diff --git a/.bazelrc b/.bazelrc index cda867ff953d5..e059fc3dab361 100644 --- a/.bazelrc +++ b/.bazelrc @@ -18,14 +18,16 @@ # 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" +build --features=external_include_paths +build --cxxopt=-Wno-private-header + +# The project requires C++ >= 17. +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 +# Protobuf and gRPC require C++17 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 +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -47,9 +49,6 @@ build --experimental_ui_max_stdouterr_bytes=-1 # in a random order to help expose undesirable interdependencies. test --test_env=GTEST_SHUFFLE --test_env=GTEST_RANDOM_SEED -# By default, build the library with OpenTelemetry -build --//:enable_opentelemetry - # Don't show warnings when building external dependencies. This still shows # warnings when using these dependencies (say in headers). build --output_filter='^//((?!(external):).)*$' @@ -70,6 +69,8 @@ build:sanitizer --strip=never build:sanitizer --copt=-Og build:sanitizer --copt=-g build:sanitizer --copt=-fno-omit-frame-pointer +#build:sanitizer --features=external_include_paths + # --config asan: Address Sanitizer build:asan --config=sanitizer @@ -102,6 +103,8 @@ build:ubsan --copt=-DCURL_STRICTER build:ubsan --linkopt=-fsanitize=undefined build:ubsan --linkopt=-fsanitize-link-c++-runtime build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 +#build:ubsan --features=external_include_paths + # --config xsan: Runs misc. sanitizers that aren't covered elsewhere. build:xsan --config=sanitizer @@ -128,3 +131,4 @@ build:msan --linkopt=-L/usr/lib/x86_64-unknown-linux-gnu # --config otel2: Open Telemetery ABI version 2 build:otel2 --cxxopt=-DOPENTELEMETRY_ABI_VERSION_NO=2 +build:otel2 --@opentelemetry-cpp//api:abi_version_no=2 diff --git a/.bazelversion b/.bazelversion index e8be68404bcb3..e7fdef7e2e635 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.6.1 +8.4.2 diff --git a/.clang-tidy b/.clang-tidy index 9dd40ccb9bb1f..2a8ade0ec8e20 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -85,6 +85,7 @@ Checks: > performance-*, portability-*, readability-*, + -bugprone-exception-escape, -google-readability-braces-around-statements, -google-readability-namespace-comments, -google-runtime-references, diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 299a8fe09bb76..5e53ed416a66a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,10 +3,10 @@ # is the same as .gitignore. # The owners for all files in the repo. -* @googleapis/cloud-cxx-owners +* @googleapis/cloud-sdk-cpp-team # These libraries are also owned by the GCS clients team. -/google/cloud/storage/ @googleapis/gcs-sdk-team @googleapis/cloud-cxx-owners -/google/cloud/storagecontrol/ @googleapis/gcs-sdk-team @googleapis/cloud-cxx-owners -/google/cloud/storageinsights/ @googleapis/gcs-sdk-team @googleapis/cloud-cxx-owners -/google/cloud/storagetransfer/ @googleapis/gcs-sdk-team @googleapis/cloud-cxx-owners +/google/cloud/storage/ @googleapis/gcs-team @googleapis/cloud-sdk-cpp-team +/google/cloud/storagecontrol/ @googleapis/gcs-team @googleapis/cloud-sdk-cpp-team +/google/cloud/storageinsights/ @googleapis/gcs-team @googleapis/cloud-sdk-cpp-team +/google/cloud/storagetransfer/ @googleapis/gcs-team @googleapis/cloud-sdk-cpp-team diff --git a/.github/renovate.json b/.github/renovate.json index de6a5eb788619..f011cce4fb499 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -7,7 +7,7 @@ "python": { "enabled": false }, - "baseBranches": ["main", "/^prepare.*v3/"], + "baseBranches": ["main"], "regexManagers": [ { "fileMatch": [ @@ -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 4a1243c5a5734..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 @@ -56,9 +56,11 @@ jobs: working-directory: "${{runner.temp}}" run: | mkdir -p vcpkg - curl -fsSL "https://github.com/microsoft/vcpkg/archive/${{ steps.vcpkg-version.outputs.version }}.tar.gz" | + curl -fsSL "https://github.com/microsoft/vcpkg/archive/${STEPS_VCPKG_VERSION_OUTPUTS_VERSION}.tar.gz" | tar -C vcpkg --strip-components=1 -zxf - vcpkg/bootstrap-vcpkg.sh -disableMetrics + env: + STEPS_VCPKG_VERSION_OUTPUTS_VERSION: ${{ steps.vcpkg-version.outputs.version }} # First compile the code using the identity with access to the build cache - run: | env VCPKG_ROOT="${{ runner.temp }}/vcpkg" ci/gha/builds/external-account.sh diff --git a/.github/workflows/macos-cmake.yml b/.github/workflows/macos-cmake.yml index a0507155c37dd..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 @@ -70,7 +70,7 @@ jobs: - uses: actions/setup-python@v5 id: py311 with: - python-version: '3.11' + python-version: '3.13' - uses: google-github-actions/setup-gcloud@v2 env: CLOUDSDK_PYTHON: ${{ steps.py311.outputs.python-path }} @@ -84,8 +84,6 @@ jobs: spanner ) core2_features=( - pubsub - pubsublite storage storage_grpc ) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 77af45ff3a7bc..986e2d993c23a 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -9,7 +9,7 @@ on: # branches we can disable builds (to speed up the testing) or add new ones, # without impacting the rest of the team. push: - branches: [ 'ci-gha**', 'prepare-for-v3.0.0' ] + branches: [ 'ci-gha**', 'main' ] # Start the build in the context of the target branch. This is considered # "safe", as the workflow files are already committed. These types of builds # have access to the secrets in the build, which we need to use the remote @@ -30,19 +30,6 @@ concurrency: cancel-in-progress: true jobs: - debug: - name: debug_job - runs-on: ubuntu-latest - steps: - - name: debug_steps - id: debug-steps - run: | - echo "event=${{ github.event_name }}" - echo "assoc=${{ github.event.pull_request.author_association }}" - echo "org=${{ github.organization }}" || true - echo "user=${{ github.event.pull_request.user }}" || true - echo "user_orgs=${{ github.event.pull_request.user.organizations_url }}" || true - pre-flight: # Save the `ref` of the pull request, so downstream jobs know what to checkout. environment: >- @@ -51,7 +38,6 @@ jobs: (github.event.pull_request.head.repo.full_name == github.repository && 'internal') }} name: Save PR ref - needs: [debug] if: >- ${{ ((github.event.pull_request.author_association == 'OWNER' || @@ -120,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-bazel.yml b/.github/workflows/windows-bazel.yml index 000bce189ce02..90e04ce16444d 100644 --- a/.github/workflows/windows-bazel.yml +++ b/.github/workflows/windows-bazel.yml @@ -70,9 +70,11 @@ jobs: # Using a short name like this avoids the problem in most cases. mkdir -p 'c:\b' || true export BAZEL_ROOT='c:\b' - export BAZEL_REMOTE_CACHE_RW_MODE=${{ inputs.bazel-cache-mode }} + export BAZEL_REMOTE_CACHE_RW_MODE=${INPUTS_BAZEL_CACHE_MODE} export EXECUTE_INTEGRATION_TESTS=${{ inputs.execute-integration-tests }} ci/gha/builds/windows-bazel.sh ${{ matrix.compilation_mode }} ${{ join(matrix.targets, ' ') }} + env: + INPUTS_BAZEL_CACHE_MODE: ${{ inputs.bazel-cache-mode }} - name: Post Build Disk Space shell: bash run: df -m diff --git a/.github/workflows/windows-cmake.yml b/.github/workflows/windows-cmake.yml index e55ae79990330..6dda386357a73 100644 --- a/.github/workflows/windows-cmake.yml +++ b/.github/workflows/windows-cmake.yml @@ -41,7 +41,7 @@ jobs: msvc: [ msvc-2022 ] build_type: [ Release ] arch: [ x64 ] - shard: [ Core1 ] + shard: [ Core1, Core2, Core3, Core4, Core5, Shard1 ] exclude: # Also skip shards (Compute and Other) that contain only generated code. - exclude-from-full-trick: ${{ ! inputs.full-matrix }} @@ -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 @@ -76,7 +76,7 @@ jobs: - uses: actions/setup-python@v5 id: py311 with: - python-version: '3.11' + python-version: '3.13' - uses: google-github-actions/setup-gcloud@v2 env: CLOUDSDK_PYTHON: ${{ steps.py311.outputs.python-path }} @@ -103,6 +103,7 @@ jobs: dataproc discoveryengine monitoring + opentelemetry retail sql dialogflow_cx @@ -209,6 +210,8 @@ jobs: universe_domain ) shard5_features=( + asset + channel video datacatalog iam @@ -269,10 +272,6 @@ jobs: skipped_features+=("${shard3_features[@]}") skipped_features+=("${shard4_features[@]}") skipped_features+=("${shard5_features[@]}") - # We use vcpkg in this build, which ships with Protobuf v21.x. - # Both `asset` and `channel` require Protobuf >= 23.x to compile on - # Windows. - skipped_features+=(asset channel) skipped="$(printf ",-%s" "${skipped_features[@]}")" echo "features=__ga_libraries__,__experimental_libraries__,${skipped:1}" >> "${GITHUB_OUTPUT}" fi @@ -300,9 +299,11 @@ jobs: run: | cd "${TEMP}" mkdir -p .build/vcpkg - curl -fsSL "https://github.com/microsoft/vcpkg/archive/${{ steps.dynamic.outputs.vcpkg-version }}.tar.gz" | + curl -fsSL "https://github.com/microsoft/vcpkg/archive/${STEPS_DYNAMIC_OUTPUTS_VCPKG_VERSION}.tar.gz" | tar -C .build/vcpkg --strip-components=1 -zxf - .build/vcpkg/bootstrap-vcpkg.sh -disableMetrics + env: + STEPS_DYNAMIC_OUTPUTS_VCPKG_VERSION: ${{ steps.dynamic.outputs.vcpkg-version }} # go/github-actions#gha-bestpractices explains why we use a SHA instead of # a named version for this runner. We could avoid using this runner with the # ideas from: @@ -316,12 +317,15 @@ jobs: shell: bash run: | export VCPKG_ROOT="${TEMP}/.build/vcpkg" - export CLOUDSDK_PYTHON="${{ steps.py311.outputs.python-path }}" + export CLOUDSDK_PYTHON="${STEPS_PY311_OUTPUTS_PYTHON_PATH}" # Put the CMake output in a directory with more space and keep it short # to avoid running into the MSVC limits. export CMAKE_OUT='c:\b' export EXECUTE_INTEGRATION_TESTS=${{ inputs.execute-integration-tests }} - ci/gha/builds/windows-cmake.sh ${{ matrix.build_type }} ${{ steps.dynamic.outputs.features }} + ci/gha/builds/windows-cmake.sh ${{ matrix.build_type }} ${STEPS_DYNAMIC_OUTPUTS_FEATURES} + env: + STEPS_PY311_OUTPUTS_PYTHON_PATH: ${{ steps.py311.outputs.python-path }} + STEPS_DYNAMIC_OUTPUTS_FEATURES: ${{ steps.dynamic.outputs.features }} - name: Post Build Disk Space shell: bash run: df -m diff --git a/.typos.toml b/.typos.toml index aba8127ea5c2a..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 @@ -62,6 +63,9 @@ extend-exclude = [ "external/googleapis.patch", # Mispelled test names in Bigtable conformance tests "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" ] [default] diff --git a/BUILD.bazel b/BUILD.bazel index c7142d44ec3ff..69b20b3e9e1d8 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -254,8 +254,3 @@ cc_library( "//google/cloud:google_cloud_cpp_universe_domain", ], ) - -bool_flag( - name = "enable_opentelemetry", - build_setting_default = False, -) diff --git a/CHANGELOG.md b/CHANGELOG.md index 188366335fb5a..e33a8f77e06f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2245 +1,92 @@ # Changelog **NOTE**: [Future Breaking Changes](/doc/deprecated.md) lists anticipated -breaking changes in the upcoming 3.x release. This release is scheduled for -2024-12 or 2025-01. +breaking changes in the upcoming 4.x release. This release is scheduled for +2027-12 or 2028-01. -## v2.47.0 - 2026-02 +**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. -### 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. - -- [Cloud API Registry](google/cloud/apiregistry/README.md) -- [Audit Manager](/google/cloud/auditmanager/README.md) -- [GKE Recommender](/google/cloud/gkerecommender/README.md) - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): define IsolationLevel enum for Spanner transactions ([#15853](https://github.com/googleapis/google-cloud-cpp/pull/15853)) - -### [Storage](/google/cloud/storage/README.md) - -- feat(storage): take async client out of experimental ([#15573](https://github.com/googleapis/google-cloud-cpp/pull/15573)) -- fix(storage): add extra validation for type in object_metadata_parser ([#15864](https://github.com/googleapis/google-cloud-cpp/pull/15864)) -- feat(storage): Update the write handle while performing appendable object upload ([#15889](https://github.com/googleapis/google-cloud-cpp/pull/15889)) -- feat(storage): add flag for enable and disable multi stream feature. ([#15893](https://github.com/googleapis/google-cloud-cpp/pull/15893)) -- fix(storage): gRPC misuse causing crashes due to concurrent writes from Flush() and Write() ([#15802](https://github.com/googleapis/google-cloud-cpp/pull/15802)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2026-01-30T21:16:31-08:00](https://github.com/googleapis/googleapis/tree/c0fcb35628690e9eb15dcefae41c651c67cd050b) - -## v2.46.0 - 2026-01 - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): enable UUID data type ([#15867](https://github.com/googleapis/google-cloud-cpp/pull/15867)) - -### [Storage](/google/cloud/storage/README.md) - -- feat(storage): Add full object checksum validation at finalization for json path ([#15815](https://github.com/googleapis/google-cloud-cpp/pull/15815)) -- feat(storage): add support for bucket encryption enforcement config ([#15844](https://github.com/googleapis/google-cloud-cpp/pull/15844)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2026-01-09T11:37:16-08:00](https://github.com/googleapis/googleapis/tree/6145b5ffe99d290c3d840136f310490d732acb04) - -## v2.45.0 - 2025-12-17 - -### 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. - -- [Cloud Maintenance API](/google/cloud/maintenance/README.md) - -### [Pubsub](google/cloud/pubsub/README.md) - -- fix(pubsub): impersonate sa credentials CompletionQueue lifetime ([#15833](https://github.com/googleapis/google-cloud-cpp/pull/15833)) - -### [Storage](google/cloud/storage/README.md) - -- fix(storage): append object spec should only be set in the first request ([#15831](https://github.com/googleapis/google-cloud-cpp/pull/15831)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2025-12-11T12:53:16-08:00](https://github.com/googleapis/googleapis/tree/05f65958eb7f2a8bc59db87ad40487f0fb093097) - -## v2.44.0 - 2025-12 - -### [BigQueryControl](google/cloud/bigquerycontrol/README.md) -- !fix(bigquerycontrol): PatchRoutine RPC has been removed. - -### [Bigtable](/google/cloud/bigtable/README.md) - -- Support for ([GoogleSQL](https://docs.cloud.google.com/bigtable/docs/googlesql-overview)) has been added to the Bigtable library. Please see the new ([bigtable::Client](https://docs.cloud.google.com/cpp/docs/reference/bigtable/latest/classgoogle_1_1cloud_1_1bigtable_1_1Client)) class for more details. - -### [Spanner](/google/cloud/spanner/README.md) - -- fix(spanner): Do not compare iterators from different containers ([#15665](https://github.com/googleapis/google-cloud-cpp/pull/15665)) - -### [Storage](/google/cloud/storage/README.md) - -- fix(storage): always use latest write handle for fast resume in gRPC BidiWriteObject ([#15795](https://github.com/googleapis/google-cloud-cpp/pull/15795)) -- feat(storage): add support for partial list bucket ([#15763](https://github.com/googleapis/google-cloud-cpp/pull/15763)) -- fix(storage): Add start appendable condition for bypassing full object checksum ([#15786](https://github.com/googleapis/google-cloud-cpp/pull/15786)) -- feat(storage): add GrpcMetricsExcludedLabelsOption for gRPC metrics label filtering ([#15735](https://github.com/googleapis/google-cloud-cpp/pull/15735)) -- fix(storage): enable fast resume for rapid object write streams by including write handle ([#15762](https://github.com/googleapis/google-cloud-cpp/pull/15762)) -- feat(storage): add configurable metrics export timeout for GCS gRPC Client ([#15629](https://github.com/googleapis/google-cloud-cpp/pull/15629)) - -### [Common Libraries](/google/cloud/README.md) - -- feat(credentials): add support for creating ComputeEngine credentials explicitly ([#15789](https://github.com/googleapis/google-cloud-cpp/pull/15789)) -- feat: Support scopes field in impersonated json ([#15675](https://github.com/googleapis/google-cloud-cpp/pull/15675)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2025-11-27T07:02:42Z](https://github.com/googleapis/googleapis/tree/8cd3749f4b98f2eeeef511c16431979aeb3a6502) - -## v2.43.0 - 2025-10 - -### [Storage](/google/cloud/storage/README.md) - -- fix(storage): fixing flushing and finalization in buffered upload of async client ([#15572](https://github.com/googleapis/google-cloud-cpp/pull/15572)) -- feat(storage): Add samples related to AppendableObject and OpenObject ([#15563](https://github.com/googleapis/google-cloud-cpp/pull/15563)) -- feat(storage): Expose Flush() in AsyncWriter ([#15555](https://github.com/googleapis/google-cloud-cpp/pull/15555)) -- fix(storage): Fix Resume() to use append_object_spec instead of write_object_spec for resumed appendable uploads ([#15558](https://github.com/googleapis/google-cloud-cpp/pull/15558)) -- fix(storage): Increase AsyncWriter default MinLwmValue to avoid frequent flushes ([#15552](https://github.com/googleapis/google-cloud-cpp/pull/15552)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2025-10-03T13:49:30-07:00](https://github.com/googleapis/googleapis/tree/2193a2bfcecb92b92aad7a4d81baa428cafd7dfd) - -## v2.42.0 - 2025-09 - -### 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. - -- [Cloud Security Compliance](/google/cloud/cloudsecuritycompliance/README.md) -- [Config Delivery API](/google/cloud/configdelivery/README.md) - -### Updated Libraries - -- [Network Connectivity](/google/cloud/networkconnectivity/README.md) - added support for DataTransferService ([#15464](https://github.com/googleapis/google-cloud-cpp/pull/15464)) - - -### [Spanner](/google/cloud/spanner/README.md) - -- perf(spanner): Use arenas to speed up queries that fetch many rows ([#15441](https://github.com/googleapis/google-cloud-cpp/pull/15441)) - -### [Storage](/google/cloud/storage/README.md) - -- feat(storage): Remove unnecessary code which was causing race condition ([#15551](https://github.com/googleapis/google-cloud-cpp/pull/15551)) -- feat(storage): Update the appendable object function to store the Object metadata ([#15422](https://github.com/googleapis/google-cloud-cpp/pull/15422)) -- feat(storage): Add generation in append_object_spec in resume operation ([#15395](https://github.com/googleapis/google-cloud-cpp/pull/15395)) - -### [Common Libraries](/google/cloud/README.md) - -- perf: Change StreamingReadRpc::Read interface to take ResponseType ([#15319](https://github.com/googleapis/google-cloud-cpp/pull/15319)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2025-09-05T15:58:06-07:00](https://github.com/googleapis/googleapis/tree/46403a9acec0719c130b33eb38b2ee62a45f9f6c) - -## v2.41.0 - 2025-08-14 - -### [Bigtable](/google/cloud/bigtable/README.md) - -- The `Bigtable::DataConnection` class has been instrumented to collect [Client Side Metrics](https://cloud.google.com/bigtable/docs/client-side-metrics), -free of charge. These metrics will be collected by -default if both the [OpenTelemetry](https://github.com/open-telemetry/opentelemetry-cpp) -and [Google Cloud Monitoring](google/cloud/monitoring/README.md) dependencies are -available. Users can opt-out by setting the `bigtable::EnableMetricsOption` to `false`. - -- The following metrics are available in Bigtable: - - AttemptLatency - - OperationLatency - - RetryCount - - FirstResponseLatency - - ServerLatency - - ApplicationBlockingLatency - - ConnectivityErrorCount - -### [Spanner](/google/cloud/spanner/README.md) - -- [Multiplexed session](https://cloud.google.com/spanner/docs/sessions#multiplexed_sessions) -support is now available. To enable Multiplexed sessions, add the -`spanner::EnableMultiplexedSessionOption` to `Options` when calling -`spanner::MakeConnection`. This enables Multiplexed sessions on all operations -read-only, read-write, and partitioned. - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2025-07-30T06:44:36-07:00](https://github.com/googleapis/googleapis/tree/f6801ce4e1df0541abb8d1e996cb36363c41fb8d) - -## v2.40.0 - 2025-08 - -### 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. - -- [License Manager API](/google/cloud/licensemanager/README.md) - -### Updated Libraries - -- [BigQuery](/google/cloud/bigquery/README.md) - added support for datapolicies/v2 -- [ManagedKafka](/google/cloud/managedkafka/README.md) - add schemaregistry to the library - -### [Bigtable](/google/cloud/bigtable/README.md) - -- We have begun instrumenting the `Bigtable::DataConnection` class to collect -several [Client Side Metrics](https://cloud.google.com/bigtable/docs/client-side-metrics), -free of charge. These metrics will be collected by -default if both the [OpenTelemetry](https://github.com/open-telemetry/opentelemetry-cpp) -and [Google Cloud Monitoring](google/cloud/monitoring/README.md) dependencies are -available. Users can opt-out by setting the `bigtable::EnableMetricsOption` to `false`. - -- The following metrics are available in Bigtable: - - AttemptLatency - - OperationLatency - - RetryCount - - FirstResponseLatency - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): add support for order_by enum ([#15240](https://github.com/googleapis/google-cloud-cpp/pull/15240)) -- feat(spanner): add support for lock_hint enum ([#15249](https://github.com/googleapis/google-cloud-cpp/pull/15249)) - -### [Storage](/google/cloud/storage/README.md) - -- feat(storage): Create OTel tracing decorator for `storage:: ParallelUploadFile()` ([#15289](https://github.com/googleapis/google-cloud-cpp/pull/15289)) -- fix(storage): Fix the bucket name not found error ([#15274](https://github.com/googleapis/google-cloud-cpp/pull/15274)) -- feat(storage): Create OTel tracing decorator for `Client::UploadFile()` ([#15245](https://github.com/googleapis/google-cloud-cpp/pull/15245)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2025-07-30T06:44:36-07:00](https://github.com/googleapis/googleapis/tree/f6801ce4e1df0541abb8d1e996cb36363c41fb8d) - -## v2.39.0 - 2025-07 - -### [Storage](/google/cloud/storage/README.md) - -- feat(storage): Link traces between Open and ReadRange traces. ([#15236](https://github.com/googleapis/google-cloud-cpp/pull/15236)) -- feat(storage): Add check for writeHandle before transforming write_object_spec to append_object_spec ([#15224])(https://github.com/googleapis/google-cloud-cpp/pull/15224)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2025-07-03T11:36:10-07:00](https://github.com/googleapis/googleapis/tree/f9d6fe4a6ad9ed89dfc315f284124d2104377940) - -## v2.38.0 - 2025-06 - -### 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. - -- [Dataform API](/google/cloud/dataform/README.md) -- [Google Cloud Managed Lustre API](/google/cloud/lustre/README.md) -- [Memorystore API](/google/cloud/memorystore/README.md) -- [Oracle Database@Google Cloud API](/google/cloud/oracledatabase/README.md) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- feat(pubsub): add MakeConnection overloads to support regional and locational endpoints ([#15190](https://github.com/googleapis/google-cloud-cpp/pull/15190)) - -### [Storage](/google/cloud/storage/README.md) - -- samples(storage): add the bucket soft delete related tags ([#15154](https://github.com/googleapis/google-cloud-cpp/pull/15154)) -- samples(storage): add samples for soft delete objects ([#15133](https://github.com/googleapis/google-cloud-cpp/pull/15133)) - -### [Common Libraries](/google/cloud/README.md) - -- feat(resourcemanager): add Connection factory function for regional endpoints ([#15189](https://github.com/googleapis/google-cloud-cpp/pull/15189)) -- samples(storagecontrol): add samples for anywhere cache ([#15134](https://github.com/googleapis/google-cloud-cpp/pull/15134)) -- fix: Bypass proxy for GCE metadata server requests - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2025-06-04T16:36:46-07:00](https://github.com/googleapis/googleapis/tree/de157ca34fa487ce248eb9130293d630b501e4ad) - -## v2.37.0 - 2025-05 - -**BREAKING CHANGES** - -Client library `resourcesettings` is being removed because the service has been turned down. - -### 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. - -- [Financial Services API](/google/cloud/financialservices/README.md) -- [Storage Batch Operations API](/google/cloud/storagebatchoperations/README.md) -- [Device Streaming API](/google/cloud/devicestreaming/README.md) -- [Chronicle API](/google/cloud/chronicle/README.md) - -### Updated Libraries - -- [iam](/google/cloud/iam/README.md) - add v3 version of the library - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): add spanner::Value support for TypeCode::INTERVAL ([#15094](https://github.com/googleapis/google-cloud-cpp/pull/15094)) -- feat(spanner): add ISO8601 duration support to spanner::Interval ([#15077](https://github.com/googleapis/google-cloud-cpp/pull/15077)) -- fix(spanner): update session bookkeeping for session NotFound ([#15009](https://github.com/googleapis/google-cloud-cpp/pull/15009)) - -### [Storage](/google/cloud/storage/README.md) - -- feat(storage): Make absl::cord constructor public in write_payload.h ([#15113](https://github.com/googleapis/google-cloud-cpp/pull/15113)) -- feat(storage): Add bidiread and bidi appendable write to the async client. ([#15078](https://github.com/googleapis/google-cloud-cpp/pull/15078)) -- fix: fix bug with customheadersoption ([#15053](https://github.com/googleapis/google-cloud-cpp/pull/15053)) - -### [Common Libraries](/google/cloud/README.md) - -- feat: add option to allow setting CURLOPT_INTERFACE ([#15044](https://github.com/googleapis/google-cloud-cpp/pull/15044)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2025-05-02T13:03:05-07:00](https://github.com/googleapis/googleapis/tree/079e5305050859d0e3a8c0768611283ee4863c07) - -## v2.36.0 - 2025-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. - -- [Parameter Manager API](/google/cloud/parametermanager/README.md) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2025-02-27T08:14:18-08:00](https://github.com/googleapis/googleapis/tree/b151ec2ae29c2c955c56784c0ce388b2d8c4a84c) - -## v2.35.0 - 2025-02 - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- docs(pubsub): Add Pub/Sub ingestion from Kafka samples ([#14954](https://github.com/googleapis/google-cloud-cpp/pull/14954)) - -### [Common Libraries](/google/cloud/README.md) - -- doc: update documentation to point to security best practice ([#14942](https://github.com/googleapis/google-cloud-cpp/pull/14942)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2025-01-28T16:10:24-08:00](https://github.com/googleapis/googleapis/tree/280725e991516d4a0f136268faf5aa6d32d21b54) - -## v2.34.0 - 2025-01 - -### [OpenTelemetry](/google/cloud/opentelemetry/README.md) - -- fix(otel): Exporter creating Monitored Resource with task_id for Cloud Run ([#14923](https://github.com/googleapis/google-cloud-cpp/pull/14923)) -- feat(otel): copy service labels into GCM Metric ([#14930](https://github.com/googleapis/google-cloud-cpp/pull/14930)) - -### [Storage](/google/cloud/storage/README.md) - -- feat(storage): add MoveObject functionality to JSON and gRPC ([#14936](https://github.com/googleapis/google-cloud-cpp/pull/14936)) - -## v2.33.0 - 2024-12 - -### [BigQuery Control](/google/cloud/bigquerycontrol/README.md) - - - Has been promoted from an `experimental` library to GA. - -### [Storage](/google/cloud/storage/README.md) - -- docs(storage): Update build instructions for gcs+grpc ([#14833](https://github.com/googleapis/google-cloud-cpp/pull/14833)) - -### [GKE Connect Gateway](/google/cloud/gkeconnect/README.md) - -- fix(gkeconnect): service only supports REST endpoint ([#14897](https://github.com/googleapis/google-cloud-cpp/pull/14897)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2024-12-13T14:53:44-08:00](https://github.com/googleapis/googleapis/tree/f4eff5440fd07389f820d22d2a55690c6390dc6d) - -## v2.32.0 - 2024-12 - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): add samples for MR CMEK ([#14674](https://github.com/googleapis/google-cloud-cpp/pull/14674)) - -### [Common Libraries](/google/cloud/README.md) - -- feat(rest): support generateIdToken in impersonation url ([#14853](https://github.com/googleapis/google-cloud-cpp/pull/14853)) -- feat(rest): support impersonated ADC ([#14815](https://github.com/googleapis/google-cloud-cpp/pull/14815)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2024-11-28T13:52:13-08:00](https://github.com/googleapis/googleapis/tree/d675ec222c431e3346ba8aaf0027392fe8b3d90c) - -## v2.31.0 - 2024-11 - -### 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. - -- [ParallelStore API](/google/cloud/parallelstore/README.md) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- docs(pubsub): Fix region tags for Pub/Sub ingestion from GCS samples ([#14773](https://github.com/googleapis/google-cloud-cpp/pull/14773)) - -### [Storage](/google/cloud/storage/README.md) - -- docs(storage): better suggestion for deprecated API ([#14786](https://github.com/googleapis/google-cloud-cpp/pull/14786)) - -### [Common Libraries](/google/cloud/README.md) - -- feat(oauth2): add support for external account workforce identity ([#14800](https://github.com/googleapis/google-cloud-cpp/pull/14800)) -- feat: API key authentication ([#14779](https://github.com/googleapis/google-cloud-cpp/pull/14779)) -- feat(mixin): generate mixins for libraries ([#14766](https://github.com/googleapis/google-cloud-cpp/pull/14766)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2024-10-31T11:22:40-07:00](https://github.com/googleapis/googleapis/tree/b7c5b60ee76c4591e32c874978c6cd8231087ed6) - -## v2.30.0 - 2024-10 - -### Updated Libraries - -- [AI Platform API](/google/cloud/aiplatform/README.md) - new - `EvaluationServiceClient` -- [Compute Engine](/google/cloud/compute/README.md) - - `FutureReservationsClient` has been removed as the service is not GA. -- [Dialogflow ES API](/google/cloud/dialogflow_es/README.md) - new - `EncryptionSpecServiceClient` and `GeneratorsClient` - -### [AI Platform API](/google/cloud/aiplatform/README.md) - -- doc(aiplatform): add Vertex AI samples ([#14703](https://github.com/googleapis/google-cloud-cpp/pull/14703)) - -### [KMS](/google/cloud/kms/README.md) - -- `AutokeyClient::ListKeyHandles(...)` signature has changed to return an - iterable type. Our telemetry indicates that there are no C++ applications - using this API, and therefore we do not consider this a breaking change. - ([#14726](https://github.com/googleapis/google-cloud-cpp/pull/14726)) - -### [OpenTelemetry](/google/cloud/opentelemetry/README.md) - -- feat(otel): release GCM exporter ([#14693](https://github.com/googleapis/google-cloud-cpp/pull/14693)) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- feat(mixin): add manual changes for pubsub and generate mixin code ([#14756](https://github.com/googleapis/google-cloud-cpp/pull/14756)) -- docs(pubsub): Add ingestion from GCS topic creation sample ([#14749](https://github.com/googleapis/google-cloud-cpp/pull/14749)) - -### [Spanner](/google/cloud/spanner/README.md) - -- docs(spanner): Add samples for backup schedule feature APIs ([#14720](https://github.com/googleapis/google-cloud-cpp/pull/14720)) -- docs(spanner): create a few code snippets as examples for using Spanner Graph using cpp ([#14660](https://github.com/googleapis/google-cloud-cpp/pull/14660)) - -### [Storage](/google/cloud/storage/README.md) - -- The gRPC plugin is now GA. The [Using the gRPC plugin][storage-grpc] - guide describes this feature in more detail. When using GCS from Google - Compute Engine (GCE) this plugin can enable higher total throughput. -- feat(storage): Add ability to restore soft deleted objects ([#14710](https://github.com/googleapis/google-cloud-cpp/pull/14710)) - -### [Common Libraries](/google/cloud/README.md) - -- fix(rest): promote buffer curl reads from to member variable ([#14732](https://github.com/googleapis/google-cloud-cpp/pull/14732)) -- fix: respect `GOOGLE_CLOUD_QUOTA_PROJECT` ([#14684](https://github.com/googleapis/google-cloud-cpp/pull/14684)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2024-09-24T10:34:24-07:00](https://github.com/googleapis/googleapis/tree/69e9dff10df4fa1e338712d38dc26b46791a6e94) - -## v2.29.0 - 2024-09 - -### 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. - -- [GKE Connect API](/google/cloud/gkeconnect/README.md) - -### [Bigtable](/google/cloud/bigtable/README.md) - -- fix(bigtable): sanitize RowRange proto input ([#14651](https://github.com/googleapis/google-cloud-cpp/pull/14651)) - -### [Compute](/google/cloud/compute/README.md) - -- feat(compute): add missing services instant_snapshots and region_instant_snapshots ([#14647](https://github.com/googleapis/google-cloud-cpp/pull/14647)) - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): support instance edition ([#14678](https://github.com/googleapis/google-cloud-cpp/pull/14678)) - -### [Common Libraries](/google/cloud/README.md) - -- fix: do not persist the keys loaded from PKCS#12 on Windows ([#14645](https://github.com/googleapis/google-cloud-cpp/pull/14645)) -- fix: no need to link gmock_main in mocks ([#14640](https://github.com/googleapis/google-cloud-cpp/pull/14640)) -- fix: quickstarts build with bazel ([#14633](https://github.com/googleapis/google-cloud-cpp/pull/14633)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2024-08-30T10:45:43-07:00](https://github.com/googleapis/googleapis/tree/6a474b31c53cc1797710206824a17b364a835d2d) - -## v2.28.0 - 2024-08 - -### [OpenTelemetry](/google/cloud/opentelemetry/README.md) - -- fix(otel): avoid infinite trace export loop ([#14612](https://github.com/googleapis/google-cloud-cpp/pull/14612)) - -### [Storage](/google/cloud/storage/README.md) - -- fix(rest): prevent libcurl callback from reading bad address ([#14615](https://github.com/googleapis/google-cloud-cpp/pull/14615)) - -### [Common Libraries](/google/cloud/README.md) - -- docs: update mock LRO tips ([#14609](https://github.com/googleapis/google-cloud-cpp/pull/14609)) - -## v2.27.0 - 2024-08 - -- We now link our mocking libraries against GoogleTest in CMake. - - The mocking libraries require GoogleTest. Not linking GoogleTest was a bug. - This bug surfaced in versions of CMake >= 3.30. - - Note that the mocking libraries are built by default. If you want to opt-out - of building or installing the mocking libraries, you can supply - `-DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF` to your CMake configure command. - - If your build fails because GoogleTest is not found, supply - `-DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF` as mentioned above. - -- We have stopped testing on CentOS 7, Debian 10 (Buster), and RockyLinux 8 as - these distros are EOL or in some form of "security only" support period. - Note that we used CentOS 7 as a proxy for testing RedHat Enterprise Linux 7. - - -### BREAKING TESTING CHANGES - -If you don't mock Long Running Operations (LRO) in your tests, then these -changes will not affect you. - -With the promotion from Experimental to GA of the new methods to support -starting Long Running Operations (LRO) synchronously and awaiting their -completion separately, the use of `ExperimentalTag` is no longer required. The -overload set for LRO methods has changed and may require matchers to -disambiguate invocations of `EXPECT_CALL` -(https://google.github.io/googletest/gmock_cook_book.html#SelectOverload). - -### 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. - -- [Developer Connect API](/google/cloud/developerconnect/README.md) -- [Privileged Access Manager API](/google/cloud/privilegedaccessmanager/README.md) - -The following experimental libraries are now available: - -- [Cloud BigQuery Control API](/google/cloud/bigquerycontrol/README.md) - -This library provides support for the Dataset, Job, Model, Project, Routine, -RowAccessPolicy, and Table REST resources. - -### [OpenTelemetry](/google/cloud/opentelemetry/README.md) - -- fix(otel): avoid crashes in tracing wrappers for streams ([#14477](https://github.com/googleapis/google-cloud-cpp/pull/14477)) - -#### Bazel - -The `--io_opentelemetry_cpp//api:with_abseil` flag was marked as deprecated in -OpenTelemetry v1.16.0. It may be removed in future versions. - -In previous versions of `opentelemetry-cpp`, this flag was required for -compatibility with Abseil. It is no longer necessary, as `opentelemetry-cpp` is -compiled with Abseil by default. - -We have stopped using the flag to validate Bazel build configurations with -OpenTelemetry tracing enabled. - -If you are building `google-cloud-cpp` with `opentelemetry-cpp` < v1.16.0, you -will need to supply the flag for compatibility with Abseil. The following can be -added to your `.bazelrc` file. - -```bash -build --@io_opentelemetry_cpp//api:with_abseil -``` - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): add samples for instance partitions ([#14574](https://github.com/googleapis/google-cloud-cpp/pull/14574)) - -### [Storage](/google/cloud/storage/README.md) - -- fix(storage): reset backoff after partial write ([#14473](https://github.com/googleapis/google-cloud-cpp/pull/14473)) -- feat(storage): single span for `ReadObject()` ([#14435](https://github.com/googleapis/google-cloud-cpp/pull/14435)) -- fix(storage): only backoff before resume attempts ([#14427](https://github.com/googleapis/google-cloud-cpp/pull/14427)) - -### [Common Libraries](/google/cloud/README.md) - -- Promoted to GA, functions to start a LRO (longrunning operation) in one - function call, and then await the LRO to complete on a separate function. -- feat(generator): include request in async streaming RPC logs ([#14565](https://github.com/googleapis/google-cloud-cpp/pull/14565)) -- fix(common): censor Bearer tokens over HTTP/2 ([#14564](https://github.com/googleapis/google-cloud-cpp/pull/14564)) -- fix(common): `json_fwd.h` is not always available ([#14439](https://github.com/googleapis/google-cloud-cpp/pull/14439)) -- fix: workaround missing SHA256 macros in MinGW-w64 ([#14437](https://github.com/googleapis/google-cloud-cpp/pull/14437)) - -## v2.26.0 - 2024-07 - -### BREAKING TESTING CHANGES - -If you don't mock Long Running Operations (LRO) in your tests, then these -changes will not affect you. - -With the addition of new methods to support starting Long Running Operations -(LRO) synchronously and awaiting their completion separately, the overload set -for the preexisting LRO methods have been expanded. Uses of `EXPECT_CALL` that -do not have matchers for the arguments will be ambiguous. To quickly remedy this -change instances of `EXPECT_CALL(*mock, Method)` to -`EXPECT_CALL(*mock, Method(::testing::_))`. - -### 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. - -- [Managed Kafka API](/google/cloud/managedkafka/README.md) - -### Updated Libraries - -- [Discovery Engine](/google/cloud/discoveryengine/README.md): - - `ControlServiceClient` added - - `GroundedGenerationServiceClient` added - - `ProjectServiceClient` added - - `RankServiceClient` added - -### [Bigtable](/google/cloud/bigtable/README.md) - -- docs(bigtable): include admin options ([#14358](https://github.com/googleapis/google-cloud-cpp/pull/14358)) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- docs(pubsub): include admin options ([#14359](https://github.com/googleapis/google-cloud-cpp/pull/14359)) - -### [Spanner](/google/cloud/spanner/README.md) - -- docs(spanner): include admin options ([#14360](https://github.com/googleapis/google-cloud-cpp/pull/14360)) - -### [Storage](/google/cloud/storage/README.md) - -- feat(storage): support object retention ([#14351](https://github.com/googleapis/google-cloud-cpp/pull/14351)) -- feat(storage): buckets with object retention ([#14350](https://github.com/googleapis/google-cloud-cpp/pull/14350)) - -### [StorageControl](/google/cloud/storagecontrol/README.md) - -- samples(storagecontrol): add storagecontrol managed folder samples ([#14356](https://github.com/googleapis/google-cloud-cpp/pull/14356)) -- samples(storagecontrol): add storagecontrol folder samples ([#14332](https://github.com/googleapis/google-cloud-cpp/pull/14332)) - -### [Common Libraries](/google/cloud/README.md) - -- New (experimental) functions to start a LRO (longrunning operation) in one - function call, and then awaiting for the LRO to complete on a separate - function. -- fix(otel): async read stream tracing ([#14393](https://github.com/googleapis/google-cloud-cpp/pull/14393)) -- fix(otel): async write stream tracing ([#14394](https://github.com/googleapis/google-cloud-cpp/pull/14394)) -- feat(otel): capture error message in traces (again) ([#14389](https://github.com/googleapis/google-cloud-cpp/pull/14389)) -- doc: document Start and Await methods and mocks ([#14375](https://github.com/googleapis/google-cloud-cpp/pull/14375)) -- fix(otel): async read write stream tracing ([#14379](https://github.com/googleapis/google-cloud-cpp/pull/14379)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2024-06-24T13:34:42-07:00](https://github.com/googleapis/googleapis/tree/622e10a1e8b2b6908e0ac7448d347a0c1b4130de) - -## v2.25.0 - 2024-06 - -### 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. - -- [Public Certificate Authority API](/google/cloud/publicca/README.md) - -### Updated Libraries - -- [KMS](/google/cloud/kms/README.md) - new `AutokeyClient` and - `AutokeyAdminClient` - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- docs(pubsub): add optimistic subscribe example ([#14272](https://github.com/googleapis/google-cloud-cpp/pull/14272)) - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): add Interval justification ([#14123](https://github.com/googleapis/google-cloud-cpp/pull/14123)) -- fix(spanner): correct use of Interval offset in Timestamp addition ([#14121](https://github.com/googleapis/google-cloud-cpp/pull/14121)) -- feat(spanner): add Interval/Timestamp/time-zone operations ([#14120](https://github.com/googleapis/google-cloud-cpp/pull/14120)) - -### [Security Center](/google/cloud/securitycenter/README.md) - -- feat(securitycenter): re-enable on windows ([#14282](https://github.com/googleapis/google-cloud-cpp/pull/14282)) - -### [Storage](/google/cloud/storage/README.md) - -- feat(storage): Respect custom endpoint for SignedUrl ([#14179](https://github.com/googleapis/google-cloud-cpp/pull/14179)) - -### [Common Libraries](/google/cloud/README.md) - -- fix(bazel): do not reference repo name ([#14287](https://github.com/googleapis/google-cloud-cpp/pull/14287)) -- fix(common): support libc++ >= 18.1 ([#14151](https://github.com/googleapis/google-cloud-cpp/pull/14151)) -- fix(common): out of range access in handle cleanup ([#14134](https://github.com/googleapis/google-cloud-cpp/pull/14134)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2024-05-22T18:51:58-07:00](https://github.com/googleapis/googleapis/tree/30717c0b0c9966906880703208a4c820411565c4) - -## v2.24.0 - 2024-05 - -### No longer testing with MSVC 2019 - -We have stopped testing with MSVC 2019. Microsoft stopped mainstream support for -MSVC 2019 in -[2024-04](https://learn.microsoft.com/en-us/lifecycle/products/visual-studio-2019). -We continue to test with MSVC 2022. We recommend that you update to this -version. Note that, in accordance with Google's -[Foundational C++ support policy][oss-cxx-support], other Google libraries -have stopped (or shortly will stop) testing with MSVC 2019 too. - -### Updated Libraries - -- [AI Platform API](/google/cloud/aiplatform/README.md) - new - `FeatureRegistryServiceClient` and `GenAiTuningServiceClient` -- [Cloud Dataplex API](/google/cloud/dataplex/README.md) - new - `DataScanServiceClient` and `DataTaxonomyServiceClient` -- [Cloud SQL Admin API](/google/cloud/sql/README.md) - several new clients: - - `SqlAvailableDatabaseVersionsServiceClient` - - `SqlEventsServiceClient` - - `SqlIamPoliciesServiceClient` - - `SqlInstanceNamesServiceClient` - - `SqlRegionsServiceClient` -- [Content Warehouse](/google/cloud/contentwarehouse/README.md) - new - `PipelineServiceClient` -- [Dataproc](/google/cloud/dataproc/README.md) - new `SessionControllerClient` - and `SessionTemplateControllerClient` -- [Dialogflow CX API](/google/cloud/dialogflow_cx/README.md) - new - `GeneratorsClient` -- [Discovery Engine](/google/cloud/discoveryengine/README.md) - several new - clients: - - `DataStoreServiceClient` - - `EngineServiceClient` - - `RecommendationServiceClient` - - `SiteSearchEngineServiceClient` -- [Network Connectivity API](/google/cloud/networkconnectivity/README.md) - new - `PolicyBasedRoutingServiceClient` -- [Retail](/google/cloud/retail/README.md) - new `AnalyticsServiceClient` - -### [Datastore](/google/cloud/datastore/README.md) - -- feat(datastore): emulator environment variable ([#14100](https://github.com/googleapis/google-cloud-cpp/pull/14100)) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- fix(pubsub): correctly trace modacks in the unary pull ([#14049](https://github.com/googleapis/google-cloud-cpp/pull/14049)) - -### [Spanner](/google/cloud/spanner/README.md) - -- fix(spanner): avoid absl types in public Interval API ([#14095](https://github.com/googleapis/google-cloud-cpp/pull/14095)) -- feat(spanner): add a representation for the Spanner INTERVAL ([#14059](https://github.com/googleapis/google-cloud-cpp/pull/14059)) -- fix(spanner): delete idle sessions upon SessionPool destruction ([#14012](https://github.com/googleapis/google-cloud-cpp/pull/14012)) - -### [Storage](/google/cloud/storage/README.md) - -- fix(storage): missing include ([#14052](https://github.com/googleapis/google-cloud-cpp/pull/14052)) - -### [Storage Control](/google/cloud/storagecontrol/README.md) - -- docs(storagecontrol): use `GetStorageLayout()` for quickstart ([#14044](https://github.com/googleapis/google-cloud-cpp/pull/14044)) -- docs(storagecontrol): update service title ([#14042](https://github.com/googleapis/google-cloud-cpp/pull/14042)) - -### [Google APIs interface definitions](https://github.com/googleapis/googleapis) - -- This release is based on definitions as of [2024-04-30T21:03:48Z](https://github.com/googleapis/googleapis/tree/5a0ae652df1ef39b7849bf2bd6ba417376ce3204) - -## v2.23.0 - 2024-04 - -### 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. - -- [App Hub API](/google/cloud/apphub/README.md) -- [Backup and DR Service API](/google/cloud/backupdr/README.md) -- [Sovereign Controls by Partners](/google/cloud/cloudcontrolspartner/README.md) -- [Cloud Storage Control API](/google/cloud/storagecontrol/README.md) is now GA. - -### Updated Libraries - -- [AI Platform API](/google/cloud/aiplatform/README.md) - new - `NotebookServiceClient` and `PersistentResourceServiceClient` -- [Cloud Dataplex API](/google/cloud/dataplex/README.md) - new - `CatalogServiceClient` -- [Network Services API](/google/cloud/networkservices/README.md) - new - `DepServiceClient` -- [SecurityCenter](/google/cloud/securitycenter/README.md) - add v2 version of the library - -### [Bigtable](/google/cloud/bigtable/README.md) - -- fix(bigtable): respect GOOGLE_CLOUD_CPP_OPENTELEMETRY_TRACING ([#13748](https://github.com/googleapis/google-cloud-cpp/pull/13748)) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- docs(pubsub): add kinesis sample ([#13593](https://github.com/googleapis/google-cloud-cpp/pull/13593)) - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): add ExcludeTransactionFromChangeStreamsOption ([#13898](https://github.com/googleapis/google-cloud-cpp/pull/13898)) -- feat(spanner): add spanner::Value support for TypeCode::FLOAT32 ([#13862](https://github.com/googleapis/google-cloud-cpp/pull/13862)) -- feat(spanner): add samples for proto columns ([#13759](https://github.com/googleapis/google-cloud-cpp/pull/13759)) -- feat(spanner): add integration tests for proto columns ([#13756](https://github.com/googleapis/google-cloud-cpp/pull/13756)) -- feat(spanner): add spanner::Value support for ProtoEnum/ProtoMessage ([#13747](https://github.com/googleapis/google-cloud-cpp/pull/13747)) -- feat(spanner): add representations for the Spanner PROTO/ENUM types ([#13743](https://github.com/googleapis/google-cloud-cpp/pull/13743)) -- feat(spanner): add sample for instance-admin managed autoscaler ([#13740](https://github.com/googleapis/google-cloud-cpp/pull/13740)) - -### [Speech](/google/cloud/speech/README.md) - -- fix(speech): enable location specific connections ([#13757](https://github.com/googleapis/google-cloud-cpp/pull/13757)) - -### [Storage](/google/cloud/storage/README.md) - -- fix(storage): preserve full Status in default creds ([#13897](https://github.com/googleapis/google-cloud-cpp/pull/13897)) -- fix(storage): respect `GOOGLE_CLOUD_CPP_OPENTELEMETRY_TRACING` ([#13766](https://github.com/googleapis/google-cloud-cpp/pull/13766)) -- feat(storage): support HNS-enabled buckets ([#13753](https://github.com/googleapis/google-cloud-cpp/pull/13753)) -- feat(storage): support soft delete timestamps ([#13728](https://github.com/googleapis/google-cloud-cpp/pull/13728)) - -### [Common Libraries](/google/cloud/README.md) - -- feat(common): introduce `FieldMaskOption` ([#13936](https://github.com/googleapis/google-cloud-cpp/pull/13936)) -- docs(common): link to system parameters page ([#13937](https://github.com/googleapis/google-cloud-cpp/pull/13937)) -- feat(common): `QuotaUserOption` for gRPC-based libs ([#13933](https://github.com/googleapis/google-cloud-cpp/pull/13933)) -- fix(common): `clang-cl` needs a `const_cast<>` ([#13891](https://github.com/googleapis/google-cloud-cpp/pull/13891)) -- fix(compute): shorten paths for Bazel+MSVC ([#13836](https://github.com/googleapis/google-cloud-cpp/pull/13836)) -- feat(common): support injecting custom headers ([#13829](https://github.com/googleapis/google-cloud-cpp/pull/13829)) - -## v2.22.0 - 2024-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. - -- [Security Center Management API](/google/cloud/securitycentermanagement/README.md) - -### [Bigtable](/google/cloud/bigtable/README.md) - -- feat: promote `EnableServerRetriesOption` ([#13698](https://github.com/googleapis/google-cloud-cpp/pull/13698)) -- feat(bigtable): install mocks library ([#13551](https://github.com/googleapis/google-cloud-cpp/pull/13551)) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- docs(pubsub): add doxygen comment to deprecate handwritten apis ([#13585](https://github.com/googleapis/google-cloud-cpp/pull/13585)) - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): add support for max commit delay ([#13562](https://github.com/googleapis/google-cloud-cpp/pull/13562)) -- feat: install mocks for `spanner`, `sql`, `pubsublite` ([#13548](https://github.com/googleapis/google-cloud-cpp/pull/13548)) - -### [Storage](/google/cloud/storage/README.md) - -- docs(GCS+gRPC): add contact info ([#13688](https://github.com/googleapis/google-cloud-cpp/pull/13688)) -- feat(storage): support listing folders as prefixes ([#13683](https://github.com/googleapis/google-cloud-cpp/pull/13683)) -- feat(storage): support soft-deleted objects ([#13644](https://github.com/googleapis/google-cloud-cpp/pull/13644)) -- feat(storage): support Bucket soft-delete metadata ([#13623](https://github.com/googleapis/google-cloud-cpp/pull/13623)) - -### [Common Libraries](/google/cloud/README.md) - -- feat: cmake option to skip building mock libraries ([#13673](https://github.com/googleapis/google-cloud-cpp/pull/13673)) -- feat(generator): support `request_id`-like fields ([#13615](https://github.com/googleapis/google-cloud-cpp/pull/13615)) -- docs(common): advertise OAuth2 library ([#13614](https://github.com/googleapis/google-cloud-cpp/pull/13614)) - -## v2.21.0 - 2024-02 - -### 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. - -- [Personalized Service Health](/google/cloud/servicehealth/README.md) - -### [Bigtable](/google/cloud/bigtable/README.md) - -- feat(bigtable): support bigtable routing cookies ([#13502](https://github.com/googleapis/google-cloud-cpp/pull/13502)) -- feat(bigtable): logging for bulk apply throttling ([#13488](https://github.com/googleapis/google-cloud-cpp/pull/13488)) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- fix(pubsub): install admin mocks ([#13537](https://github.com/googleapis/google-cloud-cpp/pull/13537)) -- feat(pubsub): add lease management for unary pull ([#13428](https://github.com/googleapis/google-cloud-cpp/pull/13428)) - -### [Storage](/google/cloud/storage/README.md) - -- feat(storage): support `UniverseDomainOption` ([#13471](https://github.com/googleapis/google-cloud-cpp/pull/13471)) -- docs(GCS+gRPC): better comments for `AsyncConnection` ([#13424](https://github.com/googleapis/google-cloud-cpp/pull/13424)) - -### [Common Libraries](/google/cloud/README.md) - -- feat: support UniverseDomainOption in gRPC IAM stub ([#13466](https://github.com/googleapis/google-cloud-cpp/pull/13466)) -- feat: simplify Bazel initialization ([#13411](https://github.com/googleapis/google-cloud-cpp/pull/13411)) - -## v2.20.0 - 2024-01 - -### 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. - -- [Cloud Quotas](/google/cloud/cloudquotas/README.md) - -### [AI Platform/Vertex AI](/google/cloud/aiplatform/README.md) - -- feat(aiplatform): add new service proto file ([#13325](https://github.com/googleapis/google-cloud-cpp/pull/13325)) - -### [Bigtable](/google/cloud/bigtable/README.md) - -- fix(bigtable): use FQDN ([#13305](https://github.com/googleapis/google-cloud-cpp/pull/13305)) - -### [OpenTelemetry](/google/cloud/opentelemetry/README.md) - -- feat(otel): capture gRPC response metadata in traces ([#13278](https://github.com/googleapis/google-cloud-cpp/pull/13278)) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- fix(pubsub): get future value before returning ([#13241](https://github.com/googleapis/google-cloud-cpp/pull/13241)) -- fix(pubsub): pass by reference explicitly ([#13220](https://github.com/googleapis/google-cloud-cpp/pull/13220)) - -### [Common Libraries](/google/cloud/README.md) - -- fix(common): returnable argument to `.then()` ([#13316](https://github.com/googleapis/google-cloud-cpp/pull/13316)) -- feat(common): read-write streaming RPCs metadata ([#13228](https://github.com/googleapis/google-cloud-cpp/pull/13228)) -- fix: respect logging format env var in `compute`, `sql` ([#13368](https://github.com/googleapis/google-cloud-cpp/pull/13368)) - -## v2.19.0 - 2023-12 - -### 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. - -- [Distributed Cloud Edge Network API](/google/cloud/edgenetwork/README.md) -- [Cloud SQL Admin API](/google/cloud/sql/README.md) -- [Telecom Network Automation API](google/cloud/telcoautomation/README.md) - -### [Bigtable](/google/cloud/bigtable/README.md) - -- feat(bigtable): throttling for AsyncBulkApply ([#13203](https://github.com/googleapis/google-cloud-cpp/pull/13203)) -- fix(bigtable): async context propagation for tracing ([#13156](https://github.com/googleapis/google-cloud-cpp/pull/13156)) -- feat(bigtable): support BulkApply throttling ([#13124](https://github.com/googleapis/google-cloud-cpp/pull/13124)) - -### [OpenTelemetry](/google/cloud/opentelemetry/README.md) - -- feat(otel): add Makefile ([#13177](https://github.com/googleapis/google-cloud-cpp/pull/13177)) -- fix(otel): detach context when single-threaded ([#13154](https://github.com/googleapis/google-cloud-cpp/pull/13154)) -- fix(otel): reconnect async traces (e.g. LROs) ([#13147](https://github.com/googleapis/google-cloud-cpp/pull/13147)) - -### [Spanner](/google/cloud/spanner/README.md) - -- feat: add PG.OID type ([#13127](https://github.com/googleapis/google-cloud-cpp/pull/13127)) -- feat(spanner): control replicas/regions used in non-transactional reads ([#13031](https://github.com/googleapis/google-cloud-cpp/pull/13031)) - -### [Vertex AI](/google/cloud/aiplatform/README.md) - -- feat(aiplatform): generate new services ([#13150](https://github.com/googleapis/google-cloud-cpp/pull/13150)) - -### [Common Libraries](/google/cloud/README.md) - -- fix(common): use FQDN for the metadata service ([#13139](https://github.com/googleapis/google-cloud-cpp/pull/13139)) -- feat(common): add GrpcCompressionAlgorithmOption ([#13108](https://github.com/googleapis/google-cloud-cpp/pull/13108)) -- doc: fix cliffhanger ([#13033](https://github.com/googleapis/google-cloud-cpp/pull/13033)) - -## v2.18.0 - 2023-11 - -### 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. - -- [Secure Source Manager](/google/cloud/securesourcemanager/README.md) - -### [Compute Engine](/google/cloud/compute/README.md) - -- fix(compute): `RegionSecurityPoliciesClient::PatchSecurityPolicy` added - `update_mask` field. - -### [Memorystore for Redis](/google/cloud/redis/README.md) - -New `CloudRedisClusterClient`. - -### [OpenTelemetry](/google/cloud/opentelemetry/README.md) - -- doc(otel): add packaging instructions - ([#13005](https://github.com/googleapis/google-cloud-cpp/pull/13005)) -- fix(otel): end async client spans properly - ([#12919](https://github.com/googleapis/google-cloud-cpp/pull/12919)) -- fix(otel): support abseil \<= 20210324 - ([#12993](https://github.com/googleapis/google-cloud-cpp/pull/12993)) -- - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): single-RPC, batched commit of mutation groups - ([#12930](https://github.com/googleapis/google-cloud-cpp/pull/12930)) - -### [Common Libraries](/google/cloud/README.md) - -- feat(common): mock for `AsyncStreamingReadWriteRpc` - ([#12950](https://github.com/googleapis/google-cloud-cpp/pull/12950)) -- fix(common): missed using `CARootsFilePathOption` - ([#12997](https://github.com/googleapis/google-cloud-cpp/pull/12997)) -- fix(generator): do not override default sleeper in streaming-read RPCs - ([#12920](https://github.com/googleapis/google-cloud-cpp/pull/12920)) - -### Other Changes - -- fix(oauth2): only enable via `GOOGLE_CLOUD_CPP_ENABLE` - ([#12911](https://github.com/googleapis/google-cloud-cpp/pull/12911)) When - compiling with CMake, the `oauth2` used to be automatically enabled if - `GOOGLE_CLOUD_CPP_REST` was manually enabled or enabled by a separate library. - That made it impossible to shard a build with separate builds for `oauth2`, - `storage` and `compute`. - -## v2.17.0 - 2023-10 - -### [Compute Engine](/google/cloud/compute/README.md) - -- fix(compute): build with Bazel and MSVC - ([#12877](https://github.com/googleapis/google-cloud-cpp/pull/12877)) -- fix(compute): usable in external Bazel projects - ([#12864](https://github.com/googleapis/google-cloud-cpp/pull/12864)) -- fix(compute): add missing bazelrc file - ([#12856](https://github.com/googleapis/google-cloud-cpp/pull/12856)) - -### [Storage](/google/cloud/storage/README.md) - -- feat(storage): another Bucket CRUD field - ([#12842](https://github.com/googleapis/google-cloud-cpp/pull/12842)) -- fix(storage): fix tellg() values - ([#12844](https://github.com/googleapis/google-cloud-cpp/pull/12844)) -- fix(storage): check ReadObject options at runtime - ([#12841](https://github.com/googleapis/google-cloud-cpp/pull/12841)) -- feat(storage): `MatchGlob` for `ListObjects()` - ([#12840](https://github.com/googleapis/google-cloud-cpp/pull/12840)) -- doc(storage): describe default project search - ([#12833](https://github.com/googleapis/google-cloud-cpp/pull/12833)) - -### [Common Libraries](/google/cloud/README.md) - -- fix(oauth2): do not require `id_token` in creds - ([#12867](https://github.com/googleapis/google-cloud-cpp/pull/12867)) - -### Other Changes - -**We have stopped testing with GCC 7.5.0 on openSUSE/Leap:** this distro uses -GCC 7.5.0 by default. This specific version of GCC crashes when compiling some -of the files generated by Protobuf 24.x. In other distros we test with GCC 7.3, -without problems. And we also test with newer versions of GCC without problems. -The exact files that cause the compiler to crash seem to change with minor -changes in Protobuf or the input `.proto` files, making it difficult to maintain -some kind of exclusion list. - -We have stopped testing with GCC 7.5.0 on openSUSE/Leap, and recommend you use -GCC >= 8 to compile `google-cloud-cpp`. If you must compile with GCC 7.5.0, -consider only enabling the libraries you will need. - -## v2.16.0 - 2023-10 - -### 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. - -- [Compute Engine](/google/cloud/compute/README.md) -- [Infrastructure Manager](/google/cloud/config/README.md) -- [NetApp](/google/cloud/netapp/README.md) - -### [Discovery Engine](/google/cloud/discoveryengine/README.md) - -New `*Client` for conversational search. - -### [OAuth2](/google/cloud/oauth2/README.md) - -- feat(oauth2): add quickstart, README, etc. - ([#12754](https://github.com/googleapis/google-cloud-cpp/pull/12754)) - -### [OpenTelemetry](/google/cloud/opentelemetry/README.md) - -We instrumented the Google Cloud C++ libraries for [distributed tracing] using -[OpenTelemetry]. All client libraries are instrumented in some capacity. - -Features to enable the collection and export of these traces are now GA. See the -[quickstart][otel-quickstart] within the library to learn more about these -tools. - -### [Policy Troubleshooter](/google/cloud/policytroubleshooter/README.md) - -Remove `PoliciesClient`. This client was placed in the wrong library. The -correct location is google/cloud/iam/v2. - -### [Storage](/google/cloud/storage/README.md) - -- fix(storage): trace auth when default credentials are assumed - ([#12672](https://github.com/googleapis/google-cloud-cpp/pull/12672)) -- docs(storage): more on InsertObject vs. WriteObject - ([#12577](https://github.com/googleapis/google-cloud-cpp/pull/12577)) - -### [Common Libraries](/google/cloud/README.md) - -- feat(common): new `*Option` to configure HTTP proxy - ([#12766](https://github.com/googleapis/google-cloud-cpp/pull/12766)) -- fix: export headers with top-level Bazel targets - ([#12762](https://github.com/googleapis/google-cloud-cpp/pull/12762)) -- fix: gRPC auth logging enabled by "auth" - ([#12702](https://github.com/googleapis/google-cloud-cpp/pull/12702)) -- fix: add implicit routing in GAPICs - ([#12544](https://github.com/googleapis/google-cloud-cpp/pull/12544)) - -### Known issues - -Compiling gRPC with Bazel and Clang >= 16 requires `--features=-layering_check` -in your Bazel command-line. For more details, see [grpc#34482]. - -## v2.15.0 - 2023-09 - -### 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. - -- [Datastore](/google/cloud/datastore/README.md) -- [Discovery Engine API](/google/cloud/discoveryengine/README.md) -- [Policy Simulator](/google/cloud/policysimulator/README.md) -- [Policy Troubleshooter](/google/cloud/policytroubleshooter/README.md) - -### Cloud IoT - -The Cloud IoT Core service has been [shutdown][cloud-iot-shutdown]. We removed -the corresponding C++ client library as it is no longer usable. - -### [BeyondCorp API](google/cloud/beyondcorp/README.md) - -Parts of the BeyondCorp API are restricted to only existing customers and will -be decommissioned. No C++ customers are affected, so we are removing the -unusable components from the C++ libraries. More information in the BeyondCorp -[announcement](https://cloud.google.com/beyondcorp-enterprise/docs/release-notes#March_31_2023). - -### [Natural Language AI](/google/cloud/language/README.md) - -We expanded the library to include the `v2` version of the API. - -### [Notebooks](/google/cloud/notebooks/README.md) - -We expanded the library to include the `v2` version of the API. - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- fix(pubsub): url encode routing params on publish - ([#12454](https://github.com/googleapis/google-cloud-cpp/pull/12454)) -- feat(pubsub): increase backoff from 1.3 to 4.0 - ([#12306](https://github.com/googleapis/google-cloud-cpp/pull/12306)) - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): enable leader aware routing by default - ([#12319](https://github.com/googleapis/google-cloud-cpp/pull/12319)) - -### [Storage](/google/cloud/storage/README.md) - -- fix(storage): tracing should decorate retries - ([#12314](https://github.com/googleapis/google-cloud-cpp/pull/12314)) - -### [Common Libraries](/google/cloud/README.md) - -- fix: URL encode explicit routing values - ([#12493](https://github.com/googleapis/google-cloud-cpp/pull/12493)) - ([#12447](https://github.com/googleapis/google-cloud-cpp/pull/12447)) -- feat(common): add `Options::set<>() &&` overload - ([#12424](https://github.com/googleapis/google-cloud-cpp/pull/12424)) -- fix(common): gRPC alarms require more locking - ([#12406](https://github.com/googleapis/google-cloud-cpp/pull/12406)) -- feat(common): retry loops preserve original message - ([#12368](https://github.com/googleapis/google-cloud-cpp/pull/12368)) -- feat(otel): control tracing with environment variable - ([#11897](https://github.com/googleapis/google-cloud-cpp/pull/11897)) -- docs(otel): troubleshoot exporter doc - ([#12345](https://github.com/googleapis/google-cloud-cpp/pull/12345)) -- docs(otel): build quickstart with vcpkg - ([#12324](https://github.com/googleapis/google-cloud-cpp/pull/12324)) -- feat(common): retry loops signal via error info - ([#12313](https://github.com/googleapis/google-cloud-cpp/pull/12313)) -- fix(common): handle expired policies in `*RetryLoop` - ([#12301](https://github.com/googleapis/google-cloud-cpp/pull/12301)) - -### Other Changes - -**Bazel Testing**: from v2.15.0 we will only test with Bazel >= 6.0.0. We do not -consider this a breaking change, as Bazel 5.x has been in maintenance mode for -more than 6 months. - -**CMake Proto Libraries**: We only compile service-specific protos if the -corresponding client library is enabled, via `-DGOOGLE_CLOUD_CPP_ENABLE=...`. - -This change reduces build times for customers who use CMake but who are not -using **all** of the client libraries listed below. - -We considered it [a bug][#8022] that customers building with CMake were forced -to compile large proto libraries that they did not need. It was certainly -[confusing][#10174]. - -Any change in behavior, including fixing bugs, can be considered "breaking". By -policy we don't consider bug fixes to be breaking changes. We applied that -policy in this case. - -The impacted libraries are: - -- `bigquery` -- `bigtable` -- `dialogflow_es` -- `iam` -- `logging` -- `pubsub` -- `speech` -- `storage` -- `texttospeech` -- `trace` - -If you are dependent on any of these proto libraries **and** you are not -compiling the corresponding client library, you will need to update your build -scripts. - -For example, if you depend on `google_cloud_cpp_speech_protos` (e.g., if you -have been using this library to make calls to Cloud Speech using raw gRPC), add -`-DGOOGLE_CLOUD_CPP_ENABLE=...,speech,...` to your CMake configure command. If -you build with `vcpkg`, include `speech` in your install command. - -Note that `google_cloud_cpp_storage_protos` are associated with the -`experimental-storage_grpc` feature, not the `storage` feature. - -## v2.14.0 - 2023-08 - -### 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. - -- [Commerce](/google/cloud/commerce/README.md) - -### [Bigtable](/google/cloud/bigtable/README.md) - -- docs(bigtable): document `DataRetryPolicy` - ([#12040](https://github.com/googleapis/google-cloud-cpp/pull/12040)) -- feat(bigtable): reverse scans - ([#12022](https://github.com/googleapis/google-cloud-cpp/pull/12022)) - -### [Channel Services](/google/cloud/channel/README.md) - -The library has been expanded to include the Reporting API. - -### [Cloud Build](/google/cloud/cloudbuild/README.md) - -- feat(cloudbuild): promote 2nd gen (repositories) API to GA - ([#12236](https://github.com/googleapis/google-cloud-cpp/pull/12236)) - -### [Cloud Functions](/google/cloud/functions/README.md) - -The library has been expanded to include the [2nd gen][functions-v2] API. - -### [Cloud Monitoring](/google/cloud/monitoring/README.md) - -The library has been expanded to include the [Snooze][monitoring-snooze] API. - -### [Cloud Run](/google/cloud/run/README.md) - -The library has been expanded to include the [Job Executions][cloud-run-jobs] -API. - -### [Compute Engine OS Config](/google/cloud/osconfig/README.md) - -The library has been expanded to include the Zonal OS Config API. - -### [Data Catalog](/google/cloud/datcatalog/README.md) - -- feat(datacatalog): promote `datalineage` to GA - ([#12271](https://github.com/googleapis/google-cloud-cpp/pull/12271)) - -### [Dataproc](/google/cloud/dataproc/README.md) - -The library has been expanded to include the [Node Groups][dataproc-node-groups] -API. - -### [Logging](/google/cloud/logging/README.md) - -The library has been expanded to include the -[Log-based Metrics][logging-metrics] API and the [Log Router][logging-config] -API. - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- docs(pubsub): add cloud storage subscription sample - ([#12088](https://github.com/googleapis/google-cloud-cpp/pull/12088)) -- docs(pubsub): add unwrapped subscription sample - ([#12090](https://github.com/googleapis/google-cloud-cpp/pull/12090)) -- docs(pubsub): add a subscriber quickstart - ([#12053](https://github.com/googleapis/google-cloud-cpp/pull/12053)) -- docs(pubsub): document `RetryPolicy` interface - ([#12030](https://github.com/googleapis/google-cloud-cpp/pull/12030)) - -### [Retail](/google/cloud/retail/README.md) - -The library has been expanded to include new services. - -### [Resource Manager](/google/cloud/resourcemanager/README.md) - -The library has been expanded to include the [Tags][resource-manager-tags] API. - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): samples for bit-reversed sequence - ([#12280](https://github.com/googleapis/google-cloud-cpp/pull/12280)) -- doc(spanner): mark obsolete Spanner options classes as deprecated - ([#12256](https://github.com/googleapis/google-cloud-cpp/pull/12256)) -- doc(spanner): Improve documentation for ActionOnExhaustion - ([#12238](https://github.com/googleapis/google-cloud-cpp/pull/12238)) -- doc(spanner): add documentation/sample for TransactionRerunPolicy - ([#12140](https://github.com/googleapis/google-cloud-cpp/pull/12140)) -- feat(spanner): tests and samples for foreign-key delete cascade - ([#12122](https://github.com/googleapis/google-cloud-cpp/pull/12122)) -- docs(spanner): document `RetryPolicy` interface - ([#12037](https://github.com/googleapis/google-cloud-cpp/pull/12037)) - -### [Speech](/google/cloud/speech/README.md) - -The library has been expanded to include the -[Model Adaptation][speech-model-adaptation] API. - -### [Storage](/google/cloud/storage/README.md) - -- docs(storage): document `RetryPolicy` interface - ([#12031](https://github.com/googleapis/google-cloud-cpp/pull/12031)) - -### [Common Libraries](/google/cloud/README.md) - -- fix(common): add missing library on Windows - ([#12103](https://github.com/googleapis/google-cloud-cpp/pull/12103)) -- fix(common): avoid run-time conflicts on Windows - ([#12105](https://github.com/googleapis/google-cloud-cpp/pull/12105)) -- feat(oauth2): new library to create oauth2 tokens - ([#12064](https://github.com/googleapis/google-cloud-cpp/pull/12064)) -- feat: support split packages - ([#12049](https://github.com/googleapis/google-cloud-cpp/pull/12049)) - -## v2.13.0 - 2023-07 - -### 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. - -- [Cloud Data Fusion](/google/cloud/datafusion/README.md) -- [Dataproc Metastore](/google/cloud/metastore/README.md) -- [Migration Center](google/cloud/migrationcenter/README.md) -- [Rapid Migration Assessment](/google/cloud/rapidmigrationassessment/README.md) -- [Secure Web Proxy](/google/cloud/networksecurity/README.md) - -### [Batch](/google/cloud/batch/README.md) - -- docs: an example to extract Cloud Batch logs - ([#11935](https://github.com/googleapis/google-cloud-cpp/pull/11935)) -- docs(batch): introduce basic snippets - ([#11915](https://github.com/googleapis/google-cloud-cpp/pull/11915)) - -### [Spanner](/google/cloud/spanner/README.md) - -- doc(spanner): add an example for CommitAtLeastOnce() - ([#11905](https://github.com/googleapis/google-cloud-cpp/pull/11905)) -- feat(spanner): implement at-least-once Commit - ([#11899](https://github.com/googleapis/google-cloud-cpp/pull/11899)) - -### [Common Libraries](/google/cloud/README.md) - -- feat(generator): separate page for retry policy overrides - ([#11950](https://github.com/googleapis/google-cloud-cpp/pull/11950)) -- fix(common): pagination must support empty pages - ([#11937](https://github.com/googleapis/google-cloud-cpp/pull/11937)) -- feat(generator): create retry policy samples - ([#11930](https://github.com/googleapis/google-cloud-cpp/pull/11930)) -- fix(common): use 64-bit API on Windows to get file sizes - ([#11906](https://github.com/googleapis/google-cloud-cpp/pull/11906)) - -## v2.12.0 - 2023-06 - -### 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. - -- [Content Warehouse](/google/cloud/contentwarehouse/README.md) -- [Cloud Domains](/google/cloud/domains/README.md) -- [Essential Contacts](/google/cloud/essentialcontacts/README.md) -- [reCAPTCHA Enterprise](/google/cloud/recaptchaenterprise/README.md) -- [Timeseries Insights](/google/cloud/timeseriesinsights/README.md) -- [Traffic Director](/google/cloud/networkservices/README.md) -- [Vertex AI](/google/cloud/aiplatform/README.md) - -### Cloud Debugger - -The Cloud Debugger service (aka Stackdriver Debugger API) has been -[shutdown][cloud-debugger-deprecated]. The corresponding client library has been -removed. - -### [BigQuery](/google/cloud/bigquery/README.md) - -This library has been expanded to include the BigLake API -([#11882](https://github.com/googleapis/google-cloud-cpp/pull/11882)) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- doc(pubsub): add new samples for schemas - ([#11872](https://github.com/googleapis/google-cloud-cpp/pull/11872)) - ([#11848](https://github.com/googleapis/google-cloud-cpp/pull/11848)) - ([#11840](https://github.com/googleapis/google-cloud-cpp/pull/11840)) - -### [Common Libraries](/google/cloud/README.md) - -- docs: use c.g.com/cpp mocking guide - ([#11869](https://github.com/googleapis/google-cloud-cpp/pull/11869)) -- docs: link reference docs at c.g.c/cpp/docs/reference - ([#11799](https://github.com/googleapis/google-cloud-cpp/pull/11799)) -- fix(generator): correct URL for reference docs - ([#11765](https://github.com/googleapis/google-cloud-cpp/pull/11765)) - -## v2.11.0 - 2023-06 - -### 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. - -- [Cloud Support API](/google/cloud/support/README.md) - -### [Bigtable](/google/cloud/bigtable/README.md) - -- docs(bigtable): async Table APIs are stable - ([#11711](https://github.com/googleapis/google-cloud-cpp/pull/11711)) -- doc(bigtable): deprecate DataClient in doxygen - ([#11550](https://github.com/googleapis/google-cloud-cpp/pull/11550)) - -### [Cloud Asset](/google/cloud/asset/README.md) - -The library has been re-enabled on Windows. See -[#11714](https://github.com/googleapis/google-cloud-cpp/issues/11714) for -details. - -### [Spanner](/google/cloud/spanner/README.md) - -- docs(spanner): some documentation tweaks - ([#11641](https://github.com/googleapis/google-cloud-cpp/pull/11641)) -- feat(spanner): tests and samples for drop-database protection - ([#11637](https://github.com/googleapis/google-cloud-cpp/pull/11637)) -- feat(spanner): make `ResultSourceInterface` public - ([#11636](https://github.com/googleapis/google-cloud-cpp/pull/11636)) - -### [Storage](/google/cloud/storage/README.md) - -- fix(storage): consistent project id overrides - ([#11754](https://github.com/googleapis/google-cloud-cpp/pull/11754)) -- feat(storage): better error messages in signed URLs - ([#11741](https://github.com/googleapis/google-cloud-cpp/pull/11741)) -- feat(storage): offer mock client without decorators - ([#11697](https://github.com/googleapis/google-cloud-cpp/pull/11697)) -- feat(storage): lazy allocation for upload buffer - ([#11633](https://github.com/googleapis/google-cloud-cpp/pull/11633)) - -### [Storage Transfer Service](/google/cloud/storagetransfer/README.md) - -The library has been re-enabled on macOS. See -[#8785](https://github.com/googleapis/google-cloud-cpp/issues/8785) for details. - -### [Common Libraries](/google/cloud/README.md) - -- feat: use full jitter exp backoff policy in the generator - ([#11748](https://github.com/googleapis/google-cloud-cpp/pull/11748)) -- feat: add new constructor for exponential backoff policy - ([#11650](https://github.com/googleapis/google-cloud-cpp/pull/11650)) -- feat: avoid development dependencies with Bazel - ([#11724](https://github.com/googleapis/google-cloud-cpp/pull/11724)) -- docs(common): better exception descriptions - ([#11705](https://github.com/googleapis/google-cloud-cpp/pull/11705)) -- fix(rest): support rewinds in libcurl - ([#11703](https://github.com/googleapis/google-cloud-cpp/pull/11703), - [#11709](https://github.com/googleapis/google-cloud-cpp/pull/11709)) -- fix: workaround curl_multi_poll returning an error on EINTR - ([#11649](https://github.com/googleapis/google-cloud-cpp/pull/11649)) -- docs(common): improve `StatusOr<>` documentation - ([#11631](https://github.com/googleapis/google-cloud-cpp/pull/11631)) -- fix: Correct exponential backoff ranges - ([#11529](https://github.com/googleapis/google-cloud-cpp/pull/11529)) -- fix: patch releases do not change the ABI - ([#11499](https://github.com/googleapis/google-cloud-cpp/pull/11499)) -- fix(rest): missing user-agent separator - ([#11473](https://github.com/googleapis/google-cloud-cpp/pull/11473)) - -## v2.10.0 - 2023-05 - -### 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. - -- [ConfidentialComputing API](/google/cloud/confidentialcomputing/README.md) -- [Storage Insights API](/google/cloud/storageinsights/README.md) -- [Workstations API](/google/cloud/workstations/README.md) - -The following experimental libraries are now available: - -- [Cloud SQL Admin API](/google/cloud/sql/README.md) +## v3.5.0 - TBD -### [Bigquery](/google/cloud/bigquery/README.md) - -- Removed bigquery/v2/model\*. There are no plans to implement gRPC endpoints - for this service. Therefore the generated code will never be usable and never - has been. - -### [Service Control](/google/cloud/servicecontrol/README.md) - -The library has been expanded to include the v2 service. - -### [Spanner](/google/cloud/spanner/README.md) - -- fix(spanner): propagate Options through SessionPool callbacks - ([#11344](https://github.com/googleapis/google-cloud-cpp/pull/11344)) - -### [Storage](/google/cloud/storage/README.md) - -- fix(storage): cache legacy credentials - ([#11271](https://github.com/googleapis/google-cloud-cpp/pull/11271)) -- fix(storage): support per-request options - ([#11445](https://github.com/googleapis/google-cloud-cpp/pull/11445)) -- fix(storage): cache all credential types - ([#11447](https://github.com/googleapis/google-cloud-cpp/pull/11447)) - -### [Common Libraries](/google/cloud/README.md) - -- doc: declutter main.dox pages - ([#11405](https://github.com/googleapis/google-cloud-cpp/pull/11405)) -- doc(common): documentation improvements - ([#11376](https://github.com/googleapis/google-cloud-cpp/pull/11376)) - -### Other Changes - -**Bazel Testing**: after v2.10.0 we will only test with Bazel >= 5.4.0. We do -not consider this a breaking change, as Bazel 4.x has been in maintenance mode -for several months. - -## v2.9.0 - 2023-04 - -### [Cloud Build](/google/cloud/cloudbuild/README.md) - -The library has been expanded to include the Cloud Build repositories (2nd gen) -API. Note that the client is tagged as experimental, because the service is -still in [preview][product-launch-stages]. - -### [Cloud Trace](/google/cloud/trace/README.md) - -The library has been expanded to include the v1 service. - -### [IAM](/google/cloud/iam/README.md) - -- fix(iam): override idempotency on idempotent POST methods - ([#11045](https://github.com/googleapis/google-cloud-cpp/pull/11045)) - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): add the final pieces for the RouteToLeaderOption - ([#11112](https://github.com/googleapis/google-cloud-cpp/pull/11112)) -- feat(spanner): support "data boost" on partitioned queries and reads - ([#10998](https://github.com/googleapis/google-cloud-cpp/pull/10998)) - -### [Storage](/google/cloud/storage/README.md) - -- feat(storage): reduce copies in `InsertObject()` - ([#11014](https://github.com/googleapis/google-cloud-cpp/pull/11014)) - -### [Common Libraries](/google/cloud/README.md) - -- feat: consume less entropy for PRNG - ([#11102](https://github.com/googleapis/google-cloud-cpp/pull/11102)) -- feat(mocks): provide access to call options in client tests - ([#11050](https://github.com/googleapis/google-cloud-cpp/pull/11050)) - -### Testing - -We have stopped testing with MSVC 2017. Microsoft stopped mainstream support for -MSVC 2017 in -[2022-04](https://learn.microsoft.com/en-us/lifecycle/products/visual-studio-2017). -We continue to test with MSVC 2022 and MSVC 2019. We recommend that you update -to one of these versions to use more recent versions of the `google-cloud-cpp` -libraries. Note that, in accordance with Google's -[Foundational C++ support policy][oss-cxx-support], the other Google libraries -have stopped (or shortly will stop) testing with MSVC 2017. - -## v2.8.0 - 2023-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. - -- [Advisory Notifications](/google/cloud/advisorynotifications/README.md) -- [Alloy DB](/google/cloud/alloydb/README.md) -- [API Keys](/google/cloud/apikeys/README.md) +## v3.4.0 - 2026-04 ### [Bigtable](/google/cloud/bigtable/README.md) -- fix(bigtable): retries for CheckConsistency / AsyncWaitForConsistency - ([#10955](https://github.com/googleapis/google-cloud-cpp/pull/10955)) -- docs(bigtable): clean up CreateTable sample - ([#10844](https://github.com/googleapis/google-cloud-cpp/pull/10844)) +- 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) -- feat(datacatalog): generate lineage library - ([#10977](https://github.com/googleapis/google-cloud-cpp/pull/10977)) - -### [KMS](/google/cloud/kms/README.md) - -The library has been expanded to include the KMS Inventory API. - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- fix(pubsub): no warnings on `ack()/nack()` success - ([#10920](https://github.com/googleapis/google-cloud-cpp/pull/10920)) -- fix(pubsub): fewer default threads for 32-bit builds - ([#10793](https://github.com/googleapis/google-cloud-cpp/pull/10793)) - -### [TPU](/google/cloud/tpu/README.md) - -The library has been expanded to include the TPU v2 API. - -### [Common Libraries](/google/cloud/README.md) - -We have introduced versioned clients for many services. The version is that of -the GCP service. While this naming convention is more verbose, it allows us to -support clients for multiple versions of a GCP service from within the same -library (e.g. `speech_v1::SpeechClient` and `speech_v2::SpeechClient`). See -[#10170] for more details. - -- fix: retries for GetIamPolicy, TestIamPermissions - ([#10957](https://github.com/googleapis/google-cloud-cpp/pull/10957)) -- doc: improve description for "terminate" group - ([#10950](https://github.com/googleapis/google-cloud-cpp/pull/10950)) -- fix(common): fewer spurious warnings in the log - ([#10811](https://github.com/googleapis/google-cloud-cpp/pull/10811)) - -## v2.7.0 - 2023-02 - -### 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. - -- [Anthos Multi-Cloud API](/google/cloud/gkemulticloud/README.md) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- Replaced the wrappers for [google.pubsub.v1.SchemaServiceClient] with - automatically generated code. Our telemetry indicates that there are no C++ - applications using this code, and therefore we do not consider this a breaking - change. - -### [Common Libraries](/google/cloud/README.md) - -- fix reference links in documentation - ([#10687](https://github.com/googleapis/google-cloud-cpp/pull/10687), - [#10684](https://github.com/googleapis/google-cloud-cpp/pull/10687)) -- fix: interface proto libraries work with older CMake - ([#10636](https://github.com/googleapis/google-cloud-cpp/pull/10636)) -- fix(common): missing Abseil deps in pkgconfig - ([#10616](https://github.com/googleapis/google-cloud-cpp/pull/10616)) -- doc: declutter generated README files - ([#10562](https://github.com/googleapis/google-cloud-cpp/pull/10562)) -- doc(common): in-depth guide for `StatusOr` - ([#10555](https://github.com/googleapis/google-cloud-cpp/pull/10555)) -- doc: remove boilerplate from landing page snippet - ([#10537](https://github.com/googleapis/google-cloud-cpp/pull/10537)) -- doc(common): use real Doxygen groups - ([#10504](https://github.com/googleapis/google-cloud-cpp/pull/10504)) -- fix(generator): correct doxygen comments - ([#10500](https://github.com/googleapis/google-cloud-cpp/pull/10500)) - -## v2.6.0 - 2023-01 - -### [BigQuery](/google/cloud/bigquery/README.md) - -The library has been expanded to include the following services: - -- [BigQuery Data Policy API](https://cloud.google.com/bigquery/docs/column-data-masking-intro) - -### [IAM](/google/cloud/iam/README.md) - -The library has been expanded to include the IAM v2 API. This API includes -support for [IAM Deny](https://cloud.google.com/iam/docs/deny-overview) -policies. - -### [Pub/Sub](/google/cloud/pubsub/README.md) +- Added Data Lineage Config Management library.([#16069](https://github.com/googleapis/google-cloud-cpp/pull/16069)) -- fix: add missing includes - ([#10421](https://github.com/googleapis/google-cloud-cpp/pull/10421)) +### [Dataplex](/google/cloud/dataplex/README.md) -### [Speech](/google/cloud/speech/README.md) - -- fix: remove duplicate protos - ([#10486](https://github.com/googleapis/google-cloud-cpp/pull/10486)) - -### [Storage](/google/cloud/storage/README.md) - -- fix(storage): better error code for CreateBucket() and 409 errors - ([#10480](https://github.com/googleapis/google-cloud-cpp/pull/10480) -- fix: add missing includes - ([#10421](https://github.com/googleapis/google-cloud-cpp/pull/10421)) -- fix(storage): scopes should disable self-signed JWTs - ([#10369](https://github.com/googleapis/google-cloud-cpp/pull/10369)) -- doc(storage): document all `oauth2` names as deprecated - ([#10352](https://github.com/googleapis/google-cloud-cpp/pull/10352)) - -### [Text-to-Speech](/google/cloud/texttospeech/README.md) - -- fix: remove duplicate protos - ([#10486](https://github.com/googleapis/google-cloud-cpp/pull/10486)) - -### [Trace](/google/cloud/trace/README.md) - -- fix: remove duplicate protos - ([#10486](https://github.com/googleapis/google-cloud-cpp/pull/10486)) - -### [Common Libraries](/google/cloud/README.md) - -- fix: add missing includes - ([#10421](https://github.com/googleapis/google-cloud-cpp/pull/10421)) -- feat(common): support external accounts - ([#10465](https://github.com/googleapis/google-cloud-cpp/pull/10465)) - ([#10430](https://github.com/googleapis/google-cloud-cpp/pull/10430)) - ([#10357](https://github.com/googleapis/google-cloud-cpp/pull/10357)) -- feat(common): options for `Make*Credentials()` - ([#10417](https://github.com/googleapis/google-cloud-cpp/pull/10417)) -- feat: support logging for unified Rest credentials - ([#10412](https://github.com/googleapis/google-cloud-cpp/pull/10412)) - -## v2.5.0 - 2022-12 - -**NOTE** - -- feat!: We have dropped the experimental marker from bidirectional streaming - APIs ([#10340](https://github.com/googleapis/google-cloud-cpp/pull/10340)). - The APIs in question are: - - `bigquery::BigQueryWriteClient::AsyncAppendRows()` - - `dialogflow_cx::SessionsClient::AsyncStreamingDetectIntent()` - - `dialogflow_es::ParticipantsClient::AsyncStreamingAnalyzeContent()` - - `dialogflow_es::SessionsClient::AsyncStreamingDetectIntent()` - - `logging::LoggingServiceV2Client::AsyncTailLogEntries()` - - `speech::SpeechClient::AsyncStreamingRecognize()` - -If you use any of these APIs, you must drop the `ExperimentalTag` in your code, -accordingly. - -### New Libraries - -We are happy to announce the following GA library. Unless specifically noted, -the APIs in these libraries are stable, and are ready for production use. - -- [Connectors API](/google/cloud/connectors/README.md) -- [VMware Engine API](/google/cloud/vmwareengine/README.md) - -### [Bigtable](/google/cloud/bigtable/README.md) - -- samples(bigtable): build admin samples with cmake - ([#10246](https://github.com/googleapis/google-cloud-cpp/pull/10246)) -- doc(bigtable): create page for configuration options - ([#10197](https://github.com/googleapis/google-cloud-cpp/pull/10197)) - -### [Logging](/google/cloud/logging/README.md) - -- feat(logging): generate `AsyncWriteLogEntries()` - ([#10194](https://github.com/googleapis/google-cloud-cpp/pull/10194)) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- feat(pubsub): add option to override subscription - ([#10327](https://github.com/googleapis/google-cloud-cpp/pull/10327)) -- feat(pubsub): blocking pulls - ([#10317](https://github.com/googleapis/google-cloud-cpp/pull/10317)) -- doc(pubsub): create page for configuration options - ([#10198](https://github.com/googleapis/google-cloud-cpp/pull/10198)) - -### [Spanner](/google/cloud/spanner/README.md) - -- doc(spanner): deprecate old MakeConnection() overloads - ([#10284](https://github.com/googleapis/google-cloud-cpp/pull/10284)) -- fix(spanner): tweak the tag name of a FGAC sample - ([#10266](https://github.com/googleapis/google-cloud-cpp/pull/10266)) -- samples(spanner): build admin samples with cmake - ([#10247](https://github.com/googleapis/google-cloud-cpp/pull/10247)) -- feat(spanner): tests and samples for DML RETURNING - ([#10233](https://github.com/googleapis/google-cloud-cpp/pull/10233)) -- doc(spanner): create page for configuration options - ([#10199](https://github.com/googleapis/google-cloud-cpp/pull/10199)) - -### [Speech](/google/cloud/speech/README.md) - -- feat(speech): generate speech v2 - ([#10228](https://github.com/googleapis/google-cloud-cpp/pull/10228)) - -### [Storage](/google/cloud/storage/README.md) - -- doc(storage): create page for configuration options - ([#10200](https://github.com/googleapis/google-cloud-cpp/pull/10200)) - -### [Common Libraries](/google/cloud/README.md) - -- doc: another pass on authentication components - ([#10300](https://github.com/googleapis/google-cloud-cpp/pull/10300)) -- fix(common): create default gRPC credentials only if needed - ([#10280](https://github.com/googleapis/google-cloud-cpp/pull/10280)) -- doc: group client functions - ([#10268](https://github.com/googleapis/google-cloud-cpp/pull/10268)) -- doc: use qualified client name in samples - ([#10241](https://github.com/googleapis/google-cloud-cpp/pull/10241)) -- fix(common): avoid globals for easier DLLs - ([#10212](https://github.com/googleapis/google-cloud-cpp/pull/10212)) -- feat: support a pre-release component of the version string - ([#10181](https://github.com/googleapis/google-cloud-cpp/pull/10181)) -- doc(common): add Doxygen group for common options - ([#10192](https://github.com/googleapis/google-cloud-cpp/pull/10192)) -- doc(common): add overview section - ([#10193](https://github.com/googleapis/google-cloud-cpp/pull/10193)) -- doc: better guidance for authentication samples - ([#10184](https://github.com/googleapis/google-cloud-cpp/pull/10184)) - -## v2.4.0 - 2022-11 - -### 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. - -- [Certificate Manager API](/google/cloud/certificatemanager/README.md) -- [Cloud Deploy API](/google/cloud/deploy/README.md) -- [Datastream API](/google/cloud/datastream/README.md) - -In addition, these existing libraries are now GA: - -- [Cloud Batch](/google/cloud/batch/README.md) - -### [BigQuery](/google/cloud/bigquery/README.md) - -- doc: add endpoint override snippets to generated libs - ([#10129](https://github.com/googleapis/google-cloud-cpp/pull/10129)) -- feat(bigquery): add migration service - ([#10034](https://github.com/googleapis/google-cloud-cpp/pull/10034)) - -### [Bigtable](/google/cloud/bigtable/README.md) - -- doc(bigtable): add `*Client` samples - ([#10149](https://github.com/googleapis/google-cloud-cpp/pull/10149)) -- feat(bigtable): support `GOOGLE_CLOUD_ENABLE_DIRECT_PATH` - ([#9978](https://github.com/googleapis/google-cloud-cpp/pull/9978)) - -### [IAM](/google/cloud/iam/README.md) - -- doc: add endpoint override snippets to generated libs - ([#10129](https://github.com/googleapis/google-cloud-cpp/pull/10129)) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- doc(pubsub): samples for endpoint and auth - ([#10136](https://github.com/googleapis/google-cloud-cpp/pull/10136)) -- feat(pubsub): install pubsub_mocks pkg - ([#10008](https://github.com/googleapis/google-cloud-cpp/pull/10008)) -- feat(pubsub): implement blocking publisher - ([#10055](https://github.com/googleapis/google-cloud-cpp/pull/10055)) -- feat(pubsub): implement per-call options for `Subscriber` - ([#10043](https://github.com/googleapis/google-cloud-cpp/pull/10043)) -- fix(pubsub): limit `ModifyAckDeadlineRequest` size - ([#10032](https://github.com/googleapis/google-cloud-cpp/pull/10032)) -- fix(pubsub): faster shutdowns for `Publisher` - ([#9991](https://github.com/googleapis/google-cloud-cpp/pull/9991)) - -### [Spanner](/google/cloud/spanner/README.md) - -- doc(spanner): add `*Client` samples - ([#10145](https://github.com/googleapis/google-cloud-cpp/pull/10145)) -- feat(spanner): add support for RowStream::RowsModified() - ([#10102](https://github.com/googleapis/google-cloud-cpp/pull/10102)) -- feat(spanner): support for the PG.JSONB data type - ([#10098](https://github.com/googleapis/google-cloud-cpp/pull/10098)) - -### [Storage](/google/cloud/storage/README.md) - -- doc(storage): common initialization examples - ([#10107](https://github.com/googleapis/google-cloud-cpp/pull/10107)) -- fix(rest): too many debug headers - ([#10054](https://github.com/googleapis/google-cloud-cpp/pull/10054)) -- fix(rest): return complete payloads for errors - ([#10051](https://github.com/googleapis/google-cloud-cpp/pull/10051)) -- feat(storage): support `Autoclass` feature - ([#10003](https://github.com/googleapis/google-cloud-cpp/pull/10003)) -- feat(storage): faster `InsertObject()` uploads - ([#9997](https://github.com/googleapis/google-cloud-cpp/pull/9997)) -- fix(storage): respect MIME message boundary size limits - ([#9965](https://github.com/googleapis/google-cloud-cpp/pull/9965)) - -### [Common Libraries](/google/cloud/README.md) - -- feat(generator): generate authentication example - ([#10138](https://github.com/googleapis/google-cloud-cpp/pull/10138)) -- doc: workaround Doxygen formatting quirk - ([#10137](https://github.com/googleapis/google-cloud-cpp/pull/10137)) -- doc: add endpoint override snippets to generated libs - ([#10129](https://github.com/googleapis/google-cloud-cpp/pull/10129)) -- feat(generator): generate simple samples for `*Client` - ([#10118](https://github.com/googleapis/google-cloud-cpp/pull/10118)) -- feat: add mock library w/ StreamRange - ([#9998](https://github.com/googleapis/google-cloud-cpp/pull/9998)) -- doc(common): make authentication docs easier to find - ([#10110](https://github.com/googleapis/google-cloud-cpp/pull/10110)) -- fix: configure context in async retries - ([#10100](https://github.com/googleapis/google-cloud-cpp/pull/10100)) -- doc: document when GrpcNumChannelsOption applies - ([#10000](https://github.com/googleapis/google-cloud-cpp/pull/10000)) -- feat(generator): make idempotency policy non-abstract - ([#9981](https://github.com/googleapis/google-cloud-cpp/pull/9981)) -- fix(common): preserve `ErrorInfo` on retry errors - ([#9971](https://github.com/googleapis/google-cloud-cpp/pull/9971)) - -## v2.3.0 - 2022-10 - -### 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. - -- [Distributed Cloud Edge Container API](/google/cloud/edgecontainer/README.md) -- [Network Connectivity API](/google/cloud/networkconnectivity/README.md) - -### [BigQuery](/google/cloud/bigquery/README.md) - -The library has been expanded to include [Analytics Hub][bq-analytics-hub], an -API that facilitates data sharing within and across organizations. -([#9882](https://github.com/googleapis/google-cloud-cpp/pull/9882)) +- 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) -- fix(spanner): remove session from pool upon "not found" refresh failure - ([#9954](https://github.com/googleapis/google-cloud-cpp/pull/9954)) -- feat(spanner): add support for Customer Managed Multi-Region (CMMR) read-only - replicas at instance creation time - ([#9872](https://github.com/googleapis/google-cloud-cpp/pull/9872)) +- 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): easier mocks for `HmacKeyMetadata` - ([#9949](https://github.com/googleapis/google-cloud-cpp/pull/9949)) -- feat(storage): easier mocks for `*AccessControl` - ([#9910](https://github.com/googleapis/google-cloud-cpp/pull/9910)) -- feat(storage): easier mocks with `ObjectMetadata` - ([#9899](https://github.com/googleapis/google-cloud-cpp/pull/9899)) -- fix(storage): decay type before testing supported-options membership - ([#9893](https://github.com/googleapis/google-cloud-cpp/pull/9893)) -- feat(storage): easier mocks with `BucketMetadata` - ([#9886](https://github.com/googleapis/google-cloud-cpp/pull/9886)) -- fix(storage): error message for resumable uploads - ([#9855](https://github.com/googleapis/google-cloud-cpp/pull/9855)) -- feat(storage): release `*StallMinimumThroughputOption` - ([#9813](https://github.com/googleapis/google-cloud-cpp/pull/9813)) -- fix(storage): no workaround needed with libc++ and MSVC - ([#9768](https://github.com/googleapis/google-cloud-cpp/pull/9768)) +- feat(storage): add IsOpen API for zonal read operation ([#16063](https://github.com/googleapis/google-cloud-cpp/pull/16063)) -### [Common Libraries](/google/cloud/README.md) +### [Google APIs interface definitions](https://github.com/googleapis/googleapis) -- fix(common): better defaults for curl initialization - ([#9798](https://github.com/googleapis/google-cloud-cpp/pull/9798)) +- This release is based on definitions as of [2026-04-02T09:44:56-07:00](https://github.com/googleapis/googleapis/tree/c8ca5bce5cbabac76b8619bd8d63ac10bb0561a9) -## v2.2.0 - 2022-09 +## v3.3.0 - 2026-03 ### New Libraries -We are introducing new client libraries for GCP services. While we do not -anticipate any API changes to these libraries before declaring them GA, we are -releasing them early in case they elicit some feedback that requires changes. - -- [API Keys](/google/cloud/apikeys/README.md) - 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. -
- Expand to see the full list of new GA libraries... -
- -- [Bare Metal Solution](/google/cloud/baremetalsolution/README.md) -- [Beyond Corp](/google/cloud/beyondcorp/README.md) -- [Optimization AI](/google/cloud/optimization/README.md) -- [Cloud Run](/google/cloud/run/README.md) -- [Video Services](/google/cloud/video/README.md) - -
- -### [Bigtable](/google/cloud/bigtable/README.md) - -- fix(bigtable): `DataConnection` refreshes channels - ([#9718](https://github.com/googleapis/google-cloud-cpp/pull/9718)) -- fix(bigtable): Use retry policy on all streams with failing mutations - ([#9706](https://github.com/googleapis/google-cloud-cpp/pull/9706)) -- feat(bigtable): per-operation Options - ([#9627](https://github.com/googleapis/google-cloud-cpp/pull/9627)) - ([#9623](https://github.com/googleapis/google-cloud-cpp/pull/9623)) - -### [Dataproc](/google/cloud/dataproc/README.md) - -- feat(dataproc): mark the dataproc services as location dependent - ([#9722](https://github.com/googleapis/google-cloud-cpp/pull/9722)) - -### [Spanner](/google/cloud/spanner/README.md) - -- feat(spanner): fine-grained access control - ([#9669](https://github.com/googleapis/google-cloud-cpp/pull/9669)) -- feat(spanner): equality for copyable classes - ([#9648](https://github.com/googleapis/google-cloud-cpp/pull/9648)) +- [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) -- We have a new implementation for HTTP requests. This new implementation - provides comparable download performance, and improves some uploads. See - [#9659] for details. We have rigorously tested this new implementation. In the - unlikely event that this new implementation breaks your application, we have - included an environment variable to revert to the legacy implementation. Set - `GOOGLE_CLOUD_CPP_STORAGE_USE_LEGACY_HTTP` to any value to use the legacy - implementation. We are planning to remove the legacy code and the - `GOOGLE_CLOUD_CPP_STORAGE_USE_LEGACY_HTTP` environment variable by 2022-12. -- feat(storage): improve error messages on stalled uploads - ([#9744](https://github.com/googleapis/google-cloud-cpp/pull/9744)) -- feat(storage): equality for Native IAM types - ([#9649](https://github.com/googleapis/google-cloud-cpp/pull/9649)) -- feat(storage): SA credentials default to self-signed JWTs - ([#9629](https://github.com/googleapis/google-cloud-cpp/pull/9629)) - -### [Common Libraries](/google/cloud/README.md) - -- feat: group GUAC `Options` in an `OptionsList` - ([#9643](https://github.com/googleapis/google-cloud-cpp/pull/9643)) -- fix(rest): cache credentials - ([#9620](https://github.com/googleapis/google-cloud-cpp/pull/9620)) -- doc: add table of contents to landing page - ([#9671](https://github.com/googleapis/google-cloud-cpp/pull/9671)) - -## v2.1.0 - 2022-08 - -### New Libraries - -We are introducing new client libraries for GCP services. While we do not -anticipate any API changes to these libraries before declaring them GA, we are -releasing them early in case they elicit some feedback that requires changes. - -- [Batch](/google/cloud/batch/README.md) - ([#9474](https://github.com/googleapis/google-cloud-cpp/pull/9474)) -- [Beyond Corp](/google/cloud/beyondcorp/README.md) - ([#9555](https://github.com/googleapis/google-cloud-cpp/pull/9555)) -- [Cloud Run](/google/cloud/run/README.md) - ([#9460](https://github.com/googleapis/google-cloud-cpp/pull/9460)) - -### [Assured Workloads](/google/cloud/assuredworkloads/README.md) - -- fix(assuredworkloads): reenable on windows - ([#9467](https://github.com/googleapis/google-cloud-cpp/pull/9467)) - -### [Bigtable](/google/cloud/bigtable/README.md) - -- fix(bigtable): the mocks library is no longer header-only - ([#9568](https://github.com/googleapis/google-cloud-cpp/pull/9568)) +- feat(storage): Get/Insert/Update/Patch Object contexts ([#15933](https://github.com/googleapis/google-cloud-cpp/pull/15933)) -### [Cloud Asset](/google/cloud/asset/README.md) - -- fix(asset): reenable on macOS - ([#9468](https://github.com/googleapis/google-cloud-cpp/pull/9468)) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- fix(pubsub): missing subscription name in lease extensions - ([#9523](https://github.com/googleapis/google-cloud-cpp/pull/9523)) -- feat(pubsub): exactly-once delivery - ([#9436](https://github.com/googleapis/google-cloud-cpp/pull/9436)) - -### [Spanner](/google/cloud/spanner/README.md) +### [Google APIs interface definitions](https://github.com/googleapis/googleapis) -- fix(spanner): avoid evaluation-order issue in function arguments - ([#9452](https://github.com/googleapis/google-cloud-cpp/pull/9452)) +- This release is based on definitions as of [2026-02-23T01:04:53-08:00](https://github.com/googleapis/googleapis/tree/edfe7983b9d99d6244b4d7636d25fa6e752a2041) -### [Stackdriver Debugger](/google/cloud/debugger/README.md) +## v3.2.0 - 2026-02 -- doc(debugger): announce deprecation - ([#9552](https://github.com/googleapis/google-cloud-cpp/pull/9552)) +### [Cloud Key Management Service](/google/cloud/kms/README.md) -### [Storage](/google/cloud/storage/README.md) +- feat: Added DeleteCryptoKey and DeleteCryptoKeyVersion RPCs to permanently remove resources. +- feat: Introduced the RetiredResource resource to track records of deleted keys and prevent the reuse of their resource names. +- feat: Added ListRetiredResources and GetRetiredResource RPCs to manage and view these records. -- feat(storage): experimental options to tune stall timeouts - ([#9593](https://github.com/googleapis/google-cloud-cpp/pull/9593)) -- feat(storage): add debugging headers to `ObjectWriteStream` - ([#9580](https://github.com/googleapis/google-cloud-cpp/pull/9580)) -- fix(storage): no char for `std::uniform_int_distribution` - ([#9509](https://github.com/googleapis/google-cloud-cpp/pull/9509)) -- feat(storage): support Bucket custom placement config - ([#9481](https://github.com/googleapis/google-cloud-cpp/pull/9481)) +## v3.1.0 - 2026-02 -### [Common Libraries](/google/cloud/README.md) +### Default Retry Policy Changes -- feat(common): make the RPC log even more readable - ([#9561](https://github.com/googleapis/google-cloud-cpp/pull/9561)) -- feat: improve error messages for access token errors - ([#9485](https://github.com/googleapis/google-cloud-cpp/pull/9485)) -- feat(common): make the RPC log even more readable - ([#9477](https://github.com/googleapis/google-cloud-cpp/pull/9477)) +All libraries except Bigtable, PubSub, Spanner, and Storage have had their +default maximum retry policy duration reduced from 30 minutes to 10 minutes. -## v2.0.0 - 2022-07 +## v3.0.0 - 2026-02 **BREAKING CHANGES** -As previously announced, `google-cloud-cpp` now requires C++ >= 14. This is -motivated by similar changes in our dependencies, and because C++ 14 has been +As previously announced, `google-cloud-cpp` now requires C++ >= 17. This is +motivated by similar changes in our dependencies, and because C++ 17 has been the default C++ version in all the compilers we support for several years. We think this change is large enough that deserves a major version bump to -signal the new requirements. - -If you are already using C++ >= 14 you need to make no changes. If you are using -C++11: please consider updating as soon as possible. To ease your transition to -C++ >= 14 we will, if requested, backport critical fixes to v1.42.0 until -2023-07-01. After 2023-07-01 we will drop all support to v1.42.0 and earlier -versions. - -**Debian 9 (Stretch) is EOL** - -Debian 9 (Stretch) reached EOL on 2022-06-30. Therefore, we have stopped testing -or supporting this distribution. This was the last distribution we supported -that required GCC \< 7.3, and/or CMake \< 3.10. Starting with this release we -require CMake >= 3.10, and only test with GCC >= 7.3. - -**OTHER CHANGES** - -### [Bigtable](/google/cloud/bigtable/README.md) - -We introduced a [new constructor][modern-table-ctor] for `Table` which accepts a -`DataConnection` instead of a `DataClient`. The `DataConnection` is a new -interface that more closely matches the client surface of `Table`. Read more -about `*Connection` classes in our -[Architecture Design][architecture-connection] document. - -#### What are the benefits of `DataConnection`? - -The new API greatly simplifies mocking. Every `Table::Foo(..)` call has an -associated `DataConnection::Foo(...)` call. This allows you to set expectations -on the exact values returned by the client call. See -[Mocking the Cloud Bigtable C++ Client][howto-mock-data-api] for a complete -example on how to mock the behavior of `Table` with -`bigtable_mocks::MockDataConnection`. - -The new `DataConnection` API offers more consistency across our libraries. It -also enables the use of some common library features, such as our -[`UnifiedCredentialsOption`][guac-dox]. Also, any new features will be added to -the `DataConnection` API first. - -#### Do I need to update my code? - -No. If the benefits are not appealing enough, you do not need to update your -code. All code that currently uses `DataClient` will continue to function as -before. This includes uses of `testing::MockDataClient`. - -However, if you are using `testing::MockDataClient` to mock the behavior of -`Table` in your tests: - -1. Be aware that we have announced our intention to remove classes derived from - `DataClient` on or around 2023-05. Your tests will break then. -1. Please consider using `bigtable_mocks::MockDataConnection`. It will greatly - simplify your tests. - -#### How do I update existing `DataClient` code? - -See [Migrating from `DataClient` to `DataConnection`][cbt-dataclient-migration]. - -- doc(bigtable): how to mock the Data API - ([#9415](https://github.com/googleapis/google-cloud-cpp/pull/9415)) -- feat(bigtable): modern `Table` constructor - ([#9403](https://github.com/googleapis/google-cloud-cpp/pull/9403)) -- feat(generator): support explicit routing headers - ([#9368](https://github.com/googleapis/google-cloud-cpp/pull/9368)) -- fix(bigtable)!: pass app profile id to connection as options - ([#9388](https://github.com/googleapis/google-cloud-cpp/pull/9388)) -- feat(bigtable): add `AppProfileIdOption` - ([#9382](https://github.com/googleapis/google-cloud-cpp/pull/9382)) -- feat(bigtable): table resource name as a class - ([#9377](https://github.com/googleapis/google-cloud-cpp/pull/9377)) -- feat(bigtable): instance name as a class - ([#9374](https://github.com/googleapis/google-cloud-cpp/pull/9374)) -- feat(bigtable): introduce `MockDataConnection` and `MakeTestRowReader` - ([#9335](https://github.com/googleapis/google-cloud-cpp/pull/9335)) -- feat(bigtable): introduce `DataConnection` - ([#9323](https://github.com/googleapis/google-cloud-cpp/pull/9323)) -- feat(bigtable): modern Data API policy options - ([#9320](https://github.com/googleapis/google-cloud-cpp/pull/9320)) - -### [Pub/Sub](/google/cloud/pubsub/README.md) - -- doc(pubsub): improve documentation for `*AckHandler` - ([#9404](https://github.com/googleapis/google-cloud-cpp/pull/9404)) -- feat(pubsub): update subscription builders - ([#9326](https://github.com/googleapis/google-cloud-cpp/pull/9326)) - -### [Common Libraries](/google/cloud/README.md) - -- fix(generator): handle explicit routing params for nested fields - ([#9408](https://github.com/googleapis/google-cloud-cpp/pull/9408)) -- feat(common): truncation support for plain strings in the RPC log - ([#9351](https://github.com/googleapis/google-cloud-cpp/pull/9351)) - -### New Libraries - -We are introducing a new client library. While we do not anticipate any API -changes to this library before declaring it GA, we are releasing it early in -case it elicits some feedback that requires changes. - -- [Video Services](/google/cloud/video/README.md) +signal the new requirements. Additionally, we have decommissioned previously +deprecated API features and have also made some previously optional dependencies +required. -[#10170]: https://github.com/googleapis/google-cloud-cpp/issues/10170 -[#10174]: https://github.com/googleapis/google-cloud-cpp/discussions/10174 -[#8022]: https://github.com/googleapis/google-cloud-cpp/issues/8022 -[#9659]: https://github.com/googleapis/google-cloud-cpp/issues/9659 -[architecture-connection]: /ARCHITECTURE.md#the-connection-classes -[bq-analytics-hub]: https://cloud.google.com/bigquery/docs/analytics-hub-introduction -[cbt-dataclient-migration]: https://cloud.google.com/cpp/docs/reference/bigtable/latest/migrating-from-dataclient -[cloud-debugger-deprecated]: https://cloud.google.com/debugger/docs/deprecations -[cloud-iot-shutdown]: https://cloud.google.com/iot/docs/release-notes#August_16_2022 -[cloud-run-jobs]: https://cloud.google.com/run/docs/managing/job-executions -[dataproc-node-groups]: https://cloud.google.com/dataproc/docs/guides/node-groups/dataproc-driver-node-groups -[distributed tracing]: https://opentelemetry.io/docs/concepts/observability-primer/#distributed-traces -[functions-v2]: https://cloud.google.com/functions/docs/concepts/version-comparison -[google.pubsub.v1.schemaserviceclient]: https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#google.pubsub.v1.SchemaService -[grpc#34482]: https://github.com/grpc/grpc/issues/34482 -[guac-dox]: https://cloud.google.com/cpp/docs/reference/common/latest/group__guac -[howto-mock-data-api]: https://cloud.google.com/cpp/docs/reference/bigtable/latest/bigtable-mocking -[logging-config]: https://cloud.google.com/logging/docs/routing/overview -[logging-metrics]: https://cloud.google.com/logging/docs/logs-based-metrics -[modern-table-ctor]: https://github.com/googleapis/google-cloud-cpp/blob/62740c8e9180056db77d4dd3e80a6fa7ae71295a/google/cloud/bigtable/table.h#L182-L214 -[monitoring-snooze]: https://cloud.google.com/monitoring/alerts/snooze -[opentelemetry]: https://opentelemetry.io/ -[oss-cxx-support]: https://opensource.google/documentation/policies/cplusplus-support -[otel-quickstart]: https://github.com/googleapis/google-cloud-cpp/blob/main/google/cloud/opentelemetry/quickstart -[product-launch-stages]: https://cloud.google.com/products/#product-launch-stages -[resource-manager-tags]: https://cloud.google.com/resource-manager/docs/tags/tags-overview -[speech-model-adaptation]: https://cloud.google.com/speech-to-text/docs/adaptation-model -[storage-grpc]: https://cloud.google.com/cpp/docs/reference/storage/latest/storage-grpc +**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. diff --git a/CMakeLists.txt b/CMakeLists.txt index db55e077e8a72..7ce073fe9de0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,16 +14,16 @@ # limitations under the License. # ~~~ -cmake_minimum_required(VERSION 3.13...3.24) +cmake_minimum_required(VERSION 3.22...3.31) # Define the project name and where to report bugs. set(PACKAGE_BUGREPORT "https://github.com/googleapis/google-cloud-cpp/issues") project( google-cloud-cpp - VERSION 2.47.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}") @@ -54,20 +54,12 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") " We will consider patches for older versions.") endif () elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.0.0) message( WARNING - "The `google-cloud-cpp` library is tested with Clang >= 6.0." + "The `google-cloud-cpp` library is tested with Clang >= 14.0.0." " We will consider patches for older versions.") endif () -elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") - if (CMAKE_VERSION VERSION_LESS 3.15) - message( - FATAL_ERROR - "MSVC builds require CMake >= 3.15." - " Previous versions of CMake lack a standard mechanism to" - " select the runtime C++ library.") - endif () endif () list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) @@ -97,6 +89,10 @@ if (APPLE " cmake -DGOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK=OFF ...") endif () +if (WIN32) + add_definitions(-DNOMINMAX) +endif () + # If ccache is installed use it for the build. option(GOOGLE_CLOUD_CPP_ENABLE_CCACHE "Automatically use ccache if available" OFF) diff --git a/MODULE.bazel b/MODULE.bazel index 9d839d12a55d1..e97143bc316a4 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -16,35 +16,35 @@ module( name = "google_cloud_cpp", - version = "2.47.0", # Updated by CMake - compatibility_level = 2, # 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 = "rules_cc", version = "0.1.4") -bazel_dep(name = "abseil-cpp", version = "20240722.1", repo_name = "com_google_absl") -bazel_dep(name = "protobuf", version = "29.4", repo_name = "com_google_protobuf") -bazel_dep(name = "boringssl", version = "0.0.0-20230215-5c22014") -bazel_dep(name = "grpc", version = "1.69.0", repo_name = "com_github_grpc_grpc") -bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "com_github_nlohmann_json") -bazel_dep(name = "curl", version = "8.8.0.bcr.3", repo_name = "com_github_curl_curl") -bazel_dep(name = "crc32c", version = "1.1.0", repo_name = "com_github_google_crc32c") -bazel_dep(name = "opentelemetry-cpp", version = "1.19.0", repo_name = "io_opentelemetry_cpp") +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.2") + +# For backwards compatibility with WORKSPACE. +# The name "com_google_protobuf" is internally used by @bazel_tools, +# a native repository we cannot override. +# See https://github.com/googleapis/google-cloud-cpp/issues/15393 +bazel_dep(name = "protobuf", version = "33.1", repo_name = "com_google_protobuf") +bazel_dep(name = "boringssl", version = "0.20251124.0") +bazel_dep(name = "nlohmann_json", version = "3.12.0.bcr.1") +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.3") +bazel_dep(name = "googletest", version = "1.17.0.bcr.2") -bazel_dep(name = "googletest", version = "1.15.2", dev_dependency = True, repo_name = "com_google_googletest") -bazel_dep(name = "google_benchmark", version = "1.9.2", 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") -# Our `curl.BUILD` file uses these. -bazel_dep(name = "zlib", version = "1.3.1.bcr.7") -bazel_dep(name = "c-ares", version = "1.19.1.bcr.1", repo_name = "com_github_cares_cares") - # Pin this to fix a break in bazel/deps-cache.py -bazel_dep(name = "protoc-gen-validate", version = "1.2.1.bcr.1", dev_dependency = True, repo_name = "com_envoyproxy_protoc_gen_validate") +bazel_dep(name = "protoc-gen-validate", version = "1.2.1.bcr.2", dev_dependency = True, repo_name = "com_envoyproxy_protoc_gen_validate") python = use_extension("@rules_python//python/extensions:python.bzl", "python") python.toolchain( @@ -52,21 +52,7 @@ python.toolchain( python_version = "3.11", ) -bazel_dep(name = "googleapis", version = "0.0.0", repo_name = "com_google_googleapis") -archive_override( - module_name = "googleapis", - integrity = "sha256-aMghCWZ8iStllThbKtd8E0J1L5mGZOttBVUJ7K3cMVA=", - patch_strip = 1, - patches = ["//bazel:googleapis.modules.patch"], - strip_prefix = "googleapis-c0fcb35628690e9eb15dcefae41c651c67cd050b", - urls = [ - "https://github.com/googleapis/googleapis/archive/c0fcb35628690e9eb15dcefae41c651c67cd050b.tar.gz", - ], -) - -switched_rules = use_extension("@com_google_googleapis//:extensions.bzl", "switched_rules") -switched_rules.use_languages( - cc = True, - grpc = True, -) -use_repo(switched_rules, "com_google_googleapis_imports") +bazel_dep(name = "grpc", version = "1.76.0.bcr.1") +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 015c9d3bbca35..1a100f46ea188 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,9 @@ This repository contains idiomatic C++ client libraries for the following [Google Cloud Platform](https://cloud.google.com/) services. +> 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. + > Please check the [CHANGELOG] for important announcements and upcoming changes. ## Quickstart @@ -173,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) @@ -311,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) @@ -527,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) @@ -536,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) @@ -554,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) @@ -583,8 +601,8 @@ run the examples included with the libraries. ### Building with Bazel -This library requires Bazel >= 6.0. From the top-level directory, run the usual -commands. +This library requires Bazel >= 7.0. We recommend using Bazel modules instead of +WORKSPACE files. From the top-level directory, run the usual commands. ```shell bazel build //... @@ -592,7 +610,7 @@ bazel build //... ### Building with CMake -This library requires CMake >= 3.10. If you are planning to install the +This library requires CMake >= 3.22. If you are planning to install the libraries please consult the [packaging guide](/doc/packaging.md), these instructions will **NOT** produce artifacts that you can put in `/usr/local`, or share with your colleagues. @@ -613,11 +631,11 @@ The binary artifacts, such as examples, will be placed in `cmake-out/`. - This project follows Google's [Foundational C++ Support Policy][support-policy], which is summarized in the [Foundational C++ Support Matrix][support-matrix]. - - Language Version (>= C++14). + - Language Version (>= C++17). - Operating Systems: Windows, macOS, and Linux. - - Build Systems: Bazel (>= 6.0), CMake (>= 3.10). - - Compilers: GCC (>= 7.5), Clang (>= 6.0), MSVC (>= 2022), Apple Clang (>= - 12). + - Build Systems: Bazel (>= 7.0), CMake (>= 3.22). + - Compilers: GCC (>= 7.5), Clang (>= 14.0.0), MSVC (>= 2022), Apple Clang (>= + 17). - This project uses dependencies described in [doc/packaging.md](https://github.com/googleapis/google-cloud-cpp/blob/main/doc/packaging.md). - This project works with or without exceptions enabled. 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/gapic.bzl b/bazel/gapic.bzl index ef02cb7d259d6..e78adf9ce5cc7 100644 --- a/bazel/gapic.bzl +++ b/bazel/gapic.bzl @@ -38,23 +38,23 @@ def cc_gapic_library(name, service_dirs = [], googleapis_deps = [], additional_d native.filegroup( name = "srcs", - srcs = native.glob(sources_glob), + srcs = native.glob(sources_glob, allow_empty = True), ) native.filegroup( name = "hdrs", - srcs = native.glob(include = code_glob, exclude = sources_glob), + srcs = native.glob(include = code_glob, exclude = sources_glob, allow_empty = True), ) native.filegroup( name = "public_hdrs", - srcs = native.glob([d + "*.h" for d in service_dirs]), + srcs = native.glob([d + "*.h" for d in service_dirs], allow_empty = True), visibility = ["//:__pkg__"], ) native.filegroup( name = "mocks", - srcs = native.glob([d + "mocks/*.h" for d in service_dirs]), + srcs = native.glob([d + "mocks/*.h" for d in service_dirs], allow_empty = True), visibility = ["//:__pkg__"], ) @@ -72,7 +72,7 @@ def cc_gapic_library(name, service_dirs = [], googleapis_deps = [], additional_d visibility = ["//:__pkg__"], deps = [ ":google_cloud_cpp_" + name, - "@com_google_googletest//:gtest", + "@googletest//:gtest", ], ) @@ -85,4 +85,4 @@ def cc_gapic_library(name, service_dirs = [], googleapis_deps = [], additional_d "//:universe_domain", "//google/cloud/testing_util:google_cloud_cpp_testing_private", ], - ) for sample in native.glob([d + "samples/*_samples.cc" for d in service_dirs])] + ) for sample in native.glob([d + "samples/*_samples.cc" for d in service_dirs], allow_empty = True)] diff --git a/bazel/googleapis.modules.patch b/bazel/googleapis.modules.patch deleted file mode 100644 index 51f110379f4a5..0000000000000 --- a/bazel/googleapis.modules.patch +++ /dev/null @@ -1,137 +0,0 @@ -diff --git a/BUILD.bazel b/BUILD.bazel -index 026553f5c7..f3c6b6925c 100644 ---- a/BUILD.bazel -+++ b/BUILD.bazel -@@ -1,11 +1,13 @@ -+package(default_visibility = ["//visibility:public"]) -+ -+licenses(["notice"]) # Apache 2.0 -+ - genrule( -- name = "build_gen", -- srcs = glob( -- ["run_build_gen.sh"], -- allow_empty = True, -- ), -- outs = ["build_gen.sh"], -- cmd = """ -+ name = "build_gen", -+ outs = ["build_gen.sh"], -+ executable = True, -+ srcs = glob(["run_build_gen.sh"], allow_empty=True), -+ cmd = """ - if test -z \"$(SRCS)\"; then - cat < $@ - #!/bin/sh -@@ -17,5 +19,17 @@ EOD - cp $(SRCS) $@ - fi - """, -- executable = True, - ) -+ -+# This build file overlays on top of the BUILD files for the googleapis repo, -+# and it adds a target that lets us include their header files using -+# angle-brackets, thus treating their headers as system includes. This allows -+# us to dial-up the warnings in our own code, without seeing compiler warnings -+# from their headers, which we do not own. -+cc_library( -+ name = "googleapis_system_includes", -+ includes = [ -+ ".", -+ ], -+) -+ -diff --git a/MODULE.bazel b/MODULE.bazel -new file mode 100644 -index 000000000..169133e43 ---- /dev/null -+++ b/MODULE.bazel -@@ -0,0 +1,14 @@ -+module( -+ name = "googleapis", -+ version = "0.0.0-20240326-1c8d509c5", -+ repo_name = "com_google_googleapis", -+) -+ -+bazel_dep(name = "grpc", version = "1.63.1.bcr.1", repo_name = "com_github_grpc_grpc") -+bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf") -+bazel_dep(name = "rules_proto", version = "5.3.0-21.7") -+ -+switched_rules = use_extension("//:extensions.bzl", "switched_rules") -+ -+switched_rules.use_languages() -+use_repo(switched_rules, "com_google_googleapis_imports") -diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod -new file mode 100644 -index 000000000..8cf3fe396 ---- /dev/null -+++ b/WORKSPACE.bzlmod -@@ -0,0 +1,2 @@ -+workspace(name = "com_google_googleapis") -+ -diff --git a/extensions.bzl b/extensions.bzl -new file mode 100644 -index 000000000..9aa161841 ---- /dev/null -+++ b/extensions.bzl -@@ -0,0 +1,59 @@ -+load(":repository_rules.bzl", "switched_rules_by_language") -+ -+_use_languages_tag = tag_class( -+ attrs = { -+ "cc": attr.bool(default = False), -+ "csharp": attr.bool(default = False), -+ "gapic": attr.bool(default = False), -+ "go": attr.bool(default = False), -+ "go_test": attr.bool(default = False), -+ "grpc": attr.bool(default = False), -+ "java": attr.bool(default = False), -+ "nodejs": attr.bool(default = False), -+ "php": attr.bool(default = False), -+ "python": attr.bool(default = False), -+ "ruby": attr.bool(default = False), -+ }, -+) -+ -+def _switched_rules_impl(ctx): -+ attrs = {} -+ for module in ctx.modules: -+ if not module.is_root: -+ continue -+ -+ is_tag_set = False -+ set_tag_name = "" -+ -+ for t in module.tags.use_languages: -+ if is_tag_set: -+ fail("Multiple use_language tags are set in the root module: '{}' and '{}'. Only one is allowed.".format(set_tag_name, module.name)) -+ -+ is_tag_set = True -+ set_tag_name = module.name -+ -+ attrs = { -+ "cc": t.cc, -+ "csharp": t.csharp, -+ "gapic": t.gapic, -+ "go": t.go, -+ "go_test": t.go_test, -+ "grpc": t.grpc, -+ "java": t.java, -+ "nodejs": t.nodejs, -+ "php": t.php, -+ "python": t.python, -+ "ruby": t.ruby, -+ } -+ -+ switched_rules_by_language( -+ name = "com_google_googleapis_imports", -+ **attrs -+ ) -+ -+switched_rules = module_extension( -+ implementation = _switched_rules_impl, -+ tag_classes = { -+ "use_languages": _use_languages_tag, -+ }, -+) diff --git a/bazel/googleapis.workspace.patch b/bazel/googleapis.workspace.patch new file mode 100644 index 0000000000000..d86dce95b3251 --- /dev/null +++ b/bazel/googleapis.workspace.patch @@ -0,0 +1,13 @@ +diff --git a/BUILD.bazel b/BUILD.bazel +index 95e4c12e5..83838d3f0 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -2,7 +2,7 @@ genrule( + name = "build_gen", + outs = ["build_gen.sh"], + executable = True, +- srcs = glob(["run_build_gen.sh"]), ++ srcs = glob(["run_build_gen.sh"], allow_empty=True), + cmd = """ + if test -z \"$(SRCS)\"; then + cat < $@ diff --git a/bazel/remove_upb_c_rules.patch b/bazel/remove_upb_c_rules.patch new file mode 100644 index 0000000000000..43b077224c29d --- /dev/null +++ b/bazel/remove_upb_c_rules.patch @@ -0,0 +1,124 @@ +diff --git google/api/expr/v1alpha1/BUILD.bazel google/api/expr/v1alpha1/BUILD.bazel +index 9bed46809..197e5249c 100644 +--- google/api/expr/v1alpha1/BUILD.bazel ++++ google/api/expr/v1alpha1/BUILD.bazel +@@ -233,32 +233,32 @@ cc_proto_library( + ############################################################################## + # upb + ############################################################################## +-load( +- "@com_google_googleapis_imports//:imports.bzl", +- "upb_c_proto_library", +-) +- +-upb_c_proto_library( +- name = "checked_upb_proto", +- deps = [":checked_proto"], +-) +- +-upb_c_proto_library( +- name = "eval_upb_proto", +- deps = [":eval_proto"], +-) +- +-upb_c_proto_library( +- name = "explain_upb_proto", +- deps = [":explain_proto"], +-) +- +-upb_c_proto_library( +- name = "syntax_upb_proto", +- deps = [":syntax_proto"], +-) +- +-upb_c_proto_library( +- name = "value_upb_proto", +- deps = [":value_proto"], +-) ++#load( ++ #"@com_google_googleapis_imports//:imports.bzl", ++ #"upb_c_proto_library", ++#) ++# ++#upb_c_proto_library( ++ #name = "checked_upb_proto", ++ #deps = [":checked_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "eval_upb_proto", ++ #deps = [":eval_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "explain_upb_proto", ++ #deps = [":explain_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "syntax_upb_proto", ++ #deps = [":syntax_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "value_upb_proto", ++ #deps = [":value_proto"], ++#) +diff --git google/rpc/BUILD.bazel google/rpc/BUILD.bazel +index 31fd6457d..c38f00c46 100644 +--- google/rpc/BUILD.bazel ++++ google/rpc/BUILD.bazel +@@ -11,7 +11,7 @@ load( + "php_proto_library", + "py_gapic_assembly_pkg", + "py_proto_library", +- "upb_c_proto_library", ++ #"upb_c_proto_library", + ) + load("@rules_proto//proto:defs.bzl", "proto_library") + +@@ -104,15 +104,15 @@ cc_proto_library( + deps = [":status_proto"], + ) + +-upb_c_proto_library( +- name = "code_upb_proto", +- deps = [":code_proto"], +-) ++#upb_c_proto_library( ++ #name = "code_upb_proto", ++ #deps = [":code_proto"], ++#) + +-upb_c_proto_library( +- name = "status_upb_proto", +- deps = [":status_proto"], +-) ++#upb_c_proto_library( ++ #name = "status_upb_proto", ++ #deps = [":status_proto"], ++#) + + py_proto_library( + name = "code_py_proto", +diff --git repository_rules.bzl repository_rules.bzl +index 2f87ad682..2ab3bd054 100644 +--- repository_rules.bzl ++++ repository_rules.bzl +@@ -224,11 +224,11 @@ def switched_rules_by_language( + # + # upb + # +- rules["upb_c_proto_library"] = _switch( +- upb, +- "@com_google_protobuf//bazel:upb_c_proto_library.bzl", +- "upb_c_proto_library", +- ) ++ #rules["upb_c_proto_library"] = _switch( ++ # upb, ++ # "@com_google_protobuf//bazel:upb_c_proto_library.bzl", ++ # "upb_c_proto_library", ++ #) + + # + # PHP diff --git a/bazel/workspace0.bzl b/bazel/workspace0.bzl index 1fa5c263576a7..8d3d5cdc48773 100644 --- a/bazel/workspace0.bzl +++ b/bazel/workspace0.bzl @@ -77,14 +77,24 @@ def gl_cpp_workspace0(name = None): strip_prefix = "rules_cc-0.1.4", ) + maybe( + http_archive, + name = "com_envoyproxy_protoc_gen_validate", + urls = [ + "https://github.com/bufbuild/protoc-gen-validate/archive/v1.2.1.tar.gz", + ], + strip_prefix = "protoc-gen-validate-1.2.1", + integrity = "sha256-5HGDUnVN8Tk7h5K2MTOKqFYvOQ6BYHg+NlRUvBHZYyg=", + ) + # protobuf requires this 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", ], ) @@ -93,27 +103,27 @@ 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 maybe( http_archive, - name = "com_google_absl", + name = "abseil-cpp", urls = [ - "https://github.com/abseil/abseil-cpp/archive/20250127.1.tar.gz", + "https://github.com/abseil/abseil-cpp/archive/20250512.2.tar.gz", ], - sha256 = "b396401fd29e2e679cace77867481d388c807671dc2acc602a0259eeb79b7811", - strip_prefix = "abseil-cpp-20250127.1", + sha256 = "71358f2e72e945d280bfab44090eacb3f98e10fead31fd97876f05a835510d92", + strip_prefix = "abseil-cpp-20250512.2", ) # Load a version of googletest that we know works. This is needed to create # //:.*mocks targets, which are public. maybe( http_archive, - name = "com_google_googletest", + name = "googletest", urls = [ "https://github.com/google/googletest/archive/v1.16.0.tar.gz", ], @@ -124,32 +134,47 @@ def gl_cpp_workspace0(name = None): # Load the googleapis dependency. maybe( http_archive, - name = "com_google_googleapis", + name = "googleapis", urls = [ - "https://github.com/googleapis/googleapis/archive/c0fcb35628690e9eb15dcefae41c651c67cd050b.tar.gz", + "https://github.com/googleapis/googleapis/archive/c8ca5bce5cbabac76b8619bd8d63ac10bb0561a9.tar.gz", ], - sha256 = "68c82109667c892b6595385b2ad77c1342752f998664eb6d055509ecaddc3150", - strip_prefix = "googleapis-c0fcb35628690e9eb15dcefae41c651c67cd050b", + sha256 = "8ce00cdda7a5c1595fc539b2611f7084344bd08dd07d6e0be03068afb4bc6e8a", + strip_prefix = "googleapis-c8ca5bce5cbabac76b8619bd8d63ac10bb0561a9", build_file = Label("//bazel:googleapis.BUILD"), # Scaffolding for patching googleapis after download. For example: - # patches = ["googleapis.patch"] - # NOTE: This should only be used while developing with a new - # protobuf message. No changes to `patches` should ever be - # committed to the main branch. + patches = [ + + # NOTE: This should only be used while developing with a new + # protobuf message. No changes to `patches` should ever be + # committed to the main branch. + #"googleapis.patch", + + # Mirrors the patch from the current bazel module + "//bazel:remove_upb_c_rules.patch", + ], patch_tool = "patch", - patch_args = ["-p1"], - patches = [], + + # Use the following args when developing with a new proto message + # patch_args = ["-p1", "-l", "-n"], + repo_mapping = { + "@com_github_grpc_grpc": "@grpc", + }, ) # Load protobuf. + # The name "com_google_protobuf" is internally used by @bazel_tools, + # a native repository we cannot override. + # We will revert this to @protobuf once @bazel_tools is deprecated + # and libraries have strayed away from it. + # See https://github.com/googleapis/google-cloud-cpp/issues/15393 maybe( http_archive, name = "com_google_protobuf", urls = [ - "https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz", + "https://github.com/protocolbuffers/protobuf/archive/v31.1.tar.gz", ], - sha256 = "6bd9dcc91b17ef25c26adf86db71c67ec02431dc92e9589eaf82e22889230496", - strip_prefix = "protobuf-29.4", + sha256 = "c3a0a9ece8932e31c3b736e2db18b1c42e7070cd9b881388b26d01aa71e24ca2", + strip_prefix = "protobuf-31.1", ) # Load BoringSSL. This could be automatically loaded by gRPC. But as of @@ -167,45 +192,65 @@ def gl_cpp_workspace0(name = None): strip_prefix = "boringssl-82a53d8c902f940eb1310f76a0b96c40c67f632f", ) + # This is a transitive dependency of grpc + maybe( + http_archive, + name = "io_bazel_rules_go", + sha256 = "d93ef02f1e72c82d8bb3d5169519b36167b33cf68c252525e3b9d3d5dd143de7", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.49.0/rules_go-v0.49.0.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.49.0/rules_go-v0.49.0.zip", + ], + patch_args = ["-p1"], + ) + # Load gRPC and its dependencies, using a similar pattern to this function. maybe( http_archive, - name = "com_github_grpc_grpc", + name = "grpc", urls = [ - "https://github.com/grpc/grpc/archive/v1.69.0.tar.gz", + "https://github.com/grpc/grpc/archive/v1.74.1.tar.gz", ], - sha256 = "cd256d91781911d46a57506978b3979bfee45d5086a1b6668a3ae19c5e77f8dc", - strip_prefix = "grpc-1.69.0", + repo_mapping = { + "@com_google_absl": "@abseil-cpp", + "@com_github_grpc_grpc": "@grpc", + }, + sha256 = "7bf97c11cf3808d650a3a025bbf9c5f922c844a590826285067765dfd055d228", + strip_prefix = "grpc-1.74.1", + ) + + native.bind( + name = "protocol_compiler", + actual = "@com_google_protobuf//:protoc", ) # We use the cc_proto_library() rule from @com_google_protobuf, which # assumes that grpc_cpp_plugin and grpc_lib are in the //external: module native.bind( name = "grpc_cpp_plugin", - actual = "@com_github_grpc_grpc//src/compiler:grpc_cpp_plugin", + actual = "@grpc//src/compiler:grpc_cpp_plugin", ) native.bind( name = "grpc_lib", - actual = "@com_github_grpc_grpc//:grpc++", + actual = "@grpc//:grpc++", ) # We need libcurl for the Google Cloud Storage client. - maybe( - http_archive, + http_archive( name = "com_github_curl_curl", urls = [ - "https://curl.haxx.se/download/curl-7.69.1.tar.gz", + "https://curl.haxx.se/download/curl-7.74.0.tar.gz", ], - sha256 = "01ae0c123dee45b01bbaef94c0bc00ed2aec89cb2ee0fd598e0d302a6b5e0a98", - strip_prefix = "curl-7.69.1", + sha256 = "e56b3921eeb7a2951959c02db0912b5fcd5fdba5aca071da819e1accf338bbd7", + strip_prefix = "curl-7.74.0", build_file = Label("//bazel:curl.BUILD"), ) # We need the nlohmann_json library maybe( http_archive, - name = "com_github_nlohmann_json", + name = "nlohmann_json", urls = [ "https://github.com/nlohmann/json/archive/v3.11.3.tar.gz", ], @@ -213,25 +258,9 @@ def gl_cpp_workspace0(name = None): strip_prefix = "json-3.11.3", ) - # Load google/crc32c, a library to efficiently compute CRC32C checksums. - maybe( - http_archive, - name = "com_github_google_crc32c", - urls = [ - "https://github.com/google/crc32c/archive/1.1.2.tar.gz", - ], - sha256 = "ac07840513072b7fcebda6e821068aa04889018f24e10e46181068fb214d7e56", - strip_prefix = "crc32c-1.1.2", - build_file = Label("//bazel:crc32c.BUILD"), - patch_tool = "patch", - patch_args = ["-p1"], - patches = [Label("//bazel:configure_template.bzl.patch")], - ) - # Open Telemetry - maybe( - http_archive, - name = "io_opentelemetry_cpp", + http_archive( + name = "opentelemetry-cpp", urls = [ "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz", ], diff --git a/bazel/workspace2.bzl b/bazel/workspace2.bzl index a155449661177..97c90aab0f01a 100644 --- a/bazel/workspace2.bzl +++ b/bazel/workspace2.bzl @@ -15,11 +15,11 @@ """Load dependencies needed for google-cloud-cpp development / Phase 2.""" load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies") -load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") load( - "@com_google_googleapis//:repository_rules.bzl", + "@googleapis//:repository_rules.bzl", "switched_rules_by_language", ) +load("@grpc//bazel:grpc_deps.bzl", "grpc_deps") load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies") def gl_cpp_workspace2(name = None): @@ -38,9 +38,9 @@ def gl_cpp_workspace2(name = None): rules_cc_dependencies() - # Configure @com_google_googleapis to only compile C++ and gRPC libraries. + # Configure @googleapis to only compile C++ and gRPC libraries. switched_rules_by_language( - name = "com_google_googleapis_imports", + name = "googleapis_imports", cc = True, grpc = True, ) diff --git a/bazel/workspace3.bzl b/bazel/workspace3.bzl index 33d2454a4d9b6..38b1fd970d698 100644 --- a/bazel/workspace3.bzl +++ b/bazel/workspace3.bzl @@ -14,10 +14,10 @@ """Load dependencies needed for google-cloud-cpp development / Phase 3.""" -load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps") -load("@com_google_googletest//:googletest_deps.bzl", "googletest_deps") load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") -load("@io_opentelemetry_cpp//bazel:repository.bzl", "opentelemetry_cpp_deps") +load("@googletest//:googletest_deps.bzl", "googletest_deps") +load("@grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps") +load("@opentelemetry-cpp//bazel:repository.bzl", "opentelemetry_cpp_deps") def gl_cpp_workspace3(name = None): """Loads dependencies needed to use the google-cloud-cpp libraries. 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 f7e04990f92ff..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 409f736e2dfd2..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 8a5bbd59f5b9c..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 7db93244bf9f0..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 e5959bb91522e..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 9af81d3d6f5fc..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 ca0a66d67b30d..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 f52308b497277..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 2979b3345bf59..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 e64ba92293265..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 dbd6370a8d724..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 e63aee73f74da..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 1ebeec4433c94..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 3f1cb18d21434..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 983229c836c22..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 41d8ff3b6fec9..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 641a1eb2e84a8..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 e0f1f4e571d3b..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 a4c419fd59715..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 f4cd52c37099a..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 22962a15bf39e..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 eeab01218aa2c..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 309ea7989aa7a..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 e5e0498c6ec25..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 0bf08cedddf5b..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 fe43dd43227d4..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 982774c6b6566..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 abfeccceeab50..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 6bca85e5a0b3d..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 cac765d97d5af..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 f7c6ebc2aa2d9..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 ef380c79f748a..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 5c664a8c92937..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 9db9901f96088..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 66b9943bce342..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 37518b9cdc19d..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 85fad37b3e9c1..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 812e511344834..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 876d22e16a000..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 3c53049b437a4..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 bd6b3d8052cae..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 b41ec6ab241cc..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 bc81629fd15da..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 7feed44c7bcd7..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 c8a3ce6a2c271..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 ee6c9f6321a6f..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 f5e257978cd97..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 dd5d82a0cdabd..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 ae12713a96835..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 49f9d2db736df..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 9a77091fd4516..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 0b55a1c7f9b23..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 84e7ee27eab79..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 cdd08043cac0b..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 8c7be1a00f4a3..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 907b76edc64b0..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 b275bd1e77236..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 b53e26b3e00fd..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 c6e6faa8e69c5..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 db1c34f33daac..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 b6ca988ea6eeb..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 7e7c534443abf..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 e506d8fd35931..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 2b3d63ef3c8ad..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 ba0d33f3abeb4..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 a12beff0976fa..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 5e60986d1b5a1..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 10e8e96cacb22..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 1dead1a6d3482..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 5c4f15c24516c..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 8a023937d6ead..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 a3e3c6e9b09f7..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_network_profiles.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_network_profiles.expected.abi.dump.gz deleted file mode 100644 index fda6ae395b354..0000000000000 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_network_profiles.expected.abi.dump.gz and /dev/null 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 a982b24f53dab..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 b1e7816fa55d3..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 a442a930656ab..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 ae4f5cc4b7f92..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 5a95bdf5039a1..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 79d0edebcc95f..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 fd063b76929de..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 e88f5a4f7d4ce..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 bb8c5d22aac8e..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 8ded0d16b1ef5..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 fb39624c20f39..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 e8e2fed3636c9..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 4ba7238cf6a36..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 eecf702983b97..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 443298f8850a8..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 1dcd11b7609a5..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 bfe91df9dcdb3..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 6bc5beefd471b..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 197eb96de3642..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 7c2f2a7f5ef1d..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 79c8ea69bd989..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 1d59454268baf..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 aa1404fb14348..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 ea0bfd4e8b836..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 a345af7d85330..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_reservation_sub_blocks.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_reservation_sub_blocks.expected.abi.dump.gz deleted file mode 100644 index f4592ac4b773c..0000000000000 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_reservation_sub_blocks.expected.abi.dump.gz and /dev/null 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 6ce3a7f7d3373..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 5f839fd21d252..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 35ca23f964923..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 bb8f286efb935..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 9f851b38fb4fd..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 49143b4588595..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 758c257d6f96f..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 5c541b60b98fa..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 cd4fa71a3e688..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 2d34834fb37b0..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 ab5cc6de02274..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 e64e6431f2b4c..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 af8279796e35e..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 bf094246318bc..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 e7354d34aac21..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 124da8edac28d..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 cbc7deb1e5c53..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 62cbbb27bd73d..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 a5774eba87bc3..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 b26704047dd15..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 ceecddcdd9d9e..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 c410cb3ff4069..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 8b34b9ab7fe70..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 d0995f3a89aee..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 d1b52a03f02ed..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 bac99bba4a17c..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 426460e136e7d..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 069c5ccd2b9e1..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 0676742e9b1c5..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 a83e78995e20c..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 77071a90f7014..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 f2bab4c6d9e68..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 44df64059d8af..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 e6289d8093a11..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 7266c175aff70..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 0f5905c4fdb5a..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 1a7226b1bf47e..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 de23882d3e1f6..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 fe65198cb08b2..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 a6a5ac061105a..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 4dc3ff787917a..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 3671d48cf05b0..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 e193c5173b518..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 22066c293a6d2..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 b70fca01ac56b..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 ed14fa6b91e55..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 fafecf2f43fc9..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 69b20b668e993..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 c8e40d9315350..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 add9bf06b33e7..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 6b4a8e8b858b6..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 e2fd0b86d6b75..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 82f7e193d40cb..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 18aa35c691948..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 dcfd71e3ba964..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 5a91a5cc2b175..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 00cefcdbf8f68..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 ab352ebcf7618..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 8bc3e32b13748..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 75ed0ab863976..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 153f196e9b1b4..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 cb80345d30b33..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 7c60c52047152..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 6035efcb50215..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 cdfb4df131c2b..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 bd40a157f7f72..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 b9ac1464b6926..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 2f51dbb70e45d..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 68d646e86a86f..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 9b91c1559198a..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 7d6cb781e69cd..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 e16e70768738b..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 b87da2b180c64..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 98f5b92893a72..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 1c7fa4d9f18ed..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 f3b6a811ddfb6..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 a173ccc7cda54..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 c3b352a92208a..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 cdcd2a359f16a..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 5ff38634be2f0..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 48dcfd090526a..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 cfc037955679c..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 97a8f73a7ef48..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 da9f18197436b..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 f679980c29f80..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 b47c14a41f28e..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 d75891bc0514c..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 efe269d36774b..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 b10622e58a1b0..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 b94e7ccbc40ee..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 891d8c2a2d494..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 597fbc4fe3aef..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 3c397b3b8439c..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 3cefde340dc6b..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 8784065044c25..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 afc6ab0bcde75..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 f167f0b26a63f..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 3d0a5ab3ad5d6..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 8a29b97af553d..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 d33b0f6c021ed..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 f55d3247c09f4..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 75f7fe2a28590..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 1e95a9780cd04..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 d065f57e2922b..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 b1cddb1639bc8..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 8f305575b1b8f..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 6c1da7347cbc6..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 662cde0c13e82..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 8e5828c4bc87f..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 1179b574dd2a4..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 b46bd10e16253..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 792244b420b17..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 679ba0623bcad..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 e07471f59062a..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 27ee141b4772b..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 34f7d69a852de..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 1855d530c064a..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 2ecd7c0204857..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 7766b9799f50c..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 82ac173692915..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 c5a36a083f682..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 94c5e94a049bf..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 e12a32fdb1f12..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 81ff415707a70..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 d4d8a382f2e0b..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 5845e43bc85d2..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 3367a6bd6b509..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 ae98cfc11b24c..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 7f28f2da53b25..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 a6521da7a7ad4..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 477e9f5ed1c62..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 e705ea8c30646..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 6ea06836b74b5..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 0b03c53d01ab9..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 3308b06c5644b..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 fcf814b9ad75f..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 b676d1d7034cd..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 4bb0a0574d041..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/BUILD.bazel b/ci/bzlmod_tests/consumer-test/BUILD.bazel new file mode 100644 index 0000000000000..f2d6d030954e2 --- /dev/null +++ b/ci/bzlmod_tests/consumer-test/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_cc//cc:defs.bzl", "cc_test") + +cc_test( + name = "main_test", + srcs = ["main.cc"], + deps = [ + "@google_cloud_cpp//google/cloud/storage:storage_client_testing", + ], +) diff --git a/ci/bzlmod_tests/consumer-test/MODULE.bazel b/ci/bzlmod_tests/consumer-test/MODULE.bazel new file mode 100644 index 0000000000000..9a48243eaeb83 --- /dev/null +++ b/ci/bzlmod_tests/consumer-test/MODULE.bazel @@ -0,0 +1,5 @@ +module(name = "bzlmod-consumer-test") + +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/bzlmod_tests/consumer-test/main.cc b/ci/bzlmod_tests/consumer-test/main.cc new file mode 100644 index 0000000000000..8a6e907ba3c95 --- /dev/null +++ b/ci/bzlmod_tests/consumer-test/main.cc @@ -0,0 +1,16 @@ +#include "google/cloud/storage/client.h" +#include "google/cloud/storage/testing/mock_client.h" +#include +#include + +TEST(BzlmodTest, CanCreateMockClient) { + // Create a mock client. + auto mock = std::make_shared(); + + // Use the mock to construct a Client object. This verifies that the + // necessary symbols are linked correctly. + google::cloud::storage::Client client(mock); + + // A simple assertion to make it a valid test. + ASSERT_TRUE(true); +} diff --git a/ci/cloudbuild/builds/bazel-oldest.sh b/ci/cloudbuild/builds/bazel-oldest.sh index 907dd70fd13b7..c1697dde77971 100755 --- a/ci/cloudbuild/builds/bazel-oldest.sh +++ b/ci/cloudbuild/builds/bazel-oldest.sh @@ -16,21 +16,22 @@ set -euo pipefail -export USE_BAZEL_VERSION=6.4.0 +export USE_BAZEL_VERSION=7.7.1 source "$(dirname "$0")/../../lib/init.sh" source module ci/cloudbuild/builds/lib/bazel.sh source module ci/cloudbuild/builds/lib/cloudcxxrc.sh +source module ci/lib/io.sh export CC=clang export CXX=clang++ mapfile -t args < <(bazel::common_args) args+=( - # For now, we continue to test Bazel 6.x without bzlmod. Once the minimum - # supported version of Bazel is 7.x we can decide how to test without bzlmod. + # Test without bzlmod as WORKSPACE is still supported in bazel 7 LTS. --noenable_bzlmod + --enable_workspace # Only run the unit tests, no need to waste time running everything. --test_tag_filters=-integration-test ) -bazel test "${args[@]}" -- "${BAZEL_TARGETS[@]}" +io::run bazel test "${args[@]}" -- "${BAZEL_TARGETS[@]}" diff --git a/ci/cloudbuild/builds/bazel-targets.sh b/ci/cloudbuild/builds/bazel-targets.sh index 87a53b7dad7d6..7d93b375dea0c 100755 --- a/ci/cloudbuild/builds/bazel-targets.sh +++ b/ci/cloudbuild/builds/bazel-targets.sh @@ -21,7 +21,6 @@ source module ci/cloudbuild/builds/lib/bazel.sh source module ci/cloudbuild/builds/lib/cloudcxxrc.sh mapfile -t args < <(bazel::common_args) -for repo_root in "ci/verify_current_targets" "ci/verify_deprecated_targets"; do - io::log_h2 "Verifying Bazel targets in repo root: ${repo_root}" - env -C "${repo_root}" bazel test "${args[@]}" ... -done +repo_root="ci/verify_current_targets" +io::log_h2 "Verifying Bazel targets in repo root: ${repo_root}" +env -C "${repo_root}" bazel test "${args[@]}" ... diff --git a/ci/cloudbuild/builds/check-api.sh b/ci/cloudbuild/builds/check-api.sh index ef6a0b21b5ed4..984e2da49d4db 100755 --- a/ci/cloudbuild/builds/check-api.sh +++ b/ci/cloudbuild/builds/check-api.sh @@ -45,6 +45,7 @@ fi # https://github.com/googleapis/google-cloud-cpp/issues/6313 io::run cmake "${cmake_args[@]}" \ -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_MESSAGE=NEVER \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_BUILD_TYPE=Debug \ @@ -73,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/checkers.sh b/ci/cloudbuild/builds/checkers.sh index 027f8eb959755..1dc119a3e118e 100755 --- a/ci/cloudbuild/builds/checkers.sh +++ b/ci/cloudbuild/builds/checkers.sh @@ -94,19 +94,6 @@ time { xargs -r -P "$(nproc)" -n 50 -0 awk -f "ci/check-include-guards.gawk" } -# TODO(#4501) - this fixup can be removed if #include works -# Apply transformations to fix errors on MSVC+x86. See the bug for a detailed -# explanation as to why this is needed: -# https://github.com/googleapis/google-cloud-cpp/issues/4501 -# This should run before clang-format because it might alter the order of any -# includes. -printf "%-50s" "Running Abseil header fixes:" >&2 -time { - expressions=("-e" "'s;#include \"absl/strings/str_\(cat\|replace\|join\).h\";#include \"google/cloud/internal/absl_str_\1_quiet.h\";'") - (git grep -zEl '#include "absl/strings/str_(cat|replace|join).h"' -- '*.h' '*.cc' ':!google/cloud/internal/absl_str_*quiet.h' || true) | - xargs -r -P "$(nproc)" -n 50 -0 bash -c "sed_edit ${expressions[*]} \"\$0\" \"\$@\"" -} - # Apply several transformations that cannot be enforced by clang-format: # - Replace any #include for grpc++/* with grpcpp/*. The paths with grpc++ # are obsoleted by the gRPC team, so we should not use them in our code. diff --git a/ci/cloudbuild/builds/clang-14.0.sh b/ci/cloudbuild/builds/clang-14.0.sh new file mode 100755 index 0000000000000..0db406fca54f7 --- /dev/null +++ b/ci/cloudbuild/builds/clang-14.0.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -euo pipefail + +source "$(dirname "$0")/../../lib/init.sh" +source module ci/cloudbuild/builds/lib/cmake.sh +source module ci/cloudbuild/builds/lib/ctest.sh +source module ci/cloudbuild/builds/lib/features.sh +source module ci/lib/io.sh + +# We run this test in a Docker image that includes the oldest Clang that we +# support. At this time this is Clang 7.0. +export CC=clang +export CXX=clang++ + +read -r ENABLED_FEATURES < <(features::always_build_cmake) +ENABLED_FEATURES="${ENABLED_FEATURES},compute" +readonly ENABLED_FEATURES + +io::run cmake -GNinja -S . -B cmake-out \ + -DCMAKE_CXX_STANDARD=17 \ + -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" \ + -DGOOGLE_CLOUD_CPP_ENABLE_CCACHE=ON \ + -DGOOGLE_CLOUD_CPP_ENABLE_WERROR=ON \ + -DBUILD_SHARED_LIBS=yes +io::run cmake --build cmake-out + +mapfile -t ctest_args < <(ctest::common_args) +io::run env -C cmake-out ctest "${ctest_args[@]}" -LE integration-test diff --git a/ci/cloudbuild/builds/clang-7.0.sh b/ci/cloudbuild/builds/clang-7.0.sh deleted file mode 100755 index 55fbd3edfcc85..0000000000000 --- a/ci/cloudbuild/builds/clang-7.0.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -euo pipefail - -source "$(dirname "$0")/../../lib/init.sh" -source module ci/cloudbuild/builds/lib/cmake.sh -source module ci/cloudbuild/builds/lib/ctest.sh -source module ci/cloudbuild/builds/lib/features.sh -source module ci/lib/io.sh - -# We run this test in a Docker image that includes the oldest Clang that we -# support. At this time this is Clang 7.0. -export CC=clang -export CXX=clang++ - -read -r ENABLED_FEATURES < <(features::always_build_cmake) -ENABLED_FEATURES="${ENABLED_FEATURES},compute" -readonly ENABLED_FEATURES - -io::run cmake -GNinja -S . -B cmake-out \ - -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" \ - -DGOOGLE_CLOUD_CPP_ENABLE_CCACHE=ON \ - -DGOOGLE_CLOUD_CPP_ENABLE_WERROR=ON \ - -DBUILD_SHARED_LIBS=yes -io::run cmake --build cmake-out - -mapfile -t ctest_args < <(ctest::common_args) -io::run env -C cmake-out ctest "${ctest_args[@]}" -LE integration-test diff --git a/ci/cloudbuild/builds/clang-tidy-compute.sh b/ci/cloudbuild/builds/clang-tidy-compute.sh index 4bda9c60f390a..78c1826f06f2d 100755 --- a/ci/cloudbuild/builds/clang-tidy-compute.sh +++ b/ci/cloudbuild/builds/clang-tidy-compute.sh @@ -35,7 +35,7 @@ readonly ENABLED_FEATURES="compute" io::run cmake "${cmake_args[@]}" \ -DCMAKE_CXX_CLANG_TIDY=/usr/local/bin/clang-tidy-wrapper \ -DGOOGLE_CLOUD_CPP_ENABLE_CLANG_ABI_COMPAT_17=ON \ - -DCMAKE_CXX_STANDARD=14 \ + -DCMAKE_CXX_STANDARD=17 \ -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" \ -DGOOGLE_CLOUD_CPP_INTERNAL_DOCFX=ON io::run cmake --build cmake-out diff --git a/ci/cloudbuild/builds/clang-tidy.sh b/ci/cloudbuild/builds/clang-tidy.sh index 111c919e6d7ee..2c4782120075c 100755 --- a/ci/cloudbuild/builds/clang-tidy.sh +++ b/ci/cloudbuild/builds/clang-tidy.sh @@ -47,7 +47,7 @@ fi io::run cmake "${cmake_args[@]}" \ -DCMAKE_CXX_CLANG_TIDY=/usr/local/bin/clang-tidy-wrapper \ -DGOOGLE_CLOUD_CPP_ENABLE_CLANG_ABI_COMPAT_17=ON \ - -DCMAKE_CXX_STANDARD=14 \ + -DCMAKE_CXX_STANDARD=17 \ -DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=ON \ -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" \ -DGOOGLE_CLOUD_CPP_INTERNAL_DOCFX="${enable_docfx}" diff --git a/ci/cloudbuild/builds/cmake-gcs-rest.sh b/ci/cloudbuild/builds/cmake-gcs-rest.sh index 7abceadae6351..1c058e87748f9 100755 --- a/ci/cloudbuild/builds/cmake-gcs-rest.sh +++ b/ci/cloudbuild/builds/cmake-gcs-rest.sh @@ -30,7 +30,7 @@ mapfile -t cmake_args < <(cmake::common_args) read -r ENABLED_FEATURES < <(features::always_build_cmake) readonly ENABLED_FEATURES -io::run cmake "${cmake_args[@]}" -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" +io::run cmake "${cmake_args[@]}" -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" -DCMAKE_CXX_STANDARD=17 io::run cmake --build cmake-out mapfile -t ctest_args < <(ctest::common_args) io::run env -C cmake-out GOOGLE_CLOUD_CPP_STORAGE_HAVE_REST_CLIENT=yes \ diff --git a/ci/cloudbuild/builds/cmake-install.sh b/ci/cloudbuild/builds/cmake-install.sh index ea830d7ad9989..994db2352d5a2 100755 --- a/ci/cloudbuild/builds/cmake-install.sh +++ b/ci/cloudbuild/builds/cmake-install.sh @@ -35,6 +35,7 @@ readonly ENABLED_FEATURES # Compiles and installs all libraries and headers. cmake "${cmake_args[@]}" \ -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_MESSAGE=NEVER \ -DGOOGLE_CLOUD_CPP_ENABLE_CLANG_ABI_COMPAT_17=ON \ -DBUILD_TESTING=OFF \ @@ -98,7 +99,7 @@ expected_dirs+=( ./include/google/cloud/gkebackup/logging/v1 ./include/google/cloud/gkehub/v1/configmanagement ./include/google/cloud/gkehub/v1/multiclusteringress - ./include/google/cloud/grpc_utils + ./include/google/cloud/gkehub/v1/rbacrolebindingactuation ./include/google/cloud/internal ./include/google/cloud/internal/win32 ./include/google/cloud/location @@ -132,7 +133,6 @@ expected_dirs+=( ./include/google/cloud/storage/internal/grpc ./include/google/cloud/storage/internal/rest ./include/google/cloud/storage/mocks - ./include/google/cloud/storage/oauth2 ./include/google/cloud/storage/testing # no gRPC services in google/cloud/workflows/type. ./include/google/cloud/workflows/type diff --git a/ci/cloudbuild/builds/cmake-oldest-deps.sh b/ci/cloudbuild/builds/cmake-oldest-deps.sh index 7ffaf56dae058..7da9d9ba52dfe 100755 --- a/ci/cloudbuild/builds/cmake-oldest-deps.sh +++ b/ci/cloudbuild/builds/cmake-oldest-deps.sh @@ -36,6 +36,7 @@ readonly ENABLED_FEATURES io::log_h2 "Configuring" vcpkg_root="$(vcpkg::root_dir)" cmake -GNinja -S . -B cmake-out/build \ + "-DCMAKE_CXX_STANDARD=17" \ "-DCMAKE_TOOLCHAIN_FILE=${vcpkg_root}/scripts/buildsystems/vcpkg.cmake" \ "-DVCPKG_MANIFEST_DIR=ci/etc/oldest-deps" \ "-DVCPKG_FEATURE_FLAGS=versions,manifest" \ @@ -49,4 +50,5 @@ io::log_h2 "Testing" mapfile -t ctest_args < <(ctest::common_args) env -C cmake-out/build ctest "${ctest_args[@]}" -LE "integration-test" -integration::ctest_with_emulators "cmake-out/build" +# TODO(#15947): Passing spanner here skips its test execution. +integration::ctest_with_emulators "cmake-out/build" "spanner" diff --git a/ci/cloudbuild/builds/cmake-single-feature.sh b/ci/cloudbuild/builds/cmake-single-feature.sh index 68ac4a6814723..9e0c9aab07adf 100755 --- a/ci/cloudbuild/builds/cmake-single-feature.sh +++ b/ci/cloudbuild/builds/cmake-single-feature.sh @@ -61,11 +61,13 @@ done for feature in "${features[@]}"; do io::run cmake -S . -B cmake-out/test-only-"${feature}" \ -DGOOGLE_CLOUD_CPP_ENABLE="${feature}" \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_TESTING=OFF io::run check_pkgconfig_relative cmake-out/test-only-"${feature}" io::run cmake -S . -B cmake-out/test-only-"${feature}"-absolute-cmake-install \ -DGOOGLE_CLOUD_CPP_ENABLE="${feature}" \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_INCLUDEDIR=/test-only/include \ -DCMAKE_INSTALL_LIBDIR=/test-only/lib \ -DBUILD_TESTING=OFF diff --git a/ci/cloudbuild/builds/cmake-split-install.sh b/ci/cloudbuild/builds/cmake-split-install.sh index 4c4a10f923e06..99340bcf3dc07 100755 --- a/ci/cloudbuild/builds/cmake-split-install.sh +++ b/ci/cloudbuild/builds/cmake-split-install.sh @@ -42,6 +42,7 @@ io::log_h2 "Building and installing common libraries" # We need a custom build directory mapfile -t core_cmake_args < <(cmake::common_args cmake-out/common-libraries) io::run cmake "${core_cmake_args[@]}" "${install_args[@]}" \ + -DCMAKE_CXX_STANDARD=17 \ -DGOOGLE_CLOUD_CPP_ENABLE="__common__" io::run cmake --build cmake-out/common-libraries io::run cmake --install cmake-out/common-libraries --prefix "${INSTALL_PREFIX}" @@ -50,6 +51,7 @@ io::log_h2 "Building and installing popular libraries" mapfile -t core_cmake_args < <(cmake::common_args cmake-out/popular-libraries) io::run cmake "${core_cmake_args[@]}" "${install_args[@]}" \ -DCMAKE_PREFIX_PATH="${INSTALL_PREFIX}" \ + -DCMAKE_CXX_STANDARD=17 \ -DGOOGLE_CLOUD_CPP_ENABLE="bigtable,pubsub,spanner,storage,storage_grpc,iam,policytroubleshooter" \ -DGOOGLE_CLOUD_CPP_USE_INSTALLED_COMMON=ON io::run cmake --build cmake-out/popular-libraries @@ -60,6 +62,7 @@ io::log_h2 "Building and installing Compute" mapfile -t feature_cmake_args < <(cmake::common_args cmake-out/compute) io::run cmake "${feature_cmake_args[@]}" "${install_args[@]}" \ -DCMAKE_PREFIX_PATH="${INSTALL_PREFIX}" \ + -DCMAKE_CXX_STANDARD=17 \ -DGOOGLE_CLOUD_CPP_USE_INSTALLED_COMMON=ON \ -DGOOGLE_CLOUD_CPP_ENABLE="compute" io::run cmake --build cmake-out/compute @@ -70,6 +73,7 @@ io::log_h2 "Building and installing all features" mapfile -t feature_cmake_args < <(cmake::common_args cmake-out/features) io::run cmake "${feature_cmake_args[@]}" "${install_args[@]}" \ -DCMAKE_PREFIX_PATH="${INSTALL_PREFIX}" \ + -DCMAKE_CXX_STANDARD=17 \ -DGOOGLE_CLOUD_CPP_USE_INSTALLED_COMMON=ON \ -DGOOGLE_CLOUD_CPP_ENABLE="__ga_libraries__,-bigtable,-pubsub,-storage,-storage_grpc,-spanner,-iam,-policytroubleshooter,-compute" io::run cmake --build cmake-out/features diff --git a/ci/cloudbuild/builds/cxx14.sh b/ci/cloudbuild/builds/cxx14.sh deleted file mode 100755 index aa2b7d3136e39..0000000000000 --- a/ci/cloudbuild/builds/cxx14.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -euo pipefail - -source "$(dirname "$0")/../../lib/init.sh" -source module ci/cloudbuild/builds/lib/cmake.sh -source module ci/cloudbuild/builds/lib/ctest.sh -source module ci/cloudbuild/builds/lib/features.sh -source module ci/cloudbuild/builds/lib/integration.sh -source module ci/lib/io.sh - -export CC=gcc -export CXX=g++ - -mapfile -t cmake_args < <(cmake::common_args) -read -r ENABLED_FEATURES < <(features::always_build_cmake) -# We should test all the GA libraries -ENABLED_FEATURES="${ENABLED_FEATURES},__ga_libraries__" -readonly ENABLED_FEATURES - -io::run cmake "${cmake_args[@]}" \ - -DCMAKE_CXX_STANDARD=14 \ - -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" -io::run cmake --build cmake-out -mapfile -t ctest_args < <(ctest::common_args) -io::run env -C cmake-out ctest "${ctest_args[@]}" -LE "integration-test" - -integration::ctest_with_emulators "cmake-out" diff --git a/ci/cloudbuild/builds/demo-install.sh b/ci/cloudbuild/builds/demo-install.sh index baf0e86030c57..4f9ccd0343eae 100755 --- a/ci/cloudbuild/builds/demo-install.sh +++ b/ci/cloudbuild/builds/demo-install.sh @@ -47,11 +47,13 @@ fi PREFIX="${HOME}/google-cloud-cpp-installed" cmake -S . -B cmake-out \ "${cmake_config_testing_details[@]}" \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DBUILD_TESTING=OFF \ -DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF \ -DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF \ + -DGOOGLE_CLOUD_CPP_ENABLE_CTYPE_CORD_WORKAROUND="${DEMO_CORD_WORKAROUND:-ON}" \ -DGOOGLE_CLOUD_CPP_ENABLE=__ga_libraries__,opentelemetry cmake --build cmake-out -- -j "$(nproc)" cmake --build cmake-out --target install diff --git a/ci/cloudbuild/builds/development.sh b/ci/cloudbuild/builds/development.sh index 357fb04abb10d..a039434f963a0 100755 --- a/ci/cloudbuild/builds/development.sh +++ b/ci/cloudbuild/builds/development.sh @@ -40,7 +40,7 @@ io::run cmake "${cmake_args[@]}" \ -DCMAKE_CXX_CLANG_TIDY=/usr/local/bin/clang-tidy-wrapper \ -DGOOGLE_CLOUD_CPP_ENABLE_CLANG_ABI_COMPAT_17=ON \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ - -DCMAKE_CXX_STANDARD=14 \ + -DCMAKE_CXX_STANDARD=17 \ -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" io::run cmake --build cmake-out diff --git a/ci/cloudbuild/builds/gcc-oldest.sh b/ci/cloudbuild/builds/gcc-oldest.sh index a781b2295d4a3..fa837b97a6485 100755 --- a/ci/cloudbuild/builds/gcc-oldest.sh +++ b/ci/cloudbuild/builds/gcc-oldest.sh @@ -32,6 +32,8 @@ ENABLED_FEATURES="${ENABLED_FEATURES},compute" readonly ENABLED_FEATURES io::run cmake "${cmake_args[@]}" \ + -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_FLAGS="-Wno-error=conversion" \ -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" io::run cmake --build cmake-out mapfile -t ctest_args < <(ctest::common_args) diff --git a/ci/cloudbuild/builds/generate-libraries.sh b/ci/cloudbuild/builds/generate-libraries.sh index f24f299b39581..8f3c8a92dbd32 100755 --- a/ci/cloudbuild/builds/generate-libraries.sh +++ b/ci/cloudbuild/builds/generate-libraries.sh @@ -24,6 +24,9 @@ source module ci/lib/io.sh bazel_output_base="$(bazel info output_base)" +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" git grep -l "Generated by the Codegen C++ plugin" generator/integration_tests/golden | xargs rm @@ -36,8 +39,8 @@ fi io::log_h2 "Running the generator to update the golden files" bazel run --action_env=GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes \ //generator:google-cloud-cpp-codegen -- \ - --protobuf_proto_path="${bazel_output_base}/external/protobuf~/src" \ - --googleapis_proto_path="${bazel_output_base}/external/googleapis~" \ + --protobuf_proto_path="${protobuf_proto_path}" \ + --googleapis_proto_path="${googleapis_proto_path}" \ --golden_proto_path="${PWD}" \ --output_path="${PWD}" \ --update_ci=false \ @@ -49,8 +52,8 @@ if [ -z "${GENERATE_GOLDEN_ONLY}" ]; then io::log_h2 "Running the generator to emit protos from discovery docs" bazel run --action_env=GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes \ //generator:google-cloud-cpp-codegen -- \ - --protobuf_proto_path="${bazel_output_base}"/external/protobuf~/src \ - --googleapis_proto_path="${bazel_output_base}"/external/googleapis~ \ + --protobuf_proto_path="${protobuf_proto_path}" \ + --googleapis_proto_path="${googleapis_proto_path}" \ --discovery_proto_path="${PWD}/protos" \ --output_path="${PROJECT_ROOT}/protos" \ --export_output_path="${PROJECT_ROOT}" \ @@ -81,8 +84,8 @@ if [ -z "${GENERATE_GOLDEN_ONLY}" ]; then io::log_h2 "Running the generator to update the generated libraries" bazel run --action_env=GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes \ //generator:google-cloud-cpp-codegen -- \ - --protobuf_proto_path="${bazel_output_base}"/external/protobuf~/src \ - --googleapis_proto_path="${bazel_output_base}"/external/googleapis~ \ + --protobuf_proto_path="${protobuf_proto_path}" \ + --googleapis_proto_path="${googleapis_proto_path}" \ --discovery_proto_path="${PWD}/protos" \ --output_path="${PROJECT_ROOT}" \ --check_comment_substitutions=true \ diff --git a/ci/cloudbuild/builds/grpc-at-head.sh b/ci/cloudbuild/builds/grpc-at-head.sh index d9318cd45c389..1082a188d63ba 100755 --- a/ci/cloudbuild/builds/grpc-at-head.sh +++ b/ci/cloudbuild/builds/grpc-at-head.sh @@ -20,10 +20,11 @@ source "$(dirname "$0")/../../lib/init.sh" source module ci/cloudbuild/builds/lib/bazel.sh source module ci/cloudbuild/builds/lib/cloudcxxrc.sh source module ci/cloudbuild/builds/lib/integration.sh +source module ci/etc/quickstart-config.sh rm -fr /h/grpc && git -C /h clone -q --depth 1 https://github.com/grpc/grpc.git rm -fr /h/protobuf && mkdir -p /h/protobuf && - curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v25.0.tar.gz | + curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v31.1.tar.gz | tar -C /h/protobuf -xzf - --strip-components=1 mapfile -t args < <(bazel::common_args) @@ -35,3 +36,9 @@ bazel test "${args[@]}" --test_tag_filters=-integration-test "${BAZEL_TARGETS[@] mapfile -t integration_args < <(integration::bazel_args) integration::bazel_with_emulators test "${args[@]}" "${integration_args[@]}" + +for lib in $(quickstart::libraries); do + io::log_h2 "Building Bazel quickstart for ${lib} using MODULE" + USE_BAZEL_VERSION=8.5.1 io::run env -C "${PROJECT_ROOT}/google/cloud/${lib}/quickstart" \ + bazel build --noenable_workspace --enable_bzlmod "${args[@]}" :quickstart +done diff --git a/ci/cloudbuild/builds/lib/integration.sh b/ci/cloudbuild/builds/lib/integration.sh index 3506c661c860c..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 @@ -267,10 +267,16 @@ function integration::bazel_with_emulators() { else io::log_h2 "Running generator integration test" 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 "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 -- \ - --protobuf_proto_path="${bazel_output_base}/external/protobuf~/src" \ - --googleapis_proto_path="${bazel_output_base}/external/googleapis~" \ + --protobuf_proto_path="${protobuf_proto_path}" \ + --googleapis_proto_path="${googleapis_proto_path}" \ --golden_proto_path="${PWD}" \ --output_path="${PWD}" \ --update_ci=false \ @@ -302,6 +308,8 @@ function integration::ctest_with_emulators() { fi local cmake_out="$1" + local skip_args=("${@:2}") + mapfile -t ctest_args < <(ctest::common_args) # Integration tests are inherently flaky. Make up to three attempts to get the # test passing. @@ -315,9 +323,11 @@ function integration::ctest_with_emulators() { "${PROJECT_ROOT}/google/cloud/storage/ci/${EMULATOR_SCRIPT}" \ "${cmake_out}" "${ctest_args[@]}" -L integration-test-emulator - io::log_h2 "Running Spanner integration tests (with emulator)" - "${PROJECT_ROOT}/google/cloud/spanner/ci/${EMULATOR_SCRIPT}" \ - "${cmake_out}" "${ctest_args[@]}" -L integration-test-emulator + if ! [[ "${skip_args[*]}" =~ "spanner" ]]; then + io::log_h2 "Running Spanner integration tests (with emulator)" + "${PROJECT_ROOT}/google/cloud/spanner/ci/${EMULATOR_SCRIPT}" \ + "${cmake_out}" "${ctest_args[@]}" -L integration-test-emulator + fi io::log_h2 "Running Bigtable integration tests (with emulator)" "google/cloud/bigtable/ci/${EMULATOR_SCRIPT}" \ diff --git a/ci/cloudbuild/builds/lib/quickstart.sh b/ci/cloudbuild/builds/lib/quickstart.sh index 4a148f4d6fc9e..274b9e1cdc685 100644 --- a/ci/cloudbuild/builds/lib/quickstart.sh +++ b/ci/cloudbuild/builds/lib/quickstart.sh @@ -31,6 +31,19 @@ source module ci/cloudbuild/builds/lib/cmake.sh source module ci/etc/quickstart-config.sh source module ci/lib/io.sh +quickstart_program="" + +function cleanup() { + local exit_status=$? + io::log_h2 "cleanup on EXIT with exit_status=${exit_status}" + if ((exit_status != 0)); then + io::run find . -name 'core' + io::run gdb --exec="${quickstart_program}" --core=./core --eval-command="thread apply all bt" + fi +} + +trap 'cleanup' INT TERM EXIT + # Builds the CMake and Makefile quickstart programs but DOES NOT RUN THEM. This # is a useful way to test that the artifacts installed by `google-cloud-cpp` # work for compilation. This function requires a single argument specifying the @@ -58,6 +71,8 @@ function quickstart::build_one_quickstart() { local configure_args=( "-S" "${src_dir}" "-B" "${cmake_bin_dir}" + -DCMAKE_CXX_STANDARD=17 + -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="${prefix}" ) if command -v /usr/local/bin/sccache >/dev/null 2>&1; then @@ -68,12 +83,12 @@ function quickstart::build_one_quickstart() { cmake "${configure_args[@]}" cmake --build "${cmake_bin_dir}" - echo - io::log "[ Make ]" - local makefile_bin_dir="${PROJECT_ROOT}/cmake-out/quickstart/makefile-${bin_dir_suffix}" - mkdir -p "${makefile_bin_dir}" - PKG_CONFIG_PATH="${prefix}/lib64/pkgconfig:${prefix}/lib/pkgconfig:${PKG_CONFIG_PATH:-}" \ - make -C "${src_dir}" BIN="${makefile_bin_dir}" + # echo + # io::log "[ Make ]" + # local makefile_bin_dir="${PROJECT_ROOT}/cmake-out/quickstart/makefile-${bin_dir_suffix}" + # mkdir -p "${makefile_bin_dir}" + # PKG_CONFIG_PATH="${prefix}/lib64/pkgconfig:${prefix}/lib/pkgconfig:${PKG_CONFIG_PATH:-}" \ + # CXXFLAGS="--std=c++17" make -C "${src_dir}" BIN="${makefile_bin_dir}" } # Runs the CMake and Makefile quickstart programs but DOES NOT COMPILE THEM. @@ -87,6 +102,8 @@ function quickstart::build_one_quickstart() { # quickstart::build_cmake_and_make "/usr/local" # quickstart::run_cmake_and_make "/usr/local" function quickstart::run_cmake_and_make() { + io::run ulimit -c unlimited + io::run ulimit -a local prefix="$1" for lib in $(quickstart::libraries); do io::log_h2 "Running quickstart: ${lib}" @@ -102,13 +119,18 @@ function quickstart::run_gcs_grpc_quickstart() { io::log "[ CMake ]" local cmake_bin_dir="${PROJECT_ROOT}/cmake-out/quickstart/cmake-storage_grpc" - "${cmake_bin_dir}/quickstart_grpc" "${run_args[@]}" - echo - io::log "[ Make ]" - local makefile_bin_dir="${PROJECT_ROOT}/cmake-out/quickstart/makefile-storage_grpc" - LD_LIBRARY_PATH="${prefix}/lib64:${prefix}/lib:${LD_LIBRARY_PATH:-}" \ - "${makefile_bin_dir}/quickstart_grpc" "${run_args[@]}" + if command -v /usr/bin/valgrind >/dev/null 2>&1; then + io::run valgrind --leak-check=full "${cmake_bin_dir}/quickstart_grpc" "${run_args[@]}" + else + io::run env MALLOC_CHECK_=3 "${cmake_bin_dir}/quickstart_grpc" "${run_args[@]}" + fi + + # echo + # io::log "[ Make ]" + # local makefile_bin_dir="${PROJECT_ROOT}/cmake-out/quickstart/makefile-storage_grpc" + # LD_LIBRARY_PATH="${prefix}/lib64:${prefix}/lib:${LD_LIBRARY_PATH:-}" \ + # "${makefile_bin_dir}/quickstart_grpc" "${run_args[@]}" } function quickstart::run_one_quickstart() { @@ -119,10 +141,15 @@ function quickstart::run_one_quickstart() { io::log "[ CMake ]" local cmake_bin_dir="${PROJECT_ROOT}/cmake-out/quickstart/cmake-${bin_dir_suffix}" - io::run "${cmake_bin_dir}/quickstart" "${run_args[@]}" + quickstart_program="${cmake_bin_dir}/quickstart" + if command -v /usr/bin/valgrind >/dev/null 2>&1; then + io::run valgrind --leak-check=full "${cmake_bin_dir}/quickstart" "${run_args[@]}" + else + io::run env MALLOC_CHECK_=3 "${cmake_bin_dir}/quickstart" "${run_args[@]}" + fi - echo - io::log "[ Make ]" - local makefile_bin_dir="${PROJECT_ROOT}/cmake-out/quickstart/makefile-${bin_dir_suffix}" - io::run env LD_LIBRARY_PATH="${prefix}/lib64:${prefix}/lib:${LD_LIBRARY_PATH:-}" "${makefile_bin_dir}/quickstart" "${run_args[@]}" + # echo + # io::log "[ Make ]" + # local makefile_bin_dir="${PROJECT_ROOT}/cmake-out/quickstart/makefile-${bin_dir_suffix}" + # io::run env LD_LIBRARY_PATH="${prefix}/lib64:${prefix}/lib:${LD_LIBRARY_PATH:-}" "${makefile_bin_dir}/quickstart" "${run_args[@]}" } diff --git a/ci/cloudbuild/builds/m32.sh b/ci/cloudbuild/builds/m32.sh index bac62106191d3..6db88dafa98f1 100755 --- a/ci/cloudbuild/builds/m32.sh +++ b/ci/cloudbuild/builds/m32.sh @@ -35,6 +35,7 @@ readonly ENABLED_FEATURES # This is the build to test with -m32, which requires a toolchain file. io::run cmake "${cmake_args[@]}" \ "--toolchain" "${PROJECT_ROOT}/ci/etc/m32-toolchain.cmake" \ + -DCMAKE_CXX_STANDARD=17 \ -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" io::run cmake --build cmake-out mapfile -t ctest_args < <(ctest::common_args) diff --git a/ci/cloudbuild/builds/noex.sh b/ci/cloudbuild/builds/noex.sh index 4cffa4618ddcc..2cab6111b68da 100755 --- a/ci/cloudbuild/builds/noex.sh +++ b/ci/cloudbuild/builds/noex.sh @@ -32,6 +32,7 @@ readonly ENABLED_FEATURES io::run cmake "${cmake_args[@]}" \ -DGOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS=NO \ + -DCMAKE_CXX_STANDARD=17 \ -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" io::run cmake --build cmake-out mapfile -t ctest_args < <(ctest::common_args) diff --git a/ci/cloudbuild/builds/otel-disabled-bazel.sh b/ci/cloudbuild/builds/otel-disabled-bazel.sh deleted file mode 100755 index 63901b1811069..0000000000000 --- a/ci/cloudbuild/builds/otel-disabled-bazel.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -euo pipefail - -source "$(dirname "$0")/../../lib/init.sh" -source module ci/cloudbuild/builds/lib/bazel.sh -source module ci/cloudbuild/builds/lib/cloudcxxrc.sh - -export CC=clang -export CXX=clang++ - -mapfile -t args < <(bazel::common_args) -args+=("--//:enable_opentelemetry=false") -# Note that we do not ignore `//:opentelemetry`, as the exporters should be -# usable whether google-cloud-cpp is built with OpenTelemetry or not. -ignore=( - # These integration tests use opentelemetry matchers out of convenience. - "-//google/cloud/opentelemetry/integration_tests/..." - # The quickstart demonstrates client tracing instrumentation, and thus it - # depends on google-cloud-cpp being built with OpenTelemetry. - "-//google/cloud/opentelemetry/quickstart/..." -) -bazel test "${args[@]}" --test_tag_filters=-integration-test -- "${BAZEL_TARGETS[@]}" "${ignore[@]}" diff --git a/ci/cloudbuild/builds/publish-docs.sh b/ci/cloudbuild/builds/publish-docs.sh index 5f40ea6504bdb..df74fe7f9e889 100755 --- a/ci/cloudbuild/builds/publish-docs.sh +++ b/ci/cloudbuild/builds/publish-docs.sh @@ -40,6 +40,7 @@ fi doc_args=( "-DCMAKE_BUILD_TYPE=Debug" + "-DCMAKE_CXX_STANDARD=17" "-DGOOGLE_CLOUD_CPP_GENERATE_DOXYGEN=ON" "-DGOOGLE_CLOUD_CPP_INTERNAL_DOCFX=ON" "-DGOOGLE_CLOUD_CPP_ENABLE=${ENABLED_FEATURES}" @@ -93,6 +94,8 @@ function stage_docfx() { local path="${binary_dir}/google/cloud/${feature}/docfx" if [[ "${feature}" == "common" ]]; then path="${binary_dir}/google/cloud/docfx" + elif [[ "${feature}" == "guides" ]]; then + path="${binary_dir}/product-neutral-guides/docfx" fi echo "path=${path}" >"${log}" @@ -119,6 +122,7 @@ io::log "bucket: gs://${docfx_bucket}" # have documentation, such as `experimental-storage_grpc`. These are harmless, # as the `stage_docfx()` function skips missing directories without an error. uploaded=(common) +uploaded+=(guides) uploaded+=("${FEATURE_LIST[@]}") echo "${uploaded[@]}" | xargs -P "$(nproc)" -n 1 \ bash -c "stage_docfx \"\${0}\" \"${docfx_bucket}\" cmake-out \"cmake-out/\${0}.docfx.log\"" diff --git a/ci/cloudbuild/builds/quickstart-bazel.sh b/ci/cloudbuild/builds/quickstart-bazel.sh index 3a86351e7a5c1..edbd65bbf1d24 100755 --- a/ci/cloudbuild/builds/quickstart-bazel.sh +++ b/ci/cloudbuild/builds/quickstart-bazel.sh @@ -26,7 +26,11 @@ export CXX=g++ mapfile -t args < <(bazel::common_args) for lib in $(quickstart::libraries); do - io::log_h2 "Running Bazel quickstart for ${lib}" - env -C "${PROJECT_ROOT}/google/cloud/${lib}/quickstart" \ - bazel build "${args[@]}" :quickstart + io::log_h2 "Building Bazel quickstart for ${lib} using WORKSPACE" + USE_BAZEL_VERSION=7.6.1 io::run env -C "${PROJECT_ROOT}/google/cloud/${lib}/quickstart" \ + bazel build --enable_workspace --noenable_bzlmod "${args[@]}" :quickstart + + io::log_h2 "Building Bazel quickstart for ${lib} using MODULE" + USE_BAZEL_VERSION=8.5.1 io::run env -C "${PROJECT_ROOT}/google/cloud/${lib}/quickstart" \ + bazel build --noenable_workspace --enable_bzlmod "${args[@]}" :quickstart done diff --git a/ci/cloudbuild/builds/quickstart-cmake.sh b/ci/cloudbuild/builds/quickstart-cmake.sh index 8a5baa15a840e..64a4ecc667b7b 100755 --- a/ci/cloudbuild/builds/quickstart-cmake.sh +++ b/ci/cloudbuild/builds/quickstart-cmake.sh @@ -60,6 +60,7 @@ mapfile -t features < <( feature_list="$(printf ";%s" "${features[@]}")" feature_list="${feature_list:1}" io::run cmake -G Ninja \ + -DCMAKE_CXX_STANDARD=17 \ -S "${PROJECT_ROOT}/ci/verify_quickstart" \ -B "${PROJECT_ROOT}/cmake-out/quickstart" \ -DCMAKE_TOOLCHAIN_FILE="${vcpkg_dir}/scripts/buildsystems/vcpkg.cmake" \ diff --git a/ci/cloudbuild/builds/quickstart-production.sh b/ci/cloudbuild/builds/quickstart-production.sh index 73f226bb73a1d..ea63c181e89fd 100755 --- a/ci/cloudbuild/builds/quickstart-production.sh +++ b/ci/cloudbuild/builds/quickstart-production.sh @@ -35,6 +35,7 @@ readonly ENABLED_FEATURES io::run cmake "${cmake_args[@]}" \ -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_MESSAGE=NEVER \ -DBUILD_SHARED_LIBS=ON \ -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" diff --git a/ci/cloudbuild/builds/scan-build.sh b/ci/cloudbuild/builds/scan-build.sh index 7c71cd3891487..2846f0829d34c 100755 --- a/ci/cloudbuild/builds/scan-build.sh +++ b/ci/cloudbuild/builds/scan-build.sh @@ -38,5 +38,6 @@ scan_build=( "${HOME}/scan-build" ) io::run "${scan_build[@]}" cmake "${cmake_args[@]}" \ + -DCMAKE_CXX_STANDARD=17 \ -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" io::run "${scan_build[@]}" cmake --build cmake-out diff --git a/ci/cloudbuild/builds/shared.sh b/ci/cloudbuild/builds/shared.sh index 26ecce68ed514..9bcd6a6243d66 100755 --- a/ci/cloudbuild/builds/shared.sh +++ b/ci/cloudbuild/builds/shared.sh @@ -33,6 +33,7 @@ readonly ENABLED_FEATURES io::run cmake "${cmake_args[@]}" \ -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_MESSAGE=NEVER \ -DBUILD_SHARED_LIBS=ON \ -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" diff --git a/ci/cloudbuild/dockerfiles/demo-alpine-stable.Dockerfile b/ci/cloudbuild/dockerfiles/demo-alpine-stable.Dockerfile index 3b27a85bc7ae8..027023d7686af 100644 --- a/ci/cloudbuild/dockerfiles/demo-alpine-stable.Dockerfile +++ b/ci/cloudbuild/dockerfiles/demo-alpine-stable.Dockerfile @@ -58,27 +58,22 @@ ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig # ```bash RUN apk update && \ - apk add abseil-cpp-dev crc32c-dev c-ares-dev curl-dev grpc-dev \ + apk add abseil-cpp-dev c-ares-dev curl-dev grpc-dev \ protobuf-dev nlohmann-json openssl-dev re2-dev # ``` # #### opentelemetry-cpp -# The project has an **optional** dependency on the OpenTelemetry library. -# We recommend installing this library because: -# - the dependency will become required in the google-cloud-cpp v3.x series. -# - it is needed to produce distributed traces of the library. - # ```bash WORKDIR /var/tmp/build/opentelemetry-cpp -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -DWITH_EXAMPLES=OFF \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -88,6 +83,8 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20 ## [DONE packaging.md] +RUN apk update && apk add gdb + # Speed up the CI builds using sccache. WORKDIR /var/tmp/sccache RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz | \ @@ -95,3 +92,5 @@ RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/scca mkdir -p /usr/local/bin && \ mv sccache /usr/local/bin/sccache && \ chmod +x /usr/local/bin/sccache + +ENV DEMO_CORD_WORKAROUND=OFF diff --git a/ci/cloudbuild/dockerfiles/demo-debian-bookworm.Dockerfile b/ci/cloudbuild/dockerfiles/demo-debian-bookworm.Dockerfile index 4ed72ae9a418b..4ea7d35d571f6 100644 --- a/ci/cloudbuild/dockerfiles/demo-debian-bookworm.Dockerfile +++ b/ci/cloudbuild/dockerfiles/demo-debian-bookworm.Dockerfile @@ -23,7 +23,7 @@ ARG NCPU=4 RUN apt-get update && \ apt-get --no-install-recommends install -y apt-transport-https apt-utils \ automake build-essential ca-certificates cmake curl git \ - gcc g++ m4 make ninja-build pkg-config tar wget zlib1g-dev + gcc g++ m4 make ninja-build pkg-config tar wget zlib1g-dev libc6-dbg # ``` # Install the development packages for direct `google-cloud-cpp` dependencies: @@ -31,9 +31,6 @@ RUN apt-get update && \ # ```bash RUN apt-get update && \ apt-get --no-install-recommends install -y \ - libabsl-dev \ - libprotobuf-dev protobuf-compiler \ - libgrpc++-dev libgrpc-dev protobuf-compiler-grpc \ libcurl4-openssl-dev libssl-dev nlohmann-json3-dev # ``` @@ -58,44 +55,53 @@ RUN curl -fsSL https://distfiles.ariadne.space/pkgconf/pkgconf-2.2.0.tar.gz | \ ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig # ``` -# #### crc32c +# #### Abseil -# The project depends on the Crc32c library, we need to compile this from -# source: +# ```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/crc32c -RUN curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ +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=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ + -Dprotobuf_BUILD_TESTS=OFF \ + -Dprotobuf_ABSL_PROVIDER=package \ -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ - ldconfig + ldconfig && \ + ln -s /usr/local/bin/protoc /usr/bin/protoc # ``` # #### opentelemetry-cpp -# The project has an **optional** dependency on the OpenTelemetry library. -# We recommend installing this library because: -# - the dependency will become required in the google-cloud-cpp v3.x series. -# - it is needed to produce distributed traces of the library. - # ```bash WORKDIR /var/tmp/build/opentelemetry-cpp -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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 \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -104,8 +110,63 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20 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.2.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 apt-get update && \ + apt-get --no-install-recommends install -y gdb + WORKDIR /var/tmp/sccache RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz | \ tar -zxf - --strip-components=1 && \ @@ -115,3 +176,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 diff --git a/ci/cloudbuild/dockerfiles/demo-debian-bullseye.Dockerfile b/ci/cloudbuild/dockerfiles/demo-debian-bullseye.Dockerfile index 7d847693157ae..bde9040639ed1 100644 --- a/ci/cloudbuild/dockerfiles/demo-debian-bullseye.Dockerfile +++ b/ci/cloudbuild/dockerfiles/demo-debian-bullseye.Dockerfile @@ -22,26 +22,27 @@ ARG NCPU=4 # ```bash RUN apt-get update && \ apt-get --no-install-recommends install -y apt-transport-https apt-utils \ - automake build-essential ca-certificates cmake curl git \ + automake build-essential ca-certificates curl git \ gcc g++ libc-ares-dev libc-ares2 libcurl4-openssl-dev \ - libssl-dev m4 make ninja-build pkg-config tar wget zlib1g-dev + libssl-dev m4 make ninja-build pkg-config tar wget zlib1g-dev libc6-dbg # ``` -# #### Abseil +# #### Install CMake v3.22 +WORKDIR /var/tmp/build/cmake +RUN curl -fsSL https://github.com/Kitware/cmake/archive/v3.22.3.tar.gz | \ + tar -xzf - --strip-components=1 && \ + ./bootstrap && make -j ${NCPU:-4} && make install -# Debian 11 ships with Abseil==20200923.3. Unfortunately, the current gRPC -# version needs Abseil >= 20210324. Enabling `ABSL_PROPAGATE_CXX_STD` -# propagates the version of C++ used to compile Abseil to anything that depends -# on Abseil. +# #### Abseil # ```bash WORKDIR /var/tmp/build/abseil-cpp -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.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 \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DABSL_BUILD_TESTING=OFF \ - -DABSL_PROPAGATE_CXX_STD=ON \ -DBUILD_SHARED_LIBS=yes \ -S . -B cmake-out && \ cmake --build cmake-out -- -j ${NCPU:-4} && \ @@ -49,27 +50,6 @@ RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.1.tar.gz | ldconfig # ``` -# #### crc32c - -# The project depends on the Crc32c library, we need to compile this from -# source: - -# ```bash -WORKDIR /var/tmp/build/crc32c -RUN curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ - -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ - cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ - ldconfig -# ``` - # #### nlohmann_json library # Debian 11 also ships with nlohmann-json==3.9.1, which is recent enough for our needs: @@ -88,10 +68,11 @@ RUN apt-get update && \ # ```bash WORKDIR /var/tmp/build/protobuf -RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz | \ +RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v33.1.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -Dprotobuf_BUILD_TESTS=OFF \ -Dprotobuf_ABSL_PROVIDER=package \ @@ -110,7 +91,7 @@ RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz 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=Release \ + cmake -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_SHARED_LIBS=ON \ -DRE2_BUILD_TESTING=OFF \ -S . -B cmake-out && \ @@ -121,14 +102,13 @@ RUN curl -fsSL https://github.com/google/re2/archive/2025-07-22.tar.gz | \ # #### gRPC -# Finally, we build gRPC from source: - # ```bash WORKDIR /var/tmp/build/grpc -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.69.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 \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -DgRPC_INSTALL=ON \ -DgRPC_BUILD_TESTS=OFF \ @@ -145,21 +125,16 @@ RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.69.0.tar.gz | \ # #### opentelemetry-cpp -# The project has an **optional** dependency on the OpenTelemetry library. -# We recommend installing this library because: -# - the dependency will become required in the google-cloud-cpp v3.x series. -# - it is needed to produce distributed traces of the library. - # ```bash WORKDIR /var/tmp/build/opentelemetry-cpp -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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 \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -170,6 +145,9 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20 ## [DONE packaging.md] +RUN apt-get update && \ + apt-get --no-install-recommends install -y gdb + WORKDIR /var/tmp/sccache RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz | \ tar -zxf - --strip-components=1 && \ @@ -179,3 +157,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 diff --git a/ci/cloudbuild/dockerfiles/demo-fedora.Dockerfile b/ci/cloudbuild/dockerfiles/demo-fedora.Dockerfile index 9e63de4fad809..302e5b7bf392a 100644 --- a/ci/cloudbuild/dockerfiles/demo-fedora.Dockerfile +++ b/ci/cloudbuild/dockerfiles/demo-fedora.Dockerfile @@ -22,7 +22,8 @@ ARG NCPU=4 # ```bash RUN dnf makecache && \ dnf install -y cmake curl findutils gcc-c++ git make ninja-build \ - patch unzip tar wget zip + patch unzip tar wget zip dnf-utils +RUN dnf makecache && dnf debuginfo-install -y glibc # ``` # Fedora:40 includes packages, with recent enough versions, for most of the @@ -31,7 +32,7 @@ RUN dnf makecache && \ # ```bash RUN dnf makecache && \ dnf install -y protobuf-compiler protobuf-devel grpc-cpp grpc-devel \ - json-devel libcurl-devel google-crc32c-devel openssl-devel + json-devel libcurl-devel openssl-devel # ``` # #### Patching pkg-config @@ -54,14 +55,6 @@ RUN curl -fsSL https://distfiles.ariadne.space/pkgconf/pkgconf-2.2.0.tar.gz | \ ldconfig && cd /var/tmp && rm -fr build # ``` -# Older versions of Fedora hard-code RE2 to use C++11. It was fixed starting -# with Fedora:38. If you using Fedora >= 38 or you are not planning to use -# `pkg-config(1)` you can ignore this step. Alternatively, you can install RE2 -# and gRPC from source. -# ``` -# sed -i 's/-std=c\+\+11 //' /usr/lib64/pkgconfig/re2.pc -# ``` - # The following steps will install libraries and tools in `/usr/local`. By # default, pkgconf does not search in these directories. We need to explicitly # set the search path. @@ -72,21 +65,16 @@ ENV PKG_CONFIG_PATH=/usr/local/share/pkgconfig:/usr/lib64/pkgconfig:/usr/local/l # #### opentelemetry-cpp -# The project has an **optional** dependency on the OpenTelemetry library. -# We recommend installing this library because: -# - the dependency will become required in the google-cloud-cpp v3.x series. -# - it is needed to produce distributed traces of the library. - # ```bash WORKDIR /var/tmp/build/opentelemetry-cpp -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -DWITH_EXAMPLES=OFF \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -97,6 +85,8 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20 ## [DONE packaging.md] +RUN dnf makecache && dnf install -y gdb + WORKDIR /var/tmp/sccache RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz | \ tar -zxf - --strip-components=1 && \ diff --git a/ci/cloudbuild/dockerfiles/demo-opensuse-leap.Dockerfile b/ci/cloudbuild/dockerfiles/demo-opensuse-leap.Dockerfile index 5e07d8be4d975..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 \ - gcc gcc-c++ 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 libcrc32c-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 @@ -50,23 +49,58 @@ ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig ENV PATH=/usr/local/bin:${PATH} # ``` -# #### opentelemetry-cpp +# Use the following environment variables to configure the compiler used by +# CMake. +ENV CC=gcc-9 +ENV CXX=g++-9 + +# #### 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 -# The project has an **optional** dependency on the OpenTelemetry library. -# We recommend installing this library because: -# - the dependency will become required in the google-cloud-cpp v3.x series. -# - it is needed to produce distributed traces of the library. +# ```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 +# ``` + +# #### opentelemetry-cpp # ```bash WORKDIR /var/tmp/build/opentelemetry-cpp -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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 \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -75,15 +109,63 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20 ldconfig # ``` -# Use the following environment variables to configure the compiler used by -# CMake. +# #### 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 +# ``` -ENV CXX=g++-8 +# #### gRPC -ENV CC=gcc-8 +# ```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 && \ + zypper install --allow-downgrade -y gdb + WORKDIR /var/tmp/sccache RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz | \ tar -zxf - --strip-components=1 && \ @@ -93,3 +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 6c97967e70375..15bd62307002a 100644 --- a/ci/cloudbuild/dockerfiles/demo-rockylinux-9.Dockerfile +++ b/ci/cloudbuild/dockerfiles/demo-rockylinux-9.Dockerfile @@ -27,7 +27,9 @@ RUN dnf makecache && \ dnf makecache && \ dnf install -y cmake findutils gcc-c++ git make openssl-devel \ patch zlib-devel libcurl-devel c-ares-devel tar wget which \ - autoconf automake libtool binutils + autoconf automake libtool binutils dnf-utils +RUN dnf makecache && dnf debuginfo-install -y glibc + # ``` # Set some useful environment variables. @@ -68,19 +70,14 @@ ENV PATH=/usr/local/bin:${PATH} # #### Abseil -# Rocky Linux 9 includes a package for Abseil, unfortunately, this package is -# incomplete, as it lacks the CMake support files for it. We need to compile -# Abseiil from source. Enabling `ABSL_PROPAGATE_CXX_STD` propagates the version -# of C++ used to compile Abseil to anything that depends on Abseil. - # ```bash WORKDIR /var/tmp/build/abseil-cpp -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.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 \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DABSL_BUILD_TESTING=OFF \ - -DABSL_PROPAGATE_CXX_STD=ON \ -DBUILD_SHARED_LIBS=yes \ -S . -B cmake-out && \ cmake --build cmake-out -- -j ${NCPU:-4} && \ @@ -96,10 +93,11 @@ RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.1.tar.gz | # ```bash WORKDIR /var/tmp/build/protobuf -RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz | \ +RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v33.1.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -Dprotobuf_BUILD_TESTS=OFF \ -Dprotobuf_ABSL_PROVIDER=package \ @@ -119,7 +117,7 @@ RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz 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=Release \ + cmake -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_SHARED_LIBS=ON \ -DRE2_BUILD_TESTING=OFF \ -S . -B cmake-out && \ @@ -137,11 +135,11 @@ 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.69.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 \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_SHARED_LIBS=yes \ -DgRPC_INSTALL=ON \ -DgRPC_BUILD_TESTS=OFF \ @@ -157,27 +155,6 @@ RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.69.0.tar.gz | \ ldconfig # ``` -# #### crc32c - -# The project depends on the Crc32c library, we need to compile this from -# source: - -# ```bash -WORKDIR /var/tmp/build/crc32c -RUN curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ - -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ - cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ - ldconfig -# ``` - # #### nlohmann_json library # The project depends on the nlohmann_json library. We use CMake to @@ -190,7 +167,7 @@ WORKDIR /var/tmp/build/json RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_SHARED_LIBS=yes \ -DBUILD_TESTING=OFF \ -DJSON_BuildTests=OFF \ @@ -201,21 +178,16 @@ RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ # #### opentelemetry-cpp -# The project has an **optional** dependency on the OpenTelemetry library. -# We recommend installing this library because: -# - the dependency will become required in the google-cloud-cpp v3.x series. -# - it is needed to produce distributed traces of the library. - # ```bash WORKDIR /var/tmp/build/opentelemetry-cpp -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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 \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -226,6 +198,8 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20 ## [DONE packaging.md] +RUN dnf makecache && dnf update -y && dnf install -y gdb + WORKDIR /var/tmp/sccache RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz | \ tar -zxf - --strip-components=1 && \ @@ -235,3 +209,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 diff --git a/ci/cloudbuild/dockerfiles/demo-ubuntu-24.04.Dockerfile b/ci/cloudbuild/dockerfiles/demo-ubuntu-24.04.Dockerfile index 8f14cae6f71fd..be694f5466ddf 100644 --- a/ci/cloudbuild/dockerfiles/demo-ubuntu-24.04.Dockerfile +++ b/ci/cloudbuild/dockerfiles/demo-ubuntu-24.04.Dockerfile @@ -23,7 +23,7 @@ ARG NCPU=4 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get --no-install-recommends install -y apt-transport-https apt-utils \ - cmake ca-certificates curl git gcc g++ m4 make tar + cmake ca-certificates curl git gcc g++ m4 make tar libc6-dbg # ``` # Ubuntu:24 includes packages for most of the direct dependencies of @@ -33,11 +33,8 @@ RUN apt-get update && \ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get --no-install-recommends install -y \ - libabsl-dev \ - libcurl4-openssl-dev \ - libgrpc++-dev protobuf-compiler-grpc \ - libprotobuf-dev protobuf-compiler \ - nlohmann-json3-dev + libssl-dev libcurl4-openssl-dev nlohmann-json3-dev zlib1g-dev \ + libsystemd-dev # ``` # #### Patching pkg-config @@ -62,45 +59,49 @@ RUN curl -fsSL https://distfiles.ariadne.space/pkgconf/pkgconf-2.2.0.tar.gz | \ RUN ln -s /usr/bin/pkgconf /usr/bin/pkg-config # ``` +# #### Abseil -# #### crc32c +# ```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 \ + -DABSL_BUILD_TESTING=OFF \ + -DBUILD_SHARED_LIBS=yes \ + -S . -B cmake-out && \ + cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ + ldconfig +# ``` -# The project depends on the Crc32c library, we need to compile this from -# source: +# #### Protobuf # ```bash -WORKDIR /var/tmp/build/crc32c -RUN curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ +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=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ + -Dprotobuf_BUILD_TESTS=OFF \ + -Dprotobuf_ABSL_PROVIDER=package \ -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ ldconfig # ``` # #### opentelemetry-cpp -# The project has an **optional** dependency on the OpenTelemetry library. -# We recommend installing this library because: -# - the dependency will become required in the google-cloud-cpp v3.x series. -# - it is needed to produce distributed traces of the library. - # ```bash WORKDIR /var/tmp/build/opentelemetry-cpp -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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 \ -DBUILD_SHARED_LIBS=yes \ -DWITH_EXAMPLES=OFF \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -109,8 +110,64 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20 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.2.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ + -DBUILD_SHARED_LIBS=ON \ + -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 \ + -DgRPC_BUILD_GRPCPP_OTEL_PLUGIN=ON \ + -S . -B cmake-out && \ + cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ + ldconfig +# ``` + ## [DONE packaging.md] +RUN apt-get update && \ + apt-get --no-install-recommends install -y gdb + WORKDIR /var/tmp/sccache RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz | \ tar -zxf - --strip-components=1 && \ @@ -120,3 +177,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 diff --git a/ci/cloudbuild/dockerfiles/demo-ubuntu-focal.Dockerfile b/ci/cloudbuild/dockerfiles/demo-ubuntu-focal.Dockerfile deleted file mode 100644 index f0c9d4934fdba..0000000000000 --- a/ci/cloudbuild/dockerfiles/demo-ubuntu-focal.Dockerfile +++ /dev/null @@ -1,194 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu:focal -ARG NCPU=4 - -## [BEGIN packaging.md] - -# Install the minimal development tools, libcurl, OpenSSL and libc-ares: - -# ```bash -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && \ - apt-get --no-install-recommends install -y apt-transport-https apt-utils \ - automake build-essential cmake ca-certificates curl git \ - gcc g++ libc-ares-dev libc-ares2 libcurl4-openssl-dev \ - libssl-dev m4 make pkg-config tar wget zlib1g-dev -# ``` - -# #### Abseil - -# We need a recent version of Abseil. Enabling `ABSL_PROPAGATE_CXX_STD` -# propagates the version of C++ used to compile Abseil to anything that depends -# on Abseil. - -# ```bash -WORKDIR /var/tmp/build/abseil-cpp -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.1.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DABSL_BUILD_TESTING=OFF \ - -DABSL_PROPAGATE_CXX_STD=ON \ - -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 - -# We need to install a version of Protobuf that is recent enough to support the -# Google Cloud Platform proto files: - -# ```bash -WORKDIR /var/tmp/build/protobuf -RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -Dprotobuf_BUILD_TESTS=OFF \ - -Dprotobuf_ABSL_PROVIDER=package \ - -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ - cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ - ldconfig -# ``` - -# #### RE2 - -# The version of RE2 included with this distro hard-codes C++11 in its -# pkg-config file. You can skip this build and use the system's package if -# you are not planning to use pkg-config. - -# ```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=Release \ - -DBUILD_SHARED_LIBS=ON \ - -DRE2_BUILD_TESTING=OFF \ - -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ - cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ - ldconfig -# ``` - -# #### gRPC - -# We also need a version of gRPC that is recent enough to support the Google -# Cloud Platform proto files. We install it using: - -# ```bash -WORKDIR /var/tmp/build/grpc -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.69.0.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -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 \ - -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ - cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ - ldconfig -# ``` - -# #### crc32c - -# The project depends on the Crc32c library, we need to compile this from -# source: - -# ```bash -WORKDIR /var/tmp/build/crc32c -RUN curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ - -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ - cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ - ldconfig -# ``` - -# #### nlohmann_json library - -# The project depends on the nlohmann_json library. We use CMake to -# install it as this installs the necessary CMake configuration files. -# Note that this is a header-only library, and often installed manually. -# This leaves your environment without support for CMake pkg-config. - -# ```bash -WORKDIR /var/tmp/build/json -RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DBUILD_TESTING=OFF \ - -DJSON_BuildTests=OFF \ - -S . -B cmake-out && \ - cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ - ldconfig -# ``` - -# #### opentelemetry-cpp - -# The project has an **optional** dependency on the OpenTelemetry library. -# We recommend installing this library because: -# - the dependency will become required in the google-cloud-cpp v3.x series. -# - it is needed to produce distributed traces of the library. - -# ```bash -WORKDIR /var/tmp/build/opentelemetry-cpp -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DWITH_EXAMPLES=OFF \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ - -DBUILD_TESTING=OFF \ - -DOPENTELEMETRY_INSTALL=ON \ - -DOPENTELEMETRY_ABI_VERSION_NO=2 \ - -S . -B cmake-out && \ - cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ - ldconfig -# ``` - -## [DONE packaging.md] - -WORKDIR /var/tmp/sccache -RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz | \ - tar -zxf - --strip-components=1 && \ - mkdir -p /usr/local/bin && \ - mv sccache /usr/local/bin/sccache && \ - chmod +x /usr/local/bin/sccache - -# Update the ld.conf cache in case any libraries were installed in /usr/local/lib* -RUN ldconfig /usr/local/lib* diff --git a/ci/cloudbuild/dockerfiles/demo-ubuntu-jammy.Dockerfile b/ci/cloudbuild/dockerfiles/demo-ubuntu-jammy.Dockerfile index 1f5d6c164c893..bd56e96c73661 100644 --- a/ci/cloudbuild/dockerfiles/demo-ubuntu-jammy.Dockerfile +++ b/ci/cloudbuild/dockerfiles/demo-ubuntu-jammy.Dockerfile @@ -25,23 +25,19 @@ RUN apt-get update && \ apt-get --no-install-recommends install -y apt-transport-https apt-utils \ automake build-essential cmake ca-certificates curl git \ gcc g++ libc-ares-dev libc-ares2 libcurl4-openssl-dev libre2-dev \ - libssl-dev m4 make pkg-config tar wget zlib1g-dev + libssl-dev m4 make pkg-config tar wget zlib1g-dev libc6-dbg # ``` # #### Abseil -# We need a recent version of Abseil. Enabling `ABSL_PROPAGATE_CXX_STD` -# propagates the version of C++ used to compile Abseil to anything that depends -# on Abseil. - # ```bash WORKDIR /var/tmp/build/abseil-cpp -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.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 \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DABSL_BUILD_TESTING=OFF \ - -DABSL_PROPAGATE_CXX_STD=ON \ -DBUILD_SHARED_LIBS=yes \ -S . -B cmake-out && \ cmake --build cmake-out -- -j ${NCPU:-4} && \ @@ -56,10 +52,11 @@ RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.1.tar.gz | # ```bash WORKDIR /var/tmp/build/protobuf -RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz | \ +RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v33.1.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -Dprotobuf_BUILD_TESTS=OFF \ -Dprotobuf_ABSL_PROVIDER=package \ @@ -76,10 +73,11 @@ RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz # ```bash WORKDIR /var/tmp/build/grpc -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.69.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 \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -DgRPC_INSTALL=ON \ -DgRPC_BUILD_TESTS=OFF \ @@ -95,27 +93,6 @@ RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.69.0.tar.gz | \ ldconfig # ``` -# #### crc32c - -# The project depends on the Crc32c library, we need to compile this from -# source: - -# ```bash -WORKDIR /var/tmp/build/crc32c -RUN curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ - -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ - cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ - ldconfig -# ``` - # #### nlohmann_json library # The project depends on the nlohmann_json library. We use CMake to @@ -128,7 +105,7 @@ WORKDIR /var/tmp/build/json RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_SHARED_LIBS=yes \ -DBUILD_TESTING=OFF \ -DJSON_BuildTests=OFF \ @@ -139,21 +116,16 @@ RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ # #### opentelemetry-cpp -# The project has an **optional** dependency on the OpenTelemetry library. -# We recommend installing this library because: -# - the dependency will become required in the google-cloud-cpp v3.x series. -# - it is needed to produce distributed traces of the library. - # ```bash WORKDIR /var/tmp/build/opentelemetry-cpp -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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 \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -164,6 +136,9 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20 ## [DONE packaging.md] +RUN apt-get update && \ + apt-get --no-install-recommends install -y gdb + WORKDIR /var/tmp/sccache RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz | \ tar -zxf - --strip-components=1 && \ @@ -173,3 +148,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 diff --git a/ci/cloudbuild/dockerfiles/fedora-latest-bazel.Dockerfile b/ci/cloudbuild/dockerfiles/fedora-latest-bazel.Dockerfile index 44904a1aec020..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.24.1/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 ebb032c5804a5..a5ebcfac33e4a 100644 --- a/ci/cloudbuild/dockerfiles/fedora-latest-cmake.Dockerfile +++ b/ci/cloudbuild/dockerfiles/fedora-latest-cmake.Dockerfile @@ -40,7 +40,9 @@ 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 # Sets root's password to the empty string to enable users to get a root shell # inside the container with `su -` and no password. Sudo would not work because @@ -48,6 +50,18 @@ RUN dnf makecache && dnf install -y pugixml-devel yaml-cpp-devel # 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 @@ -70,12 +84,11 @@ 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/20250127.1.tar.gz | \ +RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ - sed -i 's/^#define ABSL_OPTION_USE_\(.*\) 2/#define ABSL_OPTION_USE_\1 0/' "absl/base/options.h" && \ - sed -i 's/^#define ABSL_OPTION_USE_INLINE_NAMESPACE 1$/#define ABSL_OPTION_USE_INLINE_NAMESPACE 0/' "absl/base/options.h" && \ cmake \ -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_CXX_STANDARD=17 \ -DABSL_BUILD_TESTING=OFF \ -DBUILD_SHARED_LIBS=yes \ -GNinja -S . -B cmake-out && \ @@ -93,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" \ @@ -103,19 +116,6 @@ RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.2.tar.gz | \ cmake --build cmake-out --target install && \ ldconfig && cd /var/tmp && rm -fr build -WORKDIR /var/tmp/build -RUN curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out --target install && \ - ldconfig && cd /var/tmp && rm -fr build - WORKDIR /var/tmp/build RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ tar -xzf - --strip-components=1 && \ @@ -129,10 +129,11 @@ RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ ldconfig && cd /var/tmp && rm -fr build WORKDIR /var/tmp/build/protobuf -RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz | \ +RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v33.1.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -Dprotobuf_BUILD_TESTS=OFF \ -Dprotobuf_ABSL_PROVIDER=package \ @@ -141,16 +142,15 @@ RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz ldconfig && cd /var/tmp && rm -fr build WORKDIR /var/tmp/build/ -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24.0.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_CXX_STANDARD=14 \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ -DBUILD_SHARED_LIBS=ON \ -DWITH_EXAMPLES=OFF \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -160,10 +160,11 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20 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.69.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 \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=ON \ -DgRPC_INSTALL=ON \ -DgRPC_BUILD_TESTS=OFF \ diff --git a/ci/cloudbuild/dockerfiles/fedora-latest-cxx14.Dockerfile b/ci/cloudbuild/dockerfiles/fedora-latest-cxx14.Dockerfile deleted file mode 100644 index 74612e722e5c5..0000000000000 --- a/ci/cloudbuild/dockerfiles/fedora-latest-cxx14.Dockerfile +++ /dev/null @@ -1,211 +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. - -FROM fedora:40 -ARG NCPU=4 -ARG ARCH=amd64 - -# Install the basic development tools. -RUN dnf makecache && \ - dnf install -y autoconf automake \ - clang cmake diffutils findutils gcc-c++ git \ - make ninja-build patch python3 \ - python-pip tar unzip wget which zip zlib-devel - -# Install the development packages for libcurl and OpenSSL. Neither are affected -# by the C++ version, so we can use the pre-built binaries. -RUN dnf makecache && \ - dnf install -y libcurl-devel openssl-devel - -# Install the Python modules needed to run the storage emulator -RUN dnf makecache && dnf install -y python3-devel -RUN pip3 install --upgrade pip -RUN pip3 install setuptools wheel - -# The Cloud Pub/Sub emulator needs Java, and so does `bazel coverage` :shrug: -# Bazel needs the '-devel' version with javac. -RUN dnf makecache && dnf install -y java-latest-openjdk-devel - -# Sets root's password to the empty string to enable users to get a root shell -# inside the container with `su -` and no password. Sudo would not work because -# we run these containers as the invoking user's uid, which does not exist in -# the container's /etc/passwd file. -RUN echo 'root:cloudcxx' | chpasswd - -# Fedora's version of `pkg-config` (https://github.com/pkgconf/pkgconf) is slow -# when handling `.pc` files with lots of `Requires:` deps, which happens with -# Abseil, so we use the normal `pkg-config` binary, which seems to not suffer -# from this bottleneck. For more details see -# https://github.com/googleapis/google-cloud-cpp/issues/7052 -WORKDIR /var/tmp/build/pkgconf -RUN curl -fsSL https://distfiles.ariadne.space/pkgconf/pkgconf-2.2.0.tar.gz | \ - tar -xzf - --strip-components=1 && \ - ./configure --prefix=/usr --with-system-libdir=/lib64:/usr/lib64 --with-system-includedir=/usr/include && \ - make -j ${NCPU:-4} && \ - make install && \ - ldconfig && cd /var/tmp && rm -fr build - -# The following steps will install libraries and tools in `/usr/local`. By -# default, pkgconf does not search in these directories. We need to explicitly -# set the search path. -ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig - -# Download and install direct dependencies of `google-cloud-cpp`. Including -# development dependencies. In each case, remove the downloaded files and the -# temporary artifacts after a successful build to keep the image smaller (and -# with fewer layers). - -WORKDIR /var/tmp/build -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.1.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_CXX_STANDARD=14 \ - -DCMAKE_BUILD_TYPE=Release \ - -DABSL_BUILD_TESTING=OFF \ - -DABSL_PROPAGATE_CXX_STD=ON \ - -DBUILD_SHARED_LIBS=yes \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out && cmake --install cmake-out && \ - ldconfig && \ - cd /var/tmp && rm -fr build - -WORKDIR /var/tmp/build -RUN curl -fsSL https://github.com/google/googletest/archive/v1.16.0.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_CXX_STANDARD=14 \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out && cmake --install cmake-out && \ - 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 | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_CXX_STANDARD=14 \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DBENCHMARK_ENABLE_TESTING=OFF \ - -S . -B cmake-out && \ - cmake --build cmake-out && cmake --install cmake-out && \ - ldconfig && \ - cd /var/tmp && rm -fr build - -WORKDIR /var/tmp/build -RUN curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_CXX_STANDARD=14 \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out && cmake --install cmake-out && \ - ldconfig && \ - cd /var/tmp && rm -fr build - -WORKDIR /var/tmp/build -RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_CXX_STANDARD=14 \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DBUILD_TESTING=OFF \ - -DJSON_BuildTests=OFF \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out && cmake --install cmake-out && \ - ldconfig && \ - cd /var/tmp && rm -fr build - -WORKDIR /var/tmp/build/protobuf -RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_CXX_STANDARD=14 \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -Dprotobuf_BUILD_TESTS=OFF \ - -Dprotobuf_ABSL_PROVIDER=package \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out && cmake --install cmake-out && \ - ldconfig && \ - cd /var/tmp && rm -fr build - -WORKDIR /var/tmp/build/ -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_CXX_STANDARD=14 \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ - -DBUILD_SHARED_LIBS=ON \ - -DWITH_EXAMPLES=OFF \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ - -DBUILD_TESTING=OFF \ - -DOPENTELEMETRY_INSTALL=ON \ - -DOPENTELEMETRY_ABI_VERSION_NO=2 \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out && cmake --install cmake-out && \ - ldconfig && cd /var/tmp && rm -fr build - -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.69.0.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_CXX_STANDARD=14 \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=ON \ - -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 \ - -DgRPC_BUILD_GRPCPP_OTEL_PLUGIN=ON \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out && cmake --install cmake-out && \ - ldconfig && \ - cd /var/tmp && rm -fr build - -WORKDIR /var/tmp/sccache -RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz | \ - tar -zxf - --strip-components=1 && \ - mkdir -p /usr/local/bin && \ - mv sccache /usr/local/bin/sccache && \ - chmod +x /usr/local/bin/sccache - -# Install the Cloud SDK and some of the emulators. We use the emulators to run -# integration tests for the client libraries. -COPY . /var/tmp/ci -WORKDIR /var/tmp/downloads -# The Google Cloud CLI requires Python <= 3.10, Fedora defaults to 3.12. -RUN dnf makecache && dnf install -y python3.10 -ENV CLOUDSDK_PYTHON=python3.10 -RUN /var/tmp/ci/install-cloud-sdk.sh -ENV CLOUD_SDK_LOCATION=/usr/local/google-cloud-sdk -ENV PATH=${CLOUD_SDK_LOCATION}/bin:${PATH} - -# Update the ld.conf cache in case any libraries were installed in /usr/local/lib* -RUN ldconfig /usr/local/lib* diff --git a/ci/cloudbuild/dockerfiles/fedora-latest-cxx20.Dockerfile b/ci/cloudbuild/dockerfiles/fedora-latest-cxx20.Dockerfile index 2e4ceda94a7bb..05c72c0054291 100644 --- a/ci/cloudbuild/dockerfiles/fedora-latest-cxx20.Dockerfile +++ b/ci/cloudbuild/dockerfiles/fedora-latest-cxx20.Dockerfile @@ -39,6 +39,10 @@ RUN pip3 install setuptools wheel # Bazel needs the '-devel' version with javac. RUN dnf makecache && dnf install -y java-latest-openjdk-devel +RUN dnf makecache && dnf install -y glibc glibc-devel + +RUN dnf makecache && dnf install -y clang-tools-extra + # Sets root's password to the empty string to enable users to get a root shell # inside the container with `su -` and no password. Sudo would not work because # we run these containers as the invoking user's uid, which does not exist in @@ -69,13 +73,12 @@ 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/20250127.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 \ -DCMAKE_BUILD_TYPE=Release \ -DABSL_BUILD_TESTING=OFF \ - -DABSL_PROPAGATE_CXX_STD=ON \ -DBUILD_SHARED_LIBS=yes \ -GNinja -S . -B cmake-out && \ cmake --build cmake-out && cmake --install cmake-out && \ @@ -95,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 \ @@ -107,21 +110,6 @@ RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.2.tar.gz | \ ldconfig && \ cd /var/tmp && rm -fr build -WORKDIR /var/tmp/build -RUN curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_CXX_STANDARD=20 \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out && cmake --install cmake-out && \ - ldconfig && \ - cd /var/tmp && rm -fr build - WORKDIR /var/tmp/build RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ tar -xzf - --strip-components=1 && \ @@ -137,7 +125,7 @@ RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ cd /var/tmp && rm -fr build WORKDIR /var/tmp/build/protobuf -RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz | \ +RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v33.1.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_CXX_STANDARD=20 \ @@ -151,7 +139,7 @@ RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz cd /var/tmp && rm -fr build WORKDIR /var/tmp/build/ -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24.0.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_CXX_STANDARD=20 \ @@ -160,7 +148,6 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20 -DBUILD_SHARED_LIBS=ON \ -DWITH_EXAMPLES=OFF \ -DWITH_STL=CXX20 \ - -DWITH_ABSEIL=ON \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -170,7 +157,7 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20 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.69.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 edfa43967e05c..9d1e232b3d416 100644 --- a/ci/cloudbuild/dockerfiles/fedora-latest-publish-docs.Dockerfile +++ b/ci/cloudbuild/dockerfiles/fedora-latest-publish-docs.Dockerfile @@ -27,15 +27,13 @@ RUN dnf makecache && \ dnf install -y \ gmock-devel \ google-benchmark-devel \ - google-crc32c-devel \ grpc-devel \ gtest-devel \ json-devel \ 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 @@ -46,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 @@ -63,15 +73,15 @@ RUN curl -fsSL https://github.com/doxygen/doxygen/archive/refs/tags/Release_1_11 cmake --build cmake-out --target install WORKDIR /var/tmp/build/ -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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_CXX_STANDARD=17 \ -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ -DBUILD_SHARED_LIBS=ON \ -DWITH_EXAMPLES=OFF \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ diff --git a/ci/cloudbuild/dockerfiles/fedora-m32.Dockerfile b/ci/cloudbuild/dockerfiles/fedora-m32.Dockerfile index 22e4e93c9af86..29d7f9efeabe2 100644 --- a/ci/cloudbuild/dockerfiles/fedora-m32.Dockerfile +++ b/ci/cloudbuild/dockerfiles/fedora-m32.Dockerfile @@ -36,7 +36,6 @@ RUN dnf makecache && \ glibc-devel.i686 \ gmock-devel.i686 \ google-benchmark-devel.i686 \ - google-crc32c-devel.i686 \ grpc-devel.i686 \ gtest-devel.i686 \ libcurl-devel.i686 \ @@ -100,7 +99,7 @@ RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ # compiled with. And we use the compiler flags from ci/etc/m32-toolchain.cmake # to force a 32-bit install. WORKDIR /var/tmp/build/opentelemetry -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24.0.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_CXX_STANDARD=17 \ @@ -114,8 +113,7 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20 -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ -DBUILD_SHARED_LIBS=ON \ -DWITH_EXAMPLES=OFF \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ diff --git a/ci/cloudbuild/dockerfiles/fedora-msan.Dockerfile b/ci/cloudbuild/dockerfiles/fedora-msan.Dockerfile index 6eef6ad512195..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.24.1/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 547ce3218c655..ae722c9165881 100644 --- a/ci/cloudbuild/dockerfiles/gcc-oldest.Dockerfile +++ b/ci/cloudbuild/dockerfiles/gcc-oldest.Dockerfile @@ -16,20 +16,48 @@ FROM opensuse/leap:15 ARG NCPU=4 RUN zypper refresh && \ - zypper install --allow-downgrade -y automake cmake curl gcc gcc-c++ \ - git gzip libtool make ninja patch tar wget - - -RUN zypper refresh && \ - zypper install --allow-downgrade -y abseil-cpp-devel c-ares-devel \ - libcurl-devel libopenssl-devel libcrc32c-devel nlohmann_json-devel \ - re2-devel + 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 RUN (echo "/usr/local/lib" ; echo "/usr/local/lib64") | \ tee /etc/ld.so.conf.d/usrlocal.conf 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.2.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake \ + -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_BUILD_TYPE=Release \ + -DABSL_BUILD_TESTING=OFF \ + -DBUILD_SHARED_LIBS=yes \ + -GNinja -S . -B cmake-out && \ + cmake --build cmake-out && cmake --install cmake-out && \ + ldconfig && \ + cd /var/tmp && rm -fr build + +WORKDIR /var/tmp/build/re2 +RUN curl -fsSL https://github.com/google/re2/archive/2024-07-02.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_STANDARD=17 \ + -DBUILD_SHARED_LIBS=ON \ + -DRE2_BUILD_TESTING=OFF \ + -S . -B cmake-out && \ + cmake --build cmake-out -- -j ${NCPU:-4} && \ + cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ + ldconfig && \ + cd /var/tmp && rm -fr build + + # Install googletest, remove the downloaded files and the temporary artifacts # after a successful build to keep the image smaller (and with fewer layers) WORKDIR /var/tmp/build @@ -37,6 +65,7 @@ RUN curl -fsSL https://github.com/google/googletest/archive/v1.16.0.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -GNinja -S . -B cmake-out && \ cmake --build cmake-out && cmake --install cmake-out && \ @@ -44,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" \ @@ -55,10 +84,11 @@ RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.2.tar.gz | \ ldconfig && cd /var/tmp && rm -fr build WORKDIR /var/tmp/build/protobuf -RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz | \ +RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v33.1.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -Dprotobuf_BUILD_TESTS=OFF \ -Dprotobuf_ABSL_PROVIDER=package \ @@ -70,15 +100,15 @@ RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz # GCC 7.x. See https://github.com/open-telemetry/opentelemetry-cpp/issues/1014 # for more details. WORKDIR /var/tmp/build/opentelemetry-cpp -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24.0.tar.gz | \ tar -xzf - --strip-components=1 && \ sed -i 's/Stack &GetStack()/Stack \&GetStack() __attribute__((noinline, noclone))/' "api/include/opentelemetry/context/runtime_context.h" && \ cmake \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -DWITH_EXAMPLES=OFF \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -87,10 +117,11 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20 ldconfig && cd /var/tmp && rm -fr build WORKDIR /var/tmp/build/grpc -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.69.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 \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -DgRPC_INSTALL=ON \ -DgRPC_BUILD_TESTS=OFF \ @@ -104,6 +135,18 @@ RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.69.0.tar.gz | \ cmake --build cmake-out && cmake --install cmake-out && \ ldconfig && cd /var/tmp && rm -fr build +WORKDIR /var/tmp/build +RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=yes \ + -DBUILD_TESTING=OFF \ + -DJSON_BuildTests=OFF \ + -GNinja -S . -B cmake-out && \ + cmake --build cmake-out --target install && \ + ldconfig && cd /var/tmp && rm -fr build + WORKDIR /var/tmp/sccache RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz | \ tar -zxf - --strip-components=1 && \ diff --git a/ci/cloudbuild/dockerfiles/ubuntu-20.04-install.Dockerfile b/ci/cloudbuild/dockerfiles/ubuntu-20.04-install.Dockerfile index 8b674b17cd2f5..ac26d636b2c5f 100644 --- a/ci/cloudbuild/dockerfiles/ubuntu-20.04-install.Dockerfile +++ b/ci/cloudbuild/dockerfiles/ubuntu-20.04-install.Dockerfile @@ -46,6 +46,7 @@ RUN apt-get update && \ apt-utils \ ca-certificates \ apt-transport-https + # Install Python packages used in the integration tests. RUN update-alternatives --install /usr/bin/python python $(which python3) 10 RUN pip3 install setuptools wheel @@ -58,12 +59,12 @@ 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/20250127.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" \ + -DCMAKE_CXX_STANDARD=17 \ -DABSL_BUILD_TESTING=OFF \ - -DABSL_PROPAGATE_CXX_STD=ON \ -DBUILD_SHARED_LIBS=yes \ -S . -B cmake-out -GNinja && \ cmake --build cmake-out --target install && \ @@ -75,6 +76,7 @@ RUN curl -fsSL https://github.com/google/googletest/archive/v1.16.0.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -S . -B cmake-out -GNinja && \ cmake --build cmake-out --target install && \ @@ -82,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" \ @@ -93,20 +95,6 @@ RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.2.tar.gz | \ ldconfig && \ cd /var/tmp && rm -fr build -WORKDIR /var/tmp/build/crc32c -RUN curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE="Release" \ - -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ - -S . -B cmake-out -GNinja && \ - cmake --build cmake-out --target install && \ - ldconfig && \ - cd /var/tmp && rm -fr build - WORKDIR /var/tmp/build/nlohmann-json RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ tar -xzf - --strip-components=1 && \ @@ -120,11 +108,13 @@ RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ ldconfig && \ cd /var/tmp && rm -fr build + WORKDIR /var/tmp/build/protobuf -RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz | \ +RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v33.1.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -Dprotobuf_BUILD_TESTS=OFF \ -Dprotobuf_ABSL_PROVIDER=package \ @@ -156,16 +146,15 @@ RUN curl -fsSL https://github.com/google/re2/archive/2025-07-22.tar.gz | \ cd /var/tmp && rm -fr build WORKDIR /var/tmp/build/ -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24.0.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_CXX_STANDARD=14 \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ -DBUILD_SHARED_LIBS=ON \ -DWITH_EXAMPLES=OFF \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -174,10 +163,11 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20 ldconfig && cd /var/tmp && rm -fr build WORKDIR /var/tmp/build/grpc -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.69.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 \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=ON \ -DgRPC_INSTALL=ON \ -DgRPC_BUILD_TESTS=OFF \ diff --git a/ci/cloudbuild/dockerfiles/ubuntu-22.04-install.Dockerfile b/ci/cloudbuild/dockerfiles/ubuntu-22.04-install.Dockerfile new file mode 100644 index 0000000000000..e9868ec79e92f --- /dev/null +++ b/ci/cloudbuild/dockerfiles/ubuntu-22.04-install.Dockerfile @@ -0,0 +1,202 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && \ + apt-get --no-install-recommends install -y \ + automake \ + build-essential \ + clang \ + cmake \ + curl \ + gawk \ + git \ + gcc \ + g++ \ + libcurl4-openssl-dev \ + libssl-dev \ + libtool \ + lsb-release \ + make \ + ninja-build \ + patch \ + pkg-config \ + python3 \ + python3-dev \ + python3-pip \ + tar \ + unzip \ + zip \ + wget \ + zlib1g-dev \ + apt-utils \ + ca-certificates \ + apt-transport-https + +# Install Python packages used in the integration tests. +RUN update-alternatives --install /usr/bin/python python $(which python3) 10 +RUN pip3 install setuptools wheel +# The Cloud Pub/Sub emulator needs Java :shrug: +RUN apt update && apt install -y openjdk-11-jre + +# Install all the direct (and indirect) dependencies for google-cloud-cpp. +# Use a different directory for each build, and remove the downloaded +# files and any temporary artifacts after a successful build to keep the +# image smaller (and with fewer layers) + +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="Release" \ + -DCMAKE_CXX_STANDARD=17 \ + -DABSL_BUILD_TESTING=OFF \ + -DBUILD_SHARED_LIBS=yes \ + -S . -B cmake-out -GNinja && \ + cmake --build cmake-out --target install && \ + ldconfig && \ + cd /var/tmp && rm -fr build + +WORKDIR /var/tmp/build/googletest +RUN curl -fsSL https://github.com/google/googletest/archive/v1.16.0.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake \ + -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_CXX_STANDARD=17 \ + -DBUILD_SHARED_LIBS=yes \ + -S . -B cmake-out -GNinja && \ + cmake --build cmake-out --target install && \ + ldconfig && \ + cd /var/tmp && rm -fr build + +WORKDIR /var/tmp/build/benchmark +RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.5.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake \ + -DCMAKE_BUILD_TYPE="Release" \ + -DBUILD_SHARED_LIBS=yes \ + -DBENCHMARK_ENABLE_TESTING=OFF \ + -S . -B cmake-out -GNinja && \ + cmake --build cmake-out --target install && \ + ldconfig && \ + cd /var/tmp && rm -fr build + +WORKDIR /var/tmp/build/nlohmann-json +RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake \ + -DCMAKE_BUILD_TYPE="Release" \ + -DBUILD_SHARED_LIBS=yes \ + -DBUILD_TESTING=OFF \ + -DJSON_BuildTests=OFF \ + -S . -B cmake-out -GNinja && \ + cmake --build cmake-out --target install && \ + ldconfig && \ + cd /var/tmp && rm -fr build + + +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=Release \ + -DCMAKE_CXX_STANDARD=17 \ + -DBUILD_SHARED_LIBS=yes \ + -Dprotobuf_BUILD_TESTS=OFF \ + -Dprotobuf_ABSL_PROVIDER=package \ + -S . -B cmake-out -GNinja && \ + cmake --build cmake-out --target install && \ + ldconfig && \ + cd /var/tmp && rm -fr build + +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=Release \ + -DBUILD_SHARED_LIBS=yes \ + -S . -B cmake-out -GNinja && \ + cmake --build cmake-out --target install && \ + ldconfig && \ + cd /var/tmp && rm -fr build + +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=Release \ + -DBUILD_SHARED_LIBS=ON \ + -DRE2_BUILD_TESTING=OFF \ + -S . -B cmake-out -GNinja && \ + cmake --build cmake-out --target install && \ + ldconfig && \ + cd /var/tmp && rm -fr build + +WORKDIR /var/tmp/build/ +RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24.0.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake \ + -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ + -DBUILD_SHARED_LIBS=ON \ + -DWITH_EXAMPLES=OFF \ + -DWITH_STL=CXX17 \ + -DBUILD_TESTING=OFF \ + -DOPENTELEMETRY_INSTALL=ON \ + -DOPENTELEMETRY_ABI_VERSION_NO=2 \ + -S . -B cmake-out -GNinja && \ + cmake --build cmake-out --target install && \ + ldconfig && cd /var/tmp && rm -fr build + +WORKDIR /var/tmp/build/grpc +RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_STANDARD=17 \ + -DBUILD_SHARED_LIBS=ON \ + -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 \ + -DgRPC_BUILD_GRPCPP_OTEL_PLUGIN=ON \ + -S . -B cmake-out -GNinja && \ + cmake --build cmake-out --target install && \ + ldconfig && \ + cd /var/tmp && rm -fr build + +# Install the Cloud SDK and some of the emulators. We use the emulators to run +# integration tests for the client libraries. +COPY . /var/tmp/ci +WORKDIR /var/tmp/downloads +RUN /var/tmp/ci/install-cloud-sdk.sh +ENV CLOUD_SDK_LOCATION=/usr/local/google-cloud-sdk +ENV PATH=${CLOUD_SDK_LOCATION}/bin:${PATH} + +WORKDIR /var/tmp/sccache +RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz | \ + tar -zxf - --strip-components=1 && \ + mkdir -p /usr/local/bin && \ + mv sccache /usr/local/bin/sccache && \ + chmod +x /usr/local/bin/sccache + +# Update the ld.conf cache in case any libraries were installed in /usr/local/lib* +RUN ldconfig /usr/local/lib* diff --git a/ci/cloudbuild/dockerfiles/ubuntu-22.04.Dockerfile b/ci/cloudbuild/dockerfiles/ubuntu-22.04.Dockerfile new file mode 100644 index 0000000000000..d11b633bbf6b6 --- /dev/null +++ b/ci/cloudbuild/dockerfiles/ubuntu-22.04.Dockerfile @@ -0,0 +1,65 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && \ + apt-get --no-install-recommends install -y \ + automake \ + build-essential \ + clang \ + cmake \ + curl \ + gawk \ + git \ + gcc \ + g++ \ + libcurl4-openssl-dev \ + libssl-dev \ + libtool \ + lsb-release \ + make \ + ninja-build \ + patch \ + pkg-config \ + python3 \ + python3-dev \ + python3-pip \ + tar \ + unzip \ + zip \ + wget \ + zlib1g-dev \ + apt-utils \ + ca-certificates \ + apt-transport-https + +# Install Python packages used in the integration tests. +RUN update-alternatives --install /usr/bin/python python $(which python3) 10 +RUN pip3 install setuptools wheel +# The Cloud Pub/Sub emulator needs Java :shrug: +RUN apt update && (apt install -y openjdk-11-jre || apt install -y openjdk-9-jre) + +# Install the Cloud SDK and some of the emulators. We use the emulators to run +# integration tests for the client libraries. +COPY . /var/tmp/ci +WORKDIR /var/tmp/downloads +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.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 a67a2f89b646e..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.24.1/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-focal.Dockerfile b/ci/cloudbuild/dockerfiles/ubuntu-focal.Dockerfile deleted file mode 100644 index ad6690e64454b..0000000000000 --- a/ci/cloudbuild/dockerfiles/ubuntu-focal.Dockerfile +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu:focal -ARG NCPU=4 -ARG ARCH=amd64 - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && \ - apt-get --no-install-recommends install -y \ - automake \ - build-essential \ - clang \ - clang-9 \ - cmake \ - ctags \ - curl \ - gawk \ - git \ - gcc \ - g++ \ - cmake \ - libcurl4-openssl-dev \ - libssl-dev \ - libtool \ - llvm-9 \ - lsb-release \ - make \ - ninja-build \ - patch \ - pkg-config \ - python3 \ - python3-dev \ - python3-pip \ - tar \ - unzip \ - zip \ - wget \ - zlib1g-dev \ - apt-utils \ - ca-certificates \ - apt-transport-https - -# Install Python packages used in the integration tests. -RUN update-alternatives --install /usr/bin/python python $(which python3) 10 -RUN pip3 install setuptools wheel - -# The Cloud Pub/Sub emulator needs Java :shrug: -RUN apt update && (apt install -y openjdk-11-jre || apt install -y openjdk-9-jre) - -# Install the Cloud SDK and some of the emulators. We use the emulators to run -# integration tests for the client libraries. -COPY . /var/tmp/ci -WORKDIR /var/tmp/downloads -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.24.1/bazelisk-linux-${ARCH}" && \ - chmod +x /usr/bin/bazelisk && \ - ln -s /usr/bin/bazelisk /usr/bin/bazel diff --git a/ci/cloudbuild/triggers/asan-ci.yaml b/ci/cloudbuild/triggers/asan-ci.yaml index 4e624d3aebc7a..18e8a9611dba4 100644 --- a/ci/cloudbuild/triggers/asan-ci.yaml +++ b/ci/cloudbuild/triggers/asan-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-03-22T00:38:08.167137222Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: a803727d-8633-49ea-b545-bd7f9124bc3d + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: asan-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/a803727d-8633-49ea-b545-bd7f9124bc3d substitutions: _BUILD_NAME: asan _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/asan-pr.yaml b/ci/cloudbuild/triggers/asan-pr.yaml index e1b22dbb1abe4..6a05ff6f60aa3 100644 --- a/ci/cloudbuild/triggers/asan-pr.yaml +++ b/ci/cloudbuild/triggers/asan-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-09T18:15:26.533760362Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 45fd50c2-04f1-4674-b533-0db1346c8b7e includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: asan-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/45fd50c2-04f1-4674-b533-0db1346c8b7e substitutions: _BUILD_NAME: asan _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/bazel-oldest-ci.yaml b/ci/cloudbuild/triggers/bazel-oldest-ci.yaml index 31df3bb45423f..181f27adf8d8e 100644 --- a/ci/cloudbuild/triggers/bazel-oldest-ci.yaml +++ b/ci/cloudbuild/triggers/bazel-oldest-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-02-08T12:44:34.878690706Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 3a7690ee-a385-4e86-835e-990a64eb71d7 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: bazel-oldest-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/3a7690ee-a385-4e86-835e-990a64eb71d7 substitutions: _BUILD_NAME: bazel-oldest _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/bazel-oldest-pr.yaml b/ci/cloudbuild/triggers/bazel-oldest-pr.yaml index 4f4b2b36421ed..9608a467811fd 100644 --- a/ci/cloudbuild/triggers/bazel-oldest-pr.yaml +++ b/ci/cloudbuild/triggers/bazel-oldest-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-02-08T12:44:28.719440875Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 914bc7a4-afa2-4faf-8a0e-571218e8fd83 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: bazel-oldest-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/914bc7a4-afa2-4faf-8a0e-571218e8fd83 substitutions: _BUILD_NAME: bazel-oldest _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/bazel-otel-abi-2-ci.yaml b/ci/cloudbuild/triggers/bazel-otel-abi-2-ci.yaml index af9768ad913c3..b2892455d9037 100644 --- a/ci/cloudbuild/triggers/bazel-otel-abi-2-ci.yaml +++ b/ci/cloudbuild/triggers/bazel-otel-abi-2-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-12-13T16:53:04.793743056Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: abfbaa6f-e1a0-4298-af45-78f9dc1a9831 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: bazel-otel-abi-2-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/abfbaa6f-e1a0-4298-af45-78f9dc1a9831 substitutions: _BUILD_NAME: bazel-otel-abi-2 _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/bazel-otel-abi-2-pr.yaml b/ci/cloudbuild/triggers/bazel-otel-abi-2-pr.yaml index 338f750994701..80dd505210956 100644 --- a/ci/cloudbuild/triggers/bazel-otel-abi-2-pr.yaml +++ b/ci/cloudbuild/triggers/bazel-otel-abi-2-pr.yaml @@ -17,12 +17,10 @@ github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 18b11d89-0625-40ba-897a-ac10462d1c7b includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: bazel-otel-abi-2-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/18b11d89-0625-40ba-897a-ac10462d1c7b substitutions: _BUILD_NAME: bazel-otel-abi-2 _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/bazel-targets-ci.yaml b/ci/cloudbuild/triggers/bazel-targets-ci.yaml index 599e2586bb30d..4d250ab320dab 100644 --- a/ci/cloudbuild/triggers/bazel-targets-ci.yaml +++ b/ci/cloudbuild/triggers/bazel-targets-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-26T16:37:27.818296611Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 1f63c286-589b-41cf-aee0-dd0e3cb6861c + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: bazel-targets-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/1f63c286-589b-41cf-aee0-dd0e3cb6861c substitutions: _BUILD_NAME: bazel-targets _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/bazel-targets-pr.yaml b/ci/cloudbuild/triggers/bazel-targets-pr.yaml index a50efe76ffb8e..6f7a9f82ac260 100644 --- a/ci/cloudbuild/triggers/bazel-targets-pr.yaml +++ b/ci/cloudbuild/triggers/bazel-targets-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-26T16:37:32.709851004Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 95e11a96-2138-4d65-8598-25308f1cf5f8 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: bazel-targets-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/95e11a96-2138-4d65-8598-25308f1cf5f8 substitutions: _BUILD_NAME: bazel-targets _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/check-api-ci.yaml b/ci/cloudbuild/triggers/check-api-ci.yaml index 1c0314e181c66..0728c470a75d2 100644 --- a/ci/cloudbuild/triggers/check-api-ci.yaml +++ b/ci/cloudbuild/triggers/check-api-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-30T13:51:14.389552861Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 83b375fa-9209-4691-8dcc-a28f7a19dcf2 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: check-api-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/83b375fa-9209-4691-8dcc-a28f7a19dcf2 substitutions: _BUILD_NAME: check-api _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/check-api-pr.yaml b/ci/cloudbuild/triggers/check-api-pr.yaml index e4a68a40daa43..558644c7e4284 100644 --- a/ci/cloudbuild/triggers/check-api-pr.yaml +++ b/ci/cloudbuild/triggers/check-api-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-30T13:51:18.047210322Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 9d4afe6c-48fc-4bc4-8b40-68312b2c0fec includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: check-api-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/9d4afe6c-48fc-4bc4-8b40-68312b2c0fec substitutions: _BUILD_NAME: check-api _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/checkers-ci.yaml b/ci/cloudbuild/triggers/checkers-ci.yaml index ad3403e81f633..e562c9844a5cb 100644 --- a/ci/cloudbuild/triggers/checkers-ci.yaml +++ b/ci/cloudbuild/triggers/checkers-ci.yaml @@ -12,14 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-03-30T00:38:59.589682412Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 2d35a7fd-e273-44d4-b592-fc8810327a27 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: checkers-ci substitutions: diff --git a/ci/cloudbuild/triggers/checkers-pr.yaml b/ci/cloudbuild/triggers/checkers-pr.yaml index 8e1c2a766ee8b..bd207387e6051 100644 --- a/ci/cloudbuild/triggers/checkers-pr.yaml +++ b/ci/cloudbuild/triggers/checkers-pr.yaml @@ -12,15 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-09T18:15:32.194276806Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 746bbc75-cdf8-4172-bb08-0c2335479a8b includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: checkers-pr substitutions: diff --git a/ci/cloudbuild/triggers/clang-14-0-ci.yaml b/ci/cloudbuild/triggers/clang-14-0-ci.yaml new file mode 100644 index 0000000000000..20d447839b045 --- /dev/null +++ b/ci/cloudbuild/triggers/clang-14-0-ci.yaml @@ -0,0 +1,28 @@ +# 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. + +filename: ci/cloudbuild/cloudbuild.yaml +github: + name: google-cloud-cpp + owner: googleapis + push: + branch: main +includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS +name: clang-14-0-ci +substitutions: + _BUILD_NAME: clang-14.0 + _DISTRO: ubuntu-22.04-install + _TRIGGER_TYPE: ci +tags: +- ci diff --git a/ci/cloudbuild/triggers/clang-14-0-pr.yaml b/ci/cloudbuild/triggers/clang-14-0-pr.yaml new file mode 100644 index 0000000000000..0f5a0356e0102 --- /dev/null +++ b/ci/cloudbuild/triggers/clang-14-0-pr.yaml @@ -0,0 +1,29 @@ +# 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. + +filename: ci/cloudbuild/cloudbuild.yaml +github: + name: google-cloud-cpp + owner: googleapis + pullRequest: + branch: main + commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY +includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS +name: clang-14-0-pr +substitutions: + _BUILD_NAME: clang-14.0 + _DISTRO: ubuntu-22.04-install + _TRIGGER_TYPE: pr +tags: +- pr diff --git a/ci/cloudbuild/triggers/clang-7-0-ci.yaml b/ci/cloudbuild/triggers/clang-7-0-ci.yaml deleted file mode 100644 index f9e881ba2c41d..0000000000000 --- a/ci/cloudbuild/triggers/clang-7-0-ci.yaml +++ /dev/null @@ -1,31 +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. - -createTime: '2023-06-02T17:19:48.154215116Z' -filename: ci/cloudbuild/cloudbuild.yaml -github: - name: google-cloud-cpp - owner: googleapis - push: - branch: ^main$ -id: c9060166-f159-46c6-8ac9-4f256759fcb8 -includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS -name: clang-7-0-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/c9060166-f159-46c6-8ac9-4f256759fcb8 -substitutions: - _BUILD_NAME: clang-7.0 - _DISTRO: ubuntu-20.04-install - _TRIGGER_TYPE: ci -tags: -- ci diff --git a/ci/cloudbuild/triggers/clang-7-0-pr.yaml b/ci/cloudbuild/triggers/clang-7-0-pr.yaml deleted file mode 100644 index 57e61a54dfde2..0000000000000 --- a/ci/cloudbuild/triggers/clang-7-0-pr.yaml +++ /dev/null @@ -1,32 +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. - -createTime: '2023-06-02T17:19:52.984755094Z' -filename: ci/cloudbuild/cloudbuild.yaml -github: - name: google-cloud-cpp - owner: googleapis - pullRequest: - branch: ^main$ - commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 8a4c069a-53c0-49bf-ba31-5f3a3c228a42 -includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS -name: clang-7-0-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/8a4c069a-53c0-49bf-ba31-5f3a3c228a42 -substitutions: - _BUILD_NAME: clang-7.0 - _DISTRO: ubuntu-20.04-install - _TRIGGER_TYPE: pr -tags: -- pr diff --git a/ci/cloudbuild/triggers/clang-cxx20-ci.yaml b/ci/cloudbuild/triggers/clang-cxx20-ci.yaml index f576175518750..016f08240cc33 100644 --- a/ci/cloudbuild/triggers/clang-cxx20-ci.yaml +++ b/ci/cloudbuild/triggers/clang-cxx20-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2024-02-20T18:40:45.776612692Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: ed6fae7b-7ab3-44b9-b26b-d41de3926e16 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: clang-cxx20-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/ed6fae7b-7ab3-44b9-b26b-d41de3926e16 substitutions: _BUILD_NAME: clang-cxx20 _DISTRO: fedora-latest-cxx20 diff --git a/ci/cloudbuild/triggers/clang-cxx20-pr.yaml b/ci/cloudbuild/triggers/clang-cxx20-pr.yaml index d91fe98fa40da..deede5bd62215 100644 --- a/ci/cloudbuild/triggers/clang-cxx20-pr.yaml +++ b/ci/cloudbuild/triggers/clang-cxx20-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2024-02-20T18:41:20.365076403Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: b5fb032a-c06d-4369-b42d-98524085d402 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: clang-cxx20-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/b5fb032a-c06d-4369-b42d-98524085d402 substitutions: _BUILD_NAME: clang-cxx20 _DISTRO: fedora-latest-cxx20 diff --git a/ci/cloudbuild/triggers/clang-tidy-bigquery-ci.yaml b/ci/cloudbuild/triggers/clang-tidy-bigquery-ci.yaml index b954e747a024d..8f54909e9976e 100644 --- a/ci/cloudbuild/triggers/clang-tidy-bigquery-ci.yaml +++ b/ci/cloudbuild/triggers/clang-tidy-bigquery-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-10-24T17:38:53.406054685Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 5ad8f0dd-38a8-4a40-aa81-925e0867fef6 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: clang-tidy-bigquery-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/5ad8f0dd-38a8-4a40-aa81-925e0867fef6 substitutions: _BUILD_NAME: clang-tidy _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/clang-tidy-bigquery-pr.yaml b/ci/cloudbuild/triggers/clang-tidy-bigquery-pr.yaml index 3172cac412840..d9c6569cbd0c4 100644 --- a/ci/cloudbuild/triggers/clang-tidy-bigquery-pr.yaml +++ b/ci/cloudbuild/triggers/clang-tidy-bigquery-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-10-24T17:38:54.756444054Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 94fbc973-ea4b-49e9-a1ce-db3994993675 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: clang-tidy-bigquery-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/94fbc973-ea4b-49e9-a1ce-db3994993675 substitutions: _BUILD_NAME: clang-tidy _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/clang-tidy-ci.yaml b/ci/cloudbuild/triggers/clang-tidy-ci.yaml index fc71b6c8eb0dd..d38d9f8414ee5 100644 --- a/ci/cloudbuild/triggers/clang-tidy-ci.yaml +++ b/ci/cloudbuild/triggers/clang-tidy-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-03-22T00:36:44.386437504Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 88b3547a-7d8b-4af2-998f-e2ed284ebaaa + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: clang-tidy-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/88b3547a-7d8b-4af2-998f-e2ed284ebaaa substitutions: _BUILD_NAME: clang-tidy _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/clang-tidy-compute.yaml b/ci/cloudbuild/triggers/clang-tidy-compute.yaml index 3478a8c656eb3..e203f530d4f11 100644 --- a/ci/cloudbuild/triggers/clang-tidy-compute.yaml +++ b/ci/cloudbuild/triggers/clang-tidy-compute.yaml @@ -12,16 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-07-10T20:41:19.444876272Z' description: Runs clang-tidy on all compute libraries. gitFileSource: path: ci/cloudbuild/cloudbuild.yaml repoType: GITHUB revision: refs/heads/main uri: https://github.com/googleapis/google-cloud-cpp -id: 6d247368-98d8-4b06-9179-afeedd054f50 name: clang-tidy-compute -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/6d247368-98d8-4b06-9179-afeedd054f50 sourceToBuild: ref: refs/heads/main repoType: GITHUB diff --git a/ci/cloudbuild/triggers/clang-tidy-pr.yaml b/ci/cloudbuild/triggers/clang-tidy-pr.yaml index 3df8445b2199f..bfddd842c0d9a 100644 --- a/ci/cloudbuild/triggers/clang-tidy-pr.yaml +++ b/ci/cloudbuild/triggers/clang-tidy-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-09T18:15:36.012514343Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 8448ca7a-edac-4d56-ae23-928897249570 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: clang-tidy-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/8448ca7a-edac-4d56-ae23-928897249570 substitutions: _BUILD_NAME: clang-tidy _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/clang-tidy-pubsub-ci.yaml b/ci/cloudbuild/triggers/clang-tidy-pubsub-ci.yaml index 46ec3f0f85b19..2d96f418c638c 100644 --- a/ci/cloudbuild/triggers/clang-tidy-pubsub-ci.yaml +++ b/ci/cloudbuild/triggers/clang-tidy-pubsub-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-10-24T17:38:56.263489135Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 7bdca032-6ec4-4b7c-9c0b-d04bd19c2ba3 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: clang-tidy-pubsub-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/7bdca032-6ec4-4b7c-9c0b-d04bd19c2ba3 substitutions: _BUILD_NAME: clang-tidy _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/clang-tidy-pubsub-pr.yaml b/ci/cloudbuild/triggers/clang-tidy-pubsub-pr.yaml index 2aa254d3eceb8..c60b00221eb06 100644 --- a/ci/cloudbuild/triggers/clang-tidy-pubsub-pr.yaml +++ b/ci/cloudbuild/triggers/clang-tidy-pubsub-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-10-24T17:38:57.870335767Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 47691835-f91f-42a3-92bf-7820c2eb34f2 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: clang-tidy-pubsub-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/47691835-f91f-42a3-92bf-7820c2eb34f2 substitutions: _BUILD_NAME: clang-tidy _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/clang-tidy-storage-ci.yaml b/ci/cloudbuild/triggers/clang-tidy-storage-ci.yaml index aa39e6a6335df..01736a9f8ae72 100644 --- a/ci/cloudbuild/triggers/clang-tidy-storage-ci.yaml +++ b/ci/cloudbuild/triggers/clang-tidy-storage-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-10-24T17:38:59.377179872Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: dcb2a46a-01f9-4b02-8c34-79943099e25f + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: clang-tidy-storage-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/dcb2a46a-01f9-4b02-8c34-79943099e25f substitutions: _BUILD_NAME: clang-tidy _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/clang-tidy-storage-pr.yaml b/ci/cloudbuild/triggers/clang-tidy-storage-pr.yaml index 25a3b368e72b3..f9f25ab32c926 100644 --- a/ci/cloudbuild/triggers/clang-tidy-storage-pr.yaml +++ b/ci/cloudbuild/triggers/clang-tidy-storage-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-10-24T17:39:00.640655067Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 163b45f9-e55c-48fb-948d-c1f4539f1524 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: clang-tidy-storage-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/163b45f9-e55c-48fb-948d-c1f4539f1524 substitutions: _BUILD_NAME: clang-tidy _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/clang-tidy-tools-ci.yaml b/ci/cloudbuild/triggers/clang-tidy-tools-ci.yaml index f1945eeb1a984..afabc25697670 100644 --- a/ci/cloudbuild/triggers/clang-tidy-tools-ci.yaml +++ b/ci/cloudbuild/triggers/clang-tidy-tools-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-10-24T17:39:02.117138961Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 8be80238-a508-43c4-a1c3-8ce285cbb571 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: clang-tidy-tools-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/8be80238-a508-43c4-a1c3-8ce285cbb571 substitutions: _BUILD_NAME: clang-tidy _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/clang-tidy-tools-pr.yaml b/ci/cloudbuild/triggers/clang-tidy-tools-pr.yaml index b220c26c2034b..8371354c92d67 100644 --- a/ci/cloudbuild/triggers/clang-tidy-tools-pr.yaml +++ b/ci/cloudbuild/triggers/clang-tidy-tools-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-10-24T17:39:03.693462256Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: cb911c90-e6a6-4440-a1c9-0890cce4565f includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: clang-tidy-tools-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/cb911c90-e6a6-4440-a1c9-0890cce4565f substitutions: _BUILD_NAME: clang-tidy _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/cmake-gcs-rest-ci.yaml b/ci/cloudbuild/triggers/cmake-gcs-rest-ci.yaml index 91b7cd684fc96..68cb5a7426f90 100644 --- a/ci/cloudbuild/triggers/cmake-gcs-rest-ci.yaml +++ b/ci/cloudbuild/triggers/cmake-gcs-rest-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-04-28T21:23:21.953441802Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 87c8300c-afd2-419e-b878-2e8ceb7a7496 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: cmake-gcs-rest-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/87c8300c-afd2-419e-b878-2e8ceb7a7496 substitutions: _BUILD_NAME: cmake-gcs-rest _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/cmake-gcs-rest-pr.yaml b/ci/cloudbuild/triggers/cmake-gcs-rest-pr.yaml index f33f31f74bcda..ebe5954b29ace 100644 --- a/ci/cloudbuild/triggers/cmake-gcs-rest-pr.yaml +++ b/ci/cloudbuild/triggers/cmake-gcs-rest-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-04-28T21:23:32.712697493Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 4bc5ac63-ff83-4063-b5f6-c1d04c0ce706 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: cmake-gcs-rest-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/4bc5ac63-ff83-4063-b5f6-c1d04c0ce706 substitutions: _BUILD_NAME: cmake-gcs-rest _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/cmake-install-ci.yaml b/ci/cloudbuild/triggers/cmake-install-ci.yaml index 1e9ea8a9d495d..6f3d08239cae6 100644 --- a/ci/cloudbuild/triggers/cmake-install-ci.yaml +++ b/ci/cloudbuild/triggers/cmake-install-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-03-24T00:02:59.444857698Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 49d3dff1-bee0-4a2b-9bd1-a696d54e48c9 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: cmake-install-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/49d3dff1-bee0-4a2b-9bd1-a696d54e48c9 substitutions: _BUILD_NAME: cmake-install _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/cmake-install-pr.yaml b/ci/cloudbuild/triggers/cmake-install-pr.yaml index 46529333844cd..f31c2e0359d00 100644 --- a/ci/cloudbuild/triggers/cmake-install-pr.yaml +++ b/ci/cloudbuild/triggers/cmake-install-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-09T18:15:41.397491676Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 1e40a006-1073-4d1b-82ca-03528fd3fd51 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: cmake-install-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/1e40a006-1073-4d1b-82ca-03528fd3fd51 substitutions: _BUILD_NAME: cmake-install _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/cmake-oldest-deps-ci.yaml b/ci/cloudbuild/triggers/cmake-oldest-deps-ci.yaml index a4e015aa1d0c3..e24176f2ae9b5 100644 --- a/ci/cloudbuild/triggers/cmake-oldest-deps-ci.yaml +++ b/ci/cloudbuild/triggers/cmake-oldest-deps-ci.yaml @@ -12,19 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-28T12:39:57.322470341Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 64e55546-2701-4234-b348-fe9a4478dd38 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: cmake-oldest-deps-ci substitutions: _BUILD_NAME: cmake-oldest-deps - _DISTRO: ubuntu-focal + _DISTRO: ubuntu-22.04 _TRIGGER_TYPE: ci tags: - ci diff --git a/ci/cloudbuild/triggers/cmake-oldest-deps-pr.yaml b/ci/cloudbuild/triggers/cmake-oldest-deps-pr.yaml index f91205e69e765..b975be064bee4 100644 --- a/ci/cloudbuild/triggers/cmake-oldest-deps-pr.yaml +++ b/ci/cloudbuild/triggers/cmake-oldest-deps-pr.yaml @@ -12,20 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-28T12:39:51.473360103Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 384786a7-5ee5-49e2-8866-369fe55c7d04 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: cmake-oldest-deps-pr substitutions: _BUILD_NAME: cmake-oldest-deps - _DISTRO: ubuntu-focal + _DISTRO: ubuntu-22.04 _TRIGGER_TYPE: pr tags: - pr diff --git a/ci/cloudbuild/triggers/cmake-single-feature-ci.yaml b/ci/cloudbuild/triggers/cmake-single-feature-ci.yaml index 5576c038e3231..ec9af1ec71efc 100644 --- a/ci/cloudbuild/triggers/cmake-single-feature-ci.yaml +++ b/ci/cloudbuild/triggers/cmake-single-feature-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-05-06T21:50:55.921332969Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 09d4a76e-0a9f-4ef1-ab7e-de78684c23cc + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: cmake-single-feature-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/09d4a76e-0a9f-4ef1-ab7e-de78684c23cc substitutions: _BUILD_NAME: cmake-single-feature _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/cmake-single-feature-pr.yaml b/ci/cloudbuild/triggers/cmake-single-feature-pr.yaml index b51df7d6d4c6b..3034a9f58194c 100644 --- a/ci/cloudbuild/triggers/cmake-single-feature-pr.yaml +++ b/ci/cloudbuild/triggers/cmake-single-feature-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-05-06T21:51:02.240926631Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 3e376bfc-ab89-4c29-a640-f7f88f756c8c includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: cmake-single-feature-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/3e376bfc-ab89-4c29-a640-f7f88f756c8c substitutions: _BUILD_NAME: cmake-single-feature _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/cmake-split-install-ci.yaml b/ci/cloudbuild/triggers/cmake-split-install-ci.yaml index d76869eee2028..e8bc9293db27f 100644 --- a/ci/cloudbuild/triggers/cmake-split-install-ci.yaml +++ b/ci/cloudbuild/triggers/cmake-split-install-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-07-10T15:26:52.770667141Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 0b727502-82fe-41a1-a4e2-73f9375718ad + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: cmake-split-install-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/0b727502-82fe-41a1-a4e2-73f9375718ad substitutions: _BUILD_NAME: cmake-split-install _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/cmake-split-install-pr.yaml b/ci/cloudbuild/triggers/cmake-split-install-pr.yaml index 0d0a9193291e6..0e02e22351ef1 100644 --- a/ci/cloudbuild/triggers/cmake-split-install-pr.yaml +++ b/ci/cloudbuild/triggers/cmake-split-install-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-07-10T15:26:59.182700120Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: a6f49616-83ce-4471-b517-f86c44e09ce5 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: cmake-split-install-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/a6f49616-83ce-4471-b517-f86c44e09ce5 substitutions: _BUILD_NAME: cmake-split-install _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/conformance-ci.yaml b/ci/cloudbuild/triggers/conformance-ci.yaml index c02548500f06f..8ed1757aba63e 100644 --- a/ci/cloudbuild/triggers/conformance-ci.yaml +++ b/ci/cloudbuild/triggers/conformance-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-10-30T21:38:59.771402989Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 9858e9c0-2f5a-45ad-9e5b-3af30eaf30af + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: conformance-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/9858e9c0-2f5a-45ad-9e5b-3af30eaf30af substitutions: _BUILD_NAME: conformance _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/conformance-pr.yaml b/ci/cloudbuild/triggers/conformance-pr.yaml index 90c09130c8612..1b6b9016d0bdf 100644 --- a/ci/cloudbuild/triggers/conformance-pr.yaml +++ b/ci/cloudbuild/triggers/conformance-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-10-30T21:35:19.557214462Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 03976e73-5154-457f-813f-4d33bb162e70 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: conformance-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/03976e73-5154-457f-813f-4d33bb162e70 substitutions: _BUILD_NAME: conformance _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/coverage-ci.yaml b/ci/cloudbuild/triggers/coverage-ci.yaml index af06ffa89b86c..045e3d36ef7dc 100644 --- a/ci/cloudbuild/triggers/coverage-ci.yaml +++ b/ci/cloudbuild/triggers/coverage-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-16T13:00:27.617873387Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 5c4f383c-11bc-4eb7-a42f-c8d69172caf2 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: coverage-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/5c4f383c-11bc-4eb7-a42f-c8d69172caf2 substitutions: _BUILD_NAME: coverage _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/coverage-pr.yaml b/ci/cloudbuild/triggers/coverage-pr.yaml index a6f08ff1dde82..da95bc0009508 100644 --- a/ci/cloudbuild/triggers/coverage-pr.yaml +++ b/ci/cloudbuild/triggers/coverage-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-16T13:00:31.944469840Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 0ada9a21-5379-48e2-9e6d-8c388d6333e5 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: coverage-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/0ada9a21-5379-48e2-9e6d-8c388d6333e5 substitutions: _BUILD_NAME: coverage _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/cxx14-ci.yaml b/ci/cloudbuild/triggers/cxx14-ci.yaml deleted file mode 100644 index 1d828f4ffd743..0000000000000 --- a/ci/cloudbuild/triggers/cxx14-ci.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -createTime: '2022-06-23T15:35:45.803275576Z' -filename: ci/cloudbuild/cloudbuild.yaml -github: - name: google-cloud-cpp - owner: googleapis - push: - branch: ^main$ -id: 23c2a0e2-d64f-4ca4-869a-1064e2549624 -includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS -name: cxx14-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/23c2a0e2-d64f-4ca4-869a-1064e2549624 -substitutions: - _BUILD_NAME: cxx14 - _DISTRO: fedora-latest-cxx14 - _TRIGGER_TYPE: ci -tags: -- ci diff --git a/ci/cloudbuild/triggers/cxx14-pr.yaml b/ci/cloudbuild/triggers/cxx14-pr.yaml deleted file mode 100644 index 872298572d48b..0000000000000 --- a/ci/cloudbuild/triggers/cxx14-pr.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -createTime: '2022-06-23T15:35:40.201715614Z' -filename: ci/cloudbuild/cloudbuild.yaml -github: - name: google-cloud-cpp - owner: googleapis - pullRequest: - branch: ^main$ - commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 54861c36-30b4-4c71-81f9-a765a957ef23 -includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS -name: cxx14-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/54861c36-30b4-4c71-81f9-a765a957ef23 -substitutions: - _BUILD_NAME: cxx14 - _DISTRO: fedora-latest-cxx14 - _TRIGGER_TYPE: pr -tags: -- pr diff --git a/ci/cloudbuild/triggers/cxx20-ci.yaml b/ci/cloudbuild/triggers/cxx20-ci.yaml index c91ce65b5d020..8170c68ba76ab 100644 --- a/ci/cloudbuild/triggers/cxx20-ci.yaml +++ b/ci/cloudbuild/triggers/cxx20-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-10-21T13:06:18.672990290Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 7471e4f8-769d-48dd-8f6f-253bef7051ef + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: cxx20-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/7471e4f8-769d-48dd-8f6f-253bef7051ef substitutions: _BUILD_NAME: cxx20 _DISTRO: fedora-latest-cxx20 diff --git a/ci/cloudbuild/triggers/cxx20-pr.yaml b/ci/cloudbuild/triggers/cxx20-pr.yaml index 648d65635062b..23743deb90ece 100644 --- a/ci/cloudbuild/triggers/cxx20-pr.yaml +++ b/ci/cloudbuild/triggers/cxx20-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-10-21T13:06:28.013633506Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: f4da53f5-3966-45bd-8821-8a43a0804ecc includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: cxx20-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/f4da53f5-3966-45bd-8821-8a43a0804ecc substitutions: _BUILD_NAME: cxx20 _DISTRO: fedora-latest-cxx20 diff --git a/ci/cloudbuild/triggers/demo-alpine-stable-ci.yaml b/ci/cloudbuild/triggers/demo-alpine-stable-ci.yaml index 505824c5934b8..4b23217fca988 100644 --- a/ci/cloudbuild/triggers/demo-alpine-stable-ci.yaml +++ b/ci/cloudbuild/triggers/demo-alpine-stable-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-06-24T18:22:48.436591174Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: d5596043-576e-41b2-b324-72805c5983e1 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-alpine-stable-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/d5596043-576e-41b2-b324-72805c5983e1 substitutions: _BUILD_NAME: demo-install _DISTRO: demo-alpine-stable diff --git a/ci/cloudbuild/triggers/demo-alpine-stable-pr.yaml b/ci/cloudbuild/triggers/demo-alpine-stable-pr.yaml index 7e7ae83ac78dd..c67735e3040f8 100644 --- a/ci/cloudbuild/triggers/demo-alpine-stable-pr.yaml +++ b/ci/cloudbuild/triggers/demo-alpine-stable-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-06-24T18:22:53.925960095Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 85f2a500-3643-4ac3-96be-4b824a69762f includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-alpine-stable-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/85f2a500-3643-4ac3-96be-4b824a69762f substitutions: _BUILD_NAME: demo-install _DISTRO: demo-alpine-stable diff --git a/ci/cloudbuild/triggers/demo-debian-bookworm-ci.yaml b/ci/cloudbuild/triggers/demo-debian-bookworm-ci.yaml index ea8d0346b10aa..33b5b93895f7d 100644 --- a/ci/cloudbuild/triggers/demo-debian-bookworm-ci.yaml +++ b/ci/cloudbuild/triggers/demo-debian-bookworm-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-09-09T16:23:55.750964253Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 6e1b6108-8b51-4751-ba8c-59dd82c062dc + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-debian-bookworm-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/6e1b6108-8b51-4751-ba8c-59dd82c062dc substitutions: _BUILD_NAME: demo-install _DISTRO: demo-debian-bookworm diff --git a/ci/cloudbuild/triggers/demo-debian-bookworm-pr.yaml b/ci/cloudbuild/triggers/demo-debian-bookworm-pr.yaml index 8ededcc7d56a8..c306f914494d2 100644 --- a/ci/cloudbuild/triggers/demo-debian-bookworm-pr.yaml +++ b/ci/cloudbuild/triggers/demo-debian-bookworm-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-09-09T16:24:10.043640665Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: f1cbc3fc-d09b-483f-bb4c-0ea3394b334e includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-debian-bookworm-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/f1cbc3fc-d09b-483f-bb4c-0ea3394b334e substitutions: _BUILD_NAME: demo-install _DISTRO: demo-debian-bookworm diff --git a/ci/cloudbuild/triggers/demo-debian-bullseye-ci.yaml b/ci/cloudbuild/triggers/demo-debian-bullseye-ci.yaml index 32bc2d971ee0a..e969e19c552a0 100644 --- a/ci/cloudbuild/triggers/demo-debian-bullseye-ci.yaml +++ b/ci/cloudbuild/triggers/demo-debian-bullseye-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-08-17T14:42:37.946358416Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 99ed51ab-3b42-4046-8698-6ea54b39afaa + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-debian-bullseye-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/99ed51ab-3b42-4046-8698-6ea54b39afaa substitutions: _BUILD_NAME: demo-install _DISTRO: demo-debian-bullseye diff --git a/ci/cloudbuild/triggers/demo-debian-bullseye-pr.yaml b/ci/cloudbuild/triggers/demo-debian-bullseye-pr.yaml index a18f67684c95b..38bb2c4f9e290 100644 --- a/ci/cloudbuild/triggers/demo-debian-bullseye-pr.yaml +++ b/ci/cloudbuild/triggers/demo-debian-bullseye-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-08-17T14:43:32.603712645Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 3cc016a1-2a35-467a-94af-4eab3822cbfd includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-debian-bullseye-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/3cc016a1-2a35-467a-94af-4eab3822cbfd substitutions: _BUILD_NAME: demo-install _DISTRO: demo-debian-bullseye diff --git a/ci/cloudbuild/triggers/demo-fedora-ci.yaml b/ci/cloudbuild/triggers/demo-fedora-ci.yaml index a8d5d0048ed6d..968b22858551c 100644 --- a/ci/cloudbuild/triggers/demo-fedora-ci.yaml +++ b/ci/cloudbuild/triggers/demo-fedora-ci.yaml @@ -12,14 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-13T23:35:58.117686333Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: efe44360-59b3-4784-96f6-ebe03ecdd2f7 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-fedora-ci substitutions: diff --git a/ci/cloudbuild/triggers/demo-fedora-pr.yaml b/ci/cloudbuild/triggers/demo-fedora-pr.yaml index f622b52d16894..db1fc5b7d0ac6 100644 --- a/ci/cloudbuild/triggers/demo-fedora-pr.yaml +++ b/ci/cloudbuild/triggers/demo-fedora-pr.yaml @@ -12,15 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-13T23:35:59.268915688Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 182e01a3-0956-47bc-9a8a-023318168962 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-fedora-pr substitutions: diff --git a/ci/cloudbuild/triggers/demo-opensuse-leap-ci.yaml b/ci/cloudbuild/triggers/demo-opensuse-leap-ci.yaml index ae9bcd864c143..6eff3d2493935 100644 --- a/ci/cloudbuild/triggers/demo-opensuse-leap-ci.yaml +++ b/ci/cloudbuild/triggers/demo-opensuse-leap-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-13T23:36:00.260269718Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 3b91bcd6-80af-4aa0-9e64-60047f5a65f5 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-opensuse-leap-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/3b91bcd6-80af-4aa0-9e64-60047f5a65f5 substitutions: _BUILD_NAME: demo-install _DISTRO: demo-opensuse-leap diff --git a/ci/cloudbuild/triggers/demo-opensuse-leap-pr.yaml b/ci/cloudbuild/triggers/demo-opensuse-leap-pr.yaml index 8f9130fc2a1b4..2bbe9a6816d40 100644 --- a/ci/cloudbuild/triggers/demo-opensuse-leap-pr.yaml +++ b/ci/cloudbuild/triggers/demo-opensuse-leap-pr.yaml @@ -12,15 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-13T23:36:01.288217115Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: f18095de-383b-45bd-835e-06a70adbf296 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-opensuse-leap-pr substitutions: diff --git a/ci/cloudbuild/triggers/demo-rockylinux-9-ci.yaml b/ci/cloudbuild/triggers/demo-rockylinux-9-ci.yaml index 688a3c84594c9..3845bef0579f7 100644 --- a/ci/cloudbuild/triggers/demo-rockylinux-9-ci.yaml +++ b/ci/cloudbuild/triggers/demo-rockylinux-9-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-11-09T20:49:08.012480312Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: de5ea0bf-fef1-433d-aa17-4cb50ab8278b + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-rockylinux-9-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/de5ea0bf-fef1-433d-aa17-4cb50ab8278b substitutions: _BUILD_NAME: demo-install _DISTRO: demo-rockylinux-9 diff --git a/ci/cloudbuild/triggers/demo-rockylinux-9-pr.yaml b/ci/cloudbuild/triggers/demo-rockylinux-9-pr.yaml index 80128088e5b7e..e4f813c366576 100644 --- a/ci/cloudbuild/triggers/demo-rockylinux-9-pr.yaml +++ b/ci/cloudbuild/triggers/demo-rockylinux-9-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-11-09T20:49:14.519880680Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 55c2722f-ba23-4b27-af94-cee7095098e2 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-rockylinux-9-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/55c2722f-ba23-4b27-af94-cee7095098e2 substitutions: _BUILD_NAME: demo-install _DISTRO: demo-rockylinux-9 diff --git a/ci/cloudbuild/triggers/demo-ubuntu-24-04-ci.yaml b/ci/cloudbuild/triggers/demo-ubuntu-24-04-ci.yaml index 76f3eba809deb..ade5c0ec17574 100644 --- a/ci/cloudbuild/triggers/demo-ubuntu-24-04-ci.yaml +++ b/ci/cloudbuild/triggers/demo-ubuntu-24-04-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2024-04-29T15:41:19.785339726Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 93fdf9e2-71b2-44a1-911e-13dca09cbd7c + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-ubuntu-24-04-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/93fdf9e2-71b2-44a1-911e-13dca09cbd7c substitutions: _BUILD_NAME: demo-install _DISTRO: demo-ubuntu-24.04 diff --git a/ci/cloudbuild/triggers/demo-ubuntu-24-04-pr.yaml b/ci/cloudbuild/triggers/demo-ubuntu-24-04-pr.yaml index a3cc011fc7e9e..97b31871e2f5b 100644 --- a/ci/cloudbuild/triggers/demo-ubuntu-24-04-pr.yaml +++ b/ci/cloudbuild/triggers/demo-ubuntu-24-04-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2024-04-29T15:40:53.593998357Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 4e65bb4a-0deb-4e5c-a074-f628fa012f13 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-ubuntu-24-04-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/4e65bb4a-0deb-4e5c-a074-f628fa012f13 substitutions: _BUILD_NAME: demo-install _DISTRO: demo-ubuntu-24.04 diff --git a/ci/cloudbuild/triggers/demo-ubuntu-focal-ci.yaml b/ci/cloudbuild/triggers/demo-ubuntu-focal-ci.yaml deleted file mode 100644 index 9c435a293efba..0000000000000 --- a/ci/cloudbuild/triggers/demo-ubuntu-focal-ci.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -createTime: '2021-04-13T23:36:04.667175923Z' -filename: ci/cloudbuild/cloudbuild.yaml -github: - name: google-cloud-cpp - owner: googleapis - push: - branch: ^main$ -id: 0294a1e2-044b-45d5-8ba0-6806c93b3a72 -includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS -name: demo-ubuntu-focal-ci -substitutions: - _BUILD_NAME: demo-install - _DISTRO: demo-ubuntu-focal - _TRIGGER_TYPE: ci -tags: -- ci diff --git a/ci/cloudbuild/triggers/demo-ubuntu-focal-pr.yaml b/ci/cloudbuild/triggers/demo-ubuntu-focal-pr.yaml deleted file mode 100644 index 639e4e8ac38c5..0000000000000 --- a/ci/cloudbuild/triggers/demo-ubuntu-focal-pr.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -createTime: '2021-04-13T23:36:05.750350763Z' -filename: ci/cloudbuild/cloudbuild.yaml -github: - name: google-cloud-cpp - owner: googleapis - pullRequest: - branch: ^main$ - commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 22188f98-620b-4a43-b5f7-34f206d70062 -includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS -name: demo-ubuntu-focal-pr -substitutions: - _BUILD_NAME: demo-install - _DISTRO: demo-ubuntu-focal - _TRIGGER_TYPE: pr -tags: -- pr diff --git a/ci/cloudbuild/triggers/demo-ubuntu-jammy-ci.yaml b/ci/cloudbuild/triggers/demo-ubuntu-jammy-ci.yaml index 750bbb568dc53..653032b5d8824 100644 --- a/ci/cloudbuild/triggers/demo-ubuntu-jammy-ci.yaml +++ b/ci/cloudbuild/triggers/demo-ubuntu-jammy-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-05-13T19:36:13.788953133Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: a646ace3-c0a6-4acf-8e42-72c8d2aece0c + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-ubuntu-jammy-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/a646ace3-c0a6-4acf-8e42-72c8d2aece0c substitutions: _BUILD_NAME: demo-install _DISTRO: demo-ubuntu-jammy diff --git a/ci/cloudbuild/triggers/demo-ubuntu-jammy-pr.yaml b/ci/cloudbuild/triggers/demo-ubuntu-jammy-pr.yaml index 866f7a55a244a..d1b1791ff826d 100644 --- a/ci/cloudbuild/triggers/demo-ubuntu-jammy-pr.yaml +++ b/ci/cloudbuild/triggers/demo-ubuntu-jammy-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-05-13T19:36:14.958592625Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: f190d45e-015f-4e09-bc3f-864aebf18316 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: demo-ubuntu-jammy-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/f190d45e-015f-4e09-bc3f-864aebf18316 substitutions: _BUILD_NAME: demo-install _DISTRO: demo-ubuntu-jammy diff --git a/ci/cloudbuild/triggers/gcc-oldest-ci.yaml b/ci/cloudbuild/triggers/gcc-oldest-ci.yaml index 4a3f90949fe28..0023a36528950 100644 --- a/ci/cloudbuild/triggers/gcc-oldest-ci.yaml +++ b/ci/cloudbuild/triggers/gcc-oldest-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2024-07-02T17:49:31.595592561Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 71fc938d-2480-4bdb-b274-eb0bf3a3ed1b + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: gcc-oldest-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/71fc938d-2480-4bdb-b274-eb0bf3a3ed1b substitutions: _BUILD_NAME: gcc-oldest _DISTRO: gcc-oldest diff --git a/ci/cloudbuild/triggers/gcc-oldest-pr.yaml b/ci/cloudbuild/triggers/gcc-oldest-pr.yaml index 5f2ddeb348c6f..0d4dca975c0c6 100644 --- a/ci/cloudbuild/triggers/gcc-oldest-pr.yaml +++ b/ci/cloudbuild/triggers/gcc-oldest-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2024-07-02T17:51:28.002279385Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: d2015e6f-b0c4-46a4-afc6-d1ac99c4abea includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: gcc-oldest-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/d2015e6f-b0c4-46a4-afc6-d1ac99c4abea substitutions: _BUILD_NAME: gcc-oldest _DISTRO: gcc-oldest diff --git a/ci/cloudbuild/triggers/generate-libraries-ci.yaml b/ci/cloudbuild/triggers/generate-libraries-ci.yaml index 032b0fe9af591..32da32c007023 100644 --- a/ci/cloudbuild/triggers/generate-libraries-ci.yaml +++ b/ci/cloudbuild/triggers/generate-libraries-ci.yaml @@ -12,14 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-23T21:24:08.230967530Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 11fcbd32-d016-4661-ba98-31c65277739c + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: generate-libraries-ci substitutions: diff --git a/ci/cloudbuild/triggers/generate-libraries-pr.yaml b/ci/cloudbuild/triggers/generate-libraries-pr.yaml index 0fd7ad36c90c4..a35c311807e99 100644 --- a/ci/cloudbuild/triggers/generate-libraries-pr.yaml +++ b/ci/cloudbuild/triggers/generate-libraries-pr.yaml @@ -12,15 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-23T21:24:15.931797724Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 6dc01f3c-7ccc-422f-8adb-2de0478853b3 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: generate-libraries-pr substitutions: diff --git a/ci/cloudbuild/triggers/grpc-at-head.yaml b/ci/cloudbuild/triggers/grpc-at-head.yaml index 6a7540265f2e4..c40a7b3f8e6f2 100644 --- a/ci/cloudbuild/triggers/grpc-at-head.yaml +++ b/ci/cloudbuild/triggers/grpc-at-head.yaml @@ -12,16 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-03-27T18:47:54.336916197Z' description: Compiles using gRPC at HEAD gitFileSource: path: ci/cloudbuild/cloudbuild.yaml repoType: GITHUB revision: refs/heads/main uri: https://github.com/googleapis/google-cloud-cpp -id: e21f4d09-213f-41ef-9be5-62309adf4287 name: grpc-at-head -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/e21f4d09-213f-41ef-9be5-62309adf4287 sourceToBuild: ref: refs/heads/main repoType: GITHUB diff --git a/ci/cloudbuild/triggers/integration-daily.yaml b/ci/cloudbuild/triggers/integration-daily.yaml index 6bb4b4101b872..05bf16aa9ce98 100644 --- a/ci/cloudbuild/triggers/integration-daily.yaml +++ b/ci/cloudbuild/triggers/integration-daily.yaml @@ -12,16 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-26T23:11:01.303393604Z' description: Runs the slow integration tests gitFileSource: path: ci/cloudbuild/cloudbuild.yaml repoType: GITHUB revision: refs/heads/main uri: https://github.com/googleapis/google-cloud-cpp -id: 03b9bb52-8d28-4095-9ca4-653f8602acf7 name: integration-daily -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/03b9bb52-8d28-4095-9ca4-653f8602acf7 sourceToBuild: ref: refs/heads/main repoType: GITHUB diff --git a/ci/cloudbuild/triggers/integration-production-ci.yaml b/ci/cloudbuild/triggers/integration-production-ci.yaml index 7c22f06458c91..57fb41a380704 100644 --- a/ci/cloudbuild/triggers/integration-production-ci.yaml +++ b/ci/cloudbuild/triggers/integration-production-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-02-10T22:16:26.551396759Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: ee3bb11b-6d26-4c21-a5fb-aeca37c2deb8 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: integration-production-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/ee3bb11b-6d26-4c21-a5fb-aeca37c2deb8 substitutions: _BUILD_NAME: integration-production _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/integration-production-pr.yaml b/ci/cloudbuild/triggers/integration-production-pr.yaml index 3ffd9c67bae97..a83c12b4daec7 100644 --- a/ci/cloudbuild/triggers/integration-production-pr.yaml +++ b/ci/cloudbuild/triggers/integration-production-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-02-10T22:16:19.911913669Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 60e90544-5856-457c-b293-d9bade69c132 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: integration-production-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/60e90544-5856-457c-b293-d9bade69c132 substitutions: _BUILD_NAME: integration-production _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/libcxx-ci.yaml b/ci/cloudbuild/triggers/libcxx-ci.yaml index 0fc1a57d02c30..60e093c3d4ca1 100644 --- a/ci/cloudbuild/triggers/libcxx-ci.yaml +++ b/ci/cloudbuild/triggers/libcxx-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-14T19:46:44.349528722Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 431b657a-77ea-4448-8f1f-16af521409e5 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: libcxx-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/431b657a-77ea-4448-8f1f-16af521409e5 substitutions: _BUILD_NAME: libcxx _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/libcxx-pr.yaml b/ci/cloudbuild/triggers/libcxx-pr.yaml index 12c49e687492c..f57a8f9c3f021 100644 --- a/ci/cloudbuild/triggers/libcxx-pr.yaml +++ b/ci/cloudbuild/triggers/libcxx-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-14T19:46:45.308277299Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: bb2d6a6f-9cf9-493a-bcbc-b7c0b60514a6 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: libcxx-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/bb2d6a6f-9cf9-493a-bcbc-b7c0b60514a6 substitutions: _BUILD_NAME: libcxx _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/m32-ci.yaml b/ci/cloudbuild/triggers/m32-ci.yaml index 98c6f632d9945..df6b32c0ed56b 100644 --- a/ci/cloudbuild/triggers/m32-ci.yaml +++ b/ci/cloudbuild/triggers/m32-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-02-08T12:05:48.696628316Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: b3c7d288-1474-4114-9a12-4d07d25a541e + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: m32-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/b3c7d288-1474-4114-9a12-4d07d25a541e substitutions: _BUILD_NAME: m32 _DISTRO: fedora-m32 diff --git a/ci/cloudbuild/triggers/m32-pr.yaml b/ci/cloudbuild/triggers/m32-pr.yaml index b608731b732bb..53a68533f0491 100644 --- a/ci/cloudbuild/triggers/m32-pr.yaml +++ b/ci/cloudbuild/triggers/m32-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-02-08T12:05:52.742100534Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 5eaadd40-1942-4c3f-b3ac-b4feae945a54 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: m32-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/5eaadd40-1942-4c3f-b3ac-b4feae945a54 substitutions: _BUILD_NAME: m32 _DISTRO: fedora-m32 diff --git a/ci/cloudbuild/triggers/msan-ci.yaml b/ci/cloudbuild/triggers/msan-ci.yaml index 30164fa9eba24..02858f0993295 100644 --- a/ci/cloudbuild/triggers/msan-ci.yaml +++ b/ci/cloudbuild/triggers/msan-ci.yaml @@ -12,14 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-15T01:54:43.175858386Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 6a79664d-8602-4312-9c33-810683d8f847 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: msan-ci substitutions: diff --git a/ci/cloudbuild/triggers/msan-pr.yaml b/ci/cloudbuild/triggers/msan-pr.yaml index cf775a9ab4704..e33b945030997 100644 --- a/ci/cloudbuild/triggers/msan-pr.yaml +++ b/ci/cloudbuild/triggers/msan-pr.yaml @@ -12,15 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-15T01:54:38.313691225Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: d9988eca-23ae-4b44-ad1f-ae38b12d5987 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: msan-pr substitutions: diff --git a/ci/cloudbuild/triggers/noex-ci.yaml b/ci/cloudbuild/triggers/noex-ci.yaml index fb5c1adb8185d..6d44a165b596c 100644 --- a/ci/cloudbuild/triggers/noex-ci.yaml +++ b/ci/cloudbuild/triggers/noex-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-14T14:41:37.760841534Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: ab963829-28af-4d7c-8aa4-e2598f8b8862 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: noex-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/ab963829-28af-4d7c-8aa4-e2598f8b8862 substitutions: _BUILD_NAME: noex _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/noex-pr.yaml b/ci/cloudbuild/triggers/noex-pr.yaml index 0870e554ca8aa..e95044ed202ef 100644 --- a/ci/cloudbuild/triggers/noex-pr.yaml +++ b/ci/cloudbuild/triggers/noex-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-14T14:41:33.605980616Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: da93fa8a-46af-4274-b397-ac1cc33c46c5 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: noex-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/da93fa8a-46af-4274-b397-ac1cc33c46c5 substitutions: _BUILD_NAME: noex _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/otel-disabled-bazel-ci.yaml b/ci/cloudbuild/triggers/otel-disabled-bazel-ci.yaml deleted file mode 100644 index 81d34aa9b4c73..0000000000000 --- a/ci/cloudbuild/triggers/otel-disabled-bazel-ci.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -createTime: '2022-11-29T04:06:34.344761147Z' -filename: ci/cloudbuild/cloudbuild.yaml -github: - name: google-cloud-cpp - owner: googleapis - push: - branch: ^main$ -id: 95ef05ac-0f7d-46b6-ae3c-bf9e3b1bd342 -includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS -name: otel-disabled-bazel-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/95ef05ac-0f7d-46b6-ae3c-bf9e3b1bd342 -substitutions: - _BUILD_NAME: otel-disabled-bazel - _DISTRO: fedora-latest-bazel - _TRIGGER_TYPE: ci -tags: -- ci diff --git a/ci/cloudbuild/triggers/otel-disabled-bazel-pr.yaml b/ci/cloudbuild/triggers/otel-disabled-bazel-pr.yaml deleted file mode 100644 index c23e51ca34edf..0000000000000 --- a/ci/cloudbuild/triggers/otel-disabled-bazel-pr.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -createTime: '2022-11-29T04:06:20.679878755Z' -filename: ci/cloudbuild/cloudbuild.yaml -github: - name: google-cloud-cpp - owner: googleapis - pullRequest: - branch: ^main$ - commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: e645a8df-6b2c-4911-a192-e36e6d8935b6 -includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS -name: otel-disabled-bazel-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/e645a8df-6b2c-4911-a192-e36e6d8935b6 -substitutions: - _BUILD_NAME: otel-disabled-bazel - _DISTRO: fedora-latest-bazel - _TRIGGER_TYPE: pr -tags: -- pr diff --git a/ci/cloudbuild/triggers/protobuf-at-head.yaml b/ci/cloudbuild/triggers/protobuf-at-head.yaml index c2f1d9a6d247d..5e12284df97bf 100644 --- a/ci/cloudbuild/triggers/protobuf-at-head.yaml +++ b/ci/cloudbuild/triggers/protobuf-at-head.yaml @@ -12,16 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-06-13T12:46:50.379194817Z' description: Compiles using gRPC at HEAD gitFileSource: path: ci/cloudbuild/cloudbuild.yaml repoType: GITHUB revision: refs/heads/main uri: https://github.com/googleapis/google-cloud-cpp -id: 7dc9cea4-9d0b-4d0f-9947-5b79bfee5c12 name: protobuf-at-head -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/7dc9cea4-9d0b-4d0f-9947-5b79bfee5c12 sourceToBuild: ref: refs/heads/main repoType: GITHUB diff --git a/ci/cloudbuild/triggers/publish-docs-ci.yaml b/ci/cloudbuild/triggers/publish-docs-ci.yaml index 06c8d2a99eff9..60afdccb03176 100644 --- a/ci/cloudbuild/triggers/publish-docs-ci.yaml +++ b/ci/cloudbuild/triggers/publish-docs-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-23T19:47:54.365241453Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: ee436bb0-22ab-407d-ab69-2a73aec2566d + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: publish-docs-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/ee436bb0-22ab-407d-ab69-2a73aec2566d substitutions: _BUILD_NAME: publish-docs _DISTRO: fedora-latest-publish-docs diff --git a/ci/cloudbuild/triggers/publish-docs-compute-pr.yaml b/ci/cloudbuild/triggers/publish-docs-compute-pr.yaml index 4f1ddfb1d58cb..1b05c25d5cf83 100644 --- a/ci/cloudbuild/triggers/publish-docs-compute-pr.yaml +++ b/ci/cloudbuild/triggers/publish-docs-compute-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2023-08-28T23:51:12.027081210Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 30ee0e3e-4eed-4b33-8786-47baae4947c1 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: publish-docs-compute-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/30ee0e3e-4eed-4b33-8786-47baae4947c1 substitutions: _BUILD_NAME: publish-docs _DISTRO: fedora-latest-publish-docs diff --git a/ci/cloudbuild/triggers/publish-docs-pr.yaml b/ci/cloudbuild/triggers/publish-docs-pr.yaml index 91234eb86db42..c526c61ea35f1 100644 --- a/ci/cloudbuild/triggers/publish-docs-pr.yaml +++ b/ci/cloudbuild/triggers/publish-docs-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-23T21:24:42.026459567Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 7957a267-70de-4e1b-a6b9-99469602a8af includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: publish-docs-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/7957a267-70de-4e1b-a6b9-99469602a8af substitutions: _BUILD_NAME: publish-docs _DISTRO: fedora-latest-publish-docs diff --git a/ci/cloudbuild/triggers/publish-docs-release.yaml b/ci/cloudbuild/triggers/publish-docs-release.yaml index f2f64840f1708..9b665a871cc9d 100644 --- a/ci/cloudbuild/triggers/publish-docs-release.yaml +++ b/ci/cloudbuild/triggers/publish-docs-release.yaml @@ -12,16 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-11-02T14:12:26.217489944Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^v2.*.x$ -id: d8deccfb-08d6-4ab7-b8fe-1d59c2d346ea + branch: main name: publish-docs-release -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/d8deccfb-08d6-4ab7-b8fe-1d59c2d346ea substitutions: _BUILD_NAME: publish-docs _DISTRO: fedora-latest-publish-docs diff --git a/ci/cloudbuild/triggers/quickstart-bazel-ci.yaml b/ci/cloudbuild/triggers/quickstart-bazel-ci.yaml index 7f76a05047241..5a73633862a9c 100644 --- a/ci/cloudbuild/triggers/quickstart-bazel-ci.yaml +++ b/ci/cloudbuild/triggers/quickstart-bazel-ci.yaml @@ -12,14 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-03-29T23:07:34.524944837Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 1967685b-bdf1-48e2-abe5-593db92382ef + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: quickstart-bazel-ci substitutions: diff --git a/ci/cloudbuild/triggers/quickstart-bazel-pr.yaml b/ci/cloudbuild/triggers/quickstart-bazel-pr.yaml index 35e3d24f2b615..6dd7a2a33acd1 100644 --- a/ci/cloudbuild/triggers/quickstart-bazel-pr.yaml +++ b/ci/cloudbuild/triggers/quickstart-bazel-pr.yaml @@ -12,15 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-09T18:15:48.096780282Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 77afa7e6-cfd6-46c4-9b38-a943a61335ca includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: quickstart-bazel-pr substitutions: diff --git a/ci/cloudbuild/triggers/quickstart-cmake-ci.yaml b/ci/cloudbuild/triggers/quickstart-cmake-ci.yaml index 76d7afc27e182..3afb6a022de72 100644 --- a/ci/cloudbuild/triggers/quickstart-cmake-ci.yaml +++ b/ci/cloudbuild/triggers/quickstart-cmake-ci.yaml @@ -12,19 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-03-29T23:07:43.402748254Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: ff22d673-dc4c-4330-922e-d43be27ef2b4 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: quickstart-cmake-ci substitutions: _BUILD_NAME: quickstart-cmake - _DISTRO: ubuntu-focal + _DISTRO: ubuntu-24.04 _TRIGGER_TYPE: ci tags: - ci diff --git a/ci/cloudbuild/triggers/quickstart-cmake-pr.yaml b/ci/cloudbuild/triggers/quickstart-cmake-pr.yaml index 66d23059e1546..6d0df027eba1e 100644 --- a/ci/cloudbuild/triggers/quickstart-cmake-pr.yaml +++ b/ci/cloudbuild/triggers/quickstart-cmake-pr.yaml @@ -12,20 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-09T18:15:49.856898769Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 94aaedf9-cbc3-4b7b-b571-a6281587d358 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: quickstart-cmake-pr substitutions: _BUILD_NAME: quickstart-cmake - _DISTRO: ubuntu-focal + _DISTRO: ubuntu-24.04 _TRIGGER_TYPE: pr tags: - pr diff --git a/ci/cloudbuild/triggers/quickstart-production-ci.yaml b/ci/cloudbuild/triggers/quickstart-production-ci.yaml index d65a6f0ea9fa6..23dbe4d1f3c4d 100644 --- a/ci/cloudbuild/triggers/quickstart-production-ci.yaml +++ b/ci/cloudbuild/triggers/quickstart-production-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-02-11T02:48:03.262626422Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: f516d42a-ed88-432f-9ee7-5e4ac4d5c676 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: quickstart-production-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/f516d42a-ed88-432f-9ee7-5e4ac4d5c676 substitutions: _BUILD_NAME: quickstart-production _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/quickstart-production-pr.yaml b/ci/cloudbuild/triggers/quickstart-production-pr.yaml index 61c5159c0fd5d..b02d753941c7c 100644 --- a/ci/cloudbuild/triggers/quickstart-production-pr.yaml +++ b/ci/cloudbuild/triggers/quickstart-production-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2022-02-11T02:48:08.775499777Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: e373a802-f341-4559-bb55-7ec64f1ee825 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: quickstart-production-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/e373a802-f341-4559-bb55-7ec64f1ee825 substitutions: _BUILD_NAME: quickstart-production _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/rotate-keys.yaml b/ci/cloudbuild/triggers/rotate-keys.yaml index 6fe036a1ab2ba..fe04f92ff3e1b 100644 --- a/ci/cloudbuild/triggers/rotate-keys.yaml +++ b/ci/cloudbuild/triggers/rotate-keys.yaml @@ -12,16 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-23T00:24:28.311789386Z' description: Rotates the SA keys used by the GCS integration test gitFileSource: path: ci/cloudbuild/cloudbuild.yaml repoType: GITHUB revision: refs/heads/main uri: https://github.com/googleapis/google-cloud-cpp -id: 3fca51de-ec4c-453f-9693-5ccec556a379 name: rotate-keys -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/3fca51de-ec4c-453f-9693-5ccec556a379 sourceToBuild: ref: refs/heads/main repoType: GITHUB diff --git a/ci/cloudbuild/triggers/shared-ci.yaml b/ci/cloudbuild/triggers/shared-ci.yaml index 008946395d067..debb9fefb7e51 100644 --- a/ci/cloudbuild/triggers/shared-ci.yaml +++ b/ci/cloudbuild/triggers/shared-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-16T17:54:50.114636655Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 876841fe-996a-4b64-a080-62b05313b8ff + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: shared-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/876841fe-996a-4b64-a080-62b05313b8ff substitutions: _BUILD_NAME: shared _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/shared-pr.yaml b/ci/cloudbuild/triggers/shared-pr.yaml index 403320d3b4727..0dbfb2c554d59 100644 --- a/ci/cloudbuild/triggers/shared-pr.yaml +++ b/ci/cloudbuild/triggers/shared-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-16T17:54:51.132738909Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 0a6fec60-47ba-4795-979b-4aec54e16d1a includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: shared-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/0a6fec60-47ba-4795-979b-4aec54e16d1a substitutions: _BUILD_NAME: shared _DISTRO: fedora-latest-cmake diff --git a/ci/cloudbuild/triggers/tsan-ci.yaml b/ci/cloudbuild/triggers/tsan-ci.yaml index a58bf045dc09f..e081182e60304 100644 --- a/ci/cloudbuild/triggers/tsan-ci.yaml +++ b/ci/cloudbuild/triggers/tsan-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-03-30T01:00:00.841245060Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: de7c77d3-385d-48b6-a6e8-9dda0c171716 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: tsan-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/de7c77d3-385d-48b6-a6e8-9dda0c171716 substitutions: _BUILD_NAME: tsan _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/tsan-pr.yaml b/ci/cloudbuild/triggers/tsan-pr.yaml index 41f3d6d016aa5..621a50eb82e4d 100644 --- a/ci/cloudbuild/triggers/tsan-pr.yaml +++ b/ci/cloudbuild/triggers/tsan-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-09T18:15:51.542576617Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: ea400a9b-879a-4e13-a4b3-9109825d6e99 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: tsan-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/ea400a9b-879a-4e13-a4b3-9109825d6e99 substitutions: _BUILD_NAME: tsan _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/ubsan-ci.yaml b/ci/cloudbuild/triggers/ubsan-ci.yaml index 7cbb2d8d1eeab..b0094bad88bfa 100644 --- a/ci/cloudbuild/triggers/ubsan-ci.yaml +++ b/ci/cloudbuild/triggers/ubsan-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-03-28T18:40:21.563522491Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: f61a17f2-316f-4ba5-a56a-5abd55e3da83 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: ubsan-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/f61a17f2-316f-4ba5-a56a-5abd55e3da83 substitutions: _BUILD_NAME: ubsan _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/ubsan-pr.yaml b/ci/cloudbuild/triggers/ubsan-pr.yaml index 61d4e03aa8f6b..4c94612c38dcc 100644 --- a/ci/cloudbuild/triggers/ubsan-pr.yaml +++ b/ci/cloudbuild/triggers/ubsan-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-09T18:15:53.351255451Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 6e77e431-c822-40c7-a8de-7860b4b0fc69 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: ubsan-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/6e77e431-c822-40c7-a8de-7860b4b0fc69 substitutions: _BUILD_NAME: ubsan _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/universe-domain-ci.yaml b/ci/cloudbuild/triggers/universe-domain-ci.yaml index 860a7bee6332d..67725b15dffc6 100644 --- a/ci/cloudbuild/triggers/universe-domain-ci.yaml +++ b/ci/cloudbuild/triggers/universe-domain-ci.yaml @@ -17,7 +17,7 @@ github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ + branch: main name: universe-domain-ci substitutions: _BUILD_NAME: universe-domain diff --git a/ci/cloudbuild/triggers/universe-domain-pr.yaml b/ci/cloudbuild/triggers/universe-domain-pr.yaml index 61b0926549a7d..0f27ae1ad1d9d 100644 --- a/ci/cloudbuild/triggers/universe-domain-pr.yaml +++ b/ci/cloudbuild/triggers/universe-domain-pr.yaml @@ -17,7 +17,7 @@ github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY name: universe-domain-pr substitutions: diff --git a/ci/cloudbuild/triggers/xsan-ci.yaml b/ci/cloudbuild/triggers/xsan-ci.yaml index 17489a5295092..378d092302af4 100644 --- a/ci/cloudbuild/triggers/xsan-ci.yaml +++ b/ci/cloudbuild/triggers/xsan-ci.yaml @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-03-23T16:27:32.983843488Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: - branch: ^main$ -id: 7af338de-c46d-41ff-a96b-f58e3b720fc5 + branch: main includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: xsan-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/7af338de-c46d-41ff-a96b-f58e3b720fc5 substitutions: _BUILD_NAME: xsan _DISTRO: fedora-latest-bazel diff --git a/ci/cloudbuild/triggers/xsan-pr.yaml b/ci/cloudbuild/triggers/xsan-pr.yaml index 6cd9595b22baa..524896dcc69ca 100644 --- a/ci/cloudbuild/triggers/xsan-pr.yaml +++ b/ci/cloudbuild/triggers/xsan-pr.yaml @@ -12,18 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -createTime: '2021-04-09T18:15:54.945301389Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis pullRequest: - branch: ^main$ + branch: main commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: 679ab848-3bcc-4e46-b4e5-4cd86d4b1405 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: xsan-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/679ab848-3bcc-4e46-b4e5-4cd86d4b1405 substitutions: _BUILD_NAME: xsan _DISTRO: fedora-latest-bazel diff --git a/ci/etc/expected_install_directories b/ci/etc/expected_install_directories index 6610b6dba68df..5e38dd32f7cc5 100644 --- a/ci/etc/expected_install_directories +++ b/ci/etc/expected_install_directories @@ -21,12 +21,10 @@ ./include/google/bigtable/v2 ./include/google/cloud ./include/google/cloud/accessapproval -./include/google/cloud/accessapproval/mocks ./include/google/cloud/accessapproval/v1 ./include/google/cloud/accessapproval/v1/internal ./include/google/cloud/accessapproval/v1/mocks ./include/google/cloud/accesscontextmanager -./include/google/cloud/accesscontextmanager/mocks ./include/google/cloud/accesscontextmanager/v1 ./include/google/cloud/accesscontextmanager/v1/internal ./include/google/cloud/accesscontextmanager/v1/mocks @@ -43,17 +41,14 @@ ./include/google/cloud/alloydb/v1/internal ./include/google/cloud/alloydb/v1/mocks ./include/google/cloud/apigateway -./include/google/cloud/apigateway/mocks ./include/google/cloud/apigateway/v1 ./include/google/cloud/apigateway/v1/internal ./include/google/cloud/apigateway/v1/mocks ./include/google/cloud/apigeeconnect -./include/google/cloud/apigeeconnect/mocks ./include/google/cloud/apigeeconnect/v1 ./include/google/cloud/apigeeconnect/v1/internal ./include/google/cloud/apigeeconnect/v1/mocks ./include/google/cloud/apikeys -./include/google/cloud/apikeys/mocks ./include/google/cloud/apikeys/v2 ./include/google/cloud/apikeys/v2/internal ./include/google/cloud/apikeys/v2/mocks @@ -62,7 +57,6 @@ ./include/google/cloud/apiregistry/v1/internal ./include/google/cloud/apiregistry/v1/mocks ./include/google/cloud/appengine -./include/google/cloud/appengine/mocks ./include/google/cloud/appengine/v1 ./include/google/cloud/appengine/v1/internal ./include/google/cloud/appengine/v1/mocks @@ -71,17 +65,14 @@ ./include/google/cloud/apphub/v1/internal ./include/google/cloud/apphub/v1/mocks ./include/google/cloud/artifactregistry -./include/google/cloud/artifactregistry/mocks ./include/google/cloud/artifactregistry/v1 ./include/google/cloud/artifactregistry/v1/internal ./include/google/cloud/artifactregistry/v1/mocks ./include/google/cloud/asset -./include/google/cloud/asset/mocks ./include/google/cloud/asset/v1 ./include/google/cloud/asset/v1/internal ./include/google/cloud/asset/v1/mocks ./include/google/cloud/assuredworkloads -./include/google/cloud/assuredworkloads/mocks ./include/google/cloud/assuredworkloads/v1 ./include/google/cloud/assuredworkloads/v1/internal ./include/google/cloud/assuredworkloads/v1/mocks @@ -90,7 +81,6 @@ ./include/google/cloud/auditmanager/v1/internal ./include/google/cloud/auditmanager/v1/mocks ./include/google/cloud/automl -./include/google/cloud/automl/mocks ./include/google/cloud/automl/v1 ./include/google/cloud/automl/v1/internal ./include/google/cloud/automl/v1/mocks @@ -99,12 +89,10 @@ ./include/google/cloud/backupdr/v1/internal ./include/google/cloud/backupdr/v1/mocks ./include/google/cloud/baremetalsolution -./include/google/cloud/baremetalsolution/mocks ./include/google/cloud/baremetalsolution/v2 ./include/google/cloud/baremetalsolution/v2/internal ./include/google/cloud/baremetalsolution/v2/mocks ./include/google/cloud/batch -./include/google/cloud/batch/mocks ./include/google/cloud/batch/v1 ./include/google/cloud/batch/v1/internal ./include/google/cloud/batch/v1/mocks @@ -121,7 +109,6 @@ ./include/google/cloud/beyondcorp/appgateways/v1 ./include/google/cloud/beyondcorp/appgateways/v1/internal ./include/google/cloud/beyondcorp/appgateways/v1/mocks -./include/google/cloud/beyondcorp/mocks ./include/google/cloud/bigquery ./include/google/cloud/bigquery/analyticshub ./include/google/cloud/bigquery/analyticshub/v1 @@ -150,7 +137,6 @@ ./include/google/cloud/bigquery/migration/v2 ./include/google/cloud/bigquery/migration/v2/internal ./include/google/cloud/bigquery/migration/v2/mocks -./include/google/cloud/bigquery/mocks ./include/google/cloud/bigquery/reservation ./include/google/cloud/bigquery/reservation/v1 ./include/google/cloud/bigquery/reservation/v1/internal @@ -174,22 +160,22 @@ ./include/google/cloud/billing/budgets/v1 ./include/google/cloud/billing/budgets/v1/internal ./include/google/cloud/billing/budgets/v1/mocks -./include/google/cloud/billing/mocks ./include/google/cloud/billing/v1 ./include/google/cloud/billing/v1/internal ./include/google/cloud/billing/v1/mocks ./include/google/cloud/binaryauthorization -./include/google/cloud/binaryauthorization/mocks ./include/google/cloud/binaryauthorization/v1 ./include/google/cloud/binaryauthorization/v1/internal ./include/google/cloud/binaryauthorization/v1/mocks ./include/google/cloud/certificatemanager -./include/google/cloud/certificatemanager/mocks ./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/mocks ./include/google/cloud/channel/v1 ./include/google/cloud/channel/v1/internal ./include/google/cloud/channel/v1/mocks @@ -198,7 +184,6 @@ ./include/google/cloud/chronicle/v1/internal ./include/google/cloud/chronicle/v1/mocks ./include/google/cloud/cloudbuild -./include/google/cloud/cloudbuild/mocks ./include/google/cloud/cloudbuild/v1 ./include/google/cloud/cloudbuild/v1/internal ./include/google/cloud/cloudbuild/v1/mocks @@ -226,7 +211,6 @@ ./include/google/cloud/commerce/consumer/procurement/v1/internal ./include/google/cloud/commerce/consumer/procurement/v1/mocks ./include/google/cloud/composer -./include/google/cloud/composer/mocks ./include/google/cloud/composer/v1 ./include/google/cloud/composer/v1/internal ./include/google/cloud/composer/v1/mocks @@ -664,22 +648,18 @@ ./include/google/cloud/configdelivery/v1/internal ./include/google/cloud/configdelivery/v1/mocks ./include/google/cloud/connectors -./include/google/cloud/connectors/mocks ./include/google/cloud/connectors/v1 ./include/google/cloud/connectors/v1/internal ./include/google/cloud/connectors/v1/mocks ./include/google/cloud/contactcenterinsights -./include/google/cloud/contactcenterinsights/mocks ./include/google/cloud/contactcenterinsights/v1 ./include/google/cloud/contactcenterinsights/v1/internal ./include/google/cloud/contactcenterinsights/v1/mocks ./include/google/cloud/container -./include/google/cloud/container/mocks ./include/google/cloud/container/v1 ./include/google/cloud/container/v1/internal ./include/google/cloud/container/v1/mocks ./include/google/cloud/containeranalysis -./include/google/cloud/containeranalysis/mocks ./include/google/cloud/containeranalysis/v1 ./include/google/cloud/containeranalysis/v1/internal ./include/google/cloud/containeranalysis/v1/mocks @@ -689,10 +669,13 @@ ./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 -./include/google/cloud/datacatalog/mocks ./include/google/cloud/datacatalog/v1 ./include/google/cloud/datacatalog/v1/internal ./include/google/cloud/datacatalog/v1/mocks @@ -705,17 +688,14 @@ ./include/google/cloud/datafusion/v1/internal ./include/google/cloud/datafusion/v1/mocks ./include/google/cloud/datamigration -./include/google/cloud/datamigration/mocks ./include/google/cloud/datamigration/v1 ./include/google/cloud/datamigration/v1/internal ./include/google/cloud/datamigration/v1/mocks ./include/google/cloud/dataplex -./include/google/cloud/dataplex/mocks ./include/google/cloud/dataplex/v1 ./include/google/cloud/dataplex/v1/internal ./include/google/cloud/dataplex/v1/mocks ./include/google/cloud/dataproc -./include/google/cloud/dataproc/mocks ./include/google/cloud/dataproc/v1 ./include/google/cloud/dataproc/v1/internal ./include/google/cloud/dataproc/v1/mocks @@ -728,12 +708,10 @@ ./include/google/cloud/datastore/v1/internal ./include/google/cloud/datastore/v1/mocks ./include/google/cloud/datastream -./include/google/cloud/datastream/mocks ./include/google/cloud/datastream/v1 ./include/google/cloud/datastream/v1/internal ./include/google/cloud/datastream/v1/mocks ./include/google/cloud/deploy -./include/google/cloud/deploy/mocks ./include/google/cloud/deploy/v1 ./include/google/cloud/deploy/v1/internal ./include/google/cloud/deploy/v1/mocks @@ -760,12 +738,10 @@ ./include/google/cloud/discoveryengine/v1/internal ./include/google/cloud/discoveryengine/v1/mocks ./include/google/cloud/dlp -./include/google/cloud/dlp/mocks ./include/google/cloud/dlp/v2 ./include/google/cloud/dlp/v2/internal ./include/google/cloud/dlp/v2/mocks ./include/google/cloud/documentai -./include/google/cloud/documentai/mocks ./include/google/cloud/documentai/v1 ./include/google/cloud/documentai/v1/internal ./include/google/cloud/documentai/v1/mocks @@ -774,7 +750,6 @@ ./include/google/cloud/domains/v1/internal ./include/google/cloud/domains/v1/mocks ./include/google/cloud/edgecontainer -./include/google/cloud/edgecontainer/mocks ./include/google/cloud/edgecontainer/v1 ./include/google/cloud/edgecontainer/v1/internal ./include/google/cloud/edgecontainer/v1/mocks @@ -787,7 +762,6 @@ ./include/google/cloud/essentialcontacts/v1/internal ./include/google/cloud/essentialcontacts/v1/mocks ./include/google/cloud/eventarc -./include/google/cloud/eventarc/mocks ./include/google/cloud/eventarc/publishing ./include/google/cloud/eventarc/publishing/v1 ./include/google/cloud/eventarc/publishing/v1/internal @@ -796,7 +770,6 @@ ./include/google/cloud/eventarc/v1/internal ./include/google/cloud/eventarc/v1/mocks ./include/google/cloud/filestore -./include/google/cloud/filestore/mocks ./include/google/cloud/filestore/v1 ./include/google/cloud/filestore/v1/internal ./include/google/cloud/filestore/v1/mocks @@ -805,7 +778,6 @@ ./include/google/cloud/financialservices/v1/internal ./include/google/cloud/financialservices/v1/mocks ./include/google/cloud/functions -./include/google/cloud/functions/mocks ./include/google/cloud/functions/v1 ./include/google/cloud/functions/v1/internal ./include/google/cloud/functions/v1/mocks @@ -822,7 +794,6 @@ ./include/google/cloud/gkeconnect/gateway/v1/internal ./include/google/cloud/gkeconnect/gateway/v1/mocks ./include/google/cloud/gkehub -./include/google/cloud/gkehub/mocks ./include/google/cloud/gkehub/v1 ./include/google/cloud/gkehub/v1/internal ./include/google/cloud/gkehub/v1/mocks @@ -834,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 @@ -843,7 +818,6 @@ ./include/google/cloud/iam/credentials/v1 ./include/google/cloud/iam/credentials/v1/internal ./include/google/cloud/iam/credentials/v1/mocks -./include/google/cloud/iam/mocks ./include/google/cloud/iam/v1 ./include/google/cloud/iam/v1/internal ./include/google/cloud/iam/v1/mocks @@ -854,12 +828,10 @@ ./include/google/cloud/iam/v3/internal ./include/google/cloud/iam/v3/mocks ./include/google/cloud/iap -./include/google/cloud/iap/mocks ./include/google/cloud/iap/v1 ./include/google/cloud/iap/v1/internal ./include/google/cloud/iap/v1/mocks ./include/google/cloud/ids -./include/google/cloud/ids/mocks ./include/google/cloud/ids/v1 ./include/google/cloud/ids/v1/internal ./include/google/cloud/ids/v1/mocks @@ -868,12 +840,10 @@ ./include/google/cloud/kms/inventory/v1 ./include/google/cloud/kms/inventory/v1/internal ./include/google/cloud/kms/inventory/v1/mocks -./include/google/cloud/kms/mocks ./include/google/cloud/kms/v1 ./include/google/cloud/kms/v1/internal ./include/google/cloud/kms/v1/mocks ./include/google/cloud/language -./include/google/cloud/language/mocks ./include/google/cloud/language/v1 ./include/google/cloud/language/v1/internal ./include/google/cloud/language/v1/mocks @@ -885,7 +855,6 @@ ./include/google/cloud/licensemanager/v1/internal ./include/google/cloud/licensemanager/v1/mocks ./include/google/cloud/logging -./include/google/cloud/logging/mocks ./include/google/cloud/logging/v2 ./include/google/cloud/logging/v2/internal ./include/google/cloud/logging/v2/mocks @@ -899,7 +868,6 @@ ./include/google/cloud/maintenance/api/v1/internal ./include/google/cloud/maintenance/api/v1/mocks ./include/google/cloud/managedidentities -./include/google/cloud/managedidentities/mocks ./include/google/cloud/managedidentities/v1 ./include/google/cloud/managedidentities/v1/internal ./include/google/cloud/managedidentities/v1/mocks @@ -912,7 +880,6 @@ ./include/google/cloud/managedkafka/v1/internal ./include/google/cloud/managedkafka/v1/mocks ./include/google/cloud/memcache -./include/google/cloud/memcache/mocks ./include/google/cloud/memcache/v1 ./include/google/cloud/memcache/v1/internal ./include/google/cloud/memcache/v1/mocks @@ -937,7 +904,6 @@ ./include/google/cloud/monitoring/metricsscope/v1 ./include/google/cloud/monitoring/metricsscope/v1/internal ./include/google/cloud/monitoring/metricsscope/v1/mocks -./include/google/cloud/monitoring/mocks ./include/google/cloud/monitoring/v3 ./include/google/cloud/monitoring/v3/internal ./include/google/cloud/monitoring/v3/mocks @@ -946,12 +912,10 @@ ./include/google/cloud/netapp/v1/internal ./include/google/cloud/netapp/v1/mocks ./include/google/cloud/networkconnectivity -./include/google/cloud/networkconnectivity/mocks ./include/google/cloud/networkconnectivity/v1 ./include/google/cloud/networkconnectivity/v1/internal ./include/google/cloud/networkconnectivity/v1/mocks ./include/google/cloud/networkmanagement -./include/google/cloud/networkmanagement/mocks ./include/google/cloud/networkmanagement/v1 ./include/google/cloud/networkmanagement/v1/internal ./include/google/cloud/networkmanagement/v1/mocks @@ -964,7 +928,6 @@ ./include/google/cloud/networkservices/v1/internal ./include/google/cloud/networkservices/v1/mocks ./include/google/cloud/notebooks -./include/google/cloud/notebooks/mocks ./include/google/cloud/notebooks/v1 ./include/google/cloud/notebooks/v1/internal ./include/google/cloud/notebooks/v1/mocks @@ -972,7 +935,6 @@ ./include/google/cloud/notebooks/v2/internal ./include/google/cloud/notebooks/v2/mocks ./include/google/cloud/optimization -./include/google/cloud/optimization/mocks ./include/google/cloud/optimization/v1 ./include/google/cloud/optimization/v1/internal ./include/google/cloud/optimization/v1/mocks @@ -985,7 +947,6 @@ ./include/google/cloud/orchestration/airflow/service ./include/google/cloud/orchestration/airflow/service/v1 ./include/google/cloud/orgpolicy -./include/google/cloud/orgpolicy/mocks ./include/google/cloud/orgpolicy/v2 ./include/google/cloud/orgpolicy/v2/internal ./include/google/cloud/orgpolicy/v2/mocks @@ -994,12 +955,10 @@ ./include/google/cloud/osconfig/agentendpoint/v1 ./include/google/cloud/osconfig/agentendpoint/v1/internal ./include/google/cloud/osconfig/agentendpoint/v1/mocks -./include/google/cloud/osconfig/mocks ./include/google/cloud/osconfig/v1 ./include/google/cloud/osconfig/v1/internal ./include/google/cloud/osconfig/v1/mocks ./include/google/cloud/oslogin -./include/google/cloud/oslogin/mocks ./include/google/cloud/oslogin/v1 ./include/google/cloud/oslogin/v1/internal ./include/google/cloud/oslogin/v1/mocks @@ -1020,12 +979,10 @@ ./include/google/cloud/policytroubleshooter/iam/v3 ./include/google/cloud/policytroubleshooter/iam/v3/internal ./include/google/cloud/policytroubleshooter/iam/v3/mocks -./include/google/cloud/policytroubleshooter/mocks ./include/google/cloud/policytroubleshooter/v1 ./include/google/cloud/policytroubleshooter/v1/internal ./include/google/cloud/policytroubleshooter/v1/mocks ./include/google/cloud/privateca -./include/google/cloud/privateca/mocks ./include/google/cloud/privateca/v1 ./include/google/cloud/privateca/v1/internal ./include/google/cloud/privateca/v1/mocks @@ -1034,7 +991,6 @@ ./include/google/cloud/privilegedaccessmanager/v1/internal ./include/google/cloud/privilegedaccessmanager/v1/mocks ./include/google/cloud/profiler -./include/google/cloud/profiler/mocks ./include/google/cloud/profiler/v2 ./include/google/cloud/profiler/v2/internal ./include/google/cloud/profiler/v2/mocks @@ -1061,7 +1017,6 @@ ./include/google/cloud/recaptchaenterprise/v1/internal ./include/google/cloud/recaptchaenterprise/v1/mocks ./include/google/cloud/recommender -./include/google/cloud/recommender/mocks ./include/google/cloud/recommender/v1 ./include/google/cloud/recommender/v1/internal ./include/google/cloud/recommender/v1/mocks @@ -1070,32 +1025,26 @@ ./include/google/cloud/redis/cluster/v1 ./include/google/cloud/redis/cluster/v1/internal ./include/google/cloud/redis/cluster/v1/mocks -./include/google/cloud/redis/mocks ./include/google/cloud/redis/v1 ./include/google/cloud/redis/v1/internal ./include/google/cloud/redis/v1/mocks ./include/google/cloud/resourcemanager -./include/google/cloud/resourcemanager/mocks ./include/google/cloud/resourcemanager/v3 ./include/google/cloud/resourcemanager/v3/internal ./include/google/cloud/resourcemanager/v3/mocks ./include/google/cloud/retail -./include/google/cloud/retail/mocks ./include/google/cloud/retail/v2 ./include/google/cloud/retail/v2/internal ./include/google/cloud/retail/v2/mocks ./include/google/cloud/run -./include/google/cloud/run/mocks ./include/google/cloud/run/v2 ./include/google/cloud/run/v2/internal ./include/google/cloud/run/v2/mocks ./include/google/cloud/scheduler -./include/google/cloud/scheduler/mocks ./include/google/cloud/scheduler/v1 ./include/google/cloud/scheduler/v1/internal ./include/google/cloud/scheduler/v1/mocks ./include/google/cloud/secretmanager -./include/google/cloud/secretmanager/mocks ./include/google/cloud/secretmanager/v1 ./include/google/cloud/secretmanager/v1/internal ./include/google/cloud/secretmanager/v1/mocks @@ -1109,7 +1058,6 @@ ./include/google/cloud/security/publicca ./include/google/cloud/security/publicca/v1 ./include/google/cloud/securitycenter -./include/google/cloud/securitycenter/mocks ./include/google/cloud/securitycenter/v1 ./include/google/cloud/securitycenter/v1/internal ./include/google/cloud/securitycenter/v1/mocks @@ -1121,7 +1069,6 @@ ./include/google/cloud/securitycentermanagement/v1/internal ./include/google/cloud/securitycentermanagement/v1/mocks ./include/google/cloud/servicecontrol -./include/google/cloud/servicecontrol/mocks ./include/google/cloud/servicecontrol/v1 ./include/google/cloud/servicecontrol/v1/internal ./include/google/cloud/servicecontrol/v1/mocks @@ -1129,7 +1076,6 @@ ./include/google/cloud/servicecontrol/v2/internal ./include/google/cloud/servicecontrol/v2/mocks ./include/google/cloud/servicedirectory -./include/google/cloud/servicedirectory/mocks ./include/google/cloud/servicedirectory/v1 ./include/google/cloud/servicedirectory/v1/internal ./include/google/cloud/servicedirectory/v1/mocks @@ -1138,17 +1084,14 @@ ./include/google/cloud/servicehealth/v1/internal ./include/google/cloud/servicehealth/v1/mocks ./include/google/cloud/servicemanagement -./include/google/cloud/servicemanagement/mocks ./include/google/cloud/servicemanagement/v1 ./include/google/cloud/servicemanagement/v1/internal ./include/google/cloud/servicemanagement/v1/mocks ./include/google/cloud/serviceusage -./include/google/cloud/serviceusage/mocks ./include/google/cloud/serviceusage/v1 ./include/google/cloud/serviceusage/v1/internal ./include/google/cloud/serviceusage/v1/mocks ./include/google/cloud/shell -./include/google/cloud/shell/mocks ./include/google/cloud/shell/v1 ./include/google/cloud/shell/v1/internal ./include/google/cloud/shell/v1/mocks @@ -1158,7 +1101,6 @@ ./include/google/cloud/spanner/admin/mocks ./include/google/cloud/spanner/internal ./include/google/cloud/speech -./include/google/cloud/speech/mocks ./include/google/cloud/speech/v1 ./include/google/cloud/speech/v1/internal ./include/google/cloud/speech/v1/mocks @@ -1184,7 +1126,6 @@ ./include/google/cloud/storageinsights/v1/internal ./include/google/cloud/storageinsights/v1/mocks ./include/google/cloud/storagetransfer -./include/google/cloud/storagetransfer/mocks ./include/google/cloud/storagetransfer/v1 ./include/google/cloud/storagetransfer/v1/internal ./include/google/cloud/storagetransfer/v1/mocks @@ -1193,12 +1134,10 @@ ./include/google/cloud/support/v2/internal ./include/google/cloud/support/v2/mocks ./include/google/cloud/talent -./include/google/cloud/talent/mocks ./include/google/cloud/talent/v4 ./include/google/cloud/talent/v4/internal ./include/google/cloud/talent/v4/mocks ./include/google/cloud/tasks -./include/google/cloud/tasks/mocks ./include/google/cloud/tasks/v2 ./include/google/cloud/tasks/v2/internal ./include/google/cloud/tasks/v2/mocks @@ -1207,7 +1146,6 @@ ./include/google/cloud/telcoautomation/v1/internal ./include/google/cloud/telcoautomation/v1/mocks ./include/google/cloud/texttospeech -./include/google/cloud/texttospeech/mocks ./include/google/cloud/texttospeech/v1 ./include/google/cloud/texttospeech/v1/internal ./include/google/cloud/texttospeech/v1/mocks @@ -1216,7 +1154,6 @@ ./include/google/cloud/timeseriesinsights/v1/internal ./include/google/cloud/timeseriesinsights/v1/mocks ./include/google/cloud/tpu -./include/google/cloud/tpu/mocks ./include/google/cloud/tpu/v1 ./include/google/cloud/tpu/v1/internal ./include/google/cloud/tpu/v1/mocks @@ -1224,7 +1161,6 @@ ./include/google/cloud/tpu/v2/internal ./include/google/cloud/tpu/v2/mocks ./include/google/cloud/trace -./include/google/cloud/trace/mocks ./include/google/cloud/trace/v1 ./include/google/cloud/trace/v1/internal ./include/google/cloud/trace/v1/mocks @@ -1232,16 +1168,18 @@ ./include/google/cloud/trace/v2/internal ./include/google/cloud/trace/v2/mocks ./include/google/cloud/translate -./include/google/cloud/translate/mocks ./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 ./include/google/cloud/video/livestream/v1/internal ./include/google/cloud/video/livestream/v1/mocks -./include/google/cloud/video/mocks ./include/google/cloud/video/stitcher ./include/google/cloud/video/stitcher/v1 ./include/google/cloud/video/stitcher/v1/internal @@ -1251,17 +1189,18 @@ ./include/google/cloud/video/transcoder/v1/internal ./include/google/cloud/video/transcoder/v1/mocks ./include/google/cloud/videointelligence -./include/google/cloud/videointelligence/mocks ./include/google/cloud/videointelligence/v1 ./include/google/cloud/videointelligence/v1/internal ./include/google/cloud/videointelligence/v1/mocks ./include/google/cloud/vision -./include/google/cloud/vision/mocks ./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/mocks ./include/google/cloud/vmmigration/v1 ./include/google/cloud/vmmigration/v1/internal ./include/google/cloud/vmmigration/v1/mocks @@ -1270,17 +1209,14 @@ ./include/google/cloud/vmwareengine/v1/internal ./include/google/cloud/vmwareengine/v1/mocks ./include/google/cloud/vpcaccess -./include/google/cloud/vpcaccess/mocks ./include/google/cloud/vpcaccess/v1 ./include/google/cloud/vpcaccess/v1/internal ./include/google/cloud/vpcaccess/v1/mocks ./include/google/cloud/webrisk -./include/google/cloud/webrisk/mocks ./include/google/cloud/webrisk/v1 ./include/google/cloud/webrisk/v1/internal ./include/google/cloud/webrisk/v1/mocks ./include/google/cloud/websecurityscanner -./include/google/cloud/websecurityscanner/mocks ./include/google/cloud/websecurityscanner/v1 ./include/google/cloud/websecurityscanner/v1/internal ./include/google/cloud/websecurityscanner/v1/mocks @@ -1289,10 +1225,13 @@ ./include/google/cloud/workflows/executions/v1 ./include/google/cloud/workflows/executions/v1/internal ./include/google/cloud/workflows/executions/v1/mocks -./include/google/cloud/workflows/mocks ./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 @@ -1407,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 @@ -1498,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 @@ -1641,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 @@ -1659,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/etc/oldest-deps/overlay-ports/opentelemetry-cpp/fix-target_link.patch b/ci/etc/oldest-deps/overlay-ports/opentelemetry-cpp/fix-target_link.patch new file mode 100644 index 0000000000000..f4709e8b1c28f --- /dev/null +++ b/ci/etc/oldest-deps/overlay-ports/opentelemetry-cpp/fix-target_link.patch @@ -0,0 +1,17 @@ +diff --git a/cmake/opentracing-cpp.cmake b/cmake/opentracing-cpp.cmake +index f014ecd..fd8898a 100644 +--- a/cmake/opentracing-cpp.cmake ++++ b/cmake/opentracing-cpp.cmake +@@ -1,7 +1,11 @@ + # Copyright The OpenTelemetry Authors + # SPDX-License-Identifier: Apache-2.0 + +-find_package(OpenTracing CONFIG QUIET) ++find_package(OpenTracing CONFIG REQUIRED) ++if(NOT TARGET OpenTracing::opentracing AND TARGET OpenTracing::opentracing-static) ++ add_library(OpenTracing::opentracing ALIAS OpenTracing::opentracing-static) ++endif() ++ + set(OpenTracing_PROVIDER "find_package") + + if(NOT OpenTracing_FOUND) diff --git a/ci/etc/oldest-deps/overlay-ports/opentelemetry-cpp/portfile.cmake b/ci/etc/oldest-deps/overlay-ports/opentelemetry-cpp/portfile.cmake new file mode 100644 index 0000000000000..c8bb4f68fce6a --- /dev/null +++ b/ci/etc/oldest-deps/overlay-ports/opentelemetry-cpp/portfile.cmake @@ -0,0 +1,135 @@ +if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif () + +vcpkg_from_github( + OUT_SOURCE_PATH + SOURCE_PATH + REPO + open-telemetry/opentelemetry-cpp + REF + "v${VERSION}" + SHA512 + 6dc0357d8b3410852d3f970f72b8bec59dba9d6c533ca600432102e65de161903bd9170d98cef7ff0af5191309577ffd2a69ccd004b840914a910a6a282204e4 + HEAD_REF + main + PATCHES + fix-target_link.patch) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS + FEATURE_OPTIONS + FEATURES + etw + WITH_ETW + zipkin + WITH_ZIPKIN + prometheus + WITH_PROMETHEUS + elasticsearch + WITH_ELASTICSEARCH + otlp-file + WITH_OTLP_FILE + otlp-http + WITH_OTLP_HTTP + otlp-grpc + WITH_OTLP_GRPC + geneva + WITH_GENEVA + user-events + WITH_USER_EVENTS + opentracing + WITH_OPENTRACING + INVERTED_FEATURES + user-events + BUILD_TRACEPOINTS) + +# opentelemetry-proto is a third party submodule and opentelemetry-cpp release +# did not pack it. +if (WITH_OTLP_FILE + OR WITH_OTLP_GRPC + OR WITH_OTLP_HTTP) + set(OTEL_PROTO_VERSION "1.6.0") + vcpkg_download_distfile( + ARCHIVE + URLS + "https://github.com/open-telemetry/opentelemetry-proto/archive/v${OTEL_PROTO_VERSION}.tar.gz" + FILENAME + "opentelemetry-proto-${OTEL_PROTO_VERSION}.tar.gz" + SHA512 + 0e72e0c32d2d699d7a832a4c57a9dbe60e844d4c4e8d7b39eb45e4282cde89fccfeef893eae70b9d018643782090a7228c3ef60863b00747498e80f0cf1db8ae + ) + + vcpkg_extract_source_archive(src ARCHIVE "${ARCHIVE}") + file(REMOVE_RECURSE "${SOURCE_PATH}/third_party/opentelemetry-proto") + file(COPY "${src}/." + DESTINATION "${SOURCE_PATH}/third_party/opentelemetry-proto") + # Create empty .git directory to prevent opentelemetry from cloning it + # during build time + file(MAKE_DIRECTORY "${SOURCE_PATH}/third_party/opentelemetry-proto/.git") + list( + APPEND + FEATURE_OPTIONS + "-DgRPC_CPP_PLUGIN_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/grpc/grpc_cpp_plugin${VCPKG_HOST_EXECUTABLE_SUFFIX}" + ) +endif () +list(APPEND FEATURE_OPTIONS -DCMAKE_CXX_STANDARD=17) +list(APPEND FEATURE_OPTIONS -DWITH_STL=CXX17) + +set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS "OFF") + +if (WITH_GENEVA OR WITH_USER_EVENTS) + # Geneva and user events exporters from opentelemetry-cpp-contrib are + # tightly coupled with opentelemetry-cpp repo, so they should be ported as a + # feature under opentelemetry-cpp. + clone_opentelemetry_cpp_contrib(CONTRIB_SOURCE_PATH) + + if (WITH_GENEVA) + set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS + "${CONTRIB_SOURCE_PATH}/exporters/geneva") + if (VCPKG_TARGET_IS_WINDOWS) + set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS + "${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS}\;${CONTRIB_SOURCE_PATH}/exporters/geneva-trace" + ) + else () + set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS + "${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS}\;${CONTRIB_SOURCE_PATH}/exporters/fluentd" + ) + endif () + endif () + + if (WITH_USER_EVENTS) + if (WITH_GENEVA) + set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS + "${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS}\;${CONTRIB_SOURCE_PATH}/exporters/user_events" + ) + else () + set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS + "${CONTRIB_SOURCE_PATH}/exporters/user_events") + endif () + endif () +endif () + +vcpkg_cmake_configure( + SOURCE_PATH + "${SOURCE_PATH}" + OPTIONS + -DBUILD_TESTING=OFF + -DWITH_EXAMPLES=OFF + -DOPENTELEMETRY_INSTALL=ON + -DWITH_BENCHMARK=OFF + -DOPENTELEMETRY_EXTERNAL_COMPONENT_PATH=${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS} + ${FEATURE_OPTIONS} + MAYBE_UNUSED_VARIABLES + WITH_GENEVA + WITH_USER_EVENTS + BUILD_TRACEPOINTS + gRPC_CPP_PLUGIN_EXECUTABLE) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}") +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ci/etc/oldest-deps/overlay-ports/opentelemetry-cpp/vcpkg.json b/ci/etc/oldest-deps/overlay-ports/opentelemetry-cpp/vcpkg.json new file mode 100644 index 0000000000000..0570a7bd2e108 --- /dev/null +++ b/ci/etc/oldest-deps/overlay-ports/opentelemetry-cpp/vcpkg.json @@ -0,0 +1,108 @@ +{ + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", + "name": "opentelemetry-cpp", + "version-semver": "1.23.0", + "description": [ + "OpenTelemetry is a collection of tools, APIs, and SDKs.", + "You use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) for analysis in order to understand your software's performance and behavior." + ], + "homepage": "https://github.com/open-telemetry/opentelemetry-cpp", + "license": "Apache-2.0", + "dependencies": [ + "abseil", + "nlohmann-json", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "elasticsearch": { + "description": "Whether to include the Elasticsearch Client in the SDK", + "dependencies": [ + { + "name": "curl", + "default-features": false + } + ] + }, + "etw": { + "description": "Whether to include the ETW Exporter in the SDK", + "supports": "windows" + }, + "geneva": { + "description": "Whether to include the Geneva Exporter from the opentelemetry-cpp-contrib repository", + "dependencies": [ + { + "name": "opentelemetry-cpp", + "features": [ + "etw" + ], + "platform": "windows" + }, + "opentelemetry-cpp-contrib-version" + ] + }, + "opentracing": { + "description": "Whether to include the Opentracing shim", + "dependencies": [ + "opentracing" + ] + }, + "otlp-file": { + "description": "Whether to include the OpenTelemetry Protocol to File exporter in the SDK", + "supports": "!uwp", + "dependencies": [ + "protobuf" + ] + }, + "otlp-grpc": { + "description": "Whether to include the OTLP gRPC exporter in the SDK", + "dependencies": [ + "grpc", + { + "name": "grpc", + "host": true + } + ] + }, + "otlp-http": { + "description": "Whether to include the OpenTelemetry Protocol over HTTP in the SDK", + "dependencies": [ + "curl", + "protobuf" + ] + }, + "prometheus": { + "description": "Whether to include the Prometheus Client in the SDK", + "dependencies": [ + "prometheus-cpp" + ] + }, + "user-events": { + "description": "Whether to include the User Events Exporter from the opentelemetry-cpp-contrib repository", + "supports": "linux", + "dependencies": [ + "libeventheader-tracepoint", + "libtracepoint", + { + "name": "opentelemetry-cpp", + "features": [ + "otlp-http" + ] + }, + "opentelemetry-cpp-contrib-version" + ] + }, + "zipkin": { + "description": "Whether to include the Zipkin exporter in the SDK", + "dependencies": [ + "curl" + ] + } + } +} diff --git a/ci/etc/oldest-deps/vcpkg.json b/ci/etc/oldest-deps/vcpkg.json index 9545857b07db6..ec1607271c0b1 100644 --- a/ci/etc/oldest-deps/vcpkg.json +++ b/ci/etc/oldest-deps/vcpkg.json @@ -1,6 +1,6 @@ { "name": "google-cloud-cpp", - "version": "2.17.0", + "version": "3.0.0", "description": "C++ Client Libraries for Google Cloud Platform APIs.", "homepage": "https://github.com/googleapis/google-cloud-cpp", "license": "Apache-2.0", @@ -8,8 +8,7 @@ "$TODO": "move `gtest` and `benchmark` to dev-dependencies", "builtin-baseline": "6d9ed568117dd958c543b3ab8d3ed692965cac34", "dependencies": [ - {"name": "abseil", "version>=": "2020-09-23#3"}, - {"name": "crc32c", "version>=": "1.1.1"}, + {"name": "abseil", "version>=": "20250127.1"}, { "name": "curl", "features": [ @@ -18,26 +17,35 @@ }, { "name": "grpc", - "version>=": "1.33.1", + "version>=": "1.71.0", "host": true }, { "name": "protobuf", - "version>=": "3.15.8", + "version>=": "5.29.5", "host": true }, - {"name": "grpc", "version>=": "1.33.1"}, - {"name": "opentelemetry-cpp", "version>=": "1.9.1"}, - {"name": "protobuf", "version>=": "3.15.8"}, + {"name": "grpc", "version>=": "1.71.0"}, + {"name": "opentelemetry-cpp", "version>=": "1.22.0"}, + {"name": "protobuf", "version>=": "5.29.5"}, {"name": "nlohmann-json", "version>=": "3.9.1"}, "benchmark", - {"name": "gtest", "version>=": "1.11.0", "host": true} + {"name": "gtest", "version>=": "1.17.0", "host": true}, + "utf8-range", + "re2" ], "overrides": [ - { "name": "opentelemetry-cpp", "version": "1.9.1"}, - { "name": "protobuf", "version": "3.15.8" }, - { "name": "grpc", "version": "1.36.4" }, + { "name": "abseil", "version": "20250127.1"}, + { "name": "opentelemetry-cpp", "version": "1.22.0"}, + { "name": "protobuf", "version": "5.29.5" }, + { "name": "utf8-range", "version": "5.29.5" }, + { "name": "grpc", "version": "1.71.0" }, { "name": "upb", "version": "2020-12-19" }, - { "name": "gtest", "version": "1.12.0" } - ] + { "name": "benchmark", "version": "1.9.4" }, + { "name": "re2", "version": "2025-08-12" }, + { "name": "gtest", "version": "1.17.0" } + ], + "configuration": { + "overlay-ports" : [ "overlay-ports"] + } } diff --git a/ci/etc/vcpkg-version.txt b/ci/etc/vcpkg-version.txt index 1cf30f24daa2d..922462b2e1e1c 100644 --- a/ci/etc/vcpkg-version.txt +++ b/ci/etc/vcpkg-version.txt @@ -1 +1 @@ -2024.09.30 +3895230f38e498525f2560a281223d12066fa74a diff --git a/ci/generate-markdown/generate-packaging.sh b/ci/generate-markdown/generate-packaging.sh index 634ab67318ae8..17a4ce101abd4 100755 --- a/ci/generate-markdown/generate-packaging.sh +++ b/ci/generate-markdown/generate-packaging.sh @@ -37,7 +37,6 @@ file="doc/packaging.md" "demo-opensuse-leap.Dockerfile,openSUSE (Leap)" "demo-ubuntu-24.04.Dockerfile,Ubuntu (24.04 LTS - Noble Numbat)" "demo-ubuntu-jammy.Dockerfile,Ubuntu (22.04 LTS - Jammy Jellyfish)" - "demo-ubuntu-focal.Dockerfile,Ubuntu (20.04 LTS - Focal Fossa)" "demo-debian-bookworm.Dockerfile,Debian (12 - Bookworm)" "demo-debian-bullseye.Dockerfile,Debian (11 - Bullseye)" "demo-rockylinux-9.Dockerfile,Rocky Linux (9)" diff --git a/ci/gha/builds/lib/bazel.sh b/ci/gha/builds/lib/bazel.sh index e3576265e3981..96b22858d798e 100755 --- a/ci/gha/builds/lib/bazel.sh +++ b/ci/gha/builds/lib/bazel.sh @@ -78,6 +78,7 @@ function bazel::msvc_args() { '--per_file_copt=.*\.upbdefs\.c@-wd4090' # TODO(#14462) - gRPC is not compatible with (at least) MSVC 2019 + bzlmod. '--noenable_bzlmod' + '--enable_workspace' ) printf "%s\n" "${args[@]}" } diff --git a/ci/gha/builds/lib/cmake.sh b/ci/gha/builds/lib/cmake.sh index de923525946e8..df7c047e2d4b4 100755 --- a/ci/gha/builds/lib/cmake.sh +++ b/ci/gha/builds/lib/cmake.sh @@ -44,6 +44,7 @@ function cmake::common_args() { fi local args args=( + -DCMAKE_CXX_STANDARD=17 -DGOOGLE_CLOUD_CPP_ENABLE_CCACHE=OFF -DGOOGLE_CLOUD_CPP_ENABLE_WERROR=ON -GNinja diff --git a/ci/gha/builds/vcpkg-overlays/opentelemetry-cpp/fix-target_link.patch b/ci/gha/builds/vcpkg-overlays/opentelemetry-cpp/fix-target_link.patch new file mode 100644 index 0000000000000..f4709e8b1c28f --- /dev/null +++ b/ci/gha/builds/vcpkg-overlays/opentelemetry-cpp/fix-target_link.patch @@ -0,0 +1,17 @@ +diff --git a/cmake/opentracing-cpp.cmake b/cmake/opentracing-cpp.cmake +index f014ecd..fd8898a 100644 +--- a/cmake/opentracing-cpp.cmake ++++ b/cmake/opentracing-cpp.cmake +@@ -1,7 +1,11 @@ + # Copyright The OpenTelemetry Authors + # SPDX-License-Identifier: Apache-2.0 + +-find_package(OpenTracing CONFIG QUIET) ++find_package(OpenTracing CONFIG REQUIRED) ++if(NOT TARGET OpenTracing::opentracing AND TARGET OpenTracing::opentracing-static) ++ add_library(OpenTracing::opentracing ALIAS OpenTracing::opentracing-static) ++endif() ++ + set(OpenTracing_PROVIDER "find_package") + + if(NOT OpenTracing_FOUND) diff --git a/ci/gha/builds/vcpkg-overlays/opentelemetry-cpp/portfile.cmake b/ci/gha/builds/vcpkg-overlays/opentelemetry-cpp/portfile.cmake index eacf1ea4ada70..c8896c71694e8 100644 --- a/ci/gha/builds/vcpkg-overlays/opentelemetry-cpp/portfile.cmake +++ b/ci/gha/builds/vcpkg-overlays/opentelemetry-cpp/portfile.cmake @@ -10,12 +10,11 @@ vcpkg_from_github( REF "v${VERSION}" SHA512 - c93005c9b24b358a9998141f6c7fd9675778731775dacaad18f0e81117fd00aaabff371c04cf96688a9c86117727181052a141d961d4db28fc457b454351c570 + 6dc0357d8b3410852d3f970f72b8bec59dba9d6c533ca600432102e65de161903bd9170d98cef7ff0af5191309577ffd2a69ccd004b840914a910a6a282204e4 HEAD_REF main PATCHES - # Missing find_dependency for Abseil - add-missing-find-dependency.patch) + fix-target_link.patch) vcpkg_check_features( OUT_FEATURE_OPTIONS @@ -29,6 +28,8 @@ vcpkg_check_features( WITH_PROMETHEUS elasticsearch WITH_ELASTICSEARCH + otlp-file + WITH_OTLP_FILE otlp-http WITH_OTLP_HTTP otlp-grpc @@ -37,14 +38,18 @@ vcpkg_check_features( WITH_GENEVA user-events WITH_USER_EVENTS + opentracing + WITH_OPENTRACING INVERTED_FEATURES user-events BUILD_TRACEPOINTS) # opentelemetry-proto is a third party submodule and opentelemetry-cpp release # did not pack it. -if (WITH_OTLP_GRPC OR WITH_OTLP_HTTP) - set(OTEL_PROTO_VERSION "1.3.1") +if (WITH_OTLP_FILE + OR WITH_OTLP_GRPC + OR WITH_OTLP_HTTP) + set(OTEL_PROTO_VERSION "1.6.0") vcpkg_download_distfile( ARCHIVE URLS @@ -52,7 +57,7 @@ if (WITH_OTLP_GRPC OR WITH_OTLP_HTTP) FILENAME "opentelemetry-proto-${OTEL_PROTO_VERSION}.tar.gz" SHA512 - 8c75e4ff79c4b5b251e0ec8ece92ec901d70ec601644505ffdd137fb728daac91fd9203e1f448500124906737d91d80f10b694977688c655418b94f61c828d06 + 0e72e0c32d2d699d7a832a4c57a9dbe60e844d4c4e8d7b39eb45e4282cde89fccfeef893eae70b9d018643782090a7228c3ef60863b00747498e80f0cf1db8ae ) vcpkg_extract_source_archive(src ARCHIVE "${ARCHIVE}") @@ -62,13 +67,13 @@ if (WITH_OTLP_GRPC OR WITH_OTLP_HTTP) # Create empty .git directory to prevent opentelemetry from cloning it # during build time file(MAKE_DIRECTORY "${SOURCE_PATH}/third_party/opentelemetry-proto/.git") - list(APPEND FEATURE_OPTIONS -DCMAKE_CXX_STANDARD=14) list( APPEND FEATURE_OPTIONS "-DgRPC_CPP_PLUGIN_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/grpc/grpc_cpp_plugin${VCPKG_HOST_EXECUTABLE_SUFFIX}" ) endif () +list(APPEND FEATURE_OPTIONS -DCMAKE_CXX_STANDARD=17 -DWITH_STL=CXX17) set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS "OFF") @@ -111,15 +116,14 @@ vcpkg_cmake_configure( -DBUILD_TESTING=OFF -DWITH_EXAMPLES=OFF -DOPENTELEMETRY_INSTALL=ON - -DWITH_STL=CXX14 - -DWITH_ABSEIL=ON -DWITH_BENCHMARK=OFF -DOPENTELEMETRY_EXTERNAL_COMPONENT_PATH=${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS} ${FEATURE_OPTIONS} MAYBE_UNUSED_VARIABLES WITH_GENEVA WITH_USER_EVENTS - BUILD_TRACEPOINTS) + BUILD_TRACEPOINTS + gRPC_CPP_PLUGIN_EXECUTABLE) vcpkg_cmake_install() vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}") diff --git a/ci/gha/builds/vcpkg-overlays/opentelemetry-cpp/vcpkg.json b/ci/gha/builds/vcpkg-overlays/opentelemetry-cpp/vcpkg.json new file mode 100644 index 0000000000000..0570a7bd2e108 --- /dev/null +++ b/ci/gha/builds/vcpkg-overlays/opentelemetry-cpp/vcpkg.json @@ -0,0 +1,108 @@ +{ + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", + "name": "opentelemetry-cpp", + "version-semver": "1.23.0", + "description": [ + "OpenTelemetry is a collection of tools, APIs, and SDKs.", + "You use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) for analysis in order to understand your software's performance and behavior." + ], + "homepage": "https://github.com/open-telemetry/opentelemetry-cpp", + "license": "Apache-2.0", + "dependencies": [ + "abseil", + "nlohmann-json", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "elasticsearch": { + "description": "Whether to include the Elasticsearch Client in the SDK", + "dependencies": [ + { + "name": "curl", + "default-features": false + } + ] + }, + "etw": { + "description": "Whether to include the ETW Exporter in the SDK", + "supports": "windows" + }, + "geneva": { + "description": "Whether to include the Geneva Exporter from the opentelemetry-cpp-contrib repository", + "dependencies": [ + { + "name": "opentelemetry-cpp", + "features": [ + "etw" + ], + "platform": "windows" + }, + "opentelemetry-cpp-contrib-version" + ] + }, + "opentracing": { + "description": "Whether to include the Opentracing shim", + "dependencies": [ + "opentracing" + ] + }, + "otlp-file": { + "description": "Whether to include the OpenTelemetry Protocol to File exporter in the SDK", + "supports": "!uwp", + "dependencies": [ + "protobuf" + ] + }, + "otlp-grpc": { + "description": "Whether to include the OTLP gRPC exporter in the SDK", + "dependencies": [ + "grpc", + { + "name": "grpc", + "host": true + } + ] + }, + "otlp-http": { + "description": "Whether to include the OpenTelemetry Protocol over HTTP in the SDK", + "dependencies": [ + "curl", + "protobuf" + ] + }, + "prometheus": { + "description": "Whether to include the Prometheus Client in the SDK", + "dependencies": [ + "prometheus-cpp" + ] + }, + "user-events": { + "description": "Whether to include the User Events Exporter from the opentelemetry-cpp-contrib repository", + "supports": "linux", + "dependencies": [ + "libeventheader-tracepoint", + "libtracepoint", + { + "name": "opentelemetry-cpp", + "features": [ + "otlp-http" + ] + }, + "opentelemetry-cpp-contrib-version" + ] + }, + "zipkin": { + "description": "Whether to include the Zipkin exporter in the SDK", + "dependencies": [ + "curl" + ] + } + } +} 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="$(= 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" +# The project requires C++ >= 17. +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 +# Protobuf and gRPC require C++17 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 +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 -# TODO(#11485) - enable bzlmod once it works -common --noenable_bzlmod - # TODO(#13311) - remove once gRPC works with Bazel v7 or when gRPC stops using # `apple_rules`. common:macos --repo_env=BAZEL_NO_APPLE_CPP_TOOLCHAIN=1 diff --git a/ci/verify_current_targets/.bazelversion b/ci/verify_current_targets/.bazelversion index e8be68404bcb3..e7fdef7e2e635 100644 --- a/ci/verify_current_targets/.bazelversion +++ b/ci/verify_current_targets/.bazelversion @@ -1 +1 @@ -7.6.1 +8.4.2 diff --git a/ci/verify_current_targets/CMakeLists.txt b/ci/verify_current_targets/CMakeLists.txt index e10300c2e4c01..32ba9818eef1f 100644 --- a/ci/verify_current_targets/CMakeLists.txt +++ b/ci/verify_current_targets/CMakeLists.txt @@ -79,23 +79,13 @@ endforeach () # Verify backwards compatible proto libraries are installed. See #8022 for more # details. -foreach (library "dialogflow_es" "iam" "monitoring" "speech" "texttospeech" - "trace") +foreach (library "iam") find_package(google_cloud_cpp_${library}) endforeach () set(backwards_compat_proto_libraries # cmake-format: sortable - "cloud_dialogflow_v2_protos" - "cloud_speech_protos" - "cloud_texttospeech_protos" - "devtools_cloudtrace_v2_trace_protos" - "devtools_cloudtrace_v2_tracing_protos" - "iam_v1_iam_policy_protos" - "iam_v1_options_protos" - "iam_v1_policy_protos" - "logging_type_protos" - "logging_type_type_protos") + "iam_v1_iam_policy_protos" "iam_v1_options_protos" "iam_v1_policy_protos") foreach (library ${backwards_compat_proto_libraries}) add_test_case(test_cmake_${library} google-cloud-cpp::common diff --git a/ci/verify_current_targets/MODULE.bazel b/ci/verify_current_targets/MODULE.bazel new file mode 100644 index 0000000000000..1c488000beede --- /dev/null +++ b/ci/verify_current_targets/MODULE.bazel @@ -0,0 +1,7 @@ +module(name = "google-cloud-cpp-verify-current-targets") + +bazel_dep(name = "google_cloud_cpp", version = "0.0.0") +local_path_override( + module_name = "google_cloud_cpp", + path = "../..", +) diff --git a/ci/verify_current_targets/WORKSPACE.bazel b/ci/verify_current_targets/WORKSPACE.bazel deleted file mode 100644 index 46f3b24ccaa76..0000000000000 --- a/ci/verify_current_targets/WORKSPACE.bazel +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "verify_current_targets") - -local_repository( - name = "google_cloud_cpp", - path = "../../", -) - -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/ci/verify_deprecated_targets/.bazelrc b/ci/verify_deprecated_targets/.bazelrc index a63472faf465a..dd078cc0c0d14 100644 --- a/ci/verify_deprecated_targets/.bazelrc +++ b/ci/verify_deprecated_targets/.bazelrc @@ -15,23 +15,19 @@ # 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" +# The project requires C++ >= 17. +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 +# Protobuf and gRPC require C++17 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 +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 -# TODO(#11485) - enable bzlmod once it works -common --noenable_bzlmod - # TODO(#13311) - remove once gRPC works with Bazel v7 or when gRPC stops using # `apple_rules`. common:macos --repo_env=BAZEL_NO_APPLE_CPP_TOOLCHAIN=1 diff --git a/ci/verify_deprecated_targets/.bazelversion b/ci/verify_deprecated_targets/.bazelversion index e8be68404bcb3..e7fdef7e2e635 100644 --- a/ci/verify_deprecated_targets/.bazelversion +++ b/ci/verify_deprecated_targets/.bazelversion @@ -1 +1 @@ -7.6.1 +8.4.2 diff --git a/ci/verify_deprecated_targets/BUILD.bazel b/ci/verify_deprecated_targets/BUILD.bazel index 65ed0fb8c083c..077a58df1b51f 100644 --- a/ci/verify_deprecated_targets/BUILD.bazel +++ b/ci/verify_deprecated_targets/BUILD.bazel @@ -16,20 +16,12 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 -# TODO(#5726) - DO NOT CHANGE THESE TARGET NAMES These package names are -# expected to remain usable until we have retired them. They are *deprecated* -# (that is, we no longer recommend their use), but *NOT* retired (that is, they -# remain available). This is a test for backwards compatibility. If you need to -# change the test, there is good chance you are breaking something. +# These package names are expected to remain usable until we have retired them. +# They are *deprecated* (that is, we no longer recommend their use), but *NOT* +# decommissioned (that is, they remain available). This is a test for backwards +# compatibility. If you need to change the test, there is good chance you are +# breaking something. DEPRECATED_TARGETS = [ - "google/cloud/grpc_utils:google_cloud_cpp_grpc_utils", - "google/cloud/pubsub:pubsub_client_testing", - "google/cloud/spanner:spanner_client_testing", - "google/cloud/testing_util:google_cloud_cpp_testing", - "google/cloud/testing_util:google_cloud_cpp_testing_grpc", - "google/cloud/testing_util:google_cloud_cpp_testing_rest", - "google/cloud:google_cloud_cpp_common", - "google/cloud:google_cloud_cpp_grpc_utils", ] [cc_test( diff --git a/ci/verify_deprecated_targets/MODULE.bazel b/ci/verify_deprecated_targets/MODULE.bazel new file mode 100644 index 0000000000000..fd929f8987a59 --- /dev/null +++ b/ci/verify_deprecated_targets/MODULE.bazel @@ -0,0 +1,7 @@ +module(name = "google-cloud-cpp-verify-deprecated-targets") + +bazel_dep(name = "google_cloud_cpp", version = "0.0.0") +local_path_override( + module_name = "google_cloud_cpp", + path = "../..", +) diff --git a/ci/verify_deprecated_targets/WORKSPACE.bazel b/ci/verify_deprecated_targets/WORKSPACE.bazel deleted file mode 100644 index 8711eace78c3f..0000000000000 --- a/ci/verify_deprecated_targets/WORKSPACE.bazel +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 Google Cloud Bigtable C++ -# client library in Bazel-based projects. -workspace(name = "verify_deprecated_targets") - -local_repository( - name = "google_cloud_cpp", - path = "../../", -) - -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/ci/verify_deprecated_targets/verify_deprecated_targets.cc b/ci/verify_deprecated_targets/verify_deprecated_targets.cc index d887bdf914be4..6dd838fe5a64a 100644 --- a/ci/verify_deprecated_targets/verify_deprecated_targets.cc +++ b/ci/verify_deprecated_targets/verify_deprecated_targets.cc @@ -17,8 +17,5 @@ int main() { std::cout << "Hello: " << google::cloud::version_string() << "\n"; - // Verifies use of the backward-compatibility aliases: v1 and gcpcxxV1. - std::cout << "Hello: " << google::cloud::v1::version_string() << "\n"; - std::cout << "Hello: " << google::cloud::gcpcxxV1::version_string() << "\n"; return 0; } diff --git a/cmake/CompileProtos.cmake b/cmake/CompileProtos.cmake index 4b389c7bf3256..a42f48c7e25cd 100644 --- a/cmake/CompileProtos.cmake +++ b/cmake/CompileProtos.cmake @@ -227,7 +227,7 @@ endfunction () # extracts the list of `.proto` files for each proto library we are interested # in. These files are extracted as Bazel rule names, for example: # -# @com_google_googleapis//google/bigtable/v2:bigtable.proto +# @googleapis//google/bigtable/v2:bigtable.proto # # We use naming conventions to convert these rules files to a path. Using the # same example that becomes: @@ -253,7 +253,7 @@ function (google_cloud_cpp_load_protolist var file) string(REGEX REPLACE "\n" ";" contents "${contents}") set(protos) foreach (line IN LISTS contents) - string(REPLACE "@com_google_googleapis//" "" line "${line}") + string(REPLACE "@googleapis//" "" line "${line}") string(REPLACE ":" "/" line "${line}") if ("${line}" STREQUAL "") continue() @@ -273,7 +273,7 @@ endfunction () # extracts the list of dependencies for each proto library we are interested in. # These dependencies are extracted as Bazel rule names, for example: # -# @com_google_googleapis//google/api:annotations_proto +# @googleapis//google/api:annotations_proto # # We use naming conventions to convert these rules files to a CMake target. # Using the same example that becomes: @@ -311,8 +311,7 @@ function (google_cloud_cpp_load_protodeps var file) endif () string(REPLACE ":" "_" line "${line}") string(REPLACE "_proto" "_protos" line "${line}") - string(REPLACE "@com_google_googleapis//" "google-cloud-cpp::" line - "${line}") + string(REPLACE "@googleapis//" "google-cloud-cpp::" line "${line}") # Avoid duplicate `google`'s in the target name. string(REPLACE "google-cloud-cpp::google/" "google-cloud-cpp::" line "${line}") diff --git a/cmake/GoogleCloudCppFeatures.cmake b/cmake/GoogleCloudCppFeatures.cmake index b445cb0e2034e..b8beb5e44b9f5 100644 --- a/cmake/GoogleCloudCppFeatures.cmake +++ b/cmake/GoogleCloudCppFeatures.cmake @@ -67,6 +67,7 @@ set(GOOGLE_CLOUD_CPP_GA_LIBRARIES "billing" "binaryauthorization" "certificatemanager" + "ces" "channel" "chronicle" "cloudbuild" @@ -113,6 +114,7 @@ set(GOOGLE_CLOUD_CPP_GA_LIBRARIES "gkehub" "gkemulticloud" "gkerecommender" + "hypercomputecluster" "iam" "iap" "ids" @@ -185,15 +187,18 @@ set(GOOGLE_CLOUD_CPP_GA_LIBRARIES "tpu" "trace" "translate" + "vectorsearch" "video" "videointelligence" "vision" + "visionai" "vmmigration" "vmwareengine" "vpcaccess" "webrisk" "websecurityscanner" "workflows" + "workloadmanager" "workstations") set(GOOGLE_CLOUD_CPP_COMPUTE_LIBRARIES @@ -306,7 +311,8 @@ export_libraries_bzl() # other feature, or even if no features are enabled. # ~~~ macro (google_cloud_cpp_enable_deps) - find_package(opentelemetry-cpp CONFIG) + list(APPEND GOOGLE_CLOUD_CPP_ENABLE monitoring trace opentelemetry + universe_domain) if (__ga_libraries__ IN_LIST GOOGLE_CLOUD_CPP_ENABLE) list(APPEND GOOGLE_CLOUD_CPP_ENABLE ${GOOGLE_CLOUD_CPP_GA_LIBRARIES}) list(APPEND GOOGLE_CLOUD_CPP_ENABLE @@ -345,11 +351,6 @@ macro (google_cloud_cpp_enable_deps) if (asset IN_LIST GOOGLE_CLOUD_CPP_ENABLE) list(INSERT GOOGLE_CLOUD_CPP_ENABLE 0 accesscontextmanager osconfig) endif () - if (bigtable IN_LIST GOOGLE_CLOUD_CPP_ENABLE) - if (opentelemetry-cpp_FOUND) - list(INSERT GOOGLE_CLOUD_CPP_ENABLE 0 opentelemetry) - endif () - endif () if (contentwarehouse IN_LIST GOOGLE_CLOUD_CPP_ENABLE) list(INSERT GOOGLE_CLOUD_CPP_ENABLE 0 documentai) endif () @@ -359,14 +360,9 @@ macro (google_cloud_cpp_enable_deps) if (pubsub IN_LIST GOOGLE_CLOUD_CPP_ENABLE) list(INSERT GOOGLE_CLOUD_CPP_ENABLE 0 iam) endif () - if ((storage_grpc IN_LIST GOOGLE_CLOUD_CPP_ENABLE) - # TODO(#13857) - remove backwards compatibility shims - OR (experimental-storage_grpc IN_LIST GOOGLE_CLOUD_CPP_ENABLE)) + if (storage_grpc IN_LIST GOOGLE_CLOUD_CPP_ENABLE) list(INSERT GOOGLE_CLOUD_CPP_ENABLE 0 storage) endif () - if (opentelemetry IN_LIST GOOGLE_CLOUD_CPP_ENABLE) - list(INSERT GOOGLE_CLOUD_CPP_ENABLE 0 monitoring trace opentelemetry) - endif () endmacro () # Cleanup the "GOOGLE_CLOUD_CPP_ENABLE" variable. Remove duplicates, and set @@ -424,9 +420,7 @@ function (google_cloud_cpp_enable_features) foreach (feature IN LISTS GOOGLE_CLOUD_CPP_ENABLE) if ("${feature}" STREQUAL "generator") add_subdirectory(generator) - elseif (("${feature}" STREQUAL "storage_grpc") - # TODO(#13857) - remove backwards compatibility shims - OR ("${feature}" STREQUAL "experimental-storage_grpc")) + elseif ("${feature}" STREQUAL "storage_grpc") if (NOT ("storage" IN_LIST GOOGLE_CLOUD_CPP_ENABLE)) add_subdirectory(google/cloud/storage) endif () @@ -529,9 +523,7 @@ endfunction () function (google_cloud_cpp_define_dependent_legacy_feature_options) set(GOOGLE_CLOUD_CPP_STORAGE_ENABLE_GRPC_DEFAULT OFF) - if ((storage_grpc IN_LIST GOOGLE_CLOUD_CPP_ENABLE) - # TODO(#13857) - remove backwards compatibility shims - OR (experimental-storage_grpc IN_LIST GOOGLE_CLOUD_CPP_ENABLE)) + if (storage_grpc IN_LIST GOOGLE_CLOUD_CPP_ENABLE) set(GOOGLE_CLOUD_CPP_STORAGE_ENABLE_GRPC_DEFAULT ON) endif () diff --git a/cmake/GoogleCloudCppLibrary.cmake b/cmake/GoogleCloudCppLibrary.cmake index e0d65b53669ae..414d0985c9693 100644 --- a/cmake/GoogleCloudCppLibrary.cmake +++ b/cmake/GoogleCloudCppLibrary.cmake @@ -222,17 +222,6 @@ function (google_cloud_cpp_add_gapic_library library display_name) list(TRANSFORM shared_proto_dep_targets PREPEND "google_cloud_cpp_") list(TRANSFORM shared_proto_dep_targets APPEND "_protos") - # We used to offer the proto library by another name. Maintain backwards - # compatibility by providing an interface library with that name. Also make - # sure we install it as part of google_cloud_cpp_${library}-targets. - unset(backwards_compat_proto_targets) - foreach (old_protos IN LISTS _opt_BACKWARDS_COMPAT_PROTO_TARGETS) - google_cloud_cpp_backwards_compat_protos_library("${old_protos}" - "${library}_protos") - list(APPEND backwards_compat_proto_targets - "google_cloud_cpp_${old_protos}") - endforeach () - file( GLOB source_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" diff --git a/cmake/GoogleapisConfig.cmake b/cmake/GoogleapisConfig.cmake index 843653a0d88aa..02b0740bf77b8 100644 --- a/cmake/GoogleapisConfig.cmake +++ b/cmake/GoogleapisConfig.cmake @@ -27,9 +27,9 @@ set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256 mark_as_advanced(GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256) set(_GOOGLE_CLOUD_CPP_GOOGLEAPIS_COMMIT_SHA - "c0fcb35628690e9eb15dcefae41c651c67cd050b") + "c8ca5bce5cbabac76b8619bd8d63ac10bb0561a9") set(_GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256 - "68c82109667c892b6595385b2ad77c1342752f998664eb6d055509ecaddc3150") + "8ce00cdda7a5c1595fc539b2611f7084344bd08dd07d6e0be03068afb4bc6e8a") set(DOXYGEN_ALIASES "googleapis_link{2}=\"[\\1](https://github.com/googleapis/googleapis/blob/${_GOOGLE_CLOUD_CPP_GOOGLEAPIS_COMMIT_SHA}/\\2)\"" diff --git a/cmake/IncludeNlohmannJson.cmake b/cmake/IncludeNlohmannJson.cmake deleted file mode 100644 index db8056ae051b2..0000000000000 --- a/cmake/IncludeNlohmannJson.cmake +++ /dev/null @@ -1,34 +0,0 @@ -# ~~~ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ~~~ - -function (find_nlohmann_json) - find_package(nlohmann_json CONFIG QUIET) - if (nlohmann_json_FOUND) - return() - endif () - # As a fall back, try finding the header. Since this is a header-only - # library that is all we need. - find_path(GOOGLE_CLOUD_CPP_NLOHMANN_JSON_HEADER "nlohmann/json.hpp" - REQUIRED) - add_library(nlohmann_json::nlohmann_json UNKNOWN IMPORTED) - set_property( - TARGET nlohmann_json::nlohmann_json - APPEND - PROPERTY INTERFACE_INCLUDE_DIRECTORIES - ${GOOGLE_CLOUD_CPP_NLOHMANN_JSON_HEADER}) -endfunction () - -find_nlohmann_json() diff --git a/doc/compile-time-configuration.md b/doc/compile-time-configuration.md index 07ae4f011e4a5..26a26ceea0665 100644 --- a/doc/compile-time-configuration.md +++ b/doc/compile-time-configuration.md @@ -78,13 +78,12 @@ We expect that application developers using Bazel will include ### The C++ Standard -The default Bazel toolchain forces C++11 on Linux and macOS. `google-cloud-cpp` -requires C++14, so you will need to update the C++ standard version. You must -either: +`google-cloud-cpp` requires C++17, so you may need to update the C++ standard +version. You want to either: - Provide your own C++ toolchain configuration for Bazel. Consult the Bazel documentation if you want to attempt this approach. -- Add `--cxxopt=-std=c++14` and `--host_cxxopt=-std=c++14` (or higher) in your +- Add `--cxxopt=-std=c++17` and `--host_cxxopt=-std=c++17` (or higher) in your Bazel command-line. - Add the same options in your Bazel `.bazelrc` file. @@ -92,14 +91,6 @@ The `--host_cxxopt` may be unfamiliar. This is required to support Protobuf and gRPC, which compile code generators for the "host" environment, and generate libraries for the "target" environment. -### Enabling OpenTelemetry - -[OpenTelemetry] is disabled by default. Add `--//:enable_opentelemetry` to your -Bazel command-line parameters to enable OpenTelemetry features, such as -instrumentation to collect distributed traces. - -See the [OpenTelemetry quickstart] for more details. - ### Workarounds gRPC circa 1.58.1 fails to build with Bazel and Clang >= 16 (see [grpc#34482]). @@ -110,4 +101,3 @@ Add the `--features=-layering_check` option to your Bazel command-line or add [github discussion]: https://github.com/googleapis/google-cloud-cpp/discussions [grpc#34482]: https://github.com/grpc/grpc/issues/34482 [opentelemetry]: https://opentelemetry.io/ -[opentelemetry quickstart]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/opentelemetry/quickstart diff --git a/doc/contributor/howto-guide-adding-generated-libraries.md b/doc/contributor/howto-guide-adding-generated-libraries.md index 1190db6d8a2e7..9071a269a08f8 100644 --- a/doc/contributor/howto-guide-adding-generated-libraries.md +++ b/doc/contributor/howto-guide-adding-generated-libraries.md @@ -42,6 +42,7 @@ cases: ```shell bazelisk --batch query --noshow_progress --noshow_loading_progress \ + --enable_workspace --noenable_bzlmod --incompatible_disallow_empty_glob=no \ "kind(cc_library, @com_google_googleapis//${subdir}/...)" ``` @@ -96,7 +97,7 @@ and add the new service. Find the list of `.proto` files that will need to be included: ```shell -find "${bazel_output_base}/external/googleapis~/${subdir}" -name '*.proto' -print0 | +find "${bazel_output_base}/external/googleapis+/${subdir}" -name '*.proto' -print0 | xargs -0 grep -l '^service' ``` @@ -150,8 +151,8 @@ Then run the micro-generator to create the scaffold and the C++ sources: ```shell bazelisk run \ //generator:google-cloud-cpp-codegen -- \ - --protobuf_proto_path="${bazel_output_base}"/external/protobuf~/src \ - --googleapis_proto_path="${bazel_output_base}"/external/googleapis~ \ + --protobuf_proto_path="${bazel_output_base}"/external/protobuf+/src \ + --googleapis_proto_path="${bazel_output_base}"/external/googleapis+ \ --discovery_proto_path="${PWD}/protos" \ --output_path="${PWD}" \ --config_file="${PWD}/generator/generator_config.textproto" \ diff --git a/doc/deprecated.md b/doc/deprecated.md index 04fafb3bd229f..f39a13aa1414e 100644 --- a/doc/deprecated.md +++ b/doc/deprecated.md @@ -1,55 +1,8 @@ # Future Breaking Changes -The next major version of `google-cloud-cpp` (the 3.x series) is expected to +The next major version of `google-cloud-cpp` (the 4.x series) is expected to include the following **breaking changes**. -
-Bigtable: mark bigtable::DataClient as final - -
- -We will mark `bigtable::DataClient` as `final` and remove the following member -functions: - -- `DataClient::Channel()` -- `DataClient::reset()` -- `DataClient::BackgroundThreadsFactory()` - -Application developers should not need to interact with this class directly. -Please use `google::cloud::bigtable::MakeDataClient(...)` with the options from -`google::cloud::GrpcOptionList<>` if you need to configure the gRPC channel or -background threads. More details can be found in [#8800]. - -
- -
-Bigtable: remove bigtable::RowReader constructors - -
- -We will remove `bigtable::RowReader` constructors which accept `DataClient` as -an argument. - -Application developers who read rows by directly constructing a `RowReader` -object should instead construct a `Table` object and call `Table::ReadRows(...)` -on it. - -For status on this, see [#8854]. - -
- -
-BigQuery: remove BigQueryReadReadRowsStreamingUpdater from -google::cloud::bigquery namespace -
- -We will remove `BigQueryReadReadRowsStreamingUpdater` from its declaration in -`google/cloud/bigquery/read_connection.h` and from the `google::cloud::bigquery` -namespace. The function continues to exist but in an internal file and -namespace. For status on this see [#8234]. - -
-
Pubsub: remove legacy admin APIs
@@ -65,70 +18,4 @@ details.
-
-Spanner: remove legacy admin APIs -
- -We will remove the hand-written versions of the Spanner admin APIs. These have -been superseded by versions generated automatically from the service -definitions. The new APIs can be found in the -[`google/cloud/spanner/admin`](https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/spanner/admin) -tree and within the `google::cloud::spanner_admin` namespace. Starting with the -v1.32.0 release, and depending on your compiler settings, using the old -classes/functions may elicit a deprecation warning. See [#7356] for more -details. - -
- -
-Spanner: remove spanner::MakeTestRow() -
- -We will remove `spanner::MakeTestRow()`, which has been replaced by -`spanner_mocks::MakeRow()`. Starting with the v1.41.0 release, and depending on -your compiler settings, using `spanner::MakeTestRow()` may elicit a deprecation -warning. See [#9086] for more details. - -
- -
-Storage: remove the `google::cloud::storage::oauth2` namespace -
- -We will remove the `google::cloud::storage::oauth2` namespace, and all the -header files in `google/cloud/storage/oauth2/`. The new credential types in -`google/cloud/credentials.h` are work with gRPC-based services and support more -use-cases. To create access tokens use the supporting classes in -`google/cloud/oauth2/`. - -
- -
-Common Libraries: remove v1 and gcpcxxV1 -backward compatibility aliases -
- -We will remove the inline namespace aliases of `v1` and `gcpcxxV1` that are -declared in `google/cloud/version.h`. These aliases exist because we changed the -format of our inline namespace name to include the major, minor, and patch -numbers for each release, and we didn't want to break users. Our Doxygen -documentation was mistakenly recommending that users include the inline -namespace names in their code, but this was also fixed to now recommend against -doing so. Users should generally omit the name of our versioned inline namespace -name because that will tightly couple their code to a specific release, and will -make upgrading to newer versions more difficult. Instead, users should simply -omit the inline namespace name, for example, instead of -~`google::cloud::v1::Status`~ use `google::cloud::Status`. Please update your -code to avoid naming the `v1` and `gcpcxxV1` inline namespace names. For more -info, see [#7463] and [#5976]. - -
- [#12987]: https://github.com/googleapis/google-cloud-cpp/issues/12987 -[#5976]: https://github.com/googleapis/google-cloud-cpp/issues/5976 -[#7356]: https://github.com/googleapis/google-cloud-cpp/issues/7356 -[#7463]: https://github.com/googleapis/google-cloud-cpp/issues/7463 -[#8234]: https://github.com/googleapis/google-cloud-cpp/issues/8234 -[#8800]: https://github.com/googleapis/google-cloud-cpp/issues/8800 -[#8854]: https://github.com/googleapis/google-cloud-cpp/issues/8854 -[#9086]: https://github.com/googleapis/google-cloud-cpp/issues/9086 diff --git a/doc/packaging.md b/doc/packaging.md index 3b77ef4d6db6b..2abb07b2bda6d 100644 --- a/doc/packaging.md +++ b/doc/packaging.md @@ -115,20 +115,13 @@ quickstart guides also cover this use-case. | Library | Minimum version | Description | | --------------------------------- | ----------------: | ---------------------------------------------------------- | -| [Abseil][abseil-gh] | 20200923, Patch 3 | Abseil C++ common library [^1] | -| [gRPC][grpc-gh] | 1.35.x | An RPC library and framework [^2] | -| [libcurl][libcurl-gh] | 7.47.0 | HTTP client library [^3] | -| [crc32c][crc32c-gh] | 1.0.6 | Hardware-accelerated CRC32C implementation [^4] | -| [OpenSSL][openssl-gh] | 1.0.2 | Crypto functions for [^3] | -| [nlohmann/json][nlohmann-json-gh] | 3.4.0 | JSON for Modern C++ [^3] | -| [protobuf][protobuf-gh] | 3.15.8 | Protobuf is needed for any library based on gRPC [^5] [^6] | - -`google-cloud-cpp` also has an **optional** dependency on the following -libraries: - -| Library | Minimum version | Description | -| --------------------------------- | --------------- | ------------------------------ | -| [OpenTelemetry][opentelemetry-gh] | 1.9.1 | An observability framework[^7] | +| [Abseil][abseil-gh] | 20250814, Patch 1 | Abseil C++ common library [^1] | +| [gRPC][grpc-gh] | 1.76.x | An RPC library and framework [^2] | +| [libcurl][libcurl-gh] | 7.74.0 | HTTP client library [^3] | +| [OpenSSL][openssl-gh] | 3.0.17 | Crypto functions for [^3] | +| [nlohmann/json][nlohmann-json-gh] | 3.12.0 | JSON for Modern C++ [^3] | +| [protobuf][protobuf-gh] | 6.33.x | Protobuf is needed for any library based on gRPC [^5] [^6] | +| [OpenTelemetry][opentelemetry-gh] | 1.23.0 | An observability framework[^7] | Note that these libraries may also depend on other libraries. The following instructions include steps to install these indirect dependencies too. @@ -188,28 +181,22 @@ development packages ```bash apk update && \ - apk add abseil-cpp-dev crc32c-dev c-ares-dev curl-dev grpc-dev \ + apk add abseil-cpp-dev c-ares-dev curl-dev grpc-dev \ protobuf-dev nlohmann-json openssl-dev re2-dev ``` #### opentelemetry-cpp -The project has an **optional** dependency on the OpenTelemetry library. We -recommend installing this library because: - -- the dependency will become required in the google-cloud-cpp v3.x series. -- it is needed to produce distributed traces of the library. - ```bash mkdir -p $HOME/Downloads/opentelemetry-cpp && cd $HOME/Downloads/opentelemetry-cpp -curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -DWITH_EXAMPLES=OFF \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -225,11 +212,13 @@ We can now compile and install `google-cloud-cpp`: # Pick a location to install the artifacts, e.g., `/usr/local` or `/opt` PREFIX="${HOME}/google-cloud-cpp-installed" cmake -S . -B cmake-out \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DBUILD_TESTING=OFF \ -DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF \ -DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF \ + -DGOOGLE_CLOUD_CPP_ENABLE_CTYPE_CORD_WORKAROUND="${DEMO_CORD_WORKAROUND:-ON}" \ -DGOOGLE_CLOUD_CPP_ENABLE=__ga_libraries__,opentelemetry cmake --build cmake-out -- -j "$(nproc)" cmake --build cmake-out --target install @@ -246,7 +235,8 @@ Install the minimal development tools: ```bash sudo dnf makecache && \ sudo dnf install -y cmake curl findutils gcc-c++ git make ninja-build \ - patch unzip tar wget zip + patch unzip tar wget zip dnf-utils +sudo dnf makecache && sudo dnf debuginfo-install -y glibc ``` Fedora:40 includes packages, with recent enough versions, for most of the direct @@ -255,7 +245,7 @@ dependencies of `google-cloud-cpp`. ```bash sudo dnf makecache && \ sudo dnf install -y protobuf-compiler protobuf-devel grpc-cpp grpc-devel \ - json-devel libcurl-devel google-crc32c-devel openssl-devel + json-devel libcurl-devel openssl-devel ``` #### Patching pkg-config @@ -278,15 +268,6 @@ sudo make install && \ sudo ldconfig && cd /var/tmp && rm -fr build ``` -Older versions of Fedora hard-code RE2 to use C++11. It was fixed starting with -Fedora:38. If you using Fedora >= 38 or you are not planning to use -`pkg-config(1)` you can ignore this step. Alternatively, you can install RE2 and -gRPC from source. - -``` -sed -i 's/-std=c\+\+11 //' /usr/lib64/pkgconfig/re2.pc -``` - The following steps will install libraries and tools in `/usr/local`. By default, pkgconf does not search in these directories. We need to explicitly set the search path. @@ -297,22 +278,16 @@ export PKG_CONFIG_PATH=/usr/local/share/pkgconfig:/usr/lib64/pkgconfig:/usr/loca #### opentelemetry-cpp -The project has an **optional** dependency on the OpenTelemetry library. We -recommend installing this library because: - -- the dependency will become required in the google-cloud-cpp v3.x series. -- it is needed to produce distributed traces of the library. - ```bash mkdir -p $HOME/Downloads/opentelemetry-cpp && cd $HOME/Downloads/opentelemetry-cpp -curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -DWITH_EXAMPLES=OFF \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -329,11 +304,13 @@ We can now compile and install `google-cloud-cpp`: # Pick a location to install the artifacts, e.g., `/usr/local` or `/opt` PREFIX="${HOME}/google-cloud-cpp-installed" cmake -S . -B cmake-out \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DBUILD_TESTING=OFF \ -DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF \ -DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF \ + -DGOOGLE_CLOUD_CPP_ENABLE_CTYPE_CORD_WORKAROUND="${DEMO_CORD_WORKAROUND:-ON}" \ -DGOOGLE_CLOUD_CPP_ENABLE=__ga_libraries__,opentelemetry cmake --build cmake-out -- -j "$(nproc)" cmake --build cmake-out --target install @@ -355,16 +332,15 @@ use GCC 8 or higher to compile `google-cloud-cpp`. ```bash sudo zypper refresh && \ sudo zypper install --allow-downgrade -y automake cmake curl \ - gcc gcc-c++ 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 sudo zypper refresh && \ -sudo zypper install --allow-downgrade -y abseil-cpp-devel c-ares-devel \ - libcurl-devel libopenssl-devel libcrc32c-devel nlohmann_json-devel \ - grpc-devel libprotobuf-devel +sudo zypper install --allow-downgrade -y \ + libcurl-devel libopenssl-devel nlohmann_json-devel ``` The following steps will install libraries and tools in `/usr/local`. openSUSE @@ -378,24 +354,56 @@ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig export PATH=/usr/local/bin:${PATH} ``` -#### opentelemetry-cpp +Use the following environment variables to configure the compiler used by CMake. +export CC=gcc-9 export CXX=g++-9 -The project has an **optional** dependency on the OpenTelemetry library. We -recommend installing this library because: +#### Abseil -- the dependency will become required in the google-cloud-cpp v3.x series. -- it is needed to produce distributed traces of the library. +```bash +mkdir -p $HOME/Downloads/abseil-cpp && cd $HOME/Downloads/abseil-cpp +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} && \ +sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ +sudo ldconfig +``` + +#### Protobuf + +```bash +mkdir -p $HOME/Downloads/protobuf && cd $HOME/Downloads/protobuf +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 && \ +sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ +sudo ldconfig && \ + ln -s /usr/local/bin/protoc /usr/bin/protoc +``` + +#### opentelemetry-cpp ```bash mkdir -p $HOME/Downloads/opentelemetry-cpp && cd $HOME/Downloads/opentelemetry-cpp -curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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 \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -404,11 +412,57 @@ sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ sudo ldconfig ``` -Use the following environment variables to configure the compiler used by CMake. +#### c-ares + +```bash +mkdir -p $HOME/Downloads/c-ares && cd $HOME/Downloads/c-ares +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 && \ +sudo cmake --build cmake-out --target install && \ +sudo ldconfig +``` -export CXX=g++-8 +#### RE2 -export CC=gcc-8 +```bash +mkdir -p $HOME/Downloads/re2 && cd $HOME/Downloads/re2 +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 && \ +sudo cmake --build cmake-out --target install && \ +sudo ldconfig +``` + +#### gRPC + +```bash +mkdir -p $HOME/Downloads/grpc && cd $HOME/Downloads/grpc +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 && \ +sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ +sudo ldconfig +``` #### Compile and install the main project @@ -418,11 +472,13 @@ We can now compile and install `google-cloud-cpp`: # Pick a location to install the artifacts, e.g., `/usr/local` or `/opt` PREFIX="${HOME}/google-cloud-cpp-installed" cmake -S . -B cmake-out \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DBUILD_TESTING=OFF \ -DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF \ -DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF \ + -DGOOGLE_CLOUD_CPP_ENABLE_CTYPE_CORD_WORKAROUND="${DEMO_CORD_WORKAROUND:-ON}" \ -DGOOGLE_CLOUD_CPP_ENABLE=__ga_libraries__,opentelemetry cmake --build cmake-out -- -j "$(nproc)" cmake --build cmake-out --target install @@ -440,7 +496,7 @@ Install the minimal development tools, libcurl, OpenSSL and libc-ares: export DEBIAN_FRONTEND=noninteractive sudo apt-get update && \ sudo apt-get --no-install-recommends install -y apt-transport-https apt-utils \ - cmake ca-certificates curl git gcc g++ m4 make tar + cmake ca-certificates curl git gcc g++ m4 make tar libc6-dbg ``` Ubuntu:24 includes packages for most of the direct dependencies of @@ -450,11 +506,8 @@ Ubuntu:24 includes packages for most of the direct dependencies of export DEBIAN_FRONTEND=noninteractive sudo apt-get update && \ sudo apt-get --no-install-recommends install -y \ - libabsl-dev \ - libcurl4-openssl-dev \ - libgrpc++-dev protobuf-compiler-grpc \ - libprotobuf-dev protobuf-compiler \ - nlohmann-json3-dev + libssl-dev libcurl4-openssl-dev nlohmann-json3-dev zlib1g-dev \ + libsystemd-dev ``` #### Patching pkg-config @@ -479,215 +532,105 @@ sudo ldconfig && cd /var/tmp && rm -fr build ln -s /usr/bin/pkgconf /usr/bin/pkg-config ``` -#### crc32c - -The project depends on the Crc32c library, we need to compile this from source: - -```bash -mkdir -p $HOME/Downloads/crc32c && cd $HOME/Downloads/crc32c -curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ - -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ -sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ -sudo ldconfig -``` - -#### opentelemetry-cpp - -The project has an **optional** dependency on the OpenTelemetry library. We -recommend installing this library because: - -- the dependency will become required in the google-cloud-cpp v3.x series. -- it is needed to produce distributed traces of the library. - -```bash -mkdir -p $HOME/Downloads/opentelemetry-cpp && cd $HOME/Downloads/opentelemetry-cpp -curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DWITH_EXAMPLES=OFF \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ - -DBUILD_TESTING=OFF \ - -DOPENTELEMETRY_INSTALL=ON \ - -DOPENTELEMETRY_ABI_VERSION_NO=2 \ - -S . -B cmake-out && \ -sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ -sudo ldconfig -``` - -#### Compile and install the main project - -We can now compile and install `google-cloud-cpp`: - -```bash -# Pick a location to install the artifacts, e.g., `/usr/local` or `/opt` -PREFIX="${HOME}/google-cloud-cpp-installed" -cmake -S . -B cmake-out \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ - -DBUILD_TESTING=OFF \ - -DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF \ - -DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF \ - -DGOOGLE_CLOUD_CPP_ENABLE=__ga_libraries__,opentelemetry -cmake --build cmake-out -- -j "$(nproc)" -cmake --build cmake-out --target install -``` - - - -
-Ubuntu (22.04 LTS - Jammy Jellyfish) -
- -Install the minimal development tools, libcurl, OpenSSL and libc-ares: - -```bash -export DEBIAN_FRONTEND=noninteractive -sudo apt-get update && \ -sudo apt-get --no-install-recommends install -y apt-transport-https apt-utils \ - automake build-essential cmake ca-certificates curl git \ - gcc g++ libc-ares-dev libc-ares2 libcurl4-openssl-dev libre2-dev \ - libssl-dev m4 make pkg-config tar wget zlib1g-dev -``` - #### Abseil -We need a recent version of Abseil. Enabling `ABSL_PROPAGATE_CXX_STD` propagates -the version of C++ used to compile Abseil to anything that depends on Abseil. - ```bash mkdir -p $HOME/Downloads/abseil-cpp && cd $HOME/Downloads/abseil-cpp -curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.1.tar.gz | \ +curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ -DABSL_BUILD_TESTING=OFF \ - -DABSL_PROPAGATE_CXX_STD=ON \ -DBUILD_SHARED_LIBS=yes \ -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ sudo ldconfig ``` #### Protobuf -We need to install a version of Protobuf that is recent enough to support the -Google Cloud Platform proto files: - ```bash mkdir -p $HOME/Downloads/protobuf && cd $HOME/Downloads/protobuf -curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz | \ +curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v33.1.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -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 -- -j ${NCPU:-4} && \ sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ sudo ldconfig ``` -#### gRPC - -We also need a version of gRPC that is recent enough to support the Google Cloud -Platform proto files. We install it using: +#### opentelemetry-cpp ```bash -mkdir -p $HOME/Downloads/grpc && cd $HOME/Downloads/grpc -curl -fsSL https://github.com/grpc/grpc/archive/v1.69.0.tar.gz | \ +mkdir -p $HOME/Downloads/opentelemetry-cpp && cd $HOME/Downloads/opentelemetry-cpp +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 \ -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 \ + -DWITH_EXAMPLES=OFF \ + -DWITH_STL=CXX17 \ + -DBUILD_TESTING=OFF \ + -DOPENTELEMETRY_INSTALL=ON \ + -DOPENTELEMETRY_ABI_VERSION_NO=2 \ -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ sudo ldconfig ``` -#### crc32c - -The project depends on the Crc32c library, we need to compile this from source: +#### c-ares ```bash -mkdir -p $HOME/Downloads/crc32c && cd $HOME/Downloads/crc32c -curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ +mkdir -p $HOME/Downloads/c-ares && cd $HOME/Downloads/c-ares +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=Release \ + -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ -sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ +sudo cmake --build cmake-out --target install && \ sudo ldconfig ``` -#### nlohmann_json library - -The project depends on the nlohmann_json library. We use CMake to install it as -this installs the necessary CMake configuration files. Note that this is a -header-only library, and often installed manually. This leaves your environment -without support for CMake pkg-config. +#### RE2 ```bash -mkdir -p $HOME/Downloads/json && cd $HOME/Downloads/json -curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ +mkdir -p $HOME/Downloads/re2 && cd $HOME/Downloads/re2 +curl -fsSL https://github.com/google/re2/archive/2025-07-22.tar.gz | \ tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DBUILD_TESTING=OFF \ - -DJSON_BuildTests=OFF \ - -S . -B cmake-out && \ -sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ + cmake -DCMAKE_BUILD_TYPE=Debug \ + -DBUILD_SHARED_LIBS=ON \ + -DRE2_BUILD_TESTING=OFF \ + -S . -B cmake-out && \ +sudo cmake --build cmake-out --target install && \ sudo ldconfig ``` -#### opentelemetry-cpp - -The project has an **optional** dependency on the OpenTelemetry library. We -recommend installing this library because: - -- the dependency will become required in the google-cloud-cpp v3.x series. -- it is needed to produce distributed traces of the library. +#### gRPC ```bash -mkdir -p $HOME/Downloads/opentelemetry-cpp && cd $HOME/Downloads/opentelemetry-cpp -curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +mkdir -p $HOME/Downloads/grpc && cd $HOME/Downloads/grpc +curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DWITH_EXAMPLES=OFF \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ - -DBUILD_TESTING=OFF \ - -DOPENTELEMETRY_INSTALL=ON \ - -DOPENTELEMETRY_ABI_VERSION_NO=2 \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ + -DBUILD_SHARED_LIBS=ON \ + -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 \ + -DgRPC_BUILD_GRPCPP_OTEL_PLUGIN=ON \ -S . -B cmake-out && \ sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ sudo ldconfig @@ -701,11 +644,13 @@ We can now compile and install `google-cloud-cpp`: # Pick a location to install the artifacts, e.g., `/usr/local` or `/opt` PREFIX="${HOME}/google-cloud-cpp-installed" cmake -S . -B cmake-out \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DBUILD_TESTING=OFF \ -DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF \ -DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF \ + -DGOOGLE_CLOUD_CPP_ENABLE_CTYPE_CORD_WORKAROUND="${DEMO_CORD_WORKAROUND:-ON}" \ -DGOOGLE_CLOUD_CPP_ENABLE=__ga_libraries__,opentelemetry cmake --build cmake-out -- -j "$(nproc)" cmake --build cmake-out --target install @@ -714,7 +659,7 @@ cmake --build cmake-out --target install
-Ubuntu (20.04 LTS - Focal Fossa) +Ubuntu (22.04 LTS - Jammy Jellyfish)
Install the minimal development tools, libcurl, OpenSSL and libc-ares: @@ -724,23 +669,20 @@ export DEBIAN_FRONTEND=noninteractive sudo apt-get update && \ sudo apt-get --no-install-recommends install -y apt-transport-https apt-utils \ automake build-essential cmake ca-certificates curl git \ - gcc g++ libc-ares-dev libc-ares2 libcurl4-openssl-dev \ - libssl-dev m4 make pkg-config tar wget zlib1g-dev + gcc g++ libc-ares-dev libc-ares2 libcurl4-openssl-dev libre2-dev \ + libssl-dev m4 make pkg-config tar wget zlib1g-dev libc6-dbg ``` #### Abseil -We need a recent version of Abseil. Enabling `ABSL_PROPAGATE_CXX_STD` propagates -the version of C++ used to compile Abseil to anything that depends on Abseil. - ```bash mkdir -p $HOME/Downloads/abseil-cpp && cd $HOME/Downloads/abseil-cpp -curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.1.tar.gz | \ +curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DABSL_BUILD_TESTING=OFF \ - -DABSL_PROPAGATE_CXX_STD=ON \ -DBUILD_SHARED_LIBS=yes \ -S . -B cmake-out && \ cmake --build cmake-out -- -j ${NCPU:-4} && \ @@ -755,10 +697,11 @@ Google Cloud Platform proto files: ```bash mkdir -p $HOME/Downloads/protobuf && cd $HOME/Downloads/protobuf -curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz | \ +curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v33.1.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -Dprotobuf_BUILD_TESTS=OFF \ -Dprotobuf_ABSL_PROVIDER=package \ @@ -768,25 +711,6 @@ sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ sudo ldconfig ``` -#### RE2 - -The version of RE2 included with this distro hard-codes C++11 in its pkg-config -file. You can skip this build and use the system's package if you are not -planning to use pkg-config. - -```bash -mkdir -p $HOME/Downloads/re2 && cd $HOME/Downloads/re2 -curl -fsSL https://github.com/google/re2/archive/2025-07-22.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=ON \ - -DRE2_BUILD_TESTING=OFF \ - -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ -sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ -sudo ldconfig -``` - #### gRPC We also need a version of gRPC that is recent enough to support the Google Cloud @@ -794,10 +718,11 @@ Platform proto files. We install it using: ```bash mkdir -p $HOME/Downloads/grpc && cd $HOME/Downloads/grpc -curl -fsSL https://github.com/grpc/grpc/archive/v1.69.0.tar.gz | \ +curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -DgRPC_INSTALL=ON \ -DgRPC_BUILD_TESTS=OFF \ @@ -813,26 +738,6 @@ sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ sudo ldconfig ``` -#### crc32c - -The project depends on the Crc32c library, we need to compile this from source: - -```bash -mkdir -p $HOME/Downloads/crc32c && cd $HOME/Downloads/crc32c -curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ - -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ -sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ -sudo ldconfig -``` - #### nlohmann_json library The project depends on the nlohmann_json library. We use CMake to install it as @@ -845,7 +750,7 @@ mkdir -p $HOME/Downloads/json && cd $HOME/Downloads/json curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_SHARED_LIBS=yes \ -DBUILD_TESTING=OFF \ -DJSON_BuildTests=OFF \ @@ -856,22 +761,16 @@ sudo ldconfig #### opentelemetry-cpp -The project has an **optional** dependency on the OpenTelemetry library. We -recommend installing this library because: - -- the dependency will become required in the google-cloud-cpp v3.x series. -- it is needed to produce distributed traces of the library. - ```bash mkdir -p $HOME/Downloads/opentelemetry-cpp && cd $HOME/Downloads/opentelemetry-cpp -curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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 \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -888,11 +787,13 @@ We can now compile and install `google-cloud-cpp`: # Pick a location to install the artifacts, e.g., `/usr/local` or `/opt` PREFIX="${HOME}/google-cloud-cpp-installed" cmake -S . -B cmake-out \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DBUILD_TESTING=OFF \ -DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF \ -DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF \ + -DGOOGLE_CLOUD_CPP_ENABLE_CTYPE_CORD_WORKAROUND="${DEMO_CORD_WORKAROUND:-ON}" \ -DGOOGLE_CLOUD_CPP_ENABLE=__ga_libraries__,opentelemetry cmake --build cmake-out -- -j "$(nproc)" cmake --build cmake-out --target install @@ -910,7 +811,7 @@ Install the minimal development tools. sudo apt-get update && \ sudo apt-get --no-install-recommends install -y apt-transport-https apt-utils \ automake build-essential ca-certificates cmake curl git \ - gcc g++ m4 make ninja-build pkg-config tar wget zlib1g-dev + gcc g++ m4 make ninja-build pkg-config tar wget zlib1g-dev libc6-dbg ``` Install the development packages for direct `google-cloud-cpp` dependencies: @@ -918,9 +819,6 @@ Install the development packages for direct `google-cloud-cpp` dependencies: ```bash sudo apt-get update && \ sudo apt-get --no-install-recommends install -y \ - libabsl-dev \ - libprotobuf-dev protobuf-compiler \ - libgrpc++-dev libgrpc-dev protobuf-compiler-grpc \ libcurl4-openssl-dev libssl-dev nlohmann-json3-dev ``` @@ -945,44 +843,53 @@ sudo ldconfig && cd /var/tmp && rm -fr build export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig ``` -#### crc32c - -The project depends on the Crc32c library, we need to compile this from source: +#### Abseil ```bash -mkdir -p $HOME/Downloads/crc32c && cd $HOME/Downloads/crc32c -curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ +mkdir -p $HOME/Downloads/abseil-cpp && cd $HOME/Downloads/abseil-cpp +curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ - -S . -B cmake-out && \ + -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} && \ sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ sudo ldconfig ``` -#### opentelemetry-cpp +#### Protobuf -The project has an **optional** dependency on the OpenTelemetry library. We -recommend installing this library because: +```bash +mkdir -p $HOME/Downloads/protobuf && cd $HOME/Downloads/protobuf +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 && \ +sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ +sudo ldconfig && \ + ln -s /usr/local/bin/protoc /usr/bin/protoc +``` -- the dependency will become required in the google-cloud-cpp v3.x series. -- it is needed to produce distributed traces of the library. +#### opentelemetry-cpp ```bash mkdir -p $HOME/Downloads/opentelemetry-cpp && cd $HOME/Downloads/opentelemetry-cpp -curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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 \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -991,6 +898,58 @@ sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ sudo ldconfig ``` +#### c-ares + +```bash +mkdir -p $HOME/Downloads/c-ares && cd $HOME/Downloads/c-ares +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 && \ +sudo cmake --build cmake-out --target install && \ +sudo ldconfig +``` + +#### RE2 + +```bash +mkdir -p $HOME/Downloads/re2 && cd $HOME/Downloads/re2 +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 && \ +sudo cmake --build cmake-out --target install && \ +sudo ldconfig +``` + +#### gRPC + +```bash +mkdir -p $HOME/Downloads/grpc && cd $HOME/Downloads/grpc +curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.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 && \ +sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ +sudo ldconfig +``` + #### Compile and install the main project We can now compile and install `google-cloud-cpp`: @@ -999,11 +958,13 @@ We can now compile and install `google-cloud-cpp`: # Pick a location to install the artifacts, e.g., `/usr/local` or `/opt` PREFIX="${HOME}/google-cloud-cpp-installed" cmake -S . -B cmake-out \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DBUILD_TESTING=OFF \ -DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF \ -DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF \ + -DGOOGLE_CLOUD_CPP_ENABLE_CTYPE_CORD_WORKAROUND="${DEMO_CORD_WORKAROUND:-ON}" \ -DGOOGLE_CLOUD_CPP_ENABLE=__ga_libraries__,opentelemetry cmake --build cmake-out -- -j "$(nproc)" cmake --build cmake-out --target install @@ -1020,25 +981,28 @@ Install the minimal development tools, libcurl, and OpenSSL: ```bash sudo apt-get update && \ sudo apt-get --no-install-recommends install -y apt-transport-https apt-utils \ - automake build-essential ca-certificates cmake curl git \ + automake build-essential ca-certificates curl git \ gcc g++ libc-ares-dev libc-ares2 libcurl4-openssl-dev \ - libssl-dev m4 make ninja-build pkg-config tar wget zlib1g-dev + libssl-dev m4 make ninja-build pkg-config tar wget zlib1g-dev libc6-dbg ``` -#### Abseil +#### Install CMake v3.22 + +mkdir -p $HOME/Downloads/cmake && cd $HOME/Downloads/cmake curl -fsSL +https://github.com/Kitware/cmake/archive/v3.22.3.tar.gz | \ +tar -xzf - --strip-components=1 && \ +./bootstrap && make -j ${NCPU:-4} && sudo make install -Debian 11 ships with Abseil==20200923.3. Unfortunately, the current gRPC version -needs Abseil >= 20210324. Enabling `ABSL_PROPAGATE_CXX_STD` propagates the -version of C++ used to compile Abseil to anything that depends on Abseil. +#### Abseil ```bash mkdir -p $HOME/Downloads/abseil-cpp && cd $HOME/Downloads/abseil-cpp -curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.1.tar.gz | \ +curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DABSL_BUILD_TESTING=OFF \ - -DABSL_PROPAGATE_CXX_STD=ON \ -DBUILD_SHARED_LIBS=yes \ -S . -B cmake-out && \ cmake --build cmake-out -- -j ${NCPU:-4} && \ @@ -1046,26 +1010,6 @@ sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ sudo ldconfig ``` -#### crc32c - -The project depends on the Crc32c library, we need to compile this from source: - -```bash -mkdir -p $HOME/Downloads/crc32c && cd $HOME/Downloads/crc32c -curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ - -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ -sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ -sudo ldconfig -``` - #### nlohmann_json library Debian 11 also ships with nlohmann-json==3.9.1, which is recent enough for our @@ -1085,10 +1029,11 @@ to build from source: ```bash mkdir -p $HOME/Downloads/protobuf && cd $HOME/Downloads/protobuf -curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz | \ +curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v33.1.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -Dprotobuf_BUILD_TESTS=OFF \ -Dprotobuf_ABSL_PROVIDER=package \ @@ -1107,7 +1052,7 @@ planning to use pkg-config. mkdir -p $HOME/Downloads/re2 && cd $HOME/Downloads/re2 curl -fsSL https://github.com/google/re2/archive/2025-07-22.tar.gz | \ tar -xzf - --strip-components=1 && \ - cmake -DCMAKE_BUILD_TYPE=Release \ + cmake -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_SHARED_LIBS=ON \ -DRE2_BUILD_TESTING=OFF \ -S . -B cmake-out && \ @@ -1118,14 +1063,13 @@ sudo ldconfig #### gRPC -Finally, we build gRPC from source: - ```bash mkdir -p $HOME/Downloads/grpc && cd $HOME/Downloads/grpc -curl -fsSL https://github.com/grpc/grpc/archive/v1.69.0.tar.gz | \ +curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -DgRPC_INSTALL=ON \ -DgRPC_BUILD_TESTS=OFF \ @@ -1142,22 +1086,16 @@ sudo ldconfig #### opentelemetry-cpp -The project has an **optional** dependency on the OpenTelemetry library. We -recommend installing this library because: - -- the dependency will become required in the google-cloud-cpp v3.x series. -- it is needed to produce distributed traces of the library. - ```bash mkdir -p $HOME/Downloads/opentelemetry-cpp && cd $HOME/Downloads/opentelemetry-cpp -curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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 \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -1174,11 +1112,13 @@ We can now compile and install `google-cloud-cpp`: # Pick a location to install the artifacts, e.g., `/usr/local` or `/opt` PREFIX="${HOME}/google-cloud-cpp-installed" cmake -S . -B cmake-out \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DBUILD_TESTING=OFF \ -DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF \ -DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF \ + -DGOOGLE_CLOUD_CPP_ENABLE_CTYPE_CORD_WORKAROUND="${DEMO_CORD_WORKAROUND:-ON}" \ -DGOOGLE_CLOUD_CPP_ENABLE=__ga_libraries__,opentelemetry cmake --build cmake-out -- -j "$(nproc)" cmake --build cmake-out --target install @@ -1200,7 +1140,9 @@ sudo dnf install -y epel-release && \ sudo dnf makecache && \ sudo dnf install -y cmake findutils gcc-c++ git make openssl-devel \ patch zlib-devel libcurl-devel c-ares-devel tar wget which \ - autoconf automake libtool binutils + autoconf automake libtool binutils dnf-utils +sudo dnf makecache && sudo dnf debuginfo-install -y glibc + ``` Set some useful environment variables. @@ -1241,19 +1183,14 @@ export PATH=/usr/local/bin:${PATH} #### Abseil -Rocky Linux 9 includes a package for Abseil, unfortunately, this package is -incomplete, as it lacks the CMake support files for it. We need to compile -Abseiil from source. Enabling `ABSL_PROPAGATE_CXX_STD` propagates the version of -C++ used to compile Abseil to anything that depends on Abseil. - ```bash mkdir -p $HOME/Downloads/abseil-cpp && cd $HOME/Downloads/abseil-cpp -curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.1.tar.gz | \ +curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DABSL_BUILD_TESTING=OFF \ - -DABSL_PROPAGATE_CXX_STD=ON \ -DBUILD_SHARED_LIBS=yes \ -S . -B cmake-out && \ cmake --build cmake-out -- -j ${NCPU:-4} && \ @@ -1269,10 +1206,11 @@ install Protobuf (and any downstream packages) from source. ```bash mkdir -p $HOME/Downloads/protobuf && cd $HOME/Downloads/protobuf -curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v29.4.tar.gz | \ +curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v33.1.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -Dprotobuf_BUILD_TESTS=OFF \ -Dprotobuf_ABSL_PROVIDER=package \ @@ -1292,7 +1230,7 @@ planning to use pkg-config. mkdir -p $HOME/Downloads/re2 && cd $HOME/Downloads/re2 curl -fsSL https://github.com/google/re2/archive/2025-07-22.tar.gz | \ tar -xzf - --strip-components=1 && \ - cmake -DCMAKE_BUILD_TYPE=Release \ + cmake -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_SHARED_LIBS=ON \ -DRE2_BUILD_TESTING=OFF \ -S . -B cmake-out && \ @@ -1310,11 +1248,11 @@ install it using: ```bash mkdir -p $HOME/Downloads/grpc && cd $HOME/Downloads/grpc -curl -fsSL https://github.com/grpc/grpc/archive/v1.69.0.tar.gz | \ +curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_CXX_STANDARD=17 \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_SHARED_LIBS=yes \ -DgRPC_INSTALL=ON \ -DgRPC_BUILD_TESTS=OFF \ @@ -1330,26 +1268,6 @@ sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ sudo ldconfig ``` -#### crc32c - -The project depends on the Crc32c library, we need to compile this from source: - -```bash -mkdir -p $HOME/Downloads/crc32c && cd $HOME/Downloads/crc32c -curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ - -S . -B cmake-out && \ - cmake --build cmake-out -- -j ${NCPU:-4} && \ -sudo cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ -sudo ldconfig -``` - #### nlohmann_json library The project depends on the nlohmann_json library. We use CMake to install it as @@ -1362,7 +1280,7 @@ mkdir -p $HOME/Downloads/json && cd $HOME/Downloads/json curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_SHARED_LIBS=yes \ -DBUILD_TESTING=OFF \ -DJSON_BuildTests=OFF \ @@ -1373,22 +1291,16 @@ sudo ldconfig #### opentelemetry-cpp -The project has an **optional** dependency on the OpenTelemetry library. We -recommend installing this library because: - -- the dependency will become required in the google-cloud-cpp v3.x series. -- it is needed to produce distributed traces of the library. - ```bash mkdir -p $HOME/Downloads/opentelemetry-cpp && cd $HOME/Downloads/opentelemetry-cpp -curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.20.0.tar.gz | \ +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 \ - -DWITH_STL=CXX14 \ - -DWITH_ABSEIL=ON \ + -DWITH_STL=CXX17 \ -DBUILD_TESTING=OFF \ -DOPENTELEMETRY_INSTALL=ON \ -DOPENTELEMETRY_ABI_VERSION_NO=2 \ @@ -1405,11 +1317,13 @@ We can now compile and install `google-cloud-cpp`: # Pick a location to install the artifacts, e.g., `/usr/local` or `/opt` PREFIX="${HOME}/google-cloud-cpp-installed" cmake -S . -B cmake-out \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ -DBUILD_TESTING=OFF \ -DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF \ -DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF \ + -DGOOGLE_CLOUD_CPP_ENABLE_CTYPE_CORD_WORKAROUND="${DEMO_CORD_WORKAROUND:-ON}" \ -DGOOGLE_CLOUD_CPP_ENABLE=__ga_libraries__,opentelemetry cmake --build cmake-out -- -j "$(nproc)" cmake --build cmake-out --target install @@ -1480,8 +1394,6 @@ cmake --build cmake-out --target install [^3]: Only some libraries (Compute, SQL Admin, and Google Cloud Storage) require this dependency. -[^4]: Only the Google Cloud Storage client library requires this dependency. - [^5]: The Google Cloud Storage client does not require Protobuf. [^6]: On some platforms, some libraries may need a newer version of Protobuf to @@ -1489,11 +1401,10 @@ cmake --build cmake-out --target install the Protobuf-generated code. [^7]: See the [OpenTelemetry quickstart][otel-qs] for detailed instructions on how - to enable and build this optional dependency. + to build this dependency. [abseil-gh]: https://github.com/abseil/abseil-cpp [abseil/abseil-cpp#696]: https://github.com/abseil/abseil-cpp/issues/696 -[crc32c-gh]: https://github.com/google/crc32c [grpc-gh]: https://github.com/grpc/grpc [homebrew formula]: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/abseil.rb [howto-setup-dev-workstation]: /doc/contributor/howto-guide-setup-development-workstation.md diff --git a/doc/v3-migration-guide.md b/doc/v3-migration-guide.md new file mode 100644 index 0000000000000..66f41b055559f --- /dev/null +++ b/doc/v3-migration-guide.md @@ -0,0 +1,1235 @@ +# `google-cloud-cpp` v3 Migration Guide + +This document helps users of previous major versions (v1.x.y, v2.x.y) of the +`google-cloud-cpp` SDK migrate to a release on the v3.x.y series. + +While this repository does not strictly follow semver, it does use the major +version number to indicate large breaking changes. We strive to balance the +frequency in which we introduce breaking changes with improvements to the SDK. +Since our most recent major version increment, about 3 years ago, we have added +new API surfaces that supersede the previous deprecated types and functions. As +part of the v3 release series, we are decommissioning those deprecated API +surfaces. + +## C++17 + +Depending on your build system of choice, you should set the appropriate flag +for your compiler if it does not already default to `--std=c++17` or higher. + +## Dependencies + +### Previously Optional Dependencies that are now Required + +- `libcurl` +- `nlohmann_json` +- `opentelemetry-cpp` + +### Relocated Dependencies + +- `crc32c` google-cloud-cpp now uses the crc32c implementation in Abseil. + +## Build system changes + +### Bazel + +
+google-cloud-cpp module in Bazel Central Registry + +Bazel is moving away from WORKSPACE file support to using modules from the Bazel +Central Registry. Part of the v3.x.y release series includes supporting the new +[google-cloud-cpp](https://registry.bazel.build/modules/google_cloud_cpp) Bazel +module which can be added to your `MODULE.bazel` file as a dependency. + +google-cloud-cpp will support WORKSPACE files until Bazel 8 reaches end of +support (2027/12). However, some dependencies may stop supporting WORKSPACE +files before then which will limit what dependency versions can be used via +WORKSPACE. + +
+ +### CMake + +
+Removed backward compatible proto interface libraries. + +If your application links directly to one of these decommissioned proto +libraries, you should update your CMakeLists.txt with the preferred proto +library name. + +| Library | Decommissioned Proto Library | Preferred Proto Library | +| -------------------------- | ------------------------------------- | -------------------------------------- | +| google/cloud/dialogflow_es | cloud_dialogflow_v2_protos | google-cloud-cpp::dialogflow_es_protos | +| google/cloud/logging | logging_type_protos | google-cloud-cpp::logging_protos | +| google/cloud/logging | logging_type_type_protos | google-cloud-cpp::logging_protos | +| google/cloud/speech | cloud_speech_protos | google-cloud-cpp::speech_protos | +| google/cloud/texttospeech | cloud_texttospeech_protos | google-cloud-cpp::texttospeech_protos | +| google/cloud/trace | devtools_cloudtrace_v2_tracing_protos | google-cloud-cpp::trace_protos | +| google/cloud/trace | devtools_cloudtrace_v2_trace_protos | google-cloud-cpp::trace_protos | + +
+ +## Decommissioned API Surfaces + +### Common + +
+Removed v1 inline namespace alias. + + +Omit the `v1` namespace for unversioned libraries: + +- Bigtable +- PubSub +- Spanner +- Storage + +For example, code that used to look like this: + +**Before:** + +```cpp + +google::cloud::v1::pubsub::Publisher publisher; +``` + +Should be changed to this: + +**After:** + +```cpp +google::cloud::pubsub::Publisher publisher; +``` + +
+ +
+Removed gcpcxxV1 inline namespace alias. + + +Omit the `gcpcxxV1` namespace from versioned libraries. The version is now part +of the service namespace. + +For example, code that used to look like this: + +**Before:** + +```cpp + +google::cloud::bigquery_storage_v1::gcpcxxV1::BigQueryReadClient client; +``` + +Should be changed to this: + +**After:** + +```cpp +google::cloud::bigquery_storage_v1::BigQueryReadClient client; +``` + +
+ +
+Removed google::cloud::grpc_utils namespace and headers. + + +Types that were previously defined in both `google::cloud::grpc_utils` and +`google::cloud` now only exist in `google::cloud`. + +For example, code that used to look like this: + +**Before:** + +```cpp +#include "google/cloud/grpc_utils/completion_queue.h + +google::cloud::grpc_utils::CompletionQueue cq; +``` + +Should be changed to this: + +**After:** + +```cpp +#include "google/cloud/completion_queue.h + +google::cloud::CompletionQueue cq; +``` + +
+ +
+Removed unversioned forwarding headers. + + +We created some early libraries without version and/or service directories. For +backwards compatibility, forwarding headers were left at parent directory that +pointed at the first version of the library: + +- google/cloud/accessapproval +- google/cloud/accesscontextmanager +- google/cloud/apigateway +- google/cloud/apigeeconnect +- google/cloud/apikeys +- google/cloud/appengine +- google/cloud/artifactregistry +- google/cloud/asset +- google/cloud/assuredworkloads +- google/cloud/automl +- google/cloud/baremetalsolution +- google/cloud/batch +- google/cloud/beyondcorp +- google/cloud/bigquery +- google/cloud/billing +- google/cloud/binaryauthorization +- google/cloud/certificatemanager +- google/cloud/channel +- google/cloud/cloudbuild +- google/cloud/composer +- google/cloud/connectors +- google/cloud/contactcenterinsights +- google/cloud/container +- google/cloud/containeranalysis +- google/cloud/datacatalog +- google/cloud/datamigration +- google/cloud/dataplex +- google/cloud/dataproc +- google/cloud/datastream +- google/cloud/deploy +- google/cloud/dlp +- google/cloud/documentai +- google/cloud/edgecontainer +- google/cloud/eventarc +- google/cloud/filestore +- google/cloud/functions +- google/cloud/gkehub +- google/cloud/iam +- google/cloud/iap +- google/cloud/ids +- google/cloud/kms +- google/cloud/language +- google/cloud/logging +- google/cloud/managedidentities +- google/cloud/memcache +- google/cloud/monitoring +- google/cloud/networkconnectivity +- google/cloud/networkmanagement +- google/cloud/notebooks +- google/cloud/optimization +- google/cloud/orgpolicy +- google/cloud/osconfig +- google/cloud/oslogin +- google/cloud/policytroubleshooter +- google/cloud/privateca +- google/cloud/profiler +- google/cloud/recommender +- google/cloud/redis +- google/cloud/resourcemanager +- google/cloud/retail +- google/cloud/run +- google/cloud/scheduler +- google/cloud/secretmanager +- google/cloud/securitycenter +- google/cloud/servicecontrol +- google/cloud/servicedirectory +- google/cloud/servicemanagement +- google/cloud/serviceusage +- google/cloud/shell +- google/cloud/speech +- google/cloud/storagetransfer +- google/cloud/talent +- google/cloud/tasks +- google/cloud/texttospeech +- google/cloud/tpu +- google/cloud/trace +- google/cloud/translate +- google/cloud/video +- google/cloud/videointelligence +- google/cloud/vision +- google/cloud/vmmigration +- google/cloud/vpcaccess +- google/cloud/webrisk +- google/cloud/websecurityscanner +- google/cloud/workflows + +For example, code that used to look like this: + +**Before:** + +```cpp +#include "google/cloud/bigquery/bigquery_read_client.h" +``` + +Should be changed to this: + +**After:** + +```cpp +#include "google/cloud/bigquery/storage/v1/bigquery_read_client.h" +``` + +
+ +### Bigquery + +
+Removed bigquery/retry_traits.h file + +The library no longer exposes the `google/cloud/bigquery/retry_traits.h` header +file. It only contained internal symbols. + +
+ +### Bigtable + +
+Removed bigtable::RowReader constructors + + +We have removed the `bigtable::RowReader` constructors that accept `DataClient` +as an argument. + +Developers that read rows by directly constructing a `RowReader` object should +instead construct a `Table` object and call `Table::ReadRows(...)`. + +For example, code that used to look like this: + +**Before:** + +```cpp +#include "google/cloud/bigtable/data_client.h" +#include "google/cloud/bigtable/row_reader.h" +#include "google/cloud/bigtable/table.h" + +// ... + +auto client = google::cloud::bigtable::MakeDataClient( + "my-project", "my-instance", creds); +auto reader = google::cloud::bigtable::RowReader( + client, "my-table-id", google::cloud::bigtable::RowSet("r1", "r2"), + google::cloud::bigtable::RowReader::NO_ROWS_LIMIT, + google::cloud::bigtable::Filter::PassAllFilter(), + /*...retry and backoff policies...*/); + +for (auto& row : reader) { + if (!row) throw std::move(row).status(); + // ... +} +``` + +Should be changed to this: + +**After:** + +```cpp +#include "google/cloud/bigtable/table.h" + +// ... + +namespace cbt = google::cloud::bigtable; +cbt::Table table(cbt::MakeDataConnection(), + cbt::TableResource("my-project", "my-instance", "my-table-id")); + +for (auto& row : table.ReadRows( + cbt::RowSet("r1", "r2"), + cbt::Filter::PassAllFilter())) { + if (!row) throw std::move(row).status(); + // ... +} +``` + +
+ +
+ Removed bigtable::ClientOptions + +#### `bigtable::ClientOptions` + +We have removed the deprecated `bigtable::ClientOptions` class. Please use +`google::cloud::Options` instead. + +The following table shows the mapping from `bigtable::ClientOptions` methods to +their `google::cloud::Options` equivalents: + +| `bigtable::ClientOptions` method | `google::cloud::Options` equivalent | +| ----------------------------------- | ----------------------------------------------------------------------------------------------- | +| `(constructor)` | `google::cloud::Options{}` | +| `set_data_endpoint` | `google::cloud::EndpointOption` | +| `set_admin_endpoint` | `google::cloud::EndpointOption` | +| `set_connection_pool_name` | `google::cloud::GrpcChannelArgumentsOption` or`google::cloud::GrpcChannelArgumentsNativeOption` | +| `set_connection_pool_size` | `google::cloud::GrpcNumChannelsOption` | +| `SetCredentials` | `google::cloud::GrpcCredentialOption` | +| `set_channel_arguments` | `google::cloud::GrpcChannelArgumentsNativeOption` | +| `SetCompressionAlgorithm` | `google::cloud::GrpcChannelArgumentsNativeOption` | +| `SetGrpclbFallbackTimeout` | `google::cloud::GrpcChannelArgumentsNativeOption` | +| `SetUserAgentPrefix` | `google::cloud::UserAgentProductsOption` or`google::cloud::GrpcChannelArgumentsNativeOption` | +| `SetResourceQuota` | `google::cloud::GrpcChannelArgumentsNativeOption` | +| `SetMaxReceiveMessageSize` | `google::cloud::GrpcChannelArgumentsNativeOption` | +| `SetMaxSendMessageSize` | `google::cloud::GrpcChannelArgumentsNativeOption` | +| `SetLoadBalancingPolicyName` | `google::cloud::GrpcChannelArgumentsNativeOption` | +| `SetServiceConfigJSON` | `google::cloud::GrpcChannelArgumentsNativeOption` | +| `SetSslTargetNameOverride` | `google::cloud::GrpcChannelArgumentsNativeOption` | +| `enable_tracing`, `disable_tracing` | `google::cloud::LoggingComponentsOption` | +| `tracing_options` | `google::cloud::GrpcTracingOptionsOption` | +| `set_max_conn_refresh_period` | `bigtable::MaxConnectionRefreshOption` | +| `set_min_conn_refresh_period` | `bigtable::MinConnectionRefreshOption` | +| `set_background_thread_pool_size` | `google::cloud::GrpcBackgroundThreadPoolSizeOption` | +| `DisableBackgroundThreads` | `google::cloud::GrpcCompletionQueueOption` | + +Example usage of the replacements can be found below. + +**Before:** + +```cpp +auto client = bigtable::Client( + bigtable::ClientOptions().set_connection_pool_size(4)); +``` + +**After:** + +```cpp +auto client = bigtable::Client( + google::cloud::Options{}.set(4)); +``` + +#### `bigtable::CreateDefaultDataClient` + +We have removed the deprecated `bigtable::CreateDefaultDataClient` function. +Please use `bigtable::MakeDataClient` instead. + +**Before:** + +```cpp +auto client = bigtable::CreateDefaultDataClient( + "my-project", "my-instance", + bigtable::ClientOptions().set_connection_pool_size(4)); +``` + +**After:** + +```cpp +auto client = bigtable::MakeDataClient( + "my-project", "my-instance", + google::cloud::Options{}.set(4)); +``` + +#### `bigtable::CreateDefaultAdminClient` + +The deprecated `bigtable::CreateDefaultAdminClient` function has been removed. +Please use `bigtable::MakeAdminClient` instead. + +**Before:** + +```cpp +auto client = bigtable::CreateDefaultAdminClient( + "my-project", bigtable::ClientOptions().set_connection_pool_size(4)); +``` + +**After:** + +```cpp +auto client = bigtable::MakeAdminClient( + "my-project", + google::cloud::Options{}.set(4)); +``` + +#### `bigtable::CreateDefaultInstanceAdminClient` + +The deprecated `bigtable::CreateDefaultInstanceAdminClient` function has been +removed. Please use `bigtable::MakeInstanceAdminClient` instead. + +**Before:** + +```cpp +auto client = bigtable::CreateDefaultInstanceAdminClient( + "my-project", bigtable::ClientOptions().set_connection_pool_size(4)); +``` + +**After:** + +```cpp +auto client = bigtable::MakeInstanceAdminClient( + "my-project", + google::cloud::Options{}.set(4)); +``` + +
+ +
+ +Removed bigtable::AsyncRowReader<>::NO_ROWS_LIMIT + + +AsyncRowReader::NO_ROWS_LIMIT has been removed. Please use +`google::cloud::bigtable::RowReader::NO_ROWS_LIMIT` instead. + +```cpp +// Before +auto limit = google::cloud::bigtable::AsyncRowReader<>::NO_ROWS_LIMIT; + +// After +auto limit = google::cloud::bigtable::RowReader::NO_ROWS_LIMIT; +``` + +
+ +
+Removed Endpoint Options + + +We have removed the `bigtable::DataEndpointOption`, +`bigtable::AdminEndpointOption`, and `bigtable::InstanceAdminEndpointOption` +classes. Applications should use `google::cloud::EndpointOption` instead. + +**Before:** + +```cpp +auto options = google::cloud::Options{}.set("..."); +``` + +**After:** + +```cpp +auto options = google::cloud::Options{}.set("..."); +``` + +
+ +
+Removed bigtable::DataClient and related functions + +We have removed the `bigtable::DataClient` class and its associated factory +functions (e.g., `MakeDataClient`). Applications should now use +`bigtable::DataConnection` and `bigtable::MakeDataConnection()` instead. For +detailed migration steps and examples, please refer to the migration guide: + +[Migrating from DataClient to DataConnection](https://docs.cloud.google.com/cpp/docs/reference/bigtable/latest/migrating-from-dataclient) + +
+ +
+Removed bigtable::MetadataUpdatePolicy + +We have removed the `bigtable::MetadataUpdatePolicy` class. It was only used in +internal legacy files. + +
+ +
+Removed bigtable::AdminClient and bigtable::TableAdmin + +We have replaced the `bigtable::AdminClient` class and `bigtable::TableAdmin` +class with `bigtable_admin::BigtableTableAdminClient`. + +**Before:** + +```cpp + +std::shared_ptr admin_client = + bigtable::MakeAdminClient("project-id"); +auto table_admin = std::make_unique( + admin_client, "instance-id"); + +// Drop a selection of rows by key prefix. +auto result = table_admin.DropRowByPrefix("table-id", "row-key-prefix"); + +// Drop all rows. +result = table_admin.DropAllRows("table-id"); +``` + +**After:** + +```cpp +#include "google/cloud/bigtable/admin/bigtable_table_admin_client.h" + +auto table_admin = bigtable_admin::BigtableTableAdminClient( + bigtable_admin::MakeBigtableAdminConnection()); +auto table_name = bigtable::TableName("project-id", "instance-id", "table-id"); + +// Drop a selection of rows by key prefix. +google::bigtable::admin::v2::DropRowRangeRequest drop_rows_by_prefix; +drop_rows_by_prefix.set_name(table_name); +drop_rows_by_prefix.set_row_key_prefix("row-key-prefix"); +auto result = table_admin.DropRowRange(drop_rows_by_prefix); + +// Drop all rows. +google::bigtable::admin::v2::DropRowRangeRequest drop_all_rows; +drop_all_rows.set_name(table_name); +drop_all_rows.set_delete_all_data_from_table(true); +result = table_admin.DropRowRange(drop_all_rows); +``` + +
+ +
WaitForConsistency is now a free function + +With the removal of the `bigtable::TableAdmin` class, we have moved +`WaitForConsistency` to +`bigtable_admin::BigtableTableAdminClient::WaitForConsistency`. + +**Before:** + +```cpp + +std::shared_ptr admin_client = + bigtable::MakeAdminClient("project-id"); +auto table_admin = std::make_unique( + admin_client, "instance-id"); + +auto token = table_admin.GenerateConsistencyToken("table-id"); +if (!token) throw std::runtime_error(token.status().message()); +auto result = table_admin.WaitForConsistency("table-id", *token); +``` + +**After:** + +```cpp +#include "google/cloud/bigtable/admin/bigtable_table_admin_client.h" + +auto connection = bigtable_admin::MakeBigtableAdminConnection(); +auto table_admin = bigtable_admin::BigtableTableAdminClient(connection); +auto table_name = bigtable::TableName("project-id", "instance-id", "table-id"); + +auto token = table_admin.GenerateConsistencyToken(table_name); +if (!token) throw std::runtime_error(token.status().message()); + +google::bigtable::admin::v2::CheckConsistencyRequest wait_request; +wait_request.set_name(table_name); +wait_request.set_consistency_token(token->consistency_token()); +auto wait_response = table_admin.WaitForConsistency(wait_request).get(); +``` + +
+ +
+Removed bigtable::InstanceAdminClient and bigtable::InstanceAdmin + +We have replaced the `bigtable::InstanceAdminClient` class and +`bigtable::InstanceAdmin` class with +`bigtable_admin::BigtableInstanceAdminClient`. + +**Before:** + +```cpp +auto instance_admin_client = bigtable::MakeInstanceAdminClient("project-id"); +auto instance_admin = + std::make_unique(instance_admin_client); + +auto clusters = instance_admin->ListClusters(); +``` + +**After:** + +```cpp +#include "google/cloud/bigtable/admin/bigtable_instance_admin_client.h" + +auto instance_admin = + std::make_unique( + bigtable_admin::MakeBigtableInstanceAdminConnection()); + +auto clusters = instance_admin->ListClusters( + InstanceName("project-id", "instance-id")); +``` + +
+ +### IAM + +
+ +Removed iam/retry_traits.h file + +The library no longer exposes `google/cloud/iam/retry_traits.h` header file. It +only contained internal symbols. + +
+ +### Pubsub + +
+ Removed pubsub::PublisherOptions + +#### `pubsub::PublisherOptions` + +We have removed the deprecated `pubsub::PublisherOptions`. Please use +`google::cloud::Options` instead. + +The following table shows the mapping from `pubsub::PublisherOptions` methods to +their `google::cloud::Options` equivalents: + +| `pubsub::PublisherOptions` method | `google::cloud::Options` equivalent | +| --------------------------------- | -------------------------------------------------- | +| `(constructor)` | `google::cloud::Options{}` | +| `set_maximum_hold_time` | `google::cloud::pubsub::MaxHoldTimeOption` | +| `set_maximum_batch_message_count` | `google::cloud::pubsub::MaxBatchMessagesOption` | +| `set_maximum_batch_bytes` | `google::cloud::pubsub::MaxBatchBytesOption` | +| `enable_message_ordering` | `google::cloud::pubsub::MessageOrderingOption` | +| `disable_message_ordering` | `google::cloud::pubsub::MessageOrderingOption` | +| `set_maximum_pending_bytes` | `google::cloud::pubsub::MaxPendingBytesOption` | +| `set_maximum_pending_messages` | `google::cloud::pubsub::MaxPendingMessagesOption` | +| `set_full_publisher_ignored` | `google::cloud::pubsub::FullPublisherActionOption` | +| `set_full_publisher_rejects` | `google::cloud::pubsub::FullPublisherActionOption` | +| `set_full_publisher_blocks` | `google::cloud::pubsub::FullPublisherActionOption` | + +Example usage of the replacements can be found below. + +**Before:** + +```cpp +namespace gc = ::google::cloud; +namespace pubsub = ::google::cloud::pubsub; + +auto publisher_options = pubsub::PublisherOptions{} + .enable_message_ordering() + .set_full_publisher_ignored(); + +auto publisher = pubsub::Publisher(pubsub::MakePublisherConnection( + topic, publisher_options); +``` + +**After:** + +```cpp +namespace gc = ::google::cloud; +namespace pubsub = ::google::cloud::pubsub; + +auto options = gc::Options{} + .set(true) + .set( + pubsub::FullPublisherAction::kIgnored); + +auto publisher = pubsub::Publisher(pubsub::MakePublisherConnection( + topic, options)); +``` + +
+ +
+ Removed pubsub::SubscriberOptions + +#### `pubsub::SubscriberOptions` + +We have removed the deprecated `pubsub::SubscriberOptions`. Please use +`google::cloud::Options` instead. + +The following table shows the mapping from `pubsub::SubscriberOptions` methods +to their `google::cloud::Options` equivalents: + +| `pubsub::SubscriberOptions` method | `google::cloud::Options` equivalent | +| ---------------------------------- | ----------------------------------------------------- | +| `(constructor)` | `google::cloud::Options{}` | +| `set_max_deadline_time` | `google::cloud::pubsub::MaxDeadlineTimeOption` | +| `set_max_deadline_extension` | `google::cloud::pubsub::MaxDeadlineExtensionOption` | +| `set_max_outstanding_messages` | `google::cloud::pubsub::MaxOutstandingMessagesOption` | +| `set_max_outstanding_bytes` | `google::cloud::pubsub::MaxOutstandingBytesOption` | +| `set_max_concurrency` | `google::cloud::pubsub::MaxConcurrencyOption` | +| `set_shutdown_polling_period` | `google::cloud::pubsub::ShutdownPollingPeriodOption` | + +Example usage of the replacements can be found below. + +**Before:** + +```cpp +namespace gc = ::google::cloud; +namespace pubsub = ::google::cloud::pubsub; + +auto subscriber_options = pubsub::SubscriberOptions{} + .set_max_deadline_time(std::chrono::seconds(10)) + .set_max_outstanding_messages(42); + +auto subscriber = pubsub::Subscriber(pubsub::MakeSubscriberConnection( + subscription, subscriber_options); +``` + +**After:** + +```cpp +namespace gc = ::google::cloud; +namespace pubsub = ::google::cloud::pubsub; + +auto options = gc::Options{} + .set(std::chrono::seconds(10)) + .set(42); + +auto subscriber = pubsub::Subscriber(pubsub::MakeSubscriberConnection( + subscription, options)); +``` + +
+ +### Spanner + +
+All sessions are now Multiplexed Sessions + +The Spanner library now ignores all SessionPool related options, which are +marked as deprecated and will be removed in the future: + +- `EnableMultiplexedSessionOption` +- `SessionPoolMinSessionsOption` +- `SessionPoolMaxSessionsPerChannelOption` +- `SessionPoolMaxIdleSessionsOption` +- `SessionPoolActionOnExhaustionOption` +- `SessionPoolKeepAliveIntervalOption` + +
+ +
+Removed spanner::MakeTestRow + + +We have removed the `spanner::MakeTestRow` functions. Please use +`spanner_mocks::MakeRow` instead. + +**Before:** + +```cpp +#include "google/cloud/spanner/row.h" + +// ... + +auto row = google::cloud::spanner::MakeTestRow( + {{"c0", google::cloud::spanner::Value(42)}}); +auto row2 = google::cloud::spanner::MakeTestRow(1, "foo", true); +``` + +**After:** + +```cpp +#include "google/cloud/spanner/mocks/row.h" + +// ... + +auto row = google::cloud::spanner_mocks::MakeRow( + {{"c0", google::cloud::spanner::Value(42)}}); +auto row2 = google::cloud::spanner_mocks::MakeRow(1, "foo", true); +``` + +
+ +
+Removed spanner::ClientOptions class + +We have removed the `spanner::ClientOptions` class. Use `google::cloud::Options` +instead to set the following as needed: + +- `spanner::QueryOptimizerVersionOption` +- `spanner::QueryOptimizerStatisticsPackageOption` +- `spanner::RequestPriorityOption` +- `spanner::RequestTagOption` + +**Before:** + +```cpp +#include "google/cloud/spanner/client.h" + +// ... + +namespace spanner = ::google::cloud::spanner; +auto client_options = spanner::ClientOptions().set_query_options( + spanner::QueryOptions().set_optimizer_version("1")); + +auto client = spanner::Client(connection, client_options); +``` + +**After:** + +```cpp +#include "google/cloud/spanner/client.h" +#include "google/cloud/spanner/options.h" + +// ... + +namespace spanner = ::google::cloud::spanner; +auto options = google::cloud::Options{}.set("1"); + +auto client = spanner::Client(connection, options); +``` + +
+ +
+ +Removed admin/retry_traits.h file + +The library no longer exposes `google/cloud/spanner/admin/retry_traits.h` header +file. It only contained internal symbols. + +
+ +
+Removed Admin Clients from spanner namespace + +We have removed the `DatabaseAdminClient` and `InstanceAdminClient` classes (and +their associated connection classes and factory functions) from the +`google::cloud::spanner` namespace. Please use the replacements in +`google::cloud::spanner_admin`. + +**Before:** + +```cpp +#include "google/cloud/spanner/database_admin_client.h" +#include "google/cloud/spanner/instance_admin_client.h" + +namespace spanner = ::google::cloud::spanner; + +void Function(spanner::DatabaseAdminClient db_admin, + spanner::InstanceAdminClient in_admin) { + // ... +} +``` + +**After:** + +```cpp +#include "google/cloud/spanner/admin/database_admin_client.h" +#include "google/cloud/spanner/admin/instance_admin_client.h" + +namespace spanner_admin = ::google::cloud::spanner_admin; + +void Function(spanner_admin::DatabaseAdminClient db_admin, + spanner_admin::InstanceAdminClient in_admin) { + // ... +} +``` + +
+ +### Storage + +
+ClientOptions is removed + +The `ClientOptions` class is no longer available. You should now use +`google::cloud::Options` to configure the `Client`. + +**Before:** + +```cpp +#include "google/cloud/storage/client.h" + +void CreateClient() { + auto credentials = google::cloud::storage::oauth2::GoogleDefaultCredentials().value(); + auto options = google::cloud::storage::ClientOptions(credentials); + options.set_project_id("my-project"); + options.set_upload_buffer_size(1024 * 1024); + + google::cloud::storage::Client client(options); +} +``` + +**After:** + +```cpp +#include "google/cloud/storage/client.h" +#include "google/cloud/storage/options.h" // For option structs + +void CreateClient() { + auto credentials = google::cloud::MakeGoogleDefaultCredentials(); + auto client = google::cloud::storage::Client( + google::cloud::Options{} + .set(credentials) + .set("my-project") + .set(1024 * 1024)); +} +``` + +Use the following table to map `ClientOptions` setters to +`google::cloud::Options`: + +| `ClientOptions` Method | Replacement Option (`.set(value)`) | +| :------------------------------------ | :------------------------------------------------------ | +| `set_credentials(c)` | `google::cloud::storage::Oauth2CredentialsOption` | +| `set_project_id(p)` | `google::cloud::storage::ProjectIdOption` | +| `set_endpoint(url)` | `google::cloud::storage::RestEndpointOption` | +| `set_iam_endpoint(url)` | `google::cloud::storage::IamEndpointOption` | +| `SetDownloadBufferSize` | `google::cloud::storage::DownloadBufferSizeOption` | +| `SetUploadBufferSizee` | `google::cloud::storage::UploadBufferSizeOption` | +| `set_maximum_simple_upload_size(s)` | `google::cloud::storage::MaximumSimpleUploadSizeOption` | +| `set_enable_http_tracing(true)` | `google::cloud::LoggingComponentsOption` | +| `set_enable_raw_client_tracing(true)` | `google::cloud::LoggingComponentsOption` | + +**Example for Tracing:** + +```cpp +// Before +options.set_enable_http_tracing(true); + +// After +auto opts = Options{}.lookup().insert("raw-client"); +``` + +
+ +
+ChannelOptions is removed + +The `ChannelOptions` class is no longer available. You should now use +`google::cloud::Options` to configure the transport channel. + +**Before:** + +```cpp +#include "google/cloud/storage/grpc_plugin.h" + +void CreateClient() { + auto options = google::cloud::storage::ChannelOptions() + .set_ssl_root_path("path/to/roots.pem"); + + auto client = google::cloud::storage::MakeGrpcClient( + google::cloud::storage::ClientOptions(), options); +} +``` + +**After:** + +```cpp +#include "google/cloud/storage/grpc_plugin.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/common_options.h" + +void CreateClient() { + auto client = google::cloud::storage::MakeGrpcClient( + google::cloud::Options{}.set( + "path/to/roots.pem")); +} +``` + +
+ +
+ChannelOptions Mapping + +Use the following table to map `ChannelOptions` setters to +`google::cloud::Options`: + +| `ChannelOptions` Method | Replacement Option (`.set(value)`) | +| :---------------------- | :------------------------------------- | +| `set_ssl_root_path(p)` | `google::cloud::CARootsFilePathOption` | + +
+ +
+Client Constructor removal + +We have removed the `Client(ClientOptions)` constructor. The default constructor +`Client()` generally uses default options and default credentials. To customize, +use `Client(Options)`. + +**Before:** + +```cpp +#include "google/cloud/storage/client.h" + +void CreateClient() { + auto credentials = google::cloud::storage::oauth2::GoogleDefaultCredentials().value(); + auto options = google::cloud::storage::ClientOptions(credentials); + auto client = google::cloud::storage::Client(options); +} +``` + +**After:** + +```cpp +#include "google/cloud/storage/client.h" +#include "google/cloud/storage/options.h" + +void CreateClient() { + auto credentials = google::cloud::MakeGoogleDefaultCredentials(); + auto client = google::cloud::storage::Client( + google::cloud::Options{}.set(credentials)); +} +``` + +
+ +
+Removed Client(Connection, NoDecorations) constructor + +We have removed the `Client` constructor that accepted a `StorageConnection` and +the `NoDecorations` tag. This was intended only for test code. + +**Before:** + +```cpp +#include "google/cloud/storage/client.h" +#include "google/cloud/storage/testing/mock_storage_connection.h" + +void TestClient() { + auto mock = std::make_shared(); + // ... + auto client = google::cloud::storage::Client( + mock, google::cloud::storage::Client::NoDecorations{}); +} +``` + +**After:** + +```cpp +#include "google/cloud/storage/client.h" +#include "google/cloud/storage/testing/mock_storage_connection.h" + +void TestClient() { + auto mock = std::make_shared(); + // ... + auto client = google::cloud::storage::internal::ClientImplDetails::CreateWithoutDecorations(mock); +} +``` + +
+ +
+Removed Client::raw_client() + +We have removed the `Client::raw_client()` method. This was intended only for +internal use or testing. If you need access to the underlying connection for +testing purposes, use `google::cloud::storage::internal::ClientImplDetails`. + +**Before:** + +```cpp +#include "google/cloud/storage/client.h" + +void UseRawClient(google::cloud::storage::Client client) { + auto connection = client.raw_client(); +} +``` + +**After:** + +```cpp +#include "google/cloud/storage/client.h" + +void UseRawClient(google::cloud::storage::Client client) { + auto connection = + google::cloud::storage::internal::ClientImplDetails::GetConnection(client); +} +``` + +
+ +
+Removed storage_experimental::GrpcPluginOption and storage_experimental::DefaultGrpcClient + +The `storage_experimental::GrpcPluginOption` is no longer necessary. Instead of +calling `storage_experimental::DefaultGrpcClient` now call +`storage::MakeGrpcClient` + +**Before:** + +```cpp +#include "google/cloud/storage/grpc_plugin.h" +namespace gc = ::google::cloud; + +auto options = gc::Options{} + .set("media"); +auto client = gc::storage_experimental::DefaultGrpcClient(options); +``` + +**After:** + +```cpp +#include "google/cloud/storage/grpc_plugin.h" +namespace gc = ::google::cloud; + +auto client = gc::storage::MakeGrpcClient(); +``` + +
+ +
+Removed experimental-storage_grpc targets from CMake and Bazel + +CMake should now link to `google-cloud-cpp::storage_grpc`. + +Bazel should now depend on `@google_cloud_cpp//:storage_grpc` + +
+ +
+Removed deprecated Oauth2CredentialsOption + +You should use the `google::cloud::UnifiedCredentialsOption` and the unified +credentials API documented at +https://docs.cloud.google.com/cpp/docs/reference/common/latest/group__guac +instead. + +**Before:** + +```cpp +#include "google/cloud/options.h" +#include "google/cloud/storage/client.h" +#include "google/cloud/storage/oauth2/google_credentials.h" + +namespace gc = ::google::cloud; +namespace gcs = ::google::cloud::storage; +namespace oauth2 = ::google::cloud::storage::oauth2; + +auto options = gc::Options{} + .set(oauth2::CreateAnonymousCredentials()); +auto client = gcs::Client(options); +``` + +**After:** + +```cpp +#include "google/cloud/options.h" +#include "google/cloud/storage/client.h" +#include "google/cloud/credentials.h" + +namespace gc = ::google::cloud; +namespace gcs = ::google::cloud::storage; + +auto options = gc::Options{} + .set(gc::MakeInsecureCredentials()); +auto client = gcs::Client(options); +``` + +
+ +
+Removed deprecated CreateServiceAccountCredentialsFromFilePath + +You should use the `google::cloud::MakeServiceAccountCredentialsFromFile` +factory function and associated override options `google::cloud::ScopesOption` +and `google::cloud::subjectOption` instead. + +**Before:** + +```cpp +#include "google/cloud/options.h" +#include "google/cloud/storage/client.h" +#include "google/cloud/storage/oauth2/google_credentials.h" + +namespace gc = ::google::cloud; +namespace gcs = ::google::cloud::storage; +namespace oauth2 = ::google::cloud::storage::oauth2; + +std::set scopes = {"scope1", "scope2"}; +auto credentials = CreateServiceAccountCredentialsFromFilePath( + "path-to-file", scopes, "my-subject"); + +auto options = gc::Options{} + .set(credentials); +auto client = gcs::Client(options); +``` + +**After:** + +```cpp +#include "google/cloud/options.h" +#include "google/cloud/storage/client.h" +#include "google/cloud/credentials.h" + +namespace gc = ::google::cloud; +namespace gcs = ::google::cloud::storage; + +auto options = gc::Options{} + .set(std::vector({"scope1", "scope2"})) + .set("my-subject"); + +options = options.set( + gc::MakeServiceAccountCredentialsFromFile("path-to-file", options)); +auto client = gcs::Client(options); +``` + +
diff --git a/docfx/BUILD.bazel b/docfx/BUILD.bazel index 2960304936fca..25de3ea4d760a 100644 --- a/docfx/BUILD.bazel +++ b/docfx/BUILD.bazel @@ -32,8 +32,8 @@ cc_library( }), deps = [ "@com_github_jbeder_yaml_cpp//:yaml-cpp", - "@com_github_nlohmann_json//:json", "@com_github_zeux_pugixml//:pugixml", + "@nlohmann_json//:json", ], ) @@ -50,8 +50,8 @@ cc_library( deps = [ ":docfx", "@com_github_jbeder_yaml_cpp//:yaml-cpp", - "@com_github_nlohmann_json//:json", "@com_github_zeux_pugixml//:pugixml", + "@nlohmann_json//:json", ], ) @@ -63,7 +63,7 @@ cc_library( ":docfx", ":docfx_testing", "@com_github_zeux_pugixml//:pugixml", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in unit_tests] diff --git a/docfx/CMakeLists.txt b/docfx/CMakeLists.txt index 72204d4a65607..49ccfaae9749b 100644 --- a/docfx/CMakeLists.txt +++ b/docfx/CMakeLists.txt @@ -72,13 +72,11 @@ add_library( toc_entry.cc toc_entry.h yaml_context.cc - yaml_context.h - yaml_emit.cc - yaml_emit.h) + yaml_context.h) google_cloud_cpp_add_common_options(docfx) target_include_directories(docfx PUBLIC "${PROJECT_SOURCE_DIR}") target_compile_features(docfx PUBLIC cxx_std_17) -target_link_libraries(docfx PUBLIC pugixml::pugixml yaml-cpp +target_link_libraries(docfx PUBLIC pugixml::pugixml yaml-cpp::yaml-cpp nlohmann_json::nlohmann_json) create_bazel_config(docfx YEAR "2023") diff --git a/docfx/docfx.bzl b/docfx/docfx.bzl index 0600d0fe4538f..5898f44cd1816 100644 --- a/docfx/docfx.bzl +++ b/docfx/docfx.bzl @@ -35,7 +35,6 @@ docfx_hdrs = [ "public_docs.h", "toc_entry.h", "yaml_context.h", - "yaml_emit.h", ] docfx_srcs = [ @@ -56,5 +55,4 @@ docfx_srcs = [ "public_docs.cc", "toc_entry.cc", "yaml_context.cc", - "yaml_emit.cc", ] diff --git a/docfx/doxygen2children.cc b/docfx/doxygen2children.cc index 1abd9f3ccacd8..c844ceef7b66c 100644 --- a/docfx/doxygen2children.cc +++ b/docfx/doxygen2children.cc @@ -14,7 +14,6 @@ #include "docfx/doxygen2children.h" #include "docfx/public_docs.h" -#include "docfx/yaml_emit.h" #include #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/CMakeLists.txt b/docfx/product-neutral-guides/CMakeLists.txt index 56f54c315b8d0..5b0d62f66cff7 100644 --- a/docfx/product-neutral-guides/CMakeLists.txt +++ b/docfx/product-neutral-guides/CMakeLists.txt @@ -51,6 +51,11 @@ set(TOC_ITEMS ${toc_items}) set(toc_file "${output_dir}/toc.yml") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/toc.yml.in" "${toc_file}" @ONLY) +set(metadata_file "${output_dir}/docs.metadata.json") +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/docs.metadata.json.in" + "${metadata_file}" @ONLY) +list(APPEND copied_files "${metadata_file}") + add_custom_target(product-neutral-guides-docs DEPENDS ${copied_files}) add_dependencies(all-docfx product-neutral-guides-docs) diff --git a/docfx/product-neutral-guides/docs.metadata.json.in b/docfx/product-neutral-guides/docs.metadata.json.in new file mode 100644 index 0000000000000..395f8646bd51d --- /dev/null +++ b/docfx/product-neutral-guides/docs.metadata.json.in @@ -0,0 +1,5 @@ +{ + "language": "cpp", + "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/examples/BUILD.bazel b/examples/BUILD.bazel index a131ef5390160..f0881c24cef5a 100644 --- a/examples/BUILD.bazel +++ b/examples/BUILD.bazel @@ -12,11 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -load( - "@com_google_googleapis_imports//:imports.bzl", - "cc_grpc_library", - "cc_proto_library", -) +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") package(default_visibility = ["//visibility:private"]) @@ -95,7 +93,7 @@ cc_test( "//:spanner", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_github_curl_curl//:curl", + "@curl", ], ) diff --git a/examples/gcs2cbt.cc b/examples/gcs2cbt.cc index 0b1d5ab889556..4405a2cb8d28b 100644 --- a/examples/gcs2cbt.cc +++ b/examples/gcs2cbt.cc @@ -60,8 +60,9 @@ int main(int argc, char* argv[]) try { // Create a connection to Cloud Bigtable and an object to manipulate the // specific table used in this demo. - cbt::Table table(cbt::MakeDataClient(options.project_id, options.instance_id), - options.table_id); + cbt::Table table(cbt::MakeDataConnection(), + cbt::TableResource(options.project_id, options.instance_id, + options.table_id)); cbt::MutationBatcher batcher(table); // How often do we print a progress marker ('.') in the reader thread. diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt index 5ad3c812c22be..823f71c4db7c2 100644 --- a/external/googleapis/CMakeLists.txt +++ b/external/googleapis/CMakeLists.txt @@ -387,51 +387,6 @@ foreach (target ${external_googleapis_installed_libraries_list}) external_googleapis_install_pc("${target}") endforeach () -# Create and install the googleapis pkg-config file for backwards compatibility. -set(GOOGLE_CLOUD_CPP_PC_LIBS "") -google_cloud_cpp_set_pkgconfig_paths() -set(GOOGLE_CLOUD_CPP_PC_NAME "The Google APIS C++ Proto Library") -set(GOOGLE_CLOUD_CPP_PC_DESCRIPTION - "Provides C++ APIs to access Google Cloud Platforms.") -# This list is for backwards compatibility purposes only. DO NOT add new -# libraries to it. -string( - JOIN - " " - GOOGLE_CLOUD_CPP_PC_REQUIRES - "google_cloud_cpp_bigtable_protos" - "google_cloud_cpp_cloud_bigquery_protos" - "google_cloud_cpp_iam_protos" - "google_cloud_cpp_pubsub_protos" - "google_cloud_cpp_storage_protos" - "google_cloud_cpp_logging_protos" - "google_cloud_cpp_iam_v1_iam_policy_protos" - "google_cloud_cpp_iam_v1_options_protos" - "google_cloud_cpp_iam_v1_policy_protos" - "google_cloud_cpp_longrunning_operations_protos" - "google_cloud_cpp_api_auth_protos" - "google_cloud_cpp_api_annotations_protos" - "google_cloud_cpp_api_client_protos" - "google_cloud_cpp_api_field_behavior_protos" - "google_cloud_cpp_api_http_protos" - "google_cloud_cpp_rpc_status_protos" - "google_cloud_cpp_rpc_error_details_protos" - "google_cloud_cpp_type_expr_protos" - "grpc++" - "grpc" - "openssl" - "protobuf" - "zlib" - "libcares") -set(GOOGLE_CLOUD_CPP_PC_LIBS "") -google_cloud_cpp_set_pkgconfig_paths() -configure_file("${PROJECT_SOURCE_DIR}/cmake/templates/config.pc.in" - "googleapis.pc" @ONLY) -install( - FILES "${CMAKE_CURRENT_BINARY_DIR}/googleapis.pc" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" - COMPONENT google_cloud_cpp_development) - # Create and install the CMake configuration files. include(CMakePackageConfigHelpers) diff --git a/external/googleapis/protodeps/accessapproval.deps b/external/googleapis/protodeps/accessapproval.deps index 2e749051efbb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/accessapproval.deps +++ b/external/googleapis/protodeps/accessapproval.deps @@ -1,6 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/accesscontextmanager.deps b/external/googleapis/protodeps/accesscontextmanager.deps index ceffcfaf47cd4..99121353ed73a 100644 --- a/external/googleapis/protodeps/accesscontextmanager.deps +++ b/external/googleapis/protodeps/accesscontextmanager.deps @@ -1,14 +1,14 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/identity/accesscontextmanager/type:type_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/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/identity/accesscontextmanager/type:type_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/advisorynotifications.deps b/external/googleapis/protodeps/advisorynotifications.deps index 2e749051efbb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/advisorynotifications.deps +++ b/external/googleapis/protodeps/advisorynotifications.deps @@ -1,6 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/aiplatform.deps b/external/googleapis/protodeps/aiplatform.deps index 2f70814a31fbd..1bf735c9d55e1 100644 --- a/external/googleapis/protodeps/aiplatform.deps +++ b/external/googleapis/protodeps/aiplatform.deps @@ -1,13 +1,13 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:httpbody_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:interval_proto -@com_google_googleapis//google/type:latlng_proto -@com_google_googleapis//google/type:money_proto +@googleapis//google/api:annotations_proto +@googleapis//google/api:client_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:http_proto +@googleapis//google/api:httpbody_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:date_proto +@googleapis//google/type:interval_proto +@googleapis//google/type:latlng_proto +@googleapis//google/type:money_proto diff --git a/external/googleapis/protodeps/alloydb.deps b/external/googleapis/protodeps/alloydb.deps index 1d05da9c5f015..46b0ff5b368cf 100644 --- a/external/googleapis/protodeps/alloydb.deps +++ b/external/googleapis/protodeps/alloydb.deps @@ -1,12 +1,12 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:dayofweek_proto -@com_google_googleapis//google/type:timeofday_proto +@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 +@googleapis//google/type:date_proto +@googleapis//google/type:dayofweek_proto +@googleapis//google/type:timeofday_proto diff --git a/external/googleapis/protodeps/apigateway.deps b/external/googleapis/protodeps/apigateway.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/apigateway.deps +++ b/external/googleapis/protodeps/apigateway.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/apigeeconnect.deps b/external/googleapis/protodeps/apigeeconnect.deps index da299b760ccb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/apigeeconnect.deps +++ b/external/googleapis/protodeps/apigeeconnect.deps @@ -1,7 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/rpc:status_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/apikeys.deps b/external/googleapis/protodeps/apikeys.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/apikeys.deps +++ b/external/googleapis/protodeps/apikeys.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/apiregistry.deps b/external/googleapis/protodeps/apiregistry.deps index 2e749051efbb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/apiregistry.deps +++ b/external/googleapis/protodeps/apiregistry.deps @@ -1,6 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/appengine.deps b/external/googleapis/protodeps/appengine.deps index eb1ab5d9b5bf6..156e79c776692 100644 --- a/external/googleapis/protodeps/appengine.deps +++ b/external/googleapis/protodeps/appengine.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/logging/type:type_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/logging/type:type_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/apphub.deps b/external/googleapis/protodeps/apphub.deps index 3797f67d24463..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/apphub.deps +++ b/external/googleapis/protodeps/apphub.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/artifactregistry.deps b/external/googleapis/protodeps/artifactregistry.deps index 9098b1b674ef2..11efb6f9d66da 100644 --- a/external/googleapis/protodeps/artifactregistry.deps +++ b/external/googleapis/protodeps/artifactregistry.deps @@ -1,13 +1,13 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/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/asset.deps b/external/googleapis/protodeps/asset.deps index 089feac7b43ee..f9a583f6c679e 100644 --- a/external/googleapis/protodeps/asset.deps +++ b/external/googleapis/protodeps/asset.deps @@ -1,22 +1,22 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/cloud/orgpolicy/v1:orgpolicy_proto -@com_google_googleapis//google/cloud/osconfig/v1:osconfig_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/identity/accesscontextmanager/type:type_proto -@com_google_googleapis//google/identity/accesscontextmanager/v1:accesscontextmanager_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:code_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:datetime_proto -@com_google_googleapis//google/type:dayofweek_proto -@com_google_googleapis//google/type:expr_proto -@com_google_googleapis//google/type:timeofday_proto +@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/cloud/orgpolicy/v1:orgpolicy_proto +@googleapis//google/cloud/osconfig/v1:osconfig_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/identity/accesscontextmanager/type:type_proto +@googleapis//google/identity/accesscontextmanager/v1:accesscontextmanager_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:code_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:date_proto +@googleapis//google/type:datetime_proto +@googleapis//google/type:dayofweek_proto +@googleapis//google/type:expr_proto +@googleapis//google/type:timeofday_proto diff --git a/external/googleapis/protodeps/assuredworkloads.deps b/external/googleapis/protodeps/assuredworkloads.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/assuredworkloads.deps +++ b/external/googleapis/protodeps/assuredworkloads.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/auditmanager.deps b/external/googleapis/protodeps/auditmanager.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/auditmanager.deps +++ b/external/googleapis/protodeps/auditmanager.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/automl.deps b/external/googleapis/protodeps/automl.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/automl.deps +++ b/external/googleapis/protodeps/automl.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/backupdr.deps b/external/googleapis/protodeps/backupdr.deps index c95a0a1cd0211..7fd8412d7bb69 100644 --- a/external/googleapis/protodeps/backupdr.deps +++ b/external/googleapis/protodeps/backupdr.deps @@ -1,11 +1,11 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:dayofweek_proto -@com_google_googleapis//google/type:month_proto +@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 +@googleapis//google/type:dayofweek_proto +@googleapis//google/type:month_proto diff --git a/external/googleapis/protodeps/baremetalsolution.deps b/external/googleapis/protodeps/baremetalsolution.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/baremetalsolution.deps +++ b/external/googleapis/protodeps/baremetalsolution.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/batch.deps b/external/googleapis/protodeps/batch.deps index 3797f67d24463..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/batch.deps +++ b/external/googleapis/protodeps/batch.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/beyondcorp.deps b/external/googleapis/protodeps/beyondcorp.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/beyondcorp.deps +++ b/external/googleapis/protodeps/beyondcorp.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/bigquery.deps b/external/googleapis/protodeps/bigquery.deps index 9ce491ff2a77d..b22419f223126 100644 --- a/external/googleapis/protodeps/bigquery.deps +++ b/external/googleapis/protodeps/bigquery.deps @@ -1,17 +1,17 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:distribution_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:label_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:metric_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:error_details_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@googleapis//google/api:annotations_proto +@googleapis//google/api:client_proto +@googleapis//google/api:distribution_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:http_proto +@googleapis//google/api:label_proto +@googleapis//google/api:launch_stage_proto +@googleapis//google/api:metric_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:error_details_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/bigquerycontrol.deps b/external/googleapis/protodeps/bigquerycontrol.deps index bd46b0cedb062..34365612fc71f 100644 --- a/external/googleapis/protodeps/bigquerycontrol.deps +++ b/external/googleapis/protodeps/bigquerycontrol.deps @@ -1,7 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/type:expr_proto +@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/type:expr_proto diff --git a/external/googleapis/protodeps/bigtable.deps b/external/googleapis/protodeps/bigtable.deps index bb9e95d7e0e3b..15001fff1a50c 100644 --- a/external/googleapis/protodeps/bigtable.deps +++ b/external/googleapis/protodeps/bigtable.deps @@ -1,15 +1,15 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/api:routing_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:expr_proto +@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/api:routing_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:date_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/billing.deps b/external/googleapis/protodeps/billing.deps index 0c58b63ac7071..1668a7cb77606 100644 --- a/external/googleapis/protodeps/billing.deps +++ b/external/googleapis/protodeps/billing.deps @@ -1,13 +1,14 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:expr_proto -@com_google_googleapis//google/type:money_proto +@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/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/rpc:status_proto +@googleapis//google/type:date_proto +@googleapis//google/type:expr_proto +@googleapis//google/type:money_proto diff --git a/external/googleapis/protodeps/binaryauthorization.deps b/external/googleapis/protodeps/binaryauthorization.deps index d2c38d51f9ffc..5524f95cdace3 100644 --- a/external/googleapis/protodeps/binaryauthorization.deps +++ b/external/googleapis/protodeps/binaryauthorization.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//grafeas/v1:grafeas_proto +@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/rpc:status_proto +@googleapis//grafeas/v1:grafeas_proto diff --git a/external/googleapis/protodeps/certificatemanager.deps b/external/googleapis/protodeps/certificatemanager.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/certificatemanager.deps +++ b/external/googleapis/protodeps/certificatemanager.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/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/channel.deps b/external/googleapis/protodeps/channel.deps index 983107aeb76d1..ccb330e36cc92 100644 --- a/external/googleapis/protodeps/channel.deps +++ b/external/googleapis/protodeps/channel.deps @@ -1,13 +1,13 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:datetime_proto -@com_google_googleapis//google/type:decimal_proto -@com_google_googleapis//google/type:money_proto -@com_google_googleapis//google/type:postal_address_proto +@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:date_proto +@googleapis//google/type:datetime_proto +@googleapis//google/type:decimal_proto +@googleapis//google/type:money_proto +@googleapis//google/type:postal_address_proto diff --git a/external/googleapis/protodeps/chronicle.deps b/external/googleapis/protodeps/chronicle.deps index 2e6ff1caf713a..4bbe4120b3305 100644 --- a/external/googleapis/protodeps/chronicle.deps +++ b/external/googleapis/protodeps/chronicle.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:interval_proto +@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:interval_proto diff --git a/external/googleapis/protodeps/cloudbuild.deps b/external/googleapis/protodeps/cloudbuild.deps index 628d37343b4ed..8852d31b2ad18 100644 --- a/external/googleapis/protodeps/cloudbuild.deps +++ b/external/googleapis/protodeps/cloudbuild.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:httpbody_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/api:routing_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@googleapis//google/api:annotations_proto +@googleapis//google/api:client_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:http_proto +@googleapis//google/api:httpbody_proto +@googleapis//google/api:launch_stage_proto +@googleapis//google/api:resource_proto +@googleapis//google/api:routing_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/cloudcontrolspartner.deps b/external/googleapis/protodeps/cloudcontrolspartner.deps index 22f7f75a595a1..f631e058a96b9 100644 --- a/external/googleapis/protodeps/cloudcontrolspartner.deps +++ b/external/googleapis/protodeps/cloudcontrolspartner.deps @@ -1,7 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/type:interval_proto +@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/rpc:status_proto +@googleapis//google/type:interval_proto diff --git a/external/googleapis/protodeps/cloudquotas.deps b/external/googleapis/protodeps/cloudquotas.deps index 2e749051efbb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/cloudquotas.deps +++ b/external/googleapis/protodeps/cloudquotas.deps @@ -1,6 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/cloudsecuritycompliance.deps b/external/googleapis/protodeps/cloudsecuritycompliance.deps index 2e6ff1caf713a..4bbe4120b3305 100644 --- a/external/googleapis/protodeps/cloudsecuritycompliance.deps +++ b/external/googleapis/protodeps/cloudsecuritycompliance.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:interval_proto +@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:interval_proto diff --git a/external/googleapis/protodeps/commerce.deps b/external/googleapis/protodeps/commerce.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/commerce.deps +++ b/external/googleapis/protodeps/commerce.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/common.deps b/external/googleapis/protodeps/common.deps index 84fe573712543..bb6f4b96c838a 100644 --- a/external/googleapis/protodeps/common.deps +++ b/external/googleapis/protodeps/common.deps @@ -1 +1,2 @@ -@com_google_googleapis//google/api:field_behavior_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/composer.deps b/external/googleapis/protodeps/composer.deps index 56ffb0ed0575f..d648e9f3b53c5 100644 --- a/external/googleapis/protodeps/composer.deps +++ b/external/googleapis/protodeps/composer.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto +@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:date_proto diff --git a/external/googleapis/protodeps/compute.deps b/external/googleapis/protodeps/compute.deps index 85cafd76d2c8c..c3119d7f51695 100644 --- a/external/googleapis/protodeps/compute.deps +++ b/external/googleapis/protodeps/compute.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/api:routing_proto -@com_google_googleapis//google/cloud:extended_operations_proto +@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/api:routing_proto +@googleapis//google/cloud:extended_operations_proto diff --git a/external/googleapis/protodeps/confidentialcomputing.deps b/external/googleapis/protodeps/confidentialcomputing.deps index da299b760ccb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/confidentialcomputing.deps +++ b/external/googleapis/protodeps/confidentialcomputing.deps @@ -1,7 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/rpc:status_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/config.deps b/external/googleapis/protodeps/config.deps index 3797f67d24463..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/config.deps +++ b/external/googleapis/protodeps/config.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/configdelivery.deps b/external/googleapis/protodeps/configdelivery.deps index 3797f67d24463..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/configdelivery.deps +++ b/external/googleapis/protodeps/configdelivery.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/connectors.deps b/external/googleapis/protodeps/connectors.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/connectors.deps +++ b/external/googleapis/protodeps/connectors.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/contactcenterinsights.deps b/external/googleapis/protodeps/contactcenterinsights.deps index 2e6ff1caf713a..4bbe4120b3305 100644 --- a/external/googleapis/protodeps/contactcenterinsights.deps +++ b/external/googleapis/protodeps/contactcenterinsights.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:interval_proto +@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:interval_proto diff --git a/external/googleapis/protodeps/container.deps b/external/googleapis/protodeps/container.deps index b4198c064ae3e..bb786c561e94a 100644 --- a/external/googleapis/protodeps/container.deps +++ b/external/googleapis/protodeps/container.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/rpc:code_proto -@com_google_googleapis//google/rpc:status_proto +@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/rpc:code_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/containeranalysis.deps b/external/googleapis/protodeps/containeranalysis.deps index 167e562981c0a..a0baf2c377879 100644 --- a/external/googleapis/protodeps/containeranalysis.deps +++ b/external/googleapis/protodeps/containeranalysis.deps @@ -1,13 +1,13 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto -@com_google_googleapis//grafeas/v1:grafeas_proto +@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/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/rpc:status_proto +@googleapis//google/type:expr_proto +@googleapis//grafeas/v1:grafeas_proto diff --git a/external/googleapis/protodeps/contentwarehouse.deps b/external/googleapis/protodeps/contentwarehouse.deps index f27f32a86d7f7..6d161fdc7e6f9 100644 --- a/external/googleapis/protodeps/contentwarehouse.deps +++ b/external/googleapis/protodeps/contentwarehouse.deps @@ -1,17 +1,17 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/cloud/documentai/v1:documentai_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:color_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:datetime_proto -@com_google_googleapis//google/type:expr_proto -@com_google_googleapis//google/type:interval_proto -@com_google_googleapis//google/type:money_proto -@com_google_googleapis//google/type:postal_address_proto +@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/cloud/documentai/v1:documentai_proto +@googleapis//google/iam/v1:policy_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:color_proto +@googleapis//google/type:date_proto +@googleapis//google/type:datetime_proto +@googleapis//google/type:expr_proto +@googleapis//google/type:interval_proto +@googleapis//google/type:money_proto +@googleapis//google/type:postal_address_proto diff --git a/external/googleapis/protodeps/datacatalog.deps b/external/googleapis/protodeps/datacatalog.deps index 9098b1b674ef2..11efb6f9d66da 100644 --- a/external/googleapis/protodeps/datacatalog.deps +++ b/external/googleapis/protodeps/datacatalog.deps @@ -1,13 +1,13 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/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/dataform.deps b/external/googleapis/protodeps/dataform.deps index db570cc8d9199..dc80aafe0faf3 100644 --- a/external/googleapis/protodeps/dataform.deps +++ b/external/googleapis/protodeps/dataform.deps @@ -1,8 +1,14 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:interval_proto +@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/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/datafusion.deps b/external/googleapis/protodeps/datafusion.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/datafusion.deps +++ b/external/googleapis/protodeps/datafusion.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/datamigration.deps b/external/googleapis/protodeps/datamigration.deps index 9098b1b674ef2..11efb6f9d66da 100644 --- a/external/googleapis/protodeps/datamigration.deps +++ b/external/googleapis/protodeps/datamigration.deps @@ -1,13 +1,13 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/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/dataplex.deps b/external/googleapis/protodeps/dataplex.deps index b6736e4dc8dbb..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/dataplex.deps +++ b/external/googleapis/protodeps/dataplex.deps @@ -1,14 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/dataproc.deps b/external/googleapis/protodeps/dataproc.deps index 2e6ff1caf713a..4bbe4120b3305 100644 --- a/external/googleapis/protodeps/dataproc.deps +++ b/external/googleapis/protodeps/dataproc.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:interval_proto +@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:interval_proto diff --git a/external/googleapis/protodeps/datastore.deps b/external/googleapis/protodeps/datastore.deps index b48ba0d6dc240..0b84223bcdb80 100644 --- a/external/googleapis/protodeps/datastore.deps +++ b/external/googleapis/protodeps/datastore.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:routing_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:latlng_proto +@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:routing_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:latlng_proto diff --git a/external/googleapis/protodeps/datastream.deps b/external/googleapis/protodeps/datastream.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/datastream.deps +++ b/external/googleapis/protodeps/datastream.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/deploy.deps b/external/googleapis/protodeps/deploy.deps index 690385b1c9fa0..817953a439a11 100644 --- a/external/googleapis/protodeps/deploy.deps +++ b/external/googleapis/protodeps/deploy.deps @@ -1,11 +1,11 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:dayofweek_proto -@com_google_googleapis//google/type:timeofday_proto +@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:date_proto +@googleapis//google/type:dayofweek_proto +@googleapis//google/type:timeofday_proto diff --git a/external/googleapis/protodeps/developerconnect.deps b/external/googleapis/protodeps/developerconnect.deps index 3797f67d24463..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/developerconnect.deps +++ b/external/googleapis/protodeps/developerconnect.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/devicestreaming.deps b/external/googleapis/protodeps/devicestreaming.deps index 2e749051efbb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/devicestreaming.deps +++ b/external/googleapis/protodeps/devicestreaming.deps @@ -1,6 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/dialogflow_cx.deps b/external/googleapis/protodeps/dialogflow_cx.deps index 457ff4c5f60b2..ba45406b2df47 100644 --- a/external/googleapis/protodeps/dialogflow_cx.deps +++ b/external/googleapis/protodeps/dialogflow_cx.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:latlng_proto +@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:latlng_proto diff --git a/external/googleapis/protodeps/dialogflow_es.deps b/external/googleapis/protodeps/dialogflow_es.deps index 457ff4c5f60b2..ba45406b2df47 100644 --- a/external/googleapis/protodeps/dialogflow_es.deps +++ b/external/googleapis/protodeps/dialogflow_es.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:latlng_proto +@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:latlng_proto diff --git a/external/googleapis/protodeps/discoveryengine.deps b/external/googleapis/protodeps/discoveryengine.deps index d2fe5d9ee5836..ba7d47fadd611 100644 --- a/external/googleapis/protodeps/discoveryengine.deps +++ b/external/googleapis/protodeps/discoveryengine.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:httpbody_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto +@googleapis//google/api:annotations_proto +@googleapis//google/api:client_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:http_proto +@googleapis//google/api:httpbody_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:date_proto diff --git a/external/googleapis/protodeps/dlp.deps b/external/googleapis/protodeps/dlp.deps index dec5bc18836cc..db48401637fb8 100644 --- a/external/googleapis/protodeps/dlp.deps +++ b/external/googleapis/protodeps/dlp.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:dayofweek_proto -@com_google_googleapis//google/type:timeofday_proto +@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/rpc:status_proto +@googleapis//google/type:date_proto +@googleapis//google/type:dayofweek_proto +@googleapis//google/type:timeofday_proto diff --git a/external/googleapis/protodeps/documentai.deps b/external/googleapis/protodeps/documentai.deps index b5eb632423f8e..aec9bc7912381 100644 --- a/external/googleapis/protodeps/documentai.deps +++ b/external/googleapis/protodeps/documentai.deps @@ -1,13 +1,13 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:color_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:datetime_proto -@com_google_googleapis//google/type:money_proto -@com_google_googleapis//google/type:postal_address_proto +@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:color_proto +@googleapis//google/type:date_proto +@googleapis//google/type:datetime_proto +@googleapis//google/type:money_proto +@googleapis//google/type:postal_address_proto diff --git a/external/googleapis/protodeps/domains.deps b/external/googleapis/protodeps/domains.deps index 1a611eac8ecb4..81447f0c47af9 100644 --- a/external/googleapis/protodeps/domains.deps +++ b/external/googleapis/protodeps/domains.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:money_proto -@com_google_googleapis//google/type:postal_address_proto +@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:money_proto +@googleapis//google/type:postal_address_proto diff --git a/external/googleapis/protodeps/edgecontainer.deps b/external/googleapis/protodeps/edgecontainer.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/edgecontainer.deps +++ b/external/googleapis/protodeps/edgecontainer.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/edgenetwork.deps b/external/googleapis/protodeps/edgenetwork.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/edgenetwork.deps +++ b/external/googleapis/protodeps/edgenetwork.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/essentialcontacts.deps b/external/googleapis/protodeps/essentialcontacts.deps index 2e749051efbb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/essentialcontacts.deps +++ b/external/googleapis/protodeps/essentialcontacts.deps @@ -1,6 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/eventarc.deps b/external/googleapis/protodeps/eventarc.deps index 0070a78d1da1d..c38fafb3763df 100644 --- a/external/googleapis/protodeps/eventarc.deps +++ b/external/googleapis/protodeps/eventarc.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:code_proto -@com_google_googleapis//google/rpc:status_proto +@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:code_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/filestore.deps b/external/googleapis/protodeps/filestore.deps index 566a4dcfa2cbf..fef9d1147e5f4 100644 --- a/external/googleapis/protodeps/filestore.deps +++ b/external/googleapis/protodeps/filestore.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/cloud/common:common_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/cloud/common:common_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/financialservices.deps b/external/googleapis/protodeps/financialservices.deps index 98062774348f3..30285358b93a4 100644 --- a/external/googleapis/protodeps/financialservices.deps +++ b/external/googleapis/protodeps/financialservices.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:datetime_proto -@com_google_googleapis//google/type:interval_proto +@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 +@googleapis//google/type:interval_proto diff --git a/external/googleapis/protodeps/functions.deps b/external/googleapis/protodeps/functions.deps index 5c762bd51f554..c0924d5a73d28 100644 --- a/external/googleapis/protodeps/functions.deps +++ b/external/googleapis/protodeps/functions.deps @@ -1,14 +1,14 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:expr_proto +@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/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:date_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/gkebackup.deps b/external/googleapis/protodeps/gkebackup.deps index 1d05da9c5f015..46b0ff5b368cf 100644 --- a/external/googleapis/protodeps/gkebackup.deps +++ b/external/googleapis/protodeps/gkebackup.deps @@ -1,12 +1,12 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:dayofweek_proto -@com_google_googleapis//google/type:timeofday_proto +@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 +@googleapis//google/type:date_proto +@googleapis//google/type:dayofweek_proto +@googleapis//google/type:timeofday_proto diff --git a/external/googleapis/protodeps/gkeconnect.deps b/external/googleapis/protodeps/gkeconnect.deps index 5d260a00b6f04..191cdfdc78801 100644 --- a/external/googleapis/protodeps/gkeconnect.deps +++ b/external/googleapis/protodeps/gkeconnect.deps @@ -1,5 +1,6 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/gkehub.deps b/external/googleapis/protodeps/gkehub.deps index 6ef8f9ccdeb73..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/gkehub.deps +++ b/external/googleapis/protodeps/gkehub.deps @@ -1,8 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/gkemulticloud.deps b/external/googleapis/protodeps/gkemulticloud.deps index 56ffb0ed0575f..d648e9f3b53c5 100644 --- a/external/googleapis/protodeps/gkemulticloud.deps +++ b/external/googleapis/protodeps/gkemulticloud.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto +@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:date_proto diff --git a/external/googleapis/protodeps/gkerecommender.deps b/external/googleapis/protodeps/gkerecommender.deps index 5d260a00b6f04..191cdfdc78801 100644 --- a/external/googleapis/protodeps/gkerecommender.deps +++ b/external/googleapis/protodeps/gkerecommender.deps @@ -1,5 +1,6 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/grafeas.deps b/external/googleapis/protodeps/grafeas.deps index da299b760ccb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/grafeas.deps +++ b/external/googleapis/protodeps/grafeas.deps @@ -1,7 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/rpc:status_proto +@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/rpc:status_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/iam.deps b/external/googleapis/protodeps/iam.deps index e027a4c044e59..ac9f9bb108292 100644 --- a/external/googleapis/protodeps/iam.deps +++ b/external/googleapis/protodeps/iam.deps @@ -1,11 +1,12 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/type:expr_proto +@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/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/rpc:status_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/iam_v2.deps b/external/googleapis/protodeps/iam_v2.deps index 7dabe81c47849..6a7f7c082196f 100644 --- a/external/googleapis/protodeps/iam_v2.deps +++ b/external/googleapis/protodeps/iam_v2.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/longrunning:operations_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/iam_v3.deps b/external/googleapis/protodeps/iam_v3.deps index ea852ac64f42a..5290041a37946 100644 --- a/external/googleapis/protodeps/iam_v3.deps +++ b/external/googleapis/protodeps/iam_v3.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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 +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/iap.deps b/external/googleapis/protodeps/iap.deps index e027a4c044e59..ac9f9bb108292 100644 --- a/external/googleapis/protodeps/iap.deps +++ b/external/googleapis/protodeps/iap.deps @@ -1,11 +1,12 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/type:expr_proto +@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/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/rpc:status_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/ids.deps b/external/googleapis/protodeps/ids.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/ids.deps +++ b/external/googleapis/protodeps/ids.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/kms.deps b/external/googleapis/protodeps/kms.deps index a4834da700af3..0ae51f1dfe212 100644 --- a/external/googleapis/protodeps/kms.deps +++ b/external/googleapis/protodeps/kms.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/cloud/kms/v1:kms_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/cloud/kms/v1:kms_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/language.deps b/external/googleapis/protodeps/language.deps index 5d260a00b6f04..191cdfdc78801 100644 --- a/external/googleapis/protodeps/language.deps +++ b/external/googleapis/protodeps/language.deps @@ -1,5 +1,6 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/licensemanager.deps b/external/googleapis/protodeps/licensemanager.deps index 3797f67d24463..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/licensemanager.deps +++ b/external/googleapis/protodeps/licensemanager.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/logging.deps b/external/googleapis/protodeps/logging.deps index c1736c35c9531..d72761ae60779 100644 --- a/external/googleapis/protodeps/logging.deps +++ b/external/googleapis/protodeps/logging.deps @@ -1,13 +1,13 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:distribution_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:label_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:metric_proto -@com_google_googleapis//google/api:monitored_resource_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/logging/type:type_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@googleapis//google/api:annotations_proto +@googleapis//google/api:client_proto +@googleapis//google/api:distribution_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:http_proto +@googleapis//google/api:label_proto +@googleapis//google/api:launch_stage_proto +@googleapis//google/api:metric_proto +@googleapis//google/api:monitored_resource_proto +@googleapis//google/api:resource_proto +@googleapis//google/logging/type:type_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/logging_type.deps b/external/googleapis/protodeps/logging_type.deps index e69de29bb2d1d..571008e03f6be 100644 --- a/external/googleapis/protodeps/logging_type.deps +++ b/external/googleapis/protodeps/logging_type.deps @@ -0,0 +1 @@ +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/lustre.deps b/external/googleapis/protodeps/lustre.deps index 0070a78d1da1d..c38fafb3763df 100644 --- a/external/googleapis/protodeps/lustre.deps +++ b/external/googleapis/protodeps/lustre.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:code_proto -@com_google_googleapis//google/rpc:status_proto +@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:code_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/maintenance.deps b/external/googleapis/protodeps/maintenance.deps index 8790d2ff278d9..215c8fb2926ff 100644 --- a/external/googleapis/protodeps/maintenance.deps +++ b/external/googleapis/protodeps/maintenance.deps @@ -1,7 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/managedidentities.deps b/external/googleapis/protodeps/managedidentities.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/managedidentities.deps +++ b/external/googleapis/protodeps/managedidentities.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/managedkafka.deps b/external/googleapis/protodeps/managedkafka.deps index 1f1ff171c6bb8..55352947fc477 100644 --- a/external/googleapis/protodeps/managedkafka.deps +++ b/external/googleapis/protodeps/managedkafka.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:httpbody_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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:httpbody_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/memcache.deps b/external/googleapis/protodeps/memcache.deps index 64a55e8f7c5ea..b4a44896f9844 100644 --- a/external/googleapis/protodeps/memcache.deps +++ b/external/googleapis/protodeps/memcache.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:dayofweek_proto -@com_google_googleapis//google/type:timeofday_proto +@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:dayofweek_proto +@googleapis//google/type:timeofday_proto diff --git a/external/googleapis/protodeps/memorystore.deps b/external/googleapis/protodeps/memorystore.deps index d820005adbc5a..4760fd1987644 100644 --- a/external/googleapis/protodeps/memorystore.deps +++ b/external/googleapis/protodeps/memorystore.deps @@ -1,11 +1,11 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:dayofweek_proto -@com_google_googleapis//google/type:timeofday_proto +@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 +@googleapis//google/type:dayofweek_proto +@googleapis//google/type:timeofday_proto diff --git a/external/googleapis/protodeps/metastore.deps b/external/googleapis/protodeps/metastore.deps index 1f3a27a42b85d..8b5e38216b242 100644 --- a/external/googleapis/protodeps/metastore.deps +++ b/external/googleapis/protodeps/metastore.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:dayofweek_proto +@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:dayofweek_proto diff --git a/external/googleapis/protodeps/migrationcenter.deps b/external/googleapis/protodeps/migrationcenter.deps index b77d5badb5fc8..bf3983f8225f3 100644 --- a/external/googleapis/protodeps/migrationcenter.deps +++ b/external/googleapis/protodeps/migrationcenter.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:money_proto +@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:date_proto +@googleapis//google/type:money_proto diff --git a/external/googleapis/protodeps/monitoring.deps b/external/googleapis/protodeps/monitoring.deps index ff168475aa60d..a108c60062189 100644 --- a/external/googleapis/protodeps/monitoring.deps +++ b/external/googleapis/protodeps/monitoring.deps @@ -1,16 +1,16 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:distribution_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:label_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:metric_proto -@com_google_googleapis//google/api:monitored_resource_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:calendar_period_proto -@com_google_googleapis//google/type:interval_proto -@com_google_googleapis//google/type:timeofday_proto +@googleapis//google/api:annotations_proto +@googleapis//google/api:client_proto +@googleapis//google/api:distribution_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:field_info_proto +@googleapis//google/api:http_proto +@googleapis//google/api:label_proto +@googleapis//google/api:launch_stage_proto +@googleapis//google/api:metric_proto +@googleapis//google/api:monitored_resource_proto +@googleapis//google/api:resource_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:calendar_period_proto +@googleapis//google/type:interval_proto +@googleapis//google/type:timeofday_proto diff --git a/external/googleapis/protodeps/netapp.deps b/external/googleapis/protodeps/netapp.deps index 3797f67d24463..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/netapp.deps +++ b/external/googleapis/protodeps/netapp.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/networkconnectivity.deps b/external/googleapis/protodeps/networkconnectivity.deps index 549af4e186636..6055d685d86c1 100644 --- a/external/googleapis/protodeps/networkconnectivity.deps +++ b/external/googleapis/protodeps/networkconnectivity.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:error_details_proto -@com_google_googleapis//google/rpc:status_proto +@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:error_details_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/networkmanagement.deps b/external/googleapis/protodeps/networkmanagement.deps index 3797f67d24463..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/networkmanagement.deps +++ b/external/googleapis/protodeps/networkmanagement.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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 6ef8f9ccdeb73..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/networksecurity.deps +++ b/external/googleapis/protodeps/networksecurity.deps @@ -1,8 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/networkservices.deps b/external/googleapis/protodeps/networkservices.deps index 3797f67d24463..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/networkservices.deps +++ b/external/googleapis/protodeps/networkservices.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/notebooks.deps b/external/googleapis/protodeps/notebooks.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/notebooks.deps +++ b/external/googleapis/protodeps/notebooks.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/optimization.deps b/external/googleapis/protodeps/optimization.deps index adcc65c0bd05f..01bfe98dfffbd 100644 --- a/external/googleapis/protodeps/optimization.deps +++ b/external/googleapis/protodeps/optimization.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:latlng_proto +@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/longrunning:operations_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:latlng_proto diff --git a/external/googleapis/protodeps/oracledatabase.deps b/external/googleapis/protodeps/oracledatabase.deps index ec9a1e918f795..8dbc33f98fbe6 100644 --- a/external/googleapis/protodeps/oracledatabase.deps +++ b/external/googleapis/protodeps/oracledatabase.deps @@ -1,13 +1,13 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:datetime_proto -@com_google_googleapis//google/type:dayofweek_proto -@com_google_googleapis//google/type:month_proto -@com_google_googleapis//google/type:timeofday_proto +@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 +@googleapis//google/type:datetime_proto +@googleapis//google/type:dayofweek_proto +@googleapis//google/type:month_proto +@googleapis//google/type:timeofday_proto diff --git a/external/googleapis/protodeps/orgpolicy.deps b/external/googleapis/protodeps/orgpolicy.deps index bd46b0cedb062..95e1c03aafd45 100644 --- a/external/googleapis/protodeps/orgpolicy.deps +++ b/external/googleapis/protodeps/orgpolicy.deps @@ -1,7 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/type:expr_proto +@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/rpc:status_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/osconfig.deps b/external/googleapis/protodeps/osconfig.deps index f8d1159c4429c..73b148e638ab4 100644 --- a/external/googleapis/protodeps/osconfig.deps +++ b/external/googleapis/protodeps/osconfig.deps @@ -1,12 +1,12 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:datetime_proto -@com_google_googleapis//google/type:dayofweek_proto -@com_google_googleapis//google/type:timeofday_proto +@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:date_proto +@googleapis//google/type:datetime_proto +@googleapis//google/type:dayofweek_proto +@googleapis//google/type:timeofday_proto diff --git a/external/googleapis/protodeps/oslogin.deps b/external/googleapis/protodeps/oslogin.deps index 789389795384a..e41a179464293 100644 --- a/external/googleapis/protodeps/oslogin.deps +++ b/external/googleapis/protodeps/oslogin.deps @@ -1,7 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/cloud/oslogin/common:common_proto +@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/cloud/oslogin/common:common_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/parallelstore.deps b/external/googleapis/protodeps/parallelstore.deps index 0070a78d1da1d..c38fafb3763df 100644 --- a/external/googleapis/protodeps/parallelstore.deps +++ b/external/googleapis/protodeps/parallelstore.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:code_proto -@com_google_googleapis//google/rpc:status_proto +@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:code_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/parametermanager.deps b/external/googleapis/protodeps/parametermanager.deps index 5b0f6e6ecbcd0..58d4140ff41a3 100644 --- a/external/googleapis/protodeps/parametermanager.deps +++ b/external/googleapis/protodeps/parametermanager.deps @@ -1,8 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto +@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/iam/v1:resource_policy_member_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/policysimulator.deps b/external/googleapis/protodeps/policysimulator.deps index a2410bf813156..2cc7903fd7e31 100644 --- a/external/googleapis/protodeps/policysimulator.deps +++ b/external/googleapis/protodeps/policysimulator.deps @@ -1,12 +1,12 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/cloud/orgpolicy/v2:orgpolicy_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:expr_proto +@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/cloud/orgpolicy/v2:orgpolicy_proto +@googleapis//google/iam/v1:policy_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:date_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/policytroubleshooter.deps b/external/googleapis/protodeps/policytroubleshooter.deps index b814dcc68cf04..6eb8ac6c618ee 100644 --- a/external/googleapis/protodeps/policytroubleshooter.deps +++ b/external/googleapis/protodeps/policytroubleshooter.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v2:policy_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/iam/v1:policy_proto +@googleapis//google/iam/v2:policy_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/privateca.deps b/external/googleapis/protodeps/privateca.deps index ea852ac64f42a..5290041a37946 100644 --- a/external/googleapis/protodeps/privateca.deps +++ b/external/googleapis/protodeps/privateca.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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 +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/privilegedaccessmanager.deps b/external/googleapis/protodeps/privilegedaccessmanager.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/privilegedaccessmanager.deps +++ b/external/googleapis/protodeps/privilegedaccessmanager.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/profiler.deps b/external/googleapis/protodeps/profiler.deps index 2e749051efbb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/profiler.deps +++ b/external/googleapis/protodeps/profiler.deps @@ -1,6 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/publicca.deps b/external/googleapis/protodeps/publicca.deps index 2e749051efbb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/publicca.deps +++ b/external/googleapis/protodeps/publicca.deps @@ -1,6 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/pubsub.deps b/external/googleapis/protodeps/pubsub.deps index 2e749051efbb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/pubsub.deps +++ b/external/googleapis/protodeps/pubsub.deps @@ -1,6 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/pubsublite.deps b/external/googleapis/protodeps/pubsublite.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/pubsublite.deps +++ b/external/googleapis/protodeps/pubsublite.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/rapidmigrationassessment.deps b/external/googleapis/protodeps/rapidmigrationassessment.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/rapidmigrationassessment.deps +++ b/external/googleapis/protodeps/rapidmigrationassessment.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/recaptchaenterprise.deps b/external/googleapis/protodeps/recaptchaenterprise.deps index c4941d895e95b..215c8fb2926ff 100644 --- a/external/googleapis/protodeps/recaptchaenterprise.deps +++ b/external/googleapis/protodeps/recaptchaenterprise.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/rpc:status_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/recommender.deps b/external/googleapis/protodeps/recommender.deps index d39c17013f4d3..c2af991168b9b 100644 --- a/external/googleapis/protodeps/recommender.deps +++ b/external/googleapis/protodeps/recommender.deps @@ -1,8 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/cloud/recommender/v1:recommender_proto -@com_google_googleapis//google/type:money_proto +@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/cloud/recommender/v1:recommender_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:money_proto diff --git a/external/googleapis/protodeps/redis.deps b/external/googleapis/protodeps/redis.deps index d820005adbc5a..4760fd1987644 100644 --- a/external/googleapis/protodeps/redis.deps +++ b/external/googleapis/protodeps/redis.deps @@ -1,11 +1,11 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:dayofweek_proto -@com_google_googleapis//google/type:timeofday_proto +@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 +@googleapis//google/type:dayofweek_proto +@googleapis//google/type:timeofday_proto diff --git a/external/googleapis/protodeps/resourcemanager.deps b/external/googleapis/protodeps/resourcemanager.deps index 9098b1b674ef2..11efb6f9d66da 100644 --- a/external/googleapis/protodeps/resourcemanager.deps +++ b/external/googleapis/protodeps/resourcemanager.deps @@ -1,13 +1,13 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/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/retail.deps b/external/googleapis/protodeps/retail.deps index d2fe5d9ee5836..ba7d47fadd611 100644 --- a/external/googleapis/protodeps/retail.deps +++ b/external/googleapis/protodeps/retail.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:httpbody_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto +@googleapis//google/api:annotations_proto +@googleapis//google/api:client_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:http_proto +@googleapis//google/api:httpbody_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:date_proto diff --git a/external/googleapis/protodeps/run.deps b/external/googleapis/protodeps/run.deps index c74f9bbf1f0cc..fa07d4ad68c5b 100644 --- a/external/googleapis/protodeps/run.deps +++ b/external/googleapis/protodeps/run.deps @@ -1,14 +1,14 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/api:routing_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/api:routing_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/scheduler.deps b/external/googleapis/protodeps/scheduler.deps index da299b760ccb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/scheduler.deps +++ b/external/googleapis/protodeps/scheduler.deps @@ -1,7 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/rpc:status_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/secretmanager.deps b/external/googleapis/protodeps/secretmanager.deps index e027a4c044e59..ac9f9bb108292 100644 --- a/external/googleapis/protodeps/secretmanager.deps +++ b/external/googleapis/protodeps/secretmanager.deps @@ -1,11 +1,12 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/type:expr_proto +@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/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/rpc:status_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/securesourcemanager.deps b/external/googleapis/protodeps/securesourcemanager.deps index 9098b1b674ef2..6fe9d79d63f91 100644 --- a/external/googleapis/protodeps/securesourcemanager.deps +++ b/external/googleapis/protodeps/securesourcemanager.deps @@ -1,13 +1,14 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/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/securitycenter.deps b/external/googleapis/protodeps/securitycenter.deps index c74f9bbf1f0cc..82b8f2ed76f34 100644 --- a/external/googleapis/protodeps/securitycenter.deps +++ b/external/googleapis/protodeps/securitycenter.deps @@ -1,14 +1,15 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/api:routing_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/api:routing_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/securitycentermanagement.deps b/external/googleapis/protodeps/securitycentermanagement.deps index 5f83d2c4fe211..8597ef29e4c83 100644 --- a/external/googleapis/protodeps/securitycentermanagement.deps +++ b/external/googleapis/protodeps/securitycentermanagement.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/iam/v1:policy_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/servicecontrol.deps b/external/googleapis/protodeps/servicecontrol.deps index 0910235a94fa3..9f374fa21a603 100644 --- a/external/googleapis/protodeps/servicecontrol.deps +++ b/external/googleapis/protodeps/servicecontrol.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:distribution_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/logging/type:type_proto -@com_google_googleapis//google/rpc/context:attribute_context_proto -@com_google_googleapis//google/rpc:status_proto +@googleapis//google/api:annotations_proto +@googleapis//google/api:client_proto +@googleapis//google/api:distribution_proto +@googleapis//google/api:http_proto +@googleapis//google/api:launch_stage_proto +@googleapis//google/logging/type:type_proto +@googleapis//google/rpc/context:attribute_context_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/servicedirectory.deps b/external/googleapis/protodeps/servicedirectory.deps index e027a4c044e59..ac9f9bb108292 100644 --- a/external/googleapis/protodeps/servicedirectory.deps +++ b/external/googleapis/protodeps/servicedirectory.deps @@ -1,11 +1,12 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/type:expr_proto +@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/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/rpc:status_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/servicehealth.deps b/external/googleapis/protodeps/servicehealth.deps index 2e749051efbb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/servicehealth.deps +++ b/external/googleapis/protodeps/servicehealth.deps @@ -1,6 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/servicemanagement.deps b/external/googleapis/protodeps/servicemanagement.deps index d8c1c3c97b2e9..1e73905ffe0dd 100644 --- a/external/googleapis/protodeps/servicemanagement.deps +++ b/external/googleapis/protodeps/servicemanagement.deps @@ -1,29 +1,29 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:auth_proto -@com_google_googleapis//google/api:backend_proto -@com_google_googleapis//google/api:billing_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:config_change_proto -@com_google_googleapis//google/api:context_proto -@com_google_googleapis//google/api:control_proto -@com_google_googleapis//google/api:documentation_proto -@com_google_googleapis//google/api:endpoint_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:label_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:log_proto -@com_google_googleapis//google/api:logging_proto -@com_google_googleapis//google/api:metric_proto -@com_google_googleapis//google/api:monitored_resource_proto -@com_google_googleapis//google/api:monitoring_proto -@com_google_googleapis//google/api:policy_proto -@com_google_googleapis//google/api:quota_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/api:service_proto -@com_google_googleapis//google/api:source_info_proto -@com_google_googleapis//google/api:system_parameter_proto -@com_google_googleapis//google/api:usage_proto -@com_google_googleapis//google/api:visibility_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@googleapis//google/api:annotations_proto +@googleapis//google/api:auth_proto +@googleapis//google/api:backend_proto +@googleapis//google/api:billing_proto +@googleapis//google/api:client_proto +@googleapis//google/api:config_change_proto +@googleapis//google/api:context_proto +@googleapis//google/api:control_proto +@googleapis//google/api:documentation_proto +@googleapis//google/api:endpoint_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:http_proto +@googleapis//google/api:label_proto +@googleapis//google/api:launch_stage_proto +@googleapis//google/api:log_proto +@googleapis//google/api:logging_proto +@googleapis//google/api:metric_proto +@googleapis//google/api:monitored_resource_proto +@googleapis//google/api:monitoring_proto +@googleapis//google/api:policy_proto +@googleapis//google/api:quota_proto +@googleapis//google/api:resource_proto +@googleapis//google/api:service_proto +@googleapis//google/api:source_info_proto +@googleapis//google/api:system_parameter_proto +@googleapis//google/api:usage_proto +@googleapis//google/api:visibility_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/serviceusage.deps b/external/googleapis/protodeps/serviceusage.deps index 4101bfc533315..63834b543b9e1 100644 --- a/external/googleapis/protodeps/serviceusage.deps +++ b/external/googleapis/protodeps/serviceusage.deps @@ -1,17 +1,17 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:auth_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:documentation_proto -@com_google_googleapis//google/api:endpoint_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:label_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:monitored_resource_proto -@com_google_googleapis//google/api:monitoring_proto -@com_google_googleapis//google/api:quota_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/api:usage_proto -@com_google_googleapis//google/api:visibility_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@googleapis//google/api:annotations_proto +@googleapis//google/api:auth_proto +@googleapis//google/api:client_proto +@googleapis//google/api:documentation_proto +@googleapis//google/api:endpoint_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:http_proto +@googleapis//google/api:label_proto +@googleapis//google/api:launch_stage_proto +@googleapis//google/api:monitored_resource_proto +@googleapis//google/api:monitoring_proto +@googleapis//google/api:quota_proto +@googleapis//google/api:resource_proto +@googleapis//google/api:usage_proto +@googleapis//google/api:visibility_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/shell.deps b/external/googleapis/protodeps/shell.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/shell.deps +++ b/external/googleapis/protodeps/shell.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/spanner.deps b/external/googleapis/protodeps/spanner.deps index 9098b1b674ef2..11efb6f9d66da 100644 --- a/external/googleapis/protodeps/spanner.deps +++ b/external/googleapis/protodeps/spanner.deps @@ -1,13 +1,13 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/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/speech.deps b/external/googleapis/protodeps/speech.deps index 3797f67d24463..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/speech.deps +++ b/external/googleapis/protodeps/speech.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/sql.deps b/external/googleapis/protodeps/sql.deps index 14bec83d18847..d5e6174d740a9 100644 --- a/external/googleapis/protodeps/sql.deps +++ b/external/googleapis/protodeps/sql.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:interval_proto +@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 +@googleapis//google/type:interval_proto diff --git a/external/googleapis/protodeps/storage.deps b/external/googleapis/protodeps/storage.deps index d0ef8487c5bde..c253719c21070 100644 --- a/external/googleapis/protodeps/storage.deps +++ b/external/googleapis/protodeps/storage.deps @@ -1,14 +1,14 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/api:routing_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:expr_proto +@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/api:routing_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/rpc:status_proto +@googleapis//google/type:date_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/storagebatchoperations.deps b/external/googleapis/protodeps/storagebatchoperations.deps index 0070a78d1da1d..c38fafb3763df 100644 --- a/external/googleapis/protodeps/storagebatchoperations.deps +++ b/external/googleapis/protodeps/storagebatchoperations.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:code_proto -@com_google_googleapis//google/rpc:status_proto +@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:code_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/storagecontrol.deps b/external/googleapis/protodeps/storagecontrol.deps index c592de3ec96f1..82b8f2ed76f34 100644 --- a/external/googleapis/protodeps/storagecontrol.deps +++ b/external/googleapis/protodeps/storagecontrol.deps @@ -1,15 +1,15 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/api:routing_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/api:routing_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/storageinsights.deps b/external/googleapis/protodeps/storageinsights.deps index daade2723f218..f2a3876fd991a 100644 --- a/external/googleapis/protodeps/storageinsights.deps +++ b/external/googleapis/protodeps/storageinsights.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:datetime_proto +@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:date_proto +@googleapis//google/type:datetime_proto diff --git a/external/googleapis/protodeps/storagetransfer.deps b/external/googleapis/protodeps/storagetransfer.deps index d874c482d341b..02c4f744264c2 100644 --- a/external/googleapis/protodeps/storagetransfer.deps +++ b/external/googleapis/protodeps/storagetransfer.deps @@ -1,11 +1,11 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:code_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:date_proto -@com_google_googleapis//google/type:timeofday_proto +@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:code_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:date_proto +@googleapis//google/type:timeofday_proto diff --git a/external/googleapis/protodeps/support.deps b/external/googleapis/protodeps/support.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/support.deps +++ b/external/googleapis/protodeps/support.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/talent.deps b/external/googleapis/protodeps/talent.deps index 95aee605883ca..81bb11b047629 100644 --- a/external/googleapis/protodeps/talent.deps +++ b/external/googleapis/protodeps/talent.deps @@ -1,12 +1,12 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:latlng_proto -@com_google_googleapis//google/type:money_proto -@com_google_googleapis//google/type:postal_address_proto -@com_google_googleapis//google/type:timeofday_proto +@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:latlng_proto +@googleapis//google/type:money_proto +@googleapis//google/type:postal_address_proto +@googleapis//google/type:timeofday_proto diff --git a/external/googleapis/protodeps/tasks.deps b/external/googleapis/protodeps/tasks.deps index 8c879a7869b75..ac9f9bb108292 100644 --- a/external/googleapis/protodeps/tasks.deps +++ b/external/googleapis/protodeps/tasks.deps @@ -1,12 +1,12 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:iam_policy_proto -@com_google_googleapis//google/iam/v1:options_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/iam/v1:resource_policy_member_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/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/rpc:status_proto +@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/telcoautomation.deps b/external/googleapis/protodeps/telcoautomation.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/telcoautomation.deps +++ b/external/googleapis/protodeps/telcoautomation.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/texttospeech.deps b/external/googleapis/protodeps/texttospeech.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/texttospeech.deps +++ b/external/googleapis/protodeps/texttospeech.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/timeseriesinsights.deps b/external/googleapis/protodeps/timeseriesinsights.deps index da299b760ccb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/timeseriesinsights.deps +++ b/external/googleapis/protodeps/timeseriesinsights.deps @@ -1,7 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/rpc:status_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/tpu.deps b/external/googleapis/protodeps/tpu.deps index 2e6ff1caf713a..4bbe4120b3305 100644 --- a/external/googleapis/protodeps/tpu.deps +++ b/external/googleapis/protodeps/tpu.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:interval_proto +@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:interval_proto diff --git a/external/googleapis/protodeps/trace.deps b/external/googleapis/protodeps/trace.deps index da299b760ccb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/trace.deps +++ b/external/googleapis/protodeps/trace.deps @@ -1,7 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/rpc:status_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/translate.deps b/external/googleapis/protodeps/translate.deps index 998ea7357574a..eb22dfc51db28 100644 --- a/external/googleapis/protodeps/translate.deps +++ b/external/googleapis/protodeps/translate.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/iam/v1:policy_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:expr_proto +@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/iam/v1:policy_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:expr_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/video.deps b/external/googleapis/protodeps/video.deps index bd1493be2995f..6f45ca705af53 100644 --- a/external/googleapis/protodeps/video.deps +++ b/external/googleapis/protodeps/video.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:datetime_proto +@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 +@googleapis//google/type:datetime_proto diff --git a/external/googleapis/protodeps/videointelligence.deps b/external/googleapis/protodeps/videointelligence.deps index 9fab3b1b5e5fb..6312d7a490f63 100644 --- a/external/googleapis/protodeps/videointelligence.deps +++ b/external/googleapis/protodeps/videointelligence.deps @@ -1,7 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/longrunning:operations_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/vision.deps b/external/googleapis/protodeps/vision.deps index 4e2049ed4bd4b..6fd15a7dd96d7 100644 --- a/external/googleapis/protodeps/vision.deps +++ b/external/googleapis/protodeps/vision.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/type:color_proto -@com_google_googleapis//google/type:latlng_proto +@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:color_proto +@googleapis//google/type:latlng_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/vmmigration.deps b/external/googleapis/protodeps/vmmigration.deps index 549af4e186636..6055d685d86c1 100644 --- a/external/googleapis/protodeps/vmmigration.deps +++ b/external/googleapis/protodeps/vmmigration.deps @@ -1,10 +1,10 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:error_details_proto -@com_google_googleapis//google/rpc:status_proto +@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:error_details_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/vmwareengine.deps b/external/googleapis/protodeps/vmwareengine.deps index 3797f67d24463..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/vmwareengine.deps +++ b/external/googleapis/protodeps/vmwareengine.deps @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:field_info_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/vpcaccess.deps b/external/googleapis/protodeps/vpcaccess.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/vpcaccess.deps +++ b/external/googleapis/protodeps/vpcaccess.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/webrisk.deps b/external/googleapis/protodeps/webrisk.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/webrisk.deps +++ b/external/googleapis/protodeps/webrisk.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/websecurityscanner.deps b/external/googleapis/protodeps/websecurityscanner.deps index 2e749051efbb4..5c7b273c6aea4 100644 --- a/external/googleapis/protodeps/websecurityscanner.deps +++ b/external/googleapis/protodeps/websecurityscanner.deps @@ -1,6 +1,7 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto +@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/rpc:status_proto diff --git a/external/googleapis/protodeps/workflows.deps b/external/googleapis/protodeps/workflows.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/workflows.deps +++ b/external/googleapis/protodeps/workflows.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/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/protodeps/workstations.deps b/external/googleapis/protodeps/workstations.deps index 6ef8f9ccdeb73..3a69eb58546e0 100644 --- a/external/googleapis/protodeps/workstations.deps +++ b/external/googleapis/protodeps/workstations.deps @@ -1,8 +1,8 @@ -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:http_proto -@com_google_googleapis//google/api:launch_stage_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto +@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/accessapproval.list b/external/googleapis/protolists/accessapproval.list index 5a99edaabd357..99843cd3e7c0f 100644 --- a/external/googleapis/protolists/accessapproval.list +++ b/external/googleapis/protolists/accessapproval.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/accessapproval/v1:accessapproval.proto +@googleapis//google/cloud/accessapproval/v1:accessapproval.proto diff --git a/external/googleapis/protolists/accesscontextmanager.list b/external/googleapis/protolists/accesscontextmanager.list index 525ee1e644d80..78eee05ee01ce 100644 --- a/external/googleapis/protolists/accesscontextmanager.list +++ b/external/googleapis/protolists/accesscontextmanager.list @@ -1,6 +1,6 @@ -@com_google_googleapis//google/identity/accesscontextmanager/type:device_resources.proto -@com_google_googleapis//google/identity/accesscontextmanager/v1:access_context_manager.proto -@com_google_googleapis//google/identity/accesscontextmanager/v1:access_level.proto -@com_google_googleapis//google/identity/accesscontextmanager/v1:access_policy.proto -@com_google_googleapis//google/identity/accesscontextmanager/v1:gcp_user_access_binding.proto -@com_google_googleapis//google/identity/accesscontextmanager/v1:service_perimeter.proto +@googleapis//google/identity/accesscontextmanager/type:device_resources.proto +@googleapis//google/identity/accesscontextmanager/v1:access_context_manager.proto +@googleapis//google/identity/accesscontextmanager/v1:access_level.proto +@googleapis//google/identity/accesscontextmanager/v1:access_policy.proto +@googleapis//google/identity/accesscontextmanager/v1:gcp_user_access_binding.proto +@googleapis//google/identity/accesscontextmanager/v1:service_perimeter.proto diff --git a/external/googleapis/protolists/advisorynotifications.list b/external/googleapis/protolists/advisorynotifications.list index 43db20b963bdd..aaea7387f3e11 100644 --- a/external/googleapis/protolists/advisorynotifications.list +++ b/external/googleapis/protolists/advisorynotifications.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/advisorynotifications/v1:service.proto +@googleapis//google/cloud/advisorynotifications/v1:service.proto diff --git a/external/googleapis/protolists/aiplatform.list b/external/googleapis/protolists/aiplatform.list index 11bb4ba69fa3b..668b04a4957f5 100644 --- a/external/googleapis/protolists/aiplatform.list +++ b/external/googleapis/protolists/aiplatform.list @@ -1,159 +1,161 @@ -@com_google_googleapis//google/cloud/aiplatform/logging:prediction.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/instance:image_classification.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/instance:image_object_detection.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/instance:image_segmentation.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/instance:text_classification.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/instance:text_extraction.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/instance:text_sentiment.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/instance:video_action_recognition.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/instance:video_classification.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/instance:video_object_tracking.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/params:image_classification.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/params:image_object_detection.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/params:image_segmentation.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/params:video_action_recognition.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/params:video_classification.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/params:video_object_tracking.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:classification.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:image_object_detection.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:image_segmentation.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:tabular_classification.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:tabular_regression.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:text_extraction.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:text_sentiment.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:video_action_recognition.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:video_classification.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:video_object_tracking.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_image_classification.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_image_object_detection.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_image_segmentation.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_tables.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_text_classification.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_text_extraction.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_text_sentiment.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_video_action_recognition.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_video_classification.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_video_object_tracking.proto -@com_google_googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:export_evaluated_data_items_config.proto -@com_google_googleapis//google/cloud/aiplatform/v1:accelerator_type.proto -@com_google_googleapis//google/cloud/aiplatform/v1:annotation.proto -@com_google_googleapis//google/cloud/aiplatform/v1:annotation_spec.proto -@com_google_googleapis//google/cloud/aiplatform/v1:api_auth.proto -@com_google_googleapis//google/cloud/aiplatform/v1:artifact.proto -@com_google_googleapis//google/cloud/aiplatform/v1:batch_prediction_job.proto -@com_google_googleapis//google/cloud/aiplatform/v1:cached_content.proto -@com_google_googleapis//google/cloud/aiplatform/v1:completion_stats.proto -@com_google_googleapis//google/cloud/aiplatform/v1:content.proto -@com_google_googleapis//google/cloud/aiplatform/v1:context.proto -@com_google_googleapis//google/cloud/aiplatform/v1:custom_job.proto -@com_google_googleapis//google/cloud/aiplatform/v1:data_foundry_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:data_item.proto -@com_google_googleapis//google/cloud/aiplatform/v1:data_labeling_job.proto -@com_google_googleapis//google/cloud/aiplatform/v1:dataset.proto -@com_google_googleapis//google/cloud/aiplatform/v1:dataset_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:dataset_version.proto -@com_google_googleapis//google/cloud/aiplatform/v1:deployed_index_ref.proto -@com_google_googleapis//google/cloud/aiplatform/v1:deployed_model_ref.proto -@com_google_googleapis//google/cloud/aiplatform/v1:deployment_resource_pool.proto -@com_google_googleapis//google/cloud/aiplatform/v1:deployment_resource_pool_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:deployment_stage.proto -@com_google_googleapis//google/cloud/aiplatform/v1:encryption_spec.proto -@com_google_googleapis//google/cloud/aiplatform/v1:endpoint.proto -@com_google_googleapis//google/cloud/aiplatform/v1:endpoint_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:entity_type.proto -@com_google_googleapis//google/cloud/aiplatform/v1:env_var.proto -@com_google_googleapis//google/cloud/aiplatform/v1:evaluated_annotation.proto -@com_google_googleapis//google/cloud/aiplatform/v1:evaluation_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:event.proto -@com_google_googleapis//google/cloud/aiplatform/v1:execution.proto -@com_google_googleapis//google/cloud/aiplatform/v1:explanation.proto -@com_google_googleapis//google/cloud/aiplatform/v1:explanation_metadata.proto -@com_google_googleapis//google/cloud/aiplatform/v1:feature.proto -@com_google_googleapis//google/cloud/aiplatform/v1:feature_group.proto -@com_google_googleapis//google/cloud/aiplatform/v1:feature_monitoring_stats.proto -@com_google_googleapis//google/cloud/aiplatform/v1:feature_online_store.proto -@com_google_googleapis//google/cloud/aiplatform/v1:feature_online_store_admin_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:feature_online_store_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:feature_registry_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:feature_selector.proto -@com_google_googleapis//google/cloud/aiplatform/v1:feature_view.proto -@com_google_googleapis//google/cloud/aiplatform/v1:feature_view_sync.proto -@com_google_googleapis//google/cloud/aiplatform/v1:featurestore.proto -@com_google_googleapis//google/cloud/aiplatform/v1:featurestore_monitoring.proto -@com_google_googleapis//google/cloud/aiplatform/v1:featurestore_online_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:featurestore_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:gen_ai_cache_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:genai_tuning_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:hyperparameter_tuning_job.proto -@com_google_googleapis//google/cloud/aiplatform/v1:index.proto -@com_google_googleapis//google/cloud/aiplatform/v1:index_endpoint.proto -@com_google_googleapis//google/cloud/aiplatform/v1:index_endpoint_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:index_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:io.proto -@com_google_googleapis//google/cloud/aiplatform/v1:job_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:job_state.proto -@com_google_googleapis//google/cloud/aiplatform/v1:lineage_subgraph.proto -@com_google_googleapis//google/cloud/aiplatform/v1:llm_utility_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:machine_resources.proto -@com_google_googleapis//google/cloud/aiplatform/v1:manual_batch_tuning_parameters.proto -@com_google_googleapis//google/cloud/aiplatform/v1:match_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:metadata_schema.proto -@com_google_googleapis//google/cloud/aiplatform/v1:metadata_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:metadata_store.proto -@com_google_googleapis//google/cloud/aiplatform/v1:migratable_resource.proto -@com_google_googleapis//google/cloud/aiplatform/v1:migration_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:model.proto -@com_google_googleapis//google/cloud/aiplatform/v1:model_deployment_monitoring_job.proto -@com_google_googleapis//google/cloud/aiplatform/v1:model_evaluation.proto -@com_google_googleapis//google/cloud/aiplatform/v1:model_evaluation_slice.proto -@com_google_googleapis//google/cloud/aiplatform/v1:model_garden_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:model_monitoring.proto -@com_google_googleapis//google/cloud/aiplatform/v1:model_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:nas_job.proto -@com_google_googleapis//google/cloud/aiplatform/v1:network_spec.proto -@com_google_googleapis//google/cloud/aiplatform/v1:notebook_euc_config.proto -@com_google_googleapis//google/cloud/aiplatform/v1:notebook_execution_job.proto -@com_google_googleapis//google/cloud/aiplatform/v1:notebook_idle_shutdown_config.proto -@com_google_googleapis//google/cloud/aiplatform/v1:notebook_runtime.proto -@com_google_googleapis//google/cloud/aiplatform/v1:notebook_runtime_template_ref.proto -@com_google_googleapis//google/cloud/aiplatform/v1:notebook_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:notebook_software_config.proto -@com_google_googleapis//google/cloud/aiplatform/v1:openapi.proto -@com_google_googleapis//google/cloud/aiplatform/v1:operation.proto -@com_google_googleapis//google/cloud/aiplatform/v1:persistent_resource.proto -@com_google_googleapis//google/cloud/aiplatform/v1:persistent_resource_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:pipeline_failure_policy.proto -@com_google_googleapis//google/cloud/aiplatform/v1:pipeline_job.proto -@com_google_googleapis//google/cloud/aiplatform/v1:pipeline_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:pipeline_state.proto -@com_google_googleapis//google/cloud/aiplatform/v1:prediction_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:publisher_model.proto -@com_google_googleapis//google/cloud/aiplatform/v1:reasoning_engine.proto -@com_google_googleapis//google/cloud/aiplatform/v1:reasoning_engine_execution_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:reasoning_engine_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:reservation_affinity.proto -@com_google_googleapis//google/cloud/aiplatform/v1:saved_query.proto -@com_google_googleapis//google/cloud/aiplatform/v1:schedule.proto -@com_google_googleapis//google/cloud/aiplatform/v1:schedule_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:service_networking.proto -@com_google_googleapis//google/cloud/aiplatform/v1:specialist_pool.proto -@com_google_googleapis//google/cloud/aiplatform/v1:specialist_pool_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:study.proto -@com_google_googleapis//google/cloud/aiplatform/v1:tensorboard.proto -@com_google_googleapis//google/cloud/aiplatform/v1:tensorboard_data.proto -@com_google_googleapis//google/cloud/aiplatform/v1:tensorboard_experiment.proto -@com_google_googleapis//google/cloud/aiplatform/v1:tensorboard_run.proto -@com_google_googleapis//google/cloud/aiplatform/v1:tensorboard_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:tensorboard_time_series.proto -@com_google_googleapis//google/cloud/aiplatform/v1:tool.proto -@com_google_googleapis//google/cloud/aiplatform/v1:training_pipeline.proto -@com_google_googleapis//google/cloud/aiplatform/v1:tuning_job.proto -@com_google_googleapis//google/cloud/aiplatform/v1:types.proto -@com_google_googleapis//google/cloud/aiplatform/v1:unmanaged_container_model.proto -@com_google_googleapis//google/cloud/aiplatform/v1:usage_metadata.proto -@com_google_googleapis//google/cloud/aiplatform/v1:user_action_reference.proto -@com_google_googleapis//google/cloud/aiplatform/v1:value.proto -@com_google_googleapis//google/cloud/aiplatform/v1:vertex_rag_data.proto -@com_google_googleapis//google/cloud/aiplatform/v1:vertex_rag_data_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:vertex_rag_service.proto -@com_google_googleapis//google/cloud/aiplatform/v1:vizier_service.proto +@googleapis//google/cloud/aiplatform/logging:prediction.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/instance:image_classification.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/instance:image_object_detection.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/instance:image_segmentation.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/instance:text_classification.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/instance:text_extraction.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/instance:text_sentiment.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/instance:video_action_recognition.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/instance:video_classification.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/instance:video_object_tracking.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/params:image_classification.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/params:image_object_detection.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/params:image_segmentation.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/params:video_action_recognition.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/params:video_classification.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/params:video_object_tracking.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:classification.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:image_object_detection.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:image_segmentation.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:tabular_classification.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:tabular_regression.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:text_extraction.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:text_sentiment.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:video_action_recognition.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:video_classification.proto +@googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:video_object_tracking.proto +@googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_image_classification.proto +@googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_image_object_detection.proto +@googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_image_segmentation.proto +@googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_tables.proto +@googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_text_classification.proto +@googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_text_extraction.proto +@googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_text_sentiment.proto +@googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_video_action_recognition.proto +@googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_video_classification.proto +@googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:automl_video_object_tracking.proto +@googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:export_evaluated_data_items_config.proto +@googleapis//google/cloud/aiplatform/v1:accelerator_type.proto +@googleapis//google/cloud/aiplatform/v1:annotation.proto +@googleapis//google/cloud/aiplatform/v1:annotation_spec.proto +@googleapis//google/cloud/aiplatform/v1:api_auth.proto +@googleapis//google/cloud/aiplatform/v1:artifact.proto +@googleapis//google/cloud/aiplatform/v1:batch_prediction_job.proto +@googleapis//google/cloud/aiplatform/v1:cached_content.proto +@googleapis//google/cloud/aiplatform/v1:completion_stats.proto +@googleapis//google/cloud/aiplatform/v1:content.proto +@googleapis//google/cloud/aiplatform/v1:context.proto +@googleapis//google/cloud/aiplatform/v1:custom_job.proto +@googleapis//google/cloud/aiplatform/v1:data_foundry_service.proto +@googleapis//google/cloud/aiplatform/v1:data_item.proto +@googleapis//google/cloud/aiplatform/v1:data_labeling_job.proto +@googleapis//google/cloud/aiplatform/v1:dataset.proto +@googleapis//google/cloud/aiplatform/v1:dataset_service.proto +@googleapis//google/cloud/aiplatform/v1:dataset_version.proto +@googleapis//google/cloud/aiplatform/v1:deployed_index_ref.proto +@googleapis//google/cloud/aiplatform/v1:deployed_model_ref.proto +@googleapis//google/cloud/aiplatform/v1:deployment_resource_pool.proto +@googleapis//google/cloud/aiplatform/v1:deployment_resource_pool_service.proto +@googleapis//google/cloud/aiplatform/v1:deployment_stage.proto +@googleapis//google/cloud/aiplatform/v1:encryption_spec.proto +@googleapis//google/cloud/aiplatform/v1:endpoint.proto +@googleapis//google/cloud/aiplatform/v1:endpoint_service.proto +@googleapis//google/cloud/aiplatform/v1:entity_type.proto +@googleapis//google/cloud/aiplatform/v1:env_var.proto +@googleapis//google/cloud/aiplatform/v1:evaluated_annotation.proto +@googleapis//google/cloud/aiplatform/v1:evaluation_service.proto +@googleapis//google/cloud/aiplatform/v1:event.proto +@googleapis//google/cloud/aiplatform/v1:execution.proto +@googleapis//google/cloud/aiplatform/v1:explanation.proto +@googleapis//google/cloud/aiplatform/v1:explanation_metadata.proto +@googleapis//google/cloud/aiplatform/v1:feature.proto +@googleapis//google/cloud/aiplatform/v1:feature_group.proto +@googleapis//google/cloud/aiplatform/v1:feature_monitoring_stats.proto +@googleapis//google/cloud/aiplatform/v1:feature_online_store.proto +@googleapis//google/cloud/aiplatform/v1:feature_online_store_admin_service.proto +@googleapis//google/cloud/aiplatform/v1:feature_online_store_service.proto +@googleapis//google/cloud/aiplatform/v1:feature_registry_service.proto +@googleapis//google/cloud/aiplatform/v1:feature_selector.proto +@googleapis//google/cloud/aiplatform/v1:feature_view.proto +@googleapis//google/cloud/aiplatform/v1:feature_view_sync.proto +@googleapis//google/cloud/aiplatform/v1:featurestore.proto +@googleapis//google/cloud/aiplatform/v1:featurestore_monitoring.proto +@googleapis//google/cloud/aiplatform/v1:featurestore_online_service.proto +@googleapis//google/cloud/aiplatform/v1:featurestore_service.proto +@googleapis//google/cloud/aiplatform/v1:gen_ai_cache_service.proto +@googleapis//google/cloud/aiplatform/v1:genai_tuning_service.proto +@googleapis//google/cloud/aiplatform/v1:hyperparameter_tuning_job.proto +@googleapis//google/cloud/aiplatform/v1:index.proto +@googleapis//google/cloud/aiplatform/v1:index_endpoint.proto +@googleapis//google/cloud/aiplatform/v1:index_endpoint_service.proto +@googleapis//google/cloud/aiplatform/v1:index_service.proto +@googleapis//google/cloud/aiplatform/v1:io.proto +@googleapis//google/cloud/aiplatform/v1:job_service.proto +@googleapis//google/cloud/aiplatform/v1:job_state.proto +@googleapis//google/cloud/aiplatform/v1:lineage_subgraph.proto +@googleapis//google/cloud/aiplatform/v1:llm_utility_service.proto +@googleapis//google/cloud/aiplatform/v1:machine_resources.proto +@googleapis//google/cloud/aiplatform/v1:manual_batch_tuning_parameters.proto +@googleapis//google/cloud/aiplatform/v1:match_service.proto +@googleapis//google/cloud/aiplatform/v1:metadata_schema.proto +@googleapis//google/cloud/aiplatform/v1:metadata_service.proto +@googleapis//google/cloud/aiplatform/v1:metadata_store.proto +@googleapis//google/cloud/aiplatform/v1:migratable_resource.proto +@googleapis//google/cloud/aiplatform/v1:migration_service.proto +@googleapis//google/cloud/aiplatform/v1:model.proto +@googleapis//google/cloud/aiplatform/v1:model_deployment_monitoring_job.proto +@googleapis//google/cloud/aiplatform/v1:model_evaluation.proto +@googleapis//google/cloud/aiplatform/v1:model_evaluation_slice.proto +@googleapis//google/cloud/aiplatform/v1:model_garden_service.proto +@googleapis//google/cloud/aiplatform/v1:model_monitoring.proto +@googleapis//google/cloud/aiplatform/v1:model_service.proto +@googleapis//google/cloud/aiplatform/v1:nas_job.proto +@googleapis//google/cloud/aiplatform/v1:network_spec.proto +@googleapis//google/cloud/aiplatform/v1:notebook_euc_config.proto +@googleapis//google/cloud/aiplatform/v1:notebook_execution_job.proto +@googleapis//google/cloud/aiplatform/v1:notebook_idle_shutdown_config.proto +@googleapis//google/cloud/aiplatform/v1:notebook_runtime.proto +@googleapis//google/cloud/aiplatform/v1:notebook_runtime_template_ref.proto +@googleapis//google/cloud/aiplatform/v1:notebook_service.proto +@googleapis//google/cloud/aiplatform/v1:notebook_software_config.proto +@googleapis//google/cloud/aiplatform/v1:openapi.proto +@googleapis//google/cloud/aiplatform/v1:operation.proto +@googleapis//google/cloud/aiplatform/v1:persistent_resource.proto +@googleapis//google/cloud/aiplatform/v1:persistent_resource_service.proto +@googleapis//google/cloud/aiplatform/v1:pipeline_failure_policy.proto +@googleapis//google/cloud/aiplatform/v1:pipeline_job.proto +@googleapis//google/cloud/aiplatform/v1:pipeline_service.proto +@googleapis//google/cloud/aiplatform/v1:pipeline_state.proto +@googleapis//google/cloud/aiplatform/v1:prediction_service.proto +@googleapis//google/cloud/aiplatform/v1:publisher_model.proto +@googleapis//google/cloud/aiplatform/v1:reasoning_engine.proto +@googleapis//google/cloud/aiplatform/v1:reasoning_engine_execution_service.proto +@googleapis//google/cloud/aiplatform/v1:reasoning_engine_service.proto +@googleapis//google/cloud/aiplatform/v1:reservation_affinity.proto +@googleapis//google/cloud/aiplatform/v1:saved_query.proto +@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 +@googleapis//google/cloud/aiplatform/v1:tensorboard.proto +@googleapis//google/cloud/aiplatform/v1:tensorboard_data.proto +@googleapis//google/cloud/aiplatform/v1:tensorboard_experiment.proto +@googleapis//google/cloud/aiplatform/v1:tensorboard_run.proto +@googleapis//google/cloud/aiplatform/v1:tensorboard_service.proto +@googleapis//google/cloud/aiplatform/v1:tensorboard_time_series.proto +@googleapis//google/cloud/aiplatform/v1:tool.proto +@googleapis//google/cloud/aiplatform/v1:training_pipeline.proto +@googleapis//google/cloud/aiplatform/v1:tuning_job.proto +@googleapis//google/cloud/aiplatform/v1:types.proto +@googleapis//google/cloud/aiplatform/v1:unmanaged_container_model.proto +@googleapis//google/cloud/aiplatform/v1:usage_metadata.proto +@googleapis//google/cloud/aiplatform/v1:user_action_reference.proto +@googleapis//google/cloud/aiplatform/v1:value.proto +@googleapis//google/cloud/aiplatform/v1:vertex_rag_data.proto +@googleapis//google/cloud/aiplatform/v1:vertex_rag_data_service.proto +@googleapis//google/cloud/aiplatform/v1:vertex_rag_service.proto +@googleapis//google/cloud/aiplatform/v1:vizier_service.proto diff --git a/external/googleapis/protolists/alloydb.list b/external/googleapis/protolists/alloydb.list index ba56b31936a46..bffc9babb8c6b 100644 --- a/external/googleapis/protolists/alloydb.list +++ b/external/googleapis/protolists/alloydb.list @@ -1,5 +1,5 @@ -@com_google_googleapis//google/cloud/alloydb/v1:csql_resources.proto -@com_google_googleapis//google/cloud/alloydb/v1:csql_service.proto -@com_google_googleapis//google/cloud/alloydb/v1:data_model.proto -@com_google_googleapis//google/cloud/alloydb/v1:resources.proto -@com_google_googleapis//google/cloud/alloydb/v1:service.proto +@googleapis//google/cloud/alloydb/v1:csql_resources.proto +@googleapis//google/cloud/alloydb/v1:csql_service.proto +@googleapis//google/cloud/alloydb/v1:data_model.proto +@googleapis//google/cloud/alloydb/v1:resources.proto +@googleapis//google/cloud/alloydb/v1:service.proto diff --git a/external/googleapis/protolists/apigateway.list b/external/googleapis/protolists/apigateway.list index 45ec3e32801f4..14440962c2dd2 100644 --- a/external/googleapis/protolists/apigateway.list +++ b/external/googleapis/protolists/apigateway.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/apigateway/v1:apigateway.proto -@com_google_googleapis//google/cloud/apigateway/v1:apigateway_service.proto +@googleapis//google/cloud/apigateway/v1:apigateway.proto +@googleapis//google/cloud/apigateway/v1:apigateway_service.proto diff --git a/external/googleapis/protolists/apigeeconnect.list b/external/googleapis/protolists/apigeeconnect.list index df09cb07d7e15..58e521d081404 100644 --- a/external/googleapis/protolists/apigeeconnect.list +++ b/external/googleapis/protolists/apigeeconnect.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/apigeeconnect/v1:connection.proto -@com_google_googleapis//google/cloud/apigeeconnect/v1:tether.proto +@googleapis//google/cloud/apigeeconnect/v1:connection.proto +@googleapis//google/cloud/apigeeconnect/v1:tether.proto diff --git a/external/googleapis/protolists/apikeys.list b/external/googleapis/protolists/apikeys.list index f8d04a268cb20..dcec62e504b39 100644 --- a/external/googleapis/protolists/apikeys.list +++ b/external/googleapis/protolists/apikeys.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/api/apikeys/v2:apikeys.proto -@com_google_googleapis//google/api/apikeys/v2:resources.proto +@googleapis//google/api/apikeys/v2:apikeys.proto +@googleapis//google/api/apikeys/v2:resources.proto diff --git a/external/googleapis/protolists/apiregistry.list b/external/googleapis/protolists/apiregistry.list index 6470878934037..ca575abf9dba6 100644 --- a/external/googleapis/protolists/apiregistry.list +++ b/external/googleapis/protolists/apiregistry.list @@ -1,3 +1,3 @@ -@com_google_googleapis//google/cloud/apiregistry/v1:common.proto -@com_google_googleapis//google/cloud/apiregistry/v1:resources.proto -@com_google_googleapis//google/cloud/apiregistry/v1:service.proto +@googleapis//google/cloud/apiregistry/v1:common.proto +@googleapis//google/cloud/apiregistry/v1:resources.proto +@googleapis//google/cloud/apiregistry/v1:service.proto diff --git a/external/googleapis/protolists/appengine.list b/external/googleapis/protolists/appengine.list index 251ea26f4e5c8..516ec196250c4 100644 --- a/external/googleapis/protolists/appengine.list +++ b/external/googleapis/protolists/appengine.list @@ -1,18 +1,18 @@ -@com_google_googleapis//google/appengine/legacy:audit_data.proto -@com_google_googleapis//google/appengine/logging/v1:request_log.proto -@com_google_googleapis//google/appengine/v1:app_yaml.proto -@com_google_googleapis//google/appengine/v1:appengine.proto -@com_google_googleapis//google/appengine/v1:application.proto -@com_google_googleapis//google/appengine/v1:audit_data.proto -@com_google_googleapis//google/appengine/v1:certificate.proto -@com_google_googleapis//google/appengine/v1:deploy.proto -@com_google_googleapis//google/appengine/v1:deployed_files.proto -@com_google_googleapis//google/appengine/v1:domain.proto -@com_google_googleapis//google/appengine/v1:domain_mapping.proto -@com_google_googleapis//google/appengine/v1:firewall.proto -@com_google_googleapis//google/appengine/v1:instance.proto -@com_google_googleapis//google/appengine/v1:location.proto -@com_google_googleapis//google/appengine/v1:network_settings.proto -@com_google_googleapis//google/appengine/v1:operation.proto -@com_google_googleapis//google/appengine/v1:service.proto -@com_google_googleapis//google/appengine/v1:version.proto +@googleapis//google/appengine/legacy:audit_data.proto +@googleapis//google/appengine/logging/v1:request_log.proto +@googleapis//google/appengine/v1:app_yaml.proto +@googleapis//google/appengine/v1:appengine.proto +@googleapis//google/appengine/v1:application.proto +@googleapis//google/appengine/v1:audit_data.proto +@googleapis//google/appengine/v1:certificate.proto +@googleapis//google/appengine/v1:deploy.proto +@googleapis//google/appengine/v1:deployed_files.proto +@googleapis//google/appengine/v1:domain.proto +@googleapis//google/appengine/v1:domain_mapping.proto +@googleapis//google/appengine/v1:firewall.proto +@googleapis//google/appengine/v1:instance.proto +@googleapis//google/appengine/v1:location.proto +@googleapis//google/appengine/v1:network_settings.proto +@googleapis//google/appengine/v1:operation.proto +@googleapis//google/appengine/v1:service.proto +@googleapis//google/appengine/v1:version.proto diff --git a/external/googleapis/protolists/apphub.list b/external/googleapis/protolists/apphub.list index 6dc02c5da7f60..aba5a64493d7d 100644 --- a/external/googleapis/protolists/apphub.list +++ b/external/googleapis/protolists/apphub.list @@ -1,6 +1,6 @@ -@com_google_googleapis//google/cloud/apphub/v1:apphub_service.proto -@com_google_googleapis//google/cloud/apphub/v1:application.proto -@com_google_googleapis//google/cloud/apphub/v1:attributes.proto -@com_google_googleapis//google/cloud/apphub/v1:service.proto -@com_google_googleapis//google/cloud/apphub/v1:service_project_attachment.proto -@com_google_googleapis//google/cloud/apphub/v1:workload.proto +@googleapis//google/cloud/apphub/v1:apphub_service.proto +@googleapis//google/cloud/apphub/v1:application.proto +@googleapis//google/cloud/apphub/v1:attributes.proto +@googleapis//google/cloud/apphub/v1:service.proto +@googleapis//google/cloud/apphub/v1:service_project_attachment.proto +@googleapis//google/cloud/apphub/v1:workload.proto diff --git a/external/googleapis/protolists/artifactregistry.list b/external/googleapis/protolists/artifactregistry.list index 78b0bbb95740b..6d9b4ea2b6361 100644 --- a/external/googleapis/protolists/artifactregistry.list +++ b/external/googleapis/protolists/artifactregistry.list @@ -1,17 +1,17 @@ -@com_google_googleapis//google/devtools/artifactregistry/v1:apt_artifact.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:artifact.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:attachment.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:export.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:file.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:generic.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:go.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:kfp_artifact.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:package.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:repository.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:rule.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:service.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:settings.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:tag.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:version.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:vpcsc_config.proto -@com_google_googleapis//google/devtools/artifactregistry/v1:yum_artifact.proto +@googleapis//google/devtools/artifactregistry/v1:apt_artifact.proto +@googleapis//google/devtools/artifactregistry/v1:artifact.proto +@googleapis//google/devtools/artifactregistry/v1:attachment.proto +@googleapis//google/devtools/artifactregistry/v1:export.proto +@googleapis//google/devtools/artifactregistry/v1:file.proto +@googleapis//google/devtools/artifactregistry/v1:generic.proto +@googleapis//google/devtools/artifactregistry/v1:go.proto +@googleapis//google/devtools/artifactregistry/v1:kfp_artifact.proto +@googleapis//google/devtools/artifactregistry/v1:package.proto +@googleapis//google/devtools/artifactregistry/v1:repository.proto +@googleapis//google/devtools/artifactregistry/v1:rule.proto +@googleapis//google/devtools/artifactregistry/v1:service.proto +@googleapis//google/devtools/artifactregistry/v1:settings.proto +@googleapis//google/devtools/artifactregistry/v1:tag.proto +@googleapis//google/devtools/artifactregistry/v1:version.proto +@googleapis//google/devtools/artifactregistry/v1:vpcsc_config.proto +@googleapis//google/devtools/artifactregistry/v1:yum_artifact.proto diff --git a/external/googleapis/protolists/asset.list b/external/googleapis/protolists/asset.list index 4ff0d00333e7d..80d6e2ac1b51a 100644 --- a/external/googleapis/protolists/asset.list +++ b/external/googleapis/protolists/asset.list @@ -1,3 +1,3 @@ -@com_google_googleapis//google/cloud/asset/v1:asset_enrichment_resourceowners.proto -@com_google_googleapis//google/cloud/asset/v1:asset_service.proto -@com_google_googleapis//google/cloud/asset/v1:assets.proto +@googleapis//google/cloud/asset/v1:asset_enrichment_resourceowners.proto +@googleapis//google/cloud/asset/v1:asset_service.proto +@googleapis//google/cloud/asset/v1:assets.proto diff --git a/external/googleapis/protolists/assuredworkloads.list b/external/googleapis/protolists/assuredworkloads.list index df25c7e857683..a121c3154f8ed 100644 --- a/external/googleapis/protolists/assuredworkloads.list +++ b/external/googleapis/protolists/assuredworkloads.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/assuredworkloads/v1:assuredworkloads.proto +@googleapis//google/cloud/assuredworkloads/v1:assuredworkloads.proto diff --git a/external/googleapis/protolists/auditmanager.list b/external/googleapis/protolists/auditmanager.list index b3b99d045599d..fad3cb6d5e34a 100644 --- a/external/googleapis/protolists/auditmanager.list +++ b/external/googleapis/protolists/auditmanager.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/auditmanager/v1:auditmanager.proto +@googleapis//google/cloud/auditmanager/v1:auditmanager.proto diff --git a/external/googleapis/protolists/automl.list b/external/googleapis/protolists/automl.list index 8cf18d3f86de7..b07ce43626863 100644 --- a/external/googleapis/protolists/automl.list +++ b/external/googleapis/protolists/automl.list @@ -1,19 +1,19 @@ -@com_google_googleapis//google/cloud/automl/v1:annotation_payload.proto -@com_google_googleapis//google/cloud/automl/v1:annotation_spec.proto -@com_google_googleapis//google/cloud/automl/v1:classification.proto -@com_google_googleapis//google/cloud/automl/v1:data_items.proto -@com_google_googleapis//google/cloud/automl/v1:dataset.proto -@com_google_googleapis//google/cloud/automl/v1:detection.proto -@com_google_googleapis//google/cloud/automl/v1:geometry.proto -@com_google_googleapis//google/cloud/automl/v1:image.proto -@com_google_googleapis//google/cloud/automl/v1:io.proto -@com_google_googleapis//google/cloud/automl/v1:model.proto -@com_google_googleapis//google/cloud/automl/v1:model_evaluation.proto -@com_google_googleapis//google/cloud/automl/v1:operations.proto -@com_google_googleapis//google/cloud/automl/v1:prediction_service.proto -@com_google_googleapis//google/cloud/automl/v1:service.proto -@com_google_googleapis//google/cloud/automl/v1:text.proto -@com_google_googleapis//google/cloud/automl/v1:text_extraction.proto -@com_google_googleapis//google/cloud/automl/v1:text_segment.proto -@com_google_googleapis//google/cloud/automl/v1:text_sentiment.proto -@com_google_googleapis//google/cloud/automl/v1:translation.proto +@googleapis//google/cloud/automl/v1:annotation_payload.proto +@googleapis//google/cloud/automl/v1:annotation_spec.proto +@googleapis//google/cloud/automl/v1:classification.proto +@googleapis//google/cloud/automl/v1:data_items.proto +@googleapis//google/cloud/automl/v1:dataset.proto +@googleapis//google/cloud/automl/v1:detection.proto +@googleapis//google/cloud/automl/v1:geometry.proto +@googleapis//google/cloud/automl/v1:image.proto +@googleapis//google/cloud/automl/v1:io.proto +@googleapis//google/cloud/automl/v1:model.proto +@googleapis//google/cloud/automl/v1:model_evaluation.proto +@googleapis//google/cloud/automl/v1:operations.proto +@googleapis//google/cloud/automl/v1:prediction_service.proto +@googleapis//google/cloud/automl/v1:service.proto +@googleapis//google/cloud/automl/v1:text.proto +@googleapis//google/cloud/automl/v1:text_extraction.proto +@googleapis//google/cloud/automl/v1:text_segment.proto +@googleapis//google/cloud/automl/v1:text_sentiment.proto +@googleapis//google/cloud/automl/v1:translation.proto diff --git a/external/googleapis/protolists/backupdr.list b/external/googleapis/protolists/backupdr.list index 05924108c54f1..5bfa09f28b558 100644 --- a/external/googleapis/protolists/backupdr.list +++ b/external/googleapis/protolists/backupdr.list @@ -1,14 +1,14 @@ -@com_google_googleapis//google/cloud/backupdr/logging/v1:bdr_log.proto -@com_google_googleapis//google/cloud/backupdr/logging/v1:eventlog.proto -@com_google_googleapis//google/cloud/backupdr/logging/v1:reportlog.proto -@com_google_googleapis//google/cloud/backupdr/v1:backupdr.proto -@com_google_googleapis//google/cloud/backupdr/v1:backupplan.proto -@com_google_googleapis//google/cloud/backupdr/v1:backupplanassociation.proto -@com_google_googleapis//google/cloud/backupdr/v1:backupvault.proto -@com_google_googleapis//google/cloud/backupdr/v1:backupvault_alloydb.proto -@com_google_googleapis//google/cloud/backupdr/v1:backupvault_ba.proto -@com_google_googleapis//google/cloud/backupdr/v1:backupvault_cloudsql.proto -@com_google_googleapis//google/cloud/backupdr/v1:backupvault_disk.proto -@com_google_googleapis//google/cloud/backupdr/v1:backupvault_gce.proto -@com_google_googleapis//google/cloud/backupdr/v1:datasourcereference.proto -@com_google_googleapis//google/cloud/backupdr/v1:protection_summary.proto +@googleapis//google/cloud/backupdr/logging/v1:bdr_log.proto +@googleapis//google/cloud/backupdr/logging/v1:eventlog.proto +@googleapis//google/cloud/backupdr/logging/v1:reportlog.proto +@googleapis//google/cloud/backupdr/v1:backupdr.proto +@googleapis//google/cloud/backupdr/v1:backupplan.proto +@googleapis//google/cloud/backupdr/v1:backupplanassociation.proto +@googleapis//google/cloud/backupdr/v1:backupvault.proto +@googleapis//google/cloud/backupdr/v1:backupvault_alloydb.proto +@googleapis//google/cloud/backupdr/v1:backupvault_ba.proto +@googleapis//google/cloud/backupdr/v1:backupvault_cloudsql.proto +@googleapis//google/cloud/backupdr/v1:backupvault_disk.proto +@googleapis//google/cloud/backupdr/v1:backupvault_gce.proto +@googleapis//google/cloud/backupdr/v1:datasourcereference.proto +@googleapis//google/cloud/backupdr/v1:protection_summary.proto diff --git a/external/googleapis/protolists/baremetalsolution.list b/external/googleapis/protolists/baremetalsolution.list index d4f8031e3af14..e0db0788073d7 100644 --- a/external/googleapis/protolists/baremetalsolution.list +++ b/external/googleapis/protolists/baremetalsolution.list @@ -1,11 +1,11 @@ -@com_google_googleapis//google/cloud/baremetalsolution/v2:baremetalsolution.proto -@com_google_googleapis//google/cloud/baremetalsolution/v2:common.proto -@com_google_googleapis//google/cloud/baremetalsolution/v2:instance.proto -@com_google_googleapis//google/cloud/baremetalsolution/v2:lun.proto -@com_google_googleapis//google/cloud/baremetalsolution/v2:network.proto -@com_google_googleapis//google/cloud/baremetalsolution/v2:nfs_share.proto -@com_google_googleapis//google/cloud/baremetalsolution/v2:osimage.proto -@com_google_googleapis//google/cloud/baremetalsolution/v2:provisioning.proto -@com_google_googleapis//google/cloud/baremetalsolution/v2:ssh_key.proto -@com_google_googleapis//google/cloud/baremetalsolution/v2:volume.proto -@com_google_googleapis//google/cloud/baremetalsolution/v2:volume_snapshot.proto +@googleapis//google/cloud/baremetalsolution/v2:baremetalsolution.proto +@googleapis//google/cloud/baremetalsolution/v2:common.proto +@googleapis//google/cloud/baremetalsolution/v2:instance.proto +@googleapis//google/cloud/baremetalsolution/v2:lun.proto +@googleapis//google/cloud/baremetalsolution/v2:network.proto +@googleapis//google/cloud/baremetalsolution/v2:nfs_share.proto +@googleapis//google/cloud/baremetalsolution/v2:osimage.proto +@googleapis//google/cloud/baremetalsolution/v2:provisioning.proto +@googleapis//google/cloud/baremetalsolution/v2:ssh_key.proto +@googleapis//google/cloud/baremetalsolution/v2:volume.proto +@googleapis//google/cloud/baremetalsolution/v2:volume_snapshot.proto diff --git a/external/googleapis/protolists/batch.list b/external/googleapis/protolists/batch.list index 8e615a6b74a8e..368ec70f8a92a 100644 --- a/external/googleapis/protolists/batch.list +++ b/external/googleapis/protolists/batch.list @@ -1,4 +1,4 @@ -@com_google_googleapis//google/cloud/batch/v1:batch.proto -@com_google_googleapis//google/cloud/batch/v1:job.proto -@com_google_googleapis//google/cloud/batch/v1:task.proto -@com_google_googleapis//google/cloud/batch/v1:volume.proto +@googleapis//google/cloud/batch/v1:batch.proto +@googleapis//google/cloud/batch/v1:job.proto +@googleapis//google/cloud/batch/v1:task.proto +@googleapis//google/cloud/batch/v1:volume.proto diff --git a/external/googleapis/protolists/beyondcorp.list b/external/googleapis/protolists/beyondcorp.list index 10748ee775e2c..d4446e7f910bf 100644 --- a/external/googleapis/protolists/beyondcorp.list +++ b/external/googleapis/protolists/beyondcorp.list @@ -1,5 +1,5 @@ -@com_google_googleapis//google/cloud/beyondcorp/appconnections/v1:app_connections_service.proto -@com_google_googleapis//google/cloud/beyondcorp/appconnectors/v1:app_connector_instance_config.proto -@com_google_googleapis//google/cloud/beyondcorp/appconnectors/v1:app_connectors_service.proto -@com_google_googleapis//google/cloud/beyondcorp/appconnectors/v1:resource_info.proto -@com_google_googleapis//google/cloud/beyondcorp/appgateways/v1:app_gateways_service.proto +@googleapis//google/cloud/beyondcorp/appconnections/v1:app_connections_service.proto +@googleapis//google/cloud/beyondcorp/appconnectors/v1:app_connector_instance_config.proto +@googleapis//google/cloud/beyondcorp/appconnectors/v1:app_connectors_service.proto +@googleapis//google/cloud/beyondcorp/appconnectors/v1:resource_info.proto +@googleapis//google/cloud/beyondcorp/appgateways/v1:app_gateways_service.proto diff --git a/external/googleapis/protolists/bigquery.list b/external/googleapis/protolists/bigquery.list index ff1e1fee59832..698330da6e199 100644 --- a/external/googleapis/protolists/bigquery.list +++ b/external/googleapis/protolists/bigquery.list @@ -1,25 +1,25 @@ -@com_google_googleapis//google/cloud/bigquery/analyticshub/v1:analyticshub.proto -@com_google_googleapis//google/cloud/bigquery/analyticshub/v1:pubsub.proto -@com_google_googleapis//google/cloud/bigquery/biglake/v1:metastore.proto -@com_google_googleapis//google/cloud/bigquery/connection/v1:connection.proto -@com_google_googleapis//google/cloud/bigquery/datapolicies/v1:datapolicy.proto -@com_google_googleapis//google/cloud/bigquery/datapolicies/v2:datapolicy.proto -@com_google_googleapis//google/cloud/bigquery/datatransfer/v1:datatransfer.proto -@com_google_googleapis//google/cloud/bigquery/datatransfer/v1:transfer.proto -@com_google_googleapis//google/cloud/bigquery/logging/v1:audit_data.proto -@com_google_googleapis//google/cloud/bigquery/migration/v2:migration_entities.proto -@com_google_googleapis//google/cloud/bigquery/migration/v2:migration_error_details.proto -@com_google_googleapis//google/cloud/bigquery/migration/v2:migration_metrics.proto -@com_google_googleapis//google/cloud/bigquery/migration/v2:migration_service.proto -@com_google_googleapis//google/cloud/bigquery/migration/v2:translation_config.proto -@com_google_googleapis//google/cloud/bigquery/migration/v2:translation_details.proto -@com_google_googleapis//google/cloud/bigquery/migration/v2:translation_suggestion.proto -@com_google_googleapis//google/cloud/bigquery/migration/v2:translation_usability.proto -@com_google_googleapis//google/cloud/bigquery/reservation/v1:reservation.proto -@com_google_googleapis//google/cloud/bigquery/storage/v1:annotations.proto -@com_google_googleapis//google/cloud/bigquery/storage/v1:arrow.proto -@com_google_googleapis//google/cloud/bigquery/storage/v1:avro.proto -@com_google_googleapis//google/cloud/bigquery/storage/v1:protobuf.proto -@com_google_googleapis//google/cloud/bigquery/storage/v1:storage.proto -@com_google_googleapis//google/cloud/bigquery/storage/v1:stream.proto -@com_google_googleapis//google/cloud/bigquery/storage/v1:table.proto +@googleapis//google/cloud/bigquery/analyticshub/v1:analyticshub.proto +@googleapis//google/cloud/bigquery/analyticshub/v1:pubsub.proto +@googleapis//google/cloud/bigquery/biglake/v1:metastore.proto +@googleapis//google/cloud/bigquery/connection/v1:connection.proto +@googleapis//google/cloud/bigquery/datapolicies/v1:datapolicy.proto +@googleapis//google/cloud/bigquery/datapolicies/v2:datapolicy.proto +@googleapis//google/cloud/bigquery/datatransfer/v1:datatransfer.proto +@googleapis//google/cloud/bigquery/datatransfer/v1:transfer.proto +@googleapis//google/cloud/bigquery/logging/v1:audit_data.proto +@googleapis//google/cloud/bigquery/migration/v2:migration_entities.proto +@googleapis//google/cloud/bigquery/migration/v2:migration_error_details.proto +@googleapis//google/cloud/bigquery/migration/v2:migration_metrics.proto +@googleapis//google/cloud/bigquery/migration/v2:migration_service.proto +@googleapis//google/cloud/bigquery/migration/v2:translation_config.proto +@googleapis//google/cloud/bigquery/migration/v2:translation_details.proto +@googleapis//google/cloud/bigquery/migration/v2:translation_suggestion.proto +@googleapis//google/cloud/bigquery/migration/v2:translation_usability.proto +@googleapis//google/cloud/bigquery/reservation/v1:reservation.proto +@googleapis//google/cloud/bigquery/storage/v1:annotations.proto +@googleapis//google/cloud/bigquery/storage/v1:arrow.proto +@googleapis//google/cloud/bigquery/storage/v1:avro.proto +@googleapis//google/cloud/bigquery/storage/v1:protobuf.proto +@googleapis//google/cloud/bigquery/storage/v1:storage.proto +@googleapis//google/cloud/bigquery/storage/v1:stream.proto +@googleapis//google/cloud/bigquery/storage/v1:table.proto diff --git a/external/googleapis/protolists/bigquerycontrol.list b/external/googleapis/protolists/bigquerycontrol.list index a63307013bf8c..24283eeabae6e 100644 --- a/external/googleapis/protolists/bigquerycontrol.list +++ b/external/googleapis/protolists/bigquerycontrol.list @@ -1,45 +1,45 @@ -@com_google_googleapis//google/cloud/bigquery/v2:biglake_config.proto -@com_google_googleapis//google/cloud/bigquery/v2:clustering.proto -@com_google_googleapis//google/cloud/bigquery/v2:data_format_options.proto -@com_google_googleapis//google/cloud/bigquery/v2:dataset.proto -@com_google_googleapis//google/cloud/bigquery/v2:dataset_reference.proto -@com_google_googleapis//google/cloud/bigquery/v2:decimal_target_types.proto -@com_google_googleapis//google/cloud/bigquery/v2:encryption_config.proto -@com_google_googleapis//google/cloud/bigquery/v2:error.proto -@com_google_googleapis//google/cloud/bigquery/v2:external_catalog_dataset_options.proto -@com_google_googleapis//google/cloud/bigquery/v2:external_catalog_table_options.proto -@com_google_googleapis//google/cloud/bigquery/v2:external_data_config.proto -@com_google_googleapis//google/cloud/bigquery/v2:external_dataset_reference.proto -@com_google_googleapis//google/cloud/bigquery/v2:file_set_specification_type.proto -@com_google_googleapis//google/cloud/bigquery/v2:hive_partitioning.proto -@com_google_googleapis//google/cloud/bigquery/v2:job.proto -@com_google_googleapis//google/cloud/bigquery/v2:job_config.proto -@com_google_googleapis//google/cloud/bigquery/v2:job_creation_reason.proto -@com_google_googleapis//google/cloud/bigquery/v2:job_reference.proto -@com_google_googleapis//google/cloud/bigquery/v2:job_stats.proto -@com_google_googleapis//google/cloud/bigquery/v2:job_status.proto -@com_google_googleapis//google/cloud/bigquery/v2:json_extension.proto -@com_google_googleapis//google/cloud/bigquery/v2:location_metadata.proto -@com_google_googleapis//google/cloud/bigquery/v2:managed_table_type.proto -@com_google_googleapis//google/cloud/bigquery/v2:map_target_type.proto -@com_google_googleapis//google/cloud/bigquery/v2:model.proto -@com_google_googleapis//google/cloud/bigquery/v2:model_reference.proto -@com_google_googleapis//google/cloud/bigquery/v2:partitioning_definition.proto -@com_google_googleapis//google/cloud/bigquery/v2:privacy_policy.proto -@com_google_googleapis//google/cloud/bigquery/v2:project.proto -@com_google_googleapis//google/cloud/bigquery/v2:query_parameter.proto -@com_google_googleapis//google/cloud/bigquery/v2:range_partitioning.proto -@com_google_googleapis//google/cloud/bigquery/v2:restriction_config.proto -@com_google_googleapis//google/cloud/bigquery/v2:routine.proto -@com_google_googleapis//google/cloud/bigquery/v2:routine_reference.proto -@com_google_googleapis//google/cloud/bigquery/v2:row_access_policy.proto -@com_google_googleapis//google/cloud/bigquery/v2:row_access_policy_reference.proto -@com_google_googleapis//google/cloud/bigquery/v2:session_info.proto -@com_google_googleapis//google/cloud/bigquery/v2:standard_sql.proto -@com_google_googleapis//google/cloud/bigquery/v2:system_variable.proto -@com_google_googleapis//google/cloud/bigquery/v2:table.proto -@com_google_googleapis//google/cloud/bigquery/v2:table_constraints.proto -@com_google_googleapis//google/cloud/bigquery/v2:table_reference.proto -@com_google_googleapis//google/cloud/bigquery/v2:table_schema.proto -@com_google_googleapis//google/cloud/bigquery/v2:time_partitioning.proto -@com_google_googleapis//google/cloud/bigquery/v2:udf_resource.proto +@googleapis//google/cloud/bigquery/v2:biglake_config.proto +@googleapis//google/cloud/bigquery/v2:clustering.proto +@googleapis//google/cloud/bigquery/v2:data_format_options.proto +@googleapis//google/cloud/bigquery/v2:dataset.proto +@googleapis//google/cloud/bigquery/v2:dataset_reference.proto +@googleapis//google/cloud/bigquery/v2:decimal_target_types.proto +@googleapis//google/cloud/bigquery/v2:encryption_config.proto +@googleapis//google/cloud/bigquery/v2:error.proto +@googleapis//google/cloud/bigquery/v2:external_catalog_dataset_options.proto +@googleapis//google/cloud/bigquery/v2:external_catalog_table_options.proto +@googleapis//google/cloud/bigquery/v2:external_data_config.proto +@googleapis//google/cloud/bigquery/v2:external_dataset_reference.proto +@googleapis//google/cloud/bigquery/v2:file_set_specification_type.proto +@googleapis//google/cloud/bigquery/v2:hive_partitioning.proto +@googleapis//google/cloud/bigquery/v2:job.proto +@googleapis//google/cloud/bigquery/v2:job_config.proto +@googleapis//google/cloud/bigquery/v2:job_creation_reason.proto +@googleapis//google/cloud/bigquery/v2:job_reference.proto +@googleapis//google/cloud/bigquery/v2:job_stats.proto +@googleapis//google/cloud/bigquery/v2:job_status.proto +@googleapis//google/cloud/bigquery/v2:json_extension.proto +@googleapis//google/cloud/bigquery/v2:location_metadata.proto +@googleapis//google/cloud/bigquery/v2:managed_table_type.proto +@googleapis//google/cloud/bigquery/v2:map_target_type.proto +@googleapis//google/cloud/bigquery/v2:model.proto +@googleapis//google/cloud/bigquery/v2:model_reference.proto +@googleapis//google/cloud/bigquery/v2:partitioning_definition.proto +@googleapis//google/cloud/bigquery/v2:privacy_policy.proto +@googleapis//google/cloud/bigquery/v2:project.proto +@googleapis//google/cloud/bigquery/v2:query_parameter.proto +@googleapis//google/cloud/bigquery/v2:range_partitioning.proto +@googleapis//google/cloud/bigquery/v2:restriction_config.proto +@googleapis//google/cloud/bigquery/v2:routine.proto +@googleapis//google/cloud/bigquery/v2:routine_reference.proto +@googleapis//google/cloud/bigquery/v2:row_access_policy.proto +@googleapis//google/cloud/bigquery/v2:row_access_policy_reference.proto +@googleapis//google/cloud/bigquery/v2:session_info.proto +@googleapis//google/cloud/bigquery/v2:standard_sql.proto +@googleapis//google/cloud/bigquery/v2:system_variable.proto +@googleapis//google/cloud/bigquery/v2:table.proto +@googleapis//google/cloud/bigquery/v2:table_constraints.proto +@googleapis//google/cloud/bigquery/v2:table_reference.proto +@googleapis//google/cloud/bigquery/v2:table_schema.proto +@googleapis//google/cloud/bigquery/v2:time_partitioning.proto +@googleapis//google/cloud/bigquery/v2:udf_resource.proto diff --git a/external/googleapis/protolists/bigtable.list b/external/googleapis/protolists/bigtable.list index 04cbd7ae40fe2..11a5e6f60c84f 100644 --- a/external/googleapis/protolists/bigtable.list +++ b/external/googleapis/protolists/bigtable.list @@ -1,13 +1,13 @@ -@com_google_googleapis//google/bigtable/admin/v2:bigtable_instance_admin.proto -@com_google_googleapis//google/bigtable/admin/v2:bigtable_table_admin.proto -@com_google_googleapis//google/bigtable/admin/v2:common.proto -@com_google_googleapis//google/bigtable/admin/v2:instance.proto -@com_google_googleapis//google/bigtable/admin/v2:table.proto -@com_google_googleapis//google/bigtable/admin/v2:types.proto -@com_google_googleapis//google/bigtable/v2:bigtable.proto -@com_google_googleapis//google/bigtable/v2:data.proto -@com_google_googleapis//google/bigtable/v2:feature_flags.proto -@com_google_googleapis//google/bigtable/v2:peer_info.proto -@com_google_googleapis//google/bigtable/v2:request_stats.proto -@com_google_googleapis//google/bigtable/v2:response_params.proto -@com_google_googleapis//google/bigtable/v2:types.proto +@googleapis//google/bigtable/admin/v2:bigtable_instance_admin.proto +@googleapis//google/bigtable/admin/v2:bigtable_table_admin.proto +@googleapis//google/bigtable/admin/v2:common.proto +@googleapis//google/bigtable/admin/v2:instance.proto +@googleapis//google/bigtable/admin/v2:table.proto +@googleapis//google/bigtable/admin/v2:types.proto +@googleapis//google/bigtable/v2:bigtable.proto +@googleapis//google/bigtable/v2:data.proto +@googleapis//google/bigtable/v2:feature_flags.proto +@googleapis//google/bigtable/v2:peer_info.proto +@googleapis//google/bigtable/v2:request_stats.proto +@googleapis//google/bigtable/v2:response_params.proto +@googleapis//google/bigtable/v2:types.proto diff --git a/external/googleapis/protolists/billing.list b/external/googleapis/protolists/billing.list index 4af71adda7eae..cbf0ce79640cf 100644 --- a/external/googleapis/protolists/billing.list +++ b/external/googleapis/protolists/billing.list @@ -1,4 +1,4 @@ -@com_google_googleapis//google/cloud/billing/budgets/v1:budget_model.proto -@com_google_googleapis//google/cloud/billing/budgets/v1:budget_service.proto -@com_google_googleapis//google/cloud/billing/v1:cloud_billing.proto -@com_google_googleapis//google/cloud/billing/v1:cloud_catalog.proto +@googleapis//google/cloud/billing/budgets/v1:budget_model.proto +@googleapis//google/cloud/billing/budgets/v1:budget_service.proto +@googleapis//google/cloud/billing/v1:cloud_billing.proto +@googleapis//google/cloud/billing/v1:cloud_catalog.proto diff --git a/external/googleapis/protolists/binaryauthorization.list b/external/googleapis/protolists/binaryauthorization.list index 41f5317c7311b..8d26c8c896bdc 100644 --- a/external/googleapis/protolists/binaryauthorization.list +++ b/external/googleapis/protolists/binaryauthorization.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/binaryauthorization/v1:resources.proto -@com_google_googleapis//google/cloud/binaryauthorization/v1:service.proto +@googleapis//google/cloud/binaryauthorization/v1:resources.proto +@googleapis//google/cloud/binaryauthorization/v1:service.proto diff --git a/external/googleapis/protolists/certificatemanager.list b/external/googleapis/protolists/certificatemanager.list index d11935b471f25..48ca808eede2c 100644 --- a/external/googleapis/protolists/certificatemanager.list +++ b/external/googleapis/protolists/certificatemanager.list @@ -1,4 +1,4 @@ -@com_google_googleapis//google/cloud/certificatemanager/logging/v1:logs.proto -@com_google_googleapis//google/cloud/certificatemanager/v1:certificate_issuance_config.proto -@com_google_googleapis//google/cloud/certificatemanager/v1:certificate_manager.proto -@com_google_googleapis//google/cloud/certificatemanager/v1:trust_config.proto +@googleapis//google/cloud/certificatemanager/logging/v1:logs.proto +@googleapis//google/cloud/certificatemanager/v1:certificate_issuance_config.proto +@googleapis//google/cloud/certificatemanager/v1:certificate_manager.proto +@googleapis//google/cloud/certificatemanager/v1:trust_config.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/channel.list b/external/googleapis/protolists/channel.list index 919472ea6530f..4f766a7eb934f 100644 --- a/external/googleapis/protolists/channel.list +++ b/external/googleapis/protolists/channel.list @@ -1,13 +1,13 @@ -@com_google_googleapis//google/cloud/channel/v1:billing_accounts.proto -@com_google_googleapis//google/cloud/channel/v1:channel_partner_links.proto -@com_google_googleapis//google/cloud/channel/v1:common.proto -@com_google_googleapis//google/cloud/channel/v1:customers.proto -@com_google_googleapis//google/cloud/channel/v1:entitlement_changes.proto -@com_google_googleapis//google/cloud/channel/v1:entitlements.proto -@com_google_googleapis//google/cloud/channel/v1:offers.proto -@com_google_googleapis//google/cloud/channel/v1:operations.proto -@com_google_googleapis//google/cloud/channel/v1:products.proto -@com_google_googleapis//google/cloud/channel/v1:reports_service.proto -@com_google_googleapis//google/cloud/channel/v1:repricing.proto -@com_google_googleapis//google/cloud/channel/v1:service.proto -@com_google_googleapis//google/cloud/channel/v1:subscriber_event.proto +@googleapis//google/cloud/channel/v1:billing_accounts.proto +@googleapis//google/cloud/channel/v1:channel_partner_links.proto +@googleapis//google/cloud/channel/v1:common.proto +@googleapis//google/cloud/channel/v1:customers.proto +@googleapis//google/cloud/channel/v1:entitlement_changes.proto +@googleapis//google/cloud/channel/v1:entitlements.proto +@googleapis//google/cloud/channel/v1:offers.proto +@googleapis//google/cloud/channel/v1:operations.proto +@googleapis//google/cloud/channel/v1:products.proto +@googleapis//google/cloud/channel/v1:reports_service.proto +@googleapis//google/cloud/channel/v1:repricing.proto +@googleapis//google/cloud/channel/v1:service.proto +@googleapis//google/cloud/channel/v1:subscriber_event.proto diff --git a/external/googleapis/protolists/chronicle.list b/external/googleapis/protolists/chronicle.list index a294e00e28651..e05a4e8606f15 100644 --- a/external/googleapis/protolists/chronicle.list +++ b/external/googleapis/protolists/chronicle.list @@ -1,5 +1,5 @@ -@com_google_googleapis//google/cloud/chronicle/v1:data_access_control.proto -@com_google_googleapis//google/cloud/chronicle/v1:entity.proto -@com_google_googleapis//google/cloud/chronicle/v1:instance.proto -@com_google_googleapis//google/cloud/chronicle/v1:reference_list.proto -@com_google_googleapis//google/cloud/chronicle/v1:rule.proto +@googleapis//google/cloud/chronicle/v1:data_access_control.proto +@googleapis//google/cloud/chronicle/v1:entity.proto +@googleapis//google/cloud/chronicle/v1:instance.proto +@googleapis//google/cloud/chronicle/v1:reference_list.proto +@googleapis//google/cloud/chronicle/v1:rule.proto diff --git a/external/googleapis/protolists/cloudbuild.list b/external/googleapis/protolists/cloudbuild.list index 1e26f22148d64..4afb9ed5272c4 100644 --- a/external/googleapis/protolists/cloudbuild.list +++ b/external/googleapis/protolists/cloudbuild.list @@ -1,3 +1,3 @@ -@com_google_googleapis//google/devtools/cloudbuild/v1:cloudbuild.proto -@com_google_googleapis//google/devtools/cloudbuild/v2:cloudbuild.proto -@com_google_googleapis//google/devtools/cloudbuild/v2:repositories.proto +@googleapis//google/devtools/cloudbuild/v1:cloudbuild.proto +@googleapis//google/devtools/cloudbuild/v2:cloudbuild.proto +@googleapis//google/devtools/cloudbuild/v2:repositories.proto diff --git a/external/googleapis/protolists/cloudcontrolspartner.list b/external/googleapis/protolists/cloudcontrolspartner.list index 84f72822624a4..3d10ba213c1e9 100644 --- a/external/googleapis/protolists/cloudcontrolspartner.list +++ b/external/googleapis/protolists/cloudcontrolspartner.list @@ -1,10 +1,10 @@ -@com_google_googleapis//google/cloud/cloudcontrolspartner/v1:access_approval_requests.proto -@com_google_googleapis//google/cloud/cloudcontrolspartner/v1:completion_state.proto -@com_google_googleapis//google/cloud/cloudcontrolspartner/v1:core.proto -@com_google_googleapis//google/cloud/cloudcontrolspartner/v1:customer_workloads.proto -@com_google_googleapis//google/cloud/cloudcontrolspartner/v1:customers.proto -@com_google_googleapis//google/cloud/cloudcontrolspartner/v1:ekm_connections.proto -@com_google_googleapis//google/cloud/cloudcontrolspartner/v1:monitoring.proto -@com_google_googleapis//google/cloud/cloudcontrolspartner/v1:partner_permissions.proto -@com_google_googleapis//google/cloud/cloudcontrolspartner/v1:partners.proto -@com_google_googleapis//google/cloud/cloudcontrolspartner/v1:violations.proto +@googleapis//google/cloud/cloudcontrolspartner/v1:access_approval_requests.proto +@googleapis//google/cloud/cloudcontrolspartner/v1:completion_state.proto +@googleapis//google/cloud/cloudcontrolspartner/v1:core.proto +@googleapis//google/cloud/cloudcontrolspartner/v1:customer_workloads.proto +@googleapis//google/cloud/cloudcontrolspartner/v1:customers.proto +@googleapis//google/cloud/cloudcontrolspartner/v1:ekm_connections.proto +@googleapis//google/cloud/cloudcontrolspartner/v1:monitoring.proto +@googleapis//google/cloud/cloudcontrolspartner/v1:partner_permissions.proto +@googleapis//google/cloud/cloudcontrolspartner/v1:partners.proto +@googleapis//google/cloud/cloudcontrolspartner/v1:violations.proto diff --git a/external/googleapis/protolists/cloudquotas.list b/external/googleapis/protolists/cloudquotas.list index f40de87299fd9..bbc5f30d7016c 100644 --- a/external/googleapis/protolists/cloudquotas.list +++ b/external/googleapis/protolists/cloudquotas.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/api/cloudquotas/v1:cloudquotas.proto -@com_google_googleapis//google/api/cloudquotas/v1:resources.proto +@googleapis//google/api/cloudquotas/v1:cloudquotas.proto +@googleapis//google/api/cloudquotas/v1:resources.proto diff --git a/external/googleapis/protolists/cloudsecuritycompliance.list b/external/googleapis/protolists/cloudsecuritycompliance.list index a7bde6c85dccf..b998f802c1039 100644 --- a/external/googleapis/protolists/cloudsecuritycompliance.list +++ b/external/googleapis/protolists/cloudsecuritycompliance.list @@ -1,6 +1,6 @@ -@com_google_googleapis//google/cloud/cloudsecuritycompliance/v1:audit.proto -@com_google_googleapis//google/cloud/cloudsecuritycompliance/v1:cm_enrollment_service.proto -@com_google_googleapis//google/cloud/cloudsecuritycompliance/v1:common.proto -@com_google_googleapis//google/cloud/cloudsecuritycompliance/v1:config.proto -@com_google_googleapis//google/cloud/cloudsecuritycompliance/v1:deployment.proto -@com_google_googleapis//google/cloud/cloudsecuritycompliance/v1:monitoring.proto +@googleapis//google/cloud/cloudsecuritycompliance/v1:audit.proto +@googleapis//google/cloud/cloudsecuritycompliance/v1:cm_enrollment_service.proto +@googleapis//google/cloud/cloudsecuritycompliance/v1:common.proto +@googleapis//google/cloud/cloudsecuritycompliance/v1:config.proto +@googleapis//google/cloud/cloudsecuritycompliance/v1:deployment.proto +@googleapis//google/cloud/cloudsecuritycompliance/v1:monitoring.proto diff --git a/external/googleapis/protolists/commerce.list b/external/googleapis/protolists/commerce.list index 002d4d2a5b930..1c6c2bb5de357 100644 --- a/external/googleapis/protolists/commerce.list +++ b/external/googleapis/protolists/commerce.list @@ -1,3 +1,3 @@ -@com_google_googleapis//google/cloud/commerce/consumer/procurement/v1:license_management_service.proto -@com_google_googleapis//google/cloud/commerce/consumer/procurement/v1:order.proto -@com_google_googleapis//google/cloud/commerce/consumer/procurement/v1:procurement_service.proto +@googleapis//google/cloud/commerce/consumer/procurement/v1:license_management_service.proto +@googleapis//google/cloud/commerce/consumer/procurement/v1:order.proto +@googleapis//google/cloud/commerce/consumer/procurement/v1:procurement_service.proto diff --git a/external/googleapis/protolists/common.list b/external/googleapis/protolists/common.list index 67a3ab77f8387..a0cb24dea2b98 100644 --- a/external/googleapis/protolists/common.list +++ b/external/googleapis/protolists/common.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/common:operation_metadata.proto +@googleapis//google/cloud/common:operation_metadata.proto diff --git a/external/googleapis/protolists/composer.list b/external/googleapis/protolists/composer.list index cb3d1f7ea017d..bffa84ffd8040 100644 --- a/external/googleapis/protolists/composer.list +++ b/external/googleapis/protolists/composer.list @@ -1,3 +1,3 @@ -@com_google_googleapis//google/cloud/orchestration/airflow/service/v1:environments.proto -@com_google_googleapis//google/cloud/orchestration/airflow/service/v1:image_versions.proto -@com_google_googleapis//google/cloud/orchestration/airflow/service/v1:operations.proto +@googleapis//google/cloud/orchestration/airflow/service/v1:environments.proto +@googleapis//google/cloud/orchestration/airflow/service/v1:image_versions.proto +@googleapis//google/cloud/orchestration/airflow/service/v1:operations.proto diff --git a/external/googleapis/protolists/confidentialcomputing.list b/external/googleapis/protolists/confidentialcomputing.list index 64493bb25a660..194675ea9cafe 100644 --- a/external/googleapis/protolists/confidentialcomputing.list +++ b/external/googleapis/protolists/confidentialcomputing.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/confidentialcomputing/v1:service.proto +@googleapis//google/cloud/confidentialcomputing/v1:service.proto diff --git a/external/googleapis/protolists/config.list b/external/googleapis/protolists/config.list index b04623d899593..43d1cb13a8179 100644 --- a/external/googleapis/protolists/config.list +++ b/external/googleapis/protolists/config.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/config/v1:config.proto +@googleapis//google/cloud/config/v1:config.proto diff --git a/external/googleapis/protolists/configdelivery.list b/external/googleapis/protolists/configdelivery.list index 5188314ee93f1..55475568c20e4 100644 --- a/external/googleapis/protolists/configdelivery.list +++ b/external/googleapis/protolists/configdelivery.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/configdelivery/v1:config_delivery.proto +@googleapis//google/cloud/configdelivery/v1:config_delivery.proto diff --git a/external/googleapis/protolists/connectors.list b/external/googleapis/protolists/connectors.list index abe5ebbba3cda..e3cf9badab54f 100644 --- a/external/googleapis/protolists/connectors.list +++ b/external/googleapis/protolists/connectors.list @@ -1,11 +1,11 @@ -@com_google_googleapis//google/cloud/connectors/v1:authconfig.proto -@com_google_googleapis//google/cloud/connectors/v1:common.proto -@com_google_googleapis//google/cloud/connectors/v1:connection.proto -@com_google_googleapis//google/cloud/connectors/v1:connector.proto -@com_google_googleapis//google/cloud/connectors/v1:connector_version.proto -@com_google_googleapis//google/cloud/connectors/v1:connectors_service.proto -@com_google_googleapis//google/cloud/connectors/v1:destination_config.proto -@com_google_googleapis//google/cloud/connectors/v1:provider.proto -@com_google_googleapis//google/cloud/connectors/v1:runtime.proto -@com_google_googleapis//google/cloud/connectors/v1:settings.proto -@com_google_googleapis//google/cloud/connectors/v1:ssl_config.proto +@googleapis//google/cloud/connectors/v1:authconfig.proto +@googleapis//google/cloud/connectors/v1:common.proto +@googleapis//google/cloud/connectors/v1:connection.proto +@googleapis//google/cloud/connectors/v1:connector.proto +@googleapis//google/cloud/connectors/v1:connector_version.proto +@googleapis//google/cloud/connectors/v1:connectors_service.proto +@googleapis//google/cloud/connectors/v1:destination_config.proto +@googleapis//google/cloud/connectors/v1:provider.proto +@googleapis//google/cloud/connectors/v1:runtime.proto +@googleapis//google/cloud/connectors/v1:settings.proto +@googleapis//google/cloud/connectors/v1:ssl_config.proto diff --git a/external/googleapis/protolists/contactcenterinsights.list b/external/googleapis/protolists/contactcenterinsights.list index 462afe82f2ed3..19c2eee697f1c 100644 --- a/external/googleapis/protolists/contactcenterinsights.list +++ b/external/googleapis/protolists/contactcenterinsights.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/contactcenterinsights/v1:contact_center_insights.proto -@com_google_googleapis//google/cloud/contactcenterinsights/v1:resources.proto +@googleapis//google/cloud/contactcenterinsights/v1:contact_center_insights.proto +@googleapis//google/cloud/contactcenterinsights/v1:resources.proto diff --git a/external/googleapis/protolists/container.list b/external/googleapis/protolists/container.list index 387306c1dcf8f..b1d4a753de836 100644 --- a/external/googleapis/protolists/container.list +++ b/external/googleapis/protolists/container.list @@ -1 +1 @@ -@com_google_googleapis//google/container/v1:cluster_service.proto +@googleapis//google/container/v1:cluster_service.proto diff --git a/external/googleapis/protolists/containeranalysis.list b/external/googleapis/protolists/containeranalysis.list index cf04e89e6ceb3..665fd476ce103 100644 --- a/external/googleapis/protolists/containeranalysis.list +++ b/external/googleapis/protolists/containeranalysis.list @@ -1 +1 @@ -@com_google_googleapis//google/devtools/containeranalysis/v1:containeranalysis.proto +@googleapis//google/devtools/containeranalysis/v1:containeranalysis.proto diff --git a/external/googleapis/protolists/contentwarehouse.list b/external/googleapis/protolists/contentwarehouse.list index 206b4c4364062..71d026e2307fa 100644 --- a/external/googleapis/protolists/contentwarehouse.list +++ b/external/googleapis/protolists/contentwarehouse.list @@ -1,18 +1,18 @@ -@com_google_googleapis//google/cloud/contentwarehouse/v1:async_document_service_request.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:common.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:document.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:document_link_service.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:document_schema.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:document_schema_service.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:document_service.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:document_service_request.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:filters.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:histogram.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:pipeline_service.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:pipelines.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:rule_engine.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:ruleset_service.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:ruleset_service_request.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:synonymset.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:synonymset_service.proto -@com_google_googleapis//google/cloud/contentwarehouse/v1:synonymset_service_request.proto +@googleapis//google/cloud/contentwarehouse/v1:async_document_service_request.proto +@googleapis//google/cloud/contentwarehouse/v1:common.proto +@googleapis//google/cloud/contentwarehouse/v1:document.proto +@googleapis//google/cloud/contentwarehouse/v1:document_link_service.proto +@googleapis//google/cloud/contentwarehouse/v1:document_schema.proto +@googleapis//google/cloud/contentwarehouse/v1:document_schema_service.proto +@googleapis//google/cloud/contentwarehouse/v1:document_service.proto +@googleapis//google/cloud/contentwarehouse/v1:document_service_request.proto +@googleapis//google/cloud/contentwarehouse/v1:filters.proto +@googleapis//google/cloud/contentwarehouse/v1:histogram.proto +@googleapis//google/cloud/contentwarehouse/v1:pipeline_service.proto +@googleapis//google/cloud/contentwarehouse/v1:pipelines.proto +@googleapis//google/cloud/contentwarehouse/v1:rule_engine.proto +@googleapis//google/cloud/contentwarehouse/v1:ruleset_service.proto +@googleapis//google/cloud/contentwarehouse/v1:ruleset_service_request.proto +@googleapis//google/cloud/contentwarehouse/v1:synonymset.proto +@googleapis//google/cloud/contentwarehouse/v1:synonymset_service.proto +@googleapis//google/cloud/contentwarehouse/v1:synonymset_service_request.proto diff --git a/external/googleapis/protolists/datacatalog.list b/external/googleapis/protolists/datacatalog.list index 2eb2ef0147769..ddff1eff21222 100644 --- a/external/googleapis/protolists/datacatalog.list +++ b/external/googleapis/protolists/datacatalog.list @@ -1,17 +1,18 @@ -@com_google_googleapis//google/cloud/datacatalog/lineage/v1:lineage.proto -@com_google_googleapis//google/cloud/datacatalog/v1:bigquery.proto -@com_google_googleapis//google/cloud/datacatalog/v1:common.proto -@com_google_googleapis//google/cloud/datacatalog/v1:data_source.proto -@com_google_googleapis//google/cloud/datacatalog/v1:datacatalog.proto -@com_google_googleapis//google/cloud/datacatalog/v1:dataplex_spec.proto -@com_google_googleapis//google/cloud/datacatalog/v1:dump_content.proto -@com_google_googleapis//google/cloud/datacatalog/v1:gcs_fileset_spec.proto -@com_google_googleapis//google/cloud/datacatalog/v1:physical_schema.proto -@com_google_googleapis//google/cloud/datacatalog/v1:policytagmanager.proto -@com_google_googleapis//google/cloud/datacatalog/v1:policytagmanagerserialization.proto -@com_google_googleapis//google/cloud/datacatalog/v1:schema.proto -@com_google_googleapis//google/cloud/datacatalog/v1:search.proto -@com_google_googleapis//google/cloud/datacatalog/v1:table_spec.proto -@com_google_googleapis//google/cloud/datacatalog/v1:tags.proto -@com_google_googleapis//google/cloud/datacatalog/v1:timestamps.proto -@com_google_googleapis//google/cloud/datacatalog/v1:usage.proto +@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 +@googleapis//google/cloud/datacatalog/v1:data_source.proto +@googleapis//google/cloud/datacatalog/v1:datacatalog.proto +@googleapis//google/cloud/datacatalog/v1:dataplex_spec.proto +@googleapis//google/cloud/datacatalog/v1:dump_content.proto +@googleapis//google/cloud/datacatalog/v1:gcs_fileset_spec.proto +@googleapis//google/cloud/datacatalog/v1:physical_schema.proto +@googleapis//google/cloud/datacatalog/v1:policytagmanager.proto +@googleapis//google/cloud/datacatalog/v1:policytagmanagerserialization.proto +@googleapis//google/cloud/datacatalog/v1:schema.proto +@googleapis//google/cloud/datacatalog/v1:search.proto +@googleapis//google/cloud/datacatalog/v1:table_spec.proto +@googleapis//google/cloud/datacatalog/v1:tags.proto +@googleapis//google/cloud/datacatalog/v1:timestamps.proto +@googleapis//google/cloud/datacatalog/v1:usage.proto diff --git a/external/googleapis/protolists/dataform.list b/external/googleapis/protolists/dataform.list index 5b8e73cbd5f39..23b44a266c1c8 100644 --- a/external/googleapis/protolists/dataform.list +++ b/external/googleapis/protolists/dataform.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/dataform/logging/v1:logging.proto -@com_google_googleapis//google/cloud/dataform/v1:dataform.proto +@googleapis//google/cloud/dataform/logging/v1:logging.proto +@googleapis//google/cloud/dataform/v1:dataform.proto diff --git a/external/googleapis/protolists/datafusion.list b/external/googleapis/protolists/datafusion.list index c736d23ac29e2..04d7053087438 100644 --- a/external/googleapis/protolists/datafusion.list +++ b/external/googleapis/protolists/datafusion.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/datafusion/v1:datafusion.proto +@googleapis//google/cloud/datafusion/v1:datafusion.proto diff --git a/external/googleapis/protolists/datamigration.list b/external/googleapis/protolists/datamigration.list index 52a5b20a1a382..da87ace35d0c7 100644 --- a/external/googleapis/protolists/datamigration.list +++ b/external/googleapis/protolists/datamigration.list @@ -1,4 +1,4 @@ -@com_google_googleapis//google/cloud/clouddms/logging/v1:clouddms_platform_logs.proto -@com_google_googleapis//google/cloud/clouddms/v1:clouddms.proto -@com_google_googleapis//google/cloud/clouddms/v1:clouddms_resources.proto -@com_google_googleapis//google/cloud/clouddms/v1:conversionworkspace_resources.proto +@googleapis//google/cloud/clouddms/logging/v1:clouddms_platform_logs.proto +@googleapis//google/cloud/clouddms/v1:clouddms.proto +@googleapis//google/cloud/clouddms/v1:clouddms_resources.proto +@googleapis//google/cloud/clouddms/v1:conversionworkspace_resources.proto diff --git a/external/googleapis/protolists/dataplex.list b/external/googleapis/protolists/dataplex.list index de426ab75fe68..e31b6ac83e94c 100644 --- a/external/googleapis/protolists/dataplex.list +++ b/external/googleapis/protolists/dataplex.list @@ -1,19 +1,20 @@ -@com_google_googleapis//google/cloud/dataplex/v1:analyze.proto -@com_google_googleapis//google/cloud/dataplex/v1:business_glossary.proto -@com_google_googleapis//google/cloud/dataplex/v1:catalog.proto -@com_google_googleapis//google/cloud/dataplex/v1:cmek.proto -@com_google_googleapis//google/cloud/dataplex/v1:content.proto -@com_google_googleapis//google/cloud/dataplex/v1:data_discovery.proto -@com_google_googleapis//google/cloud/dataplex/v1:data_documentation.proto -@com_google_googleapis//google/cloud/dataplex/v1:data_profile.proto -@com_google_googleapis//google/cloud/dataplex/v1:data_quality.proto -@com_google_googleapis//google/cloud/dataplex/v1:data_taxonomy.proto -@com_google_googleapis//google/cloud/dataplex/v1:datascans.proto -@com_google_googleapis//google/cloud/dataplex/v1:datascans_common.proto -@com_google_googleapis//google/cloud/dataplex/v1:logs.proto -@com_google_googleapis//google/cloud/dataplex/v1:metadata.proto -@com_google_googleapis//google/cloud/dataplex/v1:processing.proto -@com_google_googleapis//google/cloud/dataplex/v1:resources.proto -@com_google_googleapis//google/cloud/dataplex/v1:security.proto -@com_google_googleapis//google/cloud/dataplex/v1:service.proto -@com_google_googleapis//google/cloud/dataplex/v1:tasks.proto +@googleapis//google/cloud/dataplex/v1:analyze.proto +@googleapis//google/cloud/dataplex/v1:business_glossary.proto +@googleapis//google/cloud/dataplex/v1:catalog.proto +@googleapis//google/cloud/dataplex/v1:cmek.proto +@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 +@googleapis//google/cloud/dataplex/v1:datascans.proto +@googleapis//google/cloud/dataplex/v1:datascans_common.proto +@googleapis//google/cloud/dataplex/v1:logs.proto +@googleapis//google/cloud/dataplex/v1:metadata.proto +@googleapis//google/cloud/dataplex/v1:processing.proto +@googleapis//google/cloud/dataplex/v1:resources.proto +@googleapis//google/cloud/dataplex/v1:security.proto +@googleapis//google/cloud/dataplex/v1:service.proto +@googleapis//google/cloud/dataplex/v1:tasks.proto diff --git a/external/googleapis/protolists/dataproc.list b/external/googleapis/protolists/dataproc.list index f1bb983c092d2..3deb2d2c6ed17 100644 --- a/external/googleapis/protolists/dataproc.list +++ b/external/googleapis/protolists/dataproc.list @@ -1,10 +1,10 @@ -@com_google_googleapis//google/cloud/dataproc/v1:autoscaling_policies.proto -@com_google_googleapis//google/cloud/dataproc/v1:batches.proto -@com_google_googleapis//google/cloud/dataproc/v1:clusters.proto -@com_google_googleapis//google/cloud/dataproc/v1:jobs.proto -@com_google_googleapis//google/cloud/dataproc/v1:node_groups.proto -@com_google_googleapis//google/cloud/dataproc/v1:operations.proto -@com_google_googleapis//google/cloud/dataproc/v1:session_templates.proto -@com_google_googleapis//google/cloud/dataproc/v1:sessions.proto -@com_google_googleapis//google/cloud/dataproc/v1:shared.proto -@com_google_googleapis//google/cloud/dataproc/v1:workflow_templates.proto +@googleapis//google/cloud/dataproc/v1:autoscaling_policies.proto +@googleapis//google/cloud/dataproc/v1:batches.proto +@googleapis//google/cloud/dataproc/v1:clusters.proto +@googleapis//google/cloud/dataproc/v1:jobs.proto +@googleapis//google/cloud/dataproc/v1:node_groups.proto +@googleapis//google/cloud/dataproc/v1:operations.proto +@googleapis//google/cloud/dataproc/v1:session_templates.proto +@googleapis//google/cloud/dataproc/v1:sessions.proto +@googleapis//google/cloud/dataproc/v1:shared.proto +@googleapis//google/cloud/dataproc/v1:workflow_templates.proto diff --git a/external/googleapis/protolists/datastore.list b/external/googleapis/protolists/datastore.list index 81374f05b4dee..70073fa25517e 100644 --- a/external/googleapis/protolists/datastore.list +++ b/external/googleapis/protolists/datastore.list @@ -1,8 +1,8 @@ -@com_google_googleapis//google/datastore/admin/v1:datastore_admin.proto -@com_google_googleapis//google/datastore/admin/v1:index.proto -@com_google_googleapis//google/datastore/admin/v1:migration.proto -@com_google_googleapis//google/datastore/v1:aggregation_result.proto -@com_google_googleapis//google/datastore/v1:datastore.proto -@com_google_googleapis//google/datastore/v1:entity.proto -@com_google_googleapis//google/datastore/v1:query.proto -@com_google_googleapis//google/datastore/v1:query_profile.proto +@googleapis//google/datastore/admin/v1:datastore_admin.proto +@googleapis//google/datastore/admin/v1:index.proto +@googleapis//google/datastore/admin/v1:migration.proto +@googleapis//google/datastore/v1:aggregation_result.proto +@googleapis//google/datastore/v1:datastore.proto +@googleapis//google/datastore/v1:entity.proto +@googleapis//google/datastore/v1:query.proto +@googleapis//google/datastore/v1:query_profile.proto diff --git a/external/googleapis/protolists/datastream.list b/external/googleapis/protolists/datastream.list index 233efb1ae8250..5edaf8e9c2dce 100644 --- a/external/googleapis/protolists/datastream.list +++ b/external/googleapis/protolists/datastream.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/datastream/v1:datastream.proto -@com_google_googleapis//google/cloud/datastream/v1:datastream_resources.proto +@googleapis//google/cloud/datastream/v1:datastream.proto +@googleapis//google/cloud/datastream/v1:datastream_resources.proto diff --git a/external/googleapis/protolists/deploy.list b/external/googleapis/protolists/deploy.list index e8c7143200875..62c077abb0fce 100644 --- a/external/googleapis/protolists/deploy.list +++ b/external/googleapis/protolists/deploy.list @@ -1,14 +1,14 @@ -@com_google_googleapis//google/cloud/deploy/v1:automation_payload.proto -@com_google_googleapis//google/cloud/deploy/v1:automationrun_payload.proto -@com_google_googleapis//google/cloud/deploy/v1:cloud_deploy.proto -@com_google_googleapis//google/cloud/deploy/v1:customtargettype_notification_payload.proto -@com_google_googleapis//google/cloud/deploy/v1:deliverypipeline_notification_payload.proto -@com_google_googleapis//google/cloud/deploy/v1:deploypolicy_evaluation_payload.proto -@com_google_googleapis//google/cloud/deploy/v1:deploypolicy_notification_payload.proto -@com_google_googleapis//google/cloud/deploy/v1:jobrun_notification_payload.proto -@com_google_googleapis//google/cloud/deploy/v1:log_enums.proto -@com_google_googleapis//google/cloud/deploy/v1:release_notification_payload.proto -@com_google_googleapis//google/cloud/deploy/v1:release_render_payload.proto -@com_google_googleapis//google/cloud/deploy/v1:rollout_notification_payload.proto -@com_google_googleapis//google/cloud/deploy/v1:rollout_update_payload.proto -@com_google_googleapis//google/cloud/deploy/v1:target_notification_payload.proto +@googleapis//google/cloud/deploy/v1:automation_payload.proto +@googleapis//google/cloud/deploy/v1:automationrun_payload.proto +@googleapis//google/cloud/deploy/v1:cloud_deploy.proto +@googleapis//google/cloud/deploy/v1:customtargettype_notification_payload.proto +@googleapis//google/cloud/deploy/v1:deliverypipeline_notification_payload.proto +@googleapis//google/cloud/deploy/v1:deploypolicy_evaluation_payload.proto +@googleapis//google/cloud/deploy/v1:deploypolicy_notification_payload.proto +@googleapis//google/cloud/deploy/v1:jobrun_notification_payload.proto +@googleapis//google/cloud/deploy/v1:log_enums.proto +@googleapis//google/cloud/deploy/v1:release_notification_payload.proto +@googleapis//google/cloud/deploy/v1:release_render_payload.proto +@googleapis//google/cloud/deploy/v1:rollout_notification_payload.proto +@googleapis//google/cloud/deploy/v1:rollout_update_payload.proto +@googleapis//google/cloud/deploy/v1:target_notification_payload.proto diff --git a/external/googleapis/protolists/developerconnect.list b/external/googleapis/protolists/developerconnect.list index b720197c889da..df705e8e37e11 100644 --- a/external/googleapis/protolists/developerconnect.list +++ b/external/googleapis/protolists/developerconnect.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/developerconnect/v1:developer_connect.proto -@com_google_googleapis//google/cloud/developerconnect/v1:insights_config.proto +@googleapis//google/cloud/developerconnect/v1:developer_connect.proto +@googleapis//google/cloud/developerconnect/v1:insights_config.proto diff --git a/external/googleapis/protolists/devicestreaming.list b/external/googleapis/protolists/devicestreaming.list index bfa0c525f0b4d..11db2904bc6e5 100644 --- a/external/googleapis/protolists/devicestreaming.list +++ b/external/googleapis/protolists/devicestreaming.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/devicestreaming/v1:adb_service.proto -@com_google_googleapis//google/cloud/devicestreaming/v1:service.proto +@googleapis//google/cloud/devicestreaming/v1:adb_service.proto +@googleapis//google/cloud/devicestreaming/v1:service.proto diff --git a/external/googleapis/protolists/dialogflow_cx.list b/external/googleapis/protolists/dialogflow_cx.list index 6e48cd19ef7a9..55a06b1c85f65 100644 --- a/external/googleapis/protolists/dialogflow_cx.list +++ b/external/googleapis/protolists/dialogflow_cx.list @@ -1,35 +1,35 @@ -@com_google_googleapis//google/cloud/dialogflow/cx/v3:advanced_settings.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:agent.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:audio_config.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:changelog.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:code_block.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:data_store_connection.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:deployment.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:entity_type.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:environment.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:example.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:experiment.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:flow.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:fulfillment.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:gcs.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:generative_settings.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:generator.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:import_strategy.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:inline.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:intent.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:page.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:parameter_definition.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:playbook.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:response_message.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:safety_settings.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:security_settings.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:session.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:session_entity_type.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:test_case.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:tool.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:tool_call.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:trace.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:transition_route_group.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:validation_message.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:version.proto -@com_google_googleapis//google/cloud/dialogflow/cx/v3:webhook.proto +@googleapis//google/cloud/dialogflow/cx/v3:advanced_settings.proto +@googleapis//google/cloud/dialogflow/cx/v3:agent.proto +@googleapis//google/cloud/dialogflow/cx/v3:audio_config.proto +@googleapis//google/cloud/dialogflow/cx/v3:changelog.proto +@googleapis//google/cloud/dialogflow/cx/v3:code_block.proto +@googleapis//google/cloud/dialogflow/cx/v3:data_store_connection.proto +@googleapis//google/cloud/dialogflow/cx/v3:deployment.proto +@googleapis//google/cloud/dialogflow/cx/v3:entity_type.proto +@googleapis//google/cloud/dialogflow/cx/v3:environment.proto +@googleapis//google/cloud/dialogflow/cx/v3:example.proto +@googleapis//google/cloud/dialogflow/cx/v3:experiment.proto +@googleapis//google/cloud/dialogflow/cx/v3:flow.proto +@googleapis//google/cloud/dialogflow/cx/v3:fulfillment.proto +@googleapis//google/cloud/dialogflow/cx/v3:gcs.proto +@googleapis//google/cloud/dialogflow/cx/v3:generative_settings.proto +@googleapis//google/cloud/dialogflow/cx/v3:generator.proto +@googleapis//google/cloud/dialogflow/cx/v3:import_strategy.proto +@googleapis//google/cloud/dialogflow/cx/v3:inline.proto +@googleapis//google/cloud/dialogflow/cx/v3:intent.proto +@googleapis//google/cloud/dialogflow/cx/v3:page.proto +@googleapis//google/cloud/dialogflow/cx/v3:parameter_definition.proto +@googleapis//google/cloud/dialogflow/cx/v3:playbook.proto +@googleapis//google/cloud/dialogflow/cx/v3:response_message.proto +@googleapis//google/cloud/dialogflow/cx/v3:safety_settings.proto +@googleapis//google/cloud/dialogflow/cx/v3:security_settings.proto +@googleapis//google/cloud/dialogflow/cx/v3:session.proto +@googleapis//google/cloud/dialogflow/cx/v3:session_entity_type.proto +@googleapis//google/cloud/dialogflow/cx/v3:test_case.proto +@googleapis//google/cloud/dialogflow/cx/v3:tool.proto +@googleapis//google/cloud/dialogflow/cx/v3:tool_call.proto +@googleapis//google/cloud/dialogflow/cx/v3:trace.proto +@googleapis//google/cloud/dialogflow/cx/v3:transition_route_group.proto +@googleapis//google/cloud/dialogflow/cx/v3:validation_message.proto +@googleapis//google/cloud/dialogflow/cx/v3:version.proto +@googleapis//google/cloud/dialogflow/cx/v3:webhook.proto diff --git a/external/googleapis/protolists/dialogflow_es.list b/external/googleapis/protolists/dialogflow_es.list index 7561b7a7aeadf..5f521c8a728f9 100644 --- a/external/googleapis/protolists/dialogflow_es.list +++ b/external/googleapis/protolists/dialogflow_es.list @@ -1,31 +1,34 @@ -@com_google_googleapis//google/cloud/dialogflow/v2:agent.proto -@com_google_googleapis//google/cloud/dialogflow/v2:agent_coaching_instruction.proto -@com_google_googleapis//google/cloud/dialogflow/v2:answer_record.proto -@com_google_googleapis//google/cloud/dialogflow/v2:audio_config.proto -@com_google_googleapis//google/cloud/dialogflow/v2:context.proto -@com_google_googleapis//google/cloud/dialogflow/v2:conversation.proto -@com_google_googleapis//google/cloud/dialogflow/v2:conversation_dataset.proto -@com_google_googleapis//google/cloud/dialogflow/v2:conversation_event.proto -@com_google_googleapis//google/cloud/dialogflow/v2:conversation_model.proto -@com_google_googleapis//google/cloud/dialogflow/v2:conversation_profile.proto -@com_google_googleapis//google/cloud/dialogflow/v2:document.proto -@com_google_googleapis//google/cloud/dialogflow/v2:encryption_spec.proto -@com_google_googleapis//google/cloud/dialogflow/v2:entity_type.proto -@com_google_googleapis//google/cloud/dialogflow/v2:environment.proto -@com_google_googleapis//google/cloud/dialogflow/v2:fulfillment.proto -@com_google_googleapis//google/cloud/dialogflow/v2:gcs.proto -@com_google_googleapis//google/cloud/dialogflow/v2:generator.proto -@com_google_googleapis//google/cloud/dialogflow/v2:generator_evaluation.proto -@com_google_googleapis//google/cloud/dialogflow/v2:human_agent_assistant_event.proto -@com_google_googleapis//google/cloud/dialogflow/v2:intent.proto -@com_google_googleapis//google/cloud/dialogflow/v2:knowledge_base.proto -@com_google_googleapis//google/cloud/dialogflow/v2:operations.proto -@com_google_googleapis//google/cloud/dialogflow/v2:participant.proto -@com_google_googleapis//google/cloud/dialogflow/v2:session.proto -@com_google_googleapis//google/cloud/dialogflow/v2:session_entity_type.proto -@com_google_googleapis//google/cloud/dialogflow/v2:sip_trunk.proto -@com_google_googleapis//google/cloud/dialogflow/v2:tool.proto -@com_google_googleapis//google/cloud/dialogflow/v2:tool_call.proto -@com_google_googleapis//google/cloud/dialogflow/v2:validation_result.proto -@com_google_googleapis//google/cloud/dialogflow/v2:version.proto -@com_google_googleapis//google/cloud/dialogflow/v2:webhook.proto +@googleapis//google/cloud/dialogflow/v2:agent.proto +@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 +@googleapis//google/cloud/dialogflow/v2:conversation_event.proto +@googleapis//google/cloud/dialogflow/v2:conversation_model.proto +@googleapis//google/cloud/dialogflow/v2:conversation_profile.proto +@googleapis//google/cloud/dialogflow/v2:document.proto +@googleapis//google/cloud/dialogflow/v2:encryption_spec.proto +@googleapis//google/cloud/dialogflow/v2:entity_type.proto +@googleapis//google/cloud/dialogflow/v2:environment.proto +@googleapis//google/cloud/dialogflow/v2:fulfillment.proto +@googleapis//google/cloud/dialogflow/v2:gcs.proto +@googleapis//google/cloud/dialogflow/v2:generator.proto +@googleapis//google/cloud/dialogflow/v2:generator_evaluation.proto +@googleapis//google/cloud/dialogflow/v2:human_agent_assistant_event.proto +@googleapis//google/cloud/dialogflow/v2:intent.proto +@googleapis//google/cloud/dialogflow/v2:knowledge_base.proto +@googleapis//google/cloud/dialogflow/v2:operations.proto +@googleapis//google/cloud/dialogflow/v2:participant.proto +@googleapis//google/cloud/dialogflow/v2:session.proto +@googleapis//google/cloud/dialogflow/v2:session_entity_type.proto +@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/discoveryengine.list b/external/googleapis/protolists/discoveryengine.list index 7894ead553ed7..7e5db77358599 100644 --- a/external/googleapis/protolists/discoveryengine.list +++ b/external/googleapis/protolists/discoveryengine.list @@ -1,46 +1,46 @@ -@com_google_googleapis//google/cloud/discoveryengine/v1:answer.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:assist_answer.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:assistant.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:assistant_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:chunk.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:cmek_config_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:common.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:completion.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:completion_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:control.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:control_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:conversation.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:conversational_search_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:custom_tuning_model.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:data_store.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:data_store_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:document.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:document_processing_config.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:document_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:engine.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:engine_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:grounded_generation_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:grounding.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:identity_mapping_store.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:identity_mapping_store_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:import_config.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:project.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:project_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:purge_config.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:rank_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:recommendation_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:safety.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:schema.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:schema_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:search_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:search_tuning_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:serving_config.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:serving_config_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:session.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:session_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:site_search_engine.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:site_search_engine_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:user_event.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:user_event_service.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:user_license.proto -@com_google_googleapis//google/cloud/discoveryengine/v1:user_license_service.proto +@googleapis//google/cloud/discoveryengine/v1:answer.proto +@googleapis//google/cloud/discoveryengine/v1:assist_answer.proto +@googleapis//google/cloud/discoveryengine/v1:assistant.proto +@googleapis//google/cloud/discoveryengine/v1:assistant_service.proto +@googleapis//google/cloud/discoveryengine/v1:chunk.proto +@googleapis//google/cloud/discoveryengine/v1:cmek_config_service.proto +@googleapis//google/cloud/discoveryengine/v1:common.proto +@googleapis//google/cloud/discoveryengine/v1:completion.proto +@googleapis//google/cloud/discoveryengine/v1:completion_service.proto +@googleapis//google/cloud/discoveryengine/v1:control.proto +@googleapis//google/cloud/discoveryengine/v1:control_service.proto +@googleapis//google/cloud/discoveryengine/v1:conversation.proto +@googleapis//google/cloud/discoveryengine/v1:conversational_search_service.proto +@googleapis//google/cloud/discoveryengine/v1:custom_tuning_model.proto +@googleapis//google/cloud/discoveryengine/v1:data_store.proto +@googleapis//google/cloud/discoveryengine/v1:data_store_service.proto +@googleapis//google/cloud/discoveryengine/v1:document.proto +@googleapis//google/cloud/discoveryengine/v1:document_processing_config.proto +@googleapis//google/cloud/discoveryengine/v1:document_service.proto +@googleapis//google/cloud/discoveryengine/v1:engine.proto +@googleapis//google/cloud/discoveryengine/v1:engine_service.proto +@googleapis//google/cloud/discoveryengine/v1:grounded_generation_service.proto +@googleapis//google/cloud/discoveryengine/v1:grounding.proto +@googleapis//google/cloud/discoveryengine/v1:identity_mapping_store.proto +@googleapis//google/cloud/discoveryengine/v1:identity_mapping_store_service.proto +@googleapis//google/cloud/discoveryengine/v1:import_config.proto +@googleapis//google/cloud/discoveryengine/v1:project.proto +@googleapis//google/cloud/discoveryengine/v1:project_service.proto +@googleapis//google/cloud/discoveryengine/v1:purge_config.proto +@googleapis//google/cloud/discoveryengine/v1:rank_service.proto +@googleapis//google/cloud/discoveryengine/v1:recommendation_service.proto +@googleapis//google/cloud/discoveryengine/v1:safety.proto +@googleapis//google/cloud/discoveryengine/v1:schema.proto +@googleapis//google/cloud/discoveryengine/v1:schema_service.proto +@googleapis//google/cloud/discoveryengine/v1:search_service.proto +@googleapis//google/cloud/discoveryengine/v1:search_tuning_service.proto +@googleapis//google/cloud/discoveryengine/v1:serving_config.proto +@googleapis//google/cloud/discoveryengine/v1:serving_config_service.proto +@googleapis//google/cloud/discoveryengine/v1:session.proto +@googleapis//google/cloud/discoveryengine/v1:session_service.proto +@googleapis//google/cloud/discoveryengine/v1:site_search_engine.proto +@googleapis//google/cloud/discoveryengine/v1:site_search_engine_service.proto +@googleapis//google/cloud/discoveryengine/v1:user_event.proto +@googleapis//google/cloud/discoveryengine/v1:user_event_service.proto +@googleapis//google/cloud/discoveryengine/v1:user_license.proto +@googleapis//google/cloud/discoveryengine/v1:user_license_service.proto diff --git a/external/googleapis/protolists/dlp.list b/external/googleapis/protolists/dlp.list index 838d602acb8fa..2756d9a964737 100644 --- a/external/googleapis/protolists/dlp.list +++ b/external/googleapis/protolists/dlp.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/privacy/dlp/v2:dlp.proto -@com_google_googleapis//google/privacy/dlp/v2:storage.proto +@googleapis//google/privacy/dlp/v2:dlp.proto +@googleapis//google/privacy/dlp/v2:storage.proto diff --git a/external/googleapis/protolists/documentai.list b/external/googleapis/protolists/documentai.list index 1b7c34821f90f..39b5627cb0721 100644 --- a/external/googleapis/protolists/documentai.list +++ b/external/googleapis/protolists/documentai.list @@ -1,10 +1,10 @@ -@com_google_googleapis//google/cloud/documentai/v1:barcode.proto -@com_google_googleapis//google/cloud/documentai/v1:document.proto -@com_google_googleapis//google/cloud/documentai/v1:document_io.proto -@com_google_googleapis//google/cloud/documentai/v1:document_processor_service.proto -@com_google_googleapis//google/cloud/documentai/v1:document_schema.proto -@com_google_googleapis//google/cloud/documentai/v1:evaluation.proto -@com_google_googleapis//google/cloud/documentai/v1:geometry.proto -@com_google_googleapis//google/cloud/documentai/v1:operation_metadata.proto -@com_google_googleapis//google/cloud/documentai/v1:processor.proto -@com_google_googleapis//google/cloud/documentai/v1:processor_type.proto +@googleapis//google/cloud/documentai/v1:barcode.proto +@googleapis//google/cloud/documentai/v1:document.proto +@googleapis//google/cloud/documentai/v1:document_io.proto +@googleapis//google/cloud/documentai/v1:document_processor_service.proto +@googleapis//google/cloud/documentai/v1:document_schema.proto +@googleapis//google/cloud/documentai/v1:evaluation.proto +@googleapis//google/cloud/documentai/v1:geometry.proto +@googleapis//google/cloud/documentai/v1:operation_metadata.proto +@googleapis//google/cloud/documentai/v1:processor.proto +@googleapis//google/cloud/documentai/v1:processor_type.proto diff --git a/external/googleapis/protolists/domains.list b/external/googleapis/protolists/domains.list index ed603a3e1e19d..9e7caf1d1a2a1 100644 --- a/external/googleapis/protolists/domains.list +++ b/external/googleapis/protolists/domains.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/domains/v1:domains.proto +@googleapis//google/cloud/domains/v1:domains.proto diff --git a/external/googleapis/protolists/edgecontainer.list b/external/googleapis/protolists/edgecontainer.list index 202b5f564d04b..b00cffcf74969 100644 --- a/external/googleapis/protolists/edgecontainer.list +++ b/external/googleapis/protolists/edgecontainer.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/edgecontainer/v1:resources.proto -@com_google_googleapis//google/cloud/edgecontainer/v1:service.proto +@googleapis//google/cloud/edgecontainer/v1:resources.proto +@googleapis//google/cloud/edgecontainer/v1:service.proto diff --git a/external/googleapis/protolists/edgenetwork.list b/external/googleapis/protolists/edgenetwork.list index 3c3fdd55292ec..05ca1e671fed6 100644 --- a/external/googleapis/protolists/edgenetwork.list +++ b/external/googleapis/protolists/edgenetwork.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/edgenetwork/v1:resources.proto -@com_google_googleapis//google/cloud/edgenetwork/v1:service.proto +@googleapis//google/cloud/edgenetwork/v1:resources.proto +@googleapis//google/cloud/edgenetwork/v1:service.proto diff --git a/external/googleapis/protolists/essentialcontacts.list b/external/googleapis/protolists/essentialcontacts.list index cc8480f3683e0..fba232072ea0f 100644 --- a/external/googleapis/protolists/essentialcontacts.list +++ b/external/googleapis/protolists/essentialcontacts.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/essentialcontacts/v1:enums.proto -@com_google_googleapis//google/cloud/essentialcontacts/v1:service.proto +@googleapis//google/cloud/essentialcontacts/v1:enums.proto +@googleapis//google/cloud/essentialcontacts/v1:service.proto diff --git a/external/googleapis/protolists/eventarc.list b/external/googleapis/protolists/eventarc.list index fd0efedc3d1e1..414237bceebe9 100644 --- a/external/googleapis/protolists/eventarc.list +++ b/external/googleapis/protolists/eventarc.list @@ -1,14 +1,14 @@ -@com_google_googleapis//google/cloud/eventarc/publishing/v1:cloud_event.proto -@com_google_googleapis//google/cloud/eventarc/publishing/v1:publisher.proto -@com_google_googleapis//google/cloud/eventarc/v1:channel.proto -@com_google_googleapis//google/cloud/eventarc/v1:channel_connection.proto -@com_google_googleapis//google/cloud/eventarc/v1:discovery.proto -@com_google_googleapis//google/cloud/eventarc/v1:enrollment.proto -@com_google_googleapis//google/cloud/eventarc/v1:eventarc.proto -@com_google_googleapis//google/cloud/eventarc/v1:google_api_source.proto -@com_google_googleapis//google/cloud/eventarc/v1:google_channel_config.proto -@com_google_googleapis//google/cloud/eventarc/v1:logging_config.proto -@com_google_googleapis//google/cloud/eventarc/v1:message_bus.proto -@com_google_googleapis//google/cloud/eventarc/v1:network_config.proto -@com_google_googleapis//google/cloud/eventarc/v1:pipeline.proto -@com_google_googleapis//google/cloud/eventarc/v1:trigger.proto +@googleapis//google/cloud/eventarc/publishing/v1:cloud_event.proto +@googleapis//google/cloud/eventarc/publishing/v1:publisher.proto +@googleapis//google/cloud/eventarc/v1:channel.proto +@googleapis//google/cloud/eventarc/v1:channel_connection.proto +@googleapis//google/cloud/eventarc/v1:discovery.proto +@googleapis//google/cloud/eventarc/v1:enrollment.proto +@googleapis//google/cloud/eventarc/v1:eventarc.proto +@googleapis//google/cloud/eventarc/v1:google_api_source.proto +@googleapis//google/cloud/eventarc/v1:google_channel_config.proto +@googleapis//google/cloud/eventarc/v1:logging_config.proto +@googleapis//google/cloud/eventarc/v1:message_bus.proto +@googleapis//google/cloud/eventarc/v1:network_config.proto +@googleapis//google/cloud/eventarc/v1:pipeline.proto +@googleapis//google/cloud/eventarc/v1:trigger.proto diff --git a/external/googleapis/protolists/filestore.list b/external/googleapis/protolists/filestore.list index 8c5f3f8f8ecd2..0e5008b2f3abf 100644 --- a/external/googleapis/protolists/filestore.list +++ b/external/googleapis/protolists/filestore.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/filestore/v1:cloud_filestore_service.proto +@googleapis//google/cloud/filestore/v1:cloud_filestore_service.proto diff --git a/external/googleapis/protolists/financialservices.list b/external/googleapis/protolists/financialservices.list index e4feb668f9ac4..9becdd0d23b0d 100644 --- a/external/googleapis/protolists/financialservices.list +++ b/external/googleapis/protolists/financialservices.list @@ -1,10 +1,10 @@ -@com_google_googleapis//google/cloud/financialservices/v1:backtest_result.proto -@com_google_googleapis//google/cloud/financialservices/v1:bigquery_destination.proto -@com_google_googleapis//google/cloud/financialservices/v1:dataset.proto -@com_google_googleapis//google/cloud/financialservices/v1:engine_config.proto -@com_google_googleapis//google/cloud/financialservices/v1:engine_version.proto -@com_google_googleapis//google/cloud/financialservices/v1:instance.proto -@com_google_googleapis//google/cloud/financialservices/v1:line_of_business.proto -@com_google_googleapis//google/cloud/financialservices/v1:model.proto -@com_google_googleapis//google/cloud/financialservices/v1:prediction_result.proto -@com_google_googleapis//google/cloud/financialservices/v1:service.proto +@googleapis//google/cloud/financialservices/v1:backtest_result.proto +@googleapis//google/cloud/financialservices/v1:bigquery_destination.proto +@googleapis//google/cloud/financialservices/v1:dataset.proto +@googleapis//google/cloud/financialservices/v1:engine_config.proto +@googleapis//google/cloud/financialservices/v1:engine_version.proto +@googleapis//google/cloud/financialservices/v1:instance.proto +@googleapis//google/cloud/financialservices/v1:line_of_business.proto +@googleapis//google/cloud/financialservices/v1:model.proto +@googleapis//google/cloud/financialservices/v1:prediction_result.proto +@googleapis//google/cloud/financialservices/v1:service.proto diff --git a/external/googleapis/protolists/functions.list b/external/googleapis/protolists/functions.list index 78831280d291f..bbeee9c6a1161 100644 --- a/external/googleapis/protolists/functions.list +++ b/external/googleapis/protolists/functions.list @@ -1,3 +1,3 @@ -@com_google_googleapis//google/cloud/functions/v1:functions.proto -@com_google_googleapis//google/cloud/functions/v1:operations.proto -@com_google_googleapis//google/cloud/functions/v2:functions.proto +@googleapis//google/cloud/functions/v1:functions.proto +@googleapis//google/cloud/functions/v1:operations.proto +@googleapis//google/cloud/functions/v2:functions.proto diff --git a/external/googleapis/protolists/gkebackup.list b/external/googleapis/protolists/gkebackup.list index 3fabfe7539177..a6223295cfd56 100644 --- a/external/googleapis/protolists/gkebackup.list +++ b/external/googleapis/protolists/gkebackup.list @@ -1,21 +1,21 @@ -@com_google_googleapis//google/cloud/gkebackup/logging/v1:logged_backup.proto -@com_google_googleapis//google/cloud/gkebackup/logging/v1:logged_backup_channel.proto -@com_google_googleapis//google/cloud/gkebackup/logging/v1:logged_backup_plan.proto -@com_google_googleapis//google/cloud/gkebackup/logging/v1:logged_backup_plan_metadata.proto -@com_google_googleapis//google/cloud/gkebackup/logging/v1:logged_common.proto -@com_google_googleapis//google/cloud/gkebackup/logging/v1:logged_restore.proto -@com_google_googleapis//google/cloud/gkebackup/logging/v1:logged_restore_channel.proto -@com_google_googleapis//google/cloud/gkebackup/logging/v1:logged_restore_plan.proto -@com_google_googleapis//google/cloud/gkebackup/logging/v1:logged_restore_plan_metadata.proto -@com_google_googleapis//google/cloud/gkebackup/logging/v1:logging.proto -@com_google_googleapis//google/cloud/gkebackup/v1:backup.proto -@com_google_googleapis//google/cloud/gkebackup/v1:backup_channel.proto -@com_google_googleapis//google/cloud/gkebackup/v1:backup_plan.proto -@com_google_googleapis//google/cloud/gkebackup/v1:backup_plan_binding.proto -@com_google_googleapis//google/cloud/gkebackup/v1:common.proto -@com_google_googleapis//google/cloud/gkebackup/v1:gkebackup.proto -@com_google_googleapis//google/cloud/gkebackup/v1:restore.proto -@com_google_googleapis//google/cloud/gkebackup/v1:restore_channel.proto -@com_google_googleapis//google/cloud/gkebackup/v1:restore_plan.proto -@com_google_googleapis//google/cloud/gkebackup/v1:restore_plan_binding.proto -@com_google_googleapis//google/cloud/gkebackup/v1:volume.proto +@googleapis//google/cloud/gkebackup/logging/v1:logged_backup.proto +@googleapis//google/cloud/gkebackup/logging/v1:logged_backup_channel.proto +@googleapis//google/cloud/gkebackup/logging/v1:logged_backup_plan.proto +@googleapis//google/cloud/gkebackup/logging/v1:logged_backup_plan_metadata.proto +@googleapis//google/cloud/gkebackup/logging/v1:logged_common.proto +@googleapis//google/cloud/gkebackup/logging/v1:logged_restore.proto +@googleapis//google/cloud/gkebackup/logging/v1:logged_restore_channel.proto +@googleapis//google/cloud/gkebackup/logging/v1:logged_restore_plan.proto +@googleapis//google/cloud/gkebackup/logging/v1:logged_restore_plan_metadata.proto +@googleapis//google/cloud/gkebackup/logging/v1:logging.proto +@googleapis//google/cloud/gkebackup/v1:backup.proto +@googleapis//google/cloud/gkebackup/v1:backup_channel.proto +@googleapis//google/cloud/gkebackup/v1:backup_plan.proto +@googleapis//google/cloud/gkebackup/v1:backup_plan_binding.proto +@googleapis//google/cloud/gkebackup/v1:common.proto +@googleapis//google/cloud/gkebackup/v1:gkebackup.proto +@googleapis//google/cloud/gkebackup/v1:restore.proto +@googleapis//google/cloud/gkebackup/v1:restore_channel.proto +@googleapis//google/cloud/gkebackup/v1:restore_plan.proto +@googleapis//google/cloud/gkebackup/v1:restore_plan_binding.proto +@googleapis//google/cloud/gkebackup/v1:volume.proto diff --git a/external/googleapis/protolists/gkeconnect.list b/external/googleapis/protolists/gkeconnect.list index 72af37af9a2d5..c12f99bec9986 100644 --- a/external/googleapis/protolists/gkeconnect.list +++ b/external/googleapis/protolists/gkeconnect.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/gkeconnect/gateway/v1:control.proto +@googleapis//google/cloud/gkeconnect/gateway/v1:control.proto diff --git a/external/googleapis/protolists/gkehub.list b/external/googleapis/protolists/gkehub.list index 5f5e8a1e61f01..79c48b537a6d5 100644 --- a/external/googleapis/protolists/gkehub.list +++ b/external/googleapis/protolists/gkehub.list @@ -1,5 +1,7 @@ -@com_google_googleapis//google/cloud/gkehub/v1/configmanagement:configmanagement.proto -@com_google_googleapis//google/cloud/gkehub/v1/multiclusteringress:multiclusteringress.proto -@com_google_googleapis//google/cloud/gkehub/v1:feature.proto -@com_google_googleapis//google/cloud/gkehub/v1:membership.proto -@com_google_googleapis//google/cloud/gkehub/v1:service.proto +@googleapis//google/cloud/gkehub/v1/configmanagement:configmanagement.proto +@googleapis//google/cloud/gkehub/v1/multiclusteringress:multiclusteringress.proto +@googleapis//google/cloud/gkehub/v1/rbacrolebindingactuation:rbacrolebindingactuation.proto +@googleapis//google/cloud/gkehub/v1:feature.proto +@googleapis//google/cloud/gkehub/v1:fleet.proto +@googleapis//google/cloud/gkehub/v1:membership.proto +@googleapis//google/cloud/gkehub/v1:service.proto diff --git a/external/googleapis/protolists/gkemulticloud.list b/external/googleapis/protolists/gkemulticloud.list index fac2cdbe82867..5134e66e34a58 100644 --- a/external/googleapis/protolists/gkemulticloud.list +++ b/external/googleapis/protolists/gkemulticloud.list @@ -1,7 +1,7 @@ -@com_google_googleapis//google/cloud/gkemulticloud/v1:attached_resources.proto -@com_google_googleapis//google/cloud/gkemulticloud/v1:attached_service.proto -@com_google_googleapis//google/cloud/gkemulticloud/v1:aws_resources.proto -@com_google_googleapis//google/cloud/gkemulticloud/v1:aws_service.proto -@com_google_googleapis//google/cloud/gkemulticloud/v1:azure_resources.proto -@com_google_googleapis//google/cloud/gkemulticloud/v1:azure_service.proto -@com_google_googleapis//google/cloud/gkemulticloud/v1:common_resources.proto +@googleapis//google/cloud/gkemulticloud/v1:attached_resources.proto +@googleapis//google/cloud/gkemulticloud/v1:attached_service.proto +@googleapis//google/cloud/gkemulticloud/v1:aws_resources.proto +@googleapis//google/cloud/gkemulticloud/v1:aws_service.proto +@googleapis//google/cloud/gkemulticloud/v1:azure_resources.proto +@googleapis//google/cloud/gkemulticloud/v1:azure_service.proto +@googleapis//google/cloud/gkemulticloud/v1:common_resources.proto diff --git a/external/googleapis/protolists/gkerecommender.list b/external/googleapis/protolists/gkerecommender.list index 6bd3721910a64..401c7a03e449f 100644 --- a/external/googleapis/protolists/gkerecommender.list +++ b/external/googleapis/protolists/gkerecommender.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/gkerecommender/v1:gkerecommender.proto +@googleapis//google/cloud/gkerecommender/v1:gkerecommender.proto diff --git a/external/googleapis/protolists/grafeas.list b/external/googleapis/protolists/grafeas.list index 4b38af808f86a..6f02754d76137 100644 --- a/external/googleapis/protolists/grafeas.list +++ b/external/googleapis/protolists/grafeas.list @@ -1,23 +1,23 @@ -@com_google_googleapis//grafeas/v1:attestation.proto -@com_google_googleapis//grafeas/v1:build.proto -@com_google_googleapis//grafeas/v1:common.proto -@com_google_googleapis//grafeas/v1:compliance.proto -@com_google_googleapis//grafeas/v1:cvss.proto -@com_google_googleapis//grafeas/v1:deployment.proto -@com_google_googleapis//grafeas/v1:discovery.proto -@com_google_googleapis//grafeas/v1:dsse_attestation.proto -@com_google_googleapis//grafeas/v1:grafeas.proto -@com_google_googleapis//grafeas/v1:image.proto -@com_google_googleapis//grafeas/v1:intoto_provenance.proto -@com_google_googleapis//grafeas/v1:intoto_statement.proto -@com_google_googleapis//grafeas/v1:package.proto -@com_google_googleapis//grafeas/v1:provenance.proto -@com_google_googleapis//grafeas/v1:risk.proto -@com_google_googleapis//grafeas/v1:sbom.proto -@com_google_googleapis//grafeas/v1:secret.proto -@com_google_googleapis//grafeas/v1:severity.proto -@com_google_googleapis//grafeas/v1:slsa_provenance.proto -@com_google_googleapis//grafeas/v1:slsa_provenance_zero_two.proto -@com_google_googleapis//grafeas/v1:upgrade.proto -@com_google_googleapis//grafeas/v1:vex.proto -@com_google_googleapis//grafeas/v1:vulnerability.proto +@googleapis//grafeas/v1:attestation.proto +@googleapis//grafeas/v1:build.proto +@googleapis//grafeas/v1:common.proto +@googleapis//grafeas/v1:compliance.proto +@googleapis//grafeas/v1:cvss.proto +@googleapis//grafeas/v1:deployment.proto +@googleapis//grafeas/v1:discovery.proto +@googleapis//grafeas/v1:dsse_attestation.proto +@googleapis//grafeas/v1:grafeas.proto +@googleapis//grafeas/v1:image.proto +@googleapis//grafeas/v1:intoto_provenance.proto +@googleapis//grafeas/v1:intoto_statement.proto +@googleapis//grafeas/v1:package.proto +@googleapis//grafeas/v1:provenance.proto +@googleapis//grafeas/v1:risk.proto +@googleapis//grafeas/v1:sbom.proto +@googleapis//grafeas/v1:secret.proto +@googleapis//grafeas/v1:severity.proto +@googleapis//grafeas/v1:slsa_provenance.proto +@googleapis//grafeas/v1:slsa_provenance_zero_two.proto +@googleapis//grafeas/v1:upgrade.proto +@googleapis//grafeas/v1:vex.proto +@googleapis//grafeas/v1:vulnerability.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/iam.list b/external/googleapis/protolists/iam.list index e5736a9cc1674..dacc4a809a0ee 100644 --- a/external/googleapis/protolists/iam.list +++ b/external/googleapis/protolists/iam.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/iam/admin/v1:audit_data.proto -@com_google_googleapis//google/iam/admin/v1:iam.proto +@googleapis//google/iam/admin/v1:audit_data.proto +@googleapis//google/iam/admin/v1:iam.proto diff --git a/external/googleapis/protolists/iam_v2.list b/external/googleapis/protolists/iam_v2.list index 8fb4a963d1c1e..64654a95e5f27 100644 --- a/external/googleapis/protolists/iam_v2.list +++ b/external/googleapis/protolists/iam_v2.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/iam/v2:deny.proto -@com_google_googleapis//google/iam/v2:policy.proto +@googleapis//google/iam/v2:deny.proto +@googleapis//google/iam/v2:policy.proto diff --git a/external/googleapis/protolists/iam_v3.list b/external/googleapis/protolists/iam_v3.list index da1849ff962ab..a72437f0c6fca 100644 --- a/external/googleapis/protolists/iam_v3.list +++ b/external/googleapis/protolists/iam_v3.list @@ -1,5 +1,5 @@ -@com_google_googleapis//google/iam/v3:operation_metadata.proto -@com_google_googleapis//google/iam/v3:policy_binding_resources.proto -@com_google_googleapis//google/iam/v3:policy_bindings_service.proto -@com_google_googleapis//google/iam/v3:principal_access_boundary_policies_service.proto -@com_google_googleapis//google/iam/v3:principal_access_boundary_policy_resources.proto +@googleapis//google/iam/v3:operation_metadata.proto +@googleapis//google/iam/v3:policy_binding_resources.proto +@googleapis//google/iam/v3:policy_bindings_service.proto +@googleapis//google/iam/v3:principal_access_boundary_policies_service.proto +@googleapis//google/iam/v3:principal_access_boundary_policy_resources.proto diff --git a/external/googleapis/protolists/iap.list b/external/googleapis/protolists/iap.list index c9fe8a86f48a4..d3d7a76642492 100644 --- a/external/googleapis/protolists/iap.list +++ b/external/googleapis/protolists/iap.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/iap/v1:service.proto +@googleapis//google/cloud/iap/v1:service.proto diff --git a/external/googleapis/protolists/ids.list b/external/googleapis/protolists/ids.list index a1a43f91d8a13..faa82693da1f9 100644 --- a/external/googleapis/protolists/ids.list +++ b/external/googleapis/protolists/ids.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/ids/v1:ids.proto +@googleapis//google/cloud/ids/v1:ids.proto diff --git a/external/googleapis/protolists/kms.list b/external/googleapis/protolists/kms.list index 8d8fff7e8d7ad..c9a8589b16f89 100644 --- a/external/googleapis/protolists/kms.list +++ b/external/googleapis/protolists/kms.list @@ -1,8 +1,8 @@ -@com_google_googleapis//google/cloud/kms/inventory/v1:key_dashboard_service.proto -@com_google_googleapis//google/cloud/kms/inventory/v1:key_tracking_service.proto -@com_google_googleapis//google/cloud/kms/v1:autokey.proto -@com_google_googleapis//google/cloud/kms/v1:autokey_admin.proto -@com_google_googleapis//google/cloud/kms/v1:ekm_service.proto -@com_google_googleapis//google/cloud/kms/v1:hsm_management.proto -@com_google_googleapis//google/cloud/kms/v1:resources.proto -@com_google_googleapis//google/cloud/kms/v1:service.proto +@googleapis//google/cloud/kms/inventory/v1:key_dashboard_service.proto +@googleapis//google/cloud/kms/inventory/v1:key_tracking_service.proto +@googleapis//google/cloud/kms/v1:autokey.proto +@googleapis//google/cloud/kms/v1:autokey_admin.proto +@googleapis//google/cloud/kms/v1:ekm_service.proto +@googleapis//google/cloud/kms/v1:hsm_management.proto +@googleapis//google/cloud/kms/v1:resources.proto +@googleapis//google/cloud/kms/v1:service.proto diff --git a/external/googleapis/protolists/language.list b/external/googleapis/protolists/language.list index 11fcee13ff4fa..dce1ed7c2dfc5 100644 --- a/external/googleapis/protolists/language.list +++ b/external/googleapis/protolists/language.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/language/v1:language_service.proto -@com_google_googleapis//google/cloud/language/v2:language_service.proto +@googleapis//google/cloud/language/v1:language_service.proto +@googleapis//google/cloud/language/v2:language_service.proto diff --git a/external/googleapis/protolists/licensemanager.list b/external/googleapis/protolists/licensemanager.list index b8b737b22443a..0c2346a801804 100644 --- a/external/googleapis/protolists/licensemanager.list +++ b/external/googleapis/protolists/licensemanager.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/licensemanager/v1:api_entities.proto -@com_google_googleapis//google/cloud/licensemanager/v1:licensemanager.proto +@googleapis//google/cloud/licensemanager/v1:api_entities.proto +@googleapis//google/cloud/licensemanager/v1:licensemanager.proto diff --git a/external/googleapis/protolists/logging.list b/external/googleapis/protolists/logging.list index c17233e432056..7a32e64762b6d 100644 --- a/external/googleapis/protolists/logging.list +++ b/external/googleapis/protolists/logging.list @@ -1,4 +1,4 @@ -@com_google_googleapis//google/logging/v2:log_entry.proto -@com_google_googleapis//google/logging/v2:logging.proto -@com_google_googleapis//google/logging/v2:logging_config.proto -@com_google_googleapis//google/logging/v2:logging_metrics.proto +@googleapis//google/logging/v2:log_entry.proto +@googleapis//google/logging/v2:logging.proto +@googleapis//google/logging/v2:logging_config.proto +@googleapis//google/logging/v2:logging_metrics.proto diff --git a/external/googleapis/protolists/logging_type.list b/external/googleapis/protolists/logging_type.list index fde81c913e41d..40039bc218ed6 100644 --- a/external/googleapis/protolists/logging_type.list +++ b/external/googleapis/protolists/logging_type.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/logging/type:http_request.proto -@com_google_googleapis//google/logging/type:log_severity.proto +@googleapis//google/logging/type:http_request.proto +@googleapis//google/logging/type:log_severity.proto diff --git a/external/googleapis/protolists/lustre.list b/external/googleapis/protolists/lustre.list index 676a40809c361..9da3687a2546e 100644 --- a/external/googleapis/protolists/lustre.list +++ b/external/googleapis/protolists/lustre.list @@ -1,3 +1,3 @@ -@com_google_googleapis//google/cloud/lustre/v1:instance.proto -@com_google_googleapis//google/cloud/lustre/v1:lustre.proto -@com_google_googleapis//google/cloud/lustre/v1:transfer.proto +@googleapis//google/cloud/lustre/v1:instance.proto +@googleapis//google/cloud/lustre/v1:lustre.proto +@googleapis//google/cloud/lustre/v1:transfer.proto diff --git a/external/googleapis/protolists/maintenance.list b/external/googleapis/protolists/maintenance.list index 3c118b13d3f73..1d214e3500b23 100644 --- a/external/googleapis/protolists/maintenance.list +++ b/external/googleapis/protolists/maintenance.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/maintenance/api/v1:maintenance_service.proto +@googleapis//google/cloud/maintenance/api/v1:maintenance_service.proto diff --git a/external/googleapis/protolists/managedidentities.list b/external/googleapis/protolists/managedidentities.list index 86337eb3002af..f986905ce8a24 100644 --- a/external/googleapis/protolists/managedidentities.list +++ b/external/googleapis/protolists/managedidentities.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/managedidentities/v1:managed_identities_service.proto -@com_google_googleapis//google/cloud/managedidentities/v1:resource.proto +@googleapis//google/cloud/managedidentities/v1:managed_identities_service.proto +@googleapis//google/cloud/managedidentities/v1:resource.proto diff --git a/external/googleapis/protolists/managedkafka.list b/external/googleapis/protolists/managedkafka.list index b359d9053f2d4..4187899be663a 100644 --- a/external/googleapis/protolists/managedkafka.list +++ b/external/googleapis/protolists/managedkafka.list @@ -1,5 +1,5 @@ -@com_google_googleapis//google/cloud/managedkafka/schemaregistry/v1:schema_registry.proto -@com_google_googleapis//google/cloud/managedkafka/schemaregistry/v1:schema_registry_resources.proto -@com_google_googleapis//google/cloud/managedkafka/v1:managed_kafka.proto -@com_google_googleapis//google/cloud/managedkafka/v1:managed_kafka_connect.proto -@com_google_googleapis//google/cloud/managedkafka/v1:resources.proto +@googleapis//google/cloud/managedkafka/schemaregistry/v1:schema_registry.proto +@googleapis//google/cloud/managedkafka/schemaregistry/v1:schema_registry_resources.proto +@googleapis//google/cloud/managedkafka/v1:managed_kafka.proto +@googleapis//google/cloud/managedkafka/v1:managed_kafka_connect.proto +@googleapis//google/cloud/managedkafka/v1:resources.proto diff --git a/external/googleapis/protolists/memcache.list b/external/googleapis/protolists/memcache.list index 3e67d6855bf9c..6e6962ff4823a 100644 --- a/external/googleapis/protolists/memcache.list +++ b/external/googleapis/protolists/memcache.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/memcache/v1:cloud_memcache.proto +@googleapis//google/cloud/memcache/v1:cloud_memcache.proto diff --git a/external/googleapis/protolists/memorystore.list b/external/googleapis/protolists/memorystore.list index 2b9be63a9d600..4d7355e8fd396 100644 --- a/external/googleapis/protolists/memorystore.list +++ b/external/googleapis/protolists/memorystore.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/memorystore/v1:memorystore.proto +@googleapis//google/cloud/memorystore/v1:memorystore.proto diff --git a/external/googleapis/protolists/metastore.list b/external/googleapis/protolists/metastore.list index 5eb58d3e1c6f4..744e3350a2fcc 100644 --- a/external/googleapis/protolists/metastore.list +++ b/external/googleapis/protolists/metastore.list @@ -1,3 +1,3 @@ -@com_google_googleapis//google/cloud/metastore/logging/v1:log_streams.proto -@com_google_googleapis//google/cloud/metastore/v1:metastore.proto -@com_google_googleapis//google/cloud/metastore/v1:metastore_federation.proto +@googleapis//google/cloud/metastore/logging/v1:log_streams.proto +@googleapis//google/cloud/metastore/v1:metastore.proto +@googleapis//google/cloud/metastore/v1:metastore_federation.proto diff --git a/external/googleapis/protolists/migrationcenter.list b/external/googleapis/protolists/migrationcenter.list index f08c9c1eab9b1..bdb3b2aa300c4 100644 --- a/external/googleapis/protolists/migrationcenter.list +++ b/external/googleapis/protolists/migrationcenter.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/migrationcenter/v1:migrationcenter.proto +@googleapis//google/cloud/migrationcenter/v1:migrationcenter.proto diff --git a/external/googleapis/protolists/monitoring.list b/external/googleapis/protolists/monitoring.list index 378157448fd33..68b7571fb8705 100644 --- a/external/googleapis/protolists/monitoring.list +++ b/external/googleapis/protolists/monitoring.list @@ -1,43 +1,43 @@ -@com_google_googleapis//google/monitoring/dashboard/v1:alertchart.proto -@com_google_googleapis//google/monitoring/dashboard/v1:collapsible_group.proto -@com_google_googleapis//google/monitoring/dashboard/v1:common.proto -@com_google_googleapis//google/monitoring/dashboard/v1:dashboard.proto -@com_google_googleapis//google/monitoring/dashboard/v1:dashboard_filter.proto -@com_google_googleapis//google/monitoring/dashboard/v1:dashboards_service.proto -@com_google_googleapis//google/monitoring/dashboard/v1:drilldowns.proto -@com_google_googleapis//google/monitoring/dashboard/v1:error_reporting_panel.proto -@com_google_googleapis//google/monitoring/dashboard/v1:incident_list.proto -@com_google_googleapis//google/monitoring/dashboard/v1:layouts.proto -@com_google_googleapis//google/monitoring/dashboard/v1:logs_panel.proto -@com_google_googleapis//google/monitoring/dashboard/v1:metrics.proto -@com_google_googleapis//google/monitoring/dashboard/v1:piechart.proto -@com_google_googleapis//google/monitoring/dashboard/v1:scorecard.proto -@com_google_googleapis//google/monitoring/dashboard/v1:section_header.proto -@com_google_googleapis//google/monitoring/dashboard/v1:service.proto -@com_google_googleapis//google/monitoring/dashboard/v1:single_view_group.proto -@com_google_googleapis//google/monitoring/dashboard/v1:table.proto -@com_google_googleapis//google/monitoring/dashboard/v1:table_display_options.proto -@com_google_googleapis//google/monitoring/dashboard/v1:text.proto -@com_google_googleapis//google/monitoring/dashboard/v1:widget.proto -@com_google_googleapis//google/monitoring/dashboard/v1:xychart.proto -@com_google_googleapis//google/monitoring/metricsscope/v1:metrics_scope.proto -@com_google_googleapis//google/monitoring/metricsscope/v1:metrics_scopes.proto -@com_google_googleapis//google/monitoring/v3:alert.proto -@com_google_googleapis//google/monitoring/v3:alert_service.proto -@com_google_googleapis//google/monitoring/v3:common.proto -@com_google_googleapis//google/monitoring/v3:dropped_labels.proto -@com_google_googleapis//google/monitoring/v3:group.proto -@com_google_googleapis//google/monitoring/v3:group_service.proto -@com_google_googleapis//google/monitoring/v3:metric.proto -@com_google_googleapis//google/monitoring/v3:metric_service.proto -@com_google_googleapis//google/monitoring/v3:mutation_record.proto -@com_google_googleapis//google/monitoring/v3:notification.proto -@com_google_googleapis//google/monitoring/v3:notification_service.proto -@com_google_googleapis//google/monitoring/v3:query_service.proto -@com_google_googleapis//google/monitoring/v3:service.proto -@com_google_googleapis//google/monitoring/v3:service_service.proto -@com_google_googleapis//google/monitoring/v3:snooze.proto -@com_google_googleapis//google/monitoring/v3:snooze_service.proto -@com_google_googleapis//google/monitoring/v3:span_context.proto -@com_google_googleapis//google/monitoring/v3:uptime.proto -@com_google_googleapis//google/monitoring/v3:uptime_service.proto +@googleapis//google/monitoring/dashboard/v1:alertchart.proto +@googleapis//google/monitoring/dashboard/v1:collapsible_group.proto +@googleapis//google/monitoring/dashboard/v1:common.proto +@googleapis//google/monitoring/dashboard/v1:dashboard.proto +@googleapis//google/monitoring/dashboard/v1:dashboard_filter.proto +@googleapis//google/monitoring/dashboard/v1:dashboards_service.proto +@googleapis//google/monitoring/dashboard/v1:drilldowns.proto +@googleapis//google/monitoring/dashboard/v1:error_reporting_panel.proto +@googleapis//google/monitoring/dashboard/v1:incident_list.proto +@googleapis//google/monitoring/dashboard/v1:layouts.proto +@googleapis//google/monitoring/dashboard/v1:logs_panel.proto +@googleapis//google/monitoring/dashboard/v1:metrics.proto +@googleapis//google/monitoring/dashboard/v1:piechart.proto +@googleapis//google/monitoring/dashboard/v1:scorecard.proto +@googleapis//google/monitoring/dashboard/v1:section_header.proto +@googleapis//google/monitoring/dashboard/v1:service.proto +@googleapis//google/monitoring/dashboard/v1:single_view_group.proto +@googleapis//google/monitoring/dashboard/v1:table.proto +@googleapis//google/monitoring/dashboard/v1:table_display_options.proto +@googleapis//google/monitoring/dashboard/v1:text.proto +@googleapis//google/monitoring/dashboard/v1:widget.proto +@googleapis//google/monitoring/dashboard/v1:xychart.proto +@googleapis//google/monitoring/metricsscope/v1:metrics_scope.proto +@googleapis//google/monitoring/metricsscope/v1:metrics_scopes.proto +@googleapis//google/monitoring/v3:alert.proto +@googleapis//google/monitoring/v3:alert_service.proto +@googleapis//google/monitoring/v3:common.proto +@googleapis//google/monitoring/v3:dropped_labels.proto +@googleapis//google/monitoring/v3:group.proto +@googleapis//google/monitoring/v3:group_service.proto +@googleapis//google/monitoring/v3:metric.proto +@googleapis//google/monitoring/v3:metric_service.proto +@googleapis//google/monitoring/v3:mutation_record.proto +@googleapis//google/monitoring/v3:notification.proto +@googleapis//google/monitoring/v3:notification_service.proto +@googleapis//google/monitoring/v3:query_service.proto +@googleapis//google/monitoring/v3:service.proto +@googleapis//google/monitoring/v3:service_service.proto +@googleapis//google/monitoring/v3:snooze.proto +@googleapis//google/monitoring/v3:snooze_service.proto +@googleapis//google/monitoring/v3:span_context.proto +@googleapis//google/monitoring/v3:uptime.proto +@googleapis//google/monitoring/v3:uptime_service.proto diff --git a/external/googleapis/protolists/netapp.list b/external/googleapis/protolists/netapp.list index c0a7a143007c8..81afccaa277b6 100644 --- a/external/googleapis/protolists/netapp.list +++ b/external/googleapis/protolists/netapp.list @@ -1,13 +1,14 @@ -@com_google_googleapis//google/cloud/netapp/v1:active_directory.proto -@com_google_googleapis//google/cloud/netapp/v1:backup.proto -@com_google_googleapis//google/cloud/netapp/v1:backup_policy.proto -@com_google_googleapis//google/cloud/netapp/v1:backup_vault.proto -@com_google_googleapis//google/cloud/netapp/v1:cloud_netapp_service.proto -@com_google_googleapis//google/cloud/netapp/v1:common.proto -@com_google_googleapis//google/cloud/netapp/v1:host_group.proto -@com_google_googleapis//google/cloud/netapp/v1:kms.proto -@com_google_googleapis//google/cloud/netapp/v1:quota_rule.proto -@com_google_googleapis//google/cloud/netapp/v1:replication.proto -@com_google_googleapis//google/cloud/netapp/v1:snapshot.proto -@com_google_googleapis//google/cloud/netapp/v1:storage_pool.proto -@com_google_googleapis//google/cloud/netapp/v1:volume.proto +@googleapis//google/cloud/netapp/v1:active_directory.proto +@googleapis//google/cloud/netapp/v1:backup.proto +@googleapis//google/cloud/netapp/v1:backup_policy.proto +@googleapis//google/cloud/netapp/v1:backup_vault.proto +@googleapis//google/cloud/netapp/v1:cloud_netapp_service.proto +@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 +@googleapis//google/cloud/netapp/v1:storage_pool.proto +@googleapis//google/cloud/netapp/v1:volume.proto diff --git a/external/googleapis/protolists/networkconnectivity.list b/external/googleapis/protolists/networkconnectivity.list index ae27f5c6d90b3..a1edd2a0e982a 100644 --- a/external/googleapis/protolists/networkconnectivity.list +++ b/external/googleapis/protolists/networkconnectivity.list @@ -1,6 +1,6 @@ -@com_google_googleapis//google/cloud/networkconnectivity/v1:common.proto -@com_google_googleapis//google/cloud/networkconnectivity/v1:cross_network_automation.proto -@com_google_googleapis//google/cloud/networkconnectivity/v1:data_transfer.proto -@com_google_googleapis//google/cloud/networkconnectivity/v1:hub.proto -@com_google_googleapis//google/cloud/networkconnectivity/v1:internal_range.proto -@com_google_googleapis//google/cloud/networkconnectivity/v1:policy_based_routing.proto +@googleapis//google/cloud/networkconnectivity/v1:common.proto +@googleapis//google/cloud/networkconnectivity/v1:cross_network_automation.proto +@googleapis//google/cloud/networkconnectivity/v1:data_transfer.proto +@googleapis//google/cloud/networkconnectivity/v1:hub.proto +@googleapis//google/cloud/networkconnectivity/v1:internal_range.proto +@googleapis//google/cloud/networkconnectivity/v1:policy_based_routing.proto diff --git a/external/googleapis/protolists/networkmanagement.list b/external/googleapis/protolists/networkmanagement.list index fb9f1ff700015..2ac265aa9d7eb 100644 --- a/external/googleapis/protolists/networkmanagement.list +++ b/external/googleapis/protolists/networkmanagement.list @@ -1,5 +1,5 @@ -@com_google_googleapis//google/cloud/networkmanagement/v1:connectivity_test.proto -@com_google_googleapis//google/cloud/networkmanagement/v1:reachability.proto -@com_google_googleapis//google/cloud/networkmanagement/v1:trace.proto -@com_google_googleapis//google/cloud/networkmanagement/v1:vpc_flow_logs.proto -@com_google_googleapis//google/cloud/networkmanagement/v1:vpc_flow_logs_config.proto +@googleapis//google/cloud/networkmanagement/v1:connectivity_test.proto +@googleapis//google/cloud/networkmanagement/v1:reachability.proto +@googleapis//google/cloud/networkmanagement/v1:trace.proto +@googleapis//google/cloud/networkmanagement/v1:vpc_flow_logs.proto +@googleapis//google/cloud/networkmanagement/v1:vpc_flow_logs_config.proto diff --git a/external/googleapis/protolists/networksecurity.list b/external/googleapis/protolists/networksecurity.list index 4303002c9cd51..3d32c110ba98f 100644 --- a/external/googleapis/protolists/networksecurity.list +++ b/external/googleapis/protolists/networksecurity.list @@ -1,7 +1,23 @@ -@com_google_googleapis//google/cloud/networksecurity/v1:address_group.proto -@com_google_googleapis//google/cloud/networksecurity/v1:authorization_policy.proto -@com_google_googleapis//google/cloud/networksecurity/v1:client_tls_policy.proto -@com_google_googleapis//google/cloud/networksecurity/v1:common.proto -@com_google_googleapis//google/cloud/networksecurity/v1:network_security.proto -@com_google_googleapis//google/cloud/networksecurity/v1:server_tls_policy.proto -@com_google_googleapis//google/cloud/networksecurity/v1:tls.proto +@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/networkservices.list b/external/googleapis/protolists/networkservices.list index b74da16242691..92670c8db8031 100644 --- a/external/googleapis/protolists/networkservices.list +++ b/external/googleapis/protolists/networkservices.list @@ -1,14 +1,14 @@ -@com_google_googleapis//google/cloud/networkservices/v1:common.proto -@com_google_googleapis//google/cloud/networkservices/v1:dep.proto -@com_google_googleapis//google/cloud/networkservices/v1:endpoint_policy.proto -@com_google_googleapis//google/cloud/networkservices/v1:extensibility.proto -@com_google_googleapis//google/cloud/networkservices/v1:gateway.proto -@com_google_googleapis//google/cloud/networkservices/v1:grpc_route.proto -@com_google_googleapis//google/cloud/networkservices/v1:http_route.proto -@com_google_googleapis//google/cloud/networkservices/v1:mesh.proto -@com_google_googleapis//google/cloud/networkservices/v1:network_services.proto -@com_google_googleapis//google/cloud/networkservices/v1:route_view.proto -@com_google_googleapis//google/cloud/networkservices/v1:service_binding.proto -@com_google_googleapis//google/cloud/networkservices/v1:service_lb_policy.proto -@com_google_googleapis//google/cloud/networkservices/v1:tcp_route.proto -@com_google_googleapis//google/cloud/networkservices/v1:tls_route.proto +@googleapis//google/cloud/networkservices/v1:common.proto +@googleapis//google/cloud/networkservices/v1:dep.proto +@googleapis//google/cloud/networkservices/v1:endpoint_policy.proto +@googleapis//google/cloud/networkservices/v1:extensibility.proto +@googleapis//google/cloud/networkservices/v1:gateway.proto +@googleapis//google/cloud/networkservices/v1:grpc_route.proto +@googleapis//google/cloud/networkservices/v1:http_route.proto +@googleapis//google/cloud/networkservices/v1:mesh.proto +@googleapis//google/cloud/networkservices/v1:network_services.proto +@googleapis//google/cloud/networkservices/v1:route_view.proto +@googleapis//google/cloud/networkservices/v1:service_binding.proto +@googleapis//google/cloud/networkservices/v1:service_lb_policy.proto +@googleapis//google/cloud/networkservices/v1:tcp_route.proto +@googleapis//google/cloud/networkservices/v1:tls_route.proto diff --git a/external/googleapis/protolists/notebooks.list b/external/googleapis/protolists/notebooks.list index 4d8373e3848dc..9fb3b4aa7e793 100644 --- a/external/googleapis/protolists/notebooks.list +++ b/external/googleapis/protolists/notebooks.list @@ -1,15 +1,15 @@ -@com_google_googleapis//google/cloud/notebooks/v1:diagnostic_config.proto -@com_google_googleapis//google/cloud/notebooks/v1:environment.proto -@com_google_googleapis//google/cloud/notebooks/v1:event.proto -@com_google_googleapis//google/cloud/notebooks/v1:execution.proto -@com_google_googleapis//google/cloud/notebooks/v1:instance.proto -@com_google_googleapis//google/cloud/notebooks/v1:instance_config.proto -@com_google_googleapis//google/cloud/notebooks/v1:managed_service.proto -@com_google_googleapis//google/cloud/notebooks/v1:runtime.proto -@com_google_googleapis//google/cloud/notebooks/v1:schedule.proto -@com_google_googleapis//google/cloud/notebooks/v1:service.proto -@com_google_googleapis//google/cloud/notebooks/v2:diagnostic_config.proto -@com_google_googleapis//google/cloud/notebooks/v2:event.proto -@com_google_googleapis//google/cloud/notebooks/v2:gce_setup.proto -@com_google_googleapis//google/cloud/notebooks/v2:instance.proto -@com_google_googleapis//google/cloud/notebooks/v2:service.proto +@googleapis//google/cloud/notebooks/v1:diagnostic_config.proto +@googleapis//google/cloud/notebooks/v1:environment.proto +@googleapis//google/cloud/notebooks/v1:event.proto +@googleapis//google/cloud/notebooks/v1:execution.proto +@googleapis//google/cloud/notebooks/v1:instance.proto +@googleapis//google/cloud/notebooks/v1:instance_config.proto +@googleapis//google/cloud/notebooks/v1:managed_service.proto +@googleapis//google/cloud/notebooks/v1:runtime.proto +@googleapis//google/cloud/notebooks/v1:schedule.proto +@googleapis//google/cloud/notebooks/v1:service.proto +@googleapis//google/cloud/notebooks/v2:diagnostic_config.proto +@googleapis//google/cloud/notebooks/v2:event.proto +@googleapis//google/cloud/notebooks/v2:gce_setup.proto +@googleapis//google/cloud/notebooks/v2:instance.proto +@googleapis//google/cloud/notebooks/v2:service.proto diff --git a/external/googleapis/protolists/optimization.list b/external/googleapis/protolists/optimization.list index cede1e4935509..99c814ce70592 100644 --- a/external/googleapis/protolists/optimization.list +++ b/external/googleapis/protolists/optimization.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/optimization/v1:async_model.proto -@com_google_googleapis//google/cloud/optimization/v1:fleet_routing.proto +@googleapis//google/cloud/optimization/v1:async_model.proto +@googleapis//google/cloud/optimization/v1:fleet_routing.proto diff --git a/external/googleapis/protolists/oracledatabase.list b/external/googleapis/protolists/oracledatabase.list index 4ab863e29dead..b2175edf2ace3 100644 --- a/external/googleapis/protolists/oracledatabase.list +++ b/external/googleapis/protolists/oracledatabase.list @@ -1,25 +1,25 @@ -@com_google_googleapis//google/cloud/oracledatabase/v1:autonomous_database.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:autonomous_database_character_set.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:autonomous_db_backup.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:autonomous_db_version.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:common.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:database.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:database_character_set.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:db_node.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:db_server.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:db_system.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:db_system_initial_storage_size.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:db_system_shape.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:db_version.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:entitlement.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:exadata_infra.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:exadb_vm_cluster.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:exascale_db_storage_vault.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:gi_version.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:location_metadata.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:minor_version.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:odb_network.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:odb_subnet.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:oracledatabase.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:pluggable_database.proto -@com_google_googleapis//google/cloud/oracledatabase/v1:vm_cluster.proto +@googleapis//google/cloud/oracledatabase/v1:autonomous_database.proto +@googleapis//google/cloud/oracledatabase/v1:autonomous_database_character_set.proto +@googleapis//google/cloud/oracledatabase/v1:autonomous_db_backup.proto +@googleapis//google/cloud/oracledatabase/v1:autonomous_db_version.proto +@googleapis//google/cloud/oracledatabase/v1:common.proto +@googleapis//google/cloud/oracledatabase/v1:database.proto +@googleapis//google/cloud/oracledatabase/v1:database_character_set.proto +@googleapis//google/cloud/oracledatabase/v1:db_node.proto +@googleapis//google/cloud/oracledatabase/v1:db_server.proto +@googleapis//google/cloud/oracledatabase/v1:db_system.proto +@googleapis//google/cloud/oracledatabase/v1:db_system_initial_storage_size.proto +@googleapis//google/cloud/oracledatabase/v1:db_system_shape.proto +@googleapis//google/cloud/oracledatabase/v1:db_version.proto +@googleapis//google/cloud/oracledatabase/v1:entitlement.proto +@googleapis//google/cloud/oracledatabase/v1:exadata_infra.proto +@googleapis//google/cloud/oracledatabase/v1:exadb_vm_cluster.proto +@googleapis//google/cloud/oracledatabase/v1:exascale_db_storage_vault.proto +@googleapis//google/cloud/oracledatabase/v1:gi_version.proto +@googleapis//google/cloud/oracledatabase/v1:location_metadata.proto +@googleapis//google/cloud/oracledatabase/v1:minor_version.proto +@googleapis//google/cloud/oracledatabase/v1:odb_network.proto +@googleapis//google/cloud/oracledatabase/v1:odb_subnet.proto +@googleapis//google/cloud/oracledatabase/v1:oracledatabase.proto +@googleapis//google/cloud/oracledatabase/v1:pluggable_database.proto +@googleapis//google/cloud/oracledatabase/v1:vm_cluster.proto diff --git a/external/googleapis/protolists/orgpolicy.list b/external/googleapis/protolists/orgpolicy.list index d817d0f1df97a..d635a01563a49 100644 --- a/external/googleapis/protolists/orgpolicy.list +++ b/external/googleapis/protolists/orgpolicy.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/orgpolicy/v2:constraint.proto -@com_google_googleapis//google/cloud/orgpolicy/v2:orgpolicy.proto +@googleapis//google/cloud/orgpolicy/v2:constraint.proto +@googleapis//google/cloud/orgpolicy/v2:orgpolicy.proto diff --git a/external/googleapis/protolists/osconfig.list b/external/googleapis/protolists/osconfig.list index 3e002ad07ca17..eb46136c55545 100644 --- a/external/googleapis/protolists/osconfig.list +++ b/external/googleapis/protolists/osconfig.list @@ -1,17 +1,17 @@ -@com_google_googleapis//google/cloud/osconfig/agentendpoint/v1:agentendpoint.proto -@com_google_googleapis//google/cloud/osconfig/agentendpoint/v1:config_common.proto -@com_google_googleapis//google/cloud/osconfig/agentendpoint/v1:inventory.proto -@com_google_googleapis//google/cloud/osconfig/agentendpoint/v1:os_policy.proto -@com_google_googleapis//google/cloud/osconfig/agentendpoint/v1:patch_jobs.proto -@com_google_googleapis//google/cloud/osconfig/agentendpoint/v1:tasks.proto -@com_google_googleapis//google/cloud/osconfig/agentendpoint/v1:vm_inventory.proto -@com_google_googleapis//google/cloud/osconfig/v1:inventory.proto -@com_google_googleapis//google/cloud/osconfig/v1:os_policy.proto -@com_google_googleapis//google/cloud/osconfig/v1:os_policy_assignment_reports.proto -@com_google_googleapis//google/cloud/osconfig/v1:os_policy_assignments.proto -@com_google_googleapis//google/cloud/osconfig/v1:osconfig_common.proto -@com_google_googleapis//google/cloud/osconfig/v1:osconfig_service.proto -@com_google_googleapis//google/cloud/osconfig/v1:osconfig_zonal_service.proto -@com_google_googleapis//google/cloud/osconfig/v1:patch_deployments.proto -@com_google_googleapis//google/cloud/osconfig/v1:patch_jobs.proto -@com_google_googleapis//google/cloud/osconfig/v1:vulnerability.proto +@googleapis//google/cloud/osconfig/agentendpoint/v1:agentendpoint.proto +@googleapis//google/cloud/osconfig/agentendpoint/v1:config_common.proto +@googleapis//google/cloud/osconfig/agentendpoint/v1:inventory.proto +@googleapis//google/cloud/osconfig/agentendpoint/v1:os_policy.proto +@googleapis//google/cloud/osconfig/agentendpoint/v1:patch_jobs.proto +@googleapis//google/cloud/osconfig/agentendpoint/v1:tasks.proto +@googleapis//google/cloud/osconfig/agentendpoint/v1:vm_inventory.proto +@googleapis//google/cloud/osconfig/v1:inventory.proto +@googleapis//google/cloud/osconfig/v1:os_policy.proto +@googleapis//google/cloud/osconfig/v1:os_policy_assignment_reports.proto +@googleapis//google/cloud/osconfig/v1:os_policy_assignments.proto +@googleapis//google/cloud/osconfig/v1:osconfig_common.proto +@googleapis//google/cloud/osconfig/v1:osconfig_service.proto +@googleapis//google/cloud/osconfig/v1:osconfig_zonal_service.proto +@googleapis//google/cloud/osconfig/v1:patch_deployments.proto +@googleapis//google/cloud/osconfig/v1:patch_jobs.proto +@googleapis//google/cloud/osconfig/v1:vulnerability.proto diff --git a/external/googleapis/protolists/oslogin.list b/external/googleapis/protolists/oslogin.list index 17d4b36451e60..65132fc0a09eb 100644 --- a/external/googleapis/protolists/oslogin.list +++ b/external/googleapis/protolists/oslogin.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/oslogin/common:common.proto -@com_google_googleapis//google/cloud/oslogin/v1:oslogin.proto +@googleapis//google/cloud/oslogin/common:common.proto +@googleapis//google/cloud/oslogin/v1:oslogin.proto diff --git a/external/googleapis/protolists/parallelstore.list b/external/googleapis/protolists/parallelstore.list index f2bba8e97dc84..3db79b6e13a1e 100644 --- a/external/googleapis/protolists/parallelstore.list +++ b/external/googleapis/protolists/parallelstore.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/parallelstore/v1:parallelstore.proto +@googleapis//google/cloud/parallelstore/v1:parallelstore.proto diff --git a/external/googleapis/protolists/parametermanager.list b/external/googleapis/protolists/parametermanager.list index 1667aadb7cd15..897b0def96d3f 100644 --- a/external/googleapis/protolists/parametermanager.list +++ b/external/googleapis/protolists/parametermanager.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/parametermanager/v1:service.proto +@googleapis//google/cloud/parametermanager/v1:service.proto diff --git a/external/googleapis/protolists/policysimulator.list b/external/googleapis/protolists/policysimulator.list index b142102b80ac5..5a1fecd4689a6 100644 --- a/external/googleapis/protolists/policysimulator.list +++ b/external/googleapis/protolists/policysimulator.list @@ -1,3 +1,3 @@ -@com_google_googleapis//google/cloud/policysimulator/v1:explanations.proto -@com_google_googleapis//google/cloud/policysimulator/v1:orgpolicy.proto -@com_google_googleapis//google/cloud/policysimulator/v1:simulator.proto +@googleapis//google/cloud/policysimulator/v1:explanations.proto +@googleapis//google/cloud/policysimulator/v1:orgpolicy.proto +@googleapis//google/cloud/policysimulator/v1:simulator.proto diff --git a/external/googleapis/protolists/policytroubleshooter.list b/external/googleapis/protolists/policytroubleshooter.list index d1eee16bdb7a6..f1069d1a0fc09 100644 --- a/external/googleapis/protolists/policytroubleshooter.list +++ b/external/googleapis/protolists/policytroubleshooter.list @@ -1,3 +1,3 @@ -@com_google_googleapis//google/cloud/policytroubleshooter/iam/v3:troubleshooter.proto -@com_google_googleapis//google/cloud/policytroubleshooter/v1:checker.proto -@com_google_googleapis//google/cloud/policytroubleshooter/v1:explanations.proto +@googleapis//google/cloud/policytroubleshooter/iam/v3:troubleshooter.proto +@googleapis//google/cloud/policytroubleshooter/v1:checker.proto +@googleapis//google/cloud/policytroubleshooter/v1:explanations.proto diff --git a/external/googleapis/protolists/privateca.list b/external/googleapis/protolists/privateca.list index daecfec413538..a98563539c742 100644 --- a/external/googleapis/protolists/privateca.list +++ b/external/googleapis/protolists/privateca.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/security/privateca/v1:resources.proto -@com_google_googleapis//google/cloud/security/privateca/v1:service.proto +@googleapis//google/cloud/security/privateca/v1:resources.proto +@googleapis//google/cloud/security/privateca/v1:service.proto diff --git a/external/googleapis/protolists/privilegedaccessmanager.list b/external/googleapis/protolists/privilegedaccessmanager.list index a62ebaa12a002..7d87db5e5f273 100644 --- a/external/googleapis/protolists/privilegedaccessmanager.list +++ b/external/googleapis/protolists/privilegedaccessmanager.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/privilegedaccessmanager/v1:privilegedaccessmanager.proto +@googleapis//google/cloud/privilegedaccessmanager/v1:privilegedaccessmanager.proto diff --git a/external/googleapis/protolists/profiler.list b/external/googleapis/protolists/profiler.list index 890099f603643..bcb4aa7fad9df 100644 --- a/external/googleapis/protolists/profiler.list +++ b/external/googleapis/protolists/profiler.list @@ -1 +1 @@ -@com_google_googleapis//google/devtools/cloudprofiler/v2:profiler.proto +@googleapis//google/devtools/cloudprofiler/v2:profiler.proto diff --git a/external/googleapis/protolists/publicca.list b/external/googleapis/protolists/publicca.list index ef80cc31777a5..26d3fcece6206 100644 --- a/external/googleapis/protolists/publicca.list +++ b/external/googleapis/protolists/publicca.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/security/publicca/v1:resources.proto -@com_google_googleapis//google/cloud/security/publicca/v1:service.proto +@googleapis//google/cloud/security/publicca/v1:resources.proto +@googleapis//google/cloud/security/publicca/v1:service.proto diff --git a/external/googleapis/protolists/pubsub.list b/external/googleapis/protolists/pubsub.list index 613ad8287ac85..b87f07346559e 100644 --- a/external/googleapis/protolists/pubsub.list +++ b/external/googleapis/protolists/pubsub.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/pubsub/v1:pubsub.proto -@com_google_googleapis//google/pubsub/v1:schema.proto +@googleapis//google/pubsub/v1:pubsub.proto +@googleapis//google/pubsub/v1:schema.proto diff --git a/external/googleapis/protolists/pubsublite.list b/external/googleapis/protolists/pubsublite.list index 432660ba52f1a..12e8c33cbd52b 100644 --- a/external/googleapis/protolists/pubsublite.list +++ b/external/googleapis/protolists/pubsublite.list @@ -1,6 +1,6 @@ -@com_google_googleapis//google/cloud/pubsublite/v1:admin.proto -@com_google_googleapis//google/cloud/pubsublite/v1:common.proto -@com_google_googleapis//google/cloud/pubsublite/v1:cursor.proto -@com_google_googleapis//google/cloud/pubsublite/v1:publisher.proto -@com_google_googleapis//google/cloud/pubsublite/v1:subscriber.proto -@com_google_googleapis//google/cloud/pubsublite/v1:topic_stats.proto +@googleapis//google/cloud/pubsublite/v1:admin.proto +@googleapis//google/cloud/pubsublite/v1:common.proto +@googleapis//google/cloud/pubsublite/v1:cursor.proto +@googleapis//google/cloud/pubsublite/v1:publisher.proto +@googleapis//google/cloud/pubsublite/v1:subscriber.proto +@googleapis//google/cloud/pubsublite/v1:topic_stats.proto diff --git a/external/googleapis/protolists/rapidmigrationassessment.list b/external/googleapis/protolists/rapidmigrationassessment.list index 381b0b6cea239..172e900b5a555 100644 --- a/external/googleapis/protolists/rapidmigrationassessment.list +++ b/external/googleapis/protolists/rapidmigrationassessment.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/rapidmigrationassessment/v1:api_entities.proto -@com_google_googleapis//google/cloud/rapidmigrationassessment/v1:rapidmigrationassessment.proto +@googleapis//google/cloud/rapidmigrationassessment/v1:api_entities.proto +@googleapis//google/cloud/rapidmigrationassessment/v1:rapidmigrationassessment.proto diff --git a/external/googleapis/protolists/recaptchaenterprise.list b/external/googleapis/protolists/recaptchaenterprise.list index 29a1d833e7a85..5f891628c92bc 100644 --- a/external/googleapis/protolists/recaptchaenterprise.list +++ b/external/googleapis/protolists/recaptchaenterprise.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/recaptchaenterprise/v1:recaptchaenterprise.proto +@googleapis//google/cloud/recaptchaenterprise/v1:recaptchaenterprise.proto diff --git a/external/googleapis/protolists/recommender.list b/external/googleapis/protolists/recommender.list index 26eec6bcc5fa1..28e011f336ff9 100644 --- a/external/googleapis/protolists/recommender.list +++ b/external/googleapis/protolists/recommender.list @@ -1,6 +1,6 @@ -@com_google_googleapis//google/cloud/recommender/logging/v1:action_log.proto -@com_google_googleapis//google/cloud/recommender/v1:insight.proto -@com_google_googleapis//google/cloud/recommender/v1:insight_type_config.proto -@com_google_googleapis//google/cloud/recommender/v1:recommendation.proto -@com_google_googleapis//google/cloud/recommender/v1:recommender_config.proto -@com_google_googleapis//google/cloud/recommender/v1:recommender_service.proto +@googleapis//google/cloud/recommender/logging/v1:action_log.proto +@googleapis//google/cloud/recommender/v1:insight.proto +@googleapis//google/cloud/recommender/v1:insight_type_config.proto +@googleapis//google/cloud/recommender/v1:recommendation.proto +@googleapis//google/cloud/recommender/v1:recommender_config.proto +@googleapis//google/cloud/recommender/v1:recommender_service.proto diff --git a/external/googleapis/protolists/redis.list b/external/googleapis/protolists/redis.list index 4586e2a40350b..84cb8152dd6d7 100644 --- a/external/googleapis/protolists/redis.list +++ b/external/googleapis/protolists/redis.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/redis/cluster/v1:cloud_redis_cluster.proto -@com_google_googleapis//google/cloud/redis/v1:cloud_redis.proto +@googleapis//google/cloud/redis/cluster/v1:cloud_redis_cluster.proto +@googleapis//google/cloud/redis/v1:cloud_redis.proto diff --git a/external/googleapis/protolists/resourcemanager.list b/external/googleapis/protolists/resourcemanager.list index 60f81aa13deb3..1b773586eb59b 100644 --- a/external/googleapis/protolists/resourcemanager.list +++ b/external/googleapis/protolists/resourcemanager.list @@ -1,7 +1,7 @@ -@com_google_googleapis//google/cloud/resourcemanager/v3:folders.proto -@com_google_googleapis//google/cloud/resourcemanager/v3:organizations.proto -@com_google_googleapis//google/cloud/resourcemanager/v3:projects.proto -@com_google_googleapis//google/cloud/resourcemanager/v3:tag_bindings.proto -@com_google_googleapis//google/cloud/resourcemanager/v3:tag_holds.proto -@com_google_googleapis//google/cloud/resourcemanager/v3:tag_keys.proto -@com_google_googleapis//google/cloud/resourcemanager/v3:tag_values.proto +@googleapis//google/cloud/resourcemanager/v3:folders.proto +@googleapis//google/cloud/resourcemanager/v3:organizations.proto +@googleapis//google/cloud/resourcemanager/v3:projects.proto +@googleapis//google/cloud/resourcemanager/v3:tag_bindings.proto +@googleapis//google/cloud/resourcemanager/v3:tag_holds.proto +@googleapis//google/cloud/resourcemanager/v3:tag_keys.proto +@googleapis//google/cloud/resourcemanager/v3:tag_values.proto diff --git a/external/googleapis/protolists/retail.list b/external/googleapis/protolists/retail.list index 58372766eea06..e3fe13ffb2a5e 100644 --- a/external/googleapis/protolists/retail.list +++ b/external/googleapis/protolists/retail.list @@ -1,25 +1,25 @@ -@com_google_googleapis//google/cloud/retail/v2:analytics_service.proto -@com_google_googleapis//google/cloud/retail/v2:catalog.proto -@com_google_googleapis//google/cloud/retail/v2:catalog_service.proto -@com_google_googleapis//google/cloud/retail/v2:common.proto -@com_google_googleapis//google/cloud/retail/v2:completion_service.proto -@com_google_googleapis//google/cloud/retail/v2:control.proto -@com_google_googleapis//google/cloud/retail/v2:control_service.proto -@com_google_googleapis//google/cloud/retail/v2:conversational_search_service.proto -@com_google_googleapis//google/cloud/retail/v2:export_config.proto -@com_google_googleapis//google/cloud/retail/v2:generative_question.proto -@com_google_googleapis//google/cloud/retail/v2:generative_question_service.proto -@com_google_googleapis//google/cloud/retail/v2:import_config.proto -@com_google_googleapis//google/cloud/retail/v2:model.proto -@com_google_googleapis//google/cloud/retail/v2:model_service.proto -@com_google_googleapis//google/cloud/retail/v2:prediction_service.proto -@com_google_googleapis//google/cloud/retail/v2:product.proto -@com_google_googleapis//google/cloud/retail/v2:product_service.proto -@com_google_googleapis//google/cloud/retail/v2:promotion.proto -@com_google_googleapis//google/cloud/retail/v2:purge_config.proto -@com_google_googleapis//google/cloud/retail/v2:safety.proto -@com_google_googleapis//google/cloud/retail/v2:search_service.proto -@com_google_googleapis//google/cloud/retail/v2:serving_config.proto -@com_google_googleapis//google/cloud/retail/v2:serving_config_service.proto -@com_google_googleapis//google/cloud/retail/v2:user_event.proto -@com_google_googleapis//google/cloud/retail/v2:user_event_service.proto +@googleapis//google/cloud/retail/v2:analytics_service.proto +@googleapis//google/cloud/retail/v2:catalog.proto +@googleapis//google/cloud/retail/v2:catalog_service.proto +@googleapis//google/cloud/retail/v2:common.proto +@googleapis//google/cloud/retail/v2:completion_service.proto +@googleapis//google/cloud/retail/v2:control.proto +@googleapis//google/cloud/retail/v2:control_service.proto +@googleapis//google/cloud/retail/v2:conversational_search_service.proto +@googleapis//google/cloud/retail/v2:export_config.proto +@googleapis//google/cloud/retail/v2:generative_question.proto +@googleapis//google/cloud/retail/v2:generative_question_service.proto +@googleapis//google/cloud/retail/v2:import_config.proto +@googleapis//google/cloud/retail/v2:model.proto +@googleapis//google/cloud/retail/v2:model_service.proto +@googleapis//google/cloud/retail/v2:prediction_service.proto +@googleapis//google/cloud/retail/v2:product.proto +@googleapis//google/cloud/retail/v2:product_service.proto +@googleapis//google/cloud/retail/v2:promotion.proto +@googleapis//google/cloud/retail/v2:purge_config.proto +@googleapis//google/cloud/retail/v2:safety.proto +@googleapis//google/cloud/retail/v2:search_service.proto +@googleapis//google/cloud/retail/v2:serving_config.proto +@googleapis//google/cloud/retail/v2:serving_config_service.proto +@googleapis//google/cloud/retail/v2:user_event.proto +@googleapis//google/cloud/retail/v2:user_event_service.proto diff --git a/external/googleapis/protolists/run.list b/external/googleapis/protolists/run.list index 5ebc6fc0f5ab6..55f5c2a3aaef1 100644 --- a/external/googleapis/protolists/run.list +++ b/external/googleapis/protolists/run.list @@ -1,19 +1,19 @@ -@com_google_googleapis//google/cloud/run/v2:build.proto -@com_google_googleapis//google/cloud/run/v2:condition.proto -@com_google_googleapis//google/cloud/run/v2:container_status.proto -@com_google_googleapis//google/cloud/run/v2:execution.proto -@com_google_googleapis//google/cloud/run/v2:execution_template.proto -@com_google_googleapis//google/cloud/run/v2:instance.proto -@com_google_googleapis//google/cloud/run/v2:instance_split.proto -@com_google_googleapis//google/cloud/run/v2:job.proto -@com_google_googleapis//google/cloud/run/v2:k8s.min.proto -@com_google_googleapis//google/cloud/run/v2:revision.proto -@com_google_googleapis//google/cloud/run/v2:revision_template.proto -@com_google_googleapis//google/cloud/run/v2:service.proto -@com_google_googleapis//google/cloud/run/v2:status.proto -@com_google_googleapis//google/cloud/run/v2:task.proto -@com_google_googleapis//google/cloud/run/v2:task_template.proto -@com_google_googleapis//google/cloud/run/v2:traffic_target.proto -@com_google_googleapis//google/cloud/run/v2:vendor_settings.proto -@com_google_googleapis//google/cloud/run/v2:worker_pool.proto -@com_google_googleapis//google/cloud/run/v2:worker_pool_revision_template.proto +@googleapis//google/cloud/run/v2:build.proto +@googleapis//google/cloud/run/v2:condition.proto +@googleapis//google/cloud/run/v2:container_status.proto +@googleapis//google/cloud/run/v2:execution.proto +@googleapis//google/cloud/run/v2:execution_template.proto +@googleapis//google/cloud/run/v2:instance.proto +@googleapis//google/cloud/run/v2:instance_split.proto +@googleapis//google/cloud/run/v2:job.proto +@googleapis//google/cloud/run/v2:k8s.min.proto +@googleapis//google/cloud/run/v2:revision.proto +@googleapis//google/cloud/run/v2:revision_template.proto +@googleapis//google/cloud/run/v2:service.proto +@googleapis//google/cloud/run/v2:status.proto +@googleapis//google/cloud/run/v2:task.proto +@googleapis//google/cloud/run/v2:task_template.proto +@googleapis//google/cloud/run/v2:traffic_target.proto +@googleapis//google/cloud/run/v2:vendor_settings.proto +@googleapis//google/cloud/run/v2:worker_pool.proto +@googleapis//google/cloud/run/v2:worker_pool_revision_template.proto diff --git a/external/googleapis/protolists/scheduler.list b/external/googleapis/protolists/scheduler.list index 9e9a8cfd27a51..c2ece6488eb77 100644 --- a/external/googleapis/protolists/scheduler.list +++ b/external/googleapis/protolists/scheduler.list @@ -1,3 +1,3 @@ -@com_google_googleapis//google/cloud/scheduler/v1:cloudscheduler.proto -@com_google_googleapis//google/cloud/scheduler/v1:job.proto -@com_google_googleapis//google/cloud/scheduler/v1:target.proto +@googleapis//google/cloud/scheduler/v1:cloudscheduler.proto +@googleapis//google/cloud/scheduler/v1:job.proto +@googleapis//google/cloud/scheduler/v1:target.proto diff --git a/external/googleapis/protolists/secretmanager.list b/external/googleapis/protolists/secretmanager.list index 5837622371b8e..eef868e48221c 100644 --- a/external/googleapis/protolists/secretmanager.list +++ b/external/googleapis/protolists/secretmanager.list @@ -1,3 +1,3 @@ -@com_google_googleapis//google/cloud/secretmanager/logging/v1:secret_event.proto -@com_google_googleapis//google/cloud/secretmanager/v1:resources.proto -@com_google_googleapis//google/cloud/secretmanager/v1:service.proto +@googleapis//google/cloud/secretmanager/logging/v1:secret_event.proto +@googleapis//google/cloud/secretmanager/v1:resources.proto +@googleapis//google/cloud/secretmanager/v1:service.proto diff --git a/external/googleapis/protolists/securesourcemanager.list b/external/googleapis/protolists/securesourcemanager.list index fe6a032f39e7a..79260e37a6055 100644 --- a/external/googleapis/protolists/securesourcemanager.list +++ b/external/googleapis/protolists/securesourcemanager.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/securesourcemanager/v1:secure_source_manager.proto +@googleapis//google/cloud/securesourcemanager/v1:secure_source_manager.proto diff --git a/external/googleapis/protolists/securitycenter.list b/external/googleapis/protolists/securitycenter.list index bca33514fa290..6210953e2c855 100644 --- a/external/googleapis/protolists/securitycenter.list +++ b/external/googleapis/protolists/securitycenter.list @@ -1,108 +1,110 @@ -@com_google_googleapis//google/cloud/securitycenter/v1:access.proto -@com_google_googleapis//google/cloud/securitycenter/v1:application.proto -@com_google_googleapis//google/cloud/securitycenter/v1:asset.proto -@com_google_googleapis//google/cloud/securitycenter/v1:attack_exposure.proto -@com_google_googleapis//google/cloud/securitycenter/v1:attack_path.proto -@com_google_googleapis//google/cloud/securitycenter/v1:backup_disaster_recovery.proto -@com_google_googleapis//google/cloud/securitycenter/v1:bigquery_export.proto -@com_google_googleapis//google/cloud/securitycenter/v1:cloud_armor.proto -@com_google_googleapis//google/cloud/securitycenter/v1:cloud_dlp_data_profile.proto -@com_google_googleapis//google/cloud/securitycenter/v1:cloud_dlp_inspection.proto -@com_google_googleapis//google/cloud/securitycenter/v1:compliance.proto -@com_google_googleapis//google/cloud/securitycenter/v1:connection.proto -@com_google_googleapis//google/cloud/securitycenter/v1:contact_details.proto -@com_google_googleapis//google/cloud/securitycenter/v1:container.proto -@com_google_googleapis//google/cloud/securitycenter/v1:database.proto -@com_google_googleapis//google/cloud/securitycenter/v1:effective_event_threat_detection_custom_module.proto -@com_google_googleapis//google/cloud/securitycenter/v1:effective_security_health_analytics_custom_module.proto -@com_google_googleapis//google/cloud/securitycenter/v1:event_threat_detection_custom_module.proto -@com_google_googleapis//google/cloud/securitycenter/v1:event_threat_detection_custom_module_validation_errors.proto -@com_google_googleapis//google/cloud/securitycenter/v1:exfiltration.proto -@com_google_googleapis//google/cloud/securitycenter/v1:external_system.proto -@com_google_googleapis//google/cloud/securitycenter/v1:file.proto -@com_google_googleapis//google/cloud/securitycenter/v1:finding.proto -@com_google_googleapis//google/cloud/securitycenter/v1:folder.proto -@com_google_googleapis//google/cloud/securitycenter/v1:group_membership.proto -@com_google_googleapis//google/cloud/securitycenter/v1:iam_binding.proto -@com_google_googleapis//google/cloud/securitycenter/v1:indicator.proto -@com_google_googleapis//google/cloud/securitycenter/v1:kernel_rootkit.proto -@com_google_googleapis//google/cloud/securitycenter/v1:kubernetes.proto -@com_google_googleapis//google/cloud/securitycenter/v1:label.proto -@com_google_googleapis//google/cloud/securitycenter/v1:load_balancer.proto -@com_google_googleapis//google/cloud/securitycenter/v1:log_entry.proto -@com_google_googleapis//google/cloud/securitycenter/v1:mitre_attack.proto -@com_google_googleapis//google/cloud/securitycenter/v1:mute_config.proto -@com_google_googleapis//google/cloud/securitycenter/v1:notebook.proto -@com_google_googleapis//google/cloud/securitycenter/v1:notification_config.proto -@com_google_googleapis//google/cloud/securitycenter/v1:notification_message.proto -@com_google_googleapis//google/cloud/securitycenter/v1:org_policy.proto -@com_google_googleapis//google/cloud/securitycenter/v1:organization_settings.proto -@com_google_googleapis//google/cloud/securitycenter/v1:process.proto -@com_google_googleapis//google/cloud/securitycenter/v1:resource.proto -@com_google_googleapis//google/cloud/securitycenter/v1:resource_value_config.proto -@com_google_googleapis//google/cloud/securitycenter/v1:run_asset_discovery_response.proto -@com_google_googleapis//google/cloud/securitycenter/v1:security_health_analytics_custom_config.proto -@com_google_googleapis//google/cloud/securitycenter/v1:security_health_analytics_custom_module.proto -@com_google_googleapis//google/cloud/securitycenter/v1:security_marks.proto -@com_google_googleapis//google/cloud/securitycenter/v1:security_posture.proto -@com_google_googleapis//google/cloud/securitycenter/v1:securitycenter_service.proto -@com_google_googleapis//google/cloud/securitycenter/v1:simulation.proto -@com_google_googleapis//google/cloud/securitycenter/v1:source.proto -@com_google_googleapis//google/cloud/securitycenter/v1:toxic_combination.proto -@com_google_googleapis//google/cloud/securitycenter/v1:valued_resource.proto -@com_google_googleapis//google/cloud/securitycenter/v1:vulnerability.proto -@com_google_googleapis//google/cloud/securitycenter/v2:access.proto -@com_google_googleapis//google/cloud/securitycenter/v2:affected_resources.proto -@com_google_googleapis//google/cloud/securitycenter/v2:ai_model.proto -@com_google_googleapis//google/cloud/securitycenter/v2:application.proto -@com_google_googleapis//google/cloud/securitycenter/v2:attack_exposure.proto -@com_google_googleapis//google/cloud/securitycenter/v2:attack_path.proto -@com_google_googleapis//google/cloud/securitycenter/v2:backup_disaster_recovery.proto -@com_google_googleapis//google/cloud/securitycenter/v2:bigquery_export.proto -@com_google_googleapis//google/cloud/securitycenter/v2:chokepoint.proto -@com_google_googleapis//google/cloud/securitycenter/v2:cloud_armor.proto -@com_google_googleapis//google/cloud/securitycenter/v2:cloud_dlp_data_profile.proto -@com_google_googleapis//google/cloud/securitycenter/v2:cloud_dlp_inspection.proto -@com_google_googleapis//google/cloud/securitycenter/v2:compliance.proto -@com_google_googleapis//google/cloud/securitycenter/v2:connection.proto -@com_google_googleapis//google/cloud/securitycenter/v2:contact_details.proto -@com_google_googleapis//google/cloud/securitycenter/v2:container.proto -@com_google_googleapis//google/cloud/securitycenter/v2:data_access_event.proto -@com_google_googleapis//google/cloud/securitycenter/v2:data_flow_event.proto -@com_google_googleapis//google/cloud/securitycenter/v2:data_retention_deletion_event.proto -@com_google_googleapis//google/cloud/securitycenter/v2:database.proto -@com_google_googleapis//google/cloud/securitycenter/v2:disk.proto -@com_google_googleapis//google/cloud/securitycenter/v2:exfiltration.proto -@com_google_googleapis//google/cloud/securitycenter/v2:external_system.proto -@com_google_googleapis//google/cloud/securitycenter/v2:file.proto -@com_google_googleapis//google/cloud/securitycenter/v2:finding.proto -@com_google_googleapis//google/cloud/securitycenter/v2:folder.proto -@com_google_googleapis//google/cloud/securitycenter/v2:group_membership.proto -@com_google_googleapis//google/cloud/securitycenter/v2:iam_binding.proto -@com_google_googleapis//google/cloud/securitycenter/v2:indicator.proto -@com_google_googleapis//google/cloud/securitycenter/v2:ip_rules.proto -@com_google_googleapis//google/cloud/securitycenter/v2:job.proto -@com_google_googleapis//google/cloud/securitycenter/v2:kernel_rootkit.proto -@com_google_googleapis//google/cloud/securitycenter/v2:kubernetes.proto -@com_google_googleapis//google/cloud/securitycenter/v2:label.proto -@com_google_googleapis//google/cloud/securitycenter/v2:load_balancer.proto -@com_google_googleapis//google/cloud/securitycenter/v2:log_entry.proto -@com_google_googleapis//google/cloud/securitycenter/v2:mitre_attack.proto -@com_google_googleapis//google/cloud/securitycenter/v2:mute_config.proto -@com_google_googleapis//google/cloud/securitycenter/v2:network.proto -@com_google_googleapis//google/cloud/securitycenter/v2:notebook.proto -@com_google_googleapis//google/cloud/securitycenter/v2:notification_config.proto -@com_google_googleapis//google/cloud/securitycenter/v2:notification_message.proto -@com_google_googleapis//google/cloud/securitycenter/v2:org_policy.proto -@com_google_googleapis//google/cloud/securitycenter/v2:process.proto -@com_google_googleapis//google/cloud/securitycenter/v2:resource.proto -@com_google_googleapis//google/cloud/securitycenter/v2:resource_value_config.proto -@com_google_googleapis//google/cloud/securitycenter/v2:security_marks.proto -@com_google_googleapis//google/cloud/securitycenter/v2:security_posture.proto -@com_google_googleapis//google/cloud/securitycenter/v2:securitycenter_service.proto -@com_google_googleapis//google/cloud/securitycenter/v2:simulation.proto -@com_google_googleapis//google/cloud/securitycenter/v2:source.proto -@com_google_googleapis//google/cloud/securitycenter/v2:toxic_combination.proto -@com_google_googleapis//google/cloud/securitycenter/v2:valued_resource.proto -@com_google_googleapis//google/cloud/securitycenter/v2:vertex_ai.proto -@com_google_googleapis//google/cloud/securitycenter/v2:vulnerability.proto +@googleapis//google/cloud/securitycenter/v1:access.proto +@googleapis//google/cloud/securitycenter/v1:application.proto +@googleapis//google/cloud/securitycenter/v1:asset.proto +@googleapis//google/cloud/securitycenter/v1:attack_exposure.proto +@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 +@googleapis//google/cloud/securitycenter/v1:compliance.proto +@googleapis//google/cloud/securitycenter/v1:connection.proto +@googleapis//google/cloud/securitycenter/v1:contact_details.proto +@googleapis//google/cloud/securitycenter/v1:container.proto +@googleapis//google/cloud/securitycenter/v1:database.proto +@googleapis//google/cloud/securitycenter/v1:effective_event_threat_detection_custom_module.proto +@googleapis//google/cloud/securitycenter/v1:effective_security_health_analytics_custom_module.proto +@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 +@googleapis//google/cloud/securitycenter/v1:folder.proto +@googleapis//google/cloud/securitycenter/v1:group_membership.proto +@googleapis//google/cloud/securitycenter/v1:iam_binding.proto +@googleapis//google/cloud/securitycenter/v1:indicator.proto +@googleapis//google/cloud/securitycenter/v1:kernel_rootkit.proto +@googleapis//google/cloud/securitycenter/v1:kubernetes.proto +@googleapis//google/cloud/securitycenter/v1:label.proto +@googleapis//google/cloud/securitycenter/v1:load_balancer.proto +@googleapis//google/cloud/securitycenter/v1:log_entry.proto +@googleapis//google/cloud/securitycenter/v1:mitre_attack.proto +@googleapis//google/cloud/securitycenter/v1:mute_config.proto +@googleapis//google/cloud/securitycenter/v1:notebook.proto +@googleapis//google/cloud/securitycenter/v1:notification_config.proto +@googleapis//google/cloud/securitycenter/v1:notification_message.proto +@googleapis//google/cloud/securitycenter/v1:org_policy.proto +@googleapis//google/cloud/securitycenter/v1:organization_settings.proto +@googleapis//google/cloud/securitycenter/v1:process.proto +@googleapis//google/cloud/securitycenter/v1:resource.proto +@googleapis//google/cloud/securitycenter/v1:resource_value_config.proto +@googleapis//google/cloud/securitycenter/v1:run_asset_discovery_response.proto +@googleapis//google/cloud/securitycenter/v1:security_health_analytics_custom_config.proto +@googleapis//google/cloud/securitycenter/v1:security_health_analytics_custom_module.proto +@googleapis//google/cloud/securitycenter/v1:security_marks.proto +@googleapis//google/cloud/securitycenter/v1:security_posture.proto +@googleapis//google/cloud/securitycenter/v1:securitycenter_service.proto +@googleapis//google/cloud/securitycenter/v1:simulation.proto +@googleapis//google/cloud/securitycenter/v1:source.proto +@googleapis//google/cloud/securitycenter/v1:toxic_combination.proto +@googleapis//google/cloud/securitycenter/v1:valued_resource.proto +@googleapis//google/cloud/securitycenter/v1:vulnerability.proto +@googleapis//google/cloud/securitycenter/v2:access.proto +@googleapis//google/cloud/securitycenter/v2:affected_resources.proto +@googleapis//google/cloud/securitycenter/v2:ai_model.proto +@googleapis//google/cloud/securitycenter/v2:application.proto +@googleapis//google/cloud/securitycenter/v2:attack_exposure.proto +@googleapis//google/cloud/securitycenter/v2:attack_path.proto +@googleapis//google/cloud/securitycenter/v2:backup_disaster_recovery.proto +@googleapis//google/cloud/securitycenter/v2:bigquery_export.proto +@googleapis//google/cloud/securitycenter/v2:chokepoint.proto +@googleapis//google/cloud/securitycenter/v2:cloud_armor.proto +@googleapis//google/cloud/securitycenter/v2:cloud_dlp_data_profile.proto +@googleapis//google/cloud/securitycenter/v2:cloud_dlp_inspection.proto +@googleapis//google/cloud/securitycenter/v2:compliance.proto +@googleapis//google/cloud/securitycenter/v2:connection.proto +@googleapis//google/cloud/securitycenter/v2:contact_details.proto +@googleapis//google/cloud/securitycenter/v2:container.proto +@googleapis//google/cloud/securitycenter/v2:data_access_event.proto +@googleapis//google/cloud/securitycenter/v2:data_flow_event.proto +@googleapis//google/cloud/securitycenter/v2:data_retention_deletion_event.proto +@googleapis//google/cloud/securitycenter/v2:database.proto +@googleapis//google/cloud/securitycenter/v2:disk.proto +@googleapis//google/cloud/securitycenter/v2:exfiltration.proto +@googleapis//google/cloud/securitycenter/v2:external_system.proto +@googleapis//google/cloud/securitycenter/v2:file.proto +@googleapis//google/cloud/securitycenter/v2:finding.proto +@googleapis//google/cloud/securitycenter/v2:folder.proto +@googleapis//google/cloud/securitycenter/v2:group_membership.proto +@googleapis//google/cloud/securitycenter/v2:iam_binding.proto +@googleapis//google/cloud/securitycenter/v2:indicator.proto +@googleapis//google/cloud/securitycenter/v2:ip_rules.proto +@googleapis//google/cloud/securitycenter/v2:job.proto +@googleapis//google/cloud/securitycenter/v2:kernel_rootkit.proto +@googleapis//google/cloud/securitycenter/v2:kubernetes.proto +@googleapis//google/cloud/securitycenter/v2:label.proto +@googleapis//google/cloud/securitycenter/v2:load_balancer.proto +@googleapis//google/cloud/securitycenter/v2:log_entry.proto +@googleapis//google/cloud/securitycenter/v2:mitre_attack.proto +@googleapis//google/cloud/securitycenter/v2:mute_config.proto +@googleapis//google/cloud/securitycenter/v2:network.proto +@googleapis//google/cloud/securitycenter/v2:notebook.proto +@googleapis//google/cloud/securitycenter/v2:notification_config.proto +@googleapis//google/cloud/securitycenter/v2:notification_message.proto +@googleapis//google/cloud/securitycenter/v2:org_policy.proto +@googleapis//google/cloud/securitycenter/v2:process.proto +@googleapis//google/cloud/securitycenter/v2:resource.proto +@googleapis//google/cloud/securitycenter/v2:resource_value_config.proto +@googleapis//google/cloud/securitycenter/v2:security_marks.proto +@googleapis//google/cloud/securitycenter/v2:security_posture.proto +@googleapis//google/cloud/securitycenter/v2:securitycenter_service.proto +@googleapis//google/cloud/securitycenter/v2:simulation.proto +@googleapis//google/cloud/securitycenter/v2:source.proto +@googleapis//google/cloud/securitycenter/v2:toxic_combination.proto +@googleapis//google/cloud/securitycenter/v2:valued_resource.proto +@googleapis//google/cloud/securitycenter/v2:vertex_ai.proto +@googleapis//google/cloud/securitycenter/v2:vulnerability.proto diff --git a/external/googleapis/protolists/securitycentermanagement.list b/external/googleapis/protolists/securitycentermanagement.list index 4304ce74912e9..fcbb29181b7b0 100644 --- a/external/googleapis/protolists/securitycentermanagement.list +++ b/external/googleapis/protolists/securitycentermanagement.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/securitycentermanagement/v1:security_center_management.proto +@googleapis//google/cloud/securitycentermanagement/v1:security_center_management.proto diff --git a/external/googleapis/protolists/servicecontrol.list b/external/googleapis/protolists/servicecontrol.list index fdc8678cf5f34..62ff470c9430b 100644 --- a/external/googleapis/protolists/servicecontrol.list +++ b/external/googleapis/protolists/servicecontrol.list @@ -1,9 +1,9 @@ -@com_google_googleapis//google/api/servicecontrol/v1:check_error.proto -@com_google_googleapis//google/api/servicecontrol/v1:distribution.proto -@com_google_googleapis//google/api/servicecontrol/v1:http_request.proto -@com_google_googleapis//google/api/servicecontrol/v1:log_entry.proto -@com_google_googleapis//google/api/servicecontrol/v1:metric_value.proto -@com_google_googleapis//google/api/servicecontrol/v1:operation.proto -@com_google_googleapis//google/api/servicecontrol/v1:quota_controller.proto -@com_google_googleapis//google/api/servicecontrol/v1:service_controller.proto -@com_google_googleapis//google/api/servicecontrol/v2:service_controller.proto +@googleapis//google/api/servicecontrol/v1:check_error.proto +@googleapis//google/api/servicecontrol/v1:distribution.proto +@googleapis//google/api/servicecontrol/v1:http_request.proto +@googleapis//google/api/servicecontrol/v1:log_entry.proto +@googleapis//google/api/servicecontrol/v1:metric_value.proto +@googleapis//google/api/servicecontrol/v1:operation.proto +@googleapis//google/api/servicecontrol/v1:quota_controller.proto +@googleapis//google/api/servicecontrol/v1:service_controller.proto +@googleapis//google/api/servicecontrol/v2:service_controller.proto diff --git a/external/googleapis/protolists/servicedirectory.list b/external/googleapis/protolists/servicedirectory.list index 9050ad50aa26f..e6089ac3a7115 100644 --- a/external/googleapis/protolists/servicedirectory.list +++ b/external/googleapis/protolists/servicedirectory.list @@ -1,5 +1,5 @@ -@com_google_googleapis//google/cloud/servicedirectory/v1:endpoint.proto -@com_google_googleapis//google/cloud/servicedirectory/v1:lookup_service.proto -@com_google_googleapis//google/cloud/servicedirectory/v1:namespace.proto -@com_google_googleapis//google/cloud/servicedirectory/v1:registration_service.proto -@com_google_googleapis//google/cloud/servicedirectory/v1:service.proto +@googleapis//google/cloud/servicedirectory/v1:endpoint.proto +@googleapis//google/cloud/servicedirectory/v1:lookup_service.proto +@googleapis//google/cloud/servicedirectory/v1:namespace.proto +@googleapis//google/cloud/servicedirectory/v1:registration_service.proto +@googleapis//google/cloud/servicedirectory/v1:service.proto diff --git a/external/googleapis/protolists/servicehealth.list b/external/googleapis/protolists/servicehealth.list index 371f08183aa41..6e1111e738ff1 100644 --- a/external/googleapis/protolists/servicehealth.list +++ b/external/googleapis/protolists/servicehealth.list @@ -1,3 +1,3 @@ -@com_google_googleapis//google/cloud/servicehealth/logging/v1:event_log.proto -@com_google_googleapis//google/cloud/servicehealth/v1:event_resources.proto -@com_google_googleapis//google/cloud/servicehealth/v1:event_service.proto +@googleapis//google/cloud/servicehealth/logging/v1:event_log.proto +@googleapis//google/cloud/servicehealth/v1:event_resources.proto +@googleapis//google/cloud/servicehealth/v1:event_service.proto diff --git a/external/googleapis/protolists/servicemanagement.list b/external/googleapis/protolists/servicemanagement.list index 70b3f804d1553..f75090e9809ba 100644 --- a/external/googleapis/protolists/servicemanagement.list +++ b/external/googleapis/protolists/servicemanagement.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/api/servicemanagement/v1:resources.proto -@com_google_googleapis//google/api/servicemanagement/v1:servicemanager.proto +@googleapis//google/api/servicemanagement/v1:resources.proto +@googleapis//google/api/servicemanagement/v1:servicemanager.proto diff --git a/external/googleapis/protolists/serviceusage.list b/external/googleapis/protolists/serviceusage.list index d565f298c4b8a..0e3d570162238 100644 --- a/external/googleapis/protolists/serviceusage.list +++ b/external/googleapis/protolists/serviceusage.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/api/serviceusage/v1:resources.proto -@com_google_googleapis//google/api/serviceusage/v1:serviceusage.proto +@googleapis//google/api/serviceusage/v1:resources.proto +@googleapis//google/api/serviceusage/v1:serviceusage.proto diff --git a/external/googleapis/protolists/shell.list b/external/googleapis/protolists/shell.list index faa9e1b53898e..b806640c6b53a 100644 --- a/external/googleapis/protolists/shell.list +++ b/external/googleapis/protolists/shell.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/shell/v1:cloudshell.proto +@googleapis//google/cloud/shell/v1:cloudshell.proto diff --git a/external/googleapis/protolists/spanner.list b/external/googleapis/protolists/spanner.list index 64d7b1ac0ea91..283fe697494fa 100644 --- a/external/googleapis/protolists/spanner.list +++ b/external/googleapis/protolists/spanner.list @@ -1,16 +1,16 @@ -@com_google_googleapis//google/spanner/admin/database/v1:backup.proto -@com_google_googleapis//google/spanner/admin/database/v1:backup_schedule.proto -@com_google_googleapis//google/spanner/admin/database/v1:common.proto -@com_google_googleapis//google/spanner/admin/database/v1:spanner_database_admin.proto -@com_google_googleapis//google/spanner/admin/instance/v1:common.proto -@com_google_googleapis//google/spanner/admin/instance/v1:spanner_instance_admin.proto -@com_google_googleapis//google/spanner/v1:change_stream.proto -@com_google_googleapis//google/spanner/v1:commit_response.proto -@com_google_googleapis//google/spanner/v1:keys.proto -@com_google_googleapis//google/spanner/v1:location.proto -@com_google_googleapis//google/spanner/v1:mutation.proto -@com_google_googleapis//google/spanner/v1:query_plan.proto -@com_google_googleapis//google/spanner/v1:result_set.proto -@com_google_googleapis//google/spanner/v1:spanner.proto -@com_google_googleapis//google/spanner/v1:transaction.proto -@com_google_googleapis//google/spanner/v1:type.proto +@googleapis//google/spanner/admin/database/v1:backup.proto +@googleapis//google/spanner/admin/database/v1:backup_schedule.proto +@googleapis//google/spanner/admin/database/v1:common.proto +@googleapis//google/spanner/admin/database/v1:spanner_database_admin.proto +@googleapis//google/spanner/admin/instance/v1:common.proto +@googleapis//google/spanner/admin/instance/v1:spanner_instance_admin.proto +@googleapis//google/spanner/v1:change_stream.proto +@googleapis//google/spanner/v1:commit_response.proto +@googleapis//google/spanner/v1:keys.proto +@googleapis//google/spanner/v1:location.proto +@googleapis//google/spanner/v1:mutation.proto +@googleapis//google/spanner/v1:query_plan.proto +@googleapis//google/spanner/v1:result_set.proto +@googleapis//google/spanner/v1:spanner.proto +@googleapis//google/spanner/v1:transaction.proto +@googleapis//google/spanner/v1:type.proto diff --git a/external/googleapis/protolists/speech.list b/external/googleapis/protolists/speech.list index 17363f4df7d53..99eca04ec9f45 100644 --- a/external/googleapis/protolists/speech.list +++ b/external/googleapis/protolists/speech.list @@ -1,5 +1,5 @@ -@com_google_googleapis//google/cloud/speech/v1:cloud_speech.proto -@com_google_googleapis//google/cloud/speech/v1:cloud_speech_adaptation.proto -@com_google_googleapis//google/cloud/speech/v1:resource.proto -@com_google_googleapis//google/cloud/speech/v2:cloud_speech.proto -@com_google_googleapis//google/cloud/speech/v2:locations_metadata.proto +@googleapis//google/cloud/speech/v1:cloud_speech.proto +@googleapis//google/cloud/speech/v1:cloud_speech_adaptation.proto +@googleapis//google/cloud/speech/v1:resource.proto +@googleapis//google/cloud/speech/v2:cloud_speech.proto +@googleapis//google/cloud/speech/v2:locations_metadata.proto diff --git a/external/googleapis/protolists/sql.list b/external/googleapis/protolists/sql.list index 72487de861210..989db332c0fc7 100644 --- a/external/googleapis/protolists/sql.list +++ b/external/googleapis/protolists/sql.list @@ -1,17 +1,17 @@ -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_available_database_versions.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_backup_runs.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_backups.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_connect.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_databases.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_events.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_feature_eligibility.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_flags.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_iam_policies.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_instance_names.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_instances.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_operations.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_regions.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_resources.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_ssl_certs.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_tiers.proto -@com_google_googleapis//google/cloud/sql/v1:cloud_sql_users.proto +@googleapis//google/cloud/sql/v1:cloud_sql_available_database_versions.proto +@googleapis//google/cloud/sql/v1:cloud_sql_backup_runs.proto +@googleapis//google/cloud/sql/v1:cloud_sql_backups.proto +@googleapis//google/cloud/sql/v1:cloud_sql_connect.proto +@googleapis//google/cloud/sql/v1:cloud_sql_databases.proto +@googleapis//google/cloud/sql/v1:cloud_sql_events.proto +@googleapis//google/cloud/sql/v1:cloud_sql_feature_eligibility.proto +@googleapis//google/cloud/sql/v1:cloud_sql_flags.proto +@googleapis//google/cloud/sql/v1:cloud_sql_iam_policies.proto +@googleapis//google/cloud/sql/v1:cloud_sql_instance_names.proto +@googleapis//google/cloud/sql/v1:cloud_sql_instances.proto +@googleapis//google/cloud/sql/v1:cloud_sql_operations.proto +@googleapis//google/cloud/sql/v1:cloud_sql_regions.proto +@googleapis//google/cloud/sql/v1:cloud_sql_resources.proto +@googleapis//google/cloud/sql/v1:cloud_sql_ssl_certs.proto +@googleapis//google/cloud/sql/v1:cloud_sql_tiers.proto +@googleapis//google/cloud/sql/v1:cloud_sql_users.proto diff --git a/external/googleapis/protolists/storage.list b/external/googleapis/protolists/storage.list index 69b9a97eff1c4..7874486032bb3 100644 --- a/external/googleapis/protolists/storage.list +++ b/external/googleapis/protolists/storage.list @@ -1 +1 @@ -@com_google_googleapis//google/storage/v2:storage.proto +@googleapis//google/storage/v2:storage.proto diff --git a/external/googleapis/protolists/storagebatchoperations.list b/external/googleapis/protolists/storagebatchoperations.list index 933ffabcfeaec..07b97aba1ee8b 100644 --- a/external/googleapis/protolists/storagebatchoperations.list +++ b/external/googleapis/protolists/storagebatchoperations.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/storagebatchoperations/v1:storage_batch_operations.proto -@com_google_googleapis//google/cloud/storagebatchoperations/v1:storage_batch_operations_types.proto +@googleapis//google/cloud/storagebatchoperations/v1:storage_batch_operations.proto +@googleapis//google/cloud/storagebatchoperations/v1:storage_batch_operations_types.proto diff --git a/external/googleapis/protolists/storagecontrol.list b/external/googleapis/protolists/storagecontrol.list index af50b603b5e44..facaa06bd4d82 100644 --- a/external/googleapis/protolists/storagecontrol.list +++ b/external/googleapis/protolists/storagecontrol.list @@ -1 +1 @@ -@com_google_googleapis//google/storage/control/v2:storage_control.proto +@googleapis//google/storage/control/v2:storage_control.proto diff --git a/external/googleapis/protolists/storageinsights.list b/external/googleapis/protolists/storageinsights.list index 3147e0bd0d9e9..de77e3541300c 100644 --- a/external/googleapis/protolists/storageinsights.list +++ b/external/googleapis/protolists/storageinsights.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/storageinsights/v1:storageinsights.proto +@googleapis//google/cloud/storageinsights/v1:storageinsights.proto diff --git a/external/googleapis/protolists/storagetransfer.list b/external/googleapis/protolists/storagetransfer.list index f3a7810e22021..2bf9743423e27 100644 --- a/external/googleapis/protolists/storagetransfer.list +++ b/external/googleapis/protolists/storagetransfer.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/storagetransfer/v1:transfer.proto -@com_google_googleapis//google/storagetransfer/v1:transfer_types.proto +@googleapis//google/storagetransfer/v1:transfer.proto +@googleapis//google/storagetransfer/v1:transfer_types.proto diff --git a/external/googleapis/protolists/support.list b/external/googleapis/protolists/support.list index 875f466b01c46..c93e53e76d5b5 100644 --- a/external/googleapis/protolists/support.list +++ b/external/googleapis/protolists/support.list @@ -1,8 +1,8 @@ -@com_google_googleapis//google/cloud/support/v2:actor.proto -@com_google_googleapis//google/cloud/support/v2:attachment.proto -@com_google_googleapis//google/cloud/support/v2:attachment_service.proto -@com_google_googleapis//google/cloud/support/v2:case.proto -@com_google_googleapis//google/cloud/support/v2:case_service.proto -@com_google_googleapis//google/cloud/support/v2:comment.proto -@com_google_googleapis//google/cloud/support/v2:comment_service.proto -@com_google_googleapis//google/cloud/support/v2:escalation.proto +@googleapis//google/cloud/support/v2:actor.proto +@googleapis//google/cloud/support/v2:attachment.proto +@googleapis//google/cloud/support/v2:attachment_service.proto +@googleapis//google/cloud/support/v2:case.proto +@googleapis//google/cloud/support/v2:case_service.proto +@googleapis//google/cloud/support/v2:comment.proto +@googleapis//google/cloud/support/v2:comment_service.proto +@googleapis//google/cloud/support/v2:escalation.proto diff --git a/external/googleapis/protolists/talent.list b/external/googleapis/protolists/talent.list index 9ed14f4ead85f..00e594f391196 100644 --- a/external/googleapis/protolists/talent.list +++ b/external/googleapis/protolists/talent.list @@ -1,12 +1,12 @@ -@com_google_googleapis//google/cloud/talent/v4:common.proto -@com_google_googleapis//google/cloud/talent/v4:company.proto -@com_google_googleapis//google/cloud/talent/v4:company_service.proto -@com_google_googleapis//google/cloud/talent/v4:completion_service.proto -@com_google_googleapis//google/cloud/talent/v4:event.proto -@com_google_googleapis//google/cloud/talent/v4:event_service.proto -@com_google_googleapis//google/cloud/talent/v4:filters.proto -@com_google_googleapis//google/cloud/talent/v4:histogram.proto -@com_google_googleapis//google/cloud/talent/v4:job.proto -@com_google_googleapis//google/cloud/talent/v4:job_service.proto -@com_google_googleapis//google/cloud/talent/v4:tenant.proto -@com_google_googleapis//google/cloud/talent/v4:tenant_service.proto +@googleapis//google/cloud/talent/v4:common.proto +@googleapis//google/cloud/talent/v4:company.proto +@googleapis//google/cloud/talent/v4:company_service.proto +@googleapis//google/cloud/talent/v4:completion_service.proto +@googleapis//google/cloud/talent/v4:event.proto +@googleapis//google/cloud/talent/v4:event_service.proto +@googleapis//google/cloud/talent/v4:filters.proto +@googleapis//google/cloud/talent/v4:histogram.proto +@googleapis//google/cloud/talent/v4:job.proto +@googleapis//google/cloud/talent/v4:job_service.proto +@googleapis//google/cloud/talent/v4:tenant.proto +@googleapis//google/cloud/talent/v4:tenant_service.proto diff --git a/external/googleapis/protolists/tasks.list b/external/googleapis/protolists/tasks.list index 052e131396663..6371fd6df42a5 100644 --- a/external/googleapis/protolists/tasks.list +++ b/external/googleapis/protolists/tasks.list @@ -1,4 +1,4 @@ -@com_google_googleapis//google/cloud/tasks/v2:cloudtasks.proto -@com_google_googleapis//google/cloud/tasks/v2:queue.proto -@com_google_googleapis//google/cloud/tasks/v2:target.proto -@com_google_googleapis//google/cloud/tasks/v2:task.proto +@googleapis//google/cloud/tasks/v2:cloudtasks.proto +@googleapis//google/cloud/tasks/v2:queue.proto +@googleapis//google/cloud/tasks/v2:target.proto +@googleapis//google/cloud/tasks/v2:task.proto diff --git a/external/googleapis/protolists/telcoautomation.list b/external/googleapis/protolists/telcoautomation.list index 6b81e7687af94..1c8a769149a36 100644 --- a/external/googleapis/protolists/telcoautomation.list +++ b/external/googleapis/protolists/telcoautomation.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/telcoautomation/v1:telcoautomation.proto +@googleapis//google/cloud/telcoautomation/v1:telcoautomation.proto diff --git a/external/googleapis/protolists/texttospeech.list b/external/googleapis/protolists/texttospeech.list index 0aae47d75b4f9..1622bfd784662 100644 --- a/external/googleapis/protolists/texttospeech.list +++ b/external/googleapis/protolists/texttospeech.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/texttospeech/v1:cloud_tts.proto -@com_google_googleapis//google/cloud/texttospeech/v1:cloud_tts_lrs.proto +@googleapis//google/cloud/texttospeech/v1:cloud_tts.proto +@googleapis//google/cloud/texttospeech/v1:cloud_tts_lrs.proto diff --git a/external/googleapis/protolists/timeseriesinsights.list b/external/googleapis/protolists/timeseriesinsights.list index f76afc3335aa4..143ef6b6a17c7 100644 --- a/external/googleapis/protolists/timeseriesinsights.list +++ b/external/googleapis/protolists/timeseriesinsights.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/timeseriesinsights/v1:timeseries_insights.proto +@googleapis//google/cloud/timeseriesinsights/v1:timeseries_insights.proto diff --git a/external/googleapis/protolists/tpu.list b/external/googleapis/protolists/tpu.list index 9ec3a2a29b809..31b72d3a2d18c 100644 --- a/external/googleapis/protolists/tpu.list +++ b/external/googleapis/protolists/tpu.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/tpu/v1:cloud_tpu.proto -@com_google_googleapis//google/cloud/tpu/v2:cloud_tpu.proto +@googleapis//google/cloud/tpu/v1:cloud_tpu.proto +@googleapis//google/cloud/tpu/v2:cloud_tpu.proto diff --git a/external/googleapis/protolists/trace.list b/external/googleapis/protolists/trace.list index bb199c12eecf3..d319a16df722a 100644 --- a/external/googleapis/protolists/trace.list +++ b/external/googleapis/protolists/trace.list @@ -1,3 +1,3 @@ -@com_google_googleapis//google/devtools/cloudtrace/v1:trace.proto -@com_google_googleapis//google/devtools/cloudtrace/v2:trace.proto -@com_google_googleapis//google/devtools/cloudtrace/v2:tracing.proto +@googleapis//google/devtools/cloudtrace/v1:trace.proto +@googleapis//google/devtools/cloudtrace/v2:trace.proto +@googleapis//google/devtools/cloudtrace/v2:tracing.proto diff --git a/external/googleapis/protolists/translate.list b/external/googleapis/protolists/translate.list index 6ce22d7561282..e18baadfb73d3 100644 --- a/external/googleapis/protolists/translate.list +++ b/external/googleapis/protolists/translate.list @@ -1,4 +1,4 @@ -@com_google_googleapis//google/cloud/translate/v3:adaptive_mt.proto -@com_google_googleapis//google/cloud/translate/v3:automl_translation.proto -@com_google_googleapis//google/cloud/translate/v3:common.proto -@com_google_googleapis//google/cloud/translate/v3:translation_service.proto +@googleapis//google/cloud/translate/v3:adaptive_mt.proto +@googleapis//google/cloud/translate/v3:automl_translation.proto +@googleapis//google/cloud/translate/v3:common.proto +@googleapis//google/cloud/translate/v3:translation_service.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/video.list b/external/googleapis/protolists/video.list index 1781b13fd8bd9..19195191f72fe 100644 --- a/external/googleapis/protolists/video.list +++ b/external/googleapis/protolists/video.list @@ -1,16 +1,16 @@ -@com_google_googleapis//google/cloud/video/livestream/v1:outputs.proto -@com_google_googleapis//google/cloud/video/livestream/v1:resources.proto -@com_google_googleapis//google/cloud/video/livestream/v1:service.proto -@com_google_googleapis//google/cloud/video/stitcher/v1:ad_tag_details.proto -@com_google_googleapis//google/cloud/video/stitcher/v1:cdn_keys.proto -@com_google_googleapis//google/cloud/video/stitcher/v1:companions.proto -@com_google_googleapis//google/cloud/video/stitcher/v1:events.proto -@com_google_googleapis//google/cloud/video/stitcher/v1:fetch_options.proto -@com_google_googleapis//google/cloud/video/stitcher/v1:live_configs.proto -@com_google_googleapis//google/cloud/video/stitcher/v1:sessions.proto -@com_google_googleapis//google/cloud/video/stitcher/v1:slates.proto -@com_google_googleapis//google/cloud/video/stitcher/v1:stitch_details.proto -@com_google_googleapis//google/cloud/video/stitcher/v1:video_stitcher_service.proto -@com_google_googleapis//google/cloud/video/stitcher/v1:vod_configs.proto -@com_google_googleapis//google/cloud/video/transcoder/v1:resources.proto -@com_google_googleapis//google/cloud/video/transcoder/v1:services.proto +@googleapis//google/cloud/video/livestream/v1:outputs.proto +@googleapis//google/cloud/video/livestream/v1:resources.proto +@googleapis//google/cloud/video/livestream/v1:service.proto +@googleapis//google/cloud/video/stitcher/v1:ad_tag_details.proto +@googleapis//google/cloud/video/stitcher/v1:cdn_keys.proto +@googleapis//google/cloud/video/stitcher/v1:companions.proto +@googleapis//google/cloud/video/stitcher/v1:events.proto +@googleapis//google/cloud/video/stitcher/v1:fetch_options.proto +@googleapis//google/cloud/video/stitcher/v1:live_configs.proto +@googleapis//google/cloud/video/stitcher/v1:sessions.proto +@googleapis//google/cloud/video/stitcher/v1:slates.proto +@googleapis//google/cloud/video/stitcher/v1:stitch_details.proto +@googleapis//google/cloud/video/stitcher/v1:video_stitcher_service.proto +@googleapis//google/cloud/video/stitcher/v1:vod_configs.proto +@googleapis//google/cloud/video/transcoder/v1:resources.proto +@googleapis//google/cloud/video/transcoder/v1:services.proto diff --git a/external/googleapis/protolists/videointelligence.list b/external/googleapis/protolists/videointelligence.list index e1b8829615f88..7400115525ca9 100644 --- a/external/googleapis/protolists/videointelligence.list +++ b/external/googleapis/protolists/videointelligence.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/videointelligence/v1:video_intelligence.proto +@googleapis//google/cloud/videointelligence/v1:video_intelligence.proto diff --git a/external/googleapis/protolists/vision.list b/external/googleapis/protolists/vision.list index ec2be6c85430c..f7dfd554bb52e 100644 --- a/external/googleapis/protolists/vision.list +++ b/external/googleapis/protolists/vision.list @@ -1,6 +1,6 @@ -@com_google_googleapis//google/cloud/vision/v1:geometry.proto -@com_google_googleapis//google/cloud/vision/v1:image_annotator.proto -@com_google_googleapis//google/cloud/vision/v1:product_search.proto -@com_google_googleapis//google/cloud/vision/v1:product_search_service.proto -@com_google_googleapis//google/cloud/vision/v1:text_annotation.proto -@com_google_googleapis//google/cloud/vision/v1:web_detection.proto +@googleapis//google/cloud/vision/v1:geometry.proto +@googleapis//google/cloud/vision/v1:image_annotator.proto +@googleapis//google/cloud/vision/v1:product_search.proto +@googleapis//google/cloud/vision/v1:product_search_service.proto +@googleapis//google/cloud/vision/v1:text_annotation.proto +@googleapis//google/cloud/vision/v1:web_detection.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/vmmigration.list b/external/googleapis/protolists/vmmigration.list index 1f35f0b6b0cde..5eae4fbf7f378 100644 --- a/external/googleapis/protolists/vmmigration.list +++ b/external/googleapis/protolists/vmmigration.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/vmmigration/v1:vmmigration.proto +@googleapis//google/cloud/vmmigration/v1:vmmigration.proto diff --git a/external/googleapis/protolists/vmwareengine.list b/external/googleapis/protolists/vmwareengine.list index 2d0f479d7a7d9..674ed166bcbfe 100644 --- a/external/googleapis/protolists/vmwareengine.list +++ b/external/googleapis/protolists/vmwareengine.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/vmwareengine/v1:vmwareengine.proto -@com_google_googleapis//google/cloud/vmwareengine/v1:vmwareengine_resources.proto +@googleapis//google/cloud/vmwareengine/v1:vmwareengine.proto +@googleapis//google/cloud/vmwareengine/v1:vmwareengine_resources.proto diff --git a/external/googleapis/protolists/vpcaccess.list b/external/googleapis/protolists/vpcaccess.list index 1480b40df7c4d..a87365fe77cd7 100644 --- a/external/googleapis/protolists/vpcaccess.list +++ b/external/googleapis/protolists/vpcaccess.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/vpcaccess/v1:vpc_access.proto +@googleapis//google/cloud/vpcaccess/v1:vpc_access.proto diff --git a/external/googleapis/protolists/webrisk.list b/external/googleapis/protolists/webrisk.list index b5d3deda4fcc7..fab89756a71cf 100644 --- a/external/googleapis/protolists/webrisk.list +++ b/external/googleapis/protolists/webrisk.list @@ -1 +1 @@ -@com_google_googleapis//google/cloud/webrisk/v1:webrisk.proto +@googleapis//google/cloud/webrisk/v1:webrisk.proto diff --git a/external/googleapis/protolists/websecurityscanner.list b/external/googleapis/protolists/websecurityscanner.list index 057a470df0fa9..79a5ace189be2 100644 --- a/external/googleapis/protolists/websecurityscanner.list +++ b/external/googleapis/protolists/websecurityscanner.list @@ -1,11 +1,11 @@ -@com_google_googleapis//google/cloud/websecurityscanner/v1:crawled_url.proto -@com_google_googleapis//google/cloud/websecurityscanner/v1:finding.proto -@com_google_googleapis//google/cloud/websecurityscanner/v1:finding_addon.proto -@com_google_googleapis//google/cloud/websecurityscanner/v1:finding_type_stats.proto -@com_google_googleapis//google/cloud/websecurityscanner/v1:scan_config.proto -@com_google_googleapis//google/cloud/websecurityscanner/v1:scan_config_error.proto -@com_google_googleapis//google/cloud/websecurityscanner/v1:scan_run.proto -@com_google_googleapis//google/cloud/websecurityscanner/v1:scan_run_error_trace.proto -@com_google_googleapis//google/cloud/websecurityscanner/v1:scan_run_log.proto -@com_google_googleapis//google/cloud/websecurityscanner/v1:scan_run_warning_trace.proto -@com_google_googleapis//google/cloud/websecurityscanner/v1:web_security_scanner.proto +@googleapis//google/cloud/websecurityscanner/v1:crawled_url.proto +@googleapis//google/cloud/websecurityscanner/v1:finding.proto +@googleapis//google/cloud/websecurityscanner/v1:finding_addon.proto +@googleapis//google/cloud/websecurityscanner/v1:finding_type_stats.proto +@googleapis//google/cloud/websecurityscanner/v1:scan_config.proto +@googleapis//google/cloud/websecurityscanner/v1:scan_config_error.proto +@googleapis//google/cloud/websecurityscanner/v1:scan_run.proto +@googleapis//google/cloud/websecurityscanner/v1:scan_run_error_trace.proto +@googleapis//google/cloud/websecurityscanner/v1:scan_run_log.proto +@googleapis//google/cloud/websecurityscanner/v1:scan_run_warning_trace.proto +@googleapis//google/cloud/websecurityscanner/v1:web_security_scanner.proto diff --git a/external/googleapis/protolists/workflows.list b/external/googleapis/protolists/workflows.list index ee98e517fc87b..bedfddc5834e5 100644 --- a/external/googleapis/protolists/workflows.list +++ b/external/googleapis/protolists/workflows.list @@ -1,4 +1,4 @@ -@com_google_googleapis//google/cloud/workflows/executions/v1:executions.proto -@com_google_googleapis//google/cloud/workflows/type:engine_call.proto -@com_google_googleapis//google/cloud/workflows/type:executions_system.proto -@com_google_googleapis//google/cloud/workflows/v1:workflows.proto +@googleapis//google/cloud/workflows/executions/v1:executions.proto +@googleapis//google/cloud/workflows/type:engine_call.proto +@googleapis//google/cloud/workflows/type:executions_system.proto +@googleapis//google/cloud/workflows/v1:workflows.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/protolists/workstations.list b/external/googleapis/protolists/workstations.list index e85920cb02c3c..11431de4aad29 100644 --- a/external/googleapis/protolists/workstations.list +++ b/external/googleapis/protolists/workstations.list @@ -1,2 +1,2 @@ -@com_google_googleapis//google/cloud/workstations/logging/v1:platform_logs.proto -@com_google_googleapis//google/cloud/workstations/v1:workstations.proto +@googleapis//google/cloud/workstations/logging/v1:platform_logs.proto +@googleapis//google/cloud/workstations/v1:workstations.proto diff --git a/external/googleapis/update_libraries.sh b/external/googleapis/update_libraries.sh index c31577a64e4a8..61ffb2995d108 100755 --- a/external/googleapis/update_libraries.sh +++ b/external/googleapis/update_libraries.sh @@ -16,343 +16,349 @@ set -euo pipefail declare -A -r LIBRARIES=( - ["accessapproval"]="@com_google_googleapis//google/cloud/accessapproval/v1:accessapproval_cc_grpc" + ["accessapproval"]="@googleapis//google/cloud/accessapproval/v1:accessapproval_cc_grpc" ["accesscontextmanager"]="$( printf ",%s" \ - "@com_google_googleapis//google/identity/accesscontextmanager/type:type_cc_grpc" \ - "@com_google_googleapis//google/identity/accesscontextmanager/v1:accesscontextmanager_cc_grpc" + "@googleapis//google/identity/accesscontextmanager/type:type_cc_grpc" \ + "@googleapis//google/identity/accesscontextmanager/v1:accesscontextmanager_cc_grpc" )" - ["advisorynotifications"]="@com_google_googleapis//google/cloud/advisorynotifications/v1:advisorynotifications_cc_grpc" + ["advisorynotifications"]="@googleapis//google/cloud/advisorynotifications/v1:advisorynotifications_cc_grpc" ["aiplatform"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/aiplatform/logging:logging_cc_grpc" \ - "@com_google_googleapis//google/cloud/aiplatform/v1:aiplatform_cc_grpc" \ - "@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/instance:instance_cc_grpc" \ - "@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/params:params_cc_grpc" \ - "@com_google_googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:prediction_cc_grpc" \ - "@com_google_googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:definition_cc_grpc" - )" - ["alloydb"]="@com_google_googleapis//google/cloud/alloydb/v1:alloydb_cc_grpc" - ["apigateway"]="@com_google_googleapis//google/cloud/apigateway/v1:apigateway_cc_grpc" - ["apigeeconnect"]="@com_google_googleapis//google/cloud/apigeeconnect/v1:apigeeconnect_cc_grpc" - ["apikeys"]="@com_google_googleapis//google/api/apikeys/v2:apikeys_cc_grpc" - ["apiregistry"]="@com_google_googleapis//google/cloud/apiregistry/v1:apiregistry_cc_grpc" + "@googleapis//google/cloud/aiplatform/logging:logging_cc_grpc" \ + "@googleapis//google/cloud/aiplatform/v1:aiplatform_cc_grpc" \ + "@googleapis//google/cloud/aiplatform/v1/schema/predict/instance:instance_cc_grpc" \ + "@googleapis//google/cloud/aiplatform/v1/schema/predict/params:params_cc_grpc" \ + "@googleapis//google/cloud/aiplatform/v1/schema/predict/prediction:prediction_cc_grpc" \ + "@googleapis//google/cloud/aiplatform/v1/schema/trainingjob/definition:definition_cc_grpc" + )" + ["alloydb"]="@googleapis//google/cloud/alloydb/v1:alloydb_cc_grpc" + ["apigateway"]="@googleapis//google/cloud/apigateway/v1:apigateway_cc_grpc" + ["apigeeconnect"]="@googleapis//google/cloud/apigeeconnect/v1:apigeeconnect_cc_grpc" + ["apikeys"]="@googleapis//google/api/apikeys/v2:apikeys_cc_grpc" + ["apiregistry"]="@googleapis//google/cloud/apiregistry/v1:apiregistry_cc_grpc" ["appengine"]="$( printf ",%s" \ - "@com_google_googleapis//google/appengine/v1:appengine_cc_grpc" \ - "@com_google_googleapis//google/appengine/logging/v1:logging_cc_grpc" \ - "@com_google_googleapis//google/appengine/legacy:legacy_cc_grpc" + "@googleapis//google/appengine/v1:appengine_cc_grpc" \ + "@googleapis//google/appengine/logging/v1:logging_cc_grpc" \ + "@googleapis//google/appengine/legacy:legacy_cc_grpc" )" - ["apphub"]="@com_google_googleapis//google/cloud/apphub/v1:apphub_cc_grpc" - ["artifactregistry"]="@com_google_googleapis//google/devtools/artifactregistry/v1:artifactregistry_cc_grpc" - ["asset"]="@com_google_googleapis//google/cloud/asset/v1:asset_cc_grpc" - ["assuredworkloads"]="@com_google_googleapis//google/cloud/assuredworkloads/v1:assuredworkloads_cc_grpc" - ["auditmanager"]="@com_google_googleapis//google/cloud/auditmanager/v1:auditmanager_cc_grpc" - ["automl"]="@com_google_googleapis//google/cloud/automl/v1:automl_cc_grpc" + ["apphub"]="@googleapis//google/cloud/apphub/v1:apphub_cc_grpc" + ["artifactregistry"]="@googleapis//google/devtools/artifactregistry/v1:artifactregistry_cc_grpc" + ["asset"]="@googleapis//google/cloud/asset/v1:asset_cc_grpc" + ["assuredworkloads"]="@googleapis//google/cloud/assuredworkloads/v1:assuredworkloads_cc_grpc" + ["auditmanager"]="@googleapis//google/cloud/auditmanager/v1:auditmanager_cc_grpc" + ["automl"]="@googleapis//google/cloud/automl/v1:automl_cc_grpc" ["backupdr"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/backupdr/v1:backupdr_cc_grpc" \ - "@com_google_googleapis//google/cloud/backupdr/logging/v1:logging_cc_grpc" + "@googleapis//google/cloud/backupdr/v1:backupdr_cc_grpc" \ + "@googleapis//google/cloud/backupdr/logging/v1:logging_cc_grpc" )" - ["baremetalsolution"]="@com_google_googleapis//google/cloud/baremetalsolution/v2:baremetalsolution_cc_grpc" - ["batch"]="@com_google_googleapis//google/cloud/batch/v1:batch_cc_grpc" + ["baremetalsolution"]="@googleapis//google/cloud/baremetalsolution/v2:baremetalsolution_cc_grpc" + ["batch"]="@googleapis//google/cloud/batch/v1:batch_cc_grpc" ["beyondcorp"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/beyondcorp/appconnections/v1:appconnections_cc_grpc" \ - "@com_google_googleapis//google/cloud/beyondcorp/appconnectors/v1:appconnectors_cc_grpc" \ - "@com_google_googleapis//google/cloud/beyondcorp/appgateways/v1:appgateways_cc_grpc" + "@googleapis//google/cloud/beyondcorp/appconnections/v1:appconnections_cc_grpc" \ + "@googleapis//google/cloud/beyondcorp/appconnectors/v1:appconnectors_cc_grpc" \ + "@googleapis//google/cloud/beyondcorp/appgateways/v1:appgateways_cc_grpc" )" ["bigquery"]="$( # This is long enough that it needs to be kept in alphabetical order printf ",%s" \ - "@com_google_googleapis//google/cloud/bigquery/analyticshub/v1:analyticshub_cc_grpc" \ - "@com_google_googleapis//google/cloud/bigquery/biglake/v1:biglake_cc_grpc" \ - "@com_google_googleapis//google/cloud/bigquery/connection/v1:connection_cc_grpc" \ - "@com_google_googleapis//google/cloud/bigquery/datapolicies/v1:datapolicies_cc_grpc" \ - "@com_google_googleapis//google/cloud/bigquery/datapolicies/v2:datapolicies_cc_grpc" \ - "@com_google_googleapis//google/cloud/bigquery/datatransfer/v1:datatransfer_cc_grpc" \ - "@com_google_googleapis//google/cloud/bigquery/logging/v1:logging_cc_grpc" \ - "@com_google_googleapis//google/cloud/bigquery/migration/v2:migration_cc_grpc" \ - "@com_google_googleapis//google/cloud/bigquery/reservation/v1:reservation_cc_grpc" \ - "@com_google_googleapis//google/cloud/bigquery/storage/v1:storage_cc_grpc" - )" - ["bigquerycontrol"]="@com_google_googleapis//google/cloud/bigquery/v2:bigquery_cc_proto" + "@googleapis//google/cloud/bigquery/analyticshub/v1:analyticshub_cc_grpc" \ + "@googleapis//google/cloud/bigquery/biglake/v1:biglake_cc_grpc" \ + "@googleapis//google/cloud/bigquery/connection/v1:connection_cc_grpc" \ + "@googleapis//google/cloud/bigquery/datapolicies/v1:datapolicies_cc_grpc" \ + "@googleapis//google/cloud/bigquery/datapolicies/v2:datapolicies_cc_grpc" \ + "@googleapis//google/cloud/bigquery/datatransfer/v1:datatransfer_cc_grpc" \ + "@googleapis//google/cloud/bigquery/logging/v1:logging_cc_grpc" \ + "@googleapis//google/cloud/bigquery/migration/v2:migration_cc_grpc" \ + "@googleapis//google/cloud/bigquery/reservation/v1:reservation_cc_grpc" \ + "@googleapis//google/cloud/bigquery/storage/v1:storage_cc_grpc" + )" + ["bigquerycontrol"]="@googleapis//google/cloud/bigquery/v2:bigquery_cc_proto" ["bigtable"]="$( printf ",%s" \ - "@com_google_googleapis//google/bigtable/v2:bigtable_cc_grpc" \ - "@com_google_googleapis//google/bigtable/admin/v2:admin_cc_grpc" + "@googleapis//google/bigtable/v2:bigtable_cc_grpc" \ + "@googleapis//google/bigtable/admin/v2:admin_cc_grpc" )" ["billing"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/billing/v1:billing_cc_grpc" \ - "@com_google_googleapis//google/cloud/billing/budgets/v1:budgets_cc_grpc" + "@googleapis//google/cloud/billing/v1:billing_cc_grpc" \ + "@googleapis//google/cloud/billing/budgets/v1:budgets_cc_grpc" )" - ["binaryauthorization"]="@com_google_googleapis//google/cloud/binaryauthorization/v1:binaryauthorization_cc_grpc" + ["binaryauthorization"]="@googleapis//google/cloud/binaryauthorization/v1:binaryauthorization_cc_grpc" ["certificatemanager"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/certificatemanager/logging/v1:logging_cc_grpc" \ - "@com_google_googleapis//google/cloud/certificatemanager/v1:certificatemanager_cc_grpc" + "@googleapis//google/cloud/certificatemanager/logging/v1:logging_cc_grpc" \ + "@googleapis//google/cloud/certificatemanager/v1:certificatemanager_cc_grpc" )" - ["channel"]="@com_google_googleapis//google/cloud/channel/v1:channel_cc_grpc" - ["chronicle"]="@com_google_googleapis//google/cloud/chronicle/v1:chronicle_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"]="$( printf ",%s" \ - "@com_google_googleapis//google/devtools/cloudbuild/v1:cloudbuild_cc_grpc" \ - "@com_google_googleapis//google/devtools/cloudbuild/v2:cloudbuild_cc_grpc" - )" - ["cloudcontrolspartner"]="@com_google_googleapis//google/cloud/cloudcontrolspartner/v1:cloudcontrolspartner_cc_grpc" - ["cloudquotas"]="@com_google_googleapis//google/api/cloudquotas/v1:cloudquotas_cc_grpc" - ["cloudsecuritycompliance"]="@com_google_googleapis//google/cloud/cloudsecuritycompliance/v1:cloudsecuritycompliance_cc_grpc" - ["commerce"]="@com_google_googleapis//google/cloud/commerce/consumer/procurement/v1:procurement_cc_grpc" - ["common"]="@com_google_googleapis//google/cloud/common:common_cc_grpc" - ["composer"]="@com_google_googleapis//google/cloud/orchestration/airflow/service/v1:service_cc_grpc" - ["confidentialcomputing"]="@com_google_googleapis//google/cloud/confidentialcomputing/v1:confidentialcomputing_cc_grpc" - ["config"]="@com_google_googleapis//google/cloud/config/v1:config_cc_grpc" - ["configdelivery"]="@com_google_googleapis//google/cloud/configdelivery/v1:configdelivery_cc_grpc" - ["connectors"]="@com_google_googleapis//google/cloud/connectors/v1:connectors_cc_grpc" - ["contactcenterinsights"]="@com_google_googleapis//google/cloud/contactcenterinsights/v1:contactcenterinsights_cc_grpc" - ["container"]="@com_google_googleapis//google/container/v1:container_cc_grpc" - ["containeranalysis"]="@com_google_googleapis//google/devtools/containeranalysis/v1:containeranalysis_cc_grpc" - ["contentwarehouse"]="@com_google_googleapis//google/cloud/contentwarehouse/v1:contentwarehouse_cc_grpc" + "@googleapis//google/devtools/cloudbuild/v1:cloudbuild_cc_grpc" \ + "@googleapis//google/devtools/cloudbuild/v2:cloudbuild_cc_grpc" + )" + ["cloudcontrolspartner"]="@googleapis//google/cloud/cloudcontrolspartner/v1:cloudcontrolspartner_cc_grpc" + ["cloudquotas"]="@googleapis//google/api/cloudquotas/v1:cloudquotas_cc_grpc" + ["cloudsecuritycompliance"]="@googleapis//google/cloud/cloudsecuritycompliance/v1:cloudsecuritycompliance_cc_grpc" + ["commerce"]="@googleapis//google/cloud/commerce/consumer/procurement/v1:procurement_cc_grpc" + ["common"]="@googleapis//google/cloud/common:common_cc_grpc" + ["composer"]="@googleapis//google/cloud/orchestration/airflow/service/v1:service_cc_grpc" + ["confidentialcomputing"]="@googleapis//google/cloud/confidentialcomputing/v1:confidentialcomputing_cc_grpc" + ["config"]="@googleapis//google/cloud/config/v1:config_cc_grpc" + ["configdelivery"]="@googleapis//google/cloud/configdelivery/v1:configdelivery_cc_grpc" + ["connectors"]="@googleapis//google/cloud/connectors/v1:connectors_cc_grpc" + ["contactcenterinsights"]="@googleapis//google/cloud/contactcenterinsights/v1:contactcenterinsights_cc_grpc" + ["container"]="@googleapis//google/container/v1:container_cc_grpc" + ["containeranalysis"]="@googleapis//google/devtools/containeranalysis/v1:containeranalysis_cc_grpc" + ["contentwarehouse"]="@googleapis//google/cloud/contentwarehouse/v1:contentwarehouse_cc_grpc" ["datacatalog"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/datacatalog/v1:datacatalog_cc_grpc" \ - "@com_google_googleapis//google/cloud/datacatalog/lineage/v1:lineage_cc_grpc" + "@googleapis//google/cloud/datacatalog/v1:datacatalog_cc_grpc" \ + "@googleapis//google/cloud/datacatalog/lineage/v1:lineage_cc_grpc" \ + "@googleapis//google/cloud/datacatalog/lineage/configmanagement/v1:configmanagement_cc_grpc" )" ["dataform"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/dataform/v1:dataform_cc_grpc" \ - "@com_google_googleapis//google/cloud/dataform/logging/v1:logging_cc_grpc" + "@googleapis//google/cloud/dataform/v1:dataform_cc_grpc" \ + "@googleapis//google/cloud/dataform/logging/v1:logging_cc_grpc" )" - ["datafusion"]="@com_google_googleapis//google/cloud/datafusion/v1:datafusion_cc_grpc" + ["datafusion"]="@googleapis//google/cloud/datafusion/v1:datafusion_cc_grpc" ["datamigration"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/clouddms/v1:clouddms_cc_grpc" \ - "@com_google_googleapis//google/cloud/clouddms/logging/v1:logging_cc_grpc" + "@googleapis//google/cloud/clouddms/v1:clouddms_cc_grpc" \ + "@googleapis//google/cloud/clouddms/logging/v1:logging_cc_grpc" )" - ["dataplex"]="@com_google_googleapis//google/cloud/dataplex/v1:dataplex_cc_grpc" - ["dataproc"]="@com_google_googleapis//google/cloud/dataproc/v1:dataproc_cc_grpc" + ["dataplex"]="@googleapis//google/cloud/dataplex/v1:dataplex_cc_grpc" + ["dataproc"]="@googleapis//google/cloud/dataproc/v1:dataproc_cc_grpc" ["datastore"]="$( printf ",%s" \ - "@com_google_googleapis//google/datastore/admin/v1:admin_cc_grpc" \ - "@com_google_googleapis//google/datastore/v1:datastore_cc_grpc" - )" - ["datastream"]="@com_google_googleapis//google/cloud/datastream/v1:datastream_cc_grpc" - ["deploy"]="@com_google_googleapis//google/cloud/deploy/v1:deploy_cc_grpc" - ["developerconnect"]="@com_google_googleapis//google/cloud/developerconnect/v1:developerconnect_cc_grpc" - ["devicestreaming"]="@com_google_googleapis//google/cloud/devicestreaming/v1:devicestreaming_cc_grpc" - ["dialogflow_es"]="@com_google_googleapis//google/cloud/dialogflow/v2:dialogflow_cc_grpc" - ["dialogflow_cx"]="@com_google_googleapis//google/cloud/dialogflow/cx/v3:cx_cc_grpc" - ["discoveryengine"]="@com_google_googleapis//google/cloud/discoveryengine/v1:discoveryengine_cc_grpc" - ["dlp"]="@com_google_googleapis//google/privacy/dlp/v2:dlp_cc_grpc" - ["documentai"]="@com_google_googleapis//google/cloud/documentai/v1:documentai_cc_grpc" - ["domains"]="@com_google_googleapis//google/cloud/domains/v1:domains_cc_grpc" - ["edgecontainer"]="@com_google_googleapis//google/cloud/edgecontainer/v1:edgecontainer_cc_grpc" - ["edgenetwork"]="@com_google_googleapis//google/cloud/edgenetwork/v1:edgenetwork_cc_grpc" - ["essentialcontacts"]="@com_google_googleapis//google/cloud/essentialcontacts/v1:essentialcontacts_cc_grpc" + "@googleapis//google/datastore/admin/v1:admin_cc_grpc" \ + "@googleapis//google/datastore/v1:datastore_cc_grpc" + )" + ["datastream"]="@googleapis//google/cloud/datastream/v1:datastream_cc_grpc" + ["deploy"]="@googleapis//google/cloud/deploy/v1:deploy_cc_grpc" + ["developerconnect"]="@googleapis//google/cloud/developerconnect/v1:developerconnect_cc_grpc" + ["devicestreaming"]="@googleapis//google/cloud/devicestreaming/v1:devicestreaming_cc_grpc" + ["dialogflow_es"]="@googleapis//google/cloud/dialogflow/v2:dialogflow_cc_grpc" + ["dialogflow_cx"]="@googleapis//google/cloud/dialogflow/cx/v3:cx_cc_grpc" + ["discoveryengine"]="@googleapis//google/cloud/discoveryengine/v1:discoveryengine_cc_grpc" + ["dlp"]="@googleapis//google/privacy/dlp/v2:dlp_cc_grpc" + ["documentai"]="@googleapis//google/cloud/documentai/v1:documentai_cc_grpc" + ["domains"]="@googleapis//google/cloud/domains/v1:domains_cc_grpc" + ["edgecontainer"]="@googleapis//google/cloud/edgecontainer/v1:edgecontainer_cc_grpc" + ["edgenetwork"]="@googleapis//google/cloud/edgenetwork/v1:edgenetwork_cc_grpc" + ["essentialcontacts"]="@googleapis//google/cloud/essentialcontacts/v1:essentialcontacts_cc_grpc" ["eventarc"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/eventarc/v1:eventarc_cc_grpc" \ - "@com_google_googleapis//google/cloud/eventarc/publishing/v1:publishing_cc_grpc" + "@googleapis//google/cloud/eventarc/v1:eventarc_cc_grpc" \ + "@googleapis//google/cloud/eventarc/publishing/v1:publishing_cc_grpc" )" - ["filestore"]="@com_google_googleapis//google/cloud/filestore/v1:filestore_cc_grpc" - ["financialservices"]="@com_google_googleapis//google/cloud/financialservices/v1:financialservices_cc_grpc" + ["filestore"]="@googleapis//google/cloud/filestore/v1:filestore_cc_grpc" + ["financialservices"]="@googleapis//google/cloud/financialservices/v1:financialservices_cc_grpc" ["functions"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/functions/v1:functions_cc_grpc" \ - "@com_google_googleapis//google/cloud/functions/v2:functions_cc_grpc" + "@googleapis//google/cloud/functions/v1:functions_cc_grpc" \ + "@googleapis//google/cloud/functions/v2:functions_cc_grpc" )" ["gkebackup"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/gkebackup/logging/v1:logging_cc_grpc" \ - "@com_google_googleapis//google/cloud/gkebackup/v1:gkebackup_cc_grpc" + "@googleapis//google/cloud/gkebackup/logging/v1:logging_cc_grpc" \ + "@googleapis//google/cloud/gkebackup/v1:gkebackup_cc_grpc" )" - ["gkeconnect"]="@com_google_googleapis//google/cloud/gkeconnect/gateway/v1:gateway_cc_grpc" - ["gkerecommender"]="@com_google_googleapis//google/cloud/gkerecommender/v1:gkerecommender_cc_grpc" + ["gkeconnect"]="@googleapis//google/cloud/gkeconnect/gateway/v1:gateway_cc_grpc" + ["gkerecommender"]="@googleapis//google/cloud/gkerecommender/v1:gkerecommender_cc_grpc" ["gkehub"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/gkehub/v1:gkehub_cc_grpc" \ - "@com_google_googleapis//google/cloud/gkehub/v1/multiclusteringress:multiclusteringress_cc_grpc" \ - "@com_google_googleapis//google/cloud/gkehub/v1/configmanagement:configmanagement_cc_grpc" - )" - ["gkemulticloud"]="@com_google_googleapis//google/cloud/gkemulticloud/v1:gkemulticloud_cc_grpc" - ["grafeas"]="@com_google_googleapis//grafeas/v1:grafeas_cc_grpc" - ["iam"]="@com_google_googleapis//google/iam/admin/v1:admin_cc_grpc" - ["iam_v2"]="@com_google_googleapis//google/iam/v2:iam_cc_grpc" - ["iam_v3"]="@com_google_googleapis//google/iam/v3:iam_cc_grpc" - ["iap"]="@com_google_googleapis//google/cloud/iap/v1:iap_cc_grpc" - ["ids"]="@com_google_googleapis//google/cloud/ids/v1:ids_cc_grpc" + "@googleapis//google/cloud/gkehub/v1:gkehub_cc_grpc" \ + "@googleapis//google/cloud/gkehub/v1/multiclusteringress:multiclusteringress_cc_grpc" \ + "@googleapis//google/cloud/gkehub/v1/configmanagement:configmanagement_cc_grpc" + )" + ["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" + ["iap"]="@googleapis//google/cloud/iap/v1:iap_cc_grpc" + ["ids"]="@googleapis//google/cloud/ids/v1:ids_cc_grpc" ["kms"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/kms/v1:kms_cc_grpc" \ - "@com_google_googleapis//google/cloud/kms/inventory/v1:inventory_cc_grpc" + "@googleapis//google/cloud/kms/v1:kms_cc_grpc" \ + "@googleapis//google/cloud/kms/inventory/v1:inventory_cc_grpc" )" ["language"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/language/v1:language_cc_grpc" \ - "@com_google_googleapis//google/cloud/language/v2:language_cc_grpc" + "@googleapis//google/cloud/language/v1:language_cc_grpc" \ + "@googleapis//google/cloud/language/v2:language_cc_grpc" )" - ["licensemanager"]="@com_google_googleapis//google/cloud/licensemanager/v1:licensemanager_cc_grpc" - ["logging_type"]="@com_google_googleapis//google/logging/type:type_cc_grpc" - ["logging"]="@com_google_googleapis//google/logging/v2:logging_cc_grpc" - ["lustre"]="@com_google_googleapis//google/cloud/lustre/v1:lustre_cc_grpc" - ["maintenance"]="@com_google_googleapis//google/cloud/maintenance/api/v1:api_cc_grpc" - ["managedidentities"]="@com_google_googleapis//google/cloud/managedidentities/v1:managedidentities_cc_grpc" + ["licensemanager"]="@googleapis//google/cloud/licensemanager/v1:licensemanager_cc_grpc" + ["logging_type"]="@googleapis//google/logging/type:type_cc_grpc" + ["logging"]="@googleapis//google/logging/v2:logging_cc_grpc" + ["lustre"]="@googleapis//google/cloud/lustre/v1:lustre_cc_grpc" + ["maintenance"]="@googleapis//google/cloud/maintenance/api/v1:api_cc_grpc" + ["managedidentities"]="@googleapis//google/cloud/managedidentities/v1:managedidentities_cc_grpc" ["managedkafka"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/managedkafka/schemaregistry/v1:schemaregistry_cc_grpc" \ - "@com_google_googleapis//google/cloud/managedkafka/v1:managedkafka_cc_grpc" + "@googleapis//google/cloud/managedkafka/schemaregistry/v1:schemaregistry_cc_grpc" \ + "@googleapis//google/cloud/managedkafka/v1:managedkafka_cc_grpc" )" - ["memcache"]="@com_google_googleapis//google/cloud/memcache/v1:memcache_cc_grpc" - ["memorystore"]="@com_google_googleapis//google/cloud/memorystore/v1:memorystore_cc_grpc" + ["memcache"]="@googleapis//google/cloud/memcache/v1:memcache_cc_grpc" + ["memorystore"]="@googleapis//google/cloud/memorystore/v1:memorystore_cc_grpc" ["metastore"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/metastore/logging/v1:logging_cc_grpc" \ - "@com_google_googleapis//google/cloud/metastore/v1:metastore_cc_grpc" + "@googleapis//google/cloud/metastore/logging/v1:logging_cc_grpc" \ + "@googleapis//google/cloud/metastore/v1:metastore_cc_grpc" )" - ["migrationcenter"]="@com_google_googleapis//google/cloud/migrationcenter/v1:migrationcenter_cc_grpc" + ["migrationcenter"]="@googleapis//google/cloud/migrationcenter/v1:migrationcenter_cc_grpc" ["monitoring"]="$( printf ",%s" \ - "@com_google_googleapis//google/monitoring/v3:monitoring_cc_grpc" \ - "@com_google_googleapis//google/monitoring/dashboard/v1:dashboard_cc_grpc" \ - "@com_google_googleapis//google/monitoring/metricsscope/v1:metricsscope_cc_grpc" + "@googleapis//google/monitoring/v3:monitoring_cc_grpc" \ + "@googleapis//google/monitoring/dashboard/v1:dashboard_cc_grpc" \ + "@googleapis//google/monitoring/metricsscope/v1:metricsscope_cc_grpc" )" - ["netapp"]="@com_google_googleapis//google/cloud/netapp/v1:netapp_cc_grpc" - ["networkconnectivity"]="@com_google_googleapis//google/cloud/networkconnectivity/v1:networkconnectivity_cc_grpc" - ["networkmanagement"]="@com_google_googleapis//google/cloud/networkmanagement/v1:networkmanagement_cc_grpc" - ["networksecurity"]="@com_google_googleapis//google/cloud/networksecurity/v1:networksecurity_cc_grpc" - ["networkservices"]="@com_google_googleapis//google/cloud/networkservices/v1:networkservices_cc_grpc" + ["netapp"]="@googleapis//google/cloud/netapp/v1:netapp_cc_grpc" + ["networkconnectivity"]="@googleapis//google/cloud/networkconnectivity/v1:networkconnectivity_cc_grpc" + ["networkmanagement"]="@googleapis//google/cloud/networkmanagement/v1:networkmanagement_cc_grpc" + ["networksecurity"]="@googleapis//google/cloud/networksecurity/v1:networksecurity_cc_grpc" + ["networkservices"]="@googleapis//google/cloud/networkservices/v1:networkservices_cc_grpc" ["notebooks"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/notebooks/v1:notebooks_cc_grpc" \ - "@com_google_googleapis//google/cloud/notebooks/v2:notebooks_cc_grpc" + "@googleapis//google/cloud/notebooks/v1:notebooks_cc_grpc" \ + "@googleapis//google/cloud/notebooks/v2:notebooks_cc_grpc" )" - ["optimization"]="@com_google_googleapis//google/cloud/optimization/v1:optimization_cc_grpc" - ["oracledatabase"]="@com_google_googleapis//google/cloud/oracledatabase/v1:oracledatabase_cc_grpc" - ["orgpolicy"]="@com_google_googleapis//google/cloud/orgpolicy/v2:orgpolicy_cc_grpc" + ["optimization"]="@googleapis//google/cloud/optimization/v1:optimization_cc_grpc" + ["oracledatabase"]="@googleapis//google/cloud/oracledatabase/v1:oracledatabase_cc_grpc" + ["orgpolicy"]="@googleapis//google/cloud/orgpolicy/v2:orgpolicy_cc_grpc" ["osconfig"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/osconfig/agentendpoint/v1:agentendpoint_cc_grpc" \ - "@com_google_googleapis//google/cloud/osconfig/v1:osconfig_cc_grpc" + "@googleapis//google/cloud/osconfig/agentendpoint/v1:agentendpoint_cc_grpc" \ + "@googleapis//google/cloud/osconfig/v1:osconfig_cc_grpc" )" ["oslogin"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/oslogin/v1:oslogin_cc_grpc" \ - "@com_google_googleapis//google/cloud/oslogin/common:common_cc_grpc" + "@googleapis//google/cloud/oslogin/v1:oslogin_cc_grpc" \ + "@googleapis//google/cloud/oslogin/common:common_cc_grpc" )" - ["parametermanager"]="@com_google_googleapis//google/cloud/parametermanager/v1:parametermanager_cc_grpc" - ["parallelstore"]="@com_google_googleapis//google/cloud/parallelstore/v1:parallelstore_cc_grpc" - ["policysimulator"]="@com_google_googleapis//google/cloud/policysimulator/v1:policysimulator_cc_grpc" + ["parametermanager"]="@googleapis//google/cloud/parametermanager/v1:parametermanager_cc_grpc" + ["parallelstore"]="@googleapis//google/cloud/parallelstore/v1:parallelstore_cc_grpc" + ["policysimulator"]="@googleapis//google/cloud/policysimulator/v1:policysimulator_cc_grpc" ["policytroubleshooter"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/policytroubleshooter/v1:policytroubleshooter_cc_grpc" \ - "@com_google_googleapis//google/cloud/policytroubleshooter/iam/v3:iam_cc_grpc" - )" - ["privateca"]="@com_google_googleapis//google/cloud/security/privateca/v1:privateca_cc_grpc" - ["privilegedaccessmanager"]="@com_google_googleapis//google/cloud/privilegedaccessmanager/v1:privilegedaccessmanager_cc_grpc" - ["profiler"]="@com_google_googleapis//google/devtools/cloudprofiler/v2:cloudprofiler_cc_grpc" - ["publicca"]="@com_google_googleapis//google/cloud/security/publicca/v1:publicca_cc_grpc" - ["pubsub"]="@com_google_googleapis//google/pubsub/v1:pubsub_cc_grpc" - ["pubsublite"]="@com_google_googleapis//google/cloud/pubsublite/v1:pubsublite_cc_grpc" - ["rapidmigrationassessment"]="@com_google_googleapis//google/cloud/rapidmigrationassessment/v1:rapidmigrationassessment_cc_grpc" - ["recaptchaenterprise"]="@com_google_googleapis//google/cloud/recaptchaenterprise/v1:recaptchaenterprise_cc_grpc" + "@googleapis//google/cloud/policytroubleshooter/v1:policytroubleshooter_cc_grpc" \ + "@googleapis//google/cloud/policytroubleshooter/iam/v3:iam_cc_grpc" + )" + ["privateca"]="@googleapis//google/cloud/security/privateca/v1:privateca_cc_grpc" + ["privilegedaccessmanager"]="@googleapis//google/cloud/privilegedaccessmanager/v1:privilegedaccessmanager_cc_grpc" + ["profiler"]="@googleapis//google/devtools/cloudprofiler/v2:cloudprofiler_cc_grpc" + ["publicca"]="@googleapis//google/cloud/security/publicca/v1:publicca_cc_grpc" + ["pubsub"]="@googleapis//google/pubsub/v1:pubsub_cc_grpc" + ["pubsublite"]="@googleapis//google/cloud/pubsublite/v1:pubsublite_cc_grpc" + ["rapidmigrationassessment"]="@googleapis//google/cloud/rapidmigrationassessment/v1:rapidmigrationassessment_cc_grpc" + ["recaptchaenterprise"]="@googleapis//google/cloud/recaptchaenterprise/v1:recaptchaenterprise_cc_grpc" ["recommender"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/recommender/v1:recommender_cc_grpc" \ - "@com_google_googleapis//google/cloud/recommender/logging/v1:logging_cc_grpc" + "@googleapis//google/cloud/recommender/v1:recommender_cc_grpc" \ + "@googleapis//google/cloud/recommender/logging/v1:logging_cc_grpc" )" ["redis"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/redis/cluster/v1:cluster_cc_grpc" \ - "@com_google_googleapis//google/cloud/redis/v1:redis_cc_grpc" + "@googleapis//google/cloud/redis/cluster/v1:cluster_cc_grpc" \ + "@googleapis//google/cloud/redis/v1:redis_cc_grpc" )" - ["resourcemanager"]="@com_google_googleapis//google/cloud/resourcemanager/v3:resourcemanager_cc_grpc" - ["retail"]="@com_google_googleapis//google/cloud/retail/v2:retail_cc_grpc" - ["run"]="@com_google_googleapis//google/cloud/run/v2:run_cc_grpc" - ["scheduler"]="@com_google_googleapis//google/cloud/scheduler/v1:scheduler_cc_grpc" + ["resourcemanager"]="@googleapis//google/cloud/resourcemanager/v3:resourcemanager_cc_grpc" + ["retail"]="@googleapis//google/cloud/retail/v2:retail_cc_grpc" + ["run"]="@googleapis//google/cloud/run/v2:run_cc_grpc" + ["scheduler"]="@googleapis//google/cloud/scheduler/v1:scheduler_cc_grpc" ["secretmanager"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/secretmanager/v1:secretmanager_cc_grpc" \ - "@com_google_googleapis//google/cloud/secretmanager/logging/v1:logging_cc_grpc" + "@googleapis//google/cloud/secretmanager/v1:secretmanager_cc_grpc" \ + "@googleapis//google/cloud/secretmanager/logging/v1:logging_cc_grpc" )" - ["securesourcemanager"]="@com_google_googleapis//google/cloud/securesourcemanager/v1:securesourcemanager_cc_grpc" + ["securesourcemanager"]="@googleapis//google/cloud/securesourcemanager/v1:securesourcemanager_cc_grpc" ["securitycenter"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/securitycenter/v1:securitycenter_cc_grpc" \ - "@com_google_googleapis//google/cloud/securitycenter/v2:securitycenter_cc_grpc" + "@googleapis//google/cloud/securitycenter/v1:securitycenter_cc_grpc" \ + "@googleapis//google/cloud/securitycenter/v2:securitycenter_cc_grpc" )" - ["securitycentermanagement"]="@com_google_googleapis//google/cloud/securitycentermanagement/v1:securitycentermanagement_cc_grpc" + ["securitycentermanagement"]="@googleapis//google/cloud/securitycentermanagement/v1:securitycentermanagement_cc_grpc" ["servicecontrol"]="$( printf ",%s" \ - "@com_google_googleapis//google/api/servicecontrol/v1:servicecontrol_cc_grpc" \ - "@com_google_googleapis//google/api/servicecontrol/v2:servicecontrol_cc_grpc" + "@googleapis//google/api/servicecontrol/v1:servicecontrol_cc_grpc" \ + "@googleapis//google/api/servicecontrol/v2:servicecontrol_cc_grpc" )" - ["servicedirectory"]="@com_google_googleapis//google/cloud/servicedirectory/v1:servicedirectory_cc_grpc" + ["servicedirectory"]="@googleapis//google/cloud/servicedirectory/v1:servicedirectory_cc_grpc" ["servicehealth"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/servicehealth/v1:servicehealth_cc_grpc" \ - "@com_google_googleapis//google/cloud/servicehealth/logging/v1:logging_cc_grpc" + "@googleapis//google/cloud/servicehealth/v1:servicehealth_cc_grpc" \ + "@googleapis//google/cloud/servicehealth/logging/v1:logging_cc_grpc" )" - ["servicemanagement"]="@com_google_googleapis//google/api/servicemanagement/v1:servicemanagement_cc_grpc" - ["serviceusage"]="@com_google_googleapis//google/api/serviceusage/v1:serviceusage_cc_grpc" - ["shell"]="@com_google_googleapis//google/cloud/shell/v1:shell_cc_grpc" + ["servicemanagement"]="@googleapis//google/api/servicemanagement/v1:servicemanagement_cc_grpc" + ["serviceusage"]="@googleapis//google/api/serviceusage/v1:serviceusage_cc_grpc" + ["shell"]="@googleapis//google/cloud/shell/v1:shell_cc_grpc" ["spanner"]="$( printf ",%s" \ - "@com_google_googleapis//google/spanner/v1:spanner_cc_grpc" \ - "@com_google_googleapis//google/spanner/admin/instance/v1:instance_cc_grpc" \ - "@com_google_googleapis//google/spanner/admin/database/v1:database_cc_grpc" + "@googleapis//google/spanner/v1:spanner_cc_grpc" \ + "@googleapis//google/spanner/admin/instance/v1:instance_cc_grpc" \ + "@googleapis//google/spanner/admin/database/v1:database_cc_grpc" )" ["speech"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/speech/v1:speech_cc_grpc" \ - "@com_google_googleapis//google/cloud/speech/v2:speech_cc_grpc" - )" - ["sql"]="@com_google_googleapis//google/cloud/sql/v1:sql_cc_proto" - ["storage"]="@com_google_googleapis//google/storage/v2:storage_cc_grpc" - ["storagebatchoperations"]="@com_google_googleapis//google/cloud/storagebatchoperations/v1:storagebatchoperations_cc_grpc" - ["storagecontrol"]="@com_google_googleapis//google/storage/control/v2:control_cc_grpc" - ["storageinsights"]="@com_google_googleapis//google/cloud/storageinsights/v1:storageinsights_cc_grpc" - ["storagetransfer"]="@com_google_googleapis//google/storagetransfer/v1:storagetransfer_cc_grpc" - ["support"]="@com_google_googleapis//google/cloud/support/v2:support_cc_grpc" - ["talent"]="@com_google_googleapis//google/cloud/talent/v4:talent_cc_grpc" - ["tasks"]="@com_google_googleapis//google/cloud/tasks/v2:tasks_cc_grpc" - ["telcoautomation"]="@com_google_googleapis//google/cloud/telcoautomation/v1:telcoautomation_cc_grpc" - ["texttospeech"]="@com_google_googleapis//google/cloud/texttospeech/v1:texttospeech_cc_grpc" - ["timeseriesinsights"]="@com_google_googleapis//google/cloud/timeseriesinsights/v1:timeseriesinsights_cc_grpc" + "@googleapis//google/cloud/speech/v1:speech_cc_grpc" \ + "@googleapis//google/cloud/speech/v2:speech_cc_grpc" + )" + ["sql"]="@googleapis//google/cloud/sql/v1:sql_cc_proto" + ["storage"]="@googleapis//google/storage/v2:storage_cc_grpc" + ["storagebatchoperations"]="@googleapis//google/cloud/storagebatchoperations/v1:storagebatchoperations_cc_grpc" + ["storagecontrol"]="@googleapis//google/storage/control/v2:control_cc_grpc" + ["storageinsights"]="@googleapis//google/cloud/storageinsights/v1:storageinsights_cc_grpc" + ["storagetransfer"]="@googleapis//google/storagetransfer/v1:storagetransfer_cc_grpc" + ["support"]="@googleapis//google/cloud/support/v2:support_cc_grpc" + ["talent"]="@googleapis//google/cloud/talent/v4:talent_cc_grpc" + ["tasks"]="@googleapis//google/cloud/tasks/v2:tasks_cc_grpc" + ["telcoautomation"]="@googleapis//google/cloud/telcoautomation/v1:telcoautomation_cc_grpc" + ["texttospeech"]="@googleapis//google/cloud/texttospeech/v1:texttospeech_cc_grpc" + ["timeseriesinsights"]="@googleapis//google/cloud/timeseriesinsights/v1:timeseriesinsights_cc_grpc" ["tpu"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/tpu/v1:tpu_cc_grpc" \ - "@com_google_googleapis//google/cloud/tpu/v2:tpu_cc_grpc" + "@googleapis//google/cloud/tpu/v1:tpu_cc_grpc" \ + "@googleapis//google/cloud/tpu/v2:tpu_cc_grpc" )" ["trace"]="$( printf ",%s" \ - "@com_google_googleapis//google/devtools/cloudtrace/v1:cloudtrace_cc_grpc" \ - "@com_google_googleapis//google/devtools/cloudtrace/v2:cloudtrace_cc_grpc" + "@googleapis//google/devtools/cloudtrace/v1:cloudtrace_cc_grpc" \ + "@googleapis//google/devtools/cloudtrace/v2:cloudtrace_cc_grpc" )" - ["translate"]="@com_google_googleapis//google/cloud/translate/v3:translation_cc_grpc" + ["translate"]="@googleapis//google/cloud/translate/v3:translation_cc_grpc" + ["vectorsearch"]="@googleapis//google/cloud/vectorsearch/v1:vectorsearch_cc_grpc" ["video"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/video/livestream/v1:livestream_cc_grpc" \ - "@com_google_googleapis//google/cloud/video/stitcher/v1:stitcher_cc_grpc" \ - "@com_google_googleapis//google/cloud/video/transcoder/v1:transcoder_cc_grpc" - )" - ["videointelligence"]="@com_google_googleapis//google/cloud/videointelligence/v1:videointelligence_cc_grpc" - ["vision"]="@com_google_googleapis//google/cloud/vision/v1:vision_cc_grpc" - ["vmmigration"]="@com_google_googleapis//google/cloud/vmmigration/v1:vmmigration_cc_grpc" - ["vmwareengine"]="@com_google_googleapis//google/cloud/vmwareengine/v1:vmwareengine_cc_grpc" - ["vpcaccess"]="@com_google_googleapis//google/cloud/vpcaccess/v1:vpcaccess_cc_grpc" - ["webrisk"]="@com_google_googleapis//google/cloud/webrisk/v1:webrisk_cc_grpc" - ["websecurityscanner"]="@com_google_googleapis//google/cloud/websecurityscanner/v1:websecurityscanner_cc_grpc" + "@googleapis//google/cloud/video/livestream/v1:livestream_cc_grpc" \ + "@googleapis//google/cloud/video/stitcher/v1:stitcher_cc_grpc" \ + "@googleapis//google/cloud/video/transcoder/v1:transcoder_cc_grpc" + )" + ["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" + ["webrisk"]="@googleapis//google/cloud/webrisk/v1:webrisk_cc_grpc" + ["websecurityscanner"]="@googleapis//google/cloud/websecurityscanner/v1:websecurityscanner_cc_grpc" ["workflows"]="$( printf ",%s" \ - "@com_google_googleapis//google/cloud/workflows/v1:workflows_cc_grpc" \ - "@com_google_googleapis//google/cloud/workflows/type:type_cc_grpc" \ - "@com_google_googleapis//google/cloud/workflows/executions/v1:executions_cc_grpc" + "@googleapis//google/cloud/workflows/v1:workflows_cc_grpc" \ + "@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" \ - "@com_google_googleapis//google/cloud/workstations/logging/v1:logging_cc_grpc" \ - "@com_google_googleapis//google/cloud/workstations/v1:workstations_cc_grpc" + "@googleapis//google/cloud/workstations/logging/v1:logging_cc_grpc" \ + "@googleapis//google/cloud/workstations/v1:workstations_cc_grpc" )" ) @@ -382,7 +388,7 @@ for library in "${keys[@]}"; do >>"external/googleapis/protolists/${library}.list" || true bazelisk query --noshow_progress --noshow_loading_progress \ "deps(${rule})" | - grep "@com_google_googleapis//" | grep _proto | + grep "@googleapis//" | grep _proto | grep -v "${path}" \ >>"external/googleapis/protodeps/${library}.deps" || true done @@ -395,5 +401,5 @@ done # TODO(#11694) - the Bazel file introduces a dependency that we do not build. # Fortunately (maybe?) we do not use or need the dep until the issue is # resolved. -sed -i '/@com_google_googleapis\/\/google\/cloud\/location:location_proto/d' \ +sed -i '/@googleapis\/\/google\/cloud\/location:location_proto/d' \ "external/googleapis/protodeps/datamigration.deps" diff --git a/generator/BUILD.bazel b/generator/BUILD.bazel index 50509b159bcb9..13f4a6b5b4e20 100644 --- a/generator/BUILD.bazel +++ b/generator/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") load(":google_cloud_cpp_generator.bzl", "google_cloud_cpp_generator_hdrs", "google_cloud_cpp_generator_srcs") load(":google_cloud_cpp_generator_testing.bzl", "google_cloud_cpp_generator_testing_hdrs", "google_cloud_cpp_generator_testing_srcs") load(":google_cloud_cpp_generator_unit_tests.bzl", "google_cloud_cpp_generator_unit_tests") @@ -33,17 +35,16 @@ cc_library( ":generator_config_cc_proto", "//:common", "//google/cloud:google_cloud_cpp_rest_internal", + "@abseil-cpp//absl/strings", + "@abseil-cpp//absl/strings:str_format", "@com_github_jbeder_yaml_cpp//:yaml-cpp", - "@com_github_nlohmann_json//:json", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/strings:str_format", - "@com_google_googleapis//:googleapis_system_includes", - "@com_google_googleapis//google/api:client_cc_proto", - "@com_google_googleapis//google/api:field_info_cc_proto", - "@com_google_googleapis//google/api:routing_cc_proto", - "@com_google_googleapis//google/cloud:extended_operations_cc_proto", - "@com_google_googleapis//google/longrunning:longrunning_cc_proto", "@com_google_protobuf//:protoc_lib", + "@googleapis//google/api:client_cc_proto", + "@googleapis//google/api:field_info_cc_proto", + "@googleapis//google/api:routing_cc_proto", + "@googleapis//google/cloud:extended_operations_cc_proto", + "@googleapis//google/longrunning:longrunning_cc_proto", + "@nlohmann_json//:json", ], ) @@ -61,8 +62,8 @@ cc_library( ":google_cloud_cpp_generator", "//:common", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googleapis//google/longrunning:longrunning_cc_proto", - "@com_google_googletest//:gtest", + "@googleapis//google/longrunning:longrunning_cc_proto", + "@googletest//:gtest", ], ) @@ -78,7 +79,7 @@ cc_library( ":google_cloud_cpp_generator", ":google_cloud_cpp_generator_testing", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", - "@com_google_googletest//:gtest", + "@googletest//:gtest", ], ) for test in google_cloud_cpp_generator_unit_tests] @@ -116,8 +117,8 @@ cc_binary( deps = [ ":generator_config_cc_proto", ":google_cloud_cpp_generator", - "@com_google_absl//absl/flags:commandlineflag", - "@com_google_absl//absl/flags:flag", - "@com_google_absl//absl/flags:parse", + "@abseil-cpp//absl/flags:commandlineflag", + "@abseil-cpp//absl/flags:flag", + "@abseil-cpp//absl/flags:parse", ], ) diff --git a/generator/CMakeLists.txt b/generator/CMakeLists.txt index 8503589dcb862..874bad7da5fd4 100644 --- a/generator/CMakeLists.txt +++ b/generator/CMakeLists.txt @@ -27,7 +27,7 @@ find_package(Protobuf CONFIG QUIET) if (NOT Protobuf_FOUND) find_package(Protobuf REQUIRED) endif () -include(IncludeNlohmannJson) +find_package(nlohmann_json CONFIG REQUIRED) find_package(yaml-cpp CONFIG REQUIRED) add_library( @@ -67,16 +67,6 @@ add_library( internal/format_class_comments.h internal/format_method_comments.cc internal/format_method_comments.h - internal/forwarding_client_generator.cc - internal/forwarding_client_generator.h - internal/forwarding_connection_generator.cc - internal/forwarding_connection_generator.h - internal/forwarding_idempotency_policy_generator.cc - internal/forwarding_idempotency_policy_generator.h - internal/forwarding_mock_connection_generator.cc - internal/forwarding_mock_connection_generator.h - internal/forwarding_options_generator.cc - internal/forwarding_options_generator.h internal/generator_interface.h internal/http_annotation_parser.cc internal/http_annotation_parser.h @@ -160,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.cc b/generator/generator.cc index 50d18f34f9349..d14beb3df7dc0 100644 --- a/generator/generator.cc +++ b/generator/generator.cc @@ -17,12 +17,12 @@ #include "generator/internal/descriptor_utils.h" #include "generator/internal/generator_interface.h" #include "generator/internal/make_generators.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/algorithm.h" #include "google/cloud/internal/filesystem.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_split.h" -#include +#include "google/api/client.pb.h" #include #include #include @@ -72,7 +72,8 @@ bool Generator::Generate(google::protobuf::FileDescriptor const* file, services.reserve(file->service_count()); for (int i = 0; i < file->service_count(); ++i) { auto const* service = file->service(i); - if (!internal::Contains(omitted_services, service->name())) { + if (!internal::Contains(omitted_services, service->name()) && + !internal::Contains(omitted_services, service->full_name())) { services.push_back(generator_internal::MakeGenerators( service, context, service_config, *command_line_args)); } diff --git a/generator/generator_config.proto b/generator/generator_config.proto index 68859b70030d1..0dc865a2dd285 100644 --- a/generator/generator_config.proto +++ b/generator/generator_config.proto @@ -38,11 +38,6 @@ message ServiceConfiguration { repeated string omitted_services = 8; - // If set to true generate the `gcpxxV1` alias for our inline namespace. Older - // versions of the generated libraries need this, but new libraries should not - // have it. - bool backwards_compatibility_namespace_alias = 9; - // If all rpcs in the service have the same set of retryable status codes, // typically found in the service_config.json accompanying the proto files, // generate the ServiceNameRetryTraits struct using the provided codes. @@ -118,19 +113,6 @@ message ServiceConfiguration { // constructor and the connection factory function. bool experimental = 18; - // We use this setting to maintain backwards compatibility when relocating a - // service from the undesired `forwarding_product_path` to the desired - // `product_path`. - // - // If set, generate backwards compatibility headers at the - // `forwarding_product_path`. These headers define aliases (in the namespace - // derived from `forwarding_product_path`), which point to types defined at - // the `product_path` (in the namespace derived from `product_path`). - // - // For details on why we would relocate a service, see #10170, or - // https://github.com/googleapis/google-cloud-cpp/blob/main/doc/adr/2022-11-11-multiple-versions-of-GCP-service-in-one-library.md - string forwarding_product_path = 19; - // Override idempotency policy values for specific rpcs. message IdempotencyOverride { // rpc_name should be qualified with the service name e.g.: Service.Method. @@ -185,6 +167,21 @@ message ServiceConfiguration { // RPCs. If set to false (the default), a no-op resumption function will be // generated. bool omit_streaming_updater = 29; + + message BespokeMethod { + string name = 1; + string return_type = 2; + string parameters = 3; + } + + // Only added to maintain feature parity when migrating from the handwritten + // Bigtable Table Admin class to the generated class. While some attempts were + // made to generalize this feature, it currently only supports the + // WaitForConsistency method. This functionality can be enhanced later if we + // ever need to use this again. + // The implementation for this method in the ConnectionImpl class is not + // generated and must be handwritten in a separate .cc file. + repeated BespokeMethod bespoke_methods = 30; } message DiscoveryDocumentDefinedProduct { diff --git a/generator/generator_config.textproto b/generator/generator_config.textproto index 0f5348a2b5b2d..966e0c6b7e236 100644 --- a/generator/generator_config.textproto +++ b/generator/generator_config.textproto @@ -20,14 +20,12 @@ service { product_path: "google/cloud/accessapproval/v1" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] - forwarding_product_path: "google/cloud/accessapproval" } # Access Context Manager service { service_proto_path: "google/identity/accesscontextmanager/v1/access_context_manager.proto" product_path: "google/cloud/accesscontextmanager/v1" - forwarding_product_path: "google/cloud/accesscontextmanager" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -271,7 +269,6 @@ service { service { service_proto_path: "google/cloud/apigateway/v1/apigateway_service.proto" product_path: "google/cloud/apigateway/v1" - forwarding_product_path: "google/cloud/apigateway" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable", "kUnknown"] } @@ -280,7 +277,6 @@ service { service { service_proto_path: "google/cloud/apigeeconnect/v1/connection.proto" product_path: "google/cloud/apigeeconnect/v1" - forwarding_product_path: "google/cloud/apigeeconnect" initial_copyright_year: "2022" service_endpoint_env_var: "GOOGLE_CLOUD_CPP_APIGEE_CONNECTION_SERVICE_ENDPOINT" retryable_status_codes: ["kUnavailable", "kUnknown"] @@ -290,7 +286,6 @@ service { service { service_proto_path: "google/api/apikeys/v2/apikeys.proto" product_path: "google/cloud/apikeys/v2" - forwarding_product_path: "google/cloud/apikeys" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -308,7 +303,6 @@ service { service_proto_path: "google/appengine/v1/appengine.proto" additional_proto_files: ["google/appengine/v1/operation.proto"] product_path: "google/cloud/appengine/v1" - forwarding_product_path: "google/cloud/appengine" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -325,7 +319,6 @@ service { service { service_proto_path: "google/devtools/artifactregistry/v1/service.proto" product_path: "google/cloud/artifactregistry/v1" - forwarding_product_path: "google/cloud/artifactregistry" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -334,7 +327,6 @@ service { service { service_proto_path: "google/cloud/asset/v1/asset_service.proto" product_path: "google/cloud/asset/v1" - forwarding_product_path: "google/cloud/asset" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -343,7 +335,6 @@ service { service { service_proto_path: "google/cloud/assuredworkloads/v1/assuredworkloads.proto" product_path: "google/cloud/assuredworkloads/v1" - forwarding_product_path: "google/cloud/assuredworkloads" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -361,7 +352,6 @@ service { service_proto_path: "google/cloud/automl/v1/service.proto" additional_proto_files: ["google/cloud/automl/v1/operations.proto"] product_path: "google/cloud/automl/v1" - forwarding_product_path: "google/cloud/automl" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -370,7 +360,6 @@ service { service_proto_path: "google/cloud/automl/v1/prediction_service.proto" additional_proto_files: ["google/cloud/automl/v1/operations.proto"] product_path: "google/cloud/automl/v1" - forwarding_product_path: "google/cloud/automl" initial_copyright_year: "2022" service_endpoint_env_var: "GOOGLE_CLOUD_CPP_AUTOML_PREDICTION_SERVICE_ENDPOINT" retryable_status_codes: ["kUnavailable"] @@ -388,7 +377,6 @@ service { service { service_proto_path: "google/cloud/baremetalsolution/v2/baremetalsolution.proto" product_path: "google/cloud/baremetalsolution/v2" - forwarding_product_path: "google/cloud/baremetalsolution" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -397,7 +385,6 @@ service { service { service_proto_path: "google/cloud/batch/v1/batch.proto" product_path: "google/cloud/batch/v1" - forwarding_product_path: "google/cloud/batch" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -406,7 +393,6 @@ service { service { service_proto_path: "google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto" product_path: "google/cloud/beyondcorp/appconnectors/v1" - forwarding_product_path: "google/cloud/beyondcorp" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -414,7 +400,6 @@ service { service { service_proto_path: "google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto" product_path: "google/cloud/beyondcorp/appgateways/v1" - forwarding_product_path: "google/cloud/beyondcorp" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -422,7 +407,6 @@ service { service { service_proto_path: "google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto" product_path: "google/cloud/beyondcorp/appconnections/v1" - forwarding_product_path: "google/cloud/beyondcorp" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -431,7 +415,6 @@ service { service { service_proto_path: "google/cloud/bigquery/analyticshub/v1/analyticshub.proto" product_path: "google/cloud/bigquery/analyticshub/v1" - forwarding_product_path: "google/cloud/bigquery" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -446,7 +429,6 @@ service { service { service_proto_path: "google/cloud/bigquery/connection/v1/connection.proto" product_path: "google/cloud/bigquery/connection/v1" - forwarding_product_path: "google/cloud/bigquery" initial_copyright_year: "2022" service_endpoint_env_var: "GOOGLE_CLOUD_CPP_BIGQUERY_CONNECTION_SERVICE_ENDPOINT" retryable_status_codes: ["kUnavailable"] @@ -455,7 +437,6 @@ service { service { service_proto_path: "google/cloud/bigquery/datapolicies/v1/datapolicy.proto" product_path: "google/cloud/bigquery/datapolicies/v1" - forwarding_product_path: "google/cloud/bigquery" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -470,7 +451,6 @@ service { service { service_proto_path: "google/cloud/bigquery/datatransfer/v1/datatransfer.proto" product_path: "google/cloud/bigquery/datatransfer/v1" - forwarding_product_path: "google/cloud/bigquery" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -478,7 +458,6 @@ service { service { service_proto_path: "google/cloud/bigquery/migration/v2/migration_service.proto" product_path: "google/cloud/bigquery/migration/v2" - forwarding_product_path: "google/cloud/bigquery" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -486,7 +465,6 @@ service { service { service_proto_path: "google/cloud/bigquery/reservation/v1/reservation.proto" product_path: "google/cloud/bigquery/reservation/v1" - forwarding_product_path: "google/cloud/bigquery" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -494,10 +472,8 @@ service { service { service_proto_path: "google/cloud/bigquery/storage/v1/storage.proto" product_path: "google/cloud/bigquery/storage/v1" - forwarding_product_path: "google/cloud/bigquery" initial_copyright_year: "2021" omitted_services: ["BigQueryWrite"] - backwards_compatibility_namespace_alias: true retryable_status_codes: ["kUnavailable"] omit_streaming_updater: true } @@ -505,7 +481,6 @@ service { service { service_proto_path: "google/cloud/bigquery/storage/v1/storage.proto" product_path: "google/cloud/bigquery/storage/v1" - forwarding_product_path: "google/cloud/bigquery" initial_copyright_year: "2022" omitted_services: ["BigQueryRead"] retryable_status_codes: ["kUnavailable"] @@ -596,6 +571,7 @@ service { "ReadModifyWriteRow", "ReadRows", "SampleRowKeys", + "PingAndWarm", "PrepareQuery" ] omit_repo_metadata: true @@ -629,13 +605,19 @@ service { {rpc_name: "BigtableTableAdmin.CheckConsistency", idempotency: IDEMPOTENT} ] omit_repo_metadata: true + bespoke_methods : [ + { + name: "WaitForConsistency", + return_type: "future>", + parameters: "(google::bigtable::admin::v2::CheckConsistencyRequest const& request, Options opts = {})" + } + ] } # Billing service { service_proto_path: "google/cloud/billing/v1/cloud_billing.proto" product_path: "google/cloud/billing/v1" - forwarding_product_path: "google/cloud/billing" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -643,7 +625,6 @@ service { service { service_proto_path: "google/cloud/billing/v1/cloud_catalog.proto" product_path: "google/cloud/billing/v1" - forwarding_product_path: "google/cloud/billing" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -651,7 +632,6 @@ service { service { service_proto_path: "google/cloud/billing/budgets/v1/budget_service.proto" product_path: "google/cloud/billing/budgets/v1" - forwarding_product_path: "google/cloud/billing" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -660,7 +640,6 @@ service { service { service_proto_path: "google/cloud/binaryauthorization/v1/service.proto" product_path: "google/cloud/binaryauthorization/v1" - forwarding_product_path: "google/cloud/binaryauthorization" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -669,7 +648,6 @@ service { service { service_proto_path: "google/cloud/security/privateca/v1/service.proto" product_path: "google/cloud/privateca/v1" - forwarding_product_path: "google/cloud/privateca" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable", "kUnknown"] } @@ -685,11 +663,39 @@ service { service { service_proto_path: "google/cloud/certificatemanager/v1/certificate_manager.proto" product_path: "google/cloud/certificatemanager/v1" - forwarding_product_path: "google/cloud/certificatemanager" initial_copyright_year: "2022" 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" @@ -730,7 +736,6 @@ service { service { service_proto_path: "google/devtools/cloudbuild/v1/cloudbuild.proto" product_path: "google/cloud/cloudbuild/v1" - forwarding_product_path: "google/cloud/cloudbuild" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -756,19 +761,10 @@ service { service_proto_path: "google/cloud/channel/v1/service.proto" additional_proto_files: ["google/cloud/channel/v1/operations.proto"] product_path: "google/cloud/channel/v1" - forwarding_product_path: "google/cloud/channel" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } -service { - service_proto_path: "google/cloud/channel/v1/reports_service.proto" - additional_proto_files: ["google/cloud/channel/v1/operations.proto"] - product_path: "google/cloud/channel/v1" - initial_copyright_year: "2023" - retryable_status_codes: ["kUnavailable"] -} - # Cloud Controls Partner service { service_proto_path: "google/cloud/cloudcontrolspartner/v1/core.proto" @@ -812,7 +808,6 @@ service { service_proto_path: "google/cloud/orchestration/airflow/service/v1/environments.proto" additional_proto_files: ["google/cloud/orchestration/airflow/service/v1/operations.proto"] product_path: "google/cloud/composer/v1" - forwarding_product_path: "google/cloud/composer" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -820,7 +815,6 @@ service { service { service_proto_path: "google/cloud/orchestration/airflow/service/v1/image_versions.proto" product_path: "google/cloud/composer/v1" - forwarding_product_path: "google/cloud/composer" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -1806,7 +1800,6 @@ service { service { service_proto_path: "google/cloud/connectors/v1/connectors_service.proto" product_path: "google/cloud/connectors/v1" - forwarding_product_path: "google/cloud/connectors" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -1815,7 +1808,6 @@ service { service { service_proto_path: "google/cloud/contactcenterinsights/v1/contact_center_insights.proto" product_path: "google/cloud/contactcenterinsights/v1" - forwarding_product_path: "google/cloud/contactcenterinsights" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -1824,7 +1816,6 @@ service { service { service_proto_path: "google/container/v1/cluster_service.proto" product_path: "google/cloud/container/v1" - forwarding_product_path: "google/cloud/container" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] omitted_rpcs: [ @@ -1859,7 +1850,6 @@ service { service_proto_path: "google/devtools/containeranalysis/v1/containeranalysis.proto" additional_proto_files: ["grafeas/v1/grafeas.proto"] product_path: "google/cloud/containeranalysis/v1" - forwarding_product_path: "google/cloud/containeranalysis" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -1919,7 +1909,6 @@ service { service { service_proto_path: "google/cloud/datacatalog/v1/datacatalog.proto" product_path: "google/cloud/datacatalog/v1" - forwarding_product_path: "google/cloud/datacatalog" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -1927,7 +1916,6 @@ service { service { service_proto_path: "google/cloud/datacatalog/v1/policytagmanager.proto" product_path: "google/cloud/datacatalog/v1" - forwarding_product_path: "google/cloud/datacatalog" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -1935,7 +1923,6 @@ service { service { service_proto_path: "google/cloud/datacatalog/v1/policytagmanagerserialization.proto" product_path: "google/cloud/datacatalog/v1" - forwarding_product_path: "google/cloud/datacatalog" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -1947,11 +1934,24 @@ 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" product_path: "google/cloud/datamigration/v1" - forwarding_product_path: "google/cloud/datamigration" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -1965,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" @@ -1972,14 +1979,27 @@ 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" - forwarding_product_path: "google/cloud/dataplex" initial_copyright_year: "2022" 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" @@ -1997,7 +2017,6 @@ service { service { service_proto_path: "google/cloud/dataplex/v1/metadata.proto" product_path: "google/cloud/dataplex/v1" - forwarding_product_path: "google/cloud/dataplex" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2005,7 +2024,6 @@ service { service { service_proto_path: "google/cloud/dataplex/v1/service.proto" product_path: "google/cloud/dataplex/v1" - forwarding_product_path: "google/cloud/dataplex" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2014,7 +2032,6 @@ service { service { service_proto_path: "google/cloud/dataproc/v1/autoscaling_policies.proto" product_path: "google/cloud/dataproc/v1" - forwarding_product_path: "google/cloud/dataproc" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] endpoint_location_style: LOCATION_DEPENDENT_COMPAT @@ -2024,7 +2041,6 @@ service { service_proto_path: "google/cloud/dataproc/v1/batches.proto" additional_proto_files: ["google/cloud/dataproc/v1/operations.proto"] product_path: "google/cloud/dataproc/v1" - forwarding_product_path: "google/cloud/dataproc" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] endpoint_location_style: LOCATION_DEPENDENT_COMPAT @@ -2034,7 +2050,6 @@ service { service_proto_path: "google/cloud/dataproc/v1/clusters.proto" additional_proto_files: ["google/cloud/dataproc/v1/operations.proto"] product_path: "google/cloud/dataproc/v1" - forwarding_product_path: "google/cloud/dataproc" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] endpoint_location_style: LOCATION_DEPENDENT_COMPAT @@ -2043,7 +2058,6 @@ service { service { service_proto_path: "google/cloud/dataproc/v1/jobs.proto" product_path: "google/cloud/dataproc/v1" - forwarding_product_path: "google/cloud/dataproc" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] endpoint_location_style: LOCATION_DEPENDENT_COMPAT @@ -2078,7 +2092,6 @@ service { service { service_proto_path: "google/cloud/dataproc/v1/workflow_templates.proto" product_path: "google/cloud/dataproc/v1" - forwarding_product_path: "google/cloud/dataproc" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] endpoint_location_style: LOCATION_DEPENDENT_COMPAT @@ -2088,7 +2101,6 @@ service { service { service_proto_path: "google/privacy/dlp/v2/dlp.proto" product_path: "google/cloud/dlp/v2" - forwarding_product_path: "google/cloud/dlp" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2114,7 +2126,6 @@ service { service { service_proto_path: "google/cloud/datastream/v1/datastream.proto" product_path: "google/cloud/datastream/v1" - forwarding_product_path: "google/cloud/datastream" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2123,7 +2134,6 @@ service { service { service_proto_path: "google/cloud/deploy/v1/cloud_deploy.proto" product_path: "google/cloud/deploy/v1" - forwarding_product_path: "google/cloud/deploy" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2548,7 +2558,6 @@ service { service { service_proto_path: "google/cloud/documentai/v1/document_processor_service.proto" product_path: "google/cloud/documentai/v1" - forwarding_product_path: "google/cloud/documentai" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] endpoint_location_style: LOCATION_DEPENDENT_COMPAT @@ -2566,7 +2575,6 @@ service { service { service_proto_path: "google/cloud/edgecontainer/v1/service.proto" product_path: "google/cloud/edgecontainer/v1" - forwarding_product_path: "google/cloud/edgecontainer" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2591,7 +2599,6 @@ service { service { service_proto_path: "google/cloud/eventarc/v1/eventarc.proto" product_path: "google/cloud/eventarc/v1" - forwarding_product_path: "google/cloud/eventarc" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable", "kUnknown"] } @@ -2599,7 +2606,6 @@ service { service { service_proto_path: "google/cloud/eventarc/publishing/v1/publisher.proto" product_path: "google/cloud/eventarc/publishing/v1" - forwarding_product_path: "google/cloud/eventarc" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2608,7 +2614,6 @@ service { service { service_proto_path: "google/cloud/filestore/v1/cloud_filestore_service.proto" product_path: "google/cloud/filestore/v1" - forwarding_product_path: "google/cloud/filestore" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2625,7 +2630,6 @@ service { service_proto_path: "google/cloud/functions/v1/functions.proto" additional_proto_files: ["google/cloud/functions/v1/operations.proto"] product_path: "google/cloud/functions/v1" - forwarding_product_path: "google/cloud/functions" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2649,7 +2653,6 @@ service { service { service_proto_path: "google/cloud/gkehub/v1/service.proto" product_path: "google/cloud/gkehub/v1" - forwarding_product_path: "google/cloud/gkehub" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2697,13 +2700,19 @@ 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" product_path: "google/cloud/iam/credentials/v1" - forwarding_product_path: "google/cloud/iam" initial_copyright_year: "2020" - backwards_compatibility_namespace_alias: true retryable_status_codes: ["kUnavailable"] idempotency_overrides: [ {rpc_name: "IAMCredentials.GenerateAccessToken", idempotency: IDEMPOTENT}, @@ -2716,10 +2725,8 @@ service { service { service_proto_path: "google/iam/admin/v1/iam.proto" product_path: "google/cloud/iam/admin/v1" - forwarding_product_path: "google/cloud/iam" initial_copyright_year: "2021" omitted_rpcs: ["SignBlob", "SignJwt", "UpdateServiceAccount"] - backwards_compatibility_namespace_alias: true retryable_status_codes: ["kUnavailable"] omitted_rpcs: [ "SignBlob(std::string const&, std::string const&)", @@ -2737,7 +2744,6 @@ service { service { service_proto_path: "google/iam/v1/iam_policy.proto" product_path: "google/cloud/iam/v1" - forwarding_product_path: "google/cloud/iam" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2767,7 +2773,6 @@ service { service { service_proto_path: "google/cloud/iap/v1/service.proto" product_path: "google/cloud/iap/v1" - forwarding_product_path: "google/cloud/iap" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2784,7 +2789,6 @@ service { service { service_proto_path: "google/cloud/policytroubleshooter/v1/checker.proto" product_path: "google/cloud/policytroubleshooter/v1" - forwarding_product_path: "google/cloud/policytroubleshooter" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2800,7 +2804,6 @@ service { service { service_proto_path: "google/cloud/ids/v1/ids.proto" product_path: "google/cloud/ids/v1" - forwarding_product_path: "google/cloud/ids" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2823,7 +2826,6 @@ service { service { service_proto_path: "google/cloud/kms/v1/service.proto" product_path: "google/cloud/kms/v1" - forwarding_product_path: "google/cloud/kms" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2831,7 +2833,6 @@ service { service { service_proto_path: "google/cloud/kms/v1/ekm_service.proto" product_path: "google/cloud/kms/v1" - forwarding_product_path: "google/cloud/kms" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2854,7 +2855,6 @@ service { service { service_proto_path: "google/cloud/language/v1/language_service.proto" product_path: "google/cloud/language/v1" - forwarding_product_path: "google/cloud/language" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2878,7 +2878,6 @@ service { service { service_proto_path: "google/logging/v2/logging.proto" product_path: "google/cloud/logging/v2" - forwarding_product_path: "google/cloud/logging" initial_copyright_year: "2021" gen_async_rpcs: ["WriteLogEntries"] retryable_status_codes: ["kInternal", "kUnavailable"] @@ -2920,7 +2919,6 @@ service { service { service_proto_path: "google/cloud/managedidentities/v1/managed_identities_service.proto" product_path: "google/cloud/managedidentities/v1" - forwarding_product_path: "google/cloud/managedidentities" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2945,7 +2943,6 @@ service { service { service_proto_path: "google/cloud/memcache/v1/cloud_memcache.proto" product_path: "google/cloud/memcache/v1" - forwarding_product_path: "google/cloud/memcache" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2985,7 +2982,6 @@ service { service { service_proto_path: "google/monitoring/v3/alert_service.proto" product_path: "google/cloud/monitoring/v3" - forwarding_product_path: "google/cloud/monitoring" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -2993,7 +2989,6 @@ service { service { service_proto_path: "google/monitoring/v3/group_service.proto" product_path: "google/cloud/monitoring/v3" - forwarding_product_path: "google/cloud/monitoring" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3001,7 +2996,6 @@ service { service { service_proto_path: "google/monitoring/v3/metric_service.proto" product_path: "google/cloud/monitoring/v3" - forwarding_product_path: "google/cloud/monitoring" initial_copyright_year: "2022" gen_async_rpcs: ["CreateTimeSeries"] retryable_status_codes: ["kUnavailable"] @@ -3010,7 +3004,6 @@ service { service { service_proto_path: "google/monitoring/v3/notification_service.proto" product_path: "google/cloud/monitoring/v3" - forwarding_product_path: "google/cloud/monitoring" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3018,7 +3011,6 @@ service { service { service_proto_path: "google/monitoring/v3/query_service.proto" product_path: "google/cloud/monitoring/v3" - forwarding_product_path: "google/cloud/monitoring" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3026,7 +3018,6 @@ service { service { service_proto_path: "google/monitoring/v3/service_service.proto" product_path: "google/cloud/monitoring/v3" - forwarding_product_path: "google/cloud/monitoring" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3041,7 +3032,6 @@ service { service { service_proto_path: "google/monitoring/v3/uptime_service.proto" product_path: "google/cloud/monitoring/v3" - forwarding_product_path: "google/cloud/monitoring" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3049,7 +3039,6 @@ service { service { service_proto_path: "google/monitoring/dashboard/v1/dashboards_service.proto" product_path: "google/cloud/monitoring/dashboard/v1" - forwarding_product_path: "google/cloud/monitoring" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3057,7 +3046,6 @@ service { service { service_proto_path: "google/monitoring/metricsscope/v1/metrics_scopes.proto" product_path: "google/cloud/monitoring/metricsscope/v1" - forwarding_product_path: "google/cloud/monitoring" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3075,7 +3063,6 @@ service { service_proto_path: "google/cloud/networkconnectivity/v1/hub.proto" additional_proto_files: ["google/cloud/networkconnectivity/v1/common.proto"] product_path: "google/cloud/networkconnectivity/v1" - forwarding_product_path: "google/cloud/networkconnectivity" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3098,7 +3085,6 @@ service { service { service_proto_path: "google/cloud/networkmanagement/v1/reachability.proto" product_path: "google/cloud/networkmanagement/v1" - forwarding_product_path: "google/cloud/networkmanagement" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3133,7 +3119,6 @@ service { service_proto_path: "google/cloud/notebooks/v1/managed_service.proto" additional_proto_files: ["google/cloud/notebooks/v1/service.proto"] product_path: "google/cloud/notebooks/v1" - forwarding_product_path: "google/cloud/notebooks" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3149,7 +3134,6 @@ service { service { service_proto_path: "google/cloud/optimization/v1/fleet_routing.proto" product_path: "google/cloud/optimization/v1" - forwarding_product_path: "google/cloud/optimization" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3166,7 +3150,6 @@ service { service { service_proto_path: "google/cloud/orgpolicy/v2/orgpolicy.proto" product_path: "google/cloud/orgpolicy/v2" - forwarding_product_path: "google/cloud/orgpolicy" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3175,7 +3158,6 @@ service { service { service_proto_path: "google/cloud/osconfig/v1/osconfig_service.proto" product_path: "google/cloud/osconfig/v1" - forwarding_product_path: "google/cloud/osconfig" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3190,7 +3172,6 @@ service { service { service_proto_path: "google/cloud/osconfig/agentendpoint/v1/agentendpoint.proto" product_path: "google/cloud/osconfig/agentendpoint/v1" - forwarding_product_path: "google/cloud/osconfig" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] # For this service, updating the streaming RPC is a no-op. The response has @@ -3203,7 +3184,6 @@ service { service { service_proto_path: "google/cloud/oslogin/v1/oslogin.proto" product_path: "google/cloud/oslogin/v1" - forwarding_product_path: "google/cloud/oslogin" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3229,7 +3209,6 @@ service { service { service_proto_path: "google/devtools/cloudprofiler/v2/profiler.proto" product_path: "google/cloud/profiler/v2" - forwarding_product_path: "google/cloud/profiler" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] omitted_services: ["ExportService"] @@ -3373,7 +3352,6 @@ service { service { service_proto_path: "google/cloud/recommender/v1/recommender_service.proto" product_path: "google/cloud/recommender/v1" - forwarding_product_path: "google/cloud/recommender" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3382,7 +3360,6 @@ service { service { service_proto_path: "google/cloud/redis/v1/cloud_redis.proto" product_path: "google/cloud/redis/v1" - forwarding_product_path: "google/cloud/redis" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3398,7 +3375,6 @@ service { service { service_proto_path: "google/cloud/resourcemanager/v3/folders.proto" product_path: "google/cloud/resourcemanager/v3" - forwarding_product_path: "google/cloud/resourcemanager" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] endpoint_location_style: LOCATION_OPTIONALLY_DEPENDENT @@ -3407,7 +3383,6 @@ service { service { service_proto_path: "google/cloud/resourcemanager/v3/organizations.proto" product_path: "google/cloud/resourcemanager/v3" - forwarding_product_path: "google/cloud/resourcemanager" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] endpoint_location_style: LOCATION_OPTIONALLY_DEPENDENT @@ -3416,7 +3391,6 @@ service { service { service_proto_path: "google/cloud/resourcemanager/v3/projects.proto" product_path: "google/cloud/resourcemanager/v3" - forwarding_product_path: "google/cloud/resourcemanager" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] endpoint_location_style: LOCATION_OPTIONALLY_DEPENDENT @@ -3465,7 +3439,6 @@ service { service { service_proto_path: "google/cloud/retail/v2/catalog_service.proto" product_path: "google/cloud/retail/v2" - forwarding_product_path: "google/cloud/retail" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3473,7 +3446,6 @@ service { service { service_proto_path: "google/cloud/retail/v2/completion_service.proto" product_path: "google/cloud/retail/v2" - forwarding_product_path: "google/cloud/retail" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3495,7 +3467,6 @@ service { service { service_proto_path: "google/cloud/retail/v2/prediction_service.proto" product_path: "google/cloud/retail/v2" - forwarding_product_path: "google/cloud/retail" initial_copyright_year: "2022" service_endpoint_env_var: "GOOGLE_CLOUD_CPP_RETAIL_PREDICTION_SERVICE_ENDPOINT" retryable_status_codes: ["kUnavailable"] @@ -3504,7 +3475,6 @@ service { service { service_proto_path: "google/cloud/retail/v2/product_service.proto" product_path: "google/cloud/retail/v2" - forwarding_product_path: "google/cloud/retail" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3512,7 +3482,6 @@ service { service { service_proto_path: "google/cloud/retail/v2/search_service.proto" product_path: "google/cloud/retail/v2" - forwarding_product_path: "google/cloud/retail" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3527,7 +3496,6 @@ service { service { service_proto_path: "google/cloud/retail/v2/user_event_service.proto" product_path: "google/cloud/retail/v2" - forwarding_product_path: "google/cloud/retail" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3544,7 +3512,6 @@ service { service { service_proto_path: "google/cloud/run/v2/revision.proto" product_path: "google/cloud/run/v2" - forwarding_product_path: "google/cloud/run" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3552,7 +3519,6 @@ service { service { service_proto_path: "google/cloud/run/v2/service.proto" product_path: "google/cloud/run/v2" - forwarding_product_path: "google/cloud/run" initial_copyright_year: "2022" service_endpoint_env_var: "GOOGLE_CLOUD_CPP_RUN_SERVICES_ENDPOINT" retryable_status_codes: ["kUnavailable"] @@ -3569,7 +3535,6 @@ service { service { service_proto_path: "google/cloud/scheduler/v1/cloudscheduler.proto" product_path: "google/cloud/scheduler/v1" - forwarding_product_path: "google/cloud/scheduler" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3578,7 +3543,6 @@ service { service { service_proto_path: "google/cloud/secretmanager/v1/service.proto" product_path: "google/cloud/secretmanager/v1" - forwarding_product_path: "google/cloud/secretmanager" initial_copyright_year: "2021" retryable_status_codes: ["kUnavailable"] } @@ -3595,7 +3559,6 @@ service { service { service_proto_path: "google/cloud/securitycenter/v1/securitycenter_service.proto" product_path: "google/cloud/securitycenter/v1" - forwarding_product_path: "google/cloud/securitycenter" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3619,7 +3582,6 @@ service { service { service_proto_path: "google/api/servicecontrol/v1/quota_controller.proto" product_path: "google/cloud/servicecontrol/v1" - forwarding_product_path: "google/cloud/servicecontrol" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3627,7 +3589,6 @@ service { service { service_proto_path: "google/api/servicecontrol/v1/service_controller.proto" product_path: "google/cloud/servicecontrol/v1" - forwarding_product_path: "google/cloud/servicecontrol" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3643,7 +3604,6 @@ service { service { service_proto_path: "google/cloud/servicedirectory/v1/lookup_service.proto" product_path: "google/cloud/servicedirectory/v1" - forwarding_product_path: "google/cloud/servicedirectory" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable", "kUnknown"] } @@ -3651,7 +3611,6 @@ service { service { service_proto_path: "google/cloud/servicedirectory/v1/registration_service.proto" product_path: "google/cloud/servicedirectory/v1" - forwarding_product_path: "google/cloud/servicedirectory" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable", "kUnknown"] } @@ -3668,7 +3627,6 @@ service { service { service_proto_path: "google/api/servicemanagement/v1/servicemanager.proto" product_path: "google/cloud/servicemanagement/v1" - forwarding_product_path: "google/cloud/servicemanagement" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] omitted_rpcs: [ @@ -3680,7 +3638,6 @@ service { service { service_proto_path: "google/api/serviceusage/v1/serviceusage.proto" product_path: "google/cloud/serviceusage/v1" - forwarding_product_path: "google/cloud/serviceusage" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -3689,7 +3646,6 @@ service { service { service_proto_path: "google/cloud/shell/v1/cloudshell.proto" product_path: "google/cloud/shell/v1" - forwarding_product_path: "google/cloud/shell" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable", "kUnknown"] } @@ -3722,7 +3678,6 @@ service { initial_copyright_year: "2021" service_endpoint_env_var: "GOOGLE_CLOUD_CPP_SPANNER_DEFAULT_ENDPOINT" emulator_endpoint_env_var: "SPANNER_EMULATOR_HOST" - backwards_compatibility_namespace_alias: true retryable_status_codes: ["kUnavailable"] generate_rest_transport: true omit_repo_metadata: true @@ -3735,7 +3690,6 @@ service { initial_copyright_year: "2021" service_endpoint_env_var: "GOOGLE_CLOUD_CPP_SPANNER_DEFAULT_ENDPOINT" emulator_endpoint_env_var: "SPANNER_EMULATOR_HOST" - backwards_compatibility_namespace_alias: true retryable_status_codes: ["kUnavailable"] generate_rest_transport: true omit_repo_metadata: true @@ -3745,7 +3699,6 @@ service { service { service_proto_path: "google/cloud/speech/v1/cloud_speech.proto" product_path: "google/cloud/speech/v1" - forwarding_product_path: "google/cloud/speech" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4000,7 +3953,6 @@ service { service { service_proto_path: "google/storagetransfer/v1/transfer.proto" product_path: "google/cloud/storagetransfer/v1" - forwarding_product_path: "google/cloud/storagetransfer" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4009,7 +3961,6 @@ service { service { service_proto_path: "google/cloud/talent/v4/company_service.proto" product_path: "google/cloud/talent/v4" - forwarding_product_path: "google/cloud/talent" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4017,7 +3968,6 @@ service { service { service_proto_path: "google/cloud/talent/v4/completion_service.proto" product_path: "google/cloud/talent/v4" - forwarding_product_path: "google/cloud/talent" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4025,7 +3975,6 @@ service { service { service_proto_path: "google/cloud/talent/v4/event_service.proto" product_path: "google/cloud/talent/v4" - forwarding_product_path: "google/cloud/talent" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4033,7 +3982,6 @@ service { service { service_proto_path: "google/cloud/talent/v4/job_service.proto" product_path: "google/cloud/talent/v4" - forwarding_product_path: "google/cloud/talent" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4041,7 +3989,6 @@ service { service { service_proto_path: "google/cloud/talent/v4/tenant_service.proto" product_path: "google/cloud/talent/v4" - forwarding_product_path: "google/cloud/talent" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4050,7 +3997,6 @@ service { service { service_proto_path: "google/cloud/tasks/v2/cloudtasks.proto" product_path: "google/cloud/tasks/v2" - forwarding_product_path: "google/cloud/tasks" initial_copyright_year: "2021" retryable_status_codes: ["kInternal", "kUnavailable"] } @@ -4067,7 +4013,6 @@ service { service { service_proto_path: "google/cloud/texttospeech/v1/cloud_tts.proto" product_path: "google/cloud/texttospeech/v1" - forwarding_product_path: "google/cloud/texttospeech" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4086,7 +4031,6 @@ service { product_path: "google/cloud/tpu/v1" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] - forwarding_product_path: "google/cloud/tpu" } service { @@ -4110,7 +4054,6 @@ service { service { service_proto_path: "google/devtools/cloudtrace/v2/tracing.proto" product_path: "google/cloud/trace/v2" - forwarding_product_path: "google/cloud/trace" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4119,16 +4062,36 @@ service { service { service_proto_path: "google/cloud/translate/v3/translation_service.proto" product_path: "google/cloud/translate/v3" - forwarding_product_path: "google/cloud/translate" initial_copyright_year: "2022" 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" product_path: "google/cloud/video/livestream/v1" - forwarding_product_path: "google/cloud/video" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4136,7 +4099,6 @@ service { service { service_proto_path: "google/cloud/video/stitcher/v1/video_stitcher_service.proto" product_path: "google/cloud/video/stitcher/v1" - forwarding_product_path: "google/cloud/video" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4144,7 +4106,6 @@ service { service { service_proto_path: "google/cloud/video/transcoder/v1/services.proto" product_path: "google/cloud/video/transcoder/v1" - forwarding_product_path: "google/cloud/video" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4153,7 +4114,6 @@ service { service { service_proto_path: "google/cloud/videointelligence/v1/video_intelligence.proto" product_path: "google/cloud/videointelligence/v1" - forwarding_product_path: "google/cloud/videointelligence" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4162,7 +4122,6 @@ service { service { service_proto_path: "google/cloud/vision/v1/image_annotator.proto" product_path: "google/cloud/vision/v1" - forwarding_product_path: "google/cloud/vision" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4170,16 +4129,57 @@ service { service { service_proto_path: "google/cloud/vision/v1/product_search_service.proto" product_path: "google/cloud/vision/v1" - forwarding_product_path: "google/cloud/vision" initial_copyright_year: "2022" 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" product_path: "google/cloud/vmmigration/v1" - forwarding_product_path: "google/cloud/vmmigration" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4196,7 +4196,6 @@ service { service { service_proto_path: "google/cloud/vpcaccess/v1/vpc_access.proto" product_path: "google/cloud/vpcaccess/v1" - forwarding_product_path: "google/cloud/vpcaccess" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable", "kUnknown"] } @@ -4205,7 +4204,6 @@ service { service { service_proto_path: "google/cloud/webrisk/v1/webrisk.proto" product_path: "google/cloud/webrisk/v1" - forwarding_product_path: "google/cloud/webrisk" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4214,7 +4212,6 @@ service { service { service_proto_path: "google/cloud/websecurityscanner/v1/web_security_scanner.proto" product_path: "google/cloud/websecurityscanner/v1" - forwarding_product_path: "google/cloud/websecurityscanner" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4223,7 +4220,6 @@ service { service { service_proto_path: "google/cloud/workflows/v1/workflows.proto" product_path: "google/cloud/workflows/v1" - forwarding_product_path: "google/cloud/workflows" initial_copyright_year: "2022" retryable_status_codes: ["kUnavailable"] } @@ -4231,11 +4227,18 @@ service { service { service_proto_path: "google/cloud/workflows/executions/v1/executions.proto" product_path: "google/cloud/workflows/executions/v1" - forwarding_product_path: "google/cloud/workflows" initial_copyright_year: "2022" 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/generator_test.cc b/generator/generator_test.cc index d0400c9d29860..118b3e4f88ab1 100644 --- a/generator/generator_test.cc +++ b/generator/generator_test.cc @@ -17,9 +17,9 @@ #include "generator/testing/error_collectors.h" #include "generator/testing/fake_source_tree.h" #include "generator/testing/printer_mocks.h" +#include "google/protobuf/descriptor.pb.h" #include #include -#include #include #include diff --git a/generator/google_cloud_cpp_generator.bzl b/generator/google_cloud_cpp_generator.bzl index 29f7a3c9dbe36..9a20c262e612e 100644 --- a/generator/google_cloud_cpp_generator.bzl +++ b/generator/google_cloud_cpp_generator.bzl @@ -35,11 +35,6 @@ google_cloud_cpp_generator_hdrs = [ "internal/doxygen.h", "internal/format_class_comments.h", "internal/format_method_comments.h", - "internal/forwarding_client_generator.h", - "internal/forwarding_connection_generator.h", - "internal/forwarding_idempotency_policy_generator.h", - "internal/forwarding_mock_connection_generator.h", - "internal/forwarding_options_generator.h", "internal/generator_interface.h", "internal/http_annotation_parser.h", "internal/http_option_utils.h", @@ -95,11 +90,6 @@ google_cloud_cpp_generator_srcs = [ "internal/doxygen.cc", "internal/format_class_comments.cc", "internal/format_method_comments.cc", - "internal/forwarding_client_generator.cc", - "internal/forwarding_connection_generator.cc", - "internal/forwarding_idempotency_policy_generator.cc", - "internal/forwarding_mock_connection_generator.cc", - "internal/forwarding_options_generator.cc", "internal/http_annotation_parser.cc", "internal/http_option_utils.cc", "internal/idempotency_policy_generator.cc", diff --git a/generator/integration_tests/BUILD.bazel b/generator/integration_tests/BUILD.bazel index 597fae36f8cf0..89d521759ee43 100644 --- a/generator/integration_tests/BUILD.bazel +++ b/generator/integration_tests/BUILD.bazel @@ -12,12 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -load( - "@com_google_googleapis_imports//:imports.bzl", - "cc_grpc_library", - "cc_proto_library", -) -load("@rules_proto//proto:defs.bzl", "proto_library") +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") package(default_visibility = ["//visibility:private"]) @@ -34,22 +31,22 @@ proto_library( "test_request_id.proto", ], deps = [ - "@com_google_googleapis//google/api:annotations_proto", - "@com_google_googleapis//google/api:client_proto", - "@com_google_googleapis//google/api:field_behavior_proto", - "@com_google_googleapis//google/api:field_info_proto", - "@com_google_googleapis//google/api:resource_proto", - "@com_google_googleapis//google/api:routing_proto", - "@com_google_googleapis//google/iam/v1:iam_policy_proto", - "@com_google_googleapis//google/iam/v1:policy_proto", - "@com_google_googleapis//google/longrunning:operations_proto", - "@com_google_googleapis//google/rpc:status_proto", "@com_google_protobuf//:any_proto", "@com_google_protobuf//:duration_proto", "@com_google_protobuf//:empty_proto", "@com_google_protobuf//:field_mask_proto", "@com_google_protobuf//:struct_proto", "@com_google_protobuf//:timestamp_proto", + "@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:resource_proto", + "@googleapis//google/api:routing_proto", + "@googleapis//google/iam/v1:iam_policy_proto", + "@googleapis//google/iam/v1:policy_proto", + "@googleapis//google/longrunning:operations_proto", + "@googleapis//google/rpc:status_proto", ], ) @@ -67,18 +64,19 @@ cc_grpc_library( filegroup( name = "golden_srcs", - srcs = glob([ - "golden/v1/internal/*_sources.cc", - "golden/v1/internal/streaming.cc", - ]), + srcs = glob( + [ + "golden/v1/internal/*_sources.cc", + "golden/v1/internal/streaming.cc", + ], + allow_empty = True, + ), ) filegroup( name = "golden_hdrs", srcs = glob( include = [ - "golden/*.h", - "golden/mocks/*.h", "golden/v1/*.cc", "golden/v1/*.h", "golden/v1/internal/*.cc", @@ -106,8 +104,8 @@ cc_library( "//:grpc_utils", "//google/cloud:google_cloud_cpp_rest_internal", "//google/cloud:google_cloud_cpp_rest_protobuf_internal", - "@com_google_absl//absl/strings", - "@com_google_googleapis//google/longrunning:longrunning_cc_grpc", + "@abseil-cpp//absl/strings", + "@googleapis//google/longrunning:longrunning_cc_grpc", ], ) @@ -132,7 +130,7 @@ filegroup( "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_rest_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in glob(["tests/*.cc"])] diff --git a/generator/integration_tests/CMakeLists.txt b/generator/integration_tests/CMakeLists.txt index 11169e24a3435..fb3fdd6ee7ec4 100644 --- a/generator/integration_tests/CMakeLists.txt +++ b/generator/integration_tests/CMakeLists.txt @@ -54,13 +54,8 @@ set_target_properties(google_cloud_cpp_generator_golden_protos file( GLOB google_cloud_cpp_generator_golden_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" - "golden/*.h" - "golden/mocks/*.h" - "golden/v1/*.h" - "golden/v1/internal/*.h" - "golden/v1/internal/*_sources.cc" - "golden/v1/internal/streaming.cc" - "golden/v1/mocks/*.h") + "golden/v1/*.h" "golden/v1/internal/*.h" "golden/v1/internal/*_sources.cc" + "golden/v1/internal/streaming.cc" "golden/v1/mocks/*.h") list(SORT google_cloud_cpp_generator_golden_files) # Create a library from the where the golden code was copied to. diff --git a/generator/integration_tests/benchmarks/client_benchmark.cc b/generator/integration_tests/benchmarks/client_benchmark.cc index 44ae46eba7e57..d73959e361212 100644 --- a/generator/integration_tests/benchmarks/client_benchmark.cc +++ b/generator/integration_tests/benchmarks/client_benchmark.cc @@ -19,14 +19,14 @@ #include "generator/integration_tests/golden/v1/internal/golden_kitchen_sink_metadata_decorator.h" #include "generator/integration_tests/golden/v1/internal/golden_kitchen_sink_option_defaults.h" #include "generator/integration_tests/golden/v1/internal/golden_kitchen_sink_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/make_status.h" #include "google/cloud/log.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/generator/integration_tests/golden/golden_kitchen_sink_client.h b/generator/integration_tests/golden/golden_kitchen_sink_client.h deleted file mode 100644 index d56d725dd1ef2..0000000000000 --- a/generator/integration_tests/golden/golden_kitchen_sink_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: generator/integration_tests/test.proto - -#ifndef GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_KITCHEN_SINK_CLIENT_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_KITCHEN_SINK_CLIENT_H - -#include "generator/integration_tests/golden/golden_kitchen_sink_connection.h" -#include "generator/integration_tests/golden/v1/golden_kitchen_sink_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in golden_v1 instead of the aliases defined in -/// this namespace. -namespace golden { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use golden_v1::GoldenKitchenSinkClient directly. -using ::google::cloud::golden_v1::GoldenKitchenSinkClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace golden -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_KITCHEN_SINK_CLIENT_H diff --git a/generator/integration_tests/golden/golden_kitchen_sink_connection.h b/generator/integration_tests/golden/golden_kitchen_sink_connection.h deleted file mode 100644 index fadd800f282a5..0000000000000 --- a/generator/integration_tests/golden/golden_kitchen_sink_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: generator/integration_tests/test.proto - -#ifndef GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_KITCHEN_SINK_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_KITCHEN_SINK_CONNECTION_H - -#include "generator/integration_tests/golden/golden_kitchen_sink_connection_idempotency_policy.h" -#include "generator/integration_tests/golden/v1/golden_kitchen_sink_connection.h" - -namespace google { -namespace cloud { -namespace golden { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use golden_v1::MakeGoldenKitchenSinkConnection directly. -using ::google::cloud::golden_v1::MakeGoldenKitchenSinkConnection; - -/// @deprecated Use golden_v1::GoldenKitchenSinkConnection directly. -using ::google::cloud::golden_v1::GoldenKitchenSinkConnection; - -/// @deprecated Use golden_v1::GoldenKitchenSinkLimitedErrorCountRetryPolicy directly. -using ::google::cloud::golden_v1::GoldenKitchenSinkLimitedErrorCountRetryPolicy; - -/// @deprecated Use golden_v1::GoldenKitchenSinkLimitedTimeRetryPolicy directly. -using ::google::cloud::golden_v1::GoldenKitchenSinkLimitedTimeRetryPolicy; - -/// @deprecated Use golden_v1::GoldenKitchenSinkRetryPolicy directly. -using ::google::cloud::golden_v1::GoldenKitchenSinkRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace golden -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_KITCHEN_SINK_CONNECTION_H diff --git a/generator/integration_tests/golden/golden_kitchen_sink_connection_idempotency_policy.h b/generator/integration_tests/golden/golden_kitchen_sink_connection_idempotency_policy.h deleted file mode 100644 index 9917eabc4d73e..0000000000000 --- a/generator/integration_tests/golden/golden_kitchen_sink_connection_idempotency_policy.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: generator/integration_tests/test.proto - -#ifndef GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_KITCHEN_SINK_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_KITCHEN_SINK_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "generator/integration_tests/golden/v1/golden_kitchen_sink_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace golden { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use golden_v1::MakeDefaultGoldenKitchenSinkConnectionIdempotencyPolicy directly. -using ::google::cloud::golden_v1::MakeDefaultGoldenKitchenSinkConnectionIdempotencyPolicy; - -/// @deprecated Use golden_v1::GoldenKitchenSinkConnectionIdempotencyPolicy directly. -using ::google::cloud::golden_v1::GoldenKitchenSinkConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace golden -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_KITCHEN_SINK_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/generator/integration_tests/golden/golden_kitchen_sink_options.h b/generator/integration_tests/golden/golden_kitchen_sink_options.h deleted file mode 100644 index d341c6a472e8e..0000000000000 --- a/generator/integration_tests/golden/golden_kitchen_sink_options.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: generator/integration_tests/test.proto - -#ifndef GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_KITCHEN_SINK_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_KITCHEN_SINK_OPTIONS_H - -#include "generator/integration_tests/golden/golden_kitchen_sink_connection.h" -#include "generator/integration_tests/golden/golden_kitchen_sink_connection_idempotency_policy.h" -#include "generator/integration_tests/golden/v1/golden_kitchen_sink_options.h" - -namespace google { -namespace cloud { -namespace golden { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use golden_v1::GoldenKitchenSinkBackoffPolicyOption directly. -using ::google::cloud::golden_v1::GoldenKitchenSinkBackoffPolicyOption; - -/// @deprecated Use golden_v1::GoldenKitchenSinkConnectionIdempotencyPolicyOption directly. -using ::google::cloud::golden_v1::GoldenKitchenSinkConnectionIdempotencyPolicyOption; - -/// @deprecated Use golden_v1::GoldenKitchenSinkPolicyOptionList directly. -using ::google::cloud::golden_v1::GoldenKitchenSinkPolicyOptionList; - -/// @deprecated Use golden_v1::GoldenKitchenSinkRetryPolicyOption directly. -using ::google::cloud::golden_v1::GoldenKitchenSinkRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace golden -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_KITCHEN_SINK_OPTIONS_H diff --git a/generator/integration_tests/golden/golden_thing_admin_client.h b/generator/integration_tests/golden/golden_thing_admin_client.h deleted file mode 100644 index f6a025d2c33a8..0000000000000 --- a/generator/integration_tests/golden/golden_thing_admin_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: generator/integration_tests/test.proto - -#ifndef GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_THING_ADMIN_CLIENT_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_THING_ADMIN_CLIENT_H - -#include "generator/integration_tests/golden/golden_thing_admin_connection.h" -#include "generator/integration_tests/golden/v1/golden_thing_admin_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in golden_v1 instead of the aliases defined in -/// this namespace. -namespace golden { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use golden_v1::GoldenThingAdminClient directly. -using ::google::cloud::golden_v1::GoldenThingAdminClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace golden -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_THING_ADMIN_CLIENT_H diff --git a/generator/integration_tests/golden/golden_thing_admin_connection.h b/generator/integration_tests/golden/golden_thing_admin_connection.h deleted file mode 100644 index 1983cc96c8f34..0000000000000 --- a/generator/integration_tests/golden/golden_thing_admin_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: generator/integration_tests/test.proto - -#ifndef GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_THING_ADMIN_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_THING_ADMIN_CONNECTION_H - -#include "generator/integration_tests/golden/golden_thing_admin_connection_idempotency_policy.h" -#include "generator/integration_tests/golden/v1/golden_thing_admin_connection.h" - -namespace google { -namespace cloud { -namespace golden { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use golden_v1::MakeGoldenThingAdminConnection directly. -using ::google::cloud::golden_v1::MakeGoldenThingAdminConnection; - -/// @deprecated Use golden_v1::GoldenThingAdminConnection directly. -using ::google::cloud::golden_v1::GoldenThingAdminConnection; - -/// @deprecated Use golden_v1::GoldenThingAdminLimitedErrorCountRetryPolicy directly. -using ::google::cloud::golden_v1::GoldenThingAdminLimitedErrorCountRetryPolicy; - -/// @deprecated Use golden_v1::GoldenThingAdminLimitedTimeRetryPolicy directly. -using ::google::cloud::golden_v1::GoldenThingAdminLimitedTimeRetryPolicy; - -/// @deprecated Use golden_v1::GoldenThingAdminRetryPolicy directly. -using ::google::cloud::golden_v1::GoldenThingAdminRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace golden -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_THING_ADMIN_CONNECTION_H diff --git a/generator/integration_tests/golden/golden_thing_admin_connection_idempotency_policy.h b/generator/integration_tests/golden/golden_thing_admin_connection_idempotency_policy.h deleted file mode 100644 index af07244991e57..0000000000000 --- a/generator/integration_tests/golden/golden_thing_admin_connection_idempotency_policy.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: generator/integration_tests/test.proto - -#ifndef GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_THING_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_THING_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "generator/integration_tests/golden/v1/golden_thing_admin_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace golden { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use golden_v1::MakeDefaultGoldenThingAdminConnectionIdempotencyPolicy directly. -using ::google::cloud::golden_v1::MakeDefaultGoldenThingAdminConnectionIdempotencyPolicy; - -/// @deprecated Use golden_v1::GoldenThingAdminConnectionIdempotencyPolicy directly. -using ::google::cloud::golden_v1::GoldenThingAdminConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace golden -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_THING_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/generator/integration_tests/golden/golden_thing_admin_options.h b/generator/integration_tests/golden/golden_thing_admin_options.h deleted file mode 100644 index ae75afd9faff1..0000000000000 --- a/generator/integration_tests/golden/golden_thing_admin_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: generator/integration_tests/test.proto - -#ifndef GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_THING_ADMIN_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_THING_ADMIN_OPTIONS_H - -#include "generator/integration_tests/golden/golden_thing_admin_connection.h" -#include "generator/integration_tests/golden/golden_thing_admin_connection_idempotency_policy.h" -#include "generator/integration_tests/golden/v1/golden_thing_admin_options.h" - -namespace google { -namespace cloud { -namespace golden { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use golden_v1::GoldenThingAdminPollingPolicyOption directly. -using ::google::cloud::golden_v1::GoldenThingAdminPollingPolicyOption; - -/// @deprecated Use golden_v1::GoldenThingAdminBackoffPolicyOption directly. -using ::google::cloud::golden_v1::GoldenThingAdminBackoffPolicyOption; - -/// @deprecated Use golden_v1::GoldenThingAdminConnectionIdempotencyPolicyOption directly. -using ::google::cloud::golden_v1::GoldenThingAdminConnectionIdempotencyPolicyOption; - -/// @deprecated Use golden_v1::GoldenThingAdminPolicyOptionList directly. -using ::google::cloud::golden_v1::GoldenThingAdminPolicyOptionList; - -/// @deprecated Use golden_v1::GoldenThingAdminRetryPolicyOption directly. -using ::google::cloud::golden_v1::GoldenThingAdminRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace golden -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_GOLDEN_THING_ADMIN_OPTIONS_H diff --git a/generator/integration_tests/golden/mocks/mock_golden_kitchen_sink_connection.h b/generator/integration_tests/golden/mocks/mock_golden_kitchen_sink_connection.h deleted file mode 100644 index cdc30e3cc27c5..0000000000000 --- a/generator/integration_tests/golden/mocks/mock_golden_kitchen_sink_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: generator/integration_tests/test.proto - -#ifndef GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_MOCKS_MOCK_GOLDEN_KITCHEN_SINK_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_MOCKS_MOCK_GOLDEN_KITCHEN_SINK_CONNECTION_H - -#include "generator/integration_tests/golden/golden_kitchen_sink_connection.h" -#include "generator/integration_tests/golden/v1/mocks/mock_golden_kitchen_sink_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in golden_v1_mocks instead of the aliases -/// defined in this namespace. -namespace golden_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use golden_v1_mocks::MockGoldenKitchenSinkConnection directly. -using ::google::cloud::golden_v1_mocks::MockGoldenKitchenSinkConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace golden_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_MOCKS_MOCK_GOLDEN_KITCHEN_SINK_CONNECTION_H diff --git a/generator/integration_tests/golden/mocks/mock_golden_thing_admin_connection.h b/generator/integration_tests/golden/mocks/mock_golden_thing_admin_connection.h deleted file mode 100644 index 225acf2a20e79..0000000000000 --- a/generator/integration_tests/golden/mocks/mock_golden_thing_admin_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: generator/integration_tests/test.proto - -#ifndef GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_MOCKS_MOCK_GOLDEN_THING_ADMIN_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_MOCKS_MOCK_GOLDEN_THING_ADMIN_CONNECTION_H - -#include "generator/integration_tests/golden/golden_thing_admin_connection.h" -#include "generator/integration_tests/golden/v1/mocks/mock_golden_thing_admin_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in golden_v1_mocks instead of the aliases -/// defined in this namespace. -namespace golden_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use golden_v1_mocks::MockGoldenThingAdminConnection directly. -using ::google::cloud::golden_v1_mocks::MockGoldenThingAdminConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace golden_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_MOCKS_MOCK_GOLDEN_THING_ADMIN_CONNECTION_H diff --git a/generator/integration_tests/golden/v1/deprecated_connection.h b/generator/integration_tests/golden/v1/deprecated_connection.h index f4727a71ea2d9..2e25bcaa34df5 100644 --- a/generator/integration_tests/golden/v1/deprecated_connection.h +++ b/generator/integration_tests/golden/v1/deprecated_connection.h @@ -26,7 +26,7 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "generator/integration_tests/test_deprecated.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/deprecated_connection_idempotency_policy.h b/generator/integration_tests/golden/v1/deprecated_connection_idempotency_policy.h index 1c4e23e7e3a60..c29fb07e877c4 100644 --- a/generator/integration_tests/golden/v1/deprecated_connection_idempotency_policy.h +++ b/generator/integration_tests/golden/v1/deprecated_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "generator/integration_tests/test_deprecated.grpc.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/golden_kitchen_sink_client.h b/generator/integration_tests/golden/v1/golden_kitchen_sink_client.h index 8976243806b6d..e6a8424fb7f41 100644 --- a/generator/integration_tests/golden/v1/golden_kitchen_sink_client.h +++ b/generator/integration_tests/golden/v1/golden_kitchen_sink_client.h @@ -25,7 +25,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/protobuf/duration.pb.h" #include #include #include diff --git a/generator/integration_tests/golden/v1/golden_kitchen_sink_connection.h b/generator/integration_tests/golden/v1/golden_kitchen_sink_connection.h index 6c7ac2a9bd245..9d130a614e51b 100644 --- a/generator/integration_tests/golden/v1/golden_kitchen_sink_connection.h +++ b/generator/integration_tests/golden/v1/golden_kitchen_sink_connection.h @@ -29,8 +29,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "generator/integration_tests/backup.pb.h" +#include "generator/integration_tests/test.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/golden_kitchen_sink_connection_idempotency_policy.h b/generator/integration_tests/golden/v1/golden_kitchen_sink_connection_idempotency_policy.h index cfb7da3604b1f..50018df400595 100644 --- a/generator/integration_tests/golden/v1/golden_kitchen_sink_connection_idempotency_policy.h +++ b/generator/integration_tests/golden/v1/golden_kitchen_sink_connection_idempotency_policy.h @@ -21,10 +21,10 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "generator/integration_tests/test.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/golden_rest_only_client.cc b/generator/integration_tests/golden/v1/golden_rest_only_client.cc index 59b55bebb84bf..321cb26e741d7 100644 --- a/generator/integration_tests/golden/v1/golden_rest_only_client.cc +++ b/generator/integration_tests/golden/v1/golden_rest_only_client.cc @@ -38,6 +38,11 @@ GoldenRestOnlyClient::Noop(google::protobuf::Empty const& request, Options opts) return connection_->Noop(request); } +StatusOr GoldenRestOnlyClient::WaitForConsistency(google::protobuf::Empty const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->WaitForConsistency(request); +} + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1 } // namespace cloud diff --git a/generator/integration_tests/golden/v1/golden_rest_only_client.h b/generator/integration_tests/golden/v1/golden_rest_only_client.h index 8da2941554009..5b299490d2335 100644 --- a/generator/integration_tests/golden/v1/golden_rest_only_client.h +++ b/generator/integration_tests/golden/v1/golden_rest_only_client.h @@ -109,6 +109,37 @@ class GoldenRestOnlyClient { Status Noop(google::protobuf::Empty const& request, Options opts = {}); + + // clang-format off + /// + /// Polls a table until it is consistent or the RetryPolicy is exhausted based + /// on a consistency token, that is, if replication has caught up based on the + /// provided conditions specified in the token and the check 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.bigtable.admin.v2.CheckConsistencyRequest]. + /// Proto messages are converted to 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.bigtable.admin.v2.CheckConsistencyResponse]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.bigtable.admin.v2.CheckConsistencyRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L909} + /// [google.bigtable.admin.v2.CheckConsistencyResponse]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L948} + /// + // clang-format on +StatusOr WaitForConsistency(google::protobuf::Empty const& request, Options opts = {}); private: std::shared_ptr connection_; Options options_; diff --git a/generator/integration_tests/golden/v1/golden_rest_only_connection.cc b/generator/integration_tests/golden/v1/golden_rest_only_connection.cc index 4c88d9c0b35f9..44651b4a554e0 100644 --- a/generator/integration_tests/golden/v1/golden_rest_only_connection.cc +++ b/generator/integration_tests/golden/v1/golden_rest_only_connection.cc @@ -41,6 +41,11 @@ GoldenRestOnlyConnection::Noop( return Status(StatusCode::kUnimplemented, "not implemented"); } +StatusOr GoldenRestOnlyConnection::WaitForConsistency(google::protobuf::Empty const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1 } // namespace cloud diff --git a/generator/integration_tests/golden/v1/golden_rest_only_connection.h b/generator/integration_tests/golden/v1/golden_rest_only_connection.h index 49b0a925e4378..d485875264e1b 100644 --- a/generator/integration_tests/golden/v1/golden_rest_only_connection.h +++ b/generator/integration_tests/golden/v1/golden_rest_only_connection.h @@ -26,7 +26,7 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "generator/integration_tests/test2.pb.h" #include namespace google { @@ -176,6 +176,8 @@ class GoldenRestOnlyConnection { virtual Status Noop(google::protobuf::Empty const& request); + + virtual StatusOr WaitForConsistency(google::protobuf::Empty const& request); }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/generator/integration_tests/golden/v1/golden_rest_only_connection_idempotency_policy.h b/generator/integration_tests/golden/v1/golden_rest_only_connection_idempotency_policy.h index 50bb4d53d89a4..85bca182f6dca 100644 --- a/generator/integration_tests/golden/v1/golden_rest_only_connection_idempotency_policy.h +++ b/generator/integration_tests/golden/v1/golden_rest_only_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "generator/integration_tests/test2.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/golden_thing_admin_client.h b/generator/integration_tests/golden/v1/golden_thing_admin_client.h index e86ade00888e6..01dd5d8a41830 100644 --- a/generator/integration_tests/golden/v1/golden_thing_admin_client.h +++ b/generator/integration_tests/golden/v1/golden_thing_admin_client.h @@ -28,7 +28,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/version.h" #include "google/cloud/iam_updater.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/generator/integration_tests/golden/v1/golden_thing_admin_connection.h b/generator/integration_tests/golden/v1/golden_thing_admin_connection.h index d30c8e892f3db..83f4108f646e8 100644 --- a/generator/integration_tests/golden/v1/golden_thing_admin_connection.h +++ b/generator/integration_tests/golden/v1/golden_thing_admin_connection.h @@ -30,9 +30,9 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "generator/integration_tests/backup.pb.h" +#include "generator/integration_tests/test.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/golden_thing_admin_connection_idempotency_policy.h b/generator/integration_tests/golden/v1/golden_thing_admin_connection_idempotency_policy.h index 660653e2db819..7ae7345fd84ab 100644 --- a/generator/integration_tests/golden/v1/golden_thing_admin_connection_idempotency_policy.h +++ b/generator/integration_tests/golden/v1/golden_thing_admin_connection_idempotency_policy.h @@ -21,9 +21,9 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "generator/integration_tests/test.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/internal/deprecated_auth_decorator.cc b/generator/integration_tests/golden/v1/internal/deprecated_auth_decorator.cc index 1fc8379cae6a3..fb771377331b8 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_auth_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/deprecated_auth_decorator.cc @@ -17,10 +17,13 @@ // source: generator/integration_tests/test_deprecated.proto #include "generator/integration_tests/golden/v1/internal/deprecated_auth_decorator.h" -#include +#include "generator/integration_tests/test_deprecated.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -44,3 +47,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/deprecated_auth_decorator.h b/generator/integration_tests/golden/v1/internal/deprecated_auth_decorator.h index 52506df15aca1..e44c49ab6f889 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_auth_decorator.h +++ b/generator/integration_tests/golden/v1/internal/deprecated_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -53,4 +56,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_DEPRECATED_AUTH_DECORATOR_H diff --git a/generator/integration_tests/golden/v1/internal/deprecated_logging_decorator.cc b/generator/integration_tests/golden/v1/internal/deprecated_logging_decorator.cc index 16172166b5c33..af28110e22f8b 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_logging_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/deprecated_logging_decorator.cc @@ -19,12 +19,15 @@ #include "generator/integration_tests/golden/v1/internal/deprecated_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "generator/integration_tests/test_deprecated.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -55,3 +58,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/deprecated_logging_decorator.h b/generator/integration_tests/golden/v1/internal/deprecated_logging_decorator.h index 69ac4937ed695..4e1758223050d 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_logging_decorator.h +++ b/generator/integration_tests/golden/v1/internal/deprecated_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -53,4 +56,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_DEPRECATED_LOGGING_DECORATOR_H diff --git a/generator/integration_tests/golden/v1/internal/deprecated_metadata_decorator.cc b/generator/integration_tests/golden/v1/internal/deprecated_metadata_decorator.cc index 3e639da2f2e49..3e73ae0046a87 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_metadata_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/deprecated_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: generator/integration_tests/test_deprecated.proto #include "generator/integration_tests/golden/v1/internal/deprecated_metadata_decorator.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "generator/integration_tests/test_deprecated.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -70,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/deprecated_metadata_decorator.h b/generator/integration_tests/golden/v1/internal/deprecated_metadata_decorator.h index 097cc7e8137f2..a0a9b0f5e55fa 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_metadata_decorator.h +++ b/generator/integration_tests/golden/v1/internal/deprecated_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -60,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_DEPRECATED_METADATA_DECORATOR_H diff --git a/generator/integration_tests/golden/v1/internal/deprecated_option_defaults.cc b/generator/integration_tests/golden/v1/internal/deprecated_option_defaults.cc index e7e4c8301db38..e88e8ee232a19 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_option_defaults.cc +++ b/generator/integration_tests/golden/v1/internal/deprecated_option_defaults.cc @@ -42,7 +42,7 @@ Options DeprecatedServiceDefaultOptions(Options options) { if (!options.has()) { options.set( golden_v1::DeprecatedServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)).clone()); + std::chrono::minutes(10)).clone()); } if (!options.has()) { options.set( diff --git a/generator/integration_tests/golden/v1/internal/deprecated_rest_logging_decorator.h b/generator/integration_tests/golden/v1/internal/deprecated_rest_logging_decorator.h index 7b682de3e278f..9f9bf38be0e29 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_rest_logging_decorator.h +++ b/generator/integration_tests/golden/v1/internal/deprecated_rest_logging_decorator.h @@ -24,7 +24,7 @@ #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#include "generator/integration_tests/test_deprecated.pb.h" #include #include #include diff --git a/generator/integration_tests/golden/v1/internal/deprecated_rest_metadata_decorator.cc b/generator/integration_tests/golden/v1/internal/deprecated_rest_metadata_decorator.cc index 20c60adf00e18..66141d45baeed 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_rest_metadata_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/deprecated_rest_metadata_decorator.cc @@ -17,8 +17,8 @@ // source: generator/integration_tests/test_deprecated.proto #include "generator/integration_tests/golden/v1/internal/deprecated_rest_metadata_decorator.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" diff --git a/generator/integration_tests/golden/v1/internal/deprecated_rest_metadata_decorator.h b/generator/integration_tests/golden/v1/internal/deprecated_rest_metadata_decorator.h index 3de817571145e..f4754e705e3e5 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_rest_metadata_decorator.h +++ b/generator/integration_tests/golden/v1/internal/deprecated_rest_metadata_decorator.h @@ -23,7 +23,7 @@ #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include +#include "generator/integration_tests/test_deprecated.pb.h" #include #include diff --git a/generator/integration_tests/golden/v1/internal/deprecated_rest_stub.cc b/generator/integration_tests/golden/v1/internal/deprecated_rest_stub.cc index e93d035098e3d..19f91146b4b68 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_rest_stub.cc +++ b/generator/integration_tests/golden/v1/internal/deprecated_rest_stub.cc @@ -17,11 +17,11 @@ // source: generator/integration_tests/test_deprecated.proto #include "generator/integration_tests/golden/v1/internal/deprecated_rest_stub.h" +#include "absl/strings/str_cat.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "generator/integration_tests/test_deprecated.pb.h" #include #include diff --git a/generator/integration_tests/golden/v1/internal/deprecated_rest_stub.h b/generator/integration_tests/golden/v1/internal/deprecated_rest_stub.h index dbf2efee3ac36..c5ce59c4efc35 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_rest_stub.h +++ b/generator/integration_tests/golden/v1/internal/deprecated_rest_stub.h @@ -24,7 +24,7 @@ #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "generator/integration_tests/test_deprecated.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/internal/deprecated_stub.cc b/generator/integration_tests/golden/v1/internal/deprecated_stub.cc index cbad6955ba0a6..009e0f9e04b13 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_stub.cc +++ b/generator/integration_tests/golden/v1/internal/deprecated_stub.cc @@ -19,10 +19,13 @@ #include "generator/integration_tests/golden/v1/internal/deprecated_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "generator/integration_tests/test_deprecated.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -47,3 +50,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/deprecated_stub.h b/generator/integration_tests/golden/v1/internal/deprecated_stub.h index 36a20e1f1a5da..d44e262e324fd 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_stub.h +++ b/generator/integration_tests/golden/v1/internal/deprecated_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "generator/integration_tests/test_deprecated.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -61,4 +64,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_DEPRECATED_STUB_H diff --git a/generator/integration_tests/golden/v1/internal/deprecated_stub_factory.cc b/generator/integration_tests/golden/v1/internal/deprecated_stub_factory.cc index a9b7623d84f4b..ad8fd80d7b7b9 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_stub_factory.cc +++ b/generator/integration_tests/golden/v1/internal/deprecated_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "generator/integration_tests/test_deprecated.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/deprecated_stub_factory.h b/generator/integration_tests/golden/v1/internal/deprecated_stub_factory.h index 79d9fdf84b80d..90f420ccf3375 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_stub_factory.h +++ b/generator/integration_tests/golden/v1/internal/deprecated_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_DEPRECATED_STUB_FACTORY_H diff --git a/generator/integration_tests/golden/v1/internal/deprecated_tracing_connection.cc b/generator/integration_tests/golden/v1/internal/deprecated_tracing_connection.cc index d13c81924d3e5..6b12cb658120c 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_tracing_connection.cc +++ b/generator/integration_tests/golden/v1/internal/deprecated_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DeprecatedServiceTracingConnection::DeprecatedServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -39,16 +37,12 @@ DeprecatedServiceTracingConnection::Noop(google::test::deprecated::v1::Deprecate return internal::EndSpan(*span, child_->Noop(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDeprecatedServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/generator/integration_tests/golden/v1/internal/deprecated_tracing_connection.h b/generator/integration_tests/golden/v1/internal/deprecated_tracing_connection.h index eefcbb36a1f18..541576c6d8c55 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_tracing_connection.h +++ b/generator/integration_tests/golden/v1/internal/deprecated_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DeprecatedServiceTracingConnection : public golden_v1::DeprecatedServiceConnection { public: @@ -47,8 +45,6 @@ class DeprecatedServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/generator/integration_tests/golden/v1/internal/deprecated_tracing_stub.cc b/generator/integration_tests/golden/v1/internal/deprecated_tracing_stub.cc index a56fb521c6ba5..d82448aeb971e 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_tracing_stub.cc +++ b/generator/integration_tests/golden/v1/internal/deprecated_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DeprecatedServiceTracingStub::DeprecatedServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -43,18 +44,14 @@ Status DeprecatedServiceTracingStub::Noop( child_->Noop(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDeprecatedServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/deprecated_tracing_stub.h b/generator/integration_tests/golden/v1/internal/deprecated_tracing_stub.h index 9e2297a69573a..97c9b19717562 100644 --- a/generator/integration_tests/golden/v1/internal/deprecated_tracing_stub.h +++ b/generator/integration_tests/golden/v1/internal/deprecated_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DeprecatedServiceTracingStub : public DeprecatedServiceStub { public: ~DeprecatedServiceTracingStub() override = default; @@ -48,8 +49,6 @@ class DeprecatedServiceTracingStub : public DeprecatedServiceStub { std::shared_ptr propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -64,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_DEPRECATED_TRACING_STUB_H diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_auth_decorator.cc b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_auth_decorator.cc index 9ba86c1582d76..bfc1a30640416 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_auth_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_auth_decorator.cc @@ -21,10 +21,13 @@ #include "google/cloud/internal/async_streaming_read_rpc_auth.h" #include "google/cloud/internal/async_streaming_write_rpc_auth.h" #include "google/cloud/internal/streaming_write_rpc_impl.h" -#include +#include "generator/integration_tests/test.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -225,3 +228,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_auth_decorator.h b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_auth_decorator.h index 6878af270a2bf..0c730391f495f 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_auth_decorator.h +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -144,4 +147,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_GOLDEN_KITCHEN_SINK_AUTH_DECORATOR_H diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_logging_decorator.cc b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_logging_decorator.cc index ddbd94428d4f6..855ec6b3d51a8 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_logging_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_logging_decorator.cc @@ -24,12 +24,15 @@ #include "google/cloud/internal/streaming_read_rpc_logging.h" #include "google/cloud/internal/streaming_write_rpc_logging.h" #include "google/cloud/status_or.h" -#include +#include "generator/integration_tests/test.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -323,3 +326,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_logging_decorator.h b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_logging_decorator.h index 6b1e9cc829e78..2c9c49a54dc11 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_logging_decorator.h +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -145,4 +148,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_GOLDEN_KITCHEN_SINK_LOGGING_DECORATOR_H diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_metadata_decorator.cc b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_metadata_decorator.cc index 42de8cb22315a..46d01bf6abdfa 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_metadata_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_metadata_decorator.cc @@ -17,19 +17,22 @@ // source: generator/integration_tests/test.proto #include "generator/integration_tests/golden/v1/internal/golden_kitchen_sink_metadata_decorator.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/routing_matcher.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "generator/integration_tests/test.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -284,3 +287,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_metadata_decorator.h b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_metadata_decorator.h index 1d311a70ace4f..57f31c8b24d3b 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_metadata_decorator.h +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -151,4 +154,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_GOLDEN_KITCHEN_SINK_METADATA_DECORATOR_H diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_option_defaults.cc b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_option_defaults.cc index e8c2f7433f1ea..b5a80120266e9 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_option_defaults.cc +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_option_defaults.cc @@ -42,7 +42,7 @@ Options GoldenKitchenSinkDefaultOptions(Options options) { if (!options.has()) { options.set( golden_v1::GoldenKitchenSinkLimitedTimeRetryPolicy( - std::chrono::minutes(30)).clone()); + std::chrono::minutes(10)).clone()); } if (!options.has()) { options.set( diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_logging_decorator.h b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_logging_decorator.h index df10cae810a7f..1685990b2dc14 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_logging_decorator.h +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_logging_decorator.h @@ -24,7 +24,7 @@ #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#include "generator/integration_tests/test.pb.h" #include #include #include diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_metadata_decorator.cc b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_metadata_decorator.cc index 1ae999a7c3717..d2b3859215f0e 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_metadata_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_metadata_decorator.cc @@ -17,8 +17,8 @@ // source: generator/integration_tests/test.proto #include "generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_metadata_decorator.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/internal/routing_matcher.h" diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_metadata_decorator.h b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_metadata_decorator.h index be9f9bc99b00f..76cbdfe28c54b 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_metadata_decorator.h +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_metadata_decorator.h @@ -23,7 +23,7 @@ #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include +#include "generator/integration_tests/test.pb.h" #include #include diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.cc b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.cc index c99d9c8015f51..d494614674bfb 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.cc +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.cc @@ -17,11 +17,11 @@ // source: generator/integration_tests/test.proto #include "generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.h" +#include "absl/strings/str_cat.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "generator/integration_tests/test.pb.h" #include #include diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.h b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.h index 5967727ed7a73..682ed67a59950 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.h +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.h @@ -24,11 +24,11 @@ #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include -#include -#include +#include "generator/integration_tests/backup.pb.h" +#include "google/cloud/location/locations.pb.h" +#include "google/iam/v1/iam_policy.pb.h" +#include "google/longrunning/operations.pb.h" +#include "generator/integration_tests/test.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_round_robin_decorator.cc b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_round_robin_decorator.cc index dca9944170b7c..404a367e27fc2 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_round_robin_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_round_robin_decorator.cc @@ -21,6 +21,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -176,3 +179,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_round_robin_decorator.h b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_round_robin_decorator.h index b33762b040970..de3ebeb185ffe 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_round_robin_decorator.h +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_round_robin_decorator.h @@ -25,6 +25,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -145,4 +148,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_GOLDEN_KITCHEN_SINK_ROUND_ROBIN_DECORATOR_H diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub.cc b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub.cc index 116f81d935b47..f7d8a80f18f72 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub.cc +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub.cc @@ -23,10 +23,13 @@ #include "google/cloud/internal/async_streaming_write_rpc_impl.h" #include "google/cloud/internal/streaming_write_rpc_impl.h" #include "google/cloud/status_or.h" -#include +#include "generator/integration_tests/test.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -259,3 +262,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub.h b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub.h index 9051aadd25728..2642dc8c220c9 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub.h +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub.h @@ -29,14 +29,17 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include -#include -#include +#include "generator/integration_tests/backup.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" +#include "generator/integration_tests/test.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -266,4 +269,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_GOLDEN_KITCHEN_SINK_STUB_H diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub_factory.cc b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub_factory.cc index b3b0beca42d6d..009a82963c128 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub_factory.cc +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub_factory.cc @@ -28,13 +28,16 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "generator/integration_tests/test.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/iam/v1/iam_policy.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub_factory.h b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub_factory.h index e680ee1ec8657..bd5535015596d 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub_factory.h +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_GOLDEN_KITCHEN_SINK_STUB_FACTORY_H diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_connection.cc b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_connection.cc index c1cd546b9b301..ce259785752b9 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_connection.cc +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GoldenKitchenSinkTracingConnection::GoldenKitchenSinkTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -136,16 +134,12 @@ GoldenKitchenSinkTracingConnection::ListOperations(google::longrunning::ListOper std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGoldenKitchenSinkTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_connection.h b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_connection.h index ab3c947fc10fa..62f8387932398 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_connection.h +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GoldenKitchenSinkTracingConnection : public golden_v1::GoldenKitchenSinkConnection { public: @@ -88,8 +86,6 @@ class GoldenKitchenSinkTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_stub.cc b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_stub.cc index 32f1dcee73593..eadfdac1d6165 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_stub.cc +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_stub.cc @@ -26,13 +26,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GoldenKitchenSinkTracingStub::GoldenKitchenSinkTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -242,18 +243,14 @@ GoldenKitchenSinkTracingStub::AsyncStreamingWrite( std::move(context), std::move(stream), std::move(span)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGoldenKitchenSinkTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_stub.h b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_stub.h index 5713f2b4a7fac..ae0f43cd13d54 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_stub.h +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GoldenKitchenSinkTracingStub : public GoldenKitchenSinkStub { public: ~GoldenKitchenSinkTracingStub() override = default; @@ -139,8 +140,6 @@ class GoldenKitchenSinkTracingStub : public GoldenKitchenSinkStub { std::shared_ptr propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -155,4 +154,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_GOLDEN_KITCHEN_SINK_TRACING_STUB_H diff --git a/generator/integration_tests/golden/v1/internal/golden_rest_only_option_defaults.cc b/generator/integration_tests/golden/v1/internal/golden_rest_only_option_defaults.cc index bd3b1813fab2a..aa60c705e7319 100644 --- a/generator/integration_tests/golden/v1/internal/golden_rest_only_option_defaults.cc +++ b/generator/integration_tests/golden/v1/internal/golden_rest_only_option_defaults.cc @@ -21,7 +21,7 @@ #include "generator/integration_tests/golden/v1/golden_rest_only_options.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options GoldenRestOnlyDefaultOptions(std::string const& location, Options option if (!options.has()) { options.set( golden_v1::GoldenRestOnlyLimitedTimeRetryPolicy( - std::chrono::minutes(30)).clone()); + std::chrono::minutes(10)).clone()); } if (!options.has()) { options.set( diff --git a/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_logging_decorator.h b/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_logging_decorator.h index 619143e1aebeb..f5964745c3f52 100644 --- a/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_logging_decorator.h +++ b/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_logging_decorator.h @@ -24,7 +24,7 @@ #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#include "generator/integration_tests/test2.pb.h" #include #include #include diff --git a/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_metadata_decorator.cc b/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_metadata_decorator.cc index 93b97ccfc14c2..22ef122507784 100644 --- a/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_metadata_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_metadata_decorator.cc @@ -17,8 +17,8 @@ // source: generator/integration_tests/test2.proto #include "generator/integration_tests/golden/v1/internal/golden_rest_only_rest_metadata_decorator.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" diff --git a/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_metadata_decorator.h b/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_metadata_decorator.h index 3235417000a87..e774ad23b639f 100644 --- a/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_metadata_decorator.h +++ b/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_metadata_decorator.h @@ -23,7 +23,7 @@ #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include +#include "generator/integration_tests/test2.pb.h" #include #include diff --git a/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.cc b/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.cc index 1c4d0945bc7ab..6b89bc3ec21ba 100644 --- a/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.cc +++ b/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.cc @@ -17,11 +17,11 @@ // source: generator/integration_tests/test2.proto #include "generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.h" +#include "absl/strings/str_cat.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "generator/integration_tests/test2.pb.h" #include #include diff --git a/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.h b/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.h index 7277a95c1ca9a..0fe224a7b8de3 100644 --- a/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.h +++ b/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.h @@ -24,7 +24,7 @@ #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "generator/integration_tests/test2.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/internal/golden_rest_only_tracing_connection.cc b/generator/integration_tests/golden/v1/internal/golden_rest_only_tracing_connection.cc index f55f4fb1c958f..0cba6dedbdf53 100644 --- a/generator/integration_tests/golden/v1/internal/golden_rest_only_tracing_connection.cc +++ b/generator/integration_tests/golden/v1/internal/golden_rest_only_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GoldenRestOnlyTracingConnection::GoldenRestOnlyTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -39,16 +37,12 @@ GoldenRestOnlyTracingConnection::Noop(google::protobuf::Empty const& request) { return internal::EndSpan(*span, child_->Noop(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGoldenRestOnlyTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/generator/integration_tests/golden/v1/internal/golden_rest_only_tracing_connection.h b/generator/integration_tests/golden/v1/internal/golden_rest_only_tracing_connection.h index 4938ea49facbc..d8570f8c7564c 100644 --- a/generator/integration_tests/golden/v1/internal/golden_rest_only_tracing_connection.h +++ b/generator/integration_tests/golden/v1/internal/golden_rest_only_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GoldenRestOnlyTracingConnection : public golden_v1::GoldenRestOnlyConnection { public: @@ -47,8 +45,6 @@ class GoldenRestOnlyTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_auth_decorator.cc b/generator/integration_tests/golden/v1/internal/golden_thing_admin_auth_decorator.cc index 0bd19f49b07e3..de3e8777a1ef5 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_auth_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_auth_decorator.cc @@ -17,10 +17,13 @@ // source: generator/integration_tests/test.proto #include "generator/integration_tests/golden/v1/internal/golden_thing_admin_auth_decorator.h" -#include +#include "generator/integration_tests/test.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -384,3 +387,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_auth_decorator.h b/generator/integration_tests/golden/v1/internal/golden_thing_admin_auth_decorator.h index ba01c26554ab8..70607ed59fa32 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_auth_decorator.h +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_auth_decorator.h @@ -22,11 +22,14 @@ #include "generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 golden_v1_internal { @@ -203,4 +206,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_GOLDEN_THING_ADMIN_AUTH_DECORATOR_H diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_connection_impl.h b/generator/integration_tests/golden/v1/internal/golden_thing_admin_connection_impl.h index 54f892d78bdb5..c4290e915f619 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_connection_impl.h +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_logging_decorator.cc b/generator/integration_tests/golden/v1/internal/golden_thing_admin_logging_decorator.cc index 0b7b3163e3803..a95c9319616d6 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_logging_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_logging_decorator.cc @@ -19,12 +19,15 @@ #include "generator/integration_tests/golden/v1/internal/golden_thing_admin_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "generator/integration_tests/test.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -480,3 +483,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_logging_decorator.h b/generator/integration_tests/golden/v1/internal/golden_thing_admin_logging_decorator.h index 07519724e30e0..ef8c07be28621 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_logging_decorator.h +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_logging_decorator.h @@ -22,11 +22,14 @@ #include "generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 golden_v1_internal { @@ -203,4 +206,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_GOLDEN_THING_ADMIN_LOGGING_DECORATOR_H diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_metadata_decorator.cc b/generator/integration_tests/golden/v1/internal/golden_thing_admin_metadata_decorator.cc index 5e2e6b5dcd5f8..c23b1da89a2c1 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_metadata_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_metadata_decorator.cc @@ -17,19 +17,22 @@ // source: generator/integration_tests/test.proto #include "generator/integration_tests/golden/v1/internal/golden_thing_admin_metadata_decorator.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/routing_matcher.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "generator/integration_tests/test.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -423,3 +426,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_metadata_decorator.h b/generator/integration_tests/golden/v1/internal/golden_thing_admin_metadata_decorator.h index ae81704e87b18..c11e15b0e60e2 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_metadata_decorator.h +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_metadata_decorator.h @@ -22,11 +22,14 @@ #include "generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 golden_v1_internal { @@ -210,4 +213,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_GOLDEN_THING_ADMIN_METADATA_DECORATOR_H diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_option_defaults.cc b/generator/integration_tests/golden/v1/internal/golden_thing_admin_option_defaults.cc index 97628414fa551..b8e6a9d874248 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_option_defaults.cc +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_option_defaults.cc @@ -42,7 +42,7 @@ Options GoldenThingAdminDefaultOptions(Options options) { if (!options.has()) { options.set( golden_v1::GoldenThingAdminLimitedTimeRetryPolicy( - std::chrono::minutes(30)).clone()); + std::chrono::minutes(10)).clone()); } if (!options.has()) { options.set( diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_connection_impl.h b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_connection_impl.h index cf40b64cf244f..5724dd54f0276 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_connection_impl.h +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_connection_impl.h @@ -30,7 +30,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_logging_decorator.h b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_logging_decorator.h index 8564cbbc67794..daa327d9cd76b 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_logging_decorator.h +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_logging_decorator.h @@ -24,8 +24,8 @@ #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include +#include "generator/integration_tests/test.pb.h" +#include "google/longrunning/operations.pb.h" #include #include #include diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_metadata_decorator.cc b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_metadata_decorator.cc index c7df00fb03887..6f7ce3febd5a4 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_metadata_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_metadata_decorator.cc @@ -17,8 +17,8 @@ // source: generator/integration_tests/test.proto #include "generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_metadata_decorator.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/internal/routing_matcher.h" diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_metadata_decorator.h b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_metadata_decorator.h index 7345b0754e766..fd3794aea77d4 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_metadata_decorator.h +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_metadata_decorator.h @@ -23,8 +23,8 @@ #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include +#include "generator/integration_tests/test.pb.h" +#include "google/longrunning/operations.pb.h" #include #include diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.cc b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.cc index fba4abc3082e8..83303673aed35 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.cc +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.cc @@ -17,12 +17,12 @@ // source: generator/integration_tests/test.proto #include "generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.h" +#include "absl/strings/str_cat.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "generator/integration_tests/test.pb.h" +#include "google/longrunning/operations.pb.h" #include #include diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.h b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.h index a8da517cd5c60..342a94718c7fb 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.h +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.h @@ -24,10 +24,10 @@ #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "generator/integration_tests/backup.pb.h" +#include "google/cloud/location/locations.pb.h" +#include "google/longrunning/operations.pb.h" +#include "generator/integration_tests/test.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_round_robin_decorator.cc b/generator/integration_tests/golden/v1/internal/golden_thing_admin_round_robin_decorator.cc index 029059b8f119f..a9a3517e6c454 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_round_robin_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_round_robin_decorator.cc @@ -21,6 +21,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -278,3 +281,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_round_robin_decorator.h b/generator/integration_tests/golden/v1/internal/golden_thing_admin_round_robin_decorator.h index f70d24d68719a..c29a1f108a7af 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_round_robin_decorator.h +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_round_robin_decorator.h @@ -25,6 +25,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -203,4 +206,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_GOLDEN_THING_ADMIN_ROUND_ROBIN_DECORATOR_H diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.cc b/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.cc index d55035d5fe0ad..92cccb9cba775 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.cc +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.cc @@ -19,11 +19,14 @@ #include "generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "generator/integration_tests/test.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 golden_v1_internal { @@ -462,3 +465,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.h b/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.h index 3591f12bc6e0b..846f66a66e5fa 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.h +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.h @@ -24,13 +24,16 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "generator/integration_tests/backup.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" +#include "generator/integration_tests/test.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -372,4 +375,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_GOLDEN_THING_ADMIN_STUB_H diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub_factory.cc b/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub_factory.cc index 00515d63f390e..e2503a3044c55 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub_factory.cc +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub_factory.cc @@ -28,12 +28,15 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "generator/integration_tests/test.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub_factory.h b/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub_factory.h index ec537c40eb073..2d4e9da5fc1e1 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub_factory.h +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_GOLDEN_THING_ADMIN_STUB_FACTORY_H diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_connection.cc b/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_connection.cc index dd53241b4bc6b..de42374fbfa9c 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_connection.cc +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GoldenThingAdminTracingConnection::GoldenThingAdminTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -304,16 +302,12 @@ GoldenThingAdminTracingConnection::AsyncDropDatabase(google::test::admin::databa return internal::EndSpan(std::move(span), child_->AsyncDropDatabase(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGoldenThingAdminTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_connection.h b/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_connection.h index 5d14f538b444b..6d446df563c95 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_connection.h +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GoldenThingAdminTracingConnection : public golden_v1::GoldenThingAdminConnection { public: @@ -150,8 +148,6 @@ class GoldenThingAdminTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_stub.cc b/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_stub.cc index 47aa68eba184f..2c068e9771d65 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_stub.cc +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GoldenThingAdminTracingStub::GoldenThingAdminTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -377,18 +378,14 @@ future GoldenThingAdminTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGoldenThingAdminTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_stub.h b/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_stub.h index 83ed2aeff5258..95d0a1e5b356e 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_stub.h +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GoldenThingAdminTracingStub : public GoldenThingAdminStub { public: ~GoldenThingAdminTracingStub() override = default; @@ -197,8 +198,6 @@ class GoldenThingAdminTracingStub : public GoldenThingAdminStub { std::shared_ptr propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -213,4 +212,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_GOLDEN_THING_ADMIN_TRACING_STUB_H diff --git a/generator/integration_tests/golden/v1/internal/request_id_auth_decorator.cc b/generator/integration_tests/golden/v1/internal/request_id_auth_decorator.cc index 872f68ee68c4c..a81626b9446b2 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_auth_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/request_id_auth_decorator.cc @@ -17,10 +17,13 @@ // source: generator/integration_tests/test_request_id.proto #include "generator/integration_tests/golden/v1/internal/request_id_auth_decorator.h" -#include +#include "generator/integration_tests/test_request_id.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -135,3 +138,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/request_id_auth_decorator.h b/generator/integration_tests/golden/v1/internal/request_id_auth_decorator.h index 8d87238884abc..d270ef706427f 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_auth_decorator.h +++ b/generator/integration_tests/golden/v1/internal/request_id_auth_decorator.h @@ -22,11 +22,14 @@ #include "generator/integration_tests/golden/v1/internal/request_id_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 golden_v1_internal { @@ -88,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_REQUEST_ID_AUTH_DECORATOR_H diff --git a/generator/integration_tests/golden/v1/internal/request_id_connection_impl.h b/generator/integration_tests/golden/v1/internal/request_id_connection_impl.h index 9579a41f81b99..f449357766f47 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_connection_impl.h +++ b/generator/integration_tests/golden/v1/internal/request_id_connection_impl.h @@ -33,7 +33,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/internal/request_id_logging_decorator.cc b/generator/integration_tests/golden/v1/internal/request_id_logging_decorator.cc index 61725291df815..8f500b7466685 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_logging_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/request_id_logging_decorator.cc @@ -19,12 +19,15 @@ #include "generator/integration_tests/golden/v1/internal/request_id_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "generator/integration_tests/test_request_id.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -153,3 +156,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/request_id_logging_decorator.h b/generator/integration_tests/golden/v1/internal/request_id_logging_decorator.h index 8e60a32dfc8ca..4e8c11b11a34f 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_logging_decorator.h +++ b/generator/integration_tests/golden/v1/internal/request_id_logging_decorator.h @@ -22,11 +22,14 @@ #include "generator/integration_tests/golden/v1/internal/request_id_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 golden_v1_internal { @@ -88,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_REQUEST_ID_LOGGING_DECORATOR_H diff --git a/generator/integration_tests/golden/v1/internal/request_id_metadata_decorator.cc b/generator/integration_tests/golden/v1/internal/request_id_metadata_decorator.cc index f57605e72e98d..d90276dbabb52 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_metadata_decorator.cc +++ b/generator/integration_tests/golden/v1/internal/request_id_metadata_decorator.cc @@ -17,19 +17,22 @@ // source: generator/integration_tests/test_request_id.proto #include "generator/integration_tests/golden/v1/internal/request_id_metadata_decorator.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/routing_matcher.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "generator/integration_tests/test_request_id.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -204,3 +207,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/request_id_metadata_decorator.h b/generator/integration_tests/golden/v1/internal/request_id_metadata_decorator.h index 5668cfd9d7b06..3955bc0ea385c 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_metadata_decorator.h +++ b/generator/integration_tests/golden/v1/internal/request_id_metadata_decorator.h @@ -22,11 +22,14 @@ #include "generator/integration_tests/golden/v1/internal/request_id_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 golden_v1_internal { @@ -95,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_REQUEST_ID_METADATA_DECORATOR_H diff --git a/generator/integration_tests/golden/v1/internal/request_id_option_defaults.cc b/generator/integration_tests/golden/v1/internal/request_id_option_defaults.cc index 0a476ae463a3c..4c9bf43123199 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_option_defaults.cc +++ b/generator/integration_tests/golden/v1/internal/request_id_option_defaults.cc @@ -42,7 +42,7 @@ Options RequestIdServiceDefaultOptions(Options options) { if (!options.has()) { options.set( golden_v1::RequestIdServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)).clone()); + std::chrono::minutes(10)).clone()); } if (!options.has()) { options.set( diff --git a/generator/integration_tests/golden/v1/internal/request_id_stub.cc b/generator/integration_tests/golden/v1/internal/request_id_stub.cc index cd8b7b8346c43..5d0bdebd3b320 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_stub.cc +++ b/generator/integration_tests/golden/v1/internal/request_id_stub.cc @@ -19,11 +19,14 @@ #include "generator/integration_tests/golden/v1/internal/request_id_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "generator/integration_tests/test_request_id.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 golden_v1_internal { @@ -148,3 +151,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/request_id_stub.h b/generator/integration_tests/golden/v1/internal/request_id_stub.h index 71abeb30b5374..4f54e0dd470fd 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_stub.h +++ b/generator/integration_tests/golden/v1/internal/request_id_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "generator/integration_tests/test_request_id.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 golden_v1_internal { @@ -136,4 +139,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_REQUEST_ID_STUB_H diff --git a/generator/integration_tests/golden/v1/internal/request_id_stub_factory.cc b/generator/integration_tests/golden/v1/internal/request_id_stub_factory.cc index dc7c18524340a..ffc059e793b09 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_stub_factory.cc +++ b/generator/integration_tests/golden/v1/internal/request_id_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "generator/integration_tests/test_request_id.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/request_id_stub_factory.h b/generator/integration_tests/golden/v1/internal/request_id_stub_factory.h index 344f4582be905..f378692a5051e 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_stub_factory.h +++ b/generator/integration_tests/golden/v1/internal/request_id_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_REQUEST_ID_STUB_FACTORY_H diff --git a/generator/integration_tests/golden/v1/internal/request_id_tracing_connection.cc b/generator/integration_tests/golden/v1/internal/request_id_tracing_connection.cc index 4f6c6233ef909..6877827edd0e8 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_tracing_connection.cc +++ b/generator/integration_tests/golden/v1/internal/request_id_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RequestIdServiceTracingConnection::RequestIdServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -85,16 +83,12 @@ RequestIdServiceTracingConnection::AsyncCreateFoo(google::test::requestid::v1::C return internal::EndSpan(std::move(span), child_->AsyncCreateFoo(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRequestIdServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/generator/integration_tests/golden/v1/internal/request_id_tracing_connection.h b/generator/integration_tests/golden/v1/internal/request_id_tracing_connection.h index 9403699b7aa73..237448814d618 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_tracing_connection.h +++ b/generator/integration_tests/golden/v1/internal/request_id_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RequestIdServiceTracingConnection : public golden_v1::RequestIdServiceConnection { public: @@ -64,8 +62,6 @@ class RequestIdServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/generator/integration_tests/golden/v1/internal/request_id_tracing_stub.cc b/generator/integration_tests/golden/v1/internal/request_id_tracing_stub.cc index 5a0f6843f7994..2f908cd698ba3 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_tracing_stub.cc +++ b/generator/integration_tests/golden/v1/internal/request_id_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RequestIdServiceTracingStub::RequestIdServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -125,18 +126,14 @@ future RequestIdServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRequestIdServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/generator/integration_tests/golden/v1/internal/request_id_tracing_stub.h b/generator/integration_tests/golden/v1/internal/request_id_tracing_stub.h index 49fae34d273a2..4d0ec0e9ce420 100644 --- a/generator/integration_tests/golden/v1/internal/request_id_tracing_stub.h +++ b/generator/integration_tests/golden/v1/internal/request_id_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RequestIdServiceTracingStub : public RequestIdServiceStub { public: ~RequestIdServiceTracingStub() override = default; @@ -82,8 +83,6 @@ class RequestIdServiceTracingStub : public RequestIdServiceStub { std::shared_ptr propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -98,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_INTERNAL_REQUEST_ID_TRACING_STUB_H diff --git a/generator/integration_tests/golden/v1/request_id_client.h b/generator/integration_tests/golden/v1/request_id_client.h index 3176a8cb94c93..5ee58ed51ead4 100644 --- a/generator/integration_tests/golden/v1/request_id_client.h +++ b/generator/integration_tests/golden/v1/request_id_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/generator/integration_tests/golden/v1/request_id_connection.h b/generator/integration_tests/golden/v1/request_id_connection.h index 2ae948ebdc811..0370a57a271f3 100644 --- a/generator/integration_tests/golden/v1/request_id_connection.h +++ b/generator/integration_tests/golden/v1/request_id_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "generator/integration_tests/test_request_id.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden/v1/request_id_connection_idempotency_policy.h b/generator/integration_tests/golden/v1/request_id_connection_idempotency_policy.h index 1d5e01994a644..c5b3eb6e173f3 100644 --- a/generator/integration_tests/golden/v1/request_id_connection_idempotency_policy.h +++ b/generator/integration_tests/golden/v1/request_id_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "generator/integration_tests/test_request_id.grpc.pb.h" #include namespace google { diff --git a/generator/integration_tests/golden_config.textproto b/generator/integration_tests/golden_config.textproto index f86b49fb27b2d..894e152e87be0 100644 --- a/generator/integration_tests/golden_config.textproto +++ b/generator/integration_tests/golden_config.textproto @@ -40,7 +40,6 @@ service { ] generate_round_robin_decorator: true generate_rest_transport: true - forwarding_product_path: "generator/integration_tests/golden" idempotency_overrides: [ {rpc_name: "GoldenThingAdmin.DropDatabase", idempotency: IDEMPOTENT}, {rpc_name: "GoldenKitchenSink.ListLogs", idempotency: NON_IDEMPOTENT} @@ -60,6 +59,13 @@ service { ] override_service_config_yaml_name: "generator/integration_tests/test2.yaml" endpoint_location_style: LOCATION_OPTIONALLY_DEPENDENT + bespoke_methods : [ + { + name: "WaitForConsistency", + return_type: "StatusOr", + parameters: "(google::protobuf::Empty const& request, Options opts = {})" + } + ] } service { diff --git a/generator/integration_tests/tests/forwarding_headers_test.cc b/generator/integration_tests/tests/forwarding_headers_test.cc deleted file mode 100644 index 937e1a2af7b33..0000000000000 --- a/generator/integration_tests/tests/forwarding_headers_test.cc +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// In order to test backwards compatibility, we only include `golden` headers. -// We do not include any headers from `golden/v1`. -#include "generator/integration_tests/golden/golden_kitchen_sink_client.h" -#include "generator/integration_tests/golden/golden_kitchen_sink_options.h" -#include "generator/integration_tests/golden/golden_thing_admin_client.h" -#include "generator/integration_tests/golden/golden_thing_admin_options.h" -#include "generator/integration_tests/golden/mocks/mock_golden_kitchen_sink_connection.h" -#include "generator/integration_tests/golden/mocks/mock_golden_thing_admin_connection.h" -#include -#include - -namespace google { -namespace cloud { -// In order to test backwards compatibility, we only use types from the `golden` -// namespace. We do not use any types from `golden_v1` or `golden_v1_mocks`. -namespace golden { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -TEST(ForwardingHeadersTest, BackwardsCompatForGoldenThingAdmin) { - std::shared_ptr retry = - std::make_shared(5); - retry = std::make_shared( - std::chrono::minutes(5)); - std::shared_ptr idempotency = - MakeDefaultGoldenThingAdminConnectionIdempotencyPolicy(); - - auto options = - Options{} - .set(nullptr) - .set(nullptr) - .set(idempotency) - .set(retry); - - std::shared_ptr conn = - std::make_shared(); - GoldenThingAdminClient client(conn, options); - - std::function(Options)> f = - MakeGoldenThingAdminConnection; - EXPECT_TRUE(static_cast(f)); -} - -TEST(ForwardingHeadersTest, BackwardsCompatForGoldenKitchenSink) { - std::shared_ptr retry = - std::make_shared(5); - retry = std::make_shared( - std::chrono::minutes(5)); - std::shared_ptr idempotency = - MakeDefaultGoldenKitchenSinkConnectionIdempotencyPolicy(); - - auto options = - Options{} - .set(nullptr) - .set(idempotency) - .set(retry); - - std::shared_ptr conn = - std::make_shared(); - GoldenKitchenSinkClient client(conn, options); - - std::function(Options)> f = - MakeGoldenKitchenSinkConnection; - EXPECT_TRUE(static_cast(f)); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace golden -} // namespace cloud -} // namespace google diff --git a/generator/integration_tests/tests/golden_kitchen_sink_client_test.cc b/generator/integration_tests/tests/golden_kitchen_sink_client_test.cc index 3e7ea494cb8a4..8ccd182c1acbf 100644 --- a/generator/integration_tests/tests/golden_kitchen_sink_client_test.cc +++ b/generator/integration_tests/tests/golden_kitchen_sink_client_test.cc @@ -21,7 +21,7 @@ #include "google/cloud/internal/time_utils.h" #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/status_matchers.h" -#include +#include "google/iam/v1/policy.pb.h" #include #include #include diff --git a/generator/integration_tests/tests/golden_kitchen_sink_connection_test.cc b/generator/integration_tests/tests/golden_kitchen_sink_connection_test.cc index 5163dd758f5f9..1458a64863107 100644 --- a/generator/integration_tests/tests/golden_kitchen_sink_connection_test.cc +++ b/generator/integration_tests/tests/golden_kitchen_sink_connection_test.cc @@ -371,7 +371,6 @@ TEST(GoldenKitchenSinkConnectionTest, CheckExpectedOptions) { Contains(ContainsRegex("Unexpected option.+UnexpectedOption"))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanNamed; @@ -417,8 +416,6 @@ TEST(GoldenKitchenSinkConnectionTest, TracingDisabled) { "golden_v1::GoldenKitchenSinkConnection::DoNothing")))); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1 diff --git a/generator/integration_tests/tests/golden_kitchen_sink_rest_connection_test.cc b/generator/integration_tests/tests/golden_kitchen_sink_rest_connection_test.cc index ca394218f997b..572927a0119ab 100644 --- a/generator/integration_tests/tests/golden_kitchen_sink_rest_connection_test.cc +++ b/generator/integration_tests/tests/golden_kitchen_sink_rest_connection_test.cc @@ -329,7 +329,6 @@ TEST(GoldenKitchenSinkConnectionTest, CheckExpectedOptions) { Contains(ContainsRegex("Unexpected option.+UnexpectedOption"))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanNamed; @@ -374,8 +373,6 @@ TEST(GoldenKitchenSinkConnectionTest, TracingDisabled) { Not(Contains(SpanNamed( "golden_v1::GoldenKitchenSinkConnection::DoNothing")))); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1 diff --git a/generator/integration_tests/tests/golden_kitchen_sink_rest_stub_factory_test.cc b/generator/integration_tests/tests/golden_kitchen_sink_rest_stub_factory_test.cc index 3e32e57e54d66..596d26013872c 100644 --- a/generator/integration_tests/tests/golden_kitchen_sink_rest_stub_factory_test.cc +++ b/generator/integration_tests/tests/golden_kitchen_sink_rest_stub_factory_test.cc @@ -13,10 +13,10 @@ // limitations under the License. #include "generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub_factory.h" +#include "generator/integration_tests/test.pb.h" #include "google/cloud/common_options.h" #include "google/cloud/testing_util/scoped_log.h" #include "google/cloud/testing_util/status_matchers.h" -#include #include #include diff --git a/generator/integration_tests/tests/golden_kitchen_sink_stub_factory_test.cc b/generator/integration_tests/tests/golden_kitchen_sink_stub_factory_test.cc index 7d533ec279f03..cedcd641ae342 100644 --- a/generator/integration_tests/tests/golden_kitchen_sink_stub_factory_test.cc +++ b/generator/integration_tests/tests/golden_kitchen_sink_stub_factory_test.cc @@ -71,7 +71,6 @@ TEST(GoldenKitchenSinkStubFactoryTest, DefaultStubWithAuth) { EXPECT_THAT(response, StatusIs(StatusCode::kAborted, "fail")); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanNamed; @@ -108,8 +107,6 @@ TEST(GoldenKitchenSinkStubFactoryTest, DefaultStubWithTracingDisabled) { "google.test.admin.database.v1.GoldenKitchenSink/DoNothing")))); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal diff --git a/generator/integration_tests/tests/golden_kitchen_sink_tracing_connection_test.cc b/generator/integration_tests/tests/golden_kitchen_sink_tracing_connection_test.cc index dee9cb2a324a3..72646886eee35 100644 --- a/generator/integration_tests/tests/golden_kitchen_sink_tracing_connection_test.cc +++ b/generator/integration_tests/tests/golden_kitchen_sink_tracing_connection_test.cc @@ -32,7 +32,6 @@ using ::google::cloud::golden_v1_mocks::MockGoldenKitchenSinkConnection; using ::google::cloud::testing_util::StatusIs; using ::testing::Return; -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::InstallSpanCatcher; @@ -376,20 +375,6 @@ TEST(MakeGoldenKitchenSinkTracingConnection, TracingDisabled) { EXPECT_THAT(spans, IsEmpty()); } -#else - -TEST(MakeGoldenKitchenSinkTracingConnection, NoOpenTelemetry) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, DoNothing) - .WillOnce(Return(internal::AbortedError("fail"))); - - auto under_test = MakeGoldenKitchenSinkTracingConnection(mock); - auto result = under_test->DoNothing({}); - EXPECT_THAT(result, StatusIs(StatusCode::kAborted)); -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal diff --git a/generator/integration_tests/tests/golden_kitchen_sink_tracing_stub_test.cc b/generator/integration_tests/tests/golden_kitchen_sink_tracing_stub_test.cc index 306754d8db0f4..69e6bf36d0630 100644 --- a/generator/integration_tests/tests/golden_kitchen_sink_tracing_stub_test.cc +++ b/generator/integration_tests/tests/golden_kitchen_sink_tracing_stub_test.cc @@ -33,8 +33,6 @@ namespace { using ::google::cloud::testing_util::StatusIs; using ::testing::Return; -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - using ::google::cloud::testing_util::InstallSpanCatcher; using ::google::cloud::testing_util::OTelAttribute; using ::google::cloud::testing_util::OTelContextCaptured; @@ -489,21 +487,6 @@ TEST(MakeGoldenKitchenSinkTracingStub, OpenTelemetry) { EXPECT_THAT(spans, Not(IsEmpty())); } -#else - -TEST(MakeGoldenKitchenSinkTracingStub, NoOpenTelemetry) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, DoNothing) - .WillOnce(Return(internal::AbortedError("fail"))); - - auto under_test = MakeGoldenKitchenSinkTracingStub(mock); - grpc::ClientContext context; - auto result = under_test->DoNothing(context, Options{}, {}); - EXPECT_THAT(result, StatusIs(StatusCode::kAborted)); -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal diff --git a/generator/integration_tests/tests/golden_thing_admin_client_test.cc b/generator/integration_tests/tests/golden_thing_admin_client_test.cc index 5eecfeeaa077b..9e1b871df89a3 100644 --- a/generator/integration_tests/tests/golden_thing_admin_client_test.cc +++ b/generator/integration_tests/tests/golden_thing_admin_client_test.cc @@ -22,7 +22,7 @@ #include "google/cloud/internal/time_utils.h" #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/status_matchers.h" -#include +#include "google/iam/v1/policy.pb.h" #include #include #include diff --git a/generator/integration_tests/tests/golden_thing_admin_connection_test.cc b/generator/integration_tests/tests/golden_thing_admin_connection_test.cc index f4fd6b1c543cf..ef2d6171bd9a3 100644 --- a/generator/integration_tests/tests/golden_thing_admin_connection_test.cc +++ b/generator/integration_tests/tests/golden_thing_admin_connection_test.cc @@ -1617,7 +1617,6 @@ TEST(GoldenThingAdminConnectionTest, CheckExpectedOptions) { Contains(ContainsRegex("Unexpected option.+UnexpectedOption"))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanNamed; @@ -1662,9 +1661,6 @@ TEST(GoldenThingAdminConnectionTest, TracingDisabled) { Not(Contains(SpanNamed( "golden_v1::GoldenThingAdminConnection::DeleteBackup")))); } - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1 diff --git a/generator/integration_tests/tests/golden_thing_admin_rest_connection_test.cc b/generator/integration_tests/tests/golden_thing_admin_rest_connection_test.cc index 3e148cc032271..721ff35c2e208 100644 --- a/generator/integration_tests/tests/golden_thing_admin_rest_connection_test.cc +++ b/generator/integration_tests/tests/golden_thing_admin_rest_connection_test.cc @@ -1678,7 +1678,6 @@ TEST(GoldenThingAdminConnectionTest, ConnectionCreatedWithOption) { EXPECT_THAT(conn->options().get(), Eq("foo")); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanNamed; @@ -1723,8 +1722,6 @@ TEST(GoldenThingAdminConnectionTest, TracingDisabled) { Not(Contains(SpanNamed( "golden_v1::GoldenThingAdminConnection::DeleteBackup")))); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1 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/integration_tests/tests/golden_thing_admin_stub_factory_test.cc b/generator/integration_tests/tests/golden_thing_admin_stub_factory_test.cc index 891b661895da2..07f5153e836a1 100644 --- a/generator/integration_tests/tests/golden_thing_admin_stub_factory_test.cc +++ b/generator/integration_tests/tests/golden_thing_admin_stub_factory_test.cc @@ -71,7 +71,6 @@ TEST(GoldenStubFactoryTest, DefaultStubWithAuth) { EXPECT_THAT(response, StatusIs(StatusCode::kAborted, "fail")); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanNamed; @@ -109,8 +108,6 @@ TEST(GoldenStubFactoryTest, DefaultStubWithTracingDisabled) { "google.test.admin.database.v1.GoldenThingAdmin/DeleteBackup")))); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal diff --git a/generator/integration_tests/tests/golden_thing_admin_tracing_connection_test.cc b/generator/integration_tests/tests/golden_thing_admin_tracing_connection_test.cc index 7e994c2abef99..348d7016d2761 100644 --- a/generator/integration_tests/tests/golden_thing_admin_tracing_connection_test.cc +++ b/generator/integration_tests/tests/golden_thing_admin_tracing_connection_test.cc @@ -32,7 +32,6 @@ using ::google::cloud::golden_v1_mocks::MockGoldenThingAdminConnection; using ::google::cloud::testing_util::StatusIs; using ::testing::Return; -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::InstallSpanCatcher; @@ -702,20 +701,6 @@ TEST(MakeGoldenThingAdminTracingConnection, TracingDisabled) { EXPECT_THAT(spans, IsEmpty()); } -#else - -TEST(MakeGoldenThingAdminTracingConnection, NoOpenTelemetry) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, DropDatabase) - .WillOnce(Return(internal::AbortedError("fail"))); - - auto under_test = MakeGoldenThingAdminTracingConnection(mock); - auto result = under_test->DropDatabase({}); - EXPECT_THAT(result, StatusIs(StatusCode::kAborted)); -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal diff --git a/generator/integration_tests/tests/golden_thing_admin_tracing_stub_test.cc b/generator/integration_tests/tests/golden_thing_admin_tracing_stub_test.cc index 8ca098fdea0a8..4c01aa06805c3 100644 --- a/generator/integration_tests/tests/golden_thing_admin_tracing_stub_test.cc +++ b/generator/integration_tests/tests/golden_thing_admin_tracing_stub_test.cc @@ -26,8 +26,6 @@ namespace golden_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - using ::google::cloud::testing_util::InstallSpanCatcher; using ::google::cloud::testing_util::OTelAttribute; using ::google::cloud::testing_util::OTelContextCaptured; @@ -698,24 +696,6 @@ TEST(MakeGoldenThingAdminTracingStub, OpenTelemetry) { EXPECT_THAT(spans, Not(IsEmpty())); } -#else - -using ::google::cloud::testing_util::StatusIs; -using ::testing::Return; - -TEST(MakeGoldenThingAdminTracingStub, NoOpenTelemetry) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, DropDatabase) - .WillOnce(Return(internal::AbortedError("fail"))); - - auto under_test = MakeGoldenThingAdminTracingStub(mock); - grpc::ClientContext context; - auto result = under_test->DropDatabase(context, Options{}, {}); - EXPECT_THAT(result, StatusIs(StatusCode::kAborted)); -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1_internal diff --git a/generator/integration_tests/tests/request_id_tracing_stub_test.cc b/generator/integration_tests/tests/request_id_tracing_stub_test.cc index a92d4f28f81ee..fb4f9fbaa1562 100644 --- a/generator/integration_tests/tests/request_id_tracing_stub_test.cc +++ b/generator/integration_tests/tests/request_id_tracing_stub_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "generator/integration_tests/golden/v1/internal/request_id_tracing_stub.h" #include "generator/integration_tests/golden/v1/internal/request_id_connection_impl.h" #include "generator/integration_tests/golden/v1/internal/request_id_option_defaults.h" @@ -39,27 +37,16 @@ namespace { using ::google::cloud::golden_v1_testing::MockRequestIdServiceStub; using ::google::cloud::testing_util::InstallSpanCatcher; using ::google::cloud::testing_util::OTelAttribute; -using ::google::cloud::testing_util::OTelContextCaptured; using ::google::cloud::testing_util::SpanHasAttributes; -using ::google::cloud::testing_util::SpanHasInstrumentationScope; -using ::google::cloud::testing_util::SpanKindIsClient; using ::google::cloud::testing_util::SpanNamed; -using ::google::cloud::testing_util::SpanWithStatus; using ::google::cloud::testing_util::ThereIsAnActiveSpan; using ::google::cloud::testing_util::ValidatePropagator; using ::google::test::requestid::v1::CreateFooRequest; using ::google::test::requestid::v1::Foo; -using ::google::test::requestid::v1::ListFoosRequest; -using ::google::test::requestid::v1::ListFoosResponse; using ::google::test::requestid::v1::RenameFooRequest; -using ::testing::_; -using ::testing::ByMove; using ::testing::ElementsAre; -using ::testing::Eq; using ::testing::IsEmpty; using ::testing::Not; -using ::testing::ResultOf; -using ::testing::Return; Status TransientError() { return Status(StatusCode::kUnavailable, "try-again"); @@ -214,5 +201,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace golden_v1 } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/generator/internal/auth_decorator_generator.cc b/generator/internal/auth_decorator_generator.cc index 6628f4dcce822..fb8c640fe7a5b 100644 --- a/generator/internal/auth_decorator_generator.cc +++ b/generator/internal/auth_decorator_generator.cc @@ -55,7 +55,7 @@ Status AuthDecoratorGenerator::GenerateHeader() { ? "google/longrunning/operations.grpc.pb.h" : ""}); HeaderSystemIncludes({"memory", "set", "string"}); - + HeaderGrpcPortsDefInclude(); auto result = HeaderOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; @@ -80,6 +80,7 @@ class $auth_class_name$ : public $stub_class_name$ { )"""); HeaderCloseNamespaces(); + HeaderGrpcPortsUndefInclude(); // close header guard HeaderPrint("\n#endif // $header_include_guard$\n"); return {}; @@ -113,7 +114,7 @@ Status AuthDecoratorGenerator::GenerateCc() { }); CcProtobufGenCodeIncludes({vars("proto_grpc_header_path")}); CcSystemIncludes({"memory", "utility"}); - + CcGrpcPortsDefInclude(); auto result = CcOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; @@ -362,6 +363,7 @@ future $auth_class_name$::AsyncCancelOperation( } CcCloseNamespaces(); + CcGrpcPortsUndefInclude(); return {}; } diff --git a/generator/internal/client_generator.cc b/generator/internal/client_generator.cc index baa28c4995f2c..c2585c255ee97 100644 --- a/generator/internal/client_generator.cc +++ b/generator/internal/client_generator.cc @@ -20,13 +20,52 @@ #include "generator/internal/pagination.h" #include "generator/internal/predicate_utils.h" #include "generator/internal/printer.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_replace.h" +#include "google/api/client.pb.h" #include namespace google { namespace cloud { namespace generator_internal { +namespace { +std::string FormatBespokeMethodComments(std::string const& method_name) { + if (method_name == "WaitForConsistency") { + return R"""( + // clang-format off + /// + /// Polls a table until it is consistent or the RetryPolicy is exhausted based + /// on a consistency token, that is, if replication has caught up based on the + /// provided conditions specified in the token and the check 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.bigtable.admin.v2.CheckConsistencyRequest]. + /// Proto messages are converted to 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.bigtable.admin.v2.CheckConsistencyResponse]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.bigtable.admin.v2.CheckConsistencyRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L909} + /// [google.bigtable.admin.v2.CheckConsistencyResponse]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L948} + /// + // clang-format on +)"""; + } + return ""; +} +} // namespace ClientGenerator::ClientGenerator( google::protobuf::ServiceDescriptor const* service_descriptor, @@ -380,6 +419,13 @@ R"""( std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< __FILE__, __LINE__); } + for (auto const& method : bespoke_methods()) { + HeaderPrint("\n"); + HeaderPrint(FormatBespokeMethodComments(method.name())); + HeaderPrint(absl::StrCat(method.return_type(), " ", method.name(), + method.parameters(), ";")); + } + HeaderPrint( // clang-format off "\n" " private:\n" @@ -716,6 +762,19 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< __FILE__, __LINE__); } + for (auto const& method : bespoke_methods()) { + CcPrint("\n"); + CcPrint(absl::StrCat( + method.return_type(), R"""( $client_class_name$::)""", method.name(), + absl::StrReplaceAll(method.parameters(), {{" = {}", ""}}), + absl::StrFormat(R"""( { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->%s(request); +} +)""", + method.name()))); + } + CcCloseNamespaces(); return {}; } diff --git a/generator/internal/codegen_utils.cc b/generator/internal/codegen_utils.cc index 9d347017daaf2..3e5be23b867d1 100644 --- a/generator/internal/codegen_utils.cc +++ b/generator/internal/codegen_utils.cc @@ -14,12 +14,12 @@ #include "generator/internal/codegen_utils.h" #include "generator/internal/scaffold_generator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/log.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "absl/strings/str_replace.h" #include "absl/strings/str_split.h" #include "absl/time/clock.h" #include "absl/time/time.h" @@ -111,6 +111,11 @@ void ProcessArgOmitRpc( ProcessRepeated("omit_rpc", "omitted_rpcs", command_line_args); } +void ProcessArgBespokeMethod( + std::vector>& command_line_args) { + ProcessRepeated("bespoke_method", "bespoke_methods", command_line_args); +} + void ProcessArgServiceEndpointEnvVar( std::vector>& command_line_args) { auto service_endpoint_env_var = @@ -165,16 +170,6 @@ void ProcessArgAdditionalProtoFiles( command_line_args); } -void ProcessArgForwardingProductPath( - std::vector>& command_line_args) { - auto path = std::find_if(command_line_args.begin(), command_line_args.end(), - [](std::pair const& p) { - return p.first == "forwarding_product_path"; - }); - if (path == command_line_args.end() || path->second.empty()) return; - FormatProductPath(path->second); -} - void ProcessArgIdempotencyOverride( std::vector>& command_line_args) { ProcessRepeated("idempotency_override", "idempotency_overrides", @@ -279,13 +274,13 @@ ProcessCommandLineArgs(std::string const& parameters) { ProcessArgCopyrightYear(command_line_args); ProcessArgOmitService(command_line_args); ProcessArgOmitRpc(command_line_args); + ProcessArgBespokeMethod(command_line_args); ProcessArgServiceEndpointEnvVar(command_line_args); ProcessArgEmulatorEndpointEnvVar(command_line_args); ProcessArgEndpointLocationStyle(command_line_args); ProcessArgGenerateAsyncRpc(command_line_args); ProcessArgRetryGrpcStatusCode(command_line_args); ProcessArgAdditionalProtoFiles(command_line_args); - ProcessArgForwardingProductPath(command_line_args); ProcessArgIdempotencyOverride(command_line_args); ProcessArgServiceNameMapping(command_line_args); ProcessArgServiceNameToComment(command_line_args); diff --git a/generator/internal/codegen_utils_test.cc b/generator/internal/codegen_utils_test.cc index 930ca5ebd2273..de160074187a7 100644 --- a/generator/internal/codegen_utils_test.cc +++ b/generator/internal/codegen_utils_test.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "generator/internal/codegen_utils.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/testing_util/status_matchers.h" +#include "absl/strings/str_cat.h" #include "absl/time/clock.h" #include "absl/time/time.h" #include @@ -265,16 +265,6 @@ TEST(ProcessCommandLineArgs, ProcessArgAsyncOnlyRpc) { Contains(Pair("gen_async_rpcs", HasSubstr("AsyncOnly")))); } -TEST(ProcessCommandLineArgs, ProcessArgNamespaceAlias) { - auto result = ProcessCommandLineArgs( - ",product_path=google/cloud/spanner/" - ",emulator_endpoint_env_var=SPANNER_EMULATOR_HOST" - ",backwards_compatibility_namespace_alias=true"); - ASSERT_THAT(result, IsOk()); - EXPECT_THAT(*result, Contains(Pair("backwards_compatibility_namespace_alias", - HasSubstr("true")))); -} - TEST(ProcessCommandLineArgs, ProcessOmitClient) { auto result = ProcessCommandLineArgs( "product_path=google/cloud/spanner/" @@ -333,15 +323,6 @@ TEST(ProcessCommandLineArgs, ProcessExperimental) { EXPECT_THAT(*result, Contains(Pair("experimental", "true"))); } -TEST(ProcessCommandLineArgs, ProcessArgForwardingProductPath) { - auto result = ProcessCommandLineArgs( - "product_path=/google/cloud/spanner/v1" - ",forwarding_product_path=google/cloud/spanner"); - ASSERT_THAT(result, IsOk()); - EXPECT_THAT(*result, Contains(Pair("forwarding_product_path", - "google/cloud/spanner/"))); -} - TEST(ProcessCommandLineArgs, ProcessServiceNameMapping) { auto result = ProcessCommandLineArgs( "product_path=google/cloud/pubsub/" diff --git a/generator/internal/connection_generator.cc b/generator/internal/connection_generator.cc index 660fda650c8bd..b45cc3d46b638 100644 --- a/generator/internal/connection_generator.cc +++ b/generator/internal/connection_generator.cc @@ -19,6 +19,7 @@ #include "generator/internal/pagination.h" #include "generator/internal/predicate_utils.h" #include "generator/internal/printer.h" +#include "absl/strings/str_replace.h" #include "absl/strings/str_split.h" #include @@ -315,6 +316,14 @@ class $connection_class_name$ { __FILE__, __LINE__); } + for (auto const& method : bespoke_methods()) { + HeaderPrint("\n"); + HeaderPrint(absl::StrCat( + " virtual ", method.return_type(), " ", method.name(), + absl::StrReplaceAll(method.parameters(), {{", Options opts = {}", ""}}), + ";\n")); + } + // close abstract interface Connection base class HeaderPrint("};\n"); @@ -490,27 +499,31 @@ future> __FILE__, __LINE__); } + for (auto const& method : bespoke_methods()) { + CcPrint("\n"); + std::string make_return = + absl::StrContains(method.return_type(), "future") + ? absl::StrCat("google::cloud::make_ready_", method.return_type()) + : method.return_type(); + + CcPrint( + absl::StrCat(method.return_type(), R"""( $connection_class_name$::)""", + method.name(), + absl::StrReplaceAll(method.parameters(), + {{" request, Options opts = {}", ""}}), + " {\n", + absl::StrFormat(R"""( return %s( + Status(StatusCode::kUnimplemented, "not implemented")); +} +)""", + make_return))); + } + if (HasGenerateGrpcTransport()) { EmitFactoryFunctionDefinition(EndpointLocationStyle()); } CcCloseNamespaces(); - - // TODO(#8234): This is a special case for backwards compatibility of the - // streaming update function. - if (vars().at("service_name") == "BigQueryRead") { - CcOpenForwardingNamespaces(); - CcPrint(R"""( -void BigQueryReadReadRowsStreamingUpdater( - google::cloud::bigquery::storage::v1::ReadRowsResponse const& response, - google::cloud::bigquery::storage::v1::ReadRowsRequest& request) { - return bigquery_storage_v1_internal::BigQueryReadReadRowsStreamingUpdater(response, - request); -} -)"""); - CcCloseNamespaces(); - } - return {}; } diff --git a/generator/internal/connection_impl_generator.cc b/generator/internal/connection_impl_generator.cc index 7823cdcc81fa1..cb1ac65aa51a7 100644 --- a/generator/internal/connection_impl_generator.cc +++ b/generator/internal/connection_impl_generator.cc @@ -18,7 +18,8 @@ #include "generator/internal/pagination.h" #include "generator/internal/predicate_utils.h" #include "generator/internal/printer.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_replace.h" #include namespace google { @@ -120,6 +121,14 @@ class $connection_class_name$Impl HeaderPrintMethod(method, __FILE__, __LINE__, AsyncMethodDeclaration()); } + for (auto const& method : bespoke_methods()) { + HeaderPrint("\n"); + HeaderPrint(absl::StrCat( + method.return_type(), " ", method.name(), + absl::StrReplaceAll(method.parameters(), {{", Options opts = {}", ""}}), + " override;")); + } + HeaderPrint(R"""( private: std::unique_ptr background_; diff --git a/generator/internal/connection_impl_rest_generator.cc b/generator/internal/connection_impl_rest_generator.cc index b4f1b168f2b38..b0b6e7b16405d 100644 --- a/generator/internal/connection_impl_rest_generator.cc +++ b/generator/internal/connection_impl_rest_generator.cc @@ -19,7 +19,7 @@ #include "generator/internal/pagination.h" #include "generator/internal/predicate_utils.h" #include "generator/internal/printer.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" #include namespace google { diff --git a/generator/internal/descriptor_utils.cc b/generator/internal/descriptor_utils.cc index 342a1d7dd9cba..8aa4e8bc5b044 100644 --- a/generator/internal/descriptor_utils.cc +++ b/generator/internal/descriptor_utils.cc @@ -26,19 +26,19 @@ #include "generator/internal/resolve_method_return.h" #include "generator/internal/routing.h" #include "generator/internal/scaffold_generator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/internal/algorithm.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/log.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "absl/strings/str_replace.h" #include "absl/strings/str_split.h" #include "absl/strings/strip.h" #include "absl/types/variant.h" -#include -#include -#include -#include +#include "google/api/annotations.pb.h" +#include "google/api/http.pb.h" +#include "google/api/routing.pb.h" +#include "google/longrunning/operations.pb.h" #include #include #include @@ -310,6 +310,11 @@ ParameterCommentSubstitution substitutions[] = { {"`projects//locations//agents/.", "`projects//locations//agents/`."}, + // From google/cloud/gkehub/v1/service.proto + {R"""(Given 'updated' + prefix to follow go/proto-best-practices-checkers#keyword_conflict)""", + R"""()"""}, + // Some comments include multiple newlines in a row. We need to preserve // these because they are paragraph separators. When used in `@param` // commands we need to represent them as `@n` or they do would terminate the diff --git a/generator/internal/descriptor_utils_test.cc b/generator/internal/descriptor_utils_test.cc index 467251f6d2a0d..3726301a8c199 100644 --- a/generator/internal/descriptor_utils_test.cc +++ b/generator/internal/descriptor_utils_test.cc @@ -17,11 +17,11 @@ #include "generator/testing/error_collectors.h" #include "generator/testing/fake_source_tree.h" #include "generator/testing/printer_mocks.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/testing_util/status_matchers.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_split.h" +#include "google/protobuf/descriptor.pb.h" #include -#include #include #include #include @@ -221,43 +221,6 @@ TEST_F(CreateServiceVarsTest, AdditionalGrpcHeaderPathsEmpty) { EXPECT_THAT(iter->second, Eq("")); } -TEST_F(CreateServiceVarsTest, ForwardingHeaderPaths) { - FileDescriptor const* service_file_descriptor = - pool_.FindFileByName("google/cloud/frobber/v1/frobber.proto"); - service_vars_ = CreateServiceVars( - *service_file_descriptor->service(0), - {std::make_pair("product_path", "google/cloud/frobber/v1/"), - std::make_pair("forwarding_product_path", "google/cloud/frobber/")}); - EXPECT_THAT( - service_vars_, - AllOf(Contains(Pair("forwarding_client_header_path", - "google/cloud/frobber/frobber_client.h")), - Contains(Pair("forwarding_connection_header_path", - "google/cloud/frobber/frobber_connection.h")), - Contains(Pair("forwarding_idempotency_policy_header_path", - "google/cloud/frobber/" - "frobber_connection_idempotency_policy.h")), - Contains( - Pair("forwarding_mock_connection_header_path", - "google/cloud/frobber/mocks/mock_frobber_connection.h")), - Contains(Pair("forwarding_options_header_path", - "google/cloud/frobber/frobber_options.h")))); - EXPECT_THAT( - service_vars_, - AllOf(Contains(Pair("client_header_path", - "google/cloud/frobber/v1/frobber_client.h")), - Contains(Pair("connection_header_path", - "google/cloud/frobber/v1/frobber_connection.h")), - Contains(Pair("idempotency_policy_header_path", - "google/cloud/frobber/v1/" - "frobber_connection_idempotency_policy.h")), - Contains(Pair( - "mock_connection_header_path", - "google/cloud/frobber/v1/mocks/mock_frobber_connection.h")), - Contains(Pair("options_header_path", - "google/cloud/frobber/v1/frobber_options.h")))); -} - TEST_F(CreateServiceVarsTest, MixinProtoHeaderPaths) { FileDescriptor const* file = pool_.FindFileByName("google/cloud/frobber/v1/frobber.proto"); diff --git a/generator/internal/discovery_file.cc b/generator/internal/discovery_file.cc index e76ca853afec0..370c7e5c300d6 100644 --- a/generator/internal/discovery_file.cc +++ b/generator/internal/discovery_file.cc @@ -14,8 +14,8 @@ #include "generator/internal/discovery_file.h" #include "generator/internal/codegen_utils.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "absl/strings/str_format.h" +#include "absl/strings/str_join.h" #include #include #include @@ -62,8 +62,8 @@ Status DiscoveryFile::FormatFile( {"version", document_properties.version}}; google::protobuf::io::OstreamOutputStream output(&output_stream); google::protobuf::io::Printer printer(&output, '$'); - printer.Print(vars, CopyrightLicenseFileHeader().c_str()); - printer.Print(vars, GeneratedProtoPreamble().c_str()); + printer.Print(vars, CopyrightLicenseFileHeader()); + printer.Print(vars, GeneratedProtoPreamble()); printer.Print(vars, R"""( syntax = "proto3"; @@ -73,7 +73,7 @@ package $package_name$; if (!import_paths_.empty()) { printer.Print("\n"); for (auto const& path : import_paths_) { - printer.Print(vars, absl::StrFormat("import \"%s\";\n", path).c_str()); + printer.Print(vars, absl::StrFormat("import \"%s\";\n", path)); } } @@ -84,14 +84,14 @@ package $package_name$; if (!service_definition) { return std::move(service_definition).status(); } - printer.Print(vars, std::move(service_definition)->c_str()); + printer.Print(vars, *service_definition); } for (auto const& t : types_) { auto message = t->JsonToProtobufMessage(types, package_name_); if (!message) return std::move(message).status(); printer.Print("\n"); - printer.Print(vars, std::move(message)->c_str()); + printer.Print(vars, *message); } return {}; diff --git a/generator/internal/discovery_file_test.cc b/generator/internal/discovery_file_test.cc index b7f0f08bf7dba..fcc54f67381c9 100644 --- a/generator/internal/discovery_file_test.cc +++ b/generator/internal/discovery_file_test.cc @@ -15,8 +15,8 @@ #include "generator/internal/discovery_file.h" #include "generator/internal/codegen_utils.h" #include "generator/testing/descriptor_pool_fixture.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/testing_util/status_matchers.h" +#include "absl/strings/str_cat.h" #include namespace google { diff --git a/generator/internal/discovery_proto_export_file.cc b/generator/internal/discovery_proto_export_file.cc index cecd30328e852..248328a71a506 100644 --- a/generator/internal/discovery_proto_export_file.cc +++ b/generator/internal/discovery_proto_export_file.cc @@ -14,8 +14,8 @@ #include "generator/internal/discovery_proto_export_file.h" #include "generator/internal/codegen_utils.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_replace.h" #include #include #include @@ -55,9 +55,9 @@ Status DiscoveryProtoExportFile::FormatFile(std::ostream& output_stream) const { )"""); printer.Print("// IWYU pragma: begin_exports\n"); for (auto const& p : proto_includes_) { - printer.Print("#include <"); + printer.Print("#include \""); printer.Print(absl::StrReplaceAll(p, {{".proto", ".pb.h"}})); - printer.Print(">\n"); + printer.Print("\"\n"); } printer.Print("// IWYU pragma: end_exports\n"); printer.Print(vars, R"""( diff --git a/generator/internal/discovery_proto_export_file_test.cc b/generator/internal/discovery_proto_export_file_test.cc index 13f079b131d9d..1942f0853e370 100644 --- a/generator/internal/discovery_proto_export_file_test.cc +++ b/generator/internal/discovery_proto_export_file_test.cc @@ -14,8 +14,8 @@ #include "generator/internal/discovery_proto_export_file.h" #include "generator/internal/codegen_utils.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/testing_util/status_matchers.h" +#include "absl/strings/str_replace.h" #include namespace google { @@ -55,8 +55,8 @@ TEST(DiscoveryProtoExportFileTest, FormatFile) { #define GOOGLE_CLOUD_CPP_RELATIVE_FILE_PATH_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_001.pb.h" +#include "google/cloud/compute/v1/internal/common_002.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_RELATIVE_FILE_PATH_H diff --git a/generator/internal/discovery_resource.cc b/generator/internal/discovery_resource.cc index b97488bdf6cdc..ce1ec18dd3b1a 100644 --- a/generator/internal/discovery_resource.cc +++ b/generator/internal/discovery_resource.cc @@ -14,13 +14,13 @@ #include "generator/internal/discovery_resource.h" #include "generator/internal/codegen_utils.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/internal/algorithm.h" #include "google/cloud/internal/make_status.h" #include "absl/strings/ascii.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" +#include "absl/strings/str_join.h" +#include "absl/strings/str_replace.h" #include "absl/strings/str_split.h" #include diff --git a/generator/internal/discovery_to_proto.cc b/generator/internal/discovery_to_proto.cc index 520ae6a4dc4a7..da7bca5d10de9 100644 --- a/generator/internal/discovery_to_proto.cc +++ b/generator/internal/discovery_to_proto.cc @@ -17,15 +17,15 @@ #include "generator/internal/discovery_proto_export_file.h" #include "generator/internal/discovery_resource.h" #include "generator/internal/discovery_type_vertex.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/algorithm.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/log.h" #include "google/cloud/status_or.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" +#include "absl/strings/str_join.h" #include "absl/strings/str_split.h" #include #include diff --git a/generator/internal/discovery_type_vertex.cc b/generator/internal/discovery_type_vertex.cc index c29683c7cc2a4..645adb402a9f0 100644 --- a/generator/internal/discovery_type_vertex.cc +++ b/generator/internal/discovery_type_vertex.cc @@ -14,15 +14,15 @@ #include "generator/internal/discovery_type_vertex.h" #include "generator/internal/codegen_utils.h" -#include "google/cloud/internal/absl_str_join_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/internal/algorithm.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/log.h" #include "absl/strings/str_format.h" +#include "absl/strings/str_join.h" +#include "absl/strings/str_replace.h" #include "absl/strings/str_split.h" #include "absl/types/optional.h" -#include +#include "google/protobuf/descriptor.pb.h" #include #include diff --git a/generator/internal/doxygen.cc b/generator/internal/doxygen.cc index 777c5d35088eb..4066e429b85e3 100644 --- a/generator/internal/doxygen.cc +++ b/generator/internal/doxygen.cc @@ -14,7 +14,7 @@ #include "generator/internal/doxygen.h" #include "generator/internal/codegen_utils.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/generator/internal/format_class_comments.cc b/generator/internal/format_class_comments.cc index 5ad6e1659e535..b6f82500c1328 100644 --- a/generator/internal/format_class_comments.cc +++ b/generator/internal/format_class_comments.cc @@ -14,9 +14,9 @@ #include "generator/internal/format_class_comments.h" #include "generator/internal/resolve_comment_references.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/log.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_replace.h" #include "absl/strings/strip.h" #include diff --git a/generator/internal/format_method_comments.cc b/generator/internal/format_method_comments.cc index 3e3be6647b204..b94c00e60ea78 100644 --- a/generator/internal/format_method_comments.cc +++ b/generator/internal/format_method_comments.cc @@ -20,11 +20,11 @@ #include "generator/internal/predicate_utils.h" #include "generator/internal/resolve_comment_references.h" #include "generator/internal/resolve_method_return.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/log.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_replace.h" #include "absl/strings/string_view.h" -#include +#include "google/longrunning/operations.pb.h" #include #include #include @@ -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/internal/forwarding_client_generator.cc b/generator/internal/forwarding_client_generator.cc deleted file mode 100644 index 73bfff5530528..0000000000000 --- a/generator/internal/forwarding_client_generator.cc +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 "generator/internal/forwarding_client_generator.h" - -namespace google { -namespace cloud { -namespace generator_internal { - -ForwardingClientGenerator::ForwardingClientGenerator( - google::protobuf::ServiceDescriptor const* service_descriptor, - VarsDictionary service_vars, - std::map service_method_vars, - google::protobuf::compiler::GeneratorContext* context, - std::vector const& mixin_methods) - : ServiceCodeGenerator("forwarding_client_header_path", service_descriptor, - std::move(service_vars), - std::move(service_method_vars), context, - mixin_methods) {} - -Status ForwardingClientGenerator::GenerateHeader() { - HeaderPrint(CopyrightLicenseFileHeader()); - HeaderPrint(R"""( -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: $proto_file_name$ - -#ifndef $header_include_guard$ -#define $header_include_guard$ - -)"""); - - // includes - HeaderLocalIncludes({ - vars("forwarding_connection_header_path"), - vars("client_header_path"), - }); - - auto result = HeaderOpenForwardingNamespaces(NamespaceType::kNormal, R"""( -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in $product_namespace$ instead of the aliases defined in -/// this namespace.)"""); - if (!result.ok()) return result; - - // forwards - HeaderPrint( - R"""( -/// @deprecated Use $product_namespace$::$client_class_name$ directly. -using ::google::cloud::$product_namespace$::$client_class_name$; -)"""); - - HeaderCloseNamespaces(); - // close header guard - HeaderPrint(R"""( -#endif // $header_include_guard$ -)"""); - return {}; -} - -} // namespace generator_internal -} // namespace cloud -} // namespace google diff --git a/generator/internal/forwarding_client_generator.h b/generator/internal/forwarding_client_generator.h deleted file mode 100644 index 6a348197eda17..0000000000000 --- a/generator/internal/forwarding_client_generator.h +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_GENERATOR_INTERNAL_FORWARDING_CLIENT_GENERATOR_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_FORWARDING_CLIENT_GENERATOR_H - -#include "generator/internal/service_code_generator.h" -#include "google/cloud/status.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace generator_internal { - -/** - * Generates the forwarding header file for a Client class for a particular - * service. - */ -class ForwardingClientGenerator : public ServiceCodeGenerator { - public: - ForwardingClientGenerator( - google::protobuf::ServiceDescriptor const* service_descriptor, - VarsDictionary service_vars, - std::map service_method_vars, - google::protobuf::compiler::GeneratorContext* context, - std::vector const& mixin_methods); - - ~ForwardingClientGenerator() override = default; - - ForwardingClientGenerator(ForwardingClientGenerator const&) = delete; - ForwardingClientGenerator& operator=(ForwardingClientGenerator const&) = - delete; - ForwardingClientGenerator(ForwardingClientGenerator&&) = default; - ForwardingClientGenerator& operator=(ForwardingClientGenerator&&) = default; - - private: - Status GenerateHeader() override; - Status GenerateCc() override { return Status(); } -}; - -} // namespace generator_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_FORWARDING_CLIENT_GENERATOR_H diff --git a/generator/internal/forwarding_connection_generator.cc b/generator/internal/forwarding_connection_generator.cc deleted file mode 100644 index 8447ed3dbf0d7..0000000000000 --- a/generator/internal/forwarding_connection_generator.cc +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 "generator/internal/forwarding_connection_generator.h" - -namespace google { -namespace cloud { -namespace generator_internal { - -ForwardingConnectionGenerator::ForwardingConnectionGenerator( - google::protobuf::ServiceDescriptor const* service_descriptor, - VarsDictionary service_vars, - std::map service_method_vars, - google::protobuf::compiler::GeneratorContext* context, - std::vector const& mixin_methods) - : ServiceCodeGenerator("forwarding_connection_header_path", - service_descriptor, std::move(service_vars), - std::move(service_method_vars), context, - mixin_methods) {} - -Status ForwardingConnectionGenerator::GenerateHeader() { - HeaderPrint(CopyrightLicenseFileHeader()); - HeaderPrint(R"""( -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: $proto_file_name$ - -#ifndef $header_include_guard$ -#define $header_include_guard$ - -)"""); - - // includes - HeaderLocalIncludes({ - vars("forwarding_idempotency_policy_header_path"), - vars("connection_header_path"), - }); - - auto result = HeaderOpenForwardingNamespaces(); - if (!result.ok()) return result; - - HeaderPrint( - R"""( -/// @deprecated Use $product_namespace$::Make$connection_class_name$ directly. -using ::google::cloud::$product_namespace$::Make$connection_class_name$; - -/// @deprecated Use $product_namespace$::$connection_class_name$ directly. -using ::google::cloud::$product_namespace$::$connection_class_name$; - -/// @deprecated Use $product_namespace$::$limited_error_count_retry_policy_name$ directly. -using ::google::cloud::$product_namespace$::$limited_error_count_retry_policy_name$; - -/// @deprecated Use $product_namespace$::$limited_time_retry_policy_name$ directly. -using ::google::cloud::$product_namespace$::$limited_time_retry_policy_name$; - -/// @deprecated Use $product_namespace$::$retry_policy_name$ directly. -using ::google::cloud::$product_namespace$::$retry_policy_name$; -)"""); - - // TODO(#8234): This is a special case for backwards compatibility of the - // streaming update function. - if (vars().at("service_name") == "BigQueryRead") { - // streaming updater functions - for (auto const& method : methods()) { - HeaderPrintMethod( - method, - {MethodPattern( - {// clang-format off - {"\n" - "GOOGLE_CLOUD_CPP_DEPRECATED(\n" - " \"applications should not need this.\"\n" - " \" Please file a bug at https://github.com/googleapis/google-cloud-cpp\"\n" - " \" if you do.\")" - "void $service_name$$method_name$StreamingUpdater(\n" - " $response_type$ const& response,\n" - " $request_type$& request);\n"} - }, IsStreamingRead)}, - // clang-format on - __FILE__, __LINE__); - } - } - - HeaderCloseNamespaces(); - // close header guard - HeaderPrint(R"""( -#endif // $header_include_guard$ -)"""); - return {}; -} - -} // namespace generator_internal -} // namespace cloud -} // namespace google diff --git a/generator/internal/forwarding_connection_generator.h b/generator/internal/forwarding_connection_generator.h deleted file mode 100644 index 35a82254f4990..0000000000000 --- a/generator/internal/forwarding_connection_generator.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_GENERATOR_INTERNAL_FORWARDING_CONNECTION_GENERATOR_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_FORWARDING_CONNECTION_GENERATOR_H - -#include "generator/internal/service_code_generator.h" -#include "google/cloud/status.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace generator_internal { - -/** - * Generates the forwarding header file for a Connection class for a particular - * service. - */ -class ForwardingConnectionGenerator : public ServiceCodeGenerator { - public: - ForwardingConnectionGenerator( - google::protobuf::ServiceDescriptor const* service_descriptor, - VarsDictionary service_vars, - std::map service_method_vars, - google::protobuf::compiler::GeneratorContext* context, - std::vector const& mixin_methods); - - ~ForwardingConnectionGenerator() override = default; - - ForwardingConnectionGenerator(ForwardingConnectionGenerator const&) = delete; - ForwardingConnectionGenerator& operator=( - ForwardingConnectionGenerator const&) = delete; - ForwardingConnectionGenerator(ForwardingConnectionGenerator&&) = default; - ForwardingConnectionGenerator& operator=(ForwardingConnectionGenerator&&) = - default; - - private: - Status GenerateHeader() override; - Status GenerateCc() override { return Status(); } -}; - -} // namespace generator_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_FORWARDING_CONNECTION_GENERATOR_H diff --git a/generator/internal/forwarding_idempotency_policy_generator.cc b/generator/internal/forwarding_idempotency_policy_generator.cc deleted file mode 100644 index 3fbab6c018141..0000000000000 --- a/generator/internal/forwarding_idempotency_policy_generator.cc +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 "generator/internal/forwarding_idempotency_policy_generator.h" - -namespace google { -namespace cloud { -namespace generator_internal { - -ForwardingIdempotencyPolicyGenerator::ForwardingIdempotencyPolicyGenerator( - google::protobuf::ServiceDescriptor const* service_descriptor, - VarsDictionary service_vars, - std::map service_method_vars, - google::protobuf::compiler::GeneratorContext* context, - std::vector const& mixin_methods) - : ServiceCodeGenerator("forwarding_idempotency_policy_header_path", - service_descriptor, std::move(service_vars), - std::move(service_method_vars), context, - mixin_methods) {} - -Status ForwardingIdempotencyPolicyGenerator::GenerateHeader() { - HeaderPrint(CopyrightLicenseFileHeader()); - HeaderPrint(R"""( -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: $proto_file_name$ - -#ifndef $header_include_guard$ -#define $header_include_guard$ - -)"""); - - // includes - HeaderLocalIncludes({ - vars("idempotency_policy_header_path"), - }); - - auto result = HeaderOpenForwardingNamespaces(); - if (!result.ok()) return result; - - // forwards - HeaderPrint( - R"""( -/// @deprecated Use $product_namespace$::MakeDefault$idempotency_class_name$ directly. -using ::google::cloud::$product_namespace$::MakeDefault$idempotency_class_name$; - -/// @deprecated Use $product_namespace$::$idempotency_class_name$ directly. -using ::google::cloud::$product_namespace$::$idempotency_class_name$; -)"""); - - HeaderCloseNamespaces(); - // close header guard - HeaderPrint(R"""( -#endif // $header_include_guard$ -)"""); - return {}; -} - -} // namespace generator_internal -} // namespace cloud -} // namespace google diff --git a/generator/internal/forwarding_idempotency_policy_generator.h b/generator/internal/forwarding_idempotency_policy_generator.h deleted file mode 100644 index 6411d109ae8eb..0000000000000 --- a/generator/internal/forwarding_idempotency_policy_generator.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_GENERATOR_INTERNAL_FORWARDING_IDEMPOTENCY_POLICY_GENERATOR_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_FORWARDING_IDEMPOTENCY_POLICY_GENERATOR_H - -#include "generator/internal/service_code_generator.h" -#include "google/cloud/status.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace generator_internal { - -/** - * Generates the forwarding header file for a IdempotencyPolicy class for a - * particular service. - */ -class ForwardingIdempotencyPolicyGenerator : public ServiceCodeGenerator { - public: - ForwardingIdempotencyPolicyGenerator( - google::protobuf::ServiceDescriptor const* service_descriptor, - VarsDictionary service_vars, - std::map service_method_vars, - google::protobuf::compiler::GeneratorContext* context, - std::vector const& mixin_methods); - - ~ForwardingIdempotencyPolicyGenerator() override = default; - - ForwardingIdempotencyPolicyGenerator( - ForwardingIdempotencyPolicyGenerator const&) = delete; - ForwardingIdempotencyPolicyGenerator& operator=( - ForwardingIdempotencyPolicyGenerator const&) = delete; - ForwardingIdempotencyPolicyGenerator(ForwardingIdempotencyPolicyGenerator&&) = - default; - ForwardingIdempotencyPolicyGenerator& operator=( - ForwardingIdempotencyPolicyGenerator&&) = default; - - private: - Status GenerateHeader() override; - Status GenerateCc() override { return Status(); } -}; - -} // namespace generator_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_FORWARDING_IDEMPOTENCY_POLICY_GENERATOR_H diff --git a/generator/internal/forwarding_mock_connection_generator.cc b/generator/internal/forwarding_mock_connection_generator.cc deleted file mode 100644 index 4b8cce6971407..0000000000000 --- a/generator/internal/forwarding_mock_connection_generator.cc +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 "generator/internal/forwarding_mock_connection_generator.h" - -namespace google { -namespace cloud { -namespace generator_internal { - -ForwardingMockConnectionGenerator::ForwardingMockConnectionGenerator( - google::protobuf::ServiceDescriptor const* service_descriptor, - VarsDictionary service_vars, - std::map service_method_vars, - google::protobuf::compiler::GeneratorContext* context, - std::vector const& mixin_methods) - : ServiceCodeGenerator("forwarding_mock_connection_header_path", - service_descriptor, std::move(service_vars), - std::move(service_method_vars), context, - mixin_methods) {} - -Status ForwardingMockConnectionGenerator::GenerateHeader() { - HeaderPrint(CopyrightLicenseFileHeader()); - HeaderPrint(R"""( -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: $proto_file_name$ - -#ifndef $header_include_guard$ -#define $header_include_guard$ - -)"""); - - // includes - HeaderLocalIncludes({ - vars("mock_connection_header_path"), - vars("forwarding_connection_header_path"), - }); - - auto result = HeaderOpenForwardingNamespaces(NamespaceType::kMocks, R"""( -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in $product_namespace$_mocks instead of the aliases -/// defined in this namespace.)"""); - if (!result.ok()) return result; - - HeaderPrint( - R"""( -/// @deprecated Use $product_namespace$_mocks::$mock_connection_class_name$ directly. -using ::google::cloud::$product_namespace$_mocks::$mock_connection_class_name$; -)"""); - - HeaderCloseNamespaces(); - // close header guard - HeaderPrint(R"""( -#endif // $header_include_guard$ -)"""); - return {}; -} - -} // namespace generator_internal -} // namespace cloud -} // namespace google diff --git a/generator/internal/forwarding_mock_connection_generator.h b/generator/internal/forwarding_mock_connection_generator.h deleted file mode 100644 index 04b01445c3329..0000000000000 --- a/generator/internal/forwarding_mock_connection_generator.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_GENERATOR_INTERNAL_FORWARDING_MOCK_CONNECTION_GENERATOR_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_FORWARDING_MOCK_CONNECTION_GENERATOR_H - -#include "generator/internal/service_code_generator.h" -#include "google/cloud/status.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace generator_internal { - -/** - * Generates the forwarding header file for a MockConnection class for a - * particular service. - */ -class ForwardingMockConnectionGenerator : public ServiceCodeGenerator { - public: - ForwardingMockConnectionGenerator( - google::protobuf::ServiceDescriptor const* service_descriptor, - VarsDictionary service_vars, - std::map service_method_vars, - google::protobuf::compiler::GeneratorContext* context, - std::vector const& mixin_methods); - - ~ForwardingMockConnectionGenerator() override = default; - - ForwardingMockConnectionGenerator(ForwardingMockConnectionGenerator const&) = - delete; - ForwardingMockConnectionGenerator& operator=( - ForwardingMockConnectionGenerator const&) = delete; - ForwardingMockConnectionGenerator(ForwardingMockConnectionGenerator&&) = - default; - ForwardingMockConnectionGenerator& operator=( - ForwardingMockConnectionGenerator&&) = default; - - private: - Status GenerateHeader() override; - Status GenerateCc() override { return Status(); } -}; - -} // namespace generator_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_FORWARDING_MOCK_CONNECTION_GENERATOR_H diff --git a/generator/internal/forwarding_options_generator.cc b/generator/internal/forwarding_options_generator.cc deleted file mode 100644 index d79882fad809e..0000000000000 --- a/generator/internal/forwarding_options_generator.cc +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 "generator/internal/forwarding_options_generator.h" - -namespace google { -namespace cloud { -namespace generator_internal { - -ForwardingOptionsGenerator::ForwardingOptionsGenerator( - google::protobuf::ServiceDescriptor const* service_descriptor, - VarsDictionary service_vars, - std::map service_method_vars, - google::protobuf::compiler::GeneratorContext* context, - std::vector const& mixin_methods) - : ServiceCodeGenerator("forwarding_options_header_path", service_descriptor, - std::move(service_vars), - std::move(service_method_vars), context, - mixin_methods) {} - -Status ForwardingOptionsGenerator::GenerateHeader() { - HeaderPrint(CopyrightLicenseFileHeader()); - HeaderPrint(R"""( -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: $proto_file_name$ - -#ifndef $header_include_guard$ -#define $header_include_guard$ - -)"""); - - // includes - HeaderLocalIncludes({ - vars("forwarding_connection_header_path"), - vars("forwarding_idempotency_policy_header_path"), - vars("options_header_path"), - }); - - auto result = HeaderOpenForwardingNamespaces(); - if (!result.ok()) return result; - - // forwards - if (HasLongrunningMethod()) { - HeaderPrint(R"""( -/// @deprecated Use $product_namespace$::$service_name$PollingPolicyOption directly. -using ::google::cloud::$product_namespace$::$service_name$PollingPolicyOption; -)"""); - } - HeaderPrint(R"""( -/// @deprecated Use $product_namespace$::$service_name$BackoffPolicyOption directly. -using ::google::cloud::$product_namespace$::$service_name$BackoffPolicyOption; - -/// @deprecated Use $product_namespace$::$service_name$ConnectionIdempotencyPolicyOption directly. -using ::google::cloud::$product_namespace$::$service_name$ConnectionIdempotencyPolicyOption; - -/// @deprecated Use $product_namespace$::$service_name$PolicyOptionList directly. -using ::google::cloud::$product_namespace$::$service_name$PolicyOptionList; - -/// @deprecated Use $product_namespace$::$service_name$RetryPolicyOption directly. -using ::google::cloud::$product_namespace$::$service_name$RetryPolicyOption; -)"""); - - HeaderCloseNamespaces(); - // close header guard - HeaderPrint(R"""( -#endif // $header_include_guard$ -)"""); - return {}; -} - -} // namespace generator_internal -} // namespace cloud -} // namespace google diff --git a/generator/internal/forwarding_options_generator.h b/generator/internal/forwarding_options_generator.h deleted file mode 100644 index c2250296c9997..0000000000000 --- a/generator/internal/forwarding_options_generator.h +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_GENERATOR_INTERNAL_FORWARDING_OPTIONS_GENERATOR_H -#define GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_FORWARDING_OPTIONS_GENERATOR_H - -#include "generator/internal/service_code_generator.h" -#include "google/cloud/status.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace generator_internal { - -/** - * Generates the forwarding header file for a Options class for a particular - * service. - */ -class ForwardingOptionsGenerator : public ServiceCodeGenerator { - public: - ForwardingOptionsGenerator( - google::protobuf::ServiceDescriptor const* service_descriptor, - VarsDictionary service_vars, - std::map service_method_vars, - google::protobuf::compiler::GeneratorContext* context, - std::vector const& mixin_methods); - - ~ForwardingOptionsGenerator() override = default; - - ForwardingOptionsGenerator(ForwardingOptionsGenerator const&) = delete; - ForwardingOptionsGenerator& operator=(ForwardingOptionsGenerator const&) = - delete; - ForwardingOptionsGenerator(ForwardingOptionsGenerator&&) = default; - ForwardingOptionsGenerator& operator=(ForwardingOptionsGenerator&&) = default; - - private: - Status GenerateHeader() override; - Status GenerateCc() override { return Status(); } -}; - -} // namespace generator_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_FORWARDING_OPTIONS_GENERATOR_H diff --git a/generator/internal/http_annotation_parser.cc b/generator/internal/http_annotation_parser.cc index 2998499e9eae7..03096241d581a 100644 --- a/generator/internal/http_annotation_parser.cc +++ b/generator/internal/http_annotation_parser.cc @@ -13,10 +13,10 @@ // limitations under the License. #include "generator/internal/http_annotation_parser.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/log.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include #include diff --git a/generator/internal/http_option_utils.cc b/generator/internal/http_option_utils.cc index 6d085c145a9b2..4ed9baa5120fb 100644 --- a/generator/internal/http_option_utils.cc +++ b/generator/internal/http_option_utils.cc @@ -17,16 +17,16 @@ #include "generator/internal/longrunning.h" #include "generator/internal/mixin_utils.h" #include "generator/internal/printer.h" -#include "google/cloud/internal/absl_str_join_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/internal/algorithm.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/log.h" #include "absl/strings/str_format.h" +#include "absl/strings/str_join.h" +#include "absl/strings/str_replace.h" #include "absl/strings/str_split.h" #include "absl/types/optional.h" -#include +#include "google/api/annotations.pb.h" #include #include #include diff --git a/generator/internal/http_option_utils.h b/generator/internal/http_option_utils.h index 67c94bceee67b..d337c53079b8c 100644 --- a/generator/internal/http_option_utils.h +++ b/generator/internal/http_option_utils.h @@ -19,7 +19,7 @@ #include "generator/internal/mixin_utils.h" #include "generator/internal/printer.h" #include "absl/types/optional.h" -#include +#include "google/api/http.pb.h" #include #include diff --git a/generator/internal/http_option_utils_test.cc b/generator/internal/http_option_utils_test.cc index 5769678f72c53..7a830e060dd9d 100644 --- a/generator/internal/http_option_utils_test.cc +++ b/generator/internal/http_option_utils_test.cc @@ -15,8 +15,8 @@ #include "generator/internal/http_option_utils.h" #include "generator/testing/error_collectors.h" #include "generator/testing/fake_source_tree.h" -#include -#include +#include "google/api/annotations.pb.h" +#include "google/protobuf/descriptor.pb.h" #include #include #include diff --git a/generator/internal/idempotency_policy_generator.cc b/generator/internal/idempotency_policy_generator.cc index 372856850377d..6cd7917ff74de 100644 --- a/generator/internal/idempotency_policy_generator.cc +++ b/generator/internal/idempotency_policy_generator.cc @@ -19,7 +19,7 @@ #include "generator/internal/predicate_utils.h" #include "generator/internal/printer.h" #include "generator/internal/request_id.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" #include namespace google { diff --git a/generator/internal/logging_decorator_generator.cc b/generator/internal/logging_decorator_generator.cc index a2329677ca06c..c572f862d8fd2 100644 --- a/generator/internal/logging_decorator_generator.cc +++ b/generator/internal/logging_decorator_generator.cc @@ -18,7 +18,7 @@ #include "generator/internal/longrunning.h" #include "generator/internal/predicate_utils.h" #include "generator/internal/printer.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_split.h" #include @@ -63,7 +63,7 @@ Status LoggingDecoratorGenerator::GenerateHeader() { ? "google/longrunning/operations.grpc.pb.h" : ""}); HeaderSystemIncludes({"memory", "set", "string"}); - + HeaderGrpcPortsDefInclude(); auto result = HeaderOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; @@ -92,6 +92,7 @@ Status LoggingDecoratorGenerator::GenerateHeader() { HeaderPrint("}; // $logging_class_name$\n"); HeaderCloseNamespaces(); + HeaderGrpcPortsUndefInclude(); HeaderPrint("\n#endif // $header_include_guard$\n"); return {}; } @@ -127,7 +128,7 @@ Status LoggingDecoratorGenerator::GenerateCc() { "google/cloud/status_or.h"}); CcProtobufGenCodeIncludes({vars("proto_grpc_header_path")}); CcSystemIncludes({"memory", "set", "string", "utility"}); - + CcGrpcPortsDefInclude(); auto result = CcOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; @@ -408,6 +409,7 @@ future $logging_class_name$::AsyncCancelOperation( } CcCloseNamespaces(); + CcGrpcPortsUndefInclude(); return {}; } diff --git a/generator/internal/longrunning.cc b/generator/internal/longrunning.cc index 60fc92129d267..255f3031db438 100644 --- a/generator/internal/longrunning.cc +++ b/generator/internal/longrunning.cc @@ -16,11 +16,11 @@ #include "generator/internal/codegen_utils.h" #include "generator/internal/doxygen.h" #include "generator/internal/http_option_utils.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "google/cloud/extended_operations.pb.h" #include "google/cloud/log.h" +#include "absl/strings/str_cat.h" #include "absl/types/variant.h" -#include -#include +#include "google/longrunning/operations.pb.h" #include using ::google::protobuf::Descriptor; diff --git a/generator/internal/longrunning_test.cc b/generator/internal/longrunning_test.cc index f8dfa62086da3..cf9528b1bdf36 100644 --- a/generator/internal/longrunning_test.cc +++ b/generator/internal/longrunning_test.cc @@ -15,8 +15,8 @@ #include "generator/internal/longrunning.h" #include "generator/testing/error_collectors.h" #include "generator/testing/fake_source_tree.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include +#include "absl/strings/str_cat.h" +#include "google/protobuf/descriptor.pb.h" #include #include diff --git a/generator/internal/make_generators.cc b/generator/internal/make_generators.cc index 672bc474d26bb..6106010436cd3 100644 --- a/generator/internal/make_generators.cc +++ b/generator/internal/make_generators.cc @@ -20,11 +20,6 @@ #include "generator/internal/connection_impl_rest_generator.h" #include "generator/internal/connection_rest_generator.h" #include "generator/internal/descriptor_utils.h" -#include "generator/internal/forwarding_client_generator.h" -#include "generator/internal/forwarding_connection_generator.h" -#include "generator/internal/forwarding_idempotency_policy_generator.h" -#include "generator/internal/forwarding_mock_connection_generator.h" -#include "generator/internal/forwarding_options_generator.h" #include "generator/internal/idempotency_policy_generator.h" #include "generator/internal/logging_decorator_generator.h" #include "generator/internal/logging_decorator_rest_generator.h" @@ -111,22 +106,6 @@ std::vector> MakeGenerators( code_generators.push_back(std::make_unique( service, service_vars, method_vars, context, mixin_methods)); } - auto const forwarding_headers = service_vars.find("forwarding_product_path"); - if (forwarding_headers != service_vars.end() && - !forwarding_headers->second.empty()) { - code_generators.push_back(std::make_unique( - service, service_vars, method_vars, context, mixin_methods)); - code_generators.push_back(std::make_unique( - service, service_vars, method_vars, context, mixin_methods)); - code_generators.push_back( - std::make_unique( - service, service_vars, method_vars, context, mixin_methods)); - code_generators.push_back( - std::make_unique( - service, service_vars, method_vars, context, mixin_methods)); - code_generators.push_back(std::make_unique( - service, service_vars, method_vars, context, mixin_methods)); - } if (generate_grpc_transport) { code_generators.push_back(std::make_unique( @@ -148,10 +127,7 @@ std::vector> MakeGenerators( } if (generate_rest_transport) { - // All REST interfaces postdate the change to the format of our inline - // namespace name, so we never need to add a backwards-compatibility alias. auto rest_service_vars = service_vars; - rest_service_vars.erase("backwards_compatibility_namespace_alias"); code_generators.push_back(std::make_unique( service, rest_service_vars, method_vars, context, mixin_methods)); code_generators.push_back(std::make_unique( diff --git a/generator/internal/make_generators_test.cc b/generator/internal/make_generators_test.cc index 8ffd8cf80b0cc..9d750054976cd 100644 --- a/generator/internal/make_generators_test.cc +++ b/generator/internal/make_generators_test.cc @@ -17,9 +17,9 @@ #include "generator/testing/error_collectors.h" #include "generator/testing/fake_source_tree.h" #include "generator/testing/printer_mocks.h" +#include "google/protobuf/descriptor.pb.h" #include #include -#include #include namespace google { diff --git a/generator/internal/metadata_decorator_generator.cc b/generator/internal/metadata_decorator_generator.cc index 4501ac0558eb6..9af1a2ab16cc0 100644 --- a/generator/internal/metadata_decorator_generator.cc +++ b/generator/internal/metadata_decorator_generator.cc @@ -19,8 +19,8 @@ #include "generator/internal/predicate_utils.h" #include "generator/internal/printer.h" #include "generator/internal/routing.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/url_encode.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" #include @@ -133,7 +133,7 @@ Status MetadataDecoratorGenerator::GenerateHeader() { ? "google/longrunning/operations.grpc.pb.h" : ""}); HeaderSystemIncludes({"map", "memory", "string"}); - + HeaderGrpcPortsDefInclude(); auto result = HeaderOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; @@ -164,6 +164,7 @@ class $metadata_class_name$ : public $stub_class_name$ { )"""); HeaderCloseNamespaces(); + HeaderGrpcPortsUndefInclude(); // close header guard HeaderPrint("\n#endif // $header_include_guard$\n"); return {}; @@ -181,19 +182,15 @@ Status MetadataDecoratorGenerator::GenerateCc() { // includes CcPrint("\n"); CcLocalIncludes( - {vars("metadata_header_path"), - "google/cloud/internal/absl_str_cat_quiet.h", - HasExplicitRoutingMethod() - ? "google/cloud/internal/absl_str_join_quiet.h" - : "", - "google/cloud/internal/api_client_header.h", + {vars("metadata_header_path"), "absl/strings/str_cat.h", + "absl/strings/str_join.h", "google/cloud/internal/api_client_header.h", "google/cloud/grpc_options.h", HasExplicitRoutingMethod() ? "google/cloud/internal/routing_matcher.h" : "", "google/cloud/status_or.h", "google/cloud/internal/url_encode.h"}); CcProtobufGenCodeIncludes({vars("proto_grpc_header_path")}); CcSystemIncludes({"memory", "string", "utility", "vector"}); - + CcGrpcPortsDefInclude(); auto result = CcOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; @@ -421,6 +418,7 @@ void $metadata_class_name$::SetMetadata(grpc::ClientContext& context, )"""); CcCloseNamespaces(); + CcGrpcPortsUndefInclude(); return {}; } diff --git a/generator/internal/metadata_decorator_rest_generator.cc b/generator/internal/metadata_decorator_rest_generator.cc index 27d9dee5b9030..6204aff2cc578 100644 --- a/generator/internal/metadata_decorator_rest_generator.cc +++ b/generator/internal/metadata_decorator_rest_generator.cc @@ -19,8 +19,8 @@ #include "generator/internal/predicate_utils.h" #include "generator/internal/printer.h" #include "generator/internal/routing.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/url_encode.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_split.h" #include #include @@ -219,14 +219,14 @@ Status MetadataDecoratorRestGenerator::GenerateCc() { // includes CcPrint("\n"); - CcLocalIncludes( - {vars("metadata_rest_header_path"), - "google/cloud/internal/api_client_header.h", - HasExplicitRoutingMethod() ? "google/cloud/internal/routing_matcher.h" - : "", - "google/cloud/status_or.h", "google/cloud/internal/absl_str_cat_quiet.h", - "google/cloud/internal/rest_set_metadata.h", - "absl/strings/str_format.h"}); + CcLocalIncludes({vars("metadata_rest_header_path"), + "google/cloud/internal/api_client_header.h", + HasExplicitRoutingMethod() + ? "google/cloud/internal/routing_matcher.h" + : "", + "google/cloud/status_or.h", "absl/strings/str_cat.h", + "google/cloud/internal/rest_set_metadata.h", + "absl/strings/str_format.h"}); CcSystemIncludes({"memory", "utility"}); auto result = CcOpenNamespaces(NamespaceType::kInternal); diff --git a/generator/internal/mixin_utils.cc b/generator/internal/mixin_utils.cc index c24a6f943f9bf..ed92825885a45 100644 --- a/generator/internal/mixin_utils.cc +++ b/generator/internal/mixin_utils.cc @@ -14,10 +14,10 @@ #include "generator/internal/mixin_utils.h" #include "generator/internal/codegen_utils.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/log.h" #include "absl/base/no_destructor.h" #include "absl/strings/ascii.h" +#include "absl/strings/str_join.h" #include "absl/types/optional.h" #include #include @@ -140,27 +140,28 @@ std::unordered_set GetMethodNames( } // namespace -std::vector GetMixinProtoPaths(YAML::Node const& service_config) { - std::vector proto_paths; - if (service_config.Type() != YAML::NodeType::Map) return proto_paths; +std::vector GetMixinServiceProto( + YAML::Node const& service_config) { + std::vector mixin_services; + if (service_config.Type() != YAML::NodeType::Map) return mixin_services; auto const& apis = service_config["apis"]; - if (apis.Type() != YAML::NodeType::Sequence) return proto_paths; + if (apis.Type() != YAML::NodeType::Sequence) return mixin_services; for (auto const& api : apis) { if (api.Type() != YAML::NodeType::Map) continue; auto const& name = api["name"]; if (name.Type() != YAML::NodeType::Scalar) continue; - auto const package_path = name.as(); + auto const service = name.as(); auto const& mixin_proto_path_map = GetMixinProtoPathMap(); - auto const it = mixin_proto_path_map.find(package_path); + auto const it = mixin_proto_path_map.find(service); if (it == mixin_proto_path_map.end()) continue; - proto_paths.push_back(it->second); + mixin_services.push_back({it->first, it->second}); } - return proto_paths; + return mixin_services; } -std::vector GetMixinProtoPaths( +std::vector GetMixinServiceProto( std::string const& service_yaml_path) { - return GetMixinProtoPaths(YAML::LoadFile(service_yaml_path)); + return GetMixinServiceProto(YAML::LoadFile(service_yaml_path)); } std::vector GetMixinMethods(YAML::Node const& service_config, @@ -173,15 +174,16 @@ std::vector GetMixinMethods(YAML::Node const& service_config, << service.full_name(); } std::unordered_set const method_names = GetMethodNames(service); - auto const mixin_proto_paths = GetMixinProtoPaths(service_config); + auto const mixin_proto_paths = GetMixinServiceProto(service_config); auto const mixin_http_overrides = GetMixinHttpOverrides(service_config); for (auto const& mixin_proto_path : mixin_proto_paths) { - FileDescriptor const* mixin_file = pool->FindFileByName(mixin_proto_path); + FileDescriptor const* mixin_file = + pool->FindFileByName(mixin_proto_path.proto_file_path); if (mixin_file == nullptr) { GCP_LOG(FATAL) << __FILE__ << ":" << __LINE__ << " Mixin FileDescriptor is not found for path: " - << mixin_proto_path + << mixin_proto_path.proto_file_path << " in service: " << service.full_name(); } for (int i = 0; i < mixin_file->service_count(); ++i) { diff --git a/generator/internal/mixin_utils.h b/generator/internal/mixin_utils.h index 2e91cf3418b71..57967a7bb9f7f 100644 --- a/generator/internal/mixin_utils.h +++ b/generator/internal/mixin_utils.h @@ -16,7 +16,7 @@ #define GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_MIXIN_UTILS_H #include "absl/types/optional.h" -#include +#include "google/api/http.pb.h" #include #include #include @@ -38,16 +38,30 @@ struct MixinMethod { google::api::HttpRule http_override; }; +struct MixinService { + std::string service_full_name; + std::string proto_file_path; +}; + +inline bool operator==(MixinService const& lhs, MixinService const& rhs) { + return lhs.service_full_name == rhs.service_full_name && + lhs.proto_file_path == rhs.proto_file_path; +} +inline bool operator!=(MixinService const& lhs, MixinService const& rhs) { + return !(lhs == rhs); +} + /** * Extract Mixin proto file paths from the YAML Node. */ -std::vector GetMixinProtoPaths(YAML::Node const& service_config); +std::vector GetMixinServiceProto( + YAML::Node const& service_config); /** * Extract Mixin proto file paths from the YAML Node loaded from a YAML file * path. */ -std::vector GetMixinProtoPaths( +std::vector GetMixinServiceProto( std::string const& service_yaml_path); /** diff --git a/generator/internal/mixin_utils_test.cc b/generator/internal/mixin_utils_test.cc index 568156f6833c2..e517e4098c91a 100644 --- a/generator/internal/mixin_utils_test.cc +++ b/generator/internal/mixin_utils_test.cc @@ -15,7 +15,7 @@ #include "generator/internal/mixin_utils.h" #include "generator/testing/descriptor_pool_fixture.h" #include "google/cloud/testing_util/is_proto_equal.h" -#include +#include "google/api/annotations.pb.h" #include #include @@ -207,11 +207,16 @@ TEST_F(MixinUtilsTest, FilesParseSuccessfully) { } TEST_F(MixinUtilsTest, ExtractMixinProtoPathsFromYaml) { - auto const mixin_proto_paths = GetMixinProtoPaths(service_config_); - EXPECT_THAT(mixin_proto_paths, - AllOf(Contains("google/cloud/location/locations.proto"), - Contains("google/iam/v1/iam_policy.proto"), - Contains("google/longrunning/operations.proto"))); + std::vector const mixin_proto_paths = + GetMixinServiceProto(service_config_); + EXPECT_THAT( + mixin_proto_paths, + AllOf(Contains(MixinService{"google.cloud.location.Locations", + "google/cloud/location/locations.proto"}), + Contains(MixinService{"google.iam.v1.IAMPolicy", + "google/iam/v1/iam_policy.proto"}), + Contains(MixinService{"google.longrunning.Operations", + "google/longrunning/operations.proto"}))); } TEST_F(MixinUtilsTest, GetMixinMethods) { diff --git a/generator/internal/option_defaults_generator.cc b/generator/internal/option_defaults_generator.cc index 19d4f59c52b5f..00bc3d07c7b72 100644 --- a/generator/internal/option_defaults_generator.cc +++ b/generator/internal/option_defaults_generator.cc @@ -100,7 +100,7 @@ Status OptionDefaultsGenerator::GenerateCc() { case ServiceConfiguration::LOCATION_DEPENDENT: case ServiceConfiguration::LOCATION_DEPENDENT_COMPAT: case ServiceConfiguration::LOCATION_OPTIONALLY_DEPENDENT: - CcLocalIncludes({"google/cloud/internal/absl_str_cat_quiet.h"}); + CcLocalIncludes({"absl/strings/str_cat.h"}); break; default: break; @@ -159,7 +159,7 @@ auto constexpr kBackoffScaling = 2.0; if (!options.has<$product_namespace$::$retry_policy_name$Option>()) { options.set<$product_namespace$::$retry_policy_name$Option>( $product_namespace$::$limited_time_retry_policy_name$( - std::chrono::minutes(30)).clone()); + std::chrono::minutes(10)).clone()); } if (!options.has<$product_namespace$::$service_name$BackoffPolicyOption>()) { options.set<$product_namespace$::$service_name$BackoffPolicyOption>( diff --git a/generator/internal/pagination.cc b/generator/internal/pagination.cc index 7c1d1812ba4b9..c77122cd085e0 100644 --- a/generator/internal/pagination.cc +++ b/generator/internal/pagination.cc @@ -16,9 +16,9 @@ #include "generator/internal/codegen_utils.h" #include "generator/internal/descriptor_utils.h" #include "generator/internal/doxygen.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/log.h" #include "google/cloud/optional.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/generator/internal/pagination_test.cc b/generator/internal/pagination_test.cc index d31223ad428bb..35ae79e707b95 100644 --- a/generator/internal/pagination_test.cc +++ b/generator/internal/pagination_test.cc @@ -16,9 +16,9 @@ #include "generator/testing/descriptor_pool_fixture.h" #include "generator/testing/error_collectors.h" #include "generator/testing/fake_source_tree.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" +#include "absl/strings/str_replace.h" +#include "google/protobuf/descriptor.pb.h" #include -#include #include #include diff --git a/generator/internal/predicate_utils.cc b/generator/internal/predicate_utils.cc index 6b28d7dddcade..e1f55e1ed8780 100644 --- a/generator/internal/predicate_utils.cc +++ b/generator/internal/predicate_utils.cc @@ -15,7 +15,7 @@ #include "generator/internal/predicate_utils.h" #include "generator/internal/descriptor_utils.h" #include "google/cloud/log.h" -#include +#include "google/longrunning/operations.pb.h" #include namespace google { diff --git a/generator/internal/predicate_utils_test.cc b/generator/internal/predicate_utils_test.cc index 16d14e5c96dce..93fcfb82f8370 100644 --- a/generator/internal/predicate_utils_test.cc +++ b/generator/internal/predicate_utils_test.cc @@ -16,9 +16,9 @@ #include "generator/testing/error_collectors.h" #include "generator/testing/fake_source_tree.h" #include "google/cloud/log.h" +#include "google/protobuf/descriptor.pb.h" #include #include -#include #include #include #include diff --git a/generator/internal/printer.h b/generator/internal/printer.h index d626858d95b84..d565ea29b36a2 100644 --- a/generator/internal/printer.h +++ b/generator/internal/printer.h @@ -56,7 +56,7 @@ class Printer { * are defined by the given map. */ void Print(VarsDictionary const& variables, std::string const& text) { - printer_->Print(variables, text.c_str()); + printer_->Print(variables, text); } /** @@ -64,7 +64,7 @@ class Printer { */ template void Print(std::string const& text, Args&&... args) { - printer_->Print(text.c_str(), std::forward(args)...); + printer_->Print(text, std::forward(args)...); } /** diff --git a/generator/internal/request_id.cc b/generator/internal/request_id.cc index be27ca8525596..4c86a06c743c9 100644 --- a/generator/internal/request_id.cc +++ b/generator/internal/request_id.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "generator/internal/request_id.h" -#include +#include "google/api/field_info.pb.h" namespace google { namespace cloud { diff --git a/generator/internal/resolve_comment_references.cc b/generator/internal/resolve_comment_references.cc index 4a7c5dbf5e9db..4240af0b15eec 100644 --- a/generator/internal/resolve_comment_references.cc +++ b/generator/internal/resolve_comment_references.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "generator/internal/resolve_comment_references.h" -#include "google/cloud/internal/absl_str_join_quiet.h" +#include "absl/strings/str_join.h" #include "absl/strings/str_split.h" #include "absl/types/optional.h" #include diff --git a/generator/internal/resolve_method_return.cc b/generator/internal/resolve_method_return.cc index 1b1b97c64dda6..b78ab41a0d8bf 100644 --- a/generator/internal/resolve_method_return.cc +++ b/generator/internal/resolve_method_return.cc @@ -15,7 +15,7 @@ #include "generator/internal/resolve_method_return.h" #include "generator/internal/longrunning.h" #include "generator/internal/pagination.h" -#include +#include "google/longrunning/operations.pb.h" #include #include #include diff --git a/generator/internal/round_robin_decorator_generator.cc b/generator/internal/round_robin_decorator_generator.cc index 12ebe514c5eda..47bcb561d3280 100644 --- a/generator/internal/round_robin_decorator_generator.cc +++ b/generator/internal/round_robin_decorator_generator.cc @@ -51,7 +51,7 @@ Status RoundRobinDecoratorGenerator::GenerateHeader() { HeaderPrint("\n"); HeaderLocalIncludes({vars("stub_header_path"), "google/cloud/version.h"}); HeaderSystemIncludes({"memory", "mutex", "vector"}); - + HeaderGrpcPortsDefInclude(); auto result = HeaderOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; @@ -78,6 +78,7 @@ class $round_robin_class_name$ : public $stub_class_name$ { )"""); HeaderCloseNamespaces(); + HeaderGrpcPortsUndefInclude(); // close header guard HeaderPrint("\n#endif // $header_include_guard$\n"); return {}; @@ -98,6 +99,7 @@ Status RoundRobinDecoratorGenerator::GenerateCc() { vars("round_robin_header_path"), }); CcSystemIncludes({"memory", "mutex", "vector"}); + CcGrpcPortsDefInclude(); auto result = CcOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; @@ -268,6 +270,7 @@ std::shared_ptr<$stub_class_name$> )"""); CcCloseNamespaces(); + CcGrpcPortsUndefInclude(); return {}; } diff --git a/generator/internal/routing.cc b/generator/internal/routing.cc index 408f009ab60ec..e5565fff060bd 100644 --- a/generator/internal/routing.cc +++ b/generator/internal/routing.cc @@ -13,11 +13,11 @@ // limitations under the License. #include "generator/internal/routing.h" -#include "google/cloud/internal/absl_str_join_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/log.h" +#include "absl/strings/str_join.h" +#include "absl/strings/str_replace.h" #include "absl/strings/str_split.h" -#include +#include "google/api/routing.pb.h" #include #include using ::google::protobuf::compiler::cpp::FieldName; diff --git a/generator/internal/scaffold_generator.cc b/generator/internal/scaffold_generator.cc index 1ee505cd277a2..18f9672969917 100644 --- a/generator/internal/scaffold_generator.cc +++ b/generator/internal/scaffold_generator.cc @@ -14,10 +14,10 @@ #include "generator/internal/scaffold_generator.h" #include "generator/internal/codegen_utils.h" -#include "google/cloud/internal/absl_str_join_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/internal/filesystem.h" #include "google/cloud/log.h" +#include "absl/strings/str_join.h" +#include "absl/strings/str_replace.h" #include "absl/strings/str_split.h" #include #include @@ -424,8 +424,7 @@ this library. google::protobuf::io::Printer printer(&output, '$'); printer.Print( variables, - absl::StrCat(kText1, FormatCloudServiceDocsLink(variables), kText2) - .c_str()); + absl::StrCat(kText1, FormatCloudServiceDocsLink(variables), kText2)); } void GenerateBuild(std::ostream& os, @@ -453,7 +452,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["$service_subdirectory$"] googleapis_deps = [ - "@com_google_googleapis//$directory$:$library$_cc_grpc", + "@googleapis//$directory$:$library$_cc_grpc", ] cc_gapic_library( @@ -560,8 +559,7 @@ which should give you a taste of the $title$ C++ client library API. google::protobuf::io::Printer printer(&output, '$'); printer.Print( variables, - absl::StrCat(kText1, FormatCloudServiceDocsLink(variables), kText2) - .c_str()); + absl::StrCat(kText1, FormatCloudServiceDocsLink(variables), kText2)); } void GenerateDoxygenEnvironmentPage( @@ -1021,7 +1019,7 @@ void GenerateQuickstartCMake( # This file shows how to use the $title$ C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-$library$-quickstart CXX) find_package(google_cloud_cpp_$library$ REQUIRED) @@ -1086,7 +1084,7 @@ CLIENT_LIBS := $$(shell pkg-config $$(CLIENT_MODULE) --libs-only-l) )"""; google::protobuf::io::OstreamOutputStream output(&os); google::protobuf::io::Printer printer(&output, '$'); - printer.Print(variables, format.c_str()); + printer.Print(variables, format); } void GenerateQuickstartWorkspace( @@ -1094,7 +1092,7 @@ void GenerateQuickstartWorkspace( std::string const& contents) { google::protobuf::io::OstreamOutputStream output(&os); google::protobuf::io::Printer printer(&output, '$'); - printer.Print(variables, contents.c_str()); + printer.Print(variables, contents); } void GenerateQuickstartBuild( diff --git a/generator/internal/scaffold_generator_test.cc b/generator/internal/scaffold_generator_test.cc index ace489a009a58..b953aaa7b71e1 100644 --- a/generator/internal/scaffold_generator_test.cc +++ b/generator/internal/scaffold_generator_test.cc @@ -122,18 +122,18 @@ class ScaffoldGenerator : public ::testing::Test { for (auto const* s : kHierarchy) MakeDirectory(path_ + s); std::ofstream(path_ + "/external/googleapis/protolists/test.list") - << R"""(@com_google_googleapis//google/cloud/test/v1:foo.proto -@com_google_googleapis//google/cloud/test/v1:admin.proto + << R"""(@googleapis//google/cloud/test/v1:foo.proto +@googleapis//google/cloud/test/v1:admin.proto )"""; std::ofstream(path_ + "/external/googleapis/protodeps/test.deps") - << R"""(@com_google_googleapis//google/longrunning:operations_proto -@com_google_googleapis//google/rpc:status_proto -@com_google_googleapis//google/api:resource_proto -@com_google_googleapis//google/api:field_behavior_proto -@com_google_googleapis//google/api:client_proto -@com_google_googleapis//google/api:annotations_proto -@com_google_googleapis//google/api:http_proto + << R"""(@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto +@googleapis//google/api:resource_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:client_proto +@googleapis//google/api:annotations_proto +@googleapis//google/api:http_proto )"""; std::ofstream(path_ + "/google/cloud/test/v1/test_v1.yaml") @@ -274,8 +274,7 @@ TEST_F(ScaffoldGenerator, Build) { EXPECT_THAT(actual, HasSubstr(R"""(name = "test",)""")); EXPECT_THAT( actual, - HasSubstr( - R"""(@com_google_googleapis//google/cloud/test/v1:test_cc_grpc",)""")); + HasSubstr(R"""(@googleapis//google/cloud/test/v1:test_cc_grpc",)""")); } TEST_F(ScaffoldGenerator, CMakeLists) { diff --git a/generator/internal/service_code_generator.cc b/generator/internal/service_code_generator.cc index cb31ba54435b7..30f0b1b59c810 100644 --- a/generator/internal/service_code_generator.cc +++ b/generator/internal/service_code_generator.cc @@ -18,15 +18,15 @@ #include "generator/internal/pagination.h" #include "generator/internal/printer.h" #include "generator/internal/request_id.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/internal/algorithm.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/log.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_replace.h" #include "absl/strings/str_split.h" #include "absl/strings/strip.h" -#include -#include +#include "google/api/client.pb.h" +#include "google/api/routing.pb.h" #include #include #include @@ -72,9 +72,6 @@ ServiceCodeGenerator::ServiceCodeGenerator( assert(context != nullptr); SetVars(service_vars_[header_path_key]); SetMethods(); - auto e = service_vars_.find("backwards_compatibility_namespace_alias"); - define_backwards_compatibility_namespace_alias_ = - (e != service_vars_.end() && e->second == "true"); } ServiceCodeGenerator::ServiceCodeGenerator( @@ -314,29 +311,40 @@ void ServiceCodeGenerator::CcSystemIncludes( GenerateSystemIncludes(cc_, system_includes); } -Status ServiceCodeGenerator::HeaderOpenNamespaces(NamespaceType ns_type) { - return OpenNamespaces(header_, ns_type, "product_path"); +void ServiceCodeGenerator::HeaderGrpcPortsDefInclude() { + header_.Print(R"""( +// Must be included last. +#include "google/cloud/ports_def.inc" +)"""); } - -Status ServiceCodeGenerator::HeaderOpenForwardingNamespaces( - NamespaceType ns_type, std::string const& ns_documentation) { - return OpenNamespaces(header_, ns_type, "forwarding_product_path", - ns_documentation); +void ServiceCodeGenerator::HeaderGrpcPortsUndefInclude() { + header_.Print(R"""( +#include "google/cloud/ports_undef.inc" +)"""); +} +void ServiceCodeGenerator::CcGrpcPortsDefInclude() { + cc_.Print(R"""( +// Must be included last. +#include "google/cloud/ports_def.inc" +)"""); +} +void ServiceCodeGenerator::CcGrpcPortsUndefInclude() { + cc_.Print(R"""( +#include "google/cloud/ports_undef.inc" +)"""); } -void ServiceCodeGenerator::HeaderCloseNamespaces() { - CloseNamespaces(header_, define_backwards_compatibility_namespace_alias_); +Status ServiceCodeGenerator::HeaderOpenNamespaces(NamespaceType ns_type) { + return OpenNamespaces(header_, ns_type, "product_path"); } +void ServiceCodeGenerator::HeaderCloseNamespaces() { CloseNamespaces(header_); } + Status ServiceCodeGenerator::CcOpenNamespaces(NamespaceType ns_type) { return OpenNamespaces(cc_, ns_type, "product_path"); } -Status ServiceCodeGenerator::CcOpenForwardingNamespaces(NamespaceType ns_type) { - return OpenNamespaces(cc_, ns_type, "forwarding_product_path"); -} - -void ServiceCodeGenerator::CcCloseNamespaces() { CloseNamespaces(cc_, false); } +void ServiceCodeGenerator::CcCloseNamespaces() { CloseNamespaces(cc_); } void ServiceCodeGenerator::HeaderPrint(std::string const& text) { header_.Print(service_vars_, text); @@ -445,15 +453,9 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN return {}; } -void ServiceCodeGenerator::CloseNamespaces( - Printer& p, bool define_backwards_compatibility_namespace_alias) { +void ServiceCodeGenerator::CloseNamespaces(Printer& p) { p.Print(R"""( GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END)"""); - // TODO(#7463) - remove backwards compatibility namespaces - if (define_backwards_compatibility_namespace_alias) { - p.Print(R"""( -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls))"""); - } p.Print(R"""( } // namespace $namespace$ } // namespace cloud @@ -503,6 +505,20 @@ void ServiceCodeGenerator::SetMethods() { for (auto const& mixin_method : mixin_methods_) { methods_.emplace_back(mixin_method.method.get()); } + + auto bespoke_methods_var = service_vars_.find("bespoke_methods"); + if (bespoke_methods_var != service_vars_.end()) { + auto methods = absl::StrSplit(bespoke_methods_var->second, ','); + for (auto const& method : methods) { + std::vector pieces = absl::StrSplit(method, "@@"); + assert(pieces.size() == 3); + cpp::generator::ServiceConfiguration::BespokeMethod bespoke_method; + bespoke_method.set_name(SafeReplaceAll(pieces[0], "@", ",")); + bespoke_method.set_return_type(SafeReplaceAll(pieces[1], "@", ",")); + bespoke_method.set_parameters(SafeReplaceAll(pieces[2], "@", ",")); + bespoke_methods_.emplace_back(std::move(bespoke_method)); + } + } } std::string ServiceCodeGenerator::GetPbIncludeByTransport() const { diff --git a/generator/internal/service_code_generator.h b/generator/internal/service_code_generator.h index d76cc824bd161..7cab00a27a7e4 100644 --- a/generator/internal/service_code_generator.h +++ b/generator/internal/service_code_generator.h @@ -68,6 +68,10 @@ class ServiceCodeGenerator : public GeneratorInterface { std::string vars(std::string const& key) const; MethodDescriptorList const& methods() const { return methods_; } MethodDescriptorList const& async_methods() const { return async_methods_; } + std::vector const& + bespoke_methods() const { + return bespoke_methods_; + } void SetVars(absl::string_view header_path); VarsDictionary MergeServiceAndMethodVars( google::protobuf::MethodDescriptor const& method) const; @@ -77,6 +81,11 @@ class ServiceCodeGenerator : public GeneratorInterface { void HeaderSystemIncludes(std::vector const& system_includes); void CcSystemIncludes(std::vector const& system_includes); + void HeaderGrpcPortsDefInclude(); + void HeaderGrpcPortsUndefInclude(); + void CcGrpcPortsDefInclude(); + void CcGrpcPortsUndefInclude(); + void HeaderProtobufGenCodeIncludes( std::vector const& pb_h_includes); void CcProtobufGenCodeIncludes(std::vector const& pb_h_includes); @@ -259,17 +268,17 @@ class ServiceCodeGenerator : public GeneratorInterface { Status OpenNamespaces(Printer& p, NamespaceType ns_type, std::string const& product_path_var, std::string const& ns_documentation = ""); - void CloseNamespaces(Printer& p, - bool define_backwards_compatibility_namespace_alias); + void CloseNamespaces(Printer& p); google::protobuf::ServiceDescriptor const* service_descriptor_; VarsDictionary service_vars_; std::map service_method_vars_; std::string namespace_; - bool define_backwards_compatibility_namespace_alias_ = false; - bool pb_h_system_includes_ = true; + bool pb_h_system_includes_ = false; MethodDescriptorList methods_; MethodDescriptorList async_methods_; + std::vector + bespoke_methods_; Printer header_; Printer cc_; std::vector mixin_methods_; diff --git a/generator/internal/service_code_generator_test.cc b/generator/internal/service_code_generator_test.cc index 4a65fb279743a..20080e1e9eb6c 100644 --- a/generator/internal/service_code_generator_test.cc +++ b/generator/internal/service_code_generator_test.cc @@ -19,9 +19,9 @@ #include "generator/testing/fake_source_tree.h" #include "generator/testing/printer_mocks.h" #include "google/cloud/log.h" +#include "google/protobuf/descriptor.pb.h" #include #include -#include #include #include #include diff --git a/generator/internal/stub_factory_generator.cc b/generator/internal/stub_factory_generator.cc index a0e4a8c9b6990..a7f057a1676a4 100644 --- a/generator/internal/stub_factory_generator.cc +++ b/generator/internal/stub_factory_generator.cc @@ -51,7 +51,7 @@ Status StubFactoryGenerator::GenerateHeader() { "google/cloud/internal/unified_grpc_credentials.h", "google/cloud/options.h", "google/cloud/version.h"}); HeaderSystemIncludes({"memory"}); - + HeaderGrpcPortsDefInclude(); auto result = HeaderOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; @@ -63,6 +63,7 @@ std::shared_ptr<$stub_class_name$> CreateDefault$stub_class_name$( )"""); HeaderCloseNamespaces(); + HeaderGrpcPortsUndefInclude(); // close header guard HeaderPrint("\n#endif // $header_include_guard$\n"); return {}; @@ -93,7 +94,7 @@ Status StubFactoryGenerator::GenerateCc() { headers.insert(headers.end(), {vars("proto_grpc_header_path")}); CcProtobufGenCodeIncludes(headers); CcSystemIncludes({"memory", "utility"}); - + CcGrpcPortsDefInclude(); auto result = CcOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; @@ -168,6 +169,7 @@ CreateDefault$stub_class_name$( )"""); CcCloseNamespaces(); + CcGrpcPortsUndefInclude(); return {}; } diff --git a/generator/internal/stub_generator.cc b/generator/internal/stub_generator.cc index df3a361202926..020a01ce3e18b 100644 --- a/generator/internal/stub_generator.cc +++ b/generator/internal/stub_generator.cc @@ -18,8 +18,8 @@ #include "generator/internal/longrunning.h" #include "generator/internal/predicate_utils.h" #include "generator/internal/printer.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include "absl/strings/str_split.h" #include @@ -86,7 +86,7 @@ Status StubGenerator::GenerateHeader() { {vars("proto_grpc_header_path"), include_lro_header ? "google/longrunning/operations.grpc.pb.h" : ""}); HeaderSystemIncludes({"memory", "utility"}); - + HeaderGrpcPortsDefInclude(); auto result = HeaderOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; @@ -288,8 +288,8 @@ Status StubGenerator::GenerateHeader() { // clang-format on } HeaderPrint("};\n"); - HeaderCloseNamespaces(); + HeaderGrpcPortsUndefInclude(); // close header guard HeaderPrint("\n#endif // $header_include_guard$\n"); return {}; @@ -326,7 +326,7 @@ Status StubGenerator::GenerateCc() { ? "google/longrunning/operations.grpc.pb.h" : ""}); CcSystemIncludes({"memory", "utility"}); - + CcGrpcPortsDefInclude(); auto result = CcOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; @@ -596,6 +596,7 @@ future Default$stub_class_name$::AsyncCancelOperation( } CcCloseNamespaces(); + CcGrpcPortsUndefInclude(); return {}; } diff --git a/generator/internal/stub_rest_generator.cc b/generator/internal/stub_rest_generator.cc index 8692f774aa581..19e87462a9ade 100644 --- a/generator/internal/stub_rest_generator.cc +++ b/generator/internal/stub_rest_generator.cc @@ -257,8 +257,7 @@ Status StubRestGenerator::GenerateCc() { CcPrint("\n"); CcLocalIncludes({vars("stub_rest_header_path"), - "google/cloud/common_options.h", - "google/cloud/internal/absl_str_cat_quiet.h", + "google/cloud/common_options.h", "absl/strings/str_cat.h", "google/cloud/internal/rest_stub_helpers.h", "google/cloud/status_or.h"}); CcProtobufGenCodeIncludes({vars("proto_header_path"), diff --git a/generator/internal/tracing_connection_generator.cc b/generator/internal/tracing_connection_generator.cc index 1afea7c3997cb..dd8462270cb67 100644 --- a/generator/internal/tracing_connection_generator.cc +++ b/generator/internal/tracing_connection_generator.cc @@ -18,7 +18,7 @@ #include "generator/internal/pagination.h" #include "generator/internal/predicate_utils.h" #include "generator/internal/printer.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" #include namespace google { @@ -57,8 +57,6 @@ Status TracingConnectionGenerator::GenerateHeader() { if (!result.ok()) return result; HeaderPrint(R"""( -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class $tracing_connection_class_name$ : public $product_namespace$::$connection_class_name$ { public: @@ -87,8 +85,6 @@ class $tracing_connection_class_name$ std::shared_ptr<$product_namespace$::$connection_class_name$> child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * @@ -130,8 +126,6 @@ Status TracingConnectionGenerator::GenerateCc() { if (!result.ok()) return result; CcPrint(R"""( -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - $tracing_connection_class_name$::$tracing_connection_class_name$( std::shared_ptr<$product_namespace$::$connection_class_name$> child) : child_(std::move(child)) {} @@ -148,16 +142,12 @@ Status TracingConnectionGenerator::GenerateCc() { } CcPrint(R"""( -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr<$product_namespace$::$connection_class_name$> Make$tracing_connection_class_name$( std::shared_ptr<$product_namespace$::$connection_class_name$> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared<$tracing_connection_class_name$>(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } )"""); diff --git a/generator/internal/tracing_stub_generator.cc b/generator/internal/tracing_stub_generator.cc index f48aaab69b27e..3288cfd2630e0 100644 --- a/generator/internal/tracing_stub_generator.cc +++ b/generator/internal/tracing_stub_generator.cc @@ -50,15 +50,13 @@ Status TracingStubGenerator::GenerateHeader() { "google/cloud/internal/trace_propagator.h", "google/cloud/options.h", "google/cloud/version.h"}); HeaderSystemIncludes({"memory"}); - + HeaderGrpcPortsDefInclude(); auto result = HeaderOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; // Tracing stub class definition HeaderPrint( R"""( -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class $tracing_stub_class_name$ : public $stub_class_name$ { public: ~$tracing_stub_class_name$() override = default; @@ -74,8 +72,6 @@ class $tracing_stub_class_name$ : public $stub_class_name$ { std::shared_ptr propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -87,6 +83,7 @@ std::shared_ptr<$stub_class_name$> Make$tracing_stub_class_name$( )"""); HeaderCloseNamespaces(); + HeaderGrpcPortsUndefInclude(); // close header guard HeaderPrint("\n#endif // $header_include_guard$\n"); return {}; @@ -122,15 +119,13 @@ Status TracingStubGenerator::GenerateCc() { : "", "google/cloud/internal/grpc_opentelemetry.h"}); CcSystemIncludes({"memory", "utility"}); - + CcGrpcPortsDefInclude(); auto result = CcOpenNamespaces(NamespaceType::kInternal); if (!result.ok()) return result; // constructor CcPrint( R"""( -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - $tracing_stub_class_name$::$tracing_stub_class_name$( std::shared_ptr<$stub_class_name$> child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -346,18 +341,13 @@ future $tracing_stub_class_name$::AsyncCancelOperation( } CcPrint(R"""( -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr<$stub_class_name$> Make$tracing_stub_class_name$( std::shared_ptr<$stub_class_name$> stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared<$tracing_stub_class_name$>(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } )"""); CcCloseNamespaces(); + CcGrpcPortsUndefInclude(); return {}; } diff --git a/generator/standalone_main.cc b/generator/standalone_main.cc index ff7db95f54018..f94a944d760b1 100644 --- a/generator/standalone_main.cc +++ b/generator/standalone_main.cc @@ -18,15 +18,16 @@ #include "generator/internal/descriptor_utils.h" #include "generator/internal/discovery_to_proto.h" #include "generator/internal/format_method_comments.h" +#include "generator/internal/mixin_utils.h" #include "generator/internal/scaffold_generator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/log.h" #include "google/cloud/status_or.h" #include "absl/flags/flag.h" #include "absl/flags/parse.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include #include #include @@ -164,14 +165,6 @@ int WriteInstallDirectories( if (!service.omit_connection()) { install_directories.push_back("./include/" + product_path + "/mocks"); } - auto const& forwarding_product_path = service.forwarding_product_path(); - if (!forwarding_product_path.empty()) { - install_directories.push_back("./include/" + forwarding_product_path); - if (!service.omit_connection()) { - install_directories.push_back("./include/" + forwarding_product_path + - "/mocks"); - } - } auto const lib = LibraryName(product_path); install_directories.push_back("./lib64/cmake/google_cloud_cpp_" + lib); // Note that storage does not have a public-facing mocks library. Only @@ -288,9 +281,13 @@ std::vector> GenerateCodeFromProtos( args.emplace_back(absl::StrCat("--cpp_codegen_opt=omit_rpc=", SafeReplaceAll(omit_rpc, ",", "@"))); } - if (service.backwards_compatibility_namespace_alias()) { - args.emplace_back( - "--cpp_codegen_opt=backwards_compatibility_namespace_alias=true"); + for (auto const& bespoke_method : service.bespoke_methods()) { + args.emplace_back(absl::StrCat( + "--cpp_codegen_opt=bespoke_method=", + absl::StrJoin({SafeReplaceAll(bespoke_method.name(), ",", "@"), + SafeReplaceAll(bespoke_method.return_type(), ",", "@"), + SafeReplaceAll(bespoke_method.parameters(), ",", "@")}, + "@@"))); } for (auto const& retry_code : service.retryable_status_codes()) { args.emplace_back("--cpp_codegen_opt=retry_status_code=" + retry_code); @@ -329,17 +326,9 @@ std::vector> GenerateCodeFromProtos( if (service.generate_rest_transport()) { args.emplace_back("--cpp_codegen_opt=generate_rest_transport=true"); } - args.emplace_back(service.service_proto_path()); - for (auto const& additional_proto_file : service.additional_proto_files()) { - args.emplace_back(additional_proto_file); - } if (service.experimental()) { args.emplace_back("--cpp_codegen_opt=experimental=true"); } - if (!service.forwarding_product_path().empty()) { - args.emplace_back("--cpp_codegen_opt=forwarding_product_path=" + - service.forwarding_product_path()); - } for (auto const& o : service.idempotency_overrides()) { args.emplace_back(absl::StrCat( "--cpp_codegen_opt=idempotency_override=", o.rpc_name(), ":", @@ -388,10 +377,30 @@ std::vector> GenerateCodeFromProtos( "=", kv.second)); } + std::vector mixin_files_to_append; auto path = ServiceConfigYamlPath(yaml_root, scaffold_vars); if (!path.empty()) { + auto mixins = + google::cloud::generator_internal::GetMixinServiceProto(path); args.emplace_back(absl::StrCat("--cpp_codegen_opt=service_config_yaml=", std::move(path))); + for (auto& mixin_service : mixins) { + if (mixin_service.proto_file_path != service.service_proto_path()) { + args.emplace_back("--cpp_codegen_opt=omit_service=" + + std::move(mixin_service.service_full_name)); + mixin_files_to_append.push_back( + std::move(mixin_service.proto_file_path)); + } + } + } + + args.push_back(service.service_proto_path()); + for (auto const& additional_proto_file : service.additional_proto_files()) { + args.push_back(additional_proto_file); + } + + for (auto& mixin_path : mixin_files_to_append) { + args.push_back(std::move(mixin_path)); } GCP_LOG(INFO) << "Generating service code using: " 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/generator/testing/descriptor_pool_fixture.cc b/generator/testing/descriptor_pool_fixture.cc index a6f983892a58b..60ee37a58cf83 100644 --- a/generator/testing/descriptor_pool_fixture.cc +++ b/generator/testing/descriptor_pool_fixture.cc @@ -14,13 +14,13 @@ #include "generator/testing/descriptor_pool_fixture.h" #include "generator/testing/error_collectors.h" -#include -#include -#include -#include -#include -#include -#include +#include "google/api/annotations.pb.h" +#include "google/api/client.pb.h" +#include "google/longrunning/operations.pb.h" +#include "google/protobuf/any.pb.h" +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/empty.pb.h" +#include "google/rpc/status.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/BUILD.bazel b/google/cloud/BUILD.bazel index 51e32938280c6..708169ddda3d5 100644 --- a/google/cloud/BUILD.bazel +++ b/google/cloud/BUILD.bazel @@ -44,13 +44,6 @@ capture_build_info( ], ) -config_setting( - name = "enable_opentelemetry", - flag_values = { - "//:enable_opentelemetry": "true", - }, -) - filegroup( name = "common_hdrs", srcs = [h for h in google_cloud_cpp_common_hdrs if not h.startswith("internal/")], @@ -61,13 +54,6 @@ cc_library( name = "google_cloud_cpp_common_private", srcs = google_cloud_cpp_common_srcs + ["internal/build_info.cc"], hdrs = google_cloud_cpp_common_hdrs, - defines = select({ - ":enable_opentelemetry": [ - # Enable OpenTelemetry features in google-cloud-cpp - "GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY", - ], - "//conditions:default": [], - }), linkopts = select({ "@platforms//os:windows": [ "-DEFAULTLIB:bcrypt.lib", @@ -86,20 +72,16 @@ cc_library( "//:__pkg__", ], deps = [ - "@com_google_absl//absl/base", - "@com_google_absl//absl/functional:function_ref", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/strings:str_format", - "@com_google_absl//absl/time", - "@com_google_absl//absl/types:optional", - "@com_google_absl//absl/types:span", - "@com_google_absl//absl/types:variant", + "@abseil-cpp//absl/base", + "@abseil-cpp//absl/functional:function_ref", + "@abseil-cpp//absl/strings", + "@abseil-cpp//absl/strings:str_format", + "@abseil-cpp//absl/time", + "@abseil-cpp//absl/types:optional", + "@abseil-cpp//absl/types:span", + "@abseil-cpp//absl/types:variant", + "@opentelemetry-cpp//api", ] + select({ - ":enable_opentelemetry": [ - "@io_opentelemetry_cpp//api", - ], - "//conditions:default": [], - }) + select({ "@platforms//os:windows": [], "//conditions:default": [ "@boringssl//:crypto", @@ -109,13 +91,11 @@ cc_library( cc_library( name = "google_cloud_cpp_common", - deprecation = """ - This target is deprecated and will be removed on or after 2023-04-01. Use - //:common instead. More info: - https://github.com/googleapis/google-cloud-cpp/issues/3701 - """, tags = ["manual"], - visibility = ["//visibility:public"], + visibility = [ + ":__subpackages__", + "//:__pkg__", + ], deps = [":google_cloud_cpp_common_private"], ) @@ -130,7 +110,7 @@ cc_library( ":google_cloud_cpp_common", ":google_cloud_cpp_mocks", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in google_cloud_cpp_common_unit_tests] @@ -166,28 +146,25 @@ cc_library( ], deps = [ ":google_cloud_cpp_common", - "@com_github_grpc_grpc//:grpc++", - "@com_google_absl//absl/functional:function_ref", - "@com_google_absl//absl/time", - "@com_google_googleapis//:googleapis_system_includes", - "@com_google_googleapis//google/cloud/location:location_cc_grpc", - "@com_google_googleapis//google/iam/credentials/v1:credentials_cc_grpc", - "@com_google_googleapis//google/iam/v1:iam_cc_grpc", - "@com_google_googleapis//google/longrunning:longrunning_cc_grpc", - "@com_google_googleapis//google/rpc:error_details_cc_proto", - "@com_google_googleapis//google/rpc:status_cc_proto", + "@abseil-cpp//absl/functional:function_ref", + "@abseil-cpp//absl/time", + "@googleapis//google/cloud/location:location_cc_grpc", + "@googleapis//google/iam/credentials/v1:credentials_cc_grpc", + "@googleapis//google/iam/v1:iam_cc_grpc", + "@googleapis//google/longrunning:longrunning_cc_grpc", + "@googleapis//google/rpc:error_details_cc_proto", + "@googleapis//google/rpc:status_cc_proto", + "@grpc//:grpc++", ], ) cc_library( name = "google_cloud_cpp_grpc_utils", - deprecation = """ - This target is deprecated and will be removed on or after 2023-04-01. Use - //:grpc_utils instead. More info: - https://github.com/googleapis/google-cloud-cpp/issues/3701 - """, tags = ["manual"], - visibility = ["//visibility:public"], + visibility = [ + ":__subpackages__", + "//:__pkg__", + ], deps = [":google_cloud_cpp_grpc_utils_private"], ) @@ -200,9 +177,9 @@ cc_library( ":google_cloud_cpp_mocks", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googleapis//google/bigtable/admin/v2:admin_cc_grpc", - "@com_google_googleapis//google/bigtable/v2:bigtable_cc_grpc", - "@com_google_googletest//:gtest_main", + "@googleapis//google/bigtable/admin/v2:admin_cc_grpc", + "@googleapis//google/bigtable/v2:bigtable_cc_grpc", + "@googletest//:gtest_main", ], ) for test in google_cloud_cpp_grpc_utils_unit_tests] @@ -217,9 +194,9 @@ cc_library( ":google_cloud_cpp_grpc_utils", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googleapis//google/bigtable/admin/v2:admin_cc_grpc", - "@com_google_googleapis//google/bigtable/v2:bigtable_cc_grpc", - "@com_google_googletest//:gtest_main", + "@googleapis//google/bigtable/admin/v2:admin_cc_grpc", + "@googleapis//google/bigtable/v2:bigtable_cc_grpc", + "@googletest//:gtest_main", ], ) for test in google_cloud_cpp_grpc_utils_integration_tests] @@ -231,8 +208,8 @@ cc_library( ":google_cloud_cpp_grpc_utils", "@com_google_benchmark//:benchmark", "@com_google_benchmark//:benchmark_main", - "@com_google_googleapis//google/bigtable/admin/v2:admin_cc_grpc", - "@com_google_googleapis//google/bigtable/v2:bigtable_cc_grpc", + "@googleapis//google/bigtable/admin/v2:admin_cc_grpc", + "@googleapis//google/bigtable/v2:bigtable_cc_grpc", ], ) for test in google_cloud_cpp_grpc_utils_benchmarks] @@ -260,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", @@ -279,10 +258,11 @@ cc_library( visibility = ["//:__subpackages__"], deps = [ ":google_cloud_cpp_common", - "@com_github_curl_curl//:curl", - "@com_github_nlohmann_json//:json", - "@com_google_absl//absl/functional:function_ref", - "@com_google_absl//absl/types:span", + "@abseil-cpp//absl/container:flat_hash_map", + "@abseil-cpp//absl/functional:function_ref", + "@abseil-cpp//absl/types:span", + "@curl", + "@nlohmann_json//:json", ] + select({ "@platforms//os:windows": [], "//conditions:default": [ @@ -295,11 +275,13 @@ 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", "//google/cloud/testing_util:google_cloud_cpp_testing_rest_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in google_cloud_cpp_rest_internal_unit_tests] @@ -312,7 +294,7 @@ cc_library( deps = [ ":google_cloud_cpp_rest_internal", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in google_cloud_cpp_rest_internal_emulator_integration_tests] @@ -325,7 +307,7 @@ cc_library( deps = [ ":google_cloud_cpp_rest_internal", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in google_cloud_cpp_rest_internal_production_integration_tests] @@ -360,9 +342,9 @@ cc_library( "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_rest_private", - "@com_google_googleapis//google/bigtable/admin/v2:admin_cc_grpc", - "@com_google_googleapis//google/iam/admin/v1:admin_cc_grpc", - "@com_google_googletest//:gtest_main", + "@googleapis//google/bigtable/admin/v2:admin_cc_grpc", + "@googleapis//google/iam/admin/v1:admin_cc_grpc", + "@googletest//:gtest_main", ], ) for test in google_cloud_cpp_rest_protobuf_internal_unit_tests] @@ -384,7 +366,7 @@ cc_library( ":google_cloud_cpp_universe_domain", "//google/cloud/testing_util:google_cloud_cpp_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_rest_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in google_cloud_cpp_universe_domain_unit_tests] diff --git a/google/cloud/README.md b/google/cloud/README.md index 98e2d2689bbe2..6e0dc7f76e8da 100644 --- a/google/cloud/README.md +++ b/google/cloud/README.md @@ -15,14 +15,6 @@ intended for general use. They are subject to change and/or removal without notice. These include `google/cloud/internal/`, and `google/cloud/testing_utils/`. -## Supported Platforms - -- Windows, macOS, Linux -- C++14 (and higher) compilers. We test with GCC >= 7.5, Clang >= 6.0, and MSVC - \>= 2022 -- Environments with or without exceptions -- Bazel (>= 6.0) and CMake (>= 3.5) builds - ## Documentation - [Reference doxygen documentation][doxygen-link] for each release of this diff --git a/google/cloud/accessapproval/BUILD.bazel b/google/cloud/accessapproval/BUILD.bazel index a18e446f3f00d..bde1c5ea5b791 100644 --- a/google/cloud/accessapproval/BUILD.bazel +++ b/google/cloud/accessapproval/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/accessapproval/v1:accessapproval_cc_grpc", + "@googleapis//google/cloud/accessapproval/v1:accessapproval_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/accessapproval/CMakeLists.txt b/google/cloud/accessapproval/CMakeLists.txt index ed2dadc4fc1af..3d22ecb1d1483 100644 --- a/google/cloud/accessapproval/CMakeLists.txt +++ b/google/cloud/accessapproval/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(accessapproval "Access Approval API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(accessapproval_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/accessapproval/access_approval_client.h b/google/cloud/accessapproval/access_approval_client.h deleted file mode 100644 index 8fd41234aa446..0000000000000 --- a/google/cloud/accessapproval/access_approval_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/accessapproval/v1/accessapproval.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_ACCESS_APPROVAL_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_ACCESS_APPROVAL_CLIENT_H - -#include "google/cloud/accessapproval/access_approval_connection.h" -#include "google/cloud/accessapproval/v1/access_approval_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in accessapproval_v1 instead of the aliases defined in -/// this namespace. -namespace accessapproval { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use accessapproval_v1::AccessApprovalClient directly. -using ::google::cloud::accessapproval_v1::AccessApprovalClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace accessapproval -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_ACCESS_APPROVAL_CLIENT_H diff --git a/google/cloud/accessapproval/access_approval_connection.h b/google/cloud/accessapproval/access_approval_connection.h deleted file mode 100644 index 532e3a404a4ec..0000000000000 --- a/google/cloud/accessapproval/access_approval_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/accessapproval/v1/accessapproval.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_ACCESS_APPROVAL_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_ACCESS_APPROVAL_CONNECTION_H - -#include "google/cloud/accessapproval/access_approval_connection_idempotency_policy.h" -#include "google/cloud/accessapproval/v1/access_approval_connection.h" - -namespace google { -namespace cloud { -namespace accessapproval { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use accessapproval_v1::MakeAccessApprovalConnection directly. -using ::google::cloud::accessapproval_v1::MakeAccessApprovalConnection; - -/// @deprecated Use accessapproval_v1::AccessApprovalConnection directly. -using ::google::cloud::accessapproval_v1::AccessApprovalConnection; - -/// @deprecated Use -/// accessapproval_v1::AccessApprovalLimitedErrorCountRetryPolicy directly. -using ::google::cloud::accessapproval_v1:: - AccessApprovalLimitedErrorCountRetryPolicy; - -/// @deprecated Use accessapproval_v1::AccessApprovalLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::accessapproval_v1::AccessApprovalLimitedTimeRetryPolicy; - -/// @deprecated Use accessapproval_v1::AccessApprovalRetryPolicy directly. -using ::google::cloud::accessapproval_v1::AccessApprovalRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace accessapproval -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_ACCESS_APPROVAL_CONNECTION_H diff --git a/google/cloud/accessapproval/access_approval_connection_idempotency_policy.h b/google/cloud/accessapproval/access_approval_connection_idempotency_policy.h deleted file mode 100644 index d72277c785324..0000000000000 --- a/google/cloud/accessapproval/access_approval_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/accessapproval/v1/accessapproval.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_ACCESS_APPROVAL_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_ACCESS_APPROVAL_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/accessapproval/v1/access_approval_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace accessapproval { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// accessapproval_v1::MakeDefaultAccessApprovalConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::accessapproval_v1:: - MakeDefaultAccessApprovalConnectionIdempotencyPolicy; - -/// @deprecated Use accessapproval_v1::AccessApprovalConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::accessapproval_v1:: - AccessApprovalConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace accessapproval -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_ACCESS_APPROVAL_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/accessapproval/access_approval_options.h b/google/cloud/accessapproval/access_approval_options.h deleted file mode 100644 index 8393ed07eb985..0000000000000 --- a/google/cloud/accessapproval/access_approval_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/accessapproval/v1/accessapproval.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_ACCESS_APPROVAL_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_ACCESS_APPROVAL_OPTIONS_H - -#include "google/cloud/accessapproval/access_approval_connection.h" -#include "google/cloud/accessapproval/access_approval_connection_idempotency_policy.h" -#include "google/cloud/accessapproval/v1/access_approval_options.h" - -namespace google { -namespace cloud { -namespace accessapproval { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use accessapproval_v1::AccessApprovalBackoffPolicyOption -/// directly. -using ::google::cloud::accessapproval_v1::AccessApprovalBackoffPolicyOption; - -/// @deprecated Use -/// accessapproval_v1::AccessApprovalConnectionIdempotencyPolicyOption directly. -using ::google::cloud::accessapproval_v1:: - AccessApprovalConnectionIdempotencyPolicyOption; - -/// @deprecated Use accessapproval_v1::AccessApprovalPolicyOptionList directly. -using ::google::cloud::accessapproval_v1::AccessApprovalPolicyOptionList; - -/// @deprecated Use accessapproval_v1::AccessApprovalRetryPolicyOption directly. -using ::google::cloud::accessapproval_v1::AccessApprovalRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace accessapproval -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_ACCESS_APPROVAL_OPTIONS_H diff --git a/google/cloud/accessapproval/mocks/mock_access_approval_connection.h b/google/cloud/accessapproval/mocks/mock_access_approval_connection.h deleted file mode 100644 index c9f2f67c63fa1..0000000000000 --- a/google/cloud/accessapproval/mocks/mock_access_approval_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/accessapproval/v1/accessapproval.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_MOCKS_MOCK_ACCESS_APPROVAL_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_MOCKS_MOCK_ACCESS_APPROVAL_CONNECTION_H - -#include "google/cloud/accessapproval/access_approval_connection.h" -#include "google/cloud/accessapproval/v1/mocks/mock_access_approval_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in accessapproval_v1_mocks instead of the aliases -/// defined in this namespace. -namespace accessapproval_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use accessapproval_v1_mocks::MockAccessApprovalConnection -/// directly. -using ::google::cloud::accessapproval_v1_mocks::MockAccessApprovalConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace accessapproval_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_MOCKS_MOCK_ACCESS_APPROVAL_CONNECTION_H diff --git a/google/cloud/accessapproval/quickstart/.bazelrc b/google/cloud/accessapproval/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/accessapproval/quickstart/.bazelrc +++ b/google/cloud/accessapproval/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/accessapproval/quickstart/CMakeLists.txt index 63bea4cbcde1b..43a083c44f1c3 100644 --- a/google/cloud/accessapproval/quickstart/CMakeLists.txt +++ b/google/cloud/accessapproval/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Access Approval API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-accessapproval-quickstart CXX) find_package(google_cloud_cpp_accessapproval REQUIRED) diff --git a/google/cloud/accessapproval/quickstart/WORKSPACE.bazel b/google/cloud/accessapproval/quickstart/WORKSPACE.bazel index dbb5cfd8a4f78..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 = "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/accessapproval/v1/access_approval_connection.h b/google/cloud/accessapproval/v1/access_approval_connection.h index 613727bf693d7..bf36771e5831b 100644 --- a/google/cloud/accessapproval/v1/access_approval_connection.h +++ b/google/cloud/accessapproval/v1/access_approval_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_V1_ACCESS_APPROVAL_CONNECTION_H #include "google/cloud/accessapproval/v1/access_approval_connection_idempotency_policy.h" +#include "google/cloud/accessapproval/v1/accessapproval.pb.h" #include "google/cloud/accessapproval/v1/internal/access_approval_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/accessapproval/v1/access_approval_connection_idempotency_policy.h b/google/cloud/accessapproval/v1/access_approval_connection_idempotency_policy.h index 348ac7346e7ed..662276327e49f 100644 --- a/google/cloud/accessapproval/v1/access_approval_connection_idempotency_policy.h +++ b/google/cloud/accessapproval/v1/access_approval_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_V1_ACCESS_APPROVAL_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_V1_ACCESS_APPROVAL_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/accessapproval/v1/accessapproval.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/accessapproval/v1/internal/access_approval_auth_decorator.cc b/google/cloud/accessapproval/v1/internal/access_approval_auth_decorator.cc index 636d93fd8822b..d3eda57f48a88 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_auth_decorator.cc +++ b/google/cloud/accessapproval/v1/internal/access_approval_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/accessapproval/v1/accessapproval.proto #include "google/cloud/accessapproval/v1/internal/access_approval_auth_decorator.h" -#include +#include "google/cloud/accessapproval/v1/accessapproval.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accessapproval_v1_internal { @@ -124,3 +127,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace accessapproval_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/accessapproval/v1/internal/access_approval_auth_decorator.h b/google/cloud/accessapproval/v1/internal/access_approval_auth_decorator.h index 952dedada86db..b770afec0bf3d 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_auth_decorator.h +++ b/google/cloud/accessapproval/v1/internal/access_approval_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accessapproval_v1_internal { @@ -101,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_V1_INTERNAL_ACCESS_APPROVAL_AUTH_DECORATOR_H diff --git a/google/cloud/accessapproval/v1/internal/access_approval_logging_decorator.cc b/google/cloud/accessapproval/v1/internal/access_approval_logging_decorator.cc index d71dd6539436e..ac21aa792d383 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_logging_decorator.cc +++ b/google/cloud/accessapproval/v1/internal/access_approval_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/accessapproval/v1/accessapproval.proto #include "google/cloud/accessapproval/v1/internal/access_approval_logging_decorator.h" +#include "google/cloud/accessapproval/v1/accessapproval.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accessapproval_v1_internal { @@ -166,3 +169,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace accessapproval_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/accessapproval/v1/internal/access_approval_logging_decorator.h b/google/cloud/accessapproval/v1/internal/access_approval_logging_decorator.h index b534adc2c32b6..2179ac9003549 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_logging_decorator.h +++ b/google/cloud/accessapproval/v1/internal/access_approval_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accessapproval_v1_internal { @@ -101,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_V1_INTERNAL_ACCESS_APPROVAL_LOGGING_DECORATOR_H diff --git a/google/cloud/accessapproval/v1/internal/access_approval_metadata_decorator.cc b/google/cloud/accessapproval/v1/internal/access_approval_metadata_decorator.cc index 9e73c7f2fc264..ce5f874cec6b9 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_metadata_decorator.cc +++ b/google/cloud/accessapproval/v1/internal/access_approval_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/accessapproval/v1/accessapproval.proto #include "google/cloud/accessapproval/v1/internal/access_approval_metadata_decorator.h" +#include "google/cloud/accessapproval/v1/accessapproval.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 accessapproval_v1_internal { @@ -151,3 +155,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace accessapproval_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/accessapproval/v1/internal/access_approval_metadata_decorator.h b/google/cloud/accessapproval/v1/internal/access_approval_metadata_decorator.h index 540fcf58f69cc..ed9674c6464b5 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_metadata_decorator.h +++ b/google/cloud/accessapproval/v1/internal/access_approval_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accessapproval_v1_internal { @@ -106,4 +109,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_V1_INTERNAL_ACCESS_APPROVAL_METADATA_DECORATOR_H diff --git a/google/cloud/accessapproval/v1/internal/access_approval_option_defaults.cc b/google/cloud/accessapproval/v1/internal/access_approval_option_defaults.cc index 88a064f8dc1db..10fb8e272aff2 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_option_defaults.cc +++ b/google/cloud/accessapproval/v1/internal/access_approval_option_defaults.cc @@ -42,7 +42,7 @@ Options AccessApprovalDefaultOptions(Options options) { if (!options.has()) { options.set( accessapproval_v1::AccessApprovalLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/accessapproval/v1/internal/access_approval_stub.cc b/google/cloud/accessapproval/v1/internal/access_approval_stub.cc index b7327fa7eb667..66d8d3a2dd37b 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_stub.cc +++ b/google/cloud/accessapproval/v1/internal/access_approval_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/accessapproval/v1/accessapproval.proto #include "google/cloud/accessapproval/v1/internal/access_approval_stub.h" +#include "google/cloud/accessapproval/v1/accessapproval.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accessapproval_v1_internal { @@ -157,3 +160,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace accessapproval_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/accessapproval/v1/internal/access_approval_stub.h b/google/cloud/accessapproval/v1/internal/access_approval_stub.h index dd1c7c09e6744..eb1700bef052b 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_stub.h +++ b/google/cloud/accessapproval/v1/internal/access_approval_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_V1_INTERNAL_ACCESS_APPROVAL_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_V1_INTERNAL_ACCESS_APPROVAL_STUB_H +#include "google/cloud/accessapproval/v1/accessapproval.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accessapproval_v1_internal { @@ -163,4 +166,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_V1_INTERNAL_ACCESS_APPROVAL_STUB_H diff --git a/google/cloud/accessapproval/v1/internal/access_approval_stub_factory.cc b/google/cloud/accessapproval/v1/internal/access_approval_stub_factory.cc index 590ed2cf44ba4..d2e9076024088 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_stub_factory.cc +++ b/google/cloud/accessapproval/v1/internal/access_approval_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/accessapproval/v1/accessapproval.proto #include "google/cloud/accessapproval/v1/internal/access_approval_stub_factory.h" +#include "google/cloud/accessapproval/v1/accessapproval.grpc.pb.h" #include "google/cloud/accessapproval/v1/internal/access_approval_auth_decorator.h" #include "google/cloud/accessapproval/v1/internal/access_approval_logging_decorator.h" #include "google/cloud/accessapproval/v1/internal/access_approval_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accessapproval_v1_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace accessapproval_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/accessapproval/v1/internal/access_approval_stub_factory.h b/google/cloud/accessapproval/v1/internal/access_approval_stub_factory.h index a41c33fddc628..73157c8c089de 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_stub_factory.h +++ b/google/cloud/accessapproval/v1/internal/access_approval_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accessapproval_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_V1_INTERNAL_ACCESS_APPROVAL_STUB_FACTORY_H diff --git a/google/cloud/accessapproval/v1/internal/access_approval_tracing_connection.cc b/google/cloud/accessapproval/v1/internal/access_approval_tracing_connection.cc index 63330e54258fe..8b535a3f8d0bf 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_tracing_connection.cc +++ b/google/cloud/accessapproval/v1/internal/access_approval_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace accessapproval_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AccessApprovalTracingConnection::AccessApprovalTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -130,16 +128,12 @@ AccessApprovalTracingConnection::GetAccessApprovalServiceAccount( child_->GetAccessApprovalServiceAccount(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAccessApprovalTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/accessapproval/v1/internal/access_approval_tracing_connection.h b/google/cloud/accessapproval/v1/internal/access_approval_tracing_connection.h index 66b59d3c6c08c..d406d7f02d799 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_tracing_connection.h +++ b/google/cloud/accessapproval/v1/internal/access_approval_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace accessapproval_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AccessApprovalTracingConnection : public accessapproval_v1::AccessApprovalConnection { public: @@ -88,8 +86,6 @@ class AccessApprovalTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/accessapproval/v1/internal/access_approval_tracing_stub.cc b/google/cloud/accessapproval/v1/internal/access_approval_tracing_stub.cc index 365332268e5cf..0bff843346db0 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_tracing_stub.cc +++ b/google/cloud/accessapproval/v1/internal/access_approval_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accessapproval_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AccessApprovalTracingStub::AccessApprovalTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -162,18 +163,14 @@ AccessApprovalTracingStub::GetAccessApprovalServiceAccount( child_->GetAccessApprovalServiceAccount(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAccessApprovalTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace accessapproval_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/accessapproval/v1/internal/access_approval_tracing_stub.h b/google/cloud/accessapproval/v1/internal/access_approval_tracing_stub.h index 64b307080c378..f678cafb8d935 100644 --- a/google/cloud/accessapproval/v1/internal/access_approval_tracing_stub.h +++ b/google/cloud/accessapproval/v1/internal/access_approval_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accessapproval_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AccessApprovalTracingStub : public AccessApprovalStub { public: ~AccessApprovalTracingStub() override = default; @@ -97,8 +98,6 @@ class AccessApprovalTracingStub : public AccessApprovalStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -113,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSAPPROVAL_V1_INTERNAL_ACCESS_APPROVAL_TRACING_STUB_H diff --git a/google/cloud/accesscontextmanager/BUILD.bazel b/google/cloud/accesscontextmanager/BUILD.bazel index 9970c6c24fbf3..7aa7362445cc5 100644 --- a/google/cloud/accesscontextmanager/BUILD.bazel +++ b/google/cloud/accesscontextmanager/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/identity/accesscontextmanager/v1:accesscontextmanager_cc_grpc", + "@googleapis//google/identity/accesscontextmanager/v1:accesscontextmanager_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/accesscontextmanager/CMakeLists.txt b/google/cloud/accesscontextmanager/CMakeLists.txt index ed4fb0ca0a228..50e28e53c7f87 100644 --- a/google/cloud/accesscontextmanager/CMakeLists.txt +++ b/google/cloud/accesscontextmanager/CMakeLists.txt @@ -17,8 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( - accesscontextmanager "Access Context Manager API" SERVICE_DIRS "__EMPTY__" - "v1/") + accesscontextmanager "Access Context Manager API" SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(accesscontextmanager_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/accesscontextmanager/access_context_manager_client.h b/google/cloud/accesscontextmanager/access_context_manager_client.h deleted file mode 100644 index 34d876ce7301f..0000000000000 --- a/google/cloud/accesscontextmanager/access_context_manager_client.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/identity/accesscontextmanager/v1/access_context_manager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_ACCESS_CONTEXT_MANAGER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_ACCESS_CONTEXT_MANAGER_CLIENT_H - -#include "google/cloud/accesscontextmanager/access_context_manager_connection.h" -#include "google/cloud/accesscontextmanager/v1/access_context_manager_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in accesscontextmanager_v1 instead of the aliases defined -/// in this namespace. -namespace accesscontextmanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use accesscontextmanager_v1::AccessContextManagerClient -/// directly. -using ::google::cloud::accesscontextmanager_v1::AccessContextManagerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace accesscontextmanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_ACCESS_CONTEXT_MANAGER_CLIENT_H diff --git a/google/cloud/accesscontextmanager/access_context_manager_connection.h b/google/cloud/accesscontextmanager/access_context_manager_connection.h deleted file mode 100644 index e4e857eaaf5f9..0000000000000 --- a/google/cloud/accesscontextmanager/access_context_manager_connection.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/identity/accesscontextmanager/v1/access_context_manager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_ACCESS_CONTEXT_MANAGER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_ACCESS_CONTEXT_MANAGER_CONNECTION_H - -#include "google/cloud/accesscontextmanager/access_context_manager_connection_idempotency_policy.h" -#include "google/cloud/accesscontextmanager/v1/access_context_manager_connection.h" - -namespace google { -namespace cloud { -namespace accesscontextmanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use accesscontextmanager_v1::MakeAccessContextManagerConnection -/// directly. -using ::google::cloud::accesscontextmanager_v1:: - MakeAccessContextManagerConnection; - -/// @deprecated Use accesscontextmanager_v1::AccessContextManagerConnection -/// directly. -using ::google::cloud::accesscontextmanager_v1::AccessContextManagerConnection; - -/// @deprecated Use -/// accesscontextmanager_v1::AccessContextManagerLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::accesscontextmanager_v1:: - AccessContextManagerLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// accesscontextmanager_v1::AccessContextManagerLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::accesscontextmanager_v1:: - AccessContextManagerLimitedTimeRetryPolicy; - -/// @deprecated Use accesscontextmanager_v1::AccessContextManagerRetryPolicy -/// directly. -using ::google::cloud::accesscontextmanager_v1::AccessContextManagerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace accesscontextmanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_ACCESS_CONTEXT_MANAGER_CONNECTION_H diff --git a/google/cloud/accesscontextmanager/access_context_manager_connection_idempotency_policy.h b/google/cloud/accesscontextmanager/access_context_manager_connection_idempotency_policy.h deleted file mode 100644 index 537c22d95d5d6..0000000000000 --- a/google/cloud/accesscontextmanager/access_context_manager_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/identity/accesscontextmanager/v1/access_context_manager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_ACCESS_CONTEXT_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_ACCESS_CONTEXT_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/accesscontextmanager/v1/access_context_manager_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace accesscontextmanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// accesscontextmanager_v1::MakeDefaultAccessContextManagerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::accesscontextmanager_v1:: - MakeDefaultAccessContextManagerConnectionIdempotencyPolicy; - -/// @deprecated Use -/// accesscontextmanager_v1::AccessContextManagerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::accesscontextmanager_v1:: - AccessContextManagerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace accesscontextmanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_ACCESS_CONTEXT_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/accesscontextmanager/access_context_manager_options.h b/google/cloud/accesscontextmanager/access_context_manager_options.h deleted file mode 100644 index ce05c2fc804c2..0000000000000 --- a/google/cloud/accesscontextmanager/access_context_manager_options.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/identity/accesscontextmanager/v1/access_context_manager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_ACCESS_CONTEXT_MANAGER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_ACCESS_CONTEXT_MANAGER_OPTIONS_H - -#include "google/cloud/accesscontextmanager/access_context_manager_connection.h" -#include "google/cloud/accesscontextmanager/access_context_manager_connection_idempotency_policy.h" -#include "google/cloud/accesscontextmanager/v1/access_context_manager_options.h" - -namespace google { -namespace cloud { -namespace accesscontextmanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// accesscontextmanager_v1::AccessContextManagerPollingPolicyOption directly. -using ::google::cloud::accesscontextmanager_v1:: - AccessContextManagerPollingPolicyOption; - -/// @deprecated Use -/// accesscontextmanager_v1::AccessContextManagerBackoffPolicyOption directly. -using ::google::cloud::accesscontextmanager_v1:: - AccessContextManagerBackoffPolicyOption; - -/// @deprecated Use -/// accesscontextmanager_v1::AccessContextManagerConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::accesscontextmanager_v1:: - AccessContextManagerConnectionIdempotencyPolicyOption; - -/// @deprecated Use -/// accesscontextmanager_v1::AccessContextManagerPolicyOptionList directly. -using ::google::cloud::accesscontextmanager_v1:: - AccessContextManagerPolicyOptionList; - -/// @deprecated Use -/// accesscontextmanager_v1::AccessContextManagerRetryPolicyOption directly. -using ::google::cloud::accesscontextmanager_v1:: - AccessContextManagerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace accesscontextmanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_ACCESS_CONTEXT_MANAGER_OPTIONS_H diff --git a/google/cloud/accesscontextmanager/mocks/mock_access_context_manager_connection.h b/google/cloud/accesscontextmanager/mocks/mock_access_context_manager_connection.h deleted file mode 100644 index 1d1b70fbf3f64..0000000000000 --- a/google/cloud/accesscontextmanager/mocks/mock_access_context_manager_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/identity/accesscontextmanager/v1/access_context_manager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_MOCKS_MOCK_ACCESS_CONTEXT_MANAGER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_MOCKS_MOCK_ACCESS_CONTEXT_MANAGER_CONNECTION_H - -#include "google/cloud/accesscontextmanager/access_context_manager_connection.h" -#include "google/cloud/accesscontextmanager/v1/mocks/mock_access_context_manager_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in accesscontextmanager_v1_mocks instead of the aliases -/// defined in this namespace. -namespace accesscontextmanager_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// accesscontextmanager_v1_mocks::MockAccessContextManagerConnection directly. -using ::google::cloud::accesscontextmanager_v1_mocks:: - MockAccessContextManagerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace accesscontextmanager_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_MOCKS_MOCK_ACCESS_CONTEXT_MANAGER_CONNECTION_H diff --git a/google/cloud/accesscontextmanager/quickstart/.bazelrc b/google/cloud/accesscontextmanager/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/accesscontextmanager/quickstart/.bazelrc +++ b/google/cloud/accesscontextmanager/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/accesscontextmanager/quickstart/CMakeLists.txt index 8ae77adaeea1d..fd63ac9813095 100644 --- a/google/cloud/accesscontextmanager/quickstart/CMakeLists.txt +++ b/google/cloud/accesscontextmanager/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Access Context Manager API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-accesscontextmanager-quickstart CXX) find_package(google_cloud_cpp_accesscontextmanager REQUIRED) diff --git a/google/cloud/accesscontextmanager/quickstart/WORKSPACE.bazel b/google/cloud/accesscontextmanager/quickstart/WORKSPACE.bazel index 346df9ac066eb..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 = "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/accesscontextmanager/v1/access_context_manager_client.h b/google/cloud/accesscontextmanager/v1/access_context_manager_client.h index 9dc0e0fa65f3b..4bbe028367b23 100644 --- a/google/cloud/accesscontextmanager/v1/access_context_manager_client.h +++ b/google/cloud/accesscontextmanager/v1/access_context_manager_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/accesscontextmanager/v1/access_context_manager_connection.h b/google/cloud/accesscontextmanager/v1/access_context_manager_connection.h index d086f006f60e9..99ee60ec71b24 100644 --- a/google/cloud/accesscontextmanager/v1/access_context_manager_connection.h +++ b/google/cloud/accesscontextmanager/v1/access_context_manager_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/identity/accesscontextmanager/v1/access_context_manager.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/accesscontextmanager/v1/access_context_manager_connection_idempotency_policy.h b/google/cloud/accesscontextmanager/v1/access_context_manager_connection_idempotency_policy.h index 0eb739ac779b5..0b78cc9623285 100644 --- a/google/cloud/accesscontextmanager/v1/access_context_manager_connection_idempotency_policy.h +++ b/google/cloud/accesscontextmanager/v1/access_context_manager_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/identity/accesscontextmanager/v1/access_context_manager.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_auth_decorator.cc b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_auth_decorator.cc index dc864544f7a97..93677a66122f9 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_auth_decorator.cc +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/identity/accesscontextmanager/v1/access_context_manager.proto #include "google/cloud/accesscontextmanager/v1/internal/access_context_manager_auth_decorator.h" -#include +#include "google/identity/accesscontextmanager/v1/access_context_manager.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accesscontextmanager_v1_internal { @@ -649,3 +652,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace accesscontextmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_auth_decorator.h b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_auth_decorator.h index efde008bcff0c..3d21e7e9960fa 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_auth_decorator.h +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 accesscontextmanager_v1_internal { @@ -310,4 +313,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_V1_INTERNAL_ACCESS_CONTEXT_MANAGER_AUTH_DECORATOR_H diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_connection_impl.h b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_connection_impl.h index f3ca0294e700f..3bf72214b08fe 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_connection_impl.h +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_logging_decorator.cc b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_logging_decorator.cc index 3db37e0e4e9dd..91642147b154d 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_logging_decorator.cc +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/accesscontextmanager/v1/internal/access_context_manager_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/identity/accesscontextmanager/v1/access_context_manager.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accesscontextmanager_v1_internal { @@ -742,3 +745,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace accesscontextmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_logging_decorator.h b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_logging_decorator.h index 8e68588e6df28..80389128a6e41 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_logging_decorator.h +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 accesscontextmanager_v1_internal { @@ -310,4 +313,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_V1_INTERNAL_ACCESS_CONTEXT_MANAGER_LOGGING_DECORATOR_H diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_metadata_decorator.cc b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_metadata_decorator.cc index 2a22436194ac8..bd5d94085adb7 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_metadata_decorator.cc +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/accesscontextmanager/v1/internal/access_context_manager_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/identity/accesscontextmanager/v1/access_context_manager.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accesscontextmanager_v1_internal { @@ -555,3 +559,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace accesscontextmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_metadata_decorator.h b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_metadata_decorator.h index f994cd011d061..e17214f952937 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_metadata_decorator.h +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 accesscontextmanager_v1_internal { @@ -316,4 +319,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_V1_INTERNAL_ACCESS_CONTEXT_MANAGER_METADATA_DECORATOR_H diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_option_defaults.cc b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_option_defaults.cc index f2cafebd699d0..367675a81b8e9 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_option_defaults.cc +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_option_defaults.cc @@ -43,7 +43,7 @@ Options AccessContextManagerDefaultOptions(Options options) { accesscontextmanager_v1::AccessContextManagerRetryPolicyOption>()) { options.set( accesscontextmanager_v1::AccessContextManagerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub.cc b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub.cc index de9ae931f53ea..197e1a74f31f5 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub.cc +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/identity/accesscontextmanager/v1/access_context_manager.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 accesscontextmanager_v1_internal { @@ -735,3 +738,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace accesscontextmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub.h b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub.h index 8201a17b445d6..12ec2c6901f37 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub.h +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/identity/accesscontextmanager/v1/access_context_manager.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 accesscontextmanager_v1_internal { @@ -592,4 +595,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_V1_INTERNAL_ACCESS_CONTEXT_MANAGER_STUB_H diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub_factory.cc b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub_factory.cc index a9804819762d4..cf72f09fe0d93 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub_factory.cc +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/identity/accesscontextmanager/v1/access_context_manager.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 accesscontextmanager_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace accesscontextmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub_factory.h b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub_factory.h index ededefed4ce26..0cd7c2b9204f0 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub_factory.h +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accesscontextmanager_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_V1_INTERNAL_ACCESS_CONTEXT_MANAGER_STUB_FACTORY_H diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_connection.cc b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_connection.cc index f5235aea2932f..3c262886e27a1 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_connection.cc +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace accesscontextmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AccessContextManagerTracingConnection::AccessContextManagerTracingConnection( std::shared_ptr child) @@ -715,18 +713,14 @@ AccessContextManagerTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAccessContextManagerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_connection.h b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_connection.h index 1145661c6db1a..63b5c965a193a 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_connection.h +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace accesscontextmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AccessContextManagerTracingConnection : public accesscontextmanager_v1::AccessContextManagerConnection { public: @@ -301,8 +299,6 @@ class AccessContextManagerTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_stub.cc b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_stub.cc index 84fdea8249754..041ac9a51e601 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_stub.cc +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accesscontextmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AccessContextManagerTracingStub::AccessContextManagerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -697,18 +698,14 @@ future AccessContextManagerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAccessContextManagerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace accesscontextmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_stub.h b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_stub.h index 02c1e1c5aed72..1a3bf60203013 100644 --- a/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_stub.h +++ b/google/cloud/accesscontextmanager/v1/internal/access_context_manager_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace accesscontextmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AccessContextManagerTracingStub : public AccessContextManagerStub { public: ~AccessContextManagerTracingStub() override = default; @@ -306,8 +307,6 @@ class AccessContextManagerTracingStub : public AccessContextManagerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -322,4 +321,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ACCESSCONTEXTMANAGER_V1_INTERNAL_ACCESS_CONTEXT_MANAGER_TRACING_STUB_H diff --git a/google/cloud/advisorynotifications/BUILD.bazel b/google/cloud/advisorynotifications/BUILD.bazel index f7ac0e5cce0a3..c8b02f28eac04 100644 --- a/google/cloud/advisorynotifications/BUILD.bazel +++ b/google/cloud/advisorynotifications/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/advisorynotifications/v1:advisorynotifications_cc_grpc", + "@googleapis//google/cloud/advisorynotifications/v1:advisorynotifications_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/advisorynotifications/quickstart/.bazelrc b/google/cloud/advisorynotifications/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/advisorynotifications/quickstart/.bazelrc +++ b/google/cloud/advisorynotifications/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/advisorynotifications/quickstart/CMakeLists.txt index bff831625ae52..ab6388f6a9e72 100644 --- a/google/cloud/advisorynotifications/quickstart/CMakeLists.txt +++ b/google/cloud/advisorynotifications/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Advisory Notifications API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-advisorynotifications-quickstart CXX) find_package(google_cloud_cpp_advisorynotifications REQUIRED) diff --git a/google/cloud/advisorynotifications/quickstart/WORKSPACE.bazel b/google/cloud/advisorynotifications/quickstart/WORKSPACE.bazel index 4325c602c8771..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 = "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/advisorynotifications/v1/advisory_notifications_connection.h b/google/cloud/advisorynotifications/v1/advisory_notifications_connection.h index cfb32f9b0ddc7..c801bcb2313ff 100644 --- a/google/cloud/advisorynotifications/v1/advisory_notifications_connection.h +++ b/google/cloud/advisorynotifications/v1/advisory_notifications_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/advisorynotifications/v1/advisory_notifications_connection_idempotency_policy.h" #include "google/cloud/advisorynotifications/v1/internal/advisory_notifications_retry_traits.h" +#include "google/cloud/advisorynotifications/v1/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 #include namespace google { diff --git a/google/cloud/advisorynotifications/v1/advisory_notifications_connection_idempotency_policy.h b/google/cloud/advisorynotifications/v1/advisory_notifications_connection_idempotency_policy.h index e2a718e43847b..de901aea7f4f3 100644 --- a/google/cloud/advisorynotifications/v1/advisory_notifications_connection_idempotency_policy.h +++ b/google/cloud/advisorynotifications/v1/advisory_notifications_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ADVISORYNOTIFICATIONS_V1_ADVISORY_NOTIFICATIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ADVISORYNOTIFICATIONS_V1_ADVISORY_NOTIFICATIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/advisorynotifications/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_auth_decorator.cc b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_auth_decorator.cc index 9900c4e0df921..d3aca52f5ffaa 100644 --- a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_auth_decorator.cc +++ b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/advisorynotifications/v1/service.proto #include "google/cloud/advisorynotifications/v1/internal/advisory_notifications_auth_decorator.h" -#include +#include "google/cloud/advisorynotifications/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace advisorynotifications_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace advisorynotifications_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_auth_decorator.h b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_auth_decorator.h index 42cbad9890c79..918d9cbad3590 100644 --- a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_auth_decorator.h +++ b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace advisorynotifications_v1_internal { @@ -71,4 +74,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ADVISORYNOTIFICATIONS_V1_INTERNAL_ADVISORY_NOTIFICATIONS_AUTH_DECORATOR_H diff --git a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_logging_decorator.cc b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_logging_decorator.cc index 87d040cef97f5..530e730a883ce 100644 --- a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_logging_decorator.cc +++ b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/advisorynotifications/v1/service.proto #include "google/cloud/advisorynotifications/v1/internal/advisory_notifications_logging_decorator.h" +#include "google/cloud/advisorynotifications/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace advisorynotifications_v1_internal { @@ -96,3 +99,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace advisorynotifications_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_logging_decorator.h b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_logging_decorator.h index 940ded5f00198..aa48046e72a7a 100644 --- a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_logging_decorator.h +++ b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace advisorynotifications_v1_internal { @@ -71,4 +74,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ADVISORYNOTIFICATIONS_V1_INTERNAL_ADVISORY_NOTIFICATIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_metadata_decorator.cc b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_metadata_decorator.cc index 451308c1395be..4c5af9c923203 100644 --- a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_metadata_decorator.cc +++ b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/advisorynotifications/v1/service.proto #include "google/cloud/advisorynotifications/v1/internal/advisory_notifications_metadata_decorator.h" +#include "google/cloud/advisorynotifications/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 advisorynotifications_v1_internal { @@ -102,3 +106,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace advisorynotifications_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_metadata_decorator.h b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_metadata_decorator.h index 254e2d24d4be6..4f42f0f3b17ea 100644 --- a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_metadata_decorator.h +++ b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace advisorynotifications_v1_internal { @@ -77,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ADVISORYNOTIFICATIONS_V1_INTERNAL_ADVISORY_NOTIFICATIONS_METADATA_DECORATOR_H diff --git a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_option_defaults.cc b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_option_defaults.cc index 4dd1fee0e0acd..5127147e20306 100644 --- a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_option_defaults.cc +++ b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_option_defaults.cc @@ -46,7 +46,7 @@ Options AdvisoryNotificationsServiceDefaultOptions(Options options) { AdvisoryNotificationsServiceRetryPolicyOption>( advisorynotifications_v1:: AdvisoryNotificationsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace advisorynotifications_v1_internal { @@ -86,3 +89,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace advisorynotifications_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_stub.h b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_stub.h index a4a34d3fe79ec..34f33a061f495 100644 --- a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_stub.h +++ b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ADVISORYNOTIFICATIONS_V1_INTERNAL_ADVISORY_NOTIFICATIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ADVISORYNOTIFICATIONS_V1_INTERNAL_ADVISORY_NOTIFICATIONS_STUB_H +#include "google/cloud/advisorynotifications/v1/service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace advisorynotifications_v1_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ADVISORYNOTIFICATIONS_V1_INTERNAL_ADVISORY_NOTIFICATIONS_STUB_H diff --git a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_stub_factory.cc b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_stub_factory.cc index 8b5e381768696..2bfa5eec051e3 100644 --- a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_stub_factory.cc +++ b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/advisorynotifications/v1/internal/advisory_notifications_metadata_decorator.h" #include "google/cloud/advisorynotifications/v1/internal/advisory_notifications_stub.h" #include "google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_stub.h" +#include "google/cloud/advisorynotifications/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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace advisorynotifications_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace advisorynotifications_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_stub_factory.h b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_stub_factory.h index 003e7e4dd7fb9..9532e445f99b9 100644 --- a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_stub_factory.h +++ b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace advisorynotifications_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ADVISORYNOTIFICATIONS_V1_INTERNAL_ADVISORY_NOTIFICATIONS_STUB_FACTORY_H diff --git a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_connection.cc b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_connection.cc index 39fabc0f29c26..ed70ea41287b1 100644 --- a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_connection.cc +++ b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace advisorynotifications_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AdvisoryNotificationsServiceTracingConnection:: AdvisoryNotificationsServiceTracingConnection( std::shared_ptr< @@ -83,20 +81,16 @@ AdvisoryNotificationsServiceTracingConnection::UpdateSettings( return internal::EndSpan(*span, child_->UpdateSettings(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< advisorynotifications_v1::AdvisoryNotificationsServiceConnection> MakeAdvisoryNotificationsServiceTracingConnection( std::shared_ptr< advisorynotifications_v1::AdvisoryNotificationsServiceConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_connection.h b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_connection.h index ac4fda5815d1a..e8da64991bf1d 100644 --- a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_connection.h +++ b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace advisorynotifications_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AdvisoryNotificationsServiceTracingConnection : public advisorynotifications_v1::AdvisoryNotificationsServiceConnection { public: @@ -66,8 +64,6 @@ class AdvisoryNotificationsServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_stub.cc b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_stub.cc index 98aa7c2bd0d7e..377fdb3d7ff55 100644 --- a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_stub.cc +++ b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace advisorynotifications_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AdvisoryNotificationsServiceTracingStub:: AdvisoryNotificationsServiceTracingStub( std::shared_ptr child) @@ -89,20 +90,16 @@ AdvisoryNotificationsServiceTracingStub::UpdateSettings( child_->UpdateSettings(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAdvisoryNotificationsServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace advisorynotifications_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_stub.h b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_stub.h index 01a7bb7e41ccd..872b95d8778bc 100644 --- a/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_stub.h +++ b/google/cloud/advisorynotifications/v1/internal/advisory_notifications_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace advisorynotifications_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AdvisoryNotificationsServiceTracingStub : public AdvisoryNotificationsServiceStub { public: @@ -68,8 +69,6 @@ class AdvisoryNotificationsServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -85,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ADVISORYNOTIFICATIONS_V1_INTERNAL_ADVISORY_NOTIFICATIONS_TRACING_STUB_H diff --git a/google/cloud/aiplatform/BUILD.bazel b/google/cloud/aiplatform/BUILD.bazel index 3a32819257484..b67fb44afc2f2 100644 --- a/google/cloud/aiplatform/BUILD.bazel +++ b/google/cloud/aiplatform/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/aiplatform/v1:aiplatform_cc_grpc", + "@googleapis//google/cloud/aiplatform/v1:aiplatform_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/aiplatform/quickstart/.bazelrc b/google/cloud/aiplatform/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/aiplatform/quickstart/.bazelrc +++ b/google/cloud/aiplatform/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/aiplatform/quickstart/CMakeLists.txt index 9c86a6be9adb1..7b22a138fc6af 100644 --- a/google/cloud/aiplatform/quickstart/CMakeLists.txt +++ b/google/cloud/aiplatform/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Vertex AI API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-aiplatform-quickstart CXX) find_package(google_cloud_cpp_aiplatform REQUIRED) diff --git a/google/cloud/aiplatform/quickstart/WORKSPACE.bazel b/google/cloud/aiplatform/quickstart/WORKSPACE.bazel index 592cd3828c594..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 = "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/aiplatform/v1/dataset_client.h b/google/cloud/aiplatform/v1/dataset_client.h index eb70c8665ef60..67a882e06e603 100644 --- a/google/cloud/aiplatform/v1/dataset_client.h +++ b/google/cloud/aiplatform/v1/dataset_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -115,7 +115,7 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.CreateDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L276} + /// [google.cloud.aiplatform.v1.CreateDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L274} /// [google.cloud.aiplatform.v1.Dataset]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset.proto#L36} /// // clang-format on @@ -168,7 +168,7 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.CreateDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L276} + /// [google.cloud.aiplatform.v1.CreateDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L274} /// [google.cloud.aiplatform.v1.Dataset]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset.proto#L36} /// // clang-format on @@ -223,7 +223,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.Dataset]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset.proto#L36} - /// [google.cloud.aiplatform.v1.GetDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L300} + /// [google.cloud.aiplatform.v1.GetDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L297} /// // clang-format on StatusOr GetDataset( @@ -253,7 +253,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.Dataset]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset.proto#L36} - /// [google.cloud.aiplatform.v1.GetDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L300} + /// [google.cloud.aiplatform.v1.GetDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L297} /// // clang-format on StatusOr GetDataset( @@ -286,7 +286,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.Dataset]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset.proto#L36} - /// [google.cloud.aiplatform.v1.UpdateDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L315} + /// [google.cloud.aiplatform.v1.UpdateDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L312} /// [google.protobuf.FieldMask]: @googleapis_reference_link{google/protobuf/field_mask.proto#L242} /// // clang-format on @@ -318,7 +318,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.Dataset]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset.proto#L36} - /// [google.cloud.aiplatform.v1.UpdateDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L315} + /// [google.cloud.aiplatform.v1.UpdateDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L312} /// // clang-format on StatusOr UpdateDataset( @@ -354,7 +354,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.Dataset]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset.proto#L36} - /// [google.cloud.aiplatform.v1.ListDatasetsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L347} + /// [google.cloud.aiplatform.v1.ListDatasetsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L344} /// // clang-format on StreamRange ListDatasets( @@ -393,7 +393,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.Dataset]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset.proto#L36} - /// [google.cloud.aiplatform.v1.ListDatasetsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L347} + /// [google.cloud.aiplatform.v1.ListDatasetsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L344} /// // clang-format on StreamRange ListDatasets( @@ -427,7 +427,7 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.DeleteDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L404} + /// [google.cloud.aiplatform.v1.DeleteDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L401} /// [google.cloud.aiplatform.v1.DeleteOperationMetadata]: @googleapis_reference_link{google/cloud/aiplatform/v1/operation.proto#L52} /// // clang-format on @@ -478,7 +478,7 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.DeleteDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L404} + /// [google.cloud.aiplatform.v1.DeleteDatasetRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L401} /// [google.cloud.aiplatform.v1.DeleteOperationMetadata]: @googleapis_reference_link{google/cloud/aiplatform/v1/operation.proto#L52} /// // clang-format on @@ -545,8 +545,8 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.ImportDataRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L418} - /// [google.cloud.aiplatform.v1.ImportDataResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L437} + /// [google.cloud.aiplatform.v1.ImportDataRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L415} + /// [google.cloud.aiplatform.v1.ImportDataResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L434} /// // clang-format on future> @@ -602,8 +602,8 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.ImportDataRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L418} - /// [google.cloud.aiplatform.v1.ImportDataResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L437} + /// [google.cloud.aiplatform.v1.ImportDataRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L415} + /// [google.cloud.aiplatform.v1.ImportDataResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L434} /// // clang-format on future> @@ -667,8 +667,8 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.ExportDataRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L448} - /// [google.cloud.aiplatform.v1.ExportDataResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L465} + /// [google.cloud.aiplatform.v1.ExportDataRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L445} + /// [google.cloud.aiplatform.v1.ExportDataResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L462} /// // clang-format on future> @@ -723,8 +723,8 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.ExportDataRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L448} - /// [google.cloud.aiplatform.v1.ExportDataResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L465} + /// [google.cloud.aiplatform.v1.ExportDataRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L445} + /// [google.cloud.aiplatform.v1.ExportDataResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L462} /// // clang-format on future> @@ -790,7 +790,7 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.CreateDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L491} + /// [google.cloud.aiplatform.v1.CreateDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L488} /// [google.cloud.aiplatform.v1.DatasetVersion]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_version.proto#L33} /// // clang-format on @@ -846,7 +846,7 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.CreateDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L491} + /// [google.cloud.aiplatform.v1.CreateDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L488} /// [google.cloud.aiplatform.v1.DatasetVersion]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_version.proto#L33} /// // clang-format on @@ -908,7 +908,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.DatasetVersion]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_version.proto#L33} - /// [google.cloud.aiplatform.v1.UpdateDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L332} + /// [google.cloud.aiplatform.v1.UpdateDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L329} /// [google.protobuf.FieldMask]: @googleapis_reference_link{google/protobuf/field_mask.proto#L242} /// // clang-format on @@ -940,7 +940,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.DatasetVersion]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_version.proto#L33} - /// [google.cloud.aiplatform.v1.UpdateDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L332} + /// [google.cloud.aiplatform.v1.UpdateDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L329} /// // clang-format on StatusOr UpdateDatasetVersion( @@ -974,7 +974,7 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.DeleteDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L517} + /// [google.cloud.aiplatform.v1.DeleteDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L514} /// [google.cloud.aiplatform.v1.DeleteOperationMetadata]: @googleapis_reference_link{google/cloud/aiplatform/v1/operation.proto#L52} /// // clang-format on @@ -1025,7 +1025,7 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.DeleteDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L517} + /// [google.cloud.aiplatform.v1.DeleteDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L514} /// [google.cloud.aiplatform.v1.DeleteOperationMetadata]: @googleapis_reference_link{google/cloud/aiplatform/v1/operation.proto#L52} /// // clang-format on @@ -1084,7 +1084,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.DatasetVersion]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_version.proto#L33} - /// [google.cloud.aiplatform.v1.GetDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L532} + /// [google.cloud.aiplatform.v1.GetDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L528} /// // clang-format on StatusOr GetDatasetVersion( @@ -1114,7 +1114,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.DatasetVersion]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_version.proto#L33} - /// [google.cloud.aiplatform.v1.GetDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L532} + /// [google.cloud.aiplatform.v1.GetDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L528} /// // clang-format on StatusOr GetDatasetVersion( @@ -1151,7 +1151,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.DatasetVersion]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_version.proto#L33} - /// [google.cloud.aiplatform.v1.ListDatasetVersionsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L549} + /// [google.cloud.aiplatform.v1.ListDatasetVersionsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L545} /// // clang-format on StreamRange @@ -1190,7 +1190,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.DatasetVersion]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_version.proto#L33} - /// [google.cloud.aiplatform.v1.ListDatasetVersionsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L549} + /// [google.cloud.aiplatform.v1.ListDatasetVersionsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L545} /// // clang-format on StreamRange @@ -1226,7 +1226,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.DatasetVersion]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_version.proto#L33} - /// [google.cloud.aiplatform.v1.RestoreDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L590} + /// [google.cloud.aiplatform.v1.RestoreDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L586} /// // clang-format on future> @@ -1277,7 +1277,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.DatasetVersion]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_version.proto#L33} - /// [google.cloud.aiplatform.v1.RestoreDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L590} + /// [google.cloud.aiplatform.v1.RestoreDatasetVersionRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L586} /// // clang-format on future> @@ -1346,7 +1346,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.DataItem]: @googleapis_reference_link{google/cloud/aiplatform/v1/data_item.proto#L34} - /// [google.cloud.aiplatform.v1.ListDataItemsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L611} + /// [google.cloud.aiplatform.v1.ListDataItemsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L607} /// // clang-format on StreamRange ListDataItems( @@ -1385,7 +1385,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.DataItem]: @googleapis_reference_link{google/cloud/aiplatform/v1/data_item.proto#L34} - /// [google.cloud.aiplatform.v1.ListDataItemsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L611} + /// [google.cloud.aiplatform.v1.ListDataItemsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L607} /// // clang-format on StreamRange ListDataItems( @@ -1424,8 +1424,8 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.DataItemView]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L767} - /// [google.cloud.aiplatform.v1.SearchDataItemsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L651} + /// [google.cloud.aiplatform.v1.DataItemView]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L763} + /// [google.cloud.aiplatform.v1.SearchDataItemsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L647} /// // clang-format on StreamRange SearchDataItems( @@ -1461,7 +1461,7 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.ListSavedQueriesRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L787} + /// [google.cloud.aiplatform.v1.ListSavedQueriesRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L783} /// [google.cloud.aiplatform.v1.SavedQuery]: @googleapis_reference_link{google/cloud/aiplatform/v1/saved_query.proto#L34} /// // clang-format on @@ -1500,7 +1500,7 @@ class DatasetServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.ListSavedQueriesRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L787} + /// [google.cloud.aiplatform.v1.ListSavedQueriesRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L783} /// [google.cloud.aiplatform.v1.SavedQuery]: @googleapis_reference_link{google/cloud/aiplatform/v1/saved_query.proto#L34} /// // clang-format on @@ -1536,7 +1536,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.DeleteOperationMetadata]: @googleapis_reference_link{google/cloud/aiplatform/v1/operation.proto#L52} - /// [google.cloud.aiplatform.v1.DeleteSavedQueryRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L827} + /// [google.cloud.aiplatform.v1.DeleteSavedQueryRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L823} /// // clang-format on future> @@ -1587,7 +1587,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.DeleteOperationMetadata]: @googleapis_reference_link{google/cloud/aiplatform/v1/operation.proto#L52} - /// [google.cloud.aiplatform.v1.DeleteSavedQueryRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L827} + /// [google.cloud.aiplatform.v1.DeleteSavedQueryRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L823} /// // clang-format on future> @@ -1645,7 +1645,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.AnnotationSpec]: @googleapis_reference_link{google/cloud/aiplatform/v1/annotation_spec.proto#L32} - /// [google.cloud.aiplatform.v1.GetAnnotationSpecRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L841} + /// [google.cloud.aiplatform.v1.GetAnnotationSpecRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L837} /// // clang-format on StatusOr GetAnnotationSpec( @@ -1675,7 +1675,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.AnnotationSpec]: @googleapis_reference_link{google/cloud/aiplatform/v1/annotation_spec.proto#L32} - /// [google.cloud.aiplatform.v1.GetAnnotationSpecRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L841} + /// [google.cloud.aiplatform.v1.GetAnnotationSpecRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L837} /// // clang-format on StatusOr GetAnnotationSpec( @@ -1684,9 +1684,7 @@ class DatasetServiceClient { // clang-format off /// - /// Lists Annotations belongs to a dataitem - /// This RPC is only available in InternalDatasetService. It is only used for - /// exporting conversation data to CCAI Insights. + /// Lists Annotations belongs to a dataitem. /// /// @param parent Required. The resource name of the DataItem to list Annotations from. /// Format: @@ -1714,7 +1712,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.Annotation]: @googleapis_reference_link{google/cloud/aiplatform/v1/annotation.proto#L35} - /// [google.cloud.aiplatform.v1.ListAnnotationsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L858} + /// [google.cloud.aiplatform.v1.ListAnnotationsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L854} /// // clang-format on StreamRange ListAnnotations( @@ -1722,9 +1720,7 @@ class DatasetServiceClient { // clang-format off /// - /// Lists Annotations belongs to a dataitem - /// This RPC is only available in InternalDatasetService. It is only used for - /// exporting conversation data to CCAI Insights. + /// Lists Annotations belongs to a dataitem. /// /// @param request Unary RPCs, such as the one wrapped by this /// function, receive a single `request` proto message which includes all @@ -1755,7 +1751,7 @@ class DatasetServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.Annotation]: @googleapis_reference_link{google/cloud/aiplatform/v1/annotation.proto#L35} - /// [google.cloud.aiplatform.v1.ListAnnotationsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L858} + /// [google.cloud.aiplatform.v1.ListAnnotationsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/dataset_service.proto#L854} /// // clang-format on StreamRange ListAnnotations( @@ -2154,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 = {}); @@ -2193,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/dataset_connection.h b/google/cloud/aiplatform/v1/dataset_connection.h index 6607415688baf..cadfd2451138a 100644 --- a/google/cloud/aiplatform/v1/dataset_connection.h +++ b/google/cloud/aiplatform/v1/dataset_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_DATASET_CONNECTION_H #include "google/cloud/aiplatform/v1/dataset_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/dataset_service.pb.h" #include "google/cloud/aiplatform/v1/internal/dataset_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/dataset_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/dataset_connection_idempotency_policy.h index 3f5f321d02bc0..3ddfbbfada5b1 100644 --- a/google/cloud/aiplatform/v1/dataset_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/dataset_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_DATASET_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_DATASET_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/dataset_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/deployment_resource_pool_client.h b/google/cloud/aiplatform/v1/deployment_resource_pool_client.h index ad1b03a170283..8f20261089b47 100644 --- a/google/cloud/aiplatform/v1/deployment_resource_pool_client.h +++ b/google/cloud/aiplatform/v1/deployment_resource_pool_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/deployment_resource_pool_connection.h b/google/cloud/aiplatform/v1/deployment_resource_pool_connection.h index eaa455f09821b..6d858b4f71239 100644 --- a/google/cloud/aiplatform/v1/deployment_resource_pool_connection.h +++ b/google/cloud/aiplatform/v1/deployment_resource_pool_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_DEPLOYMENT_RESOURCE_POOL_CONNECTION_H #include "google/cloud/aiplatform/v1/deployment_resource_pool_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/deployment_resource_pool_service.pb.h" #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/deployment_resource_pool_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/deployment_resource_pool_connection_idempotency_policy.h index b82c38b14afd8..b5fd956d3abbc 100644 --- a/google/cloud/aiplatform/v1/deployment_resource_pool_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/deployment_resource_pool_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_DEPLOYMENT_RESOURCE_POOL_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_DEPLOYMENT_RESOURCE_POOL_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/deployment_resource_pool_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/endpoint_client.h b/google/cloud/aiplatform/v1/endpoint_client.h index 3dd6d64eefd63..19af63e98f3e3 100644 --- a/google/cloud/aiplatform/v1/endpoint_client.h +++ b/google/cloud/aiplatform/v1/endpoint_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/endpoint_connection.h b/google/cloud/aiplatform/v1/endpoint_connection.h index d5bb5c906ddf0..619565af19b12 100644 --- a/google/cloud/aiplatform/v1/endpoint_connection.h +++ b/google/cloud/aiplatform/v1/endpoint_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_ENDPOINT_CONNECTION_H #include "google/cloud/aiplatform/v1/endpoint_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/endpoint_service.pb.h" #include "google/cloud/aiplatform/v1/internal/endpoint_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/endpoint_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/endpoint_connection_idempotency_policy.h index d743a9be23753..2b9539cb02d2d 100644 --- a/google/cloud/aiplatform/v1/endpoint_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/endpoint_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_ENDPOINT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_ENDPOINT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/endpoint_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/evaluation_connection.h b/google/cloud/aiplatform/v1/evaluation_connection.h index 776ef4d0ca989..2930dc5f9e15b 100644 --- a/google/cloud/aiplatform/v1/evaluation_connection.h +++ b/google/cloud/aiplatform/v1/evaluation_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_EVALUATION_CONNECTION_H #include "google/cloud/aiplatform/v1/evaluation_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/evaluation_service.pb.h" #include "google/cloud/aiplatform/v1/internal/evaluation_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/aiplatform/v1/evaluation_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/evaluation_connection_idempotency_policy.h index 25f5b5f3c58d6..32421e1f33adb 100644 --- a/google/cloud/aiplatform/v1/evaluation_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/evaluation_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_EVALUATION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_EVALUATION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/evaluation_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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 45c419a304b34..e2c1f06367c9e 100644 --- a/google/cloud/aiplatform/v1/feature_online_store_admin_client.h +++ b/google/cloud/aiplatform/v1/feature_online_store_admin_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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_admin_connection.h b/google/cloud/aiplatform/v1/feature_online_store_admin_connection.h index 0ca95936cfb94..82a630e17f31c 100644 --- a/google/cloud/aiplatform/v1/feature_online_store_admin_connection.h +++ b/google/cloud/aiplatform/v1/feature_online_store_admin_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURE_ONLINE_STORE_ADMIN_CONNECTION_H #include "google/cloud/aiplatform/v1/feature_online_store_admin_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/feature_online_store_admin_service.pb.h" #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/feature_online_store_admin_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/feature_online_store_admin_connection_idempotency_policy.h index 40edb0049b4ec..4991f465900aa 100644 --- a/google/cloud/aiplatform/v1/feature_online_store_admin_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/feature_online_store_admin_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURE_ONLINE_STORE_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURE_ONLINE_STORE_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/feature_online_store_admin_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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_online_store_connection.h b/google/cloud/aiplatform/v1/feature_online_store_connection.h index 4cae02f7280e4..043a81fed3beb 100644 --- a/google/cloud/aiplatform/v1/feature_online_store_connection.h +++ b/google/cloud/aiplatform/v1/feature_online_store_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURE_ONLINE_STORE_CONNECTION_H #include "google/cloud/aiplatform/v1/feature_online_store_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/feature_online_store_service.pb.h" #include "google/cloud/aiplatform/v1/internal/feature_online_store_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/async_read_write_stream_impl.h" @@ -28,7 +29,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/aiplatform/v1/feature_online_store_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/feature_online_store_connection_idempotency_policy.h index 11afa137a48ac..1dd7b39e8aff7 100644 --- a/google/cloud/aiplatform/v1/feature_online_store_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/feature_online_store_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURE_ONLINE_STORE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURE_ONLINE_STORE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/feature_online_store_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/feature_registry_client.h b/google/cloud/aiplatform/v1/feature_registry_client.h index 21e76c5b5d449..7370422d3577f 100644 --- a/google/cloud/aiplatform/v1/feature_registry_client.h +++ b/google/cloud/aiplatform/v1/feature_registry_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/feature_registry_connection.h b/google/cloud/aiplatform/v1/feature_registry_connection.h index 9b6656d5aa215..a461a3556f6c5 100644 --- a/google/cloud/aiplatform/v1/feature_registry_connection.h +++ b/google/cloud/aiplatform/v1/feature_registry_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURE_REGISTRY_CONNECTION_H #include "google/cloud/aiplatform/v1/feature_registry_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/feature_registry_service.pb.h" #include "google/cloud/aiplatform/v1/internal/feature_registry_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/feature_registry_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/feature_registry_connection_idempotency_policy.h index ae95d4f62042a..99fd555cb2224 100644 --- a/google/cloud/aiplatform/v1/feature_registry_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/feature_registry_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURE_REGISTRY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURE_REGISTRY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/feature_registry_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/featurestore_client.h b/google/cloud/aiplatform/v1/featurestore_client.h index d80ecad5da24c..0f78bca32b6d5 100644 --- a/google/cloud/aiplatform/v1/featurestore_client.h +++ b/google/cloud/aiplatform/v1/featurestore_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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_connection.h b/google/cloud/aiplatform/v1/featurestore_connection.h index ce0d529a4f648..842a45aaa6b6b 100644 --- a/google/cloud/aiplatform/v1/featurestore_connection.h +++ b/google/cloud/aiplatform/v1/featurestore_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURESTORE_CONNECTION_H #include "google/cloud/aiplatform/v1/featurestore_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/featurestore_service.pb.h" #include "google/cloud/aiplatform/v1/internal/featurestore_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/featurestore_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/featurestore_connection_idempotency_policy.h index b68cf26714780..cb28307d53e0f 100644 --- a/google/cloud/aiplatform/v1/featurestore_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/featurestore_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURESTORE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURESTORE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/featurestore_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/featurestore_online_serving_connection.h b/google/cloud/aiplatform/v1/featurestore_online_serving_connection.h index d6c2c69a520f6..98ecca8d5c36f 100644 --- a/google/cloud/aiplatform/v1/featurestore_online_serving_connection.h +++ b/google/cloud/aiplatform/v1/featurestore_online_serving_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURESTORE_ONLINE_SERVING_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURESTORE_ONLINE_SERVING_CONNECTION_H +#include "google/cloud/aiplatform/v1/featurestore_online_service.pb.h" #include "google/cloud/aiplatform/v1/featurestore_online_serving_connection_idempotency_policy.h" #include "google/cloud/aiplatform/v1/internal/featurestore_online_serving_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/aiplatform/v1/featurestore_online_serving_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/featurestore_online_serving_connection_idempotency_policy.h index 27261454e4971..9a2f0af5c1462 100644 --- a/google/cloud/aiplatform/v1/featurestore_online_serving_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/featurestore_online_serving_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURESTORE_ONLINE_SERVING_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_FEATURESTORE_ONLINE_SERVING_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/featurestore_online_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/gen_ai_tuning_client.h b/google/cloud/aiplatform/v1/gen_ai_tuning_client.h index 6d0b45a8c3e45..889bbc6829516 100644 --- a/google/cloud/aiplatform/v1/gen_ai_tuning_client.h +++ b/google/cloud/aiplatform/v1/gen_ai_tuning_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/gen_ai_tuning_connection.h b/google/cloud/aiplatform/v1/gen_ai_tuning_connection.h index b13055b3fae95..0897d61d845de 100644 --- a/google/cloud/aiplatform/v1/gen_ai_tuning_connection.h +++ b/google/cloud/aiplatform/v1/gen_ai_tuning_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_GEN_AI_TUNING_CONNECTION_H #include "google/cloud/aiplatform/v1/gen_ai_tuning_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/genai_tuning_service.pb.h" #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/gen_ai_tuning_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/gen_ai_tuning_connection_idempotency_policy.h index 0ee9dff240655..bae4f749f36ef 100644 --- a/google/cloud/aiplatform/v1/gen_ai_tuning_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/gen_ai_tuning_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_GEN_AI_TUNING_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_GEN_AI_TUNING_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/genai_tuning_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/index_client.h b/google/cloud/aiplatform/v1/index_client.h index f6b76cf49a56b..cab56db2f070e 100644 --- a/google/cloud/aiplatform/v1/index_client.h +++ b/google/cloud/aiplatform/v1/index_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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_connection.h b/google/cloud/aiplatform/v1/index_connection.h index 03835e83241e9..1b8883df73826 100644 --- a/google/cloud/aiplatform/v1/index_connection.h +++ b/google/cloud/aiplatform/v1/index_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INDEX_CONNECTION_H #include "google/cloud/aiplatform/v1/index_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/index_service.pb.h" #include "google/cloud/aiplatform/v1/internal/index_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/index_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/index_connection_idempotency_policy.h index 2d6a4a9f33f24..4a84e43b6a358 100644 --- a/google/cloud/aiplatform/v1/index_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/index_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INDEX_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INDEX_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/index_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/index_endpoint_client.h b/google/cloud/aiplatform/v1/index_endpoint_client.h index d02cb0518af57..275264334c69f 100644 --- a/google/cloud/aiplatform/v1/index_endpoint_client.h +++ b/google/cloud/aiplatform/v1/index_endpoint_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/index_endpoint_connection.h b/google/cloud/aiplatform/v1/index_endpoint_connection.h index 667f0e461cfb5..494516bfccf50 100644 --- a/google/cloud/aiplatform/v1/index_endpoint_connection.h +++ b/google/cloud/aiplatform/v1/index_endpoint_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INDEX_ENDPOINT_CONNECTION_H #include "google/cloud/aiplatform/v1/index_endpoint_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/index_endpoint_service.pb.h" #include "google/cloud/aiplatform/v1/internal/index_endpoint_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/index_endpoint_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/index_endpoint_connection_idempotency_policy.h index 85c76ee774687..45380a935a59e 100644 --- a/google/cloud/aiplatform/v1/index_endpoint_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/index_endpoint_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INDEX_ENDPOINT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INDEX_ENDPOINT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/index_endpoint_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/dataset_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/dataset_auth_decorator.cc index ad1a80e259ac7..9931171fed46d 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/dataset_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/dataset_service.proto #include "google/cloud/aiplatform/v1/internal/dataset_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/dataset_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -481,3 +484,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/dataset_auth_decorator.h b/google/cloud/aiplatform/v1/internal/dataset_auth_decorator.h index 83b88efb15374..28955d75057d5 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/dataset_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/dataset_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -248,4 +251,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DATASET_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/dataset_connection_impl.h b/google/cloud/aiplatform/v1/internal/dataset_connection_impl.h index d8ad53b542c98..f4ac8d1b8a61a 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/dataset_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/dataset_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/dataset_logging_decorator.cc index d5dcc11797295..7975e3630e9bf 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/dataset_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/dataset_service.proto #include "google/cloud/aiplatform/v1/internal/dataset_logging_decorator.h" +#include "google/cloud/aiplatform/v1/dataset_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -579,3 +582,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/dataset_logging_decorator.h b/google/cloud/aiplatform/v1/internal/dataset_logging_decorator.h index 19a4f110e9b28..b61bb9f26f5e6 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/dataset_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/dataset_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -248,4 +251,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DATASET_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/dataset_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/dataset_metadata_decorator.cc index 53a4dc71a767b..db622adff9263 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/dataset_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/dataset_service.proto #include "google/cloud/aiplatform/v1/internal/dataset_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/dataset_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -437,3 +441,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/dataset_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/dataset_metadata_decorator.h index 67f613312af82..ca9db6f749104 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/dataset_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/dataset_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -253,4 +256,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DATASET_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/dataset_option_defaults.cc b/google/cloud/aiplatform/v1/internal/dataset_option_defaults.cc index 2074fe51edeb2..7fe4775b435cc 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/dataset_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/dataset_option_defaults.h" #include "google/cloud/aiplatform/v1/dataset_connection.h" #include "google/cloud/aiplatform/v1/dataset_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options DatasetServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::DatasetServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/dataset_stub.cc b/google/cloud/aiplatform/v1/internal/dataset_stub.cc index 4f6a50568bc0a..9a56e6d733d46 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_stub.cc +++ b/google/cloud/aiplatform/v1/internal/dataset_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/dataset_service.proto #include "google/cloud/aiplatform/v1/internal/dataset_stub.h" +#include "google/cloud/aiplatform/v1/dataset_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -567,3 +570,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/dataset_stub.h b/google/cloud/aiplatform/v1/internal/dataset_stub.h index 3c3dffaa040d1..492d6d7311e2a 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_stub.h +++ b/google/cloud/aiplatform/v1/internal/dataset_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DATASET_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DATASET_STUB_H +#include "google/cloud/aiplatform/v1/dataset_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -474,4 +477,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DATASET_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/dataset_stub_factory.cc b/google/cloud/aiplatform/v1/internal/dataset_stub_factory.cc index 422c77c91999f..ec2a21ad5daa9 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/dataset_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/aiplatform/v1/dataset_service.proto #include "google/cloud/aiplatform/v1/internal/dataset_stub_factory.h" +#include "google/cloud/aiplatform/v1/dataset_service.grpc.pb.h" #include "google/cloud/aiplatform/v1/internal/dataset_auth_decorator.h" #include "google/cloud/aiplatform/v1/internal/dataset_logging_decorator.h" #include "google/cloud/aiplatform/v1/internal/dataset_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/dataset_stub.h" #include "google/cloud/aiplatform/v1/internal/dataset_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/dataset_stub_factory.h b/google/cloud/aiplatform/v1/internal/dataset_stub_factory.h index 6453c5e686285..e4936e867229c 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/dataset_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DATASET_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/dataset_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/dataset_tracing_connection.cc index d491cb283ffa3..437c5c8975606 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/dataset_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DatasetServiceTracingConnection::DatasetServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -475,16 +473,12 @@ DatasetServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDatasetServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/dataset_tracing_connection.h b/google/cloud/aiplatform/v1/internal/dataset_tracing_connection.h index 91827a87b5e80..e0816301ce192 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/dataset_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DatasetServiceTracingConnection : public aiplatform_v1::DatasetServiceConnection { public: @@ -212,8 +210,6 @@ class DatasetServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/dataset_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/dataset_tracing_stub.cc index 84a1aca6330ac..54a24c18a4fd3 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/dataset_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DatasetServiceTracingStub::DatasetServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -520,18 +521,14 @@ future DatasetServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDatasetServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/dataset_tracing_stub.h b/google/cloud/aiplatform/v1/internal/dataset_tracing_stub.h index 9d387745c42eb..da7cda0d47ef5 100644 --- a/google/cloud/aiplatform/v1/internal/dataset_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/dataset_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DatasetServiceTracingStub : public DatasetServiceStub { public: ~DatasetServiceTracingStub() override = default; @@ -243,8 +244,6 @@ class DatasetServiceTracingStub : public DatasetServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -259,4 +258,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DATASET_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_auth_decorator.cc index dd93af66a992c..e3793bc0b6ddc 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/deployment_resource_pool_service.proto #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/deployment_resource_pool_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -272,3 +275,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_auth_decorator.h b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_auth_decorator.h index 24ae4f899b2e5..ecaba53dafc95 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -153,4 +156,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DEPLOYMENT_RESOURCE_POOL_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_connection_impl.h b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_connection_impl.h index 644df1274b835..d8b6aa32a84ef 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_logging_decorator.cc index 424a67da7717a..7fe02b8539148 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/deployment_resource_pool_service.proto #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_logging_decorator.h" +#include "google/cloud/aiplatform/v1/deployment_resource_pool_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -323,3 +326,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_logging_decorator.h b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_logging_decorator.h index 48a02beab4b4d..91cb6bc5ba507 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -153,4 +156,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DEPLOYMENT_RESOURCE_POOL_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_metadata_decorator.cc index fd881f57d9a0b..99ee610d4549e 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/deployment_resource_pool_service.proto #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/deployment_resource_pool_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -267,3 +271,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_metadata_decorator.h index 0e5f2ab320785..c0cda43459386 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -159,4 +162,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DEPLOYMENT_RESOURCE_POOL_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_option_defaults.cc b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_option_defaults.cc index 64c2186a02046..b899b1d40cfc9 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_option_defaults.h" #include "google/cloud/aiplatform/v1/deployment_resource_pool_connection.h" #include "google/cloud/aiplatform/v1/deployment_resource_pool_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -46,7 +46,7 @@ Options DeploymentResourcePoolServiceDefaultOptions(std::string const& location, aiplatform_v1::DeploymentResourcePoolServiceRetryPolicyOption>()) { options.set( aiplatform_v1::DeploymentResourcePoolServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub.cc b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub.cc index f29ccf725822b..bbfdd291fc1ce 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub.cc +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/deployment_resource_pool_service.proto #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub.h" +#include "google/cloud/aiplatform/v1/deployment_resource_pool_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -327,3 +330,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub.h b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub.h index 3097782e6834a..84be4fcc5708c 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub.h +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DEPLOYMENT_RESOURCE_POOL_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DEPLOYMENT_RESOURCE_POOL_STUB_H +#include "google/cloud/aiplatform/v1/deployment_resource_pool_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -283,4 +286,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DEPLOYMENT_RESOURCE_POOL_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub_factory.cc b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub_factory.cc index 9f607c7304c3c..0c1f591eafb17 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/aiplatform/v1/deployment_resource_pool_service.proto #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub_factory.h" +#include "google/cloud/aiplatform/v1/deployment_resource_pool_service.grpc.pb.h" #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_auth_decorator.h" #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_logging_decorator.h" #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub.h" #include "google/cloud/aiplatform/v1/internal/deployment_resource_pool_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -80,3 +83,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub_factory.h b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub_factory.h index 35f744222f004..c8f61fb7079f9 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DEPLOYMENT_RESOURCE_POOL_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_connection.cc index 4504c3d03ae98..445e4019ed3c1 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DeploymentResourcePoolServiceTracingConnection:: DeploymentResourcePoolServiceTracingConnection( std::shared_ptr @@ -262,18 +260,14 @@ DeploymentResourcePoolServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDeploymentResourcePoolServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_connection.h b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_connection.h index 64b1d492576a0..70fc188e69c53 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DeploymentResourcePoolServiceTracingConnection : public aiplatform_v1::DeploymentResourcePoolServiceConnection { public: @@ -128,8 +126,6 @@ class DeploymentResourcePoolServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_stub.cc index cd3c2c84ec81f..fbe99bcea304b 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DeploymentResourcePoolServiceTracingStub:: DeploymentResourcePoolServiceTracingStub( std::shared_ptr child) @@ -315,20 +316,16 @@ future DeploymentResourcePoolServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDeploymentResourcePoolServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_stub.h b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_stub.h index a773b0b32ada7..04e037b9313cb 100644 --- a/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/deployment_resource_pool_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DeploymentResourcePoolServiceTracingStub : public DeploymentResourcePoolServiceStub { public: @@ -149,8 +150,6 @@ class DeploymentResourcePoolServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -166,4 +165,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_DEPLOYMENT_RESOURCE_POOL_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/endpoint_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/endpoint_auth_decorator.cc index b2aaf5cb2f537..3d5fc848da8b1 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/endpoint_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/endpoint_service.proto #include "google/cloud/aiplatform/v1/internal/endpoint_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/endpoint_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -353,3 +356,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/endpoint_auth_decorator.h b/google/cloud/aiplatform/v1/internal/endpoint_auth_decorator.h index b0e91beb3d96d..45f44b95b3986 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/endpoint_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/endpoint_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -189,4 +192,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_ENDPOINT_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/endpoint_connection_impl.h b/google/cloud/aiplatform/v1/internal/endpoint_connection_impl.h index f47cd8ed64348..a5a61855f4295 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/endpoint_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/endpoint_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/endpoint_logging_decorator.cc index 14498fc29b6fa..21e1a4c014b37 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/endpoint_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/endpoint_service.proto #include "google/cloud/aiplatform/v1/internal/endpoint_logging_decorator.h" +#include "google/cloud/aiplatform/v1/endpoint_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -415,3 +418,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/endpoint_logging_decorator.h b/google/cloud/aiplatform/v1/internal/endpoint_logging_decorator.h index 0a61443564422..aa3dabc14dff9 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/endpoint_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/endpoint_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -189,4 +192,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_ENDPOINT_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/endpoint_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/endpoint_metadata_decorator.cc index f0beb0de14446..715a2c14206b7 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/endpoint_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/endpoint_service.proto #include "google/cloud/aiplatform/v1/internal/endpoint_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/endpoint_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -332,3 +336,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/endpoint_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/endpoint_metadata_decorator.h index 0ad7500bcab41..daddbaeb673b8 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/endpoint_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/endpoint_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -195,4 +198,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_ENDPOINT_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/endpoint_option_defaults.cc b/google/cloud/aiplatform/v1/internal/endpoint_option_defaults.cc index 45afe916360aa..748bd8b4822c1 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/endpoint_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/endpoint_option_defaults.h" #include "google/cloud/aiplatform/v1/endpoint_connection.h" #include "google/cloud/aiplatform/v1/endpoint_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options EndpointServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::EndpointServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/endpoint_stub.cc b/google/cloud/aiplatform/v1/internal/endpoint_stub.cc index d07ca910bf68c..228705417be29 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_stub.cc +++ b/google/cloud/aiplatform/v1/internal/endpoint_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/endpoint_service.proto #include "google/cloud/aiplatform/v1/internal/endpoint_stub.h" +#include "google/cloud/aiplatform/v1/endpoint_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -415,3 +418,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/endpoint_stub.h b/google/cloud/aiplatform/v1/internal/endpoint_stub.h index ad2e887552109..fd06c9b4e8696 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_stub.h +++ b/google/cloud/aiplatform/v1/internal/endpoint_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_ENDPOINT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_ENDPOINT_STUB_H +#include "google/cloud/aiplatform/v1/endpoint_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -345,4 +348,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_ENDPOINT_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/endpoint_stub_factory.cc b/google/cloud/aiplatform/v1/internal/endpoint_stub_factory.cc index bf05ffca0ba7d..fd9a0c5eb0eb3 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/endpoint_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/aiplatform/v1/endpoint_service.proto #include "google/cloud/aiplatform/v1/internal/endpoint_stub_factory.h" +#include "google/cloud/aiplatform/v1/endpoint_service.grpc.pb.h" #include "google/cloud/aiplatform/v1/internal/endpoint_auth_decorator.h" #include "google/cloud/aiplatform/v1/internal/endpoint_logging_decorator.h" #include "google/cloud/aiplatform/v1/internal/endpoint_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/endpoint_stub.h" #include "google/cloud/aiplatform/v1/internal/endpoint_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/endpoint_stub_factory.h b/google/cloud/aiplatform/v1/internal/endpoint_stub_factory.h index 8ed65bb39e576..92d20d31c5e32 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/endpoint_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_ENDPOINT_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/endpoint_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/endpoint_tracing_connection.cc index 6fcf2b4bee9ce..1a3f41853e485 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/endpoint_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EndpointServiceTracingConnection::EndpointServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -332,16 +330,12 @@ EndpointServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEndpointServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/endpoint_tracing_connection.h b/google/cloud/aiplatform/v1/internal/endpoint_tracing_connection.h index 7e49a57ee0956..950fe8ea853dd 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/endpoint_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EndpointServiceTracingConnection : public aiplatform_v1::EndpointServiceConnection { public: @@ -160,8 +158,6 @@ class EndpointServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/endpoint_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/endpoint_tracing_stub.cc index 7316f3f1a8d26..5f1b2c8b97a84 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/endpoint_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EndpointServiceTracingStub::EndpointServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -377,18 +378,14 @@ future EndpointServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEndpointServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/endpoint_tracing_stub.h b/google/cloud/aiplatform/v1/internal/endpoint_tracing_stub.h index 454c56c3f824f..6f09516dcb658 100644 --- a/google/cloud/aiplatform/v1/internal/endpoint_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/endpoint_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EndpointServiceTracingStub : public EndpointServiceStub { public: ~EndpointServiceTracingStub() override = default; @@ -185,8 +186,6 @@ class EndpointServiceTracingStub : public EndpointServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -201,4 +200,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_ENDPOINT_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/evaluation_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/evaluation_auth_decorator.cc index 407aaa6689be5..22a37596f5423 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/evaluation_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/evaluation_service.proto #include "google/cloud/aiplatform/v1/internal/evaluation_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/evaluation_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -127,3 +130,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/evaluation_auth_decorator.h b/google/cloud/aiplatform/v1/internal/evaluation_auth_decorator.h index dda0a2ceabdd2..c15900ae11ae2 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/evaluation_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_EVALUATION_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/evaluation_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/evaluation_logging_decorator.cc index 7d47e43e0fde4..badb3c47a1edb 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/evaluation_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/evaluation_service.proto #include "google/cloud/aiplatform/v1/internal/evaluation_logging_decorator.h" +#include "google/cloud/aiplatform/v1/evaluation_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -167,3 +170,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/evaluation_logging_decorator.h b/google/cloud/aiplatform/v1/internal/evaluation_logging_decorator.h index 7b32e2ab4508f..2bdcf852e3a80 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/evaluation_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_EVALUATION_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/evaluation_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/evaluation_metadata_decorator.cc index fafd56bb9397a..7c6c5d89a4407 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/evaluation_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/evaluation_service.proto #include "google/cloud/aiplatform/v1/internal/evaluation_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/evaluation_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -159,3 +163,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/evaluation_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/evaluation_metadata_decorator.h index bd742ce84bc9b..28d5691ad029c 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/evaluation_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -100,4 +103,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_EVALUATION_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/evaluation_option_defaults.cc b/google/cloud/aiplatform/v1/internal/evaluation_option_defaults.cc index 88729698bff88..e828134ac44eb 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/evaluation_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/evaluation_option_defaults.h" #include "google/cloud/aiplatform/v1/evaluation_connection.h" #include "google/cloud/aiplatform/v1/evaluation_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options EvaluationServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::EvaluationServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/evaluation_stub.cc b/google/cloud/aiplatform/v1/internal/evaluation_stub.cc index 301423f05946a..87615246435ae 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_stub.cc +++ b/google/cloud/aiplatform/v1/internal/evaluation_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/aiplatform/v1/evaluation_service.proto #include "google/cloud/aiplatform/v1/internal/evaluation_stub.h" +#include "google/cloud/aiplatform/v1/evaluation_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -163,3 +166,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/evaluation_stub.h b/google/cloud/aiplatform/v1/internal/evaluation_stub.h index 3689bb3bce21a..ffaf41e6ca884 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_stub.h +++ b/google/cloud/aiplatform/v1/internal/evaluation_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_EVALUATION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_EVALUATION_STUB_H +#include "google/cloud/aiplatform/v1/evaluation_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -165,4 +168,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_EVALUATION_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/evaluation_stub_factory.cc b/google/cloud/aiplatform/v1/internal/evaluation_stub_factory.cc index f70ddf3088f87..3ef2eda852374 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/evaluation_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/aiplatform/v1/evaluation_service.proto #include "google/cloud/aiplatform/v1/internal/evaluation_stub_factory.h" +#include "google/cloud/aiplatform/v1/evaluation_service.grpc.pb.h" #include "google/cloud/aiplatform/v1/internal/evaluation_auth_decorator.h" #include "google/cloud/aiplatform/v1/internal/evaluation_logging_decorator.h" #include "google/cloud/aiplatform/v1/internal/evaluation_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/evaluation_stub.h" #include "google/cloud/aiplatform/v1/internal/evaluation_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/evaluation_stub_factory.h b/google/cloud/aiplatform/v1/internal/evaluation_stub_factory.h index f716921ffccc8..2bffc218a928a 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/evaluation_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_EVALUATION_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/evaluation_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/evaluation_tracing_connection.cc index d0444ab154450..b7066f56fbba8 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/evaluation_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EvaluationServiceTracingConnection::EvaluationServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -134,17 +132,13 @@ EvaluationServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEvaluationServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/evaluation_tracing_connection.h b/google/cloud/aiplatform/v1/internal/evaluation_tracing_connection.h index ce8ef35478fcb..aa0d1fd3f9e44 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/evaluation_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EvaluationServiceTracingConnection : public aiplatform_v1::EvaluationServiceConnection { public: @@ -79,8 +77,6 @@ class EvaluationServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/evaluation_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/evaluation_tracing_stub.cc index fa7ef3f07f1a7..15b1fc442e354 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/evaluation_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EvaluationServiceTracingStub::EvaluationServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -160,18 +161,14 @@ EvaluationServiceTracingStub::WaitOperation( child_->WaitOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEvaluationServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/evaluation_tracing_stub.h b/google/cloud/aiplatform/v1/internal/evaluation_tracing_stub.h index 6c63eca305aeb..2487ac10a0c74 100644 --- a/google/cloud/aiplatform/v1/internal/evaluation_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/evaluation_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EvaluationServiceTracingStub : public EvaluationServiceStub { public: ~EvaluationServiceTracingStub() override = default; @@ -91,8 +92,6 @@ class EvaluationServiceTracingStub : public EvaluationServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -107,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_EVALUATION_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_auth_decorator.cc index 9ce33b09c9967..6ff4867072493 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/feature_online_store_admin_service.proto #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/feature_online_store_admin_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -404,3 +407,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_auth_decorator.h b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_auth_decorator.h index 9a02562f2a83d..efaba408cafdf 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -215,4 +218,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_ADMIN_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_connection_impl.h b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_connection_impl.h index 1bb71592f12e5..fde2abf0f77c8 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_logging_decorator.cc index 51810252dc1b6..8e88385f27151 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/feature_online_store_admin_service.proto #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_logging_decorator.h" +#include "google/cloud/aiplatform/v1/feature_online_store_admin_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -490,3 +493,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_logging_decorator.h b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_logging_decorator.h index 8bfc6a9aa8b08..e5d50eed1c8eb 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -215,4 +218,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_ADMIN_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_metadata_decorator.cc index 04a2d630d3b9e..e71c5ad65f6e0 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/feature_online_store_admin_service.proto #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/feature_online_store_admin_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -378,3 +382,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_metadata_decorator.h index af7016f613c89..c4025b680dd1b 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -221,4 +224,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_ADMIN_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_option_defaults.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_option_defaults.cc index 1e0b21f342d2f..2d33c89e8cb89 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_option_defaults.h" #include "google/cloud/aiplatform/v1/feature_online_store_admin_connection.h" #include "google/cloud/aiplatform/v1/feature_online_store_admin_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -46,7 +46,7 @@ Options FeatureOnlineStoreAdminServiceDefaultOptions( aiplatform_v1::FeatureOnlineStoreAdminServiceRetryPolicyOption>()) { options.set( aiplatform_v1::FeatureOnlineStoreAdminServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub.cc index 9fe66cf582223..8f0bdda1a8dff 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/feature_online_store_admin_service.proto #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub.h" +#include "google/cloud/aiplatform/v1/feature_online_store_admin_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -479,3 +482,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub.h b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub.h index 87647af1ec515..d403efa055ff0 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_ADMIN_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_ADMIN_STUB_H +#include "google/cloud/aiplatform/v1/feature_online_store_admin_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -410,4 +413,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_ADMIN_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub_factory.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub_factory.cc index c5c2b1bda290a..cce7c176abb94 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/aiplatform/v1/feature_online_store_admin_service.proto #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub_factory.h" +#include "google/cloud/aiplatform/v1/feature_online_store_admin_service.grpc.pb.h" #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_auth_decorator.h" #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_logging_decorator.h" #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub.h" #include "google/cloud/aiplatform/v1/internal/feature_online_store_admin_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -80,3 +83,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub_factory.h b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub_factory.h index ffb70c26531db..c8c37181c9150 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_ADMIN_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_connection.cc index f5e66fab917ba..3ce7dfa39e1b6 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FeatureOnlineStoreAdminServiceTracingConnection:: FeatureOnlineStoreAdminServiceTracingConnection( std::shared_ptr @@ -418,18 +416,14 @@ FeatureOnlineStoreAdminServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFeatureOnlineStoreAdminServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_connection.h b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_connection.h index 0cba9b13c61b5..5c50d75e297cb 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FeatureOnlineStoreAdminServiceTracingConnection : public aiplatform_v1::FeatureOnlineStoreAdminServiceConnection { public: @@ -187,8 +185,6 @@ class FeatureOnlineStoreAdminServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_stub.cc index 24b92e9ff994c..5a8f23bd0ed63 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FeatureOnlineStoreAdminServiceTracingStub:: FeatureOnlineStoreAdminServiceTracingStub( std::shared_ptr child) @@ -466,20 +467,16 @@ future FeatureOnlineStoreAdminServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFeatureOnlineStoreAdminServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_stub.h b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_stub.h index 5d1dbe3bf7b09..48e6d109a1d7f 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_admin_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FeatureOnlineStoreAdminServiceTracingStub : public FeatureOnlineStoreAdminServiceStub { public: @@ -211,8 +212,6 @@ class FeatureOnlineStoreAdminServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -228,4 +227,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_ADMIN_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_auth_decorator.cc index 461c6604cb30c..b0447ec1595c2 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/aiplatform/v1/feature_online_store_service.proto #include "google/cloud/aiplatform/v1/internal/feature_online_store_auth_decorator.h" +#include "google/cloud/aiplatform/v1/feature_online_store_service.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -170,3 +173,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_auth_decorator.h b/google/cloud/aiplatform/v1/internal/feature_online_store_auth_decorator.h index 3116cdafe7b9c..68d8d99967b50 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -114,4 +117,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_logging_decorator.cc index f449fcf481fe2..2a4982b061a4c 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/aiplatform/v1/feature_online_store_service.proto #include "google/cloud/aiplatform/v1/internal/feature_online_store_logging_decorator.h" +#include "google/cloud/aiplatform/v1/feature_online_store_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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -225,3 +228,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_logging_decorator.h b/google/cloud/aiplatform/v1/internal/feature_online_store_logging_decorator.h index 0ca2fcd931999..7951683655aca 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -115,4 +118,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_metadata_decorator.cc index 92fbf6dd621ba..6ae4a3893a335 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/feature_online_store_service.proto #include "google/cloud/aiplatform/v1/internal/feature_online_store_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/feature_online_store_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -195,3 +199,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/feature_online_store_metadata_decorator.h index 91cb5e3658010..8bb047d4c97a5 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -120,4 +123,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_option_defaults.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_option_defaults.cc index ed8600f383fcd..6cf9ebc8bcf10 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/feature_online_store_option_defaults.h" #include "google/cloud/aiplatform/v1/feature_online_store_connection.h" #include "google/cloud/aiplatform/v1/feature_online_store_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -46,7 +46,7 @@ Options FeatureOnlineStoreServiceDefaultOptions(std::string const& location, .has()) { options.set( aiplatform_v1::FeatureOnlineStoreServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_stub.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_stub.cc index 665c1e046f933..df0368c806934 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_stub.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/feature_online_store_service.proto #include "google/cloud/aiplatform/v1/internal/feature_online_store_stub.h" +#include "google/cloud/aiplatform/v1/feature_online_store_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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -209,3 +212,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_stub.h b/google/cloud/aiplatform/v1/internal/feature_online_store_stub.h index c9c7fa272af75..c4e2071a3e2d3 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_stub.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_STUB_H +#include "google/cloud/aiplatform/v1/feature_online_store_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/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#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 aiplatform_v1_internal { @@ -209,4 +212,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_stub_factory.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_stub_factory.cc index 661fa97a4f9e3..e5e55723228f5 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/aiplatform/v1/feature_online_store_service.proto #include "google/cloud/aiplatform/v1/internal/feature_online_store_stub_factory.h" +#include "google/cloud/aiplatform/v1/feature_online_store_service.grpc.pb.h" #include "google/cloud/aiplatform/v1/internal/feature_online_store_auth_decorator.h" #include "google/cloud/aiplatform/v1/internal/feature_online_store_logging_decorator.h" #include "google/cloud/aiplatform/v1/internal/feature_online_store_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/feature_online_store_stub.h" #include "google/cloud/aiplatform/v1/internal/feature_online_store_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -81,3 +84,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_stub_factory.h b/google/cloud/aiplatform/v1/internal/feature_online_store_stub_factory.h index 9ca6ef20d2772..f18305485338b 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_connection.cc index 6cb9d8b582ea9..b35d187f8042a 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FeatureOnlineStoreServiceTracingConnection:: FeatureOnlineStoreServiceTracingConnection( std::shared_ptr @@ -165,17 +163,13 @@ FeatureOnlineStoreServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFeatureOnlineStoreServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_connection.h b/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_connection.h index 9c85fcbc74bcd..1e3bb89bfb029 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FeatureOnlineStoreServiceTracingConnection : public aiplatform_v1::FeatureOnlineStoreServiceConnection { public: @@ -95,8 +93,6 @@ class FeatureOnlineStoreServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_stub.cc index 3438ecfa21b64..177d35bf250f5 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FeatureOnlineStoreServiceTracingStub::FeatureOnlineStoreServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -215,20 +216,16 @@ FeatureOnlineStoreServiceTracingStub::WaitOperation( child_->WaitOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFeatureOnlineStoreServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_stub.h b/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_stub.h index cde29d18cbc44..040770f44b533 100644 --- a/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/feature_online_store_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FeatureOnlineStoreServiceTracingStub : public FeatureOnlineStoreServiceStub { public: @@ -112,8 +113,6 @@ class FeatureOnlineStoreServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -129,4 +128,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_ONLINE_STORE_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/feature_registry_auth_decorator.cc index 1b04333f98c19..409e17cfce5d1 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/feature_registry_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/feature_registry_service.proto #include "google/cloud/aiplatform/v1/internal/feature_registry_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/feature_registry_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -396,3 +399,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_auth_decorator.h b/google/cloud/aiplatform/v1/internal/feature_registry_auth_decorator.h index a67bfeb7944dd..2a91d9e7ca657 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/feature_registry_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/feature_registry_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -205,4 +208,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_REGISTRY_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_connection_impl.h b/google/cloud/aiplatform/v1/internal/feature_registry_connection_impl.h index 0d265a94b6b9b..99a45a4833e4c 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/feature_registry_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/feature_registry_logging_decorator.cc index bfb92cd69f858..d363537369a09 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/feature_registry_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/feature_registry_service.proto #include "google/cloud/aiplatform/v1/internal/feature_registry_logging_decorator.h" +#include "google/cloud/aiplatform/v1/feature_registry_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -465,3 +468,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_logging_decorator.h b/google/cloud/aiplatform/v1/internal/feature_registry_logging_decorator.h index 0e98771688c94..9815d06ff71df 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/feature_registry_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/feature_registry_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -205,4 +208,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_REGISTRY_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/feature_registry_metadata_decorator.cc index 1acbafb58f5a1..35ff255caed0e 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/feature_registry_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/feature_registry_service.proto #include "google/cloud/aiplatform/v1/internal/feature_registry_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/feature_registry_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -361,3 +365,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/feature_registry_metadata_decorator.h index ba3e829743b39..8246dd5e808fe 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/feature_registry_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/feature_registry_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -211,4 +214,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_REGISTRY_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_option_defaults.cc b/google/cloud/aiplatform/v1/internal/feature_registry_option_defaults.cc index e8df9d0695557..67c6703a617f0 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/feature_registry_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/feature_registry_option_defaults.h" #include "google/cloud/aiplatform/v1/feature_registry_connection.h" #include "google/cloud/aiplatform/v1/feature_registry_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options FeatureRegistryServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::FeatureRegistryServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_stub.cc b/google/cloud/aiplatform/v1/internal/feature_registry_stub.cc index 1ce5fc329fef9..851bd20aaaf80 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_stub.cc +++ b/google/cloud/aiplatform/v1/internal/feature_registry_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/feature_registry_service.proto #include "google/cloud/aiplatform/v1/internal/feature_registry_stub.h" +#include "google/cloud/aiplatform/v1/feature_registry_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -455,3 +458,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_stub.h b/google/cloud/aiplatform/v1/internal/feature_registry_stub.h index 2552d71dfada9..e83aba589e686 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_stub.h +++ b/google/cloud/aiplatform/v1/internal/feature_registry_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_REGISTRY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_REGISTRY_STUB_H +#include "google/cloud/aiplatform/v1/feature_registry_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -384,4 +387,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_REGISTRY_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_stub_factory.cc b/google/cloud/aiplatform/v1/internal/feature_registry_stub_factory.cc index e22411b9d6fce..5810852093fee 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/feature_registry_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/aiplatform/v1/feature_registry_service.proto #include "google/cloud/aiplatform/v1/internal/feature_registry_stub_factory.h" +#include "google/cloud/aiplatform/v1/feature_registry_service.grpc.pb.h" #include "google/cloud/aiplatform/v1/internal/feature_registry_auth_decorator.h" #include "google/cloud/aiplatform/v1/internal/feature_registry_logging_decorator.h" #include "google/cloud/aiplatform/v1/internal/feature_registry_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/feature_registry_stub.h" #include "google/cloud/aiplatform/v1/internal/feature_registry_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_stub_factory.h b/google/cloud/aiplatform/v1/internal/feature_registry_stub_factory.h index 86271fe2ae195..bc8493e3b5b99 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/feature_registry_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_REGISTRY_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/feature_registry_tracing_connection.cc index 22486d8f9f840..5d100ccc674c1 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/feature_registry_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FeatureRegistryServiceTracingConnection:: FeatureRegistryServiceTracingConnection( std::shared_ptr child) @@ -375,17 +373,13 @@ FeatureRegistryServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFeatureRegistryServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_tracing_connection.h b/google/cloud/aiplatform/v1/internal/feature_registry_tracing_connection.h index 5a0fe6aa2c242..e4517b5574d12 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/feature_registry_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FeatureRegistryServiceTracingConnection : public aiplatform_v1::FeatureRegistryServiceConnection { public: @@ -175,8 +173,6 @@ class FeatureRegistryServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/feature_registry_tracing_stub.cc index f091632fb6c5b..884ecb38bca3c 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/feature_registry_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FeatureRegistryServiceTracingStub::FeatureRegistryServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -421,19 +422,15 @@ future FeatureRegistryServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFeatureRegistryServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/feature_registry_tracing_stub.h b/google/cloud/aiplatform/v1/internal/feature_registry_tracing_stub.h index 1143e615e8646..824f8b87b4671 100644 --- a/google/cloud/aiplatform/v1/internal/feature_registry_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/feature_registry_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FeatureRegistryServiceTracingStub : public FeatureRegistryServiceStub { public: ~FeatureRegistryServiceTracingStub() override = default; @@ -201,8 +202,6 @@ class FeatureRegistryServiceTracingStub : public FeatureRegistryServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -218,4 +217,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURE_REGISTRY_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/featurestore_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/featurestore_auth_decorator.cc index 3c6e519991a32..3c4e13c59a5aa 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/featurestore_service.proto #include "google/cloud/aiplatform/v1/internal/featurestore_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/featurestore_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -584,3 +587,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/featurestore_auth_decorator.h b/google/cloud/aiplatform/v1/internal/featurestore_auth_decorator.h index e0968a62866b1..141027311a864 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/featurestore_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -290,4 +293,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/featurestore_connection_impl.h b/google/cloud/aiplatform/v1/internal/featurestore_connection_impl.h index 5daf4b771d1bb..fef37ae62e664 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/featurestore_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/featurestore_logging_decorator.cc index 1cffac611d310..a083cae735577 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/featurestore_service.proto #include "google/cloud/aiplatform/v1/internal/featurestore_logging_decorator.h" +#include "google/cloud/aiplatform/v1/featurestore_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -692,3 +695,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/featurestore_logging_decorator.h b/google/cloud/aiplatform/v1/internal/featurestore_logging_decorator.h index ae22c91068a23..ec3e8e9d2db64 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/featurestore_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -290,4 +293,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/featurestore_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/featurestore_metadata_decorator.cc index 9106fdfc69bfb..1a72fe1b40bd2 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/featurestore_service.proto #include "google/cloud/aiplatform/v1/internal/featurestore_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/featurestore_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -520,3 +524,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/featurestore_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/featurestore_metadata_decorator.h index aff8a544ccdd0..85ec68796a3b4 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/featurestore_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -296,4 +299,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_auth_decorator.cc index 9030868cf78c2..5691a5754a7a7 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/featurestore_online_service.proto #include "google/cloud/aiplatform/v1/internal/featurestore_online_serving_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/featurestore_online_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -155,3 +158,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_auth_decorator.h b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_auth_decorator.h index cd1a3e72d1d40..09e586a631a05 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -108,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_ONLINE_SERVING_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_logging_decorator.cc index 8c7daae5589de..0399c21c5ea30 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/aiplatform/v1/featurestore_online_service.proto #include "google/cloud/aiplatform/v1/internal/featurestore_online_serving_logging_decorator.h" +#include "google/cloud/aiplatform/v1/featurestore_online_service.grpc.pb.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -214,3 +217,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_logging_decorator.h b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_logging_decorator.h index 934acbee744cb..0f156d22f1ad6 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_ONLINE_SERVING_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_metadata_decorator.cc index 9b9d312bfeda1..db59ff7a9a54a 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/featurestore_online_service.proto #include "google/cloud/aiplatform/v1/internal/featurestore_online_serving_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/featurestore_online_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -185,3 +189,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_metadata_decorator.h index f737e1ba1ee1d..5695e7a3d2592 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -114,4 +117,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_ONLINE_SERVING_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_option_defaults.cc b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_option_defaults.cc index 34fc1b01420ba..b5d82cf98eb6d 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/featurestore_online_serving_option_defaults.h" #include "google/cloud/aiplatform/v1/featurestore_online_serving_connection.h" #include "google/cloud/aiplatform/v1/featurestore_online_serving_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -47,7 +47,7 @@ Options FeaturestoreOnlineServingServiceDefaultOptions( options.set< aiplatform_v1::FeaturestoreOnlineServingServiceRetryPolicyOption>( aiplatform_v1::FeaturestoreOnlineServingServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -190,3 +193,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_stub.h b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_stub.h index 08f42e67e90ff..18c51cb2fa971 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_stub.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_ONLINE_SERVING_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_ONLINE_SERVING_STUB_H +#include "google/cloud/aiplatform/v1/featurestore_online_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -193,4 +196,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_ONLINE_SERVING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_stub_factory.cc b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_stub_factory.cc index 4dd7bde13e473..8051ebeef518f 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/aiplatform/v1/featurestore_online_service.proto #include "google/cloud/aiplatform/v1/internal/featurestore_online_serving_stub_factory.h" +#include "google/cloud/aiplatform/v1/featurestore_online_service.grpc.pb.h" #include "google/cloud/aiplatform/v1/internal/featurestore_online_serving_auth_decorator.h" #include "google/cloud/aiplatform/v1/internal/featurestore_online_serving_logging_decorator.h" #include "google/cloud/aiplatform/v1/internal/featurestore_online_serving_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/featurestore_online_serving_stub.h" #include "google/cloud/aiplatform/v1/internal/featurestore_online_serving_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -81,3 +84,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_stub_factory.h b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_stub_factory.h index ea32727e39fb2..2275855257255 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_ONLINE_SERVING_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_connection.cc index ba7ffd0928bc5..03a793a8c534f 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FeaturestoreOnlineServingServiceTracingConnection:: FeaturestoreOnlineServingServiceTracingConnection( std::shared_ptr< @@ -170,18 +168,14 @@ FeaturestoreOnlineServingServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFeaturestoreOnlineServingServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_connection.h b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_connection.h index 418a08aafa2e0..1b17dc0a7dc65 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FeaturestoreOnlineServingServiceTracingConnection : public aiplatform_v1::FeaturestoreOnlineServingServiceConnection { public: @@ -91,8 +89,6 @@ class FeaturestoreOnlineServingServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_stub.cc index da2abd7e3dc0d..db4851ebdb2ce 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FeaturestoreOnlineServingServiceTracingStub:: FeaturestoreOnlineServingServiceTracingStub( std::shared_ptr child) @@ -205,20 +206,16 @@ FeaturestoreOnlineServingServiceTracingStub::WaitOperation( child_->WaitOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFeaturestoreOnlineServingServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_stub.h b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_stub.h index 5cc9249bc780a..ecec6f9c1a59a 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_online_serving_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FeaturestoreOnlineServingServiceTracingStub : public FeaturestoreOnlineServingServiceStub { public: @@ -105,8 +106,6 @@ class FeaturestoreOnlineServingServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -122,4 +121,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_ONLINE_SERVING_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/featurestore_option_defaults.cc b/google/cloud/aiplatform/v1/internal/featurestore_option_defaults.cc index 1d65b624999ed..13ecf2fdc9234 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/featurestore_option_defaults.h" #include "google/cloud/aiplatform/v1/featurestore_connection.h" #include "google/cloud/aiplatform/v1/featurestore_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options FeaturestoreServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::FeaturestoreServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/featurestore_stub.cc b/google/cloud/aiplatform/v1/internal/featurestore_stub.cc index e55a7247f15e4..9902c24234c79 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_stub.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/featurestore_service.proto #include "google/cloud/aiplatform/v1/internal/featurestore_stub.h" +#include "google/cloud/aiplatform/v1/featurestore_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -672,3 +675,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/featurestore_stub.h b/google/cloud/aiplatform/v1/internal/featurestore_stub.h index 2edf9eed58974..94ad996d31999 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_stub.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_STUB_H +#include "google/cloud/aiplatform/v1/featurestore_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -560,4 +563,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/featurestore_stub_factory.cc b/google/cloud/aiplatform/v1/internal/featurestore_stub_factory.cc index fefe00b3dbceb..f6ef27aa8a4be 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/aiplatform/v1/featurestore_service.proto #include "google/cloud/aiplatform/v1/internal/featurestore_stub_factory.h" +#include "google/cloud/aiplatform/v1/featurestore_service.grpc.pb.h" #include "google/cloud/aiplatform/v1/internal/featurestore_auth_decorator.h" #include "google/cloud/aiplatform/v1/internal/featurestore_logging_decorator.h" #include "google/cloud/aiplatform/v1/internal/featurestore_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/featurestore_stub.h" #include "google/cloud/aiplatform/v1/internal/featurestore_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/featurestore_stub_factory.h b/google/cloud/aiplatform/v1/internal/featurestore_stub_factory.h index ed7e6a816744f..e532920739271 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/featurestore_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/featurestore_tracing_connection.cc index a616ea9ebeea3..7d340c7a532c3 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FeaturestoreServiceTracingConnection::FeaturestoreServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -582,17 +580,13 @@ FeaturestoreServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFeaturestoreServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/featurestore_tracing_connection.h b/google/cloud/aiplatform/v1/internal/featurestore_tracing_connection.h index 15853b5c74622..7183a998520f5 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FeaturestoreServiceTracingConnection : public aiplatform_v1::FeaturestoreServiceConnection { public: @@ -260,8 +258,6 @@ class FeaturestoreServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/featurestore_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/featurestore_tracing_stub.cc index 3083bcc9771cc..d7ae0eabc0665 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/featurestore_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FeaturestoreServiceTracingStub::FeaturestoreServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -611,18 +612,14 @@ future FeaturestoreServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFeaturestoreServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/featurestore_tracing_stub.h b/google/cloud/aiplatform/v1/internal/featurestore_tracing_stub.h index a57448bbc80da..3892f687e41b9 100644 --- a/google/cloud/aiplatform/v1/internal/featurestore_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/featurestore_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FeaturestoreServiceTracingStub : public FeaturestoreServiceStub { public: ~FeaturestoreServiceTracingStub() override = default; @@ -286,8 +287,6 @@ class FeaturestoreServiceTracingStub : public FeaturestoreServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -302,4 +301,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_FEATURESTORE_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_auth_decorator.cc index d3490880a4538..6050d077a483b 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/genai_tuning_service.proto #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/genai_tuning_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -218,3 +221,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_auth_decorator.h b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_auth_decorator.h index 685b885e767b1..e625f4190e75a 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -133,4 +136,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_GEN_AI_TUNING_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_connection_impl.h b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_connection_impl.h index 0dbaa5a496cb5..afba9f45d298d 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_logging_decorator.cc index 95f6c86fc02ec..df6215f899498 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/genai_tuning_service.proto #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_logging_decorator.h" +#include "google/cloud/aiplatform/v1/genai_tuning_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -273,3 +276,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_logging_decorator.h b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_logging_decorator.h index 72dc1ccc454d1..f6c6afdd841b5 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -133,4 +136,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_GEN_AI_TUNING_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_metadata_decorator.cc index d6c3abfccedf8..657b7ffc2e59e 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/genai_tuning_service.proto #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/genai_tuning_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -228,3 +232,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_metadata_decorator.h index 4fa43fb245c9c..b9adf6e22fe45 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -139,4 +142,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_GEN_AI_TUNING_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_option_defaults.cc b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_option_defaults.cc index 06e52dda73223..7bb3b59e61222 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_option_defaults.h" #include "google/cloud/aiplatform/v1/gen_ai_tuning_connection.h" #include "google/cloud/aiplatform/v1/gen_ai_tuning_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options GenAiTuningServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::GenAiTuningServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub.cc b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub.cc index 61728e12152e0..cdce4b7b6349b 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub.cc +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/genai_tuning_service.proto #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub.h" +#include "google/cloud/aiplatform/v1/genai_tuning_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -269,3 +272,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub.h b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub.h index 90995f0dfc97a..ce3e384402bd6 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub.h +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_GEN_AI_TUNING_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_GEN_AI_TUNING_STUB_H +#include "google/cloud/aiplatform/v1/genai_tuning_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -241,4 +244,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_GEN_AI_TUNING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub_factory.cc b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub_factory.cc index 67b1854720a07..db20792616363 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/aiplatform/v1/genai_tuning_service.proto #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub_factory.h" +#include "google/cloud/aiplatform/v1/genai_tuning_service.grpc.pb.h" #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_auth_decorator.h" #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_logging_decorator.h" #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub.h" #include "google/cloud/aiplatform/v1/internal/gen_ai_tuning_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub_factory.h b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub_factory.h index c898ccf282274..2887458bdcaa8 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_GEN_AI_TUNING_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_connection.cc index 04f4c25684838..cb2261d6865d7 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GenAiTuningServiceTracingConnection::GenAiTuningServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -192,17 +190,13 @@ GenAiTuningServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGenAiTuningServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_connection.h b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_connection.h index ef1d4f33daa34..fc8eed57f03ec 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GenAiTuningServiceTracingConnection : public aiplatform_v1::GenAiTuningServiceConnection { public: @@ -101,8 +99,6 @@ class GenAiTuningServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_stub.cc index db66cfdecfed0..26ca6450fa947 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GenAiTuningServiceTracingStub::GenAiTuningServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -250,18 +251,14 @@ future GenAiTuningServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGenAiTuningServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_stub.h b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_stub.h index 29ad1bdb690fd..9418dc9dc17ad 100644 --- a/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/gen_ai_tuning_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GenAiTuningServiceTracingStub : public GenAiTuningServiceStub { public: ~GenAiTuningServiceTracingStub() override = default; @@ -129,8 +130,6 @@ class GenAiTuningServiceTracingStub : public GenAiTuningServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -145,4 +144,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_GEN_AI_TUNING_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/index_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/index_auth_decorator.cc index 6f7bf9cdb718e..4a98befa2d035 100644 --- a/google/cloud/aiplatform/v1/internal/index_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/index_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/index_service.proto #include "google/cloud/aiplatform/v1/internal/index_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/index_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -273,3 +276,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/index_auth_decorator.h b/google/cloud/aiplatform/v1/internal/index_auth_decorator.h index 7d615341d6e85..84e1ec0428162 100644 --- a/google/cloud/aiplatform/v1/internal/index_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/index_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/index_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -156,4 +159,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/index_connection_impl.h b/google/cloud/aiplatform/v1/internal/index_connection_impl.h index 88f90b7a8bca9..f7148e72d0c00 100644 --- a/google/cloud/aiplatform/v1/internal/index_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/index_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/index_endpoint_auth_decorator.cc index 388da09f4b777..69bfbef2c8bae 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/index_endpoint_service.proto #include "google/cloud/aiplatform/v1/internal/index_endpoint_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/index_endpoint_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -327,3 +330,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_auth_decorator.h b/google/cloud/aiplatform/v1/internal/index_endpoint_auth_decorator.h index 9df9faadf5387..95b14b722e5b4 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/index_endpoint_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -177,4 +180,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_ENDPOINT_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_connection_impl.h b/google/cloud/aiplatform/v1/internal/index_endpoint_connection_impl.h index a9455057c8d48..1954d8c76b72e 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/index_endpoint_logging_decorator.cc index 83e0630fc4c59..b4f3306a9a098 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/index_endpoint_service.proto #include "google/cloud/aiplatform/v1/internal/index_endpoint_logging_decorator.h" +#include "google/cloud/aiplatform/v1/index_endpoint_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -387,3 +390,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_logging_decorator.h b/google/cloud/aiplatform/v1/internal/index_endpoint_logging_decorator.h index 807dd358d4e29..9c20ae2d5fb87 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/index_endpoint_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -177,4 +180,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_ENDPOINT_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/index_endpoint_metadata_decorator.cc index 565e93006d0c7..90207132a65be 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/index_endpoint_service.proto #include "google/cloud/aiplatform/v1/internal/index_endpoint_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/index_endpoint_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -312,3 +316,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/index_endpoint_metadata_decorator.h index 43b5f368e9119..b73676228710a 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/index_endpoint_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -183,4 +186,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_ENDPOINT_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_option_defaults.cc b/google/cloud/aiplatform/v1/internal/index_endpoint_option_defaults.cc index 00c0e23fc14de..9a3fc76fc427d 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/index_endpoint_option_defaults.h" #include "google/cloud/aiplatform/v1/index_endpoint_connection.h" #include "google/cloud/aiplatform/v1/index_endpoint_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options IndexEndpointServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::IndexEndpointServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_stub.cc b/google/cloud/aiplatform/v1/internal/index_endpoint_stub.cc index 8e88bb310273e..98572be2f1152 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_stub.cc +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/index_endpoint_service.proto #include "google/cloud/aiplatform/v1/internal/index_endpoint_stub.h" +#include "google/cloud/aiplatform/v1/index_endpoint_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -380,3 +383,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_stub.h b/google/cloud/aiplatform/v1/internal/index_endpoint_stub.h index 925d944cf9158..938bc63d7d90f 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_stub.h +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_ENDPOINT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_ENDPOINT_STUB_H +#include "google/cloud/aiplatform/v1/index_endpoint_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -331,4 +334,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_ENDPOINT_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_stub_factory.cc b/google/cloud/aiplatform/v1/internal/index_endpoint_stub_factory.cc index 85076d33ee753..afdb0b8401e84 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/aiplatform/v1/index_endpoint_service.proto #include "google/cloud/aiplatform/v1/internal/index_endpoint_stub_factory.h" +#include "google/cloud/aiplatform/v1/index_endpoint_service.grpc.pb.h" #include "google/cloud/aiplatform/v1/internal/index_endpoint_auth_decorator.h" #include "google/cloud/aiplatform/v1/internal/index_endpoint_logging_decorator.h" #include "google/cloud/aiplatform/v1/internal/index_endpoint_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/index_endpoint_stub.h" #include "google/cloud/aiplatform/v1/internal/index_endpoint_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_stub_factory.h b/google/cloud/aiplatform/v1/internal/index_endpoint_stub_factory.h index da11d6892a7d0..2e868cf8f0398 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_ENDPOINT_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_connection.cc index eda5cfea4d0a9..a7247f4307a5f 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IndexEndpointServiceTracingConnection::IndexEndpointServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -304,17 +302,13 @@ IndexEndpointServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIndexEndpointServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_connection.h b/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_connection.h index 6e52b5bebbc76..c693fbbc4c93e 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IndexEndpointServiceTracingConnection : public aiplatform_v1::IndexEndpointServiceConnection { public: @@ -149,8 +147,6 @@ class IndexEndpointServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_stub.cc index 0c6ebc04e7ed2..ad50c54e6c2f0 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IndexEndpointServiceTracingStub::IndexEndpointServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -345,18 +346,14 @@ future IndexEndpointServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIndexEndpointServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_stub.h b/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_stub.h index 3253974c179c7..0310c2c84ac52 100644 --- a/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/index_endpoint_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IndexEndpointServiceTracingStub : public IndexEndpointServiceStub { public: ~IndexEndpointServiceTracingStub() override = default; @@ -173,8 +174,6 @@ class IndexEndpointServiceTracingStub : public IndexEndpointServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -189,4 +188,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_ENDPOINT_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/index_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/index_logging_decorator.cc index a0317bf9a67ea..e96da96d64400 100644 --- a/google/cloud/aiplatform/v1/internal/index_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/index_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/index_service.proto #include "google/cloud/aiplatform/v1/internal/index_logging_decorator.h" +#include "google/cloud/aiplatform/v1/index_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -323,3 +326,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/index_logging_decorator.h b/google/cloud/aiplatform/v1/internal/index_logging_decorator.h index ff27751de1f6a..d291daeb90a25 100644 --- a/google/cloud/aiplatform/v1/internal/index_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/index_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/index_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -156,4 +159,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/index_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/index_metadata_decorator.cc index 512b560c07978..ca222c89d75b9 100644 --- a/google/cloud/aiplatform/v1/internal/index_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/index_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/index_service.proto #include "google/cloud/aiplatform/v1/internal/index_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/index_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -266,3 +270,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/index_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/index_metadata_decorator.h index 60b3115519c75..ebf0e9521fff8 100644 --- a/google/cloud/aiplatform/v1/internal/index_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/index_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/index_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -161,4 +164,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/index_option_defaults.cc b/google/cloud/aiplatform/v1/internal/index_option_defaults.cc index e9236d8a1d025..711597e128a30 100644 --- a/google/cloud/aiplatform/v1/internal/index_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/index_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/index_option_defaults.h" #include "google/cloud/aiplatform/v1/index_connection.h" #include "google/cloud/aiplatform/v1/index_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options IndexServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::IndexServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/index_stub.cc b/google/cloud/aiplatform/v1/internal/index_stub.cc index b09586e01527f..e106d3d4d4329 100644 --- a/google/cloud/aiplatform/v1/internal/index_stub.cc +++ b/google/cloud/aiplatform/v1/internal/index_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/index_service.proto #include "google/cloud/aiplatform/v1/internal/index_stub.h" +#include "google/cloud/aiplatform/v1/index_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -324,3 +327,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/index_stub.h b/google/cloud/aiplatform/v1/internal/index_stub.h index 00685327e71be..ad547ab571329 100644 --- a/google/cloud/aiplatform/v1/internal/index_stub.h +++ b/google/cloud/aiplatform/v1/internal/index_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_STUB_H +#include "google/cloud/aiplatform/v1/index_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -282,4 +285,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/index_stub_factory.cc b/google/cloud/aiplatform/v1/internal/index_stub_factory.cc index 942271ee114ba..8e0fa7011ae02 100644 --- a/google/cloud/aiplatform/v1/internal/index_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/index_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/aiplatform/v1/index_service.proto #include "google/cloud/aiplatform/v1/internal/index_stub_factory.h" +#include "google/cloud/aiplatform/v1/index_service.grpc.pb.h" #include "google/cloud/aiplatform/v1/internal/index_auth_decorator.h" #include "google/cloud/aiplatform/v1/internal/index_logging_decorator.h" #include "google/cloud/aiplatform/v1/internal/index_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/index_stub.h" #include "google/cloud/aiplatform/v1/internal/index_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/index_stub_factory.h b/google/cloud/aiplatform/v1/internal/index_stub_factory.h index ff8861e65d2cd..eb75d103d00dd 100644 --- a/google/cloud/aiplatform/v1/internal/index_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/index_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/index_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/index_tracing_connection.cc index 63e47c99bcd79..360562d2365ff 100644 --- a/google/cloud/aiplatform/v1/internal/index_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/index_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IndexServiceTracingConnection::IndexServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -245,16 +243,12 @@ IndexServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIndexServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/index_tracing_connection.h b/google/cloud/aiplatform/v1/internal/index_tracing_connection.h index b8762c0754e54..22ec0fa1985c4 100644 --- a/google/cloud/aiplatform/v1/internal/index_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/index_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IndexServiceTracingConnection : public aiplatform_v1::IndexServiceConnection { public: @@ -124,8 +122,6 @@ class IndexServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/index_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/index_tracing_stub.cc index d97b44f113337..7e29f7c30c014 100644 --- a/google/cloud/aiplatform/v1/internal/index_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/index_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IndexServiceTracingStub::IndexServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -297,18 +298,14 @@ future IndexServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIndexServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/index_tracing_stub.h b/google/cloud/aiplatform/v1/internal/index_tracing_stub.h index f56724dd48c5b..e5c6f40835782 100644 --- a/google/cloud/aiplatform/v1/internal/index_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/index_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IndexServiceTracingStub : public IndexServiceStub { public: ~IndexServiceTracingStub() override = default; @@ -151,8 +152,6 @@ class IndexServiceTracingStub : public IndexServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -167,4 +166,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_INDEX_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/job_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/job_auth_decorator.cc index 6618f31d44575..8862107184c74 100644 --- a/google/cloud/aiplatform/v1/internal/job_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/job_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/job_service.proto #include "google/cloud/aiplatform/v1/internal/job_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/job_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -625,3 +628,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/job_auth_decorator.h b/google/cloud/aiplatform/v1/internal/job_auth_decorator.h index b9b9db5971119..28bbe177316f3 100644 --- a/google/cloud/aiplatform/v1/internal/job_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/job_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/job_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -343,4 +346,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_JOB_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/job_connection_impl.h b/google/cloud/aiplatform/v1/internal/job_connection_impl.h index 4a1e9093b9a7b..6b75e793f521d 100644 --- a/google/cloud/aiplatform/v1/internal/job_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/job_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/job_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/job_logging_decorator.cc index 7246f93d8cded..f66f548916820 100644 --- a/google/cloud/aiplatform/v1/internal/job_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/job_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/job_service.proto #include "google/cloud/aiplatform/v1/internal/job_logging_decorator.h" +#include "google/cloud/aiplatform/v1/job_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -804,3 +807,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/job_logging_decorator.h b/google/cloud/aiplatform/v1/internal/job_logging_decorator.h index ceb3aaa9986e8..7eb573ad57f78 100644 --- a/google/cloud/aiplatform/v1/internal/job_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/job_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/job_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -343,4 +346,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_JOB_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/job_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/job_metadata_decorator.cc index bbbb689befcde..fd36c946083f5 100644 --- a/google/cloud/aiplatform/v1/internal/job_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/job_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/job_service.proto #include "google/cloud/aiplatform/v1/internal/job_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/job_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -595,3 +599,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/job_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/job_metadata_decorator.h index 9cecf5e666b98..5873ec810e789 100644 --- a/google/cloud/aiplatform/v1/internal/job_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/job_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/job_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -348,4 +351,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_JOB_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/job_option_defaults.cc b/google/cloud/aiplatform/v1/internal/job_option_defaults.cc index fd695ebe1c565..7d0b511625f4d 100644 --- a/google/cloud/aiplatform/v1/internal/job_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/job_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/job_option_defaults.h" #include "google/cloud/aiplatform/v1/job_connection.h" #include "google/cloud/aiplatform/v1/job_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options JobServiceDefaultOptions(std::string const& location, Options options) { if (!options.has()) { options.set( aiplatform_v1::JobServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/job_stub.cc b/google/cloud/aiplatform/v1/internal/job_stub.cc index 6df2a36a6e0d8..ca56f0b80b262 100644 --- a/google/cloud/aiplatform/v1/internal/job_stub.cc +++ b/google/cloud/aiplatform/v1/internal/job_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/job_service.proto #include "google/cloud/aiplatform/v1/internal/job_stub.h" +#include "google/cloud/aiplatform/v1/job_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -782,3 +785,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/job_stub.h b/google/cloud/aiplatform/v1/internal/job_stub.h index 7c40ff6eafef5..f7a2d2d3d5e63 100644 --- a/google/cloud/aiplatform/v1/internal/job_stub.h +++ b/google/cloud/aiplatform/v1/internal/job_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_JOB_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_JOB_STUB_H +#include "google/cloud/aiplatform/v1/job_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -661,4 +664,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_JOB_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/job_stub_factory.cc b/google/cloud/aiplatform/v1/internal/job_stub_factory.cc index 701d198f483f0..f270d9fb5cb34 100644 --- a/google/cloud/aiplatform/v1/internal/job_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/job_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/job_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/job_stub.h" #include "google/cloud/aiplatform/v1/internal/job_tracing_stub.h" +#include "google/cloud/aiplatform/v1/job_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/job_stub_factory.h b/google/cloud/aiplatform/v1/internal/job_stub_factory.h index 4044390d24498..b98bf8bd7ae5a 100644 --- a/google/cloud/aiplatform/v1/internal/job_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/job_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_JOB_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/job_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/job_tracing_connection.cc index 653d4fe2aab00..bb0e5702ea31d 100644 --- a/google/cloud/aiplatform/v1/internal/job_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/job_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - JobServiceTracingConnection::JobServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -641,16 +639,12 @@ JobServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeJobServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/job_tracing_connection.h b/google/cloud/aiplatform/v1/internal/job_tracing_connection.h index 04da12fc38384..e0a3d5328f206 100644 --- a/google/cloud/aiplatform/v1/internal/job_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/job_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class JobServiceTracingConnection : public aiplatform_v1::JobServiceConnection { public: ~JobServiceTracingConnection() override = default; @@ -288,8 +286,6 @@ class JobServiceTracingConnection : public aiplatform_v1::JobServiceConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/job_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/job_tracing_stub.cc index 0898fa7512a9a..c6eda876dc560 100644 --- a/google/cloud/aiplatform/v1/internal/job_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/job_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - JobServiceTracingStub::JobServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -735,18 +736,14 @@ future JobServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeJobServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/job_tracing_stub.h b/google/cloud/aiplatform/v1/internal/job_tracing_stub.h index fb656016fe6ad..2e01bce37656a 100644 --- a/google/cloud/aiplatform/v1/internal/job_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/job_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class JobServiceTracingStub : public JobServiceStub { public: ~JobServiceTracingStub() override = default; @@ -338,8 +339,6 @@ class JobServiceTracingStub : public JobServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -354,4 +353,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_JOB_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/llm_utility_auth_decorator.cc index 0b3f3b0b3d80a..bd1abca29d5ad 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/llm_utility_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/llm_utility_service.proto #include "google/cloud/aiplatform/v1/internal/llm_utility_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/llm_utility_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -136,3 +139,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_auth_decorator.h b/google/cloud/aiplatform/v1/internal/llm_utility_auth_decorator.h index 313b1633c078c..44907257fa863 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/llm_utility_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -98,4 +101,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_LLM_UTILITY_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/llm_utility_logging_decorator.cc index 70061887b3012..b392dda401a80 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/llm_utility_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/llm_utility_service.proto #include "google/cloud/aiplatform/v1/internal/llm_utility_logging_decorator.h" +#include "google/cloud/aiplatform/v1/llm_utility_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -179,3 +182,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_logging_decorator.h b/google/cloud/aiplatform/v1/internal/llm_utility_logging_decorator.h index 67e869dd373e6..ad8a092993470 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/llm_utility_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -98,4 +101,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_LLM_UTILITY_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/llm_utility_metadata_decorator.cc index 717f722c77191..dc609589f0104 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/llm_utility_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/llm_utility_service.proto #include "google/cloud/aiplatform/v1/internal/llm_utility_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/llm_utility_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -169,3 +173,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/llm_utility_metadata_decorator.h index d423f5a540ead..38d35d1e17521 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/llm_utility_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_LLM_UTILITY_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_option_defaults.cc b/google/cloud/aiplatform/v1/internal/llm_utility_option_defaults.cc index b9794c422f7f5..e4e09bbbba719 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/llm_utility_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/llm_utility_option_defaults.h" #include "google/cloud/aiplatform/v1/llm_utility_connection.h" #include "google/cloud/aiplatform/v1/llm_utility_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options LlmUtilityServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::LlmUtilityServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_stub.cc b/google/cloud/aiplatform/v1/internal/llm_utility_stub.cc index 8ee839c47f102..8a5ef006f5753 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_stub.cc +++ b/google/cloud/aiplatform/v1/internal/llm_utility_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/aiplatform/v1/llm_utility_service.proto #include "google/cloud/aiplatform/v1/internal/llm_utility_stub.h" +#include "google/cloud/aiplatform/v1/llm_utility_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -175,3 +178,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_stub.h b/google/cloud/aiplatform/v1/internal/llm_utility_stub.h index 01e3c91d90f77..9b2d18b823dea 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_stub.h +++ b/google/cloud/aiplatform/v1/internal/llm_utility_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_LLM_UTILITY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_LLM_UTILITY_STUB_H +#include "google/cloud/aiplatform/v1/llm_utility_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -173,4 +176,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_LLM_UTILITY_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_stub_factory.cc b/google/cloud/aiplatform/v1/internal/llm_utility_stub_factory.cc index c842326478816..ab2a3085cade6 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/llm_utility_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/llm_utility_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/llm_utility_stub.h" #include "google/cloud/aiplatform/v1/internal/llm_utility_tracing_stub.h" +#include "google/cloud/aiplatform/v1/llm_utility_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_stub_factory.h b/google/cloud/aiplatform/v1/internal/llm_utility_stub_factory.h index 62a69bca27904..399bf39051faf 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/llm_utility_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_LLM_UTILITY_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/llm_utility_tracing_connection.cc index c87ebad3c7479..33837f38fa214 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/llm_utility_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LlmUtilityServiceTracingConnection::LlmUtilityServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -143,17 +141,13 @@ LlmUtilityServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLlmUtilityServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_tracing_connection.h b/google/cloud/aiplatform/v1/internal/llm_utility_tracing_connection.h index ce19704faf7f0..0d5a7e2be99fb 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/llm_utility_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LlmUtilityServiceTracingConnection : public aiplatform_v1::LlmUtilityServiceConnection { public: @@ -82,8 +80,6 @@ class LlmUtilityServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/llm_utility_tracing_stub.cc index d6b3f67afd1eb..e4131f77802e5 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/llm_utility_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LlmUtilityServiceTracingStub::LlmUtilityServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -172,18 +173,14 @@ LlmUtilityServiceTracingStub::WaitOperation( child_->WaitOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLlmUtilityServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/llm_utility_tracing_stub.h b/google/cloud/aiplatform/v1/internal/llm_utility_tracing_stub.h index 73d3c59dc56e5..40b54f9c7e39b 100644 --- a/google/cloud/aiplatform/v1/internal/llm_utility_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/llm_utility_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LlmUtilityServiceTracingStub : public LlmUtilityServiceStub { public: ~LlmUtilityServiceTracingStub() override = default; @@ -95,8 +96,6 @@ class LlmUtilityServiceTracingStub : public LlmUtilityServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -111,4 +110,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_LLM_UTILITY_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/match_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/match_auth_decorator.cc index 169a2aad33276..14b3f1ea44ce2 100644 --- a/google/cloud/aiplatform/v1/internal/match_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/match_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/match_service.proto #include "google/cloud/aiplatform/v1/internal/match_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/match_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -136,3 +139,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/match_auth_decorator.h b/google/cloud/aiplatform/v1/internal/match_auth_decorator.h index 2251b55d9da20..5bc9c8ca65ac7 100644 --- a/google/cloud/aiplatform/v1/internal/match_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/match_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MATCH_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/match_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/match_logging_decorator.cc index 07b6461e09bb8..ab004efce4855 100644 --- a/google/cloud/aiplatform/v1/internal/match_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/match_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/match_service.proto #include "google/cloud/aiplatform/v1/internal/match_logging_decorator.h" +#include "google/cloud/aiplatform/v1/match_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -178,3 +181,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/match_logging_decorator.h b/google/cloud/aiplatform/v1/internal/match_logging_decorator.h index b1b503c7139b6..7e61d5854b3ab 100644 --- a/google/cloud/aiplatform/v1/internal/match_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/match_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MATCH_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/match_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/match_metadata_decorator.cc index 3a9b866f30ad6..f06c05679ac55 100644 --- a/google/cloud/aiplatform/v1/internal/match_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/match_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/match_service.proto #include "google/cloud/aiplatform/v1/internal/match_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/match_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -166,3 +170,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/match_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/match_metadata_decorator.h index ab3c176f80985..6b4ac23b18e77 100644 --- a/google/cloud/aiplatform/v1/internal/match_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/match_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MATCH_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/match_option_defaults.cc b/google/cloud/aiplatform/v1/internal/match_option_defaults.cc index b3c6dde6f3761..2789ba584adfd 100644 --- a/google/cloud/aiplatform/v1/internal/match_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/match_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/match_option_defaults.h" #include "google/cloud/aiplatform/v1/match_connection.h" #include "google/cloud/aiplatform/v1/match_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options MatchServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::MatchServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/match_stub.cc b/google/cloud/aiplatform/v1/internal/match_stub.cc index 01c5625626eb5..7df509d0615ff 100644 --- a/google/cloud/aiplatform/v1/internal/match_stub.cc +++ b/google/cloud/aiplatform/v1/internal/match_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/aiplatform/v1/match_service.proto #include "google/cloud/aiplatform/v1/internal/match_stub.h" +#include "google/cloud/aiplatform/v1/match_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -173,3 +176,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/match_stub.h b/google/cloud/aiplatform/v1/internal/match_stub.h index 1f873ad330e02..5e5bcd0596219 100644 --- a/google/cloud/aiplatform/v1/internal/match_stub.h +++ b/google/cloud/aiplatform/v1/internal/match_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MATCH_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MATCH_STUB_H +#include "google/cloud/aiplatform/v1/match_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -174,4 +177,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MATCH_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/match_stub_factory.cc b/google/cloud/aiplatform/v1/internal/match_stub_factory.cc index ddc23fb9581ed..ca5a47e0e5bc5 100644 --- a/google/cloud/aiplatform/v1/internal/match_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/match_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/match_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/match_stub.h" #include "google/cloud/aiplatform/v1/internal/match_tracing_stub.h" +#include "google/cloud/aiplatform/v1/match_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/match_stub_factory.h b/google/cloud/aiplatform/v1/internal/match_stub_factory.h index 807a800868956..860e4ae693421 100644 --- a/google/cloud/aiplatform/v1/internal/match_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/match_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MATCH_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/match_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/match_tracing_connection.cc index 11f580130ac5a..f728c37b97711 100644 --- a/google/cloud/aiplatform/v1/internal/match_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/match_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MatchServiceTracingConnection::MatchServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -141,16 +139,12 @@ MatchServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMatchServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/match_tracing_connection.h b/google/cloud/aiplatform/v1/internal/match_tracing_connection.h index 9fde896895324..b17e70a144cbf 100644 --- a/google/cloud/aiplatform/v1/internal/match_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/match_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MatchServiceTracingConnection : public aiplatform_v1::MatchServiceConnection { public: @@ -83,8 +81,6 @@ class MatchServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/match_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/match_tracing_stub.cc index ac69ace20446d..fb1260cad8cc9 100644 --- a/google/cloud/aiplatform/v1/internal/match_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/match_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MatchServiceTracingStub::MatchServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -170,18 +171,14 @@ StatusOr MatchServiceTracingStub::WaitOperation( child_->WaitOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMatchServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/match_tracing_stub.h b/google/cloud/aiplatform/v1/internal/match_tracing_stub.h index af9f24428d6dc..cf7dd70303d94 100644 --- a/google/cloud/aiplatform/v1/internal/match_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/match_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MatchServiceTracingStub : public MatchServiceStub { public: ~MatchServiceTracingStub() override = default; @@ -95,8 +96,6 @@ class MatchServiceTracingStub : public MatchServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -111,4 +110,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MATCH_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/metadata_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/metadata_auth_decorator.cc index bca5649794111..7580e61d49703 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/metadata_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/metadata_service.proto #include "google/cloud/aiplatform/v1/internal/metadata_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/metadata_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -602,3 +605,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/metadata_auth_decorator.h b/google/cloud/aiplatform/v1/internal/metadata_auth_decorator.h index 75ffb3cbcc251..8cd76c64ec917 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/metadata_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/metadata_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -326,4 +329,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_METADATA_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/metadata_connection_impl.h b/google/cloud/aiplatform/v1/internal/metadata_connection_impl.h index 0584c00d57a1d..65cb9578ae25e 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/metadata_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/metadata_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/metadata_logging_decorator.cc index 8f8c1954c23b9..ce50dcf6ec647 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/metadata_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/metadata_service.proto #include "google/cloud/aiplatform/v1/internal/metadata_logging_decorator.h" +#include "google/cloud/aiplatform/v1/metadata_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -757,3 +760,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/metadata_logging_decorator.h b/google/cloud/aiplatform/v1/internal/metadata_logging_decorator.h index d362e4b8e434b..2f500a2ec6ea8 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/metadata_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/metadata_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -326,4 +329,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_METADATA_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/metadata_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/metadata_metadata_decorator.cc index d682e4451e579..d1ea5eb51bf54 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/metadata_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/metadata_service.proto #include "google/cloud/aiplatform/v1/internal/metadata_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/metadata_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -564,3 +568,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/metadata_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/metadata_metadata_decorator.h index bed00b283513d..73baaa4d4f796 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/metadata_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/metadata_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -332,4 +335,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_METADATA_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/metadata_option_defaults.cc b/google/cloud/aiplatform/v1/internal/metadata_option_defaults.cc index 61bcdea95edcf..c800e41aede8c 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/metadata_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/metadata_option_defaults.h" #include "google/cloud/aiplatform/v1/metadata_connection.h" #include "google/cloud/aiplatform/v1/metadata_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options MetadataServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::MetadataServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/metadata_stub.cc b/google/cloud/aiplatform/v1/internal/metadata_stub.cc index e58c05ad4ff57..648bea70979ab 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_stub.cc +++ b/google/cloud/aiplatform/v1/internal/metadata_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/metadata_service.proto #include "google/cloud/aiplatform/v1/internal/metadata_stub.h" +#include "google/cloud/aiplatform/v1/metadata_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -736,3 +739,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/metadata_stub.h b/google/cloud/aiplatform/v1/internal/metadata_stub.h index d529b6e7f23fb..72a5584eed4b8 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_stub.h +++ b/google/cloud/aiplatform/v1/internal/metadata_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_METADATA_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_METADATA_STUB_H +#include "google/cloud/aiplatform/v1/metadata_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -612,4 +615,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_METADATA_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/metadata_stub_factory.cc b/google/cloud/aiplatform/v1/internal/metadata_stub_factory.cc index a65abdf6bed7c..76722749f8807 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/metadata_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/metadata_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/metadata_stub.h" #include "google/cloud/aiplatform/v1/internal/metadata_tracing_stub.h" +#include "google/cloud/aiplatform/v1/metadata_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/metadata_stub_factory.h b/google/cloud/aiplatform/v1/internal/metadata_stub_factory.h index 01bd8cfcc3b39..98a579c5533c7 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/metadata_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_METADATA_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/metadata_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/metadata_tracing_connection.cc index 2633507caf6a5..b4cc74ef433ad 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/metadata_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MetadataServiceTracingConnection::MetadataServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -600,16 +598,12 @@ MetadataServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMetadataServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/metadata_tracing_connection.h b/google/cloud/aiplatform/v1/internal/metadata_tracing_connection.h index f0958482808da..2de74ef303fcd 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/metadata_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MetadataServiceTracingConnection : public aiplatform_v1::MetadataServiceConnection { public: @@ -274,8 +272,6 @@ class MetadataServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/metadata_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/metadata_tracing_stub.cc index 267484029bc4d..f48da7508b814 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/metadata_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MetadataServiceTracingStub::MetadataServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -692,18 +693,14 @@ future MetadataServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMetadataServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/metadata_tracing_stub.h b/google/cloud/aiplatform/v1/internal/metadata_tracing_stub.h index f5612096e0300..5ecd3d803a6c6 100644 --- a/google/cloud/aiplatform/v1/internal/metadata_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/metadata_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MetadataServiceTracingStub : public MetadataServiceStub { public: ~MetadataServiceTracingStub() override = default; @@ -322,8 +323,6 @@ class MetadataServiceTracingStub : public MetadataServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -338,4 +337,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_METADATA_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/migration_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/migration_auth_decorator.cc index b979a135d774f..906ec48cf451a 100644 --- a/google/cloud/aiplatform/v1/internal/migration_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/migration_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/migration_service.proto #include "google/cloud/aiplatform/v1/internal/migration_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/migration_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -195,3 +198,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/migration_auth_decorator.h b/google/cloud/aiplatform/v1/internal/migration_auth_decorator.h index 9cd7bfc76b989..1c43be6ab2502 100644 --- a/google/cloud/aiplatform/v1/internal/migration_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/migration_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/migration_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -119,4 +122,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MIGRATION_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/migration_connection_impl.h b/google/cloud/aiplatform/v1/internal/migration_connection_impl.h index 945462fa06fad..372d6a41759c7 100644 --- a/google/cloud/aiplatform/v1/internal/migration_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/migration_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/migration_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/migration_logging_decorator.cc index c79c84beda3b1..79abcf987701e 100644 --- a/google/cloud/aiplatform/v1/internal/migration_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/migration_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/migration_service.proto #include "google/cloud/aiplatform/v1/internal/migration_logging_decorator.h" +#include "google/cloud/aiplatform/v1/migration_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -237,3 +240,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/migration_logging_decorator.h b/google/cloud/aiplatform/v1/internal/migration_logging_decorator.h index a1b5aa18c5635..e926e975eabbc 100644 --- a/google/cloud/aiplatform/v1/internal/migration_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/migration_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/migration_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -119,4 +122,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MIGRATION_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/migration_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/migration_metadata_decorator.cc index fd58fa7db4557..e40291cc2bab6 100644 --- a/google/cloud/aiplatform/v1/internal/migration_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/migration_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/migration_service.proto #include "google/cloud/aiplatform/v1/internal/migration_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/migration_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -204,3 +208,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/migration_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/migration_metadata_decorator.h index b6d1549b80f31..73acb0d8cfc5c 100644 --- a/google/cloud/aiplatform/v1/internal/migration_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/migration_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/migration_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -125,4 +128,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MIGRATION_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/migration_option_defaults.cc b/google/cloud/aiplatform/v1/internal/migration_option_defaults.cc index 0e4babe6fff0a..42e037acd0489 100644 --- a/google/cloud/aiplatform/v1/internal/migration_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/migration_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/migration_option_defaults.h" #include "google/cloud/aiplatform/v1/migration_connection.h" #include "google/cloud/aiplatform/v1/migration_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options MigrationServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::MigrationServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/migration_stub.cc b/google/cloud/aiplatform/v1/internal/migration_stub.cc index c0ec77ab7f8ec..cd775dc549a74 100644 --- a/google/cloud/aiplatform/v1/internal/migration_stub.cc +++ b/google/cloud/aiplatform/v1/internal/migration_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/migration_service.proto #include "google/cloud/aiplatform/v1/internal/migration_stub.h" +#include "google/cloud/aiplatform/v1/migration_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -238,3 +241,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/migration_stub.h b/google/cloud/aiplatform/v1/internal/migration_stub.h index 828fb58c7b8c2..617538f2df6db 100644 --- a/google/cloud/aiplatform/v1/internal/migration_stub.h +++ b/google/cloud/aiplatform/v1/internal/migration_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MIGRATION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MIGRATION_STUB_H +#include "google/cloud/aiplatform/v1/migration_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -217,4 +220,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MIGRATION_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/migration_stub_factory.cc b/google/cloud/aiplatform/v1/internal/migration_stub_factory.cc index ff538294f5e42..a5520b371ba40 100644 --- a/google/cloud/aiplatform/v1/internal/migration_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/migration_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/migration_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/migration_stub.h" #include "google/cloud/aiplatform/v1/internal/migration_tracing_stub.h" +#include "google/cloud/aiplatform/v1/migration_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/migration_stub_factory.h b/google/cloud/aiplatform/v1/internal/migration_stub_factory.h index 5cddee33bf640..350d152b9c7fe 100644 --- a/google/cloud/aiplatform/v1/internal/migration_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/migration_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MIGRATION_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/migration_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/migration_tracing_connection.cc index 21aa88a6a5a81..5058c920c796d 100644 --- a/google/cloud/aiplatform/v1/internal/migration_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/migration_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MigrationServiceTracingConnection::MigrationServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -170,16 +168,12 @@ MigrationServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMigrationServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/migration_tracing_connection.h b/google/cloud/aiplatform/v1/internal/migration_tracing_connection.h index 68b4edd35e6c4..cd75d6801cafc 100644 --- a/google/cloud/aiplatform/v1/internal/migration_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/migration_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MigrationServiceTracingConnection : public aiplatform_v1::MigrationServiceConnection { public: @@ -93,8 +91,6 @@ class MigrationServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/migration_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/migration_tracing_stub.cc index 27f46567ec427..7b1ee2688cd93 100644 --- a/google/cloud/aiplatform/v1/internal/migration_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/migration_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MigrationServiceTracingStub::MigrationServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -220,18 +221,14 @@ future MigrationServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMigrationServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/migration_tracing_stub.h b/google/cloud/aiplatform/v1/internal/migration_tracing_stub.h index 340b34282df10..47143dec81565 100644 --- a/google/cloud/aiplatform/v1/internal/migration_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/migration_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MigrationServiceTracingStub : public MigrationServiceStub { public: ~MigrationServiceTracingStub() override = default; @@ -115,8 +116,6 @@ class MigrationServiceTracingStub : public MigrationServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -131,4 +130,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MIGRATION_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/model_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/model_auth_decorator.cc index 8e7c4758591bd..cdd760719489f 100644 --- a/google/cloud/aiplatform/v1/internal/model_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/model_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/model_service.proto #include "google/cloud/aiplatform/v1/internal/model_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/model_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -447,3 +450,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/model_auth_decorator.h b/google/cloud/aiplatform/v1/internal/model_auth_decorator.h index 2a18d231572a4..90efd5dc21c47 100644 --- a/google/cloud/aiplatform/v1/internal/model_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/model_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/model_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -245,4 +248,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/model_connection_impl.h b/google/cloud/aiplatform/v1/internal/model_connection_impl.h index d7bad7c0ec829..eb3936cefdee1 100644 --- a/google/cloud/aiplatform/v1/internal/model_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/model_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/model_garden_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/model_garden_auth_decorator.cc index 8364d719db038..850c92bf7ef05 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/model_garden_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/model_garden_service.proto #include "google/cloud/aiplatform/v1/internal/model_garden_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/model_garden_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -191,3 +194,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/model_garden_auth_decorator.h b/google/cloud/aiplatform/v1/internal/model_garden_auth_decorator.h index 35316c8707bde..6154a42bee9d2 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/model_garden_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/model_garden_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -116,4 +119,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_GARDEN_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/model_garden_connection_impl.h b/google/cloud/aiplatform/v1/internal/model_garden_connection_impl.h index aa284dbf3b901..6dec955b26cce 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/model_garden_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/model_garden_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/model_garden_logging_decorator.cc index 054023dc5e905..91e2fbcfc065f 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/model_garden_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/model_garden_service.proto #include "google/cloud/aiplatform/v1/internal/model_garden_logging_decorator.h" +#include "google/cloud/aiplatform/v1/model_garden_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -232,3 +235,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/model_garden_logging_decorator.h b/google/cloud/aiplatform/v1/internal/model_garden_logging_decorator.h index b4931ca211f14..386e56dd8300a 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/model_garden_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/model_garden_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -116,4 +119,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_GARDEN_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/model_garden_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/model_garden_metadata_decorator.cc index 99d47433413bd..6e9e0e3ac6cf0 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/model_garden_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/model_garden_service.proto #include "google/cloud/aiplatform/v1/internal/model_garden_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/model_garden_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -203,3 +207,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/model_garden_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/model_garden_metadata_decorator.h index 5e05533b329dc..98eaa8b12bcf0 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/model_garden_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/model_garden_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -122,4 +125,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_GARDEN_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/model_garden_option_defaults.cc b/google/cloud/aiplatform/v1/internal/model_garden_option_defaults.cc index c848813b19396..d0b80799a7d28 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/model_garden_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/model_garden_option_defaults.h" #include "google/cloud/aiplatform/v1/model_garden_connection.h" #include "google/cloud/aiplatform/v1/model_garden_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options ModelGardenServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::ModelGardenServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/model_garden_stub.cc b/google/cloud/aiplatform/v1/internal/model_garden_stub.cc index 1dae9ace2d294..95e05bfa5563c 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_stub.cc +++ b/google/cloud/aiplatform/v1/internal/model_garden_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/model_garden_service.proto #include "google/cloud/aiplatform/v1/internal/model_garden_stub.h" +#include "google/cloud/aiplatform/v1/model_garden_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -232,3 +235,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/model_garden_stub.h b/google/cloud/aiplatform/v1/internal/model_garden_stub.h index 6fe4bf9517d12..99903e6dd7e09 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_stub.h +++ b/google/cloud/aiplatform/v1/internal/model_garden_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_GARDEN_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_GARDEN_STUB_H +#include "google/cloud/aiplatform/v1/model_garden_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -210,4 +213,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_GARDEN_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/model_garden_stub_factory.cc b/google/cloud/aiplatform/v1/internal/model_garden_stub_factory.cc index e5aa9ba918298..346513aaea1c1 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/model_garden_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/model_garden_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/model_garden_stub.h" #include "google/cloud/aiplatform/v1/internal/model_garden_tracing_stub.h" +#include "google/cloud/aiplatform/v1/model_garden_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/model_garden_stub_factory.h b/google/cloud/aiplatform/v1/internal/model_garden_stub_factory.h index 79f2ef2fc0050..cdff0cfb4ed60 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/model_garden_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_GARDEN_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/model_garden_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/model_garden_tracing_connection.cc index a22a9ab0e01c9..621b284e33f82 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/model_garden_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ModelGardenServiceTracingConnection::ModelGardenServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -161,17 +159,13 @@ ModelGardenServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeModelGardenServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/model_garden_tracing_connection.h b/google/cloud/aiplatform/v1/internal/model_garden_tracing_connection.h index bd1849a45228c..9deab23d3cf71 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/model_garden_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ModelGardenServiceTracingConnection : public aiplatform_v1::ModelGardenServiceConnection { public: @@ -88,8 +86,6 @@ class ModelGardenServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/model_garden_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/model_garden_tracing_stub.cc index 1204881fdd49e..38f46a3c0a669 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/model_garden_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ModelGardenServiceTracingStub::ModelGardenServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -213,18 +214,14 @@ future ModelGardenServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeModelGardenServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/model_garden_tracing_stub.h b/google/cloud/aiplatform/v1/internal/model_garden_tracing_stub.h index ff03af012ba9e..bd2dfc3f641cf 100644 --- a/google/cloud/aiplatform/v1/internal/model_garden_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/model_garden_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ModelGardenServiceTracingStub : public ModelGardenServiceStub { public: ~ModelGardenServiceTracingStub() override = default; @@ -112,8 +113,6 @@ class ModelGardenServiceTracingStub : public ModelGardenServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -128,4 +127,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_GARDEN_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/model_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/model_logging_decorator.cc index 7e65f6f1b6fbe..f0534c2bde2d5 100644 --- a/google/cloud/aiplatform/v1/internal/model_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/model_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/model_service.proto #include "google/cloud/aiplatform/v1/internal/model_logging_decorator.h" +#include "google/cloud/aiplatform/v1/model_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -546,3 +549,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/model_logging_decorator.h b/google/cloud/aiplatform/v1/internal/model_logging_decorator.h index ac7d78131a730..02ec42cb9cb49 100644 --- a/google/cloud/aiplatform/v1/internal/model_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/model_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/model_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -245,4 +248,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/model_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/model_metadata_decorator.cc index 33571d0239c26..ab78e6b4a89e6 100644 --- a/google/cloud/aiplatform/v1/internal/model_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/model_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/model_service.proto #include "google/cloud/aiplatform/v1/internal/model_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/model_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -417,3 +421,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/model_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/model_metadata_decorator.h index 609febf3e4be9..e1e194834b1e4 100644 --- a/google/cloud/aiplatform/v1/internal/model_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/model_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/model_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -250,4 +253,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/model_option_defaults.cc b/google/cloud/aiplatform/v1/internal/model_option_defaults.cc index a85c0ce3df8ca..200cccdf67c7e 100644 --- a/google/cloud/aiplatform/v1/internal/model_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/model_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/model_option_defaults.h" #include "google/cloud/aiplatform/v1/model_connection.h" #include "google/cloud/aiplatform/v1/model_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options ModelServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::ModelServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/model_stub.cc b/google/cloud/aiplatform/v1/internal/model_stub.cc index 1c96ec5c5a6f7..99b5ab5b7f971 100644 --- a/google/cloud/aiplatform/v1/internal/model_stub.cc +++ b/google/cloud/aiplatform/v1/internal/model_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/model_service.proto #include "google/cloud/aiplatform/v1/internal/model_stub.h" +#include "google/cloud/aiplatform/v1/model_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -541,3 +544,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/model_stub.h b/google/cloud/aiplatform/v1/internal/model_stub.h index dd75acbd68c1c..8aa429af72b34 100644 --- a/google/cloud/aiplatform/v1/internal/model_stub.h +++ b/google/cloud/aiplatform/v1/internal/model_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_STUB_H +#include "google/cloud/aiplatform/v1/model_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -464,4 +467,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/model_stub_factory.cc b/google/cloud/aiplatform/v1/internal/model_stub_factory.cc index 509f837315b14..26a6f41b3643a 100644 --- a/google/cloud/aiplatform/v1/internal/model_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/model_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/model_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/model_stub.h" #include "google/cloud/aiplatform/v1/internal/model_tracing_stub.h" +#include "google/cloud/aiplatform/v1/model_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/model_stub_factory.h b/google/cloud/aiplatform/v1/internal/model_stub_factory.h index caccd81d857e6..ed7ed1be543c2 100644 --- a/google/cloud/aiplatform/v1/internal/model_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/model_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/model_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/model_tracing_connection.cc index fa83f90980e3b..5cbede77dc90b 100644 --- a/google/cloud/aiplatform/v1/internal/model_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/model_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ModelServiceTracingConnection::ModelServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -439,16 +437,12 @@ ModelServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeModelServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/model_tracing_connection.h b/google/cloud/aiplatform/v1/internal/model_tracing_connection.h index 8ceffc7bd6d8a..81d7c0c9fd5ed 100644 --- a/google/cloud/aiplatform/v1/internal/model_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/model_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ModelServiceTracingConnection : public aiplatform_v1::ModelServiceConnection { public: @@ -207,8 +205,6 @@ class ModelServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/model_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/model_tracing_stub.cc index 1f19efb642d52..4f302af20cc9d 100644 --- a/google/cloud/aiplatform/v1/internal/model_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/model_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ModelServiceTracingStub::ModelServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -499,18 +500,14 @@ future ModelServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeModelServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/model_tracing_stub.h b/google/cloud/aiplatform/v1/internal/model_tracing_stub.h index 57a4cd056a36a..04134d6a15f8b 100644 --- a/google/cloud/aiplatform/v1/internal/model_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/model_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ModelServiceTracingStub : public ModelServiceStub { public: ~ModelServiceTracingStub() override = default; @@ -240,8 +241,6 @@ class ModelServiceTracingStub : public ModelServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -256,4 +255,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_MODEL_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/notebook_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/notebook_auth_decorator.cc index 8170e503c78f0..d250828edc9a8 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/notebook_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/notebook_service.proto #include "google/cloud/aiplatform/v1/internal/notebook_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/notebook_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -497,3 +500,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/notebook_auth_decorator.h b/google/cloud/aiplatform/v1/internal/notebook_auth_decorator.h index 552dc4f4821b5..1d03dc6cd826a 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/notebook_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/notebook_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -254,4 +257,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_NOTEBOOK_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/notebook_connection_impl.h b/google/cloud/aiplatform/v1/internal/notebook_connection_impl.h index e4f05481252a9..afc154846f687 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/notebook_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/notebook_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/notebook_logging_decorator.cc index 02c75e946ecee..2a221c5351ad5 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/notebook_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/notebook_service.proto #include "google/cloud/aiplatform/v1/internal/notebook_logging_decorator.h" +#include "google/cloud/aiplatform/v1/notebook_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -587,3 +590,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/notebook_logging_decorator.h b/google/cloud/aiplatform/v1/internal/notebook_logging_decorator.h index 2bdeeb9ceb0e1..14c1e29862e03 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/notebook_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/notebook_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -254,4 +257,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_NOTEBOOK_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/notebook_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/notebook_metadata_decorator.cc index 903e963cb376e..0e83272894900 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/notebook_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/notebook_service.proto #include "google/cloud/aiplatform/v1/internal/notebook_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/notebook_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -443,3 +447,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/notebook_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/notebook_metadata_decorator.h index a989d617d6b16..fb2a83a1234ae 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/notebook_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/notebook_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -260,4 +263,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_NOTEBOOK_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/notebook_option_defaults.cc b/google/cloud/aiplatform/v1/internal/notebook_option_defaults.cc index 2fc69d552724e..ce50d31100299 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/notebook_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/notebook_option_defaults.h" #include "google/cloud/aiplatform/v1/notebook_connection.h" #include "google/cloud/aiplatform/v1/notebook_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options NotebookServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::NotebookServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/notebook_stub.cc b/google/cloud/aiplatform/v1/internal/notebook_stub.cc index b4debca94a5c8..87fc23be3e403 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_stub.cc +++ b/google/cloud/aiplatform/v1/internal/notebook_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/notebook_service.proto #include "google/cloud/aiplatform/v1/internal/notebook_stub.h" +#include "google/cloud/aiplatform/v1/notebook_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -587,3 +590,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/notebook_stub.h b/google/cloud/aiplatform/v1/internal/notebook_stub.h index c88c1803084e0..4f8ce8f299619 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_stub.h +++ b/google/cloud/aiplatform/v1/internal/notebook_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_NOTEBOOK_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_NOTEBOOK_STUB_H +#include "google/cloud/aiplatform/v1/notebook_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -494,4 +497,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_NOTEBOOK_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/notebook_stub_factory.cc b/google/cloud/aiplatform/v1/internal/notebook_stub_factory.cc index 2abb664bff2fa..78f374aca1482 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/notebook_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/notebook_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/notebook_stub.h" #include "google/cloud/aiplatform/v1/internal/notebook_tracing_stub.h" +#include "google/cloud/aiplatform/v1/notebook_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/notebook_stub_factory.h b/google/cloud/aiplatform/v1/internal/notebook_stub_factory.h index 3648319ab9dc3..7d838cd1d86c6 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/notebook_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_NOTEBOOK_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/notebook_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/notebook_tracing_connection.cc index 0f54a7b3bc8b5..650f5347177ea 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/notebook_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NotebookServiceTracingConnection::NotebookServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -502,16 +500,12 @@ NotebookServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNotebookServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/notebook_tracing_connection.h b/google/cloud/aiplatform/v1/internal/notebook_tracing_connection.h index 63d2a20c07f7b..427405b246f7e 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/notebook_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NotebookServiceTracingConnection : public aiplatform_v1::NotebookServiceConnection { public: @@ -235,8 +233,6 @@ class NotebookServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/notebook_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/notebook_tracing_stub.cc index 24f669d348eba..db55d9eacb4b2 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/notebook_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NotebookServiceTracingStub::NotebookServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -544,18 +545,14 @@ future NotebookServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNotebookServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/notebook_tracing_stub.h b/google/cloud/aiplatform/v1/internal/notebook_tracing_stub.h index 2a8c107360d8c..e213097a41aa0 100644 --- a/google/cloud/aiplatform/v1/internal/notebook_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/notebook_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NotebookServiceTracingStub : public NotebookServiceStub { public: ~NotebookServiceTracingStub() override = default; @@ -250,8 +251,6 @@ class NotebookServiceTracingStub : public NotebookServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -266,4 +265,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_NOTEBOOK_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/persistent_resource_auth_decorator.cc index 27cdfe41dd900..657644ebc66cd 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/persistent_resource_service.proto #include "google/cloud/aiplatform/v1/internal/persistent_resource_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/persistent_resource_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -301,3 +304,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_auth_decorator.h b/google/cloud/aiplatform/v1/internal/persistent_resource_auth_decorator.h index 2a233cc812167..b7fc90de97472 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/persistent_resource_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -165,4 +168,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PERSISTENT_RESOURCE_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_connection_impl.h b/google/cloud/aiplatform/v1/internal/persistent_resource_connection_impl.h index ff50567f084f1..5ffc836f8fdae 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/persistent_resource_logging_decorator.cc index b23e8d783ce50..34aeb0c185426 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/persistent_resource_service.proto #include "google/cloud/aiplatform/v1/internal/persistent_resource_logging_decorator.h" +#include "google/cloud/aiplatform/v1/persistent_resource_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -365,3 +368,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_logging_decorator.h b/google/cloud/aiplatform/v1/internal/persistent_resource_logging_decorator.h index dbcf0dadc5bbc..c7ac13c508db2 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/persistent_resource_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -165,4 +168,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PERSISTENT_RESOURCE_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/persistent_resource_metadata_decorator.cc index 0d021f98800f6..3b1fc1e2e0c3f 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/persistent_resource_service.proto #include "google/cloud/aiplatform/v1/internal/persistent_resource_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/persistent_resource_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -290,3 +294,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/persistent_resource_metadata_decorator.h index 542bd95f2a16c..5e43119a6724a 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/persistent_resource_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -171,4 +174,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PERSISTENT_RESOURCE_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_option_defaults.cc b/google/cloud/aiplatform/v1/internal/persistent_resource_option_defaults.cc index 90c57ef83b2f1..ba88a2c651b48 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/persistent_resource_option_defaults.h" #include "google/cloud/aiplatform/v1/persistent_resource_connection.h" #include "google/cloud/aiplatform/v1/persistent_resource_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -46,7 +46,7 @@ Options PersistentResourceServiceDefaultOptions(std::string const& location, .has()) { options.set( aiplatform_v1::PersistentResourceServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_stub.cc b/google/cloud/aiplatform/v1/internal/persistent_resource_stub.cc index a53d617de7fd0..09b30bcee3bbb 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_stub.cc +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/persistent_resource_service.proto #include "google/cloud/aiplatform/v1/internal/persistent_resource_stub.h" +#include "google/cloud/aiplatform/v1/persistent_resource_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -360,3 +363,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_stub.h b/google/cloud/aiplatform/v1/internal/persistent_resource_stub.h index 4135276d851d5..f9f9592c24e77 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_stub.h +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PERSISTENT_RESOURCE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PERSISTENT_RESOURCE_STUB_H +#include "google/cloud/aiplatform/v1/persistent_resource_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -309,4 +312,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PERSISTENT_RESOURCE_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_stub_factory.cc b/google/cloud/aiplatform/v1/internal/persistent_resource_stub_factory.cc index f285d96824b02..74c4e2445ec32 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/persistent_resource_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/persistent_resource_stub.h" #include "google/cloud/aiplatform/v1/internal/persistent_resource_tracing_stub.h" +#include "google/cloud/aiplatform/v1/persistent_resource_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -80,3 +83,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_stub_factory.h b/google/cloud/aiplatform/v1/internal/persistent_resource_stub_factory.h index 6290ac25ba7c3..78027ecbfd451 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PERSISTENT_RESOURCE_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_connection.cc index 336ecf4a963d9..a71c277894c30 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PersistentResourceServiceTracingConnection:: PersistentResourceServiceTracingConnection( std::shared_ptr @@ -295,17 +293,13 @@ PersistentResourceServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePersistentResourceServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_connection.h b/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_connection.h index b22ae0c624ebe..981da883868f8 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PersistentResourceServiceTracingConnection : public aiplatform_v1::PersistentResourceServiceConnection { public: @@ -141,8 +139,6 @@ class PersistentResourceServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_stub.cc index 120407fabb943..a74ed47dea122 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PersistentResourceServiceTracingStub::PersistentResourceServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -338,20 +339,16 @@ future PersistentResourceServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePersistentResourceServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_stub.h b/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_stub.h index e9297235108fb..9a08bb10fe0ab 100644 --- a/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/persistent_resource_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PersistentResourceServiceTracingStub : public PersistentResourceServiceStub { public: @@ -162,8 +163,6 @@ class PersistentResourceServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -179,4 +178,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PERSISTENT_RESOURCE_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/pipeline_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/pipeline_auth_decorator.cc index 685f70781763b..8fd8bde4bc925 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/pipeline_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/pipeline_service.proto #include "google/cloud/aiplatform/v1/internal/pipeline_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/pipeline_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -348,3 +351,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/pipeline_auth_decorator.h b/google/cloud/aiplatform/v1/internal/pipeline_auth_decorator.h index 1e2fc3c621fb7..3c7d96d26a4e7 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/pipeline_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/pipeline_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -191,4 +194,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PIPELINE_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/pipeline_connection_impl.h b/google/cloud/aiplatform/v1/internal/pipeline_connection_impl.h index 97aaa4ce5ab7a..60d7249fc0173 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/pipeline_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/pipeline_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/pipeline_logging_decorator.cc index 80c486868ad56..73708add7e2f9 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/pipeline_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/pipeline_service.proto #include "google/cloud/aiplatform/v1/internal/pipeline_logging_decorator.h" +#include "google/cloud/aiplatform/v1/pipeline_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -430,3 +433,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/pipeline_logging_decorator.h b/google/cloud/aiplatform/v1/internal/pipeline_logging_decorator.h index 09f98eef8af1a..a1d7de3c58cca 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/pipeline_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/pipeline_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -191,4 +194,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PIPELINE_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/pipeline_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/pipeline_metadata_decorator.cc index 72dcad2df4f2c..1764c4402ac0f 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/pipeline_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/pipeline_service.proto #include "google/cloud/aiplatform/v1/internal/pipeline_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/pipeline_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -333,3 +337,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/pipeline_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/pipeline_metadata_decorator.h index 9c368c2ea2942..c1791bbf067ee 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/pipeline_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/pipeline_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -197,4 +200,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PIPELINE_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/pipeline_option_defaults.cc b/google/cloud/aiplatform/v1/internal/pipeline_option_defaults.cc index 098385f773015..8e5320477f6b1 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/pipeline_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/pipeline_option_defaults.h" #include "google/cloud/aiplatform/v1/pipeline_connection.h" #include "google/cloud/aiplatform/v1/pipeline_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options PipelineServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::PipelineServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/pipeline_stub.cc b/google/cloud/aiplatform/v1/internal/pipeline_stub.cc index 3fe72031e865e..9d2d0240012f6 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_stub.cc +++ b/google/cloud/aiplatform/v1/internal/pipeline_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/pipeline_service.proto #include "google/cloud/aiplatform/v1/internal/pipeline_stub.h" +#include "google/cloud/aiplatform/v1/pipeline_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -425,3 +428,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/pipeline_stub.h b/google/cloud/aiplatform/v1/internal/pipeline_stub.h index 856177ab4f873..1c70137b083c4 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_stub.h +++ b/google/cloud/aiplatform/v1/internal/pipeline_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PIPELINE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PIPELINE_STUB_H +#include "google/cloud/aiplatform/v1/pipeline_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -363,4 +366,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PIPELINE_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/pipeline_stub_factory.cc b/google/cloud/aiplatform/v1/internal/pipeline_stub_factory.cc index d53fb3e99dff7..38e5316072279 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/pipeline_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/pipeline_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/pipeline_stub.h" #include "google/cloud/aiplatform/v1/internal/pipeline_tracing_stub.h" +#include "google/cloud/aiplatform/v1/pipeline_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/pipeline_stub_factory.h b/google/cloud/aiplatform/v1/internal/pipeline_stub_factory.h index 9a7deb0189dc2..2a8f8aae5b343 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/pipeline_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PIPELINE_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/pipeline_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/pipeline_tracing_connection.cc index 2e9ecea13af50..0b815a1290928 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/pipeline_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PipelineServiceTracingConnection::PipelineServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -332,16 +330,12 @@ PipelineServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePipelineServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/pipeline_tracing_connection.h b/google/cloud/aiplatform/v1/internal/pipeline_tracing_connection.h index 396c815a836d8..0acba441e5804 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/pipeline_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PipelineServiceTracingConnection : public aiplatform_v1::PipelineServiceConnection { public: @@ -166,8 +164,6 @@ class PipelineServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/pipeline_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/pipeline_tracing_stub.cc index fed723308c89f..fa5eca133a997 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/pipeline_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PipelineServiceTracingStub::PipelineServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -392,18 +393,14 @@ future PipelineServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePipelineServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/pipeline_tracing_stub.h b/google/cloud/aiplatform/v1/internal/pipeline_tracing_stub.h index e20c8b9259cea..978c0b085e78e 100644 --- a/google/cloud/aiplatform/v1/internal/pipeline_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/pipeline_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PipelineServiceTracingStub : public PipelineServiceStub { public: ~PipelineServiceTracingStub() override = default; @@ -187,8 +188,6 @@ class PipelineServiceTracingStub : public PipelineServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -203,4 +202,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PIPELINE_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/prediction_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/prediction_auth_decorator.cc index 92defa2eb1e73..bafd2c683632d 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/prediction_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/aiplatform/v1/prediction_service.proto #include "google/cloud/aiplatform/v1/internal/prediction_auth_decorator.h" +#include "google/cloud/aiplatform/v1/prediction_service.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -293,3 +296,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/prediction_auth_decorator.h b/google/cloud/aiplatform/v1/internal/prediction_auth_decorator.h index ebeff1e6652b4..a9d6eab4288b5 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/prediction_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -173,4 +176,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PREDICTION_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/prediction_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/prediction_logging_decorator.cc index f4534f0b8d193..92b7b22e1e185 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/prediction_logging_decorator.cc @@ -17,16 +17,19 @@ // source: google/cloud/aiplatform/v1/prediction_service.proto #include "google/cloud/aiplatform/v1/internal/prediction_logging_decorator.h" +#include "google/cloud/aiplatform/v1/prediction_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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -412,3 +415,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/prediction_logging_decorator.h b/google/cloud/aiplatform/v1/internal/prediction_logging_decorator.h index b73d69ec67079..8e89c6b9f359f 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/prediction_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -174,4 +177,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PREDICTION_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/prediction_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/prediction_metadata_decorator.cc index e61cdca2aa952..1f1d44505f52b 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/prediction_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/prediction_service.proto #include "google/cloud/aiplatform/v1/internal/prediction_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/prediction_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -296,3 +300,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/prediction_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/prediction_metadata_decorator.h index 22c1a6d187f3b..a354b3c6e8e24 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/prediction_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -179,4 +182,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PREDICTION_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/prediction_option_defaults.cc b/google/cloud/aiplatform/v1/internal/prediction_option_defaults.cc index 694f103ead76c..3f9892f988667 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/prediction_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/prediction_option_defaults.h" #include "google/cloud/aiplatform/v1/prediction_connection.h" #include "google/cloud/aiplatform/v1/prediction_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options PredictionServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::PredictionServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/prediction_stub.cc b/google/cloud/aiplatform/v1/internal/prediction_stub.cc index 9fe265094cbf1..47d63c0ffbb90 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_stub.cc +++ b/google/cloud/aiplatform/v1/internal/prediction_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/prediction_service.proto #include "google/cloud/aiplatform/v1/internal/prediction_stub.h" +#include "google/cloud/aiplatform/v1/prediction_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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -332,3 +335,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/prediction_stub.h b/google/cloud/aiplatform/v1/internal/prediction_stub.h index 9fcd28cb8ddd2..8b8a2e1b5cbc5 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_stub.h +++ b/google/cloud/aiplatform/v1/internal/prediction_stub.h @@ -19,19 +19,22 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PREDICTION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PREDICTION_STUB_H +#include "google/cloud/aiplatform/v1/prediction_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -324,4 +327,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PREDICTION_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/prediction_stub_factory.cc b/google/cloud/aiplatform/v1/internal/prediction_stub_factory.cc index 28d1d4221ad0a..61a5ef82e0879 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/prediction_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/prediction_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/prediction_stub.h" #include "google/cloud/aiplatform/v1/internal/prediction_tracing_stub.h" +#include "google/cloud/aiplatform/v1/prediction_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/prediction_stub_factory.h b/google/cloud/aiplatform/v1/internal/prediction_stub_factory.h index f6d6f8d8a75c2..51dcd91aec4d9 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/prediction_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PREDICTION_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/prediction_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/prediction_tracing_connection.cc index 94ad46219a977..142d364cdf5f9 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/prediction_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PredictionServiceTracingConnection::PredictionServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -247,17 +245,13 @@ PredictionServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePredictionServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/prediction_tracing_connection.h b/google/cloud/aiplatform/v1/internal/prediction_tracing_connection.h index 034c291082190..6d57f76c878f1 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/prediction_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PredictionServiceTracingConnection : public aiplatform_v1::PredictionServiceConnection { public: @@ -133,8 +131,6 @@ class PredictionServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/prediction_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/prediction_tracing_stub.cc index 6329fabf2efcb..3bf0c1f9691dc 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/prediction_tracing_stub.cc @@ -23,13 +23,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PredictionServiceTracingStub::PredictionServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -349,18 +350,14 @@ PredictionServiceTracingStub::WaitOperation( child_->WaitOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePredictionServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/prediction_tracing_stub.h b/google/cloud/aiplatform/v1/internal/prediction_tracing_stub.h index 9efedd095ea76..63cde29c054cf 100644 --- a/google/cloud/aiplatform/v1/internal/prediction_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/prediction_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PredictionServiceTracingStub : public PredictionServiceStub { public: ~PredictionServiceTracingStub() override = default; @@ -170,8 +171,6 @@ class PredictionServiceTracingStub : public PredictionServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -186,4 +185,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_PREDICTION_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/schedule_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/schedule_auth_decorator.cc index 22ebeb51fce0e..16548ef93aacf 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/schedule_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/schedule_service.proto #include "google/cloud/aiplatform/v1/internal/schedule_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/schedule_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -234,3 +237,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/schedule_auth_decorator.h b/google/cloud/aiplatform/v1/internal/schedule_auth_decorator.h index 491fc533077b0..bf6df2574bc70 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/schedule_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/schedule_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -143,4 +146,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SCHEDULE_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/schedule_connection_impl.h b/google/cloud/aiplatform/v1/internal/schedule_connection_impl.h index dae0584614b4a..e0e742b516dd4 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/schedule_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/schedule_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/schedule_logging_decorator.cc index 65d4b515936b9..e48d263f933ac 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/schedule_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/schedule_service.proto #include "google/cloud/aiplatform/v1/internal/schedule_logging_decorator.h" +#include "google/cloud/aiplatform/v1/schedule_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -293,3 +296,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/schedule_logging_decorator.h b/google/cloud/aiplatform/v1/internal/schedule_logging_decorator.h index c1a20787aed2b..df24d876f7cc3 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/schedule_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/schedule_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -143,4 +146,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SCHEDULE_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/schedule_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/schedule_metadata_decorator.cc index f4d9db5703795..b1d2597e16a57 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/schedule_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/schedule_service.proto #include "google/cloud/aiplatform/v1/internal/schedule_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/schedule_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -244,3 +248,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/schedule_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/schedule_metadata_decorator.h index 1cb9f44a5e97f..1271992402888 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/schedule_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/schedule_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -149,4 +152,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SCHEDULE_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/schedule_option_defaults.cc b/google/cloud/aiplatform/v1/internal/schedule_option_defaults.cc index 573dab18c1a34..7a8be356ab4b6 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/schedule_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/schedule_option_defaults.h" #include "google/cloud/aiplatform/v1/schedule_connection.h" #include "google/cloud/aiplatform/v1/schedule_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options ScheduleServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::ScheduleServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/schedule_stub.cc b/google/cloud/aiplatform/v1/internal/schedule_stub.cc index f3711d706c48a..b5e7dc6ab261b 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_stub.cc +++ b/google/cloud/aiplatform/v1/internal/schedule_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/schedule_service.proto #include "google/cloud/aiplatform/v1/internal/schedule_stub.h" +#include "google/cloud/aiplatform/v1/schedule_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -292,3 +295,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/schedule_stub.h b/google/cloud/aiplatform/v1/internal/schedule_stub.h index 5e3cc59354173..b2aa0e69b123a 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_stub.h +++ b/google/cloud/aiplatform/v1/internal/schedule_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SCHEDULE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SCHEDULE_STUB_H +#include "google/cloud/aiplatform/v1/schedule_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -255,4 +258,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SCHEDULE_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/schedule_stub_factory.cc b/google/cloud/aiplatform/v1/internal/schedule_stub_factory.cc index 8a6c4c899830f..e52af931210ca 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/schedule_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/schedule_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/schedule_stub.h" #include "google/cloud/aiplatform/v1/internal/schedule_tracing_stub.h" +#include "google/cloud/aiplatform/v1/schedule_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/schedule_stub_factory.h b/google/cloud/aiplatform/v1/internal/schedule_stub_factory.h index b06af5be57118..d03d2ffbc746b 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/schedule_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SCHEDULE_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/schedule_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/schedule_tracing_connection.cc index f025448a5b62a..4039ce9aef634 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/schedule_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ScheduleServiceTracingConnection::ScheduleServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -208,16 +206,12 @@ ScheduleServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeScheduleServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/schedule_tracing_connection.h b/google/cloud/aiplatform/v1/internal/schedule_tracing_connection.h index 25a6f339c2e48..1752686a1936e 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/schedule_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ScheduleServiceTracingConnection : public aiplatform_v1::ScheduleServiceConnection { public: @@ -109,8 +107,6 @@ class ScheduleServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/schedule_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/schedule_tracing_stub.cc index 9caf9919b78f0..8a48fe65264f8 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/schedule_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ScheduleServiceTracingStub::ScheduleServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -273,18 +274,14 @@ future ScheduleServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeScheduleServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/schedule_tracing_stub.h b/google/cloud/aiplatform/v1/internal/schedule_tracing_stub.h index f3e80a81d77b1..8d4dcfca2b104 100644 --- a/google/cloud/aiplatform/v1/internal/schedule_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/schedule_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ScheduleServiceTracingStub : public ScheduleServiceStub { public: ~ScheduleServiceTracingStub() override = default; @@ -139,8 +140,6 @@ class ScheduleServiceTracingStub : public ScheduleServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -155,4 +154,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SCHEDULE_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/specialist_pool_auth_decorator.cc index c60d355f50100..8facf664d479f 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/specialist_pool_service.proto #include "google/cloud/aiplatform/v1/internal/specialist_pool_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/specialist_pool_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -262,3 +265,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_auth_decorator.h b/google/cloud/aiplatform/v1/internal/specialist_pool_auth_decorator.h index 4a406c5f7d082..cf66df9dc31a8 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/specialist_pool_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -148,4 +151,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SPECIALIST_POOL_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_connection_impl.h b/google/cloud/aiplatform/v1/internal/specialist_pool_connection_impl.h index 8e3a3f117818b..2f5474705a13e 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/specialist_pool_logging_decorator.cc index 982e6a3bab8e2..a247f128f10ef 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/specialist_pool_service.proto #include "google/cloud/aiplatform/v1/internal/specialist_pool_logging_decorator.h" +#include "google/cloud/aiplatform/v1/specialist_pool_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -312,3 +315,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_logging_decorator.h b/google/cloud/aiplatform/v1/internal/specialist_pool_logging_decorator.h index 2be66816765af..84897dc4c8d7d 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/specialist_pool_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -148,4 +151,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SPECIALIST_POOL_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/specialist_pool_metadata_decorator.cc index 7574d8989b9d2..f78c7c06bf44b 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/specialist_pool_service.proto #include "google/cloud/aiplatform/v1/internal/specialist_pool_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/specialist_pool_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -257,3 +261,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/specialist_pool_metadata_decorator.h index 64a29fe777d6d..663e41cc5b477 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/specialist_pool_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -154,4 +157,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SPECIALIST_POOL_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_option_defaults.cc b/google/cloud/aiplatform/v1/internal/specialist_pool_option_defaults.cc index fd6b65dd1561e..0823c596c57fb 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/specialist_pool_option_defaults.h" #include "google/cloud/aiplatform/v1/specialist_pool_connection.h" #include "google/cloud/aiplatform/v1/specialist_pool_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options SpecialistPoolServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::SpecialistPoolServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_stub.cc b/google/cloud/aiplatform/v1/internal/specialist_pool_stub.cc index 841c9c013ef67..52daaebe9396e 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_stub.cc +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/specialist_pool_service.proto #include "google/cloud/aiplatform/v1/internal/specialist_pool_stub.h" +#include "google/cloud/aiplatform/v1/specialist_pool_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -310,3 +313,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_stub.h b/google/cloud/aiplatform/v1/internal/specialist_pool_stub.h index 43a77d0569957..baaa887186bce 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_stub.h +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SPECIALIST_POOL_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SPECIALIST_POOL_STUB_H +#include "google/cloud/aiplatform/v1/specialist_pool_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -277,4 +280,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SPECIALIST_POOL_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_stub_factory.cc b/google/cloud/aiplatform/v1/internal/specialist_pool_stub_factory.cc index 24c792ff1a719..b32d0deba75d6 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/specialist_pool_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/specialist_pool_stub.h" #include "google/cloud/aiplatform/v1/internal/specialist_pool_tracing_stub.h" +#include "google/cloud/aiplatform/v1/specialist_pool_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_stub_factory.h b/google/cloud/aiplatform/v1/internal/specialist_pool_stub_factory.h index 1cd266476c1e9..e4baa124fb116 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SPECIALIST_POOL_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_connection.cc index 3b05bdbcb8d82..08240a6673ab9 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SpecialistPoolServiceTracingConnection::SpecialistPoolServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -239,17 +237,13 @@ SpecialistPoolServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSpecialistPoolServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_connection.h b/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_connection.h index 14835ac33192e..00aa26d9ced4d 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SpecialistPoolServiceTracingConnection : public aiplatform_v1::SpecialistPoolServiceConnection { public: @@ -124,8 +122,6 @@ class SpecialistPoolServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_stub.cc index a83e32d22d736..9360337392172 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SpecialistPoolServiceTracingStub::SpecialistPoolServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -290,18 +291,14 @@ future SpecialistPoolServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSpecialistPoolServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_stub.h b/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_stub.h index 8e12b6b0d78d0..326305ff03b72 100644 --- a/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/specialist_pool_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SpecialistPoolServiceTracingStub : public SpecialistPoolServiceStub { public: ~SpecialistPoolServiceTracingStub() override = default; @@ -144,8 +145,6 @@ class SpecialistPoolServiceTracingStub : public SpecialistPoolServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -160,4 +159,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_SPECIALIST_POOL_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/tensorboard_auth_decorator.cc index 670ccaa7104cb..d675d691ba032 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/tensorboard_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/tensorboard_service.proto #include "google/cloud/aiplatform/v1/internal/tensorboard_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/tensorboard_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -569,3 +572,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_auth_decorator.h b/google/cloud/aiplatform/v1/internal/tensorboard_auth_decorator.h index d368603c0115e..44c4bbd8efeb0 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/tensorboard_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/tensorboard_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -319,4 +322,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_TENSORBOARD_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_connection_impl.h b/google/cloud/aiplatform/v1/internal/tensorboard_connection_impl.h index aa7acdf469c75..de8631c8f5f7c 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/tensorboard_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/tensorboard_logging_decorator.cc index ddc000d245b4a..6f5a349e46659 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/tensorboard_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/aiplatform/v1/tensorboard_service.proto #include "google/cloud/aiplatform/v1/internal/tensorboard_logging_decorator.h" +#include "google/cloud/aiplatform/v1/tensorboard_service.grpc.pb.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -741,3 +744,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_logging_decorator.h b/google/cloud/aiplatform/v1/internal/tensorboard_logging_decorator.h index 4be5647485a56..1bb0412caf516 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/tensorboard_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/tensorboard_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -320,4 +323,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_TENSORBOARD_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/tensorboard_metadata_decorator.cc index 7b9322c7e8b2c..e6cee3033678d 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/tensorboard_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/tensorboard_service.proto #include "google/cloud/aiplatform/v1/internal/tensorboard_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/tensorboard_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -556,3 +560,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/tensorboard_metadata_decorator.h index 8c435cb1f9c95..72f51b9112688 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/tensorboard_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/tensorboard_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -325,4 +328,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_TENSORBOARD_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_option_defaults.cc b/google/cloud/aiplatform/v1/internal/tensorboard_option_defaults.cc index 1a63d22e87128..9b12105902c0e 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/tensorboard_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/tensorboard_option_defaults.h" #include "google/cloud/aiplatform/v1/tensorboard_connection.h" #include "google/cloud/aiplatform/v1/tensorboard_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options TensorboardServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::TensorboardServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_stub.cc b/google/cloud/aiplatform/v1/internal/tensorboard_stub.cc index 7d225b0cce8d8..48932548cc1ad 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_stub.cc +++ b/google/cloud/aiplatform/v1/internal/tensorboard_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/tensorboard_service.proto #include "google/cloud/aiplatform/v1/internal/tensorboard_stub.h" +#include "google/cloud/aiplatform/v1/tensorboard_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -709,3 +712,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_stub.h b/google/cloud/aiplatform/v1/internal/tensorboard_stub.h index d89eb5e236944..067dc71d81a5d 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_stub.h +++ b/google/cloud/aiplatform/v1/internal/tensorboard_stub.h @@ -19,19 +19,22 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_TENSORBOARD_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_TENSORBOARD_STUB_H +#include "google/cloud/aiplatform/v1/tensorboard_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/internal/streaming_read_rpc.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#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 aiplatform_v1_internal { @@ -627,4 +630,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_TENSORBOARD_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_stub_factory.cc b/google/cloud/aiplatform/v1/internal/tensorboard_stub_factory.cc index af4e993d9299c..f97395293009b 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/tensorboard_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/tensorboard_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/tensorboard_stub.h" #include "google/cloud/aiplatform/v1/internal/tensorboard_tracing_stub.h" +#include "google/cloud/aiplatform/v1/tensorboard_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_stub_factory.h b/google/cloud/aiplatform/v1/internal/tensorboard_stub_factory.h index a9f75ea8c848f..efbe62bdb010c 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/tensorboard_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_TENSORBOARD_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/tensorboard_tracing_connection.cc index d6bc9ec2ec262..d99a66bf99d2e 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/tensorboard_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TensorboardServiceTracingConnection::TensorboardServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -582,17 +580,13 @@ TensorboardServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTensorboardServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_tracing_connection.h b/google/cloud/aiplatform/v1/internal/tensorboard_tracing_connection.h index 824973f4ea846..50f2b29f7b51a 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/tensorboard_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TensorboardServiceTracingConnection : public aiplatform_v1::TensorboardServiceConnection { public: @@ -271,8 +269,6 @@ class TensorboardServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/tensorboard_tracing_stub.cc index 55276a5e7514a..839fe49e27af6 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/tensorboard_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TensorboardServiceTracingStub::TensorboardServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -689,18 +690,14 @@ future TensorboardServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTensorboardServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/tensorboard_tracing_stub.h b/google/cloud/aiplatform/v1/internal/tensorboard_tracing_stub.h index 5c9b863789d6a..8c3115a91aeda 100644 --- a/google/cloud/aiplatform/v1/internal/tensorboard_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/tensorboard_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TensorboardServiceTracingStub : public TensorboardServiceStub { public: ~TensorboardServiceTracingStub() override = default; @@ -315,8 +316,6 @@ class TensorboardServiceTracingStub : public TensorboardServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -331,4 +330,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_TENSORBOARD_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/vizier_auth_decorator.cc b/google/cloud/aiplatform/v1/internal/vizier_auth_decorator.cc index 6805d476d2485..382b43d9dca26 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_auth_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/vizier_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/aiplatform/v1/vizier_service.proto #include "google/cloud/aiplatform/v1/internal/vizier_auth_decorator.h" -#include +#include "google/cloud/aiplatform/v1/vizier_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -321,3 +324,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/vizier_auth_decorator.h b/google/cloud/aiplatform/v1/internal/vizier_auth_decorator.h index afef20b19185a..bb37738d87888 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_auth_decorator.h +++ b/google/cloud/aiplatform/v1/internal/vizier_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/vizier_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -186,4 +189,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_VIZIER_AUTH_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/vizier_connection_impl.h b/google/cloud/aiplatform/v1/internal/vizier_connection_impl.h index 223676940fa04..4dc4689fd0a41 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_connection_impl.h +++ b/google/cloud/aiplatform/v1/internal/vizier_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/internal/vizier_logging_decorator.cc b/google/cloud/aiplatform/v1/internal/vizier_logging_decorator.cc index 1e1bf57902070..3efe4648720bc 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_logging_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/vizier_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/aiplatform/v1/vizier_service.proto #include "google/cloud/aiplatform/v1/internal/vizier_logging_decorator.h" +#include "google/cloud/aiplatform/v1/vizier_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -406,3 +409,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/vizier_logging_decorator.h b/google/cloud/aiplatform/v1/internal/vizier_logging_decorator.h index 2de7fbe6b4b78..d09d816d317d7 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_logging_decorator.h +++ b/google/cloud/aiplatform/v1/internal/vizier_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/vizier_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -186,4 +189,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_VIZIER_LOGGING_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/vizier_metadata_decorator.cc b/google/cloud/aiplatform/v1/internal/vizier_metadata_decorator.cc index ff7f1960111a0..178eb154c7cd6 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_metadata_decorator.cc +++ b/google/cloud/aiplatform/v1/internal/vizier_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/aiplatform/v1/vizier_service.proto #include "google/cloud/aiplatform/v1/internal/vizier_metadata_decorator.h" +#include "google/cloud/aiplatform/v1/vizier_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 aiplatform_v1_internal { @@ -327,3 +331,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/vizier_metadata_decorator.h b/google/cloud/aiplatform/v1/internal/vizier_metadata_decorator.h index 186deaf547ecd..81596df9fddcd 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_metadata_decorator.h +++ b/google/cloud/aiplatform/v1/internal/vizier_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/aiplatform/v1/internal/vizier_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 aiplatform_v1_internal { @@ -191,4 +194,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_VIZIER_METADATA_DECORATOR_H diff --git a/google/cloud/aiplatform/v1/internal/vizier_option_defaults.cc b/google/cloud/aiplatform/v1/internal/vizier_option_defaults.cc index 24231f2b6e9d5..3a75179df6166 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_option_defaults.cc +++ b/google/cloud/aiplatform/v1/internal/vizier_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/aiplatform/v1/internal/vizier_option_defaults.h" #include "google/cloud/aiplatform/v1/vizier_connection.h" #include "google/cloud/aiplatform/v1/vizier_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options VizierServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( aiplatform_v1::VizierServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/aiplatform/v1/internal/vizier_stub.cc b/google/cloud/aiplatform/v1/internal/vizier_stub.cc index ca92970cbf97d..4810f307e1a3d 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_stub.cc +++ b/google/cloud/aiplatform/v1/internal/vizier_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/aiplatform/v1/vizier_service.proto #include "google/cloud/aiplatform/v1/internal/vizier_stub.h" +#include "google/cloud/aiplatform/v1/vizier_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -409,3 +412,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/vizier_stub.h b/google/cloud/aiplatform/v1/internal/vizier_stub.h index 8bdad179953a9..c09e81a334d1b 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_stub.h +++ b/google/cloud/aiplatform/v1/internal/vizier_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_VIZIER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_VIZIER_STUB_H +#include "google/cloud/aiplatform/v1/vizier_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -343,4 +346,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_VIZIER_STUB_H diff --git a/google/cloud/aiplatform/v1/internal/vizier_stub_factory.cc b/google/cloud/aiplatform/v1/internal/vizier_stub_factory.cc index a62f4e0206bd3..802bd03e70c09 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_stub_factory.cc +++ b/google/cloud/aiplatform/v1/internal/vizier_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/aiplatform/v1/internal/vizier_metadata_decorator.h" #include "google/cloud/aiplatform/v1/internal/vizier_stub.h" #include "google/cloud/aiplatform/v1/internal/vizier_tracing_stub.h" +#include "google/cloud/aiplatform/v1/vizier_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 -#include -#include -#include +#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 aiplatform_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/vizier_stub_factory.h b/google/cloud/aiplatform/v1/internal/vizier_stub_factory.h index 659d4fe9ad78d..5c1bf617a3fb9 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_stub_factory.h +++ b/google/cloud/aiplatform/v1/internal/vizier_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_VIZIER_STUB_FACTORY_H diff --git a/google/cloud/aiplatform/v1/internal/vizier_tracing_connection.cc b/google/cloud/aiplatform/v1/internal/vizier_tracing_connection.cc index c409ce92dee41..3d82dba4471a6 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_tracing_connection.cc +++ b/google/cloud/aiplatform/v1/internal/vizier_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VizierServiceTracingConnection::VizierServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -305,16 +303,12 @@ VizierServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVizierServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/aiplatform/v1/internal/vizier_tracing_connection.h b/google/cloud/aiplatform/v1/internal/vizier_tracing_connection.h index 38b4a4a1d638a..8d4ebdffff0f1 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_tracing_connection.h +++ b/google/cloud/aiplatform/v1/internal/vizier_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VizierServiceTracingConnection : public aiplatform_v1::VizierServiceConnection { public: @@ -148,8 +146,6 @@ class VizierServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/aiplatform/v1/internal/vizier_tracing_stub.cc b/google/cloud/aiplatform/v1/internal/vizier_tracing_stub.cc index 76c9aa7f8c077..cb8769024bd78 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_tracing_stub.cc +++ b/google/cloud/aiplatform/v1/internal/vizier_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VizierServiceTracingStub::VizierServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -385,18 +386,14 @@ future VizierServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVizierServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace aiplatform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/aiplatform/v1/internal/vizier_tracing_stub.h b/google/cloud/aiplatform/v1/internal/vizier_tracing_stub.h index f2cb2ec0c94c4..7d23caeb1730f 100644 --- a/google/cloud/aiplatform/v1/internal/vizier_tracing_stub.h +++ b/google/cloud/aiplatform/v1/internal/vizier_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace aiplatform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VizierServiceTracingStub : public VizierServiceStub { public: ~VizierServiceTracingStub() override = default; @@ -181,8 +182,6 @@ class VizierServiceTracingStub : public VizierServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -197,4 +196,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_INTERNAL_VIZIER_TRACING_STUB_H diff --git a/google/cloud/aiplatform/v1/job_client.h b/google/cloud/aiplatform/v1/job_client.h index d161580a96854..61e3fe13abb60 100644 --- a/google/cloud/aiplatform/v1/job_client.h +++ b/google/cloud/aiplatform/v1/job_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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( @@ -2133,7 +2133,7 @@ class JobServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.BatchPredictionJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/batch_prediction_job.proto#L394} + /// [google.cloud.aiplatform.v1.BatchPredictionJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/batch_prediction_job.proto#L413} /// [google.cloud.aiplatform.v1.CancelBatchPredictionJobRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/job_service.proto#L1116} /// [google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/job_service.proto#L311} /// @@ -2172,7 +2172,7 @@ class JobServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.BatchPredictionJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/batch_prediction_job.proto#L394} + /// [google.cloud.aiplatform.v1.BatchPredictionJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/batch_prediction_job.proto#L413} /// [google.cloud.aiplatform.v1.CancelBatchPredictionJobRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/job_service.proto#L1116} /// [google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/job_service.proto#L311} /// @@ -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/job_connection.h b/google/cloud/aiplatform/v1/job_connection.h index 36211341f6fec..33c162a632b61 100644 --- a/google/cloud/aiplatform/v1/job_connection.h +++ b/google/cloud/aiplatform/v1/job_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/aiplatform/v1/internal/job_retry_traits.h" #include "google/cloud/aiplatform/v1/job_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/job_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/job_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/job_connection_idempotency_policy.h index 69814e5a459c0..620ff2bd2de91 100644 --- a/google/cloud/aiplatform/v1/job_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/job_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_JOB_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_JOB_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/job_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/llm_utility_connection.h b/google/cloud/aiplatform/v1/llm_utility_connection.h index cbbbab31abfa4..191a1b59ca0bd 100644 --- a/google/cloud/aiplatform/v1/llm_utility_connection.h +++ b/google/cloud/aiplatform/v1/llm_utility_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/aiplatform/v1/internal/llm_utility_retry_traits.h" #include "google/cloud/aiplatform/v1/llm_utility_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/llm_utility_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 #include #include diff --git a/google/cloud/aiplatform/v1/llm_utility_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/llm_utility_connection_idempotency_policy.h index dc9d95c02a6c6..e7a571ba732ea 100644 --- a/google/cloud/aiplatform/v1/llm_utility_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/llm_utility_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_LLM_UTILITY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_LLM_UTILITY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/llm_utility_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/match_connection.h b/google/cloud/aiplatform/v1/match_connection.h index ae3c16010343d..7ac977c10d15a 100644 --- a/google/cloud/aiplatform/v1/match_connection.h +++ b/google/cloud/aiplatform/v1/match_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/aiplatform/v1/internal/match_retry_traits.h" #include "google/cloud/aiplatform/v1/match_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/match_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 #include #include diff --git a/google/cloud/aiplatform/v1/match_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/match_connection_idempotency_policy.h index 3fdd966b0e886..79a1993966abe 100644 --- a/google/cloud/aiplatform/v1/match_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/match_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_MATCH_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_MATCH_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/match_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/metadata_client.h b/google/cloud/aiplatform/v1/metadata_client.h index 28548d9428724..acf69f683f3ee 100644 --- a/google/cloud/aiplatform/v1/metadata_client.h +++ b/google/cloud/aiplatform/v1/metadata_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/metadata_connection.h b/google/cloud/aiplatform/v1/metadata_connection.h index ff802d1254bc3..70236da9b8c59 100644 --- a/google/cloud/aiplatform/v1/metadata_connection.h +++ b/google/cloud/aiplatform/v1/metadata_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/aiplatform/v1/internal/metadata_retry_traits.h" #include "google/cloud/aiplatform/v1/metadata_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/metadata_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/metadata_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/metadata_connection_idempotency_policy.h index cc88b3f5bf6b4..5680c4b071cb0 100644 --- a/google/cloud/aiplatform/v1/metadata_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/metadata_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_METADATA_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_METADATA_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/metadata_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/migration_client.h b/google/cloud/aiplatform/v1/migration_client.h index 7204cf37b3452..fd6023e48c463 100644 --- a/google/cloud/aiplatform/v1/migration_client.h +++ b/google/cloud/aiplatform/v1/migration_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/migration_connection.h b/google/cloud/aiplatform/v1/migration_connection.h index bbadd5bfa71b7..b1dce629941cf 100644 --- a/google/cloud/aiplatform/v1/migration_connection.h +++ b/google/cloud/aiplatform/v1/migration_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/aiplatform/v1/internal/migration_retry_traits.h" #include "google/cloud/aiplatform/v1/migration_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/migration_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/migration_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/migration_connection_idempotency_policy.h index 228a4dfb989b3..e5382a8efcd71 100644 --- a/google/cloud/aiplatform/v1/migration_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/migration_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/migration_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/model_client.h b/google/cloud/aiplatform/v1/model_client.h index 05c9d14ce41a3..008ddffa6df97 100644 --- a/google/cloud/aiplatform/v1/model_client.h +++ b/google/cloud/aiplatform/v1/model_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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_connection.h b/google/cloud/aiplatform/v1/model_connection.h index c4f57b5c83d5e..35c90921fed5d 100644 --- a/google/cloud/aiplatform/v1/model_connection.h +++ b/google/cloud/aiplatform/v1/model_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/aiplatform/v1/internal/model_retry_traits.h" #include "google/cloud/aiplatform/v1/model_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/model_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/model_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/model_connection_idempotency_policy.h index 2be68a892c44a..9651156dadd22 100644 --- a/google/cloud/aiplatform/v1/model_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/model_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_MODEL_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_MODEL_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/model_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/model_garden_client.h b/google/cloud/aiplatform/v1/model_garden_client.h index 78a1a0a8905a8..4051fc66b5ea9 100644 --- a/google/cloud/aiplatform/v1/model_garden_client.h +++ b/google/cloud/aiplatform/v1/model_garden_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/model_garden_connection.h b/google/cloud/aiplatform/v1/model_garden_connection.h index 9a82b9d264fdf..ed39fe437ea82 100644 --- a/google/cloud/aiplatform/v1/model_garden_connection.h +++ b/google/cloud/aiplatform/v1/model_garden_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/aiplatform/v1/internal/model_garden_retry_traits.h" #include "google/cloud/aiplatform/v1/model_garden_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/model_garden_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/model_garden_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/model_garden_connection_idempotency_policy.h index 5d5743ff0f564..9894b122a7057 100644 --- a/google/cloud/aiplatform/v1/model_garden_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/model_garden_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_MODEL_GARDEN_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_MODEL_GARDEN_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/model_garden_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/notebook_client.h b/google/cloud/aiplatform/v1/notebook_client.h index 7dff5106fd915..10f35c1cff591 100644 --- a/google/cloud/aiplatform/v1/notebook_client.h +++ b/google/cloud/aiplatform/v1/notebook_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/notebook_connection.h b/google/cloud/aiplatform/v1/notebook_connection.h index be9505e1563e9..c33de4c75ff9b 100644 --- a/google/cloud/aiplatform/v1/notebook_connection.h +++ b/google/cloud/aiplatform/v1/notebook_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/aiplatform/v1/internal/notebook_retry_traits.h" #include "google/cloud/aiplatform/v1/notebook_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/notebook_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/notebook_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/notebook_connection_idempotency_policy.h index 1495b6fa70022..4ae60255120b9 100644 --- a/google/cloud/aiplatform/v1/notebook_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/notebook_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_NOTEBOOK_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_NOTEBOOK_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/notebook_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/persistent_resource_client.h b/google/cloud/aiplatform/v1/persistent_resource_client.h index 6e1da918e5ab3..ccfd3fcc95898 100644 --- a/google/cloud/aiplatform/v1/persistent_resource_client.h +++ b/google/cloud/aiplatform/v1/persistent_resource_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/persistent_resource_connection.h b/google/cloud/aiplatform/v1/persistent_resource_connection.h index 6dac0171625ec..f676b4654d675 100644 --- a/google/cloud/aiplatform/v1/persistent_resource_connection.h +++ b/google/cloud/aiplatform/v1/persistent_resource_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/aiplatform/v1/internal/persistent_resource_retry_traits.h" #include "google/cloud/aiplatform/v1/persistent_resource_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/persistent_resource_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/persistent_resource_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/persistent_resource_connection_idempotency_policy.h index 835dfcbe513aa..92a3a9d131c4d 100644 --- a/google/cloud/aiplatform/v1/persistent_resource_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/persistent_resource_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_PERSISTENT_RESOURCE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_PERSISTENT_RESOURCE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/persistent_resource_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/pipeline_client.h b/google/cloud/aiplatform/v1/pipeline_client.h index 88b967418b822..1b4ea9c6e9205 100644 --- a/google/cloud/aiplatform/v1/pipeline_client.h +++ b/google/cloud/aiplatform/v1/pipeline_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/pipeline_connection.h b/google/cloud/aiplatform/v1/pipeline_connection.h index 43561cd9cc7bb..3311d9eceaa3b 100644 --- a/google/cloud/aiplatform/v1/pipeline_connection.h +++ b/google/cloud/aiplatform/v1/pipeline_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/aiplatform/v1/internal/pipeline_retry_traits.h" #include "google/cloud/aiplatform/v1/pipeline_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/pipeline_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/pipeline_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/pipeline_connection_idempotency_policy.h index 9d11d229dbe82..811234c1ee4f3 100644 --- a/google/cloud/aiplatform/v1/pipeline_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/pipeline_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_PIPELINE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_PIPELINE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/pipeline_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/prediction_client.h b/google/cloud/aiplatform/v1/prediction_client.h index ef68943c24d1b..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 @@ -802,8 +802,8 @@ class PredictionServiceClient { /// [`future`]: @ref google::cloud::future /// [`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#L866} - /// [google.cloud.aiplatform.v1.EmbedContentResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/prediction_service.proto#L926} + /// [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#L996} /// // clang-format on StatusOr EmbedContent( @@ -833,8 +833,8 @@ class PredictionServiceClient { /// [`future`]: @ref google::cloud::future /// [`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#L866} - /// [google.cloud.aiplatform.v1.EmbedContentResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/prediction_service.proto#L926} + /// [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#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/prediction_connection.h b/google/cloud/aiplatform/v1/prediction_connection.h index 61a4011a3aa49..7eb7aba43e99b 100644 --- a/google/cloud/aiplatform/v1/prediction_connection.h +++ b/google/cloud/aiplatform/v1/prediction_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/aiplatform/v1/internal/prediction_retry_traits.h" #include "google/cloud/aiplatform/v1/prediction_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/prediction_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" @@ -28,7 +29,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/aiplatform/v1/prediction_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/prediction_connection_idempotency_policy.h index 2cbe32a74e1c8..39d04a7567bc2 100644 --- a/google/cloud/aiplatform/v1/prediction_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/prediction_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_PREDICTION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_PREDICTION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/prediction_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/schedule_client.h b/google/cloud/aiplatform/v1/schedule_client.h index 93f744c9a7282..76c17ea4e95a2 100644 --- a/google/cloud/aiplatform/v1/schedule_client.h +++ b/google/cloud/aiplatform/v1/schedule_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -484,7 +484,7 @@ class ScheduleServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.ResumeScheduleRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/schedule_service.proto#L277} - /// [google.cloud.aiplatform.v1.Schedule.catch_up]: @googleapis_reference_link{google/cloud/aiplatform/v1/schedule.proto#L170} + /// [google.cloud.aiplatform.v1.Schedule.catch_up]: @googleapis_reference_link{google/cloud/aiplatform/v1/schedule.proto#L178} /// [google.cloud.aiplatform.v1.Schedule.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/schedule.proto#L131} /// // clang-format on @@ -522,7 +522,7 @@ class ScheduleServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.ResumeScheduleRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/schedule_service.proto#L277} - /// [google.cloud.aiplatform.v1.Schedule.catch_up]: @googleapis_reference_link{google/cloud/aiplatform/v1/schedule.proto#L170} + /// [google.cloud.aiplatform.v1.Schedule.catch_up]: @googleapis_reference_link{google/cloud/aiplatform/v1/schedule.proto#L178} /// [google.cloud.aiplatform.v1.Schedule.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/schedule.proto#L131} /// // clang-format on @@ -559,7 +559,7 @@ class ScheduleServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.ResumeScheduleRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/schedule_service.proto#L277} - /// [google.cloud.aiplatform.v1.Schedule.catch_up]: @googleapis_reference_link{google/cloud/aiplatform/v1/schedule.proto#L170} + /// [google.cloud.aiplatform.v1.Schedule.catch_up]: @googleapis_reference_link{google/cloud/aiplatform/v1/schedule.proto#L178} /// [google.cloud.aiplatform.v1.Schedule.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/schedule.proto#L131} /// // clang-format on @@ -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/schedule_connection.h b/google/cloud/aiplatform/v1/schedule_connection.h index 0be8920d0a862..497c4d1066c44 100644 --- a/google/cloud/aiplatform/v1/schedule_connection.h +++ b/google/cloud/aiplatform/v1/schedule_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/aiplatform/v1/internal/schedule_retry_traits.h" #include "google/cloud/aiplatform/v1/schedule_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/schedule_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/schedule_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/schedule_connection_idempotency_policy.h index 15e1a41e4869e..4dfdbce8390bd 100644 --- a/google/cloud/aiplatform/v1/schedule_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/schedule_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_SCHEDULE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_SCHEDULE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/schedule_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/specialist_pool_client.h b/google/cloud/aiplatform/v1/specialist_pool_client.h index dbd2ea4919019..f38634588585f 100644 --- a/google/cloud/aiplatform/v1/specialist_pool_client.h +++ b/google/cloud/aiplatform/v1/specialist_pool_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/specialist_pool_connection.h b/google/cloud/aiplatform/v1/specialist_pool_connection.h index 91c4c39a7505b..1cc5eadef32a3 100644 --- a/google/cloud/aiplatform/v1/specialist_pool_connection.h +++ b/google/cloud/aiplatform/v1/specialist_pool_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/aiplatform/v1/internal/specialist_pool_retry_traits.h" #include "google/cloud/aiplatform/v1/specialist_pool_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/specialist_pool_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/specialist_pool_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/specialist_pool_connection_idempotency_policy.h index c21ee99f1bcdc..f297d723a698c 100644 --- a/google/cloud/aiplatform/v1/specialist_pool_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/specialist_pool_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_SPECIALIST_POOL_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_SPECIALIST_POOL_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/specialist_pool_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/tensorboard_client.h b/google/cloud/aiplatform/v1/tensorboard_client.h index d6f10a11cd36b..95c36f741d9ae 100644 --- a/google/cloud/aiplatform/v1/tensorboard_client.h +++ b/google/cloud/aiplatform/v1/tensorboard_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/tensorboard_connection.h b/google/cloud/aiplatform/v1/tensorboard_connection.h index 353d2277041f1..baa2d6199d97b 100644 --- a/google/cloud/aiplatform/v1/tensorboard_connection.h +++ b/google/cloud/aiplatform/v1/tensorboard_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/aiplatform/v1/internal/tensorboard_retry_traits.h" #include "google/cloud/aiplatform/v1/tensorboard_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/tensorboard_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/tensorboard_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/tensorboard_connection_idempotency_policy.h index de0b426880245..342e83ca0d870 100644 --- a/google/cloud/aiplatform/v1/tensorboard_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/tensorboard_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_TENSORBOARD_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_TENSORBOARD_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/tensorboard_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/aiplatform/v1/vizier_client.h b/google/cloud/aiplatform/v1/vizier_client.h index 39bdf58b2bcfa..990cfda61950c 100644 --- a/google/cloud/aiplatform/v1/vizier_client.h +++ b/google/cloud/aiplatform/v1/vizier_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/aiplatform/v1/vizier_connection.h b/google/cloud/aiplatform/v1/vizier_connection.h index 23ca3d936d359..47b078d3a0177 100644 --- a/google/cloud/aiplatform/v1/vizier_connection.h +++ b/google/cloud/aiplatform/v1/vizier_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/aiplatform/v1/internal/vizier_retry_traits.h" #include "google/cloud/aiplatform/v1/vizier_connection_idempotency_policy.h" +#include "google/cloud/aiplatform/v1/vizier_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/aiplatform/v1/vizier_connection_idempotency_policy.h b/google/cloud/aiplatform/v1/vizier_connection_idempotency_policy.h index a94b8ebcfa0ec..4342b560891c7 100644 --- a/google/cloud/aiplatform/v1/vizier_connection_idempotency_policy.h +++ b/google/cloud/aiplatform/v1/vizier_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_VIZIER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AIPLATFORM_V1_VIZIER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/aiplatform/v1/vizier_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/alloydb/BUILD.bazel b/google/cloud/alloydb/BUILD.bazel index 9b90196e9337c..1a6fc0ddfa957 100644 --- a/google/cloud/alloydb/BUILD.bazel +++ b/google/cloud/alloydb/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/alloydb/v1:alloydb_cc_grpc", + "@googleapis//google/cloud/alloydb/v1:alloydb_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/alloydb/quickstart/.bazelrc b/google/cloud/alloydb/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/alloydb/quickstart/.bazelrc +++ b/google/cloud/alloydb/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/alloydb/quickstart/CMakeLists.txt index e1b180b12c4cb..38b1c1ceaca63 100644 --- a/google/cloud/alloydb/quickstart/CMakeLists.txt +++ b/google/cloud/alloydb/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the AlloyDB API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-alloydb-quickstart CXX) find_package(google_cloud_cpp_alloydb REQUIRED) diff --git a/google/cloud/alloydb/quickstart/WORKSPACE.bazel b/google/cloud/alloydb/quickstart/WORKSPACE.bazel index 22a49ab305ddd..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 = "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/alloydb/v1/alloy_db_admin_client.h b/google/cloud/alloydb/v1/alloy_db_admin_client.h index a8fe6f1431d73..e344b37b5db26 100644 --- a/google/cloud/alloydb/v1/alloy_db_admin_client.h +++ b/google/cloud/alloydb/v1/alloy_db_admin_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/alloydb/v1/alloy_db_admin_connection.h b/google/cloud/alloydb/v1/alloy_db_admin_connection.h index 3d1d8a21ff748..a9ec08c2a38e6 100644 --- a/google/cloud/alloydb/v1/alloy_db_admin_connection.h +++ b/google/cloud/alloydb/v1/alloy_db_admin_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/alloydb/v1/alloy_db_admin_connection_idempotency_policy.h" #include "google/cloud/alloydb/v1/internal/alloy_db_admin_retry_traits.h" +#include "google/cloud/alloydb/v1/service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/alloydb/v1/alloy_db_admin_connection_idempotency_policy.h b/google/cloud/alloydb/v1/alloy_db_admin_connection_idempotency_policy.h index 351efc9e62522..e11bcadb9dea7 100644 --- a/google/cloud/alloydb/v1/alloy_db_admin_connection_idempotency_policy.h +++ b/google/cloud/alloydb/v1/alloy_db_admin_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ALLOYDB_V1_ALLOY_DB_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ALLOYDB_V1_ALLOY_DB_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/alloydb/v1/service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_auth_decorator.cc b/google/cloud/alloydb/v1/internal/alloy_db_admin_auth_decorator.cc index 0555447f5b519..088a7b60ac0d4 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_auth_decorator.cc +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/alloydb/v1/service.proto #include "google/cloud/alloydb/v1/internal/alloy_db_admin_auth_decorator.h" -#include +#include "google/cloud/alloydb/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace alloydb_v1_internal { @@ -850,3 +853,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace alloydb_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_auth_decorator.h b/google/cloud/alloydb/v1/internal/alloy_db_admin_auth_decorator.h index 290c386e554aa..459a2370b07ce 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_auth_decorator.h +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/alloydb/v1/internal/alloy_db_admin_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 alloydb_v1_internal { @@ -388,4 +391,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ALLOYDB_V1_INTERNAL_ALLOY_DB_ADMIN_AUTH_DECORATOR_H diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_connection_impl.h b/google/cloud/alloydb/v1/internal/alloy_db_admin_connection_impl.h index 2122c10698b20..d1170b5b70661 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_connection_impl.h +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_logging_decorator.cc b/google/cloud/alloydb/v1/internal/alloy_db_admin_logging_decorator.cc index e4451b8c60dd1..9a6392cc8db57 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_logging_decorator.cc +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/alloydb/v1/service.proto #include "google/cloud/alloydb/v1/internal/alloy_db_admin_logging_decorator.h" +#include "google/cloud/alloydb/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace alloydb_v1_internal { @@ -957,3 +960,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace alloydb_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_logging_decorator.h b/google/cloud/alloydb/v1/internal/alloy_db_admin_logging_decorator.h index 32d1b789a8d3d..7fe12dbee1dea 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_logging_decorator.h +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/alloydb/v1/internal/alloy_db_admin_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 alloydb_v1_internal { @@ -388,4 +391,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ALLOYDB_V1_INTERNAL_ALLOY_DB_ADMIN_LOGGING_DECORATOR_H diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_metadata_decorator.cc b/google/cloud/alloydb/v1/internal/alloy_db_admin_metadata_decorator.cc index 6fcce41ba2af3..22f94daf25694 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_metadata_decorator.cc +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/alloydb/v1/service.proto #include "google/cloud/alloydb/v1/internal/alloy_db_admin_metadata_decorator.h" +#include "google/cloud/alloydb/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 alloydb_v1_internal { @@ -706,3 +710,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace alloydb_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_metadata_decorator.h b/google/cloud/alloydb/v1/internal/alloy_db_admin_metadata_decorator.h index 72630a43e6388..84478b9ca4240 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_metadata_decorator.h +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/alloydb/v1/internal/alloy_db_admin_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 alloydb_v1_internal { @@ -393,4 +396,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ALLOYDB_V1_INTERNAL_ALLOY_DB_ADMIN_METADATA_DECORATOR_H diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_option_defaults.cc b/google/cloud/alloydb/v1/internal/alloy_db_admin_option_defaults.cc index cbeba5b8074e5..002b02ca2472e 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_option_defaults.cc +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_option_defaults.cc @@ -40,7 +40,7 @@ Options AlloyDBAdminDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - alloydb_v1::AlloyDBAdminLimitedTimeRetryPolicy(std::chrono::minutes(30)) + alloydb_v1::AlloyDBAdminLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_stub.cc b/google/cloud/alloydb/v1/internal/alloy_db_admin_stub.cc index a0f18ecd4205d..6cacb7ae0fbae 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_stub.cc +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/alloydb/v1/service.proto #include "google/cloud/alloydb/v1/internal/alloy_db_admin_stub.h" +#include "google/cloud/alloydb/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace alloydb_v1_internal { @@ -961,3 +964,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace alloydb_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_stub.h b/google/cloud/alloydb/v1/internal/alloy_db_admin_stub.h index 448991524bb62..f34e60da77f8d 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_stub.h +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ALLOYDB_V1_INTERNAL_ALLOY_DB_ADMIN_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ALLOYDB_V1_INTERNAL_ALLOY_DB_ADMIN_STUB_H +#include "google/cloud/alloydb/v1/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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace alloydb_v1_internal { @@ -738,4 +741,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ALLOYDB_V1_INTERNAL_ALLOY_DB_ADMIN_STUB_H diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_stub_factory.cc b/google/cloud/alloydb/v1/internal/alloy_db_admin_stub_factory.cc index f82f732e137e3..5986d74749204 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_stub_factory.cc +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_stub_factory.cc @@ -22,18 +22,21 @@ #include "google/cloud/alloydb/v1/internal/alloy_db_admin_metadata_decorator.h" #include "google/cloud/alloydb/v1/internal/alloy_db_admin_stub.h" #include "google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_stub.h" +#include "google/cloud/alloydb/v1/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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace alloydb_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace alloydb_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_stub_factory.h b/google/cloud/alloydb/v1/internal/alloy_db_admin_stub_factory.h index eb59381f5205c..298af23712777 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_stub_factory.h +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace alloydb_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ALLOYDB_V1_INTERNAL_ALLOY_DB_ADMIN_STUB_FACTORY_H diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_connection.cc b/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_connection.cc index c021f389e8d33..2870a46744f37 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_connection.cc +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace alloydb_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AlloyDBAdminTracingConnection::AlloyDBAdminTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -852,16 +850,12 @@ Status AlloyDBAdminTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAlloyDBAdminTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_connection.h b/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_connection.h index 44aa83f712883..b8e8c12e94df7 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_connection.h +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace alloydb_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AlloyDBAdminTracingConnection : public alloydb_v1::AlloyDBAdminConnection { public: @@ -355,8 +353,6 @@ class AlloyDBAdminTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_stub.cc b/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_stub.cc index b5b776d547499..57c2ef409b6aa 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_stub.cc +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace alloydb_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AlloyDBAdminTracingStub::AlloyDBAdminTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -871,18 +872,14 @@ future AlloyDBAdminTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAlloyDBAdminTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace alloydb_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_stub.h b/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_stub.h index abc55c7320afc..5440a73025212 100644 --- a/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_stub.h +++ b/google/cloud/alloydb/v1/internal/alloy_db_admin_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace alloydb_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AlloyDBAdminTracingStub : public AlloyDBAdminStub { public: ~AlloyDBAdminTracingStub() override = default; @@ -383,8 +384,6 @@ class AlloyDBAdminTracingStub : public AlloyDBAdminStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -399,4 +398,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ALLOYDB_V1_INTERNAL_ALLOY_DB_ADMIN_TRACING_STUB_H diff --git a/google/cloud/apigateway/BUILD.bazel b/google/cloud/apigateway/BUILD.bazel index 78feee464f8bc..28d101db96038 100644 --- a/google/cloud/apigateway/BUILD.bazel +++ b/google/cloud/apigateway/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/apigateway/v1:apigateway_cc_grpc", + "@googleapis//google/cloud/apigateway/v1:apigateway_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/apigateway/CMakeLists.txt b/google/cloud/apigateway/CMakeLists.txt index f8716f3925908..44a49c3102bbd 100644 --- a/google/cloud/apigateway/CMakeLists.txt +++ b/google/cloud/apigateway/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(apigateway "API Gateway API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(apigateway_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/apigateway/api_gateway_client.h b/google/cloud/apigateway/api_gateway_client.h deleted file mode 100644 index 11682e568526f..0000000000000 --- a/google/cloud/apigateway/api_gateway_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/apigateway/v1/apigateway_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_API_GATEWAY_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_API_GATEWAY_CLIENT_H - -#include "google/cloud/apigateway/api_gateway_connection.h" -#include "google/cloud/apigateway/v1/api_gateway_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in apigateway_v1 instead of the aliases defined in -/// this namespace. -namespace apigateway { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use apigateway_v1::ApiGatewayServiceClient directly. -using ::google::cloud::apigateway_v1::ApiGatewayServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apigateway -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_API_GATEWAY_CLIENT_H diff --git a/google/cloud/apigateway/api_gateway_connection.h b/google/cloud/apigateway/api_gateway_connection.h deleted file mode 100644 index 443ca07c15bc9..0000000000000 --- a/google/cloud/apigateway/api_gateway_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/apigateway/v1/apigateway_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_API_GATEWAY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_API_GATEWAY_CONNECTION_H - -#include "google/cloud/apigateway/api_gateway_connection_idempotency_policy.h" -#include "google/cloud/apigateway/v1/api_gateway_connection.h" - -namespace google { -namespace cloud { -namespace apigateway { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use apigateway_v1::MakeApiGatewayServiceConnection directly. -using ::google::cloud::apigateway_v1::MakeApiGatewayServiceConnection; - -/// @deprecated Use apigateway_v1::ApiGatewayServiceConnection directly. -using ::google::cloud::apigateway_v1::ApiGatewayServiceConnection; - -/// @deprecated Use apigateway_v1::ApiGatewayServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::apigateway_v1:: - ApiGatewayServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use apigateway_v1::ApiGatewayServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::apigateway_v1::ApiGatewayServiceLimitedTimeRetryPolicy; - -/// @deprecated Use apigateway_v1::ApiGatewayServiceRetryPolicy directly. -using ::google::cloud::apigateway_v1::ApiGatewayServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apigateway -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_API_GATEWAY_CONNECTION_H diff --git a/google/cloud/apigateway/api_gateway_connection_idempotency_policy.h b/google/cloud/apigateway/api_gateway_connection_idempotency_policy.h deleted file mode 100644 index fb27239b47976..0000000000000 --- a/google/cloud/apigateway/api_gateway_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/apigateway/v1/apigateway_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_API_GATEWAY_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_API_GATEWAY_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/apigateway/v1/api_gateway_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace apigateway { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// apigateway_v1::MakeDefaultApiGatewayServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::apigateway_v1:: - MakeDefaultApiGatewayServiceConnectionIdempotencyPolicy; - -/// @deprecated Use apigateway_v1::ApiGatewayServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::apigateway_v1:: - ApiGatewayServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apigateway -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_API_GATEWAY_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/apigateway/api_gateway_options.h b/google/cloud/apigateway/api_gateway_options.h deleted file mode 100644 index 1d45ecba0b52e..0000000000000 --- a/google/cloud/apigateway/api_gateway_options.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/apigateway/v1/apigateway_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_API_GATEWAY_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_API_GATEWAY_OPTIONS_H - -#include "google/cloud/apigateway/api_gateway_connection.h" -#include "google/cloud/apigateway/api_gateway_connection_idempotency_policy.h" -#include "google/cloud/apigateway/v1/api_gateway_options.h" - -namespace google { -namespace cloud { -namespace apigateway { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use apigateway_v1::ApiGatewayServicePollingPolicyOption -/// directly. -using ::google::cloud::apigateway_v1::ApiGatewayServicePollingPolicyOption; - -/// @deprecated Use apigateway_v1::ApiGatewayServiceBackoffPolicyOption -/// directly. -using ::google::cloud::apigateway_v1::ApiGatewayServiceBackoffPolicyOption; - -/// @deprecated Use -/// apigateway_v1::ApiGatewayServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::apigateway_v1:: - ApiGatewayServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use apigateway_v1::ApiGatewayServicePolicyOptionList directly. -using ::google::cloud::apigateway_v1::ApiGatewayServicePolicyOptionList; - -/// @deprecated Use apigateway_v1::ApiGatewayServiceRetryPolicyOption directly. -using ::google::cloud::apigateway_v1::ApiGatewayServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apigateway -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_API_GATEWAY_OPTIONS_H diff --git a/google/cloud/apigateway/mocks/mock_api_gateway_connection.h b/google/cloud/apigateway/mocks/mock_api_gateway_connection.h deleted file mode 100644 index e8fa59547c057..0000000000000 --- a/google/cloud/apigateway/mocks/mock_api_gateway_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/apigateway/v1/apigateway_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_MOCKS_MOCK_API_GATEWAY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_MOCKS_MOCK_API_GATEWAY_CONNECTION_H - -#include "google/cloud/apigateway/api_gateway_connection.h" -#include "google/cloud/apigateway/v1/mocks/mock_api_gateway_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in apigateway_v1_mocks instead of the aliases -/// defined in this namespace. -namespace apigateway_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use apigateway_v1_mocks::MockApiGatewayServiceConnection -/// directly. -using ::google::cloud::apigateway_v1_mocks::MockApiGatewayServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apigateway_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_MOCKS_MOCK_API_GATEWAY_CONNECTION_H diff --git a/google/cloud/apigateway/quickstart/.bazelrc b/google/cloud/apigateway/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/apigateway/quickstart/.bazelrc +++ b/google/cloud/apigateway/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/apigateway/quickstart/CMakeLists.txt index 1f9e2b88c55dc..79dc737b27e39 100644 --- a/google/cloud/apigateway/quickstart/CMakeLists.txt +++ b/google/cloud/apigateway/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the API Gateway API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-apigateway-quickstart CXX) find_package(google_cloud_cpp_apigateway REQUIRED) diff --git a/google/cloud/apigateway/quickstart/WORKSPACE.bazel b/google/cloud/apigateway/quickstart/WORKSPACE.bazel index cefd8d4255b6a..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 = "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/apigateway/v1/api_gateway_client.h b/google/cloud/apigateway/v1/api_gateway_client.h index a5c8d59062d90..73eb87ee11038 100644 --- a/google/cloud/apigateway/v1/api_gateway_client.h +++ b/google/cloud/apigateway/v1/api_gateway_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/apigateway/v1/api_gateway_connection.h b/google/cloud/apigateway/v1/api_gateway_connection.h index ebaf51e29e0d8..a376f5d952702 100644 --- a/google/cloud/apigateway/v1/api_gateway_connection.h +++ b/google/cloud/apigateway/v1/api_gateway_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_V1_API_GATEWAY_CONNECTION_H #include "google/cloud/apigateway/v1/api_gateway_connection_idempotency_policy.h" +#include "google/cloud/apigateway/v1/apigateway_service.pb.h" #include "google/cloud/apigateway/v1/internal/api_gateway_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/apigateway/v1/api_gateway_connection_idempotency_policy.h b/google/cloud/apigateway/v1/api_gateway_connection_idempotency_policy.h index f7643569af365..66d28e6b09a43 100644 --- a/google/cloud/apigateway/v1/api_gateway_connection_idempotency_policy.h +++ b/google/cloud/apigateway/v1/api_gateway_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_V1_API_GATEWAY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_V1_API_GATEWAY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/apigateway/v1/apigateway_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/apigateway/v1/internal/api_gateway_auth_decorator.cc b/google/cloud/apigateway/v1/internal/api_gateway_auth_decorator.cc index dadcf70243831..494c205901c69 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_auth_decorator.cc +++ b/google/cloud/apigateway/v1/internal/api_gateway_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/apigateway/v1/apigateway_service.proto #include "google/cloud/apigateway/v1/internal/api_gateway_auth_decorator.h" -#include +#include "google/cloud/apigateway/v1/apigateway_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigateway_v1_internal { @@ -376,3 +379,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apigateway_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apigateway/v1/internal/api_gateway_auth_decorator.h b/google/cloud/apigateway/v1/internal/api_gateway_auth_decorator.h index 93c3156215daf..7671a0f82f4c8 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_auth_decorator.h +++ b/google/cloud/apigateway/v1/internal/api_gateway_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/apigateway/v1/internal/api_gateway_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 apigateway_v1_internal { @@ -190,4 +193,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_V1_INTERNAL_API_GATEWAY_AUTH_DECORATOR_H diff --git a/google/cloud/apigateway/v1/internal/api_gateway_connection_impl.h b/google/cloud/apigateway/v1/internal/api_gateway_connection_impl.h index 7ecf3194e2e63..c2965086db970 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_connection_impl.h +++ b/google/cloud/apigateway/v1/internal/api_gateway_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/apigateway/v1/internal/api_gateway_logging_decorator.cc b/google/cloud/apigateway/v1/internal/api_gateway_logging_decorator.cc index b0c6358a39a2d..4308fcbb72ad2 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_logging_decorator.cc +++ b/google/cloud/apigateway/v1/internal/api_gateway_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/apigateway/v1/apigateway_service.proto #include "google/cloud/apigateway/v1/internal/api_gateway_logging_decorator.h" +#include "google/cloud/apigateway/v1/apigateway_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigateway_v1_internal { @@ -427,3 +430,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apigateway_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apigateway/v1/internal/api_gateway_logging_decorator.h b/google/cloud/apigateway/v1/internal/api_gateway_logging_decorator.h index edd5a751bc940..aee320d115454 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_logging_decorator.h +++ b/google/cloud/apigateway/v1/internal/api_gateway_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/apigateway/v1/internal/api_gateway_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 apigateway_v1_internal { @@ -190,4 +193,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_V1_INTERNAL_API_GATEWAY_LOGGING_DECORATOR_H diff --git a/google/cloud/apigateway/v1/internal/api_gateway_metadata_decorator.cc b/google/cloud/apigateway/v1/internal/api_gateway_metadata_decorator.cc index 09771ce5fb159..4a536b4264718 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_metadata_decorator.cc +++ b/google/cloud/apigateway/v1/internal/api_gateway_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/apigateway/v1/apigateway_service.proto #include "google/cloud/apigateway/v1/internal/api_gateway_metadata_decorator.h" +#include "google/cloud/apigateway/v1/apigateway_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 apigateway_v1_internal { @@ -329,3 +333,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apigateway_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apigateway/v1/internal/api_gateway_metadata_decorator.h b/google/cloud/apigateway/v1/internal/api_gateway_metadata_decorator.h index f7fb5e6ee2d53..b7b268ac83537 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_metadata_decorator.h +++ b/google/cloud/apigateway/v1/internal/api_gateway_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/apigateway/v1/internal/api_gateway_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 apigateway_v1_internal { @@ -196,4 +199,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_V1_INTERNAL_API_GATEWAY_METADATA_DECORATOR_H diff --git a/google/cloud/apigateway/v1/internal/api_gateway_option_defaults.cc b/google/cloud/apigateway/v1/internal/api_gateway_option_defaults.cc index 1644d4e5fbc39..c33b07bb670c6 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_option_defaults.cc +++ b/google/cloud/apigateway/v1/internal/api_gateway_option_defaults.cc @@ -42,7 +42,7 @@ Options ApiGatewayServiceDefaultOptions(Options options) { if (!options.has()) { options.set( apigateway_v1::ApiGatewayServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/apigateway/v1/internal/api_gateway_stub.cc b/google/cloud/apigateway/v1/internal/api_gateway_stub.cc index 09d5f97b2b025..e7757e76ed354 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_stub.cc +++ b/google/cloud/apigateway/v1/internal/api_gateway_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/apigateway/v1/apigateway_service.proto #include "google/cloud/apigateway/v1/internal/api_gateway_stub.h" +#include "google/cloud/apigateway/v1/apigateway_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigateway_v1_internal { @@ -419,3 +422,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apigateway_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apigateway/v1/internal/api_gateway_stub.h b/google/cloud/apigateway/v1/internal/api_gateway_stub.h index a0e1f55b004db..7c1fc88665277 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_stub.h +++ b/google/cloud/apigateway/v1/internal/api_gateway_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_V1_INTERNAL_API_GATEWAY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_V1_INTERNAL_API_GATEWAY_STUB_H +#include "google/cloud/apigateway/v1/apigateway_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigateway_v1_internal { @@ -332,4 +335,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_V1_INTERNAL_API_GATEWAY_STUB_H diff --git a/google/cloud/apigateway/v1/internal/api_gateway_stub_factory.cc b/google/cloud/apigateway/v1/internal/api_gateway_stub_factory.cc index dd40a5d2a1247..325b74b390453 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_stub_factory.cc +++ b/google/cloud/apigateway/v1/internal/api_gateway_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/apigateway/v1/apigateway_service.proto #include "google/cloud/apigateway/v1/internal/api_gateway_stub_factory.h" +#include "google/cloud/apigateway/v1/apigateway_service.grpc.pb.h" #include "google/cloud/apigateway/v1/internal/api_gateway_auth_decorator.h" #include "google/cloud/apigateway/v1/internal/api_gateway_logging_decorator.h" #include "google/cloud/apigateway/v1/internal/api_gateway_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigateway_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apigateway_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apigateway/v1/internal/api_gateway_stub_factory.h b/google/cloud/apigateway/v1/internal/api_gateway_stub_factory.h index 45b9f506978e6..6035ab0f9f84a 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_stub_factory.h +++ b/google/cloud/apigateway/v1/internal/api_gateway_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigateway_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_V1_INTERNAL_API_GATEWAY_STUB_FACTORY_H diff --git a/google/cloud/apigateway/v1/internal/api_gateway_tracing_connection.cc b/google/cloud/apigateway/v1/internal/api_gateway_tracing_connection.cc index 539f41bc71d48..19844e08f35f4 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_tracing_connection.cc +++ b/google/cloud/apigateway/v1/internal/api_gateway_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace apigateway_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ApiGatewayServiceTracingConnection::ApiGatewayServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -348,17 +346,13 @@ ApiGatewayServiceTracingConnection::DeleteApiConfig( return internal::EndSpan(std::move(span), child_->DeleteApiConfig(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeApiGatewayServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/apigateway/v1/internal/api_gateway_tracing_connection.h b/google/cloud/apigateway/v1/internal/api_gateway_tracing_connection.h index 7a180a7ce1054..39c967f077577 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_tracing_connection.h +++ b/google/cloud/apigateway/v1/internal/api_gateway_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace apigateway_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ApiGatewayServiceTracingConnection : public apigateway_v1::ApiGatewayServiceConnection { public: @@ -165,8 +163,6 @@ class ApiGatewayServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/apigateway/v1/internal/api_gateway_tracing_stub.cc b/google/cloud/apigateway/v1/internal/api_gateway_tracing_stub.cc index 50b4ff12a5f75..07509df64e7b0 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_tracing_stub.cc +++ b/google/cloud/apigateway/v1/internal/api_gateway_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigateway_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ApiGatewayServiceTracingStub::ApiGatewayServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -369,18 +370,14 @@ future ApiGatewayServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeApiGatewayServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apigateway_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apigateway/v1/internal/api_gateway_tracing_stub.h b/google/cloud/apigateway/v1/internal/api_gateway_tracing_stub.h index a21e4de539d4a..940d6054e2dd9 100644 --- a/google/cloud/apigateway/v1/internal/api_gateway_tracing_stub.h +++ b/google/cloud/apigateway/v1/internal/api_gateway_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigateway_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ApiGatewayServiceTracingStub : public ApiGatewayServiceStub { public: ~ApiGatewayServiceTracingStub() override = default; @@ -186,8 +187,6 @@ class ApiGatewayServiceTracingStub : public ApiGatewayServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -202,4 +201,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGATEWAY_V1_INTERNAL_API_GATEWAY_TRACING_STUB_H diff --git a/google/cloud/apigeeconnect/BUILD.bazel b/google/cloud/apigeeconnect/BUILD.bazel index 6a8714fa07948..6d3b46405035e 100644 --- a/google/cloud/apigeeconnect/BUILD.bazel +++ b/google/cloud/apigeeconnect/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/apigeeconnect/v1:apigeeconnect_cc_grpc", + "@googleapis//google/cloud/apigeeconnect/v1:apigeeconnect_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/apigeeconnect/CMakeLists.txt b/google/cloud/apigeeconnect/CMakeLists.txt index 1cd0bd5580905..5f0260ac1f1ec 100644 --- a/google/cloud/apigeeconnect/CMakeLists.txt +++ b/google/cloud/apigeeconnect/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(apigeeconnect "Apigee Connect API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(apigeeconnect_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/apigeeconnect/connection_client.h b/google/cloud/apigeeconnect/connection_client.h deleted file mode 100644 index 06f649bb13415..0000000000000 --- a/google/cloud/apigeeconnect/connection_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/apigeeconnect/v1/connection.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_CONNECTION_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_CONNECTION_CLIENT_H - -#include "google/cloud/apigeeconnect/connection_connection.h" -#include "google/cloud/apigeeconnect/v1/connection_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in apigeeconnect_v1 instead of the aliases defined in -/// this namespace. -namespace apigeeconnect { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use apigeeconnect_v1::ConnectionServiceClient directly. -using ::google::cloud::apigeeconnect_v1::ConnectionServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apigeeconnect -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_CONNECTION_CLIENT_H diff --git a/google/cloud/apigeeconnect/connection_connection.h b/google/cloud/apigeeconnect/connection_connection.h deleted file mode 100644 index faf53eff5cc35..0000000000000 --- a/google/cloud/apigeeconnect/connection_connection.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/apigeeconnect/v1/connection.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_CONNECTION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_CONNECTION_CONNECTION_H - -#include "google/cloud/apigeeconnect/connection_connection_idempotency_policy.h" -#include "google/cloud/apigeeconnect/v1/connection_connection.h" - -namespace google { -namespace cloud { -namespace apigeeconnect { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use apigeeconnect_v1::MakeConnectionServiceConnection directly. -using ::google::cloud::apigeeconnect_v1::MakeConnectionServiceConnection; - -/// @deprecated Use apigeeconnect_v1::ConnectionServiceConnection directly. -using ::google::cloud::apigeeconnect_v1::ConnectionServiceConnection; - -/// @deprecated Use -/// apigeeconnect_v1::ConnectionServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::apigeeconnect_v1:: - ConnectionServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use apigeeconnect_v1::ConnectionServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::apigeeconnect_v1:: - ConnectionServiceLimitedTimeRetryPolicy; - -/// @deprecated Use apigeeconnect_v1::ConnectionServiceRetryPolicy directly. -using ::google::cloud::apigeeconnect_v1::ConnectionServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apigeeconnect -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_CONNECTION_CONNECTION_H diff --git a/google/cloud/apigeeconnect/connection_connection_idempotency_policy.h b/google/cloud/apigeeconnect/connection_connection_idempotency_policy.h deleted file mode 100644 index 95089111aedf2..0000000000000 --- a/google/cloud/apigeeconnect/connection_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/apigeeconnect/v1/connection.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_CONNECTION_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_CONNECTION_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/apigeeconnect/v1/connection_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace apigeeconnect { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// apigeeconnect_v1::MakeDefaultConnectionServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::apigeeconnect_v1:: - MakeDefaultConnectionServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// apigeeconnect_v1::ConnectionServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::apigeeconnect_v1:: - ConnectionServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apigeeconnect -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_CONNECTION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/apigeeconnect/connection_options.h b/google/cloud/apigeeconnect/connection_options.h deleted file mode 100644 index 1b39a2d29fab4..0000000000000 --- a/google/cloud/apigeeconnect/connection_options.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/apigeeconnect/v1/connection.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_CONNECTION_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_CONNECTION_OPTIONS_H - -#include "google/cloud/apigeeconnect/connection_connection.h" -#include "google/cloud/apigeeconnect/connection_connection_idempotency_policy.h" -#include "google/cloud/apigeeconnect/v1/connection_options.h" - -namespace google { -namespace cloud { -namespace apigeeconnect { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use apigeeconnect_v1::ConnectionServiceBackoffPolicyOption -/// directly. -using ::google::cloud::apigeeconnect_v1::ConnectionServiceBackoffPolicyOption; - -/// @deprecated Use -/// apigeeconnect_v1::ConnectionServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::apigeeconnect_v1:: - ConnectionServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use apigeeconnect_v1::ConnectionServicePolicyOptionList -/// directly. -using ::google::cloud::apigeeconnect_v1::ConnectionServicePolicyOptionList; - -/// @deprecated Use apigeeconnect_v1::ConnectionServiceRetryPolicyOption -/// directly. -using ::google::cloud::apigeeconnect_v1::ConnectionServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apigeeconnect -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_CONNECTION_OPTIONS_H diff --git a/google/cloud/apigeeconnect/mocks/mock_connection_connection.h b/google/cloud/apigeeconnect/mocks/mock_connection_connection.h deleted file mode 100644 index 97a554a229806..0000000000000 --- a/google/cloud/apigeeconnect/mocks/mock_connection_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/apigeeconnect/v1/connection.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_MOCKS_MOCK_CONNECTION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_MOCKS_MOCK_CONNECTION_CONNECTION_H - -#include "google/cloud/apigeeconnect/connection_connection.h" -#include "google/cloud/apigeeconnect/v1/mocks/mock_connection_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in apigeeconnect_v1_mocks instead of the aliases -/// defined in this namespace. -namespace apigeeconnect_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use apigeeconnect_v1_mocks::MockConnectionServiceConnection -/// directly. -using ::google::cloud::apigeeconnect_v1_mocks::MockConnectionServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apigeeconnect_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_MOCKS_MOCK_CONNECTION_CONNECTION_H diff --git a/google/cloud/apigeeconnect/quickstart/.bazelrc b/google/cloud/apigeeconnect/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/apigeeconnect/quickstart/.bazelrc +++ b/google/cloud/apigeeconnect/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/apigeeconnect/quickstart/CMakeLists.txt index 880a23ecd68fd..776822142848f 100644 --- a/google/cloud/apigeeconnect/quickstart/CMakeLists.txt +++ b/google/cloud/apigeeconnect/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Apigee Connect API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-apigeeconnect-quickstart CXX) find_package(google_cloud_cpp_apigeeconnect REQUIRED) diff --git a/google/cloud/apigeeconnect/quickstart/WORKSPACE.bazel b/google/cloud/apigeeconnect/quickstart/WORKSPACE.bazel index dde043cbb8762..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 = "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/apigeeconnect/v1/connection_connection.h b/google/cloud/apigeeconnect/v1/connection_connection.h index 506e345332ec4..0acd5da0b0674 100644 --- a/google/cloud/apigeeconnect/v1/connection_connection.h +++ b/google/cloud/apigeeconnect/v1/connection_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_V1_CONNECTION_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_V1_CONNECTION_CONNECTION_H +#include "google/cloud/apigeeconnect/v1/connection.pb.h" #include "google/cloud/apigeeconnect/v1/connection_connection_idempotency_policy.h" #include "google/cloud/apigeeconnect/v1/internal/connection_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/apigeeconnect/v1/connection_connection_idempotency_policy.h b/google/cloud/apigeeconnect/v1/connection_connection_idempotency_policy.h index 19bf869a8a2b9..bb1b3b5f8632a 100644 --- a/google/cloud/apigeeconnect/v1/connection_connection_idempotency_policy.h +++ b/google/cloud/apigeeconnect/v1/connection_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_V1_CONNECTION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_V1_CONNECTION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/apigeeconnect/v1/connection.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/apigeeconnect/v1/internal/connection_auth_decorator.cc b/google/cloud/apigeeconnect/v1/internal/connection_auth_decorator.cc index 92d3995628ea6..d0f07a30156ae 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_auth_decorator.cc +++ b/google/cloud/apigeeconnect/v1/internal/connection_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/apigeeconnect/v1/connection.proto #include "google/cloud/apigeeconnect/v1/internal/connection_auth_decorator.h" -#include +#include "google/cloud/apigeeconnect/v1/connection.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigeeconnect_v1_internal { @@ -44,3 +47,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apigeeconnect_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apigeeconnect/v1/internal/connection_auth_decorator.h b/google/cloud/apigeeconnect/v1/internal/connection_auth_decorator.h index fa066b714e04b..d226c55c1fb34 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_auth_decorator.h +++ b/google/cloud/apigeeconnect/v1/internal/connection_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigeeconnect_v1_internal { @@ -54,4 +57,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_V1_INTERNAL_CONNECTION_AUTH_DECORATOR_H diff --git a/google/cloud/apigeeconnect/v1/internal/connection_logging_decorator.cc b/google/cloud/apigeeconnect/v1/internal/connection_logging_decorator.cc index fc9c8cbcc1c1b..ed999edba43ad 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_logging_decorator.cc +++ b/google/cloud/apigeeconnect/v1/internal/connection_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/apigeeconnect/v1/connection.proto #include "google/cloud/apigeeconnect/v1/internal/connection_logging_decorator.h" +#include "google/cloud/apigeeconnect/v1/connection.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigeeconnect_v1_internal { @@ -52,3 +55,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apigeeconnect_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apigeeconnect/v1/internal/connection_logging_decorator.h b/google/cloud/apigeeconnect/v1/internal/connection_logging_decorator.h index 80f46ea42f17d..7201ad2e97d27 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_logging_decorator.h +++ b/google/cloud/apigeeconnect/v1/internal/connection_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigeeconnect_v1_internal { @@ -54,4 +57,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_V1_INTERNAL_CONNECTION_LOGGING_DECORATOR_H diff --git a/google/cloud/apigeeconnect/v1/internal/connection_metadata_decorator.cc b/google/cloud/apigeeconnect/v1/internal/connection_metadata_decorator.cc index f4ff80e2e7942..8078b807a6b0d 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_metadata_decorator.cc +++ b/google/cloud/apigeeconnect/v1/internal/connection_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/apigeeconnect/v1/connection.proto #include "google/cloud/apigeeconnect/v1/internal/connection_metadata_decorator.h" +#include "google/cloud/apigeeconnect/v1/connection.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 apigeeconnect_v1_internal { @@ -70,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apigeeconnect_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apigeeconnect/v1/internal/connection_metadata_decorator.h b/google/cloud/apigeeconnect/v1/internal/connection_metadata_decorator.h index 0196f9c597df9..92da7b45c2226 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_metadata_decorator.h +++ b/google/cloud/apigeeconnect/v1/internal/connection_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigeeconnect_v1_internal { @@ -60,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_V1_INTERNAL_CONNECTION_METADATA_DECORATOR_H diff --git a/google/cloud/apigeeconnect/v1/internal/connection_option_defaults.cc b/google/cloud/apigeeconnect/v1/internal/connection_option_defaults.cc index e80d12ae29e7d..ec7f427ac9030 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_option_defaults.cc +++ b/google/cloud/apigeeconnect/v1/internal/connection_option_defaults.cc @@ -42,7 +42,7 @@ Options ConnectionServiceDefaultOptions(Options options) { if (!options.has()) { options.set( apigeeconnect_v1::ConnectionServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/apigeeconnect/v1/internal/connection_stub.cc b/google/cloud/apigeeconnect/v1/internal/connection_stub.cc index 61bd92a3d2fc2..18dc9b6359c59 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_stub.cc +++ b/google/cloud/apigeeconnect/v1/internal/connection_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/apigeeconnect/v1/connection.proto #include "google/cloud/apigeeconnect/v1/internal/connection_stub.h" +#include "google/cloud/apigeeconnect/v1/connection.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigeeconnect_v1_internal { @@ -46,3 +49,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apigeeconnect_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apigeeconnect/v1/internal/connection_stub.h b/google/cloud/apigeeconnect/v1/internal/connection_stub.h index d24cbc8b7cad5..c5132d37548e7 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_stub.h +++ b/google/cloud/apigeeconnect/v1/internal/connection_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_V1_INTERNAL_CONNECTION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_V1_INTERNAL_CONNECTION_STUB_H +#include "google/cloud/apigeeconnect/v1/connection.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigeeconnect_v1_internal { @@ -67,4 +70,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_V1_INTERNAL_CONNECTION_STUB_H diff --git a/google/cloud/apigeeconnect/v1/internal/connection_stub_factory.cc b/google/cloud/apigeeconnect/v1/internal/connection_stub_factory.cc index bc2c14d37cf80..6b1c2f51e38be 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_stub_factory.cc +++ b/google/cloud/apigeeconnect/v1/internal/connection_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/apigeeconnect/v1/connection.proto #include "google/cloud/apigeeconnect/v1/internal/connection_stub_factory.h" +#include "google/cloud/apigeeconnect/v1/connection.grpc.pb.h" #include "google/cloud/apigeeconnect/v1/internal/connection_auth_decorator.h" #include "google/cloud/apigeeconnect/v1/internal/connection_logging_decorator.h" #include "google/cloud/apigeeconnect/v1/internal/connection_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigeeconnect_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apigeeconnect_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apigeeconnect/v1/internal/connection_stub_factory.h b/google/cloud/apigeeconnect/v1/internal/connection_stub_factory.h index a58e3444667e2..f88e499ebc2ec 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_stub_factory.h +++ b/google/cloud/apigeeconnect/v1/internal/connection_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigeeconnect_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_V1_INTERNAL_CONNECTION_STUB_FACTORY_H diff --git a/google/cloud/apigeeconnect/v1/internal/connection_tracing_connection.cc b/google/cloud/apigeeconnect/v1/internal/connection_tracing_connection.cc index 91dd2035e8453..7097253d7072d 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_tracing_connection.cc +++ b/google/cloud/apigeeconnect/v1/internal/connection_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace apigeeconnect_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConnectionServiceTracingConnection::ConnectionServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -45,17 +43,13 @@ ConnectionServiceTracingConnection::ListConnections( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConnectionServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/apigeeconnect/v1/internal/connection_tracing_connection.h b/google/cloud/apigeeconnect/v1/internal/connection_tracing_connection.h index 1052cb0d351be..d597a0964f6ae 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_tracing_connection.h +++ b/google/cloud/apigeeconnect/v1/internal/connection_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace apigeeconnect_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConnectionServiceTracingConnection : public apigeeconnect_v1::ConnectionServiceConnection { public: @@ -48,8 +46,6 @@ class ConnectionServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/apigeeconnect/v1/internal/connection_tracing_stub.cc b/google/cloud/apigeeconnect/v1/internal/connection_tracing_stub.cc index 005cd0ffcb7dd..080bb24e3b6fc 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_tracing_stub.cc +++ b/google/cloud/apigeeconnect/v1/internal/connection_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigeeconnect_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConnectionServiceTracingStub::ConnectionServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -44,18 +45,14 @@ ConnectionServiceTracingStub::ListConnections( child_->ListConnections(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConnectionServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apigeeconnect_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apigeeconnect/v1/internal/connection_tracing_stub.h b/google/cloud/apigeeconnect/v1/internal/connection_tracing_stub.h index 9bf61f26ff102..243b098500369 100644 --- a/google/cloud/apigeeconnect/v1/internal/connection_tracing_stub.h +++ b/google/cloud/apigeeconnect/v1/internal/connection_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apigeeconnect_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConnectionServiceTracingStub : public ConnectionServiceStub { public: ~ConnectionServiceTracingStub() override = default; @@ -51,8 +52,6 @@ class ConnectionServiceTracingStub : public ConnectionServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -67,4 +66,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIGEECONNECT_V1_INTERNAL_CONNECTION_TRACING_STUB_H diff --git a/google/cloud/apikeys/BUILD.bazel b/google/cloud/apikeys/BUILD.bazel index 5cdf8c63ef63e..77c3f7bbfbefa 100644 --- a/google/cloud/apikeys/BUILD.bazel +++ b/google/cloud/apikeys/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/api/apikeys/v2:apikeys_cc_grpc", + "@googleapis//google/api/apikeys/v2:apikeys_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/apikeys/CMakeLists.txt b/google/cloud/apikeys/CMakeLists.txt index a3f8fed13c9d9..538a9db2255b1 100644 --- a/google/cloud/apikeys/CMakeLists.txt +++ b/google/cloud/apikeys/CMakeLists.txt @@ -16,8 +16,7 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library(apikeys "API Keys API" - SERVICE_DIRS "__EMPTY__" "v2/") +google_cloud_cpp_add_gapic_library(apikeys "API Keys API" SERVICE_DIRS "v2/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(apikeys_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/apikeys/api_keys_client.h b/google/cloud/apikeys/api_keys_client.h deleted file mode 100644 index 08676a2051b37..0000000000000 --- a/google/cloud/apikeys/api_keys_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/apikeys/v2/apikeys.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_API_KEYS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_API_KEYS_CLIENT_H - -#include "google/cloud/apikeys/api_keys_connection.h" -#include "google/cloud/apikeys/v2/api_keys_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in apikeys_v2 instead of the aliases defined in -/// this namespace. -namespace apikeys { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use apikeys_v2::ApiKeysClient directly. -using ::google::cloud::apikeys_v2::ApiKeysClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apikeys -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_API_KEYS_CLIENT_H diff --git a/google/cloud/apikeys/api_keys_connection.h b/google/cloud/apikeys/api_keys_connection.h deleted file mode 100644 index 638f0d4ffc0d7..0000000000000 --- a/google/cloud/apikeys/api_keys_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/apikeys/v2/apikeys.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_API_KEYS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_API_KEYS_CONNECTION_H - -#include "google/cloud/apikeys/api_keys_connection_idempotency_policy.h" -#include "google/cloud/apikeys/v2/api_keys_connection.h" - -namespace google { -namespace cloud { -namespace apikeys { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use apikeys_v2::MakeApiKeysConnection directly. -using ::google::cloud::apikeys_v2::MakeApiKeysConnection; - -/// @deprecated Use apikeys_v2::ApiKeysConnection directly. -using ::google::cloud::apikeys_v2::ApiKeysConnection; - -/// @deprecated Use apikeys_v2::ApiKeysLimitedErrorCountRetryPolicy directly. -using ::google::cloud::apikeys_v2::ApiKeysLimitedErrorCountRetryPolicy; - -/// @deprecated Use apikeys_v2::ApiKeysLimitedTimeRetryPolicy directly. -using ::google::cloud::apikeys_v2::ApiKeysLimitedTimeRetryPolicy; - -/// @deprecated Use apikeys_v2::ApiKeysRetryPolicy directly. -using ::google::cloud::apikeys_v2::ApiKeysRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apikeys -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_API_KEYS_CONNECTION_H diff --git a/google/cloud/apikeys/api_keys_connection_idempotency_policy.h b/google/cloud/apikeys/api_keys_connection_idempotency_policy.h deleted file mode 100644 index 7edf168469e3e..0000000000000 --- a/google/cloud/apikeys/api_keys_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/apikeys/v2/apikeys.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_API_KEYS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_API_KEYS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/apikeys/v2/api_keys_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace apikeys { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use apikeys_v2::MakeDefaultApiKeysConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::apikeys_v2:: - MakeDefaultApiKeysConnectionIdempotencyPolicy; - -/// @deprecated Use apikeys_v2::ApiKeysConnectionIdempotencyPolicy directly. -using ::google::cloud::apikeys_v2::ApiKeysConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apikeys -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_API_KEYS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/apikeys/api_keys_options.h b/google/cloud/apikeys/api_keys_options.h deleted file mode 100644 index 15775fe00eb88..0000000000000 --- a/google/cloud/apikeys/api_keys_options.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/apikeys/v2/apikeys.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_API_KEYS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_API_KEYS_OPTIONS_H - -#include "google/cloud/apikeys/api_keys_connection.h" -#include "google/cloud/apikeys/api_keys_connection_idempotency_policy.h" -#include "google/cloud/apikeys/v2/api_keys_options.h" - -namespace google { -namespace cloud { -namespace apikeys { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use apikeys_v2::ApiKeysPollingPolicyOption directly. -using ::google::cloud::apikeys_v2::ApiKeysPollingPolicyOption; - -/// @deprecated Use apikeys_v2::ApiKeysBackoffPolicyOption directly. -using ::google::cloud::apikeys_v2::ApiKeysBackoffPolicyOption; - -/// @deprecated Use apikeys_v2::ApiKeysConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::apikeys_v2::ApiKeysConnectionIdempotencyPolicyOption; - -/// @deprecated Use apikeys_v2::ApiKeysPolicyOptionList directly. -using ::google::cloud::apikeys_v2::ApiKeysPolicyOptionList; - -/// @deprecated Use apikeys_v2::ApiKeysRetryPolicyOption directly. -using ::google::cloud::apikeys_v2::ApiKeysRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apikeys -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_API_KEYS_OPTIONS_H diff --git a/google/cloud/apikeys/mocks/mock_api_keys_connection.h b/google/cloud/apikeys/mocks/mock_api_keys_connection.h deleted file mode 100644 index 4022a1820decb..0000000000000 --- a/google/cloud/apikeys/mocks/mock_api_keys_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/apikeys/v2/apikeys.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_MOCKS_MOCK_API_KEYS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_MOCKS_MOCK_API_KEYS_CONNECTION_H - -#include "google/cloud/apikeys/api_keys_connection.h" -#include "google/cloud/apikeys/v2/mocks/mock_api_keys_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in apikeys_v2_mocks instead of the aliases -/// defined in this namespace. -namespace apikeys_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use apikeys_v2_mocks::MockApiKeysConnection directly. -using ::google::cloud::apikeys_v2_mocks::MockApiKeysConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace apikeys_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_MOCKS_MOCK_API_KEYS_CONNECTION_H diff --git a/google/cloud/apikeys/quickstart/.bazelrc b/google/cloud/apikeys/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/apikeys/quickstart/.bazelrc +++ b/google/cloud/apikeys/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/apikeys/quickstart/CMakeLists.txt index b0aa635b06ba9..fa968d0c91ef6 100644 --- a/google/cloud/apikeys/quickstart/CMakeLists.txt +++ b/google/cloud/apikeys/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the API Keys API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-apikeys-quickstart CXX) find_package(google_cloud_cpp_apikeys REQUIRED) diff --git a/google/cloud/apikeys/quickstart/WORKSPACE.bazel b/google/cloud/apikeys/quickstart/WORKSPACE.bazel index f400b608a7a61..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 = "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/apikeys/v2/api_keys_client.h b/google/cloud/apikeys/v2/api_keys_client.h index 2be36706202f2..497962470258a 100644 --- a/google/cloud/apikeys/v2/api_keys_client.h +++ b/google/cloud/apikeys/v2/api_keys_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/apikeys/v2/api_keys_connection.h b/google/cloud/apikeys/v2/api_keys_connection.h index d31c39d5016fe..e2ed3166006aa 100644 --- a/google/cloud/apikeys/v2/api_keys_connection.h +++ b/google/cloud/apikeys/v2/api_keys_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/api/apikeys/v2/apikeys.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/apikeys/v2/api_keys_connection_idempotency_policy.h b/google/cloud/apikeys/v2/api_keys_connection_idempotency_policy.h index ae88488a6f709..c130e9565ffa2 100644 --- a/google/cloud/apikeys/v2/api_keys_connection_idempotency_policy.h +++ b/google/cloud/apikeys/v2/api_keys_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/api/apikeys/v2/apikeys.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/apikeys/v2/internal/api_keys_auth_decorator.cc b/google/cloud/apikeys/v2/internal/api_keys_auth_decorator.cc index 2cee7a101ec3e..567f49da84008 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_auth_decorator.cc +++ b/google/cloud/apikeys/v2/internal/api_keys_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/api/apikeys/v2/apikeys.proto #include "google/cloud/apikeys/v2/internal/api_keys_auth_decorator.h" -#include +#include "google/api/apikeys/v2/apikeys.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apikeys_v2_internal { @@ -219,3 +222,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apikeys_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apikeys/v2/internal/api_keys_auth_decorator.h b/google/cloud/apikeys/v2/internal/api_keys_auth_decorator.h index 2022492482f28..f4a0cd2a1b541 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_auth_decorator.h +++ b/google/cloud/apikeys/v2/internal/api_keys_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/apikeys/v2/internal/api_keys_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 apikeys_v2_internal { @@ -121,4 +124,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_V2_INTERNAL_API_KEYS_AUTH_DECORATOR_H diff --git a/google/cloud/apikeys/v2/internal/api_keys_connection_impl.h b/google/cloud/apikeys/v2/internal/api_keys_connection_impl.h index 0b4affed839a1..00f3d701d0e37 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_connection_impl.h +++ b/google/cloud/apikeys/v2/internal/api_keys_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/apikeys/v2/internal/api_keys_logging_decorator.cc b/google/cloud/apikeys/v2/internal/api_keys_logging_decorator.cc index dc08d8cf174c3..530fdf7e7db17 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_logging_decorator.cc +++ b/google/cloud/apikeys/v2/internal/api_keys_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/apikeys/v2/internal/api_keys_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/api/apikeys/v2/apikeys.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apikeys_v2_internal { @@ -243,3 +246,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apikeys_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apikeys/v2/internal/api_keys_logging_decorator.h b/google/cloud/apikeys/v2/internal/api_keys_logging_decorator.h index c1e1a80148367..a17c002215cc6 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_logging_decorator.h +++ b/google/cloud/apikeys/v2/internal/api_keys_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/apikeys/v2/internal/api_keys_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 apikeys_v2_internal { @@ -121,4 +124,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_V2_INTERNAL_API_KEYS_LOGGING_DECORATOR_H diff --git a/google/cloud/apikeys/v2/internal/api_keys_metadata_decorator.cc b/google/cloud/apikeys/v2/internal/api_keys_metadata_decorator.cc index a38b3c956bce4..fdac36f41aefb 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_metadata_decorator.cc +++ b/google/cloud/apikeys/v2/internal/api_keys_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/apikeys/v2/internal/api_keys_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/api/apikeys/v2/apikeys.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apikeys_v2_internal { @@ -207,3 +211,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apikeys_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apikeys/v2/internal/api_keys_metadata_decorator.h b/google/cloud/apikeys/v2/internal/api_keys_metadata_decorator.h index 28b73655e3f18..117220b7890eb 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_metadata_decorator.h +++ b/google/cloud/apikeys/v2/internal/api_keys_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/apikeys/v2/internal/api_keys_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 apikeys_v2_internal { @@ -126,4 +129,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_V2_INTERNAL_API_KEYS_METADATA_DECORATOR_H diff --git a/google/cloud/apikeys/v2/internal/api_keys_option_defaults.cc b/google/cloud/apikeys/v2/internal/api_keys_option_defaults.cc index 92a132ccdf578..0ef4bb5b1206a 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_option_defaults.cc +++ b/google/cloud/apikeys/v2/internal/api_keys_option_defaults.cc @@ -40,7 +40,7 @@ Options ApiKeysDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - apikeys_v2::ApiKeysLimitedTimeRetryPolicy(std::chrono::minutes(30)) + apikeys_v2::ApiKeysLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/apikeys/v2/internal/api_keys_stub.cc b/google/cloud/apikeys/v2/internal/api_keys_stub.cc index aa19c80e4136f..7328cec32bee4 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_stub.cc +++ b/google/cloud/apikeys/v2/internal/api_keys_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/apikeys/v2/internal/api_keys_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/api/apikeys/v2/apikeys.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 apikeys_v2_internal { @@ -245,3 +248,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apikeys_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apikeys/v2/internal/api_keys_stub.h b/google/cloud/apikeys/v2/internal/api_keys_stub.h index 83759ad184c58..c8ff6eeaa3d9b 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_stub.h +++ b/google/cloud/apikeys/v2/internal/api_keys_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/api/apikeys/v2/apikeys.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 apikeys_v2_internal { @@ -204,4 +207,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_V2_INTERNAL_API_KEYS_STUB_H diff --git a/google/cloud/apikeys/v2/internal/api_keys_stub_factory.cc b/google/cloud/apikeys/v2/internal/api_keys_stub_factory.cc index 5195d11709456..edc37ad6c0750 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_stub_factory.cc +++ b/google/cloud/apikeys/v2/internal/api_keys_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/api/apikeys/v2/apikeys.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 apikeys_v2_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apikeys_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apikeys/v2/internal/api_keys_stub_factory.h b/google/cloud/apikeys/v2/internal/api_keys_stub_factory.h index 748719154e9a5..baddea2e216da 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_stub_factory.h +++ b/google/cloud/apikeys/v2/internal/api_keys_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apikeys_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_V2_INTERNAL_API_KEYS_STUB_FACTORY_H diff --git a/google/cloud/apikeys/v2/internal/api_keys_tracing_connection.cc b/google/cloud/apikeys/v2/internal/api_keys_tracing_connection.cc index 85e578504fddf..4eb8e3db000c8 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_tracing_connection.cc +++ b/google/cloud/apikeys/v2/internal/api_keys_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace apikeys_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ApiKeysTracingConnection::ApiKeysTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -164,15 +162,11 @@ StatusOr ApiKeysTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeApiKeysTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/apikeys/v2/internal/api_keys_tracing_connection.h b/google/cloud/apikeys/v2/internal/api_keys_tracing_connection.h index 7e40c48d17fc3..209a16af49e38 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_tracing_connection.h +++ b/google/cloud/apikeys/v2/internal/api_keys_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace apikeys_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ApiKeysTracingConnection : public apikeys_v2::ApiKeysConnection { public: ~ApiKeysTracingConnection() override = default; @@ -98,8 +96,6 @@ class ApiKeysTracingConnection : public apikeys_v2::ApiKeysConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/apikeys/v2/internal/api_keys_tracing_stub.cc b/google/cloud/apikeys/v2/internal/api_keys_tracing_stub.cc index 88df642e28a5c..d0169f58b5bf6 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_tracing_stub.cc +++ b/google/cloud/apikeys/v2/internal/api_keys_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apikeys_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ApiKeysTracingStub::ApiKeysTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -216,18 +217,14 @@ future ApiKeysTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeApiKeysTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apikeys_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apikeys/v2/internal/api_keys_tracing_stub.h b/google/cloud/apikeys/v2/internal/api_keys_tracing_stub.h index 0633583786c4d..c8703ae4d2936 100644 --- a/google/cloud/apikeys/v2/internal/api_keys_tracing_stub.h +++ b/google/cloud/apikeys/v2/internal/api_keys_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apikeys_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ApiKeysTracingStub : public ApiKeysStub { public: ~ApiKeysTracingStub() override = default; @@ -116,8 +117,6 @@ class ApiKeysTracingStub : public ApiKeysStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -132,4 +131,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIKEYS_V2_INTERNAL_API_KEYS_TRACING_STUB_H diff --git a/google/cloud/apiregistry/BUILD.bazel b/google/cloud/apiregistry/BUILD.bazel index b6758ea5301a9..734cfecfc9ccb 100644 --- a/google/cloud/apiregistry/BUILD.bazel +++ b/google/cloud/apiregistry/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/apiregistry/v1:apiregistry_cc_grpc", + "@googleapis//google/cloud/apiregistry/v1:apiregistry_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/apiregistry/quickstart/CMakeLists.txt b/google/cloud/apiregistry/quickstart/CMakeLists.txt index 1d782abb87bee..6bbdd791bd0e0 100644 --- a/google/cloud/apiregistry/quickstart/CMakeLists.txt +++ b/google/cloud/apiregistry/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud API Registry API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-apiregistry-quickstart CXX) find_package(google_cloud_cpp_apiregistry REQUIRED) diff --git a/google/cloud/apiregistry/quickstart/WORKSPACE.bazel b/google/cloud/apiregistry/quickstart/WORKSPACE.bazel index 0641bd5bc783e..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 = "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/apiregistry/v1/cloud_api_registry_connection.h b/google/cloud/apiregistry/v1/cloud_api_registry_connection.h index d2fc7bb2668eb..ec46192e3220e 100644 --- a/google/cloud/apiregistry/v1/cloud_api_registry_connection.h +++ b/google/cloud/apiregistry/v1/cloud_api_registry_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/apiregistry/v1/cloud_api_registry_connection_idempotency_policy.h" #include "google/cloud/apiregistry/v1/internal/cloud_api_registry_retry_traits.h" +#include "google/cloud/apiregistry/v1/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 #include namespace google { diff --git a/google/cloud/apiregistry/v1/cloud_api_registry_connection_idempotency_policy.h b/google/cloud/apiregistry/v1/cloud_api_registry_connection_idempotency_policy.h index 4ef1549399271..18e7776c7f048 100644 --- a/google/cloud/apiregistry/v1/cloud_api_registry_connection_idempotency_policy.h +++ b/google/cloud/apiregistry/v1/cloud_api_registry_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIREGISTRY_V1_CLOUD_API_REGISTRY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIREGISTRY_V1_CLOUD_API_REGISTRY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/apiregistry/v1/service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_auth_decorator.cc b/google/cloud/apiregistry/v1/internal/cloud_api_registry_auth_decorator.cc index 5389a7dd2db0c..e444f8f816828 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_auth_decorator.cc +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/apiregistry/v1/service.proto #include "google/cloud/apiregistry/v1/internal/cloud_api_registry_auth_decorator.h" -#include +#include "google/cloud/apiregistry/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apiregistry_v1_internal { @@ -88,3 +91,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apiregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_auth_decorator.h b/google/cloud/apiregistry/v1/internal/cloud_api_registry_auth_decorator.h index a9e56dd00dd1d..6611d200dbc3f 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_auth_decorator.h +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apiregistry_v1_internal { @@ -76,4 +79,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIREGISTRY_V1_INTERNAL_CLOUD_API_REGISTRY_AUTH_DECORATOR_H diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_logging_decorator.cc b/google/cloud/apiregistry/v1/internal/cloud_api_registry_logging_decorator.cc index 2afb0b0652370..4304f8b273a0c 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_logging_decorator.cc +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/apiregistry/v1/service.proto #include "google/cloud/apiregistry/v1/internal/cloud_api_registry_logging_decorator.h" +#include "google/cloud/apiregistry/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apiregistry_v1_internal { @@ -114,3 +117,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apiregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_logging_decorator.h b/google/cloud/apiregistry/v1/internal/cloud_api_registry_logging_decorator.h index 51b2ebc1b7566..2ba753dbb62e0 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_logging_decorator.h +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apiregistry_v1_internal { @@ -76,4 +79,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIREGISTRY_V1_INTERNAL_CLOUD_API_REGISTRY_LOGGING_DECORATOR_H diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_metadata_decorator.cc b/google/cloud/apiregistry/v1/internal/cloud_api_registry_metadata_decorator.cc index fe369e8676ed8..2a438feaca914 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_metadata_decorator.cc +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/apiregistry/v1/service.proto #include "google/cloud/apiregistry/v1/internal/cloud_api_registry_metadata_decorator.h" +#include "google/cloud/apiregistry/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 apiregistry_v1_internal { @@ -115,3 +119,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apiregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_metadata_decorator.h b/google/cloud/apiregistry/v1/internal/cloud_api_registry_metadata_decorator.h index 2a24a658c606c..6d93b6392e63b 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_metadata_decorator.h +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apiregistry_v1_internal { @@ -82,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIREGISTRY_V1_INTERNAL_CLOUD_API_REGISTRY_METADATA_DECORATOR_H diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_option_defaults.cc b/google/cloud/apiregistry/v1/internal/cloud_api_registry_option_defaults.cc index 29e305704f20e..591c9a50547d9 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_option_defaults.cc +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_option_defaults.cc @@ -42,7 +42,7 @@ Options CloudApiRegistryDefaultOptions(Options options) { if (!options.has()) { options.set( apiregistry_v1::CloudApiRegistryLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub.cc b/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub.cc index 818a19cf4d3b7..e1b8fd65afcb8 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub.cc +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/apiregistry/v1/service.proto #include "google/cloud/apiregistry/v1/internal/cloud_api_registry_stub.h" +#include "google/cloud/apiregistry/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apiregistry_v1_internal { @@ -106,3 +109,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apiregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub.h b/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub.h index 211e3a889634f..275c4e9e1f915 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub.h +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIREGISTRY_V1_INTERNAL_CLOUD_API_REGISTRY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIREGISTRY_V1_INTERNAL_CLOUD_API_REGISTRY_STUB_H +#include "google/cloud/apiregistry/v1/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 -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apiregistry_v1_internal { @@ -116,4 +119,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIREGISTRY_V1_INTERNAL_CLOUD_API_REGISTRY_STUB_H diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub_factory.cc b/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub_factory.cc index 6c84f5c85cd62..b7887f093c3ba 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub_factory.cc +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/apiregistry/v1/internal/cloud_api_registry_metadata_decorator.h" #include "google/cloud/apiregistry/v1/internal/cloud_api_registry_stub.h" #include "google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_stub.h" +#include "google/cloud/apiregistry/v1/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 -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apiregistry_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apiregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub_factory.h b/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub_factory.h index 7885509c78c21..d27f858c4068d 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub_factory.h +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apiregistry_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIREGISTRY_V1_INTERNAL_CLOUD_API_REGISTRY_STUB_FACTORY_H diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_connection.cc b/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_connection.cc index 9202a283928e2..17d44600a7714 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_connection.cc +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace apiregistry_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudApiRegistryTracingConnection::CloudApiRegistryTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -94,16 +92,12 @@ CloudApiRegistryTracingConnection::GetLocation( return internal::EndSpan(*span, child_->GetLocation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudApiRegistryTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_connection.h b/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_connection.h index a9b53c8bf117a..d258b5935240b 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_connection.h +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace apiregistry_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudApiRegistryTracingConnection : public apiregistry_v1::CloudApiRegistryConnection { public: @@ -64,8 +62,6 @@ class CloudApiRegistryTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_stub.cc b/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_stub.cc index 06b5454f5fafc..d45cb36fcc856 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_stub.cc +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apiregistry_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudApiRegistryTracingStub::CloudApiRegistryTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -104,18 +105,14 @@ CloudApiRegistryTracingStub::GetLocation( child_->GetLocation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudApiRegistryTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apiregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_stub.h b/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_stub.h index f684b07836511..62cfe8eeadfbd 100644 --- a/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_stub.h +++ b/google/cloud/apiregistry/v1/internal/cloud_api_registry_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apiregistry_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudApiRegistryTracingStub : public CloudApiRegistryStub { public: ~CloudApiRegistryTracingStub() override = default; @@ -73,8 +74,6 @@ class CloudApiRegistryTracingStub : public CloudApiRegistryStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -89,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APIREGISTRY_V1_INTERNAL_CLOUD_API_REGISTRY_TRACING_STUB_H diff --git a/google/cloud/appengine/BUILD.bazel b/google/cloud/appengine/BUILD.bazel index dbc35a71b2972..9f5046349c8f7 100644 --- a/google/cloud/appengine/BUILD.bazel +++ b/google/cloud/appengine/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/appengine/legacy:legacy_cc_grpc", - "@com_google_googleapis//google/appengine/logging/v1:logging_cc_grpc", - "@com_google_googleapis//google/appengine/v1:appengine_cc_grpc", + "@googleapis//google/appengine/legacy:legacy_cc_grpc", + "@googleapis//google/appengine/logging/v1:logging_cc_grpc", + "@googleapis//google/appengine/v1:appengine_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/appengine/CMakeLists.txt b/google/cloud/appengine/CMakeLists.txt index 9dee07931b368..a82c639c7b1f2 100644 --- a/google/cloud/appengine/CMakeLists.txt +++ b/google/cloud/appengine/CMakeLists.txt @@ -18,7 +18,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( appengine "App Engine Admin API" - SERVICE_DIRS "__EMPTY__" "v1/" + SERVICE_DIRS "v1/" SHARED_PROTO_DEPS "logging_type") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) diff --git a/google/cloud/appengine/applications_client.h b/google/cloud/appengine/applications_client.h deleted file mode 100644 index 2d4508d7967c4..0000000000000 --- a/google/cloud/appengine/applications_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_APPLICATIONS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_APPLICATIONS_CLIENT_H - -#include "google/cloud/appengine/applications_connection.h" -#include "google/cloud/appengine/v1/applications_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1 instead of the aliases defined in -/// this namespace. -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::ApplicationsClient directly. -using ::google::cloud::appengine_v1::ApplicationsClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_APPLICATIONS_CLIENT_H diff --git a/google/cloud/appengine/applications_connection.h b/google/cloud/appengine/applications_connection.h deleted file mode 100644 index 1dcfc5984fb6a..0000000000000 --- a/google/cloud/appengine/applications_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_APPLICATIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_APPLICATIONS_CONNECTION_H - -#include "google/cloud/appengine/applications_connection_idempotency_policy.h" -#include "google/cloud/appengine/v1/applications_connection.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::MakeApplicationsConnection directly. -using ::google::cloud::appengine_v1::MakeApplicationsConnection; - -/// @deprecated Use appengine_v1::ApplicationsConnection directly. -using ::google::cloud::appengine_v1::ApplicationsConnection; - -/// @deprecated Use appengine_v1::ApplicationsLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::appengine_v1::ApplicationsLimitedErrorCountRetryPolicy; - -/// @deprecated Use appengine_v1::ApplicationsLimitedTimeRetryPolicy directly. -using ::google::cloud::appengine_v1::ApplicationsLimitedTimeRetryPolicy; - -/// @deprecated Use appengine_v1::ApplicationsRetryPolicy directly. -using ::google::cloud::appengine_v1::ApplicationsRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_APPLICATIONS_CONNECTION_H diff --git a/google/cloud/appengine/applications_connection_idempotency_policy.h b/google/cloud/appengine/applications_connection_idempotency_policy.h deleted file mode 100644 index aa93a19e506cb..0000000000000 --- a/google/cloud/appengine/applications_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_APPLICATIONS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_APPLICATIONS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/appengine/v1/applications_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// appengine_v1::MakeDefaultApplicationsConnectionIdempotencyPolicy directly. -using ::google::cloud::appengine_v1:: - MakeDefaultApplicationsConnectionIdempotencyPolicy; - -/// @deprecated Use appengine_v1::ApplicationsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::appengine_v1::ApplicationsConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_APPLICATIONS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/appengine/applications_options.h b/google/cloud/appengine/applications_options.h deleted file mode 100644 index 164cf1a04cb6b..0000000000000 --- a/google/cloud/appengine/applications_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_APPLICATIONS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_APPLICATIONS_OPTIONS_H - -#include "google/cloud/appengine/applications_connection.h" -#include "google/cloud/appengine/applications_connection_idempotency_policy.h" -#include "google/cloud/appengine/v1/applications_options.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::ApplicationsPollingPolicyOption directly. -using ::google::cloud::appengine_v1::ApplicationsPollingPolicyOption; - -/// @deprecated Use appengine_v1::ApplicationsBackoffPolicyOption directly. -using ::google::cloud::appengine_v1::ApplicationsBackoffPolicyOption; - -/// @deprecated Use appengine_v1::ApplicationsConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::appengine_v1:: - ApplicationsConnectionIdempotencyPolicyOption; - -/// @deprecated Use appengine_v1::ApplicationsPolicyOptionList directly. -using ::google::cloud::appengine_v1::ApplicationsPolicyOptionList; - -/// @deprecated Use appengine_v1::ApplicationsRetryPolicyOption directly. -using ::google::cloud::appengine_v1::ApplicationsRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_APPLICATIONS_OPTIONS_H diff --git a/google/cloud/appengine/authorized_certificates_client.h b/google/cloud/appengine/authorized_certificates_client.h deleted file mode 100644 index 68ffd8bcecaa9..0000000000000 --- a/google/cloud/appengine/authorized_certificates_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_CERTIFICATES_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_CERTIFICATES_CLIENT_H - -#include "google/cloud/appengine/authorized_certificates_connection.h" -#include "google/cloud/appengine/v1/authorized_certificates_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1 instead of the aliases defined in -/// this namespace. -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::AuthorizedCertificatesClient directly. -using ::google::cloud::appengine_v1::AuthorizedCertificatesClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_CERTIFICATES_CLIENT_H diff --git a/google/cloud/appengine/authorized_certificates_connection.h b/google/cloud/appengine/authorized_certificates_connection.h deleted file mode 100644 index 29f7c62a37f7e..0000000000000 --- a/google/cloud/appengine/authorized_certificates_connection.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_CERTIFICATES_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_CERTIFICATES_CONNECTION_H - -#include "google/cloud/appengine/authorized_certificates_connection_idempotency_policy.h" -#include "google/cloud/appengine/v1/authorized_certificates_connection.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::MakeAuthorizedCertificatesConnection directly. -using ::google::cloud::appengine_v1::MakeAuthorizedCertificatesConnection; - -/// @deprecated Use appengine_v1::AuthorizedCertificatesConnection directly. -using ::google::cloud::appengine_v1::AuthorizedCertificatesConnection; - -/// @deprecated Use -/// appengine_v1::AuthorizedCertificatesLimitedErrorCountRetryPolicy directly. -using ::google::cloud::appengine_v1:: - AuthorizedCertificatesLimitedErrorCountRetryPolicy; - -/// @deprecated Use appengine_v1::AuthorizedCertificatesLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::appengine_v1:: - AuthorizedCertificatesLimitedTimeRetryPolicy; - -/// @deprecated Use appengine_v1::AuthorizedCertificatesRetryPolicy directly. -using ::google::cloud::appengine_v1::AuthorizedCertificatesRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_CERTIFICATES_CONNECTION_H diff --git a/google/cloud/appengine/authorized_certificates_connection_idempotency_policy.h b/google/cloud/appengine/authorized_certificates_connection_idempotency_policy.h deleted file mode 100644 index 0787975666c6c..0000000000000 --- a/google/cloud/appengine/authorized_certificates_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_CERTIFICATES_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_CERTIFICATES_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/appengine/v1/authorized_certificates_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// appengine_v1::MakeDefaultAuthorizedCertificatesConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::appengine_v1:: - MakeDefaultAuthorizedCertificatesConnectionIdempotencyPolicy; - -/// @deprecated Use -/// appengine_v1::AuthorizedCertificatesConnectionIdempotencyPolicy directly. -using ::google::cloud::appengine_v1:: - AuthorizedCertificatesConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_CERTIFICATES_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/appengine/authorized_certificates_options.h b/google/cloud/appengine/authorized_certificates_options.h deleted file mode 100644 index fa9a8bc820d09..0000000000000 --- a/google/cloud/appengine/authorized_certificates_options.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_CERTIFICATES_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_CERTIFICATES_OPTIONS_H - -#include "google/cloud/appengine/authorized_certificates_connection.h" -#include "google/cloud/appengine/authorized_certificates_connection_idempotency_policy.h" -#include "google/cloud/appengine/v1/authorized_certificates_options.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::AuthorizedCertificatesBackoffPolicyOption -/// directly. -using ::google::cloud::appengine_v1::AuthorizedCertificatesBackoffPolicyOption; - -/// @deprecated Use -/// appengine_v1::AuthorizedCertificatesConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::appengine_v1:: - AuthorizedCertificatesConnectionIdempotencyPolicyOption; - -/// @deprecated Use appengine_v1::AuthorizedCertificatesPolicyOptionList -/// directly. -using ::google::cloud::appengine_v1::AuthorizedCertificatesPolicyOptionList; - -/// @deprecated Use appengine_v1::AuthorizedCertificatesRetryPolicyOption -/// directly. -using ::google::cloud::appengine_v1::AuthorizedCertificatesRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_CERTIFICATES_OPTIONS_H diff --git a/google/cloud/appengine/authorized_domains_client.h b/google/cloud/appengine/authorized_domains_client.h deleted file mode 100644 index 59ecc60acbab2..0000000000000 --- a/google/cloud/appengine/authorized_domains_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_DOMAINS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_DOMAINS_CLIENT_H - -#include "google/cloud/appengine/authorized_domains_connection.h" -#include "google/cloud/appengine/v1/authorized_domains_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1 instead of the aliases defined in -/// this namespace. -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::AuthorizedDomainsClient directly. -using ::google::cloud::appengine_v1::AuthorizedDomainsClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_DOMAINS_CLIENT_H diff --git a/google/cloud/appengine/authorized_domains_connection.h b/google/cloud/appengine/authorized_domains_connection.h deleted file mode 100644 index 2ccc4ea5df5b9..0000000000000 --- a/google/cloud/appengine/authorized_domains_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_DOMAINS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_DOMAINS_CONNECTION_H - -#include "google/cloud/appengine/authorized_domains_connection_idempotency_policy.h" -#include "google/cloud/appengine/v1/authorized_domains_connection.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::MakeAuthorizedDomainsConnection directly. -using ::google::cloud::appengine_v1::MakeAuthorizedDomainsConnection; - -/// @deprecated Use appengine_v1::AuthorizedDomainsConnection directly. -using ::google::cloud::appengine_v1::AuthorizedDomainsConnection; - -/// @deprecated Use appengine_v1::AuthorizedDomainsLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::appengine_v1:: - AuthorizedDomainsLimitedErrorCountRetryPolicy; - -/// @deprecated Use appengine_v1::AuthorizedDomainsLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::appengine_v1::AuthorizedDomainsLimitedTimeRetryPolicy; - -/// @deprecated Use appengine_v1::AuthorizedDomainsRetryPolicy directly. -using ::google::cloud::appengine_v1::AuthorizedDomainsRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_DOMAINS_CONNECTION_H diff --git a/google/cloud/appengine/authorized_domains_connection_idempotency_policy.h b/google/cloud/appengine/authorized_domains_connection_idempotency_policy.h deleted file mode 100644 index e35bec99a5f9c..0000000000000 --- a/google/cloud/appengine/authorized_domains_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_DOMAINS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_DOMAINS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/appengine/v1/authorized_domains_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// appengine_v1::MakeDefaultAuthorizedDomainsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::appengine_v1:: - MakeDefaultAuthorizedDomainsConnectionIdempotencyPolicy; - -/// @deprecated Use appengine_v1::AuthorizedDomainsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::appengine_v1:: - AuthorizedDomainsConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_DOMAINS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/appengine/authorized_domains_options.h b/google/cloud/appengine/authorized_domains_options.h deleted file mode 100644 index 374ee80ee7548..0000000000000 --- a/google/cloud/appengine/authorized_domains_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_DOMAINS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_DOMAINS_OPTIONS_H - -#include "google/cloud/appengine/authorized_domains_connection.h" -#include "google/cloud/appengine/authorized_domains_connection_idempotency_policy.h" -#include "google/cloud/appengine/v1/authorized_domains_options.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::AuthorizedDomainsBackoffPolicyOption directly. -using ::google::cloud::appengine_v1::AuthorizedDomainsBackoffPolicyOption; - -/// @deprecated Use -/// appengine_v1::AuthorizedDomainsConnectionIdempotencyPolicyOption directly. -using ::google::cloud::appengine_v1:: - AuthorizedDomainsConnectionIdempotencyPolicyOption; - -/// @deprecated Use appengine_v1::AuthorizedDomainsPolicyOptionList directly. -using ::google::cloud::appengine_v1::AuthorizedDomainsPolicyOptionList; - -/// @deprecated Use appengine_v1::AuthorizedDomainsRetryPolicyOption directly. -using ::google::cloud::appengine_v1::AuthorizedDomainsRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_AUTHORIZED_DOMAINS_OPTIONS_H diff --git a/google/cloud/appengine/domain_mappings_client.h b/google/cloud/appengine/domain_mappings_client.h deleted file mode 100644 index 21a6dbb2577de..0000000000000 --- a/google/cloud/appengine/domain_mappings_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_DOMAIN_MAPPINGS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_DOMAIN_MAPPINGS_CLIENT_H - -#include "google/cloud/appengine/domain_mappings_connection.h" -#include "google/cloud/appengine/v1/domain_mappings_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1 instead of the aliases defined in -/// this namespace. -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::DomainMappingsClient directly. -using ::google::cloud::appengine_v1::DomainMappingsClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_DOMAIN_MAPPINGS_CLIENT_H diff --git a/google/cloud/appengine/domain_mappings_connection.h b/google/cloud/appengine/domain_mappings_connection.h deleted file mode 100644 index cae216f3a7d8c..0000000000000 --- a/google/cloud/appengine/domain_mappings_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_DOMAIN_MAPPINGS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_DOMAIN_MAPPINGS_CONNECTION_H - -#include "google/cloud/appengine/domain_mappings_connection_idempotency_policy.h" -#include "google/cloud/appengine/v1/domain_mappings_connection.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::MakeDomainMappingsConnection directly. -using ::google::cloud::appengine_v1::MakeDomainMappingsConnection; - -/// @deprecated Use appengine_v1::DomainMappingsConnection directly. -using ::google::cloud::appengine_v1::DomainMappingsConnection; - -/// @deprecated Use appengine_v1::DomainMappingsLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::appengine_v1::DomainMappingsLimitedErrorCountRetryPolicy; - -/// @deprecated Use appengine_v1::DomainMappingsLimitedTimeRetryPolicy directly. -using ::google::cloud::appengine_v1::DomainMappingsLimitedTimeRetryPolicy; - -/// @deprecated Use appengine_v1::DomainMappingsRetryPolicy directly. -using ::google::cloud::appengine_v1::DomainMappingsRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_DOMAIN_MAPPINGS_CONNECTION_H diff --git a/google/cloud/appengine/domain_mappings_connection_idempotency_policy.h b/google/cloud/appengine/domain_mappings_connection_idempotency_policy.h deleted file mode 100644 index 3c535df709204..0000000000000 --- a/google/cloud/appengine/domain_mappings_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_DOMAIN_MAPPINGS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_DOMAIN_MAPPINGS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/appengine/v1/domain_mappings_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// appengine_v1::MakeDefaultDomainMappingsConnectionIdempotencyPolicy directly. -using ::google::cloud::appengine_v1:: - MakeDefaultDomainMappingsConnectionIdempotencyPolicy; - -/// @deprecated Use appengine_v1::DomainMappingsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::appengine_v1::DomainMappingsConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_DOMAIN_MAPPINGS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/appengine/domain_mappings_options.h b/google/cloud/appengine/domain_mappings_options.h deleted file mode 100644 index 24cb092e57566..0000000000000 --- a/google/cloud/appengine/domain_mappings_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_DOMAIN_MAPPINGS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_DOMAIN_MAPPINGS_OPTIONS_H - -#include "google/cloud/appengine/domain_mappings_connection.h" -#include "google/cloud/appengine/domain_mappings_connection_idempotency_policy.h" -#include "google/cloud/appengine/v1/domain_mappings_options.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::DomainMappingsPollingPolicyOption directly. -using ::google::cloud::appengine_v1::DomainMappingsPollingPolicyOption; - -/// @deprecated Use appengine_v1::DomainMappingsBackoffPolicyOption directly. -using ::google::cloud::appengine_v1::DomainMappingsBackoffPolicyOption; - -/// @deprecated Use -/// appengine_v1::DomainMappingsConnectionIdempotencyPolicyOption directly. -using ::google::cloud::appengine_v1:: - DomainMappingsConnectionIdempotencyPolicyOption; - -/// @deprecated Use appengine_v1::DomainMappingsPolicyOptionList directly. -using ::google::cloud::appengine_v1::DomainMappingsPolicyOptionList; - -/// @deprecated Use appengine_v1::DomainMappingsRetryPolicyOption directly. -using ::google::cloud::appengine_v1::DomainMappingsRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_DOMAIN_MAPPINGS_OPTIONS_H diff --git a/google/cloud/appengine/firewall_client.h b/google/cloud/appengine/firewall_client.h deleted file mode 100644 index bfe06f596d985..0000000000000 --- a/google/cloud/appengine/firewall_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_FIREWALL_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_FIREWALL_CLIENT_H - -#include "google/cloud/appengine/firewall_connection.h" -#include "google/cloud/appengine/v1/firewall_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1 instead of the aliases defined in -/// this namespace. -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::FirewallClient directly. -using ::google::cloud::appengine_v1::FirewallClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_FIREWALL_CLIENT_H diff --git a/google/cloud/appengine/firewall_connection.h b/google/cloud/appengine/firewall_connection.h deleted file mode 100644 index 35353d72e8316..0000000000000 --- a/google/cloud/appengine/firewall_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_FIREWALL_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_FIREWALL_CONNECTION_H - -#include "google/cloud/appengine/firewall_connection_idempotency_policy.h" -#include "google/cloud/appengine/v1/firewall_connection.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::MakeFirewallConnection directly. -using ::google::cloud::appengine_v1::MakeFirewallConnection; - -/// @deprecated Use appengine_v1::FirewallConnection directly. -using ::google::cloud::appengine_v1::FirewallConnection; - -/// @deprecated Use appengine_v1::FirewallLimitedErrorCountRetryPolicy directly. -using ::google::cloud::appengine_v1::FirewallLimitedErrorCountRetryPolicy; - -/// @deprecated Use appengine_v1::FirewallLimitedTimeRetryPolicy directly. -using ::google::cloud::appengine_v1::FirewallLimitedTimeRetryPolicy; - -/// @deprecated Use appengine_v1::FirewallRetryPolicy directly. -using ::google::cloud::appengine_v1::FirewallRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_FIREWALL_CONNECTION_H diff --git a/google/cloud/appengine/firewall_connection_idempotency_policy.h b/google/cloud/appengine/firewall_connection_idempotency_policy.h deleted file mode 100644 index 1ab1bc3200dea..0000000000000 --- a/google/cloud/appengine/firewall_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_FIREWALL_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_FIREWALL_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/appengine/v1/firewall_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::MakeDefaultFirewallConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::appengine_v1:: - MakeDefaultFirewallConnectionIdempotencyPolicy; - -/// @deprecated Use appengine_v1::FirewallConnectionIdempotencyPolicy directly. -using ::google::cloud::appengine_v1::FirewallConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_FIREWALL_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/appengine/firewall_options.h b/google/cloud/appengine/firewall_options.h deleted file mode 100644 index 77fba158950d8..0000000000000 --- a/google/cloud/appengine/firewall_options.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_FIREWALL_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_FIREWALL_OPTIONS_H - -#include "google/cloud/appengine/firewall_connection.h" -#include "google/cloud/appengine/firewall_connection_idempotency_policy.h" -#include "google/cloud/appengine/v1/firewall_options.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::FirewallBackoffPolicyOption directly. -using ::google::cloud::appengine_v1::FirewallBackoffPolicyOption; - -/// @deprecated Use appengine_v1::FirewallConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::appengine_v1::FirewallConnectionIdempotencyPolicyOption; - -/// @deprecated Use appengine_v1::FirewallPolicyOptionList directly. -using ::google::cloud::appengine_v1::FirewallPolicyOptionList; - -/// @deprecated Use appengine_v1::FirewallRetryPolicyOption directly. -using ::google::cloud::appengine_v1::FirewallRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_FIREWALL_OPTIONS_H diff --git a/google/cloud/appengine/instances_client.h b/google/cloud/appengine/instances_client.h deleted file mode 100644 index 4a6dc74b581e8..0000000000000 --- a/google/cloud/appengine/instances_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INSTANCES_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INSTANCES_CLIENT_H - -#include "google/cloud/appengine/instances_connection.h" -#include "google/cloud/appengine/v1/instances_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1 instead of the aliases defined in -/// this namespace. -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::InstancesClient directly. -using ::google::cloud::appengine_v1::InstancesClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INSTANCES_CLIENT_H diff --git a/google/cloud/appengine/instances_connection.h b/google/cloud/appengine/instances_connection.h deleted file mode 100644 index 9020f69687cd0..0000000000000 --- a/google/cloud/appengine/instances_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INSTANCES_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INSTANCES_CONNECTION_H - -#include "google/cloud/appengine/instances_connection_idempotency_policy.h" -#include "google/cloud/appengine/v1/instances_connection.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::MakeInstancesConnection directly. -using ::google::cloud::appengine_v1::MakeInstancesConnection; - -/// @deprecated Use appengine_v1::InstancesConnection directly. -using ::google::cloud::appengine_v1::InstancesConnection; - -/// @deprecated Use appengine_v1::InstancesLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::appengine_v1::InstancesLimitedErrorCountRetryPolicy; - -/// @deprecated Use appengine_v1::InstancesLimitedTimeRetryPolicy directly. -using ::google::cloud::appengine_v1::InstancesLimitedTimeRetryPolicy; - -/// @deprecated Use appengine_v1::InstancesRetryPolicy directly. -using ::google::cloud::appengine_v1::InstancesRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INSTANCES_CONNECTION_H diff --git a/google/cloud/appengine/instances_connection_idempotency_policy.h b/google/cloud/appengine/instances_connection_idempotency_policy.h deleted file mode 100644 index 0c70380c44a3b..0000000000000 --- a/google/cloud/appengine/instances_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INSTANCES_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INSTANCES_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/appengine/v1/instances_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// appengine_v1::MakeDefaultInstancesConnectionIdempotencyPolicy directly. -using ::google::cloud::appengine_v1:: - MakeDefaultInstancesConnectionIdempotencyPolicy; - -/// @deprecated Use appengine_v1::InstancesConnectionIdempotencyPolicy directly. -using ::google::cloud::appengine_v1::InstancesConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INSTANCES_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/appengine/instances_options.h b/google/cloud/appengine/instances_options.h deleted file mode 100644 index a1ef7fb7ee125..0000000000000 --- a/google/cloud/appengine/instances_options.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INSTANCES_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INSTANCES_OPTIONS_H - -#include "google/cloud/appengine/instances_connection.h" -#include "google/cloud/appengine/instances_connection_idempotency_policy.h" -#include "google/cloud/appengine/v1/instances_options.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::InstancesPollingPolicyOption directly. -using ::google::cloud::appengine_v1::InstancesPollingPolicyOption; - -/// @deprecated Use appengine_v1::InstancesBackoffPolicyOption directly. -using ::google::cloud::appengine_v1::InstancesBackoffPolicyOption; - -/// @deprecated Use appengine_v1::InstancesConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::appengine_v1::InstancesConnectionIdempotencyPolicyOption; - -/// @deprecated Use appengine_v1::InstancesPolicyOptionList directly. -using ::google::cloud::appengine_v1::InstancesPolicyOptionList; - -/// @deprecated Use appengine_v1::InstancesRetryPolicyOption directly. -using ::google::cloud::appengine_v1::InstancesRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_INSTANCES_OPTIONS_H diff --git a/google/cloud/appengine/mocks/mock_applications_connection.h b/google/cloud/appengine/mocks/mock_applications_connection.h deleted file mode 100644 index 960b72041b782..0000000000000 --- a/google/cloud/appengine/mocks/mock_applications_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_APPLICATIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_APPLICATIONS_CONNECTION_H - -#include "google/cloud/appengine/applications_connection.h" -#include "google/cloud/appengine/v1/mocks/mock_applications_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1_mocks instead of the aliases -/// defined in this namespace. -namespace appengine_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1_mocks::MockApplicationsConnection directly. -using ::google::cloud::appengine_v1_mocks::MockApplicationsConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_APPLICATIONS_CONNECTION_H diff --git a/google/cloud/appengine/mocks/mock_authorized_certificates_connection.h b/google/cloud/appengine/mocks/mock_authorized_certificates_connection.h deleted file mode 100644 index eac1b064665de..0000000000000 --- a/google/cloud/appengine/mocks/mock_authorized_certificates_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_AUTHORIZED_CERTIFICATES_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_AUTHORIZED_CERTIFICATES_CONNECTION_H - -#include "google/cloud/appengine/authorized_certificates_connection.h" -#include "google/cloud/appengine/v1/mocks/mock_authorized_certificates_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1_mocks instead of the aliases -/// defined in this namespace. -namespace appengine_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1_mocks::MockAuthorizedCertificatesConnection -/// directly. -using ::google::cloud::appengine_v1_mocks::MockAuthorizedCertificatesConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_AUTHORIZED_CERTIFICATES_CONNECTION_H diff --git a/google/cloud/appengine/mocks/mock_authorized_domains_connection.h b/google/cloud/appengine/mocks/mock_authorized_domains_connection.h deleted file mode 100644 index 1e87e7cbb7087..0000000000000 --- a/google/cloud/appengine/mocks/mock_authorized_domains_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_AUTHORIZED_DOMAINS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_AUTHORIZED_DOMAINS_CONNECTION_H - -#include "google/cloud/appengine/authorized_domains_connection.h" -#include "google/cloud/appengine/v1/mocks/mock_authorized_domains_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1_mocks instead of the aliases -/// defined in this namespace. -namespace appengine_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1_mocks::MockAuthorizedDomainsConnection -/// directly. -using ::google::cloud::appengine_v1_mocks::MockAuthorizedDomainsConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_AUTHORIZED_DOMAINS_CONNECTION_H diff --git a/google/cloud/appengine/mocks/mock_domain_mappings_connection.h b/google/cloud/appengine/mocks/mock_domain_mappings_connection.h deleted file mode 100644 index af6c1db4426fe..0000000000000 --- a/google/cloud/appengine/mocks/mock_domain_mappings_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_DOMAIN_MAPPINGS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_DOMAIN_MAPPINGS_CONNECTION_H - -#include "google/cloud/appengine/domain_mappings_connection.h" -#include "google/cloud/appengine/v1/mocks/mock_domain_mappings_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1_mocks instead of the aliases -/// defined in this namespace. -namespace appengine_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1_mocks::MockDomainMappingsConnection directly. -using ::google::cloud::appengine_v1_mocks::MockDomainMappingsConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_DOMAIN_MAPPINGS_CONNECTION_H diff --git a/google/cloud/appengine/mocks/mock_firewall_connection.h b/google/cloud/appengine/mocks/mock_firewall_connection.h deleted file mode 100644 index 22fdd5b071b82..0000000000000 --- a/google/cloud/appengine/mocks/mock_firewall_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_FIREWALL_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_FIREWALL_CONNECTION_H - -#include "google/cloud/appengine/firewall_connection.h" -#include "google/cloud/appengine/v1/mocks/mock_firewall_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1_mocks instead of the aliases -/// defined in this namespace. -namespace appengine_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1_mocks::MockFirewallConnection directly. -using ::google::cloud::appengine_v1_mocks::MockFirewallConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_FIREWALL_CONNECTION_H diff --git a/google/cloud/appengine/mocks/mock_instances_connection.h b/google/cloud/appengine/mocks/mock_instances_connection.h deleted file mode 100644 index 5d5de36c446a9..0000000000000 --- a/google/cloud/appengine/mocks/mock_instances_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_INSTANCES_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_INSTANCES_CONNECTION_H - -#include "google/cloud/appengine/instances_connection.h" -#include "google/cloud/appengine/v1/mocks/mock_instances_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1_mocks instead of the aliases -/// defined in this namespace. -namespace appengine_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1_mocks::MockInstancesConnection directly. -using ::google::cloud::appengine_v1_mocks::MockInstancesConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_INSTANCES_CONNECTION_H diff --git a/google/cloud/appengine/mocks/mock_services_connection.h b/google/cloud/appengine/mocks/mock_services_connection.h deleted file mode 100644 index 8ea0a3758fc54..0000000000000 --- a/google/cloud/appengine/mocks/mock_services_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_SERVICES_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_SERVICES_CONNECTION_H - -#include "google/cloud/appengine/services_connection.h" -#include "google/cloud/appengine/v1/mocks/mock_services_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1_mocks instead of the aliases -/// defined in this namespace. -namespace appengine_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1_mocks::MockServicesConnection directly. -using ::google::cloud::appengine_v1_mocks::MockServicesConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_SERVICES_CONNECTION_H diff --git a/google/cloud/appengine/mocks/mock_versions_connection.h b/google/cloud/appengine/mocks/mock_versions_connection.h deleted file mode 100644 index e1d72b5613a95..0000000000000 --- a/google/cloud/appengine/mocks/mock_versions_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_VERSIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_VERSIONS_CONNECTION_H - -#include "google/cloud/appengine/v1/mocks/mock_versions_connection.h" -#include "google/cloud/appengine/versions_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1_mocks instead of the aliases -/// defined in this namespace. -namespace appengine_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1_mocks::MockVersionsConnection directly. -using ::google::cloud::appengine_v1_mocks::MockVersionsConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_MOCKS_MOCK_VERSIONS_CONNECTION_H diff --git a/google/cloud/appengine/quickstart/.bazelrc b/google/cloud/appengine/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/appengine/quickstart/.bazelrc +++ b/google/cloud/appengine/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/appengine/quickstart/CMakeLists.txt index 4a0310c1326fe..94e4b97a4254a 100644 --- a/google/cloud/appengine/quickstart/CMakeLists.txt +++ b/google/cloud/appengine/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the App Engine Admin API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-appengine-quickstart CXX) find_package(google_cloud_cpp_appengine REQUIRED) diff --git a/google/cloud/appengine/quickstart/WORKSPACE.bazel b/google/cloud/appengine/quickstart/WORKSPACE.bazel index 537c55d350aa8..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 = "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/appengine/services_client.h b/google/cloud/appengine/services_client.h deleted file mode 100644 index c786f15a232bc..0000000000000 --- a/google/cloud/appengine/services_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_SERVICES_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_SERVICES_CLIENT_H - -#include "google/cloud/appengine/services_connection.h" -#include "google/cloud/appengine/v1/services_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1 instead of the aliases defined in -/// this namespace. -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::ServicesClient directly. -using ::google::cloud::appengine_v1::ServicesClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_SERVICES_CLIENT_H diff --git a/google/cloud/appengine/services_connection.h b/google/cloud/appengine/services_connection.h deleted file mode 100644 index e35fb5dc203fc..0000000000000 --- a/google/cloud/appengine/services_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_SERVICES_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_SERVICES_CONNECTION_H - -#include "google/cloud/appengine/services_connection_idempotency_policy.h" -#include "google/cloud/appengine/v1/services_connection.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::MakeServicesConnection directly. -using ::google::cloud::appengine_v1::MakeServicesConnection; - -/// @deprecated Use appengine_v1::ServicesConnection directly. -using ::google::cloud::appengine_v1::ServicesConnection; - -/// @deprecated Use appengine_v1::ServicesLimitedErrorCountRetryPolicy directly. -using ::google::cloud::appengine_v1::ServicesLimitedErrorCountRetryPolicy; - -/// @deprecated Use appengine_v1::ServicesLimitedTimeRetryPolicy directly. -using ::google::cloud::appengine_v1::ServicesLimitedTimeRetryPolicy; - -/// @deprecated Use appengine_v1::ServicesRetryPolicy directly. -using ::google::cloud::appengine_v1::ServicesRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_SERVICES_CONNECTION_H diff --git a/google/cloud/appengine/services_connection_idempotency_policy.h b/google/cloud/appengine/services_connection_idempotency_policy.h deleted file mode 100644 index 2e8d5895d736b..0000000000000 --- a/google/cloud/appengine/services_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/appengine/v1/services_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::MakeDefaultServicesConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::appengine_v1:: - MakeDefaultServicesConnectionIdempotencyPolicy; - -/// @deprecated Use appengine_v1::ServicesConnectionIdempotencyPolicy directly. -using ::google::cloud::appengine_v1::ServicesConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/appengine/services_options.h b/google/cloud/appengine/services_options.h deleted file mode 100644 index e533fdbcb278f..0000000000000 --- a/google/cloud/appengine/services_options.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_SERVICES_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_SERVICES_OPTIONS_H - -#include "google/cloud/appengine/services_connection.h" -#include "google/cloud/appengine/services_connection_idempotency_policy.h" -#include "google/cloud/appengine/v1/services_options.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::ServicesPollingPolicyOption directly. -using ::google::cloud::appengine_v1::ServicesPollingPolicyOption; - -/// @deprecated Use appengine_v1::ServicesBackoffPolicyOption directly. -using ::google::cloud::appengine_v1::ServicesBackoffPolicyOption; - -/// @deprecated Use appengine_v1::ServicesConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::appengine_v1::ServicesConnectionIdempotencyPolicyOption; - -/// @deprecated Use appengine_v1::ServicesPolicyOptionList directly. -using ::google::cloud::appengine_v1::ServicesPolicyOptionList; - -/// @deprecated Use appengine_v1::ServicesRetryPolicyOption directly. -using ::google::cloud::appengine_v1::ServicesRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_SERVICES_OPTIONS_H diff --git a/google/cloud/appengine/v1/applications_client.h b/google/cloud/appengine/v1/applications_client.h index 858b253225e14..886d19815fb29 100644 --- a/google/cloud/appengine/v1/applications_client.h +++ b/google/cloud/appengine/v1/applications_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/appengine/v1/applications_connection.h b/google/cloud/appengine/v1/applications_connection.h index 2cde9edc612de..60e2d20bef5ef 100644 --- a/google/cloud/appengine/v1/applications_connection.h +++ b/google/cloud/appengine/v1/applications_connection.h @@ -29,9 +29,9 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/appengine/v1/appengine.pb.h" +#include "google/appengine/v1/operation.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/applications_connection_idempotency_policy.h b/google/cloud/appengine/v1/applications_connection_idempotency_policy.h index 0e3d3d4afa7fe..50885547b435f 100644 --- a/google/cloud/appengine/v1/applications_connection_idempotency_policy.h +++ b/google/cloud/appengine/v1/applications_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/authorized_certificates_connection.h b/google/cloud/appengine/v1/authorized_certificates_connection.h index bd2cbfdd1f457..0a17cb2917e39 100644 --- a/google/cloud/appengine/v1/authorized_certificates_connection.h +++ b/google/cloud/appengine/v1/authorized_certificates_connection.h @@ -27,8 +27,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/appengine/v1/appengine.pb.h" +#include "google/appengine/v1/operation.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/authorized_certificates_connection_idempotency_policy.h b/google/cloud/appengine/v1/authorized_certificates_connection_idempotency_policy.h index c2603b3aa0a04..a1950e2b18871 100644 --- a/google/cloud/appengine/v1/authorized_certificates_connection_idempotency_policy.h +++ b/google/cloud/appengine/v1/authorized_certificates_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/authorized_domains_connection.h b/google/cloud/appengine/v1/authorized_domains_connection.h index 396a0235da93f..14ba727bf2dcd 100644 --- a/google/cloud/appengine/v1/authorized_domains_connection.h +++ b/google/cloud/appengine/v1/authorized_domains_connection.h @@ -27,8 +27,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/appengine/v1/appengine.pb.h" +#include "google/appengine/v1/operation.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/authorized_domains_connection_idempotency_policy.h b/google/cloud/appengine/v1/authorized_domains_connection_idempotency_policy.h index 1c208e1e49940..ec917751c4561 100644 --- a/google/cloud/appengine/v1/authorized_domains_connection_idempotency_policy.h +++ b/google/cloud/appengine/v1/authorized_domains_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/domain_mappings_client.h b/google/cloud/appengine/v1/domain_mappings_client.h index ee4f5df537551..0be96fd049670 100644 --- a/google/cloud/appengine/v1/domain_mappings_client.h +++ b/google/cloud/appengine/v1/domain_mappings_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/appengine/v1/domain_mappings_connection.h b/google/cloud/appengine/v1/domain_mappings_connection.h index fb918bcf886d2..d7f7e25dfbe75 100644 --- a/google/cloud/appengine/v1/domain_mappings_connection.h +++ b/google/cloud/appengine/v1/domain_mappings_connection.h @@ -30,9 +30,9 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/appengine/v1/appengine.pb.h" +#include "google/appengine/v1/operation.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/domain_mappings_connection_idempotency_policy.h b/google/cloud/appengine/v1/domain_mappings_connection_idempotency_policy.h index b568538e1652f..fc18543d459be 100644 --- a/google/cloud/appengine/v1/domain_mappings_connection_idempotency_policy.h +++ b/google/cloud/appengine/v1/domain_mappings_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/firewall_connection.h b/google/cloud/appengine/v1/firewall_connection.h index 63d558a56d152..7ec4c6e27089c 100644 --- a/google/cloud/appengine/v1/firewall_connection.h +++ b/google/cloud/appengine/v1/firewall_connection.h @@ -27,8 +27,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/appengine/v1/appengine.pb.h" +#include "google/appengine/v1/operation.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/firewall_connection_idempotency_policy.h b/google/cloud/appengine/v1/firewall_connection_idempotency_policy.h index e33f5d4f7463a..dc4b08950980b 100644 --- a/google/cloud/appengine/v1/firewall_connection_idempotency_policy.h +++ b/google/cloud/appengine/v1/firewall_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/instances_client.h b/google/cloud/appengine/v1/instances_client.h index 9c2f8779eed68..190f36922be90 100644 --- a/google/cloud/appengine/v1/instances_client.h +++ b/google/cloud/appengine/v1/instances_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/appengine/v1/instances_connection.h b/google/cloud/appengine/v1/instances_connection.h index 839adaaf4bc9a..f82664ff815f0 100644 --- a/google/cloud/appengine/v1/instances_connection.h +++ b/google/cloud/appengine/v1/instances_connection.h @@ -30,9 +30,9 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/appengine/v1/appengine.pb.h" +#include "google/appengine/v1/operation.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/instances_connection_idempotency_policy.h b/google/cloud/appengine/v1/instances_connection_idempotency_policy.h index 468212711766d..12d0d17907d23 100644 --- a/google/cloud/appengine/v1/instances_connection_idempotency_policy.h +++ b/google/cloud/appengine/v1/instances_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/internal/applications_auth_decorator.cc b/google/cloud/appengine/v1/internal/applications_auth_decorator.cc index 282336771331a..5feb36601a915 100644 --- a/google/cloud/appengine/v1/internal/applications_auth_decorator.cc +++ b/google/cloud/appengine/v1/internal/applications_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/appengine/v1/appengine.proto #include "google/cloud/appengine/v1/internal/applications_auth_decorator.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -163,3 +166,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/applications_auth_decorator.h b/google/cloud/appengine/v1/internal/applications_auth_decorator.h index 9fee26d361c8b..092d91b36a487 100644 --- a/google/cloud/appengine/v1/internal/applications_auth_decorator.h +++ b/google/cloud/appengine/v1/internal/applications_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/applications_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -95,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_APPLICATIONS_AUTH_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/applications_connection_impl.h b/google/cloud/appengine/v1/internal/applications_connection_impl.h index cb2e3cb703c96..cd87094394313 100644 --- a/google/cloud/appengine/v1/internal/applications_connection_impl.h +++ b/google/cloud/appengine/v1/internal/applications_connection_impl.h @@ -31,7 +31,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/internal/applications_logging_decorator.cc b/google/cloud/appengine/v1/internal/applications_logging_decorator.cc index 3448dcf84e5e6..42c21b2b0941c 100644 --- a/google/cloud/appengine/v1/internal/applications_logging_decorator.cc +++ b/google/cloud/appengine/v1/internal/applications_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/appengine/v1/internal/applications_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -173,3 +176,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/applications_logging_decorator.h b/google/cloud/appengine/v1/internal/applications_logging_decorator.h index 0170a9751c031..52e173f362812 100644 --- a/google/cloud/appengine/v1/internal/applications_logging_decorator.h +++ b/google/cloud/appengine/v1/internal/applications_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/applications_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -95,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_APPLICATIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/applications_metadata_decorator.cc b/google/cloud/appengine/v1/internal/applications_metadata_decorator.cc index 4f66faf429770..614bfeca2fb6c 100644 --- a/google/cloud/appengine/v1/internal/applications_metadata_decorator.cc +++ b/google/cloud/appengine/v1/internal/applications_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/appengine/v1/internal/applications_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -154,3 +158,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/applications_metadata_decorator.h b/google/cloud/appengine/v1/internal/applications_metadata_decorator.h index 7244fd7d2ab9c..9ad052926f061 100644 --- a/google/cloud/appengine/v1/internal/applications_metadata_decorator.h +++ b/google/cloud/appengine/v1/internal/applications_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/applications_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -100,4 +103,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_APPLICATIONS_METADATA_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/applications_option_defaults.cc b/google/cloud/appengine/v1/internal/applications_option_defaults.cc index ac149d7a5395d..b53a22d282f18 100644 --- a/google/cloud/appengine/v1/internal/applications_option_defaults.cc +++ b/google/cloud/appengine/v1/internal/applications_option_defaults.cc @@ -41,7 +41,7 @@ Options ApplicationsDefaultOptions(Options options) { if (!options.has()) { options.set( appengine_v1::ApplicationsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/appengine/v1/internal/applications_stub.cc b/google/cloud/appengine/v1/internal/applications_stub.cc index d91b01ce047bc..d29a758aaeedb 100644 --- a/google/cloud/appengine/v1/internal/applications_stub.cc +++ b/google/cloud/appengine/v1/internal/applications_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/appengine/v1/internal/applications_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/appengine/v1/appengine.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 appengine_v1_internal { @@ -176,3 +179,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/applications_stub.h b/google/cloud/appengine/v1/internal/applications_stub.h index bb4cccb85ba7f..fba66f5a81314 100644 --- a/google/cloud/appengine/v1/internal/applications_stub.h +++ b/google/cloud/appengine/v1/internal/applications_stub.h @@ -24,12 +24,15 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/appengine/v1/appengine.grpc.pb.h" +#include "google/appengine/v1/operation.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 appengine_v1_internal { @@ -157,4 +160,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_APPLICATIONS_STUB_H diff --git a/google/cloud/appengine/v1/internal/applications_stub_factory.cc b/google/cloud/appengine/v1/internal/applications_stub_factory.cc index 57cf34d56fc8f..7e630b1ab174e 100644 --- a/google/cloud/appengine/v1/internal/applications_stub_factory.cc +++ b/google/cloud/appengine/v1/internal/applications_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/applications_stub_factory.h b/google/cloud/appengine/v1/internal/applications_stub_factory.h index bcd64da0c33c5..36cff8a49f052 100644 --- a/google/cloud/appengine/v1/internal/applications_stub_factory.h +++ b/google/cloud/appengine/v1/internal/applications_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_APPLICATIONS_STUB_FACTORY_H diff --git a/google/cloud/appengine/v1/internal/applications_tracing_connection.cc b/google/cloud/appengine/v1/internal/applications_tracing_connection.cc index c35ddc1c0c8bc..f2fdbf3dffdf2 100644 --- a/google/cloud/appengine/v1/internal/applications_tracing_connection.cc +++ b/google/cloud/appengine/v1/internal/applications_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ApplicationsTracingConnection::ApplicationsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -131,16 +129,12 @@ ApplicationsTracingConnection::RepairApplication( child_->RepairApplication(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeApplicationsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/appengine/v1/internal/applications_tracing_connection.h b/google/cloud/appengine/v1/internal/applications_tracing_connection.h index e14ebebcfbb08..6c6a08c54bfea 100644 --- a/google/cloud/appengine/v1/internal/applications_tracing_connection.h +++ b/google/cloud/appengine/v1/internal/applications_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ApplicationsTracingConnection : public appengine_v1::ApplicationsConnection { public: @@ -77,8 +75,6 @@ class ApplicationsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/appengine/v1/internal/applications_tracing_stub.cc b/google/cloud/appengine/v1/internal/applications_tracing_stub.cc index 9819abf8b9986..3c9fd9757bac1 100644 --- a/google/cloud/appengine/v1/internal/applications_tracing_stub.cc +++ b/google/cloud/appengine/v1/internal/applications_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ApplicationsTracingStub::ApplicationsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -153,18 +154,14 @@ future ApplicationsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeApplicationsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/applications_tracing_stub.h b/google/cloud/appengine/v1/internal/applications_tracing_stub.h index d78d8dc774d18..89b945cccfa6e 100644 --- a/google/cloud/appengine/v1/internal/applications_tracing_stub.h +++ b/google/cloud/appengine/v1/internal/applications_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ApplicationsTracingStub : public ApplicationsStub { public: ~ApplicationsTracingStub() override = default; @@ -90,8 +91,6 @@ class ApplicationsTracingStub : public ApplicationsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -106,4 +105,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_APPLICATIONS_TRACING_STUB_H diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_auth_decorator.cc b/google/cloud/appengine/v1/internal/authorized_certificates_auth_decorator.cc index 65ad8d61a3dfd..001bd920ab198 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_auth_decorator.cc +++ b/google/cloud/appengine/v1/internal/authorized_certificates_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/appengine/v1/appengine.proto #include "google/cloud/appengine/v1/internal/authorized_certificates_auth_decorator.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_auth_decorator.h b/google/cloud/appengine/v1/internal/authorized_certificates_auth_decorator.h index 27b2846943d63..cc1522e85de1b 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_auth_decorator.h +++ b/google/cloud/appengine/v1/internal/authorized_certificates_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -77,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_AUTHORIZED_CERTIFICATES_AUTH_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_logging_decorator.cc b/google/cloud/appengine/v1/internal/authorized_certificates_logging_decorator.cc index 4ecf60d08a380..4739c7ea18a6f 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_logging_decorator.cc +++ b/google/cloud/appengine/v1/internal/authorized_certificates_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/appengine/v1/internal/authorized_certificates_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -103,3 +106,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_logging_decorator.h b/google/cloud/appengine/v1/internal/authorized_certificates_logging_decorator.h index ae49c8d334ea8..83450786c8b36 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_logging_decorator.h +++ b/google/cloud/appengine/v1/internal/authorized_certificates_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -77,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_AUTHORIZED_CERTIFICATES_LOGGING_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_metadata_decorator.cc b/google/cloud/appengine/v1/internal/authorized_certificates_metadata_decorator.cc index 6959ed147d1d0..0856bd6e0aade 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_metadata_decorator.cc +++ b/google/cloud/appengine/v1/internal/authorized_certificates_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/appengine/v1/internal/authorized_certificates_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -105,3 +109,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_metadata_decorator.h b/google/cloud/appengine/v1/internal/authorized_certificates_metadata_decorator.h index 61cac4c44cbf4..f10e0ca1883a2 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_metadata_decorator.h +++ b/google/cloud/appengine/v1/internal/authorized_certificates_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -83,4 +86,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_AUTHORIZED_CERTIFICATES_METADATA_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_option_defaults.cc b/google/cloud/appengine/v1/internal/authorized_certificates_option_defaults.cc index 8bdcf1735b0ad..64d6f1379e522 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_option_defaults.cc +++ b/google/cloud/appengine/v1/internal/authorized_certificates_option_defaults.cc @@ -42,7 +42,7 @@ Options AuthorizedCertificatesDefaultOptions(Options options) { if (!options.has()) { options.set( appengine_v1::AuthorizedCertificatesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_stub.cc b/google/cloud/appengine/v1/internal/authorized_certificates_stub.cc index 45278d3884910..003e65cbb2488 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_stub.cc +++ b/google/cloud/appengine/v1/internal/authorized_certificates_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/appengine/v1/internal/authorized_certificates_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -98,3 +101,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_stub.h b/google/cloud/appengine/v1/internal/authorized_certificates_stub.h index 47ef0d0aa39e3..5a3bc380b0625 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_stub.h +++ b/google/cloud/appengine/v1/internal/authorized_certificates_stub.h @@ -22,11 +22,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/appengine/v1/appengine.grpc.pb.h" +#include "google/appengine/v1/operation.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -113,4 +116,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_AUTHORIZED_CERTIFICATES_STUB_H diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_stub_factory.cc b/google/cloud/appengine/v1/internal/authorized_certificates_stub_factory.cc index 4f2f146032649..63f40244f1b41 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_stub_factory.cc +++ b/google/cloud/appengine/v1/internal/authorized_certificates_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_stub_factory.h b/google/cloud/appengine/v1/internal/authorized_certificates_stub_factory.h index fcc3b5aedd23c..3d2370e520a78 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_stub_factory.h +++ b/google/cloud/appengine/v1/internal/authorized_certificates_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_AUTHORIZED_CERTIFICATES_STUB_FACTORY_H diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_tracing_connection.cc b/google/cloud/appengine/v1/internal/authorized_certificates_tracing_connection.cc index aa9611a7b308a..e99f5e55a0f19 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_tracing_connection.cc +++ b/google/cloud/appengine/v1/internal/authorized_certificates_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AuthorizedCertificatesTracingConnection:: AuthorizedCertificatesTracingConnection( std::shared_ptr child) @@ -86,17 +84,13 @@ Status AuthorizedCertificatesTracingConnection::DeleteAuthorizedCertificate( return internal::EndSpan(*span, child_->DeleteAuthorizedCertificate(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAuthorizedCertificatesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_tracing_connection.h b/google/cloud/appengine/v1/internal/authorized_certificates_tracing_connection.h index ed4b6f5937cd1..88efffc4aabc9 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_tracing_connection.h +++ b/google/cloud/appengine/v1/internal/authorized_certificates_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AuthorizedCertificatesTracingConnection : public appengine_v1::AuthorizedCertificatesConnection { public: @@ -68,8 +66,6 @@ class AuthorizedCertificatesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_tracing_stub.cc b/google/cloud/appengine/v1/internal/authorized_certificates_tracing_stub.cc index 2ecb9c3b6ae1f..7f6048d766ddb 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_tracing_stub.cc +++ b/google/cloud/appengine/v1/internal/authorized_certificates_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AuthorizedCertificatesTracingStub::AuthorizedCertificatesTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -100,19 +101,15 @@ Status AuthorizedCertificatesTracingStub::DeleteAuthorizedCertificate( child_->DeleteAuthorizedCertificate(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAuthorizedCertificatesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/authorized_certificates_tracing_stub.h b/google/cloud/appengine/v1/internal/authorized_certificates_tracing_stub.h index 665d11b2bd928..1a59fa2de6e1b 100644 --- a/google/cloud/appengine/v1/internal/authorized_certificates_tracing_stub.h +++ b/google/cloud/appengine/v1/internal/authorized_certificates_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AuthorizedCertificatesTracingStub : public AuthorizedCertificatesStub { public: ~AuthorizedCertificatesTracingStub() override = default; @@ -74,8 +75,6 @@ class AuthorizedCertificatesTracingStub : public AuthorizedCertificatesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -91,4 +90,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_AUTHORIZED_CERTIFICATES_TRACING_STUB_H diff --git a/google/cloud/appengine/v1/internal/authorized_domains_auth_decorator.cc b/google/cloud/appengine/v1/internal/authorized_domains_auth_decorator.cc index b1eecbffb6e5d..216fd3e080fb8 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_auth_decorator.cc +++ b/google/cloud/appengine/v1/internal/authorized_domains_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/appengine/v1/appengine.proto #include "google/cloud/appengine/v1/internal/authorized_domains_auth_decorator.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -44,3 +47,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/authorized_domains_auth_decorator.h b/google/cloud/appengine/v1/internal/authorized_domains_auth_decorator.h index 5059b6f826cd1..7d7737000a5d6 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_auth_decorator.h +++ b/google/cloud/appengine/v1/internal/authorized_domains_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -54,4 +57,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_AUTHORIZED_DOMAINS_AUTH_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/authorized_domains_logging_decorator.cc b/google/cloud/appengine/v1/internal/authorized_domains_logging_decorator.cc index 84e04e22130ab..fea1b85a3ba24 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_logging_decorator.cc +++ b/google/cloud/appengine/v1/internal/authorized_domains_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/appengine/v1/internal/authorized_domains_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -52,3 +55,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/authorized_domains_logging_decorator.h b/google/cloud/appengine/v1/internal/authorized_domains_logging_decorator.h index f01da02535b9f..9cf515f685157 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_logging_decorator.h +++ b/google/cloud/appengine/v1/internal/authorized_domains_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -54,4 +57,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_AUTHORIZED_DOMAINS_LOGGING_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/authorized_domains_metadata_decorator.cc b/google/cloud/appengine/v1/internal/authorized_domains_metadata_decorator.cc index 62e8f3486c620..c65cd5ee5edc7 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_metadata_decorator.cc +++ b/google/cloud/appengine/v1/internal/authorized_domains_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/appengine/v1/internal/authorized_domains_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -70,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/authorized_domains_metadata_decorator.h b/google/cloud/appengine/v1/internal/authorized_domains_metadata_decorator.h index c5f0ffb9772ca..5495cf4039980 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_metadata_decorator.h +++ b/google/cloud/appengine/v1/internal/authorized_domains_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -60,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_AUTHORIZED_DOMAINS_METADATA_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/authorized_domains_option_defaults.cc b/google/cloud/appengine/v1/internal/authorized_domains_option_defaults.cc index 4a18cc962769c..1cba0f76d62d2 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_option_defaults.cc +++ b/google/cloud/appengine/v1/internal/authorized_domains_option_defaults.cc @@ -42,7 +42,7 @@ Options AuthorizedDomainsDefaultOptions(Options options) { if (!options.has()) { options.set( appengine_v1::AuthorizedDomainsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/appengine/v1/internal/authorized_domains_stub.cc b/google/cloud/appengine/v1/internal/authorized_domains_stub.cc index 0dabc689a6fb9..9fde7e54a3fbd 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_stub.cc +++ b/google/cloud/appengine/v1/internal/authorized_domains_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/appengine/v1/internal/authorized_domains_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -46,3 +49,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/authorized_domains_stub.h b/google/cloud/appengine/v1/internal/authorized_domains_stub.h index 8736625bcb1e9..87801e7f018b3 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_stub.h +++ b/google/cloud/appengine/v1/internal/authorized_domains_stub.h @@ -22,11 +22,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/appengine/v1/appengine.grpc.pb.h" +#include "google/appengine/v1/operation.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -65,4 +68,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_AUTHORIZED_DOMAINS_STUB_H diff --git a/google/cloud/appengine/v1/internal/authorized_domains_stub_factory.cc b/google/cloud/appengine/v1/internal/authorized_domains_stub_factory.cc index ad88107fa9b44..8d39d88f1f1db 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_stub_factory.cc +++ b/google/cloud/appengine/v1/internal/authorized_domains_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/authorized_domains_stub_factory.h b/google/cloud/appengine/v1/internal/authorized_domains_stub_factory.h index 24e6aca27a895..0a3a611bc83cf 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_stub_factory.h +++ b/google/cloud/appengine/v1/internal/authorized_domains_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_AUTHORIZED_DOMAINS_STUB_FACTORY_H diff --git a/google/cloud/appengine/v1/internal/authorized_domains_tracing_connection.cc b/google/cloud/appengine/v1/internal/authorized_domains_tracing_connection.cc index 85543616a90de..f952d047b18e1 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_tracing_connection.cc +++ b/google/cloud/appengine/v1/internal/authorized_domains_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AuthorizedDomainsTracingConnection::AuthorizedDomainsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -44,17 +42,13 @@ AuthorizedDomainsTracingConnection::ListAuthorizedDomains( google::appengine::v1::AuthorizedDomain>(std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAuthorizedDomainsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/appengine/v1/internal/authorized_domains_tracing_connection.h b/google/cloud/appengine/v1/internal/authorized_domains_tracing_connection.h index b310f5153f8fa..ee1b003e38be5 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_tracing_connection.h +++ b/google/cloud/appengine/v1/internal/authorized_domains_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AuthorizedDomainsTracingConnection : public appengine_v1::AuthorizedDomainsConnection { public: @@ -47,8 +45,6 @@ class AuthorizedDomainsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/appengine/v1/internal/authorized_domains_tracing_stub.cc b/google/cloud/appengine/v1/internal/authorized_domains_tracing_stub.cc index 6e2826252d38d..b3949ee59d271 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_tracing_stub.cc +++ b/google/cloud/appengine/v1/internal/authorized_domains_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AuthorizedDomainsTracingStub::AuthorizedDomainsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -44,18 +45,14 @@ AuthorizedDomainsTracingStub::ListAuthorizedDomains( context, *span, child_->ListAuthorizedDomains(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAuthorizedDomainsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/authorized_domains_tracing_stub.h b/google/cloud/appengine/v1/internal/authorized_domains_tracing_stub.h index b7165266027e1..1768fc4723fe8 100644 --- a/google/cloud/appengine/v1/internal/authorized_domains_tracing_stub.h +++ b/google/cloud/appengine/v1/internal/authorized_domains_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AuthorizedDomainsTracingStub : public AuthorizedDomainsStub { public: ~AuthorizedDomainsTracingStub() override = default; @@ -51,8 +52,6 @@ class AuthorizedDomainsTracingStub : public AuthorizedDomainsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -67,4 +66,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_AUTHORIZED_DOMAINS_TRACING_STUB_H diff --git a/google/cloud/appengine/v1/internal/domain_mappings_auth_decorator.cc b/google/cloud/appengine/v1/internal/domain_mappings_auth_decorator.cc index 4e37c8bb1b192..ba2a4784fe0dd 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_auth_decorator.cc +++ b/google/cloud/appengine/v1/internal/domain_mappings_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/appengine/v1/appengine.proto #include "google/cloud/appengine/v1/internal/domain_mappings_auth_decorator.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -176,3 +179,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/domain_mappings_auth_decorator.h b/google/cloud/appengine/v1/internal/domain_mappings_auth_decorator.h index 1cca255964231..15de9252f71a6 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_auth_decorator.h +++ b/google/cloud/appengine/v1/internal/domain_mappings_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/domain_mappings_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -106,4 +109,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_DOMAIN_MAPPINGS_AUTH_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/domain_mappings_connection_impl.h b/google/cloud/appengine/v1/internal/domain_mappings_connection_impl.h index 4f1de87cccbb5..feac915343bd0 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_connection_impl.h +++ b/google/cloud/appengine/v1/internal/domain_mappings_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/internal/domain_mappings_logging_decorator.cc b/google/cloud/appengine/v1/internal/domain_mappings_logging_decorator.cc index 29a6109f9a415..2f88a146e3d98 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_logging_decorator.cc +++ b/google/cloud/appengine/v1/internal/domain_mappings_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/appengine/v1/internal/domain_mappings_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -188,3 +191,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/domain_mappings_logging_decorator.h b/google/cloud/appengine/v1/internal/domain_mappings_logging_decorator.h index 0da2847d4bd7f..3896d86028d5c 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_logging_decorator.h +++ b/google/cloud/appengine/v1/internal/domain_mappings_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/domain_mappings_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -106,4 +109,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_DOMAIN_MAPPINGS_LOGGING_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/domain_mappings_metadata_decorator.cc b/google/cloud/appengine/v1/internal/domain_mappings_metadata_decorator.cc index b95243c5a604b..b9981bf3bd79d 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_metadata_decorator.cc +++ b/google/cloud/appengine/v1/internal/domain_mappings_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/appengine/v1/internal/domain_mappings_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -165,3 +169,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/domain_mappings_metadata_decorator.h b/google/cloud/appengine/v1/internal/domain_mappings_metadata_decorator.h index dbd7b7cf72c7d..d576e0cc3138b 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_metadata_decorator.h +++ b/google/cloud/appengine/v1/internal/domain_mappings_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/domain_mappings_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -111,4 +114,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_DOMAIN_MAPPINGS_METADATA_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/domain_mappings_option_defaults.cc b/google/cloud/appengine/v1/internal/domain_mappings_option_defaults.cc index 12b5218311f37..3082cb086c6a0 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_option_defaults.cc +++ b/google/cloud/appengine/v1/internal/domain_mappings_option_defaults.cc @@ -41,7 +41,7 @@ Options DomainMappingsDefaultOptions(Options options) { if (!options.has()) { options.set( appengine_v1::DomainMappingsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/appengine/v1/internal/domain_mappings_stub.cc b/google/cloud/appengine/v1/internal/domain_mappings_stub.cc index 3a9f8b71b9bce..6cb547b466d1c 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_stub.cc +++ b/google/cloud/appengine/v1/internal/domain_mappings_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/appengine/v1/internal/domain_mappings_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/appengine/v1/appengine.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 appengine_v1_internal { @@ -188,3 +191,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/domain_mappings_stub.h b/google/cloud/appengine/v1/internal/domain_mappings_stub.h index e8396daf9c3fb..d8e6b214fe01b 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_stub.h +++ b/google/cloud/appengine/v1/internal/domain_mappings_stub.h @@ -24,12 +24,15 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/appengine/v1/appengine.grpc.pb.h" +#include "google/appengine/v1/operation.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 appengine_v1_internal { @@ -173,4 +176,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_DOMAIN_MAPPINGS_STUB_H diff --git a/google/cloud/appengine/v1/internal/domain_mappings_stub_factory.cc b/google/cloud/appengine/v1/internal/domain_mappings_stub_factory.cc index fc8c386d2d33b..b26b2de1b450b 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_stub_factory.cc +++ b/google/cloud/appengine/v1/internal/domain_mappings_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/domain_mappings_stub_factory.h b/google/cloud/appengine/v1/internal/domain_mappings_stub_factory.h index d49e7f4f11112..5b6a362e2e330 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_stub_factory.h +++ b/google/cloud/appengine/v1/internal/domain_mappings_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_DOMAIN_MAPPINGS_STUB_FACTORY_H diff --git a/google/cloud/appengine/v1/internal/domain_mappings_tracing_connection.cc b/google/cloud/appengine/v1/internal/domain_mappings_tracing_connection.cc index a78f31edd9810..4a45ebe79583c 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_tracing_connection.cc +++ b/google/cloud/appengine/v1/internal/domain_mappings_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DomainMappingsTracingConnection::DomainMappingsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -146,16 +144,12 @@ DomainMappingsTracingConnection::DeleteDomainMapping( child_->DeleteDomainMapping(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDomainMappingsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/appengine/v1/internal/domain_mappings_tracing_connection.h b/google/cloud/appengine/v1/internal/domain_mappings_tracing_connection.h index 48ea354b0ab93..9b3abdcdda0bb 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_tracing_connection.h +++ b/google/cloud/appengine/v1/internal/domain_mappings_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DomainMappingsTracingConnection : public appengine_v1::DomainMappingsConnection { public: @@ -86,8 +84,6 @@ class DomainMappingsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/appengine/v1/internal/domain_mappings_tracing_stub.cc b/google/cloud/appengine/v1/internal/domain_mappings_tracing_stub.cc index 2d1944ed2b8f7..2428ec517055c 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_tracing_stub.cc +++ b/google/cloud/appengine/v1/internal/domain_mappings_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DomainMappingsTracingStub::DomainMappingsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -165,18 +166,14 @@ future DomainMappingsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDomainMappingsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/domain_mappings_tracing_stub.h b/google/cloud/appengine/v1/internal/domain_mappings_tracing_stub.h index bba974650a5f2..a9256ad5599d8 100644 --- a/google/cloud/appengine/v1/internal/domain_mappings_tracing_stub.h +++ b/google/cloud/appengine/v1/internal/domain_mappings_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DomainMappingsTracingStub : public DomainMappingsStub { public: ~DomainMappingsTracingStub() override = default; @@ -101,8 +102,6 @@ class DomainMappingsTracingStub : public DomainMappingsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -117,4 +116,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_DOMAIN_MAPPINGS_TRACING_STUB_H diff --git a/google/cloud/appengine/v1/internal/firewall_auth_decorator.cc b/google/cloud/appengine/v1/internal/firewall_auth_decorator.cc index ece924a1c1717..6f565cf1cbd5d 100644 --- a/google/cloud/appengine/v1/internal/firewall_auth_decorator.cc +++ b/google/cloud/appengine/v1/internal/firewall_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/appengine/v1/appengine.proto #include "google/cloud/appengine/v1/internal/firewall_auth_decorator.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -85,3 +88,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/firewall_auth_decorator.h b/google/cloud/appengine/v1/internal/firewall_auth_decorator.h index 7b2d5787cb76b..872267633a789 100644 --- a/google/cloud/appengine/v1/internal/firewall_auth_decorator.h +++ b/google/cloud/appengine/v1/internal/firewall_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -74,4 +77,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_FIREWALL_AUTH_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/firewall_logging_decorator.cc b/google/cloud/appengine/v1/internal/firewall_logging_decorator.cc index ec8107af18bc3..a7149aed29aef 100644 --- a/google/cloud/appengine/v1/internal/firewall_logging_decorator.cc +++ b/google/cloud/appengine/v1/internal/firewall_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/appengine/v1/internal/firewall_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -110,3 +113,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/firewall_logging_decorator.h b/google/cloud/appengine/v1/internal/firewall_logging_decorator.h index bfa6c6bb25bf8..65dc7a398a98e 100644 --- a/google/cloud/appengine/v1/internal/firewall_logging_decorator.h +++ b/google/cloud/appengine/v1/internal/firewall_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -74,4 +77,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_FIREWALL_LOGGING_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/firewall_metadata_decorator.cc b/google/cloud/appengine/v1/internal/firewall_metadata_decorator.cc index 2b6934cfb9eaf..ebf9bbcc9c783 100644 --- a/google/cloud/appengine/v1/internal/firewall_metadata_decorator.cc +++ b/google/cloud/appengine/v1/internal/firewall_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/appengine/v1/internal/firewall_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -113,3 +117,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/firewall_metadata_decorator.h b/google/cloud/appengine/v1/internal/firewall_metadata_decorator.h index b437a4cd7e0aa..55f823650227b 100644 --- a/google/cloud/appengine/v1/internal/firewall_metadata_decorator.h +++ b/google/cloud/appengine/v1/internal/firewall_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -79,4 +82,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_FIREWALL_METADATA_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/firewall_option_defaults.cc b/google/cloud/appengine/v1/internal/firewall_option_defaults.cc index 4a4ebc08deaf0..ea51decdc2ab0 100644 --- a/google/cloud/appengine/v1/internal/firewall_option_defaults.cc +++ b/google/cloud/appengine/v1/internal/firewall_option_defaults.cc @@ -40,7 +40,7 @@ Options FirewallDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - appengine_v1::FirewallLimitedTimeRetryPolicy(std::chrono::minutes(30)) + appengine_v1::FirewallLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/appengine/v1/internal/firewall_stub.cc b/google/cloud/appengine/v1/internal/firewall_stub.cc index 6051df0a471de..a8d45e30ea7fc 100644 --- a/google/cloud/appengine/v1/internal/firewall_stub.cc +++ b/google/cloud/appengine/v1/internal/firewall_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/appengine/v1/internal/firewall_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -106,3 +109,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/firewall_stub.h b/google/cloud/appengine/v1/internal/firewall_stub.h index 7d4135cbf737b..7e0a16c59bc80 100644 --- a/google/cloud/appengine/v1/internal/firewall_stub.h +++ b/google/cloud/appengine/v1/internal/firewall_stub.h @@ -22,11 +22,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/appengine/v1/appengine.grpc.pb.h" +#include "google/appengine/v1/operation.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_FIREWALL_STUB_H diff --git a/google/cloud/appengine/v1/internal/firewall_stub_factory.cc b/google/cloud/appengine/v1/internal/firewall_stub_factory.cc index 814ea94685739..4c02dc0ec3f3a 100644 --- a/google/cloud/appengine/v1/internal/firewall_stub_factory.cc +++ b/google/cloud/appengine/v1/internal/firewall_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -67,3 +70,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/firewall_stub_factory.h b/google/cloud/appengine/v1/internal/firewall_stub_factory.h index dbc37c89d6fae..cd6d3546354f4 100644 --- a/google/cloud/appengine/v1/internal/firewall_stub_factory.h +++ b/google/cloud/appengine/v1/internal/firewall_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_FIREWALL_STUB_FACTORY_H diff --git a/google/cloud/appengine/v1/internal/firewall_tracing_connection.cc b/google/cloud/appengine/v1/internal/firewall_tracing_connection.cc index db9ccadffeec4..a1e9d475024cf 100644 --- a/google/cloud/appengine/v1/internal/firewall_tracing_connection.cc +++ b/google/cloud/appengine/v1/internal/firewall_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FirewallTracingConnection::FirewallTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -88,15 +86,11 @@ Status FirewallTracingConnection::DeleteIngressRule( return internal::EndSpan(*span, child_->DeleteIngressRule(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFirewallTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/appengine/v1/internal/firewall_tracing_connection.h b/google/cloud/appengine/v1/internal/firewall_tracing_connection.h index ff4c5cf236730..a4fc505b38bcf 100644 --- a/google/cloud/appengine/v1/internal/firewall_tracing_connection.h +++ b/google/cloud/appengine/v1/internal/firewall_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FirewallTracingConnection : public appengine_v1::FirewallConnection { public: ~FirewallTracingConnection() override = default; @@ -63,8 +61,6 @@ class FirewallTracingConnection : public appengine_v1::FirewallConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/appengine/v1/internal/firewall_tracing_stub.cc b/google/cloud/appengine/v1/internal/firewall_tracing_stub.cc index 0817ad775be99..8d8ae4d64a0f4 100644 --- a/google/cloud/appengine/v1/internal/firewall_tracing_stub.cc +++ b/google/cloud/appengine/v1/internal/firewall_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FirewallTracingStub::FirewallTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -103,18 +104,14 @@ Status FirewallTracingStub::DeleteIngressRule( context, *span, child_->DeleteIngressRule(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFirewallTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/firewall_tracing_stub.h b/google/cloud/appengine/v1/internal/firewall_tracing_stub.h index 7890a025deaa7..13142df324ddc 100644 --- a/google/cloud/appengine/v1/internal/firewall_tracing_stub.h +++ b/google/cloud/appengine/v1/internal/firewall_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FirewallTracingStub : public FirewallStub { public: ~FirewallTracingStub() override = default; @@ -70,8 +71,6 @@ class FirewallTracingStub : public FirewallStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -86,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_FIREWALL_TRACING_STUB_H diff --git a/google/cloud/appengine/v1/internal/instances_auth_decorator.cc b/google/cloud/appengine/v1/internal/instances_auth_decorator.cc index 10d0d651bb679..4f8b805afd1f3 100644 --- a/google/cloud/appengine/v1/internal/instances_auth_decorator.cc +++ b/google/cloud/appengine/v1/internal/instances_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/appengine/v1/appengine.proto #include "google/cloud/appengine/v1/internal/instances_auth_decorator.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -144,3 +147,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/instances_auth_decorator.h b/google/cloud/appengine/v1/internal/instances_auth_decorator.h index 5b8c15b9171db..f7e3be7c0bb0a 100644 --- a/google/cloud/appengine/v1/internal/instances_auth_decorator.h +++ b/google/cloud/appengine/v1/internal/instances_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/instances_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -89,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_INSTANCES_AUTH_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/instances_connection_impl.h b/google/cloud/appengine/v1/internal/instances_connection_impl.h index 7eb4be50b2f92..f37ebb2bfccca 100644 --- a/google/cloud/appengine/v1/internal/instances_connection_impl.h +++ b/google/cloud/appengine/v1/internal/instances_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/internal/instances_logging_decorator.cc b/google/cloud/appengine/v1/internal/instances_logging_decorator.cc index f121e89ab5762..21e67f937d2ea 100644 --- a/google/cloud/appengine/v1/internal/instances_logging_decorator.cc +++ b/google/cloud/appengine/v1/internal/instances_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/appengine/v1/internal/instances_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -155,3 +158,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/instances_logging_decorator.h b/google/cloud/appengine/v1/internal/instances_logging_decorator.h index 122ed4b8e8089..8674d5ba7764f 100644 --- a/google/cloud/appengine/v1/internal/instances_logging_decorator.h +++ b/google/cloud/appengine/v1/internal/instances_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/instances_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -89,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_INSTANCES_LOGGING_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/instances_metadata_decorator.cc b/google/cloud/appengine/v1/internal/instances_metadata_decorator.cc index 5e63760cf9ec2..297eec6410afd 100644 --- a/google/cloud/appengine/v1/internal/instances_metadata_decorator.cc +++ b/google/cloud/appengine/v1/internal/instances_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/appengine/v1/internal/instances_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -141,3 +145,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/instances_metadata_decorator.h b/google/cloud/appengine/v1/internal/instances_metadata_decorator.h index ec67073047bc2..cc9e4e6b3ffbe 100644 --- a/google/cloud/appengine/v1/internal/instances_metadata_decorator.h +++ b/google/cloud/appengine/v1/internal/instances_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/instances_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_INSTANCES_METADATA_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/instances_option_defaults.cc b/google/cloud/appengine/v1/internal/instances_option_defaults.cc index 0428bcca6df0f..4eafd1d995723 100644 --- a/google/cloud/appengine/v1/internal/instances_option_defaults.cc +++ b/google/cloud/appengine/v1/internal/instances_option_defaults.cc @@ -40,7 +40,7 @@ Options InstancesDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - appengine_v1::InstancesLimitedTimeRetryPolicy(std::chrono::minutes(30)) + appengine_v1::InstancesLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/appengine/v1/internal/instances_stub.cc b/google/cloud/appengine/v1/internal/instances_stub.cc index 0f0f648407573..9f0073417396d 100644 --- a/google/cloud/appengine/v1/internal/instances_stub.cc +++ b/google/cloud/appengine/v1/internal/instances_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/appengine/v1/internal/instances_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/appengine/v1/appengine.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 appengine_v1_internal { @@ -154,3 +157,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/instances_stub.h b/google/cloud/appengine/v1/internal/instances_stub.h index cb3e8d4316070..bc5d9ec09e99b 100644 --- a/google/cloud/appengine/v1/internal/instances_stub.h +++ b/google/cloud/appengine/v1/internal/instances_stub.h @@ -24,12 +24,15 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/appengine/v1/appengine.grpc.pb.h" +#include "google/appengine/v1/operation.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 appengine_v1_internal { @@ -141,4 +144,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_INSTANCES_STUB_H diff --git a/google/cloud/appengine/v1/internal/instances_stub_factory.cc b/google/cloud/appengine/v1/internal/instances_stub_factory.cc index 8c93005a726e8..48e0c2b286975 100644 --- a/google/cloud/appengine/v1/internal/instances_stub_factory.cc +++ b/google/cloud/appengine/v1/internal/instances_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/instances_stub_factory.h b/google/cloud/appengine/v1/internal/instances_stub_factory.h index 00d0d89447765..c2373e7fd2d9c 100644 --- a/google/cloud/appengine/v1/internal/instances_stub_factory.h +++ b/google/cloud/appengine/v1/internal/instances_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_INSTANCES_STUB_FACTORY_H diff --git a/google/cloud/appengine/v1/internal/instances_tracing_connection.cc b/google/cloud/appengine/v1/internal/instances_tracing_connection.cc index 9754f6ec18683..8ffcda2a8ff92 100644 --- a/google/cloud/appengine/v1/internal/instances_tracing_connection.cc +++ b/google/cloud/appengine/v1/internal/instances_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InstancesTracingConnection::InstancesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -108,16 +106,12 @@ InstancesTracingConnection::DebugInstance( return internal::EndSpan(std::move(span), child_->DebugInstance(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeInstancesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/appengine/v1/internal/instances_tracing_connection.h b/google/cloud/appengine/v1/internal/instances_tracing_connection.h index 4d1a16f6445e5..537844ee7e01e 100644 --- a/google/cloud/appengine/v1/internal/instances_tracing_connection.h +++ b/google/cloud/appengine/v1/internal/instances_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InstancesTracingConnection : public appengine_v1::InstancesConnection { public: ~InstancesTracingConnection() override = default; @@ -69,8 +67,6 @@ class InstancesTracingConnection : public appengine_v1::InstancesConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/appengine/v1/internal/instances_tracing_stub.cc b/google/cloud/appengine/v1/internal/instances_tracing_stub.cc index a11e273e04424..41e56ff2758e5 100644 --- a/google/cloud/appengine/v1/internal/instances_tracing_stub.cc +++ b/google/cloud/appengine/v1/internal/instances_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InstancesTracingStub::InstancesTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -133,18 +134,14 @@ future InstancesTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeInstancesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/instances_tracing_stub.h b/google/cloud/appengine/v1/internal/instances_tracing_stub.h index 07beaa58419aa..625c1d18508b3 100644 --- a/google/cloud/appengine/v1/internal/instances_tracing_stub.h +++ b/google/cloud/appengine/v1/internal/instances_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InstancesTracingStub : public InstancesStub { public: ~InstancesTracingStub() override = default; @@ -84,8 +85,6 @@ class InstancesTracingStub : public InstancesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -100,4 +99,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_INSTANCES_TRACING_STUB_H diff --git a/google/cloud/appengine/v1/internal/services_auth_decorator.cc b/google/cloud/appengine/v1/internal/services_auth_decorator.cc index a113a7e0a7224..a1057ebfd87f1 100644 --- a/google/cloud/appengine/v1/internal/services_auth_decorator.cc +++ b/google/cloud/appengine/v1/internal/services_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/appengine/v1/appengine.proto #include "google/cloud/appengine/v1/internal/services_auth_decorator.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -144,3 +147,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/services_auth_decorator.h b/google/cloud/appengine/v1/internal/services_auth_decorator.h index 38af16469a1f4..1d63a95e8bfb0 100644 --- a/google/cloud/appengine/v1/internal/services_auth_decorator.h +++ b/google/cloud/appengine/v1/internal/services_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/services_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -89,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_SERVICES_AUTH_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/services_connection_impl.h b/google/cloud/appengine/v1/internal/services_connection_impl.h index 1f25749575ecb..31b927105c601 100644 --- a/google/cloud/appengine/v1/internal/services_connection_impl.h +++ b/google/cloud/appengine/v1/internal/services_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/internal/services_logging_decorator.cc b/google/cloud/appengine/v1/internal/services_logging_decorator.cc index 8dd0238a7aa9d..63e1be9d5139d 100644 --- a/google/cloud/appengine/v1/internal/services_logging_decorator.cc +++ b/google/cloud/appengine/v1/internal/services_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/appengine/v1/internal/services_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -155,3 +158,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/services_logging_decorator.h b/google/cloud/appengine/v1/internal/services_logging_decorator.h index 71d03651f60dc..a2c9f9dc51ba7 100644 --- a/google/cloud/appengine/v1/internal/services_logging_decorator.h +++ b/google/cloud/appengine/v1/internal/services_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/services_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -89,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_SERVICES_LOGGING_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/services_metadata_decorator.cc b/google/cloud/appengine/v1/internal/services_metadata_decorator.cc index 70c1046a70a5a..d12b9b7f44661 100644 --- a/google/cloud/appengine/v1/internal/services_metadata_decorator.cc +++ b/google/cloud/appengine/v1/internal/services_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/appengine/v1/internal/services_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -141,3 +145,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/services_metadata_decorator.h b/google/cloud/appengine/v1/internal/services_metadata_decorator.h index 2ec01f076d748..ef16f280d9fa2 100644 --- a/google/cloud/appengine/v1/internal/services_metadata_decorator.h +++ b/google/cloud/appengine/v1/internal/services_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/services_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_SERVICES_METADATA_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/services_option_defaults.cc b/google/cloud/appengine/v1/internal/services_option_defaults.cc index 9350b14265b79..4c64e69d2908b 100644 --- a/google/cloud/appengine/v1/internal/services_option_defaults.cc +++ b/google/cloud/appengine/v1/internal/services_option_defaults.cc @@ -40,7 +40,7 @@ Options ServicesDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - appengine_v1::ServicesLimitedTimeRetryPolicy(std::chrono::minutes(30)) + appengine_v1::ServicesLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/appengine/v1/internal/services_stub.cc b/google/cloud/appengine/v1/internal/services_stub.cc index cec7dceabbee0..f4912bba753ab 100644 --- a/google/cloud/appengine/v1/internal/services_stub.cc +++ b/google/cloud/appengine/v1/internal/services_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/appengine/v1/internal/services_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/appengine/v1/appengine.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 appengine_v1_internal { @@ -153,3 +156,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/services_stub.h b/google/cloud/appengine/v1/internal/services_stub.h index 7b0d31246d9bb..a843784abd3e3 100644 --- a/google/cloud/appengine/v1/internal/services_stub.h +++ b/google/cloud/appengine/v1/internal/services_stub.h @@ -24,12 +24,15 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/appengine/v1/appengine.grpc.pb.h" +#include "google/appengine/v1/operation.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 appengine_v1_internal { @@ -140,4 +143,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_SERVICES_STUB_H diff --git a/google/cloud/appengine/v1/internal/services_stub_factory.cc b/google/cloud/appengine/v1/internal/services_stub_factory.cc index e43c9da1f9cb5..252c1b972207c 100644 --- a/google/cloud/appengine/v1/internal/services_stub_factory.cc +++ b/google/cloud/appengine/v1/internal/services_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/services_stub_factory.h b/google/cloud/appengine/v1/internal/services_stub_factory.h index f59d89d5a38df..aa8025019120e 100644 --- a/google/cloud/appengine/v1/internal/services_stub_factory.h +++ b/google/cloud/appengine/v1/internal/services_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_SERVICES_STUB_FACTORY_H diff --git a/google/cloud/appengine/v1/internal/services_tracing_connection.cc b/google/cloud/appengine/v1/internal/services_tracing_connection.cc index 24d806c96a9f1..8bfbc134cd34e 100644 --- a/google/cloud/appengine/v1/internal/services_tracing_connection.cc +++ b/google/cloud/appengine/v1/internal/services_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServicesTracingConnection::ServicesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -106,15 +104,11 @@ ServicesTracingConnection::DeleteService( return internal::EndSpan(std::move(span), child_->DeleteService(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServicesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/appengine/v1/internal/services_tracing_connection.h b/google/cloud/appengine/v1/internal/services_tracing_connection.h index 90f66b56626ac..cd6893a84f61e 100644 --- a/google/cloud/appengine/v1/internal/services_tracing_connection.h +++ b/google/cloud/appengine/v1/internal/services_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServicesTracingConnection : public appengine_v1::ServicesConnection { public: ~ServicesTracingConnection() override = default; @@ -69,8 +67,6 @@ class ServicesTracingConnection : public appengine_v1::ServicesConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/appengine/v1/internal/services_tracing_stub.cc b/google/cloud/appengine/v1/internal/services_tracing_stub.cc index ecd270ca728c3..097ee5163834d 100644 --- a/google/cloud/appengine/v1/internal/services_tracing_stub.cc +++ b/google/cloud/appengine/v1/internal/services_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServicesTracingStub::ServicesTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -132,18 +133,14 @@ future ServicesTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServicesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/services_tracing_stub.h b/google/cloud/appengine/v1/internal/services_tracing_stub.h index 1dfa5977d3b25..998e868d9f136 100644 --- a/google/cloud/appengine/v1/internal/services_tracing_stub.h +++ b/google/cloud/appengine/v1/internal/services_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServicesTracingStub : public ServicesStub { public: ~ServicesTracingStub() override = default; @@ -84,8 +85,6 @@ class ServicesTracingStub : public ServicesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -100,4 +99,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_SERVICES_TRACING_STUB_H diff --git a/google/cloud/appengine/v1/internal/versions_auth_decorator.cc b/google/cloud/appengine/v1/internal/versions_auth_decorator.cc index 5002a54db7e84..fe22e6b7792ed 100644 --- a/google/cloud/appengine/v1/internal/versions_auth_decorator.cc +++ b/google/cloud/appengine/v1/internal/versions_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/appengine/v1/appengine.proto #include "google/cloud/appengine/v1/internal/versions_auth_decorator.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -172,3 +175,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/versions_auth_decorator.h b/google/cloud/appengine/v1/internal/versions_auth_decorator.h index f9b92a9842838..ecff2a8f4fe5d 100644 --- a/google/cloud/appengine/v1/internal/versions_auth_decorator.h +++ b/google/cloud/appengine/v1/internal/versions_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/versions_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_VERSIONS_AUTH_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/versions_connection_impl.h b/google/cloud/appengine/v1/internal/versions_connection_impl.h index 6126bdf65087a..9ad5e6270b20b 100644 --- a/google/cloud/appengine/v1/internal/versions_connection_impl.h +++ b/google/cloud/appengine/v1/internal/versions_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/internal/versions_logging_decorator.cc b/google/cloud/appengine/v1/internal/versions_logging_decorator.cc index 50b8cb9a45b85..4d8a0db53b835 100644 --- a/google/cloud/appengine/v1/internal/versions_logging_decorator.cc +++ b/google/cloud/appengine/v1/internal/versions_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/appengine/v1/internal/versions_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -184,3 +187,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/versions_logging_decorator.h b/google/cloud/appengine/v1/internal/versions_logging_decorator.h index 3feec16fa7beb..abfb510541fae 100644 --- a/google/cloud/appengine/v1/internal/versions_logging_decorator.h +++ b/google/cloud/appengine/v1/internal/versions_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/versions_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_VERSIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/versions_metadata_decorator.cc b/google/cloud/appengine/v1/internal/versions_metadata_decorator.cc index f50adae9c4fe5..d4855469bf1ad 100644 --- a/google/cloud/appengine/v1/internal/versions_metadata_decorator.cc +++ b/google/cloud/appengine/v1/internal/versions_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/appengine/v1/internal/versions_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -161,3 +165,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/versions_metadata_decorator.h b/google/cloud/appengine/v1/internal/versions_metadata_decorator.h index a6e195e8a0580..d904c618c4423 100644 --- a/google/cloud/appengine/v1/internal/versions_metadata_decorator.h +++ b/google/cloud/appengine/v1/internal/versions_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/appengine/v1/internal/versions_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 appengine_v1_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_VERSIONS_METADATA_DECORATOR_H diff --git a/google/cloud/appengine/v1/internal/versions_option_defaults.cc b/google/cloud/appengine/v1/internal/versions_option_defaults.cc index 60c691d5594dc..d396b0b015746 100644 --- a/google/cloud/appengine/v1/internal/versions_option_defaults.cc +++ b/google/cloud/appengine/v1/internal/versions_option_defaults.cc @@ -40,7 +40,7 @@ Options VersionsDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - appengine_v1::VersionsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + appengine_v1::VersionsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/appengine/v1/internal/versions_stub.cc b/google/cloud/appengine/v1/internal/versions_stub.cc index 1b99381ddda1a..6d444437f4584 100644 --- a/google/cloud/appengine/v1/internal/versions_stub.cc +++ b/google/cloud/appengine/v1/internal/versions_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/appengine/v1/internal/versions_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/appengine/v1/appengine.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 appengine_v1_internal { @@ -181,3 +184,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/versions_stub.h b/google/cloud/appengine/v1/internal/versions_stub.h index 5c117b15e2cb5..e56b7c264e494 100644 --- a/google/cloud/appengine/v1/internal/versions_stub.h +++ b/google/cloud/appengine/v1/internal/versions_stub.h @@ -24,12 +24,15 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/appengine/v1/appengine.grpc.pb.h" +#include "google/appengine/v1/operation.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 appengine_v1_internal { @@ -160,4 +163,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_VERSIONS_STUB_H diff --git a/google/cloud/appengine/v1/internal/versions_stub_factory.cc b/google/cloud/appengine/v1/internal/versions_stub_factory.cc index 3c17501525d90..7adc1771188bb 100644 --- a/google/cloud/appengine/v1/internal/versions_stub_factory.cc +++ b/google/cloud/appengine/v1/internal/versions_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/versions_stub_factory.h b/google/cloud/appengine/v1/internal/versions_stub_factory.h index 727b74e32d073..38c0e9c8961b2 100644 --- a/google/cloud/appengine/v1/internal/versions_stub_factory.h +++ b/google/cloud/appengine/v1/internal/versions_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_VERSIONS_STUB_FACTORY_H diff --git a/google/cloud/appengine/v1/internal/versions_tracing_connection.cc b/google/cloud/appengine/v1/internal/versions_tracing_connection.cc index 568ffb44bbb3f..fb6cf6f97d142 100644 --- a/google/cloud/appengine/v1/internal/versions_tracing_connection.cc +++ b/google/cloud/appengine/v1/internal/versions_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VersionsTracingConnection::VersionsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -133,15 +131,11 @@ VersionsTracingConnection::DeleteVersion( return internal::EndSpan(std::move(span), child_->DeleteVersion(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVersionsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/appengine/v1/internal/versions_tracing_connection.h b/google/cloud/appengine/v1/internal/versions_tracing_connection.h index 002f10c1fd714..db32d79d30cda 100644 --- a/google/cloud/appengine/v1/internal/versions_tracing_connection.h +++ b/google/cloud/appengine/v1/internal/versions_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VersionsTracingConnection : public appengine_v1::VersionsConnection { public: ~VersionsTracingConnection() override = default; @@ -79,8 +77,6 @@ class VersionsTracingConnection : public appengine_v1::VersionsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/appengine/v1/internal/versions_tracing_stub.cc b/google/cloud/appengine/v1/internal/versions_tracing_stub.cc index 9169c902e19ee..975675eb5b600 100644 --- a/google/cloud/appengine/v1/internal/versions_tracing_stub.cc +++ b/google/cloud/appengine/v1/internal/versions_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VersionsTracingStub::VersionsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -157,18 +158,14 @@ future VersionsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVersionsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace appengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/appengine/v1/internal/versions_tracing_stub.h b/google/cloud/appengine/v1/internal/versions_tracing_stub.h index f0b18e876c14f..65fee06599e45 100644 --- a/google/cloud/appengine/v1/internal/versions_tracing_stub.h +++ b/google/cloud/appengine/v1/internal/versions_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace appengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VersionsTracingStub : public VersionsStub { public: ~VersionsTracingStub() override = default; @@ -94,8 +95,6 @@ class VersionsTracingStub : public VersionsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -110,4 +109,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_V1_INTERNAL_VERSIONS_TRACING_STUB_H diff --git a/google/cloud/appengine/v1/services_client.h b/google/cloud/appengine/v1/services_client.h index bdce72c302c88..c3c1269fd81c5 100644 --- a/google/cloud/appengine/v1/services_client.h +++ b/google/cloud/appengine/v1/services_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/appengine/v1/services_connection.h b/google/cloud/appengine/v1/services_connection.h index bcdf2cc9cd041..df7b86574b371 100644 --- a/google/cloud/appengine/v1/services_connection.h +++ b/google/cloud/appengine/v1/services_connection.h @@ -30,9 +30,9 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/appengine/v1/appengine.pb.h" +#include "google/appengine/v1/operation.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/services_connection_idempotency_policy.h b/google/cloud/appengine/v1/services_connection_idempotency_policy.h index 626e1e1a4aed8..c2cd4f4d06b7e 100644 --- a/google/cloud/appengine/v1/services_connection_idempotency_policy.h +++ b/google/cloud/appengine/v1/services_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/versions_client.h b/google/cloud/appengine/v1/versions_client.h index 434c2fbb64d8a..5f4497294ed7a 100644 --- a/google/cloud/appengine/v1/versions_client.h +++ b/google/cloud/appengine/v1/versions_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/appengine/v1/versions_connection.h b/google/cloud/appengine/v1/versions_connection.h index 427e86c3923ef..8b5d7fcf9089d 100644 --- a/google/cloud/appengine/v1/versions_connection.h +++ b/google/cloud/appengine/v1/versions_connection.h @@ -30,9 +30,9 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/appengine/v1/appengine.pb.h" +#include "google/appengine/v1/operation.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/v1/versions_connection_idempotency_policy.h b/google/cloud/appengine/v1/versions_connection_idempotency_policy.h index 354d10df0f1b0..3c51d65d8625b 100644 --- a/google/cloud/appengine/v1/versions_connection_idempotency_policy.h +++ b/google/cloud/appengine/v1/versions_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/appengine/v1/appengine.grpc.pb.h" #include namespace google { diff --git a/google/cloud/appengine/versions_client.h b/google/cloud/appengine/versions_client.h deleted file mode 100644 index 444c53df2a3bb..0000000000000 --- a/google/cloud/appengine/versions_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_VERSIONS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_VERSIONS_CLIENT_H - -#include "google/cloud/appengine/v1/versions_client.h" -#include "google/cloud/appengine/versions_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in appengine_v1 instead of the aliases defined in -/// this namespace. -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::VersionsClient directly. -using ::google::cloud::appengine_v1::VersionsClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_VERSIONS_CLIENT_H diff --git a/google/cloud/appengine/versions_connection.h b/google/cloud/appengine/versions_connection.h deleted file mode 100644 index d91e582a9901b..0000000000000 --- a/google/cloud/appengine/versions_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_VERSIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_VERSIONS_CONNECTION_H - -#include "google/cloud/appengine/v1/versions_connection.h" -#include "google/cloud/appengine/versions_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::MakeVersionsConnection directly. -using ::google::cloud::appengine_v1::MakeVersionsConnection; - -/// @deprecated Use appengine_v1::VersionsConnection directly. -using ::google::cloud::appengine_v1::VersionsConnection; - -/// @deprecated Use appengine_v1::VersionsLimitedErrorCountRetryPolicy directly. -using ::google::cloud::appengine_v1::VersionsLimitedErrorCountRetryPolicy; - -/// @deprecated Use appengine_v1::VersionsLimitedTimeRetryPolicy directly. -using ::google::cloud::appengine_v1::VersionsLimitedTimeRetryPolicy; - -/// @deprecated Use appengine_v1::VersionsRetryPolicy directly. -using ::google::cloud::appengine_v1::VersionsRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_VERSIONS_CONNECTION_H diff --git a/google/cloud/appengine/versions_connection_idempotency_policy.h b/google/cloud/appengine/versions_connection_idempotency_policy.h deleted file mode 100644 index f7f65b87f14f7..0000000000000 --- a/google/cloud/appengine/versions_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_VERSIONS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_VERSIONS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/appengine/v1/versions_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::MakeDefaultVersionsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::appengine_v1:: - MakeDefaultVersionsConnectionIdempotencyPolicy; - -/// @deprecated Use appengine_v1::VersionsConnectionIdempotencyPolicy directly. -using ::google::cloud::appengine_v1::VersionsConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_VERSIONS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/appengine/versions_options.h b/google/cloud/appengine/versions_options.h deleted file mode 100644 index 4add537e75c43..0000000000000 --- a/google/cloud/appengine/versions_options.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/appengine/v1/appengine.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_VERSIONS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_VERSIONS_OPTIONS_H - -#include "google/cloud/appengine/v1/versions_options.h" -#include "google/cloud/appengine/versions_connection.h" -#include "google/cloud/appengine/versions_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace appengine { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use appengine_v1::VersionsPollingPolicyOption directly. -using ::google::cloud::appengine_v1::VersionsPollingPolicyOption; - -/// @deprecated Use appengine_v1::VersionsBackoffPolicyOption directly. -using ::google::cloud::appengine_v1::VersionsBackoffPolicyOption; - -/// @deprecated Use appengine_v1::VersionsConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::appengine_v1::VersionsConnectionIdempotencyPolicyOption; - -/// @deprecated Use appengine_v1::VersionsPolicyOptionList directly. -using ::google::cloud::appengine_v1::VersionsPolicyOptionList; - -/// @deprecated Use appengine_v1::VersionsRetryPolicyOption directly. -using ::google::cloud::appengine_v1::VersionsRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace appengine -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPENGINE_VERSIONS_OPTIONS_H diff --git a/google/cloud/apphub/BUILD.bazel b/google/cloud/apphub/BUILD.bazel index 61ab437e885b4..a65ea4dbdfe27 100644 --- a/google/cloud/apphub/BUILD.bazel +++ b/google/cloud/apphub/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/apphub/v1:apphub_cc_grpc", + "@googleapis//google/cloud/apphub/v1:apphub_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/apphub/quickstart/.bazelrc b/google/cloud/apphub/quickstart/.bazelrc index 15d5c055db074..343e7f623d628 100644 --- a/google/cloud/apphub/quickstart/.bazelrc +++ b/google/cloud/apphub/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/apphub/quickstart/CMakeLists.txt index 61300202b466f..acffa96eb4b18 100644 --- a/google/cloud/apphub/quickstart/CMakeLists.txt +++ b/google/cloud/apphub/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the App Hub API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-apphub-quickstart CXX) find_package(google_cloud_cpp_apphub REQUIRED) diff --git a/google/cloud/apphub/quickstart/WORKSPACE.bazel b/google/cloud/apphub/quickstart/WORKSPACE.bazel index 536f2b70ba122..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 = "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/apphub/v1/app_hub_client.h b/google/cloud/apphub/v1/app_hub_client.h index 24a8b45035896..01d9a25501884 100644 --- a/google/cloud/apphub/v1/app_hub_client.h +++ b/google/cloud/apphub/v1/app_hub_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/apphub/v1/app_hub_connection.h b/google/cloud/apphub/v1/app_hub_connection.h index 489c3fd7ad31c..7c8d508ba4601 100644 --- a/google/cloud/apphub/v1/app_hub_connection.h +++ b/google/cloud/apphub/v1/app_hub_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPHUB_V1_APP_HUB_CONNECTION_H #include "google/cloud/apphub/v1/app_hub_connection_idempotency_policy.h" +#include "google/cloud/apphub/v1/apphub_service.pb.h" #include "google/cloud/apphub/v1/internal/app_hub_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/apphub/v1/app_hub_connection_idempotency_policy.h b/google/cloud/apphub/v1/app_hub_connection_idempotency_policy.h index 3d336bb2f2b3d..4e2e20f3419d3 100644 --- a/google/cloud/apphub/v1/app_hub_connection_idempotency_policy.h +++ b/google/cloud/apphub/v1/app_hub_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPHUB_V1_APP_HUB_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPHUB_V1_APP_HUB_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/apphub/v1/apphub_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/apphub/v1/internal/app_hub_auth_decorator.cc b/google/cloud/apphub/v1/internal/app_hub_auth_decorator.cc index f89ae3524161a..5cba34db0d79b 100644 --- a/google/cloud/apphub/v1/internal/app_hub_auth_decorator.cc +++ b/google/cloud/apphub/v1/internal/app_hub_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/apphub/v1/apphub_service.proto #include "google/cloud/apphub/v1/internal/app_hub_auth_decorator.h" -#include +#include "google/cloud/apphub/v1/apphub_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apphub_v1_internal { @@ -601,3 +604,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apphub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apphub/v1/internal/app_hub_auth_decorator.h b/google/cloud/apphub/v1/internal/app_hub_auth_decorator.h index 92f90eb7169b3..47a0202f9722c 100644 --- a/google/cloud/apphub/v1/internal/app_hub_auth_decorator.h +++ b/google/cloud/apphub/v1/internal/app_hub_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/apphub/v1/internal/app_hub_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 apphub_v1_internal { @@ -302,4 +305,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPHUB_V1_INTERNAL_APP_HUB_AUTH_DECORATOR_H diff --git a/google/cloud/apphub/v1/internal/app_hub_connection_impl.h b/google/cloud/apphub/v1/internal/app_hub_connection_impl.h index b8d2914b1835f..42facde00c007 100644 --- a/google/cloud/apphub/v1/internal/app_hub_connection_impl.h +++ b/google/cloud/apphub/v1/internal/app_hub_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/apphub/v1/internal/app_hub_logging_decorator.cc b/google/cloud/apphub/v1/internal/app_hub_logging_decorator.cc index 4e061a1aede07..dac8dd1579382 100644 --- a/google/cloud/apphub/v1/internal/app_hub_logging_decorator.cc +++ b/google/cloud/apphub/v1/internal/app_hub_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/apphub/v1/apphub_service.proto #include "google/cloud/apphub/v1/internal/app_hub_logging_decorator.h" +#include "google/cloud/apphub/v1/apphub_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apphub_v1_internal { @@ -721,3 +724,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apphub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apphub/v1/internal/app_hub_logging_decorator.h b/google/cloud/apphub/v1/internal/app_hub_logging_decorator.h index b5d2debd42155..5f611aa8718dc 100644 --- a/google/cloud/apphub/v1/internal/app_hub_logging_decorator.h +++ b/google/cloud/apphub/v1/internal/app_hub_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/apphub/v1/internal/app_hub_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 apphub_v1_internal { @@ -302,4 +305,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPHUB_V1_INTERNAL_APP_HUB_LOGGING_DECORATOR_H diff --git a/google/cloud/apphub/v1/internal/app_hub_metadata_decorator.cc b/google/cloud/apphub/v1/internal/app_hub_metadata_decorator.cc index f397482b69e0f..dc237eb4aefa0 100644 --- a/google/cloud/apphub/v1/internal/app_hub_metadata_decorator.cc +++ b/google/cloud/apphub/v1/internal/app_hub_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/apphub/v1/apphub_service.proto #include "google/cloud/apphub/v1/internal/app_hub_metadata_decorator.h" +#include "google/cloud/apphub/v1/apphub_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 apphub_v1_internal { @@ -539,3 +543,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apphub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apphub/v1/internal/app_hub_metadata_decorator.h b/google/cloud/apphub/v1/internal/app_hub_metadata_decorator.h index 38c91580bd843..3f03bfbfa12d3 100644 --- a/google/cloud/apphub/v1/internal/app_hub_metadata_decorator.h +++ b/google/cloud/apphub/v1/internal/app_hub_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/apphub/v1/internal/app_hub_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 apphub_v1_internal { @@ -307,4 +310,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPHUB_V1_INTERNAL_APP_HUB_METADATA_DECORATOR_H diff --git a/google/cloud/apphub/v1/internal/app_hub_option_defaults.cc b/google/cloud/apphub/v1/internal/app_hub_option_defaults.cc index 999b8f4458dc5..838b00c6a1c11 100644 --- a/google/cloud/apphub/v1/internal/app_hub_option_defaults.cc +++ b/google/cloud/apphub/v1/internal/app_hub_option_defaults.cc @@ -40,7 +40,7 @@ Options AppHubDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - apphub_v1::AppHubLimitedTimeRetryPolicy(std::chrono::minutes(30)) + apphub_v1::AppHubLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/apphub/v1/internal/app_hub_stub.cc b/google/cloud/apphub/v1/internal/app_hub_stub.cc index d8e5fcbfbcc84..fbb62039bf0af 100644 --- a/google/cloud/apphub/v1/internal/app_hub_stub.cc +++ b/google/cloud/apphub/v1/internal/app_hub_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/apphub/v1/apphub_service.proto #include "google/cloud/apphub/v1/internal/app_hub_stub.h" +#include "google/cloud/apphub/v1/apphub_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apphub_v1_internal { @@ -710,3 +713,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apphub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apphub/v1/internal/app_hub_stub.h b/google/cloud/apphub/v1/internal/app_hub_stub.h index ab5ee09d662cf..fe9005467eda7 100644 --- a/google/cloud/apphub/v1/internal/app_hub_stub.h +++ b/google/cloud/apphub/v1/internal/app_hub_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPHUB_V1_INTERNAL_APP_HUB_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPHUB_V1_INTERNAL_APP_HUB_STUB_H +#include "google/cloud/apphub/v1/apphub_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 -#include -#include -#include +#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 apphub_v1_internal { @@ -584,4 +587,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPHUB_V1_INTERNAL_APP_HUB_STUB_H diff --git a/google/cloud/apphub/v1/internal/app_hub_stub_factory.cc b/google/cloud/apphub/v1/internal/app_hub_stub_factory.cc index b514ecadaa409..b56c9aa3baca6 100644 --- a/google/cloud/apphub/v1/internal/app_hub_stub_factory.cc +++ b/google/cloud/apphub/v1/internal/app_hub_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/apphub/v1/apphub_service.proto #include "google/cloud/apphub/v1/internal/app_hub_stub_factory.h" +#include "google/cloud/apphub/v1/apphub_service.grpc.pb.h" #include "google/cloud/apphub/v1/internal/app_hub_auth_decorator.h" #include "google/cloud/apphub/v1/internal/app_hub_logging_decorator.h" #include "google/cloud/apphub/v1/internal/app_hub_metadata_decorator.h" #include "google/cloud/apphub/v1/internal/app_hub_stub.h" #include "google/cloud/apphub/v1/internal/app_hub_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 -#include -#include -#include +#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 apphub_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apphub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apphub/v1/internal/app_hub_stub_factory.h b/google/cloud/apphub/v1/internal/app_hub_stub_factory.h index 118e284c42b64..b8a8620f22b9b 100644 --- a/google/cloud/apphub/v1/internal/app_hub_stub_factory.h +++ b/google/cloud/apphub/v1/internal/app_hub_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apphub_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPHUB_V1_INTERNAL_APP_HUB_STUB_FACTORY_H diff --git a/google/cloud/apphub/v1/internal/app_hub_tracing_connection.cc b/google/cloud/apphub/v1/internal/app_hub_tracing_connection.cc index e2e0c310b8dbe..03437e3257091 100644 --- a/google/cloud/apphub/v1/internal/app_hub_tracing_connection.cc +++ b/google/cloud/apphub/v1/internal/app_hub_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace apphub_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AppHubTracingConnection::AppHubTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -572,15 +570,11 @@ Status AppHubTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAppHubTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/apphub/v1/internal/app_hub_tracing_connection.h b/google/cloud/apphub/v1/internal/app_hub_tracing_connection.h index 151167469297c..18359565d92a4 100644 --- a/google/cloud/apphub/v1/internal/app_hub_tracing_connection.h +++ b/google/cloud/apphub/v1/internal/app_hub_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace apphub_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AppHubTracingConnection : public apphub_v1::AppHubConnection { public: ~AppHubTracingConnection() override = default; @@ -260,8 +258,6 @@ class AppHubTracingConnection : public apphub_v1::AppHubConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/apphub/v1/internal/app_hub_tracing_stub.cc b/google/cloud/apphub/v1/internal/app_hub_tracing_stub.cc index 34b45ce686409..37554ad451759 100644 --- a/google/cloud/apphub/v1/internal/app_hub_tracing_stub.cc +++ b/google/cloud/apphub/v1/internal/app_hub_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apphub_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AppHubTracingStub::AppHubTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -654,18 +655,14 @@ future AppHubTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAppHubTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace apphub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/apphub/v1/internal/app_hub_tracing_stub.h b/google/cloud/apphub/v1/internal/app_hub_tracing_stub.h index 76147543c3b67..82c28f060b8e3 100644 --- a/google/cloud/apphub/v1/internal/app_hub_tracing_stub.h +++ b/google/cloud/apphub/v1/internal/app_hub_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace apphub_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AppHubTracingStub : public AppHubStub { public: ~AppHubTracingStub() override = default; @@ -297,8 +298,6 @@ class AppHubTracingStub : public AppHubStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -313,4 +312,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_APPHUB_V1_INTERNAL_APP_HUB_TRACING_STUB_H diff --git a/google/cloud/artifactregistry/BUILD.bazel b/google/cloud/artifactregistry/BUILD.bazel index 9d4f9177dd000..9c5047fdf4f91 100644 --- a/google/cloud/artifactregistry/BUILD.bazel +++ b/google/cloud/artifactregistry/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/devtools/artifactregistry/v1:artifactregistry_cc_grpc", + "@googleapis//google/devtools/artifactregistry/v1:artifactregistry_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/artifactregistry/CMakeLists.txt b/google/cloud/artifactregistry/CMakeLists.txt index 4a64078b3e0bd..e72cdb91cd067 100644 --- a/google/cloud/artifactregistry/CMakeLists.txt +++ b/google/cloud/artifactregistry/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(artifactregistry "Artifact Registry API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(artifactregistry_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/artifactregistry/artifact_registry_client.h b/google/cloud/artifactregistry/artifact_registry_client.h deleted file mode 100644 index a63dd317061c1..0000000000000 --- a/google/cloud/artifactregistry/artifact_registry_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/artifactregistry/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_ARTIFACT_REGISTRY_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_ARTIFACT_REGISTRY_CLIENT_H - -#include "google/cloud/artifactregistry/artifact_registry_connection.h" -#include "google/cloud/artifactregistry/v1/artifact_registry_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in artifactregistry_v1 instead of the aliases defined in -/// this namespace. -namespace artifactregistry { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use artifactregistry_v1::ArtifactRegistryClient directly. -using ::google::cloud::artifactregistry_v1::ArtifactRegistryClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace artifactregistry -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_ARTIFACT_REGISTRY_CLIENT_H diff --git a/google/cloud/artifactregistry/artifact_registry_connection.h b/google/cloud/artifactregistry/artifact_registry_connection.h deleted file mode 100644 index 079d726ba150c..0000000000000 --- a/google/cloud/artifactregistry/artifact_registry_connection.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/artifactregistry/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_ARTIFACT_REGISTRY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_ARTIFACT_REGISTRY_CONNECTION_H - -#include "google/cloud/artifactregistry/artifact_registry_connection_idempotency_policy.h" -#include "google/cloud/artifactregistry/v1/artifact_registry_connection.h" - -namespace google { -namespace cloud { -namespace artifactregistry { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use artifactregistry_v1::MakeArtifactRegistryConnection -/// directly. -using ::google::cloud::artifactregistry_v1::MakeArtifactRegistryConnection; - -/// @deprecated Use artifactregistry_v1::ArtifactRegistryConnection directly. -using ::google::cloud::artifactregistry_v1::ArtifactRegistryConnection; - -/// @deprecated Use -/// artifactregistry_v1::ArtifactRegistryLimitedErrorCountRetryPolicy directly. -using ::google::cloud::artifactregistry_v1:: - ArtifactRegistryLimitedErrorCountRetryPolicy; - -/// @deprecated Use artifactregistry_v1::ArtifactRegistryLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::artifactregistry_v1:: - ArtifactRegistryLimitedTimeRetryPolicy; - -/// @deprecated Use artifactregistry_v1::ArtifactRegistryRetryPolicy directly. -using ::google::cloud::artifactregistry_v1::ArtifactRegistryRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace artifactregistry -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_ARTIFACT_REGISTRY_CONNECTION_H diff --git a/google/cloud/artifactregistry/artifact_registry_connection_idempotency_policy.h b/google/cloud/artifactregistry/artifact_registry_connection_idempotency_policy.h deleted file mode 100644 index 2db4d00926e5c..0000000000000 --- a/google/cloud/artifactregistry/artifact_registry_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/artifactregistry/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_ARTIFACT_REGISTRY_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_ARTIFACT_REGISTRY_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/artifactregistry/v1/artifact_registry_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace artifactregistry { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// artifactregistry_v1::MakeDefaultArtifactRegistryConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::artifactregistry_v1:: - MakeDefaultArtifactRegistryConnectionIdempotencyPolicy; - -/// @deprecated Use -/// artifactregistry_v1::ArtifactRegistryConnectionIdempotencyPolicy directly. -using ::google::cloud::artifactregistry_v1:: - ArtifactRegistryConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace artifactregistry -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_ARTIFACT_REGISTRY_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/artifactregistry/artifact_registry_options.h b/google/cloud/artifactregistry/artifact_registry_options.h deleted file mode 100644 index ebc600d81af0b..0000000000000 --- a/google/cloud/artifactregistry/artifact_registry_options.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/artifactregistry/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_ARTIFACT_REGISTRY_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_ARTIFACT_REGISTRY_OPTIONS_H - -#include "google/cloud/artifactregistry/artifact_registry_connection.h" -#include "google/cloud/artifactregistry/artifact_registry_connection_idempotency_policy.h" -#include "google/cloud/artifactregistry/v1/artifact_registry_options.h" - -namespace google { -namespace cloud { -namespace artifactregistry { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use artifactregistry_v1::ArtifactRegistryPollingPolicyOption -/// directly. -using ::google::cloud::artifactregistry_v1::ArtifactRegistryPollingPolicyOption; - -/// @deprecated Use artifactregistry_v1::ArtifactRegistryBackoffPolicyOption -/// directly. -using ::google::cloud::artifactregistry_v1::ArtifactRegistryBackoffPolicyOption; - -/// @deprecated Use -/// artifactregistry_v1::ArtifactRegistryConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::artifactregistry_v1:: - ArtifactRegistryConnectionIdempotencyPolicyOption; - -/// @deprecated Use artifactregistry_v1::ArtifactRegistryPolicyOptionList -/// directly. -using ::google::cloud::artifactregistry_v1::ArtifactRegistryPolicyOptionList; - -/// @deprecated Use artifactregistry_v1::ArtifactRegistryRetryPolicyOption -/// directly. -using ::google::cloud::artifactregistry_v1::ArtifactRegistryRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace artifactregistry -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_ARTIFACT_REGISTRY_OPTIONS_H diff --git a/google/cloud/artifactregistry/mocks/mock_artifact_registry_connection.h b/google/cloud/artifactregistry/mocks/mock_artifact_registry_connection.h deleted file mode 100644 index 76c73ef319623..0000000000000 --- a/google/cloud/artifactregistry/mocks/mock_artifact_registry_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/artifactregistry/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_MOCKS_MOCK_ARTIFACT_REGISTRY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_MOCKS_MOCK_ARTIFACT_REGISTRY_CONNECTION_H - -#include "google/cloud/artifactregistry/artifact_registry_connection.h" -#include "google/cloud/artifactregistry/v1/mocks/mock_artifact_registry_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in artifactregistry_v1_mocks instead of the aliases -/// defined in this namespace. -namespace artifactregistry_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use artifactregistry_v1_mocks::MockArtifactRegistryConnection -/// directly. -using ::google::cloud::artifactregistry_v1_mocks:: - MockArtifactRegistryConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace artifactregistry_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_MOCKS_MOCK_ARTIFACT_REGISTRY_CONNECTION_H diff --git a/google/cloud/artifactregistry/quickstart/.bazelrc b/google/cloud/artifactregistry/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/artifactregistry/quickstart/.bazelrc +++ b/google/cloud/artifactregistry/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/artifactregistry/quickstart/CMakeLists.txt index a4726e8ee6973..3d9736a372ee2 100644 --- a/google/cloud/artifactregistry/quickstart/CMakeLists.txt +++ b/google/cloud/artifactregistry/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Artifact Registry API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-artifactregistry-quickstart CXX) find_package(google_cloud_cpp_artifactregistry REQUIRED) diff --git a/google/cloud/artifactregistry/quickstart/WORKSPACE.bazel b/google/cloud/artifactregistry/quickstart/WORKSPACE.bazel index ed044672b7fe8..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 = "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/artifactregistry/v1/artifact_registry_client.h b/google/cloud/artifactregistry/v1/artifact_registry_client.h index ff75c8bdcb4ac..766826ef6e5c4 100644 --- a/google/cloud/artifactregistry/v1/artifact_registry_client.h +++ b/google/cloud/artifactregistry/v1/artifact_registry_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -1936,8 +1936,8 @@ class ArtifactRegistryClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.devtools.artifactregistry.v1.File]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L54} - /// [google.devtools.artifactregistry.v1.ListFilesRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L92} + /// [google.devtools.artifactregistry.v1.File]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L57} + /// [google.devtools.artifactregistry.v1.ListFilesRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L95} /// // clang-format on StreamRange ListFiles( @@ -1975,8 +1975,8 @@ class ArtifactRegistryClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.devtools.artifactregistry.v1.File]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L54} - /// [google.devtools.artifactregistry.v1.ListFilesRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L92} + /// [google.devtools.artifactregistry.v1.File]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L57} + /// [google.devtools.artifactregistry.v1.ListFilesRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L95} /// // clang-format on StreamRange ListFiles( @@ -2001,8 +2001,8 @@ class ArtifactRegistryClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.devtools.artifactregistry.v1.File]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L54} - /// [google.devtools.artifactregistry.v1.GetFileRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L175} + /// [google.devtools.artifactregistry.v1.File]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L57} + /// [google.devtools.artifactregistry.v1.GetFileRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L178} /// // clang-format on StatusOr GetFile( @@ -2031,8 +2031,8 @@ class ArtifactRegistryClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.devtools.artifactregistry.v1.File]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L54} - /// [google.devtools.artifactregistry.v1.GetFileRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L175} + /// [google.devtools.artifactregistry.v1.File]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L57} + /// [google.devtools.artifactregistry.v1.GetFileRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L178} /// // clang-format on StatusOr GetFile( @@ -2066,7 +2066,7 @@ class ArtifactRegistryClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.devtools.artifactregistry.v1.DeleteFileRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L186} + /// [google.devtools.artifactregistry.v1.DeleteFileRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L189} /// [google.devtools.artifactregistry.v1.OperationMetadata]: @googleapis_reference_link{google/devtools/artifactregistry/v1/service.proto#L561} /// // clang-format on @@ -2120,7 +2120,7 @@ class ArtifactRegistryClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.devtools.artifactregistry.v1.DeleteFileRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L186} + /// [google.devtools.artifactregistry.v1.DeleteFileRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L189} /// [google.devtools.artifactregistry.v1.OperationMetadata]: @googleapis_reference_link{google/devtools/artifactregistry/v1/service.proto#L561} /// // clang-format on @@ -2179,8 +2179,8 @@ class ArtifactRegistryClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.devtools.artifactregistry.v1.File]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L54} - /// [google.devtools.artifactregistry.v1.UpdateFileRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L197} + /// [google.devtools.artifactregistry.v1.File]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L57} + /// [google.devtools.artifactregistry.v1.UpdateFileRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L200} /// // clang-format on StatusOr UpdateFile( @@ -2210,8 +2210,8 @@ class ArtifactRegistryClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.devtools.artifactregistry.v1.File]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L54} - /// [google.devtools.artifactregistry.v1.UpdateFileRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L197} + /// [google.devtools.artifactregistry.v1.File]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L57} + /// [google.devtools.artifactregistry.v1.UpdateFileRequest]: @googleapis_reference_link{google/devtools/artifactregistry/v1/file.proto#L200} /// // clang-format on StatusOr UpdateFile( diff --git a/google/cloud/artifactregistry/v1/artifact_registry_connection.h b/google/cloud/artifactregistry/v1/artifact_registry_connection.h index e52570702f305..16cb13bc4eb43 100644 --- a/google/cloud/artifactregistry/v1/artifact_registry_connection.h +++ b/google/cloud/artifactregistry/v1/artifact_registry_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/devtools/artifactregistry/v1/service.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/artifactregistry/v1/artifact_registry_connection_idempotency_policy.h b/google/cloud/artifactregistry/v1/artifact_registry_connection_idempotency_policy.h index ac52cc868894f..dcf1306ffaaa5 100644 --- a/google/cloud/artifactregistry/v1/artifact_registry_connection_idempotency_policy.h +++ b/google/cloud/artifactregistry/v1/artifact_registry_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_V1_ARTIFACT_REGISTRY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_V1_ARTIFACT_REGISTRY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/devtools/artifactregistry/v1/service.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_auth_decorator.cc b/google/cloud/artifactregistry/v1/internal/artifact_registry_auth_decorator.cc index bd6a1a5604a60..24bb94198a297 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_auth_decorator.cc +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/devtools/artifactregistry/v1/service.proto #include "google/cloud/artifactregistry/v1/internal/artifact_registry_auth_decorator.h" -#include +#include "google/devtools/artifactregistry/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace artifactregistry_v1_internal { @@ -795,3 +798,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace artifactregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_auth_decorator.h b/google/cloud/artifactregistry/v1/internal/artifact_registry_auth_decorator.h index 3c33874c115c4..17431717ffd53 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_auth_decorator.h +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/artifactregistry/v1/internal/artifact_registry_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 artifactregistry_v1_internal { @@ -410,4 +413,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_V1_INTERNAL_ARTIFACT_REGISTRY_AUTH_DECORATOR_H diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_connection_impl.h b/google/cloud/artifactregistry/v1/internal/artifact_registry_connection_impl.h index d6a92b605b6c2..cd6d8c20db250 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_connection_impl.h +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_logging_decorator.cc b/google/cloud/artifactregistry/v1/internal/artifact_registry_logging_decorator.cc index 82b32dc7e282f..e854892109191 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_logging_decorator.cc +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/artifactregistry/v1/internal/artifact_registry_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/devtools/artifactregistry/v1/service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace artifactregistry_v1_internal { @@ -1016,3 +1019,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace artifactregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_logging_decorator.h b/google/cloud/artifactregistry/v1/internal/artifact_registry_logging_decorator.h index 92eb7533b044e..bdc0fd31a8a1e 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_logging_decorator.h +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/artifactregistry/v1/internal/artifact_registry_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 artifactregistry_v1_internal { @@ -410,4 +413,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_V1_INTERNAL_ARTIFACT_REGISTRY_LOGGING_DECORATOR_H diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_metadata_decorator.cc b/google/cloud/artifactregistry/v1/internal/artifact_registry_metadata_decorator.cc index e1ee2b3576f01..a1671c13c0d5d 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_metadata_decorator.cc +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/artifactregistry/v1/internal/artifact_registry_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/devtools/artifactregistry/v1/service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace artifactregistry_v1_internal { @@ -742,3 +746,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace artifactregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_metadata_decorator.h b/google/cloud/artifactregistry/v1/internal/artifact_registry_metadata_decorator.h index c64bb2e855a29..12527a16f6198 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_metadata_decorator.h +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/artifactregistry/v1/internal/artifact_registry_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 artifactregistry_v1_internal { @@ -416,4 +419,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_V1_INTERNAL_ARTIFACT_REGISTRY_METADATA_DECORATOR_H diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_option_defaults.cc b/google/cloud/artifactregistry/v1/internal/artifact_registry_option_defaults.cc index 7a990fe3b07c4..2f258686271ba 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_option_defaults.cc +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_option_defaults.cc @@ -42,7 +42,7 @@ Options ArtifactRegistryDefaultOptions(Options options) { if (!options.has()) { options.set( artifactregistry_v1::ArtifactRegistryLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_stub.cc b/google/cloud/artifactregistry/v1/internal/artifact_registry_stub.cc index faad75521e9c4..dfb7d9ab0a8e4 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_stub.cc +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/artifactregistry/v1/internal/artifact_registry_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/devtools/artifactregistry/v1/service.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 artifactregistry_v1_internal { @@ -961,3 +964,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace artifactregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_stub.h b/google/cloud/artifactregistry/v1/internal/artifact_registry_stub.h index a72d6812b0a15..73d2f53b75baa 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_stub.h +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_V1_INTERNAL_ARTIFACT_REGISTRY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_V1_INTERNAL_ARTIFACT_REGISTRY_STUB_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 -#include -#include +#include "google/devtools/artifactregistry/v1/service.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 artifactregistry_v1_internal { @@ -812,4 +815,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_V1_INTERNAL_ARTIFACT_REGISTRY_STUB_H diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_stub_factory.cc b/google/cloud/artifactregistry/v1/internal/artifact_registry_stub_factory.cc index 269be927b3334..bc31f298c1206 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_stub_factory.cc +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_stub_factory.cc @@ -22,18 +22,21 @@ #include "google/cloud/artifactregistry/v1/internal/artifact_registry_metadata_decorator.h" #include "google/cloud/artifactregistry/v1/internal/artifact_registry_stub.h" #include "google/cloud/artifactregistry/v1/internal/artifact_registry_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 -#include -#include +#include "google/devtools/artifactregistry/v1/service.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 artifactregistry_v1_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace artifactregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_stub_factory.h b/google/cloud/artifactregistry/v1/internal/artifact_registry_stub_factory.h index 63f3bb032a65d..43edf479d6f26 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_stub_factory.h +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace artifactregistry_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_V1_INTERNAL_ARTIFACT_REGISTRY_STUB_FACTORY_H diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_connection.cc b/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_connection.cc index a7fcd6ee45ee5..a98fa88d64c2f 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_connection.cc +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace artifactregistry_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ArtifactRegistryTracingConnection::ArtifactRegistryTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -809,16 +807,12 @@ ArtifactRegistryTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeArtifactRegistryTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_connection.h b/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_connection.h index a0b48173097c8..63426066ce15a 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_connection.h +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace artifactregistry_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ArtifactRegistryTracingConnection : public artifactregistry_v1::ArtifactRegistryConnection { public: @@ -364,8 +362,6 @@ class ArtifactRegistryTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_stub.cc b/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_stub.cc index 5cd23bf79be88..22709fe25468e 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_stub.cc +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace artifactregistry_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ArtifactRegistryTracingStub::ArtifactRegistryTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -922,18 +923,14 @@ future ArtifactRegistryTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeArtifactRegistryTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace artifactregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_stub.h b/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_stub.h index 79b07c367990b..f3d902e0345ee 100644 --- a/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_stub.h +++ b/google/cloud/artifactregistry/v1/internal/artifact_registry_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace artifactregistry_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ArtifactRegistryTracingStub : public ArtifactRegistryStub { public: ~ArtifactRegistryTracingStub() override = default; @@ -406,8 +407,6 @@ class ArtifactRegistryTracingStub : public ArtifactRegistryStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -422,4 +421,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ARTIFACTREGISTRY_V1_INTERNAL_ARTIFACT_REGISTRY_TRACING_STUB_H diff --git a/google/cloud/asset/BUILD.bazel b/google/cloud/asset/BUILD.bazel index ac20e571b2aea..d79d987e283b8 100644 --- a/google/cloud/asset/BUILD.bazel +++ b/google/cloud/asset/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/asset/v1:asset_cc_grpc", + "@googleapis//google/cloud/asset/v1:asset_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/asset/CMakeLists.txt b/google/cloud/asset/CMakeLists.txt index 6666c8fc4aae3..f79442409d31d 100644 --- a/google/cloud/asset/CMakeLists.txt +++ b/google/cloud/asset/CMakeLists.txt @@ -19,7 +19,6 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( asset "Cloud Asset API" SERVICE_DIRS - "__EMPTY__" "v1/" # orgpolicy/v**1** is used *indirectly* by google/cloud/asset, therefore # it does not appear in protolists/asset.list. In addition, it is not diff --git a/google/cloud/asset/asset_client.h b/google/cloud/asset/asset_client.h deleted file mode 100644 index bff7b3a05c1f9..0000000000000 --- a/google/cloud/asset/asset_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/asset/v1/asset_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_ASSET_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_ASSET_CLIENT_H - -#include "google/cloud/asset/asset_connection.h" -#include "google/cloud/asset/v1/asset_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in asset_v1 instead of the aliases defined in -/// this namespace. -namespace asset { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use asset_v1::AssetServiceClient directly. -using ::google::cloud::asset_v1::AssetServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace asset -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_ASSET_CLIENT_H diff --git a/google/cloud/asset/asset_connection.h b/google/cloud/asset/asset_connection.h deleted file mode 100644 index 804f1f3bd0c02..0000000000000 --- a/google/cloud/asset/asset_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/asset/v1/asset_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_ASSET_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_ASSET_CONNECTION_H - -#include "google/cloud/asset/asset_connection_idempotency_policy.h" -#include "google/cloud/asset/v1/asset_connection.h" - -namespace google { -namespace cloud { -namespace asset { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use asset_v1::MakeAssetServiceConnection directly. -using ::google::cloud::asset_v1::MakeAssetServiceConnection; - -/// @deprecated Use asset_v1::AssetServiceConnection directly. -using ::google::cloud::asset_v1::AssetServiceConnection; - -/// @deprecated Use asset_v1::AssetServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::asset_v1::AssetServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use asset_v1::AssetServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::asset_v1::AssetServiceLimitedTimeRetryPolicy; - -/// @deprecated Use asset_v1::AssetServiceRetryPolicy directly. -using ::google::cloud::asset_v1::AssetServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace asset -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_ASSET_CONNECTION_H diff --git a/google/cloud/asset/asset_connection_idempotency_policy.h b/google/cloud/asset/asset_connection_idempotency_policy.h deleted file mode 100644 index 2f34cdf3ddf67..0000000000000 --- a/google/cloud/asset/asset_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/asset/v1/asset_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_ASSET_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_ASSET_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/asset/v1/asset_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace asset { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use asset_v1::MakeDefaultAssetServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::asset_v1:: - MakeDefaultAssetServiceConnectionIdempotencyPolicy; - -/// @deprecated Use asset_v1::AssetServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::asset_v1::AssetServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace asset -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_ASSET_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/asset/asset_options.h b/google/cloud/asset/asset_options.h deleted file mode 100644 index d09b4dfd6d67b..0000000000000 --- a/google/cloud/asset/asset_options.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/asset/v1/asset_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_ASSET_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_ASSET_OPTIONS_H - -#include "google/cloud/asset/asset_connection.h" -#include "google/cloud/asset/asset_connection_idempotency_policy.h" -#include "google/cloud/asset/v1/asset_options.h" - -namespace google { -namespace cloud { -namespace asset { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use asset_v1::AssetServicePollingPolicyOption directly. -using ::google::cloud::asset_v1::AssetServicePollingPolicyOption; - -/// @deprecated Use asset_v1::AssetServiceBackoffPolicyOption directly. -using ::google::cloud::asset_v1::AssetServiceBackoffPolicyOption; - -/// @deprecated Use asset_v1::AssetServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::asset_v1::AssetServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use asset_v1::AssetServicePolicyOptionList directly. -using ::google::cloud::asset_v1::AssetServicePolicyOptionList; - -/// @deprecated Use asset_v1::AssetServiceRetryPolicyOption directly. -using ::google::cloud::asset_v1::AssetServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace asset -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_ASSET_OPTIONS_H diff --git a/google/cloud/asset/mocks/mock_asset_connection.h b/google/cloud/asset/mocks/mock_asset_connection.h deleted file mode 100644 index 5e1942dd419eb..0000000000000 --- a/google/cloud/asset/mocks/mock_asset_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/asset/v1/asset_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_MOCKS_MOCK_ASSET_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_MOCKS_MOCK_ASSET_CONNECTION_H - -#include "google/cloud/asset/asset_connection.h" -#include "google/cloud/asset/v1/mocks/mock_asset_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in asset_v1_mocks instead of the aliases -/// defined in this namespace. -namespace asset_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use asset_v1_mocks::MockAssetServiceConnection directly. -using ::google::cloud::asset_v1_mocks::MockAssetServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace asset_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_MOCKS_MOCK_ASSET_CONNECTION_H diff --git a/google/cloud/asset/quickstart/.bazelrc b/google/cloud/asset/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/asset/quickstart/.bazelrc +++ b/google/cloud/asset/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/asset/quickstart/CMakeLists.txt index 55542d1a15588..b49b78bf356a0 100644 --- a/google/cloud/asset/quickstart/CMakeLists.txt +++ b/google/cloud/asset/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Asset API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-asset-quickstart CXX) find_package(google_cloud_cpp_asset REQUIRED) diff --git a/google/cloud/asset/quickstart/WORKSPACE.bazel b/google/cloud/asset/quickstart/WORKSPACE.bazel index f51d7302c273d..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 = "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/asset/v1/asset_client.h b/google/cloud/asset/v1/asset_client.h index f57bfa95d5797..f47a0cf08ddeb 100644 --- a/google/cloud/asset/v1/asset_client.h +++ b/google/cloud/asset/v1/asset_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/asset/v1/asset_connection.h b/google/cloud/asset/v1/asset_connection.h index 0c6a555f28505..1904b68bded77 100644 --- a/google/cloud/asset/v1/asset_connection.h +++ b/google/cloud/asset/v1/asset_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_V1_ASSET_CONNECTION_H #include "google/cloud/asset/v1/asset_connection_idempotency_policy.h" +#include "google/cloud/asset/v1/asset_service.pb.h" #include "google/cloud/asset/v1/internal/asset_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/asset/v1/asset_connection_idempotency_policy.h b/google/cloud/asset/v1/asset_connection_idempotency_policy.h index 9bbf0da4f4d49..e10055a36fe01 100644 --- a/google/cloud/asset/v1/asset_connection_idempotency_policy.h +++ b/google/cloud/asset/v1/asset_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_V1_ASSET_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_V1_ASSET_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/asset/v1/asset_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/asset/v1/internal/asset_auth_decorator.cc b/google/cloud/asset/v1/internal/asset_auth_decorator.cc index 4bd1e5e57da91..12aa2d5eee41d 100644 --- a/google/cloud/asset/v1/internal/asset_auth_decorator.cc +++ b/google/cloud/asset/v1/internal/asset_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/asset/v1/asset_service.proto #include "google/cloud/asset/v1/internal/asset_auth_decorator.h" -#include +#include "google/cloud/asset/v1/asset_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace asset_v1_internal { @@ -324,3 +327,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace asset_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/asset/v1/internal/asset_auth_decorator.h b/google/cloud/asset/v1/internal/asset_auth_decorator.h index 2a6420080f586..dcc769d4fefd3 100644 --- a/google/cloud/asset/v1/internal/asset_auth_decorator.h +++ b/google/cloud/asset/v1/internal/asset_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/asset/v1/internal/asset_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 asset_v1_internal { @@ -189,4 +192,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_V1_INTERNAL_ASSET_AUTH_DECORATOR_H diff --git a/google/cloud/asset/v1/internal/asset_connection_impl.h b/google/cloud/asset/v1/internal/asset_connection_impl.h index 952f6e78b9270..b1b9a367279ef 100644 --- a/google/cloud/asset/v1/internal/asset_connection_impl.h +++ b/google/cloud/asset/v1/internal/asset_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/asset/v1/internal/asset_logging_decorator.cc b/google/cloud/asset/v1/internal/asset_logging_decorator.cc index a4aca53587acf..83adb16375fc4 100644 --- a/google/cloud/asset/v1/internal/asset_logging_decorator.cc +++ b/google/cloud/asset/v1/internal/asset_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/asset/v1/asset_service.proto #include "google/cloud/asset/v1/internal/asset_logging_decorator.h" +#include "google/cloud/asset/v1/asset_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace asset_v1_internal { @@ -409,3 +412,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace asset_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/asset/v1/internal/asset_logging_decorator.h b/google/cloud/asset/v1/internal/asset_logging_decorator.h index f84bd68791412..40b6b9b1cb6de 100644 --- a/google/cloud/asset/v1/internal/asset_logging_decorator.h +++ b/google/cloud/asset/v1/internal/asset_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/asset/v1/internal/asset_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 asset_v1_internal { @@ -189,4 +192,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_V1_INTERNAL_ASSET_LOGGING_DECORATOR_H diff --git a/google/cloud/asset/v1/internal/asset_metadata_decorator.cc b/google/cloud/asset/v1/internal/asset_metadata_decorator.cc index 90503e18cbeef..a9ca4877a88ff 100644 --- a/google/cloud/asset/v1/internal/asset_metadata_decorator.cc +++ b/google/cloud/asset/v1/internal/asset_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/asset/v1/asset_service.proto #include "google/cloud/asset/v1/internal/asset_metadata_decorator.h" +#include "google/cloud/asset/v1/asset_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 asset_v1_internal { @@ -331,3 +335,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace asset_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/asset/v1/internal/asset_metadata_decorator.h b/google/cloud/asset/v1/internal/asset_metadata_decorator.h index 0ca1f7b156daa..3f8cec6fcb2e7 100644 --- a/google/cloud/asset/v1/internal/asset_metadata_decorator.h +++ b/google/cloud/asset/v1/internal/asset_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/asset/v1/internal/asset_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 asset_v1_internal { @@ -194,4 +197,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_V1_INTERNAL_ASSET_METADATA_DECORATOR_H diff --git a/google/cloud/asset/v1/internal/asset_option_defaults.cc b/google/cloud/asset/v1/internal/asset_option_defaults.cc index 0e79630e355cc..ad9a1a66070fc 100644 --- a/google/cloud/asset/v1/internal/asset_option_defaults.cc +++ b/google/cloud/asset/v1/internal/asset_option_defaults.cc @@ -40,7 +40,7 @@ Options AssetServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - asset_v1::AssetServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + asset_v1::AssetServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/asset/v1/internal/asset_stub.cc b/google/cloud/asset/v1/internal/asset_stub.cc index def5c641f166a..47f3c2e49939e 100644 --- a/google/cloud/asset/v1/internal/asset_stub.cc +++ b/google/cloud/asset/v1/internal/asset_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/asset/v1/asset_service.proto #include "google/cloud/asset/v1/internal/asset_stub.h" +#include "google/cloud/asset/v1/asset_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace asset_v1_internal { @@ -402,3 +405,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace asset_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/asset/v1/internal/asset_stub.h b/google/cloud/asset/v1/internal/asset_stub.h index e692c365bb676..8f1f6d0571ec9 100644 --- a/google/cloud/asset/v1/internal/asset_stub.h +++ b/google/cloud/asset/v1/internal/asset_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_V1_INTERNAL_ASSET_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_V1_INTERNAL_ASSET_STUB_H +#include "google/cloud/asset/v1/asset_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace asset_v1_internal { @@ -340,4 +343,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_V1_INTERNAL_ASSET_STUB_H diff --git a/google/cloud/asset/v1/internal/asset_stub_factory.cc b/google/cloud/asset/v1/internal/asset_stub_factory.cc index c4b68909f7769..9601a6ccf3ef2 100644 --- a/google/cloud/asset/v1/internal/asset_stub_factory.cc +++ b/google/cloud/asset/v1/internal/asset_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/asset/v1/asset_service.proto #include "google/cloud/asset/v1/internal/asset_stub_factory.h" +#include "google/cloud/asset/v1/asset_service.grpc.pb.h" #include "google/cloud/asset/v1/internal/asset_auth_decorator.h" #include "google/cloud/asset/v1/internal/asset_logging_decorator.h" #include "google/cloud/asset/v1/internal/asset_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace asset_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace asset_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/asset/v1/internal/asset_stub_factory.h b/google/cloud/asset/v1/internal/asset_stub_factory.h index 6b3404bada0a3..65a7fba65a2fc 100644 --- a/google/cloud/asset/v1/internal/asset_stub_factory.h +++ b/google/cloud/asset/v1/internal/asset_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace asset_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_V1_INTERNAL_ASSET_STUB_FACTORY_H diff --git a/google/cloud/asset/v1/internal/asset_tracing_connection.cc b/google/cloud/asset/v1/internal/asset_tracing_connection.cc index 845b455cc0064..7fa1aa769298f 100644 --- a/google/cloud/asset/v1/internal/asset_tracing_connection.cc +++ b/google/cloud/asset/v1/internal/asset_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace asset_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AssetServiceTracingConnection::AssetServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -311,16 +309,12 @@ AssetServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAssetServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/asset/v1/internal/asset_tracing_connection.h b/google/cloud/asset/v1/internal/asset_tracing_connection.h index 9c530c2cf0598..27b5ed39e10d8 100644 --- a/google/cloud/asset/v1/internal/asset_tracing_connection.h +++ b/google/cloud/asset/v1/internal/asset_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace asset_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AssetServiceTracingConnection : public asset_v1::AssetServiceConnection { public: ~AssetServiceTracingConnection() override = default; @@ -153,8 +151,6 @@ class AssetServiceTracingConnection : public asset_v1::AssetServiceConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/asset/v1/internal/asset_tracing_stub.cc b/google/cloud/asset/v1/internal/asset_tracing_stub.cc index 1eacf06144070..ec035f8957950 100644 --- a/google/cloud/asset/v1/internal/asset_tracing_stub.cc +++ b/google/cloud/asset/v1/internal/asset_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace asset_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AssetServiceTracingStub::AssetServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -379,18 +380,14 @@ future AssetServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAssetServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace asset_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/asset/v1/internal/asset_tracing_stub.h b/google/cloud/asset/v1/internal/asset_tracing_stub.h index 8c7a9e4e93cac..daf4ca43a3a9e 100644 --- a/google/cloud/asset/v1/internal/asset_tracing_stub.h +++ b/google/cloud/asset/v1/internal/asset_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace asset_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AssetServiceTracingStub : public AssetServiceStub { public: ~AssetServiceTracingStub() override = default; @@ -184,8 +185,6 @@ class AssetServiceTracingStub : public AssetServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -200,4 +199,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSET_V1_INTERNAL_ASSET_TRACING_STUB_H diff --git a/google/cloud/assuredworkloads/BUILD.bazel b/google/cloud/assuredworkloads/BUILD.bazel index c37769d131870..d5f42fa943315 100644 --- a/google/cloud/assuredworkloads/BUILD.bazel +++ b/google/cloud/assuredworkloads/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/assuredworkloads/v1:assuredworkloads_cc_grpc", + "@googleapis//google/cloud/assuredworkloads/v1:assuredworkloads_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/assuredworkloads/CMakeLists.txt b/google/cloud/assuredworkloads/CMakeLists.txt index 2508a6b1afc23..000704d148d18 100644 --- a/google/cloud/assuredworkloads/CMakeLists.txt +++ b/google/cloud/assuredworkloads/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(assuredworkloads "Assured Workloads API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(assuredworkloads_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/assuredworkloads/assured_workloads_client.h b/google/cloud/assuredworkloads/assured_workloads_client.h deleted file mode 100644 index 02eca9191d101..0000000000000 --- a/google/cloud/assuredworkloads/assured_workloads_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_ASSURED_WORKLOADS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_ASSURED_WORKLOADS_CLIENT_H - -#include "google/cloud/assuredworkloads/assured_workloads_connection.h" -#include "google/cloud/assuredworkloads/v1/assured_workloads_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in assuredworkloads_v1 instead of the aliases defined in -/// this namespace. -namespace assuredworkloads { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use assuredworkloads_v1::AssuredWorkloadsServiceClient directly. -using ::google::cloud::assuredworkloads_v1::AssuredWorkloadsServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace assuredworkloads -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_ASSURED_WORKLOADS_CLIENT_H diff --git a/google/cloud/assuredworkloads/assured_workloads_connection.h b/google/cloud/assuredworkloads/assured_workloads_connection.h deleted file mode 100644 index 71bbcfe0a23da..0000000000000 --- a/google/cloud/assuredworkloads/assured_workloads_connection.h +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_ASSURED_WORKLOADS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_ASSURED_WORKLOADS_CONNECTION_H - -#include "google/cloud/assuredworkloads/assured_workloads_connection_idempotency_policy.h" -#include "google/cloud/assuredworkloads/v1/assured_workloads_connection.h" - -namespace google { -namespace cloud { -namespace assuredworkloads { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use assuredworkloads_v1::MakeAssuredWorkloadsServiceConnection -/// directly. -using ::google::cloud::assuredworkloads_v1:: - MakeAssuredWorkloadsServiceConnection; - -/// @deprecated Use assuredworkloads_v1::AssuredWorkloadsServiceConnection -/// directly. -using ::google::cloud::assuredworkloads_v1::AssuredWorkloadsServiceConnection; - -/// @deprecated Use -/// assuredworkloads_v1::AssuredWorkloadsServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::assuredworkloads_v1:: - AssuredWorkloadsServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// assuredworkloads_v1::AssuredWorkloadsServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::assuredworkloads_v1:: - AssuredWorkloadsServiceLimitedTimeRetryPolicy; - -/// @deprecated Use assuredworkloads_v1::AssuredWorkloadsServiceRetryPolicy -/// directly. -using ::google::cloud::assuredworkloads_v1::AssuredWorkloadsServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace assuredworkloads -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_ASSURED_WORKLOADS_CONNECTION_H diff --git a/google/cloud/assuredworkloads/assured_workloads_connection_idempotency_policy.h b/google/cloud/assuredworkloads/assured_workloads_connection_idempotency_policy.h deleted file mode 100644 index 904e74012f079..0000000000000 --- a/google/cloud/assuredworkloads/assured_workloads_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_ASSURED_WORKLOADS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_ASSURED_WORKLOADS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/assuredworkloads/v1/assured_workloads_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace assuredworkloads { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// assuredworkloads_v1::MakeDefaultAssuredWorkloadsServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::assuredworkloads_v1:: - MakeDefaultAssuredWorkloadsServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// assuredworkloads_v1::AssuredWorkloadsServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::assuredworkloads_v1:: - AssuredWorkloadsServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace assuredworkloads -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_ASSURED_WORKLOADS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/assuredworkloads/assured_workloads_options.h b/google/cloud/assuredworkloads/assured_workloads_options.h deleted file mode 100644 index 658ab48c70bcb..0000000000000 --- a/google/cloud/assuredworkloads/assured_workloads_options.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_ASSURED_WORKLOADS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_ASSURED_WORKLOADS_OPTIONS_H - -#include "google/cloud/assuredworkloads/assured_workloads_connection.h" -#include "google/cloud/assuredworkloads/assured_workloads_connection_idempotency_policy.h" -#include "google/cloud/assuredworkloads/v1/assured_workloads_options.h" - -namespace google { -namespace cloud { -namespace assuredworkloads { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// assuredworkloads_v1::AssuredWorkloadsServicePollingPolicyOption directly. -using ::google::cloud::assuredworkloads_v1:: - AssuredWorkloadsServicePollingPolicyOption; - -/// @deprecated Use -/// assuredworkloads_v1::AssuredWorkloadsServiceBackoffPolicyOption directly. -using ::google::cloud::assuredworkloads_v1:: - AssuredWorkloadsServiceBackoffPolicyOption; - -/// @deprecated Use -/// assuredworkloads_v1::AssuredWorkloadsServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::assuredworkloads_v1:: - AssuredWorkloadsServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use assuredworkloads_v1::AssuredWorkloadsServicePolicyOptionList -/// directly. -using ::google::cloud::assuredworkloads_v1:: - AssuredWorkloadsServicePolicyOptionList; - -/// @deprecated Use -/// assuredworkloads_v1::AssuredWorkloadsServiceRetryPolicyOption directly. -using ::google::cloud::assuredworkloads_v1:: - AssuredWorkloadsServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace assuredworkloads -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_ASSURED_WORKLOADS_OPTIONS_H diff --git a/google/cloud/assuredworkloads/mocks/mock_assured_workloads_connection.h b/google/cloud/assuredworkloads/mocks/mock_assured_workloads_connection.h deleted file mode 100644 index a3c2084eeab7b..0000000000000 --- a/google/cloud/assuredworkloads/mocks/mock_assured_workloads_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_MOCKS_MOCK_ASSURED_WORKLOADS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_MOCKS_MOCK_ASSURED_WORKLOADS_CONNECTION_H - -#include "google/cloud/assuredworkloads/assured_workloads_connection.h" -#include "google/cloud/assuredworkloads/v1/mocks/mock_assured_workloads_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in assuredworkloads_v1_mocks instead of the aliases -/// defined in this namespace. -namespace assuredworkloads_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// assuredworkloads_v1_mocks::MockAssuredWorkloadsServiceConnection directly. -using ::google::cloud::assuredworkloads_v1_mocks:: - MockAssuredWorkloadsServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace assuredworkloads_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_MOCKS_MOCK_ASSURED_WORKLOADS_CONNECTION_H diff --git a/google/cloud/assuredworkloads/quickstart/.bazelrc b/google/cloud/assuredworkloads/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/assuredworkloads/quickstart/.bazelrc +++ b/google/cloud/assuredworkloads/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/assuredworkloads/quickstart/CMakeLists.txt index bfcc9b6f27562..c6cf9373b7157 100644 --- a/google/cloud/assuredworkloads/quickstart/CMakeLists.txt +++ b/google/cloud/assuredworkloads/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Assured Workloads API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-assuredworkloads-quickstart CXX) find_package(google_cloud_cpp_assuredworkloads REQUIRED) diff --git a/google/cloud/assuredworkloads/quickstart/WORKSPACE.bazel b/google/cloud/assuredworkloads/quickstart/WORKSPACE.bazel index 7ffff38f55706..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 = "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/assuredworkloads/v1/assured_workloads_client.h b/google/cloud/assuredworkloads/v1/assured_workloads_client.h index 17ebe1cc01650..dcfcb49044b0e 100644 --- a/google/cloud/assuredworkloads/v1/assured_workloads_client.h +++ b/google/cloud/assuredworkloads/v1/assured_workloads_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/assuredworkloads/v1/assured_workloads_connection.h b/google/cloud/assuredworkloads/v1/assured_workloads_connection.h index d8cdc5787f047..4d0e8aa2d42fd 100644 --- a/google/cloud/assuredworkloads/v1/assured_workloads_connection.h +++ b/google/cloud/assuredworkloads/v1/assured_workloads_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_V1_ASSURED_WORKLOADS_CONNECTION_H #include "google/cloud/assuredworkloads/v1/assured_workloads_connection_idempotency_policy.h" +#include "google/cloud/assuredworkloads/v1/assuredworkloads.pb.h" #include "google/cloud/assuredworkloads/v1/internal/assured_workloads_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/assuredworkloads/v1/assured_workloads_connection_idempotency_policy.h b/google/cloud/assuredworkloads/v1/assured_workloads_connection_idempotency_policy.h index 291a560655c7e..2ebe27ecf146a 100644 --- a/google/cloud/assuredworkloads/v1/assured_workloads_connection_idempotency_policy.h +++ b/google/cloud/assuredworkloads/v1/assured_workloads_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_V1_ASSURED_WORKLOADS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_V1_ASSURED_WORKLOADS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/assuredworkloads/v1/assuredworkloads.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_auth_decorator.cc b/google/cloud/assuredworkloads/v1/internal/assured_workloads_auth_decorator.cc index 643f48be0ecee..b37ccc5d4ef19 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_auth_decorator.cc +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/assuredworkloads/v1/assuredworkloads.proto #include "google/cloud/assuredworkloads/v1/internal/assured_workloads_auth_decorator.h" -#include +#include "google/cloud/assuredworkloads/v1/assuredworkloads.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace assuredworkloads_v1_internal { @@ -191,3 +194,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace assuredworkloads_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_auth_decorator.h b/google/cloud/assuredworkloads/v1/internal/assured_workloads_auth_decorator.h index b45484afd1d98..41ddc6043dadf 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_auth_decorator.h +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/assuredworkloads/v1/internal/assured_workloads_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 assuredworkloads_v1_internal { @@ -125,4 +128,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_V1_INTERNAL_ASSURED_WORKLOADS_AUTH_DECORATOR_H diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_connection_impl.h b/google/cloud/assuredworkloads/v1/internal/assured_workloads_connection_impl.h index bf8d205a3df82..772759a6a371d 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_connection_impl.h +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_logging_decorator.cc b/google/cloud/assuredworkloads/v1/internal/assured_workloads_logging_decorator.cc index 139602cf7027d..ec50b8cb2d714 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_logging_decorator.cc +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/assuredworkloads/v1/assuredworkloads.proto #include "google/cloud/assuredworkloads/v1/internal/assured_workloads_logging_decorator.h" +#include "google/cloud/assuredworkloads/v1/assuredworkloads.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace assuredworkloads_v1_internal { @@ -235,3 +238,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace assuredworkloads_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_logging_decorator.h b/google/cloud/assuredworkloads/v1/internal/assured_workloads_logging_decorator.h index 300fde6d1702c..b6ce0ffcb95ee 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_logging_decorator.h +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/assuredworkloads/v1/internal/assured_workloads_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 assuredworkloads_v1_internal { @@ -125,4 +128,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_V1_INTERNAL_ASSURED_WORKLOADS_LOGGING_DECORATOR_H diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_metadata_decorator.cc b/google/cloud/assuredworkloads/v1/internal/assured_workloads_metadata_decorator.cc index 1312347835a8e..3fa10049bb922 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_metadata_decorator.cc +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/assuredworkloads/v1/assuredworkloads.proto #include "google/cloud/assuredworkloads/v1/internal/assured_workloads_metadata_decorator.h" +#include "google/cloud/assuredworkloads/v1/assuredworkloads.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 assuredworkloads_v1_internal { @@ -194,3 +198,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace assuredworkloads_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_metadata_decorator.h b/google/cloud/assuredworkloads/v1/internal/assured_workloads_metadata_decorator.h index d849d8f8cfbb9..ec6bcf9149cf9 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_metadata_decorator.h +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/assuredworkloads/v1/internal/assured_workloads_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 assuredworkloads_v1_internal { @@ -131,4 +134,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_V1_INTERNAL_ASSURED_WORKLOADS_METADATA_DECORATOR_H diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_option_defaults.cc b/google/cloud/assuredworkloads/v1/internal/assured_workloads_option_defaults.cc index 20ef27f069541..5137de60c6133 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_option_defaults.cc +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_option_defaults.cc @@ -43,7 +43,7 @@ Options AssuredWorkloadsServiceDefaultOptions(Options options) { assuredworkloads_v1::AssuredWorkloadsServiceRetryPolicyOption>()) { options.set( assuredworkloads_v1::AssuredWorkloadsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub.cc b/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub.cc index ef6ad1c12f0b6..aa610051fc898 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub.cc +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/assuredworkloads/v1/assuredworkloads.proto #include "google/cloud/assuredworkloads/v1/internal/assured_workloads_stub.h" +#include "google/cloud/assuredworkloads/v1/assuredworkloads.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace assuredworkloads_v1_internal { @@ -228,3 +231,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace assuredworkloads_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub.h b/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub.h index ec7b3e9897b3b..1ec01ba744bca 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub.h +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_V1_INTERNAL_ASSURED_WORKLOADS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_V1_INTERNAL_ASSURED_WORKLOADS_STUB_H +#include "google/cloud/assuredworkloads/v1/assuredworkloads.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace assuredworkloads_v1_internal { @@ -217,4 +220,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_V1_INTERNAL_ASSURED_WORKLOADS_STUB_H diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub_factory.cc b/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub_factory.cc index 42a8f6d9b788a..21db12f2cb1d2 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub_factory.cc +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/assuredworkloads/v1/assuredworkloads.proto #include "google/cloud/assuredworkloads/v1/internal/assured_workloads_stub_factory.h" +#include "google/cloud/assuredworkloads/v1/assuredworkloads.grpc.pb.h" #include "google/cloud/assuredworkloads/v1/internal/assured_workloads_auth_decorator.h" #include "google/cloud/assuredworkloads/v1/internal/assured_workloads_logging_decorator.h" #include "google/cloud/assuredworkloads/v1/internal/assured_workloads_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace assuredworkloads_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace assuredworkloads_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub_factory.h b/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub_factory.h index 13998f0ca84ae..5ad0391ef2119 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub_factory.h +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace assuredworkloads_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_V1_INTERNAL_ASSURED_WORKLOADS_STUB_FACTORY_H diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_connection.cc b/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_connection.cc index c761ea543cb04..9071dbaac9a78 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_connection.cc +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace assuredworkloads_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AssuredWorkloadsServiceTracingConnection:: AssuredWorkloadsServiceTracingConnection( std::shared_ptr @@ -165,18 +163,14 @@ AssuredWorkloadsServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAssuredWorkloadsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_connection.h b/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_connection.h index be933bd9dce06..b4f082c039750 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_connection.h +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace assuredworkloads_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AssuredWorkloadsServiceTracingConnection : public assuredworkloads_v1::AssuredWorkloadsServiceConnection { public: @@ -100,8 +98,6 @@ class AssuredWorkloadsServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_stub.cc b/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_stub.cc index f61ace61860f9..f9dd0ba228dc1 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_stub.cc +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace assuredworkloads_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AssuredWorkloadsServiceTracingStub::AssuredWorkloadsServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -221,19 +222,15 @@ future AssuredWorkloadsServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAssuredWorkloadsServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace assuredworkloads_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_stub.h b/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_stub.h index 2a7e2fb2ad12e..fd2beebc53e7b 100644 --- a/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_stub.h +++ b/google/cloud/assuredworkloads/v1/internal/assured_workloads_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace assuredworkloads_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AssuredWorkloadsServiceTracingStub : public AssuredWorkloadsServiceStub { public: ~AssuredWorkloadsServiceTracingStub() override = default; @@ -121,8 +122,6 @@ class AssuredWorkloadsServiceTracingStub : public AssuredWorkloadsServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -138,4 +137,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ASSUREDWORKLOADS_V1_INTERNAL_ASSURED_WORKLOADS_TRACING_STUB_H diff --git a/google/cloud/auditmanager/BUILD.bazel b/google/cloud/auditmanager/BUILD.bazel index 63115f5c8cc93..12d139ac53cd5 100644 --- a/google/cloud/auditmanager/BUILD.bazel +++ b/google/cloud/auditmanager/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/auditmanager/v1:auditmanager_cc_grpc", + "@googleapis//google/cloud/auditmanager/v1:auditmanager_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/auditmanager/quickstart/CMakeLists.txt b/google/cloud/auditmanager/quickstart/CMakeLists.txt index bf27dc65fedc1..ee787043e69a1 100644 --- a/google/cloud/auditmanager/quickstart/CMakeLists.txt +++ b/google/cloud/auditmanager/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Audit Manager API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-auditmanager-quickstart CXX) find_package(google_cloud_cpp_auditmanager REQUIRED) diff --git a/google/cloud/auditmanager/quickstart/WORKSPACE.bazel b/google/cloud/auditmanager/quickstart/WORKSPACE.bazel index 98926f7ab16a7..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 = "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/auditmanager/v1/audit_manager_client.h b/google/cloud/auditmanager/v1/audit_manager_client.h index 90ae8e707b4b1..c6d499e15d510 100644 --- a/google/cloud/auditmanager/v1/audit_manager_client.h +++ b/google/cloud/auditmanager/v1/audit_manager_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/auditmanager/v1/audit_manager_connection.h b/google/cloud/auditmanager/v1/audit_manager_connection.h index 2fe7b1b90c6be..e78fb182bd30e 100644 --- a/google/cloud/auditmanager/v1/audit_manager_connection.h +++ b/google/cloud/auditmanager/v1/audit_manager_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUDITMANAGER_V1_AUDIT_MANAGER_CONNECTION_H #include "google/cloud/auditmanager/v1/audit_manager_connection_idempotency_policy.h" +#include "google/cloud/auditmanager/v1/auditmanager.pb.h" #include "google/cloud/auditmanager/v1/internal/audit_manager_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/auditmanager/v1/audit_manager_connection_idempotency_policy.h b/google/cloud/auditmanager/v1/audit_manager_connection_idempotency_policy.h index c593e9df57759..39ff96e1f39c5 100644 --- a/google/cloud/auditmanager/v1/audit_manager_connection_idempotency_policy.h +++ b/google/cloud/auditmanager/v1/audit_manager_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUDITMANAGER_V1_AUDIT_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUDITMANAGER_V1_AUDIT_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/auditmanager/v1/auditmanager.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_auth_decorator.cc b/google/cloud/auditmanager/v1/internal/audit_manager_auth_decorator.cc index f6fc8928981a9..9f128f06c0562 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_auth_decorator.cc +++ b/google/cloud/auditmanager/v1/internal/audit_manager_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/auditmanager/v1/auditmanager.proto #include "google/cloud/auditmanager/v1/internal/audit_manager_auth_decorator.h" -#include +#include "google/cloud/auditmanager/v1/auditmanager.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace auditmanager_v1_internal { @@ -218,3 +221,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace auditmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_auth_decorator.h b/google/cloud/auditmanager/v1/internal/audit_manager_auth_decorator.h index 031879b54f61f..83d98a7112c1b 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_auth_decorator.h +++ b/google/cloud/auditmanager/v1/internal/audit_manager_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/auditmanager/v1/internal/audit_manager_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 auditmanager_v1_internal { @@ -137,4 +140,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUDITMANAGER_V1_INTERNAL_AUDIT_MANAGER_AUTH_DECORATOR_H diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_connection_impl.h b/google/cloud/auditmanager/v1/internal/audit_manager_connection_impl.h index 96198e64e0541..080613ff181e8 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_connection_impl.h +++ b/google/cloud/auditmanager/v1/internal/audit_manager_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_logging_decorator.cc b/google/cloud/auditmanager/v1/internal/audit_manager_logging_decorator.cc index 5bcff8e69f004..20c6188e40cdc 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_logging_decorator.cc +++ b/google/cloud/auditmanager/v1/internal/audit_manager_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/auditmanager/v1/auditmanager.proto #include "google/cloud/auditmanager/v1/internal/audit_manager_logging_decorator.h" +#include "google/cloud/auditmanager/v1/auditmanager.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace auditmanager_v1_internal { @@ -272,3 +275,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace auditmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_logging_decorator.h b/google/cloud/auditmanager/v1/internal/audit_manager_logging_decorator.h index f749738ac420d..605169e07cb3e 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_logging_decorator.h +++ b/google/cloud/auditmanager/v1/internal/audit_manager_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/auditmanager/v1/internal/audit_manager_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 auditmanager_v1_internal { @@ -137,4 +140,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUDITMANAGER_V1_INTERNAL_AUDIT_MANAGER_LOGGING_DECORATOR_H diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_metadata_decorator.cc b/google/cloud/auditmanager/v1/internal/audit_manager_metadata_decorator.cc index 89f29697b949c..625ccaeeba5ba 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_metadata_decorator.cc +++ b/google/cloud/auditmanager/v1/internal/audit_manager_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/auditmanager/v1/auditmanager.proto #include "google/cloud/auditmanager/v1/internal/audit_manager_metadata_decorator.h" +#include "google/cloud/auditmanager/v1/auditmanager.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 auditmanager_v1_internal { @@ -224,3 +228,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace auditmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_metadata_decorator.h b/google/cloud/auditmanager/v1/internal/audit_manager_metadata_decorator.h index f275f38596bd8..5663df261c7c7 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_metadata_decorator.h +++ b/google/cloud/auditmanager/v1/internal/audit_manager_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/auditmanager/v1/internal/audit_manager_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 auditmanager_v1_internal { @@ -142,4 +145,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUDITMANAGER_V1_INTERNAL_AUDIT_MANAGER_METADATA_DECORATOR_H diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_option_defaults.cc b/google/cloud/auditmanager/v1/internal/audit_manager_option_defaults.cc index b803e024ef737..262ab0b39ae3c 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_option_defaults.cc +++ b/google/cloud/auditmanager/v1/internal/audit_manager_option_defaults.cc @@ -42,7 +42,7 @@ Options AuditManagerDefaultOptions(Options options) { if (!options.has()) { options.set( auditmanager_v1::AuditManagerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_stub.cc b/google/cloud/auditmanager/v1/internal/audit_manager_stub.cc index f61896bd78a7d..4272cbaf3dfc1 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_stub.cc +++ b/google/cloud/auditmanager/v1/internal/audit_manager_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/auditmanager/v1/auditmanager.proto #include "google/cloud/auditmanager/v1/internal/audit_manager_stub.h" +#include "google/cloud/auditmanager/v1/auditmanager.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace auditmanager_v1_internal { @@ -268,3 +271,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace auditmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_stub.h b/google/cloud/auditmanager/v1/internal/audit_manager_stub.h index c42a7d6f93ee3..789d5311926d9 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_stub.h +++ b/google/cloud/auditmanager/v1/internal/audit_manager_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUDITMANAGER_V1_INTERNAL_AUDIT_MANAGER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUDITMANAGER_V1_INTERNAL_AUDIT_MANAGER_STUB_H +#include "google/cloud/auditmanager/v1/auditmanager.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace auditmanager_v1_internal { @@ -246,4 +249,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUDITMANAGER_V1_INTERNAL_AUDIT_MANAGER_STUB_H diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_stub_factory.cc b/google/cloud/auditmanager/v1/internal/audit_manager_stub_factory.cc index 1a8a7fd1da8f9..1bc82b028b1a5 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_stub_factory.cc +++ b/google/cloud/auditmanager/v1/internal/audit_manager_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/auditmanager/v1/auditmanager.proto #include "google/cloud/auditmanager/v1/internal/audit_manager_stub_factory.h" +#include "google/cloud/auditmanager/v1/auditmanager.grpc.pb.h" #include "google/cloud/auditmanager/v1/internal/audit_manager_auth_decorator.h" #include "google/cloud/auditmanager/v1/internal/audit_manager_logging_decorator.h" #include "google/cloud/auditmanager/v1/internal/audit_manager_metadata_decorator.h" #include "google/cloud/auditmanager/v1/internal/audit_manager_stub.h" #include "google/cloud/auditmanager/v1/internal/audit_manager_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace auditmanager_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace auditmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_stub_factory.h b/google/cloud/auditmanager/v1/internal/audit_manager_stub_factory.h index 04b92b7e1d4c5..2e09d794174f1 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_stub_factory.h +++ b/google/cloud/auditmanager/v1/internal/audit_manager_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace auditmanager_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUDITMANAGER_V1_INTERNAL_AUDIT_MANAGER_STUB_FACTORY_H diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_tracing_connection.cc b/google/cloud/auditmanager/v1/internal/audit_manager_tracing_connection.cc index 6c1e5bc8f877c..a0182ad6924dc 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_tracing_connection.cc +++ b/google/cloud/auditmanager/v1/internal/audit_manager_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace auditmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AuditManagerTracingConnection::AuditManagerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -197,16 +195,12 @@ Status AuditManagerTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAuditManagerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_tracing_connection.h b/google/cloud/auditmanager/v1/internal/audit_manager_tracing_connection.h index 830e6cfcf0733..d8161bc88f38f 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_tracing_connection.h +++ b/google/cloud/auditmanager/v1/internal/audit_manager_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace auditmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AuditManagerTracingConnection : public auditmanager_v1::AuditManagerConnection { public: @@ -105,8 +103,6 @@ class AuditManagerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_tracing_stub.cc b/google/cloud/auditmanager/v1/internal/audit_manager_tracing_stub.cc index 21766ace47208..d506097f508c5 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_tracing_stub.cc +++ b/google/cloud/auditmanager/v1/internal/audit_manager_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace auditmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AuditManagerTracingStub::AuditManagerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -251,18 +252,14 @@ future AuditManagerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAuditManagerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace auditmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/auditmanager/v1/internal/audit_manager_tracing_stub.h b/google/cloud/auditmanager/v1/internal/audit_manager_tracing_stub.h index 7a57b28457ea4..9a43afbb907a5 100644 --- a/google/cloud/auditmanager/v1/internal/audit_manager_tracing_stub.h +++ b/google/cloud/auditmanager/v1/internal/audit_manager_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace auditmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AuditManagerTracingStub : public AuditManagerStub { public: ~AuditManagerTracingStub() override = default; @@ -132,8 +133,6 @@ class AuditManagerTracingStub : public AuditManagerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -148,4 +147,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUDITMANAGER_V1_INTERNAL_AUDIT_MANAGER_TRACING_STUB_H diff --git a/google/cloud/automl/BUILD.bazel b/google/cloud/automl/BUILD.bazel index 6572061302753..2c2fffeb097d6 100644 --- a/google/cloud/automl/BUILD.bazel +++ b/google/cloud/automl/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/automl/v1:automl_cc_grpc", + "@googleapis//google/cloud/automl/v1:automl_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/automl/CMakeLists.txt b/google/cloud/automl/CMakeLists.txt index 9a1847f2d83b7..15d96c9942eb8 100644 --- a/google/cloud/automl/CMakeLists.txt +++ b/google/cloud/automl/CMakeLists.txt @@ -16,8 +16,7 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library(automl "Cloud AutoML API" - SERVICE_DIRS "__EMPTY__" "v1/") +google_cloud_cpp_add_gapic_library(automl "Cloud AutoML API" SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(automl_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/automl/auto_ml_client.h b/google/cloud/automl/auto_ml_client.h deleted file mode 100644 index e81071bc20f62..0000000000000 --- a/google/cloud/automl/auto_ml_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/automl/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_AUTO_ML_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_AUTO_ML_CLIENT_H - -#include "google/cloud/automl/auto_ml_connection.h" -#include "google/cloud/automl/v1/auto_ml_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in automl_v1 instead of the aliases defined in -/// this namespace. -namespace automl { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use automl_v1::AutoMlClient directly. -using ::google::cloud::automl_v1::AutoMlClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace automl -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_AUTO_ML_CLIENT_H diff --git a/google/cloud/automl/auto_ml_connection.h b/google/cloud/automl/auto_ml_connection.h deleted file mode 100644 index 816afb7339679..0000000000000 --- a/google/cloud/automl/auto_ml_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/automl/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_AUTO_ML_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_AUTO_ML_CONNECTION_H - -#include "google/cloud/automl/auto_ml_connection_idempotency_policy.h" -#include "google/cloud/automl/v1/auto_ml_connection.h" - -namespace google { -namespace cloud { -namespace automl { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use automl_v1::MakeAutoMlConnection directly. -using ::google::cloud::automl_v1::MakeAutoMlConnection; - -/// @deprecated Use automl_v1::AutoMlConnection directly. -using ::google::cloud::automl_v1::AutoMlConnection; - -/// @deprecated Use automl_v1::AutoMlLimitedErrorCountRetryPolicy directly. -using ::google::cloud::automl_v1::AutoMlLimitedErrorCountRetryPolicy; - -/// @deprecated Use automl_v1::AutoMlLimitedTimeRetryPolicy directly. -using ::google::cloud::automl_v1::AutoMlLimitedTimeRetryPolicy; - -/// @deprecated Use automl_v1::AutoMlRetryPolicy directly. -using ::google::cloud::automl_v1::AutoMlRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace automl -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_AUTO_ML_CONNECTION_H diff --git a/google/cloud/automl/auto_ml_connection_idempotency_policy.h b/google/cloud/automl/auto_ml_connection_idempotency_policy.h deleted file mode 100644 index a2e3d38147feb..0000000000000 --- a/google/cloud/automl/auto_ml_connection_idempotency_policy.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/automl/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_AUTO_ML_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_AUTO_ML_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/automl/v1/auto_ml_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace automl { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use automl_v1::MakeDefaultAutoMlConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::automl_v1::MakeDefaultAutoMlConnectionIdempotencyPolicy; - -/// @deprecated Use automl_v1::AutoMlConnectionIdempotencyPolicy directly. -using ::google::cloud::automl_v1::AutoMlConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace automl -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_AUTO_ML_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/automl/auto_ml_options.h b/google/cloud/automl/auto_ml_options.h deleted file mode 100644 index d78d664a98ac3..0000000000000 --- a/google/cloud/automl/auto_ml_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/automl/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_AUTO_ML_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_AUTO_ML_OPTIONS_H - -#include "google/cloud/automl/auto_ml_connection.h" -#include "google/cloud/automl/auto_ml_connection_idempotency_policy.h" -#include "google/cloud/automl/v1/auto_ml_options.h" - -namespace google { -namespace cloud { -namespace automl { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use automl_v1::AutoMlPollingPolicyOption directly. -using ::google::cloud::automl_v1::AutoMlPollingPolicyOption; - -/// @deprecated Use automl_v1::AutoMlBackoffPolicyOption directly. -using ::google::cloud::automl_v1::AutoMlBackoffPolicyOption; - -/// @deprecated Use automl_v1::AutoMlConnectionIdempotencyPolicyOption directly. -using ::google::cloud::automl_v1::AutoMlConnectionIdempotencyPolicyOption; - -/// @deprecated Use automl_v1::AutoMlPolicyOptionList directly. -using ::google::cloud::automl_v1::AutoMlPolicyOptionList; - -/// @deprecated Use automl_v1::AutoMlRetryPolicyOption directly. -using ::google::cloud::automl_v1::AutoMlRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace automl -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_AUTO_ML_OPTIONS_H diff --git a/google/cloud/automl/mocks/mock_auto_ml_connection.h b/google/cloud/automl/mocks/mock_auto_ml_connection.h deleted file mode 100644 index 37176375063a8..0000000000000 --- a/google/cloud/automl/mocks/mock_auto_ml_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/automl/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_MOCKS_MOCK_AUTO_ML_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_MOCKS_MOCK_AUTO_ML_CONNECTION_H - -#include "google/cloud/automl/auto_ml_connection.h" -#include "google/cloud/automl/v1/mocks/mock_auto_ml_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in automl_v1_mocks instead of the aliases -/// defined in this namespace. -namespace automl_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use automl_v1_mocks::MockAutoMlConnection directly. -using ::google::cloud::automl_v1_mocks::MockAutoMlConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace automl_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_MOCKS_MOCK_AUTO_ML_CONNECTION_H diff --git a/google/cloud/automl/mocks/mock_prediction_connection.h b/google/cloud/automl/mocks/mock_prediction_connection.h deleted file mode 100644 index e2ba2faf7013e..0000000000000 --- a/google/cloud/automl/mocks/mock_prediction_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/automl/v1/prediction_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_MOCKS_MOCK_PREDICTION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_MOCKS_MOCK_PREDICTION_CONNECTION_H - -#include "google/cloud/automl/prediction_connection.h" -#include "google/cloud/automl/v1/mocks/mock_prediction_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in automl_v1_mocks instead of the aliases -/// defined in this namespace. -namespace automl_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use automl_v1_mocks::MockPredictionServiceConnection directly. -using ::google::cloud::automl_v1_mocks::MockPredictionServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace automl_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_MOCKS_MOCK_PREDICTION_CONNECTION_H diff --git a/google/cloud/automl/prediction_client.h b/google/cloud/automl/prediction_client.h deleted file mode 100644 index 5539add369f4a..0000000000000 --- a/google/cloud/automl/prediction_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/automl/v1/prediction_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_PREDICTION_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_PREDICTION_CLIENT_H - -#include "google/cloud/automl/prediction_connection.h" -#include "google/cloud/automl/v1/prediction_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in automl_v1 instead of the aliases defined in -/// this namespace. -namespace automl { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use automl_v1::PredictionServiceClient directly. -using ::google::cloud::automl_v1::PredictionServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace automl -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_PREDICTION_CLIENT_H diff --git a/google/cloud/automl/prediction_connection.h b/google/cloud/automl/prediction_connection.h deleted file mode 100644 index 3191c0c3e1647..0000000000000 --- a/google/cloud/automl/prediction_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/automl/v1/prediction_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_PREDICTION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_PREDICTION_CONNECTION_H - -#include "google/cloud/automl/prediction_connection_idempotency_policy.h" -#include "google/cloud/automl/v1/prediction_connection.h" - -namespace google { -namespace cloud { -namespace automl { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use automl_v1::MakePredictionServiceConnection directly. -using ::google::cloud::automl_v1::MakePredictionServiceConnection; - -/// @deprecated Use automl_v1::PredictionServiceConnection directly. -using ::google::cloud::automl_v1::PredictionServiceConnection; - -/// @deprecated Use automl_v1::PredictionServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::automl_v1::PredictionServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use automl_v1::PredictionServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::automl_v1::PredictionServiceLimitedTimeRetryPolicy; - -/// @deprecated Use automl_v1::PredictionServiceRetryPolicy directly. -using ::google::cloud::automl_v1::PredictionServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace automl -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_PREDICTION_CONNECTION_H diff --git a/google/cloud/automl/prediction_connection_idempotency_policy.h b/google/cloud/automl/prediction_connection_idempotency_policy.h deleted file mode 100644 index c024d7fe06eea..0000000000000 --- a/google/cloud/automl/prediction_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/automl/v1/prediction_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_PREDICTION_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_PREDICTION_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/automl/v1/prediction_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace automl { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// automl_v1::MakeDefaultPredictionServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::automl_v1:: - MakeDefaultPredictionServiceConnectionIdempotencyPolicy; - -/// @deprecated Use automl_v1::PredictionServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::automl_v1::PredictionServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace automl -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_PREDICTION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/automl/prediction_options.h b/google/cloud/automl/prediction_options.h deleted file mode 100644 index d1de0bfff3371..0000000000000 --- a/google/cloud/automl/prediction_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/automl/v1/prediction_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_PREDICTION_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_PREDICTION_OPTIONS_H - -#include "google/cloud/automl/prediction_connection.h" -#include "google/cloud/automl/prediction_connection_idempotency_policy.h" -#include "google/cloud/automl/v1/prediction_options.h" - -namespace google { -namespace cloud { -namespace automl { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use automl_v1::PredictionServicePollingPolicyOption directly. -using ::google::cloud::automl_v1::PredictionServicePollingPolicyOption; - -/// @deprecated Use automl_v1::PredictionServiceBackoffPolicyOption directly. -using ::google::cloud::automl_v1::PredictionServiceBackoffPolicyOption; - -/// @deprecated Use -/// automl_v1::PredictionServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::automl_v1:: - PredictionServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use automl_v1::PredictionServicePolicyOptionList directly. -using ::google::cloud::automl_v1::PredictionServicePolicyOptionList; - -/// @deprecated Use automl_v1::PredictionServiceRetryPolicyOption directly. -using ::google::cloud::automl_v1::PredictionServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace automl -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_PREDICTION_OPTIONS_H diff --git a/google/cloud/automl/quickstart/.bazelrc b/google/cloud/automl/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/automl/quickstart/.bazelrc +++ b/google/cloud/automl/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/automl/quickstart/CMakeLists.txt index 71a80e37e26ae..27664b3628e95 100644 --- a/google/cloud/automl/quickstart/CMakeLists.txt +++ b/google/cloud/automl/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud AutoML API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-automl-quickstart CXX) find_package(google_cloud_cpp_automl REQUIRED) diff --git a/google/cloud/automl/quickstart/WORKSPACE.bazel b/google/cloud/automl/quickstart/WORKSPACE.bazel index 3fcc7ee2755f4..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 = "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/automl/v1/auto_ml_client.h b/google/cloud/automl/v1/auto_ml_client.h index f281fc2249ceb..8e6ebd5c0de89 100644 --- a/google/cloud/automl/v1/auto_ml_client.h +++ b/google/cloud/automl/v1/auto_ml_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/automl/v1/auto_ml_connection.h b/google/cloud/automl/v1/auto_ml_connection.h index c60c26cff3f95..6e866fdaa9f46 100644 --- a/google/cloud/automl/v1/auto_ml_connection.h +++ b/google/cloud/automl/v1/auto_ml_connection.h @@ -21,6 +21,8 @@ #include "google/cloud/automl/v1/auto_ml_connection_idempotency_policy.h" #include "google/cloud/automl/v1/internal/auto_ml_retry_traits.h" +#include "google/cloud/automl/v1/operations.pb.h" +#include "google/cloud/automl/v1/service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,9 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/automl/v1/auto_ml_connection_idempotency_policy.h b/google/cloud/automl/v1/auto_ml_connection_idempotency_policy.h index ef1d689d03a1d..86f76836dbf00 100644 --- a/google/cloud/automl/v1/auto_ml_connection_idempotency_policy.h +++ b/google/cloud/automl/v1/auto_ml_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_AUTO_ML_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_AUTO_ML_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/automl/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/automl/v1/internal/auto_ml_auth_decorator.cc b/google/cloud/automl/v1/internal/auto_ml_auth_decorator.cc index 36402ef6436bc..63bc129b8e966 100644 --- a/google/cloud/automl/v1/internal/auto_ml_auth_decorator.cc +++ b/google/cloud/automl/v1/internal/auto_ml_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/automl/v1/service.proto #include "google/cloud/automl/v1/internal/auto_ml_auth_decorator.h" -#include +#include "google/cloud/automl/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { @@ -389,3 +392,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace automl_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/automl/v1/internal/auto_ml_auth_decorator.h b/google/cloud/automl/v1/internal/auto_ml_auth_decorator.h index 0aaab45338c19..90f7fd21af5b9 100644 --- a/google/cloud/automl/v1/internal/auto_ml_auth_decorator.h +++ b/google/cloud/automl/v1/internal/auto_ml_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/automl/v1/internal/auto_ml_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 automl_v1_internal { @@ -191,4 +194,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_AUTO_ML_AUTH_DECORATOR_H diff --git a/google/cloud/automl/v1/internal/auto_ml_connection_impl.h b/google/cloud/automl/v1/internal/auto_ml_connection_impl.h index e005d91af56a2..35ad118282396 100644 --- a/google/cloud/automl/v1/internal/auto_ml_connection_impl.h +++ b/google/cloud/automl/v1/internal/auto_ml_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/automl/v1/internal/auto_ml_logging_decorator.cc b/google/cloud/automl/v1/internal/auto_ml_logging_decorator.cc index c52e99d512cd9..b7232a0bbc810 100644 --- a/google/cloud/automl/v1/internal/auto_ml_logging_decorator.cc +++ b/google/cloud/automl/v1/internal/auto_ml_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/automl/v1/service.proto #include "google/cloud/automl/v1/internal/auto_ml_logging_decorator.h" +#include "google/cloud/automl/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { @@ -440,3 +443,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace automl_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/automl/v1/internal/auto_ml_logging_decorator.h b/google/cloud/automl/v1/internal/auto_ml_logging_decorator.h index ea25ed6a22681..984944bdb0432 100644 --- a/google/cloud/automl/v1/internal/auto_ml_logging_decorator.h +++ b/google/cloud/automl/v1/internal/auto_ml_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/automl/v1/internal/auto_ml_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 automl_v1_internal { @@ -191,4 +194,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_AUTO_ML_LOGGING_DECORATOR_H diff --git a/google/cloud/automl/v1/internal/auto_ml_metadata_decorator.cc b/google/cloud/automl/v1/internal/auto_ml_metadata_decorator.cc index a50ef4ae42991..1e48bf8302a25 100644 --- a/google/cloud/automl/v1/internal/auto_ml_metadata_decorator.cc +++ b/google/cloud/automl/v1/internal/auto_ml_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/automl/v1/service.proto #include "google/cloud/automl/v1/internal/auto_ml_metadata_decorator.h" +#include "google/cloud/automl/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 automl_v1_internal { @@ -343,3 +347,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace automl_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/automl/v1/internal/auto_ml_metadata_decorator.h b/google/cloud/automl/v1/internal/auto_ml_metadata_decorator.h index 892dfafb9ad52..2789af4ecc02a 100644 --- a/google/cloud/automl/v1/internal/auto_ml_metadata_decorator.h +++ b/google/cloud/automl/v1/internal/auto_ml_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/automl/v1/internal/auto_ml_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 automl_v1_internal { @@ -196,4 +199,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_AUTO_ML_METADATA_DECORATOR_H diff --git a/google/cloud/automl/v1/internal/auto_ml_option_defaults.cc b/google/cloud/automl/v1/internal/auto_ml_option_defaults.cc index 1fb7694d6bcb4..202ec6458675e 100644 --- a/google/cloud/automl/v1/internal/auto_ml_option_defaults.cc +++ b/google/cloud/automl/v1/internal/auto_ml_option_defaults.cc @@ -40,7 +40,7 @@ Options AutoMlDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - automl_v1::AutoMlLimitedTimeRetryPolicy(std::chrono::minutes(30)) + automl_v1::AutoMlLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/automl/v1/internal/auto_ml_stub.cc b/google/cloud/automl/v1/internal/auto_ml_stub.cc index 4ece2a2bc4141..3c08eae1998a9 100644 --- a/google/cloud/automl/v1/internal/auto_ml_stub.cc +++ b/google/cloud/automl/v1/internal/auto_ml_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/automl/v1/service.proto #include "google/cloud/automl/v1/internal/auto_ml_stub.h" +#include "google/cloud/automl/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { @@ -439,3 +442,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace automl_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/automl/v1/internal/auto_ml_stub.h b/google/cloud/automl/v1/internal/auto_ml_stub.h index d2d9a872271d5..b0f3e71e65fdc 100644 --- a/google/cloud/automl/v1/internal/auto_ml_stub.h +++ b/google/cloud/automl/v1/internal/auto_ml_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_AUTO_ML_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_AUTO_ML_STUB_H +#include "google/cloud/automl/v1/operations.pb.h" +#include "google/cloud/automl/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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { @@ -345,4 +348,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_AUTO_ML_STUB_H diff --git a/google/cloud/automl/v1/internal/auto_ml_stub_factory.cc b/google/cloud/automl/v1/internal/auto_ml_stub_factory.cc index c836df0f52d4f..4afd64d49a51f 100644 --- a/google/cloud/automl/v1/internal/auto_ml_stub_factory.cc +++ b/google/cloud/automl/v1/internal/auto_ml_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/automl/v1/internal/auto_ml_metadata_decorator.h" #include "google/cloud/automl/v1/internal/auto_ml_stub.h" #include "google/cloud/automl/v1/internal/auto_ml_tracing_stub.h" +#include "google/cloud/automl/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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace automl_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/automl/v1/internal/auto_ml_stub_factory.h b/google/cloud/automl/v1/internal/auto_ml_stub_factory.h index b50f6fcd7fa55..3fb6983ef70f0 100644 --- a/google/cloud/automl/v1/internal/auto_ml_stub_factory.h +++ b/google/cloud/automl/v1/internal/auto_ml_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_AUTO_ML_STUB_FACTORY_H diff --git a/google/cloud/automl/v1/internal/auto_ml_tracing_connection.cc b/google/cloud/automl/v1/internal/auto_ml_tracing_connection.cc index c15b77304666b..89e0220a4c783 100644 --- a/google/cloud/automl/v1/internal/auto_ml_tracing_connection.cc +++ b/google/cloud/automl/v1/internal/auto_ml_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace automl_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AutoMlTracingConnection::AutoMlTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -323,15 +321,11 @@ AutoMlTracingConnection::ListModelEvaluations( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAutoMlTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/automl/v1/internal/auto_ml_tracing_connection.h b/google/cloud/automl/v1/internal/auto_ml_tracing_connection.h index 76bbd6b70665e..285eb2ce0b8b6 100644 --- a/google/cloud/automl/v1/internal/auto_ml_tracing_connection.h +++ b/google/cloud/automl/v1/internal/auto_ml_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace automl_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AutoMlTracingConnection : public automl_v1::AutoMlConnection { public: ~AutoMlTracingConnection() override = default; @@ -162,8 +160,6 @@ class AutoMlTracingConnection : public automl_v1::AutoMlConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/automl/v1/internal/auto_ml_tracing_stub.cc b/google/cloud/automl/v1/internal/auto_ml_tracing_stub.cc index e44dfab750e9d..f8160a0f2f014 100644 --- a/google/cloud/automl/v1/internal/auto_ml_tracing_stub.cc +++ b/google/cloud/automl/v1/internal/auto_ml_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AutoMlTracingStub::AutoMlTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -388,18 +389,14 @@ future AutoMlTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAutoMlTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace automl_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/automl/v1/internal/auto_ml_tracing_stub.h b/google/cloud/automl/v1/internal/auto_ml_tracing_stub.h index ee26bbdcc252e..83de738cf1713 100644 --- a/google/cloud/automl/v1/internal/auto_ml_tracing_stub.h +++ b/google/cloud/automl/v1/internal/auto_ml_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AutoMlTracingStub : public AutoMlStub { public: ~AutoMlTracingStub() override = default; @@ -186,8 +187,6 @@ class AutoMlTracingStub : public AutoMlStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -202,4 +201,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_AUTO_ML_TRACING_STUB_H diff --git a/google/cloud/automl/v1/internal/prediction_auth_decorator.cc b/google/cloud/automl/v1/internal/prediction_auth_decorator.cc index e1a60c5475163..735af29e2e3a6 100644 --- a/google/cloud/automl/v1/internal/prediction_auth_decorator.cc +++ b/google/cloud/automl/v1/internal/prediction_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/automl/v1/prediction_service.proto #include "google/cloud/automl/v1/internal/prediction_auth_decorator.h" -#include +#include "google/cloud/automl/v1/prediction_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { @@ -108,3 +111,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace automl_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/automl/v1/internal/prediction_auth_decorator.h b/google/cloud/automl/v1/internal/prediction_auth_decorator.h index 619ab0b3ea7b6..25d16c87b41b9 100644 --- a/google/cloud/automl/v1/internal/prediction_auth_decorator.h +++ b/google/cloud/automl/v1/internal/prediction_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/automl/v1/internal/prediction_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 automl_v1_internal { @@ -75,4 +78,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_PREDICTION_AUTH_DECORATOR_H diff --git a/google/cloud/automl/v1/internal/prediction_connection_impl.h b/google/cloud/automl/v1/internal/prediction_connection_impl.h index d9603732ff669..7754af79ff1ee 100644 --- a/google/cloud/automl/v1/internal/prediction_connection_impl.h +++ b/google/cloud/automl/v1/internal/prediction_connection_impl.h @@ -31,7 +31,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/automl/v1/internal/prediction_logging_decorator.cc b/google/cloud/automl/v1/internal/prediction_logging_decorator.cc index 9be66f2c27306..e0bd53d084af3 100644 --- a/google/cloud/automl/v1/internal/prediction_logging_decorator.cc +++ b/google/cloud/automl/v1/internal/prediction_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/automl/v1/prediction_service.proto #include "google/cloud/automl/v1/internal/prediction_logging_decorator.h" +#include "google/cloud/automl/v1/prediction_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { @@ -115,3 +118,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace automl_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/automl/v1/internal/prediction_logging_decorator.h b/google/cloud/automl/v1/internal/prediction_logging_decorator.h index 3bb4f53388c47..b64cc0144d52d 100644 --- a/google/cloud/automl/v1/internal/prediction_logging_decorator.h +++ b/google/cloud/automl/v1/internal/prediction_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/automl/v1/internal/prediction_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 automl_v1_internal { @@ -75,4 +78,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_PREDICTION_LOGGING_DECORATOR_H diff --git a/google/cloud/automl/v1/internal/prediction_metadata_decorator.cc b/google/cloud/automl/v1/internal/prediction_metadata_decorator.cc index 28155dbce58d5..6a4876d4fc154 100644 --- a/google/cloud/automl/v1/internal/prediction_metadata_decorator.cc +++ b/google/cloud/automl/v1/internal/prediction_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/automl/v1/prediction_service.proto #include "google/cloud/automl/v1/internal/prediction_metadata_decorator.h" +#include "google/cloud/automl/v1/prediction_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 automl_v1_internal { @@ -114,3 +118,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace automl_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/automl/v1/internal/prediction_metadata_decorator.h b/google/cloud/automl/v1/internal/prediction_metadata_decorator.h index 86b9fdf689b24..541e6d5f11db6 100644 --- a/google/cloud/automl/v1/internal/prediction_metadata_decorator.h +++ b/google/cloud/automl/v1/internal/prediction_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/automl/v1/internal/prediction_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 automl_v1_internal { @@ -81,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_PREDICTION_METADATA_DECORATOR_H diff --git a/google/cloud/automl/v1/internal/prediction_option_defaults.cc b/google/cloud/automl/v1/internal/prediction_option_defaults.cc index 85e6ce01e24ea..63b0db52ae3d3 100644 --- a/google/cloud/automl/v1/internal/prediction_option_defaults.cc +++ b/google/cloud/automl/v1/internal/prediction_option_defaults.cc @@ -42,7 +42,7 @@ Options PredictionServiceDefaultOptions(Options options) { if (!options.has()) { options.set( automl_v1::PredictionServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/automl/v1/internal/prediction_stub.cc b/google/cloud/automl/v1/internal/prediction_stub.cc index 3baca91123a65..5edb28f36d4af 100644 --- a/google/cloud/automl/v1/internal/prediction_stub.cc +++ b/google/cloud/automl/v1/internal/prediction_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/automl/v1/prediction_service.proto #include "google/cloud/automl/v1/internal/prediction_stub.h" +#include "google/cloud/automl/v1/prediction_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { @@ -116,3 +119,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace automl_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/automl/v1/internal/prediction_stub.h b/google/cloud/automl/v1/internal/prediction_stub.h index d7405d242a2d0..2908cd7284686 100644 --- a/google/cloud/automl/v1/internal/prediction_stub.h +++ b/google/cloud/automl/v1/internal/prediction_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_PREDICTION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_PREDICTION_STUB_H +#include "google/cloud/automl/v1/operations.pb.h" +#include "google/cloud/automl/v1/prediction_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { @@ -115,4 +118,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_PREDICTION_STUB_H diff --git a/google/cloud/automl/v1/internal/prediction_stub_factory.cc b/google/cloud/automl/v1/internal/prediction_stub_factory.cc index 8d8b371df2eeb..d0d47bee50fc3 100644 --- a/google/cloud/automl/v1/internal/prediction_stub_factory.cc +++ b/google/cloud/automl/v1/internal/prediction_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/automl/v1/internal/prediction_metadata_decorator.h" #include "google/cloud/automl/v1/internal/prediction_stub.h" #include "google/cloud/automl/v1/internal/prediction_tracing_stub.h" +#include "google/cloud/automl/v1/prediction_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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace automl_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/automl/v1/internal/prediction_stub_factory.h b/google/cloud/automl/v1/internal/prediction_stub_factory.h index cf242a5dc29ea..7f364c3ac8464 100644 --- a/google/cloud/automl/v1/internal/prediction_stub_factory.h +++ b/google/cloud/automl/v1/internal/prediction_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_PREDICTION_STUB_FACTORY_H diff --git a/google/cloud/automl/v1/internal/prediction_tracing_connection.cc b/google/cloud/automl/v1/internal/prediction_tracing_connection.cc index a4fd5f8671e28..59071f8a15dde 100644 --- a/google/cloud/automl/v1/internal/prediction_tracing_connection.cc +++ b/google/cloud/automl/v1/internal/prediction_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace automl_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PredictionServiceTracingConnection::PredictionServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -68,17 +66,13 @@ PredictionServiceTracingConnection::BatchPredict( return internal::EndSpan(std::move(span), child_->BatchPredict(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePredictionServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/automl/v1/internal/prediction_tracing_connection.h b/google/cloud/automl/v1/internal/prediction_tracing_connection.h index 899eedff39fbd..0814f9fa10ad0 100644 --- a/google/cloud/automl/v1/internal/prediction_tracing_connection.h +++ b/google/cloud/automl/v1/internal/prediction_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace automl_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PredictionServiceTracingConnection : public automl_v1::PredictionServiceConnection { public: @@ -57,8 +55,6 @@ class PredictionServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/automl/v1/internal/prediction_tracing_stub.cc b/google/cloud/automl/v1/internal/prediction_tracing_stub.cc index da96a0638ab65..ccc41beeeca11 100644 --- a/google/cloud/automl/v1/internal/prediction_tracing_stub.cc +++ b/google/cloud/automl/v1/internal/prediction_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PredictionServiceTracingStub::PredictionServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -98,18 +99,14 @@ future PredictionServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePredictionServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace automl_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/automl/v1/internal/prediction_tracing_stub.h b/google/cloud/automl/v1/internal/prediction_tracing_stub.h index 3e998964a3e1b..02cc7080edc7d 100644 --- a/google/cloud/automl/v1/internal/prediction_tracing_stub.h +++ b/google/cloud/automl/v1/internal/prediction_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace automl_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PredictionServiceTracingStub : public PredictionServiceStub { public: ~PredictionServiceTracingStub() override = default; @@ -71,8 +72,6 @@ class PredictionServiceTracingStub : public PredictionServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -87,4 +86,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_INTERNAL_PREDICTION_TRACING_STUB_H diff --git a/google/cloud/automl/v1/prediction_client.h b/google/cloud/automl/v1/prediction_client.h index 161a3e83ca66a..d65dd41f85c17 100644 --- a/google/cloud/automl/v1/prediction_client.h +++ b/google/cloud/automl/v1/prediction_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/automl/v1/prediction_connection.h b/google/cloud/automl/v1/prediction_connection.h index a17adc590b1a1..5ed238daf79d3 100644 --- a/google/cloud/automl/v1/prediction_connection.h +++ b/google/cloud/automl/v1/prediction_connection.h @@ -20,7 +20,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_PREDICTION_CONNECTION_H #include "google/cloud/automl/v1/internal/prediction_retry_traits.h" +#include "google/cloud/automl/v1/operations.pb.h" #include "google/cloud/automl/v1/prediction_connection_idempotency_policy.h" +#include "google/cloud/automl/v1/prediction_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -29,9 +31,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/automl/v1/prediction_connection_idempotency_policy.h b/google/cloud/automl/v1/prediction_connection_idempotency_policy.h index 2fbfed25ee4f6..2154f5c579054 100644 --- a/google/cloud/automl/v1/prediction_connection_idempotency_policy.h +++ b/google/cloud/automl/v1/prediction_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_PREDICTION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_AUTOML_V1_PREDICTION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/automl/v1/prediction_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/backupdr/BUILD.bazel b/google/cloud/backupdr/BUILD.bazel index 3376b9ace5870..0e6b09e36b3af 100644 --- a/google/cloud/backupdr/BUILD.bazel +++ b/google/cloud/backupdr/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/backupdr/v1:backupdr_cc_grpc", + "@googleapis//google/cloud/backupdr/v1:backupdr_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/backupdr/quickstart/.bazelrc b/google/cloud/backupdr/quickstart/.bazelrc index 15d5c055db074..343e7f623d628 100644 --- a/google/cloud/backupdr/quickstart/.bazelrc +++ b/google/cloud/backupdr/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/backupdr/quickstart/CMakeLists.txt index dbe53c9161f7d..b02302a95f2cc 100644 --- a/google/cloud/backupdr/quickstart/CMakeLists.txt +++ b/google/cloud/backupdr/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Backup and DR Service API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-backupdr-quickstart CXX) find_package(google_cloud_cpp_backupdr REQUIRED) diff --git a/google/cloud/backupdr/quickstart/WORKSPACE.bazel b/google/cloud/backupdr/quickstart/WORKSPACE.bazel index 0ea31f86160c2..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 = "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/backupdr/v1/backup_dr_client.h b/google/cloud/backupdr/v1/backup_dr_client.h index e4eefbdb5669b..a7f91c5096eac 100644 --- a/google/cloud/backupdr/v1/backup_dr_client.h +++ b/google/cloud/backupdr/v1/backup_dr_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/backupdr/v1/backup_dr_connection.h b/google/cloud/backupdr/v1/backup_dr_connection.h index 8020d4c359819..7f984ed961bd6 100644 --- a/google/cloud/backupdr/v1/backup_dr_connection.h +++ b/google/cloud/backupdr/v1/backup_dr_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BACKUPDR_V1_BACKUP_DR_CONNECTION_H #include "google/cloud/backupdr/v1/backup_dr_connection_idempotency_policy.h" +#include "google/cloud/backupdr/v1/backupdr.pb.h" #include "google/cloud/backupdr/v1/internal/backup_dr_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/backupdr/v1/backup_dr_connection_idempotency_policy.h b/google/cloud/backupdr/v1/backup_dr_connection_idempotency_policy.h index c37bcd85d7417..27439ee252e7a 100644 --- a/google/cloud/backupdr/v1/backup_dr_connection_idempotency_policy.h +++ b/google/cloud/backupdr/v1/backup_dr_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BACKUPDR_V1_BACKUP_DR_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BACKUPDR_V1_BACKUP_DR_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/backupdr/v1/backupdr.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/backupdr/v1/internal/backup_dr_auth_decorator.cc b/google/cloud/backupdr/v1/internal/backup_dr_auth_decorator.cc index bd1eb022073b9..b6c72d5388ed6 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_auth_decorator.cc +++ b/google/cloud/backupdr/v1/internal/backup_dr_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/backupdr/v1/backupdr.proto #include "google/cloud/backupdr/v1/internal/backup_dr_auth_decorator.h" -#include +#include "google/cloud/backupdr/v1/backupdr.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace backupdr_v1_internal { @@ -819,3 +822,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace backupdr_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/backupdr/v1/internal/backup_dr_auth_decorator.h b/google/cloud/backupdr/v1/internal/backup_dr_auth_decorator.h index b666398d7c113..618ff96518ce1 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_auth_decorator.h +++ b/google/cloud/backupdr/v1/internal/backup_dr_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/backupdr/v1/internal/backup_dr_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 backupdr_v1_internal { @@ -413,4 +416,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BACKUPDR_V1_INTERNAL_BACKUP_DR_AUTH_DECORATOR_H diff --git a/google/cloud/backupdr/v1/internal/backup_dr_connection_impl.h b/google/cloud/backupdr/v1/internal/backup_dr_connection_impl.h index 5fcc2e03b386f..c07a4f4aac040 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_connection_impl.h +++ b/google/cloud/backupdr/v1/internal/backup_dr_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/backupdr/v1/internal/backup_dr_logging_decorator.cc b/google/cloud/backupdr/v1/internal/backup_dr_logging_decorator.cc index 0dd4002e1b93b..6c10bbb0fc6d5 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_logging_decorator.cc +++ b/google/cloud/backupdr/v1/internal/backup_dr_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/backupdr/v1/backupdr.proto #include "google/cloud/backupdr/v1/internal/backup_dr_logging_decorator.h" +#include "google/cloud/backupdr/v1/backupdr.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace backupdr_v1_internal { @@ -983,3 +986,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace backupdr_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/backupdr/v1/internal/backup_dr_logging_decorator.h b/google/cloud/backupdr/v1/internal/backup_dr_logging_decorator.h index b7798f44fdc9f..1810d9141fdda 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_logging_decorator.h +++ b/google/cloud/backupdr/v1/internal/backup_dr_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/backupdr/v1/internal/backup_dr_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 backupdr_v1_internal { @@ -413,4 +416,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BACKUPDR_V1_INTERNAL_BACKUP_DR_LOGGING_DECORATOR_H diff --git a/google/cloud/backupdr/v1/internal/backup_dr_metadata_decorator.cc b/google/cloud/backupdr/v1/internal/backup_dr_metadata_decorator.cc index daca16070bfb4..c3b84ee2916d8 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_metadata_decorator.cc +++ b/google/cloud/backupdr/v1/internal/backup_dr_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/backupdr/v1/backupdr.proto #include "google/cloud/backupdr/v1/internal/backup_dr_metadata_decorator.h" +#include "google/cloud/backupdr/v1/backupdr.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 backupdr_v1_internal { @@ -716,3 +720,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace backupdr_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/backupdr/v1/internal/backup_dr_metadata_decorator.h b/google/cloud/backupdr/v1/internal/backup_dr_metadata_decorator.h index df1c76d809c66..8d07c37ed6f36 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_metadata_decorator.h +++ b/google/cloud/backupdr/v1/internal/backup_dr_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/backupdr/v1/internal/backup_dr_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 backupdr_v1_internal { @@ -418,4 +421,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BACKUPDR_V1_INTERNAL_BACKUP_DR_METADATA_DECORATOR_H diff --git a/google/cloud/backupdr/v1/internal/backup_dr_option_defaults.cc b/google/cloud/backupdr/v1/internal/backup_dr_option_defaults.cc index 1b2b82a80da54..3282c63f29810 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_option_defaults.cc +++ b/google/cloud/backupdr/v1/internal/backup_dr_option_defaults.cc @@ -40,7 +40,7 @@ Options BackupDRDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - backupdr_v1::BackupDRLimitedTimeRetryPolicy(std::chrono::minutes(30)) + backupdr_v1::BackupDRLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/backupdr/v1/internal/backup_dr_stub.cc b/google/cloud/backupdr/v1/internal/backup_dr_stub.cc index 5c9e9b0377c38..1862ca922b0b8 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_stub.cc +++ b/google/cloud/backupdr/v1/internal/backup_dr_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/backupdr/v1/backupdr.proto #include "google/cloud/backupdr/v1/internal/backup_dr_stub.h" +#include "google/cloud/backupdr/v1/backupdr.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace backupdr_v1_internal { @@ -965,3 +968,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace backupdr_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/backupdr/v1/internal/backup_dr_stub.h b/google/cloud/backupdr/v1/internal/backup_dr_stub.h index 4ca1ba56a99fb..986cdf75beda3 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_stub.h +++ b/google/cloud/backupdr/v1/internal/backup_dr_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BACKUPDR_V1_INTERNAL_BACKUP_DR_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BACKUPDR_V1_INTERNAL_BACKUP_DR_STUB_H +#include "google/cloud/backupdr/v1/backupdr.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 -#include -#include -#include +#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 backupdr_v1_internal { @@ -791,4 +794,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BACKUPDR_V1_INTERNAL_BACKUP_DR_STUB_H diff --git a/google/cloud/backupdr/v1/internal/backup_dr_stub_factory.cc b/google/cloud/backupdr/v1/internal/backup_dr_stub_factory.cc index ea806afe2edc9..abcb429329bee 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_stub_factory.cc +++ b/google/cloud/backupdr/v1/internal/backup_dr_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/backupdr/v1/backupdr.proto #include "google/cloud/backupdr/v1/internal/backup_dr_stub_factory.h" +#include "google/cloud/backupdr/v1/backupdr.grpc.pb.h" #include "google/cloud/backupdr/v1/internal/backup_dr_auth_decorator.h" #include "google/cloud/backupdr/v1/internal/backup_dr_logging_decorator.h" #include "google/cloud/backupdr/v1/internal/backup_dr_metadata_decorator.h" #include "google/cloud/backupdr/v1/internal/backup_dr_stub.h" #include "google/cloud/backupdr/v1/internal/backup_dr_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 -#include -#include -#include +#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 backupdr_v1_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace backupdr_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/backupdr/v1/internal/backup_dr_stub_factory.h b/google/cloud/backupdr/v1/internal/backup_dr_stub_factory.h index 9b42765528abf..f3cccf851092e 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_stub_factory.h +++ b/google/cloud/backupdr/v1/internal/backup_dr_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace backupdr_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BACKUPDR_V1_INTERNAL_BACKUP_DR_STUB_FACTORY_H diff --git a/google/cloud/backupdr/v1/internal/backup_dr_tracing_connection.cc b/google/cloud/backupdr/v1/internal/backup_dr_tracing_connection.cc index 4de739cc92619..26e6a3ea5179c 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_tracing_connection.cc +++ b/google/cloud/backupdr/v1/internal/backup_dr_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace backupdr_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BackupDRTracingConnection::BackupDRTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -843,15 +841,11 @@ Status BackupDRTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBackupDRTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/backupdr/v1/internal/backup_dr_tracing_connection.h b/google/cloud/backupdr/v1/internal/backup_dr_tracing_connection.h index bcb8b68dbb137..872bbe8b2b414 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_tracing_connection.h +++ b/google/cloud/backupdr/v1/internal/backup_dr_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace backupdr_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BackupDRTracingConnection : public backupdr_v1::BackupDRConnection { public: ~BackupDRTracingConnection() override = default; @@ -364,8 +362,6 @@ class BackupDRTracingConnection : public backupdr_v1::BackupDRConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/backupdr/v1/internal/backup_dr_tracing_stub.cc b/google/cloud/backupdr/v1/internal/backup_dr_tracing_stub.cc index 6cf2a60df74ca..1815ccb607ff7 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_tracing_stub.cc +++ b/google/cloud/backupdr/v1/internal/backup_dr_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace backupdr_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BackupDRTracingStub::BackupDRTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -875,18 +876,14 @@ future BackupDRTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBackupDRTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace backupdr_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/backupdr/v1/internal/backup_dr_tracing_stub.h b/google/cloud/backupdr/v1/internal/backup_dr_tracing_stub.h index bf238c46d2771..2e5dc86160d5a 100644 --- a/google/cloud/backupdr/v1/internal/backup_dr_tracing_stub.h +++ b/google/cloud/backupdr/v1/internal/backup_dr_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace backupdr_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BackupDRTracingStub : public BackupDRStub { public: ~BackupDRTracingStub() override = default; @@ -408,8 +409,6 @@ class BackupDRTracingStub : public BackupDRStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -424,4 +423,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BACKUPDR_V1_INTERNAL_BACKUP_DR_TRACING_STUB_H diff --git a/google/cloud/baremetalsolution/BUILD.bazel b/google/cloud/baremetalsolution/BUILD.bazel index d716d05083e07..9b3f22d958b28 100644 --- a/google/cloud/baremetalsolution/BUILD.bazel +++ b/google/cloud/baremetalsolution/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/baremetalsolution/v2:baremetalsolution_cc_grpc", + "@googleapis//google/cloud/baremetalsolution/v2:baremetalsolution_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/baremetalsolution/CMakeLists.txt b/google/cloud/baremetalsolution/CMakeLists.txt index e0ec28f2cb48b..e3051db7e264e 100644 --- a/google/cloud/baremetalsolution/CMakeLists.txt +++ b/google/cloud/baremetalsolution/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(baremetalsolution "Bare Metal Solution API" - SERVICE_DIRS "__EMPTY__" "v2/") + SERVICE_DIRS "v2/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(baremetalsolution_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/baremetalsolution/bare_metal_solution_client.h b/google/cloud/baremetalsolution/bare_metal_solution_client.h deleted file mode 100644 index a94eb474aa8a1..0000000000000 --- a/google/cloud/baremetalsolution/bare_metal_solution_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/baremetalsolution/v2/baremetalsolution.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_BARE_METAL_SOLUTION_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_BARE_METAL_SOLUTION_CLIENT_H - -#include "google/cloud/baremetalsolution/bare_metal_solution_connection.h" -#include "google/cloud/baremetalsolution/v2/bare_metal_solution_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in baremetalsolution_v2 instead of the aliases defined in -/// this namespace. -namespace baremetalsolution { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use baremetalsolution_v2::BareMetalSolutionClient directly. -using ::google::cloud::baremetalsolution_v2::BareMetalSolutionClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace baremetalsolution -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_BARE_METAL_SOLUTION_CLIENT_H diff --git a/google/cloud/baremetalsolution/bare_metal_solution_connection.h b/google/cloud/baremetalsolution/bare_metal_solution_connection.h deleted file mode 100644 index e7915dc0c9f3e..0000000000000 --- a/google/cloud/baremetalsolution/bare_metal_solution_connection.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/baremetalsolution/v2/baremetalsolution.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_BARE_METAL_SOLUTION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_BARE_METAL_SOLUTION_CONNECTION_H - -#include "google/cloud/baremetalsolution/bare_metal_solution_connection_idempotency_policy.h" -#include "google/cloud/baremetalsolution/v2/bare_metal_solution_connection.h" - -namespace google { -namespace cloud { -namespace baremetalsolution { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use baremetalsolution_v2::MakeBareMetalSolutionConnection -/// directly. -using ::google::cloud::baremetalsolution_v2::MakeBareMetalSolutionConnection; - -/// @deprecated Use baremetalsolution_v2::BareMetalSolutionConnection directly. -using ::google::cloud::baremetalsolution_v2::BareMetalSolutionConnection; - -/// @deprecated Use -/// baremetalsolution_v2::BareMetalSolutionLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::baremetalsolution_v2:: - BareMetalSolutionLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// baremetalsolution_v2::BareMetalSolutionLimitedTimeRetryPolicy directly. -using ::google::cloud::baremetalsolution_v2:: - BareMetalSolutionLimitedTimeRetryPolicy; - -/// @deprecated Use baremetalsolution_v2::BareMetalSolutionRetryPolicy directly. -using ::google::cloud::baremetalsolution_v2::BareMetalSolutionRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace baremetalsolution -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_BARE_METAL_SOLUTION_CONNECTION_H diff --git a/google/cloud/baremetalsolution/bare_metal_solution_connection_idempotency_policy.h b/google/cloud/baremetalsolution/bare_metal_solution_connection_idempotency_policy.h deleted file mode 100644 index e06ada6977fea..0000000000000 --- a/google/cloud/baremetalsolution/bare_metal_solution_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/baremetalsolution/v2/baremetalsolution.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_BARE_METAL_SOLUTION_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_BARE_METAL_SOLUTION_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/baremetalsolution/v2/bare_metal_solution_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace baremetalsolution { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// baremetalsolution_v2::MakeDefaultBareMetalSolutionConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::baremetalsolution_v2:: - MakeDefaultBareMetalSolutionConnectionIdempotencyPolicy; - -/// @deprecated Use -/// baremetalsolution_v2::BareMetalSolutionConnectionIdempotencyPolicy directly. -using ::google::cloud::baremetalsolution_v2:: - BareMetalSolutionConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace baremetalsolution -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_BARE_METAL_SOLUTION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/baremetalsolution/bare_metal_solution_options.h b/google/cloud/baremetalsolution/bare_metal_solution_options.h deleted file mode 100644 index 6bfbe7d78211f..0000000000000 --- a/google/cloud/baremetalsolution/bare_metal_solution_options.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/baremetalsolution/v2/baremetalsolution.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_BARE_METAL_SOLUTION_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_BARE_METAL_SOLUTION_OPTIONS_H - -#include "google/cloud/baremetalsolution/bare_metal_solution_connection.h" -#include "google/cloud/baremetalsolution/bare_metal_solution_connection_idempotency_policy.h" -#include "google/cloud/baremetalsolution/v2/bare_metal_solution_options.h" - -namespace google { -namespace cloud { -namespace baremetalsolution { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use baremetalsolution_v2::BareMetalSolutionPollingPolicyOption -/// directly. -using ::google::cloud::baremetalsolution_v2:: - BareMetalSolutionPollingPolicyOption; - -/// @deprecated Use baremetalsolution_v2::BareMetalSolutionBackoffPolicyOption -/// directly. -using ::google::cloud::baremetalsolution_v2:: - BareMetalSolutionBackoffPolicyOption; - -/// @deprecated Use -/// baremetalsolution_v2::BareMetalSolutionConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::baremetalsolution_v2:: - BareMetalSolutionConnectionIdempotencyPolicyOption; - -/// @deprecated Use baremetalsolution_v2::BareMetalSolutionPolicyOptionList -/// directly. -using ::google::cloud::baremetalsolution_v2::BareMetalSolutionPolicyOptionList; - -/// @deprecated Use baremetalsolution_v2::BareMetalSolutionRetryPolicyOption -/// directly. -using ::google::cloud::baremetalsolution_v2::BareMetalSolutionRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace baremetalsolution -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_BARE_METAL_SOLUTION_OPTIONS_H diff --git a/google/cloud/baremetalsolution/mocks/mock_bare_metal_solution_connection.h b/google/cloud/baremetalsolution/mocks/mock_bare_metal_solution_connection.h deleted file mode 100644 index c417c27e9a693..0000000000000 --- a/google/cloud/baremetalsolution/mocks/mock_bare_metal_solution_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/baremetalsolution/v2/baremetalsolution.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_MOCKS_MOCK_BARE_METAL_SOLUTION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_MOCKS_MOCK_BARE_METAL_SOLUTION_CONNECTION_H - -#include "google/cloud/baremetalsolution/bare_metal_solution_connection.h" -#include "google/cloud/baremetalsolution/v2/mocks/mock_bare_metal_solution_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in baremetalsolution_v2_mocks instead of the aliases -/// defined in this namespace. -namespace baremetalsolution_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use baremetalsolution_v2_mocks::MockBareMetalSolutionConnection -/// directly. -using ::google::cloud::baremetalsolution_v2_mocks:: - MockBareMetalSolutionConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace baremetalsolution_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_MOCKS_MOCK_BARE_METAL_SOLUTION_CONNECTION_H diff --git a/google/cloud/baremetalsolution/quickstart/.bazelrc b/google/cloud/baremetalsolution/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/baremetalsolution/quickstart/.bazelrc +++ b/google/cloud/baremetalsolution/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/baremetalsolution/quickstart/CMakeLists.txt index a387986d55287..5f2b143060e85 100644 --- a/google/cloud/baremetalsolution/quickstart/CMakeLists.txt +++ b/google/cloud/baremetalsolution/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Bare Metal Solution API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-baremetalsolution-quickstart CXX) find_package(google_cloud_cpp_baremetalsolution REQUIRED) diff --git a/google/cloud/baremetalsolution/quickstart/WORKSPACE.bazel b/google/cloud/baremetalsolution/quickstart/WORKSPACE.bazel index d84205b6f8a00..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 = "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/baremetalsolution/v2/bare_metal_solution_client.h b/google/cloud/baremetalsolution/v2/bare_metal_solution_client.h index 39b35d15feee9..8659c95296454 100644 --- a/google/cloud/baremetalsolution/v2/bare_metal_solution_client.h +++ b/google/cloud/baremetalsolution/v2/bare_metal_solution_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/baremetalsolution/v2/bare_metal_solution_connection.h b/google/cloud/baremetalsolution/v2/bare_metal_solution_connection.h index acb287cbe863c..9bfeb8ac9136c 100644 --- a/google/cloud/baremetalsolution/v2/bare_metal_solution_connection.h +++ b/google/cloud/baremetalsolution/v2/bare_metal_solution_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_V2_BARE_METAL_SOLUTION_CONNECTION_H #include "google/cloud/baremetalsolution/v2/bare_metal_solution_connection_idempotency_policy.h" +#include "google/cloud/baremetalsolution/v2/baremetalsolution.pb.h" #include "google/cloud/baremetalsolution/v2/internal/bare_metal_solution_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/baremetalsolution/v2/bare_metal_solution_connection_idempotency_policy.h b/google/cloud/baremetalsolution/v2/bare_metal_solution_connection_idempotency_policy.h index acbb0d4e5581d..494a34954397a 100644 --- a/google/cloud/baremetalsolution/v2/bare_metal_solution_connection_idempotency_policy.h +++ b/google/cloud/baremetalsolution/v2/bare_metal_solution_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_V2_BARE_METAL_SOLUTION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_V2_BARE_METAL_SOLUTION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/baremetalsolution/v2/baremetalsolution.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_auth_decorator.cc b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_auth_decorator.cc index 939b5d383e175..37add98894b0d 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_auth_decorator.cc +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/baremetalsolution/v2/baremetalsolution.proto #include "google/cloud/baremetalsolution/v2/internal/bare_metal_solution_auth_decorator.h" -#include +#include "google/cloud/baremetalsolution/v2/baremetalsolution.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace baremetalsolution_v2_internal { @@ -815,3 +818,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace baremetalsolution_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_auth_decorator.h b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_auth_decorator.h index 6588653dd4740..0bc20af78226e 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_auth_decorator.h +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 baremetalsolution_v2_internal { @@ -415,4 +418,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_V2_INTERNAL_BARE_METAL_SOLUTION_AUTH_DECORATOR_H diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_connection_impl.h b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_connection_impl.h index 8ef115e2a414f..d8f2ecd9ffdab 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_connection_impl.h +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_logging_decorator.cc b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_logging_decorator.cc index 6907cf41d8522..d6a64b9e5ea39 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_logging_decorator.cc +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/baremetalsolution/v2/baremetalsolution.proto #include "google/cloud/baremetalsolution/v2/internal/bare_metal_solution_logging_decorator.h" +#include "google/cloud/baremetalsolution/v2/baremetalsolution.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace baremetalsolution_v2_internal { @@ -996,3 +999,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace baremetalsolution_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_logging_decorator.h b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_logging_decorator.h index 598d103e6eaa4..7efe2cd8d1c43 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_logging_decorator.h +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 baremetalsolution_v2_internal { @@ -415,4 +418,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_V2_INTERNAL_BARE_METAL_SOLUTION_LOGGING_DECORATOR_H diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_metadata_decorator.cc b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_metadata_decorator.cc index 1c83cad6e1500..3e545211108a5 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_metadata_decorator.cc +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/baremetalsolution/v2/baremetalsolution.proto #include "google/cloud/baremetalsolution/v2/internal/bare_metal_solution_metadata_decorator.h" +#include "google/cloud/baremetalsolution/v2/baremetalsolution.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 baremetalsolution_v2_internal { @@ -726,3 +730,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace baremetalsolution_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_metadata_decorator.h b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_metadata_decorator.h index 981c882851e8d..12e911852f396 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_metadata_decorator.h +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 baremetalsolution_v2_internal { @@ -421,4 +424,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_V2_INTERNAL_BARE_METAL_SOLUTION_METADATA_DECORATOR_H diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_option_defaults.cc b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_option_defaults.cc index 41261d5072c81..38839cf717f9a 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_option_defaults.cc +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_option_defaults.cc @@ -43,7 +43,7 @@ Options BareMetalSolutionDefaultOptions(Options options) { .has()) { options.set( baremetalsolution_v2::BareMetalSolutionLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub.cc b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub.cc index cc0bd2a5a49fd..aa2b6365df29f 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub.cc +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/baremetalsolution/v2/baremetalsolution.proto #include "google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub.h" +#include "google/cloud/baremetalsolution/v2/baremetalsolution.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace baremetalsolution_v2_internal { @@ -962,3 +965,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace baremetalsolution_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub.h b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub.h index 41c3590b354e8..a6a2629790c43 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub.h +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_V2_INTERNAL_BARE_METAL_SOLUTION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_V2_INTERNAL_BARE_METAL_SOLUTION_STUB_H +#include "google/cloud/baremetalsolution/v2/baremetalsolution.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace baremetalsolution_v2_internal { @@ -807,4 +810,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_V2_INTERNAL_BARE_METAL_SOLUTION_STUB_H diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub_factory.cc b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub_factory.cc index 5154b14bf2ae9..b5babaea82e6c 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub_factory.cc +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub_factory.cc @@ -17,22 +17,25 @@ // source: google/cloud/baremetalsolution/v2/baremetalsolution.proto #include "google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub_factory.h" +#include "google/cloud/baremetalsolution/v2/baremetalsolution.grpc.pb.h" #include "google/cloud/baremetalsolution/v2/internal/bare_metal_solution_auth_decorator.h" #include "google/cloud/baremetalsolution/v2/internal/bare_metal_solution_logging_decorator.h" #include "google/cloud/baremetalsolution/v2/internal/bare_metal_solution_metadata_decorator.h" #include "google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub.h" #include "google/cloud/baremetalsolution/v2/internal/bare_metal_solution_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 -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace baremetalsolution_v2_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace baremetalsolution_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub_factory.h b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub_factory.h index 685542d080c0e..843a52a82182f 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub_factory.h +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace baremetalsolution_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_V2_INTERNAL_BARE_METAL_SOLUTION_STUB_FACTORY_H diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_connection.cc b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_connection.cc index 76f390f6fb1f3..3df7023fc7db5 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_connection.cc +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace baremetalsolution_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BareMetalSolutionTracingConnection::BareMetalSolutionTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -834,17 +832,13 @@ BareMetalSolutionTracingConnection::GetLocation( return internal::EndSpan(*span, child_->GetLocation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBareMetalSolutionTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_connection.h b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_connection.h index f65c5fb6482db..14bd6703d766f 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_connection.h +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace baremetalsolution_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BareMetalSolutionTracingConnection : public baremetalsolution_v2::BareMetalSolutionConnection { public: @@ -379,8 +377,6 @@ class BareMetalSolutionTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_stub.cc b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_stub.cc index ef74fcc5602a1..bf1a716b7e8dd 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_stub.cc +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace baremetalsolution_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BareMetalSolutionTracingStub::BareMetalSolutionTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -888,18 +889,14 @@ future BareMetalSolutionTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBareMetalSolutionTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace baremetalsolution_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_stub.h b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_stub.h index 8bd6f4ddbbd6a..52c60189a1bcb 100644 --- a/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_stub.h +++ b/google/cloud/baremetalsolution/v2/internal/bare_metal_solution_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace baremetalsolution_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BareMetalSolutionTracingStub : public BareMetalSolutionStub { public: ~BareMetalSolutionTracingStub() override = default; @@ -411,8 +412,6 @@ class BareMetalSolutionTracingStub : public BareMetalSolutionStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -427,4 +426,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BAREMETALSOLUTION_V2_INTERNAL_BARE_METAL_SOLUTION_TRACING_STUB_H diff --git a/google/cloud/batch/BUILD.bazel b/google/cloud/batch/BUILD.bazel index 9592453d25621..b5e81a5df7aaf 100644 --- a/google/cloud/batch/BUILD.bazel +++ b/google/cloud/batch/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/batch/v1:batch_cc_grpc", + "@googleapis//google/cloud/batch/v1:batch_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/batch/CMakeLists.txt b/google/cloud/batch/CMakeLists.txt index fae373f2eecd9..7de07e2d24d69 100644 --- a/google/cloud/batch/CMakeLists.txt +++ b/google/cloud/batch/CMakeLists.txt @@ -16,8 +16,7 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library(batch "Batch API" SERVICE_DIRS "__EMPTY__" - "v1/") +google_cloud_cpp_add_gapic_library(batch "Batch API" SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(batch_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/batch/batch_client.h b/google/cloud/batch/batch_client.h deleted file mode 100644 index 39ee96fbba302..0000000000000 --- a/google/cloud/batch/batch_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/batch/v1/batch.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_BATCH_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_BATCH_CLIENT_H - -#include "google/cloud/batch/batch_connection.h" -#include "google/cloud/batch/v1/batch_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in batch_v1 instead of the aliases defined in -/// this namespace. -namespace batch { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use batch_v1::BatchServiceClient directly. -using ::google::cloud::batch_v1::BatchServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace batch -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_BATCH_CLIENT_H diff --git a/google/cloud/batch/batch_connection.h b/google/cloud/batch/batch_connection.h deleted file mode 100644 index ac1b4838740b1..0000000000000 --- a/google/cloud/batch/batch_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/batch/v1/batch.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_BATCH_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_BATCH_CONNECTION_H - -#include "google/cloud/batch/batch_connection_idempotency_policy.h" -#include "google/cloud/batch/v1/batch_connection.h" - -namespace google { -namespace cloud { -namespace batch { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use batch_v1::MakeBatchServiceConnection directly. -using ::google::cloud::batch_v1::MakeBatchServiceConnection; - -/// @deprecated Use batch_v1::BatchServiceConnection directly. -using ::google::cloud::batch_v1::BatchServiceConnection; - -/// @deprecated Use batch_v1::BatchServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::batch_v1::BatchServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use batch_v1::BatchServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::batch_v1::BatchServiceLimitedTimeRetryPolicy; - -/// @deprecated Use batch_v1::BatchServiceRetryPolicy directly. -using ::google::cloud::batch_v1::BatchServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace batch -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_BATCH_CONNECTION_H diff --git a/google/cloud/batch/batch_connection_idempotency_policy.h b/google/cloud/batch/batch_connection_idempotency_policy.h deleted file mode 100644 index 09358aa9fff0e..0000000000000 --- a/google/cloud/batch/batch_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/batch/v1/batch.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_BATCH_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_BATCH_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/batch/v1/batch_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace batch { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use batch_v1::MakeDefaultBatchServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::batch_v1:: - MakeDefaultBatchServiceConnectionIdempotencyPolicy; - -/// @deprecated Use batch_v1::BatchServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::batch_v1::BatchServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace batch -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_BATCH_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/batch/batch_options.h b/google/cloud/batch/batch_options.h deleted file mode 100644 index b72ecba673e82..0000000000000 --- a/google/cloud/batch/batch_options.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/batch/v1/batch.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_BATCH_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_BATCH_OPTIONS_H - -#include "google/cloud/batch/batch_connection.h" -#include "google/cloud/batch/batch_connection_idempotency_policy.h" -#include "google/cloud/batch/v1/batch_options.h" - -namespace google { -namespace cloud { -namespace batch { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use batch_v1::BatchServicePollingPolicyOption directly. -using ::google::cloud::batch_v1::BatchServicePollingPolicyOption; - -/// @deprecated Use batch_v1::BatchServiceBackoffPolicyOption directly. -using ::google::cloud::batch_v1::BatchServiceBackoffPolicyOption; - -/// @deprecated Use batch_v1::BatchServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::batch_v1::BatchServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use batch_v1::BatchServicePolicyOptionList directly. -using ::google::cloud::batch_v1::BatchServicePolicyOptionList; - -/// @deprecated Use batch_v1::BatchServiceRetryPolicyOption directly. -using ::google::cloud::batch_v1::BatchServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace batch -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_BATCH_OPTIONS_H diff --git a/google/cloud/batch/mocks/mock_batch_connection.h b/google/cloud/batch/mocks/mock_batch_connection.h deleted file mode 100644 index 83e2af3d253d8..0000000000000 --- a/google/cloud/batch/mocks/mock_batch_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/batch/v1/batch.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_MOCKS_MOCK_BATCH_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_MOCKS_MOCK_BATCH_CONNECTION_H - -#include "google/cloud/batch/batch_connection.h" -#include "google/cloud/batch/v1/mocks/mock_batch_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in batch_v1_mocks instead of the aliases -/// defined in this namespace. -namespace batch_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use batch_v1_mocks::MockBatchServiceConnection directly. -using ::google::cloud::batch_v1_mocks::MockBatchServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace batch_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_MOCKS_MOCK_BATCH_CONNECTION_H diff --git a/google/cloud/batch/quickstart/.bazelrc b/google/cloud/batch/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/batch/quickstart/.bazelrc +++ b/google/cloud/batch/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/batch/quickstart/CMakeLists.txt index 1cf56ed20390d..ee62b0e45f103 100644 --- a/google/cloud/batch/quickstart/CMakeLists.txt +++ b/google/cloud/batch/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Batch API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-batch-quickstart CXX) find_package(google_cloud_cpp_batch REQUIRED) diff --git a/google/cloud/batch/quickstart/WORKSPACE.bazel b/google/cloud/batch/quickstart/WORKSPACE.bazel index 1e8e72ad83fd6..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 = "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/batch/v1/batch_client.h b/google/cloud/batch/v1/batch_client.h index c75133defc921..c9f774648a7c7 100644 --- a/google/cloud/batch/v1/batch_client.h +++ b/google/cloud/batch/v1/batch_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/batch/v1/batch_connection.h b/google/cloud/batch/v1/batch_connection.h index ae2cbf28f8700..1d5a53807fed7 100644 --- a/google/cloud/batch/v1/batch_connection.h +++ b/google/cloud/batch/v1/batch_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_V1_BATCH_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_V1_BATCH_CONNECTION_H +#include "google/cloud/batch/v1/batch.pb.h" #include "google/cloud/batch/v1/batch_connection_idempotency_policy.h" #include "google/cloud/batch/v1/internal/batch_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/batch/v1/batch_connection_idempotency_policy.h b/google/cloud/batch/v1/batch_connection_idempotency_policy.h index 60846fc67a053..f5ef04434ceb5 100644 --- a/google/cloud/batch/v1/batch_connection_idempotency_policy.h +++ b/google/cloud/batch/v1/batch_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_V1_BATCH_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_V1_BATCH_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/batch/v1/batch.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/batch/v1/internal/batch_auth_decorator.cc b/google/cloud/batch/v1/internal/batch_auth_decorator.cc index b56288568880f..9618543a32653 100644 --- a/google/cloud/batch/v1/internal/batch_auth_decorator.cc +++ b/google/cloud/batch/v1/internal/batch_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/batch/v1/batch.proto #include "google/cloud/batch/v1/internal/batch_auth_decorator.h" -#include +#include "google/cloud/batch/v1/batch.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace batch_v1_internal { @@ -218,3 +221,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace batch_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/batch/v1/internal/batch_auth_decorator.h b/google/cloud/batch/v1/internal/batch_auth_decorator.h index 5c552dce22990..b907ae057a3f0 100644 --- a/google/cloud/batch/v1/internal/batch_auth_decorator.h +++ b/google/cloud/batch/v1/internal/batch_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/batch/v1/internal/batch_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 batch_v1_internal { @@ -125,4 +128,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_V1_INTERNAL_BATCH_AUTH_DECORATOR_H diff --git a/google/cloud/batch/v1/internal/batch_connection_impl.h b/google/cloud/batch/v1/internal/batch_connection_impl.h index d6129c89029a0..123debd9f979e 100644 --- a/google/cloud/batch/v1/internal/batch_connection_impl.h +++ b/google/cloud/batch/v1/internal/batch_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/batch/v1/internal/batch_logging_decorator.cc b/google/cloud/batch/v1/internal/batch_logging_decorator.cc index dc2ebe7d94fa1..dc0aadb50b993 100644 --- a/google/cloud/batch/v1/internal/batch_logging_decorator.cc +++ b/google/cloud/batch/v1/internal/batch_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/batch/v1/batch.proto #include "google/cloud/batch/v1/internal/batch_logging_decorator.h" +#include "google/cloud/batch/v1/batch.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace batch_v1_internal { @@ -257,3 +260,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace batch_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/batch/v1/internal/batch_logging_decorator.h b/google/cloud/batch/v1/internal/batch_logging_decorator.h index 301e343f39153..0736a8363e264 100644 --- a/google/cloud/batch/v1/internal/batch_logging_decorator.h +++ b/google/cloud/batch/v1/internal/batch_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/batch/v1/internal/batch_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 batch_v1_internal { @@ -125,4 +128,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_V1_INTERNAL_BATCH_LOGGING_DECORATOR_H diff --git a/google/cloud/batch/v1/internal/batch_metadata_decorator.cc b/google/cloud/batch/v1/internal/batch_metadata_decorator.cc index c6b7241f34926..a6663aa28a4b3 100644 --- a/google/cloud/batch/v1/internal/batch_metadata_decorator.cc +++ b/google/cloud/batch/v1/internal/batch_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/batch/v1/batch.proto #include "google/cloud/batch/v1/internal/batch_metadata_decorator.h" +#include "google/cloud/batch/v1/batch.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 batch_v1_internal { @@ -216,3 +220,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace batch_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/batch/v1/internal/batch_metadata_decorator.h b/google/cloud/batch/v1/internal/batch_metadata_decorator.h index c3e436c718910..8b6aa4bf7d62a 100644 --- a/google/cloud/batch/v1/internal/batch_metadata_decorator.h +++ b/google/cloud/batch/v1/internal/batch_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/batch/v1/internal/batch_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 batch_v1_internal { @@ -130,4 +133,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_V1_INTERNAL_BATCH_METADATA_DECORATOR_H diff --git a/google/cloud/batch/v1/internal/batch_option_defaults.cc b/google/cloud/batch/v1/internal/batch_option_defaults.cc index 5fd58dc1fc1a2..193aa6c19798c 100644 --- a/google/cloud/batch/v1/internal/batch_option_defaults.cc +++ b/google/cloud/batch/v1/internal/batch_option_defaults.cc @@ -40,7 +40,7 @@ Options BatchServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - batch_v1::BatchServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + batch_v1::BatchServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/batch/v1/internal/batch_stub.cc b/google/cloud/batch/v1/internal/batch_stub.cc index fd146dfe18ddf..9278af2de4b26 100644 --- a/google/cloud/batch/v1/internal/batch_stub.cc +++ b/google/cloud/batch/v1/internal/batch_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/batch/v1/batch.proto #include "google/cloud/batch/v1/internal/batch_stub.h" +#include "google/cloud/batch/v1/batch.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace batch_v1_internal { @@ -256,3 +259,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace batch_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/batch/v1/internal/batch_stub.h b/google/cloud/batch/v1/internal/batch_stub.h index b8d25b57dc5fd..9569430a7a727 100644 --- a/google/cloud/batch/v1/internal/batch_stub.h +++ b/google/cloud/batch/v1/internal/batch_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_V1_INTERNAL_BATCH_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_V1_INTERNAL_BATCH_STUB_H +#include "google/cloud/batch/v1/batch.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace batch_v1_internal { @@ -220,4 +223,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_V1_INTERNAL_BATCH_STUB_H diff --git a/google/cloud/batch/v1/internal/batch_stub_factory.cc b/google/cloud/batch/v1/internal/batch_stub_factory.cc index 2c17f0b50aed0..c03a5cb5d32dc 100644 --- a/google/cloud/batch/v1/internal/batch_stub_factory.cc +++ b/google/cloud/batch/v1/internal/batch_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/batch/v1/batch.proto #include "google/cloud/batch/v1/internal/batch_stub_factory.h" +#include "google/cloud/batch/v1/batch.grpc.pb.h" #include "google/cloud/batch/v1/internal/batch_auth_decorator.h" #include "google/cloud/batch/v1/internal/batch_logging_decorator.h" #include "google/cloud/batch/v1/internal/batch_metadata_decorator.h" #include "google/cloud/batch/v1/internal/batch_stub.h" #include "google/cloud/batch/v1/internal/batch_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace batch_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace batch_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/batch/v1/internal/batch_stub_factory.h b/google/cloud/batch/v1/internal/batch_stub_factory.h index 93b8d875c5ad0..2db3a5b9d060f 100644 --- a/google/cloud/batch/v1/internal/batch_stub_factory.h +++ b/google/cloud/batch/v1/internal/batch_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace batch_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_V1_INTERNAL_BATCH_STUB_FACTORY_H diff --git a/google/cloud/batch/v1/internal/batch_tracing_connection.cc b/google/cloud/batch/v1/internal/batch_tracing_connection.cc index e784bc29b9aad..8454e9ac1206c 100644 --- a/google/cloud/batch/v1/internal/batch_tracing_connection.cc +++ b/google/cloud/batch/v1/internal/batch_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace batch_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BatchServiceTracingConnection::BatchServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -179,16 +177,12 @@ Status BatchServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBatchServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/batch/v1/internal/batch_tracing_connection.h b/google/cloud/batch/v1/internal/batch_tracing_connection.h index f38107579da47..9852b70e08582 100644 --- a/google/cloud/batch/v1/internal/batch_tracing_connection.h +++ b/google/cloud/batch/v1/internal/batch_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace batch_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BatchServiceTracingConnection : public batch_v1::BatchServiceConnection { public: ~BatchServiceTracingConnection() override = default; @@ -96,8 +94,6 @@ class BatchServiceTracingConnection : public batch_v1::BatchServiceConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/batch/v1/internal/batch_tracing_stub.cc b/google/cloud/batch/v1/internal/batch_tracing_stub.cc index 2691b27faf073..703e25518374a 100644 --- a/google/cloud/batch/v1/internal/batch_tracing_stub.cc +++ b/google/cloud/batch/v1/internal/batch_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace batch_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BatchServiceTracingStub::BatchServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -236,18 +237,14 @@ future BatchServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBatchServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace batch_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/batch/v1/internal/batch_tracing_stub.h b/google/cloud/batch/v1/internal/batch_tracing_stub.h index d61667b2cc87b..8ebca0a3824ee 100644 --- a/google/cloud/batch/v1/internal/batch_tracing_stub.h +++ b/google/cloud/batch/v1/internal/batch_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace batch_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BatchServiceTracingStub : public BatchServiceStub { public: ~BatchServiceTracingStub() override = default; @@ -120,8 +121,6 @@ class BatchServiceTracingStub : public BatchServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -136,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BATCH_V1_INTERNAL_BATCH_TRACING_STUB_H diff --git a/google/cloud/beyondcorp/BUILD.bazel b/google/cloud/beyondcorp/BUILD.bazel index 46b948e8bd841..10d7d8f39750f 100644 --- a/google/cloud/beyondcorp/BUILD.bazel +++ b/google/cloud/beyondcorp/BUILD.bazel @@ -19,16 +19,15 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "appconnections/v1/", "appconnectors/v1/", "appgateways/v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/beyondcorp/appconnections/v1:appconnections_cc_grpc", - "@com_google_googleapis//google/cloud/beyondcorp/appconnectors/v1:appconnectors_cc_grpc", - "@com_google_googleapis//google/cloud/beyondcorp/appgateways/v1:appgateways_cc_grpc", + "@googleapis//google/cloud/beyondcorp/appconnections/v1:appconnections_cc_grpc", + "@googleapis//google/cloud/beyondcorp/appconnectors/v1:appconnectors_cc_grpc", + "@googleapis//google/cloud/beyondcorp/appgateways/v1:appgateways_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/beyondcorp/CMakeLists.txt b/google/cloud/beyondcorp/CMakeLists.txt index fdcdab5e15ce6..2e358192deb67 100644 --- a/google/cloud/beyondcorp/CMakeLists.txt +++ b/google/cloud/beyondcorp/CMakeLists.txt @@ -18,8 +18,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( beyondcorp "BeyondCorp API" - SERVICE_DIRS "__EMPTY__" "appconnections/v1/" "appconnectors/v1/" - "appgateways/v1/") + SERVICE_DIRS "appconnections/v1/" "appconnectors/v1/" "appgateways/v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(beyondcorp_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/beyondcorp/app_connections_client.h b/google/cloud/beyondcorp/app_connections_client.h deleted file mode 100644 index a841e175bd2e9..0000000000000 --- a/google/cloud/beyondcorp/app_connections_client.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: -// google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTIONS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTIONS_CLIENT_H - -#include "google/cloud/beyondcorp/app_connections_connection.h" -#include "google/cloud/beyondcorp/appconnections/v1/app_connections_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in beyondcorp_appconnections_v1 instead of the aliases -/// defined in this namespace. -namespace beyondcorp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use beyondcorp_appconnections_v1::AppConnectionsServiceClient -/// directly. -using ::google::cloud::beyondcorp_appconnections_v1:: - AppConnectionsServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTIONS_CLIENT_H diff --git a/google/cloud/beyondcorp/app_connections_connection.h b/google/cloud/beyondcorp/app_connections_connection.h deleted file mode 100644 index e007c9d21f015..0000000000000 --- a/google/cloud/beyondcorp/app_connections_connection.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: -// google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTIONS_CONNECTION_H - -#include "google/cloud/beyondcorp/app_connections_connection_idempotency_policy.h" -#include "google/cloud/beyondcorp/appconnections/v1/app_connections_connection.h" - -namespace google { -namespace cloud { -namespace beyondcorp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// beyondcorp_appconnections_v1::MakeAppConnectionsServiceConnection directly. -using ::google::cloud::beyondcorp_appconnections_v1:: - MakeAppConnectionsServiceConnection; - -/// @deprecated Use -/// beyondcorp_appconnections_v1::AppConnectionsServiceConnection directly. -using ::google::cloud::beyondcorp_appconnections_v1:: - AppConnectionsServiceConnection; - -/// @deprecated Use -/// beyondcorp_appconnections_v1::AppConnectionsServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::beyondcorp_appconnections_v1:: - AppConnectionsServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// beyondcorp_appconnections_v1::AppConnectionsServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::beyondcorp_appconnections_v1:: - AppConnectionsServiceLimitedTimeRetryPolicy; - -/// @deprecated Use -/// beyondcorp_appconnections_v1::AppConnectionsServiceRetryPolicy directly. -using ::google::cloud::beyondcorp_appconnections_v1:: - AppConnectionsServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTIONS_CONNECTION_H diff --git a/google/cloud/beyondcorp/app_connections_connection_idempotency_policy.h b/google/cloud/beyondcorp/app_connections_connection_idempotency_policy.h deleted file mode 100644 index 267e80aa2b05b..0000000000000 --- a/google/cloud/beyondcorp/app_connections_connection_idempotency_policy.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: -// google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTIONS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTIONS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/beyondcorp/appconnections/v1/app_connections_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace beyondcorp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// beyondcorp_appconnections_v1::MakeDefaultAppConnectionsServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::beyondcorp_appconnections_v1:: - MakeDefaultAppConnectionsServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// beyondcorp_appconnections_v1::AppConnectionsServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::beyondcorp_appconnections_v1:: - AppConnectionsServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTIONS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/beyondcorp/app_connections_options.h b/google/cloud/beyondcorp/app_connections_options.h deleted file mode 100644 index e71951ae3e3a8..0000000000000 --- a/google/cloud/beyondcorp/app_connections_options.h +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: -// google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTIONS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTIONS_OPTIONS_H - -#include "google/cloud/beyondcorp/app_connections_connection.h" -#include "google/cloud/beyondcorp/app_connections_connection_idempotency_policy.h" -#include "google/cloud/beyondcorp/appconnections/v1/app_connections_options.h" - -namespace google { -namespace cloud { -namespace beyondcorp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// beyondcorp_appconnections_v1::AppConnectionsServicePollingPolicyOption -/// directly. -using ::google::cloud::beyondcorp_appconnections_v1:: - AppConnectionsServicePollingPolicyOption; - -/// @deprecated Use -/// beyondcorp_appconnections_v1::AppConnectionsServiceBackoffPolicyOption -/// directly. -using ::google::cloud::beyondcorp_appconnections_v1:: - AppConnectionsServiceBackoffPolicyOption; - -/// @deprecated Use -/// beyondcorp_appconnections_v1::AppConnectionsServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::beyondcorp_appconnections_v1:: - AppConnectionsServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use -/// beyondcorp_appconnections_v1::AppConnectionsServicePolicyOptionList -/// directly. -using ::google::cloud::beyondcorp_appconnections_v1:: - AppConnectionsServicePolicyOptionList; - -/// @deprecated Use -/// beyondcorp_appconnections_v1::AppConnectionsServiceRetryPolicyOption -/// directly. -using ::google::cloud::beyondcorp_appconnections_v1:: - AppConnectionsServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTIONS_OPTIONS_H diff --git a/google/cloud/beyondcorp/app_connectors_client.h b/google/cloud/beyondcorp/app_connectors_client.h deleted file mode 100644 index ac15683cc2805..0000000000000 --- a/google/cloud/beyondcorp/app_connectors_client.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTORS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTORS_CLIENT_H - -#include "google/cloud/beyondcorp/app_connectors_connection.h" -#include "google/cloud/beyondcorp/appconnectors/v1/app_connectors_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in beyondcorp_appconnectors_v1 instead of the aliases -/// defined in this namespace. -namespace beyondcorp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use beyondcorp_appconnectors_v1::AppConnectorsServiceClient -/// directly. -using ::google::cloud::beyondcorp_appconnectors_v1::AppConnectorsServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTORS_CLIENT_H diff --git a/google/cloud/beyondcorp/app_connectors_connection.h b/google/cloud/beyondcorp/app_connectors_connection.h deleted file mode 100644 index 0703c1726f1de..0000000000000 --- a/google/cloud/beyondcorp/app_connectors_connection.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTORS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTORS_CONNECTION_H - -#include "google/cloud/beyondcorp/app_connectors_connection_idempotency_policy.h" -#include "google/cloud/beyondcorp/appconnectors/v1/app_connectors_connection.h" - -namespace google { -namespace cloud { -namespace beyondcorp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// beyondcorp_appconnectors_v1::MakeAppConnectorsServiceConnection directly. -using ::google::cloud::beyondcorp_appconnectors_v1:: - MakeAppConnectorsServiceConnection; - -/// @deprecated Use beyondcorp_appconnectors_v1::AppConnectorsServiceConnection -/// directly. -using ::google::cloud::beyondcorp_appconnectors_v1:: - AppConnectorsServiceConnection; - -/// @deprecated Use -/// beyondcorp_appconnectors_v1::AppConnectorsServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::beyondcorp_appconnectors_v1:: - AppConnectorsServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// beyondcorp_appconnectors_v1::AppConnectorsServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::beyondcorp_appconnectors_v1:: - AppConnectorsServiceLimitedTimeRetryPolicy; - -/// @deprecated Use beyondcorp_appconnectors_v1::AppConnectorsServiceRetryPolicy -/// directly. -using ::google::cloud::beyondcorp_appconnectors_v1:: - AppConnectorsServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTORS_CONNECTION_H diff --git a/google/cloud/beyondcorp/app_connectors_connection_idempotency_policy.h b/google/cloud/beyondcorp/app_connectors_connection_idempotency_policy.h deleted file mode 100644 index 843387259f446..0000000000000 --- a/google/cloud/beyondcorp/app_connectors_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTORS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTORS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/beyondcorp/appconnectors/v1/app_connectors_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace beyondcorp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// beyondcorp_appconnectors_v1::MakeDefaultAppConnectorsServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::beyondcorp_appconnectors_v1:: - MakeDefaultAppConnectorsServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// beyondcorp_appconnectors_v1::AppConnectorsServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::beyondcorp_appconnectors_v1:: - AppConnectorsServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTORS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/beyondcorp/app_connectors_options.h b/google/cloud/beyondcorp/app_connectors_options.h deleted file mode 100644 index 8063446bc3df9..0000000000000 --- a/google/cloud/beyondcorp/app_connectors_options.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTORS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTORS_OPTIONS_H - -#include "google/cloud/beyondcorp/app_connectors_connection.h" -#include "google/cloud/beyondcorp/app_connectors_connection_idempotency_policy.h" -#include "google/cloud/beyondcorp/appconnectors/v1/app_connectors_options.h" - -namespace google { -namespace cloud { -namespace beyondcorp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// beyondcorp_appconnectors_v1::AppConnectorsServicePollingPolicyOption -/// directly. -using ::google::cloud::beyondcorp_appconnectors_v1:: - AppConnectorsServicePollingPolicyOption; - -/// @deprecated Use -/// beyondcorp_appconnectors_v1::AppConnectorsServiceBackoffPolicyOption -/// directly. -using ::google::cloud::beyondcorp_appconnectors_v1:: - AppConnectorsServiceBackoffPolicyOption; - -/// @deprecated Use -/// beyondcorp_appconnectors_v1::AppConnectorsServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::beyondcorp_appconnectors_v1:: - AppConnectorsServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use -/// beyondcorp_appconnectors_v1::AppConnectorsServicePolicyOptionList directly. -using ::google::cloud::beyondcorp_appconnectors_v1:: - AppConnectorsServicePolicyOptionList; - -/// @deprecated Use -/// beyondcorp_appconnectors_v1::AppConnectorsServiceRetryPolicyOption directly. -using ::google::cloud::beyondcorp_appconnectors_v1:: - AppConnectorsServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_CONNECTORS_OPTIONS_H diff --git a/google/cloud/beyondcorp/app_gateways_client.h b/google/cloud/beyondcorp/app_gateways_client.h deleted file mode 100644 index 4fbf2585f8232..0000000000000 --- a/google/cloud/beyondcorp/app_gateways_client.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_GATEWAYS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_GATEWAYS_CLIENT_H - -#include "google/cloud/beyondcorp/app_gateways_connection.h" -#include "google/cloud/beyondcorp/appgateways/v1/app_gateways_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in beyondcorp_appgateways_v1 instead of the aliases -/// defined in this namespace. -namespace beyondcorp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use beyondcorp_appgateways_v1::AppGatewaysServiceClient -/// directly. -using ::google::cloud::beyondcorp_appgateways_v1::AppGatewaysServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_GATEWAYS_CLIENT_H diff --git a/google/cloud/beyondcorp/app_gateways_connection.h b/google/cloud/beyondcorp/app_gateways_connection.h deleted file mode 100644 index a47ca91cfa0d8..0000000000000 --- a/google/cloud/beyondcorp/app_gateways_connection.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_GATEWAYS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_GATEWAYS_CONNECTION_H - -#include "google/cloud/beyondcorp/app_gateways_connection_idempotency_policy.h" -#include "google/cloud/beyondcorp/appgateways/v1/app_gateways_connection.h" - -namespace google { -namespace cloud { -namespace beyondcorp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use beyondcorp_appgateways_v1::MakeAppGatewaysServiceConnection -/// directly. -using ::google::cloud::beyondcorp_appgateways_v1:: - MakeAppGatewaysServiceConnection; - -/// @deprecated Use beyondcorp_appgateways_v1::AppGatewaysServiceConnection -/// directly. -using ::google::cloud::beyondcorp_appgateways_v1::AppGatewaysServiceConnection; - -/// @deprecated Use -/// beyondcorp_appgateways_v1::AppGatewaysServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::beyondcorp_appgateways_v1:: - AppGatewaysServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// beyondcorp_appgateways_v1::AppGatewaysServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::beyondcorp_appgateways_v1:: - AppGatewaysServiceLimitedTimeRetryPolicy; - -/// @deprecated Use beyondcorp_appgateways_v1::AppGatewaysServiceRetryPolicy -/// directly. -using ::google::cloud::beyondcorp_appgateways_v1::AppGatewaysServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_GATEWAYS_CONNECTION_H diff --git a/google/cloud/beyondcorp/app_gateways_connection_idempotency_policy.h b/google/cloud/beyondcorp/app_gateways_connection_idempotency_policy.h deleted file mode 100644 index f04d58be7d850..0000000000000 --- a/google/cloud/beyondcorp/app_gateways_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_GATEWAYS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_GATEWAYS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/beyondcorp/appgateways/v1/app_gateways_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace beyondcorp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// beyondcorp_appgateways_v1::MakeDefaultAppGatewaysServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::beyondcorp_appgateways_v1:: - MakeDefaultAppGatewaysServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// beyondcorp_appgateways_v1::AppGatewaysServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::beyondcorp_appgateways_v1:: - AppGatewaysServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_GATEWAYS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/beyondcorp/app_gateways_options.h b/google/cloud/beyondcorp/app_gateways_options.h deleted file mode 100644 index b850da294655f..0000000000000 --- a/google/cloud/beyondcorp/app_gateways_options.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_GATEWAYS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_GATEWAYS_OPTIONS_H - -#include "google/cloud/beyondcorp/app_gateways_connection.h" -#include "google/cloud/beyondcorp/app_gateways_connection_idempotency_policy.h" -#include "google/cloud/beyondcorp/appgateways/v1/app_gateways_options.h" - -namespace google { -namespace cloud { -namespace beyondcorp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// beyondcorp_appgateways_v1::AppGatewaysServicePollingPolicyOption directly. -using ::google::cloud::beyondcorp_appgateways_v1:: - AppGatewaysServicePollingPolicyOption; - -/// @deprecated Use -/// beyondcorp_appgateways_v1::AppGatewaysServiceBackoffPolicyOption directly. -using ::google::cloud::beyondcorp_appgateways_v1:: - AppGatewaysServiceBackoffPolicyOption; - -/// @deprecated Use -/// beyondcorp_appgateways_v1::AppGatewaysServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::beyondcorp_appgateways_v1:: - AppGatewaysServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use -/// beyondcorp_appgateways_v1::AppGatewaysServicePolicyOptionList directly. -using ::google::cloud::beyondcorp_appgateways_v1:: - AppGatewaysServicePolicyOptionList; - -/// @deprecated Use -/// beyondcorp_appgateways_v1::AppGatewaysServiceRetryPolicyOption directly. -using ::google::cloud::beyondcorp_appgateways_v1:: - AppGatewaysServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APP_GATEWAYS_OPTIONS_H diff --git a/google/cloud/beyondcorp/appconnections/v1/app_connections_client.h b/google/cloud/beyondcorp/appconnections/v1/app_connections_client.h index 787f3d0dd2664..baccc5d46be77 100644 --- a/google/cloud/beyondcorp/appconnections/v1/app_connections_client.h +++ b/google/cloud/beyondcorp/appconnections/v1/app_connections_client.h @@ -27,7 +27,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/appconnections/v1/app_connections_connection.h b/google/cloud/beyondcorp/appconnections/v1/app_connections_connection.h index b1add147978b6..2d919f0b6a8dc 100644 --- a/google/cloud/beyondcorp/appconnections/v1/app_connections_connection.h +++ b/google/cloud/beyondcorp/appconnections/v1/app_connections_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTIONS_V1_APP_CONNECTIONS_CONNECTION_H #include "google/cloud/beyondcorp/appconnections/v1/app_connections_connection_idempotency_policy.h" +#include "google/cloud/beyondcorp/appconnections/v1/app_connections_service.pb.h" #include "google/cloud/beyondcorp/appconnections/v1/internal/app_connections_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,8 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/beyondcorp/appconnections/v1/app_connections_connection_idempotency_policy.h b/google/cloud/beyondcorp/appconnections/v1/app_connections_connection_idempotency_policy.h index a7add5df1e169..26c76c014170e 100644 --- a/google/cloud/beyondcorp/appconnections/v1/app_connections_connection_idempotency_policy.h +++ b/google/cloud/beyondcorp/appconnections/v1/app_connections_connection_idempotency_policy.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTIONS_V1_APP_CONNECTIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTIONS_V1_APP_CONNECTIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/beyondcorp/appconnections/v1/app_connections_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_auth_decorator.cc b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_auth_decorator.cc index 7c1540d34acc6..8523f18ab84db 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_auth_decorator.cc +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_auth_decorator.cc @@ -18,10 +18,13 @@ // google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto #include "google/cloud/beyondcorp/appconnections/v1/internal/app_connections_auth_decorator.h" -#include +#include "google/cloud/beyondcorp/appconnections/v1/app_connections_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appconnections_v1_internal { @@ -274,3 +277,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appconnections_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_auth_decorator.h b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_auth_decorator.h index ae72d2fd8dd87..723d3da74056b 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_auth_decorator.h +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_auth_decorator.h @@ -23,11 +23,14 @@ #include "google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 beyondcorp_appconnections_v1_internal { @@ -152,4 +155,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTIONS_V1_INTERNAL_APP_CONNECTIONS_AUTH_DECORATOR_H diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_connection_impl.h b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_connection_impl.h index ea82e4d0edc53..226f749aa852c 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_connection_impl.h +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_connection_impl.h @@ -33,7 +33,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_logging_decorator.cc b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_logging_decorator.cc index 7a715d52ec2f4..2164c02af4f6e 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_logging_decorator.cc +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_logging_decorator.cc @@ -18,14 +18,17 @@ // google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto #include "google/cloud/beyondcorp/appconnections/v1/internal/app_connections_logging_decorator.h" +#include "google/cloud/beyondcorp/appconnections/v1/app_connections_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appconnections_v1_internal { @@ -325,3 +328,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appconnections_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_logging_decorator.h b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_logging_decorator.h index 8d838adec5920..da5c81f993b30 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_logging_decorator.h +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_logging_decorator.h @@ -23,11 +23,14 @@ #include "google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 beyondcorp_appconnections_v1_internal { @@ -152,4 +155,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTIONS_V1_INTERNAL_APP_CONNECTIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_metadata_decorator.cc b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_metadata_decorator.cc index 63a7a46960df4..2ebcdbae22f5a 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_metadata_decorator.cc +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_metadata_decorator.cc @@ -18,17 +18,21 @@ // google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto #include "google/cloud/beyondcorp/appconnections/v1/internal/app_connections_metadata_decorator.h" +#include "google/cloud/beyondcorp/appconnections/v1/app_connections_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 beyondcorp_appconnections_v1_internal { @@ -270,3 +274,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appconnections_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_metadata_decorator.h b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_metadata_decorator.h index c0aeaa36c2f98..739f73df08fde 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_metadata_decorator.h +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_metadata_decorator.h @@ -23,11 +23,14 @@ #include "google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 beyondcorp_appconnections_v1_internal { @@ -158,4 +161,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTIONS_V1_INTERNAL_APP_CONNECTIONS_METADATA_DECORATOR_H diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_option_defaults.cc b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_option_defaults.cc index e157a637d9958..fd3371f52da68 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_option_defaults.cc +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_option_defaults.cc @@ -46,7 +46,7 @@ Options AppConnectionsServiceDefaultOptions(Options options) { beyondcorp_appconnections_v1::AppConnectionsServiceRetryPolicyOption>( beyondcorp_appconnections_v1:: AppConnectionsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appconnections_v1_internal { @@ -324,3 +327,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appconnections_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub.h b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub.h index b8d334e0e9059..3c113981dac8b 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub.h +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub.h @@ -20,18 +20,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTIONS_V1_INTERNAL_APP_CONNECTIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTIONS_V1_INTERNAL_APP_CONNECTIONS_STUB_H +#include "google/cloud/beyondcorp/appconnections/v1/app_connections_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 -#include -#include -#include +#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 beyondcorp_appconnections_v1_internal { @@ -279,4 +282,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTIONS_V1_INTERNAL_APP_CONNECTIONS_STUB_H diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub_factory.cc b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub_factory.cc index e70e8a2881d89..d700d42db2849 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub_factory.cc +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub_factory.cc @@ -18,24 +18,27 @@ // google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto #include "google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub_factory.h" +#include "google/cloud/beyondcorp/appconnections/v1/app_connections_service.grpc.pb.h" #include "google/cloud/beyondcorp/appconnections/v1/internal/app_connections_auth_decorator.h" #include "google/cloud/beyondcorp/appconnections/v1/internal/app_connections_logging_decorator.h" #include "google/cloud/beyondcorp/appconnections/v1/internal/app_connections_metadata_decorator.h" #include "google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub.h" #include "google/cloud/beyondcorp/appconnections/v1/internal/app_connections_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 -#include -#include -#include +#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 beyondcorp_appconnections_v1_internal { @@ -80,3 +83,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appconnections_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub_factory.h b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub_factory.h index b0afc0043c8fb..150c7497c17e4 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub_factory.h +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_stub_factory.h @@ -26,6 +26,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appconnections_v1_internal { @@ -41,4 +44,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTIONS_V1_INTERNAL_APP_CONNECTIONS_STUB_FACTORY_H diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_connection.cc b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_connection.cc index 5150845c034e2..e3b40d2a29f20 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_connection.cc +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace beyondcorp_appconnections_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AppConnectionsServiceTracingConnection::AppConnectionsServiceTracingConnection( std::shared_ptr< beyondcorp_appconnections_v1::AppConnectionsServiceConnection> @@ -276,19 +274,15 @@ Status AppConnectionsServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAppConnectionsServiceTracingConnection( std::shared_ptr< beyondcorp_appconnections_v1::AppConnectionsServiceConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_connection.h b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_connection.h index fb7ef92fc956d..68e2ffda60a86 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_connection.h +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace beyondcorp_appconnections_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AppConnectionsServiceTracingConnection : public beyondcorp_appconnections_v1::AppConnectionsServiceConnection { public: @@ -124,8 +122,6 @@ class AppConnectionsServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_stub.cc b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_stub.cc index a8a1cd0049cec..d7f742f375eb4 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_stub.cc +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appconnections_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AppConnectionsServiceTracingStub::AppConnectionsServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -313,18 +314,14 @@ future AppConnectionsServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAppConnectionsServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appconnections_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_stub.h b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_stub.h index 4dbc1b436118a..5921e82f0c461 100644 --- a/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_stub.h +++ b/google/cloud/beyondcorp/appconnections/v1/internal/app_connections_tracing_stub.h @@ -26,13 +26,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appconnections_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AppConnectionsServiceTracingStub : public AppConnectionsServiceStub { public: ~AppConnectionsServiceTracingStub() override = default; @@ -148,8 +149,6 @@ class AppConnectionsServiceTracingStub : public AppConnectionsServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -164,4 +163,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTIONS_V1_INTERNAL_APP_CONNECTIONS_TRACING_STUB_H diff --git a/google/cloud/beyondcorp/appconnectors/v1/app_connectors_client.h b/google/cloud/beyondcorp/appconnectors/v1/app_connectors_client.h index 0fe3e1a7ce4ff..43dfb62e635d7 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/app_connectors_client.h +++ b/google/cloud/beyondcorp/appconnectors/v1/app_connectors_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/appconnectors/v1/app_connectors_connection.h b/google/cloud/beyondcorp/appconnectors/v1/app_connectors_connection.h index d199e5ad2d98f..7dc7cbfecf54e 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/app_connectors_connection.h +++ b/google/cloud/beyondcorp/appconnectors/v1/app_connectors_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTORS_V1_APP_CONNECTORS_CONNECTION_H #include "google/cloud/beyondcorp/appconnectors/v1/app_connectors_connection_idempotency_policy.h" +#include "google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.pb.h" #include "google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/beyondcorp/appconnectors/v1/app_connectors_connection_idempotency_policy.h b/google/cloud/beyondcorp/appconnectors/v1/app_connectors_connection_idempotency_policy.h index 7e4add7a2232d..a71570a5e95c7 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/app_connectors_connection_idempotency_policy.h +++ b/google/cloud/beyondcorp/appconnectors/v1/app_connectors_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTORS_V1_APP_CONNECTORS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTORS_V1_APP_CONNECTORS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_auth_decorator.cc b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_auth_decorator.cc index 83a979d3b7a39..f070ef107d057 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_auth_decorator.cc +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto #include "google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_auth_decorator.h" -#include +#include "google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appconnectors_v1_internal { @@ -291,3 +294,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appconnectors_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_auth_decorator.h b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_auth_decorator.h index 097c69337a3a8..c056846553762 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_auth_decorator.h +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 beyondcorp_appconnectors_v1_internal { @@ -156,4 +159,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTORS_V1_INTERNAL_APP_CONNECTORS_AUTH_DECORATOR_H diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_connection_impl.h b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_connection_impl.h index bcd96cfcce674..352aefea9fa90 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_connection_impl.h +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_logging_decorator.cc b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_logging_decorator.cc index d015c1cb93615..6b7a04a3c2172 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_logging_decorator.cc +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto #include "google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_logging_decorator.h" +#include "google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appconnectors_v1_internal { @@ -343,3 +346,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appconnectors_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_logging_decorator.h b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_logging_decorator.h index edf5080582e16..3664a15a90fd3 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_logging_decorator.h +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 beyondcorp_appconnectors_v1_internal { @@ -156,4 +159,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTORS_V1_INTERNAL_APP_CONNECTORS_LOGGING_DECORATOR_H diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_metadata_decorator.cc b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_metadata_decorator.cc index 03ea4907257b3..e85f4fbaf84ef 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_metadata_decorator.cc +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto #include "google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_metadata_decorator.h" +#include "google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 beyondcorp_appconnectors_v1_internal { @@ -283,3 +287,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appconnectors_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_metadata_decorator.h b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_metadata_decorator.h index d8618f1049f5b..8079e4cf821d5 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_metadata_decorator.h +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 beyondcorp_appconnectors_v1_internal { @@ -162,4 +165,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTORS_V1_INTERNAL_APP_CONNECTORS_METADATA_DECORATOR_H diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_option_defaults.cc b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_option_defaults.cc index 8506a523bcba1..872fbdd351c07 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_option_defaults.cc +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_option_defaults.cc @@ -44,7 +44,7 @@ Options AppConnectorsServiceDefaultOptions(Options options) { options.set< beyondcorp_appconnectors_v1::AppConnectorsServiceRetryPolicyOption>( beyondcorp_appconnectors_v1::AppConnectorsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appconnectors_v1_internal { @@ -339,3 +342,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appconnectors_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub.h b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub.h index 47a578a0ba116..5780513255c73 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub.h +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTORS_V1_INTERNAL_APP_CONNECTORS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTORS_V1_INTERNAL_APP_CONNECTORS_STUB_H +#include "google/cloud/beyondcorp/appconnectors/v1/app_connectors_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 -#include -#include -#include +#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 beyondcorp_appconnectors_v1_internal { @@ -289,4 +292,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTORS_V1_INTERNAL_APP_CONNECTORS_STUB_H diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub_factory.cc b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub_factory.cc index ad05d1ab7cfcd..4ba43aae3cd04 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub_factory.cc +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto #include "google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub_factory.h" +#include "google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.grpc.pb.h" #include "google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_auth_decorator.h" #include "google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_logging_decorator.h" #include "google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_metadata_decorator.h" #include "google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub.h" #include "google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_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 -#include -#include -#include +#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 beyondcorp_appconnectors_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appconnectors_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub_factory.h b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub_factory.h index 113af39cca030..f15a97c33142d 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub_factory.h +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appconnectors_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTORS_V1_INTERNAL_APP_CONNECTORS_STUB_FACTORY_H diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_connection.cc b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_connection.cc index b34f9df2ffdb2..e0a559687daae 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_connection.cc +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace beyondcorp_appconnectors_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AppConnectorsServiceTracingConnection::AppConnectorsServiceTracingConnection( std::shared_ptr child) @@ -291,18 +289,14 @@ Status AppConnectorsServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAppConnectorsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_connection.h b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_connection.h index f7821a55eef54..f82d67d83e54f 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_connection.h +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace beyondcorp_appconnectors_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AppConnectorsServiceTracingConnection : public beyondcorp_appconnectors_v1::AppConnectorsServiceConnection { public: @@ -131,8 +129,6 @@ class AppConnectorsServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_stub.cc b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_stub.cc index 87aa44ec1acc0..a559bc43d4702 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_stub.cc +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appconnectors_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AppConnectorsServiceTracingStub::AppConnectorsServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -325,18 +326,14 @@ future AppConnectorsServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAppConnectorsServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appconnectors_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_stub.h b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_stub.h index 12faa23f05eec..88cce8dd01e50 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_stub.h +++ b/google/cloud/beyondcorp/appconnectors/v1/internal/app_connectors_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appconnectors_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AppConnectorsServiceTracingStub : public AppConnectorsServiceStub { public: ~AppConnectorsServiceTracingStub() override = default; @@ -152,8 +153,6 @@ class AppConnectorsServiceTracingStub : public AppConnectorsServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -168,4 +167,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPCONNECTORS_V1_INTERNAL_APP_CONNECTORS_TRACING_STUB_H diff --git a/google/cloud/beyondcorp/appgateways/v1/app_gateways_client.h b/google/cloud/beyondcorp/appgateways/v1/app_gateways_client.h index a4546e818a095..51225a729eaab 100644 --- a/google/cloud/beyondcorp/appgateways/v1/app_gateways_client.h +++ b/google/cloud/beyondcorp/appgateways/v1/app_gateways_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/appgateways/v1/app_gateways_connection.h b/google/cloud/beyondcorp/appgateways/v1/app_gateways_connection.h index 5be7808362b26..fd3aa704dbbb6 100644 --- a/google/cloud/beyondcorp/appgateways/v1/app_gateways_connection.h +++ b/google/cloud/beyondcorp/appgateways/v1/app_gateways_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPGATEWAYS_V1_APP_GATEWAYS_CONNECTION_H #include "google/cloud/beyondcorp/appgateways/v1/app_gateways_connection_idempotency_policy.h" +#include "google/cloud/beyondcorp/appgateways/v1/app_gateways_service.pb.h" #include "google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/beyondcorp/appgateways/v1/app_gateways_connection_idempotency_policy.h b/google/cloud/beyondcorp/appgateways/v1/app_gateways_connection_idempotency_policy.h index 413008cb33a4c..639d2ce9e13b0 100644 --- a/google/cloud/beyondcorp/appgateways/v1/app_gateways_connection_idempotency_policy.h +++ b/google/cloud/beyondcorp/appgateways/v1/app_gateways_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPGATEWAYS_V1_APP_GATEWAYS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPGATEWAYS_V1_APP_GATEWAYS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/beyondcorp/appgateways/v1/app_gateways_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_auth_decorator.cc b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_auth_decorator.cc index bce20174bbbf3..573f305d47ef8 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_auth_decorator.cc +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto #include "google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_auth_decorator.h" -#include +#include "google/cloud/beyondcorp/appgateways/v1/app_gateways_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appgateways_v1_internal { @@ -228,3 +231,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appgateways_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_auth_decorator.h b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_auth_decorator.h index 1817a6e3e65d0..6475c2b247154 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_auth_decorator.h +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 beyondcorp_appgateways_v1_internal { @@ -133,4 +136,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPGATEWAYS_V1_INTERNAL_APP_GATEWAYS_AUTH_DECORATOR_H diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_connection_impl.h b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_connection_impl.h index d83207209b50c..40ca52a49e8f4 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_connection_impl.h +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_logging_decorator.cc b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_logging_decorator.cc index 334a70137cca1..df8bcbe73e90a 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_logging_decorator.cc +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto #include "google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_logging_decorator.h" +#include "google/cloud/beyondcorp/appgateways/v1/app_gateways_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appgateways_v1_internal { @@ -274,3 +277,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appgateways_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_logging_decorator.h b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_logging_decorator.h index 2bb57552f98b7..302f7631cd6e5 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_logging_decorator.h +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 beyondcorp_appgateways_v1_internal { @@ -133,4 +136,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPGATEWAYS_V1_INTERNAL_APP_GATEWAYS_LOGGING_DECORATOR_H diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_metadata_decorator.cc b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_metadata_decorator.cc index 240458625edbe..57ae7cc175e4f 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_metadata_decorator.cc +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto #include "google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_metadata_decorator.h" +#include "google/cloud/beyondcorp/appgateways/v1/app_gateways_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 beyondcorp_appgateways_v1_internal { @@ -230,3 +234,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appgateways_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_metadata_decorator.h b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_metadata_decorator.h index 7b1b60c901def..dfdb0a404c8a7 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_metadata_decorator.h +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 beyondcorp_appgateways_v1_internal { @@ -139,4 +142,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPGATEWAYS_V1_INTERNAL_APP_GATEWAYS_METADATA_DECORATOR_H diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_option_defaults.cc b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_option_defaults.cc index d0e69eaeca38c..b99158652991d 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_option_defaults.cc +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_option_defaults.cc @@ -43,7 +43,7 @@ Options AppGatewaysServiceDefaultOptions(Options options) { beyondcorp_appgateways_v1::AppGatewaysServiceRetryPolicyOption>()) { options.set( beyondcorp_appgateways_v1::AppGatewaysServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub.cc b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub.cc index f940a29c0ea84..4b60a55c71f7f 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub.cc +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto #include "google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub.h" +#include "google/cloud/beyondcorp/appgateways/v1/app_gateways_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appgateways_v1_internal { @@ -271,3 +274,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appgateways_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub.h b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub.h index 788d012b0b0be..5614bf6e89835 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub.h +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPGATEWAYS_V1_INTERNAL_APP_GATEWAYS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPGATEWAYS_V1_INTERNAL_APP_GATEWAYS_STUB_H +#include "google/cloud/beyondcorp/appgateways/v1/app_gateways_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 -#include -#include -#include +#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 beyondcorp_appgateways_v1_internal { @@ -246,4 +249,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPGATEWAYS_V1_INTERNAL_APP_GATEWAYS_STUB_H diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub_factory.cc b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub_factory.cc index ae7a851730fa4..c02f91966dc5d 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub_factory.cc +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto #include "google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub_factory.h" +#include "google/cloud/beyondcorp/appgateways/v1/app_gateways_service.grpc.pb.h" #include "google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_auth_decorator.h" #include "google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_logging_decorator.h" #include "google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_metadata_decorator.h" #include "google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub.h" #include "google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_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 -#include -#include -#include +#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 beyondcorp_appgateways_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appgateways_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub_factory.h b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub_factory.h index 0a7f349f9cce4..8ca34771c9795 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub_factory.h +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appgateways_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPGATEWAYS_V1_INTERNAL_APP_GATEWAYS_STUB_FACTORY_H diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_connection.cc b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_connection.cc index c349cf6cf3e3a..94c12965cfed6 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_connection.cc +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace beyondcorp_appgateways_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AppGatewaysServiceTracingConnection::AppGatewaysServiceTracingConnection( std::shared_ptr child) @@ -217,18 +215,14 @@ Status AppGatewaysServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAppGatewaysServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_connection.h b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_connection.h index d9ac514a90782..e4692ebf654a2 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_connection.h +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace beyondcorp_appgateways_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AppGatewaysServiceTracingConnection : public beyondcorp_appgateways_v1::AppGatewaysServiceConnection { public: @@ -111,8 +109,6 @@ class AppGatewaysServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_stub.cc b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_stub.cc index d476254114146..5831078b4eaf4 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_stub.cc +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appgateways_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AppGatewaysServiceTracingStub::AppGatewaysServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -263,18 +264,14 @@ future AppGatewaysServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAppGatewaysServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace beyondcorp_appgateways_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_stub.h b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_stub.h index b5fac507432e1..d105333dbc3ff 100644 --- a/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_stub.h +++ b/google/cloud/beyondcorp/appgateways/v1/internal/app_gateways_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace beyondcorp_appgateways_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AppGatewaysServiceTracingStub : public AppGatewaysServiceStub { public: ~AppGatewaysServiceTracingStub() override = default; @@ -129,8 +130,6 @@ class AppGatewaysServiceTracingStub : public AppGatewaysServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -145,4 +144,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_APPGATEWAYS_V1_INTERNAL_APP_GATEWAYS_TRACING_STUB_H diff --git a/google/cloud/beyondcorp/mocks/mock_app_connections_connection.h b/google/cloud/beyondcorp/mocks/mock_app_connections_connection.h deleted file mode 100644 index a0d3fe2ab466c..0000000000000 --- a/google/cloud/beyondcorp/mocks/mock_app_connections_connection.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: -// google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_MOCKS_MOCK_APP_CONNECTIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_MOCKS_MOCK_APP_CONNECTIONS_CONNECTION_H - -#include "google/cloud/beyondcorp/app_connections_connection.h" -#include "google/cloud/beyondcorp/appconnections/v1/mocks/mock_app_connections_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in beyondcorp_appconnections_v1_mocks instead of the -/// aliases defined in this namespace. -namespace beyondcorp_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// beyondcorp_appconnections_v1_mocks::MockAppConnectionsServiceConnection -/// directly. -using ::google::cloud::beyondcorp_appconnections_v1_mocks:: - MockAppConnectionsServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_MOCKS_MOCK_APP_CONNECTIONS_CONNECTION_H diff --git a/google/cloud/beyondcorp/mocks/mock_app_connectors_connection.h b/google/cloud/beyondcorp/mocks/mock_app_connectors_connection.h deleted file mode 100644 index c0c9e4c3ba6c7..0000000000000 --- a/google/cloud/beyondcorp/mocks/mock_app_connectors_connection.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_MOCKS_MOCK_APP_CONNECTORS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_MOCKS_MOCK_APP_CONNECTORS_CONNECTION_H - -#include "google/cloud/beyondcorp/app_connectors_connection.h" -#include "google/cloud/beyondcorp/appconnectors/v1/mocks/mock_app_connectors_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in beyondcorp_appconnectors_v1_mocks instead of the -/// aliases defined in this namespace. -namespace beyondcorp_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// beyondcorp_appconnectors_v1_mocks::MockAppConnectorsServiceConnection -/// directly. -using ::google::cloud::beyondcorp_appconnectors_v1_mocks:: - MockAppConnectorsServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_MOCKS_MOCK_APP_CONNECTORS_CONNECTION_H diff --git a/google/cloud/beyondcorp/mocks/mock_app_gateways_connection.h b/google/cloud/beyondcorp/mocks/mock_app_gateways_connection.h deleted file mode 100644 index d561b025cd2d4..0000000000000 --- a/google/cloud/beyondcorp/mocks/mock_app_gateways_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_MOCKS_MOCK_APP_GATEWAYS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_MOCKS_MOCK_APP_GATEWAYS_CONNECTION_H - -#include "google/cloud/beyondcorp/app_gateways_connection.h" -#include "google/cloud/beyondcorp/appgateways/v1/mocks/mock_app_gateways_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in beyondcorp_appgateways_v1_mocks instead of the aliases -/// defined in this namespace. -namespace beyondcorp_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// beyondcorp_appgateways_v1_mocks::MockAppGatewaysServiceConnection directly. -using ::google::cloud::beyondcorp_appgateways_v1_mocks:: - MockAppGatewaysServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace beyondcorp_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BEYONDCORP_MOCKS_MOCK_APP_GATEWAYS_CONNECTION_H diff --git a/google/cloud/beyondcorp/quickstart/.bazelrc b/google/cloud/beyondcorp/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/beyondcorp/quickstart/.bazelrc +++ b/google/cloud/beyondcorp/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/beyondcorp/quickstart/CMakeLists.txt index bcbcd6f778cee..00e6d31b05121 100644 --- a/google/cloud/beyondcorp/quickstart/CMakeLists.txt +++ b/google/cloud/beyondcorp/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the BeyondCorp API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-beyondcorp-quickstart CXX) find_package(google_cloud_cpp_beyondcorp REQUIRED) diff --git a/google/cloud/beyondcorp/quickstart/WORKSPACE.bazel b/google/cloud/beyondcorp/quickstart/WORKSPACE.bazel index 0fffc897acb57..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 = "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/bigquery/BUILD.bazel b/google/cloud/bigquery/BUILD.bazel index fa8bc6047c540..11484888b4822 100644 --- a/google/cloud/bigquery/BUILD.bazel +++ b/google/cloud/bigquery/BUILD.bazel @@ -23,7 +23,6 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "biglake/v1/", "analyticshub/v1/", "connection/v1/", @@ -38,16 +37,16 @@ service_dirs = [ src_dirs = service_dirs + [d + "internal/" for d in service_dirs] googleapis_deps = [ - "@com_google_googleapis//google/cloud/bigquery/analyticshub/v1:analyticshub_cc_grpc", - "@com_google_googleapis//google/cloud/bigquery/biglake/v1:biglake_cc_grpc", - "@com_google_googleapis//google/cloud/bigquery/connection/v1:connection_cc_grpc", - "@com_google_googleapis//google/cloud/bigquery/datapolicies/v1:datapolicies_cc_grpc", - "@com_google_googleapis//google/cloud/bigquery/datapolicies/v2:datapolicies_cc_grpc", - "@com_google_googleapis//google/cloud/bigquery/datatransfer/v1:datatransfer_cc_grpc", - "@com_google_googleapis//google/cloud/bigquery/logging/v1:logging_cc_grpc", - "@com_google_googleapis//google/cloud/bigquery/migration/v2:migration_cc_grpc", - "@com_google_googleapis//google/cloud/bigquery/reservation/v1:reservation_cc_grpc", - "@com_google_googleapis//google/cloud/bigquery/storage/v1:storage_cc_grpc", + "@googleapis//google/cloud/bigquery/analyticshub/v1:analyticshub_cc_grpc", + "@googleapis//google/cloud/bigquery/biglake/v1:biglake_cc_grpc", + "@googleapis//google/cloud/bigquery/connection/v1:connection_cc_grpc", + "@googleapis//google/cloud/bigquery/datapolicies/v1:datapolicies_cc_grpc", + "@googleapis//google/cloud/bigquery/datapolicies/v2:datapolicies_cc_grpc", + "@googleapis//google/cloud/bigquery/datatransfer/v1:datatransfer_cc_grpc", + "@googleapis//google/cloud/bigquery/logging/v1:logging_cc_grpc", + "@googleapis//google/cloud/bigquery/migration/v2:migration_cc_grpc", + "@googleapis//google/cloud/bigquery/reservation/v1:reservation_cc_grpc", + "@googleapis//google/cloud/bigquery/storage/v1:storage_cc_grpc", ] cc_gapic_library( @@ -85,7 +84,7 @@ cc_library( visibility = ["//:__subpackages__"], deps = [ ":google_cloud_cpp_bigquery_rest", - "@com_google_googletest//:gtest", + "@googletest//:gtest", ], ) @@ -100,7 +99,7 @@ cc_library( ":google_cloud_cpp_bigquery_rest_mocks", "//:common", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) @@ -114,6 +113,6 @@ cc_library( "//google/cloud:google_cloud_cpp_mocks", "//google/cloud/testing_util:google_cloud_cpp_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_rest_private", - "@com_google_googletest//:gtest", + "@googletest//:gtest", ], ) for test in bigquery_rest_unit_tests] diff --git a/google/cloud/bigquery/analytics_hub_client.h b/google/cloud/bigquery/analytics_hub_client.h deleted file mode 100644 index f5cca725c6ce2..0000000000000 --- a/google/cloud/bigquery/analytics_hub_client.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICS_HUB_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICS_HUB_CLIENT_H - -#include "google/cloud/bigquery/analytics_hub_connection.h" -#include "google/cloud/bigquery/analyticshub/v1/analytics_hub_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_analyticshub_v1 instead of the aliases defined -/// in this namespace. -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_analyticshub_v1::AnalyticsHubServiceClient -/// directly. -using ::google::cloud::bigquery_analyticshub_v1::AnalyticsHubServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICS_HUB_CLIENT_H diff --git a/google/cloud/bigquery/analytics_hub_connection.h b/google/cloud/bigquery/analytics_hub_connection.h deleted file mode 100644 index 4caa9a09b2a70..0000000000000 --- a/google/cloud/bigquery/analytics_hub_connection.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICS_HUB_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICS_HUB_CONNECTION_H - -#include "google/cloud/bigquery/analytics_hub_connection_idempotency_policy.h" -#include "google/cloud/bigquery/analyticshub/v1/analytics_hub_connection.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_analyticshub_v1::MakeAnalyticsHubServiceConnection -/// directly. -using ::google::cloud::bigquery_analyticshub_v1:: - MakeAnalyticsHubServiceConnection; - -/// @deprecated Use bigquery_analyticshub_v1::AnalyticsHubServiceConnection -/// directly. -using ::google::cloud::bigquery_analyticshub_v1::AnalyticsHubServiceConnection; - -/// @deprecated Use -/// bigquery_analyticshub_v1::AnalyticsHubServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::bigquery_analyticshub_v1:: - AnalyticsHubServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// bigquery_analyticshub_v1::AnalyticsHubServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::bigquery_analyticshub_v1:: - AnalyticsHubServiceLimitedTimeRetryPolicy; - -/// @deprecated Use bigquery_analyticshub_v1::AnalyticsHubServiceRetryPolicy -/// directly. -using ::google::cloud::bigquery_analyticshub_v1::AnalyticsHubServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICS_HUB_CONNECTION_H diff --git a/google/cloud/bigquery/analytics_hub_connection_idempotency_policy.h b/google/cloud/bigquery/analytics_hub_connection_idempotency_policy.h deleted file mode 100644 index bb371e89fed4c..0000000000000 --- a/google/cloud/bigquery/analytics_hub_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICS_HUB_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICS_HUB_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/bigquery/analyticshub/v1/analytics_hub_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_analyticshub_v1::MakeDefaultAnalyticsHubServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::bigquery_analyticshub_v1:: - MakeDefaultAnalyticsHubServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// bigquery_analyticshub_v1::AnalyticsHubServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::bigquery_analyticshub_v1:: - AnalyticsHubServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICS_HUB_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/bigquery/analytics_hub_options.h b/google/cloud/bigquery/analytics_hub_options.h deleted file mode 100644 index d538cdf852634..0000000000000 --- a/google/cloud/bigquery/analytics_hub_options.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICS_HUB_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICS_HUB_OPTIONS_H - -#include "google/cloud/bigquery/analytics_hub_connection.h" -#include "google/cloud/bigquery/analytics_hub_connection_idempotency_policy.h" -#include "google/cloud/bigquery/analyticshub/v1/analytics_hub_options.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_analyticshub_v1::AnalyticsHubServicePollingPolicyOption directly. -using ::google::cloud::bigquery_analyticshub_v1:: - AnalyticsHubServicePollingPolicyOption; - -/// @deprecated Use -/// bigquery_analyticshub_v1::AnalyticsHubServiceBackoffPolicyOption directly. -using ::google::cloud::bigquery_analyticshub_v1:: - AnalyticsHubServiceBackoffPolicyOption; - -/// @deprecated Use -/// bigquery_analyticshub_v1::AnalyticsHubServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::bigquery_analyticshub_v1:: - AnalyticsHubServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use -/// bigquery_analyticshub_v1::AnalyticsHubServicePolicyOptionList directly. -using ::google::cloud::bigquery_analyticshub_v1:: - AnalyticsHubServicePolicyOptionList; - -/// @deprecated Use -/// bigquery_analyticshub_v1::AnalyticsHubServiceRetryPolicyOption directly. -using ::google::cloud::bigquery_analyticshub_v1:: - AnalyticsHubServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICS_HUB_OPTIONS_H diff --git a/google/cloud/bigquery/analyticshub/v1/analytics_hub_client.h b/google/cloud/bigquery/analyticshub/v1/analytics_hub_client.h index ab56fa6c65f12..9c9db6346b4b7 100644 --- a/google/cloud/bigquery/analyticshub/v1/analytics_hub_client.h +++ b/google/cloud/bigquery/analyticshub/v1/analytics_hub_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/bigquery/analyticshub/v1/analytics_hub_connection.h b/google/cloud/bigquery/analyticshub/v1/analytics_hub_connection.h index 5ff4adc99c788..f9b74258d06b1 100644 --- a/google/cloud/bigquery/analyticshub/v1/analytics_hub_connection.h +++ b/google/cloud/bigquery/analyticshub/v1/analytics_hub_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICSHUB_V1_ANALYTICS_HUB_CONNECTION_H #include "google/cloud/bigquery/analyticshub/v1/analytics_hub_connection_idempotency_policy.h" +#include "google/cloud/bigquery/analyticshub/v1/analyticshub.pb.h" #include "google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/bigquery/analyticshub/v1/analytics_hub_connection_idempotency_policy.h b/google/cloud/bigquery/analyticshub/v1/analytics_hub_connection_idempotency_policy.h index 11f883ab91bdc..0b5bdeb74d6ad 100644 --- a/google/cloud/bigquery/analyticshub/v1/analytics_hub_connection_idempotency_policy.h +++ b/google/cloud/bigquery/analyticshub/v1/analytics_hub_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICSHUB_V1_ANALYTICS_HUB_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICSHUB_V1_ANALYTICS_HUB_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/analyticshub/v1/analyticshub.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_auth_decorator.cc b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_auth_decorator.cc index c10c52da05983..c79f1776b9cb0 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_auth_decorator.cc +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto #include "google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_auth_decorator.h" -#include +#include "google/cloud/bigquery/analyticshub/v1/analyticshub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_analyticshub_v1_internal { @@ -418,3 +421,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_analyticshub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_auth_decorator.h b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_auth_decorator.h index 28040cd3fe87f..29d18d66f6560 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_auth_decorator.h +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 bigquery_analyticshub_v1_internal { @@ -236,4 +239,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICSHUB_V1_INTERNAL_ANALYTICS_HUB_AUTH_DECORATOR_H diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_connection_impl.h b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_connection_impl.h index f6649c7eccc0b..a0060132752c2 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_connection_impl.h +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_logging_decorator.cc b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_logging_decorator.cc index c71db34cb5a23..c0d6aa9eb2a4c 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_logging_decorator.cc +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto #include "google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_logging_decorator.h" +#include "google/cloud/bigquery/analyticshub/v1/analyticshub.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_analyticshub_v1_internal { @@ -536,3 +539,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_analyticshub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_logging_decorator.h b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_logging_decorator.h index 7c27d2cc2518e..d641062d75c1f 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_logging_decorator.h +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 bigquery_analyticshub_v1_internal { @@ -236,4 +239,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICSHUB_V1_INTERNAL_ANALYTICS_HUB_LOGGING_DECORATOR_H diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_metadata_decorator.cc b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_metadata_decorator.cc index 00c50a400954f..b9b73d6a5ed26 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_metadata_decorator.cc +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto #include "google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_metadata_decorator.h" +#include "google/cloud/bigquery/analyticshub/v1/analyticshub.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 bigquery_analyticshub_v1_internal { @@ -417,3 +421,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_analyticshub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_metadata_decorator.h b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_metadata_decorator.h index 494d8b2c29306..3b9358436ae31 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_metadata_decorator.h +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 bigquery_analyticshub_v1_internal { @@ -242,4 +245,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICSHUB_V1_INTERNAL_ANALYTICS_HUB_METADATA_DECORATOR_H diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_option_defaults.cc b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_option_defaults.cc index 75da1da7b9644..9f02230aff358 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_option_defaults.cc +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_option_defaults.cc @@ -43,7 +43,7 @@ Options AnalyticsHubServiceDefaultOptions(Options options) { bigquery_analyticshub_v1::AnalyticsHubServiceRetryPolicyOption>()) { options.set( bigquery_analyticshub_v1::AnalyticsHubServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub.cc b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub.cc index 0f2e671046b5c..de898030c73d5 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub.cc +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto #include "google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub.h" +#include "google/cloud/bigquery/analyticshub/v1/analyticshub.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_analyticshub_v1_internal { @@ -510,3 +513,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_analyticshub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub.h b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub.h index c77da72a36266..8f05aa0534394 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub.h +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICSHUB_V1_INTERNAL_ANALYTICS_HUB_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICSHUB_V1_INTERNAL_ANALYTICS_HUB_STUB_H +#include "google/cloud/bigquery/analyticshub/v1/analyticshub.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_analyticshub_v1_internal { @@ -445,4 +448,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICSHUB_V1_INTERNAL_ANALYTICS_HUB_STUB_H diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub_factory.cc b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub_factory.cc index a51b6b0a8ece6..d646089a1c9f4 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub_factory.cc +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto #include "google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub_factory.h" +#include "google/cloud/bigquery/analyticshub/v1/analyticshub.grpc.pb.h" #include "google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_auth_decorator.h" #include "google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_logging_decorator.h" #include "google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_analyticshub_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_analyticshub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub_factory.h b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub_factory.h index 8506c20f6bc08..766af722c7040 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub_factory.h +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_analyticshub_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICSHUB_V1_INTERNAL_ANALYTICS_HUB_STUB_FACTORY_H diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_connection.cc b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_connection.cc index b9c7defede782..90073cfe991bb 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_connection.cc +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigquery_analyticshub_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AnalyticsHubServiceTracingConnection::AnalyticsHubServiceTracingConnection( std::shared_ptr child) @@ -435,18 +433,14 @@ AnalyticsHubServiceTracingConnection::ApproveQueryTemplate( return internal::EndSpan(*span, child_->ApproveQueryTemplate(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAnalyticsHubServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_connection.h b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_connection.h index 0a88db7b76706..019bfcf07147d 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_connection.h +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquery_analyticshub_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AnalyticsHubServiceTracingConnection : public bigquery_analyticshub_v1::AnalyticsHubServiceConnection { public: @@ -196,8 +194,6 @@ class AnalyticsHubServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_stub.cc b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_stub.cc index 50ffa4fc889c0..35ab9f9a00969 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_stub.cc +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_analyticshub_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AnalyticsHubServiceTracingStub::AnalyticsHubServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -512,18 +513,14 @@ future AnalyticsHubServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAnalyticsHubServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_analyticshub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_stub.h b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_stub.h index d197183eeff11..4c599319f0d41 100644 --- a/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_stub.h +++ b/google/cloud/bigquery/analyticshub/v1/internal/analytics_hub_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_analyticshub_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AnalyticsHubServiceTracingStub : public AnalyticsHubServiceStub { public: ~AnalyticsHubServiceTracingStub() override = default; @@ -232,8 +233,6 @@ class AnalyticsHubServiceTracingStub : public AnalyticsHubServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -248,4 +247,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_ANALYTICSHUB_V1_INTERNAL_ANALYTICS_HUB_TRACING_STUB_H diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_auth_decorator.cc b/google/cloud/bigquery/biglake/v1/internal/metastore_auth_decorator.cc index 6766f9444a4f0..92db5f8d43252 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_auth_decorator.cc +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/bigquery/biglake/v1/metastore.proto #include "google/cloud/bigquery/biglake/v1/internal/metastore_auth_decorator.h" -#include +#include "google/cloud/bigquery/biglake/v1/metastore.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_biglake_v1_internal { @@ -173,3 +176,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_biglake_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_auth_decorator.h b/google/cloud/bigquery/biglake/v1/internal/metastore_auth_decorator.h index c855069afc11e..c2ccb4672792e 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_auth_decorator.h +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_biglake_v1_internal { @@ -124,4 +127,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_INTERNAL_METASTORE_AUTH_DECORATOR_H diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_logging_decorator.cc b/google/cloud/bigquery/biglake/v1/internal/metastore_logging_decorator.cc index 2261f80e6c736..3c1fad175269b 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_logging_decorator.cc +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/bigquery/biglake/v1/metastore.proto #include "google/cloud/bigquery/biglake/v1/internal/metastore_logging_decorator.h" +#include "google/cloud/bigquery/biglake/v1/metastore.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_biglake_v1_internal { @@ -237,3 +240,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_biglake_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_logging_decorator.h b/google/cloud/bigquery/biglake/v1/internal/metastore_logging_decorator.h index ba902dfadc240..61f43b65dc6ed 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_logging_decorator.h +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_biglake_v1_internal { @@ -124,4 +127,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_INTERNAL_METASTORE_LOGGING_DECORATOR_H diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_metadata_decorator.cc b/google/cloud/bigquery/biglake/v1/internal/metastore_metadata_decorator.cc index 3464c99390b47..f1af220946b27 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_metadata_decorator.cc +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/bigquery/biglake/v1/metastore.proto #include "google/cloud/bigquery/biglake/v1/internal/metastore_metadata_decorator.h" +#include "google/cloud/bigquery/biglake/v1/metastore.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 bigquery_biglake_v1_internal { @@ -201,3 +205,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_biglake_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_metadata_decorator.h b/google/cloud/bigquery/biglake/v1/internal/metastore_metadata_decorator.h index f09915397a47a..d03baabf91428 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_metadata_decorator.h +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_biglake_v1_internal { @@ -130,4 +133,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_INTERNAL_METASTORE_METADATA_DECORATOR_H diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_option_defaults.cc b/google/cloud/bigquery/biglake/v1/internal/metastore_option_defaults.cc index 781fca3044b15..aa9cd618bbbbe 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_option_defaults.cc +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_option_defaults.cc @@ -41,7 +41,7 @@ Options MetastoreServiceDefaultOptions(Options options) { if (!options.has()) { options.set( bigquery_biglake_v1::MetastoreServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_stub.cc b/google/cloud/bigquery/biglake/v1/internal/metastore_stub.cc index 07f81506dd82b..2add2591aa5cb 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_stub.cc +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/bigquery/biglake/v1/metastore.proto #include "google/cloud/bigquery/biglake/v1/internal/metastore_stub.h" +#include "google/cloud/bigquery/biglake/v1/metastore.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_biglake_v1_internal { @@ -217,3 +220,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_biglake_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_stub.h b/google/cloud/bigquery/biglake/v1/internal/metastore_stub.h index 5814b1b7a0513..6f2b2e7861726 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_stub.h +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_INTERNAL_METASTORE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_INTERNAL_METASTORE_STUB_H +#include "google/cloud/bigquery/biglake/v1/metastore.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_biglake_v1_internal { @@ -209,4 +212,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_INTERNAL_METASTORE_STUB_H diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_stub_factory.cc b/google/cloud/bigquery/biglake/v1/internal/metastore_stub_factory.cc index 49c09175ac5cc..0d1d9d487e752 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_stub_factory.cc +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/bigquery/biglake/v1/internal/metastore_metadata_decorator.h" #include "google/cloud/bigquery/biglake/v1/internal/metastore_stub.h" #include "google/cloud/bigquery/biglake/v1/internal/metastore_tracing_stub.h" +#include "google/cloud/bigquery/biglake/v1/metastore.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_biglake_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_biglake_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_stub_factory.h b/google/cloud/bigquery/biglake/v1/internal/metastore_stub_factory.h index 207680adfd3cb..3b6bd7ddb9760 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_stub_factory.h +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_biglake_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_INTERNAL_METASTORE_STUB_FACTORY_H diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_connection.cc b/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_connection.cc index cbd27bd3de629..489eab0fcac8d 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_connection.cc +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigquery_biglake_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MetastoreServiceTracingConnection::MetastoreServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -180,16 +178,12 @@ MetastoreServiceTracingConnection::ListTables( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMetastoreServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_connection.h b/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_connection.h index bba0c07a2a350..60c1b478f06ec 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_connection.h +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquery_biglake_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MetastoreServiceTracingConnection : public bigquery_biglake_v1::MetastoreServiceConnection { public: @@ -103,8 +101,6 @@ class MetastoreServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_stub.cc b/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_stub.cc index cd6918c3b4adf..587ce56886f11 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_stub.cc +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_biglake_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MetastoreServiceTracingStub::MetastoreServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -215,18 +216,14 @@ MetastoreServiceTracingStub::ListTables( child_->ListTables(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMetastoreServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_biglake_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_stub.h b/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_stub.h index fa7cc6db3ad74..282d1b30fb721 100644 --- a/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_stub.h +++ b/google/cloud/bigquery/biglake/v1/internal/metastore_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_biglake_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MetastoreServiceTracingStub : public MetastoreServiceStub { public: ~MetastoreServiceTracingStub() override = default; @@ -121,8 +122,6 @@ class MetastoreServiceTracingStub : public MetastoreServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -137,4 +136,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_INTERNAL_METASTORE_TRACING_STUB_H diff --git a/google/cloud/bigquery/biglake/v1/metastore_connection.h b/google/cloud/bigquery/biglake/v1/metastore_connection.h index acf97201beea7..d3b2b2fb07547 100644 --- a/google/cloud/bigquery/biglake/v1/metastore_connection.h +++ b/google/cloud/bigquery/biglake/v1/metastore_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_METASTORE_CONNECTION_H #include "google/cloud/bigquery/biglake/v1/internal/metastore_retry_traits.h" +#include "google/cloud/bigquery/biglake/v1/metastore.pb.h" #include "google/cloud/bigquery/biglake/v1/metastore_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/biglake/v1/metastore_connection_idempotency_policy.h b/google/cloud/bigquery/biglake/v1/metastore_connection_idempotency_policy.h index 07a3e2484e814..7845dfca91250 100644 --- a/google/cloud/bigquery/biglake/v1/metastore_connection_idempotency_policy.h +++ b/google/cloud/bigquery/biglake/v1/metastore_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_METASTORE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_METASTORE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/biglake/v1/metastore.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/bigquery_read_client.h b/google/cloud/bigquery/bigquery_read_client.h deleted file mode 100644 index afffa9ded2bf5..0000000000000 --- a/google/cloud/bigquery/bigquery_read_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/storage/v1/storage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_READ_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_READ_CLIENT_H - -#include "google/cloud/bigquery/bigquery_read_connection.h" -#include "google/cloud/bigquery/storage/v1/bigquery_read_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_storage_v1 instead of the aliases defined in -/// this namespace. -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_storage_v1::BigQueryReadClient directly. -using ::google::cloud::bigquery_storage_v1::BigQueryReadClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_READ_CLIENT_H diff --git a/google/cloud/bigquery/bigquery_read_connection.h b/google/cloud/bigquery/bigquery_read_connection.h deleted file mode 100644 index 6326dcfbd6369..0000000000000 --- a/google/cloud/bigquery/bigquery_read_connection.h +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/storage/v1/storage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_READ_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_READ_CONNECTION_H - -#include "google/cloud/bigquery/bigquery_read_connection_idempotency_policy.h" -#include "google/cloud/bigquery/storage/v1/bigquery_read_connection.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_storage_v1::MakeBigQueryReadConnection directly. -using ::google::cloud::bigquery_storage_v1::MakeBigQueryReadConnection; - -/// @deprecated Use bigquery_storage_v1::BigQueryReadConnection directly. -using ::google::cloud::bigquery_storage_v1::BigQueryReadConnection; - -/// @deprecated Use -/// bigquery_storage_v1::BigQueryReadLimitedErrorCountRetryPolicy directly. -using ::google::cloud::bigquery_storage_v1:: - BigQueryReadLimitedErrorCountRetryPolicy; - -/// @deprecated Use bigquery_storage_v1::BigQueryReadLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::bigquery_storage_v1::BigQueryReadLimitedTimeRetryPolicy; - -/// @deprecated Use bigquery_storage_v1::BigQueryReadRetryPolicy directly. -using ::google::cloud::bigquery_storage_v1::BigQueryReadRetryPolicy; - -GOOGLE_CLOUD_CPP_DEPRECATED( - "applications should not need this." - " Please file a bug at https://github.com/googleapis/google-cloud-cpp" - " if you do.") -void BigQueryReadReadRowsStreamingUpdater( - google::cloud::bigquery::storage::v1::ReadRowsResponse const& response, - google::cloud::bigquery::storage::v1::ReadRowsRequest& request); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_READ_CONNECTION_H diff --git a/google/cloud/bigquery/bigquery_read_connection_idempotency_policy.h b/google/cloud/bigquery/bigquery_read_connection_idempotency_policy.h deleted file mode 100644 index f3dde2491de48..0000000000000 --- a/google/cloud/bigquery/bigquery_read_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/storage/v1/storage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_READ_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_READ_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/bigquery/storage/v1/bigquery_read_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_storage_v1::MakeDefaultBigQueryReadConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::bigquery_storage_v1:: - MakeDefaultBigQueryReadConnectionIdempotencyPolicy; - -/// @deprecated Use bigquery_storage_v1::BigQueryReadConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::bigquery_storage_v1:: - BigQueryReadConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_READ_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/bigquery/bigquery_read_options.h b/google/cloud/bigquery/bigquery_read_options.h deleted file mode 100644 index 264828d43bbd3..0000000000000 --- a/google/cloud/bigquery/bigquery_read_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/storage/v1/storage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_READ_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_READ_OPTIONS_H - -#include "google/cloud/bigquery/bigquery_read_connection.h" -#include "google/cloud/bigquery/bigquery_read_connection_idempotency_policy.h" -#include "google/cloud/bigquery/storage/v1/bigquery_read_options.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_storage_v1::BigQueryReadBackoffPolicyOption -/// directly. -using ::google::cloud::bigquery_storage_v1::BigQueryReadBackoffPolicyOption; - -/// @deprecated Use -/// bigquery_storage_v1::BigQueryReadConnectionIdempotencyPolicyOption directly. -using ::google::cloud::bigquery_storage_v1:: - BigQueryReadConnectionIdempotencyPolicyOption; - -/// @deprecated Use bigquery_storage_v1::BigQueryReadPolicyOptionList directly. -using ::google::cloud::bigquery_storage_v1::BigQueryReadPolicyOptionList; - -/// @deprecated Use bigquery_storage_v1::BigQueryReadRetryPolicyOption directly. -using ::google::cloud::bigquery_storage_v1::BigQueryReadRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_READ_OPTIONS_H diff --git a/google/cloud/bigquery/bigquery_write_client.h b/google/cloud/bigquery/bigquery_write_client.h deleted file mode 100644 index b28e7676cbe91..0000000000000 --- a/google/cloud/bigquery/bigquery_write_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/storage/v1/storage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_WRITE_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_WRITE_CLIENT_H - -#include "google/cloud/bigquery/bigquery_write_connection.h" -#include "google/cloud/bigquery/storage/v1/bigquery_write_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_storage_v1 instead of the aliases defined in -/// this namespace. -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_storage_v1::BigQueryWriteClient directly. -using ::google::cloud::bigquery_storage_v1::BigQueryWriteClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_WRITE_CLIENT_H diff --git a/google/cloud/bigquery/bigquery_write_connection.h b/google/cloud/bigquery/bigquery_write_connection.h deleted file mode 100644 index 29be103d41960..0000000000000 --- a/google/cloud/bigquery/bigquery_write_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/storage/v1/storage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_WRITE_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_WRITE_CONNECTION_H - -#include "google/cloud/bigquery/bigquery_write_connection_idempotency_policy.h" -#include "google/cloud/bigquery/storage/v1/bigquery_write_connection.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_storage_v1::MakeBigQueryWriteConnection directly. -using ::google::cloud::bigquery_storage_v1::MakeBigQueryWriteConnection; - -/// @deprecated Use bigquery_storage_v1::BigQueryWriteConnection directly. -using ::google::cloud::bigquery_storage_v1::BigQueryWriteConnection; - -/// @deprecated Use -/// bigquery_storage_v1::BigQueryWriteLimitedErrorCountRetryPolicy directly. -using ::google::cloud::bigquery_storage_v1:: - BigQueryWriteLimitedErrorCountRetryPolicy; - -/// @deprecated Use bigquery_storage_v1::BigQueryWriteLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::bigquery_storage_v1::BigQueryWriteLimitedTimeRetryPolicy; - -/// @deprecated Use bigquery_storage_v1::BigQueryWriteRetryPolicy directly. -using ::google::cloud::bigquery_storage_v1::BigQueryWriteRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_WRITE_CONNECTION_H diff --git a/google/cloud/bigquery/bigquery_write_connection_idempotency_policy.h b/google/cloud/bigquery/bigquery_write_connection_idempotency_policy.h deleted file mode 100644 index e13b586bd34d4..0000000000000 --- a/google/cloud/bigquery/bigquery_write_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/storage/v1/storage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_WRITE_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_WRITE_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/bigquery/storage/v1/bigquery_write_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_storage_v1::MakeDefaultBigQueryWriteConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::bigquery_storage_v1:: - MakeDefaultBigQueryWriteConnectionIdempotencyPolicy; - -/// @deprecated Use -/// bigquery_storage_v1::BigQueryWriteConnectionIdempotencyPolicy directly. -using ::google::cloud::bigquery_storage_v1:: - BigQueryWriteConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_WRITE_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/bigquery/bigquery_write_options.h b/google/cloud/bigquery/bigquery_write_options.h deleted file mode 100644 index 7f30a3b330713..0000000000000 --- a/google/cloud/bigquery/bigquery_write_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/storage/v1/storage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_WRITE_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_WRITE_OPTIONS_H - -#include "google/cloud/bigquery/bigquery_write_connection.h" -#include "google/cloud/bigquery/bigquery_write_connection_idempotency_policy.h" -#include "google/cloud/bigquery/storage/v1/bigquery_write_options.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_storage_v1::BigQueryWriteBackoffPolicyOption -/// directly. -using ::google::cloud::bigquery_storage_v1::BigQueryWriteBackoffPolicyOption; - -/// @deprecated Use -/// bigquery_storage_v1::BigQueryWriteConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::bigquery_storage_v1:: - BigQueryWriteConnectionIdempotencyPolicyOption; - -/// @deprecated Use bigquery_storage_v1::BigQueryWritePolicyOptionList directly. -using ::google::cloud::bigquery_storage_v1::BigQueryWritePolicyOptionList; - -/// @deprecated Use bigquery_storage_v1::BigQueryWriteRetryPolicyOption -/// directly. -using ::google::cloud::bigquery_storage_v1::BigQueryWriteRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGQUERY_WRITE_OPTIONS_H diff --git a/google/cloud/bigquery/connection/v1/connection_connection.h b/google/cloud/bigquery/connection/v1/connection_connection.h index cacdee9d8391c..aec88ed03c5f1 100644 --- a/google/cloud/bigquery/connection/v1/connection_connection.h +++ b/google/cloud/bigquery/connection/v1/connection_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_CONNECTION_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_CONNECTION_CONNECTION_H +#include "google/cloud/bigquery/connection/v1/connection.pb.h" #include "google/cloud/bigquery/connection/v1/connection_connection_idempotency_policy.h" #include "google/cloud/bigquery/connection/v1/internal/connection_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/connection/v1/connection_connection_idempotency_policy.h b/google/cloud/bigquery/connection/v1/connection_connection_idempotency_policy.h index b540df89661eb..2fc00302485a6 100644 --- a/google/cloud/bigquery/connection/v1/connection_connection_idempotency_policy.h +++ b/google/cloud/bigquery/connection/v1/connection_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_CONNECTION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_CONNECTION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/connection/v1/connection.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/connection/v1/internal/connection_auth_decorator.cc b/google/cloud/bigquery/connection/v1/internal/connection_auth_decorator.cc index c1bcdf88a1a33..49b290f087980 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_auth_decorator.cc +++ b/google/cloud/bigquery/connection/v1/internal/connection_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/bigquery/connection/v1/connection.proto #include "google/cloud/bigquery/connection/v1/internal/connection_auth_decorator.h" -#include +#include "google/cloud/bigquery/connection/v1/connection.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_connection_v1_internal { @@ -109,3 +112,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_connection_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/connection/v1/internal/connection_auth_decorator.h b/google/cloud/bigquery/connection/v1/internal/connection_auth_decorator.h index 322744953d67e..a7339b7e732f9 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_auth_decorator.h +++ b/google/cloud/bigquery/connection/v1/internal/connection_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_connection_v1_internal { @@ -88,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_INTERNAL_CONNECTION_AUTH_DECORATOR_H diff --git a/google/cloud/bigquery/connection/v1/internal/connection_logging_decorator.cc b/google/cloud/bigquery/connection/v1/internal/connection_logging_decorator.cc index 5f2fe324473d5..d2118aae96118 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_logging_decorator.cc +++ b/google/cloud/bigquery/connection/v1/internal/connection_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/bigquery/connection/v1/connection.proto #include "google/cloud/bigquery/connection/v1/internal/connection_logging_decorator.h" +#include "google/cloud/bigquery/connection/v1/connection.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_connection_v1_internal { @@ -144,3 +147,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_connection_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/connection/v1/internal/connection_logging_decorator.h b/google/cloud/bigquery/connection/v1/internal/connection_logging_decorator.h index 3c14d3eed0f24..473fdab95a19f 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_logging_decorator.h +++ b/google/cloud/bigquery/connection/v1/internal/connection_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_connection_v1_internal { @@ -88,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_INTERNAL_CONNECTION_LOGGING_DECORATOR_H diff --git a/google/cloud/bigquery/connection/v1/internal/connection_metadata_decorator.cc b/google/cloud/bigquery/connection/v1/internal/connection_metadata_decorator.cc index 0e4fe466fe728..9b8afe9123b5c 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_metadata_decorator.cc +++ b/google/cloud/bigquery/connection/v1/internal/connection_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/bigquery/connection/v1/connection.proto #include "google/cloud/bigquery/connection/v1/internal/connection_metadata_decorator.h" +#include "google/cloud/bigquery/connection/v1/connection.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 bigquery_connection_v1_internal { @@ -138,3 +142,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_connection_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/connection/v1/internal/connection_metadata_decorator.h b/google/cloud/bigquery/connection/v1/internal/connection_metadata_decorator.h index 5621123f46782..77eca89dcf4f2 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_metadata_decorator.h +++ b/google/cloud/bigquery/connection/v1/internal/connection_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_connection_v1_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_INTERNAL_CONNECTION_METADATA_DECORATOR_H diff --git a/google/cloud/bigquery/connection/v1/internal/connection_option_defaults.cc b/google/cloud/bigquery/connection/v1/internal/connection_option_defaults.cc index 646dc5dcc8a8d..197bb00314073 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_option_defaults.cc +++ b/google/cloud/bigquery/connection/v1/internal/connection_option_defaults.cc @@ -44,7 +44,7 @@ Options ConnectionServiceDefaultOptions(Options options) { .has()) { options.set( bigquery_connection_v1::ConnectionServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/bigquery/connection/v1/internal/connection_stub.cc b/google/cloud/bigquery/connection/v1/internal/connection_stub.cc index be06b6cade127..8404708c78429 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_stub.cc +++ b/google/cloud/bigquery/connection/v1/internal/connection_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/bigquery/connection/v1/connection.proto #include "google/cloud/bigquery/connection/v1/internal/connection_stub.h" +#include "google/cloud/bigquery/connection/v1/connection.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_connection_v1_internal { @@ -132,3 +135,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_connection_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/connection/v1/internal/connection_stub.h b/google/cloud/bigquery/connection/v1/internal/connection_stub.h index 75f9c02c1dcd3..02e8d99294d71 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_stub.h +++ b/google/cloud/bigquery/connection/v1/internal/connection_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_INTERNAL_CONNECTION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_INTERNAL_CONNECTION_STUB_H +#include "google/cloud/bigquery/connection/v1/connection.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_connection_v1_internal { @@ -138,4 +141,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_INTERNAL_CONNECTION_STUB_H diff --git a/google/cloud/bigquery/connection/v1/internal/connection_stub_factory.cc b/google/cloud/bigquery/connection/v1/internal/connection_stub_factory.cc index bc6b52f89f079..b7e8c25f871c8 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_stub_factory.cc +++ b/google/cloud/bigquery/connection/v1/internal/connection_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/bigquery/connection/v1/connection.proto #include "google/cloud/bigquery/connection/v1/internal/connection_stub_factory.h" +#include "google/cloud/bigquery/connection/v1/connection.grpc.pb.h" #include "google/cloud/bigquery/connection/v1/internal/connection_auth_decorator.h" #include "google/cloud/bigquery/connection/v1/internal/connection_logging_decorator.h" #include "google/cloud/bigquery/connection/v1/internal/connection_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_connection_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_connection_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/connection/v1/internal/connection_stub_factory.h b/google/cloud/bigquery/connection/v1/internal/connection_stub_factory.h index abbf7dbbe07a6..fc100768a1677 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_stub_factory.h +++ b/google/cloud/bigquery/connection/v1/internal/connection_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_connection_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_INTERNAL_CONNECTION_STUB_FACTORY_H diff --git a/google/cloud/bigquery/connection/v1/internal/connection_tracing_connection.cc b/google/cloud/bigquery/connection/v1/internal/connection_tracing_connection.cc index 965a68ca8e48b..acce93c68805d 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_tracing_connection.cc +++ b/google/cloud/bigquery/connection/v1/internal/connection_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigquery_connection_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConnectionServiceTracingConnection::ConnectionServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -112,17 +110,13 @@ ConnectionServiceTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConnectionServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquery/connection/v1/internal/connection_tracing_connection.h b/google/cloud/bigquery/connection/v1/internal/connection_tracing_connection.h index 98501492107d4..1a747a000ebcc 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_tracing_connection.h +++ b/google/cloud/bigquery/connection/v1/internal/connection_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquery_connection_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConnectionServiceTracingConnection : public bigquery_connection_v1::ConnectionServiceConnection { public: @@ -77,8 +75,6 @@ class ConnectionServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquery/connection/v1/internal/connection_tracing_stub.cc b/google/cloud/bigquery/connection/v1/internal/connection_tracing_stub.cc index 3534c059d3e29..ba7e075ea4ecf 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_tracing_stub.cc +++ b/google/cloud/bigquery/connection/v1/internal/connection_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_connection_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConnectionServiceTracingStub::ConnectionServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -135,18 +136,14 @@ ConnectionServiceTracingStub::TestIamPermissions( context, *span, child_->TestIamPermissions(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConnectionServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_connection_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/connection/v1/internal/connection_tracing_stub.h b/google/cloud/bigquery/connection/v1/internal/connection_tracing_stub.h index 79215354bf4fb..a761d1f79cc1a 100644 --- a/google/cloud/bigquery/connection/v1/internal/connection_tracing_stub.h +++ b/google/cloud/bigquery/connection/v1/internal/connection_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_connection_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConnectionServiceTracingStub : public ConnectionServiceStub { public: ~ConnectionServiceTracingStub() override = default; @@ -85,8 +86,6 @@ class ConnectionServiceTracingStub : public ConnectionServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -101,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_INTERNAL_CONNECTION_TRACING_STUB_H diff --git a/google/cloud/bigquery/connection_client.h b/google/cloud/bigquery/connection_client.h deleted file mode 100644 index 21f69cb895166..0000000000000 --- a/google/cloud/bigquery/connection_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/connection/v1/connection.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_CLIENT_H - -#include "google/cloud/bigquery/connection/v1/connection_client.h" -#include "google/cloud/bigquery/connection_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_connection_v1 instead of the aliases defined -/// in this namespace. -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_connection_v1::ConnectionServiceClient directly. -using ::google::cloud::bigquery_connection_v1::ConnectionServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_CLIENT_H diff --git a/google/cloud/bigquery/connection_connection.h b/google/cloud/bigquery/connection_connection.h deleted file mode 100644 index 2c73c22664d3a..0000000000000 --- a/google/cloud/bigquery/connection_connection.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/connection/v1/connection.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_CONNECTION_H - -#include "google/cloud/bigquery/connection/v1/connection_connection.h" -#include "google/cloud/bigquery/connection_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_connection_v1::MakeConnectionServiceConnection -/// directly. -using ::google::cloud::bigquery_connection_v1::MakeConnectionServiceConnection; - -/// @deprecated Use bigquery_connection_v1::ConnectionServiceConnection -/// directly. -using ::google::cloud::bigquery_connection_v1::ConnectionServiceConnection; - -/// @deprecated Use -/// bigquery_connection_v1::ConnectionServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::bigquery_connection_v1:: - ConnectionServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// bigquery_connection_v1::ConnectionServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::bigquery_connection_v1:: - ConnectionServiceLimitedTimeRetryPolicy; - -/// @deprecated Use bigquery_connection_v1::ConnectionServiceRetryPolicy -/// directly. -using ::google::cloud::bigquery_connection_v1::ConnectionServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_CONNECTION_H diff --git a/google/cloud/bigquery/connection_connection_idempotency_policy.h b/google/cloud/bigquery/connection_connection_idempotency_policy.h deleted file mode 100644 index 79752b579c3d1..0000000000000 --- a/google/cloud/bigquery/connection_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/connection/v1/connection.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/bigquery/connection/v1/connection_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_connection_v1::MakeDefaultConnectionServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::bigquery_connection_v1:: - MakeDefaultConnectionServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// bigquery_connection_v1::ConnectionServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::bigquery_connection_v1:: - ConnectionServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/bigquery/connection_options.h b/google/cloud/bigquery/connection_options.h deleted file mode 100644 index c580429e52d15..0000000000000 --- a/google/cloud/bigquery/connection_options.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/connection/v1/connection.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_OPTIONS_H - -#include "google/cloud/bigquery/connection/v1/connection_options.h" -#include "google/cloud/bigquery/connection_connection.h" -#include "google/cloud/bigquery/connection_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_connection_v1::ConnectionServiceBackoffPolicyOption -/// directly. -using ::google::cloud::bigquery_connection_v1:: - ConnectionServiceBackoffPolicyOption; - -/// @deprecated Use -/// bigquery_connection_v1::ConnectionServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::bigquery_connection_v1:: - ConnectionServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use bigquery_connection_v1::ConnectionServicePolicyOptionList -/// directly. -using ::google::cloud::bigquery_connection_v1:: - ConnectionServicePolicyOptionList; - -/// @deprecated Use bigquery_connection_v1::ConnectionServiceRetryPolicyOption -/// directly. -using ::google::cloud::bigquery_connection_v1:: - ConnectionServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_OPTIONS_H diff --git a/google/cloud/bigquery/data_policy_client.h b/google/cloud/bigquery/data_policy_client.h deleted file mode 100644 index c0d2074140d9a..0000000000000 --- a/google/cloud/bigquery/data_policy_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/datapolicies/v1/datapolicy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_POLICY_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_POLICY_CLIENT_H - -#include "google/cloud/bigquery/data_policy_connection.h" -#include "google/cloud/bigquery/datapolicies/v1/data_policy_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_datapolicies_v1 instead of the aliases defined -/// in this namespace. -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_datapolicies_v1::DataPolicyServiceClient directly. -using ::google::cloud::bigquery_datapolicies_v1::DataPolicyServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_POLICY_CLIENT_H diff --git a/google/cloud/bigquery/data_policy_connection.h b/google/cloud/bigquery/data_policy_connection.h deleted file mode 100644 index aa62574b3a4ca..0000000000000 --- a/google/cloud/bigquery/data_policy_connection.h +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/datapolicies/v1/datapolicy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_POLICY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_POLICY_CONNECTION_H - -#include "google/cloud/bigquery/data_policy_connection_idempotency_policy.h" -#include "google/cloud/bigquery/datapolicies/v1/data_policy_connection.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_datapolicies_v1::MakeDataPolicyServiceConnection -/// directly. -using ::google::cloud::bigquery_datapolicies_v1:: - MakeDataPolicyServiceConnection; - -/// @deprecated Use bigquery_datapolicies_v1::DataPolicyServiceConnection -/// directly. -using ::google::cloud::bigquery_datapolicies_v1::DataPolicyServiceConnection; - -/// @deprecated Use -/// bigquery_datapolicies_v1::DataPolicyServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::bigquery_datapolicies_v1:: - DataPolicyServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// bigquery_datapolicies_v1::DataPolicyServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::bigquery_datapolicies_v1:: - DataPolicyServiceLimitedTimeRetryPolicy; - -/// @deprecated Use bigquery_datapolicies_v1::DataPolicyServiceRetryPolicy -/// directly. -using ::google::cloud::bigquery_datapolicies_v1::DataPolicyServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_POLICY_CONNECTION_H diff --git a/google/cloud/bigquery/data_policy_connection_idempotency_policy.h b/google/cloud/bigquery/data_policy_connection_idempotency_policy.h deleted file mode 100644 index 7fef76f061bb9..0000000000000 --- a/google/cloud/bigquery/data_policy_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/datapolicies/v1/datapolicy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/bigquery/datapolicies/v1/data_policy_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_datapolicies_v1::MakeDefaultDataPolicyServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::bigquery_datapolicies_v1:: - MakeDefaultDataPolicyServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// bigquery_datapolicies_v1::DataPolicyServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::bigquery_datapolicies_v1:: - DataPolicyServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/bigquery/data_policy_options.h b/google/cloud/bigquery/data_policy_options.h deleted file mode 100644 index 4bab36ae5d024..0000000000000 --- a/google/cloud/bigquery/data_policy_options.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/datapolicies/v1/datapolicy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_POLICY_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_POLICY_OPTIONS_H - -#include "google/cloud/bigquery/data_policy_connection.h" -#include "google/cloud/bigquery/data_policy_connection_idempotency_policy.h" -#include "google/cloud/bigquery/datapolicies/v1/data_policy_options.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_datapolicies_v1::DataPolicyServiceBackoffPolicyOption directly. -using ::google::cloud::bigquery_datapolicies_v1:: - DataPolicyServiceBackoffPolicyOption; - -/// @deprecated Use -/// bigquery_datapolicies_v1::DataPolicyServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::bigquery_datapolicies_v1:: - DataPolicyServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use bigquery_datapolicies_v1::DataPolicyServicePolicyOptionList -/// directly. -using ::google::cloud::bigquery_datapolicies_v1:: - DataPolicyServicePolicyOptionList; - -/// @deprecated Use bigquery_datapolicies_v1::DataPolicyServiceRetryPolicyOption -/// directly. -using ::google::cloud::bigquery_datapolicies_v1:: - DataPolicyServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_POLICY_OPTIONS_H diff --git a/google/cloud/bigquery/data_transfer_client.h b/google/cloud/bigquery/data_transfer_client.h deleted file mode 100644 index 36d8f6b559544..0000000000000 --- a/google/cloud/bigquery/data_transfer_client.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_CLIENT_H - -#include "google/cloud/bigquery/data_transfer_connection.h" -#include "google/cloud/bigquery/datatransfer/v1/data_transfer_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_datatransfer_v1 instead of the aliases defined -/// in this namespace. -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_datatransfer_v1::DataTransferServiceClient -/// directly. -using ::google::cloud::bigquery_datatransfer_v1::DataTransferServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_CLIENT_H diff --git a/google/cloud/bigquery/data_transfer_connection.h b/google/cloud/bigquery/data_transfer_connection.h deleted file mode 100644 index 77ae9f1b1c8d8..0000000000000 --- a/google/cloud/bigquery/data_transfer_connection.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_CONNECTION_H - -#include "google/cloud/bigquery/data_transfer_connection_idempotency_policy.h" -#include "google/cloud/bigquery/datatransfer/v1/data_transfer_connection.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_datatransfer_v1::MakeDataTransferServiceConnection -/// directly. -using ::google::cloud::bigquery_datatransfer_v1:: - MakeDataTransferServiceConnection; - -/// @deprecated Use bigquery_datatransfer_v1::DataTransferServiceConnection -/// directly. -using ::google::cloud::bigquery_datatransfer_v1::DataTransferServiceConnection; - -/// @deprecated Use -/// bigquery_datatransfer_v1::DataTransferServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::bigquery_datatransfer_v1:: - DataTransferServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// bigquery_datatransfer_v1::DataTransferServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::bigquery_datatransfer_v1:: - DataTransferServiceLimitedTimeRetryPolicy; - -/// @deprecated Use bigquery_datatransfer_v1::DataTransferServiceRetryPolicy -/// directly. -using ::google::cloud::bigquery_datatransfer_v1::DataTransferServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_CONNECTION_H diff --git a/google/cloud/bigquery/data_transfer_connection_idempotency_policy.h b/google/cloud/bigquery/data_transfer_connection_idempotency_policy.h deleted file mode 100644 index f84d3426b2e4e..0000000000000 --- a/google/cloud/bigquery/data_transfer_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/bigquery/datatransfer/v1/data_transfer_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_datatransfer_v1::MakeDefaultDataTransferServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::bigquery_datatransfer_v1:: - MakeDefaultDataTransferServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// bigquery_datatransfer_v1::DataTransferServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::bigquery_datatransfer_v1:: - DataTransferServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/bigquery/data_transfer_options.h b/google/cloud/bigquery/data_transfer_options.h deleted file mode 100644 index d930f6ff84c61..0000000000000 --- a/google/cloud/bigquery/data_transfer_options.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_OPTIONS_H - -#include "google/cloud/bigquery/data_transfer_connection.h" -#include "google/cloud/bigquery/data_transfer_connection_idempotency_policy.h" -#include "google/cloud/bigquery/datatransfer/v1/data_transfer_options.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_datatransfer_v1::DataTransferServiceBackoffPolicyOption directly. -using ::google::cloud::bigquery_datatransfer_v1:: - DataTransferServiceBackoffPolicyOption; - -/// @deprecated Use -/// bigquery_datatransfer_v1::DataTransferServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::bigquery_datatransfer_v1:: - DataTransferServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use -/// bigquery_datatransfer_v1::DataTransferServicePolicyOptionList directly. -using ::google::cloud::bigquery_datatransfer_v1:: - DataTransferServicePolicyOptionList; - -/// @deprecated Use -/// bigquery_datatransfer_v1::DataTransferServiceRetryPolicyOption directly. -using ::google::cloud::bigquery_datatransfer_v1:: - DataTransferServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_OPTIONS_H diff --git a/google/cloud/bigquery/datapolicies/v1/data_policy_connection.h b/google/cloud/bigquery/datapolicies/v1/data_policy_connection.h index 8adcf71c164fc..80df8989be529 100644 --- a/google/cloud/bigquery/datapolicies/v1/data_policy_connection.h +++ b/google/cloud/bigquery/datapolicies/v1/data_policy_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V1_DATA_POLICY_CONNECTION_H #include "google/cloud/bigquery/datapolicies/v1/data_policy_connection_idempotency_policy.h" +#include "google/cloud/bigquery/datapolicies/v1/datapolicy.pb.h" #include "google/cloud/bigquery/datapolicies/v1/internal/data_policy_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/datapolicies/v1/data_policy_connection_idempotency_policy.h b/google/cloud/bigquery/datapolicies/v1/data_policy_connection_idempotency_policy.h index a6fbcd5d8265e..56ebe43a63d41 100644 --- a/google/cloud/bigquery/datapolicies/v1/data_policy_connection_idempotency_policy.h +++ b/google/cloud/bigquery/datapolicies/v1/data_policy_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V1_DATA_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V1_DATA_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/datapolicies/v1/datapolicy.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_auth_decorator.cc b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_auth_decorator.cc index 50dc6ba1f08c1..4b07bac1a6a24 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_auth_decorator.cc +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/bigquery/datapolicies/v1/datapolicy.proto #include "google/cloud/bigquery/datapolicies/v1/internal/data_policy_auth_decorator.h" -#include +#include "google/cloud/bigquery/datapolicies/v1/datapolicy.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v1_internal { @@ -119,3 +122,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datapolicies_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_auth_decorator.h b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_auth_decorator.h index 880297a3342c2..f005ded4f74d4 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_auth_decorator.h +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v1_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V1_INTERNAL_DATA_POLICY_AUTH_DECORATOR_H diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_logging_decorator.cc b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_logging_decorator.cc index 6e5138ae2e73d..280dd35540e77 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_logging_decorator.cc +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/bigquery/datapolicies/v1/datapolicy.proto #include "google/cloud/bigquery/datapolicies/v1/internal/data_policy_logging_decorator.h" +#include "google/cloud/bigquery/datapolicies/v1/datapolicy.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v1_internal { @@ -157,3 +160,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datapolicies_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_logging_decorator.h b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_logging_decorator.h index 1fc4870575482..3ad98f02ff574 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_logging_decorator.h +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v1_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V1_INTERNAL_DATA_POLICY_LOGGING_DECORATOR_H diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_metadata_decorator.cc b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_metadata_decorator.cc index 4d1e06b35dfc0..711d7d902d8e3 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_metadata_decorator.cc +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/bigquery/datapolicies/v1/datapolicy.proto #include "google/cloud/bigquery/datapolicies/v1/internal/data_policy_metadata_decorator.h" +#include "google/cloud/bigquery/datapolicies/v1/datapolicy.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 bigquery_datapolicies_v1_internal { @@ -149,3 +153,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datapolicies_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_metadata_decorator.h b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_metadata_decorator.h index 767cdd1249088..34fe630b2160e 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_metadata_decorator.h +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v1_internal { @@ -100,4 +103,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V1_INTERNAL_DATA_POLICY_METADATA_DECORATOR_H diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_option_defaults.cc b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_option_defaults.cc index e04f826e8dc36..d8f0d9fd14c52 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_option_defaults.cc +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_option_defaults.cc @@ -43,7 +43,7 @@ Options DataPolicyServiceDefaultOptions(Options options) { bigquery_datapolicies_v1::DataPolicyServiceRetryPolicyOption>()) { options.set( bigquery_datapolicies_v1::DataPolicyServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub.cc b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub.cc index 32358b412489a..28b8a90e79e72 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub.cc +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/bigquery/datapolicies/v1/datapolicy.proto #include "google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub.h" +#include "google/cloud/bigquery/datapolicies/v1/datapolicy.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v1_internal { @@ -145,3 +148,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datapolicies_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub.h b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub.h index 63b9ac3e16d86..6e285cd9df23f 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub.h +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V1_INTERNAL_DATA_POLICY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V1_INTERNAL_DATA_POLICY_STUB_H +#include "google/cloud/bigquery/datapolicies/v1/datapolicy.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v1_internal { @@ -150,4 +153,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V1_INTERNAL_DATA_POLICY_STUB_H diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub_factory.cc b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub_factory.cc index 764d3db6c5a99..80f7c530f0a26 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub_factory.cc +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/bigquery/datapolicies/v1/datapolicy.proto #include "google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub_factory.h" +#include "google/cloud/bigquery/datapolicies/v1/datapolicy.grpc.pb.h" #include "google/cloud/bigquery/datapolicies/v1/internal/data_policy_auth_decorator.h" #include "google/cloud/bigquery/datapolicies/v1/internal/data_policy_logging_decorator.h" #include "google/cloud/bigquery/datapolicies/v1/internal/data_policy_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datapolicies_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub_factory.h b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub_factory.h index a28f54cd1cb93..e1d5f13d99cd2 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub_factory.h +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V1_INTERNAL_DATA_POLICY_STUB_FACTORY_H diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_connection.cc b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_connection.cc index ad8523acd87af..948698e1755c7 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_connection.cc +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigquery_datapolicies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataPolicyServiceTracingConnection::DataPolicyServiceTracingConnection( std::shared_ptr child) @@ -129,18 +127,14 @@ DataPolicyServiceTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataPolicyServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_connection.h b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_connection.h index a1cdb888235ba..f1ae5cbd48950 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_connection.h +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquery_datapolicies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataPolicyServiceTracingConnection : public bigquery_datapolicies_v1::DataPolicyServiceConnection { public: @@ -82,8 +80,6 @@ class DataPolicyServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_stub.cc b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_stub.cc index 1e22d096d825d..ea7282edb4e34 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_stub.cc +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataPolicyServiceTracingStub::DataPolicyServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -152,18 +153,14 @@ DataPolicyServiceTracingStub::TestIamPermissions( context, *span, child_->TestIamPermissions(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataPolicyServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datapolicies_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_stub.h b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_stub.h index 51420c60caa2f..69a2150dd693d 100644 --- a/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_stub.h +++ b/google/cloud/bigquery/datapolicies/v1/internal/data_policy_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataPolicyServiceTracingStub : public DataPolicyServiceStub { public: ~DataPolicyServiceTracingStub() override = default; @@ -91,8 +92,6 @@ class DataPolicyServiceTracingStub : public DataPolicyServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -107,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V1_INTERNAL_DATA_POLICY_TRACING_STUB_H diff --git a/google/cloud/bigquery/datapolicies/v2/data_policy_connection.h b/google/cloud/bigquery/datapolicies/v2/data_policy_connection.h index 36c84f6c985df..8bb8278a072d5 100644 --- a/google/cloud/bigquery/datapolicies/v2/data_policy_connection.h +++ b/google/cloud/bigquery/datapolicies/v2/data_policy_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V2_DATA_POLICY_CONNECTION_H #include "google/cloud/bigquery/datapolicies/v2/data_policy_connection_idempotency_policy.h" +#include "google/cloud/bigquery/datapolicies/v2/datapolicy.pb.h" #include "google/cloud/bigquery/datapolicies/v2/internal/data_policy_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/datapolicies/v2/data_policy_connection_idempotency_policy.h b/google/cloud/bigquery/datapolicies/v2/data_policy_connection_idempotency_policy.h index 9e648dd3d5a6e..395993851ef5e 100644 --- a/google/cloud/bigquery/datapolicies/v2/data_policy_connection_idempotency_policy.h +++ b/google/cloud/bigquery/datapolicies/v2/data_policy_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V2_DATA_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V2_DATA_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/datapolicies/v2/datapolicy.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_auth_decorator.cc b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_auth_decorator.cc index 33a250804a110..8fbfa6eab2da6 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_auth_decorator.cc +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/bigquery/datapolicies/v2/datapolicy.proto #include "google/cloud/bigquery/datapolicies/v2/internal/data_policy_auth_decorator.h" -#include +#include "google/cloud/bigquery/datapolicies/v2/datapolicy.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v2_internal { @@ -129,3 +132,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datapolicies_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_auth_decorator.h b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_auth_decorator.h index 98135461d5e8e..ac7b34abe5cc9 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_auth_decorator.h +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v2_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V2_INTERNAL_DATA_POLICY_AUTH_DECORATOR_H diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_logging_decorator.cc b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_logging_decorator.cc index f5129338a6d57..ca82f67bdf0a9 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_logging_decorator.cc +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/bigquery/datapolicies/v2/datapolicy.proto #include "google/cloud/bigquery/datapolicies/v2/internal/data_policy_logging_decorator.h" +#include "google/cloud/bigquery/datapolicies/v2/datapolicy.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v2_internal { @@ -172,3 +175,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datapolicies_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_logging_decorator.h b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_logging_decorator.h index 319f8b30a6ea5..7773fe097ec05 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_logging_decorator.h +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v2_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V2_INTERNAL_DATA_POLICY_LOGGING_DECORATOR_H diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_metadata_decorator.cc b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_metadata_decorator.cc index 66f464aaa36cd..e4ca30d307307 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_metadata_decorator.cc +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/bigquery/datapolicies/v2/datapolicy.proto #include "google/cloud/bigquery/datapolicies/v2/internal/data_policy_metadata_decorator.h" +#include "google/cloud/bigquery/datapolicies/v2/datapolicy.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 bigquery_datapolicies_v2_internal { @@ -161,3 +165,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datapolicies_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_metadata_decorator.h b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_metadata_decorator.h index b3418eb7f1ae6..3f8dd40cb271a 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_metadata_decorator.h +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v2_internal { @@ -105,4 +108,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V2_INTERNAL_DATA_POLICY_METADATA_DECORATOR_H diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_option_defaults.cc b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_option_defaults.cc index ab8d0c183a7df..74fbbdfc1008c 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_option_defaults.cc +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_option_defaults.cc @@ -43,7 +43,7 @@ Options DataPolicyServiceDefaultOptions(Options options) { bigquery_datapolicies_v2::DataPolicyServiceRetryPolicyOption>()) { options.set( bigquery_datapolicies_v2::DataPolicyServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub.cc b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub.cc index ce790d235ad8c..7420862986101 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub.cc +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/bigquery/datapolicies/v2/datapolicy.proto #include "google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub.h" +#include "google/cloud/bigquery/datapolicies/v2/datapolicy.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v2_internal { @@ -158,3 +161,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datapolicies_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub.h b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub.h index b675f8b95a92b..3ce0b865e8f50 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub.h +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V2_INTERNAL_DATA_POLICY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V2_INTERNAL_DATA_POLICY_STUB_H +#include "google/cloud/bigquery/datapolicies/v2/datapolicy.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v2_internal { @@ -161,4 +164,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V2_INTERNAL_DATA_POLICY_STUB_H diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub_factory.cc b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub_factory.cc index fd26c518a3c49..85db349118108 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub_factory.cc +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/bigquery/datapolicies/v2/datapolicy.proto #include "google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub_factory.h" +#include "google/cloud/bigquery/datapolicies/v2/datapolicy.grpc.pb.h" #include "google/cloud/bigquery/datapolicies/v2/internal/data_policy_auth_decorator.h" #include "google/cloud/bigquery/datapolicies/v2/internal/data_policy_logging_decorator.h" #include "google/cloud/bigquery/datapolicies/v2/internal/data_policy_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v2_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datapolicies_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub_factory.h b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub_factory.h index 36ce1e520bb55..94810f9083e4f 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub_factory.h +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V2_INTERNAL_DATA_POLICY_STUB_FACTORY_H diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_connection.cc b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_connection.cc index 3d4568c2f6d62..0e876ff2064e5 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_connection.cc +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigquery_datapolicies_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataPolicyServiceTracingConnection::DataPolicyServiceTracingConnection( std::shared_ptr child) @@ -138,18 +136,14 @@ DataPolicyServiceTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataPolicyServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_connection.h b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_connection.h index d24847c78080b..bef38050ad267 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_connection.h +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquery_datapolicies_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataPolicyServiceTracingConnection : public bigquery_datapolicies_v2::DataPolicyServiceConnection { public: @@ -86,8 +84,6 @@ class DataPolicyServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_stub.cc b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_stub.cc index 4dc26ef7a8ce3..209b78d799642 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_stub.cc +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataPolicyServiceTracingStub::DataPolicyServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -165,18 +166,14 @@ DataPolicyServiceTracingStub::TestIamPermissions( context, *span, child_->TestIamPermissions(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataPolicyServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datapolicies_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_stub.h b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_stub.h index b161efd496c37..77d48b3efe111 100644 --- a/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_stub.h +++ b/google/cloud/bigquery/datapolicies/v2/internal/data_policy_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datapolicies_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataPolicyServiceTracingStub : public DataPolicyServiceStub { public: ~DataPolicyServiceTracingStub() override = default; @@ -96,8 +97,6 @@ class DataPolicyServiceTracingStub : public DataPolicyServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -112,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V2_INTERNAL_DATA_POLICY_TRACING_STUB_H diff --git a/google/cloud/bigquery/datatransfer/v1/data_transfer_connection.h b/google/cloud/bigquery/datatransfer/v1/data_transfer_connection.h index 6ace2eafbbd60..fc2ea8dba1bb9 100644 --- a/google/cloud/bigquery/datatransfer/v1/data_transfer_connection.h +++ b/google/cloud/bigquery/datatransfer/v1/data_transfer_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATATRANSFER_V1_DATA_TRANSFER_CONNECTION_H #include "google/cloud/bigquery/datatransfer/v1/data_transfer_connection_idempotency_policy.h" +#include "google/cloud/bigquery/datatransfer/v1/datatransfer.pb.h" #include "google/cloud/bigquery/datatransfer/v1/internal/data_transfer_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/datatransfer/v1/data_transfer_connection_idempotency_policy.h b/google/cloud/bigquery/datatransfer/v1/data_transfer_connection_idempotency_policy.h index 6264d14802dd7..c954b16516d07 100644 --- a/google/cloud/bigquery/datatransfer/v1/data_transfer_connection_idempotency_policy.h +++ b/google/cloud/bigquery/datatransfer/v1/data_transfer_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATATRANSFER_V1_DATA_TRANSFER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATATRANSFER_V1_DATA_TRANSFER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/datatransfer/v1/datatransfer.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_auth_decorator.cc b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_auth_decorator.cc index 80f1228b847fe..5ee0ec0ed3a71 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_auth_decorator.cc +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto #include "google/cloud/bigquery/datatransfer/v1/internal/data_transfer_auth_decorator.h" -#include +#include "google/cloud/bigquery/datatransfer/v1/datatransfer.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datatransfer_v1_internal { @@ -211,3 +214,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datatransfer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_auth_decorator.h b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_auth_decorator.h index 01bf27dbad0a9..3f4a1712240e0 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_auth_decorator.h +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datatransfer_v1_internal { @@ -146,4 +149,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATATRANSFER_V1_INTERNAL_DATA_TRANSFER_AUTH_DECORATOR_H diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_logging_decorator.cc b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_logging_decorator.cc index 2990548cad3da..d64b98c6a4141 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_logging_decorator.cc +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto #include "google/cloud/bigquery/datatransfer/v1/internal/data_transfer_logging_decorator.h" +#include "google/cloud/bigquery/datatransfer/v1/datatransfer.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datatransfer_v1_internal { @@ -286,3 +289,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datatransfer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_logging_decorator.h b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_logging_decorator.h index bced4fc54d6bf..3777941750e2e 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_logging_decorator.h +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datatransfer_v1_internal { @@ -146,4 +149,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATATRANSFER_V1_INTERNAL_DATA_TRANSFER_LOGGING_DECORATOR_H diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_metadata_decorator.cc b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_metadata_decorator.cc index 86f97235fd5dd..e5a6ff5128873 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_metadata_decorator.cc +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto #include "google/cloud/bigquery/datatransfer/v1/internal/data_transfer_metadata_decorator.h" +#include "google/cloud/bigquery/datatransfer/v1/datatransfer.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 bigquery_datatransfer_v1_internal { @@ -239,3 +243,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datatransfer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_metadata_decorator.h b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_metadata_decorator.h index d9d3239a1a552..e51680eb96ce5 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_metadata_decorator.h +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datatransfer_v1_internal { @@ -152,4 +155,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATATRANSFER_V1_INTERNAL_DATA_TRANSFER_METADATA_DECORATOR_H diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_option_defaults.cc b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_option_defaults.cc index 59d30c64427cb..bc42da71c84b5 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_option_defaults.cc +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_option_defaults.cc @@ -43,7 +43,7 @@ Options DataTransferServiceDefaultOptions(Options options) { bigquery_datatransfer_v1::DataTransferServiceRetryPolicyOption>()) { options.set( bigquery_datatransfer_v1::DataTransferServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub.cc b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub.cc index 97ff410cf160a..94c24bf8a87df 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub.cc +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto #include "google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub.h" +#include "google/cloud/bigquery/datatransfer/v1/datatransfer.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datatransfer_v1_internal { @@ -268,3 +271,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datatransfer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub.h b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub.h index e5a05f61be1e5..01f98535788a0 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub.h +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATATRANSFER_V1_INTERNAL_DATA_TRANSFER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATATRANSFER_V1_INTERNAL_DATA_TRANSFER_STUB_H +#include "google/cloud/bigquery/datatransfer/v1/datatransfer.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 -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datatransfer_v1_internal { @@ -263,4 +266,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATATRANSFER_V1_INTERNAL_DATA_TRANSFER_STUB_H diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub_factory.cc b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub_factory.cc index 9b7f2a0858651..7aa9a9ac30d30 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub_factory.cc +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub_factory.cc @@ -17,22 +17,25 @@ // source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto #include "google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub_factory.h" +#include "google/cloud/bigquery/datatransfer/v1/datatransfer.grpc.pb.h" #include "google/cloud/bigquery/datatransfer/v1/internal/data_transfer_auth_decorator.h" #include "google/cloud/bigquery/datatransfer/v1/internal/data_transfer_logging_decorator.h" #include "google/cloud/bigquery/datatransfer/v1/internal/data_transfer_metadata_decorator.h" #include "google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub.h" #include "google/cloud/bigquery/datatransfer/v1/internal/data_transfer_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 -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datatransfer_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datatransfer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub_factory.h b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub_factory.h index d5762b98bf052..941dd8e448895 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub_factory.h +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datatransfer_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATATRANSFER_V1_INTERNAL_DATA_TRANSFER_STUB_FACTORY_H diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_connection.cc b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_connection.cc index af3bd81d0053a..3c922f6e5032e 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_connection.cc +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigquery_datatransfer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataTransferServiceTracingConnection::DataTransferServiceTracingConnection( std::shared_ptr child) @@ -238,18 +236,14 @@ DataTransferServiceTracingConnection::GetLocation( return internal::EndSpan(*span, child_->GetLocation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataTransferServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_connection.h b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_connection.h index d9841e928c3e2..6bb9ffdc7cb83 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_connection.h +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquery_datatransfer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataTransferServiceTracingConnection : public bigquery_datatransfer_v1::DataTransferServiceConnection { public: @@ -126,8 +124,6 @@ class DataTransferServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_stub.cc b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_stub.cc index 41b65665dc9a0..d88f40bc04374 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_stub.cc +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datatransfer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataTransferServiceTracingStub::DataTransferServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -281,18 +282,14 @@ DataTransferServiceTracingStub::GetLocation( child_->GetLocation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataTransferServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_datatransfer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_stub.h b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_stub.h index 6bc13abef5ea1..d52f9a29cd72a 100644 --- a/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_stub.h +++ b/google/cloud/bigquery/datatransfer/v1/internal/data_transfer_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_datatransfer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataTransferServiceTracingStub : public DataTransferServiceStub { public: ~DataTransferServiceTracingStub() override = default; @@ -143,8 +144,6 @@ class DataTransferServiceTracingStub : public DataTransferServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -159,4 +158,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATATRANSFER_V1_INTERNAL_DATA_TRANSFER_TRACING_STUB_H diff --git a/google/cloud/bigquery/migration/v2/internal/migration_auth_decorator.cc b/google/cloud/bigquery/migration/v2/internal/migration_auth_decorator.cc index ddd62d5b802ff..09f5a1fd0872a 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_auth_decorator.cc +++ b/google/cloud/bigquery/migration/v2/internal/migration_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/bigquery/migration/v2/migration_service.proto #include "google/cloud/bigquery/migration/v2/internal/migration_auth_decorator.h" -#include +#include "google/cloud/bigquery/migration/v2/migration_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_migration_v2_internal { @@ -103,3 +106,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_migration_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/migration/v2/internal/migration_auth_decorator.h b/google/cloud/bigquery/migration/v2/internal/migration_auth_decorator.h index bdd6aa8d6179f..b4d8f15bdc808 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_auth_decorator.h +++ b/google/cloud/bigquery/migration/v2/internal/migration_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_migration_v2_internal { @@ -90,4 +93,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_V2_INTERNAL_MIGRATION_AUTH_DECORATOR_H diff --git a/google/cloud/bigquery/migration/v2/internal/migration_logging_decorator.cc b/google/cloud/bigquery/migration/v2/internal/migration_logging_decorator.cc index f1fc9f93af503..6a68bca06f290 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_logging_decorator.cc +++ b/google/cloud/bigquery/migration/v2/internal/migration_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/bigquery/migration/v2/migration_service.proto #include "google/cloud/bigquery/migration/v2/internal/migration_logging_decorator.h" +#include "google/cloud/bigquery/migration/v2/migration_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_migration_v2_internal { @@ -135,3 +138,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_migration_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/migration/v2/internal/migration_logging_decorator.h b/google/cloud/bigquery/migration/v2/internal/migration_logging_decorator.h index 6b7bb846cde44..2ee1b895bf5fd 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_logging_decorator.h +++ b/google/cloud/bigquery/migration/v2/internal/migration_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_migration_v2_internal { @@ -90,4 +93,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_V2_INTERNAL_MIGRATION_LOGGING_DECORATOR_H diff --git a/google/cloud/bigquery/migration/v2/internal/migration_metadata_decorator.cc b/google/cloud/bigquery/migration/v2/internal/migration_metadata_decorator.cc index c05180f27eaea..b310714c24c05 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_metadata_decorator.cc +++ b/google/cloud/bigquery/migration/v2/internal/migration_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/bigquery/migration/v2/migration_service.proto #include "google/cloud/bigquery/migration/v2/internal/migration_metadata_decorator.h" +#include "google/cloud/bigquery/migration/v2/migration_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 bigquery_migration_v2_internal { @@ -129,3 +133,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_migration_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/migration/v2/internal/migration_metadata_decorator.h b/google/cloud/bigquery/migration/v2/internal/migration_metadata_decorator.h index 34ecc0122da69..2a6eb2b9cb579 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_metadata_decorator.h +++ b/google/cloud/bigquery/migration/v2/internal/migration_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_migration_v2_internal { @@ -96,4 +99,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_V2_INTERNAL_MIGRATION_METADATA_DECORATOR_H diff --git a/google/cloud/bigquery/migration/v2/internal/migration_option_defaults.cc b/google/cloud/bigquery/migration/v2/internal/migration_option_defaults.cc index 2ddfc295a861d..05b3bd5571b8d 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_option_defaults.cc +++ b/google/cloud/bigquery/migration/v2/internal/migration_option_defaults.cc @@ -43,7 +43,7 @@ Options MigrationServiceDefaultOptions(Options options) { .has()) { options.set( bigquery_migration_v2::MigrationServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/bigquery/migration/v2/internal/migration_stub.cc b/google/cloud/bigquery/migration/v2/internal/migration_stub.cc index 0c3684f4ba572..6e8430e6a4944 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_stub.cc +++ b/google/cloud/bigquery/migration/v2/internal/migration_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/bigquery/migration/v2/migration_service.proto #include "google/cloud/bigquery/migration/v2/internal/migration_stub.h" +#include "google/cloud/bigquery/migration/v2/migration_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_migration_v2_internal { @@ -129,3 +132,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_migration_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/migration/v2/internal/migration_stub.h b/google/cloud/bigquery/migration/v2/internal/migration_stub.h index 7ed2ae0b5b3fb..8dd4a27e0a001 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_stub.h +++ b/google/cloud/bigquery/migration/v2/internal/migration_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_V2_INTERNAL_MIGRATION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_V2_INTERNAL_MIGRATION_STUB_H +#include "google/cloud/bigquery/migration/v2/migration_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_migration_v2_internal { @@ -137,4 +140,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_V2_INTERNAL_MIGRATION_STUB_H diff --git a/google/cloud/bigquery/migration/v2/internal/migration_stub_factory.cc b/google/cloud/bigquery/migration/v2/internal/migration_stub_factory.cc index b13e2252d720f..f2db4b5bc8b82 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_stub_factory.cc +++ b/google/cloud/bigquery/migration/v2/internal/migration_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/bigquery/migration/v2/internal/migration_metadata_decorator.h" #include "google/cloud/bigquery/migration/v2/internal/migration_stub.h" #include "google/cloud/bigquery/migration/v2/internal/migration_tracing_stub.h" +#include "google/cloud/bigquery/migration/v2/migration_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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_migration_v2_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_migration_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/migration/v2/internal/migration_stub_factory.h b/google/cloud/bigquery/migration/v2/internal/migration_stub_factory.h index 8245258645644..27067e70a3b4a 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_stub_factory.h +++ b/google/cloud/bigquery/migration/v2/internal/migration_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_migration_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_V2_INTERNAL_MIGRATION_STUB_FACTORY_H diff --git a/google/cloud/bigquery/migration/v2/internal/migration_tracing_connection.cc b/google/cloud/bigquery/migration/v2/internal/migration_tracing_connection.cc index 4e55e7c0c5dbc..cf548f76d6eab 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_tracing_connection.cc +++ b/google/cloud/bigquery/migration/v2/internal/migration_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigquery_migration_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MigrationServiceTracingConnection::MigrationServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -113,16 +111,12 @@ MigrationServiceTracingConnection::ListMigrationSubtasks( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMigrationServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquery/migration/v2/internal/migration_tracing_connection.h b/google/cloud/bigquery/migration/v2/internal/migration_tracing_connection.h index 7be577d96a75e..87341d497d365 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_tracing_connection.h +++ b/google/cloud/bigquery/migration/v2/internal/migration_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquery_migration_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MigrationServiceTracingConnection : public bigquery_migration_v2::MigrationServiceConnection { public: @@ -77,8 +75,6 @@ class MigrationServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquery/migration/v2/internal/migration_tracing_stub.cc b/google/cloud/bigquery/migration/v2/internal/migration_tracing_stub.cc index b58a5988764a9..f1593ccef753c 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_tracing_stub.cc +++ b/google/cloud/bigquery/migration/v2/internal/migration_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_migration_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MigrationServiceTracingStub::MigrationServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -132,18 +133,14 @@ MigrationServiceTracingStub::ListMigrationSubtasks( context, *span, child_->ListMigrationSubtasks(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMigrationServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_migration_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/migration/v2/internal/migration_tracing_stub.h b/google/cloud/bigquery/migration/v2/internal/migration_tracing_stub.h index 57509f94cb653..4ffd10da6c025 100644 --- a/google/cloud/bigquery/migration/v2/internal/migration_tracing_stub.h +++ b/google/cloud/bigquery/migration/v2/internal/migration_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_migration_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MigrationServiceTracingStub : public MigrationServiceStub { public: ~MigrationServiceTracingStub() override = default; @@ -87,8 +88,6 @@ class MigrationServiceTracingStub : public MigrationServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -103,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_V2_INTERNAL_MIGRATION_TRACING_STUB_H diff --git a/google/cloud/bigquery/migration/v2/migration_connection.h b/google/cloud/bigquery/migration/v2/migration_connection.h index 773edbb66cbef..4390b09be7413 100644 --- a/google/cloud/bigquery/migration/v2/migration_connection.h +++ b/google/cloud/bigquery/migration/v2/migration_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/bigquery/migration/v2/internal/migration_retry_traits.h" #include "google/cloud/bigquery/migration/v2/migration_connection_idempotency_policy.h" +#include "google/cloud/bigquery/migration/v2/migration_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 #include namespace google { diff --git a/google/cloud/bigquery/migration/v2/migration_connection_idempotency_policy.h b/google/cloud/bigquery/migration/v2/migration_connection_idempotency_policy.h index 3fcf7dc68be0b..a1073a8500d62 100644 --- a/google/cloud/bigquery/migration/v2/migration_connection_idempotency_policy.h +++ b/google/cloud/bigquery/migration/v2/migration_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_V2_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_V2_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/migration/v2/migration_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/migration_client.h b/google/cloud/bigquery/migration_client.h deleted file mode 100644 index ddeb5a5877875..0000000000000 --- a/google/cloud/bigquery/migration_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/migration/v2/migration_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_CLIENT_H - -#include "google/cloud/bigquery/migration/v2/migration_client.h" -#include "google/cloud/bigquery/migration_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_migration_v2 instead of the aliases defined in -/// this namespace. -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_migration_v2::MigrationServiceClient directly. -using ::google::cloud::bigquery_migration_v2::MigrationServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_CLIENT_H diff --git a/google/cloud/bigquery/migration_connection.h b/google/cloud/bigquery/migration_connection.h deleted file mode 100644 index 032b87776d156..0000000000000 --- a/google/cloud/bigquery/migration_connection.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/migration/v2/migration_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_CONNECTION_H - -#include "google/cloud/bigquery/migration/v2/migration_connection.h" -#include "google/cloud/bigquery/migration_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_migration_v2::MakeMigrationServiceConnection -/// directly. -using ::google::cloud::bigquery_migration_v2::MakeMigrationServiceConnection; - -/// @deprecated Use bigquery_migration_v2::MigrationServiceConnection directly. -using ::google::cloud::bigquery_migration_v2::MigrationServiceConnection; - -/// @deprecated Use -/// bigquery_migration_v2::MigrationServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::bigquery_migration_v2:: - MigrationServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// bigquery_migration_v2::MigrationServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::bigquery_migration_v2:: - MigrationServiceLimitedTimeRetryPolicy; - -/// @deprecated Use bigquery_migration_v2::MigrationServiceRetryPolicy directly. -using ::google::cloud::bigquery_migration_v2::MigrationServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_CONNECTION_H diff --git a/google/cloud/bigquery/migration_connection_idempotency_policy.h b/google/cloud/bigquery/migration_connection_idempotency_policy.h deleted file mode 100644 index 9cd1ebba3427c..0000000000000 --- a/google/cloud/bigquery/migration_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/migration/v2/migration_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/bigquery/migration/v2/migration_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_migration_v2::MakeDefaultMigrationServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::bigquery_migration_v2:: - MakeDefaultMigrationServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// bigquery_migration_v2::MigrationServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::bigquery_migration_v2:: - MigrationServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/bigquery/migration_options.h b/google/cloud/bigquery/migration_options.h deleted file mode 100644 index 80488f99b8bb1..0000000000000 --- a/google/cloud/bigquery/migration_options.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/migration/v2/migration_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_OPTIONS_H - -#include "google/cloud/bigquery/migration/v2/migration_options.h" -#include "google/cloud/bigquery/migration_connection.h" -#include "google/cloud/bigquery/migration_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_migration_v2::MigrationServiceBackoffPolicyOption -/// directly. -using ::google::cloud::bigquery_migration_v2:: - MigrationServiceBackoffPolicyOption; - -/// @deprecated Use -/// bigquery_migration_v2::MigrationServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::bigquery_migration_v2:: - MigrationServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use bigquery_migration_v2::MigrationServicePolicyOptionList -/// directly. -using ::google::cloud::bigquery_migration_v2::MigrationServicePolicyOptionList; - -/// @deprecated Use bigquery_migration_v2::MigrationServiceRetryPolicyOption -/// directly. -using ::google::cloud::bigquery_migration_v2::MigrationServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_OPTIONS_H diff --git a/google/cloud/bigquery/mocks/mock_analytics_hub_connection.h b/google/cloud/bigquery/mocks/mock_analytics_hub_connection.h deleted file mode 100644 index e69d6fede475e..0000000000000 --- a/google/cloud/bigquery/mocks/mock_analytics_hub_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/analyticshub/v1/analyticshub.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_ANALYTICS_HUB_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_ANALYTICS_HUB_CONNECTION_H - -#include "google/cloud/bigquery/analytics_hub_connection.h" -#include "google/cloud/bigquery/analyticshub/v1/mocks/mock_analytics_hub_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_analyticshub_v1_mocks instead of the aliases -/// defined in this namespace. -namespace bigquery_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_analyticshub_v1_mocks::MockAnalyticsHubServiceConnection directly. -using ::google::cloud::bigquery_analyticshub_v1_mocks:: - MockAnalyticsHubServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_ANALYTICS_HUB_CONNECTION_H diff --git a/google/cloud/bigquery/mocks/mock_bigquery_read_connection.h b/google/cloud/bigquery/mocks/mock_bigquery_read_connection.h deleted file mode 100644 index 19685608ebd11..0000000000000 --- a/google/cloud/bigquery/mocks/mock_bigquery_read_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/storage/v1/storage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_BIGQUERY_READ_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_BIGQUERY_READ_CONNECTION_H - -#include "google/cloud/bigquery/bigquery_read_connection.h" -#include "google/cloud/bigquery/storage/v1/mocks/mock_bigquery_read_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_storage_v1_mocks instead of the aliases -/// defined in this namespace. -namespace bigquery_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_storage_v1_mocks::MockBigQueryReadConnection -/// directly. -using ::google::cloud::bigquery_storage_v1_mocks::MockBigQueryReadConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_BIGQUERY_READ_CONNECTION_H diff --git a/google/cloud/bigquery/mocks/mock_bigquery_write_connection.h b/google/cloud/bigquery/mocks/mock_bigquery_write_connection.h deleted file mode 100644 index 3354e6212f6ba..0000000000000 --- a/google/cloud/bigquery/mocks/mock_bigquery_write_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/storage/v1/storage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_BIGQUERY_WRITE_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_BIGQUERY_WRITE_CONNECTION_H - -#include "google/cloud/bigquery/bigquery_write_connection.h" -#include "google/cloud/bigquery/storage/v1/mocks/mock_bigquery_write_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_storage_v1_mocks instead of the aliases -/// defined in this namespace. -namespace bigquery_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_storage_v1_mocks::MockBigQueryWriteConnection -/// directly. -using ::google::cloud::bigquery_storage_v1_mocks::MockBigQueryWriteConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_BIGQUERY_WRITE_CONNECTION_H diff --git a/google/cloud/bigquery/mocks/mock_connection_connection.h b/google/cloud/bigquery/mocks/mock_connection_connection.h deleted file mode 100644 index e21493a15f07e..0000000000000 --- a/google/cloud/bigquery/mocks/mock_connection_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/connection/v1/connection.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_CONNECTION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_CONNECTION_CONNECTION_H - -#include "google/cloud/bigquery/connection/v1/mocks/mock_connection_connection.h" -#include "google/cloud/bigquery/connection_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_connection_v1_mocks instead of the aliases -/// defined in this namespace. -namespace bigquery_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_connection_v1_mocks::MockConnectionServiceConnection directly. -using ::google::cloud::bigquery_connection_v1_mocks:: - MockConnectionServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_CONNECTION_CONNECTION_H diff --git a/google/cloud/bigquery/mocks/mock_data_policy_connection.h b/google/cloud/bigquery/mocks/mock_data_policy_connection.h deleted file mode 100644 index 13f5c5e84f1ae..0000000000000 --- a/google/cloud/bigquery/mocks/mock_data_policy_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/datapolicies/v1/datapolicy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_DATA_POLICY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_DATA_POLICY_CONNECTION_H - -#include "google/cloud/bigquery/data_policy_connection.h" -#include "google/cloud/bigquery/datapolicies/v1/mocks/mock_data_policy_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_datapolicies_v1_mocks instead of the aliases -/// defined in this namespace. -namespace bigquery_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_datapolicies_v1_mocks::MockDataPolicyServiceConnection directly. -using ::google::cloud::bigquery_datapolicies_v1_mocks:: - MockDataPolicyServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_DATA_POLICY_CONNECTION_H diff --git a/google/cloud/bigquery/mocks/mock_data_transfer_connection.h b/google/cloud/bigquery/mocks/mock_data_transfer_connection.h deleted file mode 100644 index 5be1967395f73..0000000000000 --- a/google/cloud/bigquery/mocks/mock_data_transfer_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_DATA_TRANSFER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_DATA_TRANSFER_CONNECTION_H - -#include "google/cloud/bigquery/data_transfer_connection.h" -#include "google/cloud/bigquery/datatransfer/v1/mocks/mock_data_transfer_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_datatransfer_v1_mocks instead of the aliases -/// defined in this namespace. -namespace bigquery_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_datatransfer_v1_mocks::MockDataTransferServiceConnection directly. -using ::google::cloud::bigquery_datatransfer_v1_mocks:: - MockDataTransferServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_DATA_TRANSFER_CONNECTION_H diff --git a/google/cloud/bigquery/mocks/mock_migration_connection.h b/google/cloud/bigquery/mocks/mock_migration_connection.h deleted file mode 100644 index 3ebd20884864b..0000000000000 --- a/google/cloud/bigquery/mocks/mock_migration_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/migration/v2/migration_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_MIGRATION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_MIGRATION_CONNECTION_H - -#include "google/cloud/bigquery/migration/v2/mocks/mock_migration_connection.h" -#include "google/cloud/bigquery/migration_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_migration_v2_mocks instead of the aliases -/// defined in this namespace. -namespace bigquery_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_migration_v2_mocks::MockMigrationServiceConnection -/// directly. -using ::google::cloud::bigquery_migration_v2_mocks:: - MockMigrationServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_MIGRATION_CONNECTION_H diff --git a/google/cloud/bigquery/mocks/mock_reservation_connection.h b/google/cloud/bigquery/mocks/mock_reservation_connection.h deleted file mode 100644 index 59193794e893f..0000000000000 --- a/google/cloud/bigquery/mocks/mock_reservation_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/reservation/v1/reservation.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_RESERVATION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_RESERVATION_CONNECTION_H - -#include "google/cloud/bigquery/reservation/v1/mocks/mock_reservation_connection.h" -#include "google/cloud/bigquery/reservation_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_reservation_v1_mocks instead of the aliases -/// defined in this namespace. -namespace bigquery_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_reservation_v1_mocks::MockReservationServiceConnection directly. -using ::google::cloud::bigquery_reservation_v1_mocks:: - MockReservationServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MOCKS_MOCK_RESERVATION_CONNECTION_H diff --git a/google/cloud/bigquery/quickstart/.bazelrc b/google/cloud/bigquery/quickstart/.bazelrc index f8f4bb3e07a87..1ccef142904e8 100644 --- a/google/cloud/bigquery/quickstart/.bazelrc +++ b/google/cloud/bigquery/quickstart/.bazelrc @@ -15,19 +15,12 @@ # 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 +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 - -#Our quickstarts do not yet support bzlmod -build --noenable_bzlmod 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/CMakeLists.txt b/google/cloud/bigquery/quickstart/CMakeLists.txt index 7d2f85070ece2..71975b5ceb3f2 100644 --- a/google/cloud/bigquery/quickstart/CMakeLists.txt +++ b/google/cloud/bigquery/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # A minimal CMakeList.txt showing how to use the Cloud BigQuery C++ client # library in CMake-based projects. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-bigquery-quickstart CXX) find_package(google_cloud_cpp_bigquery REQUIRED) diff --git a/google/cloud/bigquery/quickstart/MODULE.bazel b/google/cloud/bigquery/quickstart/MODULE.bazel new file mode 100644 index 0000000000000..e47bfb6fa8af0 --- /dev/null +++ b/google/cloud/bigquery/quickstart/MODULE.bazel @@ -0,0 +1,20 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +module( + name = "quickstart", + version = "0.0.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 2526be8067ccf..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 = "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/bigquery/quickstart/bazel/BUILD.bazel b/google/cloud/bigquery/quickstart/bazel/BUILD.bazel new file mode 100644 index 0000000000000..9d3c52804de76 --- /dev/null +++ b/google/cloud/bigquery/quickstart/bazel/BUILD.bazel @@ -0,0 +1,17 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 v2 + +package(default_visibility = ["//:__subpackages__"]) diff --git a/google/cloud/bigquery/quickstart/bazel/remove_upb_c_rules.patch b/google/cloud/bigquery/quickstart/bazel/remove_upb_c_rules.patch new file mode 100644 index 0000000000000..43b077224c29d --- /dev/null +++ b/google/cloud/bigquery/quickstart/bazel/remove_upb_c_rules.patch @@ -0,0 +1,124 @@ +diff --git google/api/expr/v1alpha1/BUILD.bazel google/api/expr/v1alpha1/BUILD.bazel +index 9bed46809..197e5249c 100644 +--- google/api/expr/v1alpha1/BUILD.bazel ++++ google/api/expr/v1alpha1/BUILD.bazel +@@ -233,32 +233,32 @@ cc_proto_library( + ############################################################################## + # upb + ############################################################################## +-load( +- "@com_google_googleapis_imports//:imports.bzl", +- "upb_c_proto_library", +-) +- +-upb_c_proto_library( +- name = "checked_upb_proto", +- deps = [":checked_proto"], +-) +- +-upb_c_proto_library( +- name = "eval_upb_proto", +- deps = [":eval_proto"], +-) +- +-upb_c_proto_library( +- name = "explain_upb_proto", +- deps = [":explain_proto"], +-) +- +-upb_c_proto_library( +- name = "syntax_upb_proto", +- deps = [":syntax_proto"], +-) +- +-upb_c_proto_library( +- name = "value_upb_proto", +- deps = [":value_proto"], +-) ++#load( ++ #"@com_google_googleapis_imports//:imports.bzl", ++ #"upb_c_proto_library", ++#) ++# ++#upb_c_proto_library( ++ #name = "checked_upb_proto", ++ #deps = [":checked_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "eval_upb_proto", ++ #deps = [":eval_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "explain_upb_proto", ++ #deps = [":explain_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "syntax_upb_proto", ++ #deps = [":syntax_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "value_upb_proto", ++ #deps = [":value_proto"], ++#) +diff --git google/rpc/BUILD.bazel google/rpc/BUILD.bazel +index 31fd6457d..c38f00c46 100644 +--- google/rpc/BUILD.bazel ++++ google/rpc/BUILD.bazel +@@ -11,7 +11,7 @@ load( + "php_proto_library", + "py_gapic_assembly_pkg", + "py_proto_library", +- "upb_c_proto_library", ++ #"upb_c_proto_library", + ) + load("@rules_proto//proto:defs.bzl", "proto_library") + +@@ -104,15 +104,15 @@ cc_proto_library( + deps = [":status_proto"], + ) + +-upb_c_proto_library( +- name = "code_upb_proto", +- deps = [":code_proto"], +-) ++#upb_c_proto_library( ++ #name = "code_upb_proto", ++ #deps = [":code_proto"], ++#) + +-upb_c_proto_library( +- name = "status_upb_proto", +- deps = [":status_proto"], +-) ++#upb_c_proto_library( ++ #name = "status_upb_proto", ++ #deps = [":status_proto"], ++#) + + py_proto_library( + name = "code_py_proto", +diff --git repository_rules.bzl repository_rules.bzl +index 2f87ad682..2ab3bd054 100644 +--- repository_rules.bzl ++++ repository_rules.bzl +@@ -224,11 +224,11 @@ def switched_rules_by_language( + # + # upb + # +- rules["upb_c_proto_library"] = _switch( +- upb, +- "@com_google_protobuf//bazel:upb_c_proto_library.bzl", +- "upb_c_proto_library", +- ) ++ #rules["upb_c_proto_library"] = _switch( ++ # upb, ++ # "@com_google_protobuf//bazel:upb_c_proto_library.bzl", ++ # "upb_c_proto_library", ++ #) + + # + # PHP diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_auth_decorator.cc b/google/cloud/bigquery/reservation/v1/internal/reservation_auth_decorator.cc index a28e523bbf4a7..cb9fc3f1fa4e5 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_auth_decorator.cc +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/bigquery/reservation/v1/reservation.proto #include "google/cloud/bigquery/reservation/v1/internal/reservation_auth_decorator.h" -#include +#include "google/cloud/bigquery/reservation/v1/reservation.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_reservation_v1_internal { @@ -319,3 +322,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_reservation_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_auth_decorator.h b/google/cloud/bigquery/reservation/v1/internal/reservation_auth_decorator.h index 0beb12b998c9a..4cae77012ea5a 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_auth_decorator.h +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_reservation_v1_internal { @@ -211,4 +214,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_V1_INTERNAL_RESERVATION_AUTH_DECORATOR_H diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_logging_decorator.cc b/google/cloud/bigquery/reservation/v1/internal/reservation_logging_decorator.cc index 3a14eab21e1c4..464b591062764 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_logging_decorator.cc +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/bigquery/reservation/v1/reservation.proto #include "google/cloud/bigquery/reservation/v1/internal/reservation_logging_decorator.h" +#include "google/cloud/bigquery/reservation/v1/reservation.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_reservation_v1_internal { @@ -438,3 +441,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_reservation_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_logging_decorator.h b/google/cloud/bigquery/reservation/v1/internal/reservation_logging_decorator.h index bbf07d894b67f..faaebed52bcfa 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_logging_decorator.h +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_reservation_v1_internal { @@ -211,4 +214,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_V1_INTERNAL_RESERVATION_LOGGING_DECORATOR_H diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_metadata_decorator.cc b/google/cloud/bigquery/reservation/v1/internal/reservation_metadata_decorator.cc index cacd0d1e4406a..6540598c89d84 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_metadata_decorator.cc +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/bigquery/reservation/v1/reservation.proto #include "google/cloud/bigquery/reservation/v1/internal/reservation_metadata_decorator.h" +#include "google/cloud/bigquery/reservation/v1/reservation.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 bigquery_reservation_v1_internal { @@ -354,3 +358,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_reservation_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_metadata_decorator.h b/google/cloud/bigquery/reservation/v1/internal/reservation_metadata_decorator.h index 2e56e80f91b6a..a0b078cb19211 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_metadata_decorator.h +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_reservation_v1_internal { @@ -217,4 +220,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_V1_INTERNAL_RESERVATION_METADATA_DECORATOR_H diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_option_defaults.cc b/google/cloud/bigquery/reservation/v1/internal/reservation_option_defaults.cc index 3ed3665c332f4..e8ad2217a8354 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_option_defaults.cc +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_option_defaults.cc @@ -43,7 +43,7 @@ Options ReservationServiceDefaultOptions(Options options) { bigquery_reservation_v1::ReservationServiceRetryPolicyOption>()) { options.set( bigquery_reservation_v1::ReservationServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_stub.cc b/google/cloud/bigquery/reservation/v1/internal/reservation_stub.cc index 36d3319806399..e9f06560914fb 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_stub.cc +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/bigquery/reservation/v1/reservation.proto #include "google/cloud/bigquery/reservation/v1/internal/reservation_stub.h" +#include "google/cloud/bigquery/reservation/v1/reservation.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_reservation_v1_internal { @@ -417,3 +420,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_reservation_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_stub.h b/google/cloud/bigquery/reservation/v1/internal/reservation_stub.h index 7dbce9a91437b..bf65deab30ceb 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_stub.h +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_V1_INTERNAL_RESERVATION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_V1_INTERNAL_RESERVATION_STUB_H +#include "google/cloud/bigquery/reservation/v1/reservation.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_reservation_v1_internal { @@ -383,4 +386,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_V1_INTERNAL_RESERVATION_STUB_H diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_stub_factory.cc b/google/cloud/bigquery/reservation/v1/internal/reservation_stub_factory.cc index e8c82beca748c..a69cc85afe4b3 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_stub_factory.cc +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/bigquery/reservation/v1/internal/reservation_metadata_decorator.h" #include "google/cloud/bigquery/reservation/v1/internal/reservation_stub.h" #include "google/cloud/bigquery/reservation/v1/internal/reservation_tracing_stub.h" +#include "google/cloud/bigquery/reservation/v1/reservation.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_reservation_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_reservation_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_stub_factory.h b/google/cloud/bigquery/reservation/v1/internal/reservation_stub_factory.h index 75614c952465c..e708af66d687c 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_stub_factory.h +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_reservation_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_V1_INTERNAL_RESERVATION_STUB_FACTORY_H diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_connection.cc b/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_connection.cc index 3b2968ba3ff22..4ce33751bd24c 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_connection.cc +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigquery_reservation_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ReservationServiceTracingConnection::ReservationServiceTracingConnection( std::shared_ptr child) @@ -358,18 +356,14 @@ ReservationServiceTracingConnection::ListReservationGroups( std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeReservationServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_connection.h b/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_connection.h index b0ab19d7d8299..e9d7b93f7836f 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_connection.h +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquery_reservation_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ReservationServiceTracingConnection : public bigquery_reservation_v1::ReservationServiceConnection { public: @@ -177,8 +175,6 @@ class ReservationServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_stub.cc b/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_stub.cc index 989b27bc87394..4ce0b8897e83b 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_stub.cc +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_reservation_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ReservationServiceTracingStub::ReservationServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -440,18 +441,14 @@ ReservationServiceTracingStub::ListReservationGroups( context, *span, child_->ListReservationGroups(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeReservationServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_reservation_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_stub.h b/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_stub.h index f3f9c4add5294..d8a6d03e1b802 100644 --- a/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_stub.h +++ b/google/cloud/bigquery/reservation/v1/internal/reservation_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_reservation_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ReservationServiceTracingStub : public ReservationServiceStub { public: ~ReservationServiceTracingStub() override = default; @@ -208,8 +209,6 @@ class ReservationServiceTracingStub : public ReservationServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -224,4 +223,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_V1_INTERNAL_RESERVATION_TRACING_STUB_H diff --git a/google/cloud/bigquery/reservation/v1/reservation_connection.h b/google/cloud/bigquery/reservation/v1/reservation_connection.h index c991697567aa0..8b2c65250b12d 100644 --- a/google/cloud/bigquery/reservation/v1/reservation_connection.h +++ b/google/cloud/bigquery/reservation/v1/reservation_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_V1_RESERVATION_CONNECTION_H #include "google/cloud/bigquery/reservation/v1/internal/reservation_retry_traits.h" +#include "google/cloud/bigquery/reservation/v1/reservation.pb.h" #include "google/cloud/bigquery/reservation/v1/reservation_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/reservation/v1/reservation_connection_idempotency_policy.h b/google/cloud/bigquery/reservation/v1/reservation_connection_idempotency_policy.h index c297d7838f1d1..247843fbf9ba0 100644 --- a/google/cloud/bigquery/reservation/v1/reservation_connection_idempotency_policy.h +++ b/google/cloud/bigquery/reservation/v1/reservation_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_V1_RESERVATION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_V1_RESERVATION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/reservation/v1/reservation.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/reservation_client.h b/google/cloud/bigquery/reservation_client.h deleted file mode 100644 index a728f4643c7b2..0000000000000 --- a/google/cloud/bigquery/reservation_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/reservation/v1/reservation.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_CLIENT_H - -#include "google/cloud/bigquery/reservation/v1/reservation_client.h" -#include "google/cloud/bigquery/reservation_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in bigquery_reservation_v1 instead of the aliases defined -/// in this namespace. -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_reservation_v1::ReservationServiceClient directly. -using ::google::cloud::bigquery_reservation_v1::ReservationServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_CLIENT_H diff --git a/google/cloud/bigquery/reservation_connection.h b/google/cloud/bigquery/reservation_connection.h deleted file mode 100644 index 40bde54134e36..0000000000000 --- a/google/cloud/bigquery/reservation_connection.h +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/reservation/v1/reservation.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_CONNECTION_H - -#include "google/cloud/bigquery/reservation/v1/reservation_connection.h" -#include "google/cloud/bigquery/reservation_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use bigquery_reservation_v1::MakeReservationServiceConnection -/// directly. -using ::google::cloud::bigquery_reservation_v1:: - MakeReservationServiceConnection; - -/// @deprecated Use bigquery_reservation_v1::ReservationServiceConnection -/// directly. -using ::google::cloud::bigquery_reservation_v1::ReservationServiceConnection; - -/// @deprecated Use -/// bigquery_reservation_v1::ReservationServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::bigquery_reservation_v1:: - ReservationServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// bigquery_reservation_v1::ReservationServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::bigquery_reservation_v1:: - ReservationServiceLimitedTimeRetryPolicy; - -/// @deprecated Use bigquery_reservation_v1::ReservationServiceRetryPolicy -/// directly. -using ::google::cloud::bigquery_reservation_v1::ReservationServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_CONNECTION_H diff --git a/google/cloud/bigquery/reservation_connection_idempotency_policy.h b/google/cloud/bigquery/reservation_connection_idempotency_policy.h deleted file mode 100644 index 2a1982ec17c4b..0000000000000 --- a/google/cloud/bigquery/reservation_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/reservation/v1/reservation.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/bigquery/reservation/v1/reservation_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_reservation_v1::MakeDefaultReservationServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::bigquery_reservation_v1:: - MakeDefaultReservationServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// bigquery_reservation_v1::ReservationServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::bigquery_reservation_v1:: - ReservationServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/bigquery/reservation_options.h b/google/cloud/bigquery/reservation_options.h deleted file mode 100644 index 6c3e565432c51..0000000000000 --- a/google/cloud/bigquery/reservation_options.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/bigquery/reservation/v1/reservation.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_OPTIONS_H - -#include "google/cloud/bigquery/reservation/v1/reservation_options.h" -#include "google/cloud/bigquery/reservation_connection.h" -#include "google/cloud/bigquery/reservation_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// bigquery_reservation_v1::ReservationServiceBackoffPolicyOption directly. -using ::google::cloud::bigquery_reservation_v1:: - ReservationServiceBackoffPolicyOption; - -/// @deprecated Use -/// bigquery_reservation_v1::ReservationServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::bigquery_reservation_v1:: - ReservationServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use bigquery_reservation_v1::ReservationServicePolicyOptionList -/// directly. -using ::google::cloud::bigquery_reservation_v1:: - ReservationServicePolicyOptionList; - -/// @deprecated Use bigquery_reservation_v1::ReservationServiceRetryPolicyOption -/// directly. -using ::google::cloud::bigquery_reservation_v1:: - ReservationServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_OPTIONS_H diff --git a/google/cloud/bigquery/retry_traits.h b/google/cloud/bigquery/retry_traits.h deleted file mode 100644 index 9227228d0295b..0000000000000 --- a/google/cloud/bigquery/retry_traits.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_BIGQUERY_RETRY_TRAITS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RETRY_TRAITS_H - -#include "google/cloud/bigquery/internal/bigquery_read_retry_traits.h" -#warning "This header is deprecated, it only provided internal symbols." - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RETRY_TRAITS_H diff --git a/google/cloud/bigquery/storage/v1/bigquery_read_client.h b/google/cloud/bigquery/storage/v1/bigquery_read_client.h index 50d03053cff27..adcf2a533902e 100644 --- a/google/cloud/bigquery/storage/v1/bigquery_read_client.h +++ b/google/cloud/bigquery/storage/v1/bigquery_read_client.h @@ -315,7 +315,6 @@ class BigQueryReadClient { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace bigquery_storage_v1 } // namespace cloud } // namespace google diff --git a/google/cloud/bigquery/storage/v1/bigquery_read_connection.cc b/google/cloud/bigquery/storage/v1/bigquery_read_connection.cc index 9435c6475456d..ac0e222eac708 100644 --- a/google/cloud/bigquery/storage/v1/bigquery_read_connection.cc +++ b/google/cloud/bigquery/storage/v1/bigquery_read_connection.cc @@ -82,20 +82,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_storage_v1 } // namespace cloud } // namespace google - -namespace google { -namespace cloud { -namespace bigquery { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -void BigQueryReadReadRowsStreamingUpdater( - google::cloud::bigquery::storage::v1::ReadRowsResponse const& response, - google::cloud::bigquery::storage::v1::ReadRowsRequest& request) { - return bigquery_storage_v1_internal::BigQueryReadReadRowsStreamingUpdater( - response, request); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigquery -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigquery/storage/v1/bigquery_read_connection.h b/google/cloud/bigquery/storage/v1/bigquery_read_connection.h index 63a7245212169..7dc9ea8e0103d 100644 --- a/google/cloud/bigquery/storage/v1/bigquery_read_connection.h +++ b/google/cloud/bigquery/storage/v1/bigquery_read_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/bigquery/storage/v1/bigquery_read_connection_idempotency_policy.h" #include "google/cloud/bigquery/storage/v1/internal/bigquery_read_retry_traits.h" +#include "google/cloud/bigquery/storage/v1/storage.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 #include namespace google { @@ -223,7 +223,6 @@ std::shared_ptr MakeBigQueryReadConnection( Options options = {}); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace bigquery_storage_v1 } // namespace cloud } // namespace google diff --git a/google/cloud/bigquery/storage/v1/bigquery_read_connection_idempotency_policy.h b/google/cloud/bigquery/storage/v1/bigquery_read_connection_idempotency_policy.h index 7cec89d74c419..520e8f29936bd 100644 --- a/google/cloud/bigquery/storage/v1/bigquery_read_connection_idempotency_policy.h +++ b/google/cloud/bigquery/storage/v1/bigquery_read_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_BIGQUERY_READ_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_BIGQUERY_READ_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/storage/v1/storage.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { @@ -50,7 +50,6 @@ std::unique_ptr MakeDefaultBigQueryReadConnectionIdempotencyPolicy(); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace bigquery_storage_v1 } // namespace cloud } // namespace google diff --git a/google/cloud/bigquery/storage/v1/bigquery_write_connection.h b/google/cloud/bigquery/storage/v1/bigquery_write_connection.h index a2dd1c8ee5550..b57ef42c860d8 100644 --- a/google/cloud/bigquery/storage/v1/bigquery_write_connection.h +++ b/google/cloud/bigquery/storage/v1/bigquery_write_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/bigquery/storage/v1/bigquery_write_connection_idempotency_policy.h" #include "google/cloud/bigquery/storage/v1/internal/bigquery_write_retry_traits.h" +#include "google/cloud/bigquery/storage/v1/storage.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/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/storage/v1/bigquery_write_connection_idempotency_policy.h b/google/cloud/bigquery/storage/v1/bigquery_write_connection_idempotency_policy.h index ffe761930a202..28bc808ecfbfe 100644 --- a/google/cloud/bigquery/storage/v1/bigquery_write_connection_idempotency_policy.h +++ b/google/cloud/bigquery/storage/v1/bigquery_write_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_BIGQUERY_WRITE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_BIGQUERY_WRITE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/storage/v1/storage.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_auth_decorator.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_read_auth_decorator.cc index 54aa8bb5d8dfb..d2c78f7a7e389 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_auth_decorator.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/bigquery/storage/v1/storage.proto #include "google/cloud/bigquery/storage/v1/internal/bigquery_read_auth_decorator.h" -#include +#include "google/cloud/bigquery/storage/v1/storage.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -67,3 +70,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_auth_decorator.h b/google/cloud/bigquery/storage/v1/internal/bigquery_read_auth_decorator.h index 041b831e99ec8..f2bb9e818ba5f 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_auth_decorator.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -61,9 +64,10 @@ class BigQueryReadAuth : public BigQueryReadStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_READ_AUTH_DECORATOR_H diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_connection_impl.h b/google/cloud/bigquery/storage/v1/internal/bigquery_read_connection_impl.h index 3bcf16a8ea721..a4c3cb4c75d7a 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_connection_impl.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_connection_impl.h @@ -73,7 +73,6 @@ class BigQueryReadConnectionImpl }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_logging_decorator.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_read_logging_decorator.cc index 835919702d256..ef1193cf769b5 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_logging_decorator.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/bigquery/storage/v1/storage.proto #include "google/cloud/bigquery/storage/v1/internal/bigquery_read_logging_decorator.h" +#include "google/cloud/bigquery/storage/v1/storage.grpc.pb.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -95,3 +98,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_logging_decorator.h b/google/cloud/bigquery/storage/v1/internal/bigquery_read_logging_decorator.h index 4c6c06fdfa408..08863fa4d998b 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_logging_decorator.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -62,9 +65,10 @@ class BigQueryReadLogging : public BigQueryReadStub { }; // BigQueryReadLogging GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_READ_LOGGING_DECORATOR_H diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_metadata_decorator.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_read_metadata_decorator.cc index 0e46204115544..57629b2f492ca 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_metadata_decorator.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/bigquery/storage/v1/storage.proto #include "google/cloud/bigquery/storage/v1/internal/bigquery_read_metadata_decorator.h" +#include "google/cloud/bigquery/storage/v1/storage.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 bigquery_storage_v1_internal { @@ -94,3 +98,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_metadata_decorator.h b/google/cloud/bigquery/storage/v1/internal/bigquery_read_metadata_decorator.h index 6dd086bb0c809..ead0bf6a6d546 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_metadata_decorator.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -66,9 +69,10 @@ class BigQueryReadMetadata : public BigQueryReadStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_READ_METADATA_DECORATOR_H diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_option_defaults.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_read_option_defaults.cc index 45c6b1d8f5c89..225d1abb6e7ad 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_option_defaults.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_option_defaults.cc @@ -42,7 +42,7 @@ Options BigQueryReadDefaultOptions(Options options) { if (!options.has()) { options.set( bigquery_storage_v1::BigQueryReadLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_option_defaults.h b/google/cloud/bigquery/storage/v1/internal/bigquery_read_option_defaults.h index 0497533f5df04..d56fe0e0cff43 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_option_defaults.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_option_defaults.h @@ -30,7 +30,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN Options BigQueryReadDefaultOptions(Options options); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub.cc index 23bf8641f0ab1..e8c35717a702f 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/bigquery/storage/v1/storage.proto #include "google/cloud/bigquery/storage/v1/internal/bigquery_read_stub.h" +#include "google/cloud/bigquery/storage/v1/storage.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub.h b/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub.h index c20709cbc33b5..7fde72ea1437e 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_READ_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_READ_STUB_H +#include "google/cloud/bigquery/storage/v1/storage.grpc.pb.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -88,9 +91,10 @@ class DefaultBigQueryReadStub : public BigQueryReadStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_READ_STUB_H diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub_factory.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub_factory.cc index bf7847fb6e7ca..a2ce5c15eeea8 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub_factory.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/bigquery/storage/v1/internal/bigquery_read_metadata_decorator.h" #include "google/cloud/bigquery/storage/v1/internal/bigquery_read_stub.h" #include "google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_stub.h" +#include "google/cloud/bigquery/storage/v1/storage.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub_factory.h b/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub_factory.h index 12cdd949325d6..8f10b313d33fe 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub_factory.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -35,9 +38,10 @@ std::shared_ptr CreateDefaultBigQueryReadStub( Options const& options); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_READ_STUB_FACTORY_H diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_connection.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_connection.cc index 302d0ef2712d4..a7ca606689595 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_connection.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigquery_storage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BigQueryReadTracingConnection::BigQueryReadTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -64,16 +62,12 @@ BigQueryReadTracingConnection::SplitReadStream( return internal::EndSpan(*span, child_->SplitReadStream(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBigQueryReadTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_connection.h b/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_connection.h index 0a7afdee44576..ad2695df10b16 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_connection.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquery_storage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BigQueryReadTracingConnection : public bigquery_storage_v1::BigQueryReadConnection { public: @@ -57,8 +55,6 @@ class BigQueryReadTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * @@ -70,7 +66,6 @@ MakeBigQueryReadTracingConnection( std::shared_ptr conn); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_stub.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_stub.cc index 9436b3e167b93..d3c1cb313a298 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_stub.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BigQueryReadTracingStub::BigQueryReadTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -74,18 +75,14 @@ BigQueryReadTracingStub::SplitReadStream( child_->SplitReadStream(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBigQueryReadTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_stub.h b/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_stub.h index 31a2a3a952990..a48970ea73f2d 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_stub.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_read_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BigQueryReadTracingStub : public BigQueryReadStub { public: ~BigQueryReadTracingStub() override = default; @@ -61,8 +62,6 @@ class BigQueryReadTracingStub : public BigQueryReadStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -73,9 +72,10 @@ std::shared_ptr MakeBigQueryReadTracingStub( std::shared_ptr stub); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_READ_TRACING_STUB_H diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_auth_decorator.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_write_auth_decorator.cc index 24008ae17fd3c..25b49b52ee813 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_auth_decorator.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/bigquery/storage/v1/storage.proto #include "google/cloud/bigquery/storage/v1/internal/bigquery_write_auth_decorator.h" +#include "google/cloud/bigquery/storage/v1/storage.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -104,3 +107,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_auth_decorator.h b/google/cloud/bigquery/storage/v1/internal/bigquery_write_auth_decorator.h index 13b51dba741de..d73b7125ee4c1 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_auth_decorator.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -83,4 +86,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_WRITE_AUTH_DECORATOR_H diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_logging_decorator.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_write_logging_decorator.cc index 49c725a73f5cd..df4acd6e357ce 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_logging_decorator.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/bigquery/storage/v1/storage.proto #include "google/cloud/bigquery/storage/v1/internal/bigquery_write_logging_decorator.h" +#include "google/cloud/bigquery/storage/v1/storage.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -135,3 +138,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_logging_decorator.h b/google/cloud/bigquery/storage/v1/internal/bigquery_write_logging_decorator.h index d04346bf77f65..782e2e80f94e6 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_logging_decorator.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -84,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_WRITE_LOGGING_DECORATOR_H diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_metadata_decorator.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_write_metadata_decorator.cc index 9af03b2621968..88795a84966a1 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_metadata_decorator.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/bigquery/storage/v1/storage.proto #include "google/cloud/bigquery/storage/v1/internal/bigquery_write_metadata_decorator.h" +#include "google/cloud/bigquery/storage/v1/storage.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 bigquery_storage_v1_internal { @@ -122,3 +126,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_metadata_decorator.h b/google/cloud/bigquery/storage/v1/internal/bigquery_write_metadata_decorator.h index 30d875d3bec3c..26bc891c75c15 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_metadata_decorator.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -88,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_WRITE_METADATA_DECORATOR_H diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_option_defaults.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_write_option_defaults.cc index e3385e68da64a..76b34ea265e0c 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_option_defaults.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_option_defaults.cc @@ -42,7 +42,7 @@ Options BigQueryWriteDefaultOptions(Options options) { if (!options.has()) { options.set( bigquery_storage_v1::BigQueryWriteLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub.cc index 32af6d38ae95f..434b64fb3bded 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/bigquery/storage/v1/storage.proto #include "google/cloud/bigquery/storage/v1/internal/bigquery_write_stub.h" +#include "google/cloud/bigquery/storage/v1/storage.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -117,3 +120,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub.h b/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub.h index 3485b37155834..c1bcc9443ff25 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_WRITE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_WRITE_STUB_H +#include "google/cloud/bigquery/storage/v1/storage.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -130,4 +133,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_WRITE_STUB_H diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub_factory.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub_factory.cc index 3275d6d215e7c..8a874da6e4d08 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub_factory.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/bigquery/storage/v1/internal/bigquery_write_metadata_decorator.h" #include "google/cloud/bigquery/storage/v1/internal/bigquery_write_stub.h" #include "google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_stub.h" +#include "google/cloud/bigquery/storage/v1/storage.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub_factory.h b/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub_factory.h index ca5aaf5a74ceb..b616060c19af1 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub_factory.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_WRITE_STUB_FACTORY_H diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_connection.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_connection.cc index b915dff1b13ad..a98f0d4e2b83a 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_connection.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace bigquery_storage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BigQueryWriteTracingConnection::BigQueryWriteTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -88,16 +86,12 @@ BigQueryWriteTracingConnection::FlushRows( return internal::EndSpan(*span, child_->FlushRows(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBigQueryWriteTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_connection.h b/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_connection.h index f7d1e33a6c10c..573062d21d765 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_connection.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquery_storage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BigQueryWriteTracingConnection : public bigquery_storage_v1::BigQueryWriteConnection { public: @@ -72,8 +70,6 @@ class BigQueryWriteTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_stub.cc b/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_stub.cc index 040fd4baff031..5d39a18f8e95b 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_stub.cc +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BigQueryWriteTracingStub::BigQueryWriteTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -116,18 +117,14 @@ BigQueryWriteTracingStub::FlushRows( child_->FlushRows(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBigQueryWriteTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_storage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_stub.h b/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_stub.h index 7a63a3faaac9a..fe19971d38416 100644 --- a/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_stub.h +++ b/google/cloud/bigquery/storage/v1/internal/bigquery_write_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigquery_storage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BigQueryWriteTracingStub : public BigQueryWriteStub { public: ~BigQueryWriteTracingStub() override = default; @@ -79,8 +80,6 @@ class BigQueryWriteTracingStub : public BigQueryWriteStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -95,4 +94,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_STORAGE_V1_INTERNAL_BIGQUERY_WRITE_TRACING_STUB_H diff --git a/google/cloud/bigquery/v2/minimal/benchmarks/BUILD.bazel b/google/cloud/bigquery/v2/minimal/benchmarks/BUILD.bazel index 3ee10d0eed017..6dbb039fe44ea 100644 --- a/google/cloud/bigquery/v2/minimal/benchmarks/BUILD.bazel +++ b/google/cloud/bigquery/v2/minimal/benchmarks/BUILD.bazel @@ -33,7 +33,7 @@ cc_library( "//google/cloud/bigquery:google_cloud_cpp_bigquery_rest_mocks", "//google/cloud/testing_util:google_cloud_cpp_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_rest_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) @@ -50,8 +50,8 @@ cc_library( "//google/cloud/bigquery:google_cloud_cpp_bigquery_rest_mocks", "//google/cloud/testing_util:google_cloud_cpp_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_rest_private", - "@com_google_googletest//:gtest", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest", + "@googletest//:gtest_main", ], ) for test in experimental_bigquery_rest_client_benchmark_unit_tests] diff --git a/google/cloud/bigquery/v2/minimal/benchmarks/benchmark.cc b/google/cloud/bigquery/v2/minimal/benchmarks/benchmark.cc index 8c4ec61ba536c..7c62b20e95cf2 100644 --- a/google/cloud/bigquery/v2/minimal/benchmarks/benchmark.cc +++ b/google/cloud/bigquery/v2/minimal/benchmarks/benchmark.cc @@ -15,12 +15,12 @@ #include "google/cloud/bigquery/v2/minimal/benchmarks/benchmark.h" #include "google/cloud/bigquery/v2/minimal/internal/common_v2_resources.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/random.h" #include "google/cloud/options.h" #include "google/cloud/stream_range.h" +#include "absl/strings/str_cat.h" #include "absl/time/time.h" #include #include diff --git a/google/cloud/bigquery/v2/minimal/benchmarks/benchmarks_config.cc b/google/cloud/bigquery/v2/minimal/benchmarks/benchmarks_config.cc index fe7b0ed75cfec..2112c9d398126 100644 --- a/google/cloud/bigquery/v2/minimal/benchmarks/benchmarks_config.cc +++ b/google/cloud/bigquery/v2/minimal/benchmarks/benchmarks_config.cc @@ -13,13 +13,13 @@ // limitations under the License. #include "google/cloud/bigquery/v2/minimal/benchmarks/benchmarks_config.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/build_info.h" #include "google/cloud/internal/compiler_info.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/random.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include #include #include @@ -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/dataset_logging.cc b/google/cloud/bigquery/v2/minimal/internal/dataset_logging.cc index 9e5e793fd2661..de7ea76a7f541 100644 --- a/google/cloud/bigquery/v2/minimal/internal/dataset_logging.cc +++ b/google/cloud/bigquery/v2/minimal/internal/dataset_logging.cc @@ -14,11 +14,11 @@ #include "google/cloud/bigquery/v2/minimal/internal/dataset_logging.h" #include "google/cloud/bigquery/v2/minimal/internal/log_wrapper.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/invoke_result.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/log.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_join.h" #include "absl/strings/string_view.h" namespace google { diff --git a/google/cloud/bigquery/v2/minimal/internal/dataset_metadata.cc b/google/cloud/bigquery/v2/minimal/internal/dataset_metadata.cc index 9b0b8ff44d7e8..48ae0681c5305 100644 --- a/google/cloud/bigquery/v2/minimal/internal/dataset_metadata.cc +++ b/google/cloud/bigquery/v2/minimal/internal/dataset_metadata.cc @@ -16,9 +16,9 @@ #include "google/cloud/bigquery/v2/minimal/internal/dataset_metadata.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include #include diff --git a/google/cloud/bigquery/v2/minimal/internal/dataset_request.cc b/google/cloud/bigquery/v2/minimal/internal/dataset_request.cc index 76c29b3b7aa5f..42e1807a52404 100644 --- a/google/cloud/bigquery/v2/minimal/internal/dataset_request.cc +++ b/google/cloud/bigquery/v2/minimal/internal/dataset_request.cc @@ -15,12 +15,12 @@ #include "google/cloud/bigquery/v2/minimal/internal/dataset_request.h" #include "google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/debug_string.h" #include "google/cloud/internal/format_time_point.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/status.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/bigquery/v2/minimal/internal/dataset_request_test.cc b/google/cloud/bigquery/v2/minimal/internal/dataset_request_test.cc index 36e2fbd98ec12..6916d4153fcad 100644 --- a/google/cloud/bigquery/v2/minimal/internal/dataset_request_test.cc +++ b/google/cloud/bigquery/v2/minimal/internal/dataset_request_test.cc @@ -14,10 +14,10 @@ #include "google/cloud/bigquery/v2/minimal/internal/dataset_request.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/format_time_point.h" #include "google/cloud/options.h" #include "google/cloud/testing_util/status_matchers.h" +#include "absl/strings/str_cat.h" #include namespace google { diff --git a/google/cloud/bigquery/v2/minimal/internal/dataset_response.cc b/google/cloud/bigquery/v2/minimal/internal/dataset_response.cc index e09176ded08e4..0c163fa4157ac 100644 --- a/google/cloud/bigquery/v2/minimal/internal/dataset_response.cc +++ b/google/cloud/bigquery/v2/minimal/internal/dataset_response.cc @@ -13,9 +13,9 @@ // limitations under the License. #include "google/cloud/bigquery/v2/minimal/internal/dataset_response.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/debug_string.h" #include "google/cloud/internal/make_status.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/bigquery/v2/minimal/internal/dataset_rest_stub.cc b/google/cloud/bigquery/v2/minimal/internal/dataset_rest_stub.cc index 01ab5707b7c19..718b84396a711 100644 --- a/google/cloud/bigquery/v2/minimal/internal/dataset_rest_stub.cc +++ b/google/cloud/bigquery/v2/minimal/internal/dataset_rest_stub.cc @@ -14,9 +14,9 @@ #include "google/cloud/bigquery/v2/minimal/internal/dataset_rest_stub.h" #include "google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_join.h" namespace google { namespace cloud { diff --git a/google/cloud/bigquery/v2/minimal/internal/job.cc b/google/cloud/bigquery/v2/minimal/internal/job.cc index 6f5b1492b6276..6ac6adde3914e 100644 --- a/google/cloud/bigquery/v2/minimal/internal/job.cc +++ b/google/cloud/bigquery/v2/minimal/internal/job.cc @@ -14,8 +14,8 @@ #include "google/cloud/bigquery/v2/minimal/internal/job.h" #include "google/cloud/bigquery/v2/minimal/internal/json_utils.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/debug_string.h" +#include "absl/strings/str_join.h" namespace google { namespace cloud { diff --git a/google/cloud/bigquery/v2/minimal/internal/job_configuration.cc b/google/cloud/bigquery/v2/minimal/internal/job_configuration.cc index 8e7503fa30f3c..898a4827cf560 100644 --- a/google/cloud/bigquery/v2/minimal/internal/job_configuration.cc +++ b/google/cloud/bigquery/v2/minimal/internal/job_configuration.cc @@ -14,8 +14,8 @@ #include "google/cloud/bigquery/v2/minimal/internal/job_configuration.h" #include "google/cloud/bigquery/v2/minimal/internal/json_utils.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/debug_string.h" +#include "absl/strings/str_join.h" namespace google { namespace cloud { diff --git a/google/cloud/bigquery/v2/minimal/internal/job_configuration_query.cc b/google/cloud/bigquery/v2/minimal/internal/job_configuration_query.cc index 8633e227f56ea..f886642a14784 100644 --- a/google/cloud/bigquery/v2/minimal/internal/job_configuration_query.cc +++ b/google/cloud/bigquery/v2/minimal/internal/job_configuration_query.cc @@ -14,8 +14,8 @@ #include "google/cloud/bigquery/v2/minimal/internal/job_configuration_query.h" #include "google/cloud/bigquery/v2/minimal/internal/json_utils.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/debug_string.h" +#include "absl/strings/str_join.h" namespace google { namespace cloud { diff --git a/google/cloud/bigquery/v2/minimal/internal/job_logging.cc b/google/cloud/bigquery/v2/minimal/internal/job_logging.cc index 83c2624e3883d..002b76801f95b 100644 --- a/google/cloud/bigquery/v2/minimal/internal/job_logging.cc +++ b/google/cloud/bigquery/v2/minimal/internal/job_logging.cc @@ -16,9 +16,9 @@ #include "google/cloud/bigquery/v2/minimal/internal/job_logging.h" #include "google/cloud/bigquery/v2/minimal/internal/log_wrapper.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_join.h" namespace google { namespace cloud { diff --git a/google/cloud/bigquery/v2/minimal/internal/job_metadata.cc b/google/cloud/bigquery/v2/minimal/internal/job_metadata.cc index 8d63fce3d66ff..27ba9e78debd4 100644 --- a/google/cloud/bigquery/v2/minimal/internal/job_metadata.cc +++ b/google/cloud/bigquery/v2/minimal/internal/job_metadata.cc @@ -16,9 +16,9 @@ #include "google/cloud/bigquery/v2/minimal/internal/job_metadata.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include #include diff --git a/google/cloud/bigquery/v2/minimal/internal/job_request.cc b/google/cloud/bigquery/v2/minimal/internal/job_request.cc index d8a7d3bdf1afb..d3404627870fb 100644 --- a/google/cloud/bigquery/v2/minimal/internal/job_request.cc +++ b/google/cloud/bigquery/v2/minimal/internal/job_request.cc @@ -17,11 +17,11 @@ #include "google/cloud/bigquery/v2/minimal/internal/json_utils.h" #include "google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/debug_string.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/status.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include namespace google { @@ -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 7b4de78b1de11..d1be2f64247a8 100644 --- a/google/cloud/bigquery/v2/minimal/internal/job_request_test.cc +++ b/google/cloud/bigquery/v2/minimal/internal/job_request_test.cc @@ -16,10 +16,10 @@ #include "google/cloud/bigquery/v2/minimal/testing/job_query_test_utils.h" #include "google/cloud/bigquery/v2/minimal/testing/job_test_utils.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/format_time_point.h" #include "google/cloud/options.h" #include "google/cloud/testing_util/status_matchers.h" +#include "absl/strings/str_cat.h" #include #include @@ -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/job_response.cc b/google/cloud/bigquery/v2/minimal/internal/job_response.cc index 3eb2633f5bd8f..1c00a4fa072d0 100644 --- a/google/cloud/bigquery/v2/minimal/internal/job_response.cc +++ b/google/cloud/bigquery/v2/minimal/internal/job_response.cc @@ -14,9 +14,9 @@ #include "google/cloud/bigquery/v2/minimal/internal/job_response.h" #include "google/cloud/bigquery/v2/minimal/internal/json_utils.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/debug_string.h" #include "google/cloud/internal/make_status.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/bigquery/v2/minimal/internal/job_rest_stub.cc b/google/cloud/bigquery/v2/minimal/internal/job_rest_stub.cc index b6edf81c97f01..6f0036f6cad4a 100644 --- a/google/cloud/bigquery/v2/minimal/internal/job_rest_stub.cc +++ b/google/cloud/bigquery/v2/minimal/internal/job_rest_stub.cc @@ -14,9 +14,9 @@ #include "google/cloud/bigquery/v2/minimal/internal/job_rest_stub.h" #include "google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_join.h" #include namespace google { diff --git a/google/cloud/bigquery/v2/minimal/internal/log_wrapper.h b/google/cloud/bigquery/v2/minimal/internal/log_wrapper.h index aeaaa660bd0a2..f689cb0aef151 100644 --- a/google/cloud/bigquery/v2/minimal/internal/log_wrapper.h +++ b/google/cloud/bigquery/v2/minimal/internal/log_wrapper.h @@ -15,12 +15,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_V2_MINIMAL_INTERNAL_LOG_WRAPPER_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_V2_MINIMAL_INTERNAL_LOG_WRAPPER_H -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/debug_string.h" #include "google/cloud/internal/invoke_result.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/log.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_join.h" #include "absl/strings/string_view.h" namespace google { @@ -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/project_metadata.cc b/google/cloud/bigquery/v2/minimal/internal/project_metadata.cc index 834fd64ffe746..26fb30c156b31 100644 --- a/google/cloud/bigquery/v2/minimal/internal/project_metadata.cc +++ b/google/cloud/bigquery/v2/minimal/internal/project_metadata.cc @@ -16,8 +16,8 @@ #include "google/cloud/bigquery/v2/minimal/internal/project_metadata.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" +#include "absl/strings/str_join.h" #include #include diff --git a/google/cloud/bigquery/v2/minimal/internal/project_request.cc b/google/cloud/bigquery/v2/minimal/internal/project_request.cc index e207bf5a8465e..130b6410487fd 100644 --- a/google/cloud/bigquery/v2/minimal/internal/project_request.cc +++ b/google/cloud/bigquery/v2/minimal/internal/project_request.cc @@ -15,12 +15,12 @@ #include "google/cloud/bigquery/v2/minimal/internal/project_request.h" #include "google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/debug_string.h" #include "google/cloud/internal/format_time_point.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/status.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/bigquery/v2/minimal/internal/project_request_test.cc b/google/cloud/bigquery/v2/minimal/internal/project_request_test.cc index 0eac637677825..7d836349d1d3c 100644 --- a/google/cloud/bigquery/v2/minimal/internal/project_request_test.cc +++ b/google/cloud/bigquery/v2/minimal/internal/project_request_test.cc @@ -14,10 +14,10 @@ #include "google/cloud/bigquery/v2/minimal/internal/project_request.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/format_time_point.h" #include "google/cloud/options.h" #include "google/cloud/testing_util/status_matchers.h" +#include "absl/strings/str_cat.h" #include namespace google { diff --git a/google/cloud/bigquery/v2/minimal/internal/project_response.cc b/google/cloud/bigquery/v2/minimal/internal/project_response.cc index 122160c8a01d2..b1bf86ad7932b 100644 --- a/google/cloud/bigquery/v2/minimal/internal/project_response.cc +++ b/google/cloud/bigquery/v2/minimal/internal/project_response.cc @@ -13,10 +13,10 @@ // limitations under the License. #include "google/cloud/bigquery/v2/minimal/internal/project_response.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/debug_string.h" #include "google/cloud/internal/make_status.h" #include "absl/strings/numbers.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.cc b/google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.cc index 8c1fb5c534a88..c58851bb618eb 100644 --- a/google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.cc +++ b/google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.cc @@ -14,8 +14,8 @@ #include "google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { 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 c0d12fc650af5..34dd83a79a44f 100644 --- a/google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.h +++ b/google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.h @@ -16,10 +16,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_V2_MINIMAL_INTERNAL_REST_STUB_UTILS_H #include "google/cloud/bigquery/v2/minimal/internal/bigquery_http_response.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/rest_request.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_join.h" namespace google { namespace cloud { @@ -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/internal/table_logging.cc b/google/cloud/bigquery/v2/minimal/internal/table_logging.cc index 87871324547ca..18e9750c3fac3 100644 --- a/google/cloud/bigquery/v2/minimal/internal/table_logging.cc +++ b/google/cloud/bigquery/v2/minimal/internal/table_logging.cc @@ -14,11 +14,11 @@ #include "google/cloud/bigquery/v2/minimal/internal/table_logging.h" #include "google/cloud/bigquery/v2/minimal/internal/log_wrapper.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/invoke_result.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/log.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_join.h" #include "absl/strings/string_view.h" namespace google { diff --git a/google/cloud/bigquery/v2/minimal/internal/table_metadata.cc b/google/cloud/bigquery/v2/minimal/internal/table_metadata.cc index 6ac4b345b2961..ac5415aa36bd0 100644 --- a/google/cloud/bigquery/v2/minimal/internal/table_metadata.cc +++ b/google/cloud/bigquery/v2/minimal/internal/table_metadata.cc @@ -16,9 +16,9 @@ #include "google/cloud/bigquery/v2/minimal/internal/table_metadata.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include #include diff --git a/google/cloud/bigquery/v2/minimal/internal/table_request.cc b/google/cloud/bigquery/v2/minimal/internal/table_request.cc index 6cc59ad428890..1ec05597cf28f 100644 --- a/google/cloud/bigquery/v2/minimal/internal/table_request.cc +++ b/google/cloud/bigquery/v2/minimal/internal/table_request.cc @@ -15,12 +15,12 @@ #include "google/cloud/bigquery/v2/minimal/internal/table_request.h" #include "google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/debug_string.h" #include "google/cloud/internal/format_time_point.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/status.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/bigquery/v2/minimal/internal/table_request_test.cc b/google/cloud/bigquery/v2/minimal/internal/table_request_test.cc index aa1c730a5efdd..0b4e1d7fb6b02 100644 --- a/google/cloud/bigquery/v2/minimal/internal/table_request_test.cc +++ b/google/cloud/bigquery/v2/minimal/internal/table_request_test.cc @@ -14,10 +14,10 @@ #include "google/cloud/bigquery/v2/minimal/internal/table_request.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/format_time_point.h" #include "google/cloud/options.h" #include "google/cloud/testing_util/status_matchers.h" +#include "absl/strings/str_cat.h" #include namespace google { diff --git a/google/cloud/bigquery/v2/minimal/internal/table_response.cc b/google/cloud/bigquery/v2/minimal/internal/table_response.cc index d274a8f73b16a..18b12e0600620 100644 --- a/google/cloud/bigquery/v2/minimal/internal/table_response.cc +++ b/google/cloud/bigquery/v2/minimal/internal/table_response.cc @@ -13,10 +13,10 @@ // limitations under the License. #include "google/cloud/bigquery/v2/minimal/internal/table_response.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/debug_string.h" #include "google/cloud/internal/make_status.h" #include "absl/strings/numbers.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/bigquery/v2/minimal/internal/table_rest_stub.cc b/google/cloud/bigquery/v2/minimal/internal/table_rest_stub.cc index 89c5641c4a8ab..715e0ba87e072 100644 --- a/google/cloud/bigquery/v2/minimal/internal/table_rest_stub.cc +++ b/google/cloud/bigquery/v2/minimal/internal/table_rest_stub.cc @@ -14,9 +14,9 @@ #include "google/cloud/bigquery/v2/minimal/internal/table_rest_stub.h" #include "google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_join.h" namespace google { namespace cloud { 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/BUILD.bazel b/google/cloud/bigquerycontrol/BUILD.bazel index b14edb09ad7c2..812cb093dcca5 100644 --- a/google/cloud/bigquerycontrol/BUILD.bazel +++ b/google/cloud/bigquerycontrol/BUILD.bazel @@ -25,7 +25,7 @@ service_dirs = [ src_dirs = service_dirs + [d + "internal/" for d in service_dirs] googleapis_deps = [ - "@com_google_googleapis//google/cloud/bigquery/v2:bigquery_cc_proto", + "@googleapis//google/cloud/bigquery/v2:bigquery_cc_proto", ] cc_gapic_library( diff --git a/google/cloud/bigquerycontrol/quickstart/.bazelrc b/google/cloud/bigquerycontrol/quickstart/.bazelrc index 15d5c055db074..343e7f623d628 100644 --- a/google/cloud/bigquerycontrol/quickstart/.bazelrc +++ b/google/cloud/bigquerycontrol/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/bigquerycontrol/quickstart/CMakeLists.txt index 665715bcc9c3b..10e1235254bca 100644 --- a/google/cloud/bigquerycontrol/quickstart/CMakeLists.txt +++ b/google/cloud/bigquerycontrol/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the BigQuery API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-bigquerycontrol-quickstart CXX) find_package(google_cloud_cpp_bigquerycontrol REQUIRED) diff --git a/google/cloud/bigquerycontrol/quickstart/WORKSPACE.bazel b/google/cloud/bigquerycontrol/quickstart/WORKSPACE.bazel index ccc125141242c..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 = "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/bigquerycontrol/v2/dataset_connection.h b/google/cloud/bigquerycontrol/v2/dataset_connection.h index 0be5bdab45456..cd3b94b953285 100644 --- a/google/cloud/bigquerycontrol/v2/dataset_connection.h +++ b/google/cloud/bigquerycontrol/v2/dataset_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_DATASET_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_DATASET_CONNECTION_H +#include "google/cloud/bigquery/v2/dataset.pb.h" #include "google/cloud/bigquerycontrol/v2/dataset_connection_idempotency_policy.h" #include "google/cloud/bigquerycontrol/v2/internal/dataset_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/dataset_connection_idempotency_policy.h b/google/cloud/bigquerycontrol/v2/dataset_connection_idempotency_policy.h index 8164426b20c7e..af5a8fb6bde5a 100644 --- a/google/cloud/bigquerycontrol/v2/dataset_connection_idempotency_policy.h +++ b/google/cloud/bigquerycontrol/v2/dataset_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_DATASET_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_DATASET_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/v2/dataset.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/internal/dataset_option_defaults.cc b/google/cloud/bigquerycontrol/v2/internal/dataset_option_defaults.cc index 19f6e15aa8392..7d5446c1a8268 100644 --- a/google/cloud/bigquerycontrol/v2/internal/dataset_option_defaults.cc +++ b/google/cloud/bigquerycontrol/v2/internal/dataset_option_defaults.cc @@ -41,7 +41,7 @@ Options DatasetServiceDefaultOptions(Options options) { if (!options.has()) { options.set( bigquerycontrol_v2::DatasetServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/bigquerycontrol/v2/internal/dataset_rest_logging_decorator.h b/google/cloud/bigquerycontrol/v2/internal/dataset_rest_logging_decorator.h index be6d2cd75efc2..44f45eacff711 100644 --- a/google/cloud/bigquerycontrol/v2/internal/dataset_rest_logging_decorator.h +++ b/google/cloud/bigquerycontrol/v2/internal/dataset_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_DATASET_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_DATASET_REST_LOGGING_DECORATOR_H +#include "google/cloud/bigquery/v2/dataset.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/dataset_rest_metadata_decorator.cc b/google/cloud/bigquerycontrol/v2/internal/dataset_rest_metadata_decorator.cc index cf91d2a9faf0e..415696dca2a0f 100644 --- a/google/cloud/bigquerycontrol/v2/internal/dataset_rest_metadata_decorator.cc +++ b/google/cloud/bigquerycontrol/v2/internal/dataset_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/bigquery/v2/dataset.proto #include "google/cloud/bigquerycontrol/v2/internal/dataset_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/dataset_rest_metadata_decorator.h b/google/cloud/bigquerycontrol/v2/internal/dataset_rest_metadata_decorator.h index 48b20e28f89d1..da3b6686875aa 100644 --- a/google/cloud/bigquerycontrol/v2/internal/dataset_rest_metadata_decorator.h +++ b/google/cloud/bigquerycontrol/v2/internal/dataset_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_DATASET_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_DATASET_REST_METADATA_DECORATOR_H +#include "google/cloud/bigquery/v2/dataset.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.cc index fb48a231fdd16..b8a862c958665 100644 --- a/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/bigquery/v2/dataset.proto #include "google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.h" +#include "google/cloud/bigquery/v2/dataset.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.h b/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.h index db840d5c3a11c..1a1c2629619fd 100644 --- a/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.h +++ b/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_DATASET_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_DATASET_REST_STUB_H +#include "google/cloud/bigquery/v2/dataset.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/internal/dataset_tracing_connection.cc b/google/cloud/bigquerycontrol/v2/internal/dataset_tracing_connection.cc index 87ecb9c487b9a..92e74db4bceae 100644 --- a/google/cloud/bigquerycontrol/v2/internal/dataset_tracing_connection.cc +++ b/google/cloud/bigquerycontrol/v2/internal/dataset_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigquerycontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DatasetServiceTracingConnection::DatasetServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -98,16 +96,12 @@ DatasetServiceTracingConnection::UndeleteDataset( return internal::EndSpan(*span, child_->UndeleteDataset(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDatasetServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquerycontrol/v2/internal/dataset_tracing_connection.h b/google/cloud/bigquerycontrol/v2/internal/dataset_tracing_connection.h index ebdc5cac1aa84..363d105f80caa 100644 --- a/google/cloud/bigquerycontrol/v2/internal/dataset_tracing_connection.h +++ b/google/cloud/bigquerycontrol/v2/internal/dataset_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquerycontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DatasetServiceTracingConnection : public bigquerycontrol_v2::DatasetServiceConnection { public: @@ -69,8 +67,6 @@ class DatasetServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquerycontrol/v2/internal/job_option_defaults.cc b/google/cloud/bigquerycontrol/v2/internal/job_option_defaults.cc index e0a80e194ec05..1bd1b480cca76 100644 --- a/google/cloud/bigquerycontrol/v2/internal/job_option_defaults.cc +++ b/google/cloud/bigquerycontrol/v2/internal/job_option_defaults.cc @@ -41,7 +41,7 @@ Options JobServiceDefaultOptions(Options options) { if (!options.has()) { options.set( bigquerycontrol_v2::JobServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/bigquerycontrol/v2/internal/job_rest_logging_decorator.h b/google/cloud/bigquerycontrol/v2/internal/job_rest_logging_decorator.h index 1eba27bd9b1b4..4f211669d1cf8 100644 --- a/google/cloud/bigquerycontrol/v2/internal/job_rest_logging_decorator.h +++ b/google/cloud/bigquerycontrol/v2/internal/job_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_JOB_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_JOB_REST_LOGGING_DECORATOR_H +#include "google/cloud/bigquery/v2/job.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/job_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/job_rest_metadata_decorator.cc b/google/cloud/bigquerycontrol/v2/internal/job_rest_metadata_decorator.cc index a8483fdbe8863..13063d40fa624 100644 --- a/google/cloud/bigquerycontrol/v2/internal/job_rest_metadata_decorator.cc +++ b/google/cloud/bigquerycontrol/v2/internal/job_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/bigquery/v2/job.proto #include "google/cloud/bigquerycontrol/v2/internal/job_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/job_rest_metadata_decorator.h b/google/cloud/bigquerycontrol/v2/internal/job_rest_metadata_decorator.h index 0f4e68970e457..b4386102d45d9 100644 --- a/google/cloud/bigquerycontrol/v2/internal/job_rest_metadata_decorator.h +++ b/google/cloud/bigquerycontrol/v2/internal/job_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_JOB_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_JOB_REST_METADATA_DECORATOR_H +#include "google/cloud/bigquery/v2/job.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/job_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.cc index 2a468e833894e..d8e00d129c4e7 100644 --- a/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/bigquery/v2/job.proto #include "google/cloud/bigquerycontrol/v2/internal/job_rest_stub.h" +#include "google/cloud/bigquery/v2/job.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.h b/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.h index a6b24b0a50bec..cf99f90548137 100644 --- a/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.h +++ b/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_JOB_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_JOB_REST_STUB_H +#include "google/cloud/bigquery/v2/job.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/internal/job_tracing_connection.cc b/google/cloud/bigquerycontrol/v2/internal/job_tracing_connection.cc index 8a9e1763deee2..a3c4b317d13e6 100644 --- a/google/cloud/bigquerycontrol/v2/internal/job_tracing_connection.cc +++ b/google/cloud/bigquerycontrol/v2/internal/job_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigquerycontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - JobServiceTracingConnection::JobServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -97,16 +95,12 @@ JobServiceTracingConnection::Query( return internal::EndSpan(*span, child_->Query(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeJobServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquerycontrol/v2/internal/job_tracing_connection.h b/google/cloud/bigquerycontrol/v2/internal/job_tracing_connection.h index ef7c3a0938506..64e4d7362e59a 100644 --- a/google/cloud/bigquerycontrol/v2/internal/job_tracing_connection.h +++ b/google/cloud/bigquerycontrol/v2/internal/job_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquerycontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class JobServiceTracingConnection : public bigquerycontrol_v2::JobServiceConnection { public: @@ -66,8 +64,6 @@ class JobServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquerycontrol/v2/internal/model_option_defaults.cc b/google/cloud/bigquerycontrol/v2/internal/model_option_defaults.cc index cc610f4b79926..788f269e36ee7 100644 --- a/google/cloud/bigquerycontrol/v2/internal/model_option_defaults.cc +++ b/google/cloud/bigquerycontrol/v2/internal/model_option_defaults.cc @@ -41,7 +41,7 @@ Options ModelServiceDefaultOptions(Options options) { if (!options.has()) { options.set( bigquerycontrol_v2::ModelServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/bigquerycontrol/v2/internal/model_rest_logging_decorator.h b/google/cloud/bigquerycontrol/v2/internal/model_rest_logging_decorator.h index 45a6739f5fb26..f9f3ee58221d3 100644 --- a/google/cloud/bigquerycontrol/v2/internal/model_rest_logging_decorator.h +++ b/google/cloud/bigquerycontrol/v2/internal/model_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_MODEL_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_MODEL_REST_LOGGING_DECORATOR_H +#include "google/cloud/bigquery/v2/model.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/model_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/model_rest_metadata_decorator.cc b/google/cloud/bigquerycontrol/v2/internal/model_rest_metadata_decorator.cc index fdbc039a95da0..1da685d2bd5cf 100644 --- a/google/cloud/bigquerycontrol/v2/internal/model_rest_metadata_decorator.cc +++ b/google/cloud/bigquerycontrol/v2/internal/model_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/bigquery/v2/model.proto #include "google/cloud/bigquerycontrol/v2/internal/model_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/model_rest_metadata_decorator.h b/google/cloud/bigquerycontrol/v2/internal/model_rest_metadata_decorator.h index 276fcd27e64c0..b2b41a7754aa0 100644 --- a/google/cloud/bigquerycontrol/v2/internal/model_rest_metadata_decorator.h +++ b/google/cloud/bigquerycontrol/v2/internal/model_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_MODEL_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_MODEL_REST_METADATA_DECORATOR_H +#include "google/cloud/bigquery/v2/model.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/model_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.cc index b9026b7d2deab..c6115bc24ed23 100644 --- a/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/bigquery/v2/model.proto #include "google/cloud/bigquerycontrol/v2/internal/model_rest_stub.h" +#include "google/cloud/bigquery/v2/model.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.h b/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.h index 80c9500815477..7dc939094813d 100644 --- a/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.h +++ b/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_MODEL_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_MODEL_REST_STUB_H +#include "google/cloud/bigquery/v2/model.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/internal/model_tracing_connection.cc b/google/cloud/bigquerycontrol/v2/internal/model_tracing_connection.cc index 18abd8120a067..203fffb0273cd 100644 --- a/google/cloud/bigquerycontrol/v2/internal/model_tracing_connection.cc +++ b/google/cloud/bigquerycontrol/v2/internal/model_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigquerycontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ModelServiceTracingConnection::ModelServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -70,16 +68,12 @@ Status ModelServiceTracingConnection::DeleteModel( return internal::EndSpan(*span, child_->DeleteModel(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeModelServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquerycontrol/v2/internal/model_tracing_connection.h b/google/cloud/bigquerycontrol/v2/internal/model_tracing_connection.h index c52362bb6f7f4..9cca8bd487294 100644 --- a/google/cloud/bigquerycontrol/v2/internal/model_tracing_connection.h +++ b/google/cloud/bigquerycontrol/v2/internal/model_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquerycontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ModelServiceTracingConnection : public bigquerycontrol_v2::ModelServiceConnection { public: @@ -56,8 +54,6 @@ class ModelServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquerycontrol/v2/internal/project_option_defaults.cc b/google/cloud/bigquerycontrol/v2/internal/project_option_defaults.cc index 73ecab1c6ae72..e8244eb1af57a 100644 --- a/google/cloud/bigquerycontrol/v2/internal/project_option_defaults.cc +++ b/google/cloud/bigquerycontrol/v2/internal/project_option_defaults.cc @@ -41,7 +41,7 @@ Options ProjectServiceDefaultOptions(Options options) { if (!options.has()) { options.set( bigquerycontrol_v2::ProjectServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/bigquerycontrol/v2/internal/project_rest_logging_decorator.h b/google/cloud/bigquerycontrol/v2/internal/project_rest_logging_decorator.h index b066836a55368..d5d545b4d0f1b 100644 --- a/google/cloud/bigquerycontrol/v2/internal/project_rest_logging_decorator.h +++ b/google/cloud/bigquerycontrol/v2/internal/project_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_PROJECT_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_PROJECT_REST_LOGGING_DECORATOR_H +#include "google/cloud/bigquery/v2/project.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/project_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/project_rest_metadata_decorator.cc b/google/cloud/bigquerycontrol/v2/internal/project_rest_metadata_decorator.cc index 3efb814ccebef..c538869322e31 100644 --- a/google/cloud/bigquerycontrol/v2/internal/project_rest_metadata_decorator.cc +++ b/google/cloud/bigquerycontrol/v2/internal/project_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/bigquery/v2/project.proto #include "google/cloud/bigquerycontrol/v2/internal/project_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/project_rest_metadata_decorator.h b/google/cloud/bigquerycontrol/v2/internal/project_rest_metadata_decorator.h index 1a56cf3da9a90..a56693988e4d5 100644 --- a/google/cloud/bigquerycontrol/v2/internal/project_rest_metadata_decorator.h +++ b/google/cloud/bigquerycontrol/v2/internal/project_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_PROJECT_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_PROJECT_REST_METADATA_DECORATOR_H +#include "google/cloud/bigquery/v2/project.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/project_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.cc index 4f6d6d9ef4b37..9fadfda343b31 100644 --- a/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/bigquery/v2/project.proto #include "google/cloud/bigquerycontrol/v2/internal/project_rest_stub.h" +#include "google/cloud/bigquery/v2/project.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.h b/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.h index 4d5f357cd33d8..d3c67125bfc51 100644 --- a/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.h +++ b/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_PROJECT_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_PROJECT_REST_STUB_H +#include "google/cloud/bigquery/v2/project.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/internal/project_tracing_connection.cc b/google/cloud/bigquerycontrol/v2/internal/project_tracing_connection.cc index 113332042cd56..9d5a4c9dc7bcb 100644 --- a/google/cloud/bigquerycontrol/v2/internal/project_tracing_connection.cc +++ b/google/cloud/bigquerycontrol/v2/internal/project_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace bigquerycontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ProjectServiceTracingConnection::ProjectServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -41,16 +39,12 @@ ProjectServiceTracingConnection::GetServiceAccount( return internal::EndSpan(*span, child_->GetServiceAccount(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeProjectServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquerycontrol/v2/internal/project_tracing_connection.h b/google/cloud/bigquerycontrol/v2/internal/project_tracing_connection.h index 67da6620f2447..4e6262695b724 100644 --- a/google/cloud/bigquerycontrol/v2/internal/project_tracing_connection.h +++ b/google/cloud/bigquerycontrol/v2/internal/project_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquerycontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ProjectServiceTracingConnection : public bigquerycontrol_v2::ProjectServiceConnection { public: @@ -48,8 +46,6 @@ class ProjectServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquerycontrol/v2/internal/routine_option_defaults.cc b/google/cloud/bigquerycontrol/v2/internal/routine_option_defaults.cc index ec8069532c7e3..65ec347cad9b0 100644 --- a/google/cloud/bigquerycontrol/v2/internal/routine_option_defaults.cc +++ b/google/cloud/bigquerycontrol/v2/internal/routine_option_defaults.cc @@ -41,7 +41,7 @@ Options RoutineServiceDefaultOptions(Options options) { if (!options.has()) { options.set( bigquerycontrol_v2::RoutineServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/bigquerycontrol/v2/internal/routine_rest_logging_decorator.h b/google/cloud/bigquerycontrol/v2/internal/routine_rest_logging_decorator.h index 525ea79ca371e..523d7df91b6fc 100644 --- a/google/cloud/bigquerycontrol/v2/internal/routine_rest_logging_decorator.h +++ b/google/cloud/bigquerycontrol/v2/internal/routine_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_ROUTINE_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_ROUTINE_REST_LOGGING_DECORATOR_H +#include "google/cloud/bigquery/v2/routine.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/routine_rest_metadata_decorator.cc b/google/cloud/bigquerycontrol/v2/internal/routine_rest_metadata_decorator.cc index 447ffe61787b7..f0d3949dc7620 100644 --- a/google/cloud/bigquerycontrol/v2/internal/routine_rest_metadata_decorator.cc +++ b/google/cloud/bigquerycontrol/v2/internal/routine_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/bigquery/v2/routine.proto #include "google/cloud/bigquerycontrol/v2/internal/routine_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/routine_rest_metadata_decorator.h b/google/cloud/bigquerycontrol/v2/internal/routine_rest_metadata_decorator.h index 10e66ff1765e5..7a4f3e10421aa 100644 --- a/google/cloud/bigquerycontrol/v2/internal/routine_rest_metadata_decorator.h +++ b/google/cloud/bigquerycontrol/v2/internal/routine_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_ROUTINE_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_ROUTINE_REST_METADATA_DECORATOR_H +#include "google/cloud/bigquery/v2/routine.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.cc index 72352c8e1321f..c9ad589949846 100644 --- a/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/bigquery/v2/routine.proto #include "google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.h" +#include "google/cloud/bigquery/v2/routine.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.h b/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.h index 603ef30e5baf9..0570acb5a4ae8 100644 --- a/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.h +++ b/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_ROUTINE_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_ROUTINE_REST_STUB_H +#include "google/cloud/bigquery/v2/routine.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/internal/routine_tracing_connection.cc b/google/cloud/bigquerycontrol/v2/internal/routine_tracing_connection.cc index f99fd3f60fa89..2473ccfcf97b7 100644 --- a/google/cloud/bigquerycontrol/v2/internal/routine_tracing_connection.cc +++ b/google/cloud/bigquerycontrol/v2/internal/routine_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace bigquerycontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RoutineServiceTracingConnection::RoutineServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -76,16 +74,12 @@ RoutineServiceTracingConnection::ListRoutines( return internal::EndSpan(*span, child_->ListRoutines(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRoutineServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquerycontrol/v2/internal/routine_tracing_connection.h b/google/cloud/bigquerycontrol/v2/internal/routine_tracing_connection.h index ba86a141ce091..43f00c2826ecb 100644 --- a/google/cloud/bigquerycontrol/v2/internal/routine_tracing_connection.h +++ b/google/cloud/bigquerycontrol/v2/internal/routine_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquerycontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RoutineServiceTracingConnection : public bigquerycontrol_v2::RoutineServiceConnection { public: @@ -61,8 +59,6 @@ class RoutineServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_option_defaults.cc b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_option_defaults.cc index 7b48521e6a1d3..1e26994c770d8 100644 --- a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_option_defaults.cc +++ b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_option_defaults.cc @@ -43,7 +43,7 @@ Options RowAccessPolicyServiceDefaultOptions(Options options) { bigquerycontrol_v2::RowAccessPolicyServiceRetryPolicyOption>()) { options.set( bigquerycontrol_v2::RowAccessPolicyServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_logging_decorator.h b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_logging_decorator.h index b54b416e26704..3dda5aca0f7eb 100644 --- a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_logging_decorator.h +++ b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_ROW_ACCESS_POLICY_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_ROW_ACCESS_POLICY_REST_LOGGING_DECORATOR_H +#include "google/cloud/bigquery/v2/row_access_policy.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_metadata_decorator.cc b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_metadata_decorator.cc index 1fa880f91f3c4..5229fae298713 100644 --- a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_metadata_decorator.cc +++ b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/bigquery/v2/row_access_policy.proto #include "google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_metadata_decorator.h b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_metadata_decorator.h index 4b86362152ce0..3368a245ddc92 100644 --- a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_metadata_decorator.h +++ b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_ROW_ACCESS_POLICY_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_ROW_ACCESS_POLICY_REST_METADATA_DECORATOR_H +#include "google/cloud/bigquery/v2/row_access_policy.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.cc index ded2701fced02..bf5d12a223fba 100644 --- a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/bigquery/v2/row_access_policy.proto #include "google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.h" +#include "google/cloud/bigquery/v2/row_access_policy.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.h b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.h index 0dddc899a6749..789d7518c1835 100644 --- a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.h +++ b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_ROW_ACCESS_POLICY_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_ROW_ACCESS_POLICY_REST_STUB_H +#include "google/cloud/bigquery/v2/row_access_policy.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_tracing_connection.cc b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_tracing_connection.cc index 1cf3f5f289106..03ea8c5c150ae 100644 --- a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_tracing_connection.cc +++ b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigquerycontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RowAccessPolicyServiceTracingConnection:: RowAccessPolicyServiceTracingConnection( std::shared_ptr @@ -98,18 +96,14 @@ Status RowAccessPolicyServiceTracingConnection::BatchDeleteRowAccessPolicies( child_->BatchDeleteRowAccessPolicies(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRowAccessPolicyServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_tracing_connection.h b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_tracing_connection.h index 8d626efb1d3f1..d806aac91c459 100644 --- a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_tracing_connection.h +++ b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquerycontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RowAccessPolicyServiceTracingConnection : public bigquerycontrol_v2::RowAccessPolicyServiceConnection { public: @@ -70,8 +68,6 @@ class RowAccessPolicyServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquerycontrol/v2/internal/table_option_defaults.cc b/google/cloud/bigquerycontrol/v2/internal/table_option_defaults.cc index 401bea12312ac..b46a3fa95c5e7 100644 --- a/google/cloud/bigquerycontrol/v2/internal/table_option_defaults.cc +++ b/google/cloud/bigquerycontrol/v2/internal/table_option_defaults.cc @@ -41,7 +41,7 @@ Options TableServiceDefaultOptions(Options options) { if (!options.has()) { options.set( bigquerycontrol_v2::TableServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/bigquerycontrol/v2/internal/table_rest_logging_decorator.h b/google/cloud/bigquerycontrol/v2/internal/table_rest_logging_decorator.h index 7b184514edb2e..71aa94654097d 100644 --- a/google/cloud/bigquerycontrol/v2/internal/table_rest_logging_decorator.h +++ b/google/cloud/bigquerycontrol/v2/internal/table_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_TABLE_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_TABLE_REST_LOGGING_DECORATOR_H +#include "google/cloud/bigquery/v2/table.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/table_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/table_rest_metadata_decorator.cc b/google/cloud/bigquerycontrol/v2/internal/table_rest_metadata_decorator.cc index 6d4270136ea1e..a8964e84a4dbf 100644 --- a/google/cloud/bigquerycontrol/v2/internal/table_rest_metadata_decorator.cc +++ b/google/cloud/bigquerycontrol/v2/internal/table_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/bigquery/v2/table.proto #include "google/cloud/bigquerycontrol/v2/internal/table_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/table_rest_metadata_decorator.h b/google/cloud/bigquerycontrol/v2/internal/table_rest_metadata_decorator.h index 9a211d82c37aa..0f65a512be563 100644 --- a/google/cloud/bigquerycontrol/v2/internal/table_rest_metadata_decorator.h +++ b/google/cloud/bigquerycontrol/v2/internal/table_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_TABLE_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_TABLE_REST_METADATA_DECORATOR_H +#include "google/cloud/bigquery/v2/table.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/table_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.cc index 1651c276dfcd1..acdc81a8d5adb 100644 --- a/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/bigquery/v2/table.proto #include "google/cloud/bigquerycontrol/v2/internal/table_rest_stub.h" +#include "google/cloud/bigquery/v2/table.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.h b/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.h index 96418d11764f1..1261b7c246a9f 100644 --- a/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.h +++ b/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_TABLE_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_INTERNAL_TABLE_REST_STUB_H +#include "google/cloud/bigquery/v2/table.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/internal/table_tracing_connection.cc b/google/cloud/bigquerycontrol/v2/internal/table_tracing_connection.cc index 18013c77ed2d7..4d488cff65d25 100644 --- a/google/cloud/bigquerycontrol/v2/internal/table_tracing_connection.cc +++ b/google/cloud/bigquerycontrol/v2/internal/table_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigquerycontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TableServiceTracingConnection::TableServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -89,16 +87,12 @@ TableServiceTracingConnection::ListTables( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTableServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigquerycontrol/v2/internal/table_tracing_connection.h b/google/cloud/bigquerycontrol/v2/internal/table_tracing_connection.h index 6c1402e4ec595..91fa030e7bedd 100644 --- a/google/cloud/bigquerycontrol/v2/internal/table_tracing_connection.h +++ b/google/cloud/bigquerycontrol/v2/internal/table_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigquerycontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TableServiceTracingConnection : public bigquerycontrol_v2::TableServiceConnection { public: @@ -64,8 +62,6 @@ class TableServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigquerycontrol/v2/job_connection.h b/google/cloud/bigquerycontrol/v2/job_connection.h index df5c6f314ae42..9fd0248aa1df1 100644 --- a/google/cloud/bigquerycontrol/v2/job_connection.h +++ b/google/cloud/bigquerycontrol/v2/job_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_JOB_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_JOB_CONNECTION_H +#include "google/cloud/bigquery/v2/job.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/job_retry_traits.h" #include "google/cloud/bigquerycontrol/v2/job_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/job_connection_idempotency_policy.h b/google/cloud/bigquerycontrol/v2/job_connection_idempotency_policy.h index da0e540de1446..d16aed54efac7 100644 --- a/google/cloud/bigquerycontrol/v2/job_connection_idempotency_policy.h +++ b/google/cloud/bigquerycontrol/v2/job_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_JOB_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_JOB_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/v2/job.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/model_connection.h b/google/cloud/bigquerycontrol/v2/model_connection.h index d005e455f1e78..673034c579ecc 100644 --- a/google/cloud/bigquerycontrol/v2/model_connection.h +++ b/google/cloud/bigquerycontrol/v2/model_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_MODEL_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_MODEL_CONNECTION_H +#include "google/cloud/bigquery/v2/model.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/model_retry_traits.h" #include "google/cloud/bigquerycontrol/v2/model_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/model_connection_idempotency_policy.h b/google/cloud/bigquerycontrol/v2/model_connection_idempotency_policy.h index 671763178a993..ec387f7302243 100644 --- a/google/cloud/bigquerycontrol/v2/model_connection_idempotency_policy.h +++ b/google/cloud/bigquerycontrol/v2/model_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_MODEL_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_MODEL_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/v2/model.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/project_connection.h b/google/cloud/bigquerycontrol/v2/project_connection.h index 072718c4f216a..f22264e9b3707 100644 --- a/google/cloud/bigquerycontrol/v2/project_connection.h +++ b/google/cloud/bigquerycontrol/v2/project_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_PROJECT_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_PROJECT_CONNECTION_H +#include "google/cloud/bigquery/v2/project.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/project_retry_traits.h" #include "google/cloud/bigquerycontrol/v2/project_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/project_connection_idempotency_policy.h b/google/cloud/bigquerycontrol/v2/project_connection_idempotency_policy.h index b0a3371366648..15b635e0f0d4f 100644 --- a/google/cloud/bigquerycontrol/v2/project_connection_idempotency_policy.h +++ b/google/cloud/bigquerycontrol/v2/project_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_PROJECT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_PROJECT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/v2/project.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/routine_connection.h b/google/cloud/bigquerycontrol/v2/routine_connection.h index a262a224cfebb..792be56081bab 100644 --- a/google/cloud/bigquerycontrol/v2/routine_connection.h +++ b/google/cloud/bigquerycontrol/v2/routine_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_ROUTINE_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_ROUTINE_CONNECTION_H +#include "google/cloud/bigquery/v2/routine.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/routine_retry_traits.h" #include "google/cloud/bigquerycontrol/v2/routine_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/routine_connection_idempotency_policy.h b/google/cloud/bigquerycontrol/v2/routine_connection_idempotency_policy.h index b4a25430c6671..32c119d2dff5a 100644 --- a/google/cloud/bigquerycontrol/v2/routine_connection_idempotency_policy.h +++ b/google/cloud/bigquerycontrol/v2/routine_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_ROUTINE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_ROUTINE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/v2/routine.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/row_access_policy_connection.h b/google/cloud/bigquerycontrol/v2/row_access_policy_connection.h index 2dab3bdbe6b6d..540cbfe560dc2 100644 --- a/google/cloud/bigquerycontrol/v2/row_access_policy_connection.h +++ b/google/cloud/bigquerycontrol/v2/row_access_policy_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_ROW_ACCESS_POLICY_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_ROW_ACCESS_POLICY_CONNECTION_H +#include "google/cloud/bigquery/v2/row_access_policy.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/row_access_policy_retry_traits.h" #include "google/cloud/bigquerycontrol/v2/row_access_policy_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/row_access_policy_connection_idempotency_policy.h b/google/cloud/bigquerycontrol/v2/row_access_policy_connection_idempotency_policy.h index 0b603e9044c88..7b6c3d8dac4c0 100644 --- a/google/cloud/bigquerycontrol/v2/row_access_policy_connection_idempotency_policy.h +++ b/google/cloud/bigquerycontrol/v2/row_access_policy_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_ROW_ACCESS_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_ROW_ACCESS_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/v2/row_access_policy.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/table_connection.h b/google/cloud/bigquerycontrol/v2/table_connection.h index b8b740ef8e3ef..c62d549441d1d 100644 --- a/google/cloud/bigquerycontrol/v2/table_connection.h +++ b/google/cloud/bigquerycontrol/v2/table_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_TABLE_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_TABLE_CONNECTION_H +#include "google/cloud/bigquery/v2/table.pb.h" #include "google/cloud/bigquerycontrol/v2/internal/table_retry_traits.h" #include "google/cloud/bigquerycontrol/v2/table_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigquerycontrol/v2/table_connection_idempotency_policy.h b/google/cloud/bigquerycontrol/v2/table_connection_idempotency_policy.h index c69ace1733ec6..e1bf6ec1ddef5 100644 --- a/google/cloud/bigquerycontrol/v2/table_connection_idempotency_policy.h +++ b/google/cloud/bigquerycontrol/v2/table_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_TABLE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERYCONTROL_V2_TABLE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/bigquery/v2/table.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/bigtable/BUILD.bazel b/google/cloud/bigtable/BUILD.bazel index b48840d42db4d..ba0cf3e9189d5 100644 --- a/google/cloud/bigtable/BUILD.bazel +++ b/google/cloud/bigtable/BUILD.bazel @@ -54,19 +54,19 @@ cc_library( deps = [ "//:common", "//:grpc_utils", - "@com_google_absl//absl/strings:str_format", - "@com_google_googleapis//google/bigtable/admin/v2:admin_cc_grpc", - "@com_google_googleapis//google/bigtable/v2:bigtable_cc_grpc", - "@com_google_googleapis//google/longrunning:longrunning_cc_grpc", - "@com_google_googleapis//google/rpc:error_details_cc_proto", - "@com_github_google_crc32c//:crc32c", - "@com_google_absl//absl/strings:cord", - "@com_github_grpc_grpc//:grpc++", + "@abseil-cpp//absl/strings:str_format", + "@googleapis//google/bigtable/admin/v2:admin_cc_grpc", + "@googleapis//google/bigtable/v2:bigtable_cc_grpc", + "@googleapis//google/longrunning:longrunning_cc_grpc", + "@googleapis//google/rpc:error_details_cc_proto", + "@abseil-cpp//absl/strings:cord", + "@abseil-cpp//absl/crc:crc32c", + "@grpc//:grpc++", ] + select({ ":metrics_enabled": [ "//:opentelemetry", - "@io_opentelemetry_cpp//api", - "@io_opentelemetry_cpp//sdk/src/metrics", + "@opentelemetry-cpp//api", + "@opentelemetry-cpp//sdk/src/metrics", ], "//conditions:default": [], }), @@ -91,7 +91,7 @@ cc_library( ":google_cloud_cpp_bigtable", "//:common", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) @@ -100,7 +100,10 @@ cc_library( testonly = True, srcs = bigtable_client_testing_srcs, hdrs = bigtable_client_testing_hdrs, - visibility = ["//visibility:public"], + visibility = [ + ":__subpackages__", + "//:__pkg__", + ], deps = [ ":google_cloud_cpp_bigtable", ":google_cloud_cpp_bigtable_mocks", @@ -108,7 +111,7 @@ cc_library( "//:grpc_utils", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) @@ -129,7 +132,7 @@ cc_library( "//:grpc_utils", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in bigtable_client_unit_tests] @@ -146,6 +149,6 @@ cc_test( "//:grpc_utils", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) diff --git a/google/cloud/bigtable/CMakeLists.txt b/google/cloud/bigtable/CMakeLists.txt index 48436804617f3..5dc1c42f4ed68 100644 --- a/google/cloud/bigtable/CMakeLists.txt +++ b/google/cloud/bigtable/CMakeLists.txt @@ -47,8 +47,7 @@ include(CTest) # Export the version information for Bazel. include(CreateBazelConfig) -find_package(opentelemetry-cpp CONFIG) -find_package(Crc32c) +find_package(opentelemetry-cpp CONFIG REQUIRED) # the client library add_library( @@ -90,6 +89,7 @@ add_library( admin/internal/bigtable_table_admin_auth_decorator.h admin/internal/bigtable_table_admin_connection_impl.cc admin/internal/bigtable_table_admin_connection_impl.h + admin/internal/bigtable_table_admin_connection_impl_bespoke.cc admin/internal/bigtable_table_admin_logging_decorator.cc admin/internal/bigtable_table_admin_logging_decorator.h admin/internal/bigtable_table_admin_metadata_decorator.cc @@ -105,11 +105,8 @@ add_library( admin/internal/bigtable_table_admin_tracing_connection.h admin/internal/bigtable_table_admin_tracing_stub.cc admin/internal/bigtable_table_admin_tracing_stub.h - admin_client.cc - admin_client.h app_profile_config.cc app_profile_config.h - async_row_reader.h bound_query.cc bound_query.h bytes.cc @@ -117,15 +114,11 @@ add_library( cell.h client.cc client.h - client_options.cc - client_options.h cluster_config.cc cluster_config.h cluster_list_responses.h column_family.h completion_queue.h - data_client.cc - data_client.h data_connection.cc data_connection.h expr.cc @@ -137,10 +130,6 @@ add_library( iam_policy.h idempotent_mutation_policy.cc idempotent_mutation_policy.h - instance_admin.cc - instance_admin.h - instance_admin_client.cc - instance_admin_client.h instance_config.cc instance_config.h instance_list_responses.h @@ -166,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 @@ -176,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 @@ -194,18 +186,10 @@ 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 - internal/legacy_async_bulk_apply.cc - internal/legacy_async_bulk_apply.h - internal/legacy_async_row_reader.cc - internal/legacy_async_row_reader.h - internal/legacy_async_row_sampler.cc - internal/legacy_async_row_sampler.h - internal/legacy_row_reader.cc - internal/legacy_row_reader.h - internal/logging_data_client.cc - internal/logging_data_client.h internal/logging_result_set_reader.cc internal/logging_result_set_reader.h internal/metrics.cc @@ -234,12 +218,12 @@ 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 internal/unary_client_utils.h - metadata_update_policy.cc - metadata_update_policy.h mutation_batcher.cc mutation_batcher.h mutation_branch.h @@ -276,8 +260,6 @@ add_library( sql_statement.h table.cc table.h - table_admin.cc - table_admin.h table_config.cc table_config.h table_resource.cc @@ -288,27 +270,21 @@ add_library( value.h version.cc version.h - version_info.h - wait_for_consistency.cc - wait_for_consistency.h) + version_info.h) target_link_libraries( google_cloud_cpp_bigtable PUBLIC absl::memory google-cloud-cpp::bigtable_protos google-cloud-cpp::common google-cloud-cpp::grpc_utils - Crc32c::crc32c gRPC::grpc++ gRPC::grpc protobuf::libprotobuf) -if (opentelemetry-cpp_FOUND) - target_compile_definitions( - google_cloud_cpp_bigtable - PRIVATE GOOGLE_CLOUD_CPP_BIGTABLE_WITH_OTEL_METRICS) - target_link_libraries(google_cloud_cpp_bigtable - PUBLIC google-cloud-cpp::opentelemetry) - set(EXTRA_MODULES "google_cloud_cpp_opentelemetry" "opentelemetry_metrics") -endif () +target_compile_definitions(google_cloud_cpp_bigtable + PRIVATE GOOGLE_CLOUD_CPP_BIGTABLE_WITH_OTEL_METRICS) +target_link_libraries(google_cloud_cpp_bigtable + PUBLIC google-cloud-cpp::opentelemetry) +set(EXTRA_MODULES "google_cloud_cpp_opentelemetry" "opentelemetry_metrics") google_cloud_cpp_add_common_options(google_cloud_cpp_bigtable) target_include_directories( google_cloud_cpp_bigtable @@ -354,9 +330,7 @@ google_cloud_cpp_add_pkgconfig( "google_cloud_cpp_grpc_utils" "google_cloud_cpp_common" "google_cloud_cpp_bigtable_protos" - ${EXTRA_MODULES} - LIBS - crc32c) + ${EXTRA_MODULES}) # Create and install the CMake configuration files. include(CMakePackageConfigHelpers) @@ -410,11 +384,8 @@ if (BUILD_TESTING) testing/cleanup_stale_resources.h testing/embedded_server_test_fixture.cc testing/embedded_server_test_fixture.h - testing/inprocess_data_client.cc - testing/inprocess_data_client.h testing/mock_async_failing_rpc_factory.h testing/mock_bigtable_stub.h - testing/mock_data_client.h testing/mock_mutate_rows_limiter.h testing/mock_mutate_rows_reader.h testing/mock_partial_result_set_reader.h @@ -425,9 +396,7 @@ if (BUILD_TESTING) testing/random_names.cc testing/random_names.h testing/table_integration_test.cc - testing/table_integration_test.h - testing/table_test_fixture.cc - testing/table_test_fixture.h) + testing/table_integration_test.h) target_link_libraries( bigtable_client_testing PUBLIC google-cloud-cpp::bigtable @@ -452,18 +421,15 @@ if (BUILD_TESTING) # List the unit tests, then setup the targets and dependencies. set(bigtable_client_unit_tests # cmake-format: sort - admin_client_test.cc app_profile_config_test.cc async_read_stream_test.cc bigtable_version_test.cc bound_query_test.cc bytes_test.cc cell_test.cc - client_options_test.cc client_test.cc cluster_config_test.cc column_family_test.cc - data_client_test.cc data_connection_test.cc expr_test.cc filters_test.cc @@ -471,8 +437,6 @@ if (BUILD_TESTING) iam_binding_test.cc iam_policy_test.cc idempotent_mutation_policy_test.cc - instance_admin_client_test.cc - instance_admin_test.cc instance_config_test.cc instance_resource_test.cc instance_update_config_test.cc @@ -482,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 @@ -491,13 +457,8 @@ 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/legacy_async_bulk_apply_test.cc - internal/legacy_async_row_reader_test.cc - internal/legacy_async_row_sampler_test.cc - internal/legacy_bulk_mutator_test.cc - internal/legacy_row_reader_test.cc - internal/logging_data_client_test.cc internal/logging_result_set_reader_test.cc internal/metrics_test.cc internal/mutate_rows_limiter_test.cc @@ -509,10 +470,9 @@ 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 - legacy_table_test.cc - metadata_update_policy_test.cc mocks/mock_row_reader_test.cc mutation_batcher_test.cc mutations_test.cc @@ -528,22 +488,13 @@ if (BUILD_TESTING) rpc_backoff_policy_test.cc rpc_retry_policy_test.cc sql_statement_test.cc - table_admin_test.cc - table_apply_test.cc - table_bulk_apply_test.cc - table_check_and_mutate_row_test.cc table_config_test.cc - table_readmodifywriterow_test.cc - table_readrow_test.cc - table_readrows_test.cc table_resource_test.cc - table_sample_row_keys_test.cc table_test.cc testing/cleanup_stale_resources_test.cc testing/random_names_test.cc timestamp_test.cc - value_test.cc - wait_for_consistency_test.cc) + value_test.cc) # Export the list of unit tests so the Bazel BUILD file can pick it up. export_list_to_bazel("bigtable_client_unit_tests.bzl" diff --git a/google/cloud/bigtable/admin/bigtable_instance_admin_client.h b/google/cloud/bigtable/admin/bigtable_instance_admin_client.h index dbfb64ab01481..c8be52c0513be 100644 --- a/google/cloud/bigtable/admin/bigtable_instance_admin_client.h +++ b/google/cloud/bigtable/admin/bigtable_instance_admin_client.h @@ -28,7 +28,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/bigtable/admin/bigtable_instance_admin_connection.h b/google/cloud/bigtable/admin/bigtable_instance_admin_connection.h index 941f91fea1c50..34afef13a90b5 100644 --- a/google/cloud/bigtable/admin/bigtable_instance_admin_connection.h +++ b/google/cloud/bigtable/admin/bigtable_instance_admin_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/bigtable/admin/bigtable_instance_admin_connection_idempotency_policy.h b/google/cloud/bigtable/admin/bigtable_instance_admin_connection_idempotency_policy.h index 7e43c82f5af91..28d36da00f188 100644 --- a/google/cloud/bigtable/admin/bigtable_instance_admin_connection_idempotency_policy.h +++ b/google/cloud/bigtable/admin/bigtable_instance_admin_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.grpc.pb.h" #include namespace google { diff --git a/google/cloud/bigtable/admin/bigtable_table_admin_client.cc b/google/cloud/bigtable/admin/bigtable_table_admin_client.cc index a30ce9aac2bca..347aa10bba977 100644 --- a/google/cloud/bigtable/admin/bigtable_table_admin_client.cc +++ b/google/cloud/bigtable/admin/bigtable_table_admin_client.cc @@ -821,6 +821,14 @@ BigtableTableAdminClient::AsyncCheckConsistency( return connection_->AsyncCheckConsistency(request); } +future> +BigtableTableAdminClient::WaitForConsistency( + google::bigtable::admin::v2::CheckConsistencyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->WaitForConsistency(request); +} + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_admin } // namespace cloud diff --git a/google/cloud/bigtable/admin/bigtable_table_admin_client.h b/google/cloud/bigtable/admin/bigtable_table_admin_client.h index 5c4926ffa55fa..cb10d31bfe4a8 100644 --- a/google/cloud/bigtable/admin/bigtable_table_admin_client.h +++ b/google/cloud/bigtable/admin/bigtable_table_admin_client.h @@ -28,7 +28,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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( @@ -2581,6 +2581,40 @@ class BigtableTableAdminClient { google::bigtable::admin::v2::CheckConsistencyRequest const& request, Options opts = {}); + // clang-format off + /// + /// Polls a table until it is consistent or the RetryPolicy is exhausted based + /// on a consistency token, that is, if replication has caught up based on the + /// provided conditions specified in the token and the check 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.bigtable.admin.v2.CheckConsistencyRequest]. + /// Proto messages are converted to 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.bigtable.admin.v2.CheckConsistencyResponse]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.bigtable.admin.v2.CheckConsistencyRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L909} + /// [google.bigtable.admin.v2.CheckConsistencyResponse]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L948} + /// + // clang-format on + future> + WaitForConsistency( + google::bigtable::admin::v2::CheckConsistencyRequest const& request, + Options opts = {}); + private: std::shared_ptr connection_; Options options_; diff --git a/google/cloud/bigtable/admin/bigtable_table_admin_connection.cc b/google/cloud/bigtable/admin/bigtable_table_admin_connection.cc index 8f6f803ee33f4..6413380c8ad91 100644 --- a/google/cloud/bigtable/admin/bigtable_table_admin_connection.cc +++ b/google/cloud/bigtable/admin/bigtable_table_admin_connection.cc @@ -382,6 +382,14 @@ BigtableTableAdminConnection::AsyncCheckConsistency( Status(StatusCode::kUnimplemented, "not implemented")); } +future> +BigtableTableAdminConnection::WaitForConsistency( + google::bigtable::admin::v2::CheckConsistencyRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + std::shared_ptr MakeBigtableTableAdminConnection( Options options) { internal::CheckExpectedOptions -#include +#include "google/bigtable/admin/v2/bigtable_table_admin.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -359,6 +359,11 @@ class BigtableTableAdminConnection { StatusOr> AsyncCheckConsistency( google::bigtable::admin::v2::CheckConsistencyRequest const& request); + + virtual future< + StatusOr> + WaitForConsistency( + google::bigtable::admin::v2::CheckConsistencyRequest const& request); }; /** diff --git a/google/cloud/bigtable/admin/bigtable_table_admin_connection_idempotency_policy.h b/google/cloud/bigtable/admin/bigtable_table_admin_connection_idempotency_policy.h index 1d2a533a55490..0879c7f71922a 100644 --- a/google/cloud/bigtable/admin/bigtable_table_admin_connection_idempotency_policy.h +++ b/google/cloud/bigtable/admin/bigtable_table_admin_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/bigtable/admin/v2/bigtable_table_admin.grpc.pb.h" #include namespace google { diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_auth_decorator.cc b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_auth_decorator.cc index 52e165e995cf4..54d693e652a0f 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_auth_decorator.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/bigtable/admin/v2/bigtable_instance_admin.proto #include "google/cloud/bigtable/admin/internal/bigtable_instance_admin_auth_decorator.h" -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_admin_internal { @@ -543,3 +546,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_auth_decorator.h b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_auth_decorator.h index cf79e70e27ffe..bf2aa40d202c4 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_auth_decorator.h +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 bigtable_admin_internal { @@ -277,4 +280,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_INTERNAL_BIGTABLE_INSTANCE_ADMIN_AUTH_DECORATOR_H diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_connection_impl.h b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_connection_impl.h index 0d8f66954e7e4..7e9cd4a9687c1 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_connection_impl.h +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_logging_decorator.cc b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_logging_decorator.cc index 27d02161e5404..af8e84da50bc0 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_logging_decorator.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/bigtable/admin/internal/bigtable_instance_admin_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_admin_internal { @@ -646,3 +649,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_logging_decorator.h b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_logging_decorator.h index 08e9be4a2c2a6..f0ecb065cddc2 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_logging_decorator.h +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 bigtable_admin_internal { @@ -277,4 +280,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_INTERNAL_BIGTABLE_INSTANCE_ADMIN_LOGGING_DECORATOR_H diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_metadata_decorator.cc b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_metadata_decorator.cc index 91f7ce424ff58..4002681b1473c 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_metadata_decorator.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/bigtable/admin/internal/bigtable_instance_admin_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/bigtable/admin/v2/bigtable_instance_admin.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_admin_internal { @@ -491,3 +495,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_metadata_decorator.h b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_metadata_decorator.h index c3d3bd29ecef1..706869de43cb4 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_metadata_decorator.h +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 bigtable_admin_internal { @@ -283,4 +286,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_INTERNAL_BIGTABLE_INSTANCE_ADMIN_METADATA_DECORATOR_H diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_option_defaults.cc b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_option_defaults.cc index eebc439197670..bc4a18c9331f8 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_option_defaults.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_option_defaults.cc @@ -43,7 +43,7 @@ Options BigtableInstanceAdminDefaultOptions(Options options) { if (!options.has()) { options.set( bigtable_admin::BigtableInstanceAdminLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub.cc b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub.cc index 81e7674434ed0..ffe780500ac10 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.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 bigtable_admin_internal { @@ -630,3 +633,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub.h b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub.h index 1cb2eee76c896..2ea8ab2292fc6 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub.h +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.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 bigtable_admin_internal { @@ -513,4 +516,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_INTERNAL_BIGTABLE_INSTANCE_ADMIN_STUB_H diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub_factory.cc b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub_factory.cc index 3a1f4da4d0717..a3b69e8aaa349 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub_factory.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_admin_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub_factory.h b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub_factory.h index a9ec14b48bab7..c0044e333264c 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub_factory.h +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_admin_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_INTERNAL_BIGTABLE_INSTANCE_ADMIN_STUB_FACTORY_H diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_connection.cc b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_connection.cc index 522d0d8405e6a..c60d90ae21f10 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_connection.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigtable_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BigtableInstanceAdminTracingConnection::BigtableInstanceAdminTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -531,17 +529,13 @@ Status BigtableInstanceAdminTracingConnection::DeleteMaterializedView( return internal::EndSpan(*span, child_->DeleteMaterializedView(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBigtableInstanceAdminTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_connection.h b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_connection.h index ebdcd8ad91d94..6f0ab1e7b7b14 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_connection.h +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigtable_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BigtableInstanceAdminTracingConnection : public bigtable_admin::BigtableInstanceAdminConnection { public: @@ -239,8 +237,6 @@ class BigtableInstanceAdminTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_stub.cc b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_stub.cc index bff207bbefcec..057f022a94298 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_stub.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BigtableInstanceAdminTracingStub::BigtableInstanceAdminTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -586,18 +587,14 @@ future BigtableInstanceAdminTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBigtableInstanceAdminTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_stub.h b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_stub.h index 254f1cd215815..19dd1039773c2 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_stub.h +++ b/google/cloud/bigtable/admin/internal/bigtable_instance_admin_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BigtableInstanceAdminTracingStub : public BigtableInstanceAdminStub { public: ~BigtableInstanceAdminTracingStub() override = default; @@ -273,8 +274,6 @@ class BigtableInstanceAdminTracingStub : public BigtableInstanceAdminStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -289,4 +288,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_INTERNAL_BIGTABLE_INSTANCE_ADMIN_TRACING_STUB_H diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_auth_decorator.cc b/google/cloud/bigtable/admin/internal/bigtable_table_admin_auth_decorator.cc index ed820ab706916..8d6b9b14e63ee 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_auth_decorator.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/bigtable/admin/v2/bigtable_table_admin.proto #include "google/cloud/bigtable/admin/internal/bigtable_table_admin_auth_decorator.h" -#include +#include "google/bigtable/admin/v2/bigtable_table_admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_admin_internal { @@ -529,3 +532,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_auth_decorator.h b/google/cloud/bigtable/admin/internal/bigtable_table_admin_auth_decorator.h index 5c1ebaf82b795..6d9bd7bc18291 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_auth_decorator.h +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/bigtable/admin/internal/bigtable_table_admin_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 bigtable_admin_internal { @@ -264,4 +267,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_INTERNAL_BIGTABLE_TABLE_ADMIN_AUTH_DECORATOR_H diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_connection_impl.h b/google/cloud/bigtable/admin/internal/bigtable_table_admin_connection_impl.h index 27812af525d89..ecdddaa38bd66 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_connection_impl.h +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -234,6 +234,10 @@ class BigtableTableAdminConnectionImpl google::bigtable::admin::v2::CheckConsistencyRequest const& request) override; + future> + WaitForConsistency(google::bigtable::admin::v2::CheckConsistencyRequest const& + request) override; + private: std::unique_ptr background_; std::shared_ptr stub_; diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_connection_impl_bespoke.cc b/google/cloud/bigtable/admin/internal/bigtable_table_admin_connection_impl_bespoke.cc new file mode 100644 index 0000000000000..138d4aab62045 --- /dev/null +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_connection_impl_bespoke.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. + +#include "google/cloud/bigtable/admin/internal/bigtable_table_admin_connection_impl.h" +#include "google/cloud/common_options.h" +#include "google/cloud/internal/async_retry_loop.h" +#include +#include + +namespace google { +namespace cloud { +namespace bigtable_admin_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< + bigtable_admin::BigtableTableAdminConnectionIdempotencyPolicyOption>() + ->clone(); +} + +} // namespace + +future> +BigtableTableAdminConnectionImpl::WaitForConsistency( + google::bigtable::admin::v2::CheckConsistencyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CheckConsistency(request_copy); + auto retry = retry_policy(*current); + auto backoff = backoff_policy(*current); + auto attempt_predicate = + [](StatusOr const& + r) { return r.ok() && r->consistent(); }; + return google::cloud::internal::AsyncRetryLoop( + std::move(retry), std::move(backoff), idempotent, background_->cq(), + [stub = stub_]( + CompletionQueue& cq, std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::admin::v2::CheckConsistencyRequest const& request) { + return stub->AsyncCheckConsistency(cq, std::move(context), + std::move(options), request); + }, + std::move(current), std::move(request_copy), __func__, + std::move(attempt_predicate)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_admin_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_logging_decorator.cc b/google/cloud/bigtable/admin/internal/bigtable_table_admin_logging_decorator.cc index 52e1715f91fd7..e4709542226eb 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_logging_decorator.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/bigtable/admin/internal/bigtable_table_admin_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/bigtable/admin/v2/bigtable_table_admin.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_admin_internal { @@ -624,3 +627,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_logging_decorator.h b/google/cloud/bigtable/admin/internal/bigtable_table_admin_logging_decorator.h index d47f13dd7e4c6..dc8491263a12a 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_logging_decorator.h +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/bigtable/admin/internal/bigtable_table_admin_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 bigtable_admin_internal { @@ -264,4 +267,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_INTERNAL_BIGTABLE_TABLE_ADMIN_LOGGING_DECORATOR_H diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_metadata_decorator.cc b/google/cloud/bigtable/admin/internal/bigtable_table_admin_metadata_decorator.cc index da9d69c6725c0..e16646beb64b7 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_metadata_decorator.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/bigtable/admin/internal/bigtable_table_admin_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/bigtable/admin/v2/bigtable_table_admin.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_admin_internal { @@ -481,3 +485,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_metadata_decorator.h b/google/cloud/bigtable/admin/internal/bigtable_table_admin_metadata_decorator.h index b0ba622681699..179352ef41e70 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_metadata_decorator.h +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/bigtable/admin/internal/bigtable_table_admin_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 bigtable_admin_internal { @@ -270,4 +273,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_INTERNAL_BIGTABLE_TABLE_ADMIN_METADATA_DECORATOR_H diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_option_defaults.cc b/google/cloud/bigtable/admin/internal/bigtable_table_admin_option_defaults.cc index 527c3301efcfb..9920b08555053 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_option_defaults.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_option_defaults.cc @@ -43,7 +43,7 @@ Options BigtableTableAdminDefaultOptions(Options options) { if (!options.has()) { options.set( bigtable_admin::BigtableTableAdminLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub.cc b/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub.cc index 5ee3d92b16d67..9a29abbde06f2 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/bigtable/admin/internal/bigtable_table_admin_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/bigtable/admin/v2/bigtable_table_admin.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 bigtable_admin_internal { @@ -615,3 +618,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub.h b/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub.h index 728a5d8015d8a..b9f0ecda260e6 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub.h +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/bigtable/admin/v2/bigtable_table_admin.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 bigtable_admin_internal { @@ -497,4 +500,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_INTERNAL_BIGTABLE_TABLE_ADMIN_STUB_H diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub_factory.cc b/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub_factory.cc index 68f1aa81b202b..65cc7cd957579 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub_factory.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/bigtable/admin/v2/bigtable_table_admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_admin_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub_factory.h b/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub_factory.h index 241ed59432cb7..9310e1197e8eb 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub_factory.h +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_admin_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_INTERNAL_BIGTABLE_TABLE_ADMIN_STUB_FACTORY_H diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_connection.cc b/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_connection.cc index 71f4e692e544a..bc23ff38a77c9 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_connection.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace bigtable_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BigtableTableAdminTracingConnection::BigtableTableAdminTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -501,17 +499,13 @@ BigtableTableAdminTracingConnection::AsyncCheckConsistency( child_->AsyncCheckConsistency(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBigtableTableAdminTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_connection.h b/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_connection.h index e1eb0c009e39d..2003fb21682aa 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_connection.h +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace bigtable_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BigtableTableAdminTracingConnection : public bigtable_admin::BigtableTableAdminConnection { public: @@ -226,8 +224,6 @@ class BigtableTableAdminTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_stub.cc b/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_stub.cc index f61e11495baa6..bf7738bbde04b 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_stub.cc +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BigtableTableAdminTracingStub::BigtableTableAdminTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -561,18 +562,14 @@ future BigtableTableAdminTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBigtableTableAdminTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_stub.h b/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_stub.h index a2b19c0170d9d..e73bed236a934 100644 --- a/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_stub.h +++ b/google/cloud/bigtable/admin/internal/bigtable_table_admin_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BigtableTableAdminTracingStub : public BigtableTableAdminStub { public: ~BigtableTableAdminTracingStub() override = default; @@ -260,8 +261,6 @@ class BigtableTableAdminTracingStub : public BigtableTableAdminStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -276,4 +275,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_INTERNAL_BIGTABLE_TABLE_ADMIN_TRACING_STUB_H diff --git a/google/cloud/bigtable/admin_client.cc b/google/cloud/bigtable/admin_client.cc deleted file mode 100644 index cdc151945d6d7..0000000000000 --- a/google/cloud/bigtable/admin_client.cc +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/admin_client.h" -#include "google/cloud/bigtable/internal/defaults.h" - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -std::shared_ptr MakeAdminClient(std::string project, - Options options) { - auto params = bigtable_internal::AdminClientParams( - internal::DefaultTableAdminOptions(std::move(options))); - return std::shared_ptr( - new AdminClient(std::move(project), std::move(params))); -} - -std::shared_ptr CreateDefaultAdminClient(std::string project, - ClientOptions options) { - return MakeAdminClient(std::move(project), - internal::MakeOptions(std::move(options))); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/admin_client.h b/google/cloud/bigtable/admin_client.h deleted file mode 100644 index 31ebc18855d7b..0000000000000 --- a/google/cloud/bigtable/admin_client.h +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_ADMIN_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_CLIENT_H - -#include "google/cloud/bigtable/admin/bigtable_table_admin_connection.h" -#include "google/cloud/bigtable/client_options.h" -#include "google/cloud/bigtable/internal/admin_client_params.h" -#include "google/cloud/bigtable/version.h" -#include "google/cloud/options.h" -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * Creates a `bigtable_admin::BigtableTableAdminConnection` and a - * `CompletionQueue` for `bigtable::TableAdmin` to use. - * - * This class is used to initiate a connection to the Cloud Bigtable Table - * Admin service. It is maintained only for backwards compatibility. - * - * @note Please prefer using `bigtable_admin::BigtableTableAdminConnection` to - * configure `bigtable_admin::BigtableTableAdminClient`, instead of using - * this class to configure `bigtable::TableAdmin`. - */ -class AdminClient final { - public: - /// The project id that this AdminClient works on. - std::string const& project() { return project_; }; - - private: - friend class TableAdmin; - friend std::shared_ptr MakeAdminClient(std::string, Options); - - AdminClient(std::string project, bigtable_internal::AdminClientParams params) - : project_(std::move(project)), - cq_(params.options.get()), - background_threads_(std::move(params.background_threads)), - connection_(bigtable_admin::MakeBigtableTableAdminConnection( - std::move(params.options))) {} - - std::string project_; - CompletionQueue cq_; - std::shared_ptr background_threads_; - std::shared_ptr connection_; -}; - -/// Create a new table admin client configured via @p options. -std::shared_ptr MakeAdminClient(std::string project, - Options options = {}); - -/** - * Create a new table admin client configured via @p options. - * - * @deprecated use the `MakeAdminClient` method which accepts - * `google::cloud::Options` instead. - */ -GOOGLE_CLOUD_CPP_DEPRECATED("use `MakeAdminClient` instead") -std::shared_ptr CreateDefaultAdminClient(std::string project, - ClientOptions options); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ADMIN_CLIENT_H diff --git a/google/cloud/bigtable/admin_client_test.cc b/google/cloud/bigtable/admin_client_test.cc deleted file mode 100644 index f9f0ccc617eb5..0000000000000 --- a/google/cloud/bigtable/admin_client_test.cc +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/admin_client.h" -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -#include "google/cloud/internal/disable_deprecation_warnings.inc" - -TEST(AdminClientTest, CreateDefaultClient) { - auto admin_client = CreateDefaultAdminClient("test-project", {}); - ASSERT_TRUE(admin_client); - EXPECT_EQ("test-project", admin_client->project()); -} - -#include "google/cloud/internal/diagnostics_pop.inc" - -TEST(AdminClientTest, MakeClient) { - auto admin_client = MakeAdminClient("test-project"); - ASSERT_TRUE(admin_client); - EXPECT_EQ("test-project", admin_client->project()); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/app_profile_config.h b/google/cloud/bigtable/app_profile_config.h index 0a7bb9031e34b..db256f2f12c46 100644 --- a/google/cloud/bigtable/app_profile_config.h +++ b/google/cloud/bigtable/app_profile_config.h @@ -16,7 +16,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_APP_PROFILE_CONFIG_H #include "google/cloud/bigtable/version.h" -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.pb.h" #include namespace google { diff --git a/google/cloud/bigtable/async_read_stream_test.cc b/google/cloud/bigtable/async_read_stream_test.cc index bcb9b4af40cd1..b6a9505315942 100644 --- a/google/cloud/bigtable/async_read_stream_test.cc +++ b/google/cloud/bigtable/async_read_stream_test.cc @@ -15,7 +15,7 @@ #include "google/cloud/bigtable/completion_queue.h" #include "google/cloud/bigtable/version.h" #include "google/cloud/testing_util/status_matchers.h" -#include +#include "google/bigtable/v2/bigtable.grpc.pb.h" #include #include diff --git a/google/cloud/bigtable/async_row_reader.h b/google/cloud/bigtable/async_row_reader.h deleted file mode 100644 index e899ad3c29439..0000000000000 --- a/google/cloud/bigtable/async_row_reader.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_ASYNC_ROW_READER_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ASYNC_ROW_READER_H - -#include "google/cloud/bigtable/version.h" -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * @deprecated Please use `bigtable::RowReader::NO_ROWS_LIMIT` instead. - */ -template -class AsyncRowReader { - public: - /// Special value to be used as rows_limit indicating no limit. - GOOGLE_CLOUD_CPP_DEPRECATED( - "`AsyncRowReader<>::NO_ROWS_LIMIT` is deprecated. It is scheduled for " - "deletion on 2023-05-01. Please use `RowReader::NO_ROWS_LIMIT` instead.") - // NOLINTNEXTLINE(readability-identifier-naming) - static std::int64_t constexpr NO_ROWS_LIMIT = 0; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ASYNC_ROW_READER_H diff --git a/google/cloud/bigtable/benchmarks/BUILD.bazel b/google/cloud/bigtable/benchmarks/BUILD.bazel index d38595bf6c969..2215e0a2f1f88 100644 --- a/google/cloud/bigtable/benchmarks/BUILD.bazel +++ b/google/cloud/bigtable/benchmarks/BUILD.bazel @@ -60,6 +60,6 @@ cc_library( "//:bigtable", "//:common", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in bigtable_benchmarks_unit_tests] diff --git a/google/cloud/bigtable/benchmarks/benchmark.cc b/google/cloud/bigtable/benchmarks/benchmark.cc index 87e9baac9b657..d758bb6b09714 100644 --- a/google/cloud/bigtable/benchmarks/benchmark.cc +++ b/google/cloud/bigtable/benchmarks/benchmark.cc @@ -16,6 +16,7 @@ #include "google/cloud/bigtable/admin/bigtable_table_admin_client.h" #include "google/cloud/bigtable/benchmarks/random_mutation.h" #include "google/cloud/bigtable/resource_names.h" +#include "google/cloud/grpc_options.h" #include "google/cloud/internal/background_threads_impl.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/make_status.h" diff --git a/google/cloud/bigtable/benchmarks/benchmark_options.cc b/google/cloud/bigtable/benchmarks/benchmark_options.cc index 7bb55f1ec367c..47da15650bf25 100644 --- a/google/cloud/bigtable/benchmarks/benchmark_options.cc +++ b/google/cloud/bigtable/benchmarks/benchmark_options.cc @@ -15,12 +15,12 @@ #include "google/cloud/bigtable/benchmarks/benchmark_options.h" #include "google/cloud/bigtable/testing/random_names.h" #include "google/cloud/bigtable/version.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/build_info.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/random.h" #include "google/cloud/status_or.h" #include "google/cloud/testing_util/command_line_parsing.h" +#include "absl/strings/str_join.h" #include "absl/time/clock.h" #include "absl/time/time.h" #include diff --git a/google/cloud/bigtable/benchmarks/embedded_server.cc b/google/cloud/bigtable/benchmarks/embedded_server.cc index 758089c837876..8f415677488d1 100644 --- a/google/cloud/bigtable/benchmarks/embedded_server.cc +++ b/google/cloud/bigtable/benchmarks/embedded_server.cc @@ -15,8 +15,8 @@ #include "google/cloud/bigtable/benchmarks/embedded_server.h" #include "google/cloud/bigtable/benchmarks/constants.h" #include "google/cloud/bigtable/benchmarks/random_mutation.h" -#include -#include +#include "google/bigtable/admin/v2/bigtable_table_admin.grpc.pb.h" +#include "google/bigtable/v2/bigtable.grpc.pb.h" #include #include #include diff --git a/google/cloud/bigtable/benchmarks/embedded_server_test.cc b/google/cloud/bigtable/benchmarks/embedded_server_test.cc index 9f11bacf0f3a7..79c956d7f5a7f 100644 --- a/google/cloud/bigtable/benchmarks/embedded_server_test.cc +++ b/google/cloud/bigtable/benchmarks/embedded_server_test.cc @@ -16,6 +16,7 @@ #include "google/cloud/bigtable/admin/bigtable_table_admin_client.h" #include "google/cloud/bigtable/resource_names.h" #include "google/cloud/bigtable/table.h" +#include "google/cloud/grpc_options.h" #include "google/cloud/testing_util/status_matchers.h" #include #include diff --git a/google/cloud/bigtable/benchmarks/mutation_batcher_throughput_benchmark.cc b/google/cloud/bigtable/benchmarks/mutation_batcher_throughput_benchmark.cc index d02b8f1c90ddb..e5c01218a6ab0 100644 --- a/google/cloud/bigtable/benchmarks/mutation_batcher_throughput_benchmark.cc +++ b/google/cloud/bigtable/benchmarks/mutation_batcher_throughput_benchmark.cc @@ -18,6 +18,7 @@ #include "google/cloud/bigtable/resource_names.h" #include "google/cloud/bigtable/table.h" #include "google/cloud/bigtable/testing/random_names.h" +#include "google/cloud/grpc_options.h" #include "google/cloud/internal/background_threads_impl.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/make_status.h" diff --git a/google/cloud/bigtable/benchmarks/mutation_batcher_throughput_options.cc b/google/cloud/bigtable/benchmarks/mutation_batcher_throughput_options.cc index 5734b3afba3e4..79bfd4ad9546c 100644 --- a/google/cloud/bigtable/benchmarks/mutation_batcher_throughput_options.cc +++ b/google/cloud/bigtable/benchmarks/mutation_batcher_throughput_options.cc @@ -13,10 +13,10 @@ // limitations under the License. #include "google/cloud/bigtable/benchmarks/mutation_batcher_throughput_options.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/status_or.h" #include "google/cloud/testing_util/command_line_parsing.h" +#include "absl/strings/str_join.h" #include namespace google { diff --git a/google/cloud/bigtable/bigtable_client_testing.bzl b/google/cloud/bigtable/bigtable_client_testing.bzl index 865460e3aead3..2146dbf028f1a 100644 --- a/google/cloud/bigtable/bigtable_client_testing.bzl +++ b/google/cloud/bigtable/bigtable_client_testing.bzl @@ -19,10 +19,8 @@ bigtable_client_testing_hdrs = [ "testing/cleanup_stale_resources.h", "testing/embedded_server_test_fixture.h", - "testing/inprocess_data_client.h", "testing/mock_async_failing_rpc_factory.h", "testing/mock_bigtable_stub.h", - "testing/mock_data_client.h", "testing/mock_mutate_rows_limiter.h", "testing/mock_mutate_rows_reader.h", "testing/mock_partial_result_set_reader.h", @@ -32,14 +30,11 @@ bigtable_client_testing_hdrs = [ "testing/mock_sample_row_keys_reader.h", "testing/random_names.h", "testing/table_integration_test.h", - "testing/table_test_fixture.h", ] bigtable_client_testing_srcs = [ "testing/cleanup_stale_resources.cc", "testing/embedded_server_test_fixture.cc", - "testing/inprocess_data_client.cc", "testing/random_names.cc", "testing/table_integration_test.cc", - "testing/table_test_fixture.cc", ] diff --git a/google/cloud/bigtable/bigtable_client_unit_tests.bzl b/google/cloud/bigtable/bigtable_client_unit_tests.bzl index c5dda043da0a4..4c9b3784556f4 100644 --- a/google/cloud/bigtable/bigtable_client_unit_tests.bzl +++ b/google/cloud/bigtable/bigtable_client_unit_tests.bzl @@ -17,18 +17,15 @@ """Automatically generated unit tests list - DO NOT EDIT.""" bigtable_client_unit_tests = [ - "admin_client_test.cc", "app_profile_config_test.cc", "async_read_stream_test.cc", "bigtable_version_test.cc", "bound_query_test.cc", "bytes_test.cc", "cell_test.cc", - "client_options_test.cc", "client_test.cc", "cluster_config_test.cc", "column_family_test.cc", - "data_client_test.cc", "data_connection_test.cc", "expr_test.cc", "filters_test.cc", @@ -36,8 +33,6 @@ bigtable_client_unit_tests = [ "iam_binding_test.cc", "iam_policy_test.cc", "idempotent_mutation_policy_test.cc", - "instance_admin_client_test.cc", - "instance_admin_test.cc", "instance_config_test.cc", "instance_resource_test.cc", "instance_update_config_test.cc", @@ -47,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", @@ -56,13 +53,8 @@ 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/legacy_async_bulk_apply_test.cc", - "internal/legacy_async_row_reader_test.cc", - "internal/legacy_async_row_sampler_test.cc", - "internal/legacy_bulk_mutator_test.cc", - "internal/legacy_row_reader_test.cc", - "internal/logging_data_client_test.cc", "internal/logging_result_set_reader_test.cc", "internal/metrics_test.cc", "internal/mutate_rows_limiter_test.cc", @@ -74,10 +66,9 @@ 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", - "legacy_table_test.cc", - "metadata_update_policy_test.cc", "mocks/mock_row_reader_test.cc", "mutation_batcher_test.cc", "mutations_test.cc", @@ -93,20 +84,11 @@ bigtable_client_unit_tests = [ "rpc_backoff_policy_test.cc", "rpc_retry_policy_test.cc", "sql_statement_test.cc", - "table_admin_test.cc", - "table_apply_test.cc", - "table_bulk_apply_test.cc", - "table_check_and_mutate_row_test.cc", "table_config_test.cc", - "table_readmodifywriterow_test.cc", - "table_readrow_test.cc", - "table_readrows_test.cc", "table_resource_test.cc", - "table_sample_row_keys_test.cc", "table_test.cc", "testing/cleanup_stale_resources_test.cc", "testing/random_names_test.cc", "timestamp_test.cc", "value_test.cc", - "wait_for_consistency_test.cc", ] diff --git a/google/cloud/bigtable/bound_query.h b/google/cloud/bigtable/bound_query.h index 22d805d419f25..e3ad5978e3b5f 100644 --- a/google/cloud/bigtable/bound_query.h +++ b/google/cloud/bigtable/bound_query.h @@ -19,7 +19,7 @@ #include "google/cloud/bigtable/value.h" #include "google/cloud/bigtable/version.h" #include "google/cloud/completion_queue.h" -#include +#include "google/bigtable/v2/bigtable.pb.h" #include #include 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 966435e0bb52e..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:admin_backup_integration_test" - "//google/cloud/bigtable/tests: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/client_options.cc b/google/cloud/bigtable/client_options.cc deleted file mode 100644 index 7bee3a22e4675..0000000000000 --- a/google/cloud/bigtable/client_options.cc +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and - -#include "google/cloud/bigtable/client_options.h" -#include "google/cloud/bigtable/internal/client_options_defaults.h" -#include "google/cloud/bigtable/internal/defaults.h" -#include "google/cloud/internal/background_threads_impl.h" -#include "google/cloud/internal/getenv.h" -#include "google/cloud/internal/user_agent_prefix.h" -#include "absl/strings/str_split.h" -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { -Options&& MakeOptions(ClientOptions&& o) { - if (!o.connection_pool_name_.empty()) { - o.opts_ - .lookup()["cbt-c++/connection-pool-name"] = - std::move(o.connection_pool_name_); - } - return std::move(o.opts_); -} -} // namespace internal - -ClientOptions::ClientOptions() { opts_ = internal::DefaultOptions(); } - -ClientOptions::ClientOptions(Options opts) { - ::google::cloud::internal::CheckExpectedOptions< - ClientOptionList, CommonOptionList, GrpcOptionList>(opts, __func__); - opts_ = internal::DefaultOptions(std::move(opts)); -} - -ClientOptions::ClientOptions(std::shared_ptr creds) { - opts_ = internal::DefaultOptions( - Options{}.set(std::move(creds))); - - // This constructor ignores the emulator environment variables, which might be - // set by `internal::DefaultOptions()`. - opts_.set("bigtable.googleapis.com"); - opts_.set("bigtableadmin.googleapis.com"); - opts_.set("bigtableadmin.googleapis.com"); -} - -// NOLINTNEXTLINE(readability-identifier-naming) -ClientOptions& ClientOptions::set_connection_pool_size(std::size_t size) { - opts_.set(size == 0 - ? internal::DefaultConnectionPoolSize() - : static_cast(size)); - return *this; -} - -std::string ClientOptions::UserAgentPrefix() { - return google::cloud::internal::UserAgentPrefix(); -} - -ClientOptions& ClientOptions::DisableBackgroundThreads( - google::cloud::CompletionQueue const& cq) { - opts_.set(cq); - return *this; -} - -BackgroundThreadsFactory ClientOptions::background_threads_factory() const { - return google::cloud::internal::MakeBackgroundThreadsFactory(opts_); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/client_options.h b/google/cloud/bigtable/client_options.h deleted file mode 100644 index 834ea1a162e53..0000000000000 --- a/google/cloud/bigtable/client_options.h +++ /dev/null @@ -1,734 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_CLIENT_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_CLIENT_OPTIONS_H - -#include "google/cloud/bigtable/options.h" -#include "google/cloud/bigtable/version.h" -#include "google/cloud/background_threads.h" -#include "google/cloud/common_options.h" -#include "google/cloud/completion_queue.h" -#include "google/cloud/grpc_options.h" -#include "google/cloud/internal/algorithm.h" -#include "google/cloud/internal/make_status.h" -#include "google/cloud/options.h" -#include "google/cloud/status.h" -#include "google/cloud/tracing_options.h" -#include "absl/strings/str_split.h" -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -class ClientOptions; -namespace internal { -Options&& MakeOptions(ClientOptions&& o); -} // namespace internal - -/** - * Configuration options for the Bigtable Client. - * - * Applications typically configure the client class using: - * @code - * auto client = - * bigtable::Client(bigtable::ClientOptions().SetCredentials(...)); - * @endcode - * - * @deprecated Please use `google::cloud::Options` instead. - */ -class ClientOptions { - public: - /** - * Initialize the client options. - * - * Configure the client to connect to the Cloud Bigtable service, using the - * default options. - * - * @par Environment Variables - * If the `BIGTABLE_EMULATOR_HOST` environment variable is set, the default - * configuration changes in important ways: - * - * - The credentials are initialized to `grpc::InsecureCredentials()`. - * - Any client created with these objects will connect to the endpoint - * (typically just a `host:port` string) set in the environment variable. - * - * This makes it easy to test applications using the Cloud Bigtable Emulator. - * - * @see The Google Cloud Platform introduction to - * [application default - * credentials](https://cloud.google.com/docs/authentication/production) - * @see `grpc::GoogleDefaultCredentials` in the [grpc - * documentation](https://grpc.io/grpc/cpp/namespacegrpc.html) - * @see The [documentation](https://cloud.google.com/bigtable/docs/emulator) - * for the Cloud Bigtable Emulator. - * - * @deprecated Please use `google::cloud::Options` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED("use `google::cloud::Options` instead") - ClientOptions(); - - /** - * Initialize the client options. - * - * Expected options are any of the types in the following option lists. - * - * - `google::cloud::CommonOptionList` - * - `google::cloud::GrpcOptionList` - * - `google::cloud::bigtable::ClientOptionList` - * - * @note Unrecognized options will be ignored. To debug issues with options - * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment and - * unexpected options will be logged. - * - * @param opts (optional) configuration options - * - * @deprecated Please use `google::cloud::Options` directly instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED("use `google::cloud::Options` directly instead") - explicit ClientOptions(Options opts); - - /** - * Connect to the production instance of Cloud Bigtable using @p creds. - * - * This constructor always connects to the production instance of Cloud - * Bigtable, and can be used when the application default credentials are - * not configured in the environment where the application is running. - * - * @param creds gRPC authentication credentials - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcCredentialOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with `google::cloud::GrpcCredentialOption` " - "instead") - explicit ClientOptions(std::shared_ptr creds); - - /** - * Return the current endpoint for data RPCs. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::EndpointOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with `google::cloud::EndpointOption` " - "instead") - std::string const& data_endpoint() const { - return opts_.get(); - } - - /** - * Set the current endpoint for data RPCs. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::EndpointOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with `google::cloud::EndpointOption` " - "instead") - ClientOptions& set_data_endpoint(std::string endpoint) { - opts_.set(std::move(endpoint)); - return *this; - } - - /** - * Return the current endpoint for admin RPCs. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::EndpointOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with `google::cloud::EndpointOption` " - "instead") - std::string const& admin_endpoint() const { - return opts_.get(); - } - - /** - * Set the current endpoint for admin RPCs. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::EndpointOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with `google::cloud::EndpointOption` " - "instead") - ClientOptions& set_admin_endpoint(std::string endpoint) { - opts_.set(endpoint); - // These two endpoints are generally equivalent, but they may differ in - // some tests. - opts_.set(std::move(endpoint)); - return *this; - } - - /** - * Set the name of the connection pool. - * - * gRPC typically opens a single connection for each destination. To improve - * performance, the Cloud Bigtable C++ client can open multiple connections - * to a given destination, but these connections are shared by all threads - * in the application. Sometimes the application may want even more - * segregation, for example, the application may want to use a different pool - * for high-priority requests vs. lower priority ones. Using different names - * creates segregated pools. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcChannelArgumentsOption` or - * `google::cloud::GrpcChannelArgumentsNativeOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcChannelArgumentsOption` or " - "`google::cloud::GrpcChannelArgumentsNativeOption` instead") - ClientOptions& set_connection_pool_name(std::string name) { - connection_pool_name_ = std::move(name); - return *this; - } - - /** - * Return the name of the connection pool. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcChannelArgumentsOption` or - * `google::cloud::GrpcChannelArgumentsNativeOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcChannelArgumentsOption` or " - "`google::cloud::GrpcChannelArgumentsNativeOption` instead") - std::string const& connection_pool_name() const { - return connection_pool_name_; - } - - /** - * Set the size of the connection pool. - * - * Specifying 0 for @p size will set the size of the connection pool to - * default. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcNumChannelsOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcNumChannelsOption` instead") - ClientOptions& set_connection_pool_size(std::size_t size); - - /** - * Return the size of the connection pool. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcNumChannelsOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcNumChannelsOption` instead") - std::size_t connection_pool_size() const { - return opts_.get(); - } - - /** - * Return the current credentials. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcCredentialOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcCredentialOption` instead") - std::shared_ptr credentials() const { - return opts_.get(); - } - - /** - * Set the current credentials. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcCredentialOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcCredentialOption` instead") - ClientOptions& SetCredentials( - std::shared_ptr credentials) { - opts_.set(std::move(credentials)); - return *this; - } - - /** - * Access all the channel arguments. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcChannelArgumentsOption` or - * `google::cloud::GrpcChannelArgumentsNativeOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcChannelArgumentsOption` or " - "`google::cloud::GrpcChannelArgumentsNativeOption` instead") - grpc::ChannelArguments channel_arguments() const { - return ::google::cloud::internal::MakeChannelArguments(opts_); - } - - /** - * Set all the channel arguments. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcChannelArgumentsNativeOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcChannelArgumentsNativeOption` instead") - ClientOptions& set_channel_arguments( - grpc::ChannelArguments const& channel_arguments) { - opts_.set(channel_arguments); - return *this; - } - - /** - * Set compression algorithm for channel. - * - * Please see the docs for grpc::ChannelArguments::SetCompressionAlgorithm() - * on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html - * for more details. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcChannelArgumentsNativeOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcChannelArgumentsNativeOption` instead") - void SetCompressionAlgorithm(grpc_compression_algorithm algorithm) { - opts_.lookup().SetCompressionAlgorithm( - algorithm); - } - - /** - * Set the `grpclb` fallback timeout with the timestamp @p fallback_timeout - * for the channel. - * - * For example: - * - * @code - * bigtable::ClientOptions::SetGrpclbFallbackTimeout( - * std::chrono::milliseconds(5000)) - * bigtable::ClientOptions::SetGrpclbFallbackTimeout( - * std::chrono::seconds(5)) - * @endcode - * - * @tparam Rep a placeholder to match the Rep tparam for @p fallback_timeout, - * 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 - * fallback_timeout, 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. - * - * @see - * [std::chrono::duration<>](http://en.cppreference.com/w/cpp/chrono/duration) - * for more details. - * - * Please see the docs for - * `grpc::ChannelArguments::SetGrpclbFallbackTimeout()` on - * https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html for more - * details. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcChannelArgumentsNativeOption` instead. - */ - template - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcChannelArgumentsNativeOption` instead") - google::cloud::Status SetGrpclbFallbackTimeout( - std::chrono::duration fallback_timeout) { - std::chrono::milliseconds ft_ms = - std::chrono::duration_cast(fallback_timeout); - - if (ft_ms.count() > std::numeric_limits::max()) { - return google::cloud::internal::OutOfRangeError( - "The supplied duration is larger than the " - "maximum value allowed by gRPC (INT_MAX)", - GCP_ERROR_INFO()); - } - auto fallback_timeout_ms = static_cast(ft_ms.count()); - opts_.lookup().SetGrpclbFallbackTimeout( - fallback_timeout_ms); - return google::cloud::Status(); - } - - /** - * Set the string to prepend to the user agent. - * - * Please see the docs for `grpc::ChannelArguments::SetUserAgentPrefix()` - * on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html - * for more details. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::UserAgentProductsOption` or - * `google::cloud::GrpcChannelArgumentsNativeOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::UserAgentProductsOption` " - "`google::cloud::GrpcChannelArgumentsNativeOption` instead") - void SetUserAgentPrefix(grpc::string const& user_agent_prefix) { - opts_.lookup().SetUserAgentPrefix( - user_agent_prefix); - } - - /** - * Set the buffer pool to be attached to the constructed channel. - * - * Please see the docs for `grpc::ChannelArguments::SetResourceQuota()` - * on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html - * for more details. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcChannelArgumentsNativeOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcChannelArgumentsNativeOption` instead") - void SetResourceQuota(grpc::ResourceQuota const& resource_quota) { - opts_.lookup().SetResourceQuota( - resource_quota); - } - - /** - * Set the max receive message size in bytes. -1 means unlimited. - * - * Please see the docs for - * `grpc::ChannelArguments::SetMaxReceiveMessageSize()` on - * https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html for more - * details. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcChannelArgumentsNativeOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcChannelArgumentsNativeOption` instead") - void SetMaxReceiveMessageSize(int size) { - opts_.lookup().SetMaxReceiveMessageSize( - size); - } - - /** - * Set the max send message size in bytes. -1 means unlimited. - * - * Please see the docs for grpc::ChannelArguments::SetMaxSendMessageSize() - * on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html - * for more details. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcChannelArgumentsNativeOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcChannelArgumentsNativeOption` instead") - void SetMaxSendMessageSize(int size) { - opts_.lookup().SetMaxSendMessageSize( - size); - } - - /** - * Set LB policy name. - * - * Please see the docs for - * grpc::ChannelArguments::SetLoadBalancingPolicyName() - * on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html - * for more details. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcChannelArgumentsNativeOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcChannelArgumentsNativeOption` instead") - void SetLoadBalancingPolicyName(grpc::string const& lb_policy_name) { - opts_.lookup().SetLoadBalancingPolicyName( - lb_policy_name); - } - - /** - * Set service config in JSON form. - * - * Please see the docs for grpc::ChannelArguments::SetServiceConfigJSON() - * on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html - * for more details. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcChannelArgumentsNativeOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcChannelArgumentsNativeOption` instead") - void SetServiceConfigJSON(grpc::string const& service_config_json) { - opts_.lookup().SetServiceConfigJSON( - service_config_json); - } - - /** - * Set target name override for SSL host name checking. - * - * Please see the docs for grpc::ChannelArguments::SetSslTargetNameOverride() - * on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html - * for more details. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcChannelArgumentsNativeOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcChannelArgumentsNativeOption` instead") - void SetSslTargetNameOverride(grpc::string const& name) { - opts_.lookup().SetSslTargetNameOverride( - name); - } - - /// Return the user agent prefix used by the library. - GOOGLE_CLOUD_CPP_DEPRECATED("Not intended for use in application code") - static std::string UserAgentPrefix(); - - /** - * Return whether tracing is enabled for the given @p component. - * - * The C++ clients can log interesting events to help library and application - * developers troubleshoot problems. This flag returns true if tracing should - * be enabled by clients configured with this option. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::LoggingComponentsOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::LoggingComponentsOption` instead") - bool tracing_enabled(std::string const& component) const { - return google::cloud::internal::Contains( - opts_.get(), component); - } - - /** - * Enable tracing for @p component in clients configured with this object. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::LoggingComponentsOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::LoggingComponentsOption` instead") - ClientOptions& enable_tracing(std::string const& component) { - opts_.lookup().insert(component); - return *this; - } - - /** - * Disable tracing for @p component in clients configured with this object. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::LoggingComponentsOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::LoggingComponentsOption` instead") - ClientOptions& disable_tracing(std::string const& component) { - opts_.lookup().erase(component); - return *this; - } - - /** - * Return the options for use when tracing RPCs. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcTracingOptionsOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcTracingOptionsOption` instead") - TracingOptions const& tracing_options() const { - return opts_.get(); - } - - /** - * Maximum connection refresh period, as set via `set_max_conn_refresh_period` - * - * @deprecated Please configure `google::cloud::Options` with - * `bigtable::MinConnectionRefreshOption` and - * `bigtable::MaxConnectionRefreshOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with `MinConnectionRefreshOption` and " - "`MaxConnectionRefreshOption` instead") - std::chrono::milliseconds max_conn_refresh_period() { - return opts_.get(); - } - - /** - * If set to a positive number, the client will refresh connections at random - * moments not more apart from each other than this duration. This is - * necessary to avoid all connections simultaneously expiring and causing - * latency spikes. - * - * If needed it changes max_conn_refresh_period() to preserve the invariant: - * - * @code - * assert(min_conn_refresh_period() <= max_conn_refresh_period()) - * @endcode - * - * @deprecated Please configure `google::cloud::Options` with - * `bigtable::MinConnectionRefreshOption` and - * `bigtable::MaxConnectionRefreshOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with `MinConnectionRefreshOption` and " - "`MaxConnectionRefreshOption` instead") - ClientOptions& set_max_conn_refresh_period(std::chrono::milliseconds period) { - opts_.set(period); - auto& min_conn_refresh_period = opts_.lookup(); - min_conn_refresh_period = (std::min)(min_conn_refresh_period, period); - return *this; - } - - /** - * Minimum connection refresh period, as set via `set_min_conn_refresh_period` - * - * @deprecated Please configure `google::cloud::Options` with - * `bigtable::MinConnectionRefreshOption` and - * `bigtable::MaxConnectionRefreshOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with `MinConnectionRefreshOption` and " - "`MaxConnectionRefreshOption` instead") - std::chrono::milliseconds min_conn_refresh_period() { - return opts_.get(); - } - - /** - * Configures the *minimum* connection refresh period. The library will wait - * at least this long before attempting any refresh operation. - * - * If needed it changes max_conn_refresh_period() to preserve the invariant: - * - * @code - * assert(min_conn_refresh_period() <= max_conn_refresh_period()) - * @endcode - * - * @deprecated Please configure `google::cloud::Options` with - * `bigtable::MinConnectionRefreshOption` and - * `bigtable::MaxConnectionRefreshOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with `MinConnectionRefreshOption` and " - "`MaxConnectionRefreshOption` instead") - ClientOptions& set_min_conn_refresh_period(std::chrono::milliseconds period) { - opts_.set(period); - auto& max_conn_refresh_period = opts_.lookup(); - max_conn_refresh_period = (std::max)(max_conn_refresh_period, period); - return *this; - } - - /** - * Set the number of background threads. - * - * @note This value is not used if `DisableBackgroundThreads()` is called. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcBackgroundThreadPoolSizeOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcBackgroundThreadPoolSizeOption` instead") - ClientOptions& set_background_thread_pool_size(std::size_t s) { - opts_.set(s); - return *this; - } - - /** - * Return the number of background threads. - * - * @note This value is not used if `DisableBackgroundThreads()` is called. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcBackgroundThreadPoolSizeOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcBackgroundThreadPoolSizeOption` instead") - std::size_t background_thread_pool_size() const { - return opts_.get(); - } - - /** - * Configure the connection to use @p cq for all background work. - * - * Connections need to perform background work on behalf of the application. - * Normally they just create a background thread and a `CompletionQueue` for - * this work, but the application may need more fine-grained control of their - * threads. In this case the application can provide the `CompletionQueue` and - * it assumes responsibility for creating one or more threads blocked on - * `CompletionQueue::Run()`. - * - * @deprecated Please configure `google::cloud::Options` with - * `google::cloud::GrpcCompletionQueueOption` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` with " - "`google::cloud::GrpcCompletionQueueOption` instead") - ClientOptions& DisableBackgroundThreads( - google::cloud::CompletionQueue const& cq); - - /** - * Backwards compatibility alias - * - * @deprecated Consider using `google::cloud::BackgroundThreadsFactory` - * directly - */ - using BackgroundThreadsFactory = ::google::cloud::BackgroundThreadsFactory; - - /// @deprecated Not intended for applications to use. There is no alternative - /// implemented or planned. - GOOGLE_CLOUD_CPP_DEPRECATED( - "Not intended for applications to use. There is no alternative " - "implemented or planned") - BackgroundThreadsFactory background_threads_factory() const; - - private: - friend struct ClientOptionsTestTraits; - friend Options&& internal::MakeOptions(ClientOptions&&); - - /// Return the current endpoint for instance admin RPCs. - std::string const& instance_admin_endpoint() const { - return opts_.get(); - } - - std::string connection_pool_name_; - Options opts_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_CLIENT_OPTIONS_H diff --git a/google/cloud/bigtable/client_options_test.cc b/google/cloud/bigtable/client_options_test.cc deleted file mode 100644 index 80594490cc89d..0000000000000 --- a/google/cloud/bigtable/client_options_test.cc +++ /dev/null @@ -1,593 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/client_options.h" -#include "google/cloud/bigtable/internal/client_options_defaults.h" -#include "google/cloud/bigtable/options.h" -#include "google/cloud/grpc_options.h" -#include "google/cloud/internal/background_threads_impl.h" -#include "google/cloud/status.h" -#include "google/cloud/testing_util/scoped_environment.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "absl/types/optional.h" -#include -#include -// ClientOptions is deprecated. We need to suppress the compiler warnings. -#include "google/cloud/internal/disable_deprecation_warnings.inc" - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -struct ClientOptionsTestTraits { - static std::string const& InstanceAdminEndpoint( - ClientOptions const& options) { - return options.instance_admin_endpoint(); - } -}; -namespace { -using ::google::cloud::internal::GetIntChannelArgument; -using ::google::cloud::internal::GetStringChannelArgument; -using ::google::cloud::testing_util::ScopedEnvironment; -using ::testing::HasSubstr; - -TEST(ClientOptionsTest, ClientOptionsDefaultSettings) { - ClientOptions client_options; - EXPECT_EQ("bigtable.googleapis.com", client_options.data_endpoint()); - EXPECT_EQ("bigtableadmin.googleapis.com", client_options.admin_endpoint()); - EXPECT_EQ(typeid(grpc::GoogleDefaultCredentials()), - typeid(client_options.credentials())); - - EXPECT_EQ("", client_options.connection_pool_name()); - // The number of connections should be >= 1, we "know" what the actual value - // is, but we do not want a change-detection-test. - EXPECT_LE(1UL, client_options.connection_pool_size()); - - auto args = client_options.channel_arguments(); - auto max_send = GetIntChannelArgument(args, GRPC_ARG_MAX_SEND_MESSAGE_LENGTH); - ASSERT_TRUE(max_send.has_value()); - EXPECT_EQ(BIGTABLE_CLIENT_DEFAULT_MAX_MESSAGE_LENGTH, max_send.value()); - auto max_recv = - GetIntChannelArgument(args, GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH); - ASSERT_TRUE(max_recv.has_value()); - EXPECT_EQ(BIGTABLE_CLIENT_DEFAULT_MAX_MESSAGE_LENGTH, max_recv.value()); - - // See `kDefaultKeepaliveTime` - auto time = GetIntChannelArgument(args, GRPC_ARG_KEEPALIVE_TIME_MS); - ASSERT_TRUE(time.has_value()); - EXPECT_EQ(30000, time.value()); - - // See `kDefaultKeepaliveTimeout` - auto timeout = GetIntChannelArgument(args, GRPC_ARG_KEEPALIVE_TIMEOUT_MS); - ASSERT_TRUE(timeout.has_value()); - EXPECT_EQ(10000, timeout.value()); -} - -TEST(ClientOptionsTest, OptionsConstructor) { - using ms = std::chrono::milliseconds; - using min = std::chrono::minutes; - auto channel_args = grpc::ChannelArguments(); - channel_args.SetString("test-key-1", "value-1"); - auto credentials = grpc::InsecureChannelCredentials(); - auto options = ClientOptions( - Options{} - .set("testdata.googleapis.com") - .set("testadmin.googleapis.com") - .set("testinstanceadmin.googleapis.com") - .set(credentials) - .set( - TracingOptions{}.SetOptions("single_line_mode=F")) - .set({"test-component"}) - .set(3) - .set(ms(100)) - .set(min(4)) - .set(5) - .set(channel_args) - .set({{"test-key-2", "value-2"}}) - .set({"test-prefix"})); - - EXPECT_EQ("testdata.googleapis.com", options.data_endpoint()); - EXPECT_EQ("testadmin.googleapis.com", options.admin_endpoint()); - EXPECT_EQ("testinstanceadmin.googleapis.com", - ClientOptionsTestTraits::InstanceAdminEndpoint(options)); - EXPECT_EQ(credentials, options.credentials()); - EXPECT_FALSE(options.tracing_options().single_line_mode()); - EXPECT_TRUE(options.tracing_enabled("test-component")); - EXPECT_EQ(3U, options.connection_pool_size()); - EXPECT_EQ(ms(100), options.min_conn_refresh_period()); - EXPECT_EQ(min(4), options.max_conn_refresh_period()); - EXPECT_EQ(5U, options.background_thread_pool_size()); - auto args = options.channel_arguments(); - auto key1 = GetStringChannelArgument(args, "test-key-1"); - ASSERT_TRUE(key1.has_value()); - EXPECT_EQ("value-1", key1.value()); - auto key2 = GetStringChannelArgument(args, "test-key-2"); - ASSERT_TRUE(key2.has_value()); - EXPECT_EQ("value-2", key2.value()); - auto s = GetStringChannelArgument(args, GRPC_ARG_PRIMARY_USER_AGENT_STRING); - ASSERT_TRUE(s.has_value()); - EXPECT_THAT(*s, HasSubstr("test-prefix")); -} - -TEST(ClientOptionsTest, CustomBackgroundThreadsOption) { - struct Fake : BackgroundThreads { - CompletionQueue cq() const override { return {}; } - }; - bool invoked = false; - auto factory = [&invoked] { - invoked = true; - return std::make_unique(); - }; - - auto options = - ClientOptions(Options{}.set(factory)); - - EXPECT_FALSE(invoked); - options.background_threads_factory()(); - EXPECT_TRUE(invoked); -} - -class ClientOptionsDefaultEndpointTest : public ::testing::Test { - public: - ClientOptionsDefaultEndpointTest() - : bigtable_emulator_host_("BIGTABLE_EMULATOR_HOST", - "testendpoint.googleapis.com"), - bigtable_instance_admin_emulator_host_( - "BIGTABLE_INSTANCE_ADMIN_EMULATOR_HOST", {}) {} - - protected: - static std::string GetInstanceAdminEndpoint(ClientOptions const& options) { - return ClientOptionsTestTraits::InstanceAdminEndpoint(options); - } - - ScopedEnvironment bigtable_emulator_host_; - ScopedEnvironment bigtable_instance_admin_emulator_host_; -}; - -TEST_F(ClientOptionsDefaultEndpointTest, Default) { - ClientOptions client_options; - EXPECT_EQ("testendpoint.googleapis.com", client_options.data_endpoint()); - EXPECT_EQ("testendpoint.googleapis.com", client_options.admin_endpoint()); - EXPECT_EQ("testendpoint.googleapis.com", - GetInstanceAdminEndpoint(client_options)); - - // Just check `MakeOptions()` for endpoints here. - auto opts = internal::MakeOptions(std::move(client_options)); - EXPECT_EQ("testendpoint.googleapis.com", opts.get()); - EXPECT_EQ("testendpoint.googleapis.com", opts.get()); - EXPECT_EQ("testendpoint.googleapis.com", - opts.get()); -} - -TEST_F(ClientOptionsDefaultEndpointTest, WithCredentials) { - auto credentials = grpc::GoogleDefaultCredentials(); - ClientOptions tested(credentials); - EXPECT_EQ("bigtable.googleapis.com", tested.data_endpoint()); - EXPECT_EQ("bigtableadmin.googleapis.com", tested.admin_endpoint()); - EXPECT_EQ(credentials.get(), tested.credentials().get()); -} - -TEST_F(ClientOptionsDefaultEndpointTest, DefaultNoEmulator) { - ScopedEnvironment bigtable_emulator_host("BIGTABLE_EMULATOR_HOST", {}); - - auto credentials = grpc::GoogleDefaultCredentials(); - ClientOptions tested(credentials); - EXPECT_EQ("bigtable.googleapis.com", tested.data_endpoint()); - EXPECT_EQ("bigtableadmin.googleapis.com", tested.admin_endpoint()); - EXPECT_EQ("bigtableadmin.googleapis.com", GetInstanceAdminEndpoint(tested)); -} - -TEST_F(ClientOptionsDefaultEndpointTest, SeparateEmulators) { - ScopedEnvironment bigtable_emulator_host("BIGTABLE_EMULATOR_HOST", - "emulator-host:8000"); - ScopedEnvironment bigtable_instance_admin_emulator_host( - "BIGTABLE_INSTANCE_ADMIN_EMULATOR_HOST", "instance-emulator-host:9000"); - ClientOptions actual; - EXPECT_EQ("emulator-host:8000", actual.data_endpoint()); - EXPECT_EQ("emulator-host:8000", actual.admin_endpoint()); - EXPECT_EQ("instance-emulator-host:9000", GetInstanceAdminEndpoint(actual)); -} - -TEST_F(ClientOptionsDefaultEndpointTest, DataNoEnv) { - ScopedEnvironment bigtable_emulator_host("BIGTABLE_EMULATOR_HOST", {}); - EXPECT_EQ("bigtable.googleapis.com", ClientOptions{}.data_endpoint()); -} - -TEST_F(ClientOptionsDefaultEndpointTest, AdminNoEnv) { - ScopedEnvironment bigtable_emulator_host("BIGTABLE_EMULATOR_HOST", {}); - EXPECT_EQ("bigtableadmin.googleapis.com", ClientOptions{}.admin_endpoint()); -} - -TEST_F(ClientOptionsDefaultEndpointTest, AdminEmulatorOverrides) { - ScopedEnvironment bigtable_emulator_host("BIGTABLE_EMULATOR_HOST", - "127.0.0.1:1234"); - EXPECT_EQ("127.0.0.1:1234", ClientOptions{}.admin_endpoint()); -} - -TEST_F(ClientOptionsDefaultEndpointTest, AdminInstanceAdminNoEffect) { - ScopedEnvironment bigtable_emulator_host("BIGTABLE_EMULATOR_HOST", {}); - ScopedEnvironment bigtable_instance_admin_emulator_host( - "BIGTABLE_INSTANCE_ADMIN_EMULATOR_HOST", "127.0.0.1:1234"); - EXPECT_EQ("bigtableadmin.googleapis.com", ClientOptions{}.admin_endpoint()); -} - -TEST_F(ClientOptionsDefaultEndpointTest, InstanceAdminNoEnv) { - ScopedEnvironment bigtable_emulator_host("BIGTABLE_EMULATOR_HOST", {}); - EXPECT_EQ("bigtableadmin.googleapis.com", - GetInstanceAdminEndpoint(ClientOptions())); -} - -TEST_F(ClientOptionsDefaultEndpointTest, InstanceAdminEmulatorOverrides) { - ScopedEnvironment bigtable_emulator_host("BIGTABLE_EMULATOR_HOST", - "127.0.0.1:1234"); - EXPECT_EQ("127.0.0.1:1234", GetInstanceAdminEndpoint(ClientOptions())); -} - -TEST_F(ClientOptionsDefaultEndpointTest, InstanceAdminInstanceAdminOverrides) { - ScopedEnvironment bigtable_emulator_host("BIGTABLE_EMULATOR_HOST", "unused"); - ScopedEnvironment bigtable_instance_admin_emulator_host( - "BIGTABLE_INSTANCE_ADMIN_EMULATOR_HOST", "127.0.0.1:1234"); - EXPECT_EQ("127.0.0.1:1234", GetInstanceAdminEndpoint(ClientOptions())); -} - -TEST(ClientOptionsTest, EditDataEndpoint) { - auto client_options = ClientOptions{}.set_data_endpoint("customendpoint.com"); - EXPECT_EQ("customendpoint.com", client_options.data_endpoint()); -} - -TEST(ClientOptionsTest, EditAdminEndpoint) { - auto client_options = - ClientOptions{}.set_admin_endpoint("customendpoint.com"); - EXPECT_EQ("customendpoint.com", client_options.admin_endpoint()); - EXPECT_EQ("customendpoint.com", - ClientOptionsTestTraits::InstanceAdminEndpoint(client_options)); -} - -TEST(ClientOptionsTest, EditCredentials) { - auto client_options = - ClientOptions{}.SetCredentials(grpc::InsecureChannelCredentials()); - EXPECT_EQ(typeid(grpc::InsecureChannelCredentials()), - typeid(client_options.credentials())); - - auto opts = internal::MakeOptions(std::move(client_options)); - EXPECT_EQ(typeid(grpc::InsecureChannelCredentials()), - typeid(opts.get())); -} - -TEST(ClientOptionsTest, EditConnectionPoolName) { - ClientOptions client_options; - auto& returned = client_options.set_connection_pool_name("foo"); - EXPECT_EQ(&returned, &client_options); - EXPECT_EQ("foo", returned.connection_pool_name()); - - auto opts = internal::MakeOptions(std::move(client_options)); - auto args = google::cloud::internal::MakeChannelArguments(opts); - auto name = GetStringChannelArgument(args, "cbt-c++/connection-pool-name"); - ASSERT_TRUE(name.has_value()); - EXPECT_EQ("foo", name); -} - -TEST(ClientOptionsTest, EditConnectionPoolSize) { - ClientOptions client_options; - auto& returned = client_options.set_connection_pool_size(42); - EXPECT_EQ(&returned, &client_options); - EXPECT_EQ(42UL, returned.connection_pool_size()); - - auto opts = internal::MakeOptions(std::move(client_options)); - EXPECT_EQ(42, opts.get()); -} - -TEST(ClientOptionsTest, ResetToDefaultConnectionPoolSize) { - ClientOptions client_options; - auto& returned = client_options.set_connection_pool_size(0); - EXPECT_EQ(&returned, &client_options); - // The number of connections should be >= 1, we "know" what the actual value - // is, but we do not want a change-detection-test. - EXPECT_LE(1UL, returned.connection_pool_size()); -} - -TEST(ClientOptionsTest, ConnectionPoolSizeDoesNotExceedMax) { - ClientOptions client_options; - auto& returned = client_options.set_connection_pool_size( - BIGTABLE_CLIENT_DEFAULT_CONNECTION_POOL_SIZE_MAX + 1); - EXPECT_EQ(&returned, &client_options); - // The number of connections should be >= 1, we "know" what the actual value - // is, but we do not want a change-detection-test. - EXPECT_LE(BIGTABLE_CLIENT_DEFAULT_CONNECTION_POOL_SIZE_MAX, - returned.connection_pool_size()); -} - -TEST(ClientOptionsTest, SetGrpclbFallbackTimeoutMS) { - // Test milliseconds are set properly to channel_arguments - ClientOptions client_options; - ASSERT_STATUS_OK( - client_options.SetGrpclbFallbackTimeout(std::chrono::milliseconds(5))); - - auto args = client_options.channel_arguments(); - auto actual = - GetIntChannelArgument(args, GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS); - ASSERT_TRUE(actual.has_value()); - EXPECT_EQ(*actual, 5); - - auto opts = internal::MakeOptions(std::move(client_options)); - args = google::cloud::internal::MakeChannelArguments(opts); - actual = GetIntChannelArgument(args, GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS); - ASSERT_TRUE(actual.has_value()); - EXPECT_EQ(*actual, 5); -} - -TEST(ClientOptionsTest, SetGrpclbFallbackTimeoutSec) { - // Test seconds are converted into milliseconds - ClientOptions client_options; - ASSERT_STATUS_OK( - client_options.SetGrpclbFallbackTimeout(std::chrono::seconds(5))); - - auto args = client_options.channel_arguments(); - auto actual = - GetIntChannelArgument(args, GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS); - ASSERT_TRUE(actual.has_value()); - EXPECT_EQ(*actual, 5000); - - auto opts = internal::MakeOptions(std::move(client_options)); - args = google::cloud::internal::MakeChannelArguments(opts); - actual = GetIntChannelArgument(args, GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS); - ASSERT_TRUE(actual.has_value()); - EXPECT_EQ(*actual, 5000); -} - -TEST(ClientOptionsTest, SetGrpclbFallbackTimeoutException) { - // Test if fallback_timeout exceeds int range and StatusCode - // matches kOutOfRange - ClientOptions client_options; - EXPECT_EQ( - client_options.SetGrpclbFallbackTimeout(std::chrono::hours(999)).code(), - google::cloud::StatusCode::kOutOfRange); -} - -TEST(ClientOptionsTest, SetCompressionAlgorithm) { - ClientOptions client_options; - client_options.SetCompressionAlgorithm(GRPC_COMPRESS_NONE); - - auto args = client_options.channel_arguments(); - auto actual = - GetIntChannelArgument(args, GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM); - ASSERT_TRUE(actual.has_value()); - EXPECT_EQ(*actual, GRPC_COMPRESS_NONE); - - auto opts = internal::MakeOptions(std::move(client_options)); - args = google::cloud::internal::MakeChannelArguments(opts); - actual = - GetIntChannelArgument(args, GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM); - ASSERT_TRUE(actual.has_value()); - EXPECT_EQ(*actual, GRPC_COMPRESS_NONE); -} - -TEST(ClientOptionsTest, SetLoadBalancingPolicyName) { - ClientOptions client_options; - client_options.SetLoadBalancingPolicyName("test-policy-name"); - - auto args = client_options.channel_arguments(); - auto actual = GetStringChannelArgument(args, GRPC_ARG_LB_POLICY_NAME); - ASSERT_TRUE(actual.has_value()); - EXPECT_EQ(*actual, "test-policy-name"); - - auto opts = internal::MakeOptions(std::move(client_options)); - args = google::cloud::internal::MakeChannelArguments(opts); - actual = GetStringChannelArgument(args, GRPC_ARG_LB_POLICY_NAME); - ASSERT_TRUE(actual.has_value()); - EXPECT_EQ(*actual, "test-policy-name"); -} - -TEST(ClientOptionsTest, SetServiceConfigJSON) { - ClientOptions client_options; - client_options.SetServiceConfigJSON("test-config"); - - auto args = client_options.channel_arguments(); - auto actual = GetStringChannelArgument(args, GRPC_ARG_SERVICE_CONFIG); - ASSERT_TRUE(actual.has_value()); - EXPECT_EQ(*actual, "test-config"); - - auto opts = internal::MakeOptions(std::move(client_options)); - args = google::cloud::internal::MakeChannelArguments(opts); - actual = GetStringChannelArgument(args, GRPC_ARG_SERVICE_CONFIG); - ASSERT_TRUE(actual.has_value()); - EXPECT_EQ(*actual, "test-config"); -} - -TEST(ClientOptionsTest, SetUserAgentPrefix) { - ClientOptions client_options; - client_options.SetUserAgentPrefix("test_prefix"); - - auto args = client_options.channel_arguments(); - auto actual = - GetStringChannelArgument(args, GRPC_ARG_PRIMARY_USER_AGENT_STRING); - ASSERT_TRUE(actual.has_value()); - EXPECT_THAT(*actual, HasSubstr("test_prefix")); - - auto opts = internal::MakeOptions(std::move(client_options)); - args = google::cloud::internal::MakeChannelArguments(opts); - actual = GetStringChannelArgument(args, GRPC_ARG_PRIMARY_USER_AGENT_STRING); - ASSERT_TRUE(actual.has_value()); - EXPECT_THAT(*actual, HasSubstr("test_prefix")); -} - -TEST(ClientOptionsTest, SetSslTargetNameOverride) { - ClientOptions client_options; - client_options.SetSslTargetNameOverride("test-name"); - - auto args = client_options.channel_arguments(); - auto actual = - GetStringChannelArgument(args, GRPC_SSL_TARGET_NAME_OVERRIDE_ARG); - ASSERT_TRUE(actual.has_value()); - EXPECT_EQ(*actual, "test-name"); - - auto opts = internal::MakeOptions(std::move(client_options)); - args = google::cloud::internal::MakeChannelArguments(opts); - actual = GetStringChannelArgument(args, GRPC_SSL_TARGET_NAME_OVERRIDE_ARG); - ASSERT_TRUE(actual.has_value()); - EXPECT_EQ(*actual, "test-name"); -} - -TEST(ClientOptionsTest, UserAgentPrefix) { - std::string const actual = ClientOptions::UserAgentPrefix(); - EXPECT_THAT(actual, HasSubstr("gl-cpp/")); -} - -TEST(ClientOptionsTest, RefreshPeriod) { - auto options = ClientOptions(); - EXPECT_LE(options.min_conn_refresh_period(), - options.max_conn_refresh_period()); - using ms = std::chrono::milliseconds; - - options.set_min_conn_refresh_period(ms(1000)); - EXPECT_EQ(1000, options.min_conn_refresh_period().count()); - - options.set_max_conn_refresh_period(ms(2000)); - EXPECT_EQ(2000, options.max_conn_refresh_period().count()); - - options.set_min_conn_refresh_period(ms(3000)); - EXPECT_EQ(3000, options.min_conn_refresh_period().count()); - EXPECT_EQ(3000, options.max_conn_refresh_period().count()); - - options.set_max_conn_refresh_period(ms(1500)); - EXPECT_EQ(1500, options.min_conn_refresh_period().count()); - EXPECT_EQ(1500, options.max_conn_refresh_period().count()); - - options.set_max_conn_refresh_period(ms(5000)); - EXPECT_EQ(1500, options.min_conn_refresh_period().count()); - EXPECT_EQ(5000, options.max_conn_refresh_period().count()); - - options.set_min_conn_refresh_period(ms(1000)); - EXPECT_EQ(1000, options.min_conn_refresh_period().count()); - EXPECT_EQ(5000, options.max_conn_refresh_period().count()); - - auto opts = internal::MakeOptions(std::move(options)); - EXPECT_EQ(1000, opts.get().count()); - EXPECT_EQ(5000, opts.get().count()); -} - -TEST(ClientOptionsTest, TracingComponents) { - ScopedEnvironment tracing("GOOGLE_CLOUD_CPP_ENABLE_TRACING", "foo,bar"); - auto options = ClientOptions(); - - // Check defaults - EXPECT_TRUE(options.tracing_enabled("foo")); - EXPECT_TRUE(options.tracing_enabled("bar")); - EXPECT_FALSE(options.tracing_enabled("baz")); - - // Edit components - options.enable_tracing("baz"); - EXPECT_TRUE(options.tracing_enabled("baz")); - options.disable_tracing("foo"); - EXPECT_FALSE(options.tracing_enabled("foo")); - - // Check `MakeOptions()` - auto opts = internal::MakeOptions(std::move(options)); - EXPECT_THAT(opts.get(), - testing::UnorderedElementsAre("bar", "baz")); -} - -TEST(ClientOptionsTest, DefaultTracingOptionsNoEnv) { - ScopedEnvironment tracing("GOOGLE_CLOUD_CPP_TRACING_OPTIONS", absl::nullopt); - - ClientOptions client_options; - auto tracing_options = client_options.tracing_options(); - EXPECT_EQ(TracingOptions(), tracing_options); - - auto opts = internal::MakeOptions(std::move(client_options)); - tracing_options = opts.get(); - EXPECT_EQ(TracingOptions(), tracing_options); -} - -TEST(ClientOptionsTest, DefaultTracingOptionsEnv) { - ScopedEnvironment tracing("GOOGLE_CLOUD_CPP_TRACING_OPTIONS", - "single_line_mode=F"); - - ClientOptions client_options; - auto tracing_options = client_options.tracing_options(); - EXPECT_FALSE(tracing_options.single_line_mode()); - - auto opts = internal::MakeOptions(std::move(client_options)); - tracing_options = opts.get(); - EXPECT_FALSE(tracing_options.single_line_mode()); -} - -TEST(ClientOptionsTest, BackgroundThreadPoolSize) { - using ThreadPool = - ::google::cloud::internal::AutomaticallyCreatedBackgroundThreads; - - auto options = ClientOptions(); - // Check that the default value is 0 or 1. Both values result in the - // BackgroundThreadsFactory creating a ThreadPool with a single thread in it. - EXPECT_GE(1U, options.background_thread_pool_size()); - - auto background = options.background_threads_factory()(); - auto* tp = dynamic_cast(background.get()); - ASSERT_NE(nullptr, tp); - EXPECT_EQ(1U, tp->pool_size()); - - options.set_background_thread_pool_size(5U); - EXPECT_EQ(5U, options.background_thread_pool_size()); - - background = options.background_threads_factory()(); - tp = dynamic_cast(background.get()); - ASSERT_NE(nullptr, tp); - EXPECT_EQ(5U, tp->pool_size()); - - auto opts = internal::MakeOptions(std::move(options)); - EXPECT_EQ(5U, opts.get()); - EXPECT_FALSE(opts.has()); -} - -TEST(ClientOptionsTest, CustomBackgroundThreads) { - auto check = [](CompletionQueue& cq, - std::unique_ptr background) { - using ms = std::chrono::milliseconds; - - // Schedule some work that cannot execute because there is no thread - // draining the completion queue. - promise p; - auto background_thread_id = p.get_future(); - background->cq().RunAsync( - [&p](CompletionQueue&) { p.set_value(std::this_thread::get_id()); }); - EXPECT_NE(std::future_status::ready, background_thread_id.wait_for(ms(10))); - - // Verify we can create our own threads to drain the completion queue. - std::thread t([&cq] { cq.Run(); }); - EXPECT_EQ(t.get_id(), background_thread_id.get()); - - cq.Shutdown(); - t.join(); - }; - - CompletionQueue cq; - auto client_options = ClientOptions().DisableBackgroundThreads(cq); - auto background = client_options.background_threads_factory()(); - - check(cq, std::move(background)); - - cq = CompletionQueue(); - client_options = ClientOptions().DisableBackgroundThreads(cq); - auto opts = internal::MakeOptions(std::move(client_options)); - background = - google::cloud::internal::MakeBackgroundThreadsFactory(std::move(opts))(); - - check(cq, std::move(background)); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/cluster_config.h b/google/cloud/bigtable/cluster_config.h index 7902116895f4b..465f96725e161 100644 --- a/google/cloud/bigtable/cluster_config.h +++ b/google/cloud/bigtable/cluster_config.h @@ -16,7 +16,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_CLUSTER_CONFIG_H #include "google/cloud/bigtable/version.h" -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.pb.h" #include namespace google { diff --git a/google/cloud/bigtable/cluster_list_responses.h b/google/cloud/bigtable/cluster_list_responses.h index fad0e53e6c655..ad51ea6627955 100644 --- a/google/cloud/bigtable/cluster_list_responses.h +++ b/google/cloud/bigtable/cluster_list_responses.h @@ -16,7 +16,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_CLUSTER_LIST_RESPONSES_H #include "google/cloud/bigtable/version.h" -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.pb.h" #include #include diff --git a/google/cloud/bigtable/column_family.h b/google/cloud/bigtable/column_family.h index 76cb5e3a8c1cc..28c898df25139 100644 --- a/google/cloud/bigtable/column_family.h +++ b/google/cloud/bigtable/column_family.h @@ -17,8 +17,8 @@ #include "google/cloud/bigtable/version.h" #include "absl/meta/type_traits.h" -#include -#include +#include "google/bigtable/admin/v2/bigtable_table_admin.pb.h" +#include "google/bigtable/admin/v2/table.pb.h" #include #include #include diff --git a/google/cloud/bigtable/config.cmake.in b/google/cloud/bigtable/config.cmake.in index 08da71ca1ef59..132b672e71812 100644 --- a/google/cloud/bigtable/config.cmake.in +++ b/google/cloud/bigtable/config.cmake.in @@ -19,6 +19,5 @@ find_dependency(google_cloud_cpp_common) find_dependency(google_cloud_cpp_grpc_utils) find_dependency(google_cloud_cpp_opentelemetry) find_dependency(absl) -find_dependency(Crc32c) include("${CMAKE_CURRENT_LIST_DIR}/google_cloud_cpp_bigtable-targets.cmake") diff --git a/google/cloud/bigtable/data_client.cc b/google/cloud/bigtable/data_client.cc deleted file mode 100644 index 9932d24c541e7..0000000000000 --- a/google/cloud/bigtable/data_client.cc +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/data_client.h" -#include "google/cloud/bigtable/internal/common_client.h" -#include "google/cloud/bigtable/internal/logging_data_client.h" -#include "google/cloud/internal/log_wrapper.h" -#include "google/cloud/log.h" - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -namespace btproto = ::google::bigtable::v2; - -std::unique_ptr< - ::grpc::ClientAsyncReaderInterface> -// NOLINTNEXTLINE(performance-unnecessary-value-param) -DataClient::PrepareAsyncSampleRowKeys(grpc::ClientContext*, - btproto::SampleRowKeysRequest const&, - grpc::CompletionQueue*) { - return nullptr; -} - -namespace { - -// TODO(#8800) - remove after `DataClient` deprecation is complete -#include "google/cloud/internal/disable_deprecation_warnings.inc" - -/** - * Implement a simple DataClient. - * - * This implementation does not support multiple threads, or refresh - * authorization tokens. In other words, it is extremely bare bones. - */ -class DefaultDataClient : public DataClient { - public: - DefaultDataClient(std::string project, std::string instance, - Options options = {}) - : project_(std::move(project)), - instance_(std::move(instance)), - authority_(options.get()), - user_project_( - options.has() - ? absl::make_optional(options.get()) - : absl::nullopt), - impl_(std::move(options)) {} - - std::string const& project_id() const override { return project_; }; - std::string const& instance_id() const override { return instance_; }; - - std::shared_ptr Channel() override { return impl_.Channel(); } - void reset() override { impl_.reset(); } - - grpc::Status MutateRow(grpc::ClientContext* context, - btproto::MutateRowRequest const& request, - btproto::MutateRowResponse* response) override { - ApplyOptions(context); - return impl_.Stub()->MutateRow(context, request, response); - } - - std::unique_ptr< - grpc::ClientAsyncResponseReaderInterface> - AsyncMutateRow(grpc::ClientContext* context, - btproto::MutateRowRequest const& request, - grpc::CompletionQueue* cq) override { - ApplyOptions(context); - return impl_.Stub()->AsyncMutateRow(context, request, cq); - } - - grpc::Status CheckAndMutateRow( - grpc::ClientContext* context, - btproto::CheckAndMutateRowRequest const& request, - btproto::CheckAndMutateRowResponse* response) override { - ApplyOptions(context); - return impl_.Stub()->CheckAndMutateRow(context, request, response); - } - - std::unique_ptr> - AsyncCheckAndMutateRow(grpc::ClientContext* context, - btproto::CheckAndMutateRowRequest const& request, - grpc::CompletionQueue* cq) override { - ApplyOptions(context); - return impl_.Stub()->AsyncCheckAndMutateRow(context, request, cq); - } - - grpc::Status ReadModifyWriteRow( - grpc::ClientContext* context, - btproto::ReadModifyWriteRowRequest const& request, - btproto::ReadModifyWriteRowResponse* response) override { - ApplyOptions(context); - return impl_.Stub()->ReadModifyWriteRow(context, request, response); - } - - std::unique_ptr> - AsyncReadModifyWriteRow(grpc::ClientContext* context, - btproto::ReadModifyWriteRowRequest const& request, - grpc::CompletionQueue* cq) override { - ApplyOptions(context); - return impl_.Stub()->AsyncReadModifyWriteRow(context, request, cq); - } - - std::unique_ptr> - ReadRows(grpc::ClientContext* context, - btproto::ReadRowsRequest const& request) override { - ApplyOptions(context); - return impl_.Stub()->ReadRows(context, request); - } - - std::unique_ptr> - AsyncReadRows(grpc::ClientContext* context, - btproto::ReadRowsRequest const& request, - grpc::CompletionQueue* cq, void* tag) override { - ApplyOptions(context); - return impl_.Stub()->AsyncReadRows(context, request, cq, tag); - } - - std::unique_ptr<::grpc::ClientAsyncReaderInterface> - PrepareAsyncReadRows(grpc::ClientContext* context, - btproto::ReadRowsRequest const& request, - grpc::CompletionQueue* cq) override { - ApplyOptions(context); - return impl_.Stub()->PrepareAsyncReadRows(context, request, cq); - } - - std::unique_ptr> - SampleRowKeys(grpc::ClientContext* context, - btproto::SampleRowKeysRequest const& request) override { - ApplyOptions(context); - return impl_.Stub()->SampleRowKeys(context, request); - } - - std::unique_ptr< - ::grpc::ClientAsyncReaderInterface> - AsyncSampleRowKeys(grpc::ClientContext* context, - btproto::SampleRowKeysRequest const& request, - grpc::CompletionQueue* cq, void* tag) override { - ApplyOptions(context); - return impl_.Stub()->AsyncSampleRowKeys(context, request, cq, tag); - } - - std::unique_ptr< - ::grpc::ClientAsyncReaderInterface> - PrepareAsyncSampleRowKeys(grpc::ClientContext* context, - btproto::SampleRowKeysRequest const& request, - grpc::CompletionQueue* cq) override { - ApplyOptions(context); - return impl_.Stub()->PrepareAsyncSampleRowKeys(context, request, cq); - } - - std::unique_ptr> - MutateRows(grpc::ClientContext* context, - btproto::MutateRowsRequest const& request) override { - ApplyOptions(context); - return impl_.Stub()->MutateRows(context, request); - } - - std::unique_ptr< - ::grpc::ClientAsyncReaderInterface> - AsyncMutateRows(grpc::ClientContext* context, - btproto::MutateRowsRequest const& request, - grpc::CompletionQueue* cq, void* tag) override { - ApplyOptions(context); - return impl_.Stub()->AsyncMutateRows(context, request, cq, tag); - } - - std::unique_ptr< - ::grpc::ClientAsyncReaderInterface> - PrepareAsyncMutateRows(grpc::ClientContext* context, - btproto::MutateRowsRequest const& request, - grpc::CompletionQueue* cq) override { - ApplyOptions(context); - return impl_.Stub()->PrepareAsyncMutateRows(context, request, cq); - } - - private: - google::cloud::BackgroundThreadsFactory BackgroundThreadsFactory() override { - return impl_.BackgroundThreadsFactory(); - } - - void ApplyOptions(grpc::ClientContext* context) { - if (!authority_.empty()) context->set_authority(authority_); - if (user_project_) { - context->AddMetadata("x-goog-user-project", *user_project_); - } - } - - std::string project_; - std::string instance_; - std::string authority_; - absl::optional user_project_; - internal::CommonClient impl_; -}; - -// TODO(#8800) - remove after `DataClient` deprecation is complete -#include "google/cloud/internal/diagnostics_pop.inc" - -} // namespace - -std::shared_ptr MakeDataClient(std::string project_id, - std::string instance_id, - Options options) { - options = internal::DefaultDataOptions(std::move(options)); - bool tracing_enabled = google::cloud::internal::Contains( - options.get(), "rpc"); - auto tracing_options = options.get(); - - std::shared_ptr client = std::make_shared( - std::move(project_id), std::move(instance_id), std::move(options)); - if (tracing_enabled) { - GCP_LOG(INFO) << "Enabled logging for gRPC calls"; - client = std::make_shared( - std::move(client), std::move(tracing_options)); - } - return client; -} - -std::shared_ptr CreateDefaultDataClient(std::string project_id, - std::string instance_id, - ClientOptions options) { - return MakeDataClient(std::move(project_id), std::move(instance_id), - internal::MakeOptions(std::move(options))); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/data_client.h b/google/cloud/bigtable/data_client.h deleted file mode 100644 index 99b8ce658bf97..0000000000000 --- a/google/cloud/bigtable/data_client.h +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_DATA_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_DATA_CLIENT_H - -#include "google/cloud/bigtable/client_options.h" -#include "google/cloud/bigtable/completion_queue.h" -#include "google/cloud/bigtable/row.h" -#include "google/cloud/bigtable/version.h" -#include -#include - -namespace google { -namespace cloud { -// Forward declare some classes so we can be friends. -namespace bigtable_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -class BulkMutator; -class LegacyAsyncRowReader; -class LegacyRowReader; -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_internal -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -class Table; -namespace internal { -class AsyncRetryBulkApply; -class LegacyAsyncRowSampler; -class LoggingDataClient; -} // namespace internal - -/** - * Connects to Cloud Bigtable's data manipulation APIs. - * - * This class is used by the Cloud Bigtable wrappers to access Cloud Bigtable. - * Multiple `bigtable::Table` objects may share a connection via a single - * `DataClient` object. The `DataClient` object is configured at construction - * time, this configuration includes the credentials, access endpoints, default - * timeouts, and other gRPC configuration options. This is an interface class - * because it is also used as a dependency injection point in some of the tests. - * - * @par Cost - * Applications should avoid unnecessarily creating new objects of type - * `DataClient`. Creating a new object of this type typically requires - * connecting to the Cloud Bigtable servers, and performing the authentication - * workflows with Google Cloud Platform. These operations can take many - * milliseconds, therefore applications should try to reuse the same - * `DataClient` instances when possible. - * - * @deprecated #google::cloud::bigtable::DataConnection is the preferred way to - * communicate with the Bigtable Data API. To migrate existing code, see - * @ref migrating-from-dataclient "Migrating from DataClient". - */ -class DataClient { - public: - virtual ~DataClient() = default; - - virtual std::string const& project_id() const = 0; - virtual std::string const& instance_id() const = 0; - - /** - * Return a new channel to handle admin operations. - * - * Intended to access rarely used services in the same endpoints as the - * Bigtable admin interfaces, for example, the google.longrunning.Operations. - * - * @deprecated This member function is scheduled for deletion and `DataClient` - * will be marked as `final`. Do not extend this class. Application - * developers who need to configure the gRPC Channel can pass any of the - * following options into `MakeDataClient(...)`: - * * `google::cloud::GrpcChannelArgumentsOption` - * * `google::cloud::GrpcChannelArgumentsNativeOption` - */ - GOOGLE_CLOUD_CPP_BIGTABLE_DATA_CLIENT_DEPRECATED("Channel()") - virtual std::shared_ptr Channel() = 0; - - /** - * Reset and create new Channels. - * - * @deprecated This member function is scheduled for deletion and `DataClient` - * will be marked as `final`. Do not extend this class. The client library - * will handle all interactions with the gRPC channels. - */ - GOOGLE_CLOUD_CPP_BIGTABLE_DATA_CLIENT_DEPRECATED("reset()") - virtual void reset() = 0; - - /** - * The thread factory this client was created with. - * - * @deprecated This member function is scheduled for deletion and `DataClient` - * will be marked as `final`. Do not extend this class. Application - * developers who need to configure the background threads can pass any - * of the following options into `MakeDataClient(...)`: - * * `google::cloud::GrpcBackgroundThreadPoolSizeOption` - * * `google::cloud::GrpcCompletionQueueOption` - * * `google::cloud::GrpcBackgroundThreadFactoryOption` - */ - virtual google::cloud::BackgroundThreadsFactory - BackgroundThreadsFactory() = 0; - - // The member functions of this class are not intended for general use by - // application developers (they are simply a dependency injection point). Make - // them protected, so the mock classes can override them, and then make the - // classes that do use them friends. - protected: - friend class Table; - friend class internal::AsyncRetryBulkApply; - friend class internal::LegacyAsyncRowSampler; - friend class bigtable_internal::BulkMutator; - friend class bigtable_internal::LegacyRowReader; - friend class bigtable_internal::LegacyAsyncRowReader; - friend class internal::LoggingDataClient; - - ///@{ - /// @name the `google.bigtable.v2.Bigtable` wrappers. - virtual grpc::Status MutateRow( - grpc::ClientContext* context, - google::bigtable::v2::MutateRowRequest const& request, - google::bigtable::v2::MutateRowResponse* response) = 0; - virtual std::unique_ptr> - AsyncMutateRow(grpc::ClientContext* context, - google::bigtable::v2::MutateRowRequest const& request, - grpc::CompletionQueue* cq) = 0; - virtual grpc::Status CheckAndMutateRow( - grpc::ClientContext* context, - google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::bigtable::v2::CheckAndMutateRowResponse* response) = 0; - virtual std::unique_ptr> - AsyncCheckAndMutateRow( - grpc::ClientContext* context, - google::bigtable::v2::CheckAndMutateRowRequest const& request, - grpc::CompletionQueue* cq) = 0; - virtual grpc::Status ReadModifyWriteRow( - grpc::ClientContext* context, - google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::bigtable::v2::ReadModifyWriteRowResponse* response) = 0; - virtual std::unique_ptr> - AsyncReadModifyWriteRow( - grpc::ClientContext* context, - google::bigtable::v2::ReadModifyWriteRowRequest const& request, - grpc::CompletionQueue* cq) = 0; - virtual std::unique_ptr< - grpc::ClientReaderInterface> - ReadRows(grpc::ClientContext* context, - google::bigtable::v2::ReadRowsRequest const& request) = 0; - virtual std::unique_ptr< - grpc::ClientAsyncReaderInterface> - AsyncReadRows(grpc::ClientContext* context, - google::bigtable::v2::ReadRowsRequest const& request, - grpc::CompletionQueue* cq, void* tag) = 0; - virtual std::unique_ptr<::grpc::ClientAsyncReaderInterface< - google::bigtable::v2::ReadRowsResponse>> - PrepareAsyncReadRows(::grpc::ClientContext* context, - google::bigtable::v2::ReadRowsRequest const& request, - grpc::CompletionQueue* cq) = 0; - virtual std::unique_ptr< - grpc::ClientReaderInterface> - SampleRowKeys(grpc::ClientContext* context, - google::bigtable::v2::SampleRowKeysRequest const& request) = 0; - virtual std::unique_ptr<::grpc::ClientAsyncReaderInterface< - google::bigtable::v2::SampleRowKeysResponse>> - AsyncSampleRowKeys(grpc::ClientContext* context, - google::bigtable::v2::SampleRowKeysRequest const& request, - grpc::CompletionQueue* cq, void* tag) = 0; - virtual std::unique_ptr<::grpc::ClientAsyncReaderInterface< - google::bigtable::v2::SampleRowKeysResponse>> - PrepareAsyncSampleRowKeys( - grpc::ClientContext* context, - google::bigtable::v2::SampleRowKeysRequest const& request, - grpc::CompletionQueue* cq); - virtual std::unique_ptr< - grpc::ClientReaderInterface> - MutateRows(grpc::ClientContext* context, - google::bigtable::v2::MutateRowsRequest const& request) = 0; - virtual std::unique_ptr<::grpc::ClientAsyncReaderInterface< - google::bigtable::v2::MutateRowsResponse>> - AsyncMutateRows(::grpc::ClientContext* context, - google::bigtable::v2::MutateRowsRequest const& request, - grpc::CompletionQueue* cq, void* tag) = 0; - virtual std::unique_ptr<::grpc::ClientAsyncReaderInterface< - google::bigtable::v2::MutateRowsResponse>> - PrepareAsyncMutateRows(grpc::ClientContext* context, - google::bigtable::v2::MutateRowsRequest const& request, - grpc::CompletionQueue* cq) = 0; - ///@} -}; - -/// Create a new data client configured via @p options. -std::shared_ptr MakeDataClient(std::string project_id, - std::string instance_id, - Options options = {}); - -/** - * Create a new data client configured via @p options. - * - * @deprecated use the `MakeDataClient` method which accepts - * `google::cloud::Options` instead. - */ -GOOGLE_CLOUD_CPP_DEPRECATED("use `MakeDataClient` instead") -std::shared_ptr CreateDefaultDataClient(std::string project_id, - std::string instance_id, - ClientOptions options); - -/** - * Return the fully qualified instance name for the @p client. - * - * Compute the full path of the instance associated with the client, i.e., - * `projects/instances/project_id()>/instances/instance_id()>` - */ -inline std::string InstanceName(std::shared_ptr const& client) { - return "projects/" + client->project_id() + "/instances/" + - client->instance_id(); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_DATA_CLIENT_H diff --git a/google/cloud/bigtable/data_client_test.cc b/google/cloud/bigtable/data_client_test.cc deleted file mode 100644 index 2fcc28caad549..0000000000000 --- a/google/cloud/bigtable/data_client_test.cc +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/data_client.h" -#include "google/cloud/bigtable/internal/logging_data_client.h" -#include "google/cloud/testing_util/scoped_environment.h" -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -// TODO(#8800) - remove after `DataClient` deprecation is complete -#include "google/cloud/internal/disable_deprecation_warnings.inc" - -TEST(DataClientTest, Default) { - auto data_client = - CreateDefaultDataClient("test-project", "test-instance", - ClientOptions().set_connection_pool_size(1)); - ASSERT_TRUE(data_client); - EXPECT_EQ("test-project", data_client->project_id()); - EXPECT_EQ("test-instance", data_client->instance_id()); - - auto channel0 = data_client->Channel(); - EXPECT_TRUE(channel0); - - auto channel1 = data_client->Channel(); - EXPECT_EQ(channel0.get(), channel1.get()); - - data_client->reset(); - channel1 = data_client->Channel(); - EXPECT_TRUE(channel1); - EXPECT_NE(channel0.get(), channel1.get()); -} - -TEST(DataClientTest, MakeClient) { - auto data_client = MakeDataClient("test-project", "test-instance", - Options{}.set(1)); - ASSERT_TRUE(data_client); - EXPECT_EQ("test-project", data_client->project_id()); - EXPECT_EQ("test-instance", data_client->instance_id()); - - auto channel0 = data_client->Channel(); - EXPECT_TRUE(channel0); - - auto channel1 = data_client->Channel(); - EXPECT_EQ(channel0.get(), channel1.get()); - - data_client->reset(); - channel1 = data_client->Channel(); - EXPECT_TRUE(channel1); - EXPECT_NE(channel0.get(), channel1.get()); -} - -// TODO(#8800) - remove after `DataClient` deprecation is complete -#include "google/cloud/internal/diagnostics_pop.inc" - -TEST(DataClientTest, Logging) { - testing_util::ScopedEnvironment env("GOOGLE_CLOUD_CPP_ENABLE_TRACING", "rpc"); - - auto data_client = MakeDataClient("test-project", "test-instance"); - ASSERT_TRUE(data_client); - ASSERT_TRUE( - dynamic_cast(data_client.get())) - << "Should create LoggingDataClient"; -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google 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.h b/google/cloud/bigtable/data_connection.h index edfdc52e2a015..2ff911892880a 100644 --- a/google/cloud/bigtable/data_connection.h +++ b/google/cloud/bigtable/data_connection.h @@ -180,7 +180,6 @@ class DataConnection { * - `google::cloud::GrpcOptionList` * - `google::cloud::UnifiedCredentialsOptionList` * - `google::cloud::bigtable::AppProfileIdOption` - * - `google::cloud::bigtable::ClientOptionsList` * - `google::cloud::bigtable::DataPolicyOptionList` * * @note Unrecognized options will be ignored. To debug issues with options set diff --git a/google/cloud/bigtable/data_connection_test.cc b/google/cloud/bigtable/data_connection_test.cc index 2a428214bca96..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,13 +61,6 @@ TEST(MakeDataConnection, DefaultsOptions) { << "User supplied Options are overridden in MakeDataConnection()"; } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY -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(); @@ -72,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(); @@ -81,7 +99,6 @@ TEST(MakeDataConnection, TracingDisabled) { EXPECT_THAT(span_catcher->GetSpans(), IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/bigtable/examples/BUILD.bazel b/google/cloud/bigtable/examples/BUILD.bazel index b913265c91f30..eb88603b9db78 100644 --- a/google/cloud/bigtable/examples/BUILD.bazel +++ b/google/cloud/bigtable/examples/BUILD.bazel @@ -31,8 +31,8 @@ cc_library( "//:grpc_utils", "//google/cloud/bigtable:bigtable_client_testing", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googleapis//google/bigtable/admin/v2:admin_cc_grpc", - "@com_google_googleapis//google/bigtable/v2:bigtable_cc_grpc", + "@googleapis//google/bigtable/admin/v2:admin_cc_grpc", + "@googleapis//google/bigtable/v2:bigtable_cc_grpc", ], ) @@ -50,7 +50,7 @@ filtered_unit_tests = [test for test in bigtable_examples_unit_tests if not test "//:grpc_utils", "//google/cloud/bigtable:bigtable_client_testing", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in filtered_unit_tests] @@ -60,7 +60,7 @@ cc_test( deps = [ "//google/cloud/bigtable:google_cloud_cpp_bigtable", "//google/cloud/bigtable:google_cloud_cpp_bigtable_mocks", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) diff --git a/google/cloud/bigtable/examples/bigtable_examples_common.cc b/google/cloud/bigtable/examples/bigtable_examples_common.cc index 06185b80fe6eb..27cc70c478250 100644 --- a/google/cloud/bigtable/examples/bigtable_examples_common.cc +++ b/google/cloud/bigtable/examples/bigtable_examples_common.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/bigtable/examples/bigtable_examples_common.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/getenv.h" +#include "absl/strings/str_join.h" #include #include diff --git a/google/cloud/bigtable/examples/bigtable_instance_admin_snippets.cc b/google/cloud/bigtable/examples/bigtable_instance_admin_snippets.cc index 0f7984a08ad8b..33545d4437ddf 100644 --- a/google/cloud/bigtable/examples/bigtable_instance_admin_snippets.cc +++ b/google/cloud/bigtable/examples/bigtable_instance_admin_snippets.cc @@ -18,11 +18,12 @@ #include "google/cloud/bigtable/resource_names.h" #include "google/cloud/bigtable/testing/cleanup_stale_resources.h" #include "google/cloud/bigtable/testing/random_names.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/location.h" #include "google/cloud/log.h" #include "google/cloud/project.h" +#include "absl/strings/match.h" +#include "absl/strings/str_join.h" #include namespace { diff --git a/google/cloud/bigtable/examples/data_snippets.cc b/google/cloud/bigtable/examples/data_snippets.cc index 1b849dbd47a87..f261a2acdc796 100644 --- a/google/cloud/bigtable/examples/data_snippets.cc +++ b/google/cloud/bigtable/examples/data_snippets.cc @@ -17,6 +17,7 @@ #include "google/cloud/bigtable/resource_names.h" #include "google/cloud/bigtable/testing/cleanup_stale_resources.h" #include "google/cloud/bigtable/testing/random_names.h" +#include "google/cloud/grpc_options.h" //! [bigtable includes] #include "google/cloud/bigtable/client.h" #include "google/cloud/bigtable/table.h" diff --git a/google/cloud/bigtable/examples/table_admin_iam_policy_snippets.cc b/google/cloud/bigtable/examples/table_admin_iam_policy_snippets.cc index 64b40da058c17..c9620ab0776aa 100644 --- a/google/cloud/bigtable/examples/table_admin_iam_policy_snippets.cc +++ b/google/cloud/bigtable/examples/table_admin_iam_policy_snippets.cc @@ -18,9 +18,9 @@ #include "google/cloud/bigtable/resource_names.h" #include "google/cloud/bigtable/testing/cleanup_stale_resources.h" #include "google/cloud/bigtable/testing/random_names.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/log.h" +#include "absl/strings/str_join.h" #include namespace { diff --git a/google/cloud/bigtable/examples/table_admin_snippets.cc b/google/cloud/bigtable/examples/table_admin_snippets.cc index e3d2ae8b08a14..3f95b4b1fafd5 100644 --- a/google/cloud/bigtable/examples/table_admin_snippets.cc +++ b/google/cloud/bigtable/examples/table_admin_snippets.cc @@ -14,10 +14,8 @@ #include "google/cloud/bigtable/admin/bigtable_table_admin_client.h" #include "google/cloud/bigtable/examples/bigtable_examples_common.h" -#include "google/cloud/bigtable/table_admin.h" #include "google/cloud/bigtable/testing/cleanup_stale_resources.h" #include "google/cloud/bigtable/testing/random_names.h" -#include "google/cloud/bigtable/wait_for_consistency.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/log.h" #include @@ -624,7 +622,7 @@ void DropRowsByPrefix( } void WaitForConsistencyCheck( - google::cloud::bigtable_admin::BigtableTableAdminClient admin, + google::cloud::bigtable_admin::BigtableTableAdminClient const& admin, std::vector const& argv) { //! [wait for consistency check] namespace cbt = ::google::cloud::bigtable; @@ -633,30 +631,24 @@ void WaitForConsistencyCheck( using ::google::cloud::future; using ::google::cloud::Status; using ::google::cloud::StatusOr; - [](cbta::BigtableTableAdminClient admin, std::string const& project_id, + [](cbta::BigtableTableAdminClient const&, std::string const& project_id, std::string const& instance_id, std::string const& table_id) { + auto client = cbta::BigtableTableAdminClient( + cbta::MakeBigtableTableAdminConnection()); std::string table_name = cbt::TableName(project_id, instance_id, table_id); StatusOr - consistency_token = admin.GenerateConsistencyToken(table_name); + consistency_token = client.GenerateConsistencyToken(table_name); if (!consistency_token) { throw std::move(consistency_token).status(); } - // Start a thread to perform the background work. - CompletionQueue cq; - std::thread cq_runner([&cq] { cq.Run(); }); - - std::string token = consistency_token->consistency_token(); - future consistent_future = - cbta::AsyncWaitForConsistency(cq, admin, table_name, token); - - // Simplify the example by blocking until the operation is done. - Status status = consistent_future.get(); - if (!status.ok()) throw std::runtime_error(status.message()); + auto token = consistency_token->consistency_token(); + google::bigtable::admin::v2::CheckConsistencyRequest wait_request; + wait_request.set_name(table_name); + wait_request.set_consistency_token(token); + auto consistency_future = client.WaitForConsistency(wait_request); + auto consistency = consistency_future.get(); + if (!consistency) throw std::runtime_error(consistency.status().message()); std::cout << "Table is consistent with token " << token << "\n"; - - // Shutdown the work queue and join the background thread - cq.Shutdown(); - cq_runner.join(); } //! [wait for consistency check] (std::move(admin), argv.at(0), argv.at(1), argv.at(2)); diff --git a/google/cloud/bigtable/expr.h b/google/cloud/bigtable/expr.h index 17a072ab3fbfa..1804f47dd12db 100644 --- a/google/cloud/bigtable/expr.h +++ b/google/cloud/bigtable/expr.h @@ -16,7 +16,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_EXPR_H #include "google/cloud/bigtable/version.h" -#include +#include "google/type/expr.pb.h" #include namespace google { diff --git a/google/cloud/bigtable/filters.h b/google/cloud/bigtable/filters.h index ea3a4671947ab..5e93c549605cd 100644 --- a/google/cloud/bigtable/filters.h +++ b/google/cloud/bigtable/filters.h @@ -17,7 +17,7 @@ #include "google/cloud/bigtable/version.h" #include "absl/meta/type_traits.h" -#include +#include "google/bigtable/v2/data.pb.h" #include #include #include diff --git a/google/cloud/bigtable/google_cloud_cpp_bigtable.bzl b/google/cloud/bigtable/google_cloud_cpp_bigtable.bzl index c5d4f47beff0b..e8f2fe5650641 100644 --- a/google/cloud/bigtable/google_cloud_cpp_bigtable.bzl +++ b/google/cloud/bigtable/google_cloud_cpp_bigtable.bzl @@ -45,27 +45,21 @@ google_cloud_cpp_bigtable_hdrs = [ "admin/internal/bigtable_table_admin_stub_factory.h", "admin/internal/bigtable_table_admin_tracing_connection.h", "admin/internal/bigtable_table_admin_tracing_stub.h", - "admin_client.h", "app_profile_config.h", - "async_row_reader.h", "bound_query.h", "bytes.h", "cell.h", "client.h", - "client_options.h", "cluster_config.h", "cluster_list_responses.h", "column_family.h", "completion_queue.h", - "data_client.h", "data_connection.h", "expr.h", "filters.h", "iam_binding.h", "iam_policy.h", "idempotent_mutation_policy.h", - "instance_admin.h", - "instance_admin_client.h", "instance_config.h", "instance_list_responses.h", "instance_resource.h", @@ -80,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", @@ -95,12 +91,9 @@ 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/legacy_async_bulk_apply.h", - "internal/legacy_async_row_reader.h", - "internal/legacy_async_row_sampler.h", - "internal/legacy_row_reader.h", - "internal/logging_data_client.h", "internal/logging_result_set_reader.h", "internal/metrics.h", "internal/mutate_rows_limiter.h", @@ -117,10 +110,10 @@ 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", - "metadata_update_policy.h", "mutation_batcher.h", "mutation_branch.h", "mutations.h", @@ -143,14 +136,12 @@ google_cloud_cpp_bigtable_hdrs = [ "rpc_retry_policy.h", "sql_statement.h", "table.h", - "table_admin.h", "table_config.h", "table_resource.h", "timestamp.h", "value.h", "version.h", "version_info.h", - "wait_for_consistency.h", ] google_cloud_cpp_bigtable_srcs = [ @@ -171,6 +162,7 @@ google_cloud_cpp_bigtable_srcs = [ "admin/internal/bigtable_instance_admin_tracing_stub.cc", "admin/internal/bigtable_table_admin_auth_decorator.cc", "admin/internal/bigtable_table_admin_connection_impl.cc", + "admin/internal/bigtable_table_admin_connection_impl_bespoke.cc", "admin/internal/bigtable_table_admin_logging_decorator.cc", "admin/internal/bigtable_table_admin_metadata_decorator.cc", "admin/internal/bigtable_table_admin_option_defaults.cc", @@ -178,21 +170,16 @@ google_cloud_cpp_bigtable_srcs = [ "admin/internal/bigtable_table_admin_stub_factory.cc", "admin/internal/bigtable_table_admin_tracing_connection.cc", "admin/internal/bigtable_table_admin_tracing_stub.cc", - "admin_client.cc", "app_profile_config.cc", "bound_query.cc", "bytes.cc", "client.cc", - "client_options.cc", "cluster_config.cc", - "data_client.cc", "data_connection.cc", "expr.cc", "iam_binding.cc", "iam_policy.cc", "idempotent_mutation_policy.cc", - "instance_admin.cc", - "instance_admin_client.cc", "instance_config.cc", "instance_resource.cc", "instance_update_config.cc", @@ -204,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", @@ -218,11 +206,6 @@ google_cloud_cpp_bigtable_srcs = [ "internal/default_row_reader.cc", "internal/defaults.cc", "internal/google_bytes_traits.cc", - "internal/legacy_async_bulk_apply.cc", - "internal/legacy_async_row_reader.cc", - "internal/legacy_async_row_sampler.cc", - "internal/legacy_row_reader.cc", - "internal/logging_data_client.cc", "internal/logging_result_set_reader.cc", "internal/metrics.cc", "internal/mutate_rows_limiter.cc", @@ -235,8 +218,8 @@ 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", - "metadata_update_policy.cc", "mutation_batcher.cc", "mutations.cc", "polling_policy.cc", @@ -251,11 +234,9 @@ google_cloud_cpp_bigtable_srcs = [ "rpc_retry_policy.cc", "sql_statement.cc", "table.cc", - "table_admin.cc", "table_config.cc", "table_resource.cc", "timestamp.cc", "value.cc", "version.cc", - "wait_for_consistency.cc", ] diff --git a/google/cloud/bigtable/iam_binding.h b/google/cloud/bigtable/iam_binding.h index e50af5eaf3224..4c61d14f1ccf2 100644 --- a/google/cloud/bigtable/iam_binding.h +++ b/google/cloud/bigtable/iam_binding.h @@ -16,7 +16,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_IAM_BINDING_H #include "google/cloud/bigtable/version.h" -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.pb.h" #include #include #include diff --git a/google/cloud/bigtable/instance_admin.cc b/google/cloud/bigtable/instance_admin.cc deleted file mode 100644 index b5a283c6355e2..0000000000000 --- a/google/cloud/bigtable/instance_admin.cc +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/instance_admin.h" -#include "google/cloud/location.h" -#include -#include -#include - -namespace btadmin = ::google::bigtable::admin::v2; - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -static_assert(std::is_copy_assignable::value, - "bigtable::InstanceAdmin must be CopyAssignable"); - -StatusOr InstanceAdmin::ListInstances() { - google::cloud::internal::OptionsSpan span(options_); - InstanceList result; - - // Build the RPC request, try to minimize copying. - btadmin::ListInstancesRequest request; - request.set_parent(project_name()); - auto sor = connection_->ListInstances(request); - if (!sor) return std::move(sor).status(); - auto response = *std::move(sor); - auto& instances = *response.mutable_instances(); - std::move(instances.begin(), instances.end(), - std::back_inserter(result.instances)); - auto& failed_locations = *response.mutable_failed_locations(); - std::move(failed_locations.begin(), failed_locations.end(), - std::back_inserter(result.failed_locations)); - return result; -} - -future> InstanceAdmin::CreateInstance( - InstanceConfig instance_config) { - google::cloud::internal::OptionsSpan span(options_); - auto request = std::move(instance_config).as_proto(); - request.set_parent(project_name()); - for (auto& kv : *request.mutable_clusters()) { - kv.second.set_location( - Location(project_id(), kv.second.location()).FullName()); - } - return connection_->CreateInstance(request); -} - -future> InstanceAdmin::CreateCluster( - ClusterConfig cluster_config, std::string const& instance_id, - std::string const& cluster_id) { - google::cloud::internal::OptionsSpan span(options_); - auto cluster = std::move(cluster_config).as_proto(); - cluster.set_location(Location(project_id(), cluster.location()).FullName()); - btadmin::CreateClusterRequest request; - request.mutable_cluster()->Swap(&cluster); - request.set_parent(InstanceName(instance_id)); - request.set_cluster_id(cluster_id); - return connection_->CreateCluster(request); -} - -future> -InstanceAdmin::UpdateInstance(InstanceUpdateConfig instance_update_config) { - google::cloud::internal::OptionsSpan span(options_); - auto request = std::move(instance_update_config).as_proto(); - return connection_->PartialUpdateInstance(request); -} - -StatusOr InstanceAdmin::GetInstance( - std::string const& instance_id) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::GetInstanceRequest request; - request.set_name(InstanceName(instance_id)); - return connection_->GetInstance(request); -} - -Status InstanceAdmin::DeleteInstance(std::string const& instance_id) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::DeleteInstanceRequest request; - request.set_name(InstanceName(instance_id)); - return connection_->DeleteInstance(request); -} - -StatusOr InstanceAdmin::GetCluster( - std::string const& instance_id, std::string const& cluster_id) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::GetClusterRequest request; - request.set_name(ClusterName(instance_id, cluster_id)); - return connection_->GetCluster(request); -} - -StatusOr InstanceAdmin::ListClusters() { - return ListClusters("-"); -} - -StatusOr InstanceAdmin::ListClusters( - std::string const& instance_id) { - google::cloud::internal::OptionsSpan span(options_); - ClusterList result; - - btadmin::ListClustersRequest request; - request.set_parent(InstanceName(instance_id)); - auto sor = connection_->ListClusters(request); - if (!sor) return std::move(sor).status(); - auto response = *std::move(sor); - auto& clusters = *response.mutable_clusters(); - std::move(clusters.begin(), clusters.end(), - std::back_inserter(result.clusters)); - auto& failed_locations = *response.mutable_failed_locations(); - std::move(failed_locations.begin(), failed_locations.end(), - std::back_inserter(result.failed_locations)); - return result; -} - -future> -InstanceAdmin::UpdateCluster(ClusterConfig cluster_config) { - google::cloud::internal::OptionsSpan span(options_); - auto request = std::move(cluster_config).as_proto(); - return connection_->UpdateCluster(request); -} - -Status InstanceAdmin::DeleteCluster(std::string const& instance_id, - std::string const& cluster_id) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::DeleteClusterRequest request; - request.set_name(ClusterName(instance_id, cluster_id)); - return connection_->DeleteCluster(request); -} - -StatusOr InstanceAdmin::CreateAppProfile( - std::string const& instance_id, AppProfileConfig config) { - google::cloud::internal::OptionsSpan span(options_); - auto request = std::move(config).as_proto(); - request.set_parent(InstanceName(instance_id)); - return connection_->CreateAppProfile(request); -} - -StatusOr InstanceAdmin::GetAppProfile( - std::string const& instance_id, std::string const& profile_id) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::GetAppProfileRequest request; - request.set_name(AppProfileName(instance_id, profile_id)); - return connection_->GetAppProfile(request); -} - -future> InstanceAdmin::UpdateAppProfile( - std::string const& instance_id, std::string const& profile_id, - AppProfileUpdateConfig config) { - google::cloud::internal::OptionsSpan span(options_); - auto request = std::move(config).as_proto(); - request.mutable_app_profile()->set_name( - AppProfileName(instance_id, profile_id)); - return connection_->UpdateAppProfile(request); -} - -StatusOr> InstanceAdmin::ListAppProfiles( - std::string const& instance_id) { - google::cloud::internal::OptionsSpan span(options_); - std::vector result; - - btadmin::ListAppProfilesRequest request; - request.set_parent(InstanceName(instance_id)); - auto sr = connection_->ListAppProfiles(request); - for (auto& ap : sr) { - if (!ap) return std::move(ap).status(); - result.emplace_back(*std::move(ap)); - } - return result; -} - -Status InstanceAdmin::DeleteAppProfile(std::string const& instance_id, - std::string const& profile_id, - bool ignore_warnings) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::DeleteAppProfileRequest request; - request.set_name(AppProfileName(instance_id, profile_id)); - request.set_ignore_warnings(ignore_warnings); - return connection_->DeleteAppProfile(request); -} - -StatusOr InstanceAdmin::GetNativeIamPolicy( - std::string const& instance_id) { - google::cloud::internal::OptionsSpan span(options_); - google::iam::v1::GetIamPolicyRequest request; - request.set_resource(InstanceName(instance_id)); - return connection_->GetIamPolicy(request); -} - -StatusOr InstanceAdmin::SetIamPolicy( - std::string const& instance_id, google::iam::v1::Policy const& iam_policy) { - google::cloud::internal::OptionsSpan span(options_); - google::iam::v1::SetIamPolicyRequest request; - request.set_resource(InstanceName(instance_id)); - *request.mutable_policy() = iam_policy; - return connection_->SetIamPolicy(request); -} - -StatusOr> InstanceAdmin::TestIamPermissions( - std::string const& instance_id, - std::vector const& permissions) { - google::cloud::internal::OptionsSpan span(options_); - google::iam::v1::TestIamPermissionsRequest request; - request.set_resource(InstanceName(instance_id)); - for (auto const& permission : permissions) { - request.add_permissions(permission); - } - auto sor = connection_->TestIamPermissions(request); - if (!sor) return std::move(sor).status(); - auto response = *std::move(sor); - std::vector result; - auto& ps = *response.mutable_permissions(); - std::move(ps.begin(), ps.end(), std::back_inserter(result)); - return result; -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/instance_admin.h b/google/cloud/bigtable/instance_admin.h deleted file mode 100644 index e7f218261fd07..0000000000000 --- a/google/cloud/bigtable/instance_admin.h +++ /dev/null @@ -1,732 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_INSTANCE_ADMIN_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INSTANCE_ADMIN_H - -#include "google/cloud/bigtable/admin/bigtable_instance_admin_connection.h" -#include "google/cloud/bigtable/admin/bigtable_instance_admin_options.h" -#include "google/cloud/bigtable/app_profile_config.h" -#include "google/cloud/bigtable/cluster_config.h" -#include "google/cloud/bigtable/cluster_list_responses.h" -#include "google/cloud/bigtable/completion_queue.h" -#include "google/cloud/bigtable/iam_policy.h" -#include "google/cloud/bigtable/instance_admin_client.h" -#include "google/cloud/bigtable/instance_config.h" -#include "google/cloud/bigtable/instance_list_responses.h" -#include "google/cloud/bigtable/instance_update_config.h" -#include "google/cloud/bigtable/internal/convert_policies.h" -#include "google/cloud/bigtable/polling_policy.h" -#include "google/cloud/bigtable/resource_names.h" -#include "google/cloud/bigtable/version.h" -#include "google/cloud/future.h" -#include "google/cloud/project.h" -#include "google/cloud/status_or.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -class InstanceAdminTester; -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_internal -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * Implements the APIs to administer Cloud Bigtable instances. - * - * @par Thread-safety - * Instances of this class created via copy-construction or copy-assignment - * share the underlying pool of connections. Access to these copies via multiple - * threads is guaranteed to work. Two threads operating concurrently on the same - * instance of this class is not guaranteed to work. - * - * @par Cost - * Creating a new object of type `InstanceAdmin` is comparable to creating a few - * objects of type `std::string` or a few objects of type - * `std::shared_ptr`. The class represents a shallow handle to a remote - * object. - * - * @par Error Handling - * This class uses `StatusOr` to report errors. When an operation fails to - * perform its work the returned `StatusOr` contains the error details. If - * the `ok()` member function in the `StatusOr` returns `true` then it - * contains the expected result. Operations that do not return a value simply - * return a `google::cloud::Status` indicating success or the details of the - * error Please consult the [`StatusOr` - * documentation](#google::cloud::StatusOr) for more details. - * - * @code - * namespace cbt = google::cloud::bigtable; - * namespace btadmin = google::bigtable::admin::v2; - * cbt::InstanceAdmin admin = ...; - * google::cloud::StatusOr instance = admin.GetInstance(...); - * - * if (!instance) { - * std::cerr << "Error fetching instance\n"; - * return; - * } - * - * // Use `instance` as a smart pointer here, e.g.: - * std::cout << "The full instance name is " << instance->name() << "\n"; - * @endcode - * - * In addition, the @ref index "main page" contains examples using `StatusOr` - * to handle errors. - * - * @par Retry, Backoff, and Idempotency Policies - * The library automatically retries requests that fail with transient errors, - * and uses [truncated exponential backoff][backoff-link] to backoff between - * retries. The default policies are to continue retrying for up to 10 minutes. - * On each transient failure the backoff period is doubled, starting with an - * initial backoff of 100 milliseconds. The backoff period growth is truncated - * at 60 seconds. The default idempotency policy is to only retry idempotent - * operations. Note that most operations that change state are **not** - * idempotent. - * - * The application can override these policies when constructing objects of this - * class. The documentation for the constructors show examples of this in - * action. - * - * [backoff-link]: https://cloud.google.com/storage/docs/exponential-backoff - * - * @see https://cloud.google.com/bigtable/ for an overview of Cloud Bigtable. - * - * @see https://cloud.google.com/bigtable/docs/overview for an overview of the - * Cloud Bigtable data model. - * - * @see https://cloud.google.com/bigtable/docs/instances-clusters-nodes for an - * introduction of the main APIs into Cloud Bigtable. - * - * @see https://cloud.google.com/bigtable/docs/reference/service-apis-overview - * for an overview of the underlying Cloud Bigtable API. - * - * @see #google::cloud::StatusOr for a description of the error reporting class - * used by this library. - * - * @see `LimitedTimeRetryPolicy` and `LimitedErrorCountRetryPolicy` for - * alternative retry policies. - * - * @see `ExponentialBackoffPolicy` to configure different parameters for the - * exponential backoff policy. - * - * @see `SafeIdempotentMutationPolicy` and `AlwaysRetryMutationPolicy` for - * alternative idempotency policies. - */ -class InstanceAdmin { - public: - explicit InstanceAdmin( - std::shared_ptr - connection, - std::string project) - : connection_(std::move(connection)), - project_id_(std::move(project)), - project_name_(Project(project_id_).FullName()), - retry_prototype_( - DefaultRPCRetryPolicy(internal::kBigtableInstanceAdminLimits)), - backoff_prototype_( - DefaultRPCBackoffPolicy(internal::kBigtableInstanceAdminLimits)), - polling_prototype_( - DefaultPollingPolicy(internal::kBigtableInstanceAdminLimits)), - options_(google::cloud::internal::MergeOptions( - bigtable_internal::MakeInstanceAdminOptions( - retry_prototype_, backoff_prototype_, polling_prototype_), - connection_->options())) {} - - /** - * @param client the interface to create grpc stubs, report errors, etc. - */ - // NOLINTNEXTLINE(performance-unnecessary-value-param) - explicit InstanceAdmin(std::shared_ptr client) - : InstanceAdmin(client->connection_, client->project()) {} - - /** - * Create a new InstanceAdmin using explicit policies to handle RPC errors. - * - * @param client the interface to create grpc stubs, report errors, etc. - * @param policies the set of policy overrides for this object. - * @tparam Policies the types of the policies to override, the types must - * derive from one of the following types: - * - `RPCBackoffPolicy` how to backoff from a failed RPC. Currently only - * `ExponentialBackoffPolicy` is implemented. You can also create your - * own policies that backoff using a different algorithm. - * - `RPCRetryPolicy` for how long to retry failed RPCs. Use - * `LimitedErrorCountRetryPolicy` to limit the number of failures - * allowed. Use `LimitedTimeRetryPolicy` to bound the time for any - * request. You can also create your own policies that combine time and - * error counts. - * - `PollingPolicy` for how long will the class wait for - * `google.longrunning.Operation` to complete. This class combines both - * the backoff policy for checking long running operations and the - * retry policy. - * - * @see GenericPollingPolicy, ExponentialBackoffPolicy, - * LimitedErrorCountRetryPolicy, LimitedTimeRetryPolicy. - */ - template - // NOLINTNEXTLINE(performance-unnecessary-value-param) - explicit InstanceAdmin(std::shared_ptr client, - Policies&&... policies) - : connection_(client->connection_), - project_id_(client->project()), - project_name_(Project(project_id_).FullName()), - retry_prototype_( - DefaultRPCRetryPolicy(internal::kBigtableInstanceAdminLimits)), - backoff_prototype_( - DefaultRPCBackoffPolicy(internal::kBigtableInstanceAdminLimits)), - polling_prototype_( - DefaultPollingPolicy(internal::kBigtableInstanceAdminLimits)) { - ChangePolicies(std::forward(policies)...); - options_ = google::cloud::internal::MergeOptions( - bigtable_internal::MakeInstanceAdminOptions( - retry_prototype_, backoff_prototype_, polling_prototype_), - connection_->options()); - } - - /// The full name (`projects/`) of the project. - std::string const& project_name() const { return project_name_; } - /// The project id, i.e., `project_name()` without the `projects/` prefix. - std::string const& project_id() const { return project_id_; } - - /** - * Returns an InstanceAdmin that reuses the connection and configuration of - * this InstanceAdmin, but with a different resource name. - */ - InstanceAdmin WithNewTarget(std::string project_id) const { - auto admin = *this; - admin.project_id_ = std::move(project_id); - admin.project_name_ = Project(admin.project_id_).FullName(); - return admin; - } - - /// Return the fully qualified name of the given instance_id. - std::string InstanceName(std::string const& instance_id) const { - return google::cloud::bigtable::InstanceName(project_id_, instance_id); - } - - /// Return the fully qualified name of the given cluster_id in give - /// instance_id. - std::string ClusterName(std::string const& instance_id, - std::string const& cluster_id) const { - return google::cloud::bigtable::ClusterName(project_id_, instance_id, - cluster_id); - } - - std::string AppProfileName(std::string const& instance_id, - std::string const& profile_id) const { - return google::cloud::bigtable::AppProfileName(project_id_, instance_id, - profile_id); - } - - /** - * Create a new instance of Cloud Bigtable. - * - * @warning Note that this is operation can take seconds or minutes to - * complete. The application may prefer to perform other work while waiting - * for this operation. - * - * @param instance_config a description of the new instance to be created. - * instance_id and a display_name parameters must be set in instance_config, - * - instance_id : must be between 6 and 33 characters. - * - display_name : must be between 4 and 30 characters. - * @return a future that becomes satisfied when (a) the operation has - * completed successfully, in which case it returns a proto with the - * Instance details, (b) the operation has failed, in which case the future - * contains an `google::cloud::Status` with the details of the failure, or - * (c) the state of the operation is unknown after the time allocated by the - * retry policies has expired, in which case the future contains the last - * error status. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc create instance - */ - future> CreateInstance( - InstanceConfig instance_config); - - /** - * Create a new Cluster of Cloud Bigtable. - * - * @param cluster_config a description of the new cluster to be created. - * @param instance_id the id of the instance in the project - * @param cluster_id the id of the cluster in the project that needs to be - * created. It must be between 6 and 30 characters. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc create cluster - */ - future> CreateCluster( - ClusterConfig cluster_config, std::string const& instance_id, - std::string const& cluster_id); - - /** - * Update an existing instance of Cloud Bigtable. - * - * @warning Note that this is operation can take seconds or minutes to - * complete. The application may prefer to perform other work while waiting - * for this operation. - * - * @param instance_update_config config with modified instance. - * @return a future that becomes satisfied when (a) the operation has - * completed successfully, in which case it returns a proto with the - * Instance details, (b) the operation has failed, in which case the future - * contains an exception (typically `bigtable::GrpcError`) with the details - * of the failure, or (c) the state of the operation is unknown after the - * time allocated by the retry policies has expired, in which case the - * future contains an exception of type `bigtable::PollTimeout`. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc update instance - */ - future> UpdateInstance( - InstanceUpdateConfig instance_update_config); - - /** - * Obtain the list of instances in the project. - * - * @note In some circumstances Cloud Bigtable may be unable to obtain the full - * list of instances, typically because some transient failure has made - * specific zones unavailable. In this cases the service returns a separate - * list of `failed_locations` that represent the unavailable zones. - * Applications may want to retry the operation after the transient - * conditions have cleared. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc list instances - */ - StatusOr ListInstances(); - - /** - * Return the details of @p instance_id. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc get instance - */ - StatusOr GetInstance( - std::string const& instance_id); - - /** - * Deletes the instances in the project. - * - * @param instance_id the id of the instance in the project that needs to be - * deleted - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc delete instance - */ - Status DeleteInstance(std::string const& instance_id); - - /** - * Obtain the list of clusters in an instance. - * - * @note In some circumstances Cloud Bigtable may be unable to obtain the full - * list of clusters, typically because some transient failure has made - * specific zones unavailable. In this cases the service returns a separate - * list of `failed_locations` that represent the unavailable zones. - * Applications may want to retry the operation after the transient - * conditions have cleared. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc list clusters - */ - StatusOr ListClusters(); - - /** - * Obtain the list of clusters in an instance. - * - * @note In some circumstances Cloud Bigtable may be unable to obtain the full - * list of clusters, typically because some transient failure has made - * specific zones unavailable. In this cases the service returns a separate - * list of `failed_locations` that represent the unavailable zones. - * Applications may want to retry the operation after the transient - * conditions have cleared. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc list clusters - */ - StatusOr ListClusters(std::string const& instance_id); - - /** - * Update an existing cluster of Cloud Bigtable. - * - * @warning Note that this is operation can take seconds or minutes to - * complete. The application may prefer to perform other work while waiting - * for this operation. - * - * @param cluster_config cluster with updated values. - * @return a future that becomes satisfied when (a) the operation has - * completed successfully, in which case it returns a proto with the - * Instance details, (b) the operation has failed, in which case the future - * contains an exception (typically `bigtable::GrpcError`) with the details - * of the failure, or (c) the state of the operation is unknown after the - * time allocated by the retry policies has expired, in which case the - * future contains an exception of type `bigtable::PollTimeout`. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc update cluster - */ - future> UpdateCluster( - ClusterConfig cluster_config); - - /** - * Deletes the specified cluster of an instance in the project. - * - * @param instance_id the id of the instance in the project - * @param cluster_id the id of the cluster in the project that needs to be - * deleted - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc delete cluster - */ - Status DeleteCluster(std::string const& instance_id, - std::string const& cluster_id); - - /** - * Gets the specified cluster of an instance in the project. - * - * @param instance_id the id of the instance in the project - * @param cluster_id the id of the cluster in the project that needs to be - * deleted - * @return a Cluster for given instance_id and cluster_id. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc get cluster - */ - StatusOr GetCluster( - std::string const& instance_id, std::string const& cluster_id); - - /** - * Create a new application profile. - * - * @param instance_id the instance for the new application profile. - * @param config the configuration for the new application profile. - * @return The proto describing the new application profile. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Multi-cluster Routing Example - * @snippet bigtable_instance_admin_snippets.cc create app profile - * - * @par Single Cluster Routing Example - * @snippet bigtable_instance_admin_snippets.cc create app profile cluster - */ - StatusOr CreateAppProfile( - std::string const& instance_id, AppProfileConfig config); - - /** - * Fetch the detailed information about an existing application profile. - * - * @param instance_id the instance to look the profile in. - * @param profile_id the id of the profile within that instance. - * @return The proto describing the application profile. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc get app profile - */ - StatusOr GetAppProfile( - std::string const& instance_id, std::string const& profile_id); - - /** - * Updates an existing application profile. - * - * @param instance_id the instance for the new application profile. - * @param profile_id the id (not the full name) of the profile to update. - * @param config the configuration for the new application profile. - * @return The proto describing the new application profile. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Change Description Example - * @snippet bigtable_instance_admin_snippets.cc update app profile description - * - * @par Change Routing to Any Cluster Example - * @snippet bigtable_instance_admin_snippets.cc update app profile routing any - * - * @par Change Routing to a Specific Cluster Example - * @snippet bigtable_instance_admin_snippets.cc update app profile routing - */ - future> UpdateAppProfile( - std::string const& instance_id, std::string const& profile_id, - AppProfileUpdateConfig config); - - /** - * List the application profiles in an instance. - * - * @param instance_id the instance to list the profiles for. - * @return a std::vector with the protos describing any profiles. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc list app profiles - */ - StatusOr> - ListAppProfiles(std::string const& instance_id); - - /** - * Delete an existing application profile. - * - * @param instance_id the instance to look the profile in. - * @param profile_id the id of the profile within that instance. - * @param ignore_warnings if true, ignore safety checks when deleting the - * application profile. This value is to to `true` by default. Passing - * `false` causes this function to fail even when no operations are - * pending. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc delete app profile - */ - Status DeleteAppProfile(std::string const& instance_id, - std::string const& profile_id, - bool ignore_warnings = true); - - /** - * Gets the native policy for @p instance_id. - * - * @param instance_id the instance to query. - * @return google::iam::v1::Policy the full IAM policy for the instance. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc get native iam policy - */ - StatusOr GetNativeIamPolicy( - std::string const& instance_id); - - /** - * Sets the IAM policy for an instance. - * - * @param instance_id which instance to set the IAM policy for. - * @param iam_policy google::iam::v1::Policy object containing role and - * members. - * @return google::iam::v1::Policy the current IAM policy for the instance. - * - * @warning ETags are currently not used by Cloud Bigtable. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc set native iam policy - */ - StatusOr SetIamPolicy( - std::string const& instance_id, - google::iam::v1::Policy const& iam_policy); - - /** - * Returns a permission set that the caller has on the specified instance. - * - * @param instance_id the ID of the instance to query. - * @param permissions set of permissions to check for the resource. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_instance_admin_snippets.cc test iam permissions - * - * @see https://cloud.google.com/bigtable/docs/access-control for a list of - * valid permissions on Google Cloud Bigtable. - */ - StatusOr> TestIamPermissions( - std::string const& instance_id, - std::vector const& permissions); - - private: - friend class bigtable_internal::InstanceAdminTester; - - ///@{ - /// @name Helper functions to implement constructors with changed policies. - void ChangePolicy(RPCRetryPolicy const& policy) { - retry_prototype_ = policy.clone(); - } - - void ChangePolicy(RPCBackoffPolicy const& policy) { - backoff_prototype_ = policy.clone(); - } - - void ChangePolicy(PollingPolicy const& policy) { - polling_prototype_ = policy.clone(); - } - - template - void ChangePolicies(Policy&& policy, Policies&&... policies) { - ChangePolicy(policy); - ChangePolicies(std::forward(policies)...); - } - void ChangePolicies() {} - ///@} - - std::shared_ptr connection_; - std::string project_id_; - std::string project_name_; - ///@{ - /// These prototypes are only used as temporary storage during construction of - /// the class, where they are consolidated as common policies in `options_`. - std::shared_ptr retry_prototype_; - std::shared_ptr backoff_prototype_; - std::shared_ptr polling_prototype_; - ///} - Options options_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INSTANCE_ADMIN_H diff --git a/google/cloud/bigtable/instance_admin_client.cc b/google/cloud/bigtable/instance_admin_client.cc deleted file mode 100644 index d95811843a370..0000000000000 --- a/google/cloud/bigtable/instance_admin_client.cc +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/instance_admin_client.h" -#include "google/cloud/bigtable/internal/defaults.h" - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -std::shared_ptr MakeInstanceAdminClient( - std::string project, Options options) { - options = internal::DefaultInstanceAdminOptions(std::move(options)); - return std::shared_ptr( - new InstanceAdminClient(std::move(project), std::move(options))); -} - -std::shared_ptr CreateDefaultInstanceAdminClient( - std::string project, ClientOptions options) { - return MakeInstanceAdminClient(std::move(project), - internal::MakeOptions(std::move(options))); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/instance_admin_client.h b/google/cloud/bigtable/instance_admin_client.h deleted file mode 100644 index 7bdf232416a50..0000000000000 --- a/google/cloud/bigtable/instance_admin_client.h +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_INSTANCE_ADMIN_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INSTANCE_ADMIN_CLIENT_H - -#include "google/cloud/bigtable/admin/bigtable_instance_admin_connection.h" -#include "google/cloud/bigtable/client_options.h" -#include "google/cloud/bigtable/version.h" -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * Creates a `bigtable_admin::BigtableInstanceAdminConnection` for - * `bigtable::InstanceAdmin` to use. - * - * This class is used to initiate a connection to the Cloud Bigtable Instance - * Admin service. It is maintained only for backwards compatibility. - * - * @deprecated Please use `bigtable_admin::BigtableInstanceAdminConnection` to - * configure `bigtable_admin::BigtableInstanceAdminClient`, instead of using - * this class to configure `bigtable::InstanceAdmin`. - */ -class InstanceAdminClient final { - public: - virtual ~InstanceAdminClient() = default; - - /// The project id that this AdminClient works on. - virtual std::string const& project() { return project_; } - - private: - friend class InstanceAdmin; - friend std::shared_ptr MakeInstanceAdminClient( - std::string, Options); - - InstanceAdminClient(std::string project, Options options) - : project_(std::move(project)), - connection_(bigtable_admin::MakeBigtableInstanceAdminConnection( - std::move(options))) {} - - std::string project_; - std::shared_ptr connection_; -}; - -/// Create a new instance admin client configured via @p options. -std::shared_ptr MakeInstanceAdminClient( - std::string project, Options options = {}); - -/** - * Create a new instance admin client configured via @p options. - * - * @deprecated use the `MakeInstanceAdminClient` method which accepts - * `google::cloud::Options` instead. - */ -GOOGLE_CLOUD_CPP_DEPRECATED("use `MakeInstanceAdminClient` instead") -std::shared_ptr CreateDefaultInstanceAdminClient( - std::string project, ClientOptions options); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INSTANCE_ADMIN_CLIENT_H diff --git a/google/cloud/bigtable/instance_admin_client_test.cc b/google/cloud/bigtable/instance_admin_client_test.cc deleted file mode 100644 index 2d86e882d2965..0000000000000 --- a/google/cloud/bigtable/instance_admin_client_test.cc +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/instance_admin_client.h" -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -#include "google/cloud/internal/disable_deprecation_warnings.inc" - -TEST(InstanceAdminClientTest, CreateDefaultClient) { - auto admin_client = CreateDefaultInstanceAdminClient("test-project", {}); - ASSERT_TRUE(admin_client); - EXPECT_EQ("test-project", admin_client->project()); -} - -#include "google/cloud/internal/diagnostics_pop.inc" - -TEST(InstanceAdminClientTest, MakeClient) { - auto admin_client = MakeInstanceAdminClient("test-project"); - ASSERT_TRUE(admin_client); - EXPECT_EQ("test-project", admin_client->project()); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/instance_admin_test.cc b/google/cloud/bigtable/instance_admin_test.cc deleted file mode 100644 index a556750b81985..0000000000000 --- a/google/cloud/bigtable/instance_admin_test.cc +++ /dev/null @@ -1,693 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/instance_admin.h" -#include "google/cloud/bigtable/admin/mocks/mock_bigtable_instance_admin_connection.h" -#include "google/cloud/bigtable/testing/mock_policies.h" -#include "google/cloud/location.h" -#include "google/cloud/project.h" -#include "google/cloud/testing_util/status_matchers.h" -#include - -namespace google { -namespace cloud { -namespace bigtable_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -// Helper class for checking that the legacy API still functions correctly -class InstanceAdminTester { - public: - static std::shared_ptr - Connection(bigtable::InstanceAdmin const& admin) { - return admin.connection_; - } - - static ::google::cloud::Options Options( - bigtable::InstanceAdmin const& admin) { - return admin.options_; - } -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_internal -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace btadmin = ::google::bigtable::admin::v2; -namespace iamproto = ::google::iam::v1; - -using ::google::cloud::bigtable::testing::MockBackoffPolicy; -using ::google::cloud::bigtable::testing::MockPollingPolicy; -using ::google::cloud::bigtable::testing::MockRetryPolicy; -using ::google::cloud::bigtable_internal::InstanceAdminTester; -using ::google::cloud::testing_util::StatusIs; -using ::testing::An; -using ::testing::Contains; -using ::testing::ElementsAreArray; -using ::testing::NotNull; -using ::testing::Return; -using ::testing::UnorderedElementsAreArray; - -using MockConnection = - ::google::cloud::bigtable_admin_mocks::MockBigtableInstanceAdminConnection; - -auto const kProjectId = "the-project"; -auto const kInstanceId = "the-instance"; -auto const kClusterId = "the-cluster"; -auto const kProfileId = "the-profile"; -auto const kProjectName = "projects/the-project"; -auto const kInstanceName = "projects/the-project/instances/the-instance"; -auto const kClusterName = - "projects/the-project/instances/the-instance/clusters/the-cluster"; -auto const kProfileName = - "projects/the-project/instances/the-instance/appProfiles/the-profile"; - -std::string LocationName(std::string const& location) { - return Location(Project(kProjectId), location).FullName(); -} - -Status FailingStatus() { return Status(StatusCode::kPermissionDenied, "fail"); } - -struct TestOption { - using Type = int; -}; - -Options TestOptions() { - return Options{} - .set(grpc::InsecureChannelCredentials()) - .set(1); -} - -void CheckOptions(Options const& options) { - EXPECT_TRUE( - options.has()); - EXPECT_TRUE( - options.has()); - EXPECT_TRUE( - options.has()); - EXPECT_TRUE(options.has()); - EXPECT_TRUE(options.has()); - EXPECT_TRUE(options.has()); -} - -/// A fixture for the bigtable::InstanceAdmin tests. -class InstanceAdminTest : public ::testing::Test { - protected: - InstanceAdmin DefaultInstanceAdmin() { - EXPECT_CALL(*connection_, options()) - .WillRepeatedly(Return(Options{}.set(1))); - return InstanceAdmin(connection_, kProjectId); - } - - std::shared_ptr connection_ = - std::make_shared(); -}; - -TEST_F(InstanceAdminTest, Project) { - InstanceAdmin tested(MakeInstanceAdminClient(kProjectId, TestOptions())); - EXPECT_EQ(kProjectId, tested.project_id()); - EXPECT_EQ(kProjectName, tested.project_name()); -} - -TEST_F(InstanceAdminTest, CopyConstructor) { - auto source = InstanceAdmin(connection_, kProjectId); - std::string const& expected = source.project_id(); - // NOLINTNEXTLINE(performance-unnecessary-copy-initialization) - InstanceAdmin copy(source); - EXPECT_EQ(expected, copy.project_id()); -} - -TEST_F(InstanceAdminTest, MoveConstructor) { - auto source = InstanceAdmin(connection_, kProjectId); - std::string expected = source.project_id(); - InstanceAdmin copy(std::move(source)); - EXPECT_EQ(expected, copy.project_id()); -} - -TEST_F(InstanceAdminTest, CopyAssignment) { - std::shared_ptr other_client = - std::make_shared(); - - auto source = InstanceAdmin(connection_, kProjectId); - std::string const& expected = source.project_id(); - auto dest = InstanceAdmin(other_client, "other-project"); - EXPECT_NE(expected, dest.project_id()); - dest = source; - EXPECT_EQ(expected, dest.project_id()); -} - -TEST_F(InstanceAdminTest, MoveAssignment) { - std::shared_ptr other_client = - std::make_shared(); - - auto source = InstanceAdmin(connection_, kProjectId); - std::string expected = source.project_id(); - auto dest = InstanceAdmin(other_client, "other-project"); - EXPECT_NE(expected, dest.project_id()); - dest = std::move(source); - EXPECT_EQ(expected, dest.project_id()); -} - -TEST_F(InstanceAdminTest, WithNewTarget) { - auto admin = InstanceAdmin(connection_, kProjectId); - auto other_admin = admin.WithNewTarget("other-project"); - EXPECT_EQ(other_admin.project_id(), "other-project"); - EXPECT_EQ(other_admin.project_name(), Project("other-project").FullName()); -} - -TEST_F(InstanceAdminTest, LegacyConstructorSharesConnection) { - auto admin_client = MakeInstanceAdminClient("test-project", TestOptions()); - auto admin_1 = InstanceAdmin(admin_client); - auto admin_2 = InstanceAdmin(admin_client); - auto conn_1 = InstanceAdminTester::Connection(admin_1); - auto conn_2 = InstanceAdminTester::Connection(admin_2); - - EXPECT_EQ(conn_1, conn_2); - EXPECT_THAT(conn_1, NotNull()); -} - -TEST_F(InstanceAdminTest, LegacyConstructorDefaultsPolicies) { - auto admin_client = MakeInstanceAdminClient("test-project", TestOptions()); - auto admin = InstanceAdmin(std::move(admin_client)); - auto options = InstanceAdminTester::Options(admin); - CheckOptions(options); -} - -TEST_F(InstanceAdminTest, LegacyConstructorWithPolicies) { - // In this test, we make a series of simple calls to verify that the policies - // passed to the `InstanceAdmin` constructor are actually collected as - // `Options`. - // - // Upon construction of an InstanceAdmin, each policy is cloned twice: Once - // while processing the variadic parameters, once while converting from - // Bigtable policies to common policies. This should explain the nested mocks - // below. - - auto mock_r = std::make_shared(); - auto mock_b = std::make_shared(); - auto mock_p = std::make_shared(); - - EXPECT_CALL(*mock_r, clone).WillOnce([] { - auto clone_1 = std::make_unique(); - EXPECT_CALL(*clone_1, clone).WillOnce([] { - auto clone_2 = std::make_unique(); - EXPECT_CALL(*clone_2, OnFailure(An())); - return clone_2; - }); - return clone_1; - }); - - EXPECT_CALL(*mock_b, clone).WillOnce([] { - auto clone_1 = std::make_unique(); - EXPECT_CALL(*clone_1, clone).WillOnce([] { - auto clone_2 = std::make_unique(); - EXPECT_CALL(*clone_2, OnCompletion(An())); - return clone_2; - }); - return clone_1; - }); - - EXPECT_CALL(*mock_p, clone).WillOnce([] { - auto clone_1 = std::make_unique(); - EXPECT_CALL(*clone_1, clone).WillOnce([] { - auto clone_2 = std::make_unique(); - EXPECT_CALL(*clone_2, WaitPeriod); - return clone_2; - }); - return clone_1; - }); - - auto admin_client = MakeInstanceAdminClient("test-project", TestOptions()); - auto admin = - InstanceAdmin(std::move(admin_client), *mock_r, *mock_b, *mock_p); - auto options = InstanceAdminTester::Options(admin); - CheckOptions(options); - - auto const& common_retry = - options.get(); - (void)common_retry->OnFailure({}); - - auto const& common_backoff = - options.get(); - (void)common_backoff->OnCompletion(); - - auto const& common_polling = - options.get(); - (void)common_polling->WaitPeriod(); -} - -TEST_F(InstanceAdminTest, ListInstancesSuccess) { - auto tested = DefaultInstanceAdmin(); - std::vector const expected_names = { - InstanceName(kProjectId, "i0"), InstanceName(kProjectId, "i1")}; - std::vector const expected_fails = {"l0", "l1"}; - - EXPECT_CALL(*connection_, ListInstances) - .WillOnce([&expected_names, &expected_fails]( - btadmin::ListInstancesRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kProjectName, request.parent()); - - btadmin::ListInstancesResponse response; - for (auto const& name : expected_names) { - auto& instance = *response.add_instances(); - instance.set_name(name); - } - for (auto const& loc : expected_fails) { - *response.add_failed_locations() = loc; - } - return make_status_or(response); - }); - - auto actual = tested.ListInstances(); - ASSERT_STATUS_OK(actual); - std::vector actual_names; - std::transform(actual->instances.begin(), actual->instances.end(), - std::back_inserter(actual_names), - [](btadmin::Instance const& i) { return i.name(); }); - - EXPECT_THAT(actual_names, ElementsAreArray(expected_names)); - EXPECT_THAT(actual->failed_locations, ElementsAreArray(expected_fails)); -} - -TEST_F(InstanceAdminTest, ListInstancesFailure) { - auto tested = DefaultInstanceAdmin(); - - EXPECT_CALL(*connection_, ListInstances).WillOnce(Return(FailingStatus())); - - EXPECT_THAT(tested.ListInstances(), StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(InstanceAdminTest, CreateInstance) { - auto tested = DefaultInstanceAdmin(); - auto constexpr kDisplayName = "display name"; - std::vector const expected_location_names = {LocationName("l0"), - LocationName("l1")}; - std::map cluster_map = { - {"c0", ClusterConfig("l0", 3, btadmin::HDD)}, - {"c1", ClusterConfig("l1", 3, btadmin::HDD)}}; - auto config = InstanceConfig(kInstanceId, kDisplayName, cluster_map); - - EXPECT_CALL(*connection_, - CreateInstance(An())) - .WillOnce([&](btadmin::CreateInstanceRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kInstanceId, request.instance_id()); - EXPECT_EQ(kProjectName, request.parent()); - EXPECT_EQ(kDisplayName, request.instance().display_name()); - std::vector actual_location_names; - for (auto&& c : request.clusters()) { - actual_location_names.emplace_back(c.second.location()); - } - EXPECT_THAT(actual_location_names, - UnorderedElementsAreArray(expected_location_names)); - return make_ready_future>(FailingStatus()); - }); - - EXPECT_THAT(tested.CreateInstance(config).get(), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(InstanceAdminTest, CreateCluster) { - auto tested = DefaultInstanceAdmin(); - auto const location_name = LocationName("the-location"); - auto config = ClusterConfig("the-location", 3, btadmin::HDD); - - EXPECT_CALL(*connection_, - CreateCluster(An())) - .WillOnce([&](btadmin::CreateClusterRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kClusterId, request.cluster_id()); - EXPECT_EQ(kInstanceName, request.parent()); - EXPECT_EQ(location_name, request.cluster().location()); - EXPECT_EQ(3, request.cluster().serve_nodes()); - EXPECT_EQ(btadmin::HDD, request.cluster().default_storage_type()); - return make_ready_future>(FailingStatus()); - }); - - EXPECT_THAT(tested.CreateCluster(config, kInstanceId, kClusterId).get(), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(InstanceAdminTest, UpdateInstance) { - auto tested = DefaultInstanceAdmin(); - auto constexpr kDisplayName = "updated display name"; - InstanceUpdateConfig config({}); - config.set_display_name(kDisplayName); - - EXPECT_CALL( - *connection_, - PartialUpdateInstance(An())) - .WillOnce([&](btadmin::PartialUpdateInstanceRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kDisplayName, request.instance().display_name()); - EXPECT_THAT(request.update_mask().paths(), Contains("display_name")); - return make_ready_future>(FailingStatus()); - }); - - EXPECT_THAT(tested.UpdateInstance(config).get(), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(InstanceAdminTest, GetInstance) { - auto tested = DefaultInstanceAdmin(); - - EXPECT_CALL(*connection_, GetInstance) - .WillOnce([&](btadmin::GetInstanceRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kInstanceName, request.name()); - return FailingStatus(); - }); - - EXPECT_THAT(tested.GetInstance(kInstanceId), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(InstanceAdminTest, DeleteInstance) { - auto tested = DefaultInstanceAdmin(); - - EXPECT_CALL(*connection_, DeleteInstance) - .WillOnce([&](btadmin::DeleteInstanceRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kInstanceName, request.name()); - return Status(); - }); - - EXPECT_STATUS_OK(tested.DeleteInstance(kInstanceId)); -} - -TEST_F(InstanceAdminTest, GetCluster) { - auto tested = DefaultInstanceAdmin(); - - EXPECT_CALL(*connection_, GetCluster) - .WillOnce([&](btadmin::GetClusterRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kClusterName, request.name()); - return FailingStatus(); - }); - - EXPECT_THAT(tested.GetCluster(kInstanceId, kClusterId), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(InstanceAdminTest, ListClustersSuccess) { - auto tested = DefaultInstanceAdmin(); - std::vector const expected_names = { - ClusterName(kProjectId, kInstanceId, "c0"), - ClusterName(kProjectId, kInstanceId, "c1")}; - std::vector const expected_fails = {"l0", "l1"}; - - EXPECT_CALL(*connection_, ListClusters) - .WillOnce([&](btadmin::ListClustersRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kInstanceName, request.parent()); - - btadmin::ListClustersResponse response; - for (auto const& name : expected_names) { - auto& cluster = *response.add_clusters(); - cluster.set_name(name); - } - for (auto const& loc : expected_fails) { - *response.add_failed_locations() = loc; - } - return make_status_or(response); - }); - - auto actual = tested.ListClusters(kInstanceId); - ASSERT_STATUS_OK(actual); - std::vector actual_names; - std::transform(actual->clusters.begin(), actual->clusters.end(), - std::back_inserter(actual_names), - [](btadmin::Cluster const& c) { return c.name(); }); - - EXPECT_THAT(actual_names, ElementsAreArray(expected_names)); - EXPECT_THAT(actual->failed_locations, ElementsAreArray(expected_fails)); -} - -TEST_F(InstanceAdminTest, ListClustersFailure) { - auto tested = DefaultInstanceAdmin(); - - EXPECT_CALL(*connection_, ListClusters) - .WillOnce([&](btadmin::ListClustersRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - // Verify that calling `ListClusters` with no arguments sets the - // instance-id to "-" - auto const instance_name = InstanceName(kProjectId, "-"); - EXPECT_EQ(instance_name, request.parent()); - return FailingStatus(); - }); - - EXPECT_THAT(tested.ListClusters(), StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(InstanceAdminTest, UpdateCluster) { - auto tested = DefaultInstanceAdmin(); - auto const location_name = LocationName("the-location"); - btadmin::Cluster c; - c.set_name(kClusterName); - c.set_location(location_name); - c.set_serve_nodes(3); - c.set_default_storage_type(btadmin::HDD); - auto config = ClusterConfig(std::move(c)); - - EXPECT_CALL(*connection_, UpdateCluster(An())) - .WillOnce([&](btadmin::Cluster const& cluster) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kClusterName, cluster.name()); - EXPECT_EQ(location_name, cluster.location()); - EXPECT_EQ(3, cluster.serve_nodes()); - EXPECT_EQ(btadmin::HDD, cluster.default_storage_type()); - return make_ready_future>(FailingStatus()); - }); - - EXPECT_THAT(tested.UpdateCluster(config).get(), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(InstanceAdminTest, DeleteCluster) { - auto tested = DefaultInstanceAdmin(); - - EXPECT_CALL(*connection_, DeleteCluster) - .WillOnce([&](btadmin::DeleteClusterRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kClusterName, request.name()); - return Status(); - }); - - EXPECT_STATUS_OK(tested.DeleteCluster(kInstanceId, kClusterId)); -} - -TEST_F(InstanceAdminTest, CreateAppProfile) { - auto tested = DefaultInstanceAdmin(); - auto config = AppProfileConfig::MultiClusterUseAny(kProfileId); - - EXPECT_CALL(*connection_, CreateAppProfile) - .WillOnce([&](btadmin::CreateAppProfileRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kProfileId, request.app_profile_id()); - EXPECT_EQ(kInstanceName, request.parent()); - return FailingStatus(); - }); - - EXPECT_THAT(tested.CreateAppProfile(kInstanceId, config), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(InstanceAdminTest, GetAppProfile) { - auto tested = DefaultInstanceAdmin(); - - EXPECT_CALL(*connection_, GetAppProfile) - .WillOnce([&](btadmin::GetAppProfileRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kProfileName, request.name()); - return FailingStatus(); - }); - - EXPECT_THAT(tested.GetAppProfile(kInstanceId, kProfileId), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(InstanceAdminTest, UpdateAppProfile) { - auto tested = DefaultInstanceAdmin(); - auto constexpr kDescription = "description"; - auto config = AppProfileUpdateConfig().set_description(kDescription); - - EXPECT_CALL(*connection_, - UpdateAppProfile(An())) - .WillOnce([&](btadmin::UpdateAppProfileRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kProfileName, request.app_profile().name()); - EXPECT_EQ(kDescription, request.app_profile().description()); - return make_ready_future>( - FailingStatus()); - }); - - EXPECT_THAT(tested.UpdateAppProfile(kInstanceId, kProfileId, config).get(), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(InstanceAdminTest, ListAppProfilesSuccess) { - auto tested = DefaultInstanceAdmin(); - std::vector const expected_names = { - AppProfileName(kProjectId, kInstanceId, "p0"), - AppProfileName(kProjectId, kInstanceId, "p1")}; - - auto iter = expected_names.begin(); - EXPECT_CALL(*connection_, ListAppProfiles) - .WillOnce([&iter, &expected_names]( - btadmin::ListAppProfilesRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kInstanceName, request.parent()); - - using ::google::cloud::internal::MakeStreamRange; - using ::google::cloud::internal::StreamReader; - auto reader = [&iter, &expected_names]() - -> StreamReader::result_type { - if (iter != expected_names.end()) { - btadmin::AppProfile p; - p.set_name(*iter); - ++iter; - return p; - } - return Status(); - }; - return MakeStreamRange(std::move(reader)); - }); - - auto profiles = tested.ListAppProfiles(kInstanceId); - ASSERT_STATUS_OK(profiles); - std::vector names; - std::transform(profiles->begin(), profiles->end(), std::back_inserter(names), - [](btadmin::AppProfile const& p) { return p.name(); }); - - EXPECT_THAT(names, ElementsAreArray(expected_names)); -} - -TEST_F(InstanceAdminTest, ListAppProfilesFailure) { - auto tested = DefaultInstanceAdmin(); - - EXPECT_CALL(*connection_, ListAppProfiles) - .WillOnce([&](btadmin::ListAppProfilesRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kInstanceName, request.parent()); - - using ::google::cloud::internal::MakeStreamRange; - return MakeStreamRange( - [] { return FailingStatus(); }); - }); - - EXPECT_THAT(tested.ListAppProfiles(kInstanceId), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(InstanceAdminTest, DeleteAppProfile) { - auto tested = DefaultInstanceAdmin(); - - EXPECT_CALL(*connection_, DeleteAppProfile) - .WillOnce([&](btadmin::DeleteAppProfileRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kProfileName, request.name()); - EXPECT_EQ(true, request.ignore_warnings()); - return Status(); - }); - - EXPECT_STATUS_OK(tested.DeleteAppProfile(kInstanceId, kProfileId, true)); -} - -TEST_F(InstanceAdminTest, GetNativeIamPolicy) { - auto tested = DefaultInstanceAdmin(); - - EXPECT_CALL(*connection_, GetIamPolicy) - .WillOnce([&](iamproto::GetIamPolicyRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kInstanceName, request.resource()); - return FailingStatus(); - }); - - EXPECT_THAT(tested.GetNativeIamPolicy(kInstanceId), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(InstanceAdminTest, SetNativeIamPolicy) { - auto tested = DefaultInstanceAdmin(); - iamproto::Policy policy; - policy.set_etag("tag"); - policy.set_version(3); - - EXPECT_CALL(*connection_, SetIamPolicy) - .WillOnce([&](iamproto::SetIamPolicyRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kInstanceName, request.resource()); - EXPECT_EQ("tag", request.policy().etag()); - EXPECT_EQ(3, request.policy().version()); - return FailingStatus(); - }); - - EXPECT_THAT(tested.SetIamPolicy(kInstanceId, policy), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(InstanceAdminTest, TestIamPermissionsSuccess) { - auto tested = DefaultInstanceAdmin(); - std::vector const expected_permissions = {"writer", "reader"}; - std::vector const returned_permissions = {"reader"}; - - EXPECT_CALL(*connection_, TestIamPermissions) - .WillOnce([&](iamproto::TestIamPermissionsRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kInstanceName, request.resource()); - std::vector actual_permissions; - for (auto const& c : request.permissions()) { - actual_permissions.emplace_back(c); - } - EXPECT_THAT(actual_permissions, - UnorderedElementsAreArray(expected_permissions)); - - iamproto::TestIamPermissionsResponse r; - for (auto const& p : returned_permissions) r.add_permissions(p); - return r; - }); - - auto resp = tested.TestIamPermissions(kInstanceId, expected_permissions); - ASSERT_STATUS_OK(resp); - EXPECT_THAT(*resp, ElementsAreArray(returned_permissions)); -} - -TEST_F(InstanceAdminTest, TestIamPermissionsFailure) { - auto tested = DefaultInstanceAdmin(); - std::vector const expected_permissions = {"writer", "reader"}; - - EXPECT_CALL(*connection_, TestIamPermissions) - .WillOnce([&](iamproto::TestIamPermissionsRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kInstanceName, request.resource()); - std::vector actual_permissions; - for (auto const& c : request.permissions()) { - actual_permissions.emplace_back(c); - } - EXPECT_THAT(actual_permissions, - UnorderedElementsAreArray(expected_permissions)); - return FailingStatus(); - }); - - EXPECT_THAT(tested.TestIamPermissions(kInstanceId, expected_permissions), - StatusIs(StatusCode::kPermissionDenied)); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/instance_config.h b/google/cloud/bigtable/instance_config.h index bf108661cd3d4..c564067e8c4e3 100644 --- a/google/cloud/bigtable/instance_config.h +++ b/google/cloud/bigtable/instance_config.h @@ -17,8 +17,8 @@ #include "google/cloud/bigtable/cluster_config.h" #include "google/cloud/bigtable/version.h" -#include -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.pb.h" +#include "google/bigtable/admin/v2/common.pb.h" #include #include diff --git a/google/cloud/bigtable/instance_list_responses.h b/google/cloud/bigtable/instance_list_responses.h index 3f098603de276..f06a3d1b3350d 100644 --- a/google/cloud/bigtable/instance_list_responses.h +++ b/google/cloud/bigtable/instance_list_responses.h @@ -16,7 +16,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INSTANCE_LIST_RESPONSES_H #include "google/cloud/bigtable/version.h" -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.pb.h" #include #include diff --git a/google/cloud/bigtable/instance_update_config.h b/google/cloud/bigtable/instance_update_config.h index 9bcc5f9f22cda..35fbac87b060c 100644 --- a/google/cloud/bigtable/instance_update_config.h +++ b/google/cloud/bigtable/instance_update_config.h @@ -18,8 +18,8 @@ #include "google/cloud/bigtable/cluster_config.h" #include "google/cloud/bigtable/version.h" #include "google/cloud/internal/algorithm.h" -#include -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.pb.h" +#include "google/bigtable/admin/v2/common.pb.h" #include #include diff --git a/google/cloud/bigtable/internal/async_bulk_apply.cc b/google/cloud/bigtable/internal/async_bulk_apply.cc index e19c3a0ffddfb..1039aa862b30b 100644 --- a/google/cloud/bigtable/internal/async_bulk_apply.cc +++ b/google/cloud/bigtable/internal/async_bulk_apply.cc @@ -14,6 +14,7 @@ #include "google/cloud/bigtable/internal/async_bulk_apply.h" #include "google/cloud/bigtable/internal/async_streaming_read.h" +#include "google/cloud/grpc_options.h" #include "google/cloud/internal/grpc_opentelemetry.h" #include "google/cloud/internal/retry_loop_helpers.h" diff --git a/google/cloud/bigtable/internal/async_bulk_apply_test.cc b/google/cloud/bigtable/internal/async_bulk_apply_test.cc index d8304717c466b..f860d202df592 100644 --- a/google/cloud/bigtable/internal/async_bulk_apply_test.cc +++ b/google/cloud/bigtable/internal/async_bulk_apply_test.cc @@ -16,6 +16,7 @@ #include "google/cloud/bigtable/internal/operation_context.h" #include "google/cloud/bigtable/testing/mock_bigtable_stub.h" #include "google/cloud/bigtable/testing/mock_mutate_rows_limiter.h" +#include "google/cloud/grpc_options.h" #include "google/cloud/internal/async_streaming_read_rpc_impl.h" #include "google/cloud/internal/background_threads_impl.h" #ifdef GOOGLE_CLOUD_CPP_BIGTABLE_WITH_OTEL_METRICS @@ -1119,7 +1120,6 @@ TEST_F(AsyncBulkApplyTest, BigtableCookie) { CheckFailedMutations(actual.get(), expected); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::IsActive; using ::google::cloud::testing_util::SpanNamed; @@ -1191,7 +1191,6 @@ TEST_F(AsyncBulkApplyTest, CallSpanActiveThroughout) { auto overlay = opentelemetry::trace::Scope(internal::MakeSpan("overlay")); (void)f.get(); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/bigtable/internal/async_row_reader_test.cc b/google/cloud/bigtable/internal/async_row_reader_test.cc index 41dfec788c604..b742726626875 100644 --- a/google/cloud/bigtable/internal/async_row_reader_test.cc +++ b/google/cloud/bigtable/internal/async_row_reader_test.cc @@ -1733,7 +1733,6 @@ TEST_F(AsyncRowReaderTest, BigtableCookie) { std::make_shared()); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::IsActive; using ::google::cloud::testing_util::SpanNamed; @@ -1811,7 +1810,6 @@ TEST_F(AsyncRowReaderTest, CallSpanActiveThroughout) { // Block until the async call has completed. p.get_future().get(); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal diff --git a/google/cloud/bigtable/internal/async_row_sampler_test.cc b/google/cloud/bigtable/internal/async_row_sampler_test.cc index 5a88ade0c8f84..8593f32811c88 100644 --- a/google/cloud/bigtable/internal/async_row_sampler_test.cc +++ b/google/cloud/bigtable/internal/async_row_sampler_test.cc @@ -772,7 +772,6 @@ TEST_F(AsyncSampleRowKeysTest, BigtableCookie) { EXPECT_THAT(sor, StatusIs(StatusCode::kPermissionDenied, HasSubstr("fail"))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::IsActive; using ::google::cloud::testing_util::SpanNamed; @@ -838,7 +837,6 @@ TEST_F(AsyncSampleRowKeysTest, CallSpanActiveThroughout) { auto overlay = opentelemetry::trace::Scope(internal::MakeSpan("overlay")); (void)f.get(); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/bigtable/internal/bigtable_auth_decorator.cc b/google/cloud/bigtable/internal/bigtable_auth_decorator.cc index f81eb363768b5..75619c26258a6 100644 --- a/google/cloud/bigtable/internal/bigtable_auth_decorator.cc +++ b/google/cloud/bigtable/internal/bigtable_auth_decorator.cc @@ -18,10 +18,13 @@ #include "google/cloud/bigtable/internal/bigtable_auth_decorator.h" #include "google/cloud/internal/async_streaming_read_rpc_auth.h" -#include +#include "google/bigtable/v2/bigtable.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_internal { @@ -221,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, @@ -267,3 +291,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/internal/bigtable_auth_decorator.h b/google/cloud/bigtable/internal/bigtable_auth_decorator.h index 5b62a0e90630c..6118e588383e9 100644 --- a/google/cloud/bigtable/internal/bigtable_auth_decorator.h +++ b/google/cloud/bigtable/internal/bigtable_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_internal { @@ -117,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, @@ -141,4 +150,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_AUTH_DECORATOR_H 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 a5fe8ed5a200e..07523e4b92c84 100644 --- a/google/cloud/bigtable/internal/bigtable_logging_decorator.cc +++ b/google/cloud/bigtable/internal/bigtable_logging_decorator.cc @@ -21,12 +21,15 @@ #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/internal/streaming_read_rpc_logging.h" #include "google/cloud/status_or.h" -#include +#include "google/bigtable/v2/bigtable.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_internal { @@ -301,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, @@ -341,3 +362,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/internal/bigtable_logging_decorator.h b/google/cloud/bigtable/internal/bigtable_logging_decorator.h index 839c0016bed17..5f5cf619a142d 100644 --- a/google/cloud/bigtable/internal/bigtable_logging_decorator.h +++ b/google/cloud/bigtable/internal/bigtable_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_internal { @@ -117,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, @@ -142,4 +151,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_LOGGING_DECORATOR_H diff --git a/google/cloud/bigtable/internal/bigtable_metadata_decorator.cc b/google/cloud/bigtable/internal/bigtable_metadata_decorator.cc index 7736c6a92462c..acc434bc39dc0 100644 --- a/google/cloud/bigtable/internal/bigtable_metadata_decorator.cc +++ b/google/cloud/bigtable/internal/bigtable_metadata_decorator.cc @@ -18,18 +18,21 @@ #include "google/cloud/bigtable/internal/bigtable_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/routing_matcher.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/bigtable/v2/bigtable.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_internal { @@ -655,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, @@ -750,3 +789,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/internal/bigtable_metadata_decorator.h b/google/cloud/bigtable/internal/bigtable_metadata_decorator.h index 259e966033309..70cf99b4a72e6 100644 --- a/google/cloud/bigtable/internal/bigtable_metadata_decorator.h +++ b/google/cloud/bigtable/internal/bigtable_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_internal { @@ -117,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, @@ -146,4 +155,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_METADATA_DECORATOR_H 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 24e062f92f9b7..00149b2b4d04d 100644 --- a/google/cloud/bigtable/internal/bigtable_round_robin_decorator.cc +++ b/google/cloud/bigtable/internal/bigtable_round_robin_decorator.cc @@ -21,6 +21,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_internal { @@ -149,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, @@ -181,3 +194,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/internal/bigtable_round_robin_decorator.h b/google/cloud/bigtable/internal/bigtable_round_robin_decorator.h index 0b54dbb130d97..5d434d139c51b 100644 --- a/google/cloud/bigtable/internal/bigtable_round_robin_decorator.h +++ b/google/cloud/bigtable/internal/bigtable_round_robin_decorator.h @@ -25,6 +25,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_internal { @@ -115,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, @@ -142,4 +151,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_ROUND_ROBIN_DECORATOR_H diff --git a/google/cloud/bigtable/internal/bigtable_stub.cc b/google/cloud/bigtable/internal/bigtable_stub.cc index cb00ccb83ffe8..f86035de2de67 100644 --- a/google/cloud/bigtable/internal/bigtable_stub.cc +++ b/google/cloud/bigtable/internal/bigtable_stub.cc @@ -20,10 +20,13 @@ #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/internal/async_streaming_read_rpc_impl.h" #include "google/cloud/status_or.h" -#include +#include "google/bigtable/v2/bigtable.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_internal { @@ -226,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, @@ -267,3 +288,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/internal/bigtable_stub.h b/google/cloud/bigtable/internal/bigtable_stub.h index d9bc25f175d05..3c101f57e4900 100644 --- a/google/cloud/bigtable/internal/bigtable_stub.h +++ b/google/cloud/bigtable/internal/bigtable_stub.h @@ -26,10 +26,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/bigtable/v2/bigtable.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_internal { @@ -119,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, @@ -219,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, @@ -242,4 +257,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_STUB_H diff --git a/google/cloud/bigtable/internal/bigtable_stub_factory.cc b/google/cloud/bigtable/internal/bigtable_stub_factory.cc index 9d5add4a61c44..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" @@ -29,7 +30,7 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/log.h" -#include +#include "google/bigtable/v2/feature_flags.pb.h" #include namespace google { @@ -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 d7b07d00cc171..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 @@ -264,7 +317,6 @@ TEST(BigtableStubFactory, FeaturesFlags) { (void)stub->MutateRow(context, Options{}, {}); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanNamed; @@ -335,7 +387,35 @@ TEST(BigtableStubFactory, TracingDisabled) { EXPECT_THAT(span_catcher->GetSpans(), IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +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 diff --git a/google/cloud/bigtable/internal/bigtable_tracing_stub.cc b/google/cloud/bigtable/internal/bigtable_tracing_stub.cc index 2150cb22880ae..80621c5222b38 100644 --- a/google/cloud/bigtable/internal/bigtable_tracing_stub.cc +++ b/google/cloud/bigtable/internal/bigtable_tracing_stub.cc @@ -23,13 +23,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BigtableTracingStub::BigtableTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -233,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, @@ -262,18 +277,14 @@ BigtableTracingStub::AsyncPrepareQuery( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBigtableTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/bigtable/internal/bigtable_tracing_stub.h b/google/cloud/bigtable/internal/bigtable_tracing_stub.h index d006b380ca250..c269361225ecb 100644 --- a/google/cloud/bigtable/internal/bigtable_tracing_stub.h +++ b/google/cloud/bigtable/internal/bigtable_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace bigtable_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BigtableTracingStub : public BigtableStub { public: ~BigtableTracingStub() override = default; @@ -117,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, @@ -137,8 +144,6 @@ class BigtableTracingStub : public BigtableStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -153,4 +158,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_TRACING_STUB_H diff --git a/google/cloud/bigtable/internal/bulk_mutator.cc b/google/cloud/bigtable/internal/bulk_mutator.cc index 7203d23fbd14d..fad9d4342563a 100644 --- a/google/cloud/bigtable/internal/bulk_mutator.cc +++ b/google/cloud/bigtable/internal/bulk_mutator.cc @@ -15,6 +15,7 @@ #include "google/cloud/bigtable/internal/bulk_mutator.h" #include "google/cloud/bigtable/rpc_retry_policy.h" #include "google/cloud/bigtable/table.h" +#include "google/cloud/grpc_options.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/log.h" #include @@ -195,22 +196,6 @@ BulkMutator::BulkMutator(std::string const& app_profile_id, : state_(app_profile_id, table_name, idempotent_policy, std::move(mut)), operation_context_(std::move(operation_context)) {} -grpc::Status BulkMutator::MakeOneRequest(bigtable::DataClient& client, - grpc::ClientContext& client_context) { - // Send the request to the server. - auto const& mutations = state_.BeforeStart(); - auto stream = client.MutateRows(&client_context, mutations); - // Read the stream of responses. - btproto::MutateRowsResponse response; - while (stream->Read(&response)) { - state_.OnRead(std::move(response)); - } - // Handle any errors in the stream. - auto grpc_status = stream->Finish(); - state_.OnFinish(MakeStatusFromRpcError(grpc_status)); - return grpc_status; -} - Status BulkMutator::MakeOneRequest(BigtableStub& stub, MutateRowsLimiter& limiter, Options const& options) { diff --git a/google/cloud/bigtable/internal/bulk_mutator.h b/google/cloud/bigtable/internal/bulk_mutator.h index bd543dc6f0ccc..922c9caeab426 100644 --- a/google/cloud/bigtable/internal/bulk_mutator.h +++ b/google/cloud/bigtable/internal/bulk_mutator.h @@ -16,12 +16,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BULK_MUTATOR_H #include "google/cloud/bigtable/completion_queue.h" -#include "google/cloud/bigtable/data_client.h" #include "google/cloud/bigtable/idempotent_mutation_policy.h" #include "google/cloud/bigtable/internal/bigtable_stub.h" #include "google/cloud/bigtable/internal/mutate_rows_limiter.h" #include "google/cloud/bigtable/internal/operation_context.h" #include "google/cloud/bigtable/version.h" +#include "google/cloud/idempotency.h" #include "google/cloud/internal/invoke_result.h" #include "google/cloud/status.h" #include @@ -89,7 +89,7 @@ class BulkMutatorState { * request provided by the application. */ int original_index; - Idempotency idempotency; + google::cloud::Idempotency idempotency; /// Set to `false` if the result is unknown. bool has_mutation_result; /** @@ -123,10 +123,6 @@ class BulkMutator { /// Return true if there are pending mutations in the mutator bool HasPendingMutations() const { return state_.HasPendingMutations(); } - /// Synchronously send one batch request to the given stub. - grpc::Status MakeOneRequest(bigtable::DataClient& client, - grpc::ClientContext& client_context); - /// Synchronously send one batch request to the given stub. Status MakeOneRequest(BigtableStub& stub, MutateRowsLimiter& limiter, Options const& options); diff --git a/google/cloud/bigtable/internal/bulk_mutator_test.cc b/google/cloud/bigtable/internal/bulk_mutator_test.cc index 7724da5f21501..e7bf9f7433e9d 100644 --- a/google/cloud/bigtable/internal/bulk_mutator_test.cc +++ b/google/cloud/bigtable/internal/bulk_mutator_test.cc @@ -14,6 +14,7 @@ #include "google/cloud/bigtable/internal/bulk_mutator.h" #include "google/cloud/bigtable/internal/operation_context.h" +#include "google/cloud/grpc_options.h" #ifdef GOOGLE_CLOUD_CPP_BIGTABLE_WITH_OTEL_METRICS #include "google/cloud/bigtable/internal/metrics.h" #include "google/cloud/testing_util/fake_clock.h" 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/crc32c.cc b/google/cloud/bigtable/internal/crc32c.cc index 3210fdbefafdd..572c031e69f0c 100644 --- a/google/cloud/bigtable/internal/crc32c.cc +++ b/google/cloud/bigtable/internal/crc32c.cc @@ -14,13 +14,7 @@ #include "google/cloud/bigtable/internal/crc32c.h" #include "absl/base/config.h" -#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION >= 20230125 #include "absl/crc/crc32c.h" -#define GOOGLE_CLOUD_CPP_USE_ABSL_CRC32C 1 -#else -#define GOOGLE_CLOUD_CPP_USE_ABSL_CRC32C 0 -#endif // ABSL_LTS_RELEASE_VERSION -#include namespace google { namespace cloud { @@ -28,8 +22,8 @@ namespace bigtable_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::string_view data) { - return crc32c::Extend(crc, reinterpret_cast(data.data()), - data.size()); + return static_cast( + absl::ExtendCrc32c(absl::crc32c_t{crc}, data)); } std::uint32_t ExtendCrc32c(std::uint32_t crc, @@ -47,8 +41,6 @@ std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::Cord const& data) { return crc; } -#if GOOGLE_CLOUD_CPP_USE_ABSL_CRC32C - std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::string_view data, std::uint32_t data_crc) { return static_cast(absl::ConcatCrc32c( @@ -69,26 +61,6 @@ std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::Cord const& data, absl::crc32c_t{crc}, absl::crc32c_t{data_crc}, data.size())); } -#else - -std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::string_view data, - std::uint32_t /*data_crc*/) { - return ExtendCrc32c(crc, data); -} - -std::uint32_t ExtendCrc32c(std::uint32_t crc, - bigtable_internal::ConstBufferSequence const& data, - std::uint32_t /*data_crc*/) { - return ExtendCrc32c(crc, data); -} - -std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::Cord const& data, - std::uint32_t /*data_crc*/) { - return ExtendCrc32c(crc, data); -} - -#endif // GOOGLE_CLOUD_CPP_USE_ABSL_CRC32C - 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/data_tracing_connection.cc b/google/cloud/bigtable/internal/data_tracing_connection.cc index e7c4942135b62..d97f825eb4fde 100644 --- a/google/cloud/bigtable/internal/data_tracing_connection.cc +++ b/google/cloud/bigtable/internal/data_tracing_connection.cc @@ -21,7 +21,6 @@ namespace cloud { namespace bigtable_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace { std::vector EndBulkApplySpan( @@ -215,15 +214,6 @@ std::shared_ptr MakeDataTracingConnection( return std::make_shared(std::move(conn)); } -#else - -std::shared_ptr MakeDataTracingConnection( - std::shared_ptr conn) { - return conn; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal } // namespace cloud diff --git a/google/cloud/bigtable/internal/data_tracing_connection_test.cc b/google/cloud/bigtable/internal/data_tracing_connection_test.cc index 5e9fadf777fc6..d60ef219b1a07 100644 --- a/google/cloud/bigtable/internal/data_tracing_connection_test.cc +++ b/google/cloud/bigtable/internal/data_tracing_connection_test.cc @@ -26,7 +26,6 @@ namespace bigtable_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::bigtable_mocks::MockDataConnection; using ::google::cloud::testing_util::InstallSpanCatcher; using ::google::cloud::testing_util::IsOkAndHolds; @@ -641,7 +640,6 @@ TEST(DataTracingConnection, AsyncReadRowFailure) { Not(SpanHasAttributes( OTelAttribute("gcloud.bigtable.row_found", _)))))); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/bigtable/internal/default_row_reader.cc b/google/cloud/bigtable/internal/default_row_reader.cc index 844bdace38dd2..7cb45dad72e67 100644 --- a/google/cloud/bigtable/internal/default_row_reader.cc +++ b/google/cloud/bigtable/internal/default_row_reader.cc @@ -15,6 +15,7 @@ #include "google/cloud/bigtable/internal/default_row_reader.h" #include "google/cloud/bigtable/table.h" #include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/grpc_options.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/retry_loop_helpers.h" diff --git a/google/cloud/bigtable/internal/default_row_reader.h b/google/cloud/bigtable/internal/default_row_reader.h index b0d48c8add3bd..5f83e9e4aebd5 100644 --- a/google/cloud/bigtable/internal/default_row_reader.h +++ b/google/cloud/bigtable/internal/default_row_reader.h @@ -20,7 +20,6 @@ #include "google/cloud/bigtable/internal/operation_context.h" #include "google/cloud/bigtable/internal/readrowsparser.h" #include "google/cloud/bigtable/internal/row_reader_impl.h" -#include "google/cloud/bigtable/metadata_update_policy.h" #include "google/cloud/bigtable/options.h" #include "google/cloud/bigtable/row.h" #include "google/cloud/bigtable/row_set.h" diff --git a/google/cloud/bigtable/internal/default_row_reader_test.cc b/google/cloud/bigtable/internal/default_row_reader_test.cc index bcbd97dfc077e..9c282ad0660cf 100644 --- a/google/cloud/bigtable/internal/default_row_reader_test.cc +++ b/google/cloud/bigtable/internal/default_row_reader_test.cc @@ -16,6 +16,7 @@ #include "google/cloud/bigtable/row_reader.h" #include "google/cloud/bigtable/testing/mock_bigtable_stub.h" #include "google/cloud/bigtable/testing/mock_policies.h" +#include "google/cloud/grpc_options.h" #include "google/cloud/internal/make_status.h" #ifdef GOOGLE_CLOUD_CPP_BIGTABLE_WITH_OTEL_METRICS #include "google/cloud/bigtable/internal/metrics.h" diff --git a/google/cloud/bigtable/internal/defaults.cc b/google/cloud/bigtable/internal/defaults.cc index c7c1cd041ea86..9544730158bda 100644 --- a/google/cloud/bigtable/internal/defaults.cc +++ b/google/cloud/bigtable/internal/defaults.cc @@ -126,20 +126,24 @@ int DefaultConnectionPoolSize() { } Options HandleUniverseDomain(Options opts) { - if (!opts.has()) { + if (!opts.has<::google::cloud::bigtable_internal::DataEndpointOption>()) { auto ep = google::cloud::internal::UniverseDomainEndpoint( "bigtable.googleapis.com", opts); - opts.set(std::move(ep)); + opts.set<::google::cloud::bigtable_internal::DataEndpointOption>( + std::move(ep)); } - if (!opts.has()) { + if (!opts.has<::google::cloud::bigtable_internal::AdminEndpointOption>()) { auto ep = google::cloud::internal::UniverseDomainEndpoint( "bigtableadmin.googleapis.com", opts); - opts.set(std::move(ep)); + opts.set<::google::cloud::bigtable_internal::AdminEndpointOption>( + std::move(ep)); } - if (!opts.has()) { + if (!opts.has< + ::google::cloud::bigtable_internal::InstanceAdminEndpointOption>()) { auto ep = google::cloud::internal::UniverseDomainEndpoint( "bigtableadmin.googleapis.com", opts); - opts.set(std::move(ep)); + opts.set<::google::cloud::bigtable_internal::InstanceAdminEndpointOption>( + std::move(ep)); } return opts; } @@ -153,14 +157,16 @@ Options DefaultOptions(Options opts) { if (opts.has()) { auto const& ep = opts.get(); - if (!opts.has()) { - opts.set(ep); + if (!opts.has<::google::cloud::bigtable_internal::DataEndpointOption>()) { + opts.set<::google::cloud::bigtable_internal::DataEndpointOption>(ep); } - if (!opts.has()) { - opts.set(ep); + if (!opts.has<::google::cloud::bigtable_internal::AdminEndpointOption>()) { + opts.set<::google::cloud::bigtable_internal::AdminEndpointOption>(ep); } - if (!opts.has()) { - opts.set(ep); + if (!opts.has<::google::cloud::bigtable_internal:: + InstanceAdminEndpointOption>()) { + opts.set<::google::cloud::bigtable_internal::InstanceAdminEndpointOption>( + ep); } } @@ -168,7 +174,7 @@ Options DefaultOptions(Options opts) { GetEnv("GOOGLE_CLOUD_ENABLE_DIRECT_PATH").value_or(""); if (absl::c_any_of(absl::StrSplit(direct_path, ','), [](absl::string_view v) { return v == "bigtable"; })) { - opts.set( + opts.set<::google::cloud::bigtable_internal::DataEndpointOption>( "google-c2p:///directpath-bigtable.googleapis.com") .set("directpath-bigtable.googleapis.com"); @@ -180,15 +186,18 @@ Options DefaultOptions(Options opts) { auto emulator = GetEnv("BIGTABLE_EMULATOR_HOST"); if (emulator) { - opts.set(*emulator); - opts.set(*emulator); - opts.set(*emulator); + opts.set<::google::cloud::bigtable_internal::DataEndpointOption>(*emulator); + opts.set<::google::cloud::bigtable_internal::AdminEndpointOption>( + *emulator); + opts.set<::google::cloud::bigtable_internal::InstanceAdminEndpointOption>( + *emulator); } auto instance_admin_emulator = GetEnv("BIGTABLE_INSTANCE_ADMIN_EMULATOR_HOST"); if (instance_admin_emulator) { - opts.set(*std::move(instance_admin_emulator)); + opts.set<::google::cloud::bigtable_internal::InstanceAdminEndpointOption>( + *std::move(instance_admin_emulator)); } // Handle `UniverseDomainOption`. Note that we have already addressed the @@ -285,17 +294,21 @@ Options DefaultDataOptions(Options opts) { "bigtable.googleapis.com", opts); opts.set(std::move(ep)); } - return opts.set(opts.get()); + return opts.set( + opts.get<::google::cloud::bigtable_internal::DataEndpointOption>()); } Options DefaultInstanceAdminOptions(Options opts) { opts = DefaultOptions(std::move(opts)); - return opts.set(opts.get()); + return opts.set( + opts.get< + ::google::cloud::bigtable_internal::InstanceAdminEndpointOption>()); } Options DefaultTableAdminOptions(Options opts) { opts = DefaultOptions(std::move(opts)); - return opts.set(opts.get()); + return opts.set( + opts.get<::google::cloud::bigtable_internal::AdminEndpointOption>()); } } // namespace internal diff --git a/google/cloud/bigtable/internal/defaults_test.cc b/google/cloud/bigtable/internal/defaults_test.cc index 19f666a323504..aa4e50948c53f 100644 --- a/google/cloud/bigtable/internal/defaults_test.cc +++ b/google/cloud/bigtable/internal/defaults_test.cc @@ -14,6 +14,7 @@ #include "google/cloud/bigtable/internal/defaults.h" #include "google/cloud/bigtable/internal/client_options_defaults.h" +#include "google/cloud/bigtable/internal/endpoint_options.h" #include "google/cloud/bigtable/options.h" #include "google/cloud/common_options.h" #include "google/cloud/grpc_options.h" @@ -53,10 +54,15 @@ TEST(OptionsTest, Defaults) { "BIGTABLE_INSTANCE_ADMIN_EMULATOR_HOST", absl::nullopt); auto opts = DefaultOptions(); - EXPECT_EQ("bigtable.googleapis.com", opts.get()); - EXPECT_EQ("bigtableadmin.googleapis.com", opts.get()); - EXPECT_EQ("bigtableadmin.googleapis.com", - opts.get()); + EXPECT_EQ("bigtable.googleapis.com", + opts.get<::google::cloud::bigtable_internal::DataEndpointOption>()); + EXPECT_EQ( + "bigtableadmin.googleapis.com", + opts.get<::google::cloud::bigtable_internal::AdminEndpointOption>()); + EXPECT_EQ( + "bigtableadmin.googleapis.com", + opts.get< + ::google::cloud::bigtable_internal::InstanceAdminEndpointOption>()); EXPECT_EQ(typeid(grpc::GoogleDefaultCredentials()), typeid(opts.get())); EXPECT_FALSE(opts.has()); @@ -94,9 +100,12 @@ TEST(OptionsTest, DefaultOptionsDoesNotOverride) { channel_args.SetString("test-key-1", "value-1"); auto opts = DefaultOptions( Options{} - .set("testdata.googleapis.com") - .set("testadmin.googleapis.com") - .set("testinstanceadmin.googleapis.com") + .set<::google::cloud::bigtable_internal::DataEndpointOption>( + "testdata.googleapis.com") + .set<::google::cloud::bigtable_internal::AdminEndpointOption>( + "testadmin.googleapis.com") + .set<::google::cloud::bigtable_internal::InstanceAdminEndpointOption>( + "testinstanceadmin.googleapis.com") .set(grpc::InsecureChannelCredentials()) .set( TracingOptions{}.SetOptions("single_line_mode=F")) @@ -107,10 +116,15 @@ TEST(OptionsTest, DefaultOptionsDoesNotOverride) { .set({{"test-key-2", "value-2"}}) .set({"test-prefix"})); - EXPECT_EQ("testdata.googleapis.com", opts.get()); - EXPECT_EQ("testadmin.googleapis.com", opts.get()); - EXPECT_EQ("testinstanceadmin.googleapis.com", - opts.get()); + EXPECT_EQ("testdata.googleapis.com", + opts.get<::google::cloud::bigtable_internal::DataEndpointOption>()); + EXPECT_EQ( + "testadmin.googleapis.com", + opts.get<::google::cloud::bigtable_internal::AdminEndpointOption>()); + EXPECT_EQ( + "testinstanceadmin.googleapis.com", + opts.get< + ::google::cloud::bigtable_internal::InstanceAdminEndpointOption>()); EXPECT_EQ(typeid(grpc::InsecureChannelCredentials()), typeid(opts.get())); EXPECT_FALSE(opts.get().single_line_mode()); @@ -134,29 +148,49 @@ TEST(OptionsTest, EndpointOptionSetsAll) { auto options = Options{}.set("endpoint-option"); options = DefaultOptions(std::move(options)); EXPECT_EQ("endpoint-option", options.get()); - EXPECT_EQ("endpoint-option", options.get()); - EXPECT_EQ("endpoint-option", options.get()); - EXPECT_EQ("endpoint-option", options.get()); + EXPECT_EQ( + "endpoint-option", + options.get<::google::cloud::bigtable_internal::DataEndpointOption>()); + EXPECT_EQ( + "endpoint-option", + options.get<::google::cloud::bigtable_internal::AdminEndpointOption>()); + EXPECT_EQ( + "endpoint-option", + options.get< + ::google::cloud::bigtable_internal::InstanceAdminEndpointOption>()); } TEST(OptionsTest, EndpointOptionOverridden) { - auto options = Options{} - .set("ignored") - .set("data") - .set("table-admin") - .set("instance-admin"); + auto options = + Options{} + .set("ignored") + .set<::google::cloud::bigtable_internal::DataEndpointOption>("data") + .set<::google::cloud::bigtable_internal::AdminEndpointOption>( + "table-admin") + .set<::google::cloud::bigtable_internal::InstanceAdminEndpointOption>( + "instance-admin"); options = DefaultOptions(std::move(options)); - EXPECT_EQ("data", options.get()); - EXPECT_EQ("table-admin", options.get()); - EXPECT_EQ("instance-admin", options.get()); + EXPECT_EQ( + "data", + options.get<::google::cloud::bigtable_internal::DataEndpointOption>()); + EXPECT_EQ( + "table-admin", + options.get<::google::cloud::bigtable_internal::AdminEndpointOption>()); + EXPECT_EQ( + "instance-admin", + options.get< + ::google::cloud::bigtable_internal::InstanceAdminEndpointOption>()); } TEST(OptionsTest, DefaultDataOptionsEndpoint) { auto options = Options{} - .set("data.googleapis.com") - .set("tableadmin.googleapis.com") - .set("instanceadmin.googleapis.com"); + .set<::google::cloud::bigtable_internal::DataEndpointOption>( + "data.googleapis.com") + .set<::google::cloud::bigtable_internal::AdminEndpointOption>( + "tableadmin.googleapis.com") + .set<::google::cloud::bigtable_internal::InstanceAdminEndpointOption>( + "instanceadmin.googleapis.com"); options = DefaultDataOptions(std::move(options)); EXPECT_EQ("data.googleapis.com", options.get()); @@ -168,9 +202,12 @@ TEST(OptionsTest, DefaultDataOptionsEndpoint) { TEST(OptionsTest, DefaultInstanceAdminOptions) { auto options = Options{} - .set("data.googleapis.com") - .set("tableadmin.googleapis.com") - .set("instanceadmin.googleapis.com"); + .set<::google::cloud::bigtable_internal::DataEndpointOption>( + "data.googleapis.com") + .set<::google::cloud::bigtable_internal::AdminEndpointOption>( + "tableadmin.googleapis.com") + .set<::google::cloud::bigtable_internal::InstanceAdminEndpointOption>( + "instanceadmin.googleapis.com"); options = DefaultInstanceAdminOptions(std::move(options)); EXPECT_EQ("instanceadmin.googleapis.com", options.get()); @@ -182,9 +219,12 @@ TEST(OptionsTest, DefaultInstanceAdminOptions) { TEST(OptionsTest, DefaultTableAdminOptions) { auto options = Options{} - .set("data.googleapis.com") - .set("tableadmin.googleapis.com") - .set("instanceadmin.googleapis.com"); + .set<::google::cloud::bigtable_internal::DataEndpointOption>( + "data.googleapis.com") + .set<::google::cloud::bigtable_internal::AdminEndpointOption>( + "tableadmin.googleapis.com") + .set<::google::cloud::bigtable_internal::InstanceAdminEndpointOption>( + "instanceadmin.googleapis.com"); options = DefaultTableAdminOptions(std::move(options)); EXPECT_EQ("tableadmin.googleapis.com", options.get()); @@ -285,9 +325,12 @@ TEST(OptionsTest, BigtableEndpointOptionsOverrideUniverseDomain) { auto options = Options{} .set("ud-option.net") - .set("data.googleapis.com") - .set("tableadmin.googleapis.com") - .set("instanceadmin.googleapis.com"); + .set<::google::cloud::bigtable_internal::DataEndpointOption>( + "data.googleapis.com") + .set<::google::cloud::bigtable_internal::AdminEndpointOption>( + "tableadmin.googleapis.com") + .set<::google::cloud::bigtable_internal::InstanceAdminEndpointOption>( + "instanceadmin.googleapis.com"); EXPECT_EQ(DefaultDataOptions(options).get(), "data.googleapis.com"); @@ -304,9 +347,11 @@ TEST(OptionsTest, BigtableEndpointEnvVarsOverrideUniverseDomain) { auto options = Options{} .set("ud-option.net") - .set("ignored-data.googleapis.com") - .set("ignored-tableadmin.googleapis.com") - .set( + .set<::google::cloud::bigtable_internal::DataEndpointOption>( + "ignored-data.googleapis.com") + .set<::google::cloud::bigtable_internal::AdminEndpointOption>( + "ignored-tableadmin.googleapis.com") + .set<::google::cloud::bigtable_internal::InstanceAdminEndpointOption>( "ignored-instanceadmin.googleapis.com") .set("ignored-endpoint.googleapis.com"); @@ -350,9 +395,15 @@ TEST(EndpointEnvTest, EmulatorEnvOnly) { ScopedEnvironment emulator("BIGTABLE_EMULATOR_HOST", "emulator-host:8000"); auto opts = DefaultOptions(); - EXPECT_EQ("emulator-host:8000", opts.get()); - EXPECT_EQ("emulator-host:8000", opts.get()); - EXPECT_EQ("emulator-host:8000", opts.get()); + EXPECT_EQ("emulator-host:8000", + opts.get<::google::cloud::bigtable_internal::DataEndpointOption>()); + EXPECT_EQ( + "emulator-host:8000", + opts.get<::google::cloud::bigtable_internal::AdminEndpointOption>()); + EXPECT_EQ( + "emulator-host:8000", + opts.get< + ::google::cloud::bigtable_internal::InstanceAdminEndpointOption>()); } TEST(EndpointEnvTest, InstanceEmulatorEnvOnly) { @@ -360,10 +411,15 @@ TEST(EndpointEnvTest, InstanceEmulatorEnvOnly) { "instance-emulator-host:9000"); auto opts = DefaultOptions(); - EXPECT_EQ("bigtable.googleapis.com", opts.get()); - EXPECT_EQ("bigtableadmin.googleapis.com", opts.get()); - EXPECT_EQ("instance-emulator-host:9000", - opts.get()); + EXPECT_EQ("bigtable.googleapis.com", + opts.get<::google::cloud::bigtable_internal::DataEndpointOption>()); + EXPECT_EQ( + "bigtableadmin.googleapis.com", + opts.get<::google::cloud::bigtable_internal::AdminEndpointOption>()); + EXPECT_EQ( + "instance-emulator-host:9000", + opts.get< + ::google::cloud::bigtable_internal::InstanceAdminEndpointOption>()); } TEST(EndpointEnvTest, InstanceEmulatorEnvOverridesOtherEnv) { @@ -372,10 +428,15 @@ TEST(EndpointEnvTest, InstanceEmulatorEnvOverridesOtherEnv) { "instance-emulator-host:9000"); auto opts = DefaultOptions(); - EXPECT_EQ("emulator-host:8000", opts.get()); - EXPECT_EQ("emulator-host:8000", opts.get()); - EXPECT_EQ("instance-emulator-host:9000", - opts.get()); + EXPECT_EQ("emulator-host:8000", + opts.get<::google::cloud::bigtable_internal::DataEndpointOption>()); + EXPECT_EQ( + "emulator-host:8000", + opts.get<::google::cloud::bigtable_internal::AdminEndpointOption>()); + EXPECT_EQ( + "instance-emulator-host:9000", + opts.get< + ::google::cloud::bigtable_internal::InstanceAdminEndpointOption>()); } TEST(EndpointEnvTest, EmulatorEnvOverridesUserOptions) { @@ -384,13 +445,22 @@ TEST(EndpointEnvTest, EmulatorEnvOverridesUserOptions) { auto opts = DefaultOptions( Options{} .set("ignored-any") - .set("ignored-data") - .set("ignored-admin") - .set("ignored-instance-admin")); - - EXPECT_EQ("emulator-host:8000", opts.get()); - EXPECT_EQ("emulator-host:8000", opts.get()); - EXPECT_EQ("emulator-host:8000", opts.get()); + .set<::google::cloud::bigtable_internal::DataEndpointOption>( + "ignored-data") + .set<::google::cloud::bigtable_internal::AdminEndpointOption>( + "ignored-admin") + .set<::google::cloud::bigtable_internal::InstanceAdminEndpointOption>( + "ignored-instance-admin")); + + EXPECT_EQ("emulator-host:8000", + opts.get<::google::cloud::bigtable_internal::DataEndpointOption>()); + EXPECT_EQ( + "emulator-host:8000", + opts.get<::google::cloud::bigtable_internal::AdminEndpointOption>()); + EXPECT_EQ( + "emulator-host:8000", + opts.get< + ::google::cloud::bigtable_internal::InstanceAdminEndpointOption>()); } TEST(EndpointEnvTest, InstanceEmulatorEnvOverridesUserOption) { @@ -400,10 +470,13 @@ TEST(EndpointEnvTest, InstanceEmulatorEnvOverridesUserOption) { auto opts = DefaultOptions( Options{} .set("ignored-any") - .set("ignored-instance-admin")); + .set<::google::cloud::bigtable_internal::InstanceAdminEndpointOption>( + "ignored-instance-admin")); - EXPECT_EQ("instance-emulator-host:9000", - opts.get()); + EXPECT_EQ( + "instance-emulator-host:9000", + opts.get< + ::google::cloud::bigtable_internal::InstanceAdminEndpointOption>()); } TEST(EndpointEnvTest, EmulatorEnvDefaultsToInsecureCredentials) { @@ -431,12 +504,16 @@ TEST(EndpointEnvTest, DirectPathEnabled) { auto opts = DefaultOptions(); EXPECT_EQ("google-c2p:///directpath-bigtable.googleapis.com", - opts.get()); + opts.get<::google::cloud::bigtable_internal::DataEndpointOption>()); EXPECT_EQ("directpath-bigtable.googleapis.com", opts.get()); // Admin endpoints are not affected. - EXPECT_EQ("bigtableadmin.googleapis.com", opts.get()); - EXPECT_EQ("bigtableadmin.googleapis.com", - opts.get()); + EXPECT_EQ( + "bigtableadmin.googleapis.com", + opts.get<::google::cloud::bigtable_internal::AdminEndpointOption>()); + EXPECT_EQ( + "bigtableadmin.googleapis.com", + opts.get< + ::google::cloud::bigtable_internal::InstanceAdminEndpointOption>()); EXPECT_EQ(1, opts.get()); } 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/endpoint_options.h b/google/cloud/bigtable/internal/endpoint_options.h new file mode 100644 index 0000000000000..58c1185263dff --- /dev/null +++ b/google/cloud/bigtable/internal/endpoint_options.h @@ -0,0 +1,58 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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_ENDPOINT_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_ENDPOINT_OPTIONS_H + +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace bigtable_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * The endpoint for data operations. + * + */ +struct DataEndpointOption { + using Type = std::string; +}; + +/** + * The endpoint for table admin operations. + * + */ +struct AdminEndpointOption { + using Type = std::string; +}; + +/** + * The endpoint for instance admin operations. + * + * In most scenarios this should have the same value as `AdminEndpointOption`. + * The most common exception is testing, where the emulator for instance admin + * operations may be different than the emulator for admin and data operations. + * */ +struct InstanceAdminEndpointOption { + using Type = std::string; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_ENDPOINT_OPTIONS_H diff --git a/google/cloud/bigtable/internal/legacy_async_bulk_apply.cc b/google/cloud/bigtable/internal/legacy_async_bulk_apply.cc deleted file mode 100644 index b4d2efa5da9a9..0000000000000 --- a/google/cloud/bigtable/internal/legacy_async_bulk_apply.cc +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/legacy_async_bulk_apply.h" - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { - -future> AsyncRetryBulkApply::Create( - CompletionQueue cq, std::unique_ptr rpc_retry_policy, - std::unique_ptr rpc_backoff_policy, - IdempotentMutationPolicy& idempotent_policy, - MetadataUpdatePolicy metadata_update_policy, - std::shared_ptr client, - std::string const& app_profile_id, std::string const& table_name, - BulkMutation mut) { - if (mut.empty()) return make_ready_future(std::vector{}); - - std::shared_ptr bulk_apply(new AsyncRetryBulkApply( - std::move(rpc_retry_policy), std::move(rpc_backoff_policy), - idempotent_policy, std::move(metadata_update_policy), std::move(client), - app_profile_id, table_name, std::move(mut))); - bulk_apply->StartIteration(std::move(cq)); - return bulk_apply->promise_.get_future(); -} - -AsyncRetryBulkApply::AsyncRetryBulkApply( - std::unique_ptr rpc_retry_policy, - std::unique_ptr rpc_backoff_policy, - IdempotentMutationPolicy& idempotent_policy, - MetadataUpdatePolicy metadata_update_policy, - std::shared_ptr client, - std::string const& app_profile_id, std::string const& table_name, - BulkMutation mut) - : rpc_retry_policy_(std::move(rpc_retry_policy)), - rpc_backoff_policy_(std::move(rpc_backoff_policy)), - metadata_update_policy_(std::move(metadata_update_policy)), - client_(std::move(client)), - state_(app_profile_id, table_name, idempotent_policy, std::move(mut)) {} - -void AsyncRetryBulkApply::StartIteration(CompletionQueue cq) { - auto context = std::make_unique(); - rpc_retry_policy_->Setup(*context); - rpc_backoff_policy_->Setup(*context); - metadata_update_policy_.Setup(*context); - auto& client = client_; - auto self = shared_from_this(); - cq.MakeStreamingReadRpc( - [client](grpc::ClientContext* context, - google::bigtable::v2::MutateRowsRequest const& request, - grpc::CompletionQueue* cq) { - return client->PrepareAsyncMutateRows(context, request, cq); - }, - state_.BeforeStart(), std::move(context), - [self, cq](google::bigtable::v2::MutateRowsResponse r) { - self->OnRead(std::move(r)); - return make_ready_future(true); - }, - [self, cq](Status const& s) { self->OnFinish(cq, s); }); -} - -void AsyncRetryBulkApply::OnRead( - google::bigtable::v2::MutateRowsResponse response) { - state_.OnRead(std::move(response)); -} - -void AsyncRetryBulkApply::OnFinish(CompletionQueue cq, Status const& status) { - state_.OnFinish(status); - if (!state_.HasPendingMutations() || !rpc_retry_policy_->OnFailure(status)) { - SetPromise(); - return; - } - - auto self = this->shared_from_this(); - cq.MakeRelativeTimer(rpc_backoff_policy_->OnCompletion(status)) - .then([self, cq](auto result) { - if (result.get()) { - self->StartIteration(std::move(cq)); - } else { - self->SetPromise(); - } - }); -} - -void AsyncRetryBulkApply::SetPromise() { - promise_.set_value(std::move(state_).OnRetryDone()); -} - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/internal/legacy_async_bulk_apply.h b/google/cloud/bigtable/internal/legacy_async_bulk_apply.h deleted file mode 100644 index f53802f5c50f1..0000000000000 --- a/google/cloud/bigtable/internal/legacy_async_bulk_apply.h +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_LEGACY_ASYNC_BULK_APPLY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_LEGACY_ASYNC_BULK_APPLY_H - -#include "google/cloud/bigtable/completion_queue.h" -#include "google/cloud/bigtable/data_client.h" -#include "google/cloud/bigtable/idempotent_mutation_policy.h" -#include "google/cloud/bigtable/internal/async_retry_op.h" -#include "google/cloud/bigtable/internal/bulk_mutator.h" -#include "google/cloud/bigtable/version.h" -#include "google/cloud/internal/invoke_result.h" -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { -/** - * Implement the retry loop for AsyncBulkApply. - * - * The retry loop for AsyncBulkApply() is fairly different from all the other - * retry loops: only those mutations that are idempotent and had a transient - * failure can be retried, and the result for each mutation arrives in a stream. - * This class implements that retry loop. - */ -class AsyncRetryBulkApply - : public std::enable_shared_from_this { - public: - static future> Create( - CompletionQueue cq, std::unique_ptr rpc_retry_policy, - std::unique_ptr rpc_backoff_policy, - IdempotentMutationPolicy& idempotent_policy, - MetadataUpdatePolicy metadata_update_policy, - std::shared_ptr client, - std::string const& app_profile_id, std::string const& table_name, - BulkMutation mut); - - private: - AsyncRetryBulkApply(std::unique_ptr rpc_retry_policy, - std::unique_ptr rpc_backoff_policy, - IdempotentMutationPolicy& idempotent_policy, - MetadataUpdatePolicy metadata_update_policy, - std::shared_ptr client, - std::string const& app_profile_id, - std::string const& table_name, BulkMutation mut); - - void StartIteration(CompletionQueue cq); - void OnRead(google::bigtable::v2::MutateRowsResponse response); - void OnFinish(CompletionQueue cq, google::cloud::Status const& status); - void SetPromise(); - - std::unique_ptr rpc_retry_policy_; - std::unique_ptr rpc_backoff_policy_; - MetadataUpdatePolicy metadata_update_policy_; - std::shared_ptr client_; - bigtable_internal::BulkMutatorState state_; - promise> promise_; -}; - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_LEGACY_ASYNC_BULK_APPLY_H diff --git a/google/cloud/bigtable/internal/legacy_async_bulk_apply_test.cc b/google/cloud/bigtable/internal/legacy_async_bulk_apply_test.cc deleted file mode 100644 index 9c2e21f730758..0000000000000 --- a/google/cloud/bigtable/internal/legacy_async_bulk_apply_test.cc +++ /dev/null @@ -1,522 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/legacy_async_bulk_apply.h" -#include "google/cloud/bigtable/testing/mock_mutate_rows_reader.h" -#include "google/cloud/bigtable/testing/mock_policies.h" -#include "google/cloud/bigtable/testing/table_test_fixture.h" -#include "google/cloud/future.h" -#include "google/cloud/internal/api_client_header.h" -#include "google/cloud/testing_util/chrono_literals.h" -#include "google/cloud/testing_util/fake_completion_queue_impl.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "google/cloud/testing_util/validate_metadata.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace btproto = ::google::bigtable::v2; - -using ::google::cloud::bigtable::testing::MockBackoffPolicy; -using ::google::cloud::bigtable::testing::MockClientAsyncReaderInterface; -using ::google::cloud::testing_util::chrono_literals::operator""_ms; -using ::google::cloud::testing_util::FakeCompletionQueueImpl; -using ::google::cloud::testing_util::StatusIs; - -class AsyncBulkApplyTest : public bigtable::testing::TableTestFixture { - protected: - AsyncBulkApplyTest() - : TableTestFixture( - CompletionQueue(std::make_shared())), - rpc_retry_policy_( - bigtable::DefaultRPCRetryPolicy(internal::kBigtableLimits)), - rpc_backoff_policy_(bigtable::DefaultRPCBackoffPolicy( - internal::kBigtableTableAdminLimits)), - idempotent_mutation_policy_( - bigtable::DefaultIdempotentMutationPolicy()), - metadata_update_policy_("my_table", MetadataParamTypes::NAME) {} - - void SimulateIteration() { - cq_impl_->SimulateCompletion(true); - // state == PROCESSING - cq_impl_->SimulateCompletion(true); - // state == PROCESSING, 1 read - cq_impl_->SimulateCompletion(false); - // state == FINISHING - cq_impl_->SimulateCompletion(true); - } - - std::shared_ptr rpc_retry_policy_; - std::shared_ptr rpc_backoff_policy_; - std::shared_ptr idempotent_mutation_policy_; - MetadataUpdatePolicy metadata_update_policy_; -}; - -std::vector StatusOnly(std::vector const& failures) { - std::vector v; - std::transform(failures.begin(), failures.end(), std::back_inserter(v), - [](FailedMutation const& f) { return f.status(); }); - return v; -} - -TEST_F(AsyncBulkApplyTest, NoMutations) { - bigtable::BulkMutation mut; - - auto bulk_apply_future = internal::AsyncRetryBulkApply::Create( - cq_, rpc_retry_policy_->clone(), rpc_backoff_policy_->clone(), - *idempotent_mutation_policy_, metadata_update_policy_, client_, - "my-app-profile", "my-table", std::move(mut)); - - ASSERT_EQ(0U, bulk_apply_future.get().size()); -} - -TEST_F(AsyncBulkApplyTest, Success) { - bigtable::BulkMutation mut{ - bigtable::SingleRowMutation("foo2", - {bigtable::SetCell("f", "c", 0_ms, "v2")}), - bigtable::SingleRowMutation("foo3", - {bigtable::SetCell("f", "c", 0_ms, "v3")}), - }; - - auto* reader = - new MockClientAsyncReaderInterface; - EXPECT_CALL(*reader, Read) - .WillOnce([](btproto::MutateRowsResponse* r, void*) { - auto& r1 = *r->add_entries(); - r1.set_index(0); - r1.mutable_status()->set_code(grpc::StatusCode::OK); - - auto& r2 = *r->add_entries(); - r2.set_index(1); - r2.mutable_status()->set_code(grpc::StatusCode::OK); - }) - .WillOnce([](btproto::MutateRowsResponse*, void*) {}); - - EXPECT_CALL(*reader, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - EXPECT_CALL(*reader, StartCall).Times(1); - - EXPECT_CALL(*client_, PrepareAsyncMutateRows) - .WillOnce([reader](grpc::ClientContext*, - btproto::MutateRowsRequest const&, - grpc::CompletionQueue*) { - return std::unique_ptr< - MockClientAsyncReaderInterface>( - reader); - }) - .RetiresOnSaturation(); - - auto bulk_apply_future = internal::AsyncRetryBulkApply::Create( - cq_, rpc_retry_policy_->clone(), rpc_backoff_policy_->clone(), - *idempotent_mutation_policy_, metadata_update_policy_, client_, - "my-app-profile", "my-table", std::move(mut)); - - bulk_apply_future.then( - [](future> f) { f.get(); }); - - ASSERT_EQ(1U, cq_impl_->size()); - - SimulateIteration(); - - ASSERT_EQ(0U, cq_impl_->size()); -} - -TEST_F(AsyncBulkApplyTest, PartialSuccessRetry) { - bigtable::BulkMutation mut{ - bigtable::SingleRowMutation("foo2", - {bigtable::SetCell("f", "c", 0_ms, "v2")}), - bigtable::SingleRowMutation("foo3", - {bigtable::SetCell("f", "c", 0_ms, "v3")}), - }; - - auto* reader0 = - new MockClientAsyncReaderInterface; - auto* reader1 = - new MockClientAsyncReaderInterface; - - EXPECT_CALL(*reader0, Read) - .WillOnce([](btproto::MutateRowsResponse* r, void*) { - auto& r1 = *r->add_entries(); - r1.set_index(0); - r1.mutable_status()->set_code(grpc::StatusCode::OK); - }) - .WillOnce([](btproto::MutateRowsResponse*, void*) {}); - - EXPECT_CALL(*reader1, Read) - .WillOnce([](btproto::MutateRowsResponse* r, void*) { - auto& r1 = *r->add_entries(); - r1.set_index(0); - r1.mutable_status()->set_code(grpc::StatusCode::OK); - }) - .WillOnce([](btproto::MutateRowsResponse*, void*) {}); - - EXPECT_CALL(*reader0, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - EXPECT_CALL(*reader1, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - EXPECT_CALL(*reader0, StartCall).Times(1); - EXPECT_CALL(*reader1, StartCall).Times(1); - - EXPECT_CALL(*client_, PrepareAsyncMutateRows) - .WillOnce([reader0](grpc::ClientContext*, - btproto::MutateRowsRequest const&, - grpc::CompletionQueue*) { - return std::unique_ptr< - MockClientAsyncReaderInterface>( - reader0); - }) - .WillOnce([reader1](grpc::ClientContext*, - btproto::MutateRowsRequest const&, - grpc::CompletionQueue*) { - return std::unique_ptr< - MockClientAsyncReaderInterface>( - reader1); - }); - - auto bulk_apply_future = internal::AsyncRetryBulkApply::Create( - cq_, rpc_retry_policy_->clone(), rpc_backoff_policy_->clone(), - *idempotent_mutation_policy_, metadata_update_policy_, client_, - "my-app-profile", "my-table", std::move(mut)); - - SimulateIteration(); - // simulate the backoff timer - cq_impl_->SimulateCompletion(true); - - ASSERT_EQ(1U, cq_impl_->size()); - - SimulateIteration(); - - bulk_apply_future.get(); - - ASSERT_EQ(0U, cq_impl_->size()); - EXPECT_TRUE(cq_impl_->empty()); -} - -TEST_F(AsyncBulkApplyTest, DefaultFailureRetry) { - bigtable::BulkMutation mut{ - bigtable::SingleRowMutation("foo2", - {bigtable::SetCell("f", "c", 0_ms, "v2")}), - bigtable::SingleRowMutation("foo3", - {bigtable::SetCell("f", "c", 0_ms, "v3")}), - }; - - auto* reader0 = - new MockClientAsyncReaderInterface; - auto* reader1 = - new MockClientAsyncReaderInterface; - - EXPECT_CALL(*reader0, Read) - .WillOnce([](btproto::MutateRowsResponse* r, void*) { - auto& r1 = *r->add_entries(); - r1.set_index(0); - r1.mutable_status()->set_code(grpc::StatusCode::OK); - }) - .WillOnce([](btproto::MutateRowsResponse*, void*) {}); - - EXPECT_CALL(*reader1, Read) - .WillOnce([](btproto::MutateRowsResponse* r, void*) { - auto& r1 = *r->add_entries(); - r1.set_index(0); - r1.mutable_status()->set_code(grpc::StatusCode::OK); - - auto& r2 = *r->add_entries(); - r2.set_index(1); - r2.mutable_status()->set_code(grpc::StatusCode::OK); - }) - .WillOnce([](btproto::MutateRowsResponse*, void*) {}); - - EXPECT_CALL(*reader0, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status(grpc::StatusCode::UNAVAILABLE, ""); - }); - - EXPECT_CALL(*reader1, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - EXPECT_CALL(*reader0, StartCall).Times(1); - EXPECT_CALL(*reader1, StartCall).Times(1); - - EXPECT_CALL(*client_, PrepareAsyncMutateRows) - .WillOnce([reader0](grpc::ClientContext*, - btproto::MutateRowsRequest const&, - grpc::CompletionQueue*) { - return std::unique_ptr< - MockClientAsyncReaderInterface>( - reader0); - }) - .WillOnce([reader1](grpc::ClientContext*, - btproto::MutateRowsRequest const&, - grpc::CompletionQueue*) { - return std::unique_ptr< - MockClientAsyncReaderInterface>( - reader1); - }); - - auto bulk_apply_future = internal::AsyncRetryBulkApply::Create( - cq_, rpc_retry_policy_->clone(), rpc_backoff_policy_->clone(), - *idempotent_mutation_policy_, metadata_update_policy_, client_, - "my-app-profile", "my-table", std::move(mut)); - - SimulateIteration(); - // simulate the backoff timer - cq_impl_->SimulateCompletion(true); - - ASSERT_EQ(1U, cq_impl_->size()); - - SimulateIteration(); - - bulk_apply_future.get(); - - ASSERT_EQ(0U, cq_impl_->size()); - - EXPECT_TRUE(cq_impl_->empty()); -} - -TEST_F(AsyncBulkApplyTest, TooManyFailures) { - bigtable::BulkMutation mut{ - bigtable::SingleRowMutation("foo2", - {bigtable::SetCell("f", "c", 0_ms, "v2")}), - bigtable::SingleRowMutation("foo3", - {bigtable::SetCell("f", "c", 0_ms, "v3")}), - }; - - // We give up on the 3rd error. - auto constexpr kErrorCount = 2; - - EXPECT_CALL(*client_, PrepareAsyncMutateRows) - .Times(kErrorCount + 1) - .WillRepeatedly([](grpc::ClientContext*, - btproto::MutateRowsRequest const&, - grpc::CompletionQueue*) { - auto reader = std::make_unique< - MockClientAsyncReaderInterface>(); - EXPECT_CALL(*reader, Read).Times(2); - EXPECT_CALL(*reader, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status(grpc::StatusCode::UNAVAILABLE, "try again"); - }); - EXPECT_CALL(*reader, StartCall); - return reader; - }); - - auto limited_retry_policy = LimitedErrorCountRetryPolicy(kErrorCount); - auto bulk_apply_future = internal::AsyncRetryBulkApply::Create( - cq_, limited_retry_policy.clone(), rpc_backoff_policy_->clone(), - *idempotent_mutation_policy_, metadata_update_policy_, client_, - "my-app-profile", "my-table", std::move(mut)); - - for (int retry = 0; retry < kErrorCount; ++retry) { - SimulateIteration(); - // simulate the backoff timer - cq_impl_->SimulateCompletion(true); - ASSERT_EQ(1U, cq_impl_->size()); - } - - SimulateIteration(); - - auto failures = StatusOnly(bulk_apply_future.get()); - EXPECT_THAT(failures, ElementsAre(StatusIs(StatusCode::kUnavailable), - StatusIs(StatusCode::kUnavailable))); - - ASSERT_EQ(0U, cq_impl_->size()); - EXPECT_TRUE(cq_impl_->empty()); -} - -TEST_F(AsyncBulkApplyTest, RetryPolicyUsedForOkStreamsWithFailedMutations) { - bigtable::BulkMutation mut{bigtable::SingleRowMutation( - "row", {bigtable::SetCell("f", "c", 0_ms, "v2")})}; - - // We give up on the 3rd error. - auto constexpr kErrorCount = 2; - - EXPECT_CALL(*client_, PrepareAsyncMutateRows) - .Times(kErrorCount + 1) - .WillRepeatedly([](grpc::ClientContext*, - btproto::MutateRowsRequest const&, - grpc::CompletionQueue*) { - auto reader = std::make_unique< - MockClientAsyncReaderInterface>(); - EXPECT_CALL(*reader, Read) - .WillOnce([](btproto::MutateRowsResponse* r, void*) { - auto& r1 = *r->add_entries(); - r1.set_index(0); - r1.mutable_status()->set_code(grpc::StatusCode::UNAVAILABLE); - }) - .WillOnce([](btproto::MutateRowsResponse*, void*) {}); - EXPECT_CALL(*reader, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - EXPECT_CALL(*reader, StartCall); - return reader; - }); - - auto limited_retry_policy = LimitedErrorCountRetryPolicy(kErrorCount); - auto bulk_apply_future = internal::AsyncRetryBulkApply::Create( - cq_, limited_retry_policy.clone(), rpc_backoff_policy_->clone(), - *idempotent_mutation_policy_, metadata_update_policy_, client_, - "my-app-profile", "my-table", std::move(mut)); - - for (int retry = 0; retry != kErrorCount; ++retry) { - SimulateIteration(); - // simulate the backoff timer - cq_impl_->SimulateCompletion(true); - ASSERT_EQ(1U, cq_impl_->size()); - } - - SimulateIteration(); - - auto failures = StatusOnly(bulk_apply_future.get()); - EXPECT_THAT(failures, ElementsAre(StatusIs(StatusCode::kUnavailable))); - - ASSERT_EQ(0U, cq_impl_->size()); - EXPECT_TRUE(cq_impl_->empty()); -} - -TEST_F(AsyncBulkApplyTest, UsesBackoffPolicy) { - bigtable::BulkMutation mut{ - bigtable::SingleRowMutation("foo2", - {bigtable::SetCell("f", "c", 0_ms, "v2")}), - bigtable::SingleRowMutation("foo3", - {bigtable::SetCell("f", "c", 0_ms, "v3")}), - }; - - auto grpc_error = grpc::Status(grpc::StatusCode::UNAVAILABLE, "try again"); - auto error = MakeStatusFromRpcError(grpc_error); - - std::unique_ptr mock(new MockBackoffPolicy); - EXPECT_CALL(*mock, Setup).Times(2); - EXPECT_CALL(*mock, OnCompletion(error)).WillOnce([](Status const&) { - return 10_ms; - }); - - EXPECT_CALL(*client_, PrepareAsyncMutateRows) - .WillOnce([grpc_error](grpc::ClientContext*, - btproto::MutateRowsRequest const&, - grpc::CompletionQueue*) { - auto reader = std::make_unique< - MockClientAsyncReaderInterface>(); - EXPECT_CALL(*reader, Read).Times(2); - EXPECT_CALL(*reader, Finish) - .WillOnce([grpc_error](grpc::Status* status, void*) { - *status = grpc_error; - }); - EXPECT_CALL(*reader, StartCall); - return reader; - }) - .WillOnce([](grpc::ClientContext*, btproto::MutateRowsRequest const&, - grpc::CompletionQueue*) { - auto reader = std::make_unique< - MockClientAsyncReaderInterface>(); - EXPECT_CALL(*reader, Read) - .WillOnce([](btproto::MutateRowsResponse* r, void*) { - auto& r1 = *r->add_entries(); - r1.set_index(0); - r1.mutable_status()->set_code(grpc::StatusCode::OK); - - auto& r2 = *r->add_entries(); - r2.set_index(1); - r2.mutable_status()->set_code(grpc::StatusCode::OK); - }) - .WillOnce([](btproto::MutateRowsResponse*, void*) {}); - EXPECT_CALL(*reader, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - EXPECT_CALL(*reader, StartCall); - return reader; - }); - - auto bulk_apply_future = internal::AsyncRetryBulkApply::Create( - cq_, rpc_retry_policy_->clone(), std::move(mock), - *idempotent_mutation_policy_, metadata_update_policy_, client_, - "my-app-profile", "my-table", std::move(mut)); - - SimulateIteration(); - // simulate the backoff timer - cq_impl_->SimulateCompletion(true); - - ASSERT_EQ(1U, cq_impl_->size()); - - SimulateIteration(); - - ASSERT_EQ(0U, cq_impl_->size()); -} - -TEST_F(AsyncBulkApplyTest, CancelDuringBackoff) { - bigtable::BulkMutation mut{ - bigtable::SingleRowMutation("foo2", - {bigtable::SetCell("f", "c", 0_ms, "v2")}), - bigtable::SingleRowMutation("foo3", - {bigtable::SetCell("f", "c", 0_ms, "v3")}), - }; - - auto grpc_error = grpc::Status(grpc::StatusCode::UNAVAILABLE, "try again"); - auto error = MakeStatusFromRpcError(grpc_error); - - std::unique_ptr mock(new MockBackoffPolicy); - EXPECT_CALL(*mock, Setup); - EXPECT_CALL(*mock, OnCompletion(error)).WillOnce([](Status const&) { - return 10_ms; - }); - - EXPECT_CALL(*client_, PrepareAsyncMutateRows) - .WillOnce([grpc_error](grpc::ClientContext*, - btproto::MutateRowsRequest const&, - grpc::CompletionQueue*) { - auto reader = std::make_unique< - MockClientAsyncReaderInterface>(); - EXPECT_CALL(*reader, Read).Times(2); - EXPECT_CALL(*reader, Finish) - .WillOnce([grpc_error](grpc::Status* status, void*) { - *status = grpc_error; - }); - EXPECT_CALL(*reader, StartCall); - return reader; - }); - - auto bulk_apply_future = internal::AsyncRetryBulkApply::Create( - cq_, rpc_retry_policy_->clone(), std::move(mock), - *idempotent_mutation_policy_, metadata_update_policy_, client_, - "my-app-profile", "my-table", std::move(mut)); - - SimulateIteration(); - ASSERT_EQ(1U, cq_impl_->size()); - - // cancel the pending operation. - bulk_apply_future.cancel(); - // simulate the backoff timer expiring. - cq_impl_->SimulateCompletion(false); - - ASSERT_EQ(0U, cq_impl_->size()); - - auto failures = StatusOnly(bulk_apply_future.get()); - EXPECT_THAT(failures, ElementsAre(StatusIs(StatusCode::kUnavailable), - StatusIs(StatusCode::kUnavailable))); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/internal/legacy_async_row_reader.cc b/google/cloud/bigtable/internal/legacy_async_row_reader.cc deleted file mode 100644 index 80ce9973850d0..0000000000000 --- a/google/cloud/bigtable/internal/legacy_async_row_reader.cc +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/legacy_async_row_reader.h" -#include "google/cloud/bigtable/version.h" -#include "google/cloud/log.h" - -namespace google { -namespace cloud { -namespace bigtable_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -void LegacyAsyncRowReader::MakeRequest() { - status_ = Status(); - google::bigtable::v2::ReadRowsRequest request; - - request.set_app_profile_id(app_profile_id_); - request.set_table_name(table_name_); - auto row_set_proto = row_set_.as_proto(); - request.mutable_rows()->Swap(&row_set_proto); - - auto filter_proto = filter_.as_proto(); - request.mutable_filter()->Swap(&filter_proto); - - if (rows_limit_ != NO_ROWS_LIMIT) { - request.set_rows_limit(rows_limit_ - rows_count_); - } - parser_ = parser_factory_->Create(false); - - auto context = std::make_unique(); - rpc_retry_policy_->Setup(*context); - rpc_backoff_policy_->Setup(*context); - metadata_update_policy_.Setup(*context); - - auto& client = client_; - auto self = this->shared_from_this(); - cq_.MakeStreamingReadRpc( - [client](grpc::ClientContext* context, - google::bigtable::v2::ReadRowsRequest const& request, - grpc::CompletionQueue* cq) { - return client->PrepareAsyncReadRows(context, request, cq); - }, - request, std::move(context), - [self](google::bigtable::v2::ReadRowsResponse r) { - return self->OnDataReceived(std::move(r)); - }, - [self](Status s) { self->OnStreamFinished(std::move(s)); }); -} - -void LegacyAsyncRowReader::TryGiveRowToUser() { - // The user is likely to ask for more rows immediately after receiving a - // row, which means that this function will be called recursively. The depth - // of the recursion can be as deep as the size of ready_rows_, which might - // be significant and potentially lead to stack overflow. The way to - // overcome this is to always switch thread to a CompletionQueue thread. - // Switching thread for every row has a non-trivial cost, though. To find a - // good balance, we allow for recursion no deeper than 100 and achieve it by - // tracking the level in `recursion_level_`. - // - // The magic value 100 is arbitrary, but back-of-the-envelope calculation - // indicates it should cap this stack usage to below 100K. Default stack - // size is usually 1MB. - struct CountFrames { - explicit CountFrames(int& cntr) : cntr(++cntr) {} - ~CountFrames() { --cntr; } - int& cntr; - } counter(recursion_level_); - - if (ready_rows_.empty()) { - if (whole_op_finished_) { - // The scan is finished for good, there will be no more rows. - on_finish_(status_); - return; - } - if (!continue_reading_) { - GCP_LOG(FATAL) - << "No rows are ready and we can't continue reading. This is a bug, " - "please report it at " - "https://github.com/googleapis/google-cloud-cpp/issues/new"; - } - // No rows, but we can fetch some. - auto continue_reading = std::move(continue_reading_); - continue_reading_.reset(); - continue_reading->set_value(true); - return; - } - - // Yay! We have something to give to the user and they want it. - auto row = std::move(ready_rows_.front()); - ready_rows_.pop(); - - auto self = this->shared_from_this(); - bool const break_recursion = recursion_level_ >= 100; - on_row_(std::move(row)).then([self, break_recursion](future fut) { - bool should_cancel; -#if GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS - try { - should_cancel = !fut.get(); - } catch (std::exception& ex) { - self->Cancel( - std::string("future<> returned from the user callback threw an " - "exception: ") + - ex.what()); - return; - } catch (...) { - self->Cancel( - "future<> returned from the user callback threw an unknown " - "exception"); - return; - } -#else // GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS - should_cancel = !fut.get(); -#endif // GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS - if (should_cancel) { - self->Cancel("User cancelled"); - return; - } - if (break_recursion) { - self->cq_.RunAsync([self] { self->UserWantsRows(); }); - return; - } - self->UserWantsRows(); - }); -} - -future LegacyAsyncRowReader::OnDataReceived( - google::bigtable::v2::ReadRowsResponse response) { - // assert(!whole_op_finished_); - // assert(!continue_reading_); - // assert(status_.ok()); - status_ = ConsumeResponse(std::move(response)); - // We've processed the response. - // - // If there were errors (e.g. malformed response from the server), we should - // interrupt this stream. Interrupting it will yield lower layers calling - // `OnStreamFinished` with a status unrelated to the real reason, so we - // store the actual reason in status_ and proceed exactly the - // same way as if the stream was broken for other reasons. - // - // Even if status_ is not OK, we might have consumed some rows, - // but, don't give them to the user yet. We want to keep the invariant that - // either the user doesn't hold a `future<>` when we're fetching more rows. - // Retries (successful or not) will do it. Improving this behavior makes - // little sense because parser errors are very unexpected and probably not - // retryable anyway. - - if (status_.ok()) { - continue_reading_.emplace(promise()); - auto res = continue_reading_->get_future(); - TryGiveRowToUser(); - return res; - } - return make_ready_future(false); -} - -void LegacyAsyncRowReader::OnStreamFinished(Status status) { - // assert(!continue_reading_); - if (status_.ok()) { - status_ = std::move(status); - } - grpc::Status parser_status; - parser_->HandleEndOfStream(parser_status); - if (!parser_status.ok() && status_.ok()) { - // If there stream finished with an error ignore what the parser says. - status_ = MakeStatusFromRpcError(parser_status); - } - - // In the unlikely case when we have already reached the requested - // number of rows and still receive an error (the parser can throw - // an error at end of stream for example), there is no need to - // retry and we have no good value for rows_limit anyway. - if (rows_limit_ != NO_ROWS_LIMIT && rows_limit_ <= rows_count_) { - status_ = Status(); - } - - if (!last_read_row_key_.empty()) { - // We've returned some rows and need to make sure we don't - // request them again. - row_set_ = - row_set_.Intersect(bigtable::RowRange::Open(last_read_row_key_, "")); - } - - // If we receive an error, but the retryable set is empty, consider it a - // success. - if (row_set_.IsEmpty()) { - status_ = Status(); - } - - if (status_.ok()) { - // We've successfully finished the scan. - whole_op_finished_ = true; - TryGiveRowToUser(); - return; - } - - if (!rpc_retry_policy_->OnFailure(status_)) { - // Can't retry. - whole_op_finished_ = true; - TryGiveRowToUser(); - return; - } - auto self = this->shared_from_this(); - cq_.MakeRelativeTimer(rpc_backoff_policy_->OnCompletion(status_)) - .then( - [self]( - future> result) { - if (auto tp = result.get()) { - self->MakeRequest(); - } else { - self->whole_op_finished_ = true; - self->TryGiveRowToUser(); - } - }); -} - -void LegacyAsyncRowReader::Cancel(std::string const& reason) { - ready_rows_ = std::queue(); - auto continue_reading = std::move(continue_reading_); - continue_reading_.reset(); - Status status(StatusCode::kCancelled, reason); - if (!continue_reading) { - // If we're not in the middle of the stream fire some user callbacks, but - // also override the overall status. - // assert(whole_op_finished_); - status_ = std::move(status); - TryGiveRowToUser(); - return; - } - // If we are in the middle of the stream, cancel the stream. - status_ = std::move(status); - continue_reading->set_value(false); -} - -Status LegacyAsyncRowReader::DrainParser() { - grpc::Status status; - while (parser_->HasNext()) { - bigtable::Row parsed_row = parser_->Next(status); - if (!status.ok()) { - return MakeStatusFromRpcError(status); - } - ++rows_count_; - last_read_row_key_ = parsed_row.row_key(); - ready_rows_.emplace(std::move(parsed_row)); - } - return Status(); -} - -Status LegacyAsyncRowReader::ConsumeResponse( - google::bigtable::v2::ReadRowsResponse response) { - for (auto& chunk : *response.mutable_chunks()) { - grpc::Status status; - parser_->HandleChunk(std::move(chunk), status); - if (!status.ok()) { - return MakeStatusFromRpcError(status); - } - Status parser_status = DrainParser(); - if (!parser_status.ok()) { - return parser_status; - } - } - if (!response.last_scanned_row_key().empty()) { - last_read_row_key_ = std::move(*response.mutable_last_scanned_row_key()); - } - return Status(); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/internal/legacy_async_row_reader.h b/google/cloud/bigtable/internal/legacy_async_row_reader.h deleted file mode 100644 index 0202f2ea1348d..0000000000000 --- a/google/cloud/bigtable/internal/legacy_async_row_reader.h +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_LEGACY_ASYNC_ROW_READER_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_LEGACY_ASYNC_ROW_READER_H - -#include "google/cloud/bigtable/completion_queue.h" -#include "google/cloud/bigtable/data_client.h" -#include "google/cloud/bigtable/filters.h" -#include "google/cloud/bigtable/internal/readrowsparser.h" -#include "google/cloud/bigtable/metadata_update_policy.h" -#include "google/cloud/bigtable/row.h" -#include "google/cloud/bigtable/row_set.h" -#include "google/cloud/bigtable/rpc_backoff_policy.h" -#include "google/cloud/bigtable/rpc_retry_policy.h" -#include "google/cloud/bigtable/version.h" -#include "google/cloud/future.h" -#include "google/cloud/grpc_error_delegate.h" -#include "google/cloud/optional.h" -#include "google/cloud/status_or.h" -#include "absl/types/optional.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * Objects of this class represent the state of reading rows via AsyncReadRows. - */ -class LegacyAsyncRowReader - : public std::enable_shared_from_this { - using RowFunctor = std::function(bigtable::Row)>; - using FinishFunctor = std::function; - - public: - /// Special value to be used as rows_limit indicating no limit. - // NOLINTNEXTLINE(readability-identifier-naming) - static std::int64_t constexpr NO_ROWS_LIMIT = 0; - // Callbacks keep pointers to these objects. - LegacyAsyncRowReader(LegacyAsyncRowReader&&) = delete; - LegacyAsyncRowReader(LegacyAsyncRowReader const&) = delete; - - static std::shared_ptr Create( - CompletionQueue cq, std::shared_ptr client, - std::string app_profile_id, std::string table_name, RowFunctor on_row, - FinishFunctor on_finish, bigtable::RowSet row_set, - std::int64_t rows_limit, bigtable::Filter filter, - std::unique_ptr rpc_retry_policy, - std::unique_ptr rpc_backoff_policy, - bigtable::MetadataUpdatePolicy metadata_update_policy, - std::unique_ptr - parser_factory) { - std::shared_ptr res(new LegacyAsyncRowReader( - std::move(cq), std::move(client), std::move(app_profile_id), - std::move(table_name), std::move(on_row), std::move(on_finish), - std::move(row_set), rows_limit, std::move(filter), - std::move(rpc_retry_policy), std::move(rpc_backoff_policy), - std::move(metadata_update_policy), std::move(parser_factory))); - res->MakeRequest(); - return res; - } - - private: - LegacyAsyncRowReader( - CompletionQueue cq, std::shared_ptr client, - std::string app_profile_id, std::string table_name, RowFunctor on_row, - FinishFunctor on_finish, bigtable::RowSet row_set, - std::int64_t rows_limit, bigtable::Filter filter, - std::unique_ptr rpc_retry_policy, - std::unique_ptr rpc_backoff_policy, - bigtable::MetadataUpdatePolicy metadata_update_policy, - std::unique_ptr parser_factory) - : cq_(std::move(cq)), - client_(std::move(client)), - app_profile_id_(std::move(app_profile_id)), - table_name_(std::move(table_name)), - on_row_(std::move(on_row)), - on_finish_(std::move(on_finish)), - row_set_(std::move(row_set)), - rows_limit_(rows_limit), - filter_(std::move(filter)), - rpc_retry_policy_(std::move(rpc_retry_policy)), - rpc_backoff_policy_(std::move(rpc_backoff_policy)), - metadata_update_policy_(std::move(metadata_update_policy)), - parser_factory_(std::move(parser_factory)) {} - - void MakeRequest(); - - /** - * Called when the user asks for more rows via satisfying the future returned - * from the row callback. - */ - void UserWantsRows() { TryGiveRowToUser(); } - - /** - * Attempt to call a user callback. - * - * If no rows are ready, this will not call the callback immediately and - * instead ask lower layers for more data. - */ - void TryGiveRowToUser(); - - /// Called when lower layers provide us with a response chunk. - future OnDataReceived(google::bigtable::v2::ReadRowsResponse response); - - /// Called when the whole stream finishes. - void OnStreamFinished(Status status); - - /// User satisfied the future returned from the row callback with false. - void Cancel(std::string const& reason); - - /// Process everything that is accumulated in the parser. - Status DrainParser(); - - /// Parse the data from the response. - Status ConsumeResponse(google::bigtable::v2::ReadRowsResponse response); - - std::mutex mu_; - CompletionQueue cq_; - std::shared_ptr client_; - std::string app_profile_id_; - std::string table_name_; - RowFunctor on_row_; - FinishFunctor on_finish_; - bigtable::RowSet row_set_; - std::int64_t rows_limit_; - bigtable::Filter filter_; - std::unique_ptr rpc_retry_policy_; - std::unique_ptr rpc_backoff_policy_; - bigtable::MetadataUpdatePolicy metadata_update_policy_; - std::unique_ptr parser_factory_; - std::unique_ptr parser_; - /// Number of rows read so far, used to set row_limit in retries. - std::int64_t rows_count_ = 0; - /// Holds the last read row key, for retries. - bigtable::RowKeyType last_read_row_key_; - /// The queue of rows which we already received but no one has asked for them. - std::queue ready_rows_; - /** - * The promise to the underlying stream to either continue reading or cancel. - * - * If the `absl::optional` is empty, it means that either the whole scan is - * finished or the underlying layers are already trying to fetch more data. - * - * If the `absl::optional` is not empty, the lower layers are waiting for this - * to be satisfied before they start fetching more data. - */ - absl::optional> continue_reading_; - /// The final status of the operation. - bool whole_op_finished_ = false; - /** - * The status of the last retry attempt_. - * - * It is reset to OK at the beginning of every retry. If an error is - * encountered (be it while parsing the response or on stream finish), it is - * stored here (unless a different error had already been stored). - */ - Status status_; - /// Tracks the level of recursion of TryGiveRowToUser - int recursion_level_ = 0; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_LEGACY_ASYNC_ROW_READER_H diff --git a/google/cloud/bigtable/internal/legacy_async_row_reader_test.cc b/google/cloud/bigtable/internal/legacy_async_row_reader_test.cc deleted file mode 100644 index 83eef314300b0..0000000000000 --- a/google/cloud/bigtable/internal/legacy_async_row_reader_test.cc +++ /dev/null @@ -1,1159 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/table.h" -#include "google/cloud/bigtable/testing/mock_data_client.h" -#include "google/cloud/bigtable/testing/mock_read_rows_reader.h" -#include "google/cloud/bigtable/testing/mock_response_reader.h" -#include "google/cloud/bigtable/testing/table_test_fixture.h" -#include "google/cloud/internal/api_client_header.h" -#include "google/cloud/testing_util/chrono_literals.h" -#include "google/cloud/testing_util/fake_completion_queue_impl.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "google/cloud/testing_util/validate_metadata.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace btproto = ::google::bigtable::v2; - -using ::google::cloud::bigtable::testing::MockClientAsyncReaderInterface; -using ::google::cloud::testing_util::ValidateMetadataFixture; -using ::google::cloud::testing_util::chrono_literals::operator""_ms; -using ::google::cloud::testing_util::FakeCompletionQueueImpl; -using ::testing::HasSubstr; -using ::testing::Values; -using ::testing::WithParamInterface; - -template -bool Unsatisfied(future const& fut) { - return std::future_status::timeout == fut.wait_for(1_ms); -} - -class TableAsyncReadRowsTest : public bigtable::testing::TableTestFixture { - protected: - TableAsyncReadRowsTest() - : TableTestFixture( - CompletionQueue(std::make_shared())), - stream_status_future_(stream_status_promise_.get_future()) {} - - MockClientAsyncReaderInterface& AddReader( - std::function request_expectations, - bool expect_a_read = true) { - readers_.emplace_back( - new MockClientAsyncReaderInterface); - reader_started_.push_back(false); - size_t idx = reader_started_.size() - 1; - auto& reader = LastReader(); - // We can't move request_expectations into the lambda because of lack of - // generalized lambda capture in C++11, so let's pass it by pointer. - auto request_expectations_ptr = - std::make_shared( - std::move(request_expectations)); - - EXPECT_CALL(*client_, PrepareAsyncReadRows) - .WillOnce([this, &reader, request_expectations_ptr]( - grpc::ClientContext* context, - btproto::ReadRowsRequest const& r, - grpc::CompletionQueue*) { - validate_metadata_fixture_.IsContextMDValid( - *context, "google.bigtable.v2.Bigtable.ReadRows", r, - google::cloud::internal::HandCraftedLibClientHeader()); - (*request_expectations_ptr)(r); - return std::unique_ptr< - MockClientAsyncReaderInterface>( - &reader); - }) - .RetiresOnSaturation(); - - EXPECT_CALL(reader, StartCall).WillOnce([idx, this](void*) { - reader_started_[idx] = true; - }); - if (expect_a_read) { - // The last call, to which we'll return ok==false. - EXPECT_CALL(reader, Read).WillOnce([](btproto::ReadRowsResponse*, void*) { - }); - } - return reader; - } - - MockClientAsyncReaderInterface& LastReader() { - return *readers_.back(); - } - - // Start Table::AsyncReadRows. - void ReadRows(int row_limit = RowReader::NO_ROWS_LIMIT) { - table_.AsyncReadRows( - [this](Row const& row) { - EXPECT_EQ(expected_rows_.front(), row.row_key()); - expected_rows_.pop(); - row_promises_.front().set_value(row.row_key()); - row_promises_.pop(); - auto ret = std::move(futures_from_user_cb_.front()); - futures_from_user_cb_.pop(); - return ret; - }, - [this](Status const& stream_status) { - stream_status_promise_.set_value(stream_status); - }, - RowSet(), row_limit, Filter::PassAllFilter()); - } - - /// Expect a row whose row key is equal to this function's argument. - template - void ExpectRow(T const& row) { - row_promises_.emplace(); - row_futures_.emplace_back(row_promises_.back().get_future()); - promises_from_user_cb_.emplace_back(); - futures_from_user_cb_.emplace(promises_from_user_cb_.back().get_future()); - expected_rows_.push(RowKeyType(row)); - } - - /// A wrapper around ExpectRow to expect many rows. - template - void ExpectRows(std::initializer_list const& rows) { - for (auto const& row : rows) { - ExpectRow(row); - } - } - - std::vector*> - readers_; - // Whether `Start()` was called on i-th retry attempt. - std::vector reader_started_; - std::queue> row_promises_; - /** - * Future at idx i corresponse to i-th expected row. It will be satisfied - * when the relevant `on_row` callback of AsyncReadRows is called. - */ - std::vector> row_futures_; - std::queue expected_rows_; - promise stream_status_promise_; - /// Future which will be satisfied with the status passed in on_finished. - future stream_status_future_; - /// I-th promise corresponds to the future returned from the ith on_row cb. - std::vector> promises_from_user_cb_; - std::queue> futures_from_user_cb_; - ValidateMetadataFixture validate_metadata_fixture_; -}; - -/// @test Verify that successfully reading a single row works. -TEST_F(TableAsyncReadRowsTest, SingleRow) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - EXPECT_CALL(stream, Read) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - })"); - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - ExpectRow("r1"); - ReadRows(); - - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - - EXPECT_TRUE(Unsatisfied(row_futures_[0])); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return data - auto row = row_futures_[0].get(); - - // Check that we're not asking for data unless someone is waiting for it. - ASSERT_EQ(0U, cq_impl_->size()); - promises_from_user_cb_[0].set_value(true); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(stream_status_future_)); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - auto stream_status = stream_status_future_.get(); - ASSERT_STATUS_OK(stream_status); - ASSERT_EQ(0U, cq_impl_->size()); -} - -/// @test Like SingleRow, but the future returned from the cb is satisfied. -TEST_F(TableAsyncReadRowsTest, SingleRowInstantFinish) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - EXPECT_CALL(stream, Read) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - })"); - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - ExpectRow("r1"); - promises_from_user_cb_[0].set_value(true); - ReadRows(); - - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - - EXPECT_TRUE(Unsatisfied(row_futures_[0])); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return data - auto row = row_futures_[0].get(); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(stream_status_future_)); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - auto stream_status = stream_status_future_.get(); - ASSERT_STATUS_OK(stream_status); - ASSERT_EQ(0U, cq_impl_->size()); -} - -/// @test Verify that reading 2 rows delivered in 2 responses works. -TEST_F(TableAsyncReadRowsTest, MultipleChunks) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - EXPECT_CALL(stream, Read) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - })"); - }) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "r2" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - })"); - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - ExpectRow("r1"); - ExpectRow("r2"); - promises_from_user_cb_[1].set_value(true); - ReadRows(); - - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - - EXPECT_TRUE(Unsatisfied(row_futures_[0])); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return data - row_futures_[0].get(); - - // Check that we're not asking for data unless someone is waiting for it. - ASSERT_EQ(0U, cq_impl_->size()); - promises_from_user_cb_[0].set_value(true); - - EXPECT_TRUE(Unsatisfied(row_futures_[1])); - cq_impl_->SimulateCompletion(true); // Return data - row_futures_[1].get(); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(stream_status_future_)); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - auto stream_status = stream_status_future_.get(); - ASSERT_STATUS_OK(stream_status); - ASSERT_EQ(0U, cq_impl_->size()); -} - -/// @test Like MultipleChunks but the future returned from on_row is satisfied. -TEST_F(TableAsyncReadRowsTest, MultipleChunksImmediatelySatisfied) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - EXPECT_CALL(stream, Read) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - })"); - }) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "r2" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - })"); - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - ExpectRow("r1"); - ExpectRow("r2"); - promises_from_user_cb_[0].set_value(true); - promises_from_user_cb_[1].set_value(true); - ReadRows(); - - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - - EXPECT_TRUE(Unsatisfied(row_futures_[0])); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return data - row_futures_[0].get(); - - EXPECT_TRUE(Unsatisfied(row_futures_[1])); - cq_impl_->SimulateCompletion(true); // Return data - row_futures_[1].get(); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(stream_status_future_)); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - auto stream_status = stream_status_future_.get(); - ASSERT_STATUS_OK(stream_status); - ASSERT_EQ(0U, cq_impl_->size()); -} - -/// @test Verify that a single row can span multiple responses. -TEST_F(TableAsyncReadRowsTest, ResponseInMultipleChunks) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - EXPECT_CALL(stream, Read) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: false - })"); - }) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "col2" } - timestamp_micros: 42000 - value: "value" - commit_row: true - })"); - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - ExpectRow("r1"); - promises_from_user_cb_[0].set_value(true); - ReadRows(); - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return data - EXPECT_TRUE(Unsatisfied(row_futures_[0])); - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return data - - row_futures_[0].get(); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - auto stream_status = stream_status_future_.get(); - ASSERT_STATUS_OK(stream_status); - ASSERT_EQ(0U, cq_impl_->size()); -} - -/// @test Verify that parser fails if the stream finishes prematurely. -TEST_F(TableAsyncReadRowsTest, ParserEofFailsOnUnfinishedRow) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - EXPECT_CALL(stream, Read) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - // missing final commit - R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: false - })"); - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - ReadRows(); - - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return data - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(stream_status_future_)); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - ASSERT_FALSE(stream_status_future_.get().ok()); -} - -/// @test Check that we ignore HandleEndOfStream errors if enough rows were read -TEST_F(TableAsyncReadRowsTest, ParserEofDoesntFailsOnUnfinishedRowIfRowLimit) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - EXPECT_CALL(stream, Read) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - // missing final commit - R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - } - chunks { - row_key: "r2" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: false - })"); - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - ExpectRow("r1"); - promises_from_user_cb_[0].set_value(true); - ReadRows(1); - - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(row_futures_[0])); - cq_impl_->SimulateCompletion(true); // Return data - - row_futures_[0].get(); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - auto stream_status = stream_status_future_.get(); - ASSERT_STATUS_OK(stream_status); - ASSERT_EQ(0U, cq_impl_->size()); -} - -/// @test Verify that permanent errors are not retried and properly passed. -TEST_F(TableAsyncReadRowsTest, PermanentFailure) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status(grpc::StatusCode::PERMISSION_DENIED, "noooo"); - }); - - ReadRows(); - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(stream_status_future_)); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - auto stream_status = stream_status_future_.get(); - ASSERT_EQ(StatusCode::kPermissionDenied, stream_status.code()); -} - -/// @test Verify that transient errors are retried. -TEST_F(TableAsyncReadRowsTest, TransientErrorIsRetried) { - auto& stream2 = AddReader([](btproto::ReadRowsRequest const& req) { - // Verify that we're not asking for the same rows again. - EXPECT_TRUE(req.has_rows()); - auto const& rows = req.rows(); - EXPECT_EQ(1, rows.row_ranges_size()); - auto const& range = rows.row_ranges(0); - EXPECT_EQ("r1", range.start_key_open()); - }); - auto& stream1 = AddReader([](btproto::ReadRowsRequest const&) {}); - - // Make it a bit trickier by delivering the error while parsing second row. - EXPECT_CALL(stream1, Read) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - } - chunks { - row_key: "r2" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: false - })"); - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream1, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status(grpc::StatusCode::UNAVAILABLE, "oh no"); - }); - - EXPECT_CALL(stream2, Read) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "r2" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - })"); - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream2, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - ExpectRows({"r1", "r2"}); - promises_from_user_cb_[0].set_value(true); - promises_from_user_cb_[1].set_value(true); - ReadRows(); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return data - - row_futures_[0].get(); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream with failure - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish timer - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(row_futures_[1])); - cq_impl_->SimulateCompletion(true); // Return data - - row_futures_[1].get(); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(stream_status_future_)); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - auto stream_status = stream_status_future_.get(); - ASSERT_STATUS_OK(stream_status); - ASSERT_EQ(0U, cq_impl_->size()); -} - -/// @test Verify that the last scanned row is respected. -TEST_F(TableAsyncReadRowsTest, LastScannedRowKeyIsRespected) { - auto& stream2 = AddReader([](btproto::ReadRowsRequest const& req) { - // The server has told that "r2" has been scanned. Our second request - // should use the range ("r2", ""]. This is what is under test. - EXPECT_TRUE(req.has_rows()); - auto const& rows = req.rows(); - EXPECT_EQ(1, rows.row_ranges_size()); - auto const& range = rows.row_ranges(0); - EXPECT_EQ("r2", range.start_key_open()); - }); - auto& stream1 = AddReader([](btproto::ReadRowsRequest const&) {}); - - EXPECT_CALL(stream1, Read) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - })"); - }) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - std::cout << "Second Read for stream1 " << std::endl; - btproto::ReadRowsResponse resp; - resp.set_last_scanned_row_key("r2"); - *r = resp; - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream1, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status(grpc::StatusCode::UNAVAILABLE, "retry"); - }); - - EXPECT_CALL(stream2, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - ExpectRows({"r1", "r2", "r3"}); - promises_from_user_cb_[0].set_value(true); - ReadRows(); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return "r1" - - row_futures_[0].get(); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return last_scanned_row_key = "r2" - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream1 with failure - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish timer - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(stream_status_future_)); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - auto stream_status = stream_status_future_.get(); - ASSERT_STATUS_OK(stream_status); - ASSERT_EQ(0U, cq_impl_->size()); -} - -/// @test Verify proper handling of bogus responses from the service. -TEST_F(TableAsyncReadRowsTest, ParserFailure) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - EXPECT_CALL(stream, Read) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - // Row not in increasing order. - R"( - chunks { - row_key: "r2" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - } - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - })"); - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - ExpectRow("r2"); - promises_from_user_cb_[0].set_value(true); - ReadRows(); - - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return data - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish placeholder Read() - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - row_futures_[0].get(); - - auto stream_status = stream_status_future_.get(); - ASSERT_EQ(StatusCode::kInternal, stream_status.code()); - ASSERT_EQ(0U, cq_impl_->size()); -} - -enum class CancelMode { - kFalseValue, -#if GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS - kStdExcept, - kOtherExcept, -#endif // GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS -}; - -/// @test Verify canceling the stream by satisfying the futures with false -class TableAsyncReadRowsCancelMidStreamTest - : public TableAsyncReadRowsTest, - public WithParamInterface {}; - -TEST_P(TableAsyncReadRowsCancelMidStreamTest, CancelMidStream) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - EXPECT_CALL(stream, Read) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - } - chunks { - row_key: "r2" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - })"); - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - ExpectRow("r1"); - ReadRows(); - - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - - EXPECT_TRUE(Unsatisfied(row_futures_[0])); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return data - row_futures_[0].get(); - - // Check that we're not asking for data unless someone is waiting for it. - ASSERT_EQ(0U, cq_impl_->size()); - - switch (GetParam()) { - case CancelMode::kFalseValue: - promises_from_user_cb_[0].set_value(false); - break; -#if GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS - case CancelMode::kStdExcept: - try { - throw std::runtime_error("user threw std::exception"); - } catch (...) { - promises_from_user_cb_[0].set_exception(std::current_exception()); - } - break; - case CancelMode::kOtherExcept: - try { - throw 5; - } catch (...) { - promises_from_user_cb_[0].set_exception(std::current_exception()); - } - break; -#endif // GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS - } - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(stream_status_future_)); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - auto stream_status = stream_status_future_.get(); - ASSERT_EQ(StatusCode::kCancelled, stream_status.code()); - switch (GetParam()) { - case CancelMode::kFalseValue: - ASSERT_THAT(stream_status.message(), HasSubstr("User cancelled")); - break; -#if GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS - case CancelMode::kStdExcept: - ASSERT_THAT(stream_status.message(), - HasSubstr("user threw std::exception")); - break; - case CancelMode::kOtherExcept: - ASSERT_THAT(stream_status.message(), HasSubstr("unknown exception")); - break; -#endif // GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS - } - - ASSERT_EQ(0U, cq_impl_->size()); -} - -#if GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS -INSTANTIATE_TEST_SUITE_P(CancelMidStream, TableAsyncReadRowsCancelMidStreamTest, - Values(CancelMode::kFalseValue, CancelMode::kStdExcept, - CancelMode::kOtherExcept)); -#else // GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS -INSTANTIATE_TEST_SUITE_P(CancelMidStream, TableAsyncReadRowsCancelMidStreamTest, - Values(CancelMode::kFalseValue)); -#endif // GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS - -/// @test Like CancelMidStream but after the underlying stream has finished. -TEST_F(TableAsyncReadRowsTest, CancelAfterStreamFinish) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - // First two rows are going to be processed, but third will cause the parser - // to fail (row order violation). This will result in finishing the stream - // while still keeping the two processed rows for the user. - EXPECT_CALL(stream, Read) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - } - chunks { - row_key: "r2" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - } - chunks { - row_key: "r0" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - })"); - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - ExpectRow("r1"); - ReadRows(); - - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - - EXPECT_TRUE(Unsatisfied(row_futures_[0])); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return data - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(row_futures_[0])); - EXPECT_TRUE(Unsatisfied(stream_status_future_)); - cq_impl_->SimulateCompletion(true); // Finish Finish() - ASSERT_EQ(0U, cq_impl_->size()); - - EXPECT_TRUE(Unsatisfied(stream_status_future_)); - auto row = row_futures_[0].get(); - - // Check that we're not asking for data unless someone is waiting for it. - ASSERT_EQ(0U, cq_impl_->size()); - promises_from_user_cb_[0].set_value(false); - - auto stream_status = stream_status_future_.get(); - ASSERT_FALSE(stream_status.ok()); - ASSERT_EQ(StatusCode::kCancelled, stream_status.code()); -} - -/// @test Verify that the recursion described in TryGiveRowToUser is bounded. -TEST_F(TableAsyncReadRowsTest, DeepStack) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - auto large_response = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "000" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - })"); - ExpectRow("000"); - for (int i = 1; i < 101; ++i) { - auto chunk = large_response.chunks(0); - std::stringstream s_idx; - s_idx << std::setfill('0') << std::setw(3) << i; - chunk.set_row_key(s_idx.str()); - ExpectRow(chunk.row_key()); - *large_response.add_chunks() = std::move(chunk); - } - - EXPECT_CALL(stream, Read) - .WillOnce([large_response](btproto::ReadRowsResponse* r, void*) { - *r = large_response; - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - for (int i = 0; i < 101; ++i) { - promises_from_user_cb_[i].set_value(true); - } - ReadRows(); - - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - - EXPECT_TRUE(Unsatisfied(row_futures_[0])); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return data - - for (int i = 0; i < 100; ++i) { - row_futures_[i].get(); - } - ASSERT_TRUE(Unsatisfied(row_futures_[100])); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // RunAsync - row_futures_[100].get(); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(stream_status_future_)); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - auto stream_status = stream_status_future_.get(); - ASSERT_STATUS_OK(stream_status); - ASSERT_EQ(0U, cq_impl_->size()); -} - -TEST_F(TableAsyncReadRowsTest, ReadRowSuccess) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - EXPECT_CALL(stream, Read) - .WillOnce([](btproto::ReadRowsResponse* r, void*) { - *r = bigtable::testing::ReadRowsResponseFromString( - R"( - chunks { - row_key: "000" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - })"); - }) - .RetiresOnSaturation(); - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - auto row_future = table_.AsyncReadRow("000", Filter::PassAllFilter()); - - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - - EXPECT_TRUE(Unsatisfied(row_future)); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Return data - - // We return data only after the whole stream is finished. - ASSERT_TRUE(Unsatisfied(row_future)); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Finish() - - auto row = row_future.get(); - ASSERT_STATUS_OK(row); - ASSERT_TRUE(row->first); - ASSERT_EQ("000", row->second.row_key()); - - ASSERT_EQ(0U, cq_impl_->size()); -} - -TEST_F(TableAsyncReadRowsTest, ReadRowNotFound) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - - auto row_future = table_.AsyncReadRow("000", Filter::PassAllFilter()); - - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(row_future)); - - cq_impl_->SimulateCompletion(true); // Finish Finish() - - auto row = row_future.get(); - ASSERT_STATUS_OK(row); - ASSERT_FALSE(row->first); -} - -TEST_F(TableAsyncReadRowsTest, ReadRowError) { - auto& stream = AddReader([](btproto::ReadRowsRequest const&) {}); - - EXPECT_CALL(stream, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status(grpc::StatusCode::PERMISSION_DENIED, ""); - }); - - auto row_future = table_.AsyncReadRow("000", Filter::PassAllFilter()); - - EXPECT_TRUE(reader_started_[0]); - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); // Finish Start() - - ASSERT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(false); // Finish stream - ASSERT_EQ(1U, cq_impl_->size()); - EXPECT_TRUE(Unsatisfied(row_future)); - - cq_impl_->SimulateCompletion(true); // Finish Finish() - - auto row = row_future.get(); - ASSERT_FALSE(row); - ASSERT_EQ(StatusCode::kPermissionDenied, row.status().code()); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/internal/legacy_async_row_sampler.cc b/google/cloud/bigtable/internal/legacy_async_row_sampler.cc deleted file mode 100644 index 9ed3f3065b620..0000000000000 --- a/google/cloud/bigtable/internal/legacy_async_row_sampler.cc +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/legacy_async_row_sampler.h" -#include "google/cloud/grpc_error_delegate.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { - -namespace btproto = ::google::bigtable::v2; - -future>> LegacyAsyncRowSampler::Create( - CompletionQueue cq, std::shared_ptr client, - std::unique_ptr rpc_retry_policy, - std::unique_ptr rpc_backoff_policy, - MetadataUpdatePolicy metadata_update_policy, std::string app_profile_id, - std::string table_name) { - std::shared_ptr sampler(new LegacyAsyncRowSampler( - std::move(cq), std::move(client), std::move(rpc_retry_policy), - std::move(rpc_backoff_policy), std::move(metadata_update_policy), - std::move(app_profile_id), std::move(table_name))); - sampler->StartIteration(); - return sampler->promise_.get_future(); -} - -LegacyAsyncRowSampler::LegacyAsyncRowSampler( - CompletionQueue cq, std::shared_ptr client, - std::unique_ptr rpc_retry_policy, - std::unique_ptr rpc_backoff_policy, - MetadataUpdatePolicy metadata_update_policy, std::string app_profile_id, - std::string table_name) - : cq_(std::move(cq)), - client_(std::move(client)), - rpc_retry_policy_(std::move(rpc_retry_policy)), - rpc_backoff_policy_(std::move(rpc_backoff_policy)), - metadata_update_policy_(std::move(metadata_update_policy)), - app_profile_id_(std::move(app_profile_id)), - table_name_(std::move(table_name)), - promise_([this] { keep_reading_ = false; }) {} - -void LegacyAsyncRowSampler::StartIteration() { - btproto::SampleRowKeysRequest request; - request.set_app_profile_id(app_profile_id_); - request.set_table_name(table_name_); - - auto context = std::make_unique(); - rpc_retry_policy_->Setup(*context); - rpc_backoff_policy_->Setup(*context); - metadata_update_policy_.Setup(*context); - - auto& client = client_; - auto self = this->shared_from_this(); - cq_.MakeStreamingReadRpc( - [client](grpc::ClientContext* context, - btproto::SampleRowKeysRequest const& request, - grpc::CompletionQueue* cq) { - return client->PrepareAsyncSampleRowKeys(context, request, cq); - }, - request, std::move(context), - [self](btproto::SampleRowKeysResponse response) { - return self->OnRead(std::move(response)); - }, - [self](Status const& status) { self->OnFinish(status); }); -} - -future LegacyAsyncRowSampler::OnRead( - btproto::SampleRowKeysResponse response) { - RowKeySample row_sample; - row_sample.offset_bytes = response.offset_bytes(); - row_sample.row_key = std::move(*response.mutable_row_key()); - samples_.emplace_back(std::move(row_sample)); - return make_ready_future(keep_reading_.load()); -} - -void LegacyAsyncRowSampler::OnFinish(Status const& status) { - if (status.ok()) { - promise_.set_value(std::move(samples_)); - return; - } - if (!rpc_retry_policy_->OnFailure(status)) { - promise_.set_value(status); - return; - } - - using TimerFuture = future>; - - samples_.clear(); - auto self = this->shared_from_this(); - auto delay = rpc_backoff_policy_->OnCompletion(std::move(status)); - cq_.MakeRelativeTimer(delay).then([self](TimerFuture result) { - if (result.get()) { - self->StartIteration(); - } else { - self->promise_.set_value( - Status(StatusCode::kCancelled, "call cancelled")); - } - }); -} - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/internal/legacy_async_row_sampler.h b/google/cloud/bigtable/internal/legacy_async_row_sampler.h deleted file mode 100644 index 8627501afa627..0000000000000 --- a/google/cloud/bigtable/internal/legacy_async_row_sampler.h +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_LEGACY_ASYNC_ROW_SAMPLER_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_LEGACY_ASYNC_ROW_SAMPLER_H - -#include "google/cloud/bigtable/completion_queue.h" -#include "google/cloud/bigtable/data_client.h" -#include "google/cloud/bigtable/metadata_update_policy.h" -#include "google/cloud/bigtable/row_key_sample.h" -#include "google/cloud/bigtable/rpc_backoff_policy.h" -#include "google/cloud/bigtable/rpc_retry_policy.h" -#include "google/cloud/bigtable/version.h" -#include "google/cloud/future_generic.h" -#include "google/cloud/status.h" -#include "google/cloud/status_or.h" -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { - -/** - * Objects of this class represent the state of receiving row keys via - * AsyncSampleRows. - */ -class LegacyAsyncRowSampler - : public std::enable_shared_from_this { - public: - static future>> Create( - CompletionQueue cq, std::shared_ptr client, - std::unique_ptr rpc_retry_policy, - std::unique_ptr rpc_backoff_policy, - MetadataUpdatePolicy metadata_update_policy, std::string app_profile_id, - std::string table_name); - - private: - LegacyAsyncRowSampler(CompletionQueue cq, std::shared_ptr client, - std::unique_ptr rpc_retry_policy, - std::unique_ptr rpc_backoff_policy, - MetadataUpdatePolicy metadata_update_policy, - std::string app_profile_id, std::string table_name); - - void StartIteration(); - future OnRead(google::bigtable::v2::SampleRowKeysResponse response); - void OnFinish(Status const& status); - - CompletionQueue cq_; - std::shared_ptr client_; - std::unique_ptr rpc_retry_policy_; - std::unique_ptr rpc_backoff_policy_; - MetadataUpdatePolicy metadata_update_policy_; - std::string app_profile_id_; - std::string table_name_; - - std::atomic keep_reading_{true}; - std::vector samples_; - promise>> promise_; -}; - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_LEGACY_ASYNC_ROW_SAMPLER_H diff --git a/google/cloud/bigtable/internal/legacy_async_row_sampler_test.cc b/google/cloud/bigtable/internal/legacy_async_row_sampler_test.cc deleted file mode 100644 index c048d81143a74..0000000000000 --- a/google/cloud/bigtable/internal/legacy_async_row_sampler_test.cc +++ /dev/null @@ -1,462 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/legacy_async_row_sampler.h" -#include "google/cloud/bigtable/testing/mock_policies.h" -#include "google/cloud/bigtable/testing/mock_response_reader.h" -#include "google/cloud/bigtable/testing/table_test_fixture.h" -#include "google/cloud/testing_util/fake_completion_queue_impl.h" -#include "google/cloud/testing_util/status_matchers.h" -#include -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace btproto = ::google::bigtable::v2; - -using ::google::cloud::bigtable::testing::MockBackoffPolicy; -using ::google::cloud::bigtable::testing::MockClientAsyncReaderInterface; -using ::google::cloud::testing_util::FakeCompletionQueueImpl; -using ::google::cloud::testing_util::StatusIs; -using ::testing::ElementsAre; -using ::testing::HasSubstr; - -class AsyncSampleRowKeysTest : public bigtable::testing::TableTestFixture { - protected: - AsyncSampleRowKeysTest() - : TableTestFixture( - CompletionQueue(std::make_shared())), - rpc_retry_policy_( - bigtable::DefaultRPCRetryPolicy(internal::kBigtableLimits)), - metadata_update_policy_("my_table", MetadataParamTypes::NAME) {} - - std::shared_ptr rpc_retry_policy_; - MetadataUpdatePolicy metadata_update_policy_; -}; - -struct RowKeySampleVectors { - explicit RowKeySampleVectors(std::vector samples) { - row_keys.reserve(samples.size()); - offset_bytes.reserve(samples.size()); - for (auto& sample : samples) { - row_keys.emplace_back(std::move(sample.row_key)); - offset_bytes.emplace_back(std::move(sample.offset_bytes)); - } - } - - std::vector row_keys; - std::vector offset_bytes; -}; - -TEST_F(AsyncSampleRowKeysTest, Simple) { - EXPECT_CALL(*client_, PrepareAsyncSampleRowKeys) - .WillOnce([](grpc::ClientContext*, btproto::SampleRowKeysRequest const&, - grpc::CompletionQueue*) { - auto reader = std::make_unique< - MockClientAsyncReaderInterface>(); - EXPECT_CALL(*reader, StartCall); - EXPECT_CALL(*reader, Read) - .WillOnce([](btproto::SampleRowKeysResponse* r, void*) { - { - r->set_row_key("test1"); - r->set_offset_bytes(11); - } - }) - .WillOnce([](btproto::SampleRowKeysResponse* r, void*) { - { - r->set_row_key("test2"); - r->set_offset_bytes(22); - } - }) - .WillOnce([](btproto::SampleRowKeysResponse*, void*) {}); - - EXPECT_CALL(*reader, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - return reader; - }); - - auto samples_future = table_.AsyncSampleRows(); - - // Start() - cq_impl_->SimulateCompletion(true); - // Return response 1 - cq_impl_->SimulateCompletion(true); - // Return response 2 - cq_impl_->SimulateCompletion(true); - // End stream - cq_impl_->SimulateCompletion(false); - // Finish() - cq_impl_->SimulateCompletion(true); - - auto status = samples_future.get(); - ASSERT_STATUS_OK(status); - - auto samples = RowKeySampleVectors(status.value()); - EXPECT_THAT(samples.row_keys, ElementsAre("test1", "test2")); - EXPECT_THAT(samples.offset_bytes, ElementsAre(11, 22)); -} - -TEST_F(AsyncSampleRowKeysTest, Retry) { - EXPECT_CALL(*client_, PrepareAsyncSampleRowKeys) - .WillOnce([](grpc::ClientContext*, btproto::SampleRowKeysRequest const&, - grpc::CompletionQueue*) { - auto reader = std::make_unique< - MockClientAsyncReaderInterface>(); - EXPECT_CALL(*reader, StartCall); - EXPECT_CALL(*reader, Read) - .WillOnce([](btproto::SampleRowKeysResponse* r, void*) { - { - r->set_row_key("test1"); - r->set_offset_bytes(11); - } - }) - .WillOnce([](btproto::SampleRowKeysResponse*, void*) {}); - - EXPECT_CALL(*reader, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status(grpc::StatusCode::UNAVAILABLE, "try again"); - }); - return reader; - }) - .WillOnce([](grpc::ClientContext*, btproto::SampleRowKeysRequest const&, - grpc::CompletionQueue*) { - auto reader = std::make_unique< - MockClientAsyncReaderInterface>(); - EXPECT_CALL(*reader, StartCall); - EXPECT_CALL(*reader, Read) - .WillOnce([](btproto::SampleRowKeysResponse* r, void*) { - { - r->set_row_key("test2"); - r->set_offset_bytes(22); - } - }) - .WillOnce([](btproto::SampleRowKeysResponse*, void*) {}); - EXPECT_CALL(*reader, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - return reader; - }); - - auto samples_future = table_.AsyncSampleRows(); - - // Start() - cq_impl_->SimulateCompletion(true); - // Return response - cq_impl_->SimulateCompletion(true); - // End stream - cq_impl_->SimulateCompletion(false); - // Finish() - cq_impl_->SimulateCompletion(true); - // Simulate the backoff timer - cq_impl_->SimulateCompletion(true); - - ASSERT_EQ(1U, cq_impl_->size()); - - // Start() - cq_impl_->SimulateCompletion(true); - // Return response - cq_impl_->SimulateCompletion(true); - // End stream - cq_impl_->SimulateCompletion(false); - // Finish() - cq_impl_->SimulateCompletion(true); - - ASSERT_EQ(0U, cq_impl_->size()); - - auto status = samples_future.get(); - ASSERT_STATUS_OK(status); - - auto samples = RowKeySampleVectors(status.value()); - EXPECT_THAT(samples.row_keys, ElementsAre("test2")); - EXPECT_THAT(samples.offset_bytes, ElementsAre(22)); -} - -TEST_F(AsyncSampleRowKeysTest, TooManyFailures) { - // We give up on the 3rd error. - auto constexpr kErrorCount = 2; - Table custom_table(client_, "foo_table", - LimitedErrorCountRetryPolicy(kErrorCount)); - - EXPECT_CALL(*client_, PrepareAsyncSampleRowKeys) - .Times(kErrorCount + 1) - .WillRepeatedly([](grpc::ClientContext*, - btproto::SampleRowKeysRequest const&, - grpc::CompletionQueue*) { - auto reader = std::make_unique< - MockClientAsyncReaderInterface>(); - EXPECT_CALL(*reader, StartCall); - EXPECT_CALL(*reader, Read).Times(2); - EXPECT_CALL(*reader, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status(grpc::StatusCode::UNAVAILABLE, "try again"); - }); - return reader; - }); - - auto samples_future = custom_table.AsyncSampleRows(); - - for (int retry = 0; retry < kErrorCount; ++retry) { - // Start() - cq_impl_->SimulateCompletion(true); - // Return response - cq_impl_->SimulateCompletion(true); - // End stream - cq_impl_->SimulateCompletion(false); - // Finish() - cq_impl_->SimulateCompletion(true); - // Simulate the backoff timer - cq_impl_->SimulateCompletion(true); - - ASSERT_EQ(1U, cq_impl_->size()); - } - - // Start() - cq_impl_->SimulateCompletion(true); - // Return response - cq_impl_->SimulateCompletion(true); - // End stream - cq_impl_->SimulateCompletion(false); - // Finish() - cq_impl_->SimulateCompletion(true); - - auto status = samples_future.get(); - ASSERT_THAT(status, - StatusIs(StatusCode::kUnavailable, HasSubstr("try again"))); - - ASSERT_EQ(0U, cq_impl_->size()); -} - -TEST_F(AsyncSampleRowKeysTest, UsesBackoff) { - auto grpc_error = grpc::Status(grpc::StatusCode::UNAVAILABLE, "try again"); - auto error = MakeStatusFromRpcError(grpc_error); - - std::unique_ptr mock(new MockBackoffPolicy); - EXPECT_CALL(*mock, Setup).Times(2); - EXPECT_CALL(*mock, OnCompletion(error)); - - EXPECT_CALL(*client_, PrepareAsyncSampleRowKeys) - .WillOnce([grpc_error](grpc::ClientContext*, - btproto::SampleRowKeysRequest const&, - grpc::CompletionQueue*) { - auto reader = std::make_unique< - MockClientAsyncReaderInterface>(); - EXPECT_CALL(*reader, StartCall); - EXPECT_CALL(*reader, Read).Times(2); - EXPECT_CALL(*reader, Finish) - .WillOnce([grpc_error](grpc::Status* status, void*) { - *status = grpc_error; - }); - return reader; - }) - .WillOnce([](grpc::ClientContext*, btproto::SampleRowKeysRequest const&, - grpc::CompletionQueue*) { - auto reader = std::make_unique< - MockClientAsyncReaderInterface>(); - EXPECT_CALL(*reader, StartCall); - EXPECT_CALL(*reader, Read).Times(2); - EXPECT_CALL(*reader, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - return reader; - }); - - auto samples_future = internal::LegacyAsyncRowSampler::Create( - cq_, client_, rpc_retry_policy_->clone(), std::move(mock), - metadata_update_policy_, "my-app-profile", "my-table"); - - // Start() - cq_impl_->SimulateCompletion(true); - // Return response - cq_impl_->SimulateCompletion(true); - // End stream - cq_impl_->SimulateCompletion(false); - // Finish() - cq_impl_->SimulateCompletion(true); - // Simulate the backoff timer - cq_impl_->SimulateCompletion(true); - - ASSERT_EQ(1U, cq_impl_->size()); - - // Start() - cq_impl_->SimulateCompletion(true); - // Return response - cq_impl_->SimulateCompletion(true); - // End stream - cq_impl_->SimulateCompletion(false); - // Finish() - cq_impl_->SimulateCompletion(true); - - ASSERT_EQ(0U, cq_impl_->size()); -} - -TEST_F(AsyncSampleRowKeysTest, CancelDuringBackoff) { - auto grpc_error = grpc::Status(grpc::StatusCode::UNAVAILABLE, "try again"); - auto error = MakeStatusFromRpcError(grpc_error); - - std::unique_ptr mock(new MockBackoffPolicy); - EXPECT_CALL(*mock, Setup); - EXPECT_CALL(*mock, OnCompletion(error)); - - EXPECT_CALL(*client_, PrepareAsyncSampleRowKeys) - .WillOnce([grpc_error](grpc::ClientContext*, - btproto::SampleRowKeysRequest const&, - grpc::CompletionQueue*) { - auto reader = std::make_unique< - MockClientAsyncReaderInterface>(); - EXPECT_CALL(*reader, StartCall); - EXPECT_CALL(*reader, Read).Times(2); - EXPECT_CALL(*reader, Finish) - .WillOnce([grpc_error](grpc::Status* status, void*) { - *status = grpc_error; - }); - return reader; - }); - - auto samples_future = internal::LegacyAsyncRowSampler::Create( - cq_, client_, rpc_retry_policy_->clone(), std::move(mock), - metadata_update_policy_, "my-app-profile", "my-table"); - - // Start() - cq_impl_->SimulateCompletion(true); - // Return response - cq_impl_->SimulateCompletion(true); - // End stream - cq_impl_->SimulateCompletion(false); - // Finish() - cq_impl_->SimulateCompletion(true); - - ASSERT_EQ(1U, cq_impl_->size()); - - // Cancel the pending operation. - samples_future.cancel(); - // Simulate the backoff timer - cq_impl_->SimulateCompletion(false); - - ASSERT_EQ(0U, cq_impl_->size()); - - auto status = samples_future.get(); - ASSERT_THAT(status, - StatusIs(StatusCode::kCancelled, HasSubstr("call cancelled"))); -} - -TEST_F(AsyncSampleRowKeysTest, CancelAfterSuccess) { - EXPECT_CALL(*client_, PrepareAsyncSampleRowKeys) - .WillOnce([](grpc::ClientContext*, btproto::SampleRowKeysRequest const&, - grpc::CompletionQueue*) { - auto reader = std::make_unique< - MockClientAsyncReaderInterface>(); - EXPECT_CALL(*reader, StartCall); - EXPECT_CALL(*reader, Read) - .WillOnce([](btproto::SampleRowKeysResponse* r, void*) { - { - r->set_row_key("test1"); - r->set_offset_bytes(11); - } - }) - .WillOnce([](btproto::SampleRowKeysResponse*, void*) {}); - - EXPECT_CALL(*reader, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status::OK; - }); - return reader; - }); - - auto samples_future = table_.AsyncSampleRows(); - // samples_future.cancel(); - - // Start() - cq_impl_->SimulateCompletion(true); - // Return response - cq_impl_->SimulateCompletion(true); - - // Cancel the pending operation - samples_future.cancel(); - - // End stream - cq_impl_->SimulateCompletion(false); - // Finish() - cq_impl_->SimulateCompletion(true); - - auto status = samples_future.get(); - ASSERT_STATUS_OK(status); - - auto samples = RowKeySampleVectors(status.value()); - EXPECT_THAT(samples.row_keys, ElementsAre("test1")); - EXPECT_THAT(samples.offset_bytes, ElementsAre(11)); -} - -TEST_F(AsyncSampleRowKeysTest, CancelMidStream) { - EXPECT_CALL(*client_, PrepareAsyncSampleRowKeys) - .WillOnce([](grpc::ClientContext*, btproto::SampleRowKeysRequest const&, - grpc::CompletionQueue*) { - auto reader = std::make_unique< - MockClientAsyncReaderInterface>(); - EXPECT_CALL(*reader, StartCall); - EXPECT_CALL(*reader, Read) - .WillOnce([](btproto::SampleRowKeysResponse* r, void*) { - { - r->set_row_key("test1"); - r->set_offset_bytes(11); - } - }) - .WillOnce([](btproto::SampleRowKeysResponse* r, void*) { - { - r->set_row_key("test2"); - r->set_offset_bytes(22); - } - }) - .WillOnce([](btproto::SampleRowKeysResponse* r, void*) { - { - r->set_row_key("test3"); - r->set_offset_bytes(33); - } - }); - EXPECT_CALL(*reader, Finish).WillOnce([](grpc::Status* status, void*) { - *status = grpc::Status(grpc::StatusCode::CANCELLED, "User cancelled"); - }); - return reader; - }); - - auto samples_future = table_.AsyncSampleRows(); - - // Start() - cq_impl_->SimulateCompletion(true); - // Return response 1 - cq_impl_->SimulateCompletion(true); - // Cancel the pending operation - samples_future.cancel(); - // Return response 2 - cq_impl_->SimulateCompletion(true); - // Return response 3 - cq_impl_->SimulateCompletion(false); - // Finish() - cq_impl_->SimulateCompletion(true); - - auto status = samples_future.get(); - EXPECT_THAT(status, - StatusIs(StatusCode::kCancelled, HasSubstr("User cancelled"))); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/internal/legacy_bulk_mutator_test.cc b/google/cloud/bigtable/internal/legacy_bulk_mutator_test.cc deleted file mode 100644 index 5674b8aff7390..0000000000000 --- a/google/cloud/bigtable/internal/legacy_bulk_mutator_test.cc +++ /dev/null @@ -1,496 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/bulk_mutator.h" -#include "google/cloud/bigtable/testing/mock_data_client.h" -#include "google/cloud/bigtable/testing/mock_mutate_rows_reader.h" -#include "google/cloud/bigtable/testing/mock_response_reader.h" -#include "google/cloud/testing_util/chrono_literals.h" -#include "google/cloud/testing_util/fake_completion_queue_impl.h" - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace btproto = ::google::bigtable::v2; -using ::testing::Return; -using ::google::cloud::testing_util::chrono_literals::operator""_ms; -using ::google::cloud::bigtable::testing::MockMutateRowsReader; - -auto constexpr kTableName = "projects/blah/instances/blah2/tables/table"; - -std::unique_ptr TestContext( - std::string const& app_profile_id = "") { - auto context = std::make_unique(); - bigtable_internal::MakeMetadataUpdatePolicy(kTableName, app_profile_id) - .Setup(*context); - return context; -} - -/// @test Verify that MultipleRowsMutator handles easy cases. -TEST(MultipleRowsMutatorTest, Simple) { - // In this test we create a Mutation for two rows, which succeeds in the - // first RPC request. First create the mutation. - BulkMutation mut( - SingleRowMutation("foo", {SetCell("fam", "col", 0_ms, "baz")}), - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")})); - - // Prepare the mocks. The mutator should issue a RPC which must return a - // stream of responses, we prepare the stream first because it is easier than - // to create one of the fly. - auto reader = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*reader, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - { - auto& e = *r->add_entries(); - e.set_index(0); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - { - auto& e = *r->add_entries(); - e.set_index(1); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*reader, Finish()).WillOnce(Return(grpc::Status::OK)); - - // Now prepare the client for the one request. - bigtable::testing::MockDataClient client; - EXPECT_CALL(client, MutateRows) - .WillOnce(reader.release()->MakeMockReturner()); - - auto policy = DefaultIdempotentMutationPolicy(); - bigtable_internal::BulkMutator mutator( - "", kTableName, *policy, std::move(mut), - std::make_shared()); - - EXPECT_TRUE(mutator.HasPendingMutations()); - auto context = TestContext(); - auto status = mutator.MakeOneRequest(client, *context); - EXPECT_TRUE(status.ok()); - auto failures = std::move(mutator).OnRetryDone(); - EXPECT_TRUE(failures.empty()); -} - -/// @test Verify that MultipleRowsMutator uses app_profile_id when set. -TEST(MultipleRowsMutatorTest, BulkApplyAppProfileId) { - namespace btproto = ::google::bigtable::v2; - - // In this test we create a Mutation for two rows, which succeeds in the - // first RPC request. First create the mutation. - BulkMutation mut( - SingleRowMutation("foo", {SetCell("fam", "col", 0_ms, "baz")}), - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")})); - - // Prepare the mocks. The mutator should issue a RPC which must return a - // stream of responses, we prepare the stream first because it is easier than - // to create one of the fly. - - // Now prepare the client for the one request. - std::string expected_id = "test-id"; - bigtable::testing::MockDataClient client; - EXPECT_CALL(client, MutateRows) - .WillOnce([expected_id](grpc::ClientContext*, - btproto::MutateRowsRequest const& req) { - auto reader = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*reader, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - { - auto& e = *r->add_entries(); - e.set_index(0); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - { - auto& e = *r->add_entries(); - e.set_index(1); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*reader, Finish()).WillOnce(Return(grpc::Status::OK)); - EXPECT_EQ(expected_id, req.app_profile_id()); - return reader; - }); - - auto policy = DefaultIdempotentMutationPolicy(); - bigtable_internal::BulkMutator mutator( - "test-id", kTableName, *policy, std::move(mut), - std::make_shared()); - - EXPECT_TRUE(mutator.HasPendingMutations()); - auto context = TestContext("test-id"); - auto status = mutator.MakeOneRequest(client, *context); - EXPECT_TRUE(status.ok()); - auto failures = std::move(mutator).OnRetryDone(); - EXPECT_TRUE(failures.empty()); -} - -/// @test Verify that MultipleRowsMutator retries partial failures. -TEST(MultipleRowsMutatorTest, RetryPartialFailure) { - // In this test we create a Mutation for two rows, one of which will fail. - // First create the mutation. - BulkMutation mut( - SingleRowMutation("foo", {SetCell("fam", "col", 0_ms, "baz")}), - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")})); - - // Prepare the mocks for the request. First create a stream response which - // indicates a partial failure. - - // Setup the client to response with r1 first, and r2 next. - bigtable::testing::MockDataClient client; - EXPECT_CALL(client, MutateRows) - .WillOnce( - [](grpc::ClientContext*, btproto::MutateRowsRequest const& req) { - EXPECT_EQ(kTableName, req.table_name()); - auto r1 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r1, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - // Simulate a partial (and recoverable) failure. - auto& e0 = *r->add_entries(); - e0.set_index(0); - e0.mutable_status()->set_code(grpc::StatusCode::UNAVAILABLE); - auto& e1 = *r->add_entries(); - e1.set_index(1); - e1.mutable_status()->set_code(grpc::StatusCode::OK); - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r1, Finish).WillOnce(Return(grpc::Status::OK)); - return r1; - }) - .WillOnce( - [](grpc::ClientContext*, btproto::MutateRowsRequest const& req) { - EXPECT_EQ(kTableName, req.table_name()); - // Prepare a second stream response, because the client should retry - // after the partial failure. - auto r2 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r2, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - { - auto& e = *r->add_entries(); - e.set_index(0); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r2, Finish).WillOnce(Return(grpc::Status::OK)); - return r2; - }); - - auto policy = DefaultIdempotentMutationPolicy(); - bigtable_internal::BulkMutator mutator( - "", kTableName, *policy, std::move(mut), - std::make_shared()); - - // This work will be in BulkApply(), but this is the test for BulkMutator in - // isolation, so call MakeOneRequest() twice, for the r1, and the r2 cases. - for (int i = 0; i != 2; ++i) { - EXPECT_TRUE(mutator.HasPendingMutations()); - auto context = TestContext(); - auto status = mutator.MakeOneRequest(client, *context); - EXPECT_TRUE(status.ok()); - } - auto failures = std::move(mutator).OnRetryDone(); - EXPECT_TRUE(failures.empty()); -} - -/// @test Verify that MultipleRowsMutator handles permanent failures. -TEST(MultipleRowsMutatorTest, PermanentFailure) { - // In this test we handle a recoverable and one unrecoverable failures. - // Create a bulk mutation with two SetCell() mutations. - BulkMutation mut( - SingleRowMutation("foo", {SetCell("fam", "col", 0_ms, "baz")}), - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")})); - - // Make the first RPC return one recoverable and one unrecoverable failures. - auto r1 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r1, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - // Simulate a partial failure, which is recoverable for this first - // element. - auto& e0 = *r->add_entries(); - e0.set_index(0); - e0.mutable_status()->set_code(grpc::StatusCode::UNAVAILABLE); - // Simulate an unrecoverable failure for the second element. - auto& e1 = *r->add_entries(); - e1.set_index(1); - e1.mutable_status()->set_code(grpc::StatusCode::OUT_OF_RANGE); - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r1, Finish()).WillOnce(Return(grpc::Status::OK)); - - // The BulkMutator should issue a second request, which will return success - // for the remaining mutation. - auto r2 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r2, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - { - auto& e = *r->add_entries(); - e.set_index(0); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r2, Finish()).WillOnce(Return(grpc::Status::OK)); - - bigtable::testing::MockDataClient client; - EXPECT_CALL(client, MutateRows) - .WillOnce(r1.release()->MakeMockReturner()) - .WillOnce(r2.release()->MakeMockReturner()); - - auto policy = DefaultIdempotentMutationPolicy(); - bigtable_internal::BulkMutator mutator( - "", kTableName, *policy, std::move(mut), - std::make_shared()); - - // This work will be in BulkApply(), but this is the test for BulkMutator in - // isolation, so call MakeOneRequest() twice, for the r1, and the r2 cases. - for (int i = 0; i != 2; ++i) { - EXPECT_TRUE(mutator.HasPendingMutations()); - auto context = TestContext(); - auto status = mutator.MakeOneRequest(client, *context); - EXPECT_TRUE(status.ok()); - } - auto failures = std::move(mutator).OnRetryDone(); - ASSERT_EQ(1UL, failures.size()); - EXPECT_EQ(1, failures[0].original_index()); - // EXPECT_EQ("bar", failures[0].mutation().row_key()); - EXPECT_EQ(google::cloud::StatusCode::kOutOfRange, - failures[0].status().code()); -} - -/// @test Verify that MultipleRowsMutator handles a stream with partial results -TEST(MultipleRowsMutatorTest, PartialStream) { - // We are going to test the case where the stream does not contain a response - // for all requests. Create a BulkMutation with two entries. - BulkMutation mut( - SingleRowMutation("foo", {SetCell("fam", "col", 0_ms, "baz")}), - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")})); - - // This will be the stream returned by the first request. It is missing - // information about one of the mutations. - auto r1 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r1, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - auto& e0 = *r->add_entries(); - e0.set_index(0); - e0.mutable_status()->set_code(grpc::StatusCode::OK); - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r1, Finish()).WillOnce(Return(grpc::Status::OK)); - - // The BulkMutation should issue a second request, this is the stream returned - // by the second request, which indicates success for the missed mutation - // on r1. - auto r2 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r2, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - { - auto& e = *r->add_entries(); - e.set_index(0); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r2, Finish()).WillOnce(Return(grpc::Status::OK)); - - bigtable::testing::MockDataClient client; - EXPECT_CALL(client, MutateRows) - .WillOnce(r1.release()->MakeMockReturner()) - .WillOnce(r2.release()->MakeMockReturner()); - - auto policy = DefaultIdempotentMutationPolicy(); - bigtable_internal::BulkMutator mutator( - "", kTableName, *policy, std::move(mut), - std::make_shared()); - - // This work will be in BulkApply(), but this is the test for BulkMutator in - // isolation, so call MakeOneRequest() twice: for the r1 and r2 cases. - for (int i = 0; i != 2; ++i) { - EXPECT_TRUE(mutator.HasPendingMutations()); - auto context = TestContext(); - auto status = mutator.MakeOneRequest(client, *context); - EXPECT_TRUE(status.ok()); - } - auto failures = std::move(mutator).OnRetryDone(); - EXPECT_TRUE(failures.empty()); -} - -/// @test Verify that MultipleRowsMutator only retries idempotent mutations -TEST(MultipleRowsMutatorTest, RetryOnlyIdempotent) { - // Create a BulkMutation with a non-idempotent mutation. - BulkMutation mut( - SingleRowMutation("foo", {SetCell("fam", "col", "baz")}), - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")}), - SingleRowMutation("baz", {SetCell("fam", "col", "v")}), - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")})); - - // We will setup the mock to return recoverable failures for idempotent - // mutations. - - // Verify that the second response has the right contents. It is easier (and - // more readable) to write these in a separate small lambda expression because - // ASSERT_EQ() has an embedded "return;" in it, which does not play well with - // the rest of the stuff here. - auto expect_r2 = [](btproto::MutateRowsRequest const& r) { - ASSERT_EQ(2, r.entries_size()); - EXPECT_EQ("bar", r.entries(0).row_key()); - }; - bigtable::testing::MockDataClient client; - EXPECT_CALL(client, MutateRows) - .WillOnce([](grpc::ClientContext*, btproto::MutateRowsRequest const& r) { - EXPECT_EQ(4, r.entries_size()); - auto r1 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r1, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - // Simulate recoverable failures for both elements. - auto& e0 = *r->add_entries(); - e0.set_index(0); - e0.mutable_status()->set_code(grpc::StatusCode::UNAVAILABLE); - auto& e1 = *r->add_entries(); - e1.set_index(1); - e1.mutable_status()->set_code(grpc::StatusCode::UNAVAILABLE); - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r1, Finish).WillOnce(Return(grpc::Status::OK)); - return r1; - }) - .WillOnce([expect_r2](grpc::ClientContext*, - btproto::MutateRowsRequest const& r) { - expect_r2(r); - // The BulkMutator should issue a second request, with only the - // idempotent mutations, make the mocks return success for them. - auto r2 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r2, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - { - auto& e = *r->add_entries(); - e.set_index(0); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r2, Finish).WillOnce(Return(grpc::Status::OK)); - - return r2; - }); - - auto policy = DefaultIdempotentMutationPolicy(); - bigtable_internal::BulkMutator mutator( - "", kTableName, *policy, std::move(mut), - std::make_shared()); - - // This work will be in BulkApply(), but this is the test for BulkMutator in - // isolation, so call MakeOneRequest() twice, for the r1, and the r2 cases. - for (int i = 0; i != 2; ++i) { - EXPECT_TRUE(mutator.HasPendingMutations()); - auto context = TestContext(); - auto status = mutator.MakeOneRequest(client, *context); - EXPECT_TRUE(status.ok()); - } - auto failures = std::move(mutator).OnRetryDone(); - ASSERT_EQ(3UL, failures.size()); - EXPECT_EQ(0, failures[0].original_index()); - // EXPECT_EQ("foo", failures[0].mutation().row_key()); - EXPECT_EQ(google::cloud::StatusCode::kUnavailable, - failures[0].status().code()); - - EXPECT_EQ(2, failures[1].original_index()); - // EXPECT_EQ("baz", failures[1].mutation().row_key()); - EXPECT_EQ(google::cloud::StatusCode::kInternal, failures[1].status().code()); - EXPECT_EQ(google::cloud::StatusCode::kInternal, failures[2].status().code()); -} - -TEST(MultipleRowsMutatorTest, UnconfirmedAreFailed) { - // Make sure that mutations which are not confirmed are reported as UNKNOWN - // with the proper index. - BulkMutation mut(SingleRowMutation("foo", {SetCell("fam", "col", "baz")}), - // this one will be unconfirmed - SingleRowMutation("bar", {SetCell("fam", "col", "qux")}), - SingleRowMutation("baz", {SetCell("fam", "col", "v")})); - - // We will setup the mock to return recoverable failures for idempotent - // mutations. - - // The BulkMutator should not issue a second request because the error is - // PERMISSION_DENIED (not retryable). - - bigtable::testing::MockDataClient client; - EXPECT_CALL(client, MutateRows) - .WillOnce([](grpc::ClientContext*, btproto::MutateRowsRequest const& r) { - EXPECT_EQ(3, r.entries_size()); - auto r1 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r1, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - auto& e0 = *r->add_entries(); - e0.set_index(0); - e0.mutable_status()->set_code(grpc::StatusCode::OK); - auto& e1 = *r->add_entries(); - e1.set_index(2); - e1.mutable_status()->set_code(grpc::StatusCode::OK); - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r1, Finish) - .WillOnce( - Return(grpc::Status(grpc::StatusCode::PERMISSION_DENIED, ""))); - return r1; - }); - - auto policy = DefaultIdempotentMutationPolicy(); - bigtable_internal::BulkMutator mutator( - "", kTableName, *policy, std::move(mut), - std::make_shared()); - - EXPECT_TRUE(mutator.HasPendingMutations()); - auto context = TestContext(); - auto status = mutator.MakeOneRequest(client, *context); - EXPECT_FALSE(status.ok()); - - auto failures = std::move(mutator).OnRetryDone(); - ASSERT_EQ(1UL, failures.size()); - EXPECT_EQ(1, failures[0].original_index()); - // EXPECT_EQ("bar", failures[0].mutation().row_key()); - EXPECT_EQ(google::cloud::StatusCode::kPermissionDenied, - failures.front().status().code()); -} - -} // anonymous namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/internal/legacy_row_reader.cc b/google/cloud/bigtable/internal/legacy_row_reader.cc deleted file mode 100644 index 62eeafff9ca3e..0000000000000 --- a/google/cloud/bigtable/internal/legacy_row_reader.cc +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/legacy_row_reader.h" -#include "google/cloud/bigtable/table.h" -#include "google/cloud/grpc_error_delegate.h" -#include "google/cloud/internal/throw_delegate.h" -#include "google/cloud/log.h" -#include - -namespace google { -namespace cloud { -namespace bigtable_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -LegacyRowReader::LegacyRowReader( - std::shared_ptr client, std::string table_name, - bigtable::RowSet row_set, std::int64_t rows_limit, bigtable::Filter filter, - std::unique_ptr retry_policy, - std::unique_ptr backoff_policy, - bigtable::MetadataUpdatePolicy metadata_update_policy, - std::unique_ptr parser_factory) - : LegacyRowReader(std::move(client), std::string(""), std::move(table_name), - std::move(row_set), rows_limit, std::move(filter), - std::move(retry_policy), std::move(backoff_policy), - std::move(metadata_update_policy), - std::move(parser_factory)) {} - -LegacyRowReader::LegacyRowReader( - std::shared_ptr client, std::string app_profile_id, - std::string table_name, bigtable::RowSet row_set, std::int64_t rows_limit, - bigtable::Filter filter, - std::unique_ptr retry_policy, - std::unique_ptr backoff_policy, - bigtable::MetadataUpdatePolicy metadata_update_policy, - std::unique_ptr parser_factory) - : client_(std::move(client)), - app_profile_id_(std::move(app_profile_id)), - table_name_(std::move(table_name)), - row_set_(std::move(row_set)), - rows_limit_(rows_limit), - filter_(std::move(filter)), - retry_policy_(std::move(retry_policy)), - backoff_policy_(std::move(backoff_policy)), - metadata_update_policy_(std::move(metadata_update_policy)), - parser_factory_(std::move(parser_factory)) {} - -void LegacyRowReader::MakeRequest() { - response_ = {}; - processed_chunks_count_ = 0; - - google::bigtable::v2::ReadRowsRequest request; - request.set_table_name(table_name_); - request.set_app_profile_id(app_profile_id_); - - auto row_set_proto = row_set_.as_proto(); - request.mutable_rows()->Swap(&row_set_proto); - - auto filter_proto = filter_.as_proto(); - request.mutable_filter()->Swap(&filter_proto); - - if (rows_limit_ != bigtable::RowReader::NO_ROWS_LIMIT) { - request.set_rows_limit(rows_limit_ - rows_count_); - } - - context_ = std::make_unique(); - retry_policy_->Setup(*context_); - backoff_policy_->Setup(*context_); - metadata_update_policy_.Setup(*context_); - stream_ = client_->ReadRows(context_.get(), request); - stream_is_open_ = true; - - parser_ = parser_factory_->Create(false); -} - -bool LegacyRowReader::NextChunk() { - ++processed_chunks_count_; - while (processed_chunks_count_ >= response_.chunks_size()) { - processed_chunks_count_ = 0; - bool response_is_valid = stream_->Read(&response_); - if (!response_is_valid) { - response_ = {}; - return false; - } - if (!response_.last_scanned_row_key().empty()) { - last_read_row_key_ = std::move(*response_.mutable_last_scanned_row_key()); - } - } - return true; -} - -absl::variant LegacyRowReader::Advance() { - if (operation_cancelled_) { - return Status(StatusCode::kCancelled, "Operation cancelled."); - } - while (true) { - auto variant = AdvanceOrFail(); - if (absl::holds_alternative(variant)) { - return absl::get(std::move(variant)); - } - - auto status = absl::get(std::move(variant)); - if (status.ok()) return Status{}; - - // In the unlikely case when we have already reached the requested - // number of rows and still receive an error (the parser can throw - // an error at end of stream for example), there is no need to - // retry and we have no good value for rows_limit anyway. - if (rows_limit_ != bigtable::RowReader::NO_ROWS_LIMIT && - rows_limit_ <= rows_count_) { - return Status{}; - } - - if (!last_read_row_key_.empty()) { - // We've returned some rows and need to make sure we don't - // request them again. - row_set_ = - row_set_.Intersect(bigtable::RowRange::Open(last_read_row_key_, "")); - } - - // If we receive an error, but the retryable set is empty, stop. - if (row_set_.IsEmpty()) return Status{}; - - if (!retry_policy_->OnFailure(status)) return status; - - auto delay = backoff_policy_->OnCompletion(status); - std::this_thread::sleep_for(delay); - - // If we reach this place, we failed and need to restart the call. - MakeRequest(); - } -} - -absl::variant LegacyRowReader::AdvanceOrFail() { - grpc::Status status; - if (!stream_) { - MakeRequest(); - } - while (!parser_->HasNext()) { - if (NextChunk()) { - parser_->HandleChunk( - std::move(*(response_.mutable_chunks(processed_chunks_count_))), - status); - if (!status.ok()) return MakeStatusFromRpcError(status); - continue; - } - - // Here, there are no more chunks to look at. Close the stream, - // finalize the parser and return OK with no rows unless something - // fails during cleanup. - stream_is_open_ = false; - status = stream_->Finish(); - if (!status.ok()) return MakeStatusFromRpcError(status); - parser_->HandleEndOfStream(status); - return MakeStatusFromRpcError(status); - } - - // We have a complete row in the parser. - bigtable::Row parsed_row = parser_->Next(status); - if (!status.ok()) return MakeStatusFromRpcError(status); - - ++rows_count_; - last_read_row_key_ = parsed_row.row_key(); - return parsed_row; -} - -void LegacyRowReader::Cancel() { - operation_cancelled_ = true; - if (!stream_is_open_) return; - context_->TryCancel(); - - // Also drain any data left unread - google::bigtable::v2::ReadRowsResponse response; - while (stream_->Read(&response)) { - } - - stream_is_open_ = false; - (void)stream_->Finish(); // ignore errors -} - -LegacyRowReader::~LegacyRowReader() { - // Make sure we don't leave open streams. - Cancel(); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/internal/legacy_row_reader.h b/google/cloud/bigtable/internal/legacy_row_reader.h deleted file mode 100644 index f1522eeb95819..0000000000000 --- a/google/cloud/bigtable/internal/legacy_row_reader.h +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_LEGACY_ROW_READER_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_LEGACY_ROW_READER_H - -#include "google/cloud/bigtable/data_client.h" -#include "google/cloud/bigtable/filters.h" -#include "google/cloud/bigtable/internal/readrowsparser.h" -#include "google/cloud/bigtable/internal/row_reader_impl.h" -#include "google/cloud/bigtable/metadata_update_policy.h" -#include "google/cloud/bigtable/row.h" -#include "google/cloud/bigtable/row_set.h" -#include "google/cloud/bigtable/rpc_backoff_policy.h" -#include "google/cloud/bigtable/rpc_retry_policy.h" -#include "google/cloud/bigtable/version.h" -#include "absl/types/variant.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * `RowReaderImpl` that interacts with the Bigtable service via `DataClient`. - */ -class LegacyRowReader : public RowReaderImpl { - public: - LegacyRowReader(std::shared_ptr client, - std::string table_name, bigtable::RowSet row_set, - std::int64_t rows_limit, bigtable::Filter filter, - std::unique_ptr retry_policy, - std::unique_ptr backoff_policy, - bigtable::MetadataUpdatePolicy metadata_update_policy, - std::unique_ptr - parser_factory); - - LegacyRowReader(std::shared_ptr client, - std::string app_profile_id, std::string table_name, - bigtable::RowSet row_set, std::int64_t rows_limit, - bigtable::Filter filter, - std::unique_ptr retry_policy, - std::unique_ptr backoff_policy, - bigtable::MetadataUpdatePolicy metadata_update_policy, - std::unique_ptr - parser_factory); - - ~LegacyRowReader() override; - - void Cancel() override; - - /** - * Read and parse the next row in the response. - * - * @param row receives the next row on success, and is reset on failure or if - * there are no more rows. - * - * This call possibly blocks waiting for data until a full row is available. - */ - absl::variant Advance() override; - - private: - /// Called by Advance(), does not handle retries. - absl::variant AdvanceOrFail(); - - /** - * Move the `processed_chunks_count_` index to the next chunk, - * reading data if needed. - * - * Returns false if no more chunks are available. - * - * This call is used internally by AdvanceOrFail to prepare data for - * parsing. When it returns true, the value of - * `response_.chunks(processed_chunks_count_)` is valid and holds - * the next chunk to parse. - */ - bool NextChunk(); - - /// Sends the ReadRows request to the stub. - void MakeRequest(); - - std::shared_ptr client_; - std::string app_profile_id_; - std::string table_name_; - bigtable::RowSet row_set_; - std::int64_t rows_limit_; - bigtable::Filter filter_; - std::unique_ptr retry_policy_; - std::unique_ptr backoff_policy_; - bigtable::MetadataUpdatePolicy metadata_update_policy_; - - std::unique_ptr context_; - - std::unique_ptr parser_factory_; - std::unique_ptr parser_; - std::unique_ptr< - grpc::ClientReaderInterface> - stream_; - bool stream_is_open_ = false; - bool operation_cancelled_ = false; - - /// The last received response, chunks are being parsed one by one from it. - google::bigtable::v2::ReadRowsResponse response_; - /// Number of chunks already parsed in response_. - int processed_chunks_count_ = 0; - - /// Number of rows read so far, used to set row_limit in retries. - std::int64_t rows_count_ = 0; - /// Holds the last read row key, for retries. - bigtable::RowKeyType last_read_row_key_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_LEGACY_ROW_READER_H diff --git a/google/cloud/bigtable/internal/legacy_row_reader_test.cc b/google/cloud/bigtable/internal/legacy_row_reader_test.cc deleted file mode 100644 index a3dea04f8d84b..0000000000000 --- a/google/cloud/bigtable/internal/legacy_row_reader_test.cc +++ /dev/null @@ -1,871 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/legacy_row_reader.h" -#include "google/cloud/bigtable/row_reader.h" -#include "google/cloud/bigtable/testing/mock_policies.h" -#include "google/cloud/bigtable/testing/mock_read_rows_reader.h" -#include "google/cloud/bigtable/testing/table_test_fixture.h" -#include "google/cloud/internal/api_client_header.h" -#include "google/cloud/internal/throw_delegate.h" -#include "google/cloud/testing_util/scoped_log.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "google/cloud/testing_util/validate_metadata.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -using ::google::bigtable::v2::ReadRowsRequest; -using ::google::bigtable::v2::ReadRowsResponse_CellChunk; -using ::google::cloud::bigtable::Row; -using ::google::cloud::bigtable::testing::MockBackoffPolicy; -using ::google::cloud::bigtable::testing::MockReadRowsReader; -using ::google::cloud::bigtable::testing::MockRetryPolicy; -using ::google::cloud::testing_util::StatusIs; -using ::google::cloud::testing_util::ValidateMetadataFixture; -using ::testing::_; -using ::testing::An; -using ::testing::DoAll; -using ::testing::Eq; -using ::testing::Matcher; -using ::testing::NiceMock; -using ::testing::Property; -using ::testing::Return; -using ::testing::SetArgPointee; -using ::testing::SetArgReferee; - -class ReadRowsParserMock : public bigtable::internal::ReadRowsParser { - public: - explicit ReadRowsParserMock() : ReadRowsParser(false) {} - - MOCK_METHOD(void, HandleChunkHook, - (ReadRowsResponse_CellChunk chunk, grpc::Status& status)); - void HandleChunk(ReadRowsResponse_CellChunk chunk, - grpc::Status& status) override { - HandleChunkHook(chunk, status); - } - - MOCK_METHOD(void, HandleEndOfStreamHook, (grpc::Status & status)); - void HandleEndOfStream(grpc::Status& status) override { - HandleEndOfStreamHook(status); - } - - bool HasNext() const override { return !rows_.empty(); } - - Row Next(grpc::Status&) override { - Row row = rows_.front(); - rows_.pop_front(); - return row; - } - - void SetRows(std::initializer_list l) { - std::transform(l.begin(), l.end(), std::back_inserter(rows_), - [](std::string const& s) -> Row { - return Row(s, std::vector()); - }); - } - - private: - std::deque rows_; -}; - -// Returns a preconfigured set of parsers, so expectations can be set on each. -class ReadRowsParserMockFactory - : public bigtable::internal::ReadRowsParserFactory { - using ParserPtr = std::unique_ptr; - - public: - void AddParser(ParserPtr parser) { parsers_.emplace_back(std::move(parser)); } - - MOCK_METHOD(void, CreateHook, ()); - ParserPtr Create(bool reverse) override { - CreateHook(); - if (parsers_.empty()) { - return std::make_unique(reverse); - } - ParserPtr parser = std::move(parsers_.front()); - parsers_.pop_front(); - return parser; - } - - private: - std::deque parsers_; -}; - -// Match the number of expected row keys in a request in EXPECT_CALL -Matcher RequestWithRowKeysCount(int n) { - return Property( - &ReadRowsRequest::rows, - Property(&google::bigtable::v2::RowSet::row_keys_size, Eq(n))); -} - -// Match the row limit in a request -Matcher RequestWithRowsLimit(std::int64_t n) { - return Property(&ReadRowsRequest::rows_limit, Eq(n)); -} - -class LegacyRowReaderTest : public bigtable::testing::TableTestFixture { - public: - LegacyRowReaderTest() - : TableTestFixture(CompletionQueue{}), - retry_policy_(std::make_unique>()), - backoff_policy_(std::make_unique>()), - metadata_update_policy_(MakeMetadataUpdatePolicy(kTableName, "")), - parser_factory_( - std::make_unique>()) {} - - std::unique_ptr retry_policy_; - std::unique_ptr backoff_policy_; - bigtable::MetadataUpdatePolicy metadata_update_policy_; - std::unique_ptr> parser_factory_; -}; - -TEST_F(LegacyRowReaderTest, EmptyReaderHasNoRows) { - // wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish).WillOnce(Return(grpc::Status::OK)); - EXPECT_CALL(*client_, ReadRows).WillOnce(stream->MakeMockReturner()); - - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet(), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - EXPECT_EQ(reader.begin(), reader.end()); -} - -TEST_F(LegacyRowReaderTest, ReadOneRow) { - // wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto parser = std::make_unique(); - parser->SetRows({"r1"}); - EXPECT_CALL(*parser, HandleEndOfStreamHook).Times(1); - { - ::testing::InSequence s; - EXPECT_CALL(*client_, ReadRows).WillOnce(stream->MakeMockReturner()); - EXPECT_CALL(*stream, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()).WillOnce(Return(grpc::Status::OK)); - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet(), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, ReadOneRowAppProfileId) { - // wrapped in unique_ptr by ReadRows - auto parser = std::make_unique(); - parser->SetRows({"r1"}); - EXPECT_CALL(*parser, HandleEndOfStreamHook).Times(1); - EXPECT_CALL(*client_, ReadRows) - .WillOnce([](grpc::ClientContext* context, ReadRowsRequest const& req) { - ValidateMetadataFixture fixture; - fixture.IsContextMDValid( - *context, "google.bigtable.v2.Bigtable.ReadRows", req, - google::cloud::internal::HandCraftedLibClientHeader()); - EXPECT_EQ("test-app-profile-id", req.app_profile_id()); - auto stream = std::make_unique( - "google.bigtable.v2.Bigtable.ReadRows"); - ::testing::InSequence s; - EXPECT_CALL(*stream, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish).WillOnce(Return(grpc::Status::OK)); - return stream; - }); - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, "test-app-profile-id", kTableName, bigtable::RowSet(), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - MakeMetadataUpdatePolicy(kTableName, "test-app-profile-id"), - std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, StreamIsDrained) { - // wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto parser = std::make_unique(); - parser->SetRows({"r1"}); - { - ::testing::InSequence s; - EXPECT_CALL(*client_, ReadRows).WillOnce(stream->MakeMockReturner()); - EXPECT_CALL(*stream, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()).WillOnce(Return(grpc::Status::OK)); - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet(), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - EXPECT_NE(it, reader.end()); - // Do not finish the iteration. We still expect the stream to be finalized, - // and the previously setup expectations on the mock `stream` check that. -} - -TEST_F(LegacyRowReaderTest, RetryThenSuccess) { - // wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto parser = std::make_unique(); - parser->SetRows({"r1"}); - { - ::testing::InSequence s; - EXPECT_CALL(*client_, ReadRows).WillOnce(stream->MakeMockReturner()); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()) - .WillOnce(Return(grpc::Status(grpc::StatusCode::INTERNAL, "retry"))); - - EXPECT_CALL(*retry_policy_, OnFailure(An())) - .WillOnce(Return(true)); - EXPECT_CALL(*backoff_policy_, OnCompletion(An())) - .WillOnce(Return(std::chrono::milliseconds(0))); - - // the stub will free it - auto* stream_retry = - new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - EXPECT_CALL(*client_, ReadRows).WillOnce(stream_retry->MakeMockReturner()); - EXPECT_CALL(*stream_retry, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream_retry, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream_retry, Finish()).WillOnce(Return(grpc::Status::OK)); - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet(), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, NoRetryOnPermanentError) { - // wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto parser = std::make_unique(); - { - ::testing::InSequence s; - EXPECT_CALL(*client_, ReadRows).WillOnce(stream->MakeMockReturner()); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()) - .WillOnce(Return(grpc::Status(grpc::StatusCode::INTERNAL, "retry"))); - - EXPECT_CALL(*retry_policy_, OnFailure(An())) - .WillOnce(Return(false)); - EXPECT_CALL(*backoff_policy_, OnCompletion(An())).Times(0); - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet(), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - EXPECT_THAT(*it, StatusIs(StatusCode::kInternal)); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, RetrySkipsAlreadyReadRows) { - // wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto parser = std::make_unique(); - parser->SetRows({"r1"}); - { - ::testing::InSequence s; - // As a baseline, check we have two rows in the initial request - EXPECT_CALL(*client_, ReadRows(_, RequestWithRowKeysCount(2))) - .WillOnce(stream->MakeMockReturner()); - - EXPECT_CALL(*stream, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()) - .WillOnce(Return(grpc::Status(grpc::StatusCode::INTERNAL, "retry"))); - - EXPECT_CALL(*retry_policy_, OnFailure(An())) - .WillOnce(Return(true)); - EXPECT_CALL(*backoff_policy_, OnCompletion(An())) - .WillOnce(Return(std::chrono::milliseconds(0))); - - // the stub will free it - auto* stream_retry = - new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - // First row should be removed from the retried request, leaving one row - EXPECT_CALL(*client_, ReadRows(_, RequestWithRowKeysCount(1))) - .WillOnce(stream_retry->MakeMockReturner()); - EXPECT_CALL(*stream_retry, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream_retry, Finish()).WillOnce(Return(grpc::Status::OK)); - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet("r1", "r2"), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, RetrySkipsAlreadyScannedRows) { - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto parser = std::make_unique(); - parser->SetRows({"r1"}); - google::bigtable::v2::ReadRowsResponse response; - response.set_last_scanned_row_key("r2"); - { - ::testing::InSequence s; - // We start our call with 3 rows in the set: "r1", "r2", "r3". - EXPECT_CALL(*client_, ReadRows(_, RequestWithRowKeysCount(3))) - .WillOnce(stream->MakeMockReturner()); - - // The mock `parser` will return "r1". Next, simulate the server returning - // an empty chunk with `last_scanned_row_key` set to "r2". - EXPECT_CALL(*stream, Read) - .WillOnce(DoAll(SetArgPointee<0>(response), Return(true))); - - // The stream fails with a retry-able error - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()) - .WillOnce(Return(grpc::Status(grpc::StatusCode::INTERNAL, "retry"))); - - EXPECT_CALL(*retry_policy_, OnFailure(An())) - .WillOnce(Return(true)); - EXPECT_CALL(*backoff_policy_, OnCompletion(An())) - .WillOnce(Return(std::chrono::milliseconds(0))); - - auto* stream_retry = - new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - - // We retry the remaining rows. We have "r1" returned, but the service has - // also told us that "r2" was scanned. This means there is only one row - // remaining to read: "r3". - EXPECT_CALL(*client_, ReadRows(_, RequestWithRowKeysCount(1))) - .WillOnce(stream_retry->MakeMockReturner()); - - // End the stream to clean up the test - EXPECT_CALL(*stream_retry, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream_retry, Finish()).WillOnce(Return(grpc::Status::OK)); - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet("r1", "r2", "r3"), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, FailedParseIsRetried) { - // wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto parser = std::make_unique(); - parser->SetRows({"r1"}); - auto response = bigtable::testing::ReadRowsResponseFromString("chunks {}"); - { - ::testing::InSequence s; - EXPECT_CALL(*client_, ReadRows).WillOnce(stream->MakeMockReturner()); - EXPECT_CALL(*stream, Read) - .WillOnce(DoAll(SetArgPointee<0>(response), Return(true))); - EXPECT_CALL(*parser, HandleChunkHook) - .WillOnce(SetArgReferee<1>( - grpc::Status(grpc::StatusCode::INTERNAL, "parser exception"))); - - EXPECT_CALL(*retry_policy_, OnFailure(An())) - .WillOnce(Return(true)); - EXPECT_CALL(*backoff_policy_, OnCompletion(An())) - .WillOnce(Return(std::chrono::milliseconds(0))); - - // the stub will free it - auto* stream_retry = - new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - EXPECT_CALL(*client_, ReadRows).WillOnce(stream_retry->MakeMockReturner()); - EXPECT_CALL(*stream_retry, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream_retry, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream_retry, Finish()).WillOnce(Return(grpc::Status::OK)); - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet(), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, FailedParseSkipsAlreadyReadRows) { - // wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto parser = std::make_unique(); - parser->SetRows({"r1"}); - { - ::testing::InSequence s; - // As a baseline, check we have two rows in the initial request - EXPECT_CALL(*client_, ReadRows(_, RequestWithRowKeysCount(2))) - .WillOnce(stream->MakeMockReturner()); - - EXPECT_CALL(*stream, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()).WillOnce(Return(grpc::Status::OK)); - EXPECT_CALL(*parser, HandleEndOfStreamHook) - .WillOnce(SetArgReferee<0>( - grpc::Status(grpc::StatusCode::INTERNAL, "InternalError"))); - - EXPECT_CALL(*retry_policy_, OnFailure(An())) - .WillOnce(Return(true)); - EXPECT_CALL(*backoff_policy_, OnCompletion(An())) - .WillOnce(Return(std::chrono::milliseconds(0))); - - // the stub will free it - auto* stream_retry = - new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - // First row should be removed from the retried request, leaving one row - EXPECT_CALL(*client_, ReadRows(_, RequestWithRowKeysCount(1))) - .WillOnce(stream_retry->MakeMockReturner()); - EXPECT_CALL(*stream_retry, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream_retry, Finish()).WillOnce(Return(grpc::Status::OK)); - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet("r1", "r2"), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, FailedParseSkipsAlreadyScannedRows) { - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto parser = std::make_unique(); - parser->SetRows({"r1"}); - google::bigtable::v2::ReadRowsResponse response; - response.set_last_scanned_row_key("r2"); - { - ::testing::InSequence s; - // We start our call with 3 rows in the set: "r1", "r2", "r3". - EXPECT_CALL(*client_, ReadRows(_, RequestWithRowKeysCount(3))) - .WillOnce(stream->MakeMockReturner()); - - // The mock `parser` will return "r1". Next, simulate the server returning - // an empty chunk with `last_scanned_row_key` set to "r2". - EXPECT_CALL(*stream, Read) - .WillOnce(DoAll(SetArgPointee<0>(response), Return(true))); - - // The stream fails with a retry-able error - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()).WillOnce(Return(grpc::Status::OK)); - EXPECT_CALL(*parser, HandleEndOfStreamHook) - .WillOnce(SetArgReferee<0>( - grpc::Status(grpc::StatusCode::INTERNAL, "InternalError"))); - - EXPECT_CALL(*retry_policy_, OnFailure(An())) - .WillOnce(Return(true)); - EXPECT_CALL(*backoff_policy_, OnCompletion(An())) - .WillOnce(Return(std::chrono::milliseconds(0))); - - auto* stream_retry = - new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - - // We retry the remaining rows. We have "r1" returned, but the service has - // also told us that "r2" was scanned. This means there is only one row - // remaining to read: "r3". - EXPECT_CALL(*client_, ReadRows(_, RequestWithRowKeysCount(1))) - .WillOnce(stream_retry->MakeMockReturner()); - - // End the stream to clean up the test - EXPECT_CALL(*stream_retry, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream_retry, Finish()).WillOnce(Return(grpc::Status::OK)); - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet("r1", "r2", "r3"), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, FailedParseWithPermanentError) { - // wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto parser = std::make_unique(); - { - ::testing::InSequence s; - - EXPECT_CALL(*client_, ReadRows).WillOnce(stream->MakeMockReturner()); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()).WillOnce(Return(grpc::Status::OK)); - EXPECT_CALL(*parser, HandleEndOfStreamHook) - .WillOnce(SetArgReferee<0>( - grpc::Status(grpc::StatusCode::INTERNAL, "InternalError"))); - EXPECT_CALL(*retry_policy_, OnFailure(An())) - .WillOnce(Return(false)); - EXPECT_CALL(*backoff_policy_, OnCompletion(An())).Times(0); - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet(), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - EXPECT_THAT(*it, StatusIs(StatusCode::kInternal)); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, NoRetryOnEmptyRowSet) { - // wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto parser = std::make_unique(); - parser->SetRows({"r2"}); - { - ::testing::InSequence s; - EXPECT_CALL(*client_, ReadRows).WillOnce(stream->MakeMockReturner()); - - EXPECT_CALL(*stream, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()) - .WillOnce(Return(grpc::Status(grpc::StatusCode::INTERNAL, - "this exception must be ignored"))); - - // Note there is no expectation of a new connection, because the - // set of rows to read should become empty after reading "r2" and - // intersecting the requested ["r1", "r2"] with ("r2", "") for the - // retry. - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, - bigtable::RowSet(bigtable::RowRange::Closed("r1", "r2")), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r2"); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, RowLimitIsSent) { - // wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - EXPECT_CALL(*client_, ReadRows(_, RequestWithRowsLimit(442))) - .WillOnce(stream->MakeMockReturner()); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()).WillOnce(Return(grpc::Status::OK)); - - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet(), 442, - bigtable::Filter::PassAllFilter(), std::move(retry_policy_), - std::move(backoff_policy_), metadata_update_policy_, - std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_EQ(it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, RowLimitIsDecreasedOnRetry) { - // wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto parser = std::make_unique(); - parser->SetRows({"r1"}); - { - ::testing::InSequence s; - EXPECT_CALL(*client_, ReadRows(_, RequestWithRowsLimit(42))) - .WillOnce(stream->MakeMockReturner()); - - EXPECT_CALL(*stream, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()) - .WillOnce(Return(grpc::Status(grpc::StatusCode::INTERNAL, "retry"))); - - EXPECT_CALL(*retry_policy_, OnFailure(An())) - .WillOnce(Return(true)); - EXPECT_CALL(*backoff_policy_, OnCompletion(An())) - .WillOnce(Return(std::chrono::milliseconds(0))); - - // the stub will free it - auto* stream_retry = - new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - // 41 instead of 42 - EXPECT_CALL(*client_, ReadRows(_, RequestWithRowsLimit(41))) - .WillOnce(stream_retry->MakeMockReturner()); - EXPECT_CALL(*stream_retry, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream_retry, Finish()).WillOnce(Return(grpc::Status::OK)); - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet(), 42, - bigtable::Filter::PassAllFilter(), std::move(retry_policy_), - std::move(backoff_policy_), metadata_update_policy_, - std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, NoRetryIfRowLimitIsReached) { - // wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto parser = std::make_unique(); - parser->SetRows({"r1"}); - { - ::testing::InSequence s; - EXPECT_CALL(*client_, ReadRows(_, RequestWithRowsLimit(1))) - .WillOnce(stream->MakeMockReturner()); - - EXPECT_CALL(*stream, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()) - .WillOnce(Return(grpc::Status(grpc::StatusCode::INTERNAL, - "this exception must be ignored"))); - - // Note there is no expectation of a new connection, because the - // row limit reaches zero. - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet(), 1, - bigtable::Filter::PassAllFilter(), std::move(retry_policy_), - std::move(backoff_policy_), metadata_update_policy_, - std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, CancelDrainsStream) { - auto parser = std::make_unique(); - parser->SetRows({"r1"}); - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - { - ::testing::InSequence s; - EXPECT_CALL(*client_, ReadRows).WillOnce(stream->MakeMockReturner()); - EXPECT_CALL(*stream, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()).WillOnce(Return(grpc::Status::OK)); - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet(), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - EXPECT_NE(it, reader.end()); - // Manually cancel the call. - reader.Cancel(); - it = reader.begin(); - EXPECT_NE(it, reader.end()); - EXPECT_THAT(*it, StatusIs(StatusCode::kCancelled)); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, CancelBeforeBegin) { - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet(), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - // Manually cancel the call before a stream was created. - reader.Cancel(); - reader.begin(); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - EXPECT_THAT(*it, StatusIs(StatusCode::kCancelled)); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(LegacyRowReaderTest, ConstructorDoesNotCallRpc) { - // The RowReader constructor/destructor by themselves should not - // invoke the RPC or create parsers (the latter restriction because - // parsers are per-connection and non-reusable). - EXPECT_CALL(*client_, ReadRows).Times(0); - EXPECT_CALL(*parser_factory_, CreateHook()).Times(0); - - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet(), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); -} - -TEST_F(LegacyRowReaderTest, RetryUsesNewContext) { - // Every retry should use a new ClientContext object. - // wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto parser = std::make_unique(); - parser->SetRows({"r1"}); - - void* previous_context = nullptr; - EXPECT_CALL(*retry_policy_, Setup) - .Times(2) - .WillRepeatedly([&previous_context](grpc::ClientContext& context) { - // This is a big hack, we want to make sure the context is new, - // but there is no easy way to check that, so we compare addresses. - EXPECT_NE(previous_context, &context); - previous_context = &context; - }); - - { - ::testing::InSequence s; - EXPECT_CALL(*client_, ReadRows).WillOnce(stream->MakeMockReturner()); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()) - .WillOnce(Return(grpc::Status(grpc::StatusCode::INTERNAL, "retry"))); - - EXPECT_CALL(*retry_policy_, OnFailure(An())) - .WillOnce(Return(true)); - EXPECT_CALL(*backoff_policy_, OnCompletion(An())) - .WillOnce(Return(std::chrono::milliseconds(0))); - - // the stub will free it - auto* stream_retry = - new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - EXPECT_CALL(*client_, ReadRows).WillOnce(stream_retry->MakeMockReturner()); - EXPECT_CALL(*stream_retry, Read).WillOnce(Return(true)); - EXPECT_CALL(*stream_retry, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream_retry, Finish()).WillOnce(Return(grpc::Status::OK)); - } - - parser_factory_->AddParser(std::move(parser)); - auto impl = std::make_shared( - client_, kTableName, bigtable::RowSet(), - bigtable::RowReader::NO_ROWS_LIMIT, bigtable::Filter::PassAllFilter(), - std::move(retry_policy_), std::move(backoff_policy_), - metadata_update_policy_, std::move(parser_factory_)); - auto reader = MakeRowReader(std::move(impl)); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - EXPECT_EQ(++it, reader.end()); -} - -} // anonymous namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/internal/logging_data_client.cc b/google/cloud/bigtable/internal/logging_data_client.cc deleted file mode 100644 index 6ad103af673a9..0000000000000 --- a/google/cloud/bigtable/internal/logging_data_client.cc +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/logging_data_client.h" -#include "google/cloud/bigtable/internal/common_client.h" -#include "google/cloud/internal/debug_string_protobuf.h" -#include "google/cloud/internal/log_wrapper.h" -#include "google/cloud/log.h" -#include "google/cloud/tracing_options.h" -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { -namespace { - -using ::google::cloud::internal::DebugString; -using ::google::cloud::internal::IsUniquePtr; - -template , - std::enable_if_t::value, int> = 0> -Result LogWrapper(Functor&& functor, grpc::ClientContext* context, - Request const& request, Response* response, char const* where, - TracingOptions const& options) { - GCP_LOG(DEBUG) << where << "() << " << DebugString(request, options); - auto status = functor(context, request, response); - if (!status.ok()) { - GCP_LOG(DEBUG) << where << "() >> status=" - << DebugString(MakeStatusFromRpcError(status), options); - } else { - GCP_LOG(DEBUG) << where - << "() >> response=" << DebugString(*response, options); - } - return status; -} - -template , - std::enable_if_t::value, int> = 0> -Result LogWrapper(Functor&& functor, grpc::ClientContext* context, - Request const& request, char const* where, - TracingOptions const& options) { - GCP_LOG(DEBUG) << where << "() << " << DebugString(request, options); - auto response = functor(context, request); - GCP_LOG(DEBUG) << where << "() >> " << (response ? "not null" : "null") - << " stream"; - return response; -} - -template < - typename Functor, typename Request, - typename Result = google::cloud::internal::invoke_result_t< - Functor, grpc::ClientContext*, Request const&, grpc::CompletionQueue*>, - std::enable_if_t::value, int> = 0> -Result LogWrapper(Functor&& functor, grpc::ClientContext* context, - Request const& request, grpc::CompletionQueue* cq, - char const* where, TracingOptions const& options) { - GCP_LOG(DEBUG) << where << "() << " << DebugString(request, options); - auto response = functor(context, request, cq); - GCP_LOG(DEBUG) << where << "() >> " << (response ? "not null" : "null") - << " async response reader"; - return response; -} - -} // namespace - -namespace btproto = ::google::bigtable::v2; - -grpc::Status LoggingDataClient::MutateRow( - grpc::ClientContext* context, btproto::MutateRowRequest const& request, - btproto::MutateRowResponse* response) { - return LogWrapper( - [this](grpc::ClientContext* context, - btproto::MutateRowRequest const& request, - btproto::MutateRowResponse* response) { - return child_->MutateRow(context, request, response); - }, - context, request, response, __func__, tracing_options_); -} - -std::unique_ptr< - grpc::ClientAsyncResponseReaderInterface> -LoggingDataClient::AsyncMutateRow(grpc::ClientContext* context, - btproto::MutateRowRequest const& request, - grpc::CompletionQueue* cq) { - return child_->AsyncMutateRow(context, request, cq); -} - -grpc::Status LoggingDataClient::CheckAndMutateRow( - grpc::ClientContext* context, - btproto::CheckAndMutateRowRequest const& request, - btproto::CheckAndMutateRowResponse* response) { - return LogWrapper( - [this](grpc::ClientContext* context, - btproto::CheckAndMutateRowRequest const& request, - btproto::CheckAndMutateRowResponse* response) { - return child_->CheckAndMutateRow(context, request, response); - }, - context, request, response, __func__, tracing_options_); -} - -std::unique_ptr> -LoggingDataClient::AsyncCheckAndMutateRow( - grpc::ClientContext* context, - google::bigtable::v2::CheckAndMutateRowRequest const& request, - grpc::CompletionQueue* cq) { - return child_->AsyncCheckAndMutateRow(context, request, cq); -} - -grpc::Status LoggingDataClient::ReadModifyWriteRow( - grpc::ClientContext* context, - btproto::ReadModifyWriteRowRequest const& request, - btproto::ReadModifyWriteRowResponse* response) { - return LogWrapper( - [this](grpc::ClientContext* context, - btproto::ReadModifyWriteRowRequest const& request, - btproto::ReadModifyWriteRowResponse* response) { - return child_->ReadModifyWriteRow(context, request, response); - }, - context, request, response, __func__, tracing_options_); -} - -std::unique_ptr> -LoggingDataClient::AsyncReadModifyWriteRow( - grpc::ClientContext* context, - google::bigtable::v2::ReadModifyWriteRowRequest const& request, - grpc::CompletionQueue* cq) { - return child_->AsyncReadModifyWriteRow(context, request, cq); -} - -std::unique_ptr> -LoggingDataClient::ReadRows(grpc::ClientContext* context, - btproto::ReadRowsRequest const& request) { - return LogWrapper( - [this](grpc::ClientContext* context, - btproto::ReadRowsRequest const& request) { - return child_->ReadRows(context, request); - }, - context, request, __func__, tracing_options_); -} - -std::unique_ptr> -LoggingDataClient::AsyncReadRows( - grpc::ClientContext* context, - google::bigtable::v2::ReadRowsRequest const& request, - grpc::CompletionQueue* cq, void* tag) { - return child_->AsyncReadRows(context, request, cq, tag); -} - -std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::ReadRowsResponse>> -LoggingDataClient::PrepareAsyncReadRows( - ::grpc::ClientContext* context, - ::google::bigtable::v2::ReadRowsRequest const& request, - ::grpc::CompletionQueue* cq) { - return child_->PrepareAsyncReadRows(context, request, cq); -} - -std::unique_ptr> -LoggingDataClient::SampleRowKeys(grpc::ClientContext* context, - btproto::SampleRowKeysRequest const& request) { - return LogWrapper( - [this](grpc::ClientContext* context, - btproto::SampleRowKeysRequest const& request) { - return child_->SampleRowKeys(context, request); - }, - context, request, __func__, tracing_options_); -} - -std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::SampleRowKeysResponse>> -LoggingDataClient::AsyncSampleRowKeys( - ::grpc::ClientContext* context, - ::google::bigtable::v2::SampleRowKeysRequest const& request, - ::grpc::CompletionQueue* cq, void* tag) { - return child_->AsyncSampleRowKeys(context, request, cq, tag); -} - -std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::SampleRowKeysResponse>> -LoggingDataClient::PrepareAsyncSampleRowKeys( - ::grpc::ClientContext* context, - ::google::bigtable::v2::SampleRowKeysRequest const& request, - ::grpc::CompletionQueue* cq) { - return child_->PrepareAsyncSampleRowKeys(context, request, cq); -} - -std::unique_ptr> -LoggingDataClient::MutateRows(grpc::ClientContext* context, - btproto::MutateRowsRequest const& request) { - return LogWrapper( - [this](grpc::ClientContext* context, - btproto::MutateRowsRequest const& request) { - return child_->MutateRows(context, request); - }, - context, request, __func__, tracing_options_); -} - -std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::MutateRowsResponse>> -LoggingDataClient::AsyncMutateRows( - ::grpc::ClientContext* context, - ::google::bigtable::v2::MutateRowsRequest const& request, - ::grpc::CompletionQueue* cq, void* tag) { - return child_->AsyncMutateRows(context, request, cq, tag); -} - -std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::MutateRowsResponse>> -LoggingDataClient::PrepareAsyncMutateRows( - ::grpc::ClientContext* context, - ::google::bigtable::v2::MutateRowsRequest const& request, - ::grpc::CompletionQueue* cq) { - return child_->PrepareAsyncMutateRows(context, request, cq); -} - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/internal/logging_data_client.h b/google/cloud/bigtable/internal/logging_data_client.h deleted file mode 100644 index a31961cdebf22..0000000000000 --- a/google/cloud/bigtable/internal/logging_data_client.h +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_LOGGING_DATA_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_LOGGING_DATA_CLIENT_H - -#include "google/cloud/bigtable/data_client.h" -#include -#include -// TODO(#8800) - delete this class when deprecation is complete -#include "google/cloud/internal/disable_deprecation_warnings.inc" - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { - -namespace btproto = ::google::bigtable::v2; - -/** - * Implement a logging DataClient. - * - * This implementation does not support multiple threads, or refresh - * authorization tokens. In other words, it is extremely bare bones. - */ -class LoggingDataClient : public DataClient { - public: - LoggingDataClient(std::shared_ptr child, - google::cloud::TracingOptions options) - : child_(std::move(child)), tracing_options_(std::move(options)) {} - - std::string const& project_id() const override { - return child_->project_id(); - } - - std::string const& instance_id() const override { - return child_->instance_id(); - } - - std::shared_ptr Channel() override { - return child_->Channel(); - } - - void reset() override { child_->reset(); } - - grpc::Status MutateRow(grpc::ClientContext* context, - btproto::MutateRowRequest const& request, - btproto::MutateRowResponse* response) override; - - std::unique_ptr< - grpc::ClientAsyncResponseReaderInterface> - AsyncMutateRow(grpc::ClientContext* context, - btproto::MutateRowRequest const& request, - grpc::CompletionQueue* cq) override; - - grpc::Status CheckAndMutateRow( - grpc::ClientContext* context, - btproto::CheckAndMutateRowRequest const& request, - btproto::CheckAndMutateRowResponse* response) override; - - std::unique_ptr> - AsyncCheckAndMutateRow( - grpc::ClientContext* context, - google::bigtable::v2::CheckAndMutateRowRequest const& request, - grpc::CompletionQueue* cq) override; - - grpc::Status ReadModifyWriteRow( - grpc::ClientContext* context, - btproto::ReadModifyWriteRowRequest const& request, - btproto::ReadModifyWriteRowResponse* response) override; - - std::unique_ptr> - AsyncReadModifyWriteRow( - grpc::ClientContext* context, - google::bigtable::v2::ReadModifyWriteRowRequest const& request, - grpc::CompletionQueue* cq) override; - - std::unique_ptr> - ReadRows(grpc::ClientContext* context, - btproto::ReadRowsRequest const& request) override; - - std::unique_ptr> - AsyncReadRows(grpc::ClientContext* context, - google::bigtable::v2::ReadRowsRequest const& request, - grpc::CompletionQueue* cq, void* tag) override; - - std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::ReadRowsResponse>> - PrepareAsyncReadRows(::grpc::ClientContext* context, - ::google::bigtable::v2::ReadRowsRequest const& request, - ::grpc::CompletionQueue* cq) override; - - std::unique_ptr> - SampleRowKeys(grpc::ClientContext* context, - btproto::SampleRowKeysRequest const& request) override; - - std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::SampleRowKeysResponse>> - AsyncSampleRowKeys( - ::grpc::ClientContext* context, - ::google::bigtable::v2::SampleRowKeysRequest const& request, - ::grpc::CompletionQueue* cq, void* tag) override; - std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::SampleRowKeysResponse>> - PrepareAsyncSampleRowKeys( - ::grpc::ClientContext* context, - ::google::bigtable::v2::SampleRowKeysRequest const& request, - ::grpc::CompletionQueue* cq) override; - - std::unique_ptr> - MutateRows(grpc::ClientContext* context, - btproto::MutateRowsRequest const& request) override; - - std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::MutateRowsResponse>> - AsyncMutateRows(::grpc::ClientContext* context, - ::google::bigtable::v2::MutateRowsRequest const& request, - ::grpc::CompletionQueue* cq, void* tag) override; - - std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::MutateRowsResponse>> - PrepareAsyncMutateRows( - ::grpc::ClientContext* context, - ::google::bigtable::v2::MutateRowsRequest const& request, - ::grpc::CompletionQueue* cq) override; - - private: - google::cloud::BackgroundThreadsFactory BackgroundThreadsFactory() override { - return child_->BackgroundThreadsFactory(); - } - - std::shared_ptr child_; - google::cloud::TracingOptions tracing_options_; -}; - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google - -// TODO(#8800) - delete this class when deprecation is complete -#include "google/cloud/internal/diagnostics_pop.inc" - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_LOGGING_DATA_CLIENT_H diff --git a/google/cloud/bigtable/internal/logging_data_client_test.cc b/google/cloud/bigtable/internal/logging_data_client_test.cc deleted file mode 100644 index 23177906ab7fb..0000000000000 --- a/google/cloud/bigtable/internal/logging_data_client_test.cc +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/logging_data_client.h" -#include "google/cloud/bigtable/data_client.h" -#include "google/cloud/bigtable/testing/mock_data_client.h" -#include "google/cloud/testing_util/scoped_log.h" -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -using ::testing::Contains; -using ::testing::HasSubstr; -using ::testing::Return; - -namespace btproto = ::google::bigtable::v2; - -class LoggingDataClientTest : public ::testing::Test { - protected: - static Status TransientError() { - return Status(StatusCode::kUnavailable, "try-again"); - } - - testing_util::ScopedLog log_; -}; - -TEST_F(LoggingDataClientTest, MutateRow) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, MutateRow).WillOnce(Return(grpc::Status())); - - internal::LoggingDataClient stub( - mock, TracingOptions{}.SetOptions("single_line_mode")); - - grpc::ClientContext context; - btproto::MutateRowRequest request; - btproto::MutateRowResponse response; - - auto status = stub.MutateRow(&context, request, &response); - - EXPECT_TRUE(status.ok()); - EXPECT_THAT(log_.ExtractLines(), Contains(HasSubstr("MutateRow"))); -} - -TEST_F(LoggingDataClientTest, CheckAndMutateRow) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, CheckAndMutateRow).WillOnce(Return(grpc::Status())); - - internal::LoggingDataClient stub( - mock, TracingOptions{}.SetOptions("single_line_mode")); - - grpc::ClientContext context; - btproto::CheckAndMutateRowRequest request; - btproto::CheckAndMutateRowResponse response; - - auto status = stub.CheckAndMutateRow(&context, request, &response); - - EXPECT_TRUE(status.ok()); - EXPECT_THAT(log_.ExtractLines(), Contains(HasSubstr("CheckAndMutateRow"))); -} - -TEST_F(LoggingDataClientTest, ReadModifyWriteRow) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, ReadModifyWriteRow).WillOnce(Return(grpc::Status())); - - internal::LoggingDataClient stub( - mock, TracingOptions{}.SetOptions("single_line_mode")); - - grpc::ClientContext context; - btproto::ReadModifyWriteRowRequest request; - btproto::ReadModifyWriteRowResponse response; - - auto status = stub.ReadModifyWriteRow(&context, request, &response); - - EXPECT_TRUE(status.ok()); - EXPECT_THAT(log_.ExtractLines(), Contains(HasSubstr("ReadModifyWriteRow"))); -} - -TEST_F(LoggingDataClientTest, ReadRows) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, ReadRows) - .WillOnce([](grpc::ClientContext*, btproto::ReadRowsRequest const&) { - return std::unique_ptr< - grpc::ClientReaderInterface>{}; - }); - - internal::LoggingDataClient stub( - mock, TracingOptions{}.SetOptions("single_line_mode")); - - grpc::ClientContext context; - btproto::ReadRowsRequest request; - - stub.ReadRows(&context, request); - - EXPECT_THAT(log_.ExtractLines(), Contains(HasSubstr("ReadRows"))); -} - -TEST_F(LoggingDataClientTest, SampleRowKeys) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, SampleRowKeys) - .WillOnce([](grpc::ClientContext*, btproto::SampleRowKeysRequest const&) { - return std::unique_ptr< - grpc::ClientReaderInterface>{}; - }); - - internal::LoggingDataClient stub( - mock, TracingOptions{}.SetOptions("single_line_mode")); - - grpc::ClientContext context; - btproto::SampleRowKeysRequest request; - - stub.SampleRowKeys(&context, request); - - EXPECT_THAT(log_.ExtractLines(), Contains(HasSubstr("SampleRowKeys"))); -} - -TEST_F(LoggingDataClientTest, MutateRows) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, MutateRows) - .WillOnce([](grpc::ClientContext*, btproto::MutateRowsRequest const&) { - return std::unique_ptr< - grpc::ClientReaderInterface>{}; - }); - - internal::LoggingDataClient stub( - mock, TracingOptions{}.SetOptions("single_line_mode")); - - grpc::ClientContext context; - btproto::MutateRowsRequest request; - - stub.MutateRows(&context, request); - - EXPECT_THAT(log_.ExtractLines(), Contains(HasSubstr("MutateRows"))); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/internal/metrics.h b/google/cloud/bigtable/internal/metrics.h index 33ee4d8af64e9..743e58ac50b54 100644 --- a/google/cloud/bigtable/internal/metrics.h +++ b/google/cloud/bigtable/internal/metrics.h @@ -20,7 +20,7 @@ #include "google/cloud/bigtable/internal/operation_context.h" #include "google/cloud/bigtable/version.h" #include "google/cloud/status.h" -#include +#include "google/bigtable/v2/response_params.pb.h" #include #include #include diff --git a/google/cloud/bigtable/internal/metrics_test.cc b/google/cloud/bigtable/internal/metrics_test.cc index 37702baaa4632..41a8bb17b5b58 100644 --- a/google/cloud/bigtable/internal/metrics_test.cc +++ b/google/cloud/bigtable/internal/metrics_test.cc @@ -142,6 +142,17 @@ class MockMeter : public opentelemetry::metrics::Meter { opentelemetry::nostd::string_view, opentelemetry::nostd::string_view), (noexcept, override)); + + MOCK_METHOD(uintptr_t, + RegisterCallback, // NOLINT(bugprone-exception-escape) + (opentelemetry::metrics::MultiObservableCallbackPtr, void*, + opentelemetry::nostd::span< + opentelemetry::metrics::ObservableInstrument*>), + (noexcept, override)); + + MOCK_METHOD(void, + DeregisterCallback, // NOLINT(bugprone-exception-escape) + (uintptr_t), (noexcept, override)); #endif MOCK_METHOD(opentelemetry::nostd::shared_ptr, diff --git a/google/cloud/bigtable/internal/mutate_rows_limiter.h b/google/cloud/bigtable/internal/mutate_rows_limiter.h index 8cbde6f084c32..e3f251d08f621 100644 --- a/google/cloud/bigtable/internal/mutate_rows_limiter.h +++ b/google/cloud/bigtable/internal/mutate_rows_limiter.h @@ -21,7 +21,7 @@ #include "google/cloud/internal/clock.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#include "google/bigtable/v2/bigtable.pb.h" #include #include #include diff --git a/google/cloud/bigtable/internal/mutate_rows_limiter_test.cc b/google/cloud/bigtable/internal/mutate_rows_limiter_test.cc index c8636759728fd..d392d00c3ef73 100644 --- a/google/cloud/bigtable/internal/mutate_rows_limiter_test.cc +++ b/google/cloud/bigtable/internal/mutate_rows_limiter_test.cc @@ -278,7 +278,6 @@ TEST(MakeMutateRowsLimiter, LoggingDisabled) { } } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::MockCompletionQueueImpl; @@ -353,7 +352,6 @@ TEST(MakeMutateRowsLimiter, TracingDisabledAsync) { EXPECT_THAT(span_catcher->GetSpans(), IsEmpty()); } } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/bigtable/internal/operation_context_factory.cc b/google/cloud/bigtable/internal/operation_context_factory.cc index 039cf185aa5ee..39f45fdc3069c 100644 --- a/google/cloud/bigtable/internal/operation_context_factory.cc +++ b/google/cloud/bigtable/internal/operation_context_factory.cc @@ -21,7 +21,7 @@ #include "google/cloud/opentelemetry/monitoring_exporter.h" #include "google/cloud/internal/algorithm.h" #include "absl/strings/str_split.h" -#include +#include "google/api/monitored_resource.pb.h" #include #include #include @@ -214,15 +214,15 @@ void MetricsOperationContextFactory::InitializeProvider( auto& labels = *resource.mutable_labels(); auto const& attributes = pda.attributes.GetAttributes(); labels[kProjectLabel] = - absl::get(attributes.find(kProjectLabel)->second); + std::get(attributes.find(kProjectLabel)->second); labels[kInstanceLabel] = - absl::get(attributes.find(kInstanceLabel)->second); + std::get(attributes.find(kInstanceLabel)->second); labels[kTableLabel] = - absl::get(attributes.find(kTableLabel)->second); + std::get(attributes.find(kTableLabel)->second); labels[kClusterLabel] = - absl::get(attributes.find(kClusterLabel)->second); + std::get(attributes.find(kClusterLabel)->second); labels[kZoneLabel] = - absl::get(attributes.find(kZoneLabel)->second); + std::get(attributes.find(kZoneLabel)->second); return std::make_pair(labels[kProjectLabel], resource); }; diff --git a/google/cloud/bigtable/internal/partial_result_set_reader.h b/google/cloud/bigtable/internal/partial_result_set_reader.h index fe40b6bb3b43c..6e911a092ab31 100644 --- a/google/cloud/bigtable/internal/partial_result_set_reader.h +++ b/google/cloud/bigtable/internal/partial_result_set_reader.h @@ -16,7 +16,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_PARTIAL_RESULT_SET_READER_H #include "google/cloud/status.h" -#include +#include "google/bigtable/v2/data.pb.h" #include namespace google { diff --git a/google/cloud/bigtable/internal/partial_result_set_source.cc b/google/cloud/bigtable/internal/partial_result_set_source.cc index 59a2b7954d3c4..31ed75081a792 100644 --- a/google/cloud/bigtable/internal/partial_result_set_source.cc +++ b/google/cloud/bigtable/internal/partial_result_set_source.cc @@ -15,10 +15,10 @@ #include "google/cloud/bigtable/internal/partial_result_set_source.h" #include "google/cloud/bigtable/internal/crc32c.h" #include "google/cloud/bigtable/options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/log.h" #include "absl/strings/cord.h" +#include "absl/strings/str_cat.h" #include "absl/types/optional.h" namespace google { diff --git a/google/cloud/bigtable/internal/partial_result_set_source.h b/google/cloud/bigtable/internal/partial_result_set_source.h index e3e46787c65a4..e7a70a5bf0440 100644 --- a/google/cloud/bigtable/internal/partial_result_set_source.h +++ b/google/cloud/bigtable/internal/partial_result_set_source.h @@ -24,10 +24,10 @@ #include "google/cloud/status.h" #include "google/cloud/status_or.h" #include "absl/types/optional.h" -#include +#include "google/bigtable/v2/bigtable.pb.h" +#include "google/protobuf/struct.pb.h" #include #include -#include #include #include #include diff --git a/google/cloud/bigtable/internal/partial_result_set_source_test.cc b/google/cloud/bigtable/internal/partial_result_set_source_test.cc index 4ca22a38111c5..7f7649d6373ad 100644 --- a/google/cloud/bigtable/internal/partial_result_set_source_test.cc +++ b/google/cloud/bigtable/internal/partial_result_set_source_test.cc @@ -27,7 +27,7 @@ #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/status_matchers.h" #include "absl/strings/substitute.h" -#include +#include "google/bigtable/v2/data.pb.h" #include #include #include diff --git a/google/cloud/bigtable/internal/query_plan.cc b/google/cloud/bigtable/internal/query_plan.cc index 054f08b34cff0..02cbc7365f09c 100644 --- a/google/cloud/bigtable/internal/query_plan.cc +++ b/google/cloud/bigtable/internal/query_plan.cc @@ -15,7 +15,7 @@ #include "google/cloud/bigtable/internal/query_plan.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/time_utils.h" -#include +#include "google/bigtable/v2/data.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/bigtable/internal/query_plan.h b/google/cloud/bigtable/internal/query_plan.h index f9a6fb418cdcd..04ee74509cf96 100644 --- a/google/cloud/bigtable/internal/query_plan.h +++ b/google/cloud/bigtable/internal/query_plan.h @@ -19,7 +19,7 @@ #include "google/cloud/bigtable/version.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/clock.h" -#include +#include "google/bigtable/v2/bigtable.pb.h" #include #include diff --git a/google/cloud/bigtable/internal/query_plan_test.cc b/google/cloud/bigtable/internal/query_plan_test.cc index af111163ac22b..104b7269046d8 100644 --- a/google/cloud/bigtable/internal/query_plan_test.cc +++ b/google/cloud/bigtable/internal/query_plan_test.cc @@ -20,7 +20,7 @@ #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/status_matchers.h" #include "absl/synchronization/barrier.h" -#include +#include "google/bigtable/v2/data.pb.h" #include #include #include diff --git a/google/cloud/bigtable/internal/readrowsparser.h b/google/cloud/bigtable/internal/readrowsparser.h index b558153b7e408..e35d1fde2cbb1 100644 --- a/google/cloud/bigtable/internal/readrowsparser.h +++ b/google/cloud/bigtable/internal/readrowsparser.h @@ -18,7 +18,7 @@ #include "google/cloud/bigtable/cell.h" #include "google/cloud/bigtable/row.h" #include "google/cloud/bigtable/version.h" -#include +#include "google/bigtable/v2/bigtable.grpc.pb.h" #include #include diff --git a/google/cloud/bigtable/internal/retry_traits.cc b/google/cloud/bigtable/internal/retry_traits.cc index aeb811c544517..c075b508d9cf2 100644 --- a/google/cloud/bigtable/internal/retry_traits.cc +++ b/google/cloud/bigtable/internal/retry_traits.cc @@ -16,8 +16,8 @@ #include "google/cloud/internal/status_payload_keys.h" #include "google/cloud/status.h" #include "absl/strings/match.h" -#include -#include +#include "google/rpc/error_details.pb.h" +#include "google/rpc/status.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/bigtable/internal/retry_traits_test.cc b/google/cloud/bigtable/internal/retry_traits_test.cc index 0125698293897..c58023c66c96b 100644 --- a/google/cloud/bigtable/internal/retry_traits_test.cc +++ b/google/cloud/bigtable/internal/retry_traits_test.cc @@ -15,8 +15,8 @@ #include "google/cloud/bigtable/internal/retry_traits.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/status_payload_keys.h" -#include -#include +#include "google/rpc/error_details.pb.h" +#include "google/rpc/status.pb.h" #include 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/internal/traced_row_reader.cc b/google/cloud/bigtable/internal/traced_row_reader.cc index 55397c63f17ff..07fbeb8b59929 100644 --- a/google/cloud/bigtable/internal/traced_row_reader.cc +++ b/google/cloud/bigtable/internal/traced_row_reader.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/bigtable/internal/traced_row_reader.h" #include "google/cloud/internal/opentelemetry.h" @@ -72,4 +71,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/bigtable/internal/traced_row_reader.h b/google/cloud/bigtable/internal/traced_row_reader.h index a423214d6dd7e..c7221b3a46ca6 100644 --- a/google/cloud/bigtable/internal/traced_row_reader.h +++ b/google/cloud/bigtable/internal/traced_row_reader.h @@ -15,7 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_TRACED_ROW_READER_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_TRACED_ROW_READER_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/bigtable/row_reader.h" namespace google { @@ -36,6 +35,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_TRACED_ROW_READER_H diff --git a/google/cloud/bigtable/internal/traced_row_reader_test.cc b/google/cloud/bigtable/internal/traced_row_reader_test.cc index cad809b81496e..a10093febf9f0 100644 --- a/google/cloud/bigtable/internal/traced_row_reader_test.cc +++ b/google/cloud/bigtable/internal/traced_row_reader_test.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/bigtable/internal/traced_row_reader.h" #include "google/cloud/bigtable/mocks/mock_row_reader.h" #include "google/cloud/internal/make_status.h" @@ -151,4 +150,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/bigtable/legacy_table_test.cc b/google/cloud/bigtable/legacy_table_test.cc deleted file mode 100644 index 7a5392d530945..0000000000000 --- a/google/cloud/bigtable/legacy_table_test.cc +++ /dev/null @@ -1,409 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/table.h" -#include "google/cloud/bigtable/testing/mock_async_failing_rpc_factory.h" -#include "google/cloud/bigtable/testing/table_test_fixture.h" -#include "google/cloud/internal/background_threads_impl.h" -#include "google/cloud/testing_util/fake_completion_queue_impl.h" - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace btproto = ::google::bigtable::v2; -using ::google::cloud::testing_util::FakeCompletionQueueImpl; -using ::google::cloud::testing_util::StatusIs; -using ::testing::HasSubstr; -using ::testing::MockFunction; - -Options NonEmptyOptions() { - struct TestOption { - using Type = bool; - }; - return Options{}.set(true); -} - -/// Define types and functions used in the tests. -class TableTest : public ::google::cloud::bigtable::testing::TableTestFixture { - public: - TableTest() : TableTestFixture(CompletionQueue{}) {} -}; - -TEST_F(TableTest, ClientProjectId) { - EXPECT_EQ(kProjectId, client_->project_id()); -} - -TEST_F(TableTest, ClientInstanceId) { - EXPECT_EQ(kInstanceId, client_->instance_id()); -} - -TEST_F(TableTest, StandaloneInstanceName) { - EXPECT_EQ(kInstanceName, InstanceName(client_)); -} - -TEST_F(TableTest, StandaloneTableName) { - EXPECT_EQ(kTableName, TableName(client_, kTableId)); -} - -TEST_F(TableTest, TableName) { EXPECT_EQ(kTableName, table_.table_name()); } - -TEST_F(TableTest, WithNewTarget) { - Table table(client_, "original-profile", kTableId); - EXPECT_EQ(table.project_id(), kProjectId); - EXPECT_EQ(table.instance_id(), kInstanceId); - EXPECT_EQ(table.table_id(), kTableId); - EXPECT_EQ(table.table_name(), TableName(kProjectId, kInstanceId, kTableId)); - EXPECT_EQ(table.app_profile_id(), "original-profile"); - - std::string const other_project_id = "other-project"; - std::string const other_instance_id = "other-instance"; - std::string const other_table_id = "other-table"; - auto other_table = - table.WithNewTarget(other_project_id, other_instance_id, other_table_id); - - EXPECT_EQ(other_table.project_id(), other_project_id); - EXPECT_EQ(other_table.instance_id(), other_instance_id); - EXPECT_EQ(other_table.table_id(), other_table_id); - EXPECT_EQ(other_table.table_name(), - TableName(other_project_id, other_instance_id, other_table_id)); - EXPECT_EQ(other_table.app_profile_id(), "original-profile"); -} - -TEST_F(TableTest, WithNewTargetProfile) { - Table table(client_, "original-profile", kTableId); - EXPECT_EQ(table.project_id(), kProjectId); - EXPECT_EQ(table.instance_id(), kInstanceId); - EXPECT_EQ(table.table_id(), kTableId); - EXPECT_EQ(table.table_name(), TableName(kProjectId, kInstanceId, kTableId)); - EXPECT_EQ(table.app_profile_id(), "original-profile"); - - std::string const other_project_id = "other-project"; - std::string const other_instance_id = "other-instance"; - std::string const other_table_id = "other-table"; - std::string const other_profile_id = "other-profile"; - auto other_table = table.WithNewTarget(other_project_id, other_instance_id, - other_profile_id, other_table_id); - - EXPECT_EQ(other_table.project_id(), other_project_id); - EXPECT_EQ(other_table.instance_id(), other_instance_id); - EXPECT_EQ(other_table.table_id(), other_table_id); - EXPECT_EQ(other_table.table_name(), - TableName(other_project_id, other_instance_id, other_table_id)); - EXPECT_EQ(other_table.app_profile_id(), other_profile_id); -} - -TEST_F(TableTest, TableConstructor) { - std::string const other_table_id = "my-table"; - std::string const other_table_name = TableName(client_, other_table_id); - Table table(client_, other_table_id); - EXPECT_EQ(other_table_name, table.table_name()); -} - -TEST_F(TableTest, CopyConstructor) { - Table source(client_, "my-table"); - std::string const& expected = source.table_name(); - // NOLINTNEXTLINE(performance-unnecessary-copy-initialization) - Table copy(source); - EXPECT_EQ(expected, copy.table_name()); -} - -TEST_F(TableTest, MoveConstructor) { - Table source(client_, "my-table"); - std::string expected = source.table_name(); - Table copy(std::move(source)); - EXPECT_EQ(expected, copy.table_name()); -} - -TEST_F(TableTest, CopyAssignment) { - Table source(client_, "my-table"); - std::string const& expected = source.table_name(); - Table dest(client_, "another-table"); - dest = source; - EXPECT_EQ(expected, dest.table_name()); -} - -TEST_F(TableTest, MoveAssignment) { - Table source(client_, "my-table"); - std::string expected = source.table_name(); - Table dest(client_, "another-table"); - dest = std::move(source); - EXPECT_EQ(expected, dest.table_name()); -} - -TEST_F(TableTest, ChangeOnePolicy) { - Table table(client_, "some-table", AlwaysRetryMutationPolicy()); - EXPECT_EQ("", table.app_profile_id()); - EXPECT_THAT(table.table_name(), HasSubstr("some-table")); -} - -TEST_F(TableTest, ChangePolicies) { - Table table(client_, "some-table", AlwaysRetryMutationPolicy(), - LimitedErrorCountRetryPolicy(42)); - EXPECT_EQ("", table.app_profile_id()); - EXPECT_THAT(table.table_name(), HasSubstr("some-table")); -} - -TEST_F(TableTest, ConstructorWithAppProfileAndPolicies) { - Table table(client_, "test-profile-id", "some-table", - AlwaysRetryMutationPolicy(), LimitedErrorCountRetryPolicy(42)); - EXPECT_EQ("test-profile-id", table.app_profile_id()); - EXPECT_THAT(table.table_name(), HasSubstr("some-table")); -} - -std::string const kProjectId = "the-project"; -std::string const kInstanceId = "the-instance"; -std::string const kTableId = "the-table"; - -class ValidContextMdAsyncTest : public ::testing::Test { - public: - ValidContextMdAsyncTest() - : cq_impl_(new FakeCompletionQueueImpl), - cq_(cq_impl_), - client_(new ::google::cloud::bigtable::testing::MockDataClient( - Options{}.set(cq_))) { - EXPECT_CALL(*client_, project_id()) - .WillRepeatedly(::testing::ReturnRef(kProjectId)); - EXPECT_CALL(*client_, instance_id()) - .WillRepeatedly(::testing::ReturnRef(kInstanceId)); - table_ = std::make_unique(client_, kTableId); - } - - protected: - template - void FinishTest( - ::google::cloud::future> res_future) { - EXPECT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); - EXPECT_EQ(0U, cq_impl_->size()); - auto res = res_future.get(); - EXPECT_FALSE(res); - EXPECT_EQ(::google::cloud::StatusCode::kPermissionDenied, - res.status().code()); - } - - void FinishTest(::google::cloud::future res_future) { - EXPECT_EQ(1U, cq_impl_->size()); - cq_impl_->SimulateCompletion(true); - EXPECT_EQ(0U, cq_impl_->size()); - auto res = res_future.get(); - EXPECT_EQ(::google::cloud::StatusCode::kPermissionDenied, res.code()); - } - - std::shared_ptr cq_impl_; - CompletionQueue cq_; - std::shared_ptr client_; - std::unique_ptr
table_; -}; - -TEST_F(ValidContextMdAsyncTest, AsyncApply) { - testing::MockAsyncFailingRpcFactory - rpc_factory; - EXPECT_CALL(*client_, AsyncMutateRow) - .WillOnce(rpc_factory.Create( - R"""( - table_name: "projects/the-project/instances/the-instance/tables/the-table" - row_key: "row_key" - mutations: { delete_from_row { } } - )""", - "google.bigtable.v2.Bigtable.MutateRow")); - FinishTest(table_->AsyncApply(SingleRowMutation("row_key", DeleteFromRow()))); -} - -TEST_F(ValidContextMdAsyncTest, AsyncCheckAndMutateRow) { - testing::MockAsyncFailingRpcFactory - rpc_factory; - EXPECT_CALL(*client_, AsyncCheckAndMutateRow) - .WillOnce(rpc_factory.Create( - R"""( - table_name: "projects/the-project/instances/the-instance/tables/the-table" - row_key: "row_key" - true_mutations: { delete_from_row { } } - predicate_filter: { pass_all_filter: true } - )""", - "google.bigtable.v2.Bigtable.CheckAndMutateRow")); - FinishTest(table_->AsyncCheckAndMutateRow("row_key", Filter::PassAllFilter(), - {DeleteFromRow()}, {})); -} - -TEST_F(ValidContextMdAsyncTest, AsyncReadModifyWriteRow) { - testing::MockAsyncFailingRpcFactory - rpc_factory; - EXPECT_CALL(*client_, AsyncReadModifyWriteRow) - .WillOnce(rpc_factory.Create( - R"""( - table_name: "projects/the-project/instances/the-instance/tables/the-table" - row_key: "row_key" - rules: { - family_name: "fam" - column_qualifier: "counter" - increment_amount: 1 - } - rules: { - family_name: "fam" - column_qualifier: "list" - append_value: ";element" - } - )""", - "google.bigtable.v2.Bigtable.ReadModifyWriteRow")); - FinishTest(table_->AsyncReadModifyWriteRow( - "row_key", ReadModifyWriteRule::IncrementAmount("fam", "counter", 1), - ReadModifyWriteRule::AppendValue("fam", "list", ";element"))); -} - -TEST_F(TableTest, ApplyWithOptions) { - Table table(client_, kTableId); - auto status = table.Apply(SingleRowMutation("row"), NonEmptyOptions()); - EXPECT_THAT(status, StatusIs(StatusCode::kInvalidArgument)); -} - -TEST_F(TableTest, AsyncApplyWithOptions) { - Table table(client_, kTableId); - auto status = table.AsyncApply(SingleRowMutation("row"), NonEmptyOptions()); - EXPECT_THAT(status.get(), StatusIs(StatusCode::kInvalidArgument)); -} - -TEST_F(TableTest, BulkApplyWithOptions) { - Table table(client_, kTableId); - auto bulk = BulkMutation(SingleRowMutation("r1"), SingleRowMutation("r2")); - auto failed = table.BulkApply(bulk, NonEmptyOptions()); - ASSERT_EQ(2, failed.size()); - EXPECT_EQ(0, failed[0].original_index()); - EXPECT_THAT(failed[0].status(), StatusIs(StatusCode::kInvalidArgument)); - EXPECT_EQ(1, failed[1].original_index()); - EXPECT_THAT(failed[1].status(), StatusIs(StatusCode::kInvalidArgument)); -} - -TEST_F(TableTest, AsyncBulkApplyWithOptions) { - Table table(client_, kTableId); - auto bulk = BulkMutation(SingleRowMutation("r1"), SingleRowMutation("r2")); - auto failed = table.AsyncBulkApply(bulk, NonEmptyOptions()).get(); - ASSERT_EQ(2, failed.size()); - EXPECT_EQ(0, failed[0].original_index()); - EXPECT_THAT(failed[0].status(), StatusIs(StatusCode::kInvalidArgument)); - EXPECT_EQ(1, failed[1].original_index()); - EXPECT_THAT(failed[1].status(), StatusIs(StatusCode::kInvalidArgument)); -} - -TEST_F(TableTest, ReadRowsWithOptions) { - Table table(client_, kTableId); - auto reader = - table.ReadRows(RowSet(), Filter::PassAllFilter(), NonEmptyOptions()); - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - EXPECT_THAT(*it, StatusIs(StatusCode::kInvalidArgument)); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(TableTest, ReadRowsWithLimitWithOptions) { - Table table(client_, kTableId); - auto reader = - table.ReadRows(RowSet(), 1, Filter::PassAllFilter(), NonEmptyOptions()); - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - EXPECT_THAT(*it, StatusIs(StatusCode::kInvalidArgument)); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(TableTest, ReadRowWithOptions) { - Table table(client_, kTableId); - auto row = table.ReadRow("row", Filter::PassAllFilter(), NonEmptyOptions()); - EXPECT_THAT(row, StatusIs(StatusCode::kInvalidArgument)); -} - -TEST_F(TableTest, AsyncReadRowWithOptions) { - Table table(client_, kTableId); - auto row = - table.AsyncReadRow("row", Filter::PassAllFilter(), NonEmptyOptions()); - EXPECT_THAT(row.get(), StatusIs(StatusCode::kInvalidArgument)); -} - -TEST_F(TableTest, CheckAndMutateRowWithOptions) { - Table table(client_, kTableId); - auto branch = table.CheckAndMutateRow("row", Filter::PassAllFilter(), {}, {}, - NonEmptyOptions()); - EXPECT_THAT(branch, StatusIs(StatusCode::kInvalidArgument)); -} - -TEST_F(TableTest, AsyncCheckAndMutateRowWithOptions) { - Table table(client_, kTableId); - auto branch = table.AsyncCheckAndMutateRow("row", Filter::PassAllFilter(), {}, - {}, NonEmptyOptions()); - EXPECT_THAT(branch.get(), StatusIs(StatusCode::kInvalidArgument)); -} - -TEST_F(TableTest, SampleRowsWithOptions) { - Table table(client_, kTableId); - auto rows = table.SampleRows(NonEmptyOptions()); - EXPECT_THAT(rows, StatusIs(StatusCode::kInvalidArgument)); -} - -TEST_F(TableTest, AsyncSampleRowsWithOptions) { - Table table(client_, kTableId); - auto rows = table.AsyncSampleRows(NonEmptyOptions()); - EXPECT_THAT(rows.get(), StatusIs(StatusCode::kInvalidArgument)); -} - -TEST_F(TableTest, ReadModifyWriteRowWithOptions) { - Table table(client_, kTableId); - auto r = ReadModifyWriteRule::AppendValue("cf", "cq", "v"); - auto row = table.ReadModifyWriteRow("row", r, r, NonEmptyOptions(), r); - EXPECT_THAT(row, StatusIs(StatusCode::kInvalidArgument)); -} - -TEST_F(TableTest, AsyncReadModifyWriteRowWithOptions) { - Table table(client_, kTableId); - auto r = ReadModifyWriteRule::AppendValue("cf", "cq", "v"); - auto row = table.AsyncReadModifyWriteRow("row", r, r, NonEmptyOptions(), r); - EXPECT_THAT(row.get(), StatusIs(StatusCode::kInvalidArgument)); -} - -TEST_F(TableTest, AsyncReadRowsWithOptions) { - MockFunction(bigtable::Row const&)> on_row; - EXPECT_CALL(on_row, Call).Times(0); - - MockFunction on_finish; - EXPECT_CALL(on_finish, Call).WillOnce([](Status const& status) { - EXPECT_THAT(status, StatusIs(StatusCode::kInvalidArgument)); - }); - - Table table(client_, kTableId); - table.AsyncReadRows(on_row.AsStdFunction(), on_finish.AsStdFunction(), - RowSet(), Filter::PassAllFilter(), NonEmptyOptions()); -} - -TEST_F(TableTest, AsyncReadRowsWithLimitWithOptions) { - MockFunction(bigtable::Row const&)> on_row; - EXPECT_CALL(on_row, Call).Times(0); - - MockFunction on_finish; - EXPECT_CALL(on_finish, Call).WillOnce([](Status const& status) { - EXPECT_THAT(status, StatusIs(StatusCode::kInvalidArgument)); - }); - - Table table(client_, kTableId); - table.AsyncReadRows(on_row.AsStdFunction(), on_finish.AsStdFunction(), - RowSet(), 1, Filter::PassAllFilter(), NonEmptyOptions()); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/metadata_update_policy.cc b/google/cloud/bigtable/metadata_update_policy.cc deleted file mode 100644 index 436ada1efe281..0000000000000 --- a/google/cloud/bigtable/metadata_update_policy.cc +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/metadata_update_policy.h" -#include "google/cloud/bigtable/version.h" -#include "google/cloud/internal/api_client_header.h" -#include "google/cloud/internal/url_encode.h" - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -// These we cannot change because they are part of the public API. -// NOLINTNEXTLINE(readability-identifier-naming) -MetadataParamTypes const MetadataParamTypes::PARENT("parent"); -// NOLINTNEXTLINE(readability-identifier-naming) -MetadataParamTypes const MetadataParamTypes::NAME("name"); -// NOLINTNEXTLINE(readability-identifier-naming) -MetadataParamTypes const MetadataParamTypes::RESOURCE("resource"); -// NOLINTNEXTLINE(readability-identifier-naming) -MetadataParamTypes const MetadataParamTypes::TABLE_NAME("table_name"); -// NOLINTNEXTLINE(readability-identifier-naming) -MetadataParamTypes const MetadataParamTypes::APP_PROFILE_NAME( - "app_profile.name"); -// NOLINTNEXTLINE(readability-identifier-naming) -MetadataParamTypes const MetadataParamTypes::INSTANCE_NAME("instance.name"); -// NOLINTNEXTLINE(readability-identifier-naming) -MetadataParamTypes const MetadataParamTypes::BACKUP_NAME("backup.name"); - -MetadataUpdatePolicy::MetadataUpdatePolicy( - std::string const& resource_name, - MetadataParamTypes const& metadata_param_type) - : value_(metadata_param_type.type() + '=' + resource_name), - api_client_header_(internal::HandCraftedLibClientHeader()) {} - -void MetadataUpdatePolicy::Setup(grpc::ClientContext& context) const { - context.AddMetadata(std::string("x-goog-request-params"), value()); - context.AddMetadata(std::string("x-goog-api-client"), api_client_header()); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -namespace bigtable_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -bigtable::MetadataUpdatePolicy MakeMetadataUpdatePolicy( - std::string const& table_name, std::string const& app_profile_id) { - // The rule is the same for all RPCs in the Data API. We always include the - // table name. We append an app profile id only if one was provided. - return bigtable::MetadataUpdatePolicy( - internal::UrlEncode(table_name) + - (app_profile_id.empty() - ? "" - : "&app_profile_id=" + internal::UrlEncode(app_profile_id)), - bigtable::MetadataParamTypes::TABLE_NAME); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/metadata_update_policy.h b/google/cloud/bigtable/metadata_update_policy.h deleted file mode 100644 index d556ecfae70a4..0000000000000 --- a/google/cloud/bigtable/metadata_update_policy.h +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_METADATA_UPDATE_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_METADATA_UPDATE_POLICY_H - -#include "google/cloud/bigtable/version.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -/** - * Define the class for governing x-goog-request-params metadata value. - * - * The value of x-goog-request-params starts with one of the following suffix - * "parent=" : Operation in instance, e.g. TableAdmin::CreateTable. - * "table_name=" : table_id is known at the time of creation, e.g. - * Table::Apply. - * "name=" : this is used when table|_id is known only in the RPC call, e.g. - * TableAdmin::GetTable. - * "resource=" : this is used to set IAM policies for bigtable resource. - * - * The Setup function also adds x-goog-api-client header for analytics purpose. - */ -class MetadataParamTypes final { - public: - // NOLINTNEXTLINE(readability-identifier-naming) - static MetadataParamTypes const PARENT; - // NOLINTNEXTLINE(readability-identifier-naming) - static MetadataParamTypes const NAME; - // NOLINTNEXTLINE(readability-identifier-naming) - static MetadataParamTypes const RESOURCE; - // NOLINTNEXTLINE(readability-identifier-naming) - static MetadataParamTypes const TABLE_NAME; - // NOLINTNEXTLINE(readability-identifier-naming) - static MetadataParamTypes const APP_PROFILE_NAME; - // NOLINTNEXTLINE(readability-identifier-naming) - static MetadataParamTypes const INSTANCE_NAME; - // NOLINTNEXTLINE(readability-identifier-naming) - static MetadataParamTypes const BACKUP_NAME; - - std::string const& type() const { return type_; } - - private: - explicit MetadataParamTypes(std::string type) : type_(std::move(type)) {} - std::string type_; -}; - -inline bool operator==(MetadataParamTypes const& lhs, - MetadataParamTypes const& rhs) { - return lhs.type() == rhs.type(); -} - -inline bool operator!=(MetadataParamTypes const& lhs, - MetadataParamTypes const& rhs) { - return std::rel_ops::operator!=(lhs, rhs); -} - -/// MetadataUpdatePolicy holds supported metadata and setup ClientContext -class MetadataUpdatePolicy { - public: - /** - * Constructor with default metadata pair. - * - * @param resource_name hierarchical name of resource, including project id, - * instance id and/or table_id. - * @param metadata_param_type type to decide prefix for the value of - * x-goog-request-params - */ - MetadataUpdatePolicy(std::string const& resource_name, - MetadataParamTypes const& metadata_param_type); - - MetadataUpdatePolicy(MetadataUpdatePolicy&&) = default; - MetadataUpdatePolicy& operator=(MetadataUpdatePolicy&&) = default; - MetadataUpdatePolicy(MetadataUpdatePolicy const&) = default; - MetadataUpdatePolicy& operator=(MetadataUpdatePolicy const&) = default; - - // Update the ClientContext for the next call. - void Setup(grpc::ClientContext& context) const; - - std::string const& value() const { return value_; } - std::string const& api_client_header() const { return api_client_header_; } - - private: - std::string value_; - std::string api_client_header_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -namespace bigtable_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * Returns a `MetadataUpdatePolicy` that implements the explicit routing - * specification in `bigtable.proto`. - */ -bigtable::MetadataUpdatePolicy MakeMetadataUpdatePolicy( - std::string const& table_name, std::string const& app_profile_id); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_METADATA_UPDATE_POLICY_H diff --git a/google/cloud/bigtable/metadata_update_policy_test.cc b/google/cloud/bigtable/metadata_update_policy_test.cc deleted file mode 100644 index edc31787ff584..0000000000000 --- a/google/cloud/bigtable/metadata_update_policy_test.cc +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/metadata_update_policy.h" -#include "google/cloud/bigtable/row_set.h" -#include "google/cloud/bigtable/table.h" -#include "google/cloud/bigtable/testing/embedded_server_test_fixture.h" -#include "google/cloud/internal/url_encode.h" -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -class MetadataUpdatePolicyTest : public testing::EmbeddedServerTestFixture {}; - -using ::testing::HasSubstr; - -TEST_F(MetadataUpdatePolicyTest, TableMetadata) { - grpc::string expected = - "table_name=" + google::cloud::internal::UrlEncode(kTableName); - auto reader = table_->ReadRows(RowSet("row1"), 1, Filter::PassAllFilter()); - // lets make the RPC call to send metadata - reader.begin(); - // Get metadata from embedded server - auto client_metadata = bigtable_service_.client_metadata(); - auto range = client_metadata.equal_range("x-goog-request-params"); - ASSERT_EQ(1, std::distance(range.first, range.second)); - EXPECT_EQ(expected, range.first->second); -} - -TEST_F(MetadataUpdatePolicyTest, TableWithNewTargetMetadata) { - std::string const other_project_id = "other-project"; - std::string const other_instance_id = "other-instance"; - std::string const other_table_id = "other-table"; - auto other_table = table_->WithNewTarget(other_project_id, other_instance_id, - other_table_id); - - grpc::string expected = - "table_name=" + google::cloud::internal::UrlEncode(TableName( - other_project_id, other_instance_id, other_table_id)); - auto reader = - other_table.ReadRows(RowSet("row1"), 1, Filter::PassAllFilter()); - // lets make the RPC call to send metadata - reader.begin(); - // Get metadata from embedded server - auto client_metadata = bigtable_service_.client_metadata(); - auto range = client_metadata.equal_range("x-goog-request-params"); - ASSERT_EQ(1, std::distance(range.first, range.second)); - EXPECT_EQ(expected, range.first->second); -} - -/// @test A cloning test for normal construction of metadata . -TEST_F(MetadataUpdatePolicyTest, SimpleDefault) { - auto const x_google_request_params = "parent=" + std::string(kInstanceName); - MetadataUpdatePolicy created(kInstanceName, MetadataParamTypes::PARENT); - EXPECT_EQ(x_google_request_params, created.value()); - EXPECT_THAT(created.api_client_header(), HasSubstr("gl-cpp/")); - EXPECT_THAT(created.api_client_header(), HasSubstr("gccl/")); - EXPECT_THAT(created.api_client_header(), - AnyOf(HasSubstr("-noex-"), HasSubstr("-ex-"))); -} - -TEST_F(MetadataUpdatePolicyTest, TableAppProfileMetadata) { - auto table = Table(data_client_, "profile", kTableId); - grpc::string expected = - "table_name=" + google::cloud::internal::UrlEncode(kTableName) + - "&app_profile_id=profile"; - auto reader = table.ReadRows(RowSet("row1"), 1, Filter::PassAllFilter()); - // lets make the RPC call to send metadata - reader.begin(); - // Get metadata from embedded server - auto client_metadata = bigtable_service_.client_metadata(); - auto range = client_metadata.equal_range("x-goog-request-params"); - ASSERT_EQ(1, std::distance(range.first, range.second)); - EXPECT_EQ(expected, range.first->second); -} - -/// @test A test for setting metadata when table is known. -TEST_F(MetadataUpdatePolicyTest, TableWithNewTargetAppProfileMetadata) { - auto table = - table_->WithNewTarget(kProjectId, kInstanceId, "profile", kTableId); - grpc::string expected = - "table_name=" + google::cloud::internal::UrlEncode(kTableName) + - "&app_profile_id=profile"; - auto reader = table.ReadRows(RowSet("row1"), 1, Filter::PassAllFilter()); - // lets make the RPC call to send metadata - reader.begin(); - // Get metadata from embedded server - auto client_metadata = bigtable_service_.client_metadata(); - auto range = client_metadata.equal_range("x-goog-request-params"); - ASSERT_EQ(1, std::distance(range.first, range.second)); - EXPECT_EQ(expected, range.first->second); -} - -TEST(MakeMetadataUpdatePolicyTest, AppProfileRouting) { - auto m = bigtable_internal::MakeMetadataUpdatePolicy("table", ""); - EXPECT_EQ(m.value(), "table_name=table"); - - m = bigtable_internal::MakeMetadataUpdatePolicy("table", "profile"); - EXPECT_EQ(m.value(), "table_name=table&app_profile_id=profile"); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/mocks/mock_data_connection.h b/google/cloud/bigtable/mocks/mock_data_connection.h index a283af2c9e787..61f3d824a2005 100644 --- a/google/cloud/bigtable/mocks/mock_data_connection.h +++ b/google/cloud/bigtable/mocks/mock_data_connection.h @@ -16,6 +16,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_MOCKS_MOCK_DATA_CONNECTION_H #include "google/cloud/bigtable/data_connection.h" +#include "google/cloud/bigtable/options.h" +#include "google/cloud/options.h" #include "google/cloud/version.h" #include diff --git a/google/cloud/bigtable/mutation_batcher.h b/google/cloud/bigtable/mutation_batcher.h index f71b8a336e547..e3d0f5d652243 100644 --- a/google/cloud/bigtable/mutation_batcher.h +++ b/google/cloud/bigtable/mutation_batcher.h @@ -15,13 +15,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_MUTATION_BATCHER_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_MUTATION_BATCHER_H -#include "google/cloud/bigtable/client_options.h" #include "google/cloud/bigtable/completion_queue.h" #include "google/cloud/bigtable/mutations.h" #include "google/cloud/bigtable/table.h" #include "google/cloud/bigtable/version.h" #include "google/cloud/status.h" -#include +#include "google/bigtable/v2/bigtable.pb.h" #include #include #include diff --git a/google/cloud/bigtable/mutations.h b/google/cloud/bigtable/mutations.h index 0a1a3657d71b3..642fe4969e299 100644 --- a/google/cloud/bigtable/mutations.h +++ b/google/cloud/bigtable/mutations.h @@ -23,8 +23,8 @@ #include "google/cloud/status.h" #include "google/cloud/status_or.h" #include "absl/meta/type_traits.h" -#include -#include +#include "google/bigtable/v2/bigtable.pb.h" +#include "google/bigtable/v2/data.pb.h" #include #include #include diff --git a/google/cloud/bigtable/mutations_test.cc b/google/cloud/bigtable/mutations_test.cc index b368aa212e2ee..e131ad0d6ced0 100644 --- a/google/cloud/bigtable/mutations_test.cc +++ b/google/cloud/bigtable/mutations_test.cc @@ -16,7 +16,7 @@ #include "google/cloud/internal/big_endian.h" #include "google/cloud/testing_util/chrono_literals.h" #include "google/cloud/testing_util/status_matchers.h" -#include +#include "google/rpc/error_details.pb.h" #include namespace google { diff --git a/google/cloud/bigtable/options.h b/google/cloud/bigtable/options.h index 865d5c009547e..d75550400fa49 100644 --- a/google/cloud/bigtable/options.h +++ b/google/cloud/bigtable/options.h @@ -39,8 +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" @@ -99,37 +100,6 @@ struct ReverseScanOption { using Type = bool; }; -/** - * The endpoint for data operations. - * - * @deprecated Please use `google::cloud::EndpointOption` instead. - */ -struct DataEndpointOption { - using Type = std::string; -}; - -/** - * The endpoint for table admin operations. - * - * @deprecated Please use `google::cloud::EndpointOption` instead. - */ -struct AdminEndpointOption { - using Type = std::string; -}; - -/** - * The endpoint for instance admin operations. - * - * In most scenarios this should have the same value as `AdminEndpointOption`. - * The most common exception is testing, where the emulator for instance admin - * operations may be different than the emulator for admin and data operations. - * - * @deprecated Please use `google::cloud::EndpointOption` instead. - */ -struct InstanceAdminEndpointOption { - using Type = std::string; -}; - /** * Minimum time in ms to refresh connections. * @@ -203,13 +173,64 @@ 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` using ClientOptionList = - OptionList; + OptionList<::google::cloud::bigtable_internal::DataEndpointOption, + ::google::cloud::bigtable_internal::AdminEndpointOption, + ::google::cloud::bigtable_internal::InstanceAdminEndpointOption, + MinConnectionRefreshOption, MaxConnectionRefreshOption>; /** * Option to configure the retry policy used by `Table`. diff --git a/google/cloud/bigtable/prepared_query.h b/google/cloud/bigtable/prepared_query.h index 88539fa7c07d4..382c33bc83683 100644 --- a/google/cloud/bigtable/prepared_query.h +++ b/google/cloud/bigtable/prepared_query.h @@ -21,7 +21,7 @@ #include "google/cloud/bigtable/value.h" #include "google/cloud/bigtable/version.h" #include "google/cloud/completion_queue.h" -#include +#include "google/bigtable/v2/bigtable.pb.h" #include #include diff --git a/google/cloud/bigtable/quickstart/.bazelrc b/google/cloud/bigtable/quickstart/.bazelrc index f8f4bb3e07a87..1ccef142904e8 100644 --- a/google/cloud/bigtable/quickstart/.bazelrc +++ b/google/cloud/bigtable/quickstart/.bazelrc @@ -15,19 +15,12 @@ # 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 +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 - -#Our quickstarts do not yet support bzlmod -build --noenable_bzlmod 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/CMakeLists.txt b/google/cloud/bigtable/quickstart/CMakeLists.txt index b6584027c88a7..9d5cb3c94b00d 100644 --- a/google/cloud/bigtable/quickstart/CMakeLists.txt +++ b/google/cloud/bigtable/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # A minimal CMakeList.txt showing how to use the Cloud Bigtable C++ client # library in CMake-based projects. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-bigtable-quickstart CXX) find_package(google_cloud_cpp_bigtable REQUIRED) diff --git a/google/cloud/bigtable/quickstart/MODULE.bazel b/google/cloud/bigtable/quickstart/MODULE.bazel new file mode 100644 index 0000000000000..e47bfb6fa8af0 --- /dev/null +++ b/google/cloud/bigtable/quickstart/MODULE.bazel @@ -0,0 +1,20 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +module( + name = "quickstart", + version = "0.0.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 b28c58991fc48..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 = "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/bigtable/quickstart/bazel/BUILD.bazel b/google/cloud/bigtable/quickstart/bazel/BUILD.bazel new file mode 100644 index 0000000000000..9d3c52804de76 --- /dev/null +++ b/google/cloud/bigtable/quickstart/bazel/BUILD.bazel @@ -0,0 +1,17 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 v2 + +package(default_visibility = ["//:__subpackages__"]) diff --git a/google/cloud/bigtable/quickstart/bazel/remove_upb_c_rules.patch b/google/cloud/bigtable/quickstart/bazel/remove_upb_c_rules.patch new file mode 100644 index 0000000000000..43b077224c29d --- /dev/null +++ b/google/cloud/bigtable/quickstart/bazel/remove_upb_c_rules.patch @@ -0,0 +1,124 @@ +diff --git google/api/expr/v1alpha1/BUILD.bazel google/api/expr/v1alpha1/BUILD.bazel +index 9bed46809..197e5249c 100644 +--- google/api/expr/v1alpha1/BUILD.bazel ++++ google/api/expr/v1alpha1/BUILD.bazel +@@ -233,32 +233,32 @@ cc_proto_library( + ############################################################################## + # upb + ############################################################################## +-load( +- "@com_google_googleapis_imports//:imports.bzl", +- "upb_c_proto_library", +-) +- +-upb_c_proto_library( +- name = "checked_upb_proto", +- deps = [":checked_proto"], +-) +- +-upb_c_proto_library( +- name = "eval_upb_proto", +- deps = [":eval_proto"], +-) +- +-upb_c_proto_library( +- name = "explain_upb_proto", +- deps = [":explain_proto"], +-) +- +-upb_c_proto_library( +- name = "syntax_upb_proto", +- deps = [":syntax_proto"], +-) +- +-upb_c_proto_library( +- name = "value_upb_proto", +- deps = [":value_proto"], +-) ++#load( ++ #"@com_google_googleapis_imports//:imports.bzl", ++ #"upb_c_proto_library", ++#) ++# ++#upb_c_proto_library( ++ #name = "checked_upb_proto", ++ #deps = [":checked_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "eval_upb_proto", ++ #deps = [":eval_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "explain_upb_proto", ++ #deps = [":explain_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "syntax_upb_proto", ++ #deps = [":syntax_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "value_upb_proto", ++ #deps = [":value_proto"], ++#) +diff --git google/rpc/BUILD.bazel google/rpc/BUILD.bazel +index 31fd6457d..c38f00c46 100644 +--- google/rpc/BUILD.bazel ++++ google/rpc/BUILD.bazel +@@ -11,7 +11,7 @@ load( + "php_proto_library", + "py_gapic_assembly_pkg", + "py_proto_library", +- "upb_c_proto_library", ++ #"upb_c_proto_library", + ) + load("@rules_proto//proto:defs.bzl", "proto_library") + +@@ -104,15 +104,15 @@ cc_proto_library( + deps = [":status_proto"], + ) + +-upb_c_proto_library( +- name = "code_upb_proto", +- deps = [":code_proto"], +-) ++#upb_c_proto_library( ++ #name = "code_upb_proto", ++ #deps = [":code_proto"], ++#) + +-upb_c_proto_library( +- name = "status_upb_proto", +- deps = [":status_proto"], +-) ++#upb_c_proto_library( ++ #name = "status_upb_proto", ++ #deps = [":status_proto"], ++#) + + py_proto_library( + name = "code_py_proto", +diff --git repository_rules.bzl repository_rules.bzl +index 2f87ad682..2ab3bd054 100644 +--- repository_rules.bzl ++++ repository_rules.bzl +@@ -224,11 +224,11 @@ def switched_rules_by_language( + # + # upb + # +- rules["upb_c_proto_library"] = _switch( +- upb, +- "@com_google_protobuf//bazel:upb_c_proto_library.bzl", +- "upb_c_proto_library", +- ) ++ #rules["upb_c_proto_library"] = _switch( ++ # upb, ++ # "@com_google_protobuf//bazel:upb_c_proto_library.bzl", ++ # "upb_c_proto_library", ++ #) + + # + # PHP diff --git a/google/cloud/bigtable/read_modify_write_rule.h b/google/cloud/bigtable/read_modify_write_rule.h index 964eebd9af30d..ce782dc56286d 100644 --- a/google/cloud/bigtable/read_modify_write_rule.h +++ b/google/cloud/bigtable/read_modify_write_rule.h @@ -16,7 +16,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_READ_MODIFY_WRITE_RULE_H #include "google/cloud/bigtable/version.h" -#include +#include "google/bigtable/v2/data.pb.h" #include #include diff --git a/google/cloud/bigtable/resource_names.cc b/google/cloud/bigtable/resource_names.cc index 731ff4d65f3b9..35375cb344d2e 100644 --- a/google/cloud/bigtable/resource_names.cc +++ b/google/cloud/bigtable/resource_names.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "google/cloud/bigtable/resource_names.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/bigtable/row_key.h b/google/cloud/bigtable/row_key.h index 5b1871253f9b7..e008e243cb4d1 100644 --- a/google/cloud/bigtable/row_key.h +++ b/google/cloud/bigtable/row_key.h @@ -17,7 +17,7 @@ #include "google/cloud/bigtable/internal/google_bytes_traits.h" #include "google/cloud/bigtable/version.h" -#include +#include "google/bigtable/v2/data.pb.h" #include #include diff --git a/google/cloud/bigtable/row_range.h b/google/cloud/bigtable/row_range.h index e39ae676c3703..c948da47e419b 100644 --- a/google/cloud/bigtable/row_range.h +++ b/google/cloud/bigtable/row_range.h @@ -18,7 +18,7 @@ #include "google/cloud/bigtable/internal/prefix_range_end.h" #include "google/cloud/bigtable/row_key.h" #include "google/cloud/bigtable/version.h" -#include +#include "google/bigtable/v2/data.pb.h" #include #include diff --git a/google/cloud/bigtable/row_reader.cc b/google/cloud/bigtable/row_reader.cc index 3efcf408cdfb0..aeb5960655140 100644 --- a/google/cloud/bigtable/row_reader.cc +++ b/google/cloud/bigtable/row_reader.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/bigtable/row_reader.h" -#include "google/cloud/bigtable/internal/legacy_row_reader.h" #include "google/cloud/bigtable/table.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/internal/throw_delegate.h" @@ -65,32 +64,6 @@ RowReader::RowReader() : RowReader( std::make_shared(Status{})) {} -RowReader::RowReader( - std::shared_ptr client, std::string table_name, RowSet row_set, - std::int64_t rows_limit, Filter filter, - std::unique_ptr retry_policy, - std::unique_ptr backoff_policy, - MetadataUpdatePolicy metadata_update_policy, - std::unique_ptr parser_factory) - : RowReader(std::make_shared( - std::move(client), std::move(table_name), std::move(row_set), - rows_limit, std::move(filter), std::move(retry_policy), - std::move(backoff_policy), std::move(metadata_update_policy), - std::move(parser_factory))) {} - -RowReader::RowReader( - std::shared_ptr client, std::string app_profile_id, - std::string table_name, RowSet row_set, std::int64_t rows_limit, - Filter filter, std::unique_ptr retry_policy, - std::unique_ptr backoff_policy, - MetadataUpdatePolicy metadata_update_policy, - std::unique_ptr parser_factory) - : RowReader(std::make_shared( - std::move(client), std::move(app_profile_id), std::move(table_name), - std::move(row_set), rows_limit, std::move(filter), - std::move(retry_policy), std::move(backoff_policy), - std::move(metadata_update_policy), std::move(parser_factory))) {} - std::int64_t constexpr RowReader::NO_ROWS_LIMIT; // The name must be all lowercase to work with range-for loops. diff --git a/google/cloud/bigtable/row_reader.h b/google/cloud/bigtable/row_reader.h index 11ba0d202eba9..180834a3eb566 100644 --- a/google/cloud/bigtable/row_reader.h +++ b/google/cloud/bigtable/row_reader.h @@ -15,11 +15,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ROW_READER_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ROW_READER_H -#include "google/cloud/bigtable/data_client.h" #include "google/cloud/bigtable/filters.h" #include "google/cloud/bigtable/internal/readrowsparser.h" #include "google/cloud/bigtable/internal/row_reader_impl.h" -#include "google/cloud/bigtable/metadata_update_policy.h" #include "google/cloud/bigtable/row_set.h" #include "google/cloud/bigtable/rpc_backoff_policy.h" #include "google/cloud/bigtable/rpc_retry_policy.h" @@ -65,22 +63,6 @@ class RowReader { /// Default constructs an empty RowReader. RowReader(); - GOOGLE_CLOUD_CPP_BIGTABLE_ROW_READER_CTOR_DEPRECATED() - RowReader(std::shared_ptr client, std::string table_name, - RowSet row_set, std::int64_t rows_limit, Filter filter, - std::unique_ptr retry_policy, - std::unique_ptr backoff_policy, - MetadataUpdatePolicy metadata_update_policy, - std::unique_ptr parser_factory); - - GOOGLE_CLOUD_CPP_BIGTABLE_ROW_READER_CTOR_DEPRECATED() - RowReader(std::shared_ptr client, std::string app_profile_id, - std::string table_name, RowSet row_set, std::int64_t rows_limit, - Filter filter, std::unique_ptr retry_policy, - std::unique_ptr backoff_policy, - MetadataUpdatePolicy metadata_update_policy, - std::unique_ptr parser_factory); - // NOLINTNEXTLINE(performance-noexcept-move-constructor) RowReader(RowReader&&) = default; diff --git a/google/cloud/bigtable/row_reader_test.cc b/google/cloud/bigtable/row_reader_test.cc index b11f897d62362..1ab61568e94c3 100644 --- a/google/cloud/bigtable/row_reader_test.cc +++ b/google/cloud/bigtable/row_reader_test.cc @@ -90,7 +90,6 @@ TEST(RowReaderTest, OptionsSpan) { } } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::IsActive; TEST(RowReader, CallSpanActiveThroughout) { @@ -121,7 +120,6 @@ TEST(RowReader, CallSpanActiveThroughout) { EXPECT_STATUS_OK(row); } } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // anonymous namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/bigtable/sql_statement.h b/google/cloud/bigtable/sql_statement.h index 0b184cddaeb79..30cd0cd438305 100644 --- a/google/cloud/bigtable/sql_statement.h +++ b/google/cloud/bigtable/sql_statement.h @@ -20,7 +20,7 @@ #include "google/cloud/bigtable/version.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/status_or.h" -#include +#include "google/bigtable/v2/bigtable.pb.h" #include #include #include diff --git a/google/cloud/bigtable/table.cc b/google/cloud/bigtable/table.cc index 14b96ef6715d3..68b7c8016f073 100644 --- a/google/cloud/bigtable/table.cc +++ b/google/cloud/bigtable/table.cc @@ -13,14 +13,6 @@ // limitations under the License. #include "google/cloud/bigtable/table.h" -#include "google/cloud/bigtable/internal/bulk_mutator.h" -#include "google/cloud/bigtable/internal/data_connection_impl.h" -#include "google/cloud/bigtable/internal/legacy_async_bulk_apply.h" -#include "google/cloud/bigtable/internal/legacy_async_row_sampler.h" -#include "google/cloud/bigtable/internal/legacy_row_reader.h" -#include "google/cloud/bigtable/internal/unary_client_utils.h" -#include "google/cloud/internal/async_retry_unary_rpc.h" -#include "google/cloud/internal/make_status.h" #include #include @@ -30,7 +22,6 @@ namespace cloud { namespace bigtable { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -using ::google::cloud::Idempotency; using ::google::cloud::internal::MergeOptions; using ::google::cloud::internal::OptionsSpan; @@ -44,175 +35,28 @@ void SetCommonTableOperationRequest(Request& request, } } // namespace -using ClientUtils = bigtable::internal::UnaryClientUtils; - static_assert(std::is_copy_assignable::value, "bigtable::Table must be CopyAssignable"); Status Table::Apply(SingleRowMutation mut, Options opts) { - if (connection_) { - OptionsSpan span(MergeOptions(std::move(opts), options_)); - return connection_->Apply(table_name_, std::move(mut)); - } - if (!google::cloud::internal::IsEmpty(opts)) { - return google::cloud::internal::InvalidArgumentError( - "Per-operation options only apply to `Table`s constructed " - "with a `DataConnection`.", - GCP_ERROR_INFO()); - } - - // Copy the policies in effect for this operation. Many policy classes change - // their state as the operation makes progress (or fails to make progress), so - // we need fresh instances. - auto rpc_policy = clone_rpc_retry_policy(); - auto backoff_policy = clone_rpc_backoff_policy(); - auto idempotent_policy = clone_idempotent_mutation_policy(); - - // Build the RPC request, try to minimize copying. - btproto::MutateRowRequest request; - SetCommonTableOperationRequest( - request, app_profile_id(), table_name_); - mut.MoveTo(request); - - bool const is_idempotent = - std::all_of(request.mutations().begin(), request.mutations().end(), - [&idempotent_policy](btproto::Mutation const& m) { - return idempotent_policy->is_idempotent(m); - }); - - btproto::MutateRowResponse response; - grpc::Status status; - while (true) { - grpc::ClientContext client_context; - rpc_policy->Setup(client_context); - backoff_policy->Setup(client_context); - metadata_update_policy_.Setup(client_context); - status = client_->MutateRow(&client_context, request, &response); - - if (status.ok()) { - return google::cloud::Status{}; - } - // It is up to the policy to terminate this loop, it could run - // forever, but that would be a bad policy (pun intended). - if (!rpc_policy->OnFailure(status) || !is_idempotent) { - return MakeStatusFromRpcError(status); - } - auto delay = backoff_policy->OnCompletion(status); - std::this_thread::sleep_for(delay); - } + OptionsSpan span(MergeOptions(std::move(opts), options_)); + return connection_->Apply(table_name_, std::move(mut)); } future Table::AsyncApply(SingleRowMutation mut, Options opts) { - if (connection_) { - OptionsSpan span(MergeOptions(std::move(opts), options_)); - return connection_->AsyncApply(table_name_, std::move(mut)); - } - if (!google::cloud::internal::IsEmpty(opts)) { - return make_ready_future(google::cloud::internal::InvalidArgumentError( - "Per-operation options only apply to `Table`s constructed " - "with a `DataConnection`.", - GCP_ERROR_INFO())); - } - - google::bigtable::v2::MutateRowRequest request; - SetCommonTableOperationRequest( - request, app_profile_id(), table_name_); - mut.MoveTo(request); - - // Determine if all the mutations are idempotent. The idempotency of the - // mutations won't change as the retry loop executes, so we can just compute - // it once and use a constant value for the loop. - auto idempotent_mutation_policy = clone_idempotent_mutation_policy(); - auto const is_idempotent = std::all_of( - request.mutations().begin(), request.mutations().end(), - [&idempotent_mutation_policy](google::bigtable::v2::Mutation const& m) { - return idempotent_mutation_policy->is_idempotent(m); - }); - - auto const idempotency = - is_idempotent ? Idempotency::kIdempotent : Idempotency::kNonIdempotent; - - auto cq = background_threads_->cq(); - auto& client = client_; - auto metadata_update_policy = clone_metadata_update_policy(); - return google::cloud::internal::StartRetryAsyncUnaryRpc( - cq, __func__, clone_rpc_retry_policy(), clone_rpc_backoff_policy(), - idempotency, - [client, metadata_update_policy]( - grpc::ClientContext* context, - google::bigtable::v2::MutateRowRequest const& request, - grpc::CompletionQueue* cq) { - metadata_update_policy.Setup(*context); - return client->AsyncMutateRow(context, request, cq); - }, - std::move(request)) - .then([](future> r) { - return r.get().status(); - }); + OptionsSpan span(MergeOptions(std::move(opts), options_)); + return connection_->AsyncApply(table_name_, std::move(mut)); } std::vector Table::BulkApply(BulkMutation mut, Options opts) { - if (connection_) { - OptionsSpan span(MergeOptions(std::move(opts), options_)); - return connection_->BulkApply(table_name_, std::move(mut)); - } - if (!google::cloud::internal::IsEmpty(opts)) { - return bigtable_internal::MakeFailedMutations( - google::cloud::internal::InvalidArgumentError( - "Per-operation options only apply to `Table`s constructed " - "with a `DataConnection`.", - GCP_ERROR_INFO()), - mut.size()); - } - - if (mut.empty()) return {}; - grpc::Status status; - - // Copy the policies in effect for this operation. Many policy classes change - // their state as the operation makes progress (or fails to make progress), so - // we need fresh instances. - auto backoff_policy = clone_rpc_backoff_policy(); - auto retry_policy = clone_rpc_retry_policy(); - auto idempotent_policy = clone_idempotent_mutation_policy(); - - bigtable_internal::BulkMutator mutator( - app_profile_id(), table_name_, *idempotent_policy, std::move(mut), - std::make_shared()); - while (true) { - grpc::ClientContext client_context; - backoff_policy->Setup(client_context); - retry_policy->Setup(client_context); - metadata_update_policy_.Setup(client_context); - status = mutator.MakeOneRequest(*client_, client_context); - if (!mutator.HasPendingMutations()) break; - if (!retry_policy->OnFailure(status)) break; - auto delay = backoff_policy->OnCompletion(status); - std::this_thread::sleep_for(delay); - } - return std::move(mutator).OnRetryDone(); + OptionsSpan span(MergeOptions(std::move(opts), options_)); + return connection_->BulkApply(table_name_, std::move(mut)); } future> Table::AsyncBulkApply(BulkMutation mut, Options opts) { - if (connection_) { - OptionsSpan span(MergeOptions(std::move(opts), options_)); - return connection_->AsyncBulkApply(table_name_, std::move(mut)); - } - if (!google::cloud::internal::IsEmpty(opts)) { - return make_ready_future(bigtable_internal::MakeFailedMutations( - google::cloud::internal::InvalidArgumentError( - "Per-operation options only apply to `Table`s constructed " - "with a `DataConnection`.", - GCP_ERROR_INFO()), - mut.size())); - } - - auto cq = background_threads_->cq(); - auto mutation_policy = clone_idempotent_mutation_policy(); - return internal::AsyncRetryBulkApply::Create( - cq, clone_rpc_retry_policy(), clone_rpc_backoff_policy(), - *mutation_policy, clone_metadata_update_policy(), client_, - app_profile_id(), table_name_, std::move(mut)); + OptionsSpan span(MergeOptions(std::move(opts), options_)); + return connection_->AsyncBulkApply(table_name_, std::move(mut)); } RowReader Table::ReadRows(RowSet row_set, Filter filter, Options opts) { @@ -222,162 +66,34 @@ RowReader Table::ReadRows(RowSet row_set, Filter filter, Options opts) { RowReader Table::ReadRows(RowSet row_set, std::int64_t rows_limit, Filter filter, Options opts) { - if (connection_) { - OptionsSpan span(MergeOptions(std::move(opts), options_)); - return connection_->ReadRows(table_name_, std::move(row_set), rows_limit, - std::move(filter)); - } - if (!google::cloud::internal::IsEmpty(opts)) { - return MakeRowReader( - std::make_shared( - google::cloud::internal::InvalidArgumentError( - "Per-operation options only apply to `Table`s constructed " - "with a `DataConnection`.", - GCP_ERROR_INFO()))); - } - - auto impl = std::make_shared( - client_, app_profile_id(), table_name_, std::move(row_set), rows_limit, - std::move(filter), clone_rpc_retry_policy(), clone_rpc_backoff_policy(), - metadata_update_policy_, - std::make_unique()); - return bigtable_internal::MakeRowReader(std::move(impl)); + OptionsSpan span(MergeOptions(std::move(opts), options_)); + return connection_->ReadRows(table_name_, std::move(row_set), rows_limit, + std::move(filter)); } StatusOr> Table::ReadRow(std::string row_key, Filter filter, Options opts) { - if (connection_) { - OptionsSpan span(MergeOptions(std::move(opts), options_)); - return connection_->ReadRow(table_name_, std::move(row_key), - std::move(filter)); - } - if (!google::cloud::internal::IsEmpty(opts)) { - return google::cloud::internal::InvalidArgumentError( - "Per-operation options only apply to `Table`s constructed " - "with a `DataConnection`.", - GCP_ERROR_INFO()); - } - - RowSet row_set(std::move(row_key)); - std::int64_t const rows_limit = 1; - RowReader reader = - ReadRows(std::move(row_set), rows_limit, std::move(filter)); - - auto it = reader.begin(); - if (it == reader.end()) { - return std::make_pair(false, Row("", {})); - } - if (!*it) { - return it->status(); - } - auto result = std::make_pair(true, std::move(**it)); - if (++it != reader.end()) { - return google::cloud::internal::InternalError( - "internal error - RowReader returned more than one row in ReadRow(, " - "GCP_ERROR_INFO())"); - } - return result; + OptionsSpan span(MergeOptions(std::move(opts), options_)); + return connection_->ReadRow(table_name_, std::move(row_key), + std::move(filter)); } StatusOr Table::CheckAndMutateRow( std::string row_key, Filter filter, std::vector true_mutations, std::vector false_mutations, Options opts) { - if (connection_) { - OptionsSpan span(MergeOptions(std::move(opts), options_)); - return connection_->CheckAndMutateRow( - table_name_, std::move(row_key), std::move(filter), - std::move(true_mutations), std::move(false_mutations)); - } - if (!google::cloud::internal::IsEmpty(opts)) { - return google::cloud::internal::InvalidArgumentError( - "Per-operation options only apply to `Table`s constructed " - "with a `DataConnection`.", - GCP_ERROR_INFO()); - } - - grpc::Status status; - btproto::CheckAndMutateRowRequest request; - request.set_row_key(std::move(row_key)); - SetCommonTableOperationRequest( - request, app_profile_id(), table_name_); - *request.mutable_predicate_filter() = std::move(filter).as_proto(); - for (auto& m : true_mutations) { - *request.add_true_mutations() = std::move(m.op); - } - for (auto& m : false_mutations) { - *request.add_false_mutations() = std::move(m.op); - } - auto const idempotency = idempotent_mutation_policy_->is_idempotent(request) - ? Idempotency::kIdempotent - : Idempotency::kNonIdempotent; - auto response = ClientUtils::MakeCall( - *client_, clone_rpc_retry_policy(), clone_rpc_backoff_policy(), - metadata_update_policy_, &DataClient::CheckAndMutateRow, request, - "Table::CheckAndMutateRow", status, idempotency); - - if (!status.ok()) { - return MakeStatusFromRpcError(status); - } - return response.predicate_matched() ? MutationBranch::kPredicateMatched - : MutationBranch::kPredicateNotMatched; + OptionsSpan span(MergeOptions(std::move(opts), options_)); + return connection_->CheckAndMutateRow( + table_name_, std::move(row_key), std::move(filter), + std::move(true_mutations), std::move(false_mutations)); } future> Table::AsyncCheckAndMutateRow( std::string row_key, Filter filter, std::vector true_mutations, std::vector false_mutations, Options opts) { - if (connection_) { - OptionsSpan span(MergeOptions(std::move(opts), options_)); - return connection_->AsyncCheckAndMutateRow( - table_name_, std::move(row_key), std::move(filter), - std::move(true_mutations), std::move(false_mutations)); - } - if (!google::cloud::internal::IsEmpty(opts)) { - return make_ready_future>( - google::cloud::internal::InvalidArgumentError( - "Per-operation options only apply to `Table`s constructed " - "with a `DataConnection`.", - GCP_ERROR_INFO())); - } - - btproto::CheckAndMutateRowRequest request; - request.set_row_key(std::move(row_key)); - SetCommonTableOperationRequest( - request, app_profile_id(), table_name_); - *request.mutable_predicate_filter() = std::move(filter).as_proto(); - for (auto& m : true_mutations) { - *request.add_true_mutations() = std::move(m.op); - } - for (auto& m : false_mutations) { - *request.add_false_mutations() = std::move(m.op); - } - auto const idempotency = idempotent_mutation_policy_->is_idempotent(request) - ? Idempotency::kIdempotent - : Idempotency::kNonIdempotent; - - auto cq = background_threads_->cq(); - auto& client = client_; - auto metadata_update_policy = clone_metadata_update_policy(); - return google::cloud::internal::StartRetryAsyncUnaryRpc( - cq, __func__, clone_rpc_retry_policy(), clone_rpc_backoff_policy(), - idempotency, - [client, metadata_update_policy]( - grpc::ClientContext* context, - btproto::CheckAndMutateRowRequest const& request, - grpc::CompletionQueue* cq) { - metadata_update_policy.Setup(*context); - return client->AsyncCheckAndMutateRow(context, request, cq); - }, - std::move(request)) - .then([](future> f) - -> StatusOr { - auto response = f.get(); - if (!response) { - return response.status(); - } - return response->predicate_matched() - ? MutationBranch::kPredicateMatched - : MutationBranch::kPredicateNotMatched; - }); + OptionsSpan span(MergeOptions(std::move(opts), options_)); + return connection_->AsyncCheckAndMutateRow( + table_name_, std::move(row_key), std::move(filter), + std::move(true_mutations), std::move(false_mutations)); } // Call the `google.bigtable.v2.Bigtable.SampleRowKeys` RPC until @@ -386,75 +102,14 @@ future> Table::AsyncCheckAndMutateRow( // policies in effect tell us to stop. Note that each retry must clear the // samples otherwise the result is an inconsistent set of sample row keys. StatusOr> Table::SampleRows(Options opts) { - if (connection_) { - OptionsSpan span(MergeOptions(std::move(opts), options_)); - return connection_->SampleRows(table_name_); - } - if (!google::cloud::internal::IsEmpty(opts)) { - return google::cloud::internal::InvalidArgumentError( - "Per-operation options only apply to `Table`s constructed " - "with a `DataConnection`.", - GCP_ERROR_INFO()); - } - - // Copy the policies in effect for this operation. - auto backoff_policy = clone_rpc_backoff_policy(); - auto retry_policy = clone_rpc_retry_policy(); - std::vector samples; - - // Build the RPC request for SampleRowKeys - btproto::SampleRowKeysRequest request; - btproto::SampleRowKeysResponse response; - SetCommonTableOperationRequest( - request, app_profile_id(), table_name_); - - while (true) { - grpc::ClientContext client_context; - backoff_policy->Setup(client_context); - retry_policy->Setup(client_context); - clone_metadata_update_policy().Setup(client_context); - - auto stream = client_->SampleRowKeys(&client_context, request); - while (stream->Read(&response)) { - bigtable::RowKeySample row_sample; - row_sample.offset_bytes = response.offset_bytes(); - row_sample.row_key = std::move(*response.mutable_row_key()); - samples.emplace_back(std::move(row_sample)); - } - auto status = stream->Finish(); - if (status.ok()) { - break; - } - if (!retry_policy->OnFailure(status)) { - return MakeStatusFromRpcError( - status.error_code(), - "Retry policy exhausted: " + status.error_message()); - } - samples.clear(); - auto delay = backoff_policy->OnCompletion(status); - std::this_thread::sleep_for(delay); - } - return samples; + OptionsSpan span(MergeOptions(std::move(opts), options_)); + return connection_->SampleRows(table_name_); } future>> Table::AsyncSampleRows( Options opts) { - if (connection_) { - OptionsSpan span(MergeOptions(std::move(opts), options_)); - return connection_->AsyncSampleRows(table_name_); - } - if (!google::cloud::internal::IsEmpty(opts)) { - return make_ready_future>>( - google::cloud::internal::InvalidArgumentError( - "Per-operation options only apply to `Table`s constructed " - "with a `DataConnection`.", - GCP_ERROR_INFO())); - } - - auto cq = background_threads_->cq(); - return internal::LegacyAsyncRowSampler::Create( - cq, client_, clone_rpc_retry_policy(), clone_rpc_backoff_policy(), - metadata_update_policy_, app_profile_id(), table_name_); + OptionsSpan span(MergeOptions(std::move(opts), options_)); + return connection_->AsyncSampleRows(table_name_); } StatusOr Table::ReadModifyWriteRowImpl( @@ -462,27 +117,8 @@ StatusOr Table::ReadModifyWriteRowImpl( SetCommonTableOperationRequest< ::google::bigtable::v2::ReadModifyWriteRowRequest>( request, app_profile_id(), table_name_); - if (connection_) { - OptionsSpan span(MergeOptions(std::move(opts), options_)); - return connection_->ReadModifyWriteRow(std::move(request)); - } - if (!google::cloud::internal::IsEmpty(opts)) { - return google::cloud::internal::InvalidArgumentError( - "Per-operation options only apply to `Table`s constructed " - "with a `DataConnection`.", - GCP_ERROR_INFO()); - } - - grpc::Status status; - auto response = ClientUtils::MakeNonIdempotentCall( - *(client_), clone_rpc_retry_policy(), clone_metadata_update_policy(), - &DataClient::ReadModifyWriteRow, request, "ReadModifyWriteRowRequest", - status); - if (!status.ok()) { - return MakeStatusFromRpcError(status); - } - return bigtable_internal::TransformReadModifyWriteRowResponse( - std::move(response)); + OptionsSpan span(MergeOptions(std::move(opts), options_)); + return connection_->ReadModifyWriteRow(std::move(request)); } future> Table::AsyncReadModifyWriteRowImpl( @@ -490,107 +126,16 @@ future> Table::AsyncReadModifyWriteRowImpl( SetCommonTableOperationRequest< ::google::bigtable::v2::ReadModifyWriteRowRequest>( request, app_profile_id(), table_name_); - if (connection_) { - OptionsSpan span(MergeOptions(std::move(opts), options_)); - return connection_->AsyncReadModifyWriteRow(std::move(request)); - } - if (!google::cloud::internal::IsEmpty(opts)) { - return make_ready_future>( - google::cloud::internal::InvalidArgumentError( - "Per-operation options only apply to `Table`s constructed " - "with a `DataConnection`.", - GCP_ERROR_INFO())); - } - - auto cq = background_threads_->cq(); - auto& client = client_; - auto metadata_update_policy = clone_metadata_update_policy(); - return google::cloud::internal::StartRetryAsyncUnaryRpc( - cq, __func__, clone_rpc_retry_policy(), clone_rpc_backoff_policy(), - Idempotency::kNonIdempotent, - [client, metadata_update_policy]( - grpc::ClientContext* context, - btproto::ReadModifyWriteRowRequest const& request, - grpc::CompletionQueue* cq) { - metadata_update_policy.Setup(*context); - return client->AsyncReadModifyWriteRow(context, request, cq); - }, - std::move(request)) - .then([](future> fut) - -> StatusOr { - auto result = fut.get(); - if (!result) return std::move(result).status(); - return bigtable_internal::TransformReadModifyWriteRowResponse( - *std::move(result)); - }); + OptionsSpan span(MergeOptions(std::move(opts), options_)); + return connection_->AsyncReadModifyWriteRow(std::move(request)); } future>> Table::AsyncReadRow(std::string row_key, Filter filter, Options opts) { - if (connection_) { - OptionsSpan span(MergeOptions(std::move(opts), options_)); - return connection_->AsyncReadRow(table_name_, std::move(row_key), - std::move(filter)); - } - if (!google::cloud::internal::IsEmpty(opts)) { - return make_ready_future>>( - google::cloud::internal::InvalidArgumentError( - "Per-operation options only apply to `Table`s constructed " - "with a `DataConnection`.", - GCP_ERROR_INFO())); - } - - class AsyncReadRowHandler { - public: - AsyncReadRowHandler() : row_("", {}) {} - - future>> GetFuture() { - return row_promise_.get_future(); - } - - future OnRow(Row row) { - // assert(!row_received_); - row_ = std::move(row); - row_received_ = true; - // Don't satisfy the promise before `OnStreamFinished`. - // - // The `CompletionQueue`, which this object holds a reference to, should - // not be shut down before `OnStreamFinished` is called. In order to make - // sure of that, satisying the `promise<>` is deferred until then - the - // user shouldn't shutdown the `CompletionQueue` before this whole - // operation is done. - return make_ready_future(false); - } - - void OnStreamFinished(Status status) { - if (row_received_) { - // If we got a row we don't need to care about the stream status. - row_promise_.set_value(std::make_pair(true, std::move(row_))); - return; - } - if (status.ok()) { - row_promise_.set_value(std::make_pair(false, Row("", {}))); - } else { - row_promise_.set_value(std::move(status)); - } - } - - private: - Row row_; - bool row_received_{}; - promise>> row_promise_; - }; - - RowSet row_set(std::move(row_key)); - std::int64_t const rows_limit = 1; - auto handler = std::make_shared(); - AsyncReadRows([handler](Row row) { return handler->OnRow(std::move(row)); }, - [handler](Status status) { - handler->OnStreamFinished(std::move(status)); - }, - std::move(row_set), rows_limit, std::move(filter)); - return handler->GetFuture(); + OptionsSpan span(MergeOptions(std::move(opts), options_)); + return connection_->AsyncReadRow(table_name_, std::move(row_key), + std::move(filter)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/bigtable/table.h b/google/cloud/bigtable/table.h index 00b16e69098ac..6539d08961b7b 100644 --- a/google/cloud/bigtable/table.h +++ b/google/cloud/bigtable/table.h @@ -16,12 +16,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TABLE_H #include "google/cloud/bigtable/completion_queue.h" -#include "google/cloud/bigtable/data_client.h" #include "google/cloud/bigtable/data_connection.h" #include "google/cloud/bigtable/filters.h" #include "google/cloud/bigtable/idempotent_mutation_policy.h" #include "google/cloud/bigtable/internal/defaults.h" -#include "google/cloud/bigtable/internal/legacy_async_row_reader.h" #include "google/cloud/bigtable/mutation_branch.h" #include "google/cloud/bigtable/mutations.h" #include "google/cloud/bigtable/options.h" @@ -34,6 +32,7 @@ #include "google/cloud/bigtable/rpc_retry_policy.h" #include "google/cloud/bigtable/table_resource.h" #include "google/cloud/bigtable/version.h" +#include "google/cloud/background_threads.h" #include "google/cloud/future.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/internal/group_options.h" @@ -52,20 +51,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN class MutationBatcher; -/** - * Return the full table name. - * - * The full table name is: - * - * `projects//instances//tables/` - * - * Where the project id and instance id come from the @p client parameter. - */ -inline std::string TableName(std::shared_ptr const& client, - std::string const& table_id) { - return InstanceName(client) + "/tables/" + table_id; -} - /** * The main interface to interact with data in a Cloud Bigtable table. * @@ -209,10 +194,8 @@ class Table { : table_(std::move(tr)), table_name_(table_.FullName()), connection_(std::move(conn)), - options_(google::cloud::internal::MergeOptions(std::move(options), - connection_->options())), - metadata_update_policy_(bigtable_internal::MakeMetadataUpdatePolicy( - table_name_, app_profile_id())) {} + options_(google::cloud::internal::MergeOptions( + std::move(options), connection_->options())) {} std::string const& table_name() const { return table_name_; } std::string const& app_profile_id() const { @@ -238,8 +221,6 @@ class Table { table.table_ = TableResource(std::move(project_id), std::move(instance_id), std::move(table_id)); table.table_name_ = table.table_.FullName(); - table.metadata_update_policy_ = bigtable_internal::MakeMetadataUpdatePolicy( - table.table_name_, table.app_profile_id()); return table; } @@ -254,8 +235,6 @@ class Table { std::move(table_id)); table.table_name_ = table.table_.FullName(); table.options_.set(std::move(app_profile_id)); - table.metadata_update_policy_ = bigtable_internal::MakeMetadataUpdatePolicy( - table.table_name_, table.app_profile_id()); return table; } @@ -775,28 +754,11 @@ class Table { return (*on_finish_ptr)(std::move(status)); }; - if (connection_) { - google::cloud::internal::OptionsSpan span( - google::cloud::internal::MergeOptions(std::move(opts), options_)); - connection_->AsyncReadRows(table_name_, std::move(on_row_fn), - std::move(on_finish_fn), std::move(row_set), - rows_limit, std::move(filter)); - return; - } - if (!google::cloud::internal::IsEmpty(opts)) { - on_finish_fn(google::cloud::internal::InvalidArgumentError( - "Per-operation options only apply to `Table`s constructed " - "with a `DataConnection`.", - GCP_ERROR_INFO())); - return; - } - - bigtable_internal::LegacyAsyncRowReader::Create( - background_threads_->cq(), client_, app_profile_id(), table_name_, - std::move(on_row_fn), std::move(on_finish_fn), std::move(row_set), - rows_limit, std::move(filter), clone_rpc_retry_policy(), - clone_rpc_backoff_policy(), metadata_update_policy_, - std::make_unique()); + google::cloud::internal::OptionsSpan span( + google::cloud::internal::MergeOptions(std::move(opts), options_)); + connection_->AsyncReadRows(table_name_, std::move(on_row_fn), + std::move(on_finish_fn), std::move(row_set), + rows_limit, std::move(filter)); } /** @@ -830,176 +792,6 @@ class Table { Filter filter, Options opts = {}); - /** - * Constructor with default policies. - * - * @param client how to communicate with Cloud Bigtable, including - * credentials, the project id, and the instance id. - * @param table_id the table id within the instance defined by client. The - * full table name is `client->instance_name() + "/tables/" + table_id`. - * - * @deprecated #google::cloud::bigtable::DataConnection is the preferred way - * to communicate with the Bigtable Data API. To migrate existing code, - * see @ref migrating-from-dataclient "Migrating from DataClient". - */ - Table(std::shared_ptr client, std::string const& table_id) - : Table(std::move(client), std::string{}, table_id) {} - - /** - * Constructor with default policies. - * - * @param client how to communicate with Cloud Bigtable, including - * credentials, the project id, and the instance id. - * @param app_profile_id the app_profile_id needed for using the replication - * API. - * @param table_id the table id within the instance defined by client. The - * full table name is `client->instance_name() + "/tables/" + table_id`. - * - * @deprecated #google::cloud::bigtable::DataConnection is the preferred way - * to communicate with the Bigtable Data API. To migrate existing code, - * see @ref migrating-from-dataclient "Migrating from DataClient". - */ - Table(std::shared_ptr client, std::string app_profile_id, - std::string const& table_id) - : client_(std::move(client)), - table_(client_->project_id(), client_->instance_id(), table_id), - table_name_(table_.FullName()), - rpc_retry_policy_prototype_( - bigtable::DefaultRPCRetryPolicy(internal::kBigtableLimits)), - rpc_backoff_policy_prototype_( - bigtable::DefaultRPCBackoffPolicy(internal::kBigtableLimits)), - idempotent_mutation_policy_( - bigtable::DefaultIdempotentMutationPolicy()), - background_threads_(client_->BackgroundThreadsFactory()()), - options_(Options{}.set(std::move(app_profile_id))), - metadata_update_policy_(bigtable_internal::MakeMetadataUpdatePolicy( - table_name_, this->app_profile_id())) {} - - /** - * Constructor with explicit policies. - * - * The policies are passed by value, because this makes it easy for - * applications to create them. - * - * @par Example - * @code - * using namespace std::chrono_literals; // assuming C++14. - * auto client = bigtable::MakeClient(...); // details omitted - * bigtable::Table table(client, "my-table", - * // Allow up to 20 minutes to retry operations - * bigtable::LimitedTimeRetryPolicy(20min), - * // Start with 50 milliseconds backoff, grow - * // exponentially to 5 minutes. - * bigtable::ExponentialBackoffPolicy(50ms, 5min), - * // Only retry idempotent mutations. - * bigtable::SafeIdempotentMutationPolicy()); - * @endcode - * - * @param client how to communicate with Cloud Bigtable, including - * credentials, the project id, and the instance id. - * @param table_id the table id within the instance defined by client. The - * full table name is `client->instance_name() + "/tables/" + table_id`. - * @param policies the set of policy overrides for this object. - * @tparam Policies the types of the policies to override, the types must - * derive from one of the following types: - * - * - `IdempotentMutationPolicy` which mutations are retried. Use - * `SafeIdempotentMutationPolicy` to only retry idempotent operations, - * use `AlwaysRetryMutationPolicy` to retry all operations. Read the - * caveats in the class definition to understand the downsides of the - * latter. You can also create your own policies that decide which - * mutations to retry. - * - `RPCBackoffPolicy` how to backoff from a failed RPC. Currently only - * `ExponentialBackoffPolicy` is implemented. You can also create your - * own policies that backoff using a different algorithm. - * - `RPCRetryPolicy` for how long to retry failed RPCs. Use - * `LimitedErrorCountRetryPolicy` to limit the number of failures - * allowed. Use `LimitedTimeRetryPolicy` to bound the time for any - * request. You can also create your own policies that combine time and - * error counts. - * - * @see SafeIdempotentMutationPolicy, AlwaysRetryMutationPolicy, - * ExponentialBackoffPolicy, LimitedErrorCountRetryPolicy, - * LimitedTimeRetryPolicy. - * - * @deprecated #google::cloud::bigtable::DataConnection is the preferred way - * to communicate with the Bigtable Data API. To migrate existing code, - * see @ref migrating-from-dataclient "Migrating from DataClient". - */ - template ::value, int> = 0 - /// @endcond - > - Table(std::shared_ptr client, std::string const& table_id, - Policies&&... policies) - : Table(std::move(client), table_id) { - ChangePolicies(std::forward(policies)...); - } - - /** - * Constructor with explicit policies. - * - * The policies are passed by value, because this makes it easy for - * applications to create them. - * - * @par Example - * @code - * using namespace std::chrono_literals; // assuming C++14. - * auto client = bigtable::MakeClient(...); // details omitted - * bigtable::Table table(client, "app_id", "my-table", - * // Allow up to 20 minutes to retry operations - * bigtable::LimitedTimeRetryPolicy(20min), - * // Start with 50 milliseconds backoff, grow - * // exponentially to 5 minutes. - * bigtable::ExponentialBackoffPolicy(50ms, 5min), - * // Only retry idempotent mutations. - * bigtable::SafeIdempotentMutationPolicy()); - * @endcode - * - * @param client how to communicate with Cloud Bigtable, including - * credentials, the project id, and the instance id. - * @param app_profile_id the app_profile_id needed for using the replication - * API. - * @param table_id the table id within the instance defined by client. The - * full table name is `client->instance_name() + "/tables/" + table_id`. - * @param policies the set of policy overrides for this object. - * @tparam Policies the types of the policies to override, the types must - * derive from one of the following types: - * - `IdempotentMutationPolicy` which mutations are retried. Use - * `SafeIdempotentMutationPolicy` to only retry idempotent operations, - * use `AlwaysRetryMutationPolicy` to retry all operations. Read the - * caveats in the class definition to understand the downsides of the - * latter. You can also create your own policies that decide which - * mutations to retry. - * - `RPCBackoffPolicy` how to backoff from a failed RPC. Currently only - * `ExponentialBackoffPolicy` is implemented. You can also create your - * own policies that backoff using a different algorithm. - * - `RPCRetryPolicy` for how long to retry failed RPCs. Use - * `LimitedErrorCountRetryPolicy` to limit the number of failures - * allowed. Use `LimitedTimeRetryPolicy` to bound the time for any - * request. You can also create your own policies that combine time and - * error counts. - * - * @see SafeIdempotentMutationPolicy, AlwaysRetryMutationPolicy, - * ExponentialBackoffPolicy, LimitedErrorCountRetryPolicy, - * LimitedTimeRetryPolicy. - * - * @deprecated #google::cloud::bigtable::DataConnection is the preferred way - * to communicate with the Bigtable Data API. To migrate existing code, - * see @ref migrating-from-dataclient "Migrating from DataClient". - */ - template ::value, int> = 0 - /// @endcond - > - Table(std::shared_ptr client, std::string app_profile_id, - std::string const& table_id, Policies&&... policies) - : Table(std::move(client), std::move(app_profile_id), table_id) { - ChangePolicies(std::forward(policies)...); - } - private: /** * Send request ReadModifyWriteRowRequest to modify the row and get it back @@ -1035,10 +827,6 @@ class Table { return rpc_backoff_policy_prototype_->clone(); } - MetadataUpdatePolicy clone_metadata_update_policy() { - return metadata_update_policy_; - } - std::unique_ptr clone_idempotent_mutation_policy() { return idempotent_mutation_policy_->clone(); } @@ -1066,16 +854,13 @@ class Table { ///@} friend class MutationBatcher; - std::shared_ptr client_; TableResource table_; std::string table_name_; std::shared_ptr rpc_retry_policy_prototype_; std::shared_ptr rpc_backoff_policy_prototype_; std::shared_ptr idempotent_mutation_policy_; - std::shared_ptr background_threads_; std::shared_ptr connection_; Options options_; - MetadataUpdatePolicy metadata_update_policy_; }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/bigtable/table_admin.cc b/google/cloud/bigtable/table_admin.cc deleted file mode 100644 index 50686fb9f0452..0000000000000 --- a/google/cloud/bigtable/table_admin.cc +++ /dev/null @@ -1,349 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/table_admin.h" -#include "google/cloud/bigtable/admin/bigtable_table_admin_client.h" -#include "google/cloud/bigtable/wait_for_consistency.h" -#include "google/cloud/internal/time_utils.h" -#include -#include - -namespace btadmin = ::google::bigtable::admin::v2; - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -static_assert(std::is_copy_constructible::value, - "bigtable::TableAdmin must be constructible"); -static_assert(std::is_copy_assignable::value, - "bigtable::TableAdmin must be assignable"); - -// NOLINTNEXTLINE(readability-identifier-naming) -constexpr TableAdmin::TableView TableAdmin::ENCRYPTION_VIEW; -// NOLINTNEXTLINE(readability-identifier-naming) -constexpr TableAdmin::TableView TableAdmin::FULL; -// NOLINTNEXTLINE(readability-identifier-naming) -constexpr TableAdmin::TableView TableAdmin::NAME_ONLY; -// NOLINTNEXTLINE(readability-identifier-naming) -constexpr TableAdmin::TableView TableAdmin::REPLICATION_VIEW; -// NOLINTNEXTLINE(readability-identifier-naming) -constexpr TableAdmin::TableView TableAdmin::SCHEMA_VIEW; -// NOLINTNEXTLINE(readability-identifier-naming) -constexpr TableAdmin::TableView TableAdmin::VIEW_UNSPECIFIED; - -StatusOr TableAdmin::CreateTable(std::string table_id, - TableConfig config) { - google::cloud::internal::OptionsSpan span(options_); - auto request = std::move(config).as_proto(); - request.set_parent(instance_name()); - request.set_table_id(std::move(table_id)); - return connection_->CreateTable(request); -} - -StatusOr> TableAdmin::ListTables( - btadmin::Table::View view) { - google::cloud::internal::OptionsSpan span(options_); - std::vector result; - - btadmin::ListTablesRequest request; - request.set_parent(instance_name()); - request.set_view(view); - auto sr = connection_->ListTables(request); - for (auto& t : sr) { - if (!t) return std::move(t).status(); - result.emplace_back(*std::move(t)); - } - return result; -} - -StatusOr TableAdmin::GetTable(std::string const& table_id, - btadmin::Table::View view) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::GetTableRequest request; - request.set_name(TableName(table_id)); - request.set_view(view); - return connection_->GetTable(request); -} - -Status TableAdmin::DeleteTable(std::string const& table_id) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::DeleteTableRequest request; - request.set_name(TableName(table_id)); - return connection_->DeleteTable(request); -} - -btadmin::CreateBackupRequest TableAdmin::CreateBackupParams::AsProto( - std::string instance_name) const { - btadmin::CreateBackupRequest proto; - proto.set_parent(instance_name + "/clusters/" + cluster_id); - proto.set_backup_id(backup_id); - proto.mutable_backup()->set_source_table(std::move(instance_name) + - "/tables/" + table_name); - *proto.mutable_backup()->mutable_expire_time() = - google::cloud::internal::ToProtoTimestamp(expire_time); - return proto; -} - -StatusOr TableAdmin::CreateBackup( - CreateBackupParams const& params) { - google::cloud::internal::OptionsSpan span(options_); - auto request = params.AsProto(instance_name()); - return connection_->CreateBackup(request).get(); -} - -StatusOr TableAdmin::GetBackup(std::string const& cluster_id, - std::string const& backup_id) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::GetBackupRequest request; - request.set_name(BackupName(cluster_id, backup_id)); - return connection_->GetBackup(request); -} - -btadmin::UpdateBackupRequest TableAdmin::UpdateBackupParams::AsProto( - std::string const& instance_name) const { - btadmin::UpdateBackupRequest proto; - proto.mutable_backup()->set_name(instance_name + "/clusters/" + cluster_id + - "/backups/" + backup_name); - *proto.mutable_backup()->mutable_expire_time() = - google::cloud::internal::ToProtoTimestamp(expire_time); - proto.mutable_update_mask()->add_paths("expire_time"); - return proto; -} - -StatusOr TableAdmin::UpdateBackup( - UpdateBackupParams const& params) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::UpdateBackupRequest request = params.AsProto(instance_name()); - return connection_->UpdateBackup(request); -} - -Status TableAdmin::DeleteBackup(btadmin::Backup const& backup) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::DeleteBackupRequest request; - request.set_name(backup.name()); - return connection_->DeleteBackup(request); -} - -Status TableAdmin::DeleteBackup(std::string const& cluster_id, - std::string const& backup_id) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::DeleteBackupRequest request; - request.set_name(BackupName(cluster_id, backup_id)); - return connection_->DeleteBackup(request); -} - -btadmin::ListBackupsRequest TableAdmin::ListBackupsParams::AsProto( - std::string const& instance_name) const { - btadmin::ListBackupsRequest proto; - proto.set_parent(cluster_id ? instance_name + "/clusters/" + *cluster_id - : instance_name + "/clusters/-"); - if (filter) *proto.mutable_filter() = *filter; - if (order_by) *proto.mutable_order_by() = *order_by; - return proto; -} - -StatusOr> TableAdmin::ListBackups( - ListBackupsParams const& params) { - google::cloud::internal::OptionsSpan span(options_); - std::vector result; - - btadmin::ListBackupsRequest request = params.AsProto(instance_name()); - auto sr = connection_->ListBackups(request); - for (auto& b : sr) { - if (!b) return std::move(b).status(); - result.emplace_back(*std::move(b)); - } - return result; -} - -btadmin::RestoreTableRequest TableAdmin::RestoreTableParams::AsProto( - std::string const& instance_name) const { - btadmin::RestoreTableRequest proto; - proto.set_parent(instance_name); - proto.set_table_id(table_id); - proto.set_backup(instance_name + "/clusters/" + cluster_id + "/backups/" + - backup_id); - return proto; -} - -StatusOr TableAdmin::RestoreTable( - RestoreTableParams const& params) { - auto p = RestoreTableFromInstanceParams{ - params.table_id, BackupName(params.cluster_id, params.backup_id)}; - return RestoreTable(std::move(p)); -} - -btadmin::RestoreTableRequest AsProto( - std::string const& instance_name, - TableAdmin::RestoreTableFromInstanceParams p) { - btadmin::RestoreTableRequest proto; - proto.set_parent(instance_name); - proto.set_table_id(std::move(p.table_id)); - proto.set_backup(std::move(p.backup_name)); - return proto; -} - -StatusOr TableAdmin::RestoreTable( - RestoreTableFromInstanceParams params) { - google::cloud::internal::OptionsSpan span(options_); - auto request = AsProto(instance_name(), std::move(params)); - return connection_->RestoreTable(request).get(); -} - -StatusOr TableAdmin::ModifyColumnFamilies( - std::string const& table_id, - std::vector modifications) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::ModifyColumnFamiliesRequest request; - request.set_name(TableName(table_id)); - for (auto& m : modifications) { - google::cloud::internal::OptionsSpan span(options_); - *request.add_modifications() = std::move(m).as_proto(); - } - return connection_->ModifyColumnFamilies(request); -} - -Status TableAdmin::DropRowsByPrefix(std::string const& table_id, - std::string row_key_prefix) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::DropRowRangeRequest request; - request.set_name(TableName(table_id)); - request.set_row_key_prefix(std::move(row_key_prefix)); - return connection_->DropRowRange(request); -} - -future> TableAdmin::WaitForConsistency( - std::string const& table_id, std::string const& consistency_token) { - // We avoid lifetime issues due to ownership cycles, by holding the - // `BackgroundThreads` which run the `CompletionQueue` outside of the - // operation, in this class. If the `BackgroundThreads` running the - // `CompletionQueue` were instead owned by the Connection, we would have an - // ownership cycle. We have made this mistake before. See #7740 for more - // details. - auto client = bigtable_admin::BigtableTableAdminClient(connection_); - return bigtable_admin::AsyncWaitForConsistency(cq_, std::move(client), - TableName(table_id), - consistency_token, options_) - .then([](future f) -> StatusOr { - auto s = f.get(); - if (!s.ok()) return s; - return Consistency::kConsistent; - }); -} - -Status TableAdmin::DropAllRows(std::string const& table_id) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::DropRowRangeRequest request; - request.set_name(TableName(table_id)); - request.set_delete_all_data_from_table(true); - return connection_->DropRowRange(request); -} - -StatusOr TableAdmin::GenerateConsistencyToken( - std::string const& table_id) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::GenerateConsistencyTokenRequest request; - request.set_name(TableName(table_id)); - auto sor = connection_->GenerateConsistencyToken(request); - if (!sor) return std::move(sor).status(); - return std::move(*sor->mutable_consistency_token()); -} - -StatusOr TableAdmin::CheckConsistency( - std::string const& table_id, std::string const& consistency_token) { - google::cloud::internal::OptionsSpan span(options_); - btadmin::CheckConsistencyRequest request; - request.set_name(TableName(table_id)); - request.set_consistency_token(consistency_token); - auto sor = connection_->CheckConsistency(request); - if (!sor) return std::move(sor).status(); - return sor->consistent() ? Consistency::kConsistent - : Consistency::kInconsistent; -} - -StatusOr TableAdmin::GetIamPolicy( - std::string const& table_id) { - return GetIamPolicyImpl(TableName(table_id)); -} - -StatusOr TableAdmin::GetIamPolicy( - std::string const& cluster_id, std::string const& backup_id) { - return GetIamPolicyImpl(BackupName(cluster_id, backup_id)); -} - -StatusOr TableAdmin::GetIamPolicyImpl( - std::string resource) { - google::cloud::internal::OptionsSpan span(options_); - ::google::iam::v1::GetIamPolicyRequest request; - request.set_resource(std::move(resource)); - return connection_->GetIamPolicy(request); -} - -StatusOr TableAdmin::SetIamPolicy( - std::string const& table_id, google::iam::v1::Policy const& iam_policy) { - return SetIamPolicyImpl(TableName(table_id), iam_policy); -} - -StatusOr TableAdmin::SetIamPolicy( - std::string const& cluster_id, std::string const& backup_id, - google::iam::v1::Policy const& iam_policy) { - return SetIamPolicyImpl(BackupName(cluster_id, backup_id), iam_policy); -} - -StatusOr TableAdmin::SetIamPolicyImpl( - std::string resource, google::iam::v1::Policy const& iam_policy) { - google::cloud::internal::OptionsSpan span(options_); - ::google::iam::v1::SetIamPolicyRequest request; - request.set_resource(std::move(resource)); - *request.mutable_policy() = iam_policy; - return connection_->SetIamPolicy(request); -} - -StatusOr> TableAdmin::TestIamPermissions( - std::string const& table_id, std::vector const& permissions) { - return TestIamPermissionsImpl(TableName(table_id), permissions); -} - -StatusOr> TableAdmin::TestIamPermissions( - std::string const& cluster_id, std::string const& backup_id, - std::vector const& permissions) { - return TestIamPermissionsImpl(BackupName(cluster_id, backup_id), permissions); -} - -StatusOr> TableAdmin::TestIamPermissionsImpl( - std::string resource, std::vector const& permissions) { - google::cloud::internal::OptionsSpan span(options_); - ::google::iam::v1::TestIamPermissionsRequest request; - request.set_resource(std::move(resource)); - for (auto const& permission : permissions) { - request.add_permissions(permission); - } - auto sor = connection_->TestIamPermissions(request); - if (!sor) return std::move(sor).status(); - auto response = *std::move(sor); - std::vector result; - auto& ps = *response.mutable_permissions(); - std::move(ps.begin(), ps.end(), std::back_inserter(result)); - return result; -} - -std::string TableAdmin::InstanceName() const { - return google::cloud::bigtable::InstanceName(project_id_, instance_id_); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/table_admin.h b/google/cloud/bigtable/table_admin.h deleted file mode 100644 index e68509fa25f57..0000000000000 --- a/google/cloud/bigtable/table_admin.h +++ /dev/null @@ -1,1137 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_TABLE_ADMIN_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TABLE_ADMIN_H - -#include "google/cloud/bigtable/admin/bigtable_table_admin_connection.h" -#include "google/cloud/bigtable/admin_client.h" -#include "google/cloud/bigtable/column_family.h" -#include "google/cloud/bigtable/completion_queue.h" -#include "google/cloud/bigtable/iam_policy.h" -#include "google/cloud/bigtable/internal/convert_policies.h" -#include "google/cloud/bigtable/metadata_update_policy.h" -#include "google/cloud/bigtable/polling_policy.h" -#include "google/cloud/bigtable/resource_names.h" -#include "google/cloud/bigtable/table_config.h" -#include "google/cloud/bigtable/version.h" -#include "google/cloud/future.h" -#include "google/cloud/grpc_error_delegate.h" -#include "google/cloud/options.h" -#include "google/cloud/status_or.h" -#include "absl/types/optional.h" -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -class TableAdminTester; -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_internal -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -/// The result of checking replication against a given token. -enum class Consistency { - /// Some of the mutations created before the consistency token have not been - /// received by all the table replicas. - kInconsistent, - /// All mutations created before the consistency token have been received by - /// all the table replicas. - kConsistent, -}; - -/** - * Implements the API to administer tables in a Cloud Bigtable instance. - * - * @par Thread-safety - * Instances of this class created via copy-construction or copy-assignment - * share the underlying pool of connections. Access to these copies via multiple - * threads is guaranteed to work. Two threads operating concurrently on the same - * instance of this class is not guaranteed to work. - * - * @par Cost - * Creating a new object of type `TableAdmin` is comparable to creating a few - * objects of type `std::string` or a few objects of type - * `std::shared_ptr`. The class represents a shallow handle to a remote - * object. - * - * @par Error Handling - * This class uses `StatusOr` to report errors. When an operation fails to - * perform its work the returned `StatusOr` contains the error details. If - * the `ok()` member function in the `StatusOr` returns `true` then it - * contains the expected result. Operations that do not return a value simply - * return a `google::cloud::Status` indicating success or the details of the - * error Please consult the [`StatusOr` - * documentation](#google::cloud::StatusOr) for more details. - * - * @code - * namespace cbt = google::cloud::bigtable; - * namespace btadmin = google::bigtable::admin::v2; - * cbt::TableAdmin admin = ...; - * google::cloud::StatusOr metadata = admin.GetTable(...); - * - * if (!metadata) { - * std::cerr << "Error fetching table metadata\n"; - * return; - * } - * - * // Use "metadata" as a smart pointer here, e.g.: - * std::cout << "The full table name is " << table->name() << " the table has " - * << table->column_families_size() << " column families\n"; - * @endcode - * - * In addition, the @ref index "main page" contains examples using `StatusOr` - * to handle errors. - * - * @par Retry, Backoff, and Idempotency Policies - * The library automatically retries requests that fail with transient errors, - * and uses [truncated exponential backoff][backoff-link] to backoff between - * retries. The default policies are to continue retrying for up to 10 minutes. - * On each transient failure the backoff period is doubled, starting with an - * initial backoff of 100 milliseconds. The backoff period growth is truncated - * at 60 seconds. The default idempotency policy is to only retry idempotent - * operations. Note that most operations that change state are **not** - * idempotent. - * - * The application can override these policies when constructing objects of this - * class. The documentation for the constructors show examples of this in - * action. - * - * [backoff-link]: https://cloud.google.com/storage/docs/exponential-backoff - * - * @par Equality - * `TableAdmin` objects will compare equal iff they were created with the - * same `DataClient` and target the same Instance resource. Note that - * `TableAdmin` objects can compare equal with different retry/backoff/polling - * policies. - * - * @see https://cloud.google.com/bigtable/ for an overview of Cloud Bigtable. - * - * @see https://cloud.google.com/bigtable/docs/overview for an overview of the - * Cloud Bigtable data model. - * - * @see https://cloud.google.com/bigtable/docs/instances-clusters-nodes for an - * introduction of the main APIs into Cloud Bigtable. - * - * @see https://cloud.google.com/bigtable/docs/reference/service-apis-overview - * for an overview of the underlying Cloud Bigtable API. - * - * @see #google::cloud::StatusOr for a description of the error reporting class - * used by this library. - * - * @see `LimitedTimeRetryPolicy` and `LimitedErrorCountRetryPolicy` for - * alternative retry policies. - * - * @see `ExponentialBackoffPolicy` to configure different parameters for the - * exponential backoff policy. - * - * @see `SafeIdempotentMutationPolicy` and `AlwaysRetryMutationPolicy` for - * alternative idempotency policies. - */ -class TableAdmin { - public: - /** - * @param client the interface to create grpc stubs, report errors, etc. - * @param instance_id the id of the instance, e.g., "my-instance", the full - * name (e.g. '/projects/my-project/instances/my-instance') is built using - * the project id in the @p client parameter. - */ - // NOLINTNEXTLINE(performance-unnecessary-value-param) - TableAdmin(std::shared_ptr client, std::string instance_id) - : connection_(client->connection_), - cq_(client->cq_), - background_threads_(client->background_threads_), - project_id_(client->project()), - instance_id_(std::move(instance_id)), - instance_name_(InstanceName()), - retry_prototype_( - DefaultRPCRetryPolicy(internal::kBigtableTableAdminLimits)), - backoff_prototype_( - DefaultRPCBackoffPolicy(internal::kBigtableTableAdminLimits)), - polling_prototype_( - DefaultPollingPolicy(internal::kBigtableTableAdminLimits)), - options_(google::cloud::internal::MergeOptions( - bigtable_internal::MakeTableAdminOptions( - retry_prototype_, backoff_prototype_, polling_prototype_), - connection_->options())) {} - - /** - * Create a new TableAdmin using explicit policies to handle RPC errors. - * - * @param client the interface to create grpc stubs, report errors, etc. - * @param instance_id the id of the instance, e.g., "my-instance", the full - * name (e.g. '/projects/my-project/instances/my-instance') is built using - * the project id in the @p client parameter. - * @param policies the set of policy overrides for this object. - * @tparam Policies the types of the policies to override, the types must - * derive from one of the following types: - * - `RPCBackoffPolicy` how to backoff from a failed RPC. Currently only - * `ExponentialBackoffPolicy` is implemented. You can also create your - * own policies that backoff using a different algorithm. - * - `RPCRetryPolicy` for how long to retry failed RPCs. Use - * `LimitedErrorCountRetryPolicy` to limit the number of failures - * allowed. Use `LimitedTimeRetryPolicy` to bound the time for any - * request. You can also create your own policies that combine time and - * error counts. - * - `PollingPolicy` for how long will the class wait for - * `google.longrunning.Operation` to complete. This class combines both - * the backoff policy for checking long running operations and the - * retry policy. - * - * @see GenericPollingPolicy, ExponentialBackoffPolicy, - * LimitedErrorCountRetryPolicy, LimitedTimeRetryPolicy. - */ - template - // NOLINTNEXTLINE(performance-unnecessary-value-param) - TableAdmin(std::shared_ptr client, std::string instance_id, - Policies&&... policies) - : connection_(client->connection_), - cq_(client->cq_), - background_threads_(client->background_threads_), - project_id_(client->project()), - instance_id_(std::move(instance_id)), - instance_name_(InstanceName()), - retry_prototype_( - DefaultRPCRetryPolicy(internal::kBigtableTableAdminLimits)), - backoff_prototype_( - DefaultRPCBackoffPolicy(internal::kBigtableTableAdminLimits)), - polling_prototype_( - DefaultPollingPolicy(internal::kBigtableTableAdminLimits)) { - ChangePolicies(std::forward(policies)...); - options_ = google::cloud::internal::MergeOptions( - bigtable_internal::MakeTableAdminOptions( - retry_prototype_, backoff_prototype_, polling_prototype_), - connection_->options()); - } - - TableAdmin(TableAdmin const&) = default; - TableAdmin& operator=(TableAdmin const&) = default; - - friend bool operator==(TableAdmin const& a, TableAdmin const& b) noexcept { - return a.connection_ == b.connection_ && - a.instance_name_ == b.instance_name_; - } - friend bool operator!=(TableAdmin const& a, TableAdmin const& b) noexcept { - return !(a == b); - } - - ///@{ - /// @name Convenience shorthands for the schema views. - using TableView = ::google::bigtable::admin::v2::Table::View; - /// Only populate 'name' and fields related to the table's encryption state. - static auto constexpr ENCRYPTION_VIEW = // NOLINT(readability-identifier-naming) - google::bigtable::admin::v2::Table::ENCRYPTION_VIEW; - /// Populate all the fields in the response. - static auto constexpr FULL = // NOLINT(readability-identifier-naming) - google::bigtable::admin::v2::Table::FULL; - /// Populate only the name in the responses. - static auto constexpr NAME_ONLY = // NOLINT(readability-identifier-naming) - google::bigtable::admin::v2::Table::NAME_ONLY; - /// Populate only the name and the fields related to the table replication - /// state. - static auto constexpr REPLICATION_VIEW = // NOLINT(readability-identifier-naming) - google::bigtable::admin::v2::Table::REPLICATION_VIEW; - /// Populate only the name and the fields related to the table schema. - static auto constexpr SCHEMA_VIEW = // NOLINT(readability-identifier-naming) - google::bigtable::admin::v2::Table::SCHEMA_VIEW; - /// Use the default view as defined for each function. - static auto constexpr VIEW_UNSPECIFIED = // NOLINT(readability-identifier-naming) - google::bigtable::admin::v2::Table::VIEW_UNSPECIFIED; - ///@} - - std::string const& project() const { return project_id_; } - std::string const& instance_id() const { return instance_id_; } - std::string const& instance_name() const { return instance_name_; } - - /** - * Returns a TableAdmin that reuses the connection and configuration of this - * TableAdmin, but with a different resource name. - */ - TableAdmin WithNewTarget(std::string project_id, - std::string instance_id) const { - auto table = *this; - table.project_id_ = std::move(project_id); - table.instance_id_ = std::move(instance_id); - table.instance_name_ = table.InstanceName(); - return table; - } - - /** - * Create a new table in the instance. - * - * @param table_id the name of the table relative to the instance managed by - * this object. The full table name is - * `projects//instances//tables/` - * where PROJECT_ID is obtained from the associated AdminClient and - * INSTANCE_ID is the instance_id() of this object. - * @param config the initial schema for the table. - * @return the attributes of the newly created table. Notice that the server - * only populates the table_name() field at this time. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet table_admin_snippets.cc create table - */ - StatusOr<::google::bigtable::admin::v2::Table> CreateTable( - std::string table_id, TableConfig config); - - /** - * Return all the tables in the instance. - * - * @param view define what information about the tables is retrieved. - * - `VIEW_UNSPECIFIED`: equivalent to `VIEW_SCHEMA`. - * - `NAME`: return only the name of the table. - * - `VIEW_SCHEMA`: return the name and the schema. - * - `FULL`: return all the information about the table. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet table_admin_snippets.cc list tables - */ - StatusOr> ListTables( - ::google::bigtable::admin::v2::Table::View view); - - /** - * Get information about a single table. - * - * @param table_id the id of the table within the instance associated with - * this object. The full name of the table is - * `this->instance_name() + "/tables/" + table_id` - * @param view describes how much information to get about the name. - * - VIEW_UNSPECIFIED: equivalent to VIEW_SCHEMA. - * - NAME: return only the name of the table. - * - VIEW_SCHEMA: return the name and the schema. - * - FULL: return all the information about the table. - * @return the information about the table or status. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet table_admin_snippets.cc get table - */ - StatusOr<::google::bigtable::admin::v2::Table> GetTable( - std::string const& table_id, TableView view = SCHEMA_VIEW); - - /** - * Delete a table. - * - * @param table_id the id of the table within the instance associated with - * this object. The full name of the table is - * `this->instance_name() + "/tables/" + table_id` - * - * @return status of the operation. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet table_admin_snippets.cc delete table - */ - Status DeleteTable(std::string const& table_id); - - /** - * Parameters for `CreateBackup`. - * - * @param cluster_id the name of the cluster relative to the instance managed - * by the `TableAdmin` object. The full cluster name is - * `projects//instances//clusters/` - * where PROJECT_ID is obtained from the associated AdminClient and - * INSTANCE_ID is the instance_id() of the `TableAdmin` object. - * @param backup_id the name of the backup relative to the cluster specified. - * The full backup name is - * `projects//instances//clusters//backups/` - * where PROJECT_ID is obtained from the associated AdminClient, - * INSTANCE_ID is the instance_id() of the `TableAdmin` object, and - * CLUSTER_ID is the cluster_id specified for this object. - * @param table_id the id of the table within the instance to be backed up. - * The full name of the table is - * `projects//instances//tables/` - * where PROJECT_ID is obtained from the associated AdminClient and - * INSTANCE_ID is the instance_id() of the `TableAdmin` object. - * @param expire_time the date and time when the created backup will expire. - */ - struct CreateBackupParams { - CreateBackupParams() = default; - CreateBackupParams(std::string cluster_id, std::string backup_id, - std::string table_id, - std::chrono::system_clock::time_point expire_time) - : cluster_id(std::move(cluster_id)), - backup_id(std::move(backup_id)), - table_name(std::move(table_id)), - expire_time(std::move(expire_time)) {} - - google::bigtable::admin::v2::CreateBackupRequest AsProto( - std::string instance_name) const; - - std::string cluster_id; - std::string backup_id; - std::string table_name; - std::chrono::system_clock::time_point expire_time; - }; - - /** - * Create a new backup of a table in the instance. - * - * @param params instance of `CreateBackupParams`. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_table_admin_backup_snippets.cc create backup - */ - StatusOr CreateBackup( - CreateBackupParams const& params); - - /** - * Get information about a single backup. - * - * @param cluster_id the name of the cluster relative to the instance managed - * by the `TableAdmin` object. The full cluster name is - * `projects//instances//clusters/` - * where PROJECT_ID is obtained from the associated AdminClient and - * INSTANCE_ID is the instance_id() of the `TableAdmin` object. - * @param backup_id the name of the backup relative to the cluster specified. - * The full backup name is - * `projects//instances//clusters//backups/` - * where PROJECT_ID is obtained from the associated AdminClient, - * INSTANCE_ID is the instance_id() of the `TableAdmin` object, and - * CLUSTER_ID is the cluster_id previously specified. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_table_admin_backup_snippets.cc get backup - */ - StatusOr GetBackup( - std::string const& cluster_id, std::string const& backup_id); - - /** - * Parameters for `UpdateBackup`. - * - * @param cluster_id the name of the cluster relative to the instance managed - * by the `TableAdmin` object. The full cluster name is - * `projects//instances//clusters/` - * where PROJECT_ID is obtained from the associated AdminClient and - * INSTANCE_ID is the instance_id() of the `TableAdmin` object. - * @param backup_id the name of the backup relative to the cluster specified. - * The full backup name is - * `projects//instances//clusters//backups/` - * where PROJECT_ID is obtained from the associated AdminClient, - * INSTANCE_ID is the instance_id() of the `TableAdmin` object, and - * CLUSTER_ID is the cluster_id specified for this object. - * @param expire_time the date and time when the created backup will expire. - */ - struct UpdateBackupParams { - UpdateBackupParams() = default; - UpdateBackupParams(std::string cluster_id, std::string backup_id, - std::chrono::system_clock::time_point expire_time) - : cluster_id(std::move(cluster_id)), - backup_name(std::move(backup_id)), - expire_time(std::move(expire_time)) {} - - google::bigtable::admin::v2::UpdateBackupRequest AsProto( - std::string const& instance_name) const; - - std::string cluster_id; - std::string backup_name; - std::chrono::system_clock::time_point expire_time; - }; - - /** - * Updates a backup of a table in the instance. - * - * @param params instance of `UpdateBackupParams`. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_table_admin_backup_snippets.cc update backup - */ - StatusOr UpdateBackup( - UpdateBackupParams const& params); - - /** - * Delete a backup. - * - * @param cluster_id the name of the cluster relative to the instance managed - * by the `TableAdmin` object. The full cluster name is - * `projects//instances//clusters/` - * where PROJECT_ID is obtained from the associated AdminClient and - * INSTANCE_ID is the instance_id() of the `TableAdmin` object. - * @param backup_id the name of the backup relative to the cluster specified. - * The full backup name is - * `projects//instances//clusters//backups/` - * where PROJECT_ID is obtained from the associated AdminClient, - * INSTANCE_ID is the instance_id() of the `TableAdmin` object, and - * CLUSTER_ID is the cluster_id previously specified. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_table_admin_backup_snippets.cc delete backup - */ - Status DeleteBackup(std::string const& cluster_id, - std::string const& backup_id); - - /** - * Delete a backup. - * - * @param backup typically returned by a call to `GetBackup` or `ListBackups`. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_table_admin_backup_snippets.cc delete backup - */ - Status DeleteBackup(google::bigtable::admin::v2::Backup const& backup); - - /** - * Parameters for `ListBackups`. - */ - struct ListBackupsParams { - /** - * Sets the cluster_id. - * - * @param c the name of the cluster relative to the instance - * managed by the `TableAdmin` object. If no cluster_id is specified, - * the all backups in all clusters are listed. The full cluster name is - * `projects//instances//clusters/` - * where PROJECT_ID is obtained from the associated AdminClient and - * INSTANCE_ID is the instance_id() of the `TableAdmin` object. - */ - ListBackupsParams& set_cluster(std::string c) { - this->cluster_id = std::move(c); - return *this; - } - - /** - * Sets the filtering expression. - * - * @param f expression that filters backups listed in the response. - * The expression must specify the field name, a comparison operator, - * and the value that you want to use for filtering. The value must be a - * string, a number, or a boolean. The comparison operator must be - * <, >, <=, >=, !=, =, or :. Colon ‘:’ represents a HAS operator which - * is roughly synonymous with equality. Filter rules are case - * insensitive. - * - * The fields eligible for filtering are: - * * `name` - * * `table` - * * `state` - * * `start_time` (and values are of the format - * `YYYY-MM-DDTHH:MM:SSZ`) - * * `end_time` (and values are of the format `YYYY-MM-DDTHH:MM:SSZ`) - * * `expire_time` (and values are of the format - * `YYYY-MM-DDTHH:MM:SSZ`) - * * `size_bytes` - * - * To filter on multiple expressions, provide each separate expression - * within parentheses. By default, each expression is an AND expression. - * However, you can include AND, OR, and NOT expressions explicitly. - * - * Some examples of using filters are: - * * `name:"exact"` --> The backup's name is the string "exact". - * * `name:howl` --> The backup's name contains the string "howl". - * * `table:prod` --> The table's name contains the string "prod". - * * `state:CREATING` --> The backup is pending creation. - * * `state:READY` --> The backup is fully created and ready for use. - * * `(name:howl) AND (start_time < "2018-03-28T14:50:00Z")` - * --> The backup name contains the string "howl" and start_time - * of the backup is before `2018-03-28T14:50:00Z`. - * * `size_bytes > 10000000000` --> The backup's size is greater than - * 10GB - */ - ListBackupsParams& set_filter(std::string f) { - this->filter = std::move(f); - return *this; - } - - /** - * Sets the ordering expression. - * - * @param o expression for specifying the sort order of the results - * of the request. The string value should specify only one field in - * `google::bigtable::admin::v2::Backup`. - * The following field names are supported: - * * name - * * table - * * expire_time - * * start_time - * * end_time - * * size_bytes - * * state - * - * For example, "start_time". The default sorting order is ascending. - * Append the " desc" suffix to the field name to sort descending, e.g. - * "start_time desc". Redundant space characters in the syntax are - * insignificant. - * - * If order_by is empty, results will be sorted by `start_time` in - * descending order starting from the most recently created backup. - */ - ListBackupsParams& set_order_by(std::string o) { - this->order_by = std::move(o); - return *this; - } - - google::bigtable::admin::v2::ListBackupsRequest AsProto( - std::string const& instance_name) const; - - absl::optional cluster_id; - absl::optional filter; - absl::optional order_by; - }; - - /** - * Retrieves a list of backups. - * - * @param params instance of `ListBackupsParams`. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_table_admin_backup_snippets.cc list backups - */ - StatusOr> ListBackups( - ListBackupsParams const& params); - - /** - * Parameters for `RestoreTable`. - * - * @param table_id the name of the table relative to the instance managed by - * this object. The full table name is - * `projects//instances//tables/` - * where PROJECT_ID is obtained from the associated AdminClient and - * INSTANCE_ID is the instance_id() of this object. - * @param cluster_id the name of the cluster relative to the instance managed - * by the `TableAdmin` object. The full cluster name is - * `projects//instances//clusters/` - * where PROJECT_ID is obtained from the associated AdminClient and - * INSTANCE_ID is the instance_id() of the `TableAdmin` object. - * @param backup_id the name of the backup relative to the cluster specified. - * The full backup name is - * `projects//instances//clusters//backups/` - * where PROJECT_ID is obtained from the associated AdminClient, - * INSTANCE_ID is the instance_id() of the `TableAdmin` object, and - * CLUSTER_ID is the cluster_id previously specified. - */ - struct RestoreTableParams { - RestoreTableParams() = default; - RestoreTableParams(std::string table_id, std::string cluster_id, - std::string backup_id) - : table_id(std::move(table_id)), - cluster_id(std::move(cluster_id)), - backup_id(std::move(backup_id)) {} - - /// @deprecated covert the parameters to a proto. - google::bigtable::admin::v2::RestoreTableRequest AsProto( - std::string const& instance_name) const; - - std::string table_id; - std::string cluster_id; - std::string backup_id; - }; - - /** - * Parameters for `RestoreTable`. - * - * @param table_id the name of the table relative to the instance managed by - * this object. The full table name is - * `projects//instances//tables/` - * where PROJECT_ID is obtained from the associated AdminClient and - * INSTANCE_ID is the instance_id() of this object. - * @param backup_name the full name of the backup used to restore @p table_id. - */ - struct RestoreTableFromInstanceParams { - std::string table_id; - std::string backup_name; - }; - - /** - * Restore a backup into a new table in the instance. - * - * @param params instance of `RestoreTableParams`. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_table_admin_backup_snippets.cc restore table - */ - StatusOr RestoreTable( - RestoreTableParams const& params); - - /** - * Restore a backup into a new table in the instance. - * - * @param params instance of `RestoreTableFromInstanceParams`. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_table_admin_backup_snippets.cc restore2 - */ - StatusOr RestoreTable( - RestoreTableFromInstanceParams params); - - /** - * Modify the schema for an existing table. - * - * @param table_id the id of the table within the instance associated with - * this object. The full name of the table is - * `this->instance_name() + "/tables/" + table_id` - * @param modifications the list of modifications to the schema. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet table_admin_snippets.cc modify table - */ - StatusOr<::google::bigtable::admin::v2::Table> ModifyColumnFamilies( - std::string const& table_id, - std::vector modifications); - - /** - * Delete all the rows that start with a given prefix. - * - * @param table_id the id of the table within the instance associated with - * this object. The full name of the table is - * `this->instance_name() + "/tables/" + table_id` - * @param row_key_prefix drop any rows that start with this prefix. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet table_admin_snippets.cc drop rows by prefix - */ - Status DropRowsByPrefix(std::string const& table_id, - std::string row_key_prefix); - - /** - * Generates consistency token for a table. - * - * @param table_id the id of the table for which we want to generate - * consistency token. - * @return the consistency token for table. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet table_admin_snippets.cc generate consistency token - */ - StatusOr GenerateConsistencyToken(std::string const& table_id); - - /** - * Checks consistency of a table. - * - * @param table_id the id of the table for which we want to check - * consistency. - * @param consistency_token the consistency token of the table. - * @return the consistency status for the table. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet table_admin_snippets.cc check consistency - */ - StatusOr CheckConsistency(std::string const& table_id, - std::string const& consistency_token); - - /** - * Checks consistency of a table with multiple calls using a separate thread - * - * @param table_id the id of the table for which we want to check - * consistency. - * @param consistency_token the consistency token of the table. - * @return the consistency status for the table. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet table_admin_snippets.cc wait for consistency check - */ - google::cloud::future> WaitForConsistency( - std::string const& table_id, std::string const& consistency_token); - - /** - * Delete all the rows in a table. - * - * @param table_id the id of the table within the instance associated with - * this object. The full name of the table is - * `this->instance_name() + "/tables/" + table_id` - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet table_admin_snippets.cc drop all rows - */ - Status DropAllRows(std::string const& table_id); - - /** - * Gets the policy for @p table_id. - * - * @param table_id the table to query. - * @return google::iam::v1::Policy the full IAM policy for the table. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet table_admin_iam_policy_snippets.cc get iam policy - */ - StatusOr GetIamPolicy(std::string const& table_id); - - /** - * Gets the policy for @p backup_id. - * - * @param cluster_id the associated cluster that contains backup. - * - * @param backup_id the backup to query. - * @return google::iam::v1::Policy the full IAM policy for the backup. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_table_admin_backup_snippets.cc get backup iam policy - */ - StatusOr GetIamPolicy(std::string const& cluster_id, - std::string const& backup_id); - - /** - * Sets the IAM policy for a table. - * - * This is the preferred way to overload `IamBindings`. This is more closely - * coupled to the underlying protocol, enable more actions and is more likely - * to tolerate future protocol changes. - * - * @param table_id which table to set the IAM policy for. - * @param iam_policy google::iam::v1::Policy object containing role and - * members. - * @return google::iam::v1::Policy the current IAM policy for the table. - * - * @warning ETags are currently not used by Cloud Bigtable. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet table_admin_iam_policy_snippets.cc set iam policy - */ - StatusOr SetIamPolicy( - std::string const& table_id, google::iam::v1::Policy const& iam_policy); - - /** - * Sets the IAM policy for a backup. - * - * This is the preferred way to overload `IamBindings`. This is more closely - * coupled to the underlying protocol, enable more actions and is more likely - * to tolerate future protocol changes. - * - * @param cluster_id which is the cluster containing the backup. - * @param backup_id which backup to set the IAM policy for. - * @param iam_policy google::iam::v1::Policy object containing role and - * members. - * @return google::iam::v1::Policy the current IAM policy for the table. - * - * @warning ETags are currently not used by Cloud Bigtable. - * - * @par Idempotency - * This operation is always treated as non-idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet bigtable_table_admin_backup_snippets.cc set backup iam policy - */ - StatusOr SetIamPolicy( - std::string const& cluster_id, std::string const& backup_id, - google::iam::v1::Policy const& iam_policy); - - /** - * Returns a permission set that the caller has on the specified table. - * - * @param table_id the ID of the table to query. - * @param permissions set of permissions to check for the resource. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet table_admin_iam_policy_snippets.cc test iam permissions - * - * @see https://cloud.google.com/bigtable/docs/access-control for a list of - * valid permissions on Google Cloud Bigtable. - */ - StatusOr> TestIamPermissions( - std::string const& table_id, std::vector const& permissions); - - /** - * Returns a permission set that the caller has on the specified backup. - * - * @param cluster_id the ID of the cluster that contains the backup. - * @param backup_id the ID of the backup to query. - * @param permissions set of permissions to check for the resource. - * - * @par Idempotency - * This operation is read-only and therefore it is always idempotent. - * - * @par Thread-safety - * Two threads concurrently calling this member function on the same instance - * of this class are **not** guaranteed to work. Consider copying the object - * and using different copies in each thread. - * - * @par Example - * @snippet table_admin_iam_policy_snippets.cc test iam permissions - * - * @see https://cloud.google.com/bigtable/docs/access-control for a list of - * valid permissions on Google Cloud Bigtable. - */ - StatusOr> TestIamPermissions( - std::string const& cluster_id, std::string const& backup_id, - std::vector const& permissions); - - /// Return the fully qualified name of a table in this object's instance. - std::string TableName(std::string const& table_id) const { - return google::cloud::bigtable::TableName(project_id_, instance_id_, - table_id); - } - - /// Return the fully qualified name of a Cluster. - std::string ClusterName(std::string const& cluster_id) const { - return google::cloud::bigtable::ClusterName(project_id_, instance_id_, - cluster_id); - } - - /// Return the fully qualified name of a Backup. - std::string BackupName(std::string const& cluster_id, - std::string const& backup_id) const { - return google::cloud::bigtable::BackupName(project_id_, instance_id_, - cluster_id, backup_id); - } - - private: - friend class bigtable_internal::TableAdminTester; - - explicit TableAdmin( - std::shared_ptr connection, - CompletionQueue cq, std::string project_id, std::string instance_id) - : connection_(std::move(connection)), - cq_(std::move(cq)), - project_id_(std::move(project_id)), - instance_id_(std::move(instance_id)), - instance_name_(InstanceName()), - retry_prototype_( - DefaultRPCRetryPolicy(internal::kBigtableTableAdminLimits)), - backoff_prototype_( - DefaultRPCBackoffPolicy(internal::kBigtableTableAdminLimits)), - polling_prototype_( - DefaultPollingPolicy(internal::kBigtableTableAdminLimits)), - options_(google::cloud::internal::MergeOptions( - bigtable_internal::MakeTableAdminOptions( - retry_prototype_, backoff_prototype_, polling_prototype_), - connection_->options())) {} - - ///@{ - /// @name Helper functions to implement constructors with changed policies. - void ChangePolicy(RPCRetryPolicy const& policy) { - retry_prototype_ = policy.clone(); - } - - void ChangePolicy(RPCBackoffPolicy const& policy) { - backoff_prototype_ = policy.clone(); - } - - void ChangePolicy(PollingPolicy const& policy) { - polling_prototype_ = policy.clone(); - } - - template - void ChangePolicies(Policy&& policy, Policies&&... policies) { - ChangePolicy(policy); - ChangePolicies(std::forward(policies)...); - } - void ChangePolicies() {} - ///@} - - /// Compute the fully qualified instance name. - std::string InstanceName() const; - - StatusOr GetIamPolicyImpl(std::string resource); - - StatusOr SetIamPolicyImpl( - std::string resource, google::iam::v1::Policy const& iam_policy); - - StatusOr> TestIamPermissionsImpl( - std::string resource, std::vector const& permissions); - - std::shared_ptr connection_; - CompletionQueue cq_; - std::shared_ptr background_threads_; - std::string project_id_; - std::string instance_id_; - std::string instance_name_; - ///@{ - /// These prototypes are only used as temporary storage during construction of - /// the class, where they are consolidated as common policies in `options_`. - std::shared_ptr retry_prototype_; - std::shared_ptr backoff_prototype_; - std::shared_ptr polling_prototype_; - ///@} - Options options_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TABLE_ADMIN_H diff --git a/google/cloud/bigtable/table_admin_test.cc b/google/cloud/bigtable/table_admin_test.cc deleted file mode 100644 index b27134b6a102c..0000000000000 --- a/google/cloud/bigtable/table_admin_test.cc +++ /dev/null @@ -1,950 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/table_admin.h" -#include "google/cloud/bigtable/admin/bigtable_table_admin_connection.h" -#include "google/cloud/bigtable/admin/bigtable_table_admin_options.h" -#include "google/cloud/bigtable/admin/mocks/mock_bigtable_table_admin_connection.h" -#include "google/cloud/bigtable/testing/mock_policies.h" -#include "google/cloud/internal/background_threads_impl.h" -#include "google/cloud/internal/time_utils.h" -#include "google/cloud/testing_util/is_proto_equal.h" -#include "google/cloud/testing_util/status_matchers.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -// Helper class for checking that the legacy API still functions correctly -class TableAdminTester { - public: - static bigtable::TableAdmin MakeTestTableAdmin( - std::shared_ptr conn, - CompletionQueue cq, std::string const& kProjectId, - std::string const& kInstanceId) { - return bigtable::TableAdmin(std::move(conn), std::move(cq), kProjectId, - kInstanceId); - } - - static std::shared_ptr - Connection(bigtable::TableAdmin const& admin) { - return admin.connection_; - } - - static CompletionQueue CQ(bigtable::TableAdmin const& admin) { - return admin.cq_; - } - - static std::shared_ptr Threads( - bigtable::TableAdmin const& admin) { - return admin.background_threads_; - } - - static ::google::cloud::Options Options(bigtable::TableAdmin const& admin) { - return admin.options_; - } -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_internal -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -namespace { - -namespace btadmin = ::google::bigtable::admin::v2; -namespace iamproto = ::google::iam::v1; - -using ::google::cloud::bigtable::testing::MockBackoffPolicy; -using ::google::cloud::bigtable::testing::MockPollingPolicy; -using ::google::cloud::bigtable::testing::MockRetryPolicy; -using ::google::cloud::bigtable_internal::TableAdminTester; -using ::google::cloud::internal::ToChronoTimePoint; -using ::google::cloud::testing_util::IsProtoEqual; -using ::google::cloud::testing_util::StatusIs; -using std::chrono::hours; -using ::testing::An; -using ::testing::ElementsAre; -using ::testing::ElementsAreArray; -using ::testing::IsNull; -using ::testing::NotNull; -using ::testing::Return; -using ::testing::UnorderedElementsAreArray; -using MockConnection = - ::google::cloud::bigtable_admin_mocks::MockBigtableTableAdminConnection; - -auto const* const kProjectId = "the-project"; -auto const* const kInstanceId = "the-instance"; -auto const* const kTableId = "the-table"; -auto const* const kClusterId = "the-cluster"; -auto const* const kBackupId = "the-backup"; -auto const* const kInstanceName = "projects/the-project/instances/the-instance"; -auto const* const kTableName = - "projects/the-project/instances/the-instance/tables/the-table"; -auto const* const kClusterName = - "projects/the-project/instances/the-instance/clusters/the-cluster"; -auto const* const kBackupName = - "projects/the-project/instances/the-instance/clusters/the-cluster/backups/" - "the-backup"; - -struct TestOption { - using Type = int; -}; - -Options TestOptions() { - return Options{} - .set(grpc::InsecureChannelCredentials()) - .set(1); -} - -Status FailingStatus() { return Status(StatusCode::kPermissionDenied, "fail"); } - -bool SameCQ(CompletionQueue const& a, CompletionQueue const& b) { - using ::google::cloud::internal::GetCompletionQueueImpl; - return GetCompletionQueueImpl(a) == GetCompletionQueueImpl(b); -} - -void CheckOptions(Options const& options) { - EXPECT_TRUE( - options.has()); - EXPECT_TRUE( - options.has()); - EXPECT_TRUE( - options.has()); - EXPECT_TRUE(options.has()); - EXPECT_TRUE(options.has()); - EXPECT_TRUE(options.has()); -} - -class TableAdminTest : public ::testing::Test { - protected: - TableAdmin DefaultTableAdmin() { - EXPECT_CALL(*connection_, options()) - .WillRepeatedly(Return(Options{}.set(1))); - return TableAdminTester::MakeTestTableAdmin(connection_, {}, kProjectId, - kInstanceId); - } - - std::shared_ptr connection_ = - std::make_shared(); -}; - -TEST_F(TableAdminTest, Equality) { - auto client1 = MakeAdminClient(kProjectId, TestOptions()); - auto client2 = MakeAdminClient(kProjectId, TestOptions()); - auto ta1 = TableAdmin(client1, "i1"); - auto ta2 = TableAdmin(client1, "i2"); - auto ta3 = TableAdmin(client2, "i1"); - EXPECT_NE(ta1, ta2); - EXPECT_NE(ta1, ta3); - EXPECT_NE(ta2, ta3); - - ta2 = ta1; - EXPECT_EQ(ta1, ta2); -} - -TEST_F(TableAdminTest, ResourceNames) { - auto admin = DefaultTableAdmin(); - EXPECT_EQ(kProjectId, admin.project()); - EXPECT_EQ(kInstanceId, admin.instance_id()); - EXPECT_EQ(kInstanceName, admin.instance_name()); -} - -TEST_F(TableAdminTest, WithNewTarget) { - auto admin = DefaultTableAdmin(); - auto other_admin = admin.WithNewTarget("other-project", "other-instance"); - EXPECT_EQ(other_admin.project(), "other-project"); - EXPECT_EQ(other_admin.instance_id(), "other-instance"); - EXPECT_EQ(other_admin.instance_name(), - InstanceName("other-project", "other-instance")); -} - -TEST_F(TableAdminTest, LegacyConstructorSharesConnection) { - auto admin_client = MakeAdminClient(kProjectId, TestOptions()); - auto admin_1 = TableAdmin(admin_client, kInstanceId); - auto admin_2 = TableAdmin(admin_client, kInstanceId); - auto conn_1 = TableAdminTester::Connection(admin_1); - auto conn_2 = TableAdminTester::Connection(admin_2); - - EXPECT_EQ(conn_1, conn_2); - EXPECT_THAT(conn_1, NotNull()); -} - -TEST_F(TableAdminTest, LegacyConstructorSetsCQ) { - auto admin_client = MakeAdminClient(kProjectId, TestOptions()); - auto admin = TableAdmin(admin_client, kInstanceId); - auto conn = TableAdminTester::Connection(admin); - ASSERT_TRUE(conn->options().has()); - auto conn_cq = conn->options().get(); - auto client_cq = TableAdminTester::CQ(admin); - - EXPECT_TRUE(SameCQ(conn_cq, client_cq)); - EXPECT_THAT(TableAdminTester::Threads(admin), NotNull()); -} - -TEST_F(TableAdminTest, LegacyConstructorSetsCustomCQ) { - CompletionQueue user_cq; - auto admin_client = MakeAdminClient( - kProjectId, TestOptions().set(user_cq)); - auto admin = TableAdmin(admin_client, kInstanceId); - auto conn = TableAdminTester::Connection(admin); - ASSERT_TRUE(conn->options().has()); - auto conn_cq = conn->options().get(); - auto client_cq = TableAdminTester::CQ(admin); - - EXPECT_TRUE(SameCQ(user_cq, client_cq)); - EXPECT_TRUE(SameCQ(conn_cq, client_cq)); - EXPECT_THAT(TableAdminTester::Threads(admin), IsNull()); -} - -TEST_F(TableAdminTest, LegacyConstructorDefaultsPolicies) { - auto admin_client = MakeAdminClient(kProjectId, TestOptions()); - auto admin = TableAdmin(std::move(admin_client), kInstanceId); - auto options = TableAdminTester::Options(admin); - CheckOptions(options); -} - -TEST_F(TableAdminTest, LegacyConstructorWithPolicies) { - // In this test, we make a series of simple calls to verify that the policies - // passed to the `TableAdmin` constructor are actually collected as - // `Options`. - // - // Upon construction of an TableAdmin, each policy is cloned twice: Once - // while processing the variadic parameters, once while converting from - // Bigtable policies to common policies. This should explain the nested mocks - // below. - - auto mock_r = std::make_shared(); - auto mock_b = std::make_shared(); - auto mock_p = std::make_shared(); - - EXPECT_CALL(*mock_r, clone).WillOnce([] { - auto clone_1 = std::make_unique(); - EXPECT_CALL(*clone_1, clone).WillOnce([] { - auto clone_2 = std::make_unique(); - EXPECT_CALL(*clone_2, OnFailure(An())); - return clone_2; - }); - return clone_1; - }); - - EXPECT_CALL(*mock_b, clone).WillOnce([] { - auto clone_1 = std::make_unique(); - EXPECT_CALL(*clone_1, clone).WillOnce([] { - auto clone_2 = std::make_unique(); - EXPECT_CALL(*clone_2, OnCompletion(An())); - return clone_2; - }); - return clone_1; - }); - - EXPECT_CALL(*mock_p, clone).WillOnce([] { - auto clone_1 = std::make_unique(); - EXPECT_CALL(*clone_1, clone).WillOnce([] { - auto clone_2 = std::make_unique(); - EXPECT_CALL(*clone_2, WaitPeriod); - return clone_2; - }); - return clone_1; - }); - - auto admin_client = MakeAdminClient(kProjectId, TestOptions()); - auto admin = TableAdmin(std::move(admin_client), kInstanceId, *mock_r, - *mock_b, *mock_p); - auto options = TableAdminTester::Options(admin); - CheckOptions(options); - - auto const& common_retry = - options.get(); - (void)common_retry->OnFailure({}); - - auto const& common_backoff = - options.get(); - (void)common_backoff->OnCompletion(); - - auto const& common_polling = - options.get(); - (void)common_polling->WaitPeriod(); -} - -TEST_F(TableAdminTest, CreateTable) { - auto admin = DefaultTableAdmin(); - std::string expected_request = R"pb( - parent: 'projects/the-project/instances/the-instance' - table_id: 'the-table' - table { - column_families { - key: 'f1' - value { gc_rule { max_num_versions: 1 } } - } - column_families { - key: 'f2' - value { gc_rule { max_age { seconds: 1 } } } - } - granularity: TIMESTAMP_GRANULARITY_UNSPECIFIED - } - initial_splits { key: 'a' } - initial_splits { key: 'c' } - initial_splits { key: 'p' } - )pb"; - - EXPECT_CALL(*connection_, CreateTable) - .WillOnce( - [&expected_request](btadmin::CreateTableRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - btadmin::CreateTableRequest expected; - EXPECT_TRUE(google::protobuf::TextFormat::ParseFromString( - expected_request, &expected)); - EXPECT_THAT(expected, IsProtoEqual(request)); - return FailingStatus(); - }); - - TableConfig config({{"f1", GcRule::MaxNumVersions(1)}, - {"f2", GcRule::MaxAge(std::chrono::seconds(1))}}, - {"a", "c", "p"}); - EXPECT_THAT(admin.CreateTable(kTableId, config), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, ListTablesSuccess) { - auto admin = DefaultTableAdmin(); - auto const expected_view = btadmin::Table::FULL; - std::vector const expected_names = { - TableName(kProjectId, kInstanceId, "t0"), - TableName(kProjectId, kInstanceId, "t1")}; - - auto iter = expected_names.begin(); - EXPECT_CALL(*connection_, ListTables) - .WillOnce([&iter, &expected_names, - expected_view](btadmin::ListTablesRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kInstanceName, request.parent()); - EXPECT_EQ(expected_view, request.view()); - - using ::google::cloud::internal::MakeStreamRange; - using ::google::cloud::internal::StreamReader; - auto reader = - [&iter, - &expected_names]() -> StreamReader::result_type { - if (iter != expected_names.end()) { - btadmin::Table t; - t.set_name(*iter); - ++iter; - return t; - } - return Status(); - }; - return MakeStreamRange(std::move(reader)); - }); - - auto tables = admin.ListTables(expected_view); - ASSERT_STATUS_OK(tables); - std::vector names; - std::transform(tables->begin(), tables->end(), std::back_inserter(names), - [](btadmin::Table const& t) { return t.name(); }); - - EXPECT_THAT(names, ElementsAreArray(expected_names)); -} - -TEST_F(TableAdminTest, ListTablesFailure) { - auto admin = DefaultTableAdmin(); - auto const expected_view = btadmin::Table::NAME_ONLY; - - EXPECT_CALL(*connection_, ListTables) - .WillOnce([&expected_view](btadmin::ListTablesRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kInstanceName, request.parent()); - EXPECT_EQ(expected_view, request.view()); - - using ::google::cloud::internal::MakeStreamRange; - return MakeStreamRange([] { return FailingStatus(); }); - }); - - EXPECT_THAT(admin.ListTables(expected_view), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, GetTable) { - auto admin = DefaultTableAdmin(); - auto const expected_view = btadmin::Table::NAME_ONLY; - - EXPECT_CALL(*connection_, GetTable) - .WillOnce([&expected_view](btadmin::GetTableRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.name()); - EXPECT_EQ(expected_view, request.view()); - return FailingStatus(); - }); - - EXPECT_THAT(admin.GetTable(kTableId, expected_view), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, DeleteTable) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, DeleteTable) - .WillOnce([](btadmin::DeleteTableRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.name()); - return FailingStatus(); - }); - - EXPECT_THAT(admin.DeleteTable(kTableId), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, CreateBackupParams) { - auto const expire_time = std::chrono::system_clock::now() + hours(24); - TableAdmin::CreateBackupParams params(kClusterId, kBackupId, kTableId, - expire_time); - - auto request = params.AsProto(kInstanceName); - EXPECT_EQ(kClusterName, request.parent()); - EXPECT_EQ(kBackupId, request.backup_id()); - EXPECT_EQ(kTableName, request.backup().source_table()); - EXPECT_EQ(expire_time, ToChronoTimePoint(request.backup().expire_time())); -} - -TEST_F(TableAdminTest, CreateBackup) { - auto const expire_time = std::chrono::system_clock::now() + hours(24); - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, - CreateBackup(An())) - .WillOnce([expire_time](btadmin::CreateBackupRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kClusterName, request.parent()); - EXPECT_EQ(kBackupId, request.backup_id()); - EXPECT_EQ(kTableName, request.backup().source_table()); - EXPECT_EQ(expire_time, - ToChronoTimePoint(request.backup().expire_time())); - return make_ready_future>(FailingStatus()); - }); - - TableAdmin::CreateBackupParams params(kClusterId, kBackupId, kTableId, - expire_time); - EXPECT_THAT(admin.CreateBackup(params), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, GetBackup) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, GetBackup) - .WillOnce([](btadmin::GetBackupRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kBackupName, request.name()); - return FailingStatus(); - }); - - EXPECT_THAT(admin.GetBackup(kClusterId, kBackupId), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, UpdateBackupParams) { - auto const expire_time = std::chrono::system_clock::now() + hours(24); - TableAdmin::UpdateBackupParams params(kClusterId, kBackupId, expire_time); - - auto request = params.AsProto(kInstanceName); - EXPECT_EQ(kBackupName, request.backup().name()); - EXPECT_EQ(expire_time, ToChronoTimePoint(request.backup().expire_time())); - EXPECT_THAT(request.update_mask().paths(), ElementsAre("expire_time")); -} - -TEST_F(TableAdminTest, UpdateBackup) { - auto const expire_time = std::chrono::system_clock::now() + hours(24); - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, UpdateBackup) - .WillOnce([expire_time](btadmin::UpdateBackupRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kBackupName, request.backup().name()); - EXPECT_EQ(expire_time, - ToChronoTimePoint(request.backup().expire_time())); - EXPECT_THAT(request.update_mask().paths(), ElementsAre("expire_time")); - return FailingStatus(); - }); - - TableAdmin::UpdateBackupParams params(kClusterId, kBackupId, expire_time); - EXPECT_THAT(admin.UpdateBackup(params), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, DeleteBackup) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, DeleteBackup) - .Times(2) - .WillRepeatedly([](btadmin::DeleteBackupRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kBackupName, request.name()); - return FailingStatus(); - }); - - btadmin::Backup b; - b.set_name(kBackupName); - EXPECT_THAT(admin.DeleteBackup(b), StatusIs(StatusCode::kPermissionDenied)); - - EXPECT_THAT(admin.DeleteBackup(kClusterId, kBackupId), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, ListBackupsParams) { - TableAdmin::ListBackupsParams params; - auto request = params.AsProto(kInstanceName); - EXPECT_EQ(request.parent(), ClusterName(kProjectId, kInstanceId, "-")); - - params.set_cluster(kClusterId).set_filter("state:READY").set_order_by("name"); - request = params.AsProto(kInstanceName); - EXPECT_EQ(request.parent(), kClusterName); - EXPECT_EQ(*request.mutable_filter(), "state:READY"); - EXPECT_EQ(*request.mutable_order_by(), "name"); -} - -TEST_F(TableAdminTest, ListBackupsSuccess) { - auto admin = DefaultTableAdmin(); - std::vector const expected_names = { - BackupName(kProjectId, kInstanceId, kClusterId, "b0"), - BackupName(kProjectId, kInstanceId, kClusterId, "b1")}; - - auto iter = expected_names.begin(); - EXPECT_CALL(*connection_, ListBackups) - .WillOnce([&iter, - &expected_names](btadmin::ListBackupsRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kClusterName, request.parent()); - - using ::google::cloud::internal::MakeStreamRange; - using ::google::cloud::internal::StreamReader; - auto reader = - [&iter, - &expected_names]() -> StreamReader::result_type { - if (iter != expected_names.end()) { - btadmin::Backup b; - b.set_name(*iter); - ++iter; - return b; - } - return Status(); - }; - return MakeStreamRange(std::move(reader)); - }); - - auto params = TableAdmin::ListBackupsParams().set_cluster(kClusterId); - auto backups = admin.ListBackups(params); - ASSERT_STATUS_OK(backups); - std::vector names; - std::transform(backups->begin(), backups->end(), std::back_inserter(names), - [](btadmin::Backup const& b) { return b.name(); }); - - EXPECT_THAT(names, ElementsAreArray(expected_names)); -} - -TEST_F(TableAdminTest, ListBackupsFailure) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, ListBackups) - .WillOnce([](btadmin::ListBackupsRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kClusterName, request.parent()); - - using ::google::cloud::internal::MakeStreamRange; - return MakeStreamRange([] { return FailingStatus(); }); - }); - - auto params = TableAdmin::ListBackupsParams().set_cluster(kClusterId); - EXPECT_THAT(admin.ListBackups(params), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, RestoreTableParams) { - TableAdmin::RestoreTableParams params(kTableId, kClusterId, kBackupId); - auto request = params.AsProto(kInstanceName); - EXPECT_EQ(kInstanceName, request.parent()); - EXPECT_EQ(kTableId, request.table_id()); - EXPECT_EQ(kBackupName, request.backup()); -} - -TEST_F(TableAdminTest, RestoreTable) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, - RestoreTable(An())) - .Times(2) - .WillRepeatedly([](btadmin::RestoreTableRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kInstanceName, request.parent()); - EXPECT_EQ(kTableId, request.table_id()); - EXPECT_EQ(kBackupName, request.backup()); - return make_ready_future>(FailingStatus()); - }); - - TableAdmin::RestoreTableParams params(kTableId, kClusterId, kBackupId); - EXPECT_THAT(admin.RestoreTable(params), - StatusIs(StatusCode::kPermissionDenied)); - - TableAdmin::RestoreTableFromInstanceParams instance_params; - instance_params.table_id = kTableId; - instance_params.backup_name = kBackupName; - EXPECT_THAT(admin.RestoreTable(instance_params), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, ModifyColumnFamilies) { - auto admin = DefaultTableAdmin(); - std::string expected_request = R"pb( - name: 'projects/the-project/instances/the-instance/tables/the-table' - modifications { - id: 'foo' - create { gc_rule { max_age { seconds: 172800 } } } - } - modifications { - id: 'bar' - update { gc_rule { max_age { seconds: 86400 } } } - } - )pb"; - - EXPECT_CALL(*connection_, ModifyColumnFamilies) - .WillOnce([&expected_request]( - btadmin::ModifyColumnFamiliesRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - btadmin::ModifyColumnFamiliesRequest expected; - EXPECT_TRUE(google::protobuf::TextFormat::ParseFromString( - expected_request, &expected)); - EXPECT_THAT(expected, IsProtoEqual(request)); - return FailingStatus(); - }); - - using M = ColumnFamilyModification; - std::vector mods = { - M::Create("foo", GcRule::MaxAge(hours(48))), - M::Update("bar", GcRule::MaxAge(hours(24)))}; - EXPECT_THAT(admin.ModifyColumnFamilies(kTableId, mods), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, DropRowsByPrefix) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, DropRowRange) - .WillOnce([](btadmin::DropRowRangeRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.name()); - EXPECT_EQ("prefix", request.row_key_prefix()); - return FailingStatus(); - }); - - EXPECT_THAT(admin.DropRowsByPrefix(kTableId, "prefix"), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, WaitForConsistencySuccess) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, AsyncCheckConsistency) - .WillOnce([](btadmin::CheckConsistencyRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.name()); - EXPECT_EQ("consistency-token", request.consistency_token()); - btadmin::CheckConsistencyResponse resp; - resp.set_consistent(true); - return make_ready_future(make_status_or(resp)); - }); - - auto consistent = - admin.WaitForConsistency(kTableId, "consistency-token").get(); - ASSERT_STATUS_OK(consistent); - EXPECT_EQ(*consistent, Consistency::kConsistent); -} - -TEST_F(TableAdminTest, WaitForConsistencyFailure) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, AsyncCheckConsistency) - .WillOnce([](btadmin::CheckConsistencyRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.name()); - EXPECT_EQ("consistency-token", request.consistency_token()); - return make_ready_future>( - FailingStatus()); - }); - - EXPECT_THAT(admin.WaitForConsistency(kTableId, "consistency-token").get(), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, DropAllRows) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, DropRowRange) - .WillOnce([](btadmin::DropRowRangeRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.name()); - EXPECT_TRUE(request.delete_all_data_from_table()); - return FailingStatus(); - }); - - EXPECT_THAT(admin.DropAllRows(kTableId), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, GenerateConsistencyTokenSuccess) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, GenerateConsistencyToken) - .WillOnce([](btadmin::GenerateConsistencyTokenRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.name()); - btadmin::GenerateConsistencyTokenResponse resp; - resp.set_consistency_token("consistency-token"); - return resp; - }); - - auto token = admin.GenerateConsistencyToken(kTableId); - ASSERT_STATUS_OK(token); - EXPECT_EQ(*token, "consistency-token"); -} - -TEST_F(TableAdminTest, GenerateConsistencyTokenFailure) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, GenerateConsistencyToken) - .WillOnce([](btadmin::GenerateConsistencyTokenRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.name()); - return FailingStatus(); - }); - - EXPECT_THAT(admin.GenerateConsistencyToken(kTableId), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, CheckConsistencySuccess) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, CheckConsistency) - .WillOnce([](btadmin::CheckConsistencyRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.name()); - EXPECT_EQ("consistency-token", request.consistency_token()); - btadmin::CheckConsistencyResponse resp; - resp.set_consistent(false); - return resp; - }) - .WillOnce([](btadmin::CheckConsistencyRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.name()); - EXPECT_EQ("consistency-token", request.consistency_token()); - btadmin::CheckConsistencyResponse resp; - resp.set_consistent(true); - return resp; - }); - - auto consistent = admin.CheckConsistency(kTableId, "consistency-token"); - ASSERT_STATUS_OK(consistent); - EXPECT_EQ(*consistent, Consistency::kInconsistent); - - consistent = admin.CheckConsistency(kTableId, "consistency-token"); - ASSERT_STATUS_OK(consistent); - EXPECT_EQ(*consistent, Consistency::kConsistent); -} - -TEST_F(TableAdminTest, CheckConsistencyFailure) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, CheckConsistency) - .WillOnce([](btadmin::CheckConsistencyRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.name()); - EXPECT_EQ("consistency-token", request.consistency_token()); - return FailingStatus(); - }); - - EXPECT_THAT(admin.CheckConsistency(kTableId, "consistency-token"), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, GetIamPolicyTable) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, GetIamPolicy) - .WillOnce([](iamproto::GetIamPolicyRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.resource()); - return FailingStatus(); - }); - - EXPECT_THAT(admin.GetIamPolicy(kTableId), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, GetIamPolicyBackup) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, GetIamPolicy) - .WillOnce([](iamproto::GetIamPolicyRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kBackupName, request.resource()); - return FailingStatus(); - }); - - EXPECT_THAT(admin.GetIamPolicy(kClusterId, kBackupId), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, SetIamPolicyTable) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, SetIamPolicy) - .WillOnce([](iamproto::SetIamPolicyRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.resource()); - EXPECT_EQ(3, request.policy().version()); - EXPECT_EQ("tag", request.policy().etag()); - return FailingStatus(); - }); - - iamproto::Policy p; - p.set_version(3); - p.set_etag("tag"); - EXPECT_THAT(admin.SetIamPolicy(kTableId, p), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, SetIamPolicyBackup) { - auto admin = DefaultTableAdmin(); - - EXPECT_CALL(*connection_, SetIamPolicy) - .WillOnce([](iamproto::SetIamPolicyRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kBackupName, request.resource()); - EXPECT_EQ(3, request.policy().version()); - EXPECT_EQ("tag", request.policy().etag()); - return FailingStatus(); - }); - - iamproto::Policy p; - p.set_version(3); - p.set_etag("tag"); - EXPECT_THAT(admin.SetIamPolicy(kClusterId, kBackupId, p), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, TestIamPermissionsTableSuccess) { - auto admin = DefaultTableAdmin(); - std::vector const expected_permissions = {"writer", "reader"}; - std::vector const returned_permissions = {"reader"}; - - EXPECT_CALL(*connection_, TestIamPermissions) - .WillOnce([&](iamproto::TestIamPermissionsRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.resource()); - std::vector actual_permissions; - for (auto const& c : request.permissions()) { - actual_permissions.emplace_back(c); - } - EXPECT_THAT(actual_permissions, - UnorderedElementsAreArray(expected_permissions)); - - iamproto::TestIamPermissionsResponse r; - for (auto const& p : returned_permissions) r.add_permissions(p); - return r; - }); - - auto resp = admin.TestIamPermissions(kTableId, expected_permissions); - ASSERT_STATUS_OK(resp); - EXPECT_THAT(*resp, ElementsAreArray(returned_permissions)); -} - -TEST_F(TableAdminTest, TestIamPermissionsTableFailure) { - auto admin = DefaultTableAdmin(); - std::vector const expected_permissions = {"writer", "reader"}; - - EXPECT_CALL(*connection_, TestIamPermissions) - .WillOnce([&](iamproto::TestIamPermissionsRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kTableName, request.resource()); - std::vector actual_permissions; - for (auto const& c : request.permissions()) { - actual_permissions.emplace_back(c); - } - EXPECT_THAT(actual_permissions, - UnorderedElementsAreArray(expected_permissions)); - return FailingStatus(); - }); - - EXPECT_THAT(admin.TestIamPermissions(kTableId, expected_permissions), - StatusIs(StatusCode::kPermissionDenied)); -} - -TEST_F(TableAdminTest, TestIamPermissionsBackupSuccess) { - auto admin = DefaultTableAdmin(); - std::vector const expected_permissions = {"writer", "reader"}; - std::vector const returned_permissions = {"reader"}; - - EXPECT_CALL(*connection_, TestIamPermissions) - .WillOnce([&](iamproto::TestIamPermissionsRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kBackupName, request.resource()); - std::vector actual_permissions; - for (auto const& c : request.permissions()) { - actual_permissions.emplace_back(c); - } - EXPECT_THAT(actual_permissions, - UnorderedElementsAreArray(expected_permissions)); - - iamproto::TestIamPermissionsResponse r; - for (auto const& p : returned_permissions) r.add_permissions(p); - return r; - }); - - auto resp = - admin.TestIamPermissions(kClusterId, kBackupId, expected_permissions); - ASSERT_STATUS_OK(resp); - EXPECT_THAT(*resp, ElementsAreArray(returned_permissions)); -} - -TEST_F(TableAdminTest, TestIamPermissionsBackupFailure) { - auto admin = DefaultTableAdmin(); - std::vector const expected_permissions = {"writer", "reader"}; - - EXPECT_CALL(*connection_, TestIamPermissions) - .WillOnce([&](iamproto::TestIamPermissionsRequest const& request) { - CheckOptions(google::cloud::internal::CurrentOptions()); - EXPECT_EQ(kBackupName, request.resource()); - std::vector actual_permissions; - for (auto const& c : request.permissions()) { - actual_permissions.emplace_back(c); - } - EXPECT_THAT(actual_permissions, - UnorderedElementsAreArray(expected_permissions)); - return FailingStatus(); - }); - - EXPECT_THAT( - admin.TestIamPermissions(kClusterId, kBackupId, expected_permissions), - StatusIs(StatusCode::kPermissionDenied)); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/table_apply_test.cc b/google/cloud/bigtable/table_apply_test.cc deleted file mode 100644 index acbf38761b2c6..0000000000000 --- a/google/cloud/bigtable/table_apply_test.cc +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/table.h" -#include "google/cloud/bigtable/testing/table_test_fixture.h" -#include "google/cloud/internal/api_client_header.h" -#include "google/cloud/testing_util/chrono_literals.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "google/cloud/testing_util/validate_metadata.h" - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace bigtable = ::google::cloud::bigtable; -using ::google::cloud::testing_util::StatusIs; -using ::google::cloud::testing_util::ValidateMetadataFixture; -using ::google::cloud::testing_util::chrono_literals::operator""_ms; - -class TableApplyTest : public bigtable::testing::TableTestFixture { - protected: - TableApplyTest() : TableTestFixture(CompletionQueue{}) {} - - void IsContextMDValid(grpc::ClientContext& context, std::string const& method, - google::protobuf::Message const& request) { - return validate_metadata_fixture_.IsContextMDValid( - context, method, request, - google::cloud::internal::HandCraftedLibClientHeader()); - } - - std::function - CreateMutateRowMock(grpc::Status const& status) { - return [this, status](grpc::ClientContext* context, - google::bigtable::v2::MutateRowRequest const& request, - google::bigtable::v2::MutateRowResponse*) { - IsContextMDValid(*context, "google.bigtable.v2.Bigtable.MutateRow", - request); - return status; - }; - } - - private: - ValidateMetadataFixture validate_metadata_fixture_; -}; - -/// @test Verify that Table::Apply() works in a simplest case. -TEST_F(TableApplyTest, Simple) { - EXPECT_CALL(*client_, MutateRow) - .WillOnce(CreateMutateRowMock(grpc::Status::OK)); - - auto status = table_.Apply(bigtable::SingleRowMutation( - "bar", {bigtable::SetCell("fam", "col", 0_ms, "val")})); - ASSERT_STATUS_OK(status); -} - -/// @test Verify that Table::Apply() raises an exception on permanent failures. -TEST_F(TableApplyTest, Failure) { - EXPECT_CALL(*client_, MutateRow) - .WillRepeatedly(CreateMutateRowMock( - grpc::Status(grpc::StatusCode::FAILED_PRECONDITION, "uh-oh"))); - - auto status = table_.Apply(bigtable::SingleRowMutation( - "bar", {bigtable::SetCell("fam", "col", 0_ms, "val")})); - EXPECT_THAT(status, StatusIs(StatusCode::kFailedPrecondition)); -} - -/// @test Verify that Table::Apply() retries on partial failures. -TEST_F(TableApplyTest, Retry) { - EXPECT_CALL(*client_, MutateRow) - .WillOnce(CreateMutateRowMock( - grpc::Status(grpc::StatusCode::UNAVAILABLE, "try-again"))) - .WillOnce(CreateMutateRowMock( - grpc::Status(grpc::StatusCode::UNAVAILABLE, "try-again"))) - .WillOnce(CreateMutateRowMock( - grpc::Status(grpc::StatusCode::UNAVAILABLE, "try-again"))) - .WillOnce(CreateMutateRowMock((grpc::Status::OK))); - - auto status = table_.Apply(bigtable::SingleRowMutation( - "bar", {bigtable::SetCell("fam", "col", 0_ms, "val")})); - ASSERT_STATUS_OK(status); -} - -/// @test Verify that Table::Apply() retries only idempotent mutations. -TEST_F(TableApplyTest, RetryIdempotent) { - EXPECT_CALL(*client_, MutateRow) - .WillRepeatedly(CreateMutateRowMock( - grpc::Status(grpc::StatusCode::UNAVAILABLE, "try-again"))); - - auto status = table_.Apply(bigtable::SingleRowMutation( - "not-idempotent", {bigtable::SetCell("fam", "col", "val")})); - EXPECT_THAT(status, StatusIs(StatusCode::kUnavailable)); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/table_bulk_apply_test.cc b/google/cloud/bigtable/table_bulk_apply_test.cc deleted file mode 100644 index d991309977d62..0000000000000 --- a/google/cloud/bigtable/table_bulk_apply_test.cc +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/table.h" -#include "google/cloud/bigtable/testing/mock_mutate_rows_reader.h" -#include "google/cloud/bigtable/testing/mock_policies.h" -#include "google/cloud/bigtable/testing/table_test_fixture.h" -#include "google/cloud/testing_util/chrono_literals.h" -#include "google/cloud/testing_util/status_matchers.h" - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace btproto = ::google::bigtable::v2; - -using ::google::cloud::bigtable::testing::MockBackoffPolicy; -using ::google::cloud::testing_util::IsOk; -using ::google::cloud::testing_util::chrono_literals::operator""_ms; -using ::google::cloud::testing_util::chrono_literals::operator""_us; -using ::testing::An; -using ::testing::Not; -using ::testing::Return; - -/// Define types and functions used in the tests. -class TableBulkApplyTest - : public ::google::cloud::bigtable::testing::TableTestFixture { - public: - TableBulkApplyTest() : TableTestFixture(CompletionQueue{}) {} -}; -using ::google::cloud::bigtable::testing::MockMutateRowsReader; - -TEST_F(TableBulkApplyTest, Empty) { - auto failures = table_.BulkApply(BulkMutation()); - EXPECT_TRUE(failures.empty()); -} - -/// @test Verify that Table::BulkApply() works in the easy case. -TEST_F(TableBulkApplyTest, Simple) { - auto reader = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*reader, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - { - auto& e = *r->add_entries(); - e.set_index(0); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - { - auto& e = *r->add_entries(); - e.set_index(1); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*reader, Finish()).WillOnce(Return(grpc::Status::OK)); - - EXPECT_CALL(*client_, MutateRows) - .WillOnce(reader.release()->MakeMockReturner()); - - auto failures = table_.BulkApply(BulkMutation( - SingleRowMutation("foo", {SetCell("fam", "col", 0_ms, "baz")}), - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")}))); - ASSERT_TRUE(failures.empty()); - SUCCEED(); -} - -/// @test Verify that Table::BulkApply() retries partial failures. -TEST_F(TableBulkApplyTest, RetryPartialFailure) { - auto r1 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r1, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - // Simulate a partial (recoverable) failure. - auto& e0 = *r->add_entries(); - e0.set_index(0); - e0.mutable_status()->set_code(grpc::StatusCode::UNAVAILABLE); - auto& e1 = *r->add_entries(); - e1.set_index(1); - e1.mutable_status()->set_code(grpc::StatusCode::OK); - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r1, Finish()).WillOnce(Return(grpc::Status::OK)); - - auto r2 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r2, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - { - auto& e = *r->add_entries(); - e.set_index(0); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r2, Finish()).WillOnce(Return(grpc::Status::OK)); - - EXPECT_CALL(*client_, MutateRows) - .WillOnce(r1.release()->MakeMockReturner()) - .WillOnce(r2.release()->MakeMockReturner()); - - auto failures = table_.BulkApply(BulkMutation( - SingleRowMutation("foo", {SetCell("fam", "col", 0_ms, "baz")}), - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")}))); - ASSERT_TRUE(failures.empty()); - SUCCEED(); -} - -/// @test Verify that Table::BulkApply() handles permanent failures. -TEST_F(TableBulkApplyTest, PermanentFailure) { - auto r1 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r1, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - { - auto& e = *r->add_entries(); - e.set_index(0); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - { - auto& e = *r->add_entries(); - e.set_index(1); - e.mutable_status()->set_code(grpc::StatusCode::OUT_OF_RANGE); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r1, Finish()).WillOnce(Return(grpc::Status::OK)); - - EXPECT_CALL(*client_, MutateRows).WillOnce(r1.release()->MakeMockReturner()); - - auto failures = table_.BulkApply(BulkMutation( - SingleRowMutation("foo", {SetCell("fam", "col", 0_ms, "baz")}), - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")}))); - EXPECT_FALSE(failures.empty()); -} - -/// @test Verify that Table::BulkApply() handles a terminated stream. -TEST_F(TableBulkApplyTest, CanceledStream) { - // Simulate a stream that returns one success and then terminates. We expect - // the BulkApply() operation to retry the request, because the mutation is in - // an undetermined state. Well, it should retry assuming it is idempotent, - // which happens to be the case in this test. - auto r1 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r1, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - { - auto& e = *r->add_entries(); - e.set_index(0); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r1, Finish()).WillOnce(Return(grpc::Status::OK)); - - // Create a second stream returned by the mocks when the client retries. - auto r2 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r2, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - { - auto& e = *r->add_entries(); - e.set_index(0); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r2, Finish()).WillOnce(Return(grpc::Status::OK)); - - EXPECT_CALL(*client_, MutateRows) - .WillOnce(r1.release()->MakeMockReturner()) - .WillOnce(r2.release()->MakeMockReturner()); - - auto failures = table_.BulkApply(BulkMutation( - SingleRowMutation("foo", {SetCell("fam", "col", 0_ms, "baz")}), - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")}))); - ASSERT_TRUE(failures.empty()); - SUCCEED(); -} - -/// @test Verify that Table::BulkApply() reports correctly on too many errors. -TEST_F(TableBulkApplyTest, TooManyFailures) { - // Create a table with specific policies so we can test the behavior - // without having to depend on timers expiring. In this case tolerate only - // 3 failures. - Table custom_table( - client_, "foo_table", - // Configure the Table to stop at 3 failures. - LimitedErrorCountRetryPolicy(2), - // Use much shorter backoff than the default to test faster. - ExponentialBackoffPolicy(10_us, 40_us)); - - // Setup the mocks to fail more than 3 times. - auto r1 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r1, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - { - auto& e = *r->add_entries(); - e.set_index(0); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r1, Finish()) - .WillOnce(Return(grpc::Status(grpc::StatusCode::ABORTED, ""))); - - auto create_cancelled_stream = [&](grpc::ClientContext*, - btproto::MutateRowsRequest const&) { - auto stream = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()) - .WillOnce(Return(grpc::Status(grpc::StatusCode::ABORTED, ""))); - return stream; - }; - - EXPECT_CALL(*client_, MutateRows) - .WillOnce(r1.release()->MakeMockReturner()) - .WillOnce(create_cancelled_stream) - .WillOnce(create_cancelled_stream); - - auto failures = custom_table.BulkApply(BulkMutation( - SingleRowMutation("foo", {SetCell("fam", "col", 0_ms, "baz")}), - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")}))); - EXPECT_FALSE(failures.empty()); - EXPECT_EQ(google::cloud::StatusCode::kAborted, - failures.front().status().code()); -} - -TEST_F(TableBulkApplyTest, RetryPolicyUsedForOkStreamWithFailedMutations) { - // Create a table with specific policies so we can test the behavior - // without having to depend on timers expiring. In this case tolerate only - // 3 failures. - Table custom_table( - client_, "foo_table", - // Configure the Table to stop at 3 failures. - LimitedErrorCountRetryPolicy(2), - // Use much shorter backoff than the default to test faster. - ExponentialBackoffPolicy(10_us, 40_us)); - - auto create_stream = [&](grpc::ClientContext*, - btproto::MutateRowsRequest const&) { - auto stream = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*stream, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - auto& e0 = *r->add_entries(); - e0.set_index(0); - e0.mutable_status()->set_code(grpc::StatusCode::UNAVAILABLE); - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()).WillOnce(Return(grpc::Status::OK)); - return stream; - }; - - EXPECT_CALL(*client_, MutateRows).Times(3).WillRepeatedly(create_stream); - - auto failures = custom_table.BulkApply(BulkMutation( - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")}))); - EXPECT_FALSE(failures.empty()); - EXPECT_EQ(StatusCode::kUnavailable, failures.front().status().code()); -} - -/// @test Verify that Table::BulkApply() retries only idempotent mutations. -TEST_F(TableBulkApplyTest, RetryOnlyIdempotent) { - // We will send both idempotent and non-idempotent mutations. We prepare the - // mocks to return an empty stream in the first RPC request. That will force - // the client to only retry the idempotent mutations. - auto r1 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r1, Read).WillOnce(Return(false)); - EXPECT_CALL(*r1, Finish()).WillOnce(Return(grpc::Status::OK)); - - auto r2 = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*r2, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - { - auto& e = *r->add_entries(); - e.set_index(0); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r2, Finish()).WillOnce(Return(grpc::Status::OK)); - - EXPECT_CALL(*client_, MutateRows) - .WillOnce(r1.release()->MakeMockReturner()) - .WillOnce(r2.release()->MakeMockReturner()); - - auto failures = table_.BulkApply(BulkMutation( - SingleRowMutation("is-idempotent", {SetCell("fam", "col", 0_ms, "qux")}), - SingleRowMutation("not-idempotent", {SetCell("fam", "col", "baz")}))); - EXPECT_EQ(1UL, failures.size()); - EXPECT_EQ(1, failures.front().original_index()); - EXPECT_THAT(failures.front().status(), Not(IsOk())); - EXPECT_FALSE(failures.empty()); -} - -/// @test Verify that Table::BulkApply() works when the RPC fails. -TEST_F(TableBulkApplyTest, FailedRPC) { - auto reader = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*reader, Read).WillOnce(Return(false)); - EXPECT_CALL(*reader, Finish()) - .WillOnce(Return(grpc::Status(grpc::StatusCode::FAILED_PRECONDITION, - "no such table"))); - - EXPECT_CALL(*client_, MutateRows) - .WillOnce(reader.release()->MakeMockReturner()); - - auto failures = table_.BulkApply(BulkMutation( - SingleRowMutation("foo", {SetCell("fam", "col", 0_ms, "baz")}), - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")}))); - EXPECT_EQ(2UL, failures.size()); - EXPECT_THAT(failures.front().status(), Not(IsOk())); - EXPECT_FALSE(failures.empty()); - EXPECT_EQ(google::cloud::StatusCode::kFailedPrecondition, - failures.front().status().code()); -} - -TEST_F(TableBulkApplyTest, NoSleepIfNoPendingMutations) { - auto reader = std::make_unique( - "google.bigtable.v2.Bigtable.MutateRows"); - EXPECT_CALL(*reader, Read) - .WillOnce([](btproto::MutateRowsResponse* r) { - { - auto& e = *r->add_entries(); - e.set_index(0); - e.mutable_status()->set_code(grpc::StatusCode::OK); - } - { - auto& e = *r->add_entries(); - e.set_index(1); - e.mutable_status()->set_code(grpc::StatusCode::PERMISSION_DENIED); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*reader, Finish()).WillOnce(Return(grpc::Status::OK)); - - EXPECT_CALL(*client_, MutateRows) - .WillOnce(reader.release()->MakeMockReturner()); - - // The backoff policy is cloned once in the Table constructor, and once before - // the start of the `BulkApply` call. We set expectations on the second clone. - auto b1 = std::make_unique(); - EXPECT_CALL(*b1, clone).WillOnce([]() { - auto b2 = std::make_unique(); - EXPECT_CALL(*b2, clone).WillOnce([]() { - auto mock = std::make_unique(); - EXPECT_CALL(*mock, Setup).Times(1); - EXPECT_CALL(*mock, OnCompletion(An())).Times(0); - return mock; - }); - return b2; - }); - auto table = Table(client_, kTableId, std::move(*b1)); - (void)table.BulkApply(BulkMutation( - SingleRowMutation("foo", {SetCell("fam", "col", 0_ms, "baz")}), - SingleRowMutation("bar", {SetCell("fam", "col", 0_ms, "qux")}))); -} - -} // anonymous namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/table_check_and_mutate_row_test.cc b/google/cloud/bigtable/table_check_and_mutate_row_test.cc deleted file mode 100644 index df0f029de5e25..0000000000000 --- a/google/cloud/bigtable/table_check_and_mutate_row_test.cc +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/table.h" -#include "google/cloud/bigtable/testing/table_test_fixture.h" -#include "google/cloud/internal/api_client_header.h" -#include "google/cloud/testing_util/chrono_literals.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "google/cloud/testing_util/validate_metadata.h" - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -using ::google::cloud::testing_util::ValidateMetadataFixture; -using ::google::cloud::testing_util::chrono_literals::operator""_ms; - -class TableCheckAndMutateRowTest : public bigtable::testing::TableTestFixture { - protected: - TableCheckAndMutateRowTest() : TableTestFixture(CompletionQueue{}) {} - - void IsContextMDValid(grpc::ClientContext& context, std::string const& method, - google::protobuf::Message const& request) { - return validate_metadata_fixture_.IsContextMDValid( - context, method, request, - google::cloud::internal::HandCraftedLibClientHeader()); - } - - std::function< - grpc::Status(grpc::ClientContext* context, - google::bigtable::v2::CheckAndMutateRowRequest const&, - google::bigtable::v2::CheckAndMutateRowResponse*)> - CreateCheckAndMutateMock(grpc::Status const& status) { - return [this, status]( - grpc::ClientContext* context, - google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::bigtable::v2::CheckAndMutateRowResponse*) { - IsContextMDValid( - *context, "google.bigtable.v2.Bigtable.CheckAndMutateRow", request); - return status; - }; - } - - private: - ValidateMetadataFixture validate_metadata_fixture_; -}; - -/// @test Verify that Table::CheckAndMutateRow() works in a simplest case. -TEST_F(TableCheckAndMutateRowTest, Simple) { - EXPECT_CALL(*client_, CheckAndMutateRow) - .WillOnce(CreateCheckAndMutateMock(grpc::Status::OK)); - - auto mut = table_.CheckAndMutateRow( - "foo", bigtable::Filter::PassAllFilter(), - {bigtable::SetCell("fam", "col", 0_ms, "it was true")}, - {bigtable::SetCell("fam", "col", 0_ms, "it was false")}); - - ASSERT_STATUS_OK(mut); -} - -#if GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS -/// @test Verify that Table::CheckAndMutateRow() raises an on failures. -TEST_F(TableCheckAndMutateRowTest, Failure) { - EXPECT_CALL(*client_, CheckAndMutateRow) - .WillRepeatedly(CreateCheckAndMutateMock( - grpc::Status(grpc::StatusCode::UNAVAILABLE, "try-again"))); - - EXPECT_FALSE(table_.CheckAndMutateRow( - "foo", bigtable::Filter::PassAllFilter(), - {bigtable::SetCell("fam", "col", 0_ms, "it was true")}, - {bigtable::SetCell("fam", "col", 0_ms, "it was false")})); -} -#endif // GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS - -} // anonymous namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/table_config.h b/google/cloud/bigtable/table_config.h index 9216ca3798bbd..64ab811a3e6b7 100644 --- a/google/cloud/bigtable/table_config.h +++ b/google/cloud/bigtable/table_config.h @@ -17,7 +17,7 @@ #include "google/cloud/bigtable/column_family.h" #include "google/cloud/bigtable/version.h" -#include +#include "google/bigtable/admin/v2/bigtable_table_admin.pb.h" #include #include #include diff --git a/google/cloud/bigtable/table_readmodifywriterow_test.cc b/google/cloud/bigtable/table_readmodifywriterow_test.cc deleted file mode 100644 index 8bd0b22e2f2db..0000000000000 --- a/google/cloud/bigtable/table_readmodifywriterow_test.cc +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/testing/table_test_fixture.h" -#include "google/cloud/internal/api_client_header.h" -#include "google/cloud/testing_util/is_proto_equal.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "google/cloud/testing_util/validate_metadata.h" -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace btproto = ::google::bigtable::v2; - -using ::google::cloud::testing_util::IsProtoEqual; -using ::google::cloud::testing_util::ValidateMetadataFixture; - -/// Define helper types and functions for this test. -class TableReadModifyWriteTest : public bigtable::testing::TableTestFixture { - public: - TableReadModifyWriteTest() : TableTestFixture(CompletionQueue{}) {} - - std::function - CreateRules(std::string const& expected_request_string, - std::string const& generated_response_string) { - return [this, expected_request_string, generated_response_string]( - grpc::ClientContext* context, - btproto::ReadModifyWriteRowRequest const& request, - btproto::ReadModifyWriteRowResponse* response) { - validate_metadata_fixture_.IsContextMDValid( - *context, "google.bigtable.v2.Bigtable.ReadModifyWriteRow", request, - google::cloud::internal::HandCraftedLibClientHeader()); - btproto::ReadModifyWriteRowRequest expected_request; - EXPECT_TRUE(::google::protobuf::TextFormat::ParseFromString( - expected_request_string, &expected_request)); - EXPECT_THAT(expected_request, IsProtoEqual(request)); - - EXPECT_TRUE(::google::protobuf::TextFormat::ParseFromString( - generated_response_string, response)); - - return grpc::Status::OK; - }; - } - - private: - ValidateMetadataFixture validate_metadata_fixture_; -}; - -TEST_F(TableReadModifyWriteTest, MultipleAppendValueTest) { - std::string const row_key = "row-key"; - std::string const family1 = "family1"; - std::string const column_id1 = "colid1"; - std::string const request_text = R"""( -table_name: "projects/foo-project/instances/bar-instance/tables/baz-table" -row_key: "row-key" -rules { - family_name: "family1" - column_qualifier: "colid1" - append_value: "value1" -} -rules { - family_name: "family1" - column_qualifier: "colid1" - append_value: "-value2" -} -)"""; - - std::string const response_text = R"""( -row { - key: "response-row-key" - families { - name: "response-family1" - columns { - qualifier: "response-colid1" - cells { - value: "value1-value2" - } - } - } -} -)"""; - - auto mock_read_modify_write_row = CreateRules(request_text, response_text); - - EXPECT_CALL(*client_, ReadModifyWriteRow) - .WillOnce(mock_read_modify_write_row); - - auto row = table_.ReadModifyWriteRow( - row_key, - bigtable::ReadModifyWriteRule::AppendValue(family1, column_id1, "value1"), - bigtable::ReadModifyWriteRule::AppendValue(family1, column_id1, - "-value2")); - - ASSERT_STATUS_OK(row); - EXPECT_EQ("response-row-key", row->row_key()); - EXPECT_EQ("response-family1", row->cells().at(0).family_name()); - EXPECT_EQ("response-colid1", row->cells().at(0).column_qualifier()); - EXPECT_EQ(1, (int)row->cells().size()); - EXPECT_EQ("value1-value2", row->cells().at(0).value()); -} - -TEST_F(TableReadModifyWriteTest, MultipleIncrementAmountTest) { - std::string const row_key = "row-key"; - std::string const family1 = "family1"; - std::string const family2 = "family2"; - std::string const column_id1 = "colid1"; - std::string const column_id2 = "colid2"; - std::string const request_text = R"""( - table_name: "projects/foo-project/instances/bar-instance/tables/baz-table" - row_key: "row-key" - rules { - family_name: "family1" - column_qualifier: "colid1" - increment_amount: 1000 - } - rules { - family_name: "family1" - column_qualifier: "colid2" - increment_amount: 200 - } - rules { - family_name: "family2" - column_qualifier: "colid2" - increment_amount: 400 - } - )"""; - - std::string const response_text = R"""( - row { - key: "response-row-key" - families { - name: "response-family1" - columns { - qualifier: "response-colid1" - cells { - value: "1200" - } - } - } - families { - name: "response-family2" - columns { - qualifier: "response-colid2" - cells { - value: "400" - } - } - } - } - )"""; - - auto mock_read_modify_write_row = CreateRules(request_text, response_text); - - EXPECT_CALL(*client_, ReadModifyWriteRow) - .WillOnce(mock_read_modify_write_row); - - auto row = table_.ReadModifyWriteRow( - row_key, - bigtable::ReadModifyWriteRule::IncrementAmount(family1, column_id1, 1000), - bigtable::ReadModifyWriteRule::IncrementAmount(family1, column_id2, 200), - bigtable::ReadModifyWriteRule::IncrementAmount(family2, column_id2, 400)); - - ASSERT_STATUS_OK(row); - EXPECT_EQ("response-row-key", row->row_key()); - EXPECT_EQ("response-family1", row->cells().at(0).family_name()); - EXPECT_EQ("response-colid1", row->cells().at(0).column_qualifier()); - EXPECT_EQ(2, (int)row->cells().size()); - EXPECT_EQ("1200", row->cells().at(0).value()); - - EXPECT_EQ("response-family2", row->cells().at(1).family_name()); - EXPECT_EQ("response-colid2", row->cells().at(1).column_qualifier()); - EXPECT_EQ("400", row->cells().at(1).value()); -} - -TEST_F(TableReadModifyWriteTest, MultipleMixedRuleTest) { - std::string const row_key = "row-key"; - std::string const family1 = "family1"; - std::string const family2 = "family2"; - std::string const column_id1 = "colid1"; - std::string const column_id2 = "colid2"; - std::string const request_text = R"""( - table_name: "projects/foo-project/instances/bar-instance/tables/baz-table" - row_key: "row-key" - rules { - family_name: "family1" - column_qualifier: "colid1" - increment_amount: 1000 - } - rules { - family_name: "family1" - column_qualifier: "colid2" - append_value: "value_string" - } - rules { - family_name: "family2" - column_qualifier: "colid2" - increment_amount: 400 - } - )"""; - - std::string const response_text = R"""( - row { - key: "response-row-key" - families { - name: "response-family1" - columns { - qualifier: "response-colid1" - cells { - value: "1200" - } - } - } - families { - name: "response-family2" - columns { - qualifier: "response-colid2" - cells { - value: "value_string" - } - } - } - } - )"""; - - auto mock_read_modify_write_row = CreateRules(request_text, response_text); - - EXPECT_CALL(*client_, ReadModifyWriteRow) - .WillOnce(mock_read_modify_write_row); - - auto row = table_.ReadModifyWriteRow( - row_key, - bigtable::ReadModifyWriteRule::IncrementAmount(family1, column_id1, 1000), - bigtable::ReadModifyWriteRule::AppendValue(family1, column_id2, - "value_string"), - bigtable::ReadModifyWriteRule::IncrementAmount(family2, column_id2, 400)); - - ASSERT_STATUS_OK(row); - EXPECT_EQ("response-row-key", row->row_key()); - EXPECT_EQ("response-family1", row->cells().at(0).family_name()); - EXPECT_EQ("response-colid1", row->cells().at(0).column_qualifier()); - EXPECT_EQ(2, (int)row->cells().size()); - EXPECT_EQ("1200", row->cells().at(0).value()); - - EXPECT_EQ("response-family2", row->cells().at(1).family_name()); - EXPECT_EQ("response-colid2", row->cells().at(1).column_qualifier()); - EXPECT_EQ("value_string", row->cells().at(1).value()); -} - -TEST_F(TableReadModifyWriteTest, UnrecoverableFailureTest) { - std::string const row_key = "row-key"; - std::string const family1 = "family1"; - std::string const column_id1 = "colid1"; - - EXPECT_CALL(*client_, ReadModifyWriteRow) - .WillRepeatedly( - [](grpc::ClientContext* context, - google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::bigtable::v2::ReadModifyWriteRowResponse*) { - ::google::cloud::testing_util::ValidateMetadataFixture fixture; - fixture.IsContextMDValid( - *context, "google.bigtable.v2.Bigtable.ReadModifyWriteRow", - request, google::cloud::internal::HandCraftedLibClientHeader()); - return grpc::Status(grpc::StatusCode::PERMISSION_DENIED, "uh oh"); - }); - - EXPECT_FALSE(table_.ReadModifyWriteRow( - row_key, - bigtable::ReadModifyWriteRule::AppendValue(family1, column_id1, "value1"), - bigtable::ReadModifyWriteRule::AppendValue(family1, column_id1, - "-value2"))); -} - -} // anonymous namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/table_readrow_test.cc b/google/cloud/bigtable/table_readrow_test.cc deleted file mode 100644 index f9478e030f833..0000000000000 --- a/google/cloud/bigtable/table_readrow_test.cc +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/table.h" -#include "google/cloud/bigtable/testing/mock_read_rows_reader.h" -#include "google/cloud/bigtable/testing/table_test_fixture.h" -#include "google/cloud/testing_util/status_matchers.h" - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace btproto = ::google::bigtable::v2; -using ::google::cloud::bigtable::testing::MockReadRowsReader; -using ::google::cloud::testing_util::ValidateMetadataFixture; -using ::testing::Return; - -class TableReadRowTest : public bigtable::testing::TableTestFixture { - protected: - TableReadRowTest() : TableTestFixture(CompletionQueue{}) {} - - void IsContextMDValid(grpc::ClientContext& context, std::string const& method, - google::protobuf::Message const& request) { - return validate_metadata_fixture_.IsContextMDValid( - context, method, request, - google::cloud::internal::HandCraftedLibClientHeader()); - } - - private: - ValidateMetadataFixture validate_metadata_fixture_; -}; - -TEST_F(TableReadRowTest, ReadRowSimple) { - auto const response = bigtable::testing::ReadRowsResponseFromString(R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "col" } - timestamp_micros: 42000 - value: "value" - commit_row: true - } -)"); - - EXPECT_CALL(*client_, ReadRows) - .WillOnce([&response, this](grpc::ClientContext* context, - btproto::ReadRowsRequest const& req) { - auto stream = std::make_unique( - "google.bigtable.v2.Bigtable.ReadRows"); - EXPECT_CALL(*stream, Read) - .WillOnce([response](btproto::ReadRowsResponse* r) { - *r = response; - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish).WillOnce(Return(grpc::Status::OK)); - - IsContextMDValid(*context, "google.bigtable.v2.Bigtable.ReadRows", req); - EXPECT_EQ(1, req.rows().row_keys_size()); - EXPECT_EQ("r1", req.rows().row_keys(0)); - EXPECT_EQ(1, req.rows_limit()); - EXPECT_EQ(table_.table_name(), req.table_name()); - return stream; - }); - - auto result = table_.ReadRow("r1", bigtable::Filter::PassAllFilter()); - ASSERT_STATUS_OK(result); - EXPECT_TRUE(std::get<0>(*result)); - auto row = std::get<1>(*result); - EXPECT_EQ("r1", row.row_key()); -} - -TEST_F(TableReadRowTest, ReadRowMissing) { - EXPECT_CALL(*client_, ReadRows) - .WillOnce([this](grpc::ClientContext* context, - btproto::ReadRowsRequest const& req) { - auto stream = std::make_unique( - "google.bigtable.v2.Bigtable.ReadRows"); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish).WillOnce(Return(grpc::Status::OK)); - - IsContextMDValid(*context, "google.bigtable.v2.Bigtable.ReadRows", req); - EXPECT_EQ(1, req.rows().row_keys_size()); - EXPECT_EQ("r1", req.rows().row_keys(0)); - EXPECT_EQ(1, req.rows_limit()); - EXPECT_EQ(table_.table_name(), req.table_name()); - return stream; - }); - - auto result = table_.ReadRow("r1", bigtable::Filter::PassAllFilter()); - ASSERT_STATUS_OK(result); - EXPECT_FALSE(std::get<0>(*result)); -} - -TEST_F(TableReadRowTest, UnrecoverableFailure) { - EXPECT_CALL(*client_, ReadRows) - .WillRepeatedly([this](grpc::ClientContext* context, - btproto::ReadRowsRequest const& request) { - auto stream = std::make_unique( - "google.bigtable.v2.Bigtable.ReadRows"); - EXPECT_CALL(*stream, Read).WillRepeatedly(Return(false)); - EXPECT_CALL(*stream, Finish) - .WillRepeatedly(Return( - grpc::Status(grpc::StatusCode::PERMISSION_DENIED, "uh oh"))); - - IsContextMDValid(*context, "google.bigtable.v2.Bigtable.ReadRows", - request); - return stream; - }); - - auto row = table_.ReadRow("r1", bigtable::Filter::PassAllFilter()); - EXPECT_FALSE(row); -} - -} // anonymous namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/table_readrows_test.cc b/google/cloud/bigtable/table_readrows_test.cc deleted file mode 100644 index 1b9427d47c303..0000000000000 --- a/google/cloud/bigtable/table_readrows_test.cc +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/table.h" -#include "google/cloud/bigtable/testing/mock_read_rows_reader.h" -#include "google/cloud/bigtable/testing/table_test_fixture.h" -#include "google/cloud/testing_util/status_matchers.h" - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -using ::google::cloud::bigtable::testing::MockReadRowsReader; -using ::testing::DoAll; -using ::testing::Return; -using ::testing::SetArgPointee; -using ::testing::WithoutArgs; - -class TableReadRowsTest : public bigtable::testing::TableTestFixture { - public: - TableReadRowsTest() : TableTestFixture(CompletionQueue{}) {} -}; - -TEST_F(TableReadRowsTest, ReadRowsCanReadOneRow) { - auto response = bigtable::testing::ReadRowsResponseFromString(R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "qual" } - timestamp_micros: 42000 - value: "value" - commit_row: true - } - )"); - - // must be a new pointer, it is wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - EXPECT_CALL(*stream, Read) - .WillOnce(DoAll(SetArgPointee<0>(response), Return(true))) - .WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()).WillOnce(Return(grpc::Status::OK)); - EXPECT_CALL(*client_, ReadRows).WillOnce(stream->MakeMockReturner()); - - auto reader = - table_.ReadRows(bigtable::RowSet(), bigtable::Filter::PassAllFilter()); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(TableReadRowsTest, ReadRowsCanReadWithRetries) { - auto response = bigtable::testing::ReadRowsResponseFromString(R"( - chunks { - row_key: "r1" - family_name { value: "fam" } - qualifier { value: "qual" } - timestamp_micros: 42000 - value: "value" - commit_row: true - } - )"); - - auto response_retry = bigtable::testing::ReadRowsResponseFromString(R"( - chunks { - row_key: "r2" - family_name { value: "fam" } - qualifier { value: "qual" } - timestamp_micros: 42000 - value: "value" - commit_row: true - } - )"); - - // must be a new pointer, it is wrapped in unique_ptr by ReadRows - auto* stream = new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - auto* stream_retry = - new MockReadRowsReader("google.bigtable.v2.Bigtable.ReadRows"); - - EXPECT_CALL(*client_, ReadRows) - .WillOnce(stream->MakeMockReturner()) - .WillOnce(stream_retry->MakeMockReturner()); - - EXPECT_CALL(*stream, Read) - .WillOnce(DoAll(SetArgPointee<0>(response), Return(true))) - .WillOnce(Return(false)); - - EXPECT_CALL(*stream, Finish()) - .WillOnce( - Return(grpc::Status(grpc::StatusCode::UNAVAILABLE, "try-again"))); - - EXPECT_CALL(*stream_retry, Read) - .WillOnce(DoAll(SetArgPointee<0>(response_retry), Return(true))) - .WillOnce(Return(false)); - - EXPECT_CALL(*stream_retry, Finish()).WillOnce(Return(grpc::Status::OK)); - - auto reader = - table_.ReadRows(bigtable::RowSet(), bigtable::Filter::PassAllFilter()); - - auto it = reader.begin(); - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r1"); - ++it; - EXPECT_NE(it, reader.end()); - ASSERT_STATUS_OK(*it); - EXPECT_EQ((*it)->row_key(), "r2"); - EXPECT_EQ(++it, reader.end()); -} - -TEST_F(TableReadRowsTest, ReadRowsThrowsWhenTooManyErrors) { - EXPECT_CALL(*client_, ReadRows).WillRepeatedly(WithoutArgs([] { - auto stream = std::make_unique( - "google.bigtable.v2.Bigtable.ReadRows"); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish()) - .WillOnce( - Return(grpc::Status(grpc::StatusCode::UNAVAILABLE, "broken"))); - return stream; - })); - - auto table = bigtable::Table( - client_, "table_id", bigtable::LimitedErrorCountRetryPolicy(3), - bigtable::ExponentialBackoffPolicy(std::chrono::seconds(0), - std::chrono::seconds(0)), - bigtable::SafeIdempotentMutationPolicy()); - auto reader = - table.ReadRows(bigtable::RowSet(), bigtable::Filter::PassAllFilter()); - - auto it = reader.begin(); - ASSERT_NE(reader.end(), it); - ASSERT_FALSE(*it); - ++it; - ASSERT_EQ(reader.end(), it); -} - -} // anonymous namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/table_sample_row_keys_test.cc b/google/cloud/bigtable/table_sample_row_keys_test.cc deleted file mode 100644 index 77cb019d3ee2f..0000000000000 --- a/google/cloud/bigtable/table_sample_row_keys_test.cc +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/table.h" -#include "google/cloud/bigtable/testing/mock_sample_row_keys_reader.h" -#include "google/cloud/bigtable/testing/table_test_fixture.h" -#include "google/cloud/testing_util/chrono_literals.h" -#include "google/cloud/testing_util/status_matchers.h" -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -using ::google::cloud::testing_util::chrono_literals::operator""_us; -using ::google::cloud::bigtable::testing::MockSampleRowKeysReader; -using ::testing::Return; -using ::testing::Unused; - -class TableSampleRowKeysTest - : public ::google::cloud::bigtable::testing::TableTestFixture { - public: - TableSampleRowKeysTest() : TableTestFixture(CompletionQueue{}) {} -}; - -/// @test Verify that Table::SampleRows() works. -TEST_F(TableSampleRowKeysTest, SampleRowKeysTest) { - namespace btproto = ::google::bigtable::v2; - - EXPECT_CALL(*client_, SampleRowKeys).WillOnce([](Unused, Unused) { - auto reader = std::make_unique( - "google.bigtable.v2.Bigtable.SampleRowKeys"); - EXPECT_CALL(*reader, Read) - .WillOnce([](btproto::SampleRowKeysResponse* r) { - { - r->set_row_key("test1"); - r->set_offset_bytes(11); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*reader, Finish).WillOnce(Return(grpc::Status::OK)); - return reader; - }); - auto result = table_.SampleRows(); - ASSERT_STATUS_OK(result); - auto it = result->begin(); - EXPECT_NE(it, result->end()); - EXPECT_EQ(it->row_key, "test1"); - EXPECT_EQ(it->offset_bytes, 11); - EXPECT_EQ(++it, result->end()); -} - -/// @test Verify that Table::SampleRows() retries when unavailable. -TEST_F(TableSampleRowKeysTest, SampleRowKeysRetryTest) { - namespace btproto = ::google::bigtable::v2; - - EXPECT_CALL(*client_, SampleRowKeys) - .WillOnce([](Unused, Unused) { - auto reader = std::make_unique( - "google.bigtable.v2.Bigtable.SampleRowKeys"); - EXPECT_CALL(*reader, Read) - .WillOnce([](btproto::SampleRowKeysResponse* r) { - { - r->set_row_key("test1"); - r->set_offset_bytes(11); - } - return true; - }) - .WillOnce(Return(false)); - - EXPECT_CALL(*reader, Finish()) - .WillOnce(Return( - grpc::Status(grpc::StatusCode::UNAVAILABLE, "try-again"))); - return reader; - }) - .WillOnce([](Unused, Unused) { - auto reader_retry = std::make_unique( - "google.bigtable.v2.Bigtable.SampleRowKeys"); - EXPECT_CALL(*reader_retry, Read) - .WillOnce([](btproto::SampleRowKeysResponse* r) { - { - r->set_row_key("test2"); - r->set_offset_bytes(123); - } - return true; - }) - .WillOnce([](btproto::SampleRowKeysResponse* r) { - { - r->set_row_key("test3"); - r->set_offset_bytes(1234); - } - return true; - }) - .WillOnce(Return(false)); - - EXPECT_CALL(*reader_retry, Finish()).WillOnce(Return(grpc::Status::OK)); - return reader_retry; - }); - - auto results = table_.SampleRows(); - ASSERT_STATUS_OK(results); - - auto it = results->begin(); - EXPECT_NE(it, results->end()); - EXPECT_EQ("test2", it->row_key); - ++it; - EXPECT_NE(it, results->end()); - EXPECT_EQ("test3", it->row_key); - EXPECT_EQ(++it, results->end()); -} - -#if GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS -/// @test Verify that Table::SampleRows() reports correctly on too many errors. -TEST_F(TableSampleRowKeysTest, TooManyFailures) { - namespace btproto = ::google::bigtable::v2; - - // Create a table with specific policies so we can test the behavior - // without having to depend on timers expiring. In this case tolerate only - // 3 failures. - Table custom_table( - client_, "foo_table", - // Configure the Table to stop at 3 failures. - LimitedErrorCountRetryPolicy(2), - // Use much shorter backoff than the default to test faster. - ExponentialBackoffPolicy(10_us, 40_us), SafeIdempotentMutationPolicy()); - - // Setup the mocks to fail more than 3 times. - auto create_cancelled_stream = [](Unused, Unused) { - auto stream = std::make_unique( - "google.bigtable.v2.Bigtable.SampleRowKeys"); - EXPECT_CALL(*stream, Read).WillOnce(Return(false)); - EXPECT_CALL(*stream, Finish) - .WillOnce(Return(grpc::Status(grpc::StatusCode::ABORTED, ""))); - return stream; - }; - - EXPECT_CALL(*client_, SampleRowKeys) - .WillOnce([](Unused, Unused) { - auto r1 = std::make_unique( - "google.bigtable.v2.Bigtable.SampleRowKeys"); - EXPECT_CALL(*r1, Read) - .WillOnce([](btproto::SampleRowKeysResponse* r) { - { - r->set_row_key("test1"); - r->set_offset_bytes(11); - } - return true; - }) - .WillOnce(Return(false)); - EXPECT_CALL(*r1, Finish) - .WillOnce(Return(grpc::Status(grpc::StatusCode::ABORTED, ""))); - return r1; - }) - .WillOnce(create_cancelled_stream) - .WillOnce(create_cancelled_stream); - - EXPECT_FALSE(custom_table.SampleRows()); -} -#endif // GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/table_test.cc b/google/cloud/bigtable/table_test.cc index 70c578b16fbdf..965e239e4481b 100644 --- a/google/cloud/bigtable/table_test.cc +++ b/google/cloud/bigtable/table_test.cc @@ -178,6 +178,55 @@ TEST(TableTest, AppProfileId) { EXPECT_EQ(kAppProfileId, table.app_profile_id()); } +TEST(TableTest, WithNewTarget) { + auto conn = std::make_shared(); + Table table(conn, TableResource(kProjectId, kInstanceId, kTableId), + Options{}.set(kAppProfileId)); + EXPECT_EQ(table.project_id(), kProjectId); + EXPECT_EQ(table.instance_id(), kInstanceId); + EXPECT_EQ(table.table_id(), kTableId); + EXPECT_EQ(table.table_name(), kTableName); + EXPECT_EQ(table.app_profile_id(), kAppProfileId); + + std::string const other_project_id = "other-project"; + std::string const other_instance_id = "other-instance"; + std::string const other_table_id = "other-table"; + auto other_table = + table.WithNewTarget(other_project_id, other_instance_id, other_table_id); + + EXPECT_EQ(other_table.project_id(), other_project_id); + EXPECT_EQ(other_table.instance_id(), other_instance_id); + EXPECT_EQ(other_table.table_id(), other_table_id); + EXPECT_EQ(other_table.table_name(), + TableName(other_project_id, other_instance_id, other_table_id)); + EXPECT_EQ(other_table.app_profile_id(), kAppProfileId); +} + +TEST(TableTest, WithNewTargetProfile) { + auto conn = std::make_shared(); + Table table(conn, TableResource(kProjectId, kInstanceId, kTableId), + Options{}.set(kAppProfileId)); + EXPECT_EQ(table.project_id(), kProjectId); + EXPECT_EQ(table.instance_id(), kInstanceId); + EXPECT_EQ(table.table_id(), kTableId); + EXPECT_EQ(table.table_name(), kTableName); + EXPECT_EQ(table.app_profile_id(), kAppProfileId); + + std::string const other_project_id = "other-project"; + std::string const other_instance_id = "other-instance"; + std::string const other_table_id = "other-table"; + std::string const other_profile_id = "other-profile"; + auto other_table = table.WithNewTarget(other_project_id, other_instance_id, + other_profile_id, other_table_id); + + EXPECT_EQ(other_table.project_id(), other_project_id); + EXPECT_EQ(other_table.instance_id(), other_instance_id); + EXPECT_EQ(other_table.table_id(), other_table_id); + EXPECT_EQ(other_table.table_name(), + TableName(other_project_id, other_instance_id, other_table_id)); + EXPECT_EQ(other_table.app_profile_id(), other_profile_id); +} + TEST(TableTest, Apply) { auto mock = std::make_shared(); EXPECT_CALL(*mock, Apply) diff --git a/google/cloud/bigtable/test_proxy/BUILD.bazel b/google/cloud/bigtable/test_proxy/BUILD.bazel index c3b6490e7da97..a2edf7ee5f91c 100644 --- a/google/cloud/bigtable/test_proxy/BUILD.bazel +++ b/google/cloud/bigtable/test_proxy/BUILD.bazel @@ -24,7 +24,7 @@ cc_library( hdrs = ["cbt_test_proxy.h"], deps = [ "//:bigtable", - "//protos:system_includes", + # "//protos:system_includes", "//protos/google/cloud/bigtable/test_proxy:test_proxy_cc_grpc", "//protos/google/cloud/bigtable/test_proxy:test_proxy_cc_proto", ], diff --git a/google/cloud/bigtable/test_proxy/cbt_test_proxy.cc b/google/cloud/bigtable/test_proxy/cbt_test_proxy.cc index 0a390eaee1528..63bf68e1c45c4 100644 --- a/google/cloud/bigtable/test_proxy/cbt_test_proxy.cc +++ b/google/cloud/bigtable/test_proxy/cbt_test_proxy.cc @@ -12,16 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "google/cloud/internal/disable_deprecation_warnings.inc" #include "google/cloud/bigtable/test_proxy/cbt_test_proxy.h" #include "google/cloud/bigtable/cell.h" #include "google/cloud/bigtable/client.h" #include "google/cloud/bigtable/idempotent_mutation_policy.h" #include "google/cloud/bigtable/mutations.h" #include "google/cloud/bigtable/table.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/log.h" #include "google/cloud/status.h" +#include "absl/strings/str_cat.h" #include "absl/time/time.h" #include #include @@ -455,3 +456,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/bigtable/test_proxy/cbt_test_proxy.h b/google/cloud/bigtable/test_proxy/cbt_test_proxy.h index 31295b29fdf52..6d3bc39fed60f 100644 --- a/google/cloud/bigtable/test_proxy/cbt_test_proxy.h +++ b/google/cloud/bigtable/test_proxy/cbt_test_proxy.h @@ -17,8 +17,9 @@ #include "google/cloud/bigtable/data_connection.h" #include "google/cloud/bigtable/table.h" +#include "google/cloud/grpc_options.h" #include "google/cloud/version.h" -#include +#include "protos/google/cloud/bigtable/test_proxy/test_proxy.grpc.pb.h" #include #include #include diff --git a/google/cloud/bigtable/test_proxy/cbt_test_proxy_main.cc b/google/cloud/bigtable/test_proxy/cbt_test_proxy_main.cc index 9572a8216a91f..e312b59ffff2b 100644 --- a/google/cloud/bigtable/test_proxy/cbt_test_proxy_main.cc +++ b/google/cloud/bigtable/test_proxy/cbt_test_proxy_main.cc @@ -15,8 +15,8 @@ // Runs the CloudBigtableTestProxy as a server. #include "google/cloud/bigtable/test_proxy/cbt_test_proxy.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/log.h" +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/bigtable/testing/embedded_server_test_fixture.cc b/google/cloud/bigtable/testing/embedded_server_test_fixture.cc index 5186db9eabcb1..3d8967ae186e3 100644 --- a/google/cloud/bigtable/testing/embedded_server_test_fixture.cc +++ b/google/cloud/bigtable/testing/embedded_server_test_fixture.cc @@ -13,7 +13,14 @@ // limitations under the License. #include "google/cloud/bigtable/testing/embedded_server_test_fixture.h" +#include "google/cloud/bigtable/internal/bigtable_metadata_decorator.h" +#include "google/cloud/bigtable/internal/bigtable_stub.h" +#include "google/cloud/bigtable/internal/data_connection_impl.h" +#include "google/cloud/bigtable/internal/mutate_rows_limiter.h" +#include "google/cloud/bigtable/options.h" +#include "google/cloud/bigtable/retry_policy.h" #include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/internal/background_threads_impl.h" #include "google/cloud/internal/build_info.h" #include "google/cloud/internal/user_agent_prefix.h" #include @@ -53,9 +60,34 @@ void EmbeddedServerTestFixture::SetUp() { std::shared_ptr data_channel = server_->InProcessChannel(channel_arguments); - data_client_ = std::make_shared(kProjectId, kInstanceId, - std::move(data_channel)); - table_ = std::make_shared(data_client_, kTableId); + std::unique_ptr grpc_stub = + google::bigtable::v2::Bigtable::NewStub(data_channel); + std::shared_ptr stub = + std::make_shared( + std::make_shared( + std::move(grpc_stub)), + std::multimap{}, + google::cloud::internal::UserAgentPrefix()); + auto opts = + Options{} + .set( + google::cloud::bigtable::DataLimitedErrorCountRetryPolicy(7) + .clone()) + .set( + google::cloud::ExponentialBackoffPolicy( + /*initial_delay=*/std::chrono::milliseconds(200), + /*maximum_delay=*/std::chrono::seconds(45), + /*scaling=*/2.0) + .clone()); + data_connection_ = std::make_shared( + std::make_unique< + google::cloud::internal::AutomaticallyCreatedBackgroundThreads>(), + stub, std::make_shared(), + std::move(opts)); + + table_ = std::make_shared( + data_connection_, + bigtable::TableResource(kProjectId, kInstanceId, kTableId)); } void EmbeddedServerTestFixture::TearDown() { diff --git a/google/cloud/bigtable/testing/embedded_server_test_fixture.h b/google/cloud/bigtable/testing/embedded_server_test_fixture.h index 850da273b7991..85908653c1398 100644 --- a/google/cloud/bigtable/testing/embedded_server_test_fixture.h +++ b/google/cloud/bigtable/testing/embedded_server_test_fixture.h @@ -16,9 +16,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TESTING_EMBEDDED_SERVER_TEST_FIXTURE_H #include "google/cloud/bigtable/table.h" -#include "google/cloud/bigtable/table_admin.h" -#include "google/cloud/bigtable/testing/inprocess_data_client.h" -#include +#include "google/bigtable/v2/bigtable.grpc.pb.h" #include #include #include @@ -79,7 +77,7 @@ class EmbeddedServerTestFixture : public ::testing::Test { std::string project_id_ = kProjectId; std::string instance_id_ = kInstanceId; - std::shared_ptr data_client_; + std::shared_ptr data_connection_; std::shared_ptr table_; std::thread wait_thread_; BigtableImpl bigtable_service_; diff --git a/google/cloud/bigtable/testing/inprocess_data_client.cc b/google/cloud/bigtable/testing/inprocess_data_client.cc deleted file mode 100644 index 2b40012ec8ae4..0000000000000 --- a/google/cloud/bigtable/testing/inprocess_data_client.cc +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/testing/inprocess_data_client.h" - -namespace google { -namespace cloud { -namespace bigtable { -namespace testing { - -namespace btproto = ::google::bigtable::v2; - -grpc::Status InProcessDataClient::MutateRow( - grpc::ClientContext* context, btproto::MutateRowRequest const& request, - btproto::MutateRowResponse* response) { - return Stub()->MutateRow(context, request, response); -} - -std::unique_ptr> -InProcessDataClient::AsyncMutateRow( - grpc::ClientContext* context, - google::bigtable::v2::MutateRowRequest const& request, - grpc::CompletionQueue* cq) { - auto result = Stub()->AsyncMutateRow(context, request, cq); - return std::unique_ptr>(result.release()); -} - -grpc::Status InProcessDataClient::CheckAndMutateRow( - grpc::ClientContext* context, - btproto::CheckAndMutateRowRequest const& request, - btproto::CheckAndMutateRowResponse* response) { - return Stub()->CheckAndMutateRow(context, request, response); -} - -std::unique_ptr> -InProcessDataClient::AsyncCheckAndMutateRow( - grpc::ClientContext* context, - google::bigtable::v2::CheckAndMutateRowRequest const& request, - grpc::CompletionQueue* cq) { - auto result = Stub()->AsyncCheckAndMutateRow(context, request, cq); - return std::unique_ptr>(result.release()); -} - -grpc::Status InProcessDataClient::ReadModifyWriteRow( - grpc::ClientContext* context, - btproto::ReadModifyWriteRowRequest const& request, - btproto::ReadModifyWriteRowResponse* response) { - return Stub()->ReadModifyWriteRow(context, request, response); -} - -std::unique_ptr> -InProcessDataClient::AsyncReadModifyWriteRow( - grpc::ClientContext* context, - google::bigtable::v2::ReadModifyWriteRowRequest const& request, - grpc::CompletionQueue* cq) { - auto result = Stub()->AsyncReadModifyWriteRow(context, request, cq); - return std::unique_ptr>(result.release()); -} - -std::unique_ptr> -InProcessDataClient::ReadRows(grpc::ClientContext* context, - btproto::ReadRowsRequest const& request) { - return Stub()->ReadRows(context, request); -} - -std::unique_ptr<::grpc::ClientAsyncReaderInterface> -InProcessDataClient::AsyncReadRows(::grpc::ClientContext* context, - btproto::ReadRowsRequest const& request, - ::grpc::CompletionQueue* cq, void* tag) { - return Stub()->AsyncReadRows(context, request, cq, tag); -} - -std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::ReadRowsResponse>> -InProcessDataClient::PrepareAsyncReadRows( - ::grpc::ClientContext* context, - ::google::bigtable::v2::ReadRowsRequest const& request, - ::grpc::CompletionQueue* cq) { - return Stub()->PrepareAsyncReadRows(context, request, cq); -} - -std::unique_ptr> -InProcessDataClient::SampleRowKeys( - grpc::ClientContext* context, - btproto::SampleRowKeysRequest const& request) { - return Stub()->SampleRowKeys(context, request); -} - -std::unique_ptr> -InProcessDataClient::MutateRows(grpc::ClientContext* context, - btproto::MutateRowsRequest const& request) { - return Stub()->MutateRows(context, request); -} - -std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::MutateRowsResponse>> -InProcessDataClient::AsyncMutateRows( - ::grpc::ClientContext* context, - ::google::bigtable::v2::MutateRowsRequest const& request, - ::grpc::CompletionQueue* cq, void* tag) { - return Stub()->AsyncMutateRows(context, request, cq, tag); -} - -std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::MutateRowsResponse>> -InProcessDataClient::PrepareAsyncMutateRows( - ::grpc::ClientContext* context, - ::google::bigtable::v2::MutateRowsRequest const& request, - ::grpc::CompletionQueue* cq) { - return Stub()->PrepareAsyncMutateRows(context, request, cq); -} - -std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::SampleRowKeysResponse>> -InProcessDataClient::AsyncSampleRowKeys( - ::grpc::ClientContext* context, - ::google::bigtable::v2::SampleRowKeysRequest const& request, - ::grpc::CompletionQueue* cq, void* tag) { - return Stub()->AsyncSampleRowKeys(context, request, cq, tag); -} - -std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::SampleRowKeysResponse>> -InProcessDataClient::PrepareAsyncSampleRowKeys( - ::grpc::ClientContext* context, - ::google::bigtable::v2::SampleRowKeysRequest const& request, - ::grpc::CompletionQueue* cq) { - return Stub()->PrepareAsyncSampleRowKeys(context, request, cq); -} - -} // namespace testing -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/testing/inprocess_data_client.h b/google/cloud/bigtable/testing/inprocess_data_client.h deleted file mode 100644 index fd122d2f96489..0000000000000 --- a/google/cloud/bigtable/testing/inprocess_data_client.h +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_TESTING_INPROCESS_DATA_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TESTING_INPROCESS_DATA_CLIENT_H - -#include "google/cloud/bigtable/data_client.h" -#include -#include -// TODO(#8800) - delete this class when deprecation is complete -#include "google/cloud/internal/disable_deprecation_warnings.inc" - -namespace google { -namespace cloud { -namespace bigtable { -namespace testing { - -/** - * Connect to an embedded Cloud Bigtable server implementing the data - * manipulation APIs. - * - * This class is mainly for testing purpose, it enable use of a single embedded - * server for multiple test cases. This dataclient uses a pre-defined channel. - */ -class InProcessDataClient : public bigtable::DataClient { - public: - InProcessDataClient(std::string project, std::string instance, - std::shared_ptr channel) - : project_(std::move(project)), - instance_(std::move(instance)), - channel_(std::move(channel)) {} - - using BigtableStubPtr = - std::shared_ptr; - - std::string const& project_id() const override { return project_; } - std::string const& instance_id() const override { return instance_; } - std::shared_ptr Channel() override { return channel_; } - void reset() override {} - - std::unique_ptr Stub() { - return google::bigtable::v2::Bigtable::NewStub(Channel()); - } - - ///@{ - /// @name the google.bigtable.v2.Bigtable operations. - grpc::Status MutateRow( - grpc::ClientContext* context, - google::bigtable::v2::MutateRowRequest const& request, - google::bigtable::v2::MutateRowResponse* response) override; - std::unique_ptr> - AsyncMutateRow(grpc::ClientContext* context, - google::bigtable::v2::MutateRowRequest const& request, - grpc::CompletionQueue* cq) override; - grpc::Status CheckAndMutateRow( - grpc::ClientContext* context, - google::bigtable::v2::CheckAndMutateRowRequest const& request, - google::bigtable::v2::CheckAndMutateRowResponse* response) override; - std::unique_ptr> - AsyncCheckAndMutateRow( - grpc::ClientContext* context, - google::bigtable::v2::CheckAndMutateRowRequest const& request, - grpc::CompletionQueue* cq) override; - grpc::Status ReadModifyWriteRow( - grpc::ClientContext* context, - google::bigtable::v2::ReadModifyWriteRowRequest const& request, - google::bigtable::v2::ReadModifyWriteRowResponse* response) override; - std::unique_ptr> - AsyncReadModifyWriteRow( - grpc::ClientContext* context, - google::bigtable::v2::ReadModifyWriteRowRequest const& request, - grpc::CompletionQueue* cq) override; - std::unique_ptr< - grpc::ClientReaderInterface> - ReadRows(grpc::ClientContext* context, - google::bigtable::v2::ReadRowsRequest const& request) override; - std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::ReadRowsResponse>> - AsyncReadRows(::grpc::ClientContext* context, - ::google::bigtable::v2::ReadRowsRequest const& request, - ::grpc::CompletionQueue* cq, void* tag) override; - std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::ReadRowsResponse>> - PrepareAsyncReadRows(::grpc::ClientContext* context, - ::google::bigtable::v2::ReadRowsRequest const& request, - ::grpc::CompletionQueue* cq) override; - std::unique_ptr< - grpc::ClientReaderInterface> - SampleRowKeys( - grpc::ClientContext* context, - google::bigtable::v2::SampleRowKeysRequest const& request) override; - std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::SampleRowKeysResponse>> - AsyncSampleRowKeys( - ::grpc::ClientContext* context, - ::google::bigtable::v2::SampleRowKeysRequest const& request, - ::grpc::CompletionQueue* cq, void* tag) override; - std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::SampleRowKeysResponse>> - PrepareAsyncSampleRowKeys( - ::grpc::ClientContext* context, - ::google::bigtable::v2::SampleRowKeysRequest const& request, - ::grpc::CompletionQueue* cq) override; - std::unique_ptr< - grpc::ClientReaderInterface> - MutateRows(grpc::ClientContext* context, - google::bigtable::v2::MutateRowsRequest const& request) override; - - std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::MutateRowsResponse>> - AsyncMutateRows(::grpc::ClientContext* context, - ::google::bigtable::v2::MutateRowsRequest const& request, - ::grpc::CompletionQueue* cq, void* tag) override; - - std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::MutateRowsResponse>> - PrepareAsyncMutateRows( - ::grpc::ClientContext* context, - ::google::bigtable::v2::MutateRowsRequest const& request, - ::grpc::CompletionQueue* cq) override; - ///@} - - private: - google::cloud::BackgroundThreadsFactory BackgroundThreadsFactory() override { - return google::cloud::internal::MakeBackgroundThreadsFactory(); - } - - std::string project_; - std::string instance_; - std::shared_ptr channel_; -}; - -} // namespace testing -} // namespace bigtable -} // namespace cloud -} // namespace google - -// TODO(#8800) - delete this class when deprecation is complete -#include "google/cloud/internal/diagnostics_pop.inc" - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TESTING_INPROCESS_DATA_CLIENT_H 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/mock_data_client.h b/google/cloud/bigtable/testing/mock_data_client.h deleted file mode 100644 index 0a53659246428..0000000000000 --- a/google/cloud/bigtable/testing/mock_data_client.h +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_TESTING_MOCK_DATA_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TESTING_MOCK_DATA_CLIENT_H - -#include "google/cloud/bigtable/table.h" -#include -#include -// TODO(#8800) - delete this class when deprecation is complete -#include "google/cloud/internal/disable_deprecation_warnings.inc" - -namespace google { -namespace cloud { -namespace bigtable { -namespace testing { - -class MockDataClient : public bigtable::DataClient { - public: - MockDataClient() = default; - - explicit MockDataClient(Options options) : options_(std::move(options)) {} - - /// @deprecated use constructor that takes `google::cloud::Options` - explicit MockDataClient(ClientOptions options) - : options_(internal::MakeOptions(std::move(options))) {} - - MOCK_METHOD(std::string const&, project_id, (), (const, override)); - MOCK_METHOD(std::string const&, instance_id, (), (const, override)); - MOCK_METHOD(std::shared_ptr, Channel, (), (override)); - MOCK_METHOD(void, reset, (), (override)); - - MOCK_METHOD(grpc::Status, MutateRow, - (grpc::ClientContext*, - google::bigtable::v2::MutateRowRequest const&, - google::bigtable::v2::MutateRowResponse*), - (override)); - MOCK_METHOD(std::unique_ptr>, - AsyncMutateRow, - (grpc::ClientContext*, - google::bigtable::v2::MutateRowRequest const&, - grpc::CompletionQueue*), - (override)); - MOCK_METHOD(grpc::Status, CheckAndMutateRow, - (grpc::ClientContext*, - google::bigtable::v2::CheckAndMutateRowRequest const&, - google::bigtable::v2::CheckAndMutateRowResponse*), - (override)); - MOCK_METHOD(std::unique_ptr>, - AsyncCheckAndMutateRow, - (grpc::ClientContext*, - google::bigtable::v2::CheckAndMutateRowRequest const&, - grpc::CompletionQueue*), - (override)); - MOCK_METHOD(grpc::Status, ReadModifyWriteRow, - (grpc::ClientContext*, - google::bigtable::v2::ReadModifyWriteRowRequest const&, - google::bigtable::v2::ReadModifyWriteRowResponse*), - (override)); - MOCK_METHOD(std::unique_ptr>, - AsyncReadModifyWriteRow, - (grpc::ClientContext*, - google::bigtable::v2::ReadModifyWriteRowRequest const&, - grpc::CompletionQueue*), - (override)); - MOCK_METHOD( - std::unique_ptr< - grpc::ClientReaderInterface>, - ReadRows, - (grpc::ClientContext*, google::bigtable::v2::ReadRowsRequest const&), - (override)); - MOCK_METHOD(std::unique_ptr>, - AsyncReadRows, - (grpc::ClientContext*, - google::bigtable::v2::ReadRowsRequest const&, - grpc::CompletionQueue*, void*), - (override)); - MOCK_METHOD(std::unique_ptr<::grpc::ClientAsyncReaderInterface< - ::google::bigtable::v2::ReadRowsResponse>>, - PrepareAsyncReadRows, - (::grpc::ClientContext*, - ::google::bigtable::v2::ReadRowsRequest const&, - ::grpc::CompletionQueue*), - (override)); - MOCK_METHOD(std::unique_ptr>, - SampleRowKeys, - (grpc::ClientContext*, - google::bigtable::v2::SampleRowKeysRequest const&), - (override)); - MOCK_METHOD(std::unique_ptr>, - AsyncSampleRowKeys, - (grpc::ClientContext*, - google::bigtable::v2::SampleRowKeysRequest const&, - grpc::CompletionQueue*, void*), - (override)); - MOCK_METHOD(std::unique_ptr>, - PrepareAsyncSampleRowKeys, - (grpc::ClientContext*, - google::bigtable::v2::SampleRowKeysRequest const&, - grpc::CompletionQueue*), - (override)); - MOCK_METHOD(std::unique_ptr>, - MutateRows, - (grpc::ClientContext*, - google::bigtable::v2::MutateRowsRequest const&), - (override)); - MOCK_METHOD(std::unique_ptr>, - AsyncMutateRows, - (grpc::ClientContext*, - google::bigtable::v2::MutateRowsRequest const&, - grpc::CompletionQueue*, void*), - (override)); - MOCK_METHOD(std::unique_ptr>, - PrepareAsyncMutateRows, - (grpc::ClientContext*, - google::bigtable::v2::MutateRowsRequest const&, - grpc::CompletionQueue*), - (override)); - - private: - google::cloud::BackgroundThreadsFactory BackgroundThreadsFactory() override { - return google::cloud::internal::MakeBackgroundThreadsFactory(options_); - } - - Options options_; -}; - -} // namespace testing -} // namespace bigtable -} // namespace cloud -} // namespace google - -// TODO(#8800) - delete this class when deprecation is complete -#include "google/cloud/internal/diagnostics_pop.inc" - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TESTING_MOCK_DATA_CLIENT_H diff --git a/google/cloud/bigtable/testing/mock_mutate_rows_limiter.h b/google/cloud/bigtable/testing/mock_mutate_rows_limiter.h index c074cf3699cc5..b24c91c381b6d 100644 --- a/google/cloud/bigtable/testing/mock_mutate_rows_limiter.h +++ b/google/cloud/bigtable/testing/mock_mutate_rows_limiter.h @@ -16,7 +16,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TESTING_MOCK_MUTATE_ROWS_LIMITER_H #include "google/cloud/bigtable/internal/mutate_rows_limiter.h" -#include +#include "google/bigtable/v2/bigtable.pb.h" #include namespace google { diff --git a/google/cloud/bigtable/testing/mock_mutate_rows_reader.h b/google/cloud/bigtable/testing/mock_mutate_rows_reader.h index f91b3cbe807c0..d48201616b17e 100644 --- a/google/cloud/bigtable/testing/mock_mutate_rows_reader.h +++ b/google/cloud/bigtable/testing/mock_mutate_rows_reader.h @@ -17,7 +17,7 @@ #include "google/cloud/bigtable/testing/mock_response_reader.h" #include "google/cloud/testing_util/mock_async_response_reader.h" -#include +#include "google/bigtable/v2/bigtable.pb.h" #include namespace google { diff --git a/google/cloud/bigtable/testing/mock_read_rows_reader.h b/google/cloud/bigtable/testing/mock_read_rows_reader.h index 3915ceb5abe0d..b97d258cc79ac 100644 --- a/google/cloud/bigtable/testing/mock_read_rows_reader.h +++ b/google/cloud/bigtable/testing/mock_read_rows_reader.h @@ -17,7 +17,7 @@ #include "google/cloud/bigtable/testing/mock_response_reader.h" #include "google/cloud/testing_util/mock_async_response_reader.h" -#include +#include "google/bigtable/v2/bigtable.grpc.pb.h" #include namespace google { diff --git a/google/cloud/bigtable/testing/mock_sample_row_keys_reader.h b/google/cloud/bigtable/testing/mock_sample_row_keys_reader.h index 334579441d58e..0488a48ced270 100644 --- a/google/cloud/bigtable/testing/mock_sample_row_keys_reader.h +++ b/google/cloud/bigtable/testing/mock_sample_row_keys_reader.h @@ -16,7 +16,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TESTING_MOCK_SAMPLE_ROW_KEYS_READER_H #include "google/cloud/bigtable/testing/mock_response_reader.h" -#include +#include "google/bigtable/v2/bigtable.grpc.pb.h" #include namespace google { diff --git a/google/cloud/bigtable/testing/table_integration_test.cc b/google/cloud/bigtable/testing/table_integration_test.cc index d9f8156437f7b..d70d1346d0997 100644 --- a/google/cloud/bigtable/testing/table_integration_test.cc +++ b/google/cloud/bigtable/testing/table_integration_test.cc @@ -122,9 +122,13 @@ void TableAdminTestEnvironment::TearDown() { } void TableIntegrationTest::SetUp() { - data_connection_ = MakeDataConnection(); - data_client_ = bigtable::MakeDataClient(TableTestEnvironment::project_id(), - TableTestEnvironment::instance_id()); + 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. @@ -164,15 +168,11 @@ void TableIntegrationTest::SetUp() { } } -bigtable::Table TableIntegrationTest::GetTable( - std::string const& implementation) { - if (implementation == "with-data-connection") { - return Table(data_connection_, - TableResource(TableTestEnvironment::project_id(), - TableTestEnvironment::instance_id(), - TableTestEnvironment::table_id())); - } - return bigtable::Table(data_client_, TableTestEnvironment::table_id()); +bigtable::Table TableIntegrationTest::GetTable() { + return Table(data_connection_, + TableResource(TableTestEnvironment::project_id(), + TableTestEnvironment::instance_id(), + TableTestEnvironment::table_id())); } std::vector TableIntegrationTest::ReadRows( @@ -188,12 +188,6 @@ std::vector TableIntegrationTest::ReadRows( return result; } -std::vector TableIntegrationTest::ReadRows( - std::string const& table_name, bigtable::Filter filter) { - bigtable::Table table(data_client_, table_name); - return ReadRows(table, std::move(filter)); -} - std::vector TableIntegrationTest::ReadRows( bigtable::Table& table, std::int64_t rows_limit, bigtable::Filter filter) { auto reader = diff --git a/google/cloud/bigtable/testing/table_integration_test.h b/google/cloud/bigtable/testing/table_integration_test.h index 8c360b5374db1..ad2b076ad864c 100644 --- a/google/cloud/bigtable/testing/table_integration_test.h +++ b/google/cloud/bigtable/testing/table_integration_test.h @@ -17,7 +17,6 @@ #include "google/cloud/bigtable/admin/bigtable_table_admin_client.h" #include "google/cloud/bigtable/cell.h" -#include "google/cloud/bigtable/data_client.h" #include "google/cloud/bigtable/table.h" #include "google/cloud/internal/random.h" #include "google/cloud/testing_util/integration_test.h" @@ -94,19 +93,12 @@ class TableIntegrationTest : public ::google::cloud::testing_util::IntegrationTest { protected: void SetUp() override; - - /// Gets a Table object for the current test. - bigtable::Table GetTable( - std::string const& implementation = "with-data-client"); + bigtable::Table GetTable(); /// Return all the cells in @p table that pass @p filter. static std::vector ReadRows(bigtable::Table& table, bigtable::Filter filter); - /// Return all the cells in @p table that pass @p filter. - std::vector ReadRows(std::string const& table_name, - bigtable::Filter filter); - static std::vector ReadRows(bigtable::Table& table, std::int64_t rows_limit, bigtable::Filter filter); @@ -170,6 +162,16 @@ class TableIntegrationTest return names; } + static StatusOr> TableNames( + StreamRange& tables) { + std::vector names; + for (auto const& table : tables) { + if (!table) return table.status(); + names.push_back(table->name()); + } + return names; + } + static std::vector BackupNames( std::vector const& backups) { std::vector names(backups.size()); @@ -179,7 +181,6 @@ class TableIntegrationTest return names; } - std::shared_ptr data_client_; std::shared_ptr data_connection_; }; diff --git a/google/cloud/bigtable/testing/table_test_fixture.cc b/google/cloud/bigtable/testing/table_test_fixture.cc deleted file mode 100644 index 9491d9409b998..0000000000000 --- a/google/cloud/bigtable/testing/table_test_fixture.cc +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/testing/table_test_fixture.h" -#include "google/cloud/internal/background_threads_impl.h" -#include "google/cloud/internal/throw_delegate.h" -#include - -namespace google { -namespace cloud { -namespace bigtable { -namespace testing { - -char const TableTestFixture::kProjectId[] = "foo-project"; -char const TableTestFixture::kInstanceId[] = "bar-instance"; -char const TableTestFixture::kTableId[] = "baz-table"; - -// These are hardcoded, and not computed, because we want to test the -// computation. -char const TableTestFixture::kInstanceName[] = - "projects/foo-project/instances/bar-instance"; -char const TableTestFixture::kTableName[] = - "projects/foo-project/instances/bar-instance/tables/baz-table"; - -google::bigtable::v2::ReadRowsResponse ReadRowsResponseFromString( - std::string const& repr) { - google::bigtable::v2::ReadRowsResponse response; - if (!google::protobuf::TextFormat::ParseFromString(repr, &response)) { - google::cloud::internal::ThrowRuntimeError("Failed to parse " + repr); - } - return response; -} - -std::shared_ptr TableTestFixture::SetupMockClient() { - auto client = std::make_shared( - Options{}.set(cq_)); - EXPECT_CALL(*client, project_id()) - .WillRepeatedly(::testing::ReturnRef(project_id_)); - EXPECT_CALL(*client, instance_id()) - .WillRepeatedly(::testing::ReturnRef(instance_id_)); - return client; -} - -TableTestFixture::TableTestFixture(CompletionQueue const& cq) - : cq_impl_(std::dynamic_pointer_cast< - ::google::cloud::testing_util::FakeCompletionQueueImpl>( - google::cloud::internal::GetCompletionQueueImpl(cq))), - cq_(cq), - client_(SetupMockClient()) {} - -} // namespace testing -} // namespace bigtable -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/testing/table_test_fixture.h b/google/cloud/bigtable/testing/table_test_fixture.h deleted file mode 100644 index 72fd4c5924898..0000000000000 --- a/google/cloud/bigtable/testing/table_test_fixture.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_TESTING_TABLE_TEST_FIXTURE_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TESTING_TABLE_TEST_FIXTURE_H - -#include "google/cloud/bigtable/table.h" -#include "google/cloud/bigtable/testing/mock_data_client.h" -#include "google/cloud/testing_util/fake_completion_queue_impl.h" -#include - -namespace google { -namespace cloud { -namespace bigtable { -namespace testing { - -/// Common fixture for the bigtable::Table tests. -class TableTestFixture : public ::testing::Test { - protected: - explicit TableTestFixture(CompletionQueue const& cq); - std::shared_ptr SetupMockClient(); - - static char const kProjectId[]; - static char const kInstanceId[]; - static char const kTableId[]; - static char const kInstanceName[]; - static char const kTableName[]; - - std::string project_id_ = kProjectId; - std::string instance_id_ = kInstanceId; - std::shared_ptr<::google::cloud::testing_util::FakeCompletionQueueImpl> - cq_impl_; - CompletionQueue cq_; - std::shared_ptr client_; - bigtable::Table table_ = bigtable::Table(client_, kTableId); -}; - -google::bigtable::v2::ReadRowsResponse ReadRowsResponseFromString( - std::string const& repr); - -} // namespace testing -} // namespace bigtable -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_TESTING_TABLE_TEST_FIXTURE_H diff --git a/google/cloud/bigtable/tests/BUILD.bazel b/google/cloud/bigtable/tests/BUILD.bazel index 72d44baed557d..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", @@ -34,9 +41,9 @@ licenses(["notice"]) # Apache 2.0 "//:grpc_utils", "//google/cloud/bigtable:bigtable_client_testing", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@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/CMakeLists.txt b/google/cloud/bigtable/tests/CMakeLists.txt index 757872b6b1158..ff7c9e9eb8b04 100644 --- a/google/cloud/bigtable/tests/CMakeLists.txt +++ b/google/cloud/bigtable/tests/CMakeLists.txt @@ -18,14 +18,14 @@ # Bigtable emulator. set(bigtable_client_integration_tests # cmake-format: sort - admin_backup_integration_test.cc - admin_iam_policy_integration_test.cc - admin_integration_test.cc data_async_future_integration_test.cc data_integration_test.cc filters_integration_test.cc instance_admin_integration_test.cc mutations_integration_test.cc + table_admin_backup_integration_test.cc + table_admin_iam_policy_integration_test.cc + table_admin_integration_test.cc table_sample_rows_integration_test.cc) include(CreateBazelConfig) @@ -67,7 +67,8 @@ google_cloud_cpp_add_common_options(${target}) # We just know that these tests need to be run against production. set(bigtable_integration_tests_production # cmake-format: sort - admin_backup_integration_test.cc admin_iam_policy_integration_test.cc) + table_admin_backup_integration_test.cc + table_admin_iam_policy_integration_test.cc) foreach (fname ${bigtable_integration_tests_production}) google_cloud_cpp_set_target_name(target "bigtable" "${fname}") diff --git a/google/cloud/bigtable/tests/admin_backup_integration_test.cc b/google/cloud/bigtable/tests/admin_backup_integration_test.cc deleted file mode 100644 index 98e663204ded1..0000000000000 --- a/google/cloud/bigtable/tests/admin_backup_integration_test.cc +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/instance_admin.h" -#include "google/cloud/bigtable/table_admin.h" -#include "google/cloud/bigtable/testing/table_integration_test.h" -#include "google/cloud/internal/getenv.h" -#include "google/cloud/internal/random.h" -#include "google/cloud/internal/time_utils.h" -#include "google/cloud/testing_util/chrono_literals.h" -#include "google/cloud/testing_util/is_proto_equal.h" -#include "google/cloud/testing_util/status_matchers.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -using ::google::cloud::internal::ToProtoTimestamp; -using ::google::cloud::testing_util::IsProtoEqual; -using ::testing::Contains; -using ::testing::Not; -namespace btadmin = ::google::bigtable::admin::v2; -namespace bigtable = ::google::cloud::bigtable; - -class AdminBackupIntegrationTest - : public bigtable::testing::TableIntegrationTest { - protected: - std::unique_ptr table_admin_; - std::unique_ptr instance_admin_; - - void SetUp() override { - TableIntegrationTest::SetUp(); - - std::shared_ptr admin_client = - bigtable::MakeAdminClient( - bigtable::testing::TableTestEnvironment::project_id()); - table_admin_ = std::make_unique( - admin_client, bigtable::testing::TableTestEnvironment::instance_id()); - auto instance_admin_client = bigtable::MakeInstanceAdminClient( - bigtable::testing::TableTestEnvironment::project_id()); - instance_admin_ = - std::make_unique(instance_admin_client); - } -}; - -/// @test Verify that `bigtable::TableAdmin` Backup CRUD operations work as -/// expected. -TEST_F(AdminBackupIntegrationTest, CreateListGetUpdateRestoreDeleteBackup) { - auto const table_id = bigtable::testing::TableTestEnvironment::table_id(); - auto const table_name = - bigtable::TableName(project_id(), instance_id(), table_id); - - auto clusters = instance_admin_->ListClusters(table_admin_->instance_id()); - ASSERT_STATUS_OK(clusters); - auto const cluster_name = clusters->clusters.begin()->name(); - auto const cluster_id = - cluster_name.substr(cluster_name.rfind('/') + 1, - cluster_name.size() - cluster_name.rfind('/')); - auto const backup_id = RandomBackupId(); - auto const backup_name = cluster_name + "/backups/" + backup_id; - - // Create backup - // The proto documentation says backup expiration times are in "microseconds - // granularity": - // https://cloud.google.com/bigtable/docs/reference/admin/rpc/google.bigtable.admin.v2#google.bigtable.admin.v2.Backup - auto expire_time = std::chrono::time_point_cast( - std::chrono::system_clock::now() + std::chrono::hours(12)); - - auto backup = table_admin_->CreateBackup( - {cluster_id, backup_id, table_id, expire_time}); - ASSERT_STATUS_OK(backup); - EXPECT_EQ(backup->name(), backup_name); - - // List backups to verify new backup has been created - auto backups = table_admin_->ListBackups({}); - ASSERT_STATUS_OK(backups); - EXPECT_THAT(BackupNames(*backups), Contains(backup_name)); - - // Get backup to verify create - backup = table_admin_->GetBackup(cluster_id, backup_id); - ASSERT_STATUS_OK(backup); - EXPECT_EQ(backup->name(), backup_name); - - // Update backup - expire_time += std::chrono::hours(12); - backup = table_admin_->UpdateBackup({cluster_id, backup_id, expire_time}); - ASSERT_STATUS_OK(backup); - - // Verify the update - backup = table_admin_->GetBackup(cluster_id, backup_id); - ASSERT_STATUS_OK(backup); - EXPECT_EQ(backup->name(), backup_name); - EXPECT_THAT(backup->expire_time(), - IsProtoEqual(ToProtoTimestamp(expire_time))); - - // Delete table - EXPECT_STATUS_OK(table_admin_->DeleteTable(table_id)); - - // Verify the delete - auto tables = table_admin_->ListTables(btadmin::Table::NAME_ONLY); - ASSERT_STATUS_OK(tables); - EXPECT_THAT(TableNames(*tables), Not(Contains(table_name))); - - // Restore table - auto table = table_admin_->RestoreTable({table_id, cluster_id, backup_id}); - EXPECT_STATUS_OK(table); - - // Verify the restore - tables = table_admin_->ListTables(btadmin::Table::NAME_ONLY); - ASSERT_STATUS_OK(tables); - EXPECT_THAT(TableNames(*tables), Contains(table_name).Times(1)); - - // Delete backup - EXPECT_STATUS_OK(table_admin_->DeleteBackup(cluster_id, backup_id)); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google - -int main(int argc, char* argv[]) { - ::testing::InitGoogleMock(&argc, argv); - (void)::testing::AddGlobalTestEnvironment( - new google::cloud::bigtable::testing::TableAdminTestEnvironment); - return RUN_ALL_TESTS(); -} diff --git a/google/cloud/bigtable/tests/admin_iam_policy_integration_test.cc b/google/cloud/bigtable/tests/admin_iam_policy_integration_test.cc deleted file mode 100644 index 9a0a531325226..0000000000000 --- a/google/cloud/bigtable/tests/admin_iam_policy_integration_test.cc +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/instance_admin.h" -#include "google/cloud/bigtable/table_admin.h" -#include "google/cloud/bigtable/testing/table_integration_test.h" -#include "google/cloud/internal/getenv.h" -#include "google/cloud/testing_util/chrono_literals.h" -#include "google/cloud/testing_util/status_matchers.h" -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -class AdminIAMPolicyIntegrationTest - : public bigtable::testing::TableIntegrationTest { - protected: - std::shared_ptr admin_client_; - std::unique_ptr table_admin_; - std::string service_account_; - - void SetUp() override { - TableIntegrationTest::SetUp(); - - service_account_ = google::cloud::internal::GetEnv( - "GOOGLE_CLOUD_CPP_BIGTABLE_TEST_SERVICE_ACCOUNT") - .value_or(""); - ASSERT_FALSE(service_account_.empty()); - - admin_client_ = - MakeAdminClient(testing::TableTestEnvironment::project_id()); - table_admin_ = std::make_unique( - admin_client_, bigtable::testing::TableTestEnvironment::instance_id()); - } -}; - -/// @test Verify that IAM Policy APIs work as expected. -TEST_F(AdminIAMPolicyIntegrationTest, SetGetTestIamAPIsTest) { - auto const table_id = bigtable::testing::TableTestEnvironment::table_id(); - - auto iam_policy = bigtable::IamPolicy({bigtable::IamBinding( - "roles/bigtable.reader", {"serviceAccount:" + service_account_})}); - - auto initial_policy = table_admin_->SetIamPolicy(table_id, iam_policy); - ASSERT_STATUS_OK(initial_policy); - - auto fetched_policy = table_admin_->GetIamPolicy(table_id); - ASSERT_STATUS_OK(fetched_policy); - - EXPECT_EQ(initial_policy->version(), fetched_policy->version()); - EXPECT_EQ(initial_policy->etag(), fetched_policy->etag()); - - auto permission_set = table_admin_->TestIamPermissions( - table_id, {"bigtable.tables.get", "bigtable.tables.readRows"}); - ASSERT_STATUS_OK(permission_set); - - EXPECT_EQ(2, permission_set->size()); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google - -int main(int argc, char* argv[]) { - ::testing::InitGoogleMock(&argc, argv); - (void)::testing::AddGlobalTestEnvironment( - new google::cloud::bigtable::testing::TableTestEnvironment); - return RUN_ALL_TESTS(); -} diff --git a/google/cloud/bigtable/tests/admin_integration_test.cc b/google/cloud/bigtable/tests/admin_integration_test.cc deleted file mode 100644 index fd056d5382c2f..0000000000000 --- a/google/cloud/bigtable/tests/admin_integration_test.cc +++ /dev/null @@ -1,400 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/instance_admin.h" -#include "google/cloud/bigtable/table_admin.h" -#include "google/cloud/bigtable/testing/table_integration_test.h" -#include "google/cloud/internal/getenv.h" -#include "google/cloud/internal/random.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" -#include "google/cloud/testing_util/status_matchers.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -using ::testing::Contains; -using ::testing::HasSubstr; -using ::testing::IsSupersetOf; -using ::testing::Not; - -namespace btadmin = ::google::bigtable::admin::v2; - -class AdminIntegrationTest : public bigtable::testing::TableIntegrationTest { - protected: - std::unique_ptr table_admin_; - - void SetUp() override { - TableIntegrationTest::SetUp(); - - std::shared_ptr admin_client = - bigtable::MakeAdminClient( - bigtable::testing::TableTestEnvironment::project_id()); - table_admin_ = std::make_unique( - admin_client, bigtable::testing::TableTestEnvironment::instance_id()); - } -}; - -TEST_F(AdminIntegrationTest, TableListWithMultipleTables) { - std::vector ids; - std::vector expected_tables; - - // Create tables - int constexpr kTableCount = 5; - for (int index = 0; index < kTableCount; ++index) { - std::string table_id = RandomTableId(); - EXPECT_STATUS_OK(table_admin_->CreateTable(table_id, {})); - ids.emplace_back(table_id); - expected_tables.emplace_back( - bigtable::TableName(project_id(), instance_id(), std::move(table_id))); - } - auto tables = table_admin_->ListTables(btadmin::Table::NAME_ONLY); - ASSERT_STATUS_OK(tables); - EXPECT_THAT(TableNames(*tables), IsSupersetOf(expected_tables)); - - // Delete the tables so future tests have a clean slate. - for (auto const& table_id : ids) { - EXPECT_STATUS_OK(table_admin_->DeleteTable(table_id)); - } - - // Verify the tables were deleted. - tables = table_admin_->ListTables(btadmin::Table::NAME_ONLY); - ASSERT_STATUS_OK(tables); - auto names = TableNames(*tables); - for (auto const& t : expected_tables) { - EXPECT_THAT(names, Not(Contains(t))); - } -} - -TEST_F(AdminIntegrationTest, DropRowsByPrefix) { - auto table = GetTable(); - - // Create a vector of cell which will be inserted into bigtable - std::string const row_key1_prefix = "DropRowPrefix1"; - std::string const row_key2_prefix = "DropRowPrefix2"; - std::string const row_key1 = row_key1_prefix + "-Key1"; - std::string const row_key1_1 = row_key1_prefix + "_1-Key1"; - std::string const row_key2 = row_key2_prefix + "-Key2"; - std::vector created_cells{ - {row_key1, "family1", "column_id1", 0, "v-c-0-0"}, - {row_key1, "family1", "column_id1", 1000, "v-c-0-1"}, - {row_key1, "family2", "column_id3", 2000, "v-c-0-2"}, - {row_key1_1, "family2", "column_id3", 2000, "v-c-0-2"}, - {row_key1_1, "family2", "column_id3", 3000, "v-c-0-2"}, - {row_key2, "family2", "column_id2", 2000, "v-c0-0-0"}, - {row_key2, "family3", "column_id3", 3000, "v-c1-0-2"}, - }; - std::vector expected_cells{ - {row_key2, "family2", "column_id2", 2000, "v-c0-0-0"}, - {row_key2, "family3", "column_id3", 3000, "v-c1-0-2"}}; - - // Create records - CreateCells(table, created_cells); - // Delete all the records for a row - EXPECT_STATUS_OK(table_admin_->DropRowsByPrefix( - bigtable::testing::TableTestEnvironment::table_id(), row_key1_prefix)); - auto actual_cells = ReadRows(table, bigtable::Filter::PassAllFilter()); - - CheckEqualUnordered(expected_cells, actual_cells); -} - -TEST_F(AdminIntegrationTest, DropAllRows) { - auto table = GetTable(); - - // Create a vector of cell which will be inserted into bigtable - std::string const row_key1 = "DropRowKey1"; - std::string const row_key2 = "DropRowKey2"; - std::vector created_cells{ - {row_key1, "family1", "column_id1", 0, "v-c-0-0"}, - {row_key1, "family1", "column_id1", 1000, "v-c-0-1"}, - {row_key1, "family2", "column_id3", 2000, "v-c-0-2"}, - {row_key2, "family2", "column_id2", 2000, "v-c0-0-0"}, - {row_key2, "family3", "column_id3", 3000, "v-c1-0-2"}, - }; - - // Create records - CreateCells(table, created_cells); - // Delete all the records from a table - EXPECT_STATUS_OK(table_admin_->DropAllRows( - bigtable::testing::TableTestEnvironment::table_id())); - auto actual_cells = ReadRows(table, bigtable::Filter::PassAllFilter()); - - ASSERT_TRUE(actual_cells.empty()); -} - -/// @test Verify that `bigtable::TableAdmin` CRUD operations work as expected. -TEST_F(AdminIntegrationTest, CreateListGetDeleteTable) { - using GC = bigtable::GcRule; - auto const table_id = RandomTableId(); - auto const table_name = - bigtable::TableName(project_id(), instance_id(), table_id); - - // Create table config - bigtable::TableConfig table_config( - {{"fam", GC::MaxNumVersions(5)}, - {"foo", GC::MaxAge(std::chrono::hours(24))}}, - {"a1000", "a2000", "b3000", "m5000"}); - - // Create table - ASSERT_STATUS_OK(table_admin_->CreateTable(table_id, table_config)); - bigtable::Table table(data_client_, table_id); - - // List tables - auto tables = table_admin_->ListTables(btadmin::Table::NAME_ONLY); - ASSERT_STATUS_OK(tables); - EXPECT_THAT(TableNames(*tables), Contains(table_name)); - - // Get table - auto table_detailed = table_admin_->GetTable(table_id, btadmin::Table::FULL); - ASSERT_STATUS_OK(table_detailed); - - // Verify new table was created - EXPECT_EQ(table.table_name(), table_detailed->name()) - << "Mismatched names for GetTable(" << table_id - << "): " << table.table_name() << " != " << table_detailed->name(); - auto count_matching_families = [](btadmin::Table const& table, - std::string const& name) { - int count = 0; - for (auto const& kv : table.column_families()) { - if (kv.first == name) { - ++count; - } - } - return count; - }; - EXPECT_EQ(1, count_matching_families(*table_detailed, "fam")); - EXPECT_EQ(1, count_matching_families(*table_detailed, "foo")); - - // Update table - std::vector column_modification_list = { - bigtable::ColumnFamilyModification::Create( - "newfam", GC::Intersection(GC::MaxAge(std::chrono::hours(7 * 24)), - GC::MaxNumVersions(1))), - bigtable::ColumnFamilyModification::Update("fam", GC::MaxNumVersions(2)), - bigtable::ColumnFamilyModification::Drop("foo")}; - - auto table_modified = - table_admin_->ModifyColumnFamilies(table_id, column_modification_list); - ASSERT_STATUS_OK(table_modified); - EXPECT_EQ(1, count_matching_families(*table_modified, "fam")); - EXPECT_EQ(0, count_matching_families(*table_modified, "foo")); - EXPECT_EQ(1, count_matching_families(*table_modified, "newfam")); - auto const& gc = table_modified->column_families().at("newfam").gc_rule(); - EXPECT_TRUE(gc.has_intersection()); - EXPECT_EQ(2, gc.intersection().rules_size()); - - // Delete table - EXPECT_STATUS_OK(table_admin_->DeleteTable(table_id)); - - // List to verify it is no longer there - tables = table_admin_->ListTables(btadmin::Table::NAME_ONLY); - ASSERT_STATUS_OK(tables); - EXPECT_THAT(TableNames(*tables), Not(Contains(table_name))); -} - -/// @test Verify that `bigtable::TableAdmin` WaitForConsistencyCheck works as -/// expected. -TEST_F(AdminIntegrationTest, 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 random_table_id = RandomTableId(); - - // Create a bigtable::InstanceAdmin and a bigtable::TableAdmin to create the - // new instance and the new table. - auto instance_admin_client = bigtable::MakeInstanceAdminClient(project_id()); - bigtable::InstanceAdmin instance_admin(instance_admin_client); - - auto admin_client = bigtable::MakeAdminClient(project_id()); - bigtable::TableAdmin table_admin(admin_client, id); - - // The instance configuration is involved, it needs two clusters, which must - // be production clusters (and therefore have at least 3 nodes each), and - // 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); - bigtable::InstanceConfig config( - id, display_name, - {{id + "-c1", cluster_config_1}, {id + "-c2", cluster_config_2}}); - - // Create the new instance. - auto instance = instance_admin.CreateInstance(config).get(); - ASSERT_STATUS_OK(instance); - - // The table is going to be very simple, just one column family. - std::string const family = "column_family"; - bigtable::TableConfig table_config = bigtable::TableConfig( - {{family, bigtable::GcRule::MaxNumVersions(10)}}, {}); - - // Create the new table. - auto table_created = table_admin.CreateTable(random_table_id, table_config); - ASSERT_STATUS_OK(table_created); - - // We need to mutate the data in the table and then wait for those mutations - // to propagate to both clusters. First create a `bigtable::Table` object. - auto table = Table(MakeDataConnection(), - TableResource(project_id(), id, random_table_id)); - - // Insert some cells into the table. - std::string const row_key1 = "check-consistency-row1"; - std::string const row_key2 = "check-consistency-row2"; - std::vector created_cells{ - {row_key1, family, "column1", 1000, "not interesting"}, - {row_key1, family, "column2", 1000, "not interesting"}, - {row_key1, family, "column1", 2000, "not interesting"}, - {row_key2, family, "column2", 2000, "not interesting"}, - {row_key2, family, "column1", 3000, "not interesting"}, - }; - CreateCells(table, created_cells); - - // Create a consistency token after modifying the table. - auto consistency_token = - table_admin.GenerateConsistencyToken(random_table_id); - ASSERT_STATUS_OK(consistency_token); - - // Wait until all the mutations before the `consistency_token` have propagated - // everywhere. - google::cloud::future> result = - table_admin.WaitForConsistency(random_table_id, *consistency_token); - auto is_consistent = result.get(); - ASSERT_STATUS_OK(is_consistent); - EXPECT_EQ(bigtable::Consistency::kConsistent, *is_consistent); - - // Cleanup the table and the instance. - EXPECT_STATUS_OK(table_admin.DeleteTable(random_table_id)); - EXPECT_STATUS_OK(instance_admin.DeleteInstance(id)); -} - -/// @test Verify rpc logging for `bigtable::TableAdmin` -TEST_F(AdminIntegrationTest, CreateListGetDeleteTableWithLogging) { - using GC = bigtable::GcRule; - // In our ci builds, we set GOOGLE_CLOUD_CPP_ENABLE_TRACING to log our tests, - // by default. We should unset this variable and create a fresh client in - // order to have a conclusive test. - testing_util::ScopedEnvironment env = {"GOOGLE_CLOUD_CPP_ENABLE_TRACING", - absl::nullopt}; - testing_util::ScopedLog log; - - auto const table_id = RandomTableId(); - auto const table_name = - bigtable::TableName(project_id(), instance_id(), table_id); - - std::shared_ptr admin_client = - bigtable::MakeAdminClient( - bigtable::testing::TableTestEnvironment::project_id(), - Options{}.set({"rpc"})); - auto table_admin = std::make_unique( - admin_client, bigtable::testing::TableTestEnvironment::instance_id()); - - // Create table config - bigtable::TableConfig table_config( - {{"fam", GC::MaxNumVersions(5)}, - {"foo", GC::MaxAge(std::chrono::hours(24))}}, - {"a1000", "a2000", "b3000", "m5000"}); - - // Create table - ASSERT_STATUS_OK(table_admin->CreateTable(table_id, table_config)); - bigtable::Table table(data_client_, table_id); - - // List tables - auto tables = table_admin->ListTables(btadmin::Table::NAME_ONLY); - ASSERT_STATUS_OK(tables); - EXPECT_THAT(TableNames(*tables), Contains(table_name)); - - // Get table - auto table_detailed = table_admin->GetTable(table_id, btadmin::Table::FULL); - ASSERT_STATUS_OK(table_detailed); - - // Verify new table was created - EXPECT_EQ(table.table_name(), table_detailed->name()) - << "Mismatched names for GetTable(" << table_id - << "): " << table.table_name() << " != " << table_detailed->name(); - auto count_matching_families = [](btadmin::Table const& table, - std::string const& name) { - int count = 0; - for (auto const& kv : table.column_families()) { - if (kv.first == name) { - ++count; - } - } - return count; - }; - EXPECT_EQ(1, count_matching_families(*table_detailed, "fam")); - EXPECT_EQ(1, count_matching_families(*table_detailed, "foo")); - - // Update table - std::vector column_modification_list = { - bigtable::ColumnFamilyModification::Create( - "newfam", GC::Intersection(GC::MaxAge(std::chrono::hours(7 * 24)), - GC::MaxNumVersions(1))), - bigtable::ColumnFamilyModification::Update("fam", GC::MaxNumVersions(2)), - bigtable::ColumnFamilyModification::Drop("foo")}; - - auto table_modified = - table_admin->ModifyColumnFamilies(table_id, column_modification_list); - ASSERT_STATUS_OK(table_modified); - EXPECT_EQ(1, count_matching_families(*table_modified, "fam")); - EXPECT_EQ(0, count_matching_families(*table_modified, "foo")); - EXPECT_EQ(1, count_matching_families(*table_modified, "newfam")); - auto const& gc = table_modified->column_families().at("newfam").gc_rule(); - EXPECT_TRUE(gc.has_intersection()); - EXPECT_EQ(2, gc.intersection().rules_size()); - - // Delete table - EXPECT_STATUS_OK(table_admin->DeleteTable(table_id)); - - // List to verify it is no longer there - tables = table_admin->ListTables(btadmin::Table::NAME_ONLY); - ASSERT_STATUS_OK(tables); - EXPECT_THAT(TableNames(*tables), Not(Contains(table_name))); - - auto const log_lines = log.ExtractLines(); - EXPECT_THAT(log_lines, Contains(HasSubstr("CreateTable"))); - EXPECT_THAT(log_lines, Contains(HasSubstr("ListTables"))); - EXPECT_THAT(log_lines, Contains(HasSubstr("GetTable"))); - EXPECT_THAT(log_lines, Contains(HasSubstr("ModifyColumnFamilies"))); - EXPECT_THAT(log_lines, Contains(HasSubstr("DeleteTable"))); - - // Verify that a normal client does not log. - auto no_logging_client = - TableAdmin(MakeAdminClient(project_id()), instance_id()); - (void)no_logging_client.ListTables(btadmin::Table::NAME_ONLY); - EXPECT_THAT(log.ExtractLines(), Not(Contains(HasSubstr("ListTables")))); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable -} // namespace cloud -} // namespace google - -int main(int argc, char* argv[]) { - ::testing::InitGoogleMock(&argc, argv); - (void)::testing::AddGlobalTestEnvironment( - new google::cloud::bigtable::testing::TableAdminTestEnvironment); - return RUN_ALL_TESTS(); -} diff --git a/google/cloud/bigtable/tests/bigtable_client_integration_tests.bzl b/google/cloud/bigtable/tests/bigtable_client_integration_tests.bzl index ce7d2f550c98f..907e01e0933dc 100644 --- a/google/cloud/bigtable/tests/bigtable_client_integration_tests.bzl +++ b/google/cloud/bigtable/tests/bigtable_client_integration_tests.bzl @@ -17,13 +17,13 @@ """Automatically generated unit tests list - DO NOT EDIT.""" bigtable_client_integration_tests = [ - "admin_backup_integration_test.cc", - "admin_iam_policy_integration_test.cc", - "admin_integration_test.cc", "data_async_future_integration_test.cc", "data_integration_test.cc", "filters_integration_test.cc", "instance_admin_integration_test.cc", "mutations_integration_test.cc", + "table_admin_backup_integration_test.cc", + "table_admin_iam_policy_integration_test.cc", + "table_admin_integration_test.cc", "table_sample_rows_integration_test.cc", ] diff --git a/google/cloud/bigtable/tests/data_async_future_integration_test.cc b/google/cloud/bigtable/tests/data_async_future_integration_test.cc index c884c571e405b..56defb4862194 100644 --- a/google/cloud/bigtable/tests/data_async_future_integration_test.cc +++ b/google/cloud/bigtable/tests/data_async_future_integration_test.cc @@ -25,18 +25,12 @@ namespace { using ::google::cloud::bigtable::testing::TableIntegrationTest; using ::google::cloud::testing_util::chrono_literals::operator""_ms; -class DataAsyncIntegrationTest - : public TableIntegrationTest, - public ::testing::WithParamInterface {}; - -INSTANTIATE_TEST_SUITE_P(, DataAsyncIntegrationTest, - ::testing::Values("with-data-connection", - "with-data-client")); +class DataAsyncIntegrationTest : public TableIntegrationTest {}; std::string const kFamily = "family1"; -TEST_P(DataAsyncIntegrationTest, TableAsyncApply) { - auto table = GetTable(GetParam()); +TEST_F(DataAsyncIntegrationTest, TableAsyncApply) { + auto table = GetTable(); std::string const row_key = "key-000010"; std::vector created{{row_key, kFamily, "cc1", 1000, "v1000"}, @@ -67,8 +61,8 @@ TEST_P(DataAsyncIntegrationTest, TableAsyncApply) { CheckEqualUnordered(expected, actual); } -TEST_P(DataAsyncIntegrationTest, TableAsyncBulkApply) { - auto table = GetTable(GetParam()); +TEST_F(DataAsyncIntegrationTest, TableAsyncBulkApply) { + auto table = GetTable(); std::string const row_key1 = "key-000010"; std::string const row_key2 = "key-000020"; @@ -115,8 +109,8 @@ TEST_P(DataAsyncIntegrationTest, TableAsyncBulkApply) { CheckEqualUnordered(expected, actual); } -TEST_P(DataAsyncIntegrationTest, TableAsyncCheckAndMutateRowPass) { - auto table = GetTable(GetParam()); +TEST_F(DataAsyncIntegrationTest, TableAsyncCheckAndMutateRowPass) { + auto table = GetTable(); std::string const key = "row-key"; @@ -142,8 +136,8 @@ TEST_P(DataAsyncIntegrationTest, TableAsyncCheckAndMutateRowPass) { CheckEqualUnordered(expected, actual); } -TEST_P(DataAsyncIntegrationTest, TableAsyncCheckAndMutateRowFail) { - auto table = GetTable(GetParam()); +TEST_F(DataAsyncIntegrationTest, TableAsyncCheckAndMutateRowFail) { + auto table = GetTable(); std::string const key = "row-key"; @@ -169,8 +163,8 @@ TEST_P(DataAsyncIntegrationTest, TableAsyncCheckAndMutateRowFail) { CheckEqualUnordered(expected, actual); } -TEST_P(DataAsyncIntegrationTest, TableAsyncReadModifyWriteAppendValueTest) { - auto table = GetTable(GetParam()); +TEST_F(DataAsyncIntegrationTest, TableAsyncReadModifyWriteAppendValueTest) { + auto table = GetTable(); std::string const row_key1 = "row-key-1"; std::string const row_key2 = "row-key-2"; std::string const add_suffix1 = "-suffix"; @@ -225,8 +219,8 @@ TEST_P(DataAsyncIntegrationTest, TableAsyncReadModifyWriteAppendValueTest) { actual_cells_ignore_timestamp); } -TEST_P(DataAsyncIntegrationTest, TableAsyncReadRowsAllRows) { - auto table = GetTable(GetParam()); +TEST_F(DataAsyncIntegrationTest, TableAsyncReadRowsAllRows) { + auto table = GetTable(); std::string const row_key1 = "row-key-1"; std::string const row_key2 = "row-key-2"; @@ -264,8 +258,8 @@ TEST_P(DataAsyncIntegrationTest, TableAsyncReadRowsAllRows) { CheckEqualUnordered(created, actual); } -TEST_P(DataAsyncIntegrationTest, TableAsyncReadRowTest) { - auto table = GetTable(GetParam()); +TEST_F(DataAsyncIntegrationTest, TableAsyncReadRowTest) { + auto table = GetTable(); std::string const row_key1 = "row-key-1"; std::string const row_key2 = "row-key-2"; diff --git a/google/cloud/bigtable/tests/data_integration_test.cc b/google/cloud/bigtable/tests/data_integration_test.cc index 9a835f61176e3..2146f75342b85 100644 --- a/google/cloud/bigtable/tests/data_integration_test.cc +++ b/google/cloud/bigtable/tests/data_integration_test.cc @@ -17,12 +17,14 @@ #include "google/cloud/bigtable/options.h" #include "google/cloud/bigtable/retry_policy.h" #include "google/cloud/bigtable/testing/table_integration_test.h" +#include "google/cloud/grpc_options.h" #include "google/cloud/log.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" #include "google/cloud/testing_util/status_matchers.h" #include "absl/strings/str_format.h" +#include "absl/strings/str_split.h" #include namespace google { @@ -43,13 +45,7 @@ using ::testing::HasSubstr; using ::testing::UnorderedElementsAre; using ms = std::chrono::milliseconds; -class DataIntegrationTest : public TableIntegrationTest, - public ::testing::WithParamInterface { -}; - -INSTANTIATE_TEST_SUITE_P(, DataIntegrationTest, - ::testing::Values("with-data-connection", - "with-data-client")); +class DataIntegrationTest : public TableIntegrationTest {}; /// Use Table::Apply() to insert a single row. void Apply(Table& table, std::string const& row_key, @@ -90,8 +86,8 @@ std::string const kFamily2 = "family2"; std::string const kFamily3 = "family3"; std::string const kFamily4 = "family4"; -TEST_P(DataIntegrationTest, TableApply) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableApply) { + auto table = GetTable(); std::string const row_key = "row-key-1"; std::vector created{{row_key, kFamily4, "c0", 1000, "v1000"}, @@ -104,8 +100,8 @@ TEST_P(DataIntegrationTest, TableApply) { CheckEqualUnordered(expected, actual); } -TEST_P(DataIntegrationTest, TableBulkApply) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableBulkApply) { + auto table = GetTable(); std::vector created{{"row-key-1", kFamily4, "c0", 1000, "v1000"}, {"row-key-1", kFamily4, "c1", 2000, "v2000"}, @@ -129,9 +125,7 @@ TEST_P(DataIntegrationTest, TableBulkApply) { CheckEqualUnordered(expected, actual); } -TEST_P(DataIntegrationTest, TableBulkApplyThrottling) { - if (GetParam() == "with-data-client") GTEST_SKIP(); - +TEST_F(DataIntegrationTest, TableBulkApplyThrottling) { // Make a custom table with throttling enabled. auto table = Table(MakeDataConnection( @@ -158,9 +152,9 @@ TEST_P(DataIntegrationTest, TableBulkApplyThrottling) { CheckEqualUnordered({expected}, actual); } -TEST_P(DataIntegrationTest, TableSingleRow) { +TEST_F(DataIntegrationTest, TableSingleRow) { std::string const row_key = "row-key-1"; - auto table = GetTable(GetParam()); + auto table = GetTable(); auto mutation = SingleRowMutation(row_key, SetCell(kFamily4, "c1", 1_ms, "V1000"), @@ -175,8 +169,8 @@ TEST_P(DataIntegrationTest, TableSingleRow) { CheckEqualUnordered(expected, actual); } -TEST_P(DataIntegrationTest, TableReadRowTest) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableReadRowTest) { + auto table = GetTable(); std::string const row_key1 = "row-key-1"; std::string const row_key2 = "row-key-2"; @@ -192,8 +186,8 @@ TEST_P(DataIntegrationTest, TableReadRowTest) { CheckEqualUnordered(expected, actual); } -TEST_P(DataIntegrationTest, TableReadRowNotExistTest) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableReadRowNotExistTest) { + auto table = GetTable(); std::string const row_key1 = "row-key-1"; std::string const row_key2 = "row-key-2"; @@ -205,8 +199,8 @@ TEST_P(DataIntegrationTest, TableReadRowNotExistTest) { EXPECT_FALSE(row_cell->first); } -TEST_P(DataIntegrationTest, TableReadRowsAllRows) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableReadRowsAllRows) { + auto table = GetTable(); std::string const row_key1 = "row-key-1"; std::string const row_key2 = "row-key-2"; std::string const row_key3(1024, '3'); // a long key @@ -237,8 +231,8 @@ TEST_P(DataIntegrationTest, TableReadRowsAllRows) { CheckEqualUnordered(created, MoveCellsFromReader(read4)); } -TEST_P(DataIntegrationTest, TableReadRowsPartialRows) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableReadRowsPartialRows) { + auto table = GetTable(); std::string const row_key1 = "row-key-1"; std::string const row_key2 = "row-key-2"; std::string const row_key3 = "row-key-3"; @@ -279,11 +273,10 @@ TEST_P(DataIntegrationTest, TableReadRowsPartialRows) { } } -TEST_P(DataIntegrationTest, TableReadRowsReverseScan) { - if (GetParam() == "with-data-client") GTEST_SKIP(); +TEST_F(DataIntegrationTest, TableReadRowsReverseScan) { // The emulator does not yet support reverse scans. if (UsingCloudBigtableEmulator()) GTEST_SKIP(); - auto table = GetTable(GetParam()); + auto table = GetTable(); std::vector created{{"row-key-1", kFamily4, "c1", 1000, "a"}, {"row-key-1", kFamily4, "c2", 2000, "b"}, @@ -303,8 +296,8 @@ TEST_P(DataIntegrationTest, TableReadRowsReverseScan) { ElementsAre("row-key-3", "row-key-2", "row-key-1", "row-key-1")); } -TEST_P(DataIntegrationTest, TableReadRowsNoRows) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableReadRowsNoRows) { + auto table = GetTable(); std::string const row_key1 = "row-key-1"; std::string const row_key2 = "row-key-2"; std::string const row_key3 = "row-key-3"; @@ -329,8 +322,8 @@ TEST_P(DataIntegrationTest, TableReadRowsNoRows) { CheckEqualUnordered(expected, MoveCellsFromReader(read3)); } -TEST_P(DataIntegrationTest, TableReadRowsWrongTable) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableReadRowsWrongTable) { + auto table = GetTable(); auto other_table = table.WithNewTarget(table.project_id(), table.instance_id(), RandomTableId()); @@ -343,8 +336,8 @@ TEST_P(DataIntegrationTest, TableReadRowsWrongTable) { EXPECT_EQ(read1.end(), it); } -TEST_P(DataIntegrationTest, TableCheckAndMutateRowPass) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableCheckAndMutateRowPass) { + auto table = GetTable(); std::string const key = "row-key"; std::vector created{{key, kFamily4, "c1", 0, "v1000"}}; @@ -361,8 +354,8 @@ TEST_P(DataIntegrationTest, TableCheckAndMutateRowPass) { CheckEqualUnordered(expected, actual); } -TEST_P(DataIntegrationTest, TableCheckAndMutateRowFail) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableCheckAndMutateRowFail) { + auto table = GetTable(); std::string const key = "row-key"; std::vector created{{key, kFamily4, "c1", 0, "v1000"}}; @@ -379,8 +372,8 @@ TEST_P(DataIntegrationTest, TableCheckAndMutateRowFail) { CheckEqualUnordered(expected, actual); } -TEST_P(DataIntegrationTest, TableReadModifyWriteAppendValueTest) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableReadModifyWriteAppendValueTest) { + auto table = GetTable(); std::string const row_key1 = "row-key-1"; std::string const row_key2 = "row-key-2"; std::string const add_suffix1 = "-suffix"; @@ -415,8 +408,8 @@ TEST_P(DataIntegrationTest, TableReadModifyWriteAppendValueTest) { actual_cells_ignore_timestamp); } -TEST_P(DataIntegrationTest, TableReadModifyWriteRowIncrementAmountTest) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableReadModifyWriteRowIncrementAmountTest) { + auto table = GetTable(); std::string const key = "row-key"; // An initial; big-endian int64 number with value 0. @@ -442,8 +435,8 @@ TEST_P(DataIntegrationTest, TableReadModifyWriteRowIncrementAmountTest) { CheckEqualUnordered(expected_ignore_timestamp, actual_ignore_timestamp); } -TEST_P(DataIntegrationTest, TableReadModifyWriteRowMultipleTest) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableReadModifyWriteRowMultipleTest) { + auto table = GetTable(); std::string const key = "row-key"; std::string v1("\x00\x00\x00\x00\x00\x00\x00\x00", 8); @@ -486,8 +479,8 @@ TEST_P(DataIntegrationTest, TableReadModifyWriteRowMultipleTest) { CheckEqualUnordered(expected_ignore_timestamp, actual_ignore_timestamp); } -TEST_P(DataIntegrationTest, TableCellValueInt64Test) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableCellValueInt64Test) { + auto table = GetTable(); std::string const key = "row-key"; std::vector created{{key, kFamily1, "c1", 0, 42}, @@ -521,8 +514,8 @@ TEST_P(DataIntegrationTest, TableCellValueInt64Test) { CheckEqualUnordered(expected_ignore_timestamp, actual_ignore_timestamp); } -TEST_P(DataIntegrationTest, TableReadMultipleCellsBigValue) { - auto table = GetTable(GetParam()); +TEST_F(DataIntegrationTest, TableReadMultipleCellsBigValue) { + auto table = GetTable(); std::string const row_key = "row-key-1"; // cell vector contains 4 cells of 32 MiB each, or 128 MiB (without @@ -573,7 +566,7 @@ TEST_P(DataIntegrationTest, TableReadMultipleCellsBigValue) { CheckEqualUnordered(expected_ignore_timestamp, actual_ignore_timestamp); } -TEST_P(DataIntegrationTest, TableApplyWithLogging) { +TEST_F(DataIntegrationTest, TableApplyWithLogging) { // In our ci builds, we set GOOGLE_CLOUD_CPP_ENABLE_TRACING to log our tests, // by default. We should unset this variable and create a fresh client in // order to have a conclusive test. @@ -585,13 +578,9 @@ TEST_P(DataIntegrationTest, TableApplyWithLogging) { // Make a `Table` with an implementation that depends on the test's value // parameter. auto make_table = [&](Options const& options) { - if (GetParam() == "with-data-connection") { - auto conn = MakeDataConnection(options); - return Table(std::move(conn), - TableResource(project_id(), instance_id(), table_id)); - } - auto data_client = MakeDataClient(project_id(), instance_id(), options); - return Table(std::move(data_client), table_id); + auto conn = MakeDataConnection(options); + return Table(std::move(conn), + TableResource(project_id(), instance_id(), table_id)); }; std::string const row_key = "row-key-1"; @@ -610,7 +599,7 @@ TEST_P(DataIntegrationTest, TableApplyWithLogging) { EXPECT_THAT(log.ExtractLines(), Not(Contains(HasSubstr("MutateRow")))); } -TEST_P(DataIntegrationTest, ClientQueryColumnFamily) { +TEST_F(DataIntegrationTest, ClientQueryColumnFamily) { if (UsingCloudBigtableEmulator()) GTEST_SKIP(); auto const table_id = testing::TableTestEnvironment::table_id(); auto retry_policy_option = DataLimitedErrorCountRetryPolicy(0).clone(); @@ -676,7 +665,7 @@ TEST_P(DataIntegrationTest, ClientQueryColumnFamily) { {Bytes(column2), Bytes(value2)}})); } -TEST_P(DataIntegrationTest, ClientQueryColumnFamilyWithHistory) { +TEST_F(DataIntegrationTest, ClientQueryColumnFamilyWithHistory) { if (UsingCloudBigtableEmulator()) GTEST_SKIP(); auto const table_id = testing::TableTestEnvironment::table_id(); auto retry_policy_option = DataLimitedErrorCountRetryPolicy(0).clone(); @@ -820,76 +809,7 @@ TEST_P(DataIntegrationTest, ClientQueryColumnFamilyWithHistory) { column_2_value_old); } -// TODO(#8800) - remove after deprecation is complete -#include "google/cloud/internal/disable_deprecation_warnings.inc" - -TEST(ConnectionRefresh, Disabled) { - auto data_client = bigtable::MakeDataClient( - testing::TableTestEnvironment::project_id(), - testing::TableTestEnvironment::instance_id(), - Options{}.set(std::chrono::seconds(0))); - // In general, it is hard to show that something has *not* happened, at best - // we can show that its side-effects have not happened. In this case we want - // to show that the channels have not been refreshed. A side-effect of - // refreshing a channel is that it enters the `READY` state, so we check that - // this has not taken place and take that as evidence that no refresh has - // taken place. - // - // After the `CompletionQueue` argument is removed from the `Bigtable` API, we - // will have an option to provide a mock `CompletionQueue` to the `DataClient` - // for test purposes and verify that no timers are created, which will be a - // superior way to write this test. - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - - for (int i = 0; i < internal::DefaultConnectionPoolSize(); ++i) { - auto channel = data_client->Channel(); - EXPECT_EQ(GRPC_CHANNEL_IDLE, channel->GetState(false)); - } - // Make sure things still work. - bigtable::Table table(data_client, testing::TableTestEnvironment::table_id()); - std::string const row_key = "row-key-1"; - std::vector created{{row_key, kFamily4, "c0", 1000, "v1000"}, - {row_key, kFamily4, "c1", 2000, "v2000"}}; - Apply(table, row_key, created); - // After performing some operations, some of the channels should be in ready - // state. - auto check_if_some_channel_is_ready = [&] { - for (int i = 0; i < internal::DefaultConnectionPoolSize(); ++i) { - if (data_client->Channel()->GetState(false) == GRPC_CHANNEL_READY) { - return true; - } - } - return false; - }; - EXPECT_TRUE(check_if_some_channel_is_ready()); -} - -TEST(ConnectionRefresh, Frequent) { - auto data_client = bigtable::MakeDataClient( - testing::TableTestEnvironment::project_id(), - testing::TableTestEnvironment::instance_id(), - Options{} - .set(std::chrono::milliseconds(100)) - .set(std::chrono::milliseconds(100))); - - for (;;) { - if (data_client->Channel()->GetState(false) == GRPC_CHANNEL_READY) { - // We've found a channel which changed its state from IDLE to READY, - // which means that our refreshing mechanism works. - break; - } - std::this_thread::sleep_for(std::chrono::milliseconds(10)); - } - - // Make sure things still work. - bigtable::Table table(data_client, testing::TableTestEnvironment::table_id()); - std::string const row_key = "row-key-1"; - std::vector created{{row_key, kFamily4, "c0", 1000, "v1000"}, - {row_key, kFamily4, "c1", 2000, "v2000"}}; - Apply(table, row_key, created); -} - -TEST_P(DataIntegrationTest, SingleColumnQuery) { +TEST_F(DataIntegrationTest, SingleColumnQuery) { if (UsingCloudBigtableEmulator()) GTEST_SKIP(); auto const table_id = testing::TableTestEnvironment::table_id(); auto retry_policy_option = DataLimitedErrorCountRetryPolicy(0).clone(); @@ -952,7 +872,7 @@ TEST_P(DataIntegrationTest, SingleColumnQuery) { EXPECT_EQ(*value, value1); } -TEST_P(DataIntegrationTest, SingleColumnQueryWithHistory) { +TEST_F(DataIntegrationTest, SingleColumnQueryWithHistory) { if (UsingCloudBigtableEmulator()) GTEST_SKIP(); auto const table_id = testing::TableTestEnvironment::table_id(); auto retry_policy_option = DataLimitedErrorCountRetryPolicy(0).clone(); @@ -1056,7 +976,7 @@ TEST_P(DataIntegrationTest, SingleColumnQueryWithHistory) { EXPECT_EQ(std::get<1>(entry1), value_old); } -TEST_P(DataIntegrationTest, MultiColumnQuery) { +TEST_F(DataIntegrationTest, MultiColumnQuery) { if (UsingCloudBigtableEmulator()) GTEST_SKIP(); auto const table_id = testing::TableTestEnvironment::table_id(); auto retry_policy_option = DataLimitedErrorCountRetryPolicy(0).clone(); @@ -1123,7 +1043,7 @@ TEST_P(DataIntegrationTest, MultiColumnQuery) { RowType("multi-column-query-row-2", "v21", "v22"))); } -TEST_P(DataIntegrationTest, QueryWithNulls) { +TEST_F(DataIntegrationTest, QueryWithNulls) { if (UsingCloudBigtableEmulator()) GTEST_SKIP(); auto const table_id = testing::TableTestEnvironment::table_id(); auto retry_policy_option = DataLimitedErrorCountRetryPolicy(0).clone(); @@ -1193,9 +1113,6 @@ TEST_P(DataIntegrationTest, QueryWithNulls) { std::make_tuple(row_key3, absl::optional(value3)))); } -// TODO(#8800) - remove after deprecation is complete -#include "google/cloud/internal/diagnostics_pop.inc" - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable diff --git a/google/cloud/bigtable/tests/filters_integration_test.cc b/google/cloud/bigtable/tests/filters_integration_test.cc index aeea0834efb22..6f485da04b451 100644 --- a/google/cloud/bigtable/tests/filters_integration_test.cc +++ b/google/cloud/bigtable/tests/filters_integration_test.cc @@ -95,7 +95,7 @@ void CreateComplexRows(Table& table, std::string const& prefix) { }; TEST_F(FilterIntegrationTest, PassAll) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const row_key = "pass-all-row-key"; std::vector expected{ {row_key, "family1", "c", 0, "v-c-0-0"}, @@ -112,7 +112,7 @@ TEST_F(FilterIntegrationTest, PassAll) { } TEST_F(FilterIntegrationTest, BlockAll) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const row_key = "block-all-row-key"; std::vector created{ {row_key, "family1", "c", 0, "v-c-0-0"}, @@ -130,7 +130,7 @@ TEST_F(FilterIntegrationTest, BlockAll) { } TEST_F(FilterIntegrationTest, Latest) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const row_key = "latest-row-key"; std::vector created{ {row_key, "family1", "c", 0, "v-c-0-0"}, @@ -155,7 +155,7 @@ TEST_F(FilterIntegrationTest, Latest) { } TEST_F(FilterIntegrationTest, FamilyRegex) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const row_key = "family-regex-row-key"; std::vector created{ {row_key, "family1", "c2", 0, "bar"}, @@ -178,7 +178,7 @@ TEST_F(FilterIntegrationTest, FamilyRegex) { } TEST_F(FilterIntegrationTest, ColumnRegex) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const row_key = "column-regex-row-key"; std::vector created{ {row_key, "family1", "abc", 0, "bar"}, @@ -201,7 +201,7 @@ TEST_F(FilterIntegrationTest, ColumnRegex) { } TEST_F(FilterIntegrationTest, ColumnRange) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const row_key = "column-range-row-key"; std::vector created{ {row_key, "family1", "a00", 0, "bar"}, @@ -223,7 +223,7 @@ TEST_F(FilterIntegrationTest, ColumnRange) { } TEST_F(FilterIntegrationTest, TimestampRange) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const row_key = "timestamp-range-row-key"; std::vector created{ {row_key, "family1", "c0", 1000, "v1000"}, @@ -247,7 +247,7 @@ TEST_F(FilterIntegrationTest, TimestampRange) { } TEST_F(FilterIntegrationTest, RowKeysRegex) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const row_key = "row-key-regex-row-key"; std::vector created{ {row_key + "/abc0", "family1", "c0", 1000, "v1000"}, @@ -267,7 +267,7 @@ TEST_F(FilterIntegrationTest, RowKeysRegex) { } TEST_F(FilterIntegrationTest, ValueRegex) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const prefix = "value-regex-prefix"; std::vector created{ {prefix + "/abc0", "family1", "c0", 1000, "v1000"}, @@ -288,7 +288,7 @@ TEST_F(FilterIntegrationTest, ValueRegex) { } TEST_F(FilterIntegrationTest, ValueRange) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const prefix = "value-range-prefix"; std::vector created{ {prefix + "/abc0", "family1", "c0", 1000, "v1000"}, @@ -311,7 +311,7 @@ TEST_F(FilterIntegrationTest, ValueRange) { } TEST_F(FilterIntegrationTest, CellsRowLimit) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const prefix = "cell-row-limit-prefix"; ASSERT_NO_FATAL_FAILURE(CreateComplexRows(table, prefix)); @@ -332,7 +332,7 @@ TEST_F(FilterIntegrationTest, CellsRowLimit) { } TEST_F(FilterIntegrationTest, CellsRowOffset) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const prefix = "cell-row-offset-prefix"; ASSERT_NO_FATAL_FAILURE(CreateComplexRows(table, prefix)); @@ -353,7 +353,7 @@ TEST_F(FilterIntegrationTest, CellsRowOffset) { } TEST_F(FilterIntegrationTest, RowSample) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const prefix = "row-sample-prefix"; int constexpr kRowCount = 20000; @@ -408,7 +408,7 @@ TEST_F(FilterIntegrationTest, RowSample) { } TEST_F(FilterIntegrationTest, StripValueTransformer) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const prefix = "strip-value-transformer-prefix"; std::vector created{ {prefix + "/abc0", "family1", "c0", 1000, "v1000"}, @@ -433,7 +433,7 @@ TEST_F(FilterIntegrationTest, StripValueTransformer) { } TEST_F(FilterIntegrationTest, ApplyLabelTransformer) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const prefix = "apply-label-transformer-prefix"; std::vector created{ {prefix + "/abc0", "family1", "c0", 1000, "v1000"}, @@ -458,7 +458,7 @@ TEST_F(FilterIntegrationTest, ApplyLabelTransformer) { } TEST_F(FilterIntegrationTest, Condition) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const prefix = "condition-prefix"; std::vector created{ {prefix + "/abc0", "family1", "c0", 1000, "v1000"}, @@ -486,7 +486,7 @@ TEST_F(FilterIntegrationTest, Condition) { } TEST_F(FilterIntegrationTest, Chain) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const prefix = "chain-prefix"; std::vector created{ {prefix + "/abc0", "family1", "c0", 1000, "v1000"}, @@ -510,7 +510,7 @@ TEST_F(FilterIntegrationTest, Chain) { } TEST_F(FilterIntegrationTest, ChainFromRange) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const prefix = "chain-prefix"; std::vector created{ {prefix + "/abc0", "family1", "c0", 1000, "v1000"}, @@ -534,7 +534,7 @@ TEST_F(FilterIntegrationTest, ChainFromRange) { } TEST_F(FilterIntegrationTest, Interleave) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const prefix = "interleave-prefix"; std::vector created{ {prefix + "/abc0", "family1", "c0", 1000, "v1000"}, @@ -562,7 +562,7 @@ TEST_F(FilterIntegrationTest, Interleave) { } TEST_F(FilterIntegrationTest, InterleaveFromRange) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); std::string const prefix = "interleave-prefix"; std::vector created{ {prefix + "/abc0", "family1", "c0", 1000, "v1000"}, diff --git a/google/cloud/bigtable/tests/instance_admin_emulator.cc b/google/cloud/bigtable/tests/instance_admin_emulator.cc index 21f746c928382..40bde479f2cb8 100644 --- a/google/cloud/bigtable/tests/instance_admin_emulator.cc +++ b/google/cloud/bigtable/tests/instance_admin_emulator.cc @@ -14,8 +14,8 @@ #include "google/cloud/bigtable/internal/prefix_range_end.h" #include "absl/strings/match.h" -#include -#include +#include "google/bigtable/admin/v2/bigtable_instance_admin.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/bigtable/tests/instance_admin_integration_test.cc b/google/cloud/bigtable/tests/instance_admin_integration_test.cc index 20980eb782c04..bf4f0edff506c 100644 --- a/google/cloud/bigtable/tests/instance_admin_integration_test.cc +++ b/google/cloud/bigtable/tests/instance_admin_integration_test.cc @@ -12,13 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "google/cloud/bigtable/instance_admin.h" +#include "google/cloud/bigtable/admin/bigtable_instance_admin_client.h" +#include "google/cloud/bigtable/app_profile_config.h" +#include "google/cloud/bigtable/iam_binding.h" +#include "google/cloud/bigtable/iam_policy.h" +#include "google/cloud/bigtable/instance_config.h" +#include "google/cloud/bigtable/instance_update_config.h" +#include "google/cloud/bigtable/resource_names.h" #include "google/cloud/bigtable/testing/random_names.h" +#include "google/cloud/grpc_options.h" #include "google/cloud/internal/algorithm.h" #include "google/cloud/internal/background_threads_impl.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/random.h" #include "google/cloud/location.h" +#include "google/cloud/project.h" #include "google/cloud/status_or.h" #include "google/cloud/testing_util/integration_test.h" #include "google/cloud/testing_util/scoped_environment.h" @@ -63,30 +71,31 @@ class InstanceAdminIntegrationTest GetEnv("GOOGLE_CLOUD_CPP_BIGTABLE_TEST_SERVICE_ACCOUNT").value_or(""); ASSERT_FALSE(service_account_.empty()); - auto instance_admin_client = bigtable::MakeInstanceAdminClient(project_id_); instance_admin_ = - std::make_unique(instance_admin_client); + std::make_unique( + bigtable_admin::MakeBigtableInstanceAdminConnection()); } - std::string project_id_; std::string zone_a_; std::string zone_b_; std::string service_account_; - std::unique_ptr instance_admin_; + std::unique_ptr instance_admin_; google::cloud::internal::DefaultPRNG generator_ = google::cloud::internal::MakeDefaultPRNG(); }; -bool IsInstancePresent(std::vector const& instances, - std::string const& instance_name) { +bool IsInstancePresent( + google::protobuf::RepeatedPtrField const& instances, + std::string const& instance_name) { return google::cloud::internal::ContainsIf( instances, [&instance_name](btadmin::Instance const& i) { return i.name() == instance_name; }); } -bool IsClusterPresent(std::vector const& clusters, - std::string const& cluster_name) { +bool IsClusterPresent( + google::protobuf::RepeatedPtrField const& clusters, + std::string const& cluster_name) { return google::cloud::internal::ContainsIf( clusters, [&cluster_name](btadmin::Cluster const& i) { return i.name() == cluster_name; @@ -114,14 +123,21 @@ 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()); + auto create_request_2 = config_2.as_proto(); + create_request_2.set_parent(Project(project_id_).FullName()); - auto instance_1_fut = instance_admin_->CreateInstance(config_1); - auto instance_2_fut = instance_admin_->CreateInstance(config_2); + auto instance_1_fut = instance_admin_->CreateInstance(create_request_1); + auto instance_2_fut = instance_admin_->CreateInstance(create_request_2); // Wait for instance creation auto instance_1 = instance_1_fut.get(); @@ -132,16 +148,16 @@ TEST_F(InstanceAdminIntegrationTest, ListAllClustersTest) { EXPECT_EQ(instance_1->name(), name_1); EXPECT_EQ(instance_2->name(), name_2); - auto clusters = instance_admin_->ListClusters(); + auto clusters = instance_admin_->ListClusters(instance_1->name()); ASSERT_STATUS_OK(clusters); - for (auto const& cluster : clusters->clusters) { + for (auto const& cluster : clusters->clusters()) { EXPECT_NE(std::string::npos, - cluster.name().find(instance_admin_->project_name())); + cluster.name().find("projects/" + project_id_)); } - EXPECT_FALSE(clusters->clusters.empty()); + EXPECT_FALSE(clusters->clusters().empty()); - EXPECT_STATUS_OK(instance_admin_->DeleteInstance(id_1)); - EXPECT_STATUS_OK(instance_admin_->DeleteInstance(id_2)); + EXPECT_STATUS_OK(instance_admin_->DeleteInstance(name_1)); + EXPECT_STATUS_OK(instance_admin_->DeleteInstance(name_2)); } /// @test Verify that AppProfile CRUD operations work as expected. @@ -149,9 +165,12 @@ 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 instance_fut = instance_admin_->CreateInstance(config); + auto create_request = config.as_proto(); + create_request.set_parent(Project(project_id_).FullName()); + auto instance_fut = instance_admin_->CreateInstance(create_request); // Wait for instance creation auto instance = instance_fut.get(); ASSERT_STATUS_OK(instance); @@ -167,67 +186,83 @@ TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteAppProfile) { auto const name_2 = bigtable::AppProfileName(project_id_, instance_id, id_2); // Simplify writing the rest of the test. - auto profile_names = [](std::vector const& list) { - std::vector names(list.size()); - std::transform(list.begin(), list.end(), names.begin(), - [](btadmin::AppProfile const& x) { return x.name(); }); + auto profile_names = [](StreamRange& list) + -> StatusOr> { + std::vector names; + for (auto const& p : list) { + if (!p) return p.status(); + names.push_back(p->name()); + } return names; }; - auto profiles = instance_admin_->ListAppProfiles(instance_id); - ASSERT_STATUS_OK(profiles); - EXPECT_THAT(profile_names(*profiles), Not(Contains(name_1))); - EXPECT_THAT(profile_names(*profiles), Not(Contains(name_2))); - - auto profile_1 = instance_admin_->CreateAppProfile( - instance_id, bigtable::AppProfileConfig::MultiClusterUseAny(id_1)); + auto profiles = instance_admin_->ListAppProfiles(instance_name); + auto names = profile_names(profiles); + ASSERT_STATUS_OK(names); + EXPECT_THAT(*names, Not(Contains(name_1))); + EXPECT_THAT(*names, Not(Contains(name_2))); + + auto create_profile_request = + bigtable::AppProfileConfig::MultiClusterUseAny(id_1).as_proto(); + create_profile_request.set_parent(instance_name); + create_profile_request.set_app_profile_id(id_1); + auto profile_1 = instance_admin_->CreateAppProfile(create_profile_request); ASSERT_STATUS_OK(profile_1); EXPECT_EQ(profile_1->name(), name_1); - auto profile_2 = instance_admin_->CreateAppProfile( - instance_id, bigtable::AppProfileConfig::MultiClusterUseAny(id_2)); + create_profile_request = + bigtable::AppProfileConfig::MultiClusterUseAny(id_2).as_proto(); + create_profile_request.set_parent(instance_name); + create_profile_request.set_app_profile_id(id_2); + auto profile_2 = instance_admin_->CreateAppProfile(create_profile_request); ASSERT_STATUS_OK(profile_2); EXPECT_EQ(profile_2->name(), name_2); - profiles = instance_admin_->ListAppProfiles(instance_id); - ASSERT_STATUS_OK(profiles); - EXPECT_THAT(profile_names(*profiles), Contains(name_1).Times(1)); - EXPECT_THAT(profile_names(*profiles), Contains(name_2).Times(1)); + profiles = instance_admin_->ListAppProfiles(instance_name); + names = profile_names(profiles); + ASSERT_STATUS_OK(names); + EXPECT_THAT(*names, Contains(name_1).Times(1)); + EXPECT_THAT(*names, Contains(name_2).Times(1)); - profile_1 = instance_admin_->GetAppProfile(instance_id, id_1); + profile_1 = instance_admin_->GetAppProfile( + AppProfileName(project_id_, instance_id, id_1)); ASSERT_STATUS_OK(profile_1); EXPECT_EQ(profile_1->name(), name_1); - profile_2 = instance_admin_->GetAppProfile(instance_id, id_2); + profile_2 = instance_admin_->GetAppProfile( + AppProfileName(project_id_, instance_id, id_2)); ASSERT_STATUS_OK(profile_2); EXPECT_EQ(profile_2->name(), name_2); - profile_2 = - instance_admin_ - ->UpdateAppProfile(instance_id, id_2, - bigtable::AppProfileUpdateConfig().set_description( - "new description")) - .get(); + profile_2->set_description("new description"); + google::protobuf::FieldMask field_mask; + *field_mask.add_paths() = "description"; + profile_2 = instance_admin_->UpdateAppProfile(*profile_2, field_mask).get(); ASSERT_STATUS_OK(profile_2); EXPECT_EQ("new description", profile_2->description()); - profile_2 = instance_admin_->GetAppProfile(instance_id, id_2); + profile_2 = instance_admin_->GetAppProfile( + AppProfileName(project_id_, instance_id, id_2)); ASSERT_STATUS_OK(profile_2); EXPECT_EQ("new description", profile_2->description()); - ASSERT_STATUS_OK(instance_admin_->DeleteAppProfile(instance_id, id_1, true)); - profiles = instance_admin_->ListAppProfiles(instance_id); - ASSERT_STATUS_OK(profiles); - EXPECT_THAT(profile_names(*profiles), Not(Contains(name_1))); - EXPECT_THAT(profile_names(*profiles), Contains(name_2).Times(1)); - - ASSERT_STATUS_OK(instance_admin_->DeleteAppProfile(instance_id, id_2, true)); - profiles = instance_admin_->ListAppProfiles(instance_id); - ASSERT_STATUS_OK(profiles); - EXPECT_THAT(profile_names(*profiles), Not(Contains(name_1))); - EXPECT_THAT(profile_names(*profiles), Not(Contains(name_2))); - - ASSERT_STATUS_OK(instance_admin_->DeleteInstance(instance_id)); + ASSERT_STATUS_OK(instance_admin_->DeleteAppProfile( + AppProfileName(project_id_, instance_id, id_1), true)); + profiles = instance_admin_->ListAppProfiles(instance_name); + names = profile_names(profiles); + ASSERT_STATUS_OK(names); + EXPECT_THAT((*names), Not(Contains(name_1))); + EXPECT_THAT(*names, Contains(name_2).Times(1)); + + ASSERT_STATUS_OK(instance_admin_->DeleteAppProfile( + AppProfileName(project_id_, instance_id, id_2), true)); + profiles = instance_admin_->ListAppProfiles(instance_name); + names = profile_names(profiles); + ASSERT_STATUS_OK(names); + EXPECT_THAT(*names, Not(Contains(name_1))); + EXPECT_THAT(*names, Not(Contains(name_2))); + + ASSERT_STATUS_OK(instance_admin_->DeleteInstance(instance_name)); } /// @test Verify that Instance CRUD operations work as expected. @@ -236,25 +271,29 @@ TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteInstanceTest) { auto const instance_name = bigtable::InstanceName(project_id_, instance_id); // Create instance - auto config = IntegrationTestConfig(instance_id, zone_a_); - auto instance = instance_admin_->CreateInstance(config).get(); + 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(); ASSERT_STATUS_OK(instance); - auto const zone_a = Location(instance_admin_->project_name(), zone_a_); - auto const zone_b = Location(instance_admin_->project_name(), zone_b_); + auto project = google::cloud::Project(project_id_); + auto const zone_a = Location(project.FullName(), zone_a_); + auto const zone_b = Location(project.FullName(), zone_b_); // List instances - auto instances = instance_admin_->ListInstances(); + auto instances = instance_admin_->ListInstances(project.FullName()); ASSERT_STATUS_OK(instances); // If either zone_a_ or zone_b_ are in the list of failed locations then we // cannot proceed. ASSERT_THAT( - instances->failed_locations, + instances->failed_locations(), Not(AnyOf(Contains(zone_a.FullName()), Contains(zone_b.FullName())))); - EXPECT_TRUE(IsInstancePresent(instances->instances, instance->name())); + EXPECT_TRUE(IsInstancePresent(instances->instances(), instance->name())); // Get instance - instance = instance_admin_->GetInstance(instance_id); + instance = instance_admin_->GetInstance(instance_name); ASSERT_STATUS_OK(instance); EXPECT_EQ(instance->name(), instance_name); @@ -263,57 +302,64 @@ TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteInstanceTest) { auto const updated_display_name = instance_id.substr(0, 22) + " updated"; instance_update_config.set_display_name(updated_display_name); instance = - instance_admin_->UpdateInstance(std::move(instance_update_config)).get(); + instance_admin_->PartialUpdateInstance(instance_update_config.as_proto()) + .get(); ASSERT_STATUS_OK(instance); // Verify update - instance = instance_admin_->GetInstance(instance_id); + instance = instance_admin_->GetInstance(instance_name); ASSERT_STATUS_OK(instance); EXPECT_EQ(updated_display_name, instance->display_name()); // Delete instance - ASSERT_STATUS_OK(instance_admin_->DeleteInstance(instance_id)); + ASSERT_STATUS_OK(instance_admin_->DeleteInstance(instance_name)); // Verify delete - instances = instance_admin_->ListInstances(); + instances = instance_admin_->ListInstances(project.FullName()); ASSERT_STATUS_OK(instances); // If either zone_a_ or zone_b_ are in the list of failed locations then we // cannot proceed. ASSERT_THAT( - instances->failed_locations, + instances->failed_locations(), Not(AnyOf(Contains(zone_a.FullName()), Contains(zone_b.FullName())))); - EXPECT_FALSE(IsInstancePresent(instances->instances, instance_name)); + EXPECT_FALSE(IsInstancePresent(instances->instances(), instance_name)); } /// @test Verify that cluster CRUD operations work as expected. TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteClusterTest) { auto const instance_id = RandomInstanceId(generator_); + auto const instance_name = InstanceName(project_id_, instance_id); 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 instance = instance_admin_->CreateInstance(config).get(); + auto create_request = config.as_proto(); + create_request.set_parent(Project(project_id_).FullName()); + auto instance = instance_admin_->CreateInstance(create_request).get(); 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(cluster_config, instance_id, cluster_id) + instance_admin_ + ->CreateCluster(instance_name, cluster_id, cluster_config.as_proto()) .get(); ASSERT_STATUS_OK(cluster); EXPECT_EQ(3, cluster->serve_nodes()); // Verify create - auto clusters = instance_admin_->ListClusters(instance_id); + auto clusters = instance_admin_->ListClusters(instance_name); ASSERT_STATUS_OK(clusters); - EXPECT_TRUE(IsClusterPresent(clusters->clusters, cluster->name())); + EXPECT_TRUE(IsClusterPresent(clusters->clusters(), cluster->name())); // Get cluster - cluster = instance_admin_->GetCluster(instance_id, cluster_id); + cluster = instance_admin_->GetCluster(cluster_name); ASSERT_STATUS_OK(cluster); EXPECT_EQ(cluster_name, cluster->name()); @@ -322,53 +368,58 @@ TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteClusterTest) { cluster->clear_state(); bigtable::ClusterConfig updated_cluster_config(std::move(*cluster)); cluster = - instance_admin_->UpdateCluster(std::move(updated_cluster_config)).get(); + instance_admin_->UpdateCluster(updated_cluster_config.as_proto()).get(); ASSERT_STATUS_OK(cluster); // Verify update - cluster = instance_admin_->GetCluster(instance_id, cluster_id); + cluster = instance_admin_->GetCluster(cluster_name); ASSERT_STATUS_OK(cluster); EXPECT_EQ(4, cluster->serve_nodes()); // Delete cluster - ASSERT_STATUS_OK(instance_admin_->DeleteCluster(instance_id, cluster_id)); + ASSERT_STATUS_OK(instance_admin_->DeleteCluster(cluster_name)); // Verify delete - clusters = instance_admin_->ListClusters(instance_id); + clusters = instance_admin_->ListClusters(instance_name); ASSERT_STATUS_OK(clusters); - EXPECT_FALSE(IsClusterPresent(clusters->clusters, cluster_name)); + EXPECT_FALSE(IsClusterPresent(clusters->clusters(), cluster_name)); // Delete instance - ASSERT_STATUS_OK(instance_admin_->DeleteInstance(instance_id)); + ASSERT_STATUS_OK(instance_admin_->DeleteInstance(instance_name)); } /// @test Verify that IAM Policy Native APIs work as expected. 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); - ASSERT_STATUS_OK(instance_admin_->CreateInstance(config).get()); + auto create_request = config.as_proto(); + create_request.set_parent(Project(project_id_).FullName()); + ASSERT_STATUS_OK(instance_admin_->CreateInstance(create_request).get()); auto iam_policy = bigtable::IamPolicy({bigtable::IamBinding( "roles/bigtable.reader", {"serviceAccount:" + service_account_})}); - auto initial_policy = instance_admin_->SetIamPolicy(instance_id, iam_policy); + auto initial_policy = + instance_admin_->SetIamPolicy(instance_name, iam_policy); ASSERT_STATUS_OK(initial_policy); - auto fetched_policy = instance_admin_->GetNativeIamPolicy(instance_id); + auto fetched_policy = instance_admin_->GetIamPolicy(instance_name); ASSERT_STATUS_OK(fetched_policy); EXPECT_EQ(initial_policy->version(), fetched_policy->version()); EXPECT_EQ(initial_policy->etag(), fetched_policy->etag()); auto permission_set = instance_admin_->TestIamPermissions( - instance_id, {"bigtable.tables.list", "bigtable.tables.delete"}); + instance_name, {"bigtable.tables.list", "bigtable.tables.delete"}); ASSERT_STATUS_OK(permission_set); - EXPECT_EQ(2, permission_set->size()); - EXPECT_STATUS_OK(instance_admin_->DeleteInstance(instance_id)); + EXPECT_EQ(2, permission_set->permissions().size()); + EXPECT_STATUS_OK(instance_admin_->DeleteInstance(instance_name)); } /// @test Verify that Instance CRUD operations with logging work as expected. @@ -382,32 +433,35 @@ TEST_F(InstanceAdminIntegrationTest, testing_util::ScopedLog log; auto const instance_id = RandomInstanceId(generator_); auto const instance_name = bigtable::InstanceName(project_id_, instance_id); - - auto instance_admin_client = bigtable::MakeInstanceAdminClient( - project_id_, Options{}.set({"rpc"})); + Project const project(project_id_); auto instance_admin = - std::make_unique(instance_admin_client); + std::make_unique( + bigtable_admin::MakeBigtableInstanceAdminConnection( + Options{}.set({"rpc"}))); - auto const zone_a = Location(instance_admin_->project_name(), zone_a_); - auto const zone_b = Location(instance_admin_->project_name(), zone_b_); + auto const zone_a = Location(project.FullName(), zone_a_); + auto const zone_b = Location(project.FullName(), zone_b_); // Create instance - auto config = IntegrationTestConfig(instance_id, zone_a_); - auto instance = instance_admin->CreateInstance(config).get(); + 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(); ASSERT_STATUS_OK(instance); // Verify create - auto instances = instance_admin->ListInstances(); + auto instances = instance_admin->ListInstances(project.FullName()); ASSERT_STATUS_OK(instances); // If either zone_a_ or zone_b_ are in the list of failed locations then we // cannot proceed. ASSERT_THAT( - instances->failed_locations, + instances->failed_locations(), Not(AnyOf(Contains(zone_a.FullName()), Contains(zone_b.FullName())))); - EXPECT_TRUE(IsInstancePresent(instances->instances, instance->name())); + EXPECT_TRUE(IsInstancePresent(instances->instances(), instance->name())); // Get instance - instance = instance_admin->GetInstance(instance_id); + instance = instance_admin->GetInstance(instance_name); ASSERT_STATUS_OK(instance); EXPECT_EQ(instance->name(), instance_name); @@ -416,26 +470,27 @@ TEST_F(InstanceAdminIntegrationTest, auto const updated_display_name = instance_id.substr(0, 22) + " updated"; instance_update_config.set_display_name(updated_display_name); instance = - instance_admin->UpdateInstance(std::move(instance_update_config)).get(); + instance_admin->PartialUpdateInstance(instance_update_config.as_proto()) + .get(); ASSERT_STATUS_OK(instance); // Verify update - instance = instance_admin->GetInstance(instance_id); + instance = instance_admin->GetInstance(instance_name); ASSERT_STATUS_OK(instance); EXPECT_EQ(updated_display_name, instance->display_name()); // Delete instance - ASSERT_STATUS_OK(instance_admin->DeleteInstance(instance_id)); + ASSERT_STATUS_OK(instance_admin->DeleteInstance(instance_name)); // Verify delete - instances = instance_admin->ListInstances(); + instances = instance_admin->ListInstances(project.FullName()); ASSERT_STATUS_OK(instances); // If either zone_a_ or zone_b_ are in the list of failed locations then we // cannot proceed. ASSERT_THAT( - instances->failed_locations, + instances->failed_locations(), Not(AnyOf(Contains(zone_a.FullName()), Contains(zone_b.FullName())))); - EXPECT_FALSE(IsInstancePresent(instances->instances, instance_name)); + EXPECT_FALSE(IsInstancePresent(instances->instances(), instance_name)); auto const log_lines = log.ExtractLines(); EXPECT_THAT(log_lines, Contains(HasSubstr("ListInstances"))); @@ -445,22 +500,29 @@ TEST_F(InstanceAdminIntegrationTest, EXPECT_THAT(log_lines, Contains(HasSubstr("DeleteInstance"))); // Verify that a normal client does not log. - auto no_logging_client = InstanceAdmin(MakeInstanceAdminClient(project_id_)); - (void)no_logging_client.ListInstances(); + auto no_logging_client = + std::make_unique( + bigtable_admin::MakeBigtableInstanceAdminConnection()); + (void)no_logging_client->ListInstances(project.FullName()); EXPECT_THAT(log.ExtractLines(), Not(Contains(HasSubstr("ListInstances")))); } TEST_F(InstanceAdminIntegrationTest, CustomWorkers) { CompletionQueue cq; - auto instance_admin_client = bigtable::MakeInstanceAdminClient( - project_id_, Options{}.set(cq)); instance_admin_ = - std::make_unique(instance_admin_client); + std::make_unique( + bigtable_admin::MakeBigtableInstanceAdminConnection( + Options{}.set(cq))); // CompletionQueue `cq` is not being `Run()`, so this should never finish. auto const instance_id = RandomInstanceId(generator_); - auto instance_fut = instance_admin_->CreateInstance(IntegrationTestConfig( - instance_id, zone_a_, bigtable::InstanceConfig::PRODUCTION, 3)); + auto location = Location(Project(project_id_), zone_a_); + auto create_request = + IntegrationTestConfig(instance_id, location.FullName(), + bigtable::InstanceConfig::PRODUCTION, 3) + .as_proto(); + create_request.set_parent(Project(project_id_).FullName()); + auto instance_fut = instance_admin_->CreateInstance(create_request); EXPECT_EQ(std::future_status::timeout, instance_fut.wait_for(std::chrono::milliseconds(100))); @@ -468,13 +530,13 @@ TEST_F(InstanceAdminIntegrationTest, CustomWorkers) { std::thread t([cq]() mutable { cq.Run(); }); auto instance = instance_fut.get(); ASSERT_STATUS_OK(instance); - EXPECT_STATUS_OK(instance_admin_->DeleteInstance(instance_id)); + EXPECT_STATUS_OK( + instance_admin_->DeleteInstance(InstanceName(project_id_, instance_id))); cq.CancelAll(); cq.Shutdown(); t.join(); } - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable diff --git a/google/cloud/bigtable/tests/mutations_integration_test.cc b/google/cloud/bigtable/tests/mutations_integration_test.cc index ccd9e7ad3c574..6efaf27f79a85 100644 --- a/google/cloud/bigtable/tests/mutations_integration_test.cc +++ b/google/cloud/bigtable/tests/mutations_integration_test.cc @@ -62,7 +62,7 @@ std::string const kColumnFamily3 = "family3"; * Cloud Bigtable */ TEST_F(MutationIntegrationTest, SetCellTest) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); // Create a vector of cells which will be inserted into bigtable std::string const row_key = "SetCellRowKey"; @@ -86,7 +86,7 @@ TEST_F(MutationIntegrationTest, SetCellTest) { * correctly inserted into Cloud Bigtable */ TEST_F(MutationIntegrationTest, SetCellNumericValueTest) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); // Create a vector of cells which will be inserted into bigtable std::string const row_key = "SetCellNumRowKey"; @@ -129,7 +129,7 @@ TEST_F(MutationIntegrationTest, SetCellNumericValueErrorTest) { * correctly inserted into Cloud Bigtable. */ TEST_F(MutationIntegrationTest, SetCellIgnoreTimestampTest) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); // Create a vector of cell which will be inserted into bigtable std::string const row_key = "SetCellRowKey"; @@ -167,7 +167,7 @@ TEST_F(MutationIntegrationTest, SetCellIgnoreTimestampTest) { * Bigtable. */ TEST_F(MutationIntegrationTest, DeleteFromColumnForTimestampRangeTest) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); // Create a vector of cell which will be inserted into bigtable std::string const row_key = "DeleteColumn-Key"; @@ -212,7 +212,7 @@ TEST_F(MutationIntegrationTest, DeleteFromColumnForTimestampRangeTest) { * We expect the server (and not the client library) to reject invalid ranges. */ TEST_F(MutationIntegrationTest, DeleteFromColumnForReversedTimestampRangeTest) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); // Create a vector of cell which will be inserted into bigtable std::string const key = "row"; @@ -245,7 +245,7 @@ TEST_F(MutationIntegrationTest, DeleteFromColumnForReversedTimestampRangeTest) { * We expect the server (and not the client library) to reject invalid ranges. */ TEST_F(MutationIntegrationTest, DeleteFromColumnForEmptyTimestampRangeTest) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); // Create a vector of cell which will be inserted into bigtable std::string const key = "row"; @@ -270,7 +270,7 @@ TEST_F(MutationIntegrationTest, DeleteFromColumnForEmptyTimestampRangeTest) { * is deleting all records only for that column_identifier. */ TEST_F(MutationIntegrationTest, DeleteFromColumnForAllTest) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); // Create a vector of cell which will be inserted into bigtable std::string const row_key = "DeleteColumnForAll-Key"; @@ -304,7 +304,7 @@ TEST_F(MutationIntegrationTest, DeleteFromColumnForAllTest) { * timestamp only. */ TEST_F(MutationIntegrationTest, DeleteFromColumnStartingFromTest) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); // Create a vector of cell which will be inserted into bigtable std::string const row_key = "DeleteColumnStartingFrom-Key"; @@ -341,7 +341,7 @@ TEST_F(MutationIntegrationTest, DeleteFromColumnStartingFromTest) { * timestamp only. end_timestamp is not inclusive. */ TEST_F(MutationIntegrationTest, DeleteFromColumnEndingAtTest) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); // Create a vector of cell which will be inserted into bigtable cloud std::string const row_key = "DeleteColumnEndingAt-Key"; @@ -379,7 +379,7 @@ TEST_F(MutationIntegrationTest, DeleteFromColumnEndingAtTest) { * records for that family only */ TEST_F(MutationIntegrationTest, DeleteFromFamilyTest) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); // Create a vector of cell which will be inserted into bigtable std::string const row_key = "DeleteFamily-Key"; @@ -411,7 +411,7 @@ TEST_F(MutationIntegrationTest, DeleteFromFamilyTest) { * records for that row only */ TEST_F(MutationIntegrationTest, DeleteFromRowTest) { - auto table = GetTable("with-data-connection"); + auto table = GetTable(); // Create a vector of cell which will be inserted into bigtable std::string const row_key1 = "DeleteRowKey1"; diff --git a/google/cloud/bigtable/tests/table_admin_backup_integration_test.cc b/google/cloud/bigtable/tests/table_admin_backup_integration_test.cc new file mode 100644 index 0000000000000..2ca5ff5dbfd18 --- /dev/null +++ b/google/cloud/bigtable/tests/table_admin_backup_integration_test.cc @@ -0,0 +1,172 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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/admin/bigtable_instance_admin_client.h" +#include "google/cloud/bigtable/admin/bigtable_table_admin_client.h" +#include "google/cloud/bigtable/testing/table_integration_test.h" +#include "google/cloud/internal/getenv.h" +#include "google/cloud/internal/random.h" +#include "google/cloud/internal/time_utils.h" +#include "google/cloud/testing_util/chrono_literals.h" +#include "google/cloud/testing_util/is_proto_equal.h" +#include "google/cloud/testing_util/status_matchers.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace bigtable { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { + +using ::google::cloud::internal::ToProtoTimestamp; +using ::google::cloud::testing_util::IsProtoEqual; +using ::testing::Contains; +using ::testing::Not; +namespace btadmin = ::google::bigtable::admin::v2; +namespace bigtable = ::google::cloud::bigtable; + +class AdminBackupIntegrationTest + : public bigtable::testing::TableIntegrationTest { + protected: + void SetUp() override { + TableIntegrationTest::SetUp(); + table_admin_ = std::make_unique( + bigtable_admin::MakeBigtableTableAdminConnection()); + instance_admin_ = + std::make_unique( + bigtable_admin::MakeBigtableInstanceAdminConnection()); + } + + std::unique_ptr table_admin_; + std::unique_ptr instance_admin_; +}; + +/// @test Verify that `bigtable::TableAdmin` Backup CRUD operations work as +/// expected. +TEST_F(AdminBackupIntegrationTest, CreateListGetUpdateRestoreDeleteBackup) { + auto const table_id = bigtable::testing::TableTestEnvironment::table_id(); + auto const table_name = + bigtable::TableName(project_id(), instance_id(), table_id); + + auto clusters = instance_admin_->ListClusters( + bigtable::InstanceName(project_id(), instance_id())); + ASSERT_STATUS_OK(clusters); + auto const cluster_name = clusters->clusters().begin()->name(); + auto const cluster_id = + cluster_name.substr(cluster_name.rfind('/') + 1, + cluster_name.size() - cluster_name.rfind('/')); + auto const backup_id = RandomBackupId(); + auto backup_name = + bigtable::BackupName(project_id(), instance_id(), cluster_id, backup_id); + + // Create backup + // The proto documentation says backup expiration times are in "microseconds + // granularity": + // https://cloud.google.com/bigtable/docs/reference/admin/rpc/google.bigtable.admin.v2#google.bigtable.admin.v2.Backup + auto expire_time = std::chrono::time_point_cast( + std::chrono::system_clock::now() + std::chrono::hours(12)); + + 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), + backup_id, b) + .get(); + + ASSERT_STATUS_OK(backup); + EXPECT_EQ(backup->name(), backup_name); + + // List backups to verify new backup has been created + auto backups = table_admin_->ListBackups(cluster_name); + std::vector backups_list; + for (auto& b : backups) { + ASSERT_STATUS_OK(b); + backups_list.push_back(*b); + } + EXPECT_THAT(BackupNames(backups_list), Contains(backup_name)); + + // Get backup to verify create + backup = table_admin_->GetBackup(backup_name); + ASSERT_STATUS_OK(backup); + EXPECT_EQ(backup->name(), backup_name); + + // Update backup + expire_time += std::chrono::hours(12); + google::bigtable::admin::v2::Backup update_backup = *backup; + *update_backup.mutable_expire_time() = ToProtoTimestamp(expire_time); + google::protobuf::FieldMask update_mask; + update_mask.add_paths("expire_time"); + backup = table_admin_->UpdateBackup(update_backup, update_mask); + ASSERT_STATUS_OK(backup); + + // Verify the update + backup = table_admin_->GetBackup(backup_name); + ASSERT_STATUS_OK(backup); + EXPECT_EQ(backup->name(), backup_name); + EXPECT_THAT(backup->expire_time(), + IsProtoEqual(ToProtoTimestamp(expire_time))); + + // Delete table + EXPECT_STATUS_OK(table_admin_->DeleteTable(table_name)); + + // Verify the delete + google::bigtable::admin::v2::ListTablesRequest list_request; + list_request.set_parent(bigtable::InstanceName(project_id(), instance_id())); + list_request.set_view(btadmin::Table::NAME_ONLY); + auto tables = table_admin_->ListTables(list_request); + std::vector table_list; + for (auto& t : tables) { + ASSERT_STATUS_OK(t); + table_list.push_back(*t); + } + EXPECT_THAT(TableNames(table_list), Not(Contains(table_name))); + + // Restore table + google::bigtable::admin::v2::RestoreTableRequest restore_request; + restore_request.set_parent( + bigtable::InstanceName(project_id(), instance_id())); + restore_request.set_backup(backup_name); + restore_request.set_table_id(table_id); + auto table = table_admin_->RestoreTable(restore_request).get(); + EXPECT_STATUS_OK(table); + + // Verify the restore + tables = table_admin_->ListTables(list_request); + table_list.clear(); + for (auto& t : tables) { + ASSERT_STATUS_OK(t); + table_list.push_back(*t); + } + EXPECT_THAT(TableNames(table_list), Contains(table_name).Times(1)); + + // Delete backup + EXPECT_STATUS_OK(table_admin_->DeleteBackup(backup_name)); +} + +} // namespace +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable +} // namespace cloud +} // namespace google + +int main(int argc, char* argv[]) { + ::testing::InitGoogleMock(&argc, argv); + (void)::testing::AddGlobalTestEnvironment( + new google::cloud::bigtable::testing::TableAdminTestEnvironment); + return RUN_ALL_TESTS(); +} diff --git a/google/cloud/bigtable/tests/table_admin_iam_policy_integration_test.cc b/google/cloud/bigtable/tests/table_admin_iam_policy_integration_test.cc new file mode 100644 index 0000000000000..fd7927804e961 --- /dev/null +++ b/google/cloud/bigtable/tests/table_admin_iam_policy_integration_test.cc @@ -0,0 +1,85 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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/admin/bigtable_table_admin_client.h" +#include "google/cloud/bigtable/iam_binding.h" +#include "google/cloud/bigtable/iam_policy.h" +#include "google/cloud/bigtable/testing/table_integration_test.h" +#include "google/cloud/internal/getenv.h" +#include "google/cloud/testing_util/chrono_literals.h" +#include "google/cloud/testing_util/status_matchers.h" +#include + +namespace google { +namespace cloud { +namespace bigtable { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { + +class AdminIAMPolicyIntegrationTest + : public bigtable::testing::TableIntegrationTest { + protected: + void SetUp() override { + TableIntegrationTest::SetUp(); + + service_account_ = google::cloud::internal::GetEnv( + "GOOGLE_CLOUD_CPP_BIGTABLE_TEST_SERVICE_ACCOUNT") + .value_or(""); + ASSERT_FALSE(service_account_.empty()); + + table_admin_ = std::make_unique( + bigtable_admin::MakeBigtableTableAdminConnection()); + } + + std::string service_account_; + std::unique_ptr table_admin_; +}; + +/// @test Verify that IAM Policy APIs work as expected. +TEST_F(AdminIAMPolicyIntegrationTest, SetGetTestIamAPIsTest) { + auto const table_id = bigtable::testing::TableTestEnvironment::table_id(); + + auto table_name = bigtable::TableName(project_id(), instance_id(), table_id); + + auto iam_policy = bigtable::IamPolicy({bigtable::IamBinding( + "roles/bigtable.reader", {"serviceAccount:" + service_account_})}); + + auto initial_policy = table_admin_->SetIamPolicy(table_name, iam_policy); + ASSERT_STATUS_OK(initial_policy); + + auto fetched_policy = table_admin_->GetIamPolicy(table_name); + ASSERT_STATUS_OK(fetched_policy); + + EXPECT_EQ(initial_policy->version(), fetched_policy->version()); + EXPECT_EQ(initial_policy->etag(), fetched_policy->etag()); + + auto permission_set = table_admin_->TestIamPermissions( + table_name, {"bigtable.tables.get", "bigtable.tables.readRows"}); + ASSERT_STATUS_OK(permission_set); + + EXPECT_EQ(2, permission_set->permissions().size()); +} + +} // namespace +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable +} // namespace cloud +} // namespace google + +int main(int argc, char* argv[]) { + ::testing::InitGoogleMock(&argc, argv); + (void)::testing::AddGlobalTestEnvironment( + new google::cloud::bigtable::testing::TableTestEnvironment); + return RUN_ALL_TESTS(); +} diff --git a/google/cloud/bigtable/tests/table_admin_integration_test.cc b/google/cloud/bigtable/tests/table_admin_integration_test.cc new file mode 100644 index 0000000000000..1f79a23ba4bba --- /dev/null +++ b/google/cloud/bigtable/tests/table_admin_integration_test.cc @@ -0,0 +1,481 @@ +// Copyright 2017 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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/admin/bigtable_instance_admin_client.h" +#include "google/cloud/bigtable/admin/bigtable_table_admin_client.h" +#include "google/cloud/bigtable/cluster_config.h" +#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" +#include "google/cloud/testing_util/status_matchers.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace bigtable { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { + +using ::testing::Contains; +using ::testing::HasSubstr; +using ::testing::IsSupersetOf; +using ::testing::Not; + +using ::google::cloud::bigtable::testing::TableTestEnvironment; + +namespace btadmin = ::google::bigtable::admin::v2; + +class TableAdminIntegrationTest + : public bigtable::testing::TableIntegrationTest { + protected: + std::unique_ptr table_admin_; + + void SetUp() override { + TableIntegrationTest::SetUp(); + + table_admin_ = std::make_unique( + bigtable_admin::MakeBigtableTableAdminConnection()); + } +}; + +TEST_F(TableAdminIntegrationTest, TableListWithMultipleTables) { + std::vector ids; + std::vector expected_tables; + + auto instance_name = bigtable::InstanceName(project_id(), instance_id()); + + // Create tables + int constexpr kTableCount = 5; + for (int index = 0; index < kTableCount; ++index) { + std::string table_id = RandomTableId(); + EXPECT_STATUS_OK(table_admin_->CreateTable(instance_name, table_id, {})); + ids.emplace_back(table_id); + expected_tables.emplace_back( + bigtable::TableName(project_id(), instance_id(), std::move(table_id))); + } + google::bigtable::admin::v2::ListTablesRequest list_request; + list_request.set_parent(instance_name); + list_request.set_view(btadmin::Table::NAME_ONLY); + auto tables = table_admin_->ListTables(list_request); + std::vector table_list; + for (auto& t : tables) { + ASSERT_STATUS_OK(t); + table_list.push_back(*t); + } + EXPECT_THAT(TableNames(table_list), IsSupersetOf(expected_tables)); + + // Delete the tables so future tests have a clean slate. + for (auto const& table_id : ids) { + EXPECT_STATUS_OK(table_admin_->DeleteTable( + TableName(project_id(), instance_id(), table_id))); + } + + // Verify the tables were deleted. + tables = table_admin_->ListTables(list_request); + table_list.clear(); + for (auto& t : tables) { + ASSERT_STATUS_OK(t); + table_list.push_back(*t); + } + auto names = TableNames(table_list); + for (auto const& t : expected_tables) { + EXPECT_THAT(names, Not(Contains(t))); + } +} + +TEST_F(TableAdminIntegrationTest, DropRowsByPrefix) { + auto table = GetTable(); + + // Create a vector of cell which will be inserted into bigtable + std::string const row_key1_prefix = "DropRowPrefix1"; + std::string const row_key2_prefix = "DropRowPrefix2"; + std::string const row_key1 = row_key1_prefix + "-Key1"; + std::string const row_key1_1 = row_key1_prefix + "_1-Key1"; + std::string const row_key2 = row_key2_prefix + "-Key2"; + std::vector created_cells{ + {row_key1, "family1", "column_id1", 0, "v-c-0-0"}, + {row_key1, "family1", "column_id1", 1000, "v-c-0-1"}, + {row_key1, "family2", "column_id3", 2000, "v-c-0-2"}, + {row_key1_1, "family2", "column_id3", 2000, "v-c-0-2"}, + {row_key1_1, "family2", "column_id3", 3000, "v-c-0-2"}, + {row_key2, "family2", "column_id2", 2000, "v-c0-0-0"}, + {row_key2, "family3", "column_id3", 3000, "v-c1-0-2"}, + }; + std::vector expected_cells{ + {row_key2, "family2", "column_id2", 2000, "v-c0-0-0"}, + {row_key2, "family3", "column_id3", 3000, "v-c1-0-2"}}; + + // Create records + CreateCells(table, created_cells); + // Delete all the records for a row + google::bigtable::admin::v2::DropRowRangeRequest drop_rows_by_prefix; + drop_rows_by_prefix.set_name(table.table_name()); + drop_rows_by_prefix.set_row_key_prefix(row_key1_prefix); + EXPECT_STATUS_OK(table_admin_->DropRowRange(drop_rows_by_prefix)); + auto actual_cells = ReadRows(table, bigtable::Filter::PassAllFilter()); + CheckEqualUnordered(expected_cells, actual_cells); +} + +TEST_F(TableAdminIntegrationTest, DropAllRows) { + auto table = GetTable(); + + // Create a vector of cell which will be inserted into bigtable + std::string const row_key1 = "DropRowKey1"; + std::string const row_key2 = "DropRowKey2"; + std::vector created_cells{ + {row_key1, "family1", "column_id1", 0, "v-c-0-0"}, + {row_key1, "family1", "column_id1", 1000, "v-c-0-1"}, + {row_key1, "family2", "column_id3", 2000, "v-c-0-2"}, + {row_key2, "family2", "column_id2", 2000, "v-c0-0-0"}, + {row_key2, "family3", "column_id3", 3000, "v-c1-0-2"}, + }; + + // Create records + CreateCells(table, created_cells); + // Delete all the records from a table + google::bigtable::admin::v2::DropRowRangeRequest drop_all_rows; + drop_all_rows.set_name(table.table_name()); + drop_all_rows.set_delete_all_data_from_table(true); + EXPECT_STATUS_OK(table_admin_->DropRowRange(drop_all_rows)); + auto actual_cells = ReadRows(table, bigtable::Filter::PassAllFilter()); + ASSERT_TRUE(actual_cells.empty()); +} + +/// @test Verify that `bigtable::TableAdmin` CRUD operations work as expected. +TEST_F(TableAdminIntegrationTest, CreateListGetDeleteTable) { + using GC = bigtable::GcRule; + auto const table_id = RandomTableId(); + auto const table_name = + bigtable::TableName(project_id(), instance_id(), table_id); + auto const instance_name = InstanceName(project_id(), instance_id()); + + // Create table config + bigtable::TableConfig table_config( + {{"fam", GC::MaxNumVersions(5)}, + {"foo", GC::MaxAge(std::chrono::hours(24))}}, + {"a1000", "a2000", "b3000", "m5000"}); + + // Create table + google::bigtable::admin::v2::CreateTableRequest create_request = + std::move(table_config).as_proto(); + create_request.set_parent(instance_name); + create_request.set_table_id(table_id); + ASSERT_STATUS_OK(table_admin_->CreateTable(create_request)); + bigtable::Table table(MakeDataConnection(), + TableResource(project_id(), instance_id(), table_id)); + + // List tables + google::bigtable::admin::v2::ListTablesRequest list_request; + list_request.set_parent(instance_name); + list_request.set_view(btadmin::Table::NAME_ONLY); + auto tables = table_admin_->ListTables(list_request); + auto table_list = TableNames(tables); + ASSERT_STATUS_OK(table_list); + EXPECT_THAT(*table_list, Contains(table_name)); + + // Get table + google::bigtable::admin::v2::GetTableRequest get_request; + get_request.set_name(table_name); + get_request.set_view(btadmin::Table::FULL); + auto table_detailed = table_admin_->GetTable(get_request); + ASSERT_STATUS_OK(table_detailed); + + // Verify new table was created + EXPECT_EQ(table.table_name(), table_detailed->name()) + << "Mismatched names for GetTable(" << table_id + << "): " << table.table_name() << " != " << table_detailed->name(); + auto count_matching_families = [](btadmin::Table const& table, + std::string const& name) { + int count = 0; + for (auto const& kv : table.column_families()) { + if (kv.first == name) { + ++count; + } + } + return count; + }; + EXPECT_EQ(1, count_matching_families(*table_detailed, "fam")); + EXPECT_EQ(1, count_matching_families(*table_detailed, "foo")); + + // Update table + std::vector< + google::bigtable::admin::v2::ModifyColumnFamiliesRequest::Modification> + column_modification_list = { + bigtable::ColumnFamilyModification::Create( + "newfam", GC::Intersection(GC::MaxAge(std::chrono::hours(7 * 24)), + GC::MaxNumVersions(1))) + .as_proto(), + bigtable::ColumnFamilyModification::Update("fam", + GC::MaxNumVersions(2)) + .as_proto(), + bigtable::ColumnFamilyModification::Drop("foo").as_proto()}; + + auto table_modified = + table_admin_->ModifyColumnFamilies(table_name, column_modification_list); + ASSERT_STATUS_OK(table_modified); + EXPECT_EQ(1, count_matching_families(*table_modified, "fam")); + EXPECT_EQ(0, count_matching_families(*table_modified, "foo")); + EXPECT_EQ(1, count_matching_families(*table_modified, "newfam")); + auto const& gc = table_modified->column_families().at("newfam").gc_rule(); + EXPECT_TRUE(gc.has_intersection()); + EXPECT_EQ(2, gc.intersection().rules_size()); + + // Delete table + EXPECT_STATUS_OK(table_admin_->DeleteTable(table_name)); + + // List to verify it is no longer there + tables = table_admin_->ListTables(list_request); + table_list = TableNames(tables); + ASSERT_STATUS_OK(table_list); + EXPECT_THAT(*table_list, Not(Contains(table_name))); +} + +/// @test Verify that `bigtable::TableAdmin` WaitForConsistencyCheck works as +/// expected. +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 = TableTestEnvironment::RandomInstanceId(); + auto const random_table_id = RandomTableId(); + + // Create a bigtable::InstanceAdmin and a bigtable::TableAdmin to create the + // new instance and the new table. + auto instance_admin = + std::make_unique( + bigtable_admin::MakeBigtableInstanceAdminConnection()); + auto table_admin_connection = + bigtable_admin::MakeBigtableTableAdminConnection(); + auto table_admin = std::make_unique( + table_admin_connection); + + // The instance configuration is involved, it needs two clusters, which must + // be production clusters (and therefore have at least 3 nodes each), and + // 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 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}}); + + // Create the new instance. + auto create_request = config.as_proto(); + create_request.set_parent(Project(project_id()).FullName()); + auto instance = instance_admin->CreateInstance(create_request).get(); + ASSERT_STATUS_OK(instance); + + // The table is going to be very simple, just one column family. + std::string const family = "column_family"; + bigtable::TableConfig table_config = bigtable::TableConfig( + {{family, bigtable::GcRule::MaxNumVersions(10)}}, {}); + + // Create the new table. + auto request = std::move(table_config).as_proto(); + request.set_parent(InstanceName(project_id(), id)); + request.set_table_id(random_table_id); + auto table_created = table_admin->CreateTable(request); + ASSERT_STATUS_OK(table_created); + + // We need to mutate the data in the table and then wait for those mutations + // to propagate to both clusters. First create a `bigtable::Table` object. + auto table = Table(MakeDataConnection(), + TableResource(project_id(), id, random_table_id)); + // Insert some cells into the table. + std::string const row_key1 = "check-consistency-row1"; + std::string const row_key2 = "check-consistency-row2"; + std::vector created_cells{ + {row_key1, family, "column1", 1000, "not interesting"}, + {row_key1, family, "column2", 1000, "not interesting"}, + {row_key1, family, "column1", 2000, "not interesting"}, + {row_key2, family, "column2", 2000, "not interesting"}, + {row_key2, family, "column1", 3000, "not interesting"}, + }; + CreateCells(table, created_cells); + + // Create a consistency token after modifying the table. + auto consistency_token = + table_admin->GenerateConsistencyToken(table_created->name()); + ASSERT_STATUS_OK(consistency_token); + + // Wait until all the mutations before the `consistency_token` have propagated + // everywhere. + // google::cloud::future> + // result = google::cloud::bigtable_admin::WaitForConsistency( + // table_admin_connection, table_created->name(), + // consistency_token->consistency_token()); + + google::bigtable::admin::v2::CheckConsistencyRequest wait_request; + wait_request.set_name(table_created->name()); + wait_request.set_consistency_token(consistency_token->consistency_token()); + future> + result = table_admin->WaitForConsistency(wait_request); + StatusOr + is_consistent = result.get(); + ASSERT_STATUS_OK(is_consistent); + EXPECT_TRUE(is_consistent->consistent()); + + // Cleanup the table and the instance. + EXPECT_STATUS_OK(table_admin->DeleteTable(table_created->name())); + EXPECT_STATUS_OK(instance_admin->DeleteInstance(instance->name())); +} + +/// @test Verify rpc logging for `bigtable::TableAdmin` +TEST_F(TableAdminIntegrationTest, CreateListGetDeleteTableWithLogging) { + using GC = bigtable::GcRule; + // In our ci builds, we set GOOGLE_CLOUD_CPP_ENABLE_TRACING to log our tests, + // by default. We should unset this variable and create a fresh client in + // order to have a conclusive test. + testing_util::ScopedEnvironment env = {"GOOGLE_CLOUD_CPP_ENABLE_TRACING", + absl::nullopt}; + testing_util::ScopedLog log; + + auto const instance_name = + bigtable::InstanceName(project_id(), instance_id()); + + auto const table_id = RandomTableId(); + auto const table_name = + bigtable::TableName(project_id(), instance_id(), table_id); + + auto table_admin = std::make_unique( + bigtable_admin::MakeBigtableTableAdminConnection( + Options{}.set({"rpc"}))); + + // Create table config + bigtable::TableConfig table_config( + {{"fam", GC::MaxNumVersions(5)}, + {"foo", GC::MaxAge(std::chrono::hours(24))}}, + {"a1000", "a2000", "b3000", "m5000"}); + + // Create table + auto request = std::move(table_config).as_proto(); + request.set_parent(instance_name); + request.set_table_id(table_id); + ASSERT_STATUS_OK(table_admin->CreateTable(request)); + bigtable::Table table(MakeDataConnection(), + TableResource(project_id(), instance_id(), table_id)); + + // List tables + google::bigtable::admin::v2::ListTablesRequest list_request; + list_request.set_parent(instance_name); + list_request.set_view(btadmin::Table::NAME_ONLY); + auto tables = table_admin->ListTables(list_request); + std::vector table_list; + for (auto& t : tables) { + ASSERT_STATUS_OK(t); + table_list.push_back(*t); + } + EXPECT_THAT(TableNames(table_list), Contains(table_name)); + + // Get table + google::bigtable::admin::v2::GetTableRequest get_request; + get_request.set_name(table_name); + get_request.set_view(btadmin::Table::FULL); + auto table_detailed = table_admin->GetTable(get_request); + ASSERT_STATUS_OK(table_detailed); + + // Verify new table was created + EXPECT_EQ(table.table_name(), table_detailed->name()) + << "Mismatched names for GetTable(" << table_id + << "): " << table.table_name() << " != " << table_detailed->name(); + auto count_matching_families = [](btadmin::Table const& table, + std::string const& name) { + int count = 0; + for (auto const& kv : table.column_families()) { + if (kv.first == name) { + ++count; + } + } + return count; + }; + EXPECT_EQ(1, count_matching_families(*table_detailed, "fam")); + EXPECT_EQ(1, count_matching_families(*table_detailed, "foo")); + + // Update table + std::vector< + google::bigtable::admin::v2::ModifyColumnFamiliesRequest::Modification> + column_modification_list = { + bigtable::ColumnFamilyModification::Create( + "newfam", GC::Intersection(GC::MaxAge(std::chrono::hours(7 * 24)), + GC::MaxNumVersions(1))) + .as_proto(), + bigtable::ColumnFamilyModification::Update("fam", + GC::MaxNumVersions(2)) + .as_proto(), + bigtable::ColumnFamilyModification::Drop("foo").as_proto()}; + + auto table_modified = + table_admin->ModifyColumnFamilies(table_name, column_modification_list); + ASSERT_STATUS_OK(table_modified); + EXPECT_EQ(1, count_matching_families(*table_modified, "fam")); + EXPECT_EQ(0, count_matching_families(*table_modified, "foo")); + EXPECT_EQ(1, count_matching_families(*table_modified, "newfam")); + auto const& gc = table_modified->column_families().at("newfam").gc_rule(); + EXPECT_TRUE(gc.has_intersection()); + EXPECT_EQ(2, gc.intersection().rules_size()); + + // Delete table + EXPECT_STATUS_OK(table_admin->DeleteTable(table_name)); + + // List to verify it is no longer there + tables = table_admin->ListTables(list_request); + table_list.clear(); + for (auto& t : tables) { + ASSERT_STATUS_OK(t); + table_list.push_back(*t); + } + EXPECT_THAT(TableNames(table_list), Not(Contains(table_name))); + + auto const log_lines = log.ExtractLines(); + EXPECT_THAT(log_lines, Contains(HasSubstr("CreateTable"))); + EXPECT_THAT(log_lines, Contains(HasSubstr("ListTables"))); + EXPECT_THAT(log_lines, Contains(HasSubstr("GetTable"))); + EXPECT_THAT(log_lines, Contains(HasSubstr("ModifyColumnFamilies"))); + EXPECT_THAT(log_lines, Contains(HasSubstr("DeleteTable"))); + + // Verify that a normal client does not log. + auto no_logging_client = bigtable_admin::BigtableTableAdminClient( + bigtable_admin::MakeBigtableTableAdminConnection()); + (void)no_logging_client.ListTables(list_request); + EXPECT_THAT(log.ExtractLines(), Not(Contains(HasSubstr("ListTables")))); +} + +} // namespace +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable +} // namespace cloud +} // namespace google + +int main(int argc, char* argv[]) { + ::testing::InitGoogleMock(&argc, argv); + (void)::testing::AddGlobalTestEnvironment( + new google::cloud::bigtable::testing::TableAdminTestEnvironment); + return RUN_ALL_TESTS(); +} diff --git a/google/cloud/bigtable/tests/table_sample_rows_integration_test.cc b/google/cloud/bigtable/tests/table_sample_rows_integration_test.cc index bdb78871a410c..30388be60523a 100644 --- a/google/cloud/bigtable/tests/table_sample_rows_integration_test.cc +++ b/google/cloud/bigtable/tests/table_sample_rows_integration_test.cc @@ -12,12 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "google/cloud/bigtable/client_options.h" -#include "google/cloud/bigtable/data_client.h" #include "google/cloud/bigtable/mutations.h" #include "google/cloud/bigtable/row_key_sample.h" #include "google/cloud/bigtable/table.h" #include "google/cloud/bigtable/testing/table_integration_test.h" +#include "google/cloud/grpc_options.h" #include "google/cloud/testing_util/integration_test.h" #include "google/cloud/testing_util/status_matchers.h" #include @@ -38,12 +37,6 @@ namespace { using ::google::cloud::bigtable::testing::TableTestEnvironment; using ::testing::IsEmpty; -Table GetTable() { - return Table(MakeDataClient(TableTestEnvironment::project_id(), - TableTestEnvironment::instance_id()), - TableTestEnvironment::table_id()); -} - void VerifySamples(StatusOr> samples) { ASSERT_STATUS_OK(samples); @@ -135,21 +128,6 @@ TEST_F(SampleRowsIntegrationTest, AsyncWithDataConnection) { VerifySamples(fut.get()); }; -TEST_F(SampleRowsIntegrationTest, SyncWithDataClient) { - auto table = GetTable(); - VerifySamples(table.SampleRows()); -}; - -TEST_F(SampleRowsIntegrationTest, AsyncWithDataClient) { - auto table = GetTable(); - auto fut = table.AsyncSampleRows(); - - // Block until the asynchronous operation completes. This is not what one - // would do in a real application (the synchronous API is better in that - // case), but we need to wait before checking the results. - VerifySamples(fut.get()); -}; - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable diff --git a/google/cloud/bigtable/timestamp.h b/google/cloud/bigtable/timestamp.h index 35cb92a7a0411..44b5068d9bcf9 100644 --- a/google/cloud/bigtable/timestamp.h +++ b/google/cloud/bigtable/timestamp.h @@ -18,7 +18,7 @@ #include "google/cloud/bigtable/version.h" #include "google/cloud/status_or.h" #include "absl/time/time.h" -#include +#include "google/protobuf/timestamp.pb.h" #include #include #include diff --git a/google/cloud/bigtable/timestamp_test.cc b/google/cloud/bigtable/timestamp_test.cc index 9f752ca9910ed..8671443ddb770 100644 --- a/google/cloud/bigtable/timestamp_test.cc +++ b/google/cloud/bigtable/timestamp_test.cc @@ -14,7 +14,7 @@ #include "google/cloud/bigtable/timestamp.h" #include "google/cloud/testing_util/status_matchers.h" -#include +#include "google/protobuf/timestamp.pb.h" #include #include #include diff --git a/google/cloud/bigtable/tools/run_emulator_utils.sh b/google/cloud/bigtable/tools/run_emulator_utils.sh index 807ae6efb41a9..dc91f71083889 100755 --- a/google/cloud/bigtable/tools/run_emulator_utils.sh +++ b/google/cloud/bigtable/tools/run_emulator_utils.sh @@ -25,12 +25,12 @@ INSTANCE_ADMIN_EMULATOR_PID=0 function kill_emulators() { io::log "Killing Bigtable Emulators..." echo -n "EMULATOR_PID=${EMULATOR_PID} " - kill "${EMULATOR_PID}" || echo -n "-" + kill -9 "${EMULATOR_PID}" || echo -n "-" echo -n "." wait "${EMULATOR_PID}" >/dev/null 2>&1 || echo -n "+" echo "." echo -n "INSTANCE_ADMIN_EMULATOR_PID=${INSTANCE_ADMIN_EMULATOR_PID} " - kill "${INSTANCE_ADMIN_EMULATOR_PID}" || echo -n "-" + kill -9 "${INSTANCE_ADMIN_EMULATOR_PID}" || echo -n "-" echo -n "." wait "${INSTANCE_ADMIN_EMULATOR_PID}" >/dev/null 2>&1 || echo -n "+" echo "." diff --git a/google/cloud/bigtable/value.cc b/google/cloud/bigtable/value.cc index 54eee891c70cf..b1ed1da4d4165 100644 --- a/google/cloud/bigtable/value.cc +++ b/google/cloud/bigtable/value.cc @@ -18,10 +18,10 @@ #include "absl/container/flat_hash_set.h" #include "absl/strings/cord.h" #include "absl/strings/substitute.h" -#include +#include "google/bigtable/v2/types.pb.h" +#include "google/type/date.pb.h" #include #include -#include #include namespace google { diff --git a/google/cloud/bigtable/value.h b/google/cloud/bigtable/value.h index 100b441ae3baf..70d3984221719 100644 --- a/google/cloud/bigtable/value.h +++ b/google/cloud/bigtable/value.h @@ -19,9 +19,9 @@ #include "google/cloud/internal/make_status.h" #include "google/cloud/status_or.h" #include "bytes.h" +#include "google/bigtable/v2/data.pb.h" +#include "google/bigtable/v2/types.pb.h" #include "timestamp.h" -#include -#include #include #include diff --git a/google/cloud/bigtable/value_test.cc b/google/cloud/bigtable/value_test.cc index 6cc7853633887..d18c36eed6089 100644 --- a/google/cloud/bigtable/value_test.cc +++ b/google/cloud/bigtable/value_test.cc @@ -19,8 +19,8 @@ #include "google/cloud/testing_util/status_matchers.h" #include "absl/strings/cord.h" #include "absl/strings/substitute.h" +#include "google/type/date.pb.h" #include -#include #include #include #include diff --git a/google/cloud/bigtable/version.h b/google/cloud/bigtable/version.h index a69dff7feea46..27eab2fc6b104 100644 --- a/google/cloud/bigtable/version.h +++ b/google/cloud/bigtable/version.h @@ -81,8 +81,6 @@ int constexpr version() { return google::cloud::version(); } std::string version_string(); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -// TODO(#7463) - remove backwards compatibility namespaces -namespace v1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace bigtable } // namespace cloud } // namespace google diff --git a/google/cloud/bigtable/wait_for_consistency.cc b/google/cloud/bigtable/wait_for_consistency.cc deleted file mode 100644 index 1b1d235e80c37..0000000000000 --- a/google/cloud/bigtable/wait_for_consistency.cc +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/wait_for_consistency.h" -#include "google/cloud/bigtable/admin/bigtable_table_admin_options.h" -#include "google/cloud/bigtable/admin/internal/bigtable_table_admin_option_defaults.h" -#include "google/cloud/internal/make_status.h" -#include - -namespace google { -namespace cloud { -namespace bigtable_admin { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -// This class borrows heavily from `google::cloud::internal::AsyncRetryLoop` -class AsyncWaitForConsistencyImpl - : public std::enable_shared_from_this { - public: - AsyncWaitForConsistencyImpl(CompletionQueue cq, - BigtableTableAdminClient client, - std::string table_name, - std::string consistency_token, Options options) - : cq_(std::move(cq)), - client_(std::move(client)), - options_(bigtable_admin_internal::BigtableTableAdminDefaultOptions( - std::move(options))), - polling_policy_(options_.get()) { - request_.set_name(std::move(table_name)); - request_.set_consistency_token(std::move(consistency_token)); - } - - future Start() { - auto w = std::weak_ptr(shared_from_this()); - result_ = promise([w] { - if (auto self = w.lock()) self->Cancel(); - }); - - StartAttempt(); - return result_.get_future(); - } - - private: - using RespType = StatusOr; - using TimerResult = StatusOr; - - struct State { - bool cancelled; - std::uint_fast32_t operation; - }; - - State StartOperation() { - std::unique_lock lk(mu_); - if (!cancelled_) return State{false, ++operation_}; - return SetDoneWithCancel(std::move(lk)); - } - - State OnOperation() { - std::unique_lock lk(mu_); - if (!cancelled_) return State{false, operation_}; - return SetDoneWithCancel(std::move(lk)); - } - - void StartAttempt() { - auto self = this->shared_from_this(); - auto state = StartOperation(); - if (state.cancelled) return; - SetPending( - state.operation, - client_.AsyncCheckConsistency(request_, options_) - .then([self](future f) { self->OnAttempt(f.get()); })); - } - - void StartBackoff() { - auto self = this->shared_from_this(); - auto state = StartOperation(); - if (state.cancelled) return; - SetPending( - state.operation, - cq_.MakeRelativeTimer(polling_policy_->WaitPeriod()) - .then([self](future f) { self->OnBackoff(f.get()); })); - } - - void OnAttempt(RespType result) { - // A successful attempt, set the value and finish the loop. - if (result.ok() && result->consistent()) { - SetDone(Status()); - return; - } - auto status = std::move(result).status(); - if (!polling_policy_->OnFailure(status)) { - if (!status.ok()) return SetDone(std::move(status)); - return SetDone(internal::DeadlineExceededError( - "Polling loop terminated by polling policy", GCP_ERROR_INFO())); - } - StartBackoff(); - } - - void OnBackoff(TimerResult tp) { - auto state = OnOperation(); - // Check for the retry loop cancellation first. We want to report that - // status instead of the timer failure in that case. - if (state.cancelled) return; - if (!tp) { - // Some kind of error in the CompletionQueue, probably shutting down. - return SetDone(std::move(tp).status()); - } - StartAttempt(); - } - - void SetPending(std::uint_fast32_t operation, future op) { - std::unique_lock lk(mu_); - if (operation_ == operation) pending_operation_ = std::move(op); - if (cancelled_) return Cancel(std::move(lk)); - } - - void SetDone(Status value) { - std::unique_lock lk(mu_); - if (done_) return; - done_ = true; - lk.unlock(); - result_.set_value(std::move(value)); - } - - State SetDoneWithCancel(std::unique_lock lk) { - if (done_) return State{true, 0}; - done_ = true; - lk.unlock(); - result_.set_value( - internal::CancelledError("Operation cancelled", GCP_ERROR_INFO())); - return State{true, 0}; - } - - void Cancel() { return Cancel(std::unique_lock(mu_)); } - - void Cancel(std::unique_lock lk) { - cancelled_ = true; - future f = std::move(pending_operation_); - lk.unlock(); - f.cancel(); - } - - CompletionQueue cq_; - bigtable::admin::v2::CheckConsistencyRequest request_; - BigtableTableAdminClient client_; - Options options_; - std::shared_ptr polling_policy_; - promise result_; - - // Only the following variables require synchronization, as they coordinate - // the work between the retry loop (which would be lock-free) and the cancel - // requests (which need locks). - std::mutex mu_; - bool cancelled_ = false; - bool done_ = false; - std::uint_fast32_t operation_ = 0; - future pending_operation_; -}; - -} // namespace - -future AsyncWaitForConsistency(CompletionQueue cq, - BigtableTableAdminClient client, - std::string table_name, - std::string consistency_token, - Options options) { - auto loop = std::make_shared( - std::move(cq), std::move(client), std::move(table_name), - std::move(consistency_token), std::move(options)); - return loop->Start(); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_admin -} // namespace cloud -} // namespace google diff --git a/google/cloud/bigtable/wait_for_consistency.h b/google/cloud/bigtable/wait_for_consistency.h deleted file mode 100644 index 3deb77fa7c05d..0000000000000 --- a/google/cloud/bigtable/wait_for_consistency.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_WAIT_FOR_CONSISTENCY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_WAIT_FOR_CONSISTENCY_H - -#include "google/cloud/bigtable/admin/bigtable_table_admin_client.h" -#include "google/cloud/completion_queue.h" - -namespace google { -namespace cloud { -namespace bigtable_admin { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * Polls until a table is consistent, or until the polling policy has expired. - * - * @param cq the completion queue that will execute the asynchronous - * calls. The application must ensure that one or more threads are - * blocked on `cq.Run()`. - * @param client the Table Admin client. - * @param table_name the fully qualified name of the table. Values are of the - * form: `projects/{project}/instances/{instance}/tables/{table}`. - * @param consistency_token the consistency token of the table. - * @param options (optional) configuration options. Users who wish to modify the - * default polling behavior can supply a custom polling policy with - * `BigtableTableAdminPollingPolicyOption`. Note that the client's polling - * policy is not used for this operation. - * @return the consistency status for the table. The status is OK if and only if - * the table is consistent. - */ -future AsyncWaitForConsistency(CompletionQueue cq, - BigtableTableAdminClient client, - std::string table_name, - std::string consistency_token, - Options options = {}); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_admin -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_WAIT_FOR_CONSISTENCY_H diff --git a/google/cloud/bigtable/wait_for_consistency_test.cc b/google/cloud/bigtable/wait_for_consistency_test.cc deleted file mode 100644 index 92ab58292d800..0000000000000 --- a/google/cloud/bigtable/wait_for_consistency_test.cc +++ /dev/null @@ -1,430 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/wait_for_consistency.h" -#include "google/cloud/bigtable/admin/bigtable_table_admin_connection.h" -#include "google/cloud/bigtable/admin/bigtable_table_admin_options.h" -#include "google/cloud/bigtable/admin/mocks/mock_bigtable_table_admin_connection.h" -#include "google/cloud/bigtable/resource_names.h" -#include "google/cloud/internal/background_threads_impl.h" -#include "google/cloud/testing_util/async_sequencer.h" -#include "google/cloud/testing_util/mock_completion_queue_impl.h" -#include "google/cloud/testing_util/status_matchers.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace bigtable_admin { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace btadmin = ::google::bigtable::admin::v2; -using MockConnection = - ::google::cloud::bigtable_admin_mocks::MockBigtableTableAdminConnection; -using RespType = StatusOr; -using TimerResult = StatusOr; -using ::google::cloud::testing_util::AsyncSequencer; -using ::google::cloud::testing_util::StatusIs; -using ::testing::HasSubstr; - -auto constexpr kLimitedErrorCount = 3; - -Options TestOptions() { - using us = std::chrono::microseconds; - auto retry = - BigtableTableAdminLimitedErrorCountRetryPolicy(kLimitedErrorCount); - auto backoff = ExponentialBackoffPolicy(us(1), us(5), 2.0); - auto polling = - GenericPollingPolicy( - retry.clone(), backoff.clone()); - - return Options{}.set(polling.clone()); -} - -RespType MakeResponse(bool consistent) { - btadmin::CheckConsistencyResponse r; - r.set_consistent(consistent); - return make_status_or(std::move(r)); -} - -TEST(AsyncWaitForConsistency, Simple) { - std::string const table_name = - bigtable::TableName("test-project", "test-instance", "test-table"); - std::string const token = "test-token"; - - CompletionQueue cq; - auto mock = std::make_shared(); - auto client = BigtableTableAdminClient(mock); - - EXPECT_CALL(*mock, AsyncCheckConsistency) - .WillOnce([&](btadmin::CheckConsistencyRequest const& request) { - EXPECT_EQ(request.name(), table_name); - EXPECT_EQ(request.consistency_token(), token); - return make_ready_future(MakeResponse(true)); - }); - - auto status = AsyncWaitForConsistency(cq, client, table_name, token).get(); - EXPECT_STATUS_OK(status); -} - -TEST(AsyncWaitForConsistency, NotConsistentThenSuccess) { - std::string const table_name = - bigtable::TableName("test-project", "test-instance", "test-table"); - std::string const token = "test-token"; - - internal::AutomaticallyCreatedBackgroundThreads background; - auto mock = std::make_shared(); - auto client = BigtableTableAdminClient(mock); - - EXPECT_CALL(*mock, AsyncCheckConsistency) - .WillOnce([&](btadmin::CheckConsistencyRequest const& request) { - EXPECT_EQ(request.name(), table_name); - EXPECT_EQ(request.consistency_token(), token); - return make_ready_future(MakeResponse(false)); - }) - .WillOnce([&](btadmin::CheckConsistencyRequest const& request) { - EXPECT_EQ(request.name(), table_name); - EXPECT_EQ(request.consistency_token(), token); - return make_ready_future(MakeResponse(true)); - }); - - auto status = AsyncWaitForConsistency(background.cq(), client, table_name, - token, TestOptions()) - .get(); - EXPECT_STATUS_OK(status); -} - -TEST(AsyncWaitForConsistency, PermanentFailure) { - std::string const table_name = - bigtable::TableName("test-project", "test-instance", "test-table"); - std::string const token = "test-token"; - - internal::AutomaticallyCreatedBackgroundThreads background; - auto mock = std::make_shared(); - auto client = BigtableTableAdminClient(mock); - - EXPECT_CALL(*mock, AsyncCheckConsistency) - .WillOnce([&](btadmin::CheckConsistencyRequest const& request) { - EXPECT_EQ(request.name(), table_name); - EXPECT_EQ(request.consistency_token(), token); - return make_ready_future( - Status(StatusCode::kPermissionDenied, "fail")); - }); - - auto status = AsyncWaitForConsistency(background.cq(), client, table_name, - token, TestOptions()) - .get(); - EXPECT_THAT(status, StatusIs(StatusCode::kPermissionDenied, "fail")); -} - -TEST(AsyncWaitForConsistency, TooManyTransientFailures) { - std::string const table_name = - bigtable::TableName("test-project", "test-instance", "test-table"); - std::string const token = "test-token"; - - internal::AutomaticallyCreatedBackgroundThreads background; - auto mock = std::make_shared(); - auto client = BigtableTableAdminClient(mock); - - EXPECT_CALL(*mock, AsyncCheckConsistency) - .Times(kLimitedErrorCount + 1) - .WillRepeatedly([&](btadmin::CheckConsistencyRequest const& request) { - EXPECT_EQ(request.name(), table_name); - EXPECT_EQ(request.consistency_token(), token); - return make_ready_future( - Status(StatusCode::kUnavailable, "try again")); - }); - - auto status = AsyncWaitForConsistency(background.cq(), client, table_name, - token, TestOptions()) - .get(); - EXPECT_THAT(status, - StatusIs(StatusCode::kUnavailable, HasSubstr("try again"))); -} - -TEST(AsyncWaitForConsistency, NeverConsistent) { - std::string const table_name = - bigtable::TableName("test-project", "test-instance", "test-table"); - std::string const token = "test-token"; - - internal::AutomaticallyCreatedBackgroundThreads background; - auto mock = std::make_shared(); - auto client = BigtableTableAdminClient(mock); - - EXPECT_CALL(*mock, AsyncCheckConsistency) - .Times(kLimitedErrorCount + 1) - .WillRepeatedly([&](btadmin::CheckConsistencyRequest const& request) { - EXPECT_EQ(request.name(), table_name); - EXPECT_EQ(request.consistency_token(), token); - return make_ready_future(MakeResponse(false)); - }); - - auto status = AsyncWaitForConsistency(background.cq(), client, table_name, - token, TestOptions()) - .get(); - EXPECT_THAT(status, StatusIs(StatusCode::kDeadlineExceeded, - HasSubstr("Polling loop terminated"))); -} - -TEST(AsyncWaitForConsistency, PassesOptionsToConnection) { - std::string const table_name = - bigtable::TableName("test-project", "test-instance", "test-table"); - std::string const token = "test-token"; - - struct TestOption { - using Type = std::string; - }; - - CompletionQueue cq; - auto mock = std::make_shared(); - auto client = BigtableTableAdminClient(mock); - - EXPECT_CALL(*mock, AsyncCheckConsistency) - .WillOnce([&](btadmin::CheckConsistencyRequest const& request) { - EXPECT_EQ(request.name(), table_name); - EXPECT_EQ(request.consistency_token(), token); - EXPECT_TRUE(internal::CurrentOptions().has()); - return make_ready_future(MakeResponse(true)); - }); - - EXPECT_FALSE(internal::CurrentOptions().has()); - auto status = AsyncWaitForConsistency(cq, client, table_name, token, - Options{}.set("value")) - .get(); - EXPECT_STATUS_OK(status); -} - -class AsyncWaitForConsistencyCancelTest : public ::testing::Test { - protected: - std::size_t RequestCancelCount() { return sequencer_.CancelCount("Request"); } - std::size_t TimerCancelCount() { return sequencer_.CancelCount("Timer"); } - - future SimulateRequest() { - return sequencer_.PushBack("Request").then( - [](future g) -> RespType { - auto status = g.get(); - if (!status.ok()) return status; - return MakeResponse(true); - }); - } - - future SimulateTimer(std::chrono::nanoseconds d) { - using std::chrono::system_clock; - auto tp = system_clock::now() + - std::chrono::duration_cast(d); - return sequencer_.PushBack("Timer").then( - [tp](future g) -> TimerResult { - auto status = g.get(); - if (!status.ok()) return status; - return tp; - }); - } - - promise WaitForRequest() { - auto p = sequencer_.PopFrontWithName(); - EXPECT_EQ("Request", p.second); - return std::move(p.first); - } - promise WaitForTimer() { - auto p = sequencer_.PopFrontWithName(); - EXPECT_THAT(p.second, "Timer"); - return std::move(p.first); - } - - std::shared_ptr - MakeMockCompletionQueue() { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, MakeRelativeTimer) - .WillRepeatedly( - [this](std::chrono::nanoseconds d) { return SimulateTimer(d); }); - return mock; - } - - private: - AsyncSequencer sequencer_; -}; - -TEST_F(AsyncWaitForConsistencyCancelTest, CancelAndSuccess) { - std::string const table_name = - bigtable::TableName("test-project", "test-instance", "test-table"); - std::string const token = "test-token"; - auto const transient = Status(StatusCode::kUnavailable, "try-again"); - - auto mock_cq = MakeMockCompletionQueue(); - CompletionQueue cq(mock_cq); - auto mock = std::make_shared(); - auto client = BigtableTableAdminClient(mock); - - EXPECT_CALL(*mock, AsyncCheckConsistency) - .Times(2) - .WillRepeatedly([&](btadmin::CheckConsistencyRequest const& request) { - EXPECT_EQ(request.name(), table_name); - EXPECT_EQ(request.consistency_token(), token); - return SimulateRequest(); - }); - - auto actual = - AsyncWaitForConsistency(cq, client, table_name, token, TestOptions()); - - // First simulate a regular request that results in a transient failure. - auto p = WaitForRequest(); - p.set_value(transient); - // Then simulate the backoff timer expiring. - p = WaitForTimer(); - p.set_value(Status{}); - // Then another request that gets cancelled. - p = WaitForRequest(); - EXPECT_EQ(0, RequestCancelCount()); - EXPECT_EQ(0, TimerCancelCount()); - actual.cancel(); - EXPECT_EQ(1, RequestCancelCount()); - EXPECT_EQ(0, TimerCancelCount()); - p.set_value(Status{}); - auto value = actual.get(); - ASSERT_STATUS_OK(value); -} - -TEST_F(AsyncWaitForConsistencyCancelTest, CancelWithFailure) { - std::string const table_name = - bigtable::TableName("test-project", "test-instance", "test-table"); - std::string const token = "test-token"; - auto const transient = Status(StatusCode::kUnavailable, "try-again"); - - auto mock_cq = MakeMockCompletionQueue(); - CompletionQueue cq(mock_cq); - auto mock = std::make_shared(); - auto client = BigtableTableAdminClient(mock); - - EXPECT_CALL(*mock, AsyncCheckConsistency) - .Times(2) - .WillRepeatedly([&](btadmin::CheckConsistencyRequest const& request) { - EXPECT_EQ(request.name(), table_name); - EXPECT_EQ(request.consistency_token(), token); - return SimulateRequest(); - }); - - auto actual = - AsyncWaitForConsistency(cq, client, table_name, token, TestOptions()); - - // First simulate a regular request. - auto p = WaitForRequest(); - p.set_value(transient); - // Then simulate the backoff timer expiring. - p = WaitForTimer(); - p.set_value(Status{}); - // This triggers a second request, which is called and fails too - p = WaitForRequest(); - EXPECT_EQ(0, RequestCancelCount()); - EXPECT_EQ(0, TimerCancelCount()); - actual.cancel(); - EXPECT_EQ(1, RequestCancelCount()); - EXPECT_EQ(0, TimerCancelCount()); - p.set_value(transient); - auto value = actual.get(); - EXPECT_THAT(value, StatusIs(StatusCode::kCancelled, - HasSubstr("Operation cancelled"))); -} - -TEST_F(AsyncWaitForConsistencyCancelTest, CancelDuringTimer) { - std::string const table_name = - bigtable::TableName("test-project", "test-instance", "test-table"); - std::string const token = "test-token"; - auto const transient = Status(StatusCode::kUnavailable, "try-again"); - - auto mock_cq = MakeMockCompletionQueue(); - CompletionQueue cq(mock_cq); - auto mock = std::make_shared(); - auto client = BigtableTableAdminClient(mock); - - EXPECT_CALL(*mock, AsyncCheckConsistency) - .WillOnce([&](btadmin::CheckConsistencyRequest const& request) { - EXPECT_EQ(request.name(), table_name); - EXPECT_EQ(request.consistency_token(), token); - return SimulateRequest(); - }); - - auto actual = - AsyncWaitForConsistency(cq, client, table_name, token, TestOptions()); - - // First simulate a regular request. - auto p = WaitForRequest(); - p.set_value(transient); - - // Wait for the timer to be set - p = WaitForTimer(); - // At this point there is a timer in the completion queue, cancel the call and - // simulate a cancel for the timer. - EXPECT_EQ(0, RequestCancelCount()); - EXPECT_EQ(0, TimerCancelCount()); - actual.cancel(); - EXPECT_EQ(0, RequestCancelCount()); - EXPECT_EQ(1, TimerCancelCount()); - p.set_value(Status(StatusCode::kCancelled, "timer cancel")); - // the retry loop should *not* create any more calls, the value should be - // available immediately. - auto value = actual.get(); - EXPECT_THAT(value, StatusIs(StatusCode::kCancelled, - HasSubstr("Operation cancelled"))); -} - -TEST_F(AsyncWaitForConsistencyCancelTest, ShutdownDuringTimer) { - std::string const table_name = - bigtable::TableName("test-project", "test-instance", "test-table"); - std::string const token = "test-token"; - auto const transient = Status(StatusCode::kUnavailable, "try-again"); - - auto mock_cq = MakeMockCompletionQueue(); - CompletionQueue cq(mock_cq); - auto mock = std::make_shared(); - auto client = BigtableTableAdminClient(mock); - - EXPECT_CALL(*mock, AsyncCheckConsistency) - .WillOnce([&](btadmin::CheckConsistencyRequest const& request) { - EXPECT_EQ(request.name(), table_name); - EXPECT_EQ(request.consistency_token(), token); - return SimulateRequest(); - }); - - auto actual = - AsyncWaitForConsistency(cq, client, table_name, token, TestOptions()); - - // First simulate a regular request. - auto p = WaitForRequest(); - p.set_value(transient); - - // Wait for the timer to be set - p = WaitForTimer(); - - // At this point there is a timer in the completion queue, simulate a - // CancelAll() + Shutdown(). - EXPECT_CALL(*mock_cq, CancelAll).Times(1); - EXPECT_CALL(*mock_cq, Shutdown).Times(1); - cq.CancelAll(); - cq.Shutdown(); - p.set_value(Status(StatusCode::kCancelled, "timer cancelled")); - - // the retry loop should exit - auto value = actual.get(); - EXPECT_THAT(value, - StatusIs(StatusCode::kCancelled, HasSubstr("timer cancelled"))); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace bigtable_admin -} // namespace cloud -} // namespace google diff --git a/google/cloud/billing/BUILD.bazel b/google/cloud/billing/BUILD.bazel index f5f10cc56d4dd..a738595faabcb 100644 --- a/google/cloud/billing/BUILD.bazel +++ b/google/cloud/billing/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "budgets/v1/", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/billing/budgets/v1:budgets_cc_grpc", - "@com_google_googleapis//google/cloud/billing/v1:billing_cc_grpc", + "@googleapis//google/cloud/billing/budgets/v1:budgets_cc_grpc", + "@googleapis//google/cloud/billing/v1:billing_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/billing/CMakeLists.txt b/google/cloud/billing/CMakeLists.txt index 014d0885e573e..8ac700b8ff4ba 100644 --- a/google/cloud/billing/CMakeLists.txt +++ b/google/cloud/billing/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(billing "Cloud Billing Budget API" - SERVICE_DIRS "__EMPTY__" "budgets/v1/" "v1/") + SERVICE_DIRS "budgets/v1/" "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(billing_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/billing/budget_client.h b/google/cloud/billing/budget_client.h deleted file mode 100644 index 216e388a8ec26..0000000000000 --- a/google/cloud/billing/budget_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/budgets/v1/budget_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGET_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGET_CLIENT_H - -#include "google/cloud/billing/budget_connection.h" -#include "google/cloud/billing/budgets/v1/budget_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in billing_budgets_v1 instead of the aliases defined in -/// this namespace. -namespace billing { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use billing_budgets_v1::BudgetServiceClient directly. -using ::google::cloud::billing_budgets_v1::BudgetServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGET_CLIENT_H diff --git a/google/cloud/billing/budget_connection.h b/google/cloud/billing/budget_connection.h deleted file mode 100644 index 66958694a6c5f..0000000000000 --- a/google/cloud/billing/budget_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/budgets/v1/budget_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGET_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGET_CONNECTION_H - -#include "google/cloud/billing/budget_connection_idempotency_policy.h" -#include "google/cloud/billing/budgets/v1/budget_connection.h" - -namespace google { -namespace cloud { -namespace billing { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use billing_budgets_v1::MakeBudgetServiceConnection directly. -using ::google::cloud::billing_budgets_v1::MakeBudgetServiceConnection; - -/// @deprecated Use billing_budgets_v1::BudgetServiceConnection directly. -using ::google::cloud::billing_budgets_v1::BudgetServiceConnection; - -/// @deprecated Use -/// billing_budgets_v1::BudgetServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::billing_budgets_v1:: - BudgetServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use billing_budgets_v1::BudgetServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::billing_budgets_v1::BudgetServiceLimitedTimeRetryPolicy; - -/// @deprecated Use billing_budgets_v1::BudgetServiceRetryPolicy directly. -using ::google::cloud::billing_budgets_v1::BudgetServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGET_CONNECTION_H diff --git a/google/cloud/billing/budget_connection_idempotency_policy.h b/google/cloud/billing/budget_connection_idempotency_policy.h deleted file mode 100644 index 79c37d9b2e6f1..0000000000000 --- a/google/cloud/billing/budget_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/budgets/v1/budget_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGET_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGET_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/billing/budgets/v1/budget_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace billing { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// billing_budgets_v1::MakeDefaultBudgetServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::billing_budgets_v1:: - MakeDefaultBudgetServiceConnectionIdempotencyPolicy; - -/// @deprecated Use billing_budgets_v1::BudgetServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::billing_budgets_v1:: - BudgetServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGET_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/billing/budget_options.h b/google/cloud/billing/budget_options.h deleted file mode 100644 index 8038768056d47..0000000000000 --- a/google/cloud/billing/budget_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/budgets/v1/budget_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGET_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGET_OPTIONS_H - -#include "google/cloud/billing/budget_connection.h" -#include "google/cloud/billing/budget_connection_idempotency_policy.h" -#include "google/cloud/billing/budgets/v1/budget_options.h" - -namespace google { -namespace cloud { -namespace billing { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use billing_budgets_v1::BudgetServiceBackoffPolicyOption -/// directly. -using ::google::cloud::billing_budgets_v1::BudgetServiceBackoffPolicyOption; - -/// @deprecated Use -/// billing_budgets_v1::BudgetServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::billing_budgets_v1:: - BudgetServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use billing_budgets_v1::BudgetServicePolicyOptionList directly. -using ::google::cloud::billing_budgets_v1::BudgetServicePolicyOptionList; - -/// @deprecated Use billing_budgets_v1::BudgetServiceRetryPolicyOption directly. -using ::google::cloud::billing_budgets_v1::BudgetServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGET_OPTIONS_H diff --git a/google/cloud/billing/budgets/v1/budget_connection.h b/google/cloud/billing/budgets/v1/budget_connection.h index 043e149ecd36b..60ccefce4e0e9 100644 --- a/google/cloud/billing/budgets/v1/budget_connection.h +++ b/google/cloud/billing/budgets/v1/budget_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGETS_V1_BUDGET_CONNECTION_H #include "google/cloud/billing/budgets/v1/budget_connection_idempotency_policy.h" +#include "google/cloud/billing/budgets/v1/budget_service.pb.h" #include "google/cloud/billing/budgets/v1/internal/budget_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/billing/budgets/v1/budget_connection_idempotency_policy.h b/google/cloud/billing/budgets/v1/budget_connection_idempotency_policy.h index 5930d2f00ebf8..b52f4d91cc9e0 100644 --- a/google/cloud/billing/budgets/v1/budget_connection_idempotency_policy.h +++ b/google/cloud/billing/budgets/v1/budget_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGETS_V1_BUDGET_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGETS_V1_BUDGET_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/billing/budgets/v1/budget_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/billing/budgets/v1/internal/budget_auth_decorator.cc b/google/cloud/billing/budgets/v1/internal/budget_auth_decorator.cc index d8d9f3868b6e4..db9dc6eebfc60 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_auth_decorator.cc +++ b/google/cloud/billing/budgets/v1/internal/budget_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/billing/budgets/v1/budget_service.proto #include "google/cloud/billing/budgets/v1/internal/budget_auth_decorator.h" -#include +#include "google/cloud/billing/budgets/v1/budget_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_budgets_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_budgets_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/budgets/v1/internal/budget_auth_decorator.h b/google/cloud/billing/budgets/v1/internal/budget_auth_decorator.h index 3f420424cfe29..3576c96a3ca58 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_auth_decorator.h +++ b/google/cloud/billing/budgets/v1/internal/budget_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_budgets_v1_internal { @@ -73,4 +76,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGETS_V1_INTERNAL_BUDGET_AUTH_DECORATOR_H diff --git a/google/cloud/billing/budgets/v1/internal/budget_logging_decorator.cc b/google/cloud/billing/budgets/v1/internal/budget_logging_decorator.cc index 03088ae08bdf7..cd6c990c3b84a 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_logging_decorator.cc +++ b/google/cloud/billing/budgets/v1/internal/budget_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/billing/budgets/v1/budget_service.proto #include "google/cloud/billing/budgets/v1/internal/budget_logging_decorator.h" +#include "google/cloud/billing/budgets/v1/budget_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_budgets_v1_internal { @@ -103,3 +106,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_budgets_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/budgets/v1/internal/budget_logging_decorator.h b/google/cloud/billing/budgets/v1/internal/budget_logging_decorator.h index 8b7eb7c7ea39d..396199e88b854 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_logging_decorator.h +++ b/google/cloud/billing/budgets/v1/internal/budget_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_budgets_v1_internal { @@ -73,4 +76,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGETS_V1_INTERNAL_BUDGET_LOGGING_DECORATOR_H diff --git a/google/cloud/billing/budgets/v1/internal/budget_metadata_decorator.cc b/google/cloud/billing/budgets/v1/internal/budget_metadata_decorator.cc index 71b804e70cfba..74defcef84cdd 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_metadata_decorator.cc +++ b/google/cloud/billing/budgets/v1/internal/budget_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/billing/budgets/v1/budget_service.proto #include "google/cloud/billing/budgets/v1/internal/budget_metadata_decorator.h" +#include "google/cloud/billing/budgets/v1/budget_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 billing_budgets_v1_internal { @@ -106,3 +110,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_budgets_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/budgets/v1/internal/budget_metadata_decorator.h b/google/cloud/billing/budgets/v1/internal/budget_metadata_decorator.h index dff5c3a61caf8..f2a9e1e578f62 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_metadata_decorator.h +++ b/google/cloud/billing/budgets/v1/internal/budget_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_budgets_v1_internal { @@ -78,4 +81,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGETS_V1_INTERNAL_BUDGET_METADATA_DECORATOR_H diff --git a/google/cloud/billing/budgets/v1/internal/budget_option_defaults.cc b/google/cloud/billing/budgets/v1/internal/budget_option_defaults.cc index 8886e260354b9..9e22d32235b4f 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_option_defaults.cc +++ b/google/cloud/billing/budgets/v1/internal/budget_option_defaults.cc @@ -42,7 +42,7 @@ Options BudgetServiceDefaultOptions(Options options) { if (!options.has()) { options.set( billing_budgets_v1::BudgetServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/billing/budgets/v1/internal/budget_stub.cc b/google/cloud/billing/budgets/v1/internal/budget_stub.cc index b99b6b7487a1b..8cc745902e341 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_stub.cc +++ b/google/cloud/billing/budgets/v1/internal/budget_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/billing/budgets/v1/budget_service.proto #include "google/cloud/billing/budgets/v1/internal/budget_stub.h" +#include "google/cloud/billing/budgets/v1/budget_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_budgets_v1_internal { @@ -93,3 +96,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_budgets_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/budgets/v1/internal/budget_stub.h b/google/cloud/billing/budgets/v1/internal/budget_stub.h index acf344a7cf429..eb2e33722342d 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_stub.h +++ b/google/cloud/billing/budgets/v1/internal/budget_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGETS_V1_INTERNAL_BUDGET_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGETS_V1_INTERNAL_BUDGET_STUB_H +#include "google/cloud/billing/budgets/v1/budget_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_budgets_v1_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGETS_V1_INTERNAL_BUDGET_STUB_H diff --git a/google/cloud/billing/budgets/v1/internal/budget_stub_factory.cc b/google/cloud/billing/budgets/v1/internal/budget_stub_factory.cc index b06308ef63468..94bfee6707bea 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_stub_factory.cc +++ b/google/cloud/billing/budgets/v1/internal/budget_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/billing/budgets/v1/budget_service.proto #include "google/cloud/billing/budgets/v1/internal/budget_stub_factory.h" +#include "google/cloud/billing/budgets/v1/budget_service.grpc.pb.h" #include "google/cloud/billing/budgets/v1/internal/budget_auth_decorator.h" #include "google/cloud/billing/budgets/v1/internal/budget_logging_decorator.h" #include "google/cloud/billing/budgets/v1/internal/budget_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_budgets_v1_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_budgets_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/budgets/v1/internal/budget_stub_factory.h b/google/cloud/billing/budgets/v1/internal/budget_stub_factory.h index 94c53eb3e6b23..84b51b10a0120 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_stub_factory.h +++ b/google/cloud/billing/budgets/v1/internal/budget_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_budgets_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGETS_V1_INTERNAL_BUDGET_STUB_FACTORY_H diff --git a/google/cloud/billing/budgets/v1/internal/budget_tracing_connection.cc b/google/cloud/billing/budgets/v1/internal/budget_tracing_connection.cc index fdd952f33222f..f8122667a4440 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_tracing_connection.cc +++ b/google/cloud/billing/budgets/v1/internal/budget_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace billing_budgets_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BudgetServiceTracingConnection::BudgetServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -80,16 +78,12 @@ Status BudgetServiceTracingConnection::DeleteBudget( return internal::EndSpan(*span, child_->DeleteBudget(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBudgetServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/billing/budgets/v1/internal/budget_tracing_connection.h b/google/cloud/billing/budgets/v1/internal/budget_tracing_connection.h index 544be106f22e3..4b95e09584d3a 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_tracing_connection.h +++ b/google/cloud/billing/budgets/v1/internal/budget_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace billing_budgets_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BudgetServiceTracingConnection : public billing_budgets_v1::BudgetServiceConnection { public: @@ -63,8 +61,6 @@ class BudgetServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/billing/budgets/v1/internal/budget_tracing_stub.cc b/google/cloud/billing/budgets/v1/internal/budget_tracing_stub.cc index f5610b88a13f4..36aef213e49cd 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_tracing_stub.cc +++ b/google/cloud/billing/budgets/v1/internal/budget_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_budgets_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BudgetServiceTracingStub::BudgetServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -91,18 +92,14 @@ Status BudgetServiceTracingStub::DeleteBudget( child_->DeleteBudget(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBudgetServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_budgets_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/budgets/v1/internal/budget_tracing_stub.h b/google/cloud/billing/budgets/v1/internal/budget_tracing_stub.h index 7517c9f52277d..3e479dacf8b3b 100644 --- a/google/cloud/billing/budgets/v1/internal/budget_tracing_stub.h +++ b/google/cloud/billing/budgets/v1/internal/budget_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_budgets_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BudgetServiceTracingStub : public BudgetServiceStub { public: ~BudgetServiceTracingStub() override = default; @@ -69,8 +70,6 @@ class BudgetServiceTracingStub : public BudgetServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -85,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_BUDGETS_V1_INTERNAL_BUDGET_TRACING_STUB_H diff --git a/google/cloud/billing/cloud_billing_client.h b/google/cloud/billing/cloud_billing_client.h deleted file mode 100644 index 39dea22fa0fb7..0000000000000 --- a/google/cloud/billing/cloud_billing_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/v1/cloud_billing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_BILLING_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_BILLING_CLIENT_H - -#include "google/cloud/billing/cloud_billing_connection.h" -#include "google/cloud/billing/v1/cloud_billing_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in billing_v1 instead of the aliases defined in -/// this namespace. -namespace billing { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use billing_v1::CloudBillingClient directly. -using ::google::cloud::billing_v1::CloudBillingClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_BILLING_CLIENT_H diff --git a/google/cloud/billing/cloud_billing_connection.h b/google/cloud/billing/cloud_billing_connection.h deleted file mode 100644 index b0829a151de2c..0000000000000 --- a/google/cloud/billing/cloud_billing_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/v1/cloud_billing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_BILLING_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_BILLING_CONNECTION_H - -#include "google/cloud/billing/cloud_billing_connection_idempotency_policy.h" -#include "google/cloud/billing/v1/cloud_billing_connection.h" - -namespace google { -namespace cloud { -namespace billing { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use billing_v1::MakeCloudBillingConnection directly. -using ::google::cloud::billing_v1::MakeCloudBillingConnection; - -/// @deprecated Use billing_v1::CloudBillingConnection directly. -using ::google::cloud::billing_v1::CloudBillingConnection; - -/// @deprecated Use billing_v1::CloudBillingLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::billing_v1::CloudBillingLimitedErrorCountRetryPolicy; - -/// @deprecated Use billing_v1::CloudBillingLimitedTimeRetryPolicy directly. -using ::google::cloud::billing_v1::CloudBillingLimitedTimeRetryPolicy; - -/// @deprecated Use billing_v1::CloudBillingRetryPolicy directly. -using ::google::cloud::billing_v1::CloudBillingRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_BILLING_CONNECTION_H diff --git a/google/cloud/billing/cloud_billing_connection_idempotency_policy.h b/google/cloud/billing/cloud_billing_connection_idempotency_policy.h deleted file mode 100644 index 8f3185afecc72..0000000000000 --- a/google/cloud/billing/cloud_billing_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/v1/cloud_billing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_BILLING_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_BILLING_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/billing/v1/cloud_billing_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace billing { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// billing_v1::MakeDefaultCloudBillingConnectionIdempotencyPolicy directly. -using ::google::cloud::billing_v1:: - MakeDefaultCloudBillingConnectionIdempotencyPolicy; - -/// @deprecated Use billing_v1::CloudBillingConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::billing_v1::CloudBillingConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_BILLING_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/billing/cloud_billing_options.h b/google/cloud/billing/cloud_billing_options.h deleted file mode 100644 index fd9e31b43c77e..0000000000000 --- a/google/cloud/billing/cloud_billing_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/v1/cloud_billing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_BILLING_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_BILLING_OPTIONS_H - -#include "google/cloud/billing/cloud_billing_connection.h" -#include "google/cloud/billing/cloud_billing_connection_idempotency_policy.h" -#include "google/cloud/billing/v1/cloud_billing_options.h" - -namespace google { -namespace cloud { -namespace billing { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use billing_v1::CloudBillingBackoffPolicyOption directly. -using ::google::cloud::billing_v1::CloudBillingBackoffPolicyOption; - -/// @deprecated Use billing_v1::CloudBillingConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::billing_v1:: - CloudBillingConnectionIdempotencyPolicyOption; - -/// @deprecated Use billing_v1::CloudBillingPolicyOptionList directly. -using ::google::cloud::billing_v1::CloudBillingPolicyOptionList; - -/// @deprecated Use billing_v1::CloudBillingRetryPolicyOption directly. -using ::google::cloud::billing_v1::CloudBillingRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_BILLING_OPTIONS_H diff --git a/google/cloud/billing/cloud_catalog_client.h b/google/cloud/billing/cloud_catalog_client.h deleted file mode 100644 index bc124b21808e8..0000000000000 --- a/google/cloud/billing/cloud_catalog_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/v1/cloud_catalog.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_CATALOG_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_CATALOG_CLIENT_H - -#include "google/cloud/billing/cloud_catalog_connection.h" -#include "google/cloud/billing/v1/cloud_catalog_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in billing_v1 instead of the aliases defined in -/// this namespace. -namespace billing { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use billing_v1::CloudCatalogClient directly. -using ::google::cloud::billing_v1::CloudCatalogClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_CATALOG_CLIENT_H diff --git a/google/cloud/billing/cloud_catalog_connection.h b/google/cloud/billing/cloud_catalog_connection.h deleted file mode 100644 index 649278f5d4f05..0000000000000 --- a/google/cloud/billing/cloud_catalog_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/v1/cloud_catalog.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_CATALOG_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_CATALOG_CONNECTION_H - -#include "google/cloud/billing/cloud_catalog_connection_idempotency_policy.h" -#include "google/cloud/billing/v1/cloud_catalog_connection.h" - -namespace google { -namespace cloud { -namespace billing { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use billing_v1::MakeCloudCatalogConnection directly. -using ::google::cloud::billing_v1::MakeCloudCatalogConnection; - -/// @deprecated Use billing_v1::CloudCatalogConnection directly. -using ::google::cloud::billing_v1::CloudCatalogConnection; - -/// @deprecated Use billing_v1::CloudCatalogLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::billing_v1::CloudCatalogLimitedErrorCountRetryPolicy; - -/// @deprecated Use billing_v1::CloudCatalogLimitedTimeRetryPolicy directly. -using ::google::cloud::billing_v1::CloudCatalogLimitedTimeRetryPolicy; - -/// @deprecated Use billing_v1::CloudCatalogRetryPolicy directly. -using ::google::cloud::billing_v1::CloudCatalogRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_CATALOG_CONNECTION_H diff --git a/google/cloud/billing/cloud_catalog_connection_idempotency_policy.h b/google/cloud/billing/cloud_catalog_connection_idempotency_policy.h deleted file mode 100644 index a3d6c4f493620..0000000000000 --- a/google/cloud/billing/cloud_catalog_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/v1/cloud_catalog.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/billing/v1/cloud_catalog_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace billing { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// billing_v1::MakeDefaultCloudCatalogConnectionIdempotencyPolicy directly. -using ::google::cloud::billing_v1:: - MakeDefaultCloudCatalogConnectionIdempotencyPolicy; - -/// @deprecated Use billing_v1::CloudCatalogConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::billing_v1::CloudCatalogConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/billing/cloud_catalog_options.h b/google/cloud/billing/cloud_catalog_options.h deleted file mode 100644 index 9a62295230c2b..0000000000000 --- a/google/cloud/billing/cloud_catalog_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/v1/cloud_catalog.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_CATALOG_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_CATALOG_OPTIONS_H - -#include "google/cloud/billing/cloud_catalog_connection.h" -#include "google/cloud/billing/cloud_catalog_connection_idempotency_policy.h" -#include "google/cloud/billing/v1/cloud_catalog_options.h" - -namespace google { -namespace cloud { -namespace billing { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use billing_v1::CloudCatalogBackoffPolicyOption directly. -using ::google::cloud::billing_v1::CloudCatalogBackoffPolicyOption; - -/// @deprecated Use billing_v1::CloudCatalogConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::billing_v1:: - CloudCatalogConnectionIdempotencyPolicyOption; - -/// @deprecated Use billing_v1::CloudCatalogPolicyOptionList directly. -using ::google::cloud::billing_v1::CloudCatalogPolicyOptionList; - -/// @deprecated Use billing_v1::CloudCatalogRetryPolicyOption directly. -using ::google::cloud::billing_v1::CloudCatalogRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_CLOUD_CATALOG_OPTIONS_H diff --git a/google/cloud/billing/mocks/mock_budget_connection.h b/google/cloud/billing/mocks/mock_budget_connection.h deleted file mode 100644 index fe60dacd761d3..0000000000000 --- a/google/cloud/billing/mocks/mock_budget_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/budgets/v1/budget_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_MOCKS_MOCK_BUDGET_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_MOCKS_MOCK_BUDGET_CONNECTION_H - -#include "google/cloud/billing/budget_connection.h" -#include "google/cloud/billing/budgets/v1/mocks/mock_budget_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in billing_budgets_v1_mocks instead of the aliases -/// defined in this namespace. -namespace billing_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use billing_budgets_v1_mocks::MockBudgetServiceConnection -/// directly. -using ::google::cloud::billing_budgets_v1_mocks::MockBudgetServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_MOCKS_MOCK_BUDGET_CONNECTION_H diff --git a/google/cloud/billing/mocks/mock_cloud_billing_connection.h b/google/cloud/billing/mocks/mock_cloud_billing_connection.h deleted file mode 100644 index 0ae5e447d704a..0000000000000 --- a/google/cloud/billing/mocks/mock_cloud_billing_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/v1/cloud_billing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_MOCKS_MOCK_CLOUD_BILLING_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_MOCKS_MOCK_CLOUD_BILLING_CONNECTION_H - -#include "google/cloud/billing/cloud_billing_connection.h" -#include "google/cloud/billing/v1/mocks/mock_cloud_billing_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in billing_v1_mocks instead of the aliases -/// defined in this namespace. -namespace billing_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use billing_v1_mocks::MockCloudBillingConnection directly. -using ::google::cloud::billing_v1_mocks::MockCloudBillingConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_MOCKS_MOCK_CLOUD_BILLING_CONNECTION_H diff --git a/google/cloud/billing/mocks/mock_cloud_catalog_connection.h b/google/cloud/billing/mocks/mock_cloud_catalog_connection.h deleted file mode 100644 index 92fdf1a580a28..0000000000000 --- a/google/cloud/billing/mocks/mock_cloud_catalog_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/billing/v1/cloud_catalog.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_MOCKS_MOCK_CLOUD_CATALOG_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_MOCKS_MOCK_CLOUD_CATALOG_CONNECTION_H - -#include "google/cloud/billing/cloud_catalog_connection.h" -#include "google/cloud/billing/v1/mocks/mock_cloud_catalog_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in billing_v1_mocks instead of the aliases -/// defined in this namespace. -namespace billing_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use billing_v1_mocks::MockCloudCatalogConnection directly. -using ::google::cloud::billing_v1_mocks::MockCloudCatalogConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace billing_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_MOCKS_MOCK_CLOUD_CATALOG_CONNECTION_H diff --git a/google/cloud/billing/quickstart/.bazelrc b/google/cloud/billing/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/billing/quickstart/.bazelrc +++ b/google/cloud/billing/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/billing/quickstart/CMakeLists.txt index 5ef8ce68b09bf..ee84433c1352e 100644 --- a/google/cloud/billing/quickstart/CMakeLists.txt +++ b/google/cloud/billing/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Billing Budget API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-billing-quickstart CXX) find_package(google_cloud_cpp_billing REQUIRED) diff --git a/google/cloud/billing/quickstart/WORKSPACE.bazel b/google/cloud/billing/quickstart/WORKSPACE.bazel index e860d8c61a246..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 = "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/billing/v1/cloud_billing_connection.h b/google/cloud/billing/v1/cloud_billing_connection.h index 99cbf66c45ac7..92aa0deccfa89 100644 --- a/google/cloud/billing/v1/cloud_billing_connection.h +++ b/google/cloud/billing/v1/cloud_billing_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_CLOUD_BILLING_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_CLOUD_BILLING_CONNECTION_H +#include "google/cloud/billing/v1/cloud_billing.pb.h" #include "google/cloud/billing/v1/cloud_billing_connection_idempotency_policy.h" #include "google/cloud/billing/v1/internal/cloud_billing_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/billing/v1/cloud_billing_connection_idempotency_policy.h b/google/cloud/billing/v1/cloud_billing_connection_idempotency_policy.h index 9eb734842d37d..aaf4f98af893e 100644 --- a/google/cloud/billing/v1/cloud_billing_connection_idempotency_policy.h +++ b/google/cloud/billing/v1/cloud_billing_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_CLOUD_BILLING_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_CLOUD_BILLING_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/billing/v1/cloud_billing.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/billing/v1/cloud_catalog_connection.h b/google/cloud/billing/v1/cloud_catalog_connection.h index 3f7af5098a5b4..585518d2c7bd7 100644 --- a/google/cloud/billing/v1/cloud_catalog_connection.h +++ b/google/cloud/billing/v1/cloud_catalog_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_CLOUD_CATALOG_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_CLOUD_CATALOG_CONNECTION_H +#include "google/cloud/billing/v1/cloud_catalog.pb.h" #include "google/cloud/billing/v1/cloud_catalog_connection_idempotency_policy.h" #include "google/cloud/billing/v1/internal/cloud_catalog_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/billing/v1/cloud_catalog_connection_idempotency_policy.h b/google/cloud/billing/v1/cloud_catalog_connection_idempotency_policy.h index dbdd33ab9bff7..14409cc176b94 100644 --- a/google/cloud/billing/v1/cloud_catalog_connection_idempotency_policy.h +++ b/google/cloud/billing/v1/cloud_catalog_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_CLOUD_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_CLOUD_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/billing/v1/cloud_catalog.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/billing/v1/internal/cloud_billing_auth_decorator.cc b/google/cloud/billing/v1/internal/cloud_billing_auth_decorator.cc index 947f22c6f7d62..569534d07fb4e 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_auth_decorator.cc +++ b/google/cloud/billing/v1/internal/cloud_billing_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/billing/v1/cloud_billing.proto #include "google/cloud/billing/v1/internal/cloud_billing_auth_decorator.h" -#include +#include "google/cloud/billing/v1/cloud_billing.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -133,3 +136,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/v1/internal/cloud_billing_auth_decorator.h b/google/cloud/billing/v1/internal/cloud_billing_auth_decorator.h index 54b0ec3055580..32f3a62ce2d40 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_auth_decorator.h +++ b/google/cloud/billing/v1/internal/cloud_billing_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_BILLING_AUTH_DECORATOR_H diff --git a/google/cloud/billing/v1/internal/cloud_billing_logging_decorator.cc b/google/cloud/billing/v1/internal/cloud_billing_logging_decorator.cc index 4f9588e60fc33..f5fc7d6f6e394 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_logging_decorator.cc +++ b/google/cloud/billing/v1/internal/cloud_billing_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/billing/v1/cloud_billing.proto #include "google/cloud/billing/v1/internal/cloud_billing_logging_decorator.h" +#include "google/cloud/billing/v1/cloud_billing.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -178,3 +181,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/v1/internal/cloud_billing_logging_decorator.h b/google/cloud/billing/v1/internal/cloud_billing_logging_decorator.h index 07c25e25bb8ad..3697a39b205d7 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_logging_decorator.h +++ b/google/cloud/billing/v1/internal/cloud_billing_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_BILLING_LOGGING_DECORATOR_H diff --git a/google/cloud/billing/v1/internal/cloud_billing_metadata_decorator.cc b/google/cloud/billing/v1/internal/cloud_billing_metadata_decorator.cc index fff950a9da849..97f4c0f23b388 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_metadata_decorator.cc +++ b/google/cloud/billing/v1/internal/cloud_billing_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/billing/v1/cloud_billing.proto #include "google/cloud/billing/v1/internal/cloud_billing_metadata_decorator.h" +#include "google/cloud/billing/v1/cloud_billing.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 billing_v1_internal { @@ -160,3 +164,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/v1/internal/cloud_billing_metadata_decorator.h b/google/cloud/billing/v1/internal/cloud_billing_metadata_decorator.h index dde8349a2a410..1c01d97e04b62 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_metadata_decorator.h +++ b/google/cloud/billing/v1/internal/cloud_billing_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_BILLING_METADATA_DECORATOR_H diff --git a/google/cloud/billing/v1/internal/cloud_billing_option_defaults.cc b/google/cloud/billing/v1/internal/cloud_billing_option_defaults.cc index 4cb0577a18d34..7deb03f78a4c7 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_option_defaults.cc +++ b/google/cloud/billing/v1/internal/cloud_billing_option_defaults.cc @@ -41,7 +41,7 @@ Options CloudBillingDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - billing_v1::CloudBillingLimitedTimeRetryPolicy(std::chrono::minutes(30)) + billing_v1::CloudBillingLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/billing/v1/internal/cloud_billing_stub.cc b/google/cloud/billing/v1/internal/cloud_billing_stub.cc index 248dfd811e702..c3d1e2508384f 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_stub.cc +++ b/google/cloud/billing/v1/internal/cloud_billing_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/billing/v1/cloud_billing.proto #include "google/cloud/billing/v1/internal/cloud_billing_stub.h" +#include "google/cloud/billing/v1/cloud_billing.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -167,3 +170,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/v1/internal/cloud_billing_stub.h b/google/cloud/billing/v1/internal/cloud_billing_stub.h index dede42151b0be..f8abe8bacbf7c 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_stub.h +++ b/google/cloud/billing/v1/internal/cloud_billing_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_BILLING_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_BILLING_STUB_H +#include "google/cloud/billing/v1/cloud_billing.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -168,4 +171,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_BILLING_STUB_H diff --git a/google/cloud/billing/v1/internal/cloud_billing_stub_factory.cc b/google/cloud/billing/v1/internal/cloud_billing_stub_factory.cc index c8f32450994f7..3e8c6b09167fc 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_stub_factory.cc +++ b/google/cloud/billing/v1/internal/cloud_billing_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/billing/v1/cloud_billing.proto #include "google/cloud/billing/v1/internal/cloud_billing_stub_factory.h" +#include "google/cloud/billing/v1/cloud_billing.grpc.pb.h" #include "google/cloud/billing/v1/internal/cloud_billing_auth_decorator.h" #include "google/cloud/billing/v1/internal/cloud_billing_logging_decorator.h" #include "google/cloud/billing/v1/internal/cloud_billing_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/v1/internal/cloud_billing_stub_factory.h b/google/cloud/billing/v1/internal/cloud_billing_stub_factory.h index 286c804b363a3..19fef8eae59cf 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_stub_factory.h +++ b/google/cloud/billing/v1/internal/cloud_billing_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_BILLING_STUB_FACTORY_H diff --git a/google/cloud/billing/v1/internal/cloud_billing_tracing_connection.cc b/google/cloud/billing/v1/internal/cloud_billing_tracing_connection.cc index 8b3aaceb64844..edd63837ffdfc 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_tracing_connection.cc +++ b/google/cloud/billing/v1/internal/cloud_billing_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace billing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudBillingTracingConnection::CloudBillingTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -137,16 +135,12 @@ CloudBillingTracingConnection::MoveBillingAccount( return internal::EndSpan(*span, child_->MoveBillingAccount(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudBillingTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/billing/v1/internal/cloud_billing_tracing_connection.h b/google/cloud/billing/v1/internal/cloud_billing_tracing_connection.h index 90ce15035113e..377c71b1dd2c6 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_tracing_connection.h +++ b/google/cloud/billing/v1/internal/cloud_billing_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace billing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudBillingTracingConnection : public billing_v1::CloudBillingConnection { public: @@ -87,8 +85,6 @@ class CloudBillingTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/billing/v1/internal/cloud_billing_tracing_stub.cc b/google/cloud/billing/v1/internal/cloud_billing_tracing_stub.cc index 91e2d11358e61..e830cb0d1e228 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_tracing_stub.cc +++ b/google/cloud/billing/v1/internal/cloud_billing_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudBillingTracingStub::CloudBillingTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -165,18 +166,14 @@ CloudBillingTracingStub::MoveBillingAccount( context, *span, child_->MoveBillingAccount(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudBillingTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/v1/internal/cloud_billing_tracing_stub.h b/google/cloud/billing/v1/internal/cloud_billing_tracing_stub.h index 74142097e8de2..b11c977c5c954 100644 --- a/google/cloud/billing/v1/internal/cloud_billing_tracing_stub.h +++ b/google/cloud/billing/v1/internal/cloud_billing_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudBillingTracingStub : public CloudBillingStub { public: ~CloudBillingTracingStub() override = default; @@ -100,8 +101,6 @@ class CloudBillingTracingStub : public CloudBillingStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -116,4 +115,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_BILLING_TRACING_STUB_H diff --git a/google/cloud/billing/v1/internal/cloud_catalog_auth_decorator.cc b/google/cloud/billing/v1/internal/cloud_catalog_auth_decorator.cc index 2ce708278f082..b63c094f17fbf 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_auth_decorator.cc +++ b/google/cloud/billing/v1/internal/cloud_catalog_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/billing/v1/cloud_catalog.proto #include "google/cloud/billing/v1/internal/cloud_catalog_auth_decorator.h" -#include +#include "google/cloud/billing/v1/cloud_catalog.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -53,3 +56,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/v1/internal/cloud_catalog_auth_decorator.h b/google/cloud/billing/v1/internal/cloud_catalog_auth_decorator.h index 6c0edeace0ef2..ebca0614d9099 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_auth_decorator.h +++ b/google/cloud/billing/v1/internal/cloud_catalog_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -56,4 +59,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_CATALOG_AUTH_DECORATOR_H diff --git a/google/cloud/billing/v1/internal/cloud_catalog_logging_decorator.cc b/google/cloud/billing/v1/internal/cloud_catalog_logging_decorator.cc index 8a6cac0644d8f..d7e534df440bf 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_logging_decorator.cc +++ b/google/cloud/billing/v1/internal/cloud_catalog_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/billing/v1/cloud_catalog.proto #include "google/cloud/billing/v1/internal/cloud_catalog_logging_decorator.h" +#include "google/cloud/billing/v1/cloud_catalog.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -63,3 +66,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/v1/internal/cloud_catalog_logging_decorator.h b/google/cloud/billing/v1/internal/cloud_catalog_logging_decorator.h index dcc3507973326..fe7c7ee734605 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_logging_decorator.h +++ b/google/cloud/billing/v1/internal/cloud_catalog_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -56,4 +59,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_CATALOG_LOGGING_DECORATOR_H diff --git a/google/cloud/billing/v1/internal/cloud_catalog_metadata_decorator.cc b/google/cloud/billing/v1/internal/cloud_catalog_metadata_decorator.cc index 1088faed8ef8a..42ef5ed069eb5 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_metadata_decorator.cc +++ b/google/cloud/billing/v1/internal/cloud_catalog_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/billing/v1/cloud_catalog.proto #include "google/cloud/billing/v1/internal/cloud_catalog_metadata_decorator.h" +#include "google/cloud/billing/v1/cloud_catalog.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 billing_v1_internal { @@ -78,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/v1/internal/cloud_catalog_metadata_decorator.h b/google/cloud/billing/v1/internal/cloud_catalog_metadata_decorator.h index dffe70676ecc1..2e303fc36face 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_metadata_decorator.h +++ b/google/cloud/billing/v1/internal/cloud_catalog_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -61,4 +64,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_CATALOG_METADATA_DECORATOR_H diff --git a/google/cloud/billing/v1/internal/cloud_catalog_option_defaults.cc b/google/cloud/billing/v1/internal/cloud_catalog_option_defaults.cc index 038644912c14c..0b098ad59b473 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_option_defaults.cc +++ b/google/cloud/billing/v1/internal/cloud_catalog_option_defaults.cc @@ -41,7 +41,7 @@ Options CloudCatalogDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - billing_v1::CloudCatalogLimitedTimeRetryPolicy(std::chrono::minutes(30)) + billing_v1::CloudCatalogLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/billing/v1/internal/cloud_catalog_stub.cc b/google/cloud/billing/v1/internal/cloud_catalog_stub.cc index 174186531adcf..17aeb38232190 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_stub.cc +++ b/google/cloud/billing/v1/internal/cloud_catalog_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/billing/v1/cloud_catalog.proto #include "google/cloud/billing/v1/internal/cloud_catalog_stub.h" +#include "google/cloud/billing/v1/cloud_catalog.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -58,3 +61,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/v1/internal/cloud_catalog_stub.h b/google/cloud/billing/v1/internal/cloud_catalog_stub.h index 252be6fd66e5a..816b5dc24dc08 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_stub.h +++ b/google/cloud/billing/v1/internal/cloud_catalog_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_CATALOG_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_CATALOG_STUB_H +#include "google/cloud/billing/v1/cloud_catalog.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -70,4 +73,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_CATALOG_STUB_H diff --git a/google/cloud/billing/v1/internal/cloud_catalog_stub_factory.cc b/google/cloud/billing/v1/internal/cloud_catalog_stub_factory.cc index 66c8c58ce9fc6..0f65d22f539f6 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_stub_factory.cc +++ b/google/cloud/billing/v1/internal/cloud_catalog_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/billing/v1/cloud_catalog.proto #include "google/cloud/billing/v1/internal/cloud_catalog_stub_factory.h" +#include "google/cloud/billing/v1/cloud_catalog.grpc.pb.h" #include "google/cloud/billing/v1/internal/cloud_catalog_auth_decorator.h" #include "google/cloud/billing/v1/internal/cloud_catalog_logging_decorator.h" #include "google/cloud/billing/v1/internal/cloud_catalog_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/v1/internal/cloud_catalog_stub_factory.h b/google/cloud/billing/v1/internal/cloud_catalog_stub_factory.h index 5f6aa5baeeaa7..bbc88674b5f4a 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_stub_factory.h +++ b/google/cloud/billing/v1/internal/cloud_catalog_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_CATALOG_STUB_FACTORY_H diff --git a/google/cloud/billing/v1/internal/cloud_catalog_tracing_connection.cc b/google/cloud/billing/v1/internal/cloud_catalog_tracing_connection.cc index 52f982f0183eb..d91c4fe6fa9a9 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_tracing_connection.cc +++ b/google/cloud/billing/v1/internal/cloud_catalog_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace billing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudCatalogTracingConnection::CloudCatalogTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -55,16 +53,12 @@ CloudCatalogTracingConnection::ListSkus( std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudCatalogTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/billing/v1/internal/cloud_catalog_tracing_connection.h b/google/cloud/billing/v1/internal/cloud_catalog_tracing_connection.h index a0dbfe8f35928..56e1ea93386ab 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_tracing_connection.h +++ b/google/cloud/billing/v1/internal/cloud_catalog_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace billing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudCatalogTracingConnection : public billing_v1::CloudCatalogConnection { public: @@ -50,8 +48,6 @@ class CloudCatalogTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/billing/v1/internal/cloud_catalog_tracing_stub.cc b/google/cloud/billing/v1/internal/cloud_catalog_tracing_stub.cc index 09b898d2f6f3e..64289fe6fd48e 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_tracing_stub.cc +++ b/google/cloud/billing/v1/internal/cloud_catalog_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudCatalogTracingStub::CloudCatalogTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -56,18 +57,14 @@ CloudCatalogTracingStub::ListSkus( child_->ListSkus(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudCatalogTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace billing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/billing/v1/internal/cloud_catalog_tracing_stub.h b/google/cloud/billing/v1/internal/cloud_catalog_tracing_stub.h index e02ef50e343aa..ce93063587671 100644 --- a/google/cloud/billing/v1/internal/cloud_catalog_tracing_stub.h +++ b/google/cloud/billing/v1/internal/cloud_catalog_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace billing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudCatalogTracingStub : public CloudCatalogStub { public: ~CloudCatalogTracingStub() override = default; @@ -52,8 +53,6 @@ class CloudCatalogTracingStub : public CloudCatalogStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -68,4 +67,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BILLING_V1_INTERNAL_CLOUD_CATALOG_TRACING_STUB_H diff --git a/google/cloud/binaryauthorization/BUILD.bazel b/google/cloud/binaryauthorization/BUILD.bazel index 98ae06be8651f..80cd3957897db 100644 --- a/google/cloud/binaryauthorization/BUILD.bazel +++ b/google/cloud/binaryauthorization/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/binaryauthorization/v1:binaryauthorization_cc_grpc", + "@googleapis//google/cloud/binaryauthorization/v1:binaryauthorization_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/binaryauthorization/CMakeLists.txt b/google/cloud/binaryauthorization/CMakeLists.txt index aeef19d1d6dbd..85806a39a59d8 100644 --- a/google/cloud/binaryauthorization/CMakeLists.txt +++ b/google/cloud/binaryauthorization/CMakeLists.txt @@ -18,7 +18,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( binaryauthorization "Binary Authorization API" - SERVICE_DIRS "__EMPTY__" "v1/" + SERVICE_DIRS "v1/" SHARED_PROTO_DEPS "grafeas") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) diff --git a/google/cloud/binaryauthorization/binauthz_management_service_v1_client.h b/google/cloud/binaryauthorization/binauthz_management_service_v1_client.h deleted file mode 100644 index 9d047e61be7e4..0000000000000 --- a/google/cloud/binaryauthorization/binauthz_management_service_v1_client.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_BINAUTHZ_MANAGEMENT_SERVICE_V1_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_BINAUTHZ_MANAGEMENT_SERVICE_V1_CLIENT_H - -#include "google/cloud/binaryauthorization/binauthz_management_service_v1_connection.h" -#include "google/cloud/binaryauthorization/v1/binauthz_management_service_v1_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in binaryauthorization_v1 instead of the aliases defined -/// in this namespace. -namespace binaryauthorization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use binaryauthorization_v1::BinauthzManagementServiceV1Client -/// directly. -using ::google::cloud::binaryauthorization_v1:: - BinauthzManagementServiceV1Client; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_BINAUTHZ_MANAGEMENT_SERVICE_V1_CLIENT_H diff --git a/google/cloud/binaryauthorization/binauthz_management_service_v1_connection.h b/google/cloud/binaryauthorization/binauthz_management_service_v1_connection.h deleted file mode 100644 index 96d6d8c7adb65..0000000000000 --- a/google/cloud/binaryauthorization/binauthz_management_service_v1_connection.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_BINAUTHZ_MANAGEMENT_SERVICE_V1_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_BINAUTHZ_MANAGEMENT_SERVICE_V1_CONNECTION_H - -#include "google/cloud/binaryauthorization/binauthz_management_service_v1_connection_idempotency_policy.h" -#include "google/cloud/binaryauthorization/v1/binauthz_management_service_v1_connection.h" - -namespace google { -namespace cloud { -namespace binaryauthorization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// binaryauthorization_v1::MakeBinauthzManagementServiceV1Connection directly. -using ::google::cloud::binaryauthorization_v1:: - MakeBinauthzManagementServiceV1Connection; - -/// @deprecated Use -/// binaryauthorization_v1::BinauthzManagementServiceV1Connection directly. -using ::google::cloud::binaryauthorization_v1:: - BinauthzManagementServiceV1Connection; - -/// @deprecated Use -/// binaryauthorization_v1::BinauthzManagementServiceV1LimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::binaryauthorization_v1:: - BinauthzManagementServiceV1LimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// binaryauthorization_v1::BinauthzManagementServiceV1LimitedTimeRetryPolicy -/// directly. -using ::google::cloud::binaryauthorization_v1:: - BinauthzManagementServiceV1LimitedTimeRetryPolicy; - -/// @deprecated Use -/// binaryauthorization_v1::BinauthzManagementServiceV1RetryPolicy directly. -using ::google::cloud::binaryauthorization_v1:: - BinauthzManagementServiceV1RetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_BINAUTHZ_MANAGEMENT_SERVICE_V1_CONNECTION_H diff --git a/google/cloud/binaryauthorization/binauthz_management_service_v1_connection_idempotency_policy.h b/google/cloud/binaryauthorization/binauthz_management_service_v1_connection_idempotency_policy.h deleted file mode 100644 index 96e1f03f331eb..0000000000000 --- a/google/cloud/binaryauthorization/binauthz_management_service_v1_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_BINAUTHZ_MANAGEMENT_SERVICE_V1_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_BINAUTHZ_MANAGEMENT_SERVICE_V1_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/binaryauthorization/v1/binauthz_management_service_v1_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace binaryauthorization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// binaryauthorization_v1::MakeDefaultBinauthzManagementServiceV1ConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::binaryauthorization_v1:: - MakeDefaultBinauthzManagementServiceV1ConnectionIdempotencyPolicy; - -/// @deprecated Use -/// binaryauthorization_v1::BinauthzManagementServiceV1ConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::binaryauthorization_v1:: - BinauthzManagementServiceV1ConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_BINAUTHZ_MANAGEMENT_SERVICE_V1_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/binaryauthorization/binauthz_management_service_v1_options.h b/google/cloud/binaryauthorization/binauthz_management_service_v1_options.h deleted file mode 100644 index bcba0e19d2889..0000000000000 --- a/google/cloud/binaryauthorization/binauthz_management_service_v1_options.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_BINAUTHZ_MANAGEMENT_SERVICE_V1_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_BINAUTHZ_MANAGEMENT_SERVICE_V1_OPTIONS_H - -#include "google/cloud/binaryauthorization/binauthz_management_service_v1_connection.h" -#include "google/cloud/binaryauthorization/binauthz_management_service_v1_connection_idempotency_policy.h" -#include "google/cloud/binaryauthorization/v1/binauthz_management_service_v1_options.h" - -namespace google { -namespace cloud { -namespace binaryauthorization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// binaryauthorization_v1::BinauthzManagementServiceV1BackoffPolicyOption -/// directly. -using ::google::cloud::binaryauthorization_v1:: - BinauthzManagementServiceV1BackoffPolicyOption; - -/// @deprecated Use -/// binaryauthorization_v1::BinauthzManagementServiceV1ConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::binaryauthorization_v1:: - BinauthzManagementServiceV1ConnectionIdempotencyPolicyOption; - -/// @deprecated Use -/// binaryauthorization_v1::BinauthzManagementServiceV1PolicyOptionList -/// directly. -using ::google::cloud::binaryauthorization_v1:: - BinauthzManagementServiceV1PolicyOptionList; - -/// @deprecated Use -/// binaryauthorization_v1::BinauthzManagementServiceV1RetryPolicyOption -/// directly. -using ::google::cloud::binaryauthorization_v1:: - BinauthzManagementServiceV1RetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_BINAUTHZ_MANAGEMENT_SERVICE_V1_OPTIONS_H diff --git a/google/cloud/binaryauthorization/mocks/mock_binauthz_management_service_v1_connection.h b/google/cloud/binaryauthorization/mocks/mock_binauthz_management_service_v1_connection.h deleted file mode 100644 index f718cf397bb67..0000000000000 --- a/google/cloud/binaryauthorization/mocks/mock_binauthz_management_service_v1_connection.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_MOCKS_MOCK_BINAUTHZ_MANAGEMENT_SERVICE_V1_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_MOCKS_MOCK_BINAUTHZ_MANAGEMENT_SERVICE_V1_CONNECTION_H - -#include "google/cloud/binaryauthorization/binauthz_management_service_v1_connection.h" -#include "google/cloud/binaryauthorization/v1/mocks/mock_binauthz_management_service_v1_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in binaryauthorization_v1_mocks instead of the aliases -/// defined in this namespace. -namespace binaryauthorization_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// binaryauthorization_v1_mocks::MockBinauthzManagementServiceV1Connection -/// directly. -using ::google::cloud::binaryauthorization_v1_mocks:: - MockBinauthzManagementServiceV1Connection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_MOCKS_MOCK_BINAUTHZ_MANAGEMENT_SERVICE_V1_CONNECTION_H diff --git a/google/cloud/binaryauthorization/mocks/mock_system_policy_v1_connection.h b/google/cloud/binaryauthorization/mocks/mock_system_policy_v1_connection.h deleted file mode 100644 index 45b8202e6fb0a..0000000000000 --- a/google/cloud/binaryauthorization/mocks/mock_system_policy_v1_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_MOCKS_MOCK_SYSTEM_POLICY_V1_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_MOCKS_MOCK_SYSTEM_POLICY_V1_CONNECTION_H - -#include "google/cloud/binaryauthorization/system_policy_v1_connection.h" -#include "google/cloud/binaryauthorization/v1/mocks/mock_system_policy_v1_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in binaryauthorization_v1_mocks instead of the aliases -/// defined in this namespace. -namespace binaryauthorization_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use binaryauthorization_v1_mocks::MockSystemPolicyV1Connection -/// directly. -using ::google::cloud::binaryauthorization_v1_mocks:: - MockSystemPolicyV1Connection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_MOCKS_MOCK_SYSTEM_POLICY_V1_CONNECTION_H diff --git a/google/cloud/binaryauthorization/mocks/mock_validation_helper_v1_connection.h b/google/cloud/binaryauthorization/mocks/mock_validation_helper_v1_connection.h deleted file mode 100644 index be41ef3b89488..0000000000000 --- a/google/cloud/binaryauthorization/mocks/mock_validation_helper_v1_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_MOCKS_MOCK_VALIDATION_HELPER_V1_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_MOCKS_MOCK_VALIDATION_HELPER_V1_CONNECTION_H - -#include "google/cloud/binaryauthorization/v1/mocks/mock_validation_helper_v1_connection.h" -#include "google/cloud/binaryauthorization/validation_helper_v1_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in binaryauthorization_v1_mocks instead of the aliases -/// defined in this namespace. -namespace binaryauthorization_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// binaryauthorization_v1_mocks::MockValidationHelperV1Connection directly. -using ::google::cloud::binaryauthorization_v1_mocks:: - MockValidationHelperV1Connection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_MOCKS_MOCK_VALIDATION_HELPER_V1_CONNECTION_H diff --git a/google/cloud/binaryauthorization/quickstart/.bazelrc b/google/cloud/binaryauthorization/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/binaryauthorization/quickstart/.bazelrc +++ b/google/cloud/binaryauthorization/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/binaryauthorization/quickstart/CMakeLists.txt index db86481d43744..1476d4242cecb 100644 --- a/google/cloud/binaryauthorization/quickstart/CMakeLists.txt +++ b/google/cloud/binaryauthorization/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Binary Authorization API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-binaryauthorization-quickstart CXX) find_package(google_cloud_cpp_binaryauthorization REQUIRED) diff --git a/google/cloud/binaryauthorization/quickstart/WORKSPACE.bazel b/google/cloud/binaryauthorization/quickstart/WORKSPACE.bazel index aa8a06a7d8f3f..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 = "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/binaryauthorization/system_policy_v1_client.h b/google/cloud/binaryauthorization/system_policy_v1_client.h deleted file mode 100644 index dae420e846a1f..0000000000000 --- a/google/cloud/binaryauthorization/system_policy_v1_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_SYSTEM_POLICY_V1_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_SYSTEM_POLICY_V1_CLIENT_H - -#include "google/cloud/binaryauthorization/system_policy_v1_connection.h" -#include "google/cloud/binaryauthorization/v1/system_policy_v1_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in binaryauthorization_v1 instead of the aliases defined -/// in this namespace. -namespace binaryauthorization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use binaryauthorization_v1::SystemPolicyV1Client directly. -using ::google::cloud::binaryauthorization_v1::SystemPolicyV1Client; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_SYSTEM_POLICY_V1_CLIENT_H diff --git a/google/cloud/binaryauthorization/system_policy_v1_connection.h b/google/cloud/binaryauthorization/system_policy_v1_connection.h deleted file mode 100644 index 1ffe825b49b0a..0000000000000 --- a/google/cloud/binaryauthorization/system_policy_v1_connection.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_SYSTEM_POLICY_V1_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_SYSTEM_POLICY_V1_CONNECTION_H - -#include "google/cloud/binaryauthorization/system_policy_v1_connection_idempotency_policy.h" -#include "google/cloud/binaryauthorization/v1/system_policy_v1_connection.h" - -namespace google { -namespace cloud { -namespace binaryauthorization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use binaryauthorization_v1::MakeSystemPolicyV1Connection -/// directly. -using ::google::cloud::binaryauthorization_v1::MakeSystemPolicyV1Connection; - -/// @deprecated Use binaryauthorization_v1::SystemPolicyV1Connection directly. -using ::google::cloud::binaryauthorization_v1::SystemPolicyV1Connection; - -/// @deprecated Use -/// binaryauthorization_v1::SystemPolicyV1LimitedErrorCountRetryPolicy directly. -using ::google::cloud::binaryauthorization_v1:: - SystemPolicyV1LimitedErrorCountRetryPolicy; - -/// @deprecated Use binaryauthorization_v1::SystemPolicyV1LimitedTimeRetryPolicy -/// directly. -using ::google::cloud::binaryauthorization_v1:: - SystemPolicyV1LimitedTimeRetryPolicy; - -/// @deprecated Use binaryauthorization_v1::SystemPolicyV1RetryPolicy directly. -using ::google::cloud::binaryauthorization_v1::SystemPolicyV1RetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_SYSTEM_POLICY_V1_CONNECTION_H diff --git a/google/cloud/binaryauthorization/system_policy_v1_connection_idempotency_policy.h b/google/cloud/binaryauthorization/system_policy_v1_connection_idempotency_policy.h deleted file mode 100644 index 9a7dadbabaf17..0000000000000 --- a/google/cloud/binaryauthorization/system_policy_v1_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_SYSTEM_POLICY_V1_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_SYSTEM_POLICY_V1_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/binaryauthorization/v1/system_policy_v1_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace binaryauthorization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// binaryauthorization_v1::MakeDefaultSystemPolicyV1ConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::binaryauthorization_v1:: - MakeDefaultSystemPolicyV1ConnectionIdempotencyPolicy; - -/// @deprecated Use -/// binaryauthorization_v1::SystemPolicyV1ConnectionIdempotencyPolicy directly. -using ::google::cloud::binaryauthorization_v1:: - SystemPolicyV1ConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_SYSTEM_POLICY_V1_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/binaryauthorization/system_policy_v1_options.h b/google/cloud/binaryauthorization/system_policy_v1_options.h deleted file mode 100644 index 4c019adf2d0ae..0000000000000 --- a/google/cloud/binaryauthorization/system_policy_v1_options.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_SYSTEM_POLICY_V1_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_SYSTEM_POLICY_V1_OPTIONS_H - -#include "google/cloud/binaryauthorization/system_policy_v1_connection.h" -#include "google/cloud/binaryauthorization/system_policy_v1_connection_idempotency_policy.h" -#include "google/cloud/binaryauthorization/v1/system_policy_v1_options.h" - -namespace google { -namespace cloud { -namespace binaryauthorization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use binaryauthorization_v1::SystemPolicyV1BackoffPolicyOption -/// directly. -using ::google::cloud::binaryauthorization_v1:: - SystemPolicyV1BackoffPolicyOption; - -/// @deprecated Use -/// binaryauthorization_v1::SystemPolicyV1ConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::binaryauthorization_v1:: - SystemPolicyV1ConnectionIdempotencyPolicyOption; - -/// @deprecated Use binaryauthorization_v1::SystemPolicyV1PolicyOptionList -/// directly. -using ::google::cloud::binaryauthorization_v1::SystemPolicyV1PolicyOptionList; - -/// @deprecated Use binaryauthorization_v1::SystemPolicyV1RetryPolicyOption -/// directly. -using ::google::cloud::binaryauthorization_v1::SystemPolicyV1RetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_SYSTEM_POLICY_V1_OPTIONS_H diff --git a/google/cloud/binaryauthorization/v1/binauthz_management_service_v1_connection.h b/google/cloud/binaryauthorization/v1/binauthz_management_service_v1_connection.h index db4fffc36869d..8e78321052a66 100644 --- a/google/cloud/binaryauthorization/v1/binauthz_management_service_v1_connection.h +++ b/google/cloud/binaryauthorization/v1/binauthz_management_service_v1_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/binaryauthorization/v1/binauthz_management_service_v1_connection_idempotency_policy.h" #include "google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_retry_traits.h" +#include "google/cloud/binaryauthorization/v1/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 #include namespace google { diff --git a/google/cloud/binaryauthorization/v1/binauthz_management_service_v1_connection_idempotency_policy.h b/google/cloud/binaryauthorization/v1/binauthz_management_service_v1_connection_idempotency_policy.h index 6de535ab49f6d..53129d39e015f 100644 --- a/google/cloud/binaryauthorization/v1/binauthz_management_service_v1_connection_idempotency_policy.h +++ b/google/cloud/binaryauthorization/v1/binauthz_management_service_v1_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_BINAUTHZ_MANAGEMENT_SERVICE_V1_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_BINAUTHZ_MANAGEMENT_SERVICE_V1_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_auth_decorator.cc b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_auth_decorator.cc index 5a0fb4a58f4d6..5cec1fa1309f9 100644 --- a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_auth_decorator.cc +++ b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/binaryauthorization/v1/service.proto #include "google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_auth_decorator.h" -#include +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -102,3 +105,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_auth_decorator.h b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_auth_decorator.h index 32f712c4f487d..7aeb01dcf0b04 100644 --- a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_auth_decorator.h +++ b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -84,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_BINAUTHZ_MANAGEMENT_SERVICE_V1_AUTH_DECORATOR_H diff --git a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_logging_decorator.cc b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_logging_decorator.cc index c89ff60ced7ca..c4920aeaca8fd 100644 --- a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_logging_decorator.cc +++ b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/binaryauthorization/v1/service.proto #include "google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_logging_decorator.h" +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -137,3 +140,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_logging_decorator.h b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_logging_decorator.h index 3527ea1af94b9..98c6e619a28ea 100644 --- a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_logging_decorator.h +++ b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -85,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_BINAUTHZ_MANAGEMENT_SERVICE_V1_LOGGING_DECORATOR_H diff --git a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_metadata_decorator.cc b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_metadata_decorator.cc index c64fdf3b6a827..be5ef8c278396 100644 --- a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_metadata_decorator.cc +++ b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/binaryauthorization/v1/service.proto #include "google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_metadata_decorator.h" +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 binaryauthorization_v1_internal { @@ -130,3 +134,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_metadata_decorator.h b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_metadata_decorator.h index 739e845046bec..0373c6770b2b9 100644 --- a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_metadata_decorator.h +++ b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -91,4 +94,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_BINAUTHZ_MANAGEMENT_SERVICE_V1_METADATA_DECORATOR_H diff --git a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_option_defaults.cc b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_option_defaults.cc index 24c8467822196..6ef7df1496c66 100644 --- a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_option_defaults.cc +++ b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_option_defaults.cc @@ -46,7 +46,7 @@ Options BinauthzManagementServiceV1DefaultOptions(Options options) { binaryauthorization_v1::BinauthzManagementServiceV1RetryPolicyOption>( binaryauthorization_v1:: BinauthzManagementServiceV1LimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -122,3 +125,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_stub.h b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_stub.h index 0d6e67acb4d2c..ae55db3a8aba0 100644 --- a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_stub.h +++ b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_BINAUTHZ_MANAGEMENT_SERVICE_V1_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_BINAUTHZ_MANAGEMENT_SERVICE_V1_STUB_H +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -131,4 +134,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_BINAUTHZ_MANAGEMENT_SERVICE_V1_STUB_H diff --git a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_stub_factory.cc b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_stub_factory.cc index 1a4f3cccddfcb..79d8668ceb219 100644 --- a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_stub_factory.cc +++ b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_metadata_decorator.h" #include "google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_stub.h" #include "google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_stub.h" +#include "google/cloud/binaryauthorization/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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_stub_factory.h b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_stub_factory.h index fd310fb3f8ef1..871b1cd1a6696 100644 --- a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_stub_factory.h +++ b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_BINAUTHZ_MANAGEMENT_SERVICE_V1_STUB_FACTORY_H diff --git a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_connection.cc b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_connection.cc index cc59f42f07b8d..23ad8730b46f5 100644 --- a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_connection.cc +++ b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace binaryauthorization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BinauthzManagementServiceV1TracingConnection:: BinauthzManagementServiceV1TracingConnection( std::shared_ptr< @@ -112,19 +110,15 @@ Status BinauthzManagementServiceV1TracingConnection::DeleteAttestor( return internal::EndSpan(*span, child_->DeleteAttestor(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBinauthzManagementServiceV1TracingConnection( std::shared_ptr< binaryauthorization_v1::BinauthzManagementServiceV1Connection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_connection.h b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_connection.h index a9ad2fec3d959..8eacd82697a27 100644 --- a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_connection.h +++ b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace binaryauthorization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BinauthzManagementServiceV1TracingConnection : public binaryauthorization_v1::BinauthzManagementServiceV1Connection { public: @@ -75,8 +73,6 @@ class BinauthzManagementServiceV1TracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_stub.cc b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_stub.cc index a33fcf18f0f1f..bccf6bce52c42 100644 --- a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_stub.cc +++ b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BinauthzManagementServiceV1TracingStub::BinauthzManagementServiceV1TracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -127,20 +128,16 @@ Status BinauthzManagementServiceV1TracingStub::DeleteAttestor( child_->DeleteAttestor(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBinauthzManagementServiceV1TracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_stub.h b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_stub.h index 9308b97a182ff..186e27442b7d2 100644 --- a/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_stub.h +++ b/google/cloud/binaryauthorization/v1/internal/binauthz_management_service_v1_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BinauthzManagementServiceV1TracingStub : public BinauthzManagementServiceV1Stub { public: @@ -82,8 +83,6 @@ class BinauthzManagementServiceV1TracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -99,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_BINAUTHZ_MANAGEMENT_SERVICE_V1_TRACING_STUB_H diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_auth_decorator.cc b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_auth_decorator.cc index 30f12ff33e569..eab16198740a4 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_auth_decorator.cc +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/binaryauthorization/v1/service.proto #include "google/cloud/binaryauthorization/v1/internal/system_policy_v1_auth_decorator.h" -#include +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -45,3 +48,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_auth_decorator.h b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_auth_decorator.h index da11f61554d32..b2212e9f7bbb9 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_auth_decorator.h +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -53,4 +56,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_SYSTEM_POLICY_V1_AUTH_DECORATOR_H diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_logging_decorator.cc b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_logging_decorator.cc index 5894f55009339..26e627c1cb6c8 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_logging_decorator.cc +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/binaryauthorization/v1/service.proto #include "google/cloud/binaryauthorization/v1/internal/system_policy_v1_logging_decorator.h" +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -54,3 +57,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_logging_decorator.h b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_logging_decorator.h index 3ac8115dc0d3e..b15a27e0e206d 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_logging_decorator.h +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -53,4 +56,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_SYSTEM_POLICY_V1_LOGGING_DECORATOR_H diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_metadata_decorator.cc b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_metadata_decorator.cc index e513df392108b..9477d24cb59c4 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_metadata_decorator.cc +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/binaryauthorization/v1/service.proto #include "google/cloud/binaryauthorization/v1/internal/system_policy_v1_metadata_decorator.h" +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 binaryauthorization_v1_internal { @@ -71,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_metadata_decorator.h b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_metadata_decorator.h index 5268acc1b39a5..8a4f619659025 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_metadata_decorator.h +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -58,4 +61,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_SYSTEM_POLICY_V1_METADATA_DECORATOR_H diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_option_defaults.cc b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_option_defaults.cc index cef3f15ec9d51..8dd163afec4ee 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_option_defaults.cc +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_option_defaults.cc @@ -42,7 +42,7 @@ Options SystemPolicyV1DefaultOptions(Options options) { if (!options.has()) { options.set( binaryauthorization_v1::SystemPolicyV1LimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub.cc b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub.cc index cda15b789c980..104d4bc770c47 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub.cc +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/binaryauthorization/v1/service.proto #include "google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub.h" +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -47,3 +50,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub.h b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub.h index 3ba666a82994a..619a242d59092 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub.h +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_SYSTEM_POLICY_V1_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_SYSTEM_POLICY_V1_STUB_H +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -66,4 +69,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_SYSTEM_POLICY_V1_STUB_H diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub_factory.cc b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub_factory.cc index 24d40a05d35cc..f24964a0e6a95 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub_factory.cc +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/binaryauthorization/v1/internal/system_policy_v1_metadata_decorator.h" #include "google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub.h" #include "google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_stub.h" +#include "google/cloud/binaryauthorization/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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub_factory.h b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub_factory.h index 889b638fa3e67..04bc3315e7f12 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub_factory.h +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_SYSTEM_POLICY_V1_STUB_FACTORY_H diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_connection.cc b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_connection.cc index f081bb4ffb886..940c616333e99 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_connection.cc +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace binaryauthorization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SystemPolicyV1TracingConnection::SystemPolicyV1TracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -42,16 +40,12 @@ SystemPolicyV1TracingConnection::GetSystemPolicy( return internal::EndSpan(*span, child_->GetSystemPolicy(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSystemPolicyV1TracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_connection.h b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_connection.h index 20ba07a36aa5b..edfe713cb81aa 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_connection.h +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace binaryauthorization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SystemPolicyV1TracingConnection : public binaryauthorization_v1::SystemPolicyV1Connection { public: @@ -48,8 +46,6 @@ class SystemPolicyV1TracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_stub.cc b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_stub.cc index 007288bf24fdf..87f59d2f4b212 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_stub.cc +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SystemPolicyV1TracingStub::SystemPolicyV1TracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -45,18 +46,14 @@ SystemPolicyV1TracingStub::GetSystemPolicy( child_->GetSystemPolicy(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSystemPolicyV1TracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_stub.h b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_stub.h index a01fb3b89a050..8ea2a74e3ed08 100644 --- a/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_stub.h +++ b/google/cloud/binaryauthorization/v1/internal/system_policy_v1_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SystemPolicyV1TracingStub : public SystemPolicyV1Stub { public: ~SystemPolicyV1TracingStub() override = default; @@ -49,8 +50,6 @@ class SystemPolicyV1TracingStub : public SystemPolicyV1Stub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -65,4 +64,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_SYSTEM_POLICY_V1_TRACING_STUB_H diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_auth_decorator.cc b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_auth_decorator.cc index c3408e3835ad4..6e83c2f618c74 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_auth_decorator.cc +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/binaryauthorization/v1/service.proto #include "google/cloud/binaryauthorization/v1/internal/validation_helper_v1_auth_decorator.h" -#include +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -46,3 +49,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_auth_decorator.h b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_auth_decorator.h index 38f33b998fc24..9b872e5029feb 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_auth_decorator.h +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -55,4 +58,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_VALIDATION_HELPER_V1_AUTH_DECORATOR_H diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_logging_decorator.cc b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_logging_decorator.cc index 1388971164b76..90490da70609e 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_logging_decorator.cc +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/binaryauthorization/v1/service.proto #include "google/cloud/binaryauthorization/v1/internal/validation_helper_v1_logging_decorator.h" +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -54,3 +57,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_logging_decorator.h b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_logging_decorator.h index 84afb95b583dc..ad2187e999001 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_logging_decorator.h +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -55,4 +58,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_VALIDATION_HELPER_V1_LOGGING_DECORATOR_H diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_metadata_decorator.cc b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_metadata_decorator.cc index 29fd64d567b0d..0a35e7a0a02f9 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_metadata_decorator.cc +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/binaryauthorization/v1/service.proto #include "google/cloud/binaryauthorization/v1/internal/validation_helper_v1_metadata_decorator.h" +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 binaryauthorization_v1_internal { @@ -73,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_metadata_decorator.h b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_metadata_decorator.h index d2c64c6a4f1e5..023ac6414bc6e 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_metadata_decorator.h +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -61,4 +64,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_VALIDATION_HELPER_V1_METADATA_DECORATOR_H diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_option_defaults.cc b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_option_defaults.cc index 57d89640b2ce5..3e40f718ebfb4 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_option_defaults.cc +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_option_defaults.cc @@ -43,7 +43,7 @@ Options ValidationHelperV1DefaultOptions(Options options) { binaryauthorization_v1::ValidationHelperV1RetryPolicyOption>()) { options.set( binaryauthorization_v1::ValidationHelperV1LimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub.cc b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub.cc index 7692db5c1247f..85585c6928a3c 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub.cc +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/binaryauthorization/v1/service.proto #include "google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub.h" +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -50,3 +53,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub.h b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub.h index 3247af5600c47..9418c677990bd 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub.h +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_VALIDATION_HELPER_V1_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_VALIDATION_HELPER_V1_STUB_H +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -69,4 +72,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_VALIDATION_HELPER_V1_STUB_H diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub_factory.cc b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub_factory.cc index 6ff64cc486480..e06e1b1ba35b5 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub_factory.cc +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/binaryauthorization/v1/internal/validation_helper_v1_metadata_decorator.h" #include "google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub.h" #include "google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_stub.h" +#include "google/cloud/binaryauthorization/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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub_factory.h b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub_factory.h index fce0e9e5c9567..be9a3effd48bd 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub_factory.h +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_VALIDATION_HELPER_V1_STUB_FACTORY_H diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_connection.cc b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_connection.cc index cc99eba3ea88f..cf407923ad86b 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_connection.cc +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace binaryauthorization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ValidationHelperV1TracingConnection::ValidationHelperV1TracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -45,18 +43,14 @@ ValidationHelperV1TracingConnection::ValidateAttestationOccurrence( child_->ValidateAttestationOccurrence(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeValidationHelperV1TracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_connection.h b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_connection.h index e4a08a8b62c4d..153c64c675f5a 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_connection.h +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace binaryauthorization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ValidationHelperV1TracingConnection : public binaryauthorization_v1::ValidationHelperV1Connection { public: @@ -51,8 +49,6 @@ class ValidationHelperV1TracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_stub.cc b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_stub.cc index 34f08592227b5..5472a72351cd6 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_stub.cc +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ValidationHelperV1TracingStub::ValidationHelperV1TracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -48,18 +49,14 @@ ValidationHelperV1TracingStub::ValidateAttestationOccurrence( child_->ValidateAttestationOccurrence(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeValidationHelperV1TracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace binaryauthorization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_stub.h b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_stub.h index a08a423f4baf8..3371bf9a2ef3b 100644 --- a/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_stub.h +++ b/google/cloud/binaryauthorization/v1/internal/validation_helper_v1_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace binaryauthorization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ValidationHelperV1TracingStub : public ValidationHelperV1Stub { public: ~ValidationHelperV1TracingStub() override = default; @@ -52,8 +53,6 @@ class ValidationHelperV1TracingStub : public ValidationHelperV1Stub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -68,4 +67,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_INTERNAL_VALIDATION_HELPER_V1_TRACING_STUB_H diff --git a/google/cloud/binaryauthorization/v1/system_policy_v1_connection.h b/google/cloud/binaryauthorization/v1/system_policy_v1_connection.h index e290a300a0200..f8fa88c382e0a 100644 --- a/google/cloud/binaryauthorization/v1/system_policy_v1_connection.h +++ b/google/cloud/binaryauthorization/v1/system_policy_v1_connection.h @@ -20,13 +20,13 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_SYSTEM_POLICY_V1_CONNECTION_H #include "google/cloud/binaryauthorization/v1/internal/system_policy_v1_retry_traits.h" +#include "google/cloud/binaryauthorization/v1/service.pb.h" #include "google/cloud/binaryauthorization/v1/system_policy_v1_connection_idempotency_policy.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/version.h" -#include #include namespace google { diff --git a/google/cloud/binaryauthorization/v1/system_policy_v1_connection_idempotency_policy.h b/google/cloud/binaryauthorization/v1/system_policy_v1_connection_idempotency_policy.h index ec6a2cbd738d1..a4e44ff553580 100644 --- a/google/cloud/binaryauthorization/v1/system_policy_v1_connection_idempotency_policy.h +++ b/google/cloud/binaryauthorization/v1/system_policy_v1_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_SYSTEM_POLICY_V1_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_SYSTEM_POLICY_V1_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/binaryauthorization/v1/validation_helper_v1_connection.h b/google/cloud/binaryauthorization/v1/validation_helper_v1_connection.h index 2813a6ff98716..e38c4427628b5 100644 --- a/google/cloud/binaryauthorization/v1/validation_helper_v1_connection.h +++ b/google/cloud/binaryauthorization/v1/validation_helper_v1_connection.h @@ -20,13 +20,13 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_VALIDATION_HELPER_V1_CONNECTION_H #include "google/cloud/binaryauthorization/v1/internal/validation_helper_v1_retry_traits.h" +#include "google/cloud/binaryauthorization/v1/service.pb.h" #include "google/cloud/binaryauthorization/v1/validation_helper_v1_connection_idempotency_policy.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/version.h" -#include #include namespace google { diff --git a/google/cloud/binaryauthorization/v1/validation_helper_v1_connection_idempotency_policy.h b/google/cloud/binaryauthorization/v1/validation_helper_v1_connection_idempotency_policy.h index 2174521426d32..8a38cc674a625 100644 --- a/google/cloud/binaryauthorization/v1/validation_helper_v1_connection_idempotency_policy.h +++ b/google/cloud/binaryauthorization/v1/validation_helper_v1_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_VALIDATION_HELPER_V1_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_V1_VALIDATION_HELPER_V1_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/binaryauthorization/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/binaryauthorization/validation_helper_v1_client.h b/google/cloud/binaryauthorization/validation_helper_v1_client.h deleted file mode 100644 index 6018b7a394276..0000000000000 --- a/google/cloud/binaryauthorization/validation_helper_v1_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_VALIDATION_HELPER_V1_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_VALIDATION_HELPER_V1_CLIENT_H - -#include "google/cloud/binaryauthorization/v1/validation_helper_v1_client.h" -#include "google/cloud/binaryauthorization/validation_helper_v1_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in binaryauthorization_v1 instead of the aliases defined -/// in this namespace. -namespace binaryauthorization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use binaryauthorization_v1::ValidationHelperV1Client directly. -using ::google::cloud::binaryauthorization_v1::ValidationHelperV1Client; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_VALIDATION_HELPER_V1_CLIENT_H diff --git a/google/cloud/binaryauthorization/validation_helper_v1_connection.h b/google/cloud/binaryauthorization/validation_helper_v1_connection.h deleted file mode 100644 index fa5175d0ab4bf..0000000000000 --- a/google/cloud/binaryauthorization/validation_helper_v1_connection.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_VALIDATION_HELPER_V1_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_VALIDATION_HELPER_V1_CONNECTION_H - -#include "google/cloud/binaryauthorization/v1/validation_helper_v1_connection.h" -#include "google/cloud/binaryauthorization/validation_helper_v1_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace binaryauthorization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use binaryauthorization_v1::MakeValidationHelperV1Connection -/// directly. -using ::google::cloud::binaryauthorization_v1::MakeValidationHelperV1Connection; - -/// @deprecated Use binaryauthorization_v1::ValidationHelperV1Connection -/// directly. -using ::google::cloud::binaryauthorization_v1::ValidationHelperV1Connection; - -/// @deprecated Use -/// binaryauthorization_v1::ValidationHelperV1LimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::binaryauthorization_v1:: - ValidationHelperV1LimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// binaryauthorization_v1::ValidationHelperV1LimitedTimeRetryPolicy directly. -using ::google::cloud::binaryauthorization_v1:: - ValidationHelperV1LimitedTimeRetryPolicy; - -/// @deprecated Use binaryauthorization_v1::ValidationHelperV1RetryPolicy -/// directly. -using ::google::cloud::binaryauthorization_v1::ValidationHelperV1RetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_VALIDATION_HELPER_V1_CONNECTION_H diff --git a/google/cloud/binaryauthorization/validation_helper_v1_connection_idempotency_policy.h b/google/cloud/binaryauthorization/validation_helper_v1_connection_idempotency_policy.h deleted file mode 100644 index 8d5e61aec6049..0000000000000 --- a/google/cloud/binaryauthorization/validation_helper_v1_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_VALIDATION_HELPER_V1_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_VALIDATION_HELPER_V1_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/binaryauthorization/v1/validation_helper_v1_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace binaryauthorization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// binaryauthorization_v1::MakeDefaultValidationHelperV1ConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::binaryauthorization_v1:: - MakeDefaultValidationHelperV1ConnectionIdempotencyPolicy; - -/// @deprecated Use -/// binaryauthorization_v1::ValidationHelperV1ConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::binaryauthorization_v1:: - ValidationHelperV1ConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_VALIDATION_HELPER_V1_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/binaryauthorization/validation_helper_v1_options.h b/google/cloud/binaryauthorization/validation_helper_v1_options.h deleted file mode 100644 index 607889c06b354..0000000000000 --- a/google/cloud/binaryauthorization/validation_helper_v1_options.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/binaryauthorization/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_VALIDATION_HELPER_V1_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_VALIDATION_HELPER_V1_OPTIONS_H - -#include "google/cloud/binaryauthorization/v1/validation_helper_v1_options.h" -#include "google/cloud/binaryauthorization/validation_helper_v1_connection.h" -#include "google/cloud/binaryauthorization/validation_helper_v1_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace binaryauthorization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// binaryauthorization_v1::ValidationHelperV1BackoffPolicyOption directly. -using ::google::cloud::binaryauthorization_v1:: - ValidationHelperV1BackoffPolicyOption; - -/// @deprecated Use -/// binaryauthorization_v1::ValidationHelperV1ConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::binaryauthorization_v1:: - ValidationHelperV1ConnectionIdempotencyPolicyOption; - -/// @deprecated Use binaryauthorization_v1::ValidationHelperV1PolicyOptionList -/// directly. -using ::google::cloud::binaryauthorization_v1:: - ValidationHelperV1PolicyOptionList; - -/// @deprecated Use binaryauthorization_v1::ValidationHelperV1RetryPolicyOption -/// directly. -using ::google::cloud::binaryauthorization_v1:: - ValidationHelperV1RetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace binaryauthorization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BINARYAUTHORIZATION_VALIDATION_HELPER_V1_OPTIONS_H diff --git a/google/cloud/capture_build_info.bzl b/google/cloud/capture_build_info.bzl index b98926a025b17..31f94c0543e74 100644 --- a/google/cloud/capture_build_info.bzl +++ b/google/cloud/capture_build_info.bzl @@ -34,6 +34,7 @@ https://github.com/bazelbuild/rules_cc/blob/0d68932a68bcd6f332b14ccc561990586de2 load("@rules_cc//cc:action_names.bzl", "CPP_COMPILE_ACTION_NAME") load("@rules_cc//cc:toolchain_utils.bzl", "find_cpp_toolchain") +load("@rules_cc//cc/common:cc_common.bzl", "cc_common") def _capture_build_info_impl(ctx): toolchain = find_cpp_toolchain(ctx) diff --git a/google/cloud/certificatemanager/BUILD.bazel b/google/cloud/certificatemanager/BUILD.bazel index 9057ab9ec38a4..5b484034f4a4c 100644 --- a/google/cloud/certificatemanager/BUILD.bazel +++ b/google/cloud/certificatemanager/BUILD.bazel @@ -19,13 +19,12 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/certificatemanager/logging/v1:logging_cc_grpc", - "@com_google_googleapis//google/cloud/certificatemanager/v1:certificatemanager_cc_grpc", + "@googleapis//google/cloud/certificatemanager/logging/v1:logging_cc_grpc", + "@googleapis//google/cloud/certificatemanager/v1:certificatemanager_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/certificatemanager/CMakeLists.txt b/google/cloud/certificatemanager/CMakeLists.txt index c199c83f52646..5f77e0c1729a1 100644 --- a/google/cloud/certificatemanager/CMakeLists.txt +++ b/google/cloud/certificatemanager/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(certificatemanager "Certificate Manager API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(certificatemanager_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/certificatemanager/certificate_manager_client.h b/google/cloud/certificatemanager/certificate_manager_client.h deleted file mode 100644 index 382e403a78c7b..0000000000000 --- a/google/cloud/certificatemanager/certificate_manager_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/certificatemanager/v1/certificate_manager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_CERTIFICATE_MANAGER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_CERTIFICATE_MANAGER_CLIENT_H - -#include "google/cloud/certificatemanager/certificate_manager_connection.h" -#include "google/cloud/certificatemanager/v1/certificate_manager_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in certificatemanager_v1 instead of the aliases defined in -/// this namespace. -namespace certificatemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use certificatemanager_v1::CertificateManagerClient directly. -using ::google::cloud::certificatemanager_v1::CertificateManagerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace certificatemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_CERTIFICATE_MANAGER_CLIENT_H diff --git a/google/cloud/certificatemanager/certificate_manager_connection.h b/google/cloud/certificatemanager/certificate_manager_connection.h deleted file mode 100644 index 321a173ba2f6c..0000000000000 --- a/google/cloud/certificatemanager/certificate_manager_connection.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/certificatemanager/v1/certificate_manager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_CERTIFICATE_MANAGER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_CERTIFICATE_MANAGER_CONNECTION_H - -#include "google/cloud/certificatemanager/certificate_manager_connection_idempotency_policy.h" -#include "google/cloud/certificatemanager/v1/certificate_manager_connection.h" - -namespace google { -namespace cloud { -namespace certificatemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use certificatemanager_v1::MakeCertificateManagerConnection -/// directly. -using ::google::cloud::certificatemanager_v1::MakeCertificateManagerConnection; - -/// @deprecated Use certificatemanager_v1::CertificateManagerConnection -/// directly. -using ::google::cloud::certificatemanager_v1::CertificateManagerConnection; - -/// @deprecated Use -/// certificatemanager_v1::CertificateManagerLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::certificatemanager_v1:: - CertificateManagerLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// certificatemanager_v1::CertificateManagerLimitedTimeRetryPolicy directly. -using ::google::cloud::certificatemanager_v1:: - CertificateManagerLimitedTimeRetryPolicy; - -/// @deprecated Use certificatemanager_v1::CertificateManagerRetryPolicy -/// directly. -using ::google::cloud::certificatemanager_v1::CertificateManagerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace certificatemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_CERTIFICATE_MANAGER_CONNECTION_H diff --git a/google/cloud/certificatemanager/certificate_manager_connection_idempotency_policy.h b/google/cloud/certificatemanager/certificate_manager_connection_idempotency_policy.h deleted file mode 100644 index a1c7eb7703244..0000000000000 --- a/google/cloud/certificatemanager/certificate_manager_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/certificatemanager/v1/certificate_manager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_CERTIFICATE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_CERTIFICATE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/certificatemanager/v1/certificate_manager_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace certificatemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// certificatemanager_v1::MakeDefaultCertificateManagerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::certificatemanager_v1:: - MakeDefaultCertificateManagerConnectionIdempotencyPolicy; - -/// @deprecated Use -/// certificatemanager_v1::CertificateManagerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::certificatemanager_v1:: - CertificateManagerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace certificatemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_CERTIFICATE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/certificatemanager/certificate_manager_options.h b/google/cloud/certificatemanager/certificate_manager_options.h deleted file mode 100644 index e0f21b1771f10..0000000000000 --- a/google/cloud/certificatemanager/certificate_manager_options.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/certificatemanager/v1/certificate_manager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_CERTIFICATE_MANAGER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_CERTIFICATE_MANAGER_OPTIONS_H - -#include "google/cloud/certificatemanager/certificate_manager_connection.h" -#include "google/cloud/certificatemanager/certificate_manager_connection_idempotency_policy.h" -#include "google/cloud/certificatemanager/v1/certificate_manager_options.h" - -namespace google { -namespace cloud { -namespace certificatemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use certificatemanager_v1::CertificateManagerPollingPolicyOption -/// directly. -using ::google::cloud::certificatemanager_v1:: - CertificateManagerPollingPolicyOption; - -/// @deprecated Use certificatemanager_v1::CertificateManagerBackoffPolicyOption -/// directly. -using ::google::cloud::certificatemanager_v1:: - CertificateManagerBackoffPolicyOption; - -/// @deprecated Use -/// certificatemanager_v1::CertificateManagerConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::certificatemanager_v1:: - CertificateManagerConnectionIdempotencyPolicyOption; - -/// @deprecated Use certificatemanager_v1::CertificateManagerPolicyOptionList -/// directly. -using ::google::cloud::certificatemanager_v1:: - CertificateManagerPolicyOptionList; - -/// @deprecated Use certificatemanager_v1::CertificateManagerRetryPolicyOption -/// directly. -using ::google::cloud::certificatemanager_v1:: - CertificateManagerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace certificatemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_CERTIFICATE_MANAGER_OPTIONS_H diff --git a/google/cloud/certificatemanager/mocks/mock_certificate_manager_connection.h b/google/cloud/certificatemanager/mocks/mock_certificate_manager_connection.h deleted file mode 100644 index 89575a80fcbfc..0000000000000 --- a/google/cloud/certificatemanager/mocks/mock_certificate_manager_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/certificatemanager/v1/certificate_manager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_MOCKS_MOCK_CERTIFICATE_MANAGER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_MOCKS_MOCK_CERTIFICATE_MANAGER_CONNECTION_H - -#include "google/cloud/certificatemanager/certificate_manager_connection.h" -#include "google/cloud/certificatemanager/v1/mocks/mock_certificate_manager_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in certificatemanager_v1_mocks instead of the aliases -/// defined in this namespace. -namespace certificatemanager_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// certificatemanager_v1_mocks::MockCertificateManagerConnection directly. -using ::google::cloud::certificatemanager_v1_mocks:: - MockCertificateManagerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace certificatemanager_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_MOCKS_MOCK_CERTIFICATE_MANAGER_CONNECTION_H diff --git a/google/cloud/certificatemanager/quickstart/.bazelrc b/google/cloud/certificatemanager/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/certificatemanager/quickstart/.bazelrc +++ b/google/cloud/certificatemanager/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/certificatemanager/quickstart/CMakeLists.txt index 85592ce558fdb..438b2212c8ec8 100644 --- a/google/cloud/certificatemanager/quickstart/CMakeLists.txt +++ b/google/cloud/certificatemanager/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Certificate Manager API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-certificatemanager-quickstart CXX) find_package(google_cloud_cpp_certificatemanager REQUIRED) diff --git a/google/cloud/certificatemanager/quickstart/WORKSPACE.bazel b/google/cloud/certificatemanager/quickstart/WORKSPACE.bazel index b63b215e6401e..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 = "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/certificatemanager/v1/certificate_manager_client.h b/google/cloud/certificatemanager/v1/certificate_manager_client.h index d08c04067b979..209f1e58b194c 100644 --- a/google/cloud/certificatemanager/v1/certificate_manager_client.h +++ b/google/cloud/certificatemanager/v1/certificate_manager_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/certificatemanager/v1/certificate_manager_connection.h b/google/cloud/certificatemanager/v1/certificate_manager_connection.h index d6b66bd020403..56549a0f20458 100644 --- a/google/cloud/certificatemanager/v1/certificate_manager_connection.h +++ b/google/cloud/certificatemanager/v1/certificate_manager_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_V1_CERTIFICATE_MANAGER_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_V1_CERTIFICATE_MANAGER_CONNECTION_H +#include "google/cloud/certificatemanager/v1/certificate_manager.pb.h" #include "google/cloud/certificatemanager/v1/certificate_manager_connection_idempotency_policy.h" #include "google/cloud/certificatemanager/v1/internal/certificate_manager_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/certificatemanager/v1/certificate_manager_connection_idempotency_policy.h b/google/cloud/certificatemanager/v1/certificate_manager_connection_idempotency_policy.h index b1a745714b3b9..fee03fa9c58c2 100644 --- a/google/cloud/certificatemanager/v1/certificate_manager_connection_idempotency_policy.h +++ b/google/cloud/certificatemanager/v1/certificate_manager_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_V1_CERTIFICATE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_V1_CERTIFICATE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/certificatemanager/v1/certificate_manager.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_auth_decorator.cc b/google/cloud/certificatemanager/v1/internal/certificate_manager_auth_decorator.cc index a3bae677bca52..59c955f32d3ce 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_auth_decorator.cc +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/certificatemanager/v1/certificate_manager.proto #include "google/cloud/certificatemanager/v1/internal/certificate_manager_auth_decorator.h" -#include +#include "google/cloud/certificatemanager/v1/certificate_manager.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace certificatemanager_v1_internal { @@ -770,3 +773,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace certificatemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_auth_decorator.h b/google/cloud/certificatemanager/v1/internal/certificate_manager_auth_decorator.h index 1e5829314f6b0..2f9266d4b65fd 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_auth_decorator.h +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/certificatemanager/v1/internal/certificate_manager_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 certificatemanager_v1_internal { @@ -366,4 +369,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_V1_INTERNAL_CERTIFICATE_MANAGER_AUTH_DECORATOR_H diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_connection_impl.h b/google/cloud/certificatemanager/v1/internal/certificate_manager_connection_impl.h index be19bdea8cc1e..2fa57ac738990 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_connection_impl.h +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_logging_decorator.cc b/google/cloud/certificatemanager/v1/internal/certificate_manager_logging_decorator.cc index 591a5000c9575..f0a35ff266c4a 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_logging_decorator.cc +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/certificatemanager/v1/certificate_manager.proto #include "google/cloud/certificatemanager/v1/internal/certificate_manager_logging_decorator.h" +#include "google/cloud/certificatemanager/v1/certificate_manager.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace certificatemanager_v1_internal { @@ -910,3 +913,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace certificatemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_logging_decorator.h b/google/cloud/certificatemanager/v1/internal/certificate_manager_logging_decorator.h index 978cdfaca23d7..5c7129ff434de 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_logging_decorator.h +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/certificatemanager/v1/internal/certificate_manager_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 certificatemanager_v1_internal { @@ -366,4 +369,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_V1_INTERNAL_CERTIFICATE_MANAGER_LOGGING_DECORATOR_H diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_metadata_decorator.cc b/google/cloud/certificatemanager/v1/internal/certificate_manager_metadata_decorator.cc index e09e52d21d8ea..bc6d2ccc46d4b 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_metadata_decorator.cc +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/certificatemanager/v1/certificate_manager.proto #include "google/cloud/certificatemanager/v1/internal/certificate_manager_metadata_decorator.h" +#include "google/cloud/certificatemanager/v1/certificate_manager.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 certificatemanager_v1_internal { @@ -665,3 +669,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace certificatemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_metadata_decorator.h b/google/cloud/certificatemanager/v1/internal/certificate_manager_metadata_decorator.h index 66ed5b7fa8870..b64be9a61b44e 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_metadata_decorator.h +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/certificatemanager/v1/internal/certificate_manager_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 certificatemanager_v1_internal { @@ -372,4 +375,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_V1_INTERNAL_CERTIFICATE_MANAGER_METADATA_DECORATOR_H diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_option_defaults.cc b/google/cloud/certificatemanager/v1/internal/certificate_manager_option_defaults.cc index 200c757cd5a9c..de0cb9e9a1027 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_option_defaults.cc +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_option_defaults.cc @@ -43,7 +43,7 @@ Options CertificateManagerDefaultOptions(Options options) { .has()) { options.set( certificatemanager_v1::CertificateManagerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_stub.cc b/google/cloud/certificatemanager/v1/internal/certificate_manager_stub.cc index 1ab7bdb79ca68..4f21a455140b0 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_stub.cc +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/certificatemanager/v1/certificate_manager.proto #include "google/cloud/certificatemanager/v1/internal/certificate_manager_stub.h" +#include "google/cloud/certificatemanager/v1/certificate_manager.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace certificatemanager_v1_internal { @@ -885,3 +888,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace certificatemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_stub.h b/google/cloud/certificatemanager/v1/internal/certificate_manager_stub.h index c54fc642398be..ff9e6e6aa8b08 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_stub.h +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_V1_INTERNAL_CERTIFICATE_MANAGER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_V1_INTERNAL_CERTIFICATE_MANAGER_STUB_H +#include "google/cloud/certificatemanager/v1/certificate_manager.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace certificatemanager_v1_internal { @@ -724,4 +727,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_V1_INTERNAL_CERTIFICATE_MANAGER_STUB_H diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_stub_factory.cc b/google/cloud/certificatemanager/v1/internal/certificate_manager_stub_factory.cc index 711ad31705ca6..6420993495c9e 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_stub_factory.cc +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/certificatemanager/v1/certificate_manager.proto #include "google/cloud/certificatemanager/v1/internal/certificate_manager_stub_factory.h" +#include "google/cloud/certificatemanager/v1/certificate_manager.grpc.pb.h" #include "google/cloud/certificatemanager/v1/internal/certificate_manager_auth_decorator.h" #include "google/cloud/certificatemanager/v1/internal/certificate_manager_logging_decorator.h" #include "google/cloud/certificatemanager/v1/internal/certificate_manager_metadata_decorator.h" #include "google/cloud/certificatemanager/v1/internal/certificate_manager_stub.h" #include "google/cloud/certificatemanager/v1/internal/certificate_manager_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace certificatemanager_v1_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace certificatemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_stub_factory.h b/google/cloud/certificatemanager/v1/internal/certificate_manager_stub_factory.h index e25aabe42327a..e7cefc50003b3 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_stub_factory.h +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace certificatemanager_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_V1_INTERNAL_CERTIFICATE_MANAGER_STUB_FACTORY_H diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_connection.cc b/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_connection.cc index 831047687ff3a..366e217b8c76f 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_connection.cc +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace certificatemanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CertificateManagerTracingConnection::CertificateManagerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -817,17 +815,13 @@ Status CertificateManagerTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCertificateManagerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_connection.h b/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_connection.h index 38c1b6e930f8d..ff2e442c5555a 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_connection.h +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace certificatemanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CertificateManagerTracingConnection : public certificatemanager_v1::CertificateManagerConnection { public: @@ -349,8 +347,6 @@ class CertificateManagerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_stub.cc b/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_stub.cc index 2c0ace27ebc16..e5dfd022cf012 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_stub.cc +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace certificatemanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CertificateManagerTracingStub::CertificateManagerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -842,18 +843,14 @@ future CertificateManagerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCertificateManagerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace certificatemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_stub.h b/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_stub.h index fd2e5c3b1e866..1d2988f30a1b3 100644 --- a/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_stub.h +++ b/google/cloud/certificatemanager/v1/internal/certificate_manager_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace certificatemanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CertificateManagerTracingStub : public CertificateManagerStub { public: ~CertificateManagerTracingStub() override = default; @@ -362,8 +363,6 @@ class CertificateManagerTracingStub : public CertificateManagerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -378,4 +377,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CERTIFICATEMANAGER_V1_INTERNAL_CERTIFICATE_MANAGER_TRACING_STUB_H 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/BUILD.bazel b/google/cloud/channel/BUILD.bazel index 54ba556ef942e..4e12837ea2115 100644 --- a/google/cloud/channel/BUILD.bazel +++ b/google/cloud/channel/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/channel/v1:channel_cc_grpc", + "@googleapis//google/cloud/channel/v1:channel_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/channel/CMakeLists.txt b/google/cloud/channel/CMakeLists.txt index 1dcd79c464eb7..1343b8229074c 100644 --- a/google/cloud/channel/CMakeLists.txt +++ b/google/cloud/channel/CMakeLists.txt @@ -30,7 +30,7 @@ endif () include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(channel "Cloud Channel API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") # The quickstart is too difficult to run successfully, hence, there is no # quickstart runner. diff --git a/google/cloud/channel/cloud_channel_client.h b/google/cloud/channel/cloud_channel_client.h deleted file mode 100644 index ba6d39ebf40ff..0000000000000 --- a/google/cloud/channel/cloud_channel_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_CLOUD_CHANNEL_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_CLOUD_CHANNEL_CLIENT_H - -#include "google/cloud/channel/cloud_channel_connection.h" -#include "google/cloud/channel/v1/cloud_channel_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in channel_v1 instead of the aliases defined in -/// this namespace. -namespace channel { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use channel_v1::CloudChannelServiceClient directly. -using ::google::cloud::channel_v1::CloudChannelServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_CLOUD_CHANNEL_CLIENT_H diff --git a/google/cloud/channel/cloud_channel_connection.h b/google/cloud/channel/cloud_channel_connection.h deleted file mode 100644 index bf43fb3fb182c..0000000000000 --- a/google/cloud/channel/cloud_channel_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_CLOUD_CHANNEL_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_CLOUD_CHANNEL_CONNECTION_H - -#include "google/cloud/channel/cloud_channel_connection_idempotency_policy.h" -#include "google/cloud/channel/v1/cloud_channel_connection.h" - -namespace google { -namespace cloud { -namespace channel { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use channel_v1::MakeCloudChannelServiceConnection directly. -using ::google::cloud::channel_v1::MakeCloudChannelServiceConnection; - -/// @deprecated Use channel_v1::CloudChannelServiceConnection directly. -using ::google::cloud::channel_v1::CloudChannelServiceConnection; - -/// @deprecated Use channel_v1::CloudChannelServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::channel_v1:: - CloudChannelServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use channel_v1::CloudChannelServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::channel_v1::CloudChannelServiceLimitedTimeRetryPolicy; - -/// @deprecated Use channel_v1::CloudChannelServiceRetryPolicy directly. -using ::google::cloud::channel_v1::CloudChannelServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_CLOUD_CHANNEL_CONNECTION_H diff --git a/google/cloud/channel/cloud_channel_connection_idempotency_policy.h b/google/cloud/channel/cloud_channel_connection_idempotency_policy.h deleted file mode 100644 index 1913b4f96f1a9..0000000000000 --- a/google/cloud/channel/cloud_channel_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_CLOUD_CHANNEL_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_CLOUD_CHANNEL_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/channel/v1/cloud_channel_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace channel { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// channel_v1::MakeDefaultCloudChannelServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::channel_v1:: - MakeDefaultCloudChannelServiceConnectionIdempotencyPolicy; - -/// @deprecated Use channel_v1::CloudChannelServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::channel_v1:: - CloudChannelServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_CLOUD_CHANNEL_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/channel/cloud_channel_options.h b/google/cloud/channel/cloud_channel_options.h deleted file mode 100644 index 3c07d1a339ce0..0000000000000 --- a/google/cloud/channel/cloud_channel_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_CLOUD_CHANNEL_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_CLOUD_CHANNEL_OPTIONS_H - -#include "google/cloud/channel/cloud_channel_connection.h" -#include "google/cloud/channel/cloud_channel_connection_idempotency_policy.h" -#include "google/cloud/channel/v1/cloud_channel_options.h" - -namespace google { -namespace cloud { -namespace channel { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use channel_v1::CloudChannelServicePollingPolicyOption directly. -using ::google::cloud::channel_v1::CloudChannelServicePollingPolicyOption; - -/// @deprecated Use channel_v1::CloudChannelServiceBackoffPolicyOption directly. -using ::google::cloud::channel_v1::CloudChannelServiceBackoffPolicyOption; - -/// @deprecated Use -/// channel_v1::CloudChannelServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::channel_v1:: - CloudChannelServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use channel_v1::CloudChannelServicePolicyOptionList directly. -using ::google::cloud::channel_v1::CloudChannelServicePolicyOptionList; - -/// @deprecated Use channel_v1::CloudChannelServiceRetryPolicyOption directly. -using ::google::cloud::channel_v1::CloudChannelServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_CLOUD_CHANNEL_OPTIONS_H diff --git a/google/cloud/channel/doc/environment-variables.dox b/google/cloud/channel/doc/environment-variables.dox index 87279b5131706..e3aaf0e96a2ac 100644 --- a/google/cloud/channel/doc/environment-variables.dox +++ b/google/cloud/channel/doc/environment-variables.dox @@ -9,10 +9,6 @@ environment variables are convenient when troubleshooting problems. -- `GOOGLE_CLOUD_CPP_CLOUD_CHANNEL_REPORTS_SERVICE_ENDPOINT=...` overrides the - `EndpointOption` (which defaults to "cloudchannel.googleapis.com") - used by `MakeCloudChannelReportsServiceConnection()`. - - `GOOGLE_CLOUD_CPP_CLOUD_CHANNEL_SERVICE_ENDPOINT=...` overrides the `EndpointOption` (which defaults to "cloudchannel.googleapis.com") used by `MakeCloudChannelServiceConnection()`. diff --git a/google/cloud/channel/doc/main.dox b/google/cloud/channel/doc/main.dox index e26afd0f79404..6c2e718803565 100644 --- a/google/cloud/channel/doc/main.dox +++ b/google/cloud/channel/doc/main.dox @@ -22,18 +22,12 @@ which should give you a taste of the Cloud Channel API C++ client library API. ## 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 +The main class in this library is +[`channel_v1::CloudChannelServiceClient`](@ref google::cloud::channel_v1::CloudChannelServiceClient). All RPCs are exposed +as member functions of this class. Other classes provide helpers, configuration +parameters, and infrastructure to mock +[`channel_v1::CloudChannelServiceClient`](@ref google::cloud::channel_v1::CloudChannelServiceClient) when testing your application. - -- [\c channel_v1::CloudChannelServiceClient](@ref google::cloud::channel_v1::CloudChannelServiceClient) -- [\c channel_v1::CloudChannelReportsServiceClient](@ref google::cloud::channel_v1::CloudChannelReportsServiceClient) ## More Information diff --git a/google/cloud/channel/doc/override-authentication.dox b/google/cloud/channel/doc/override-authentication.dox index 99bb4a4ba99af..362da1179fa24 100644 --- a/google/cloud/channel/doc/override-authentication.dox +++ b/google/cloud/channel/doc/override-authentication.dox @@ -11,11 +11,6 @@ The following example shows how to explicitly load a service account key file: @snippet cloud_channel_client_samples.cc with-service-account -Follow these links to find examples for other \c *Client classes: - -- [\c channel_v1::CloudChannelServiceClient](@ref channel_v1::CloudChannelServiceClient-service-account-snippet) -- [\c channel_v1::CloudChannelReportsServiceClient](@ref channel_v1::CloudChannelReportsServiceClient-service-account-snippet) - Keep in mind that we chose this as an example because it is relatively easy to @@ -36,11 +31,5 @@ guide for more details. @snippet google/cloud/channel/v1/samples/cloud_channel_client_samples.cc with-service-account -*/ - -/*! @page channel_v1::CloudChannelReportsServiceClient-service-account-snippet Override channel_v1::CloudChannelReportsServiceClient Authentication Defaults - -@snippet google/cloud/channel/v1/samples/cloud_channel_reports_client_samples.cc with-service-account - */ // diff --git a/google/cloud/channel/doc/override-endpoint.dox b/google/cloud/channel/doc/override-endpoint.dox index 30253d1238885..dbccdff87a160 100644 --- a/google/cloud/channel/doc/override-endpoint.dox +++ b/google/cloud/channel/doc/override-endpoint.dox @@ -11,11 +11,6 @@ For example, this will override the default endpoint for `channel_v1::CloudChann @snippet cloud_channel_client_samples.cc set-client-endpoint -Follow these links to find examples for other \c *Client classes: - -- [\c channel_v1::CloudChannelServiceClient](@ref channel_v1::CloudChannelServiceClient-endpoint-snippet) -- [\c channel_v1::CloudChannelReportsServiceClient](@ref channel_v1::CloudChannelReportsServiceClient-endpoint-snippet) - */ @@ -26,11 +21,5 @@ Follow these links to find examples for other \c *Client classes: @snippet google/cloud/channel/v1/samples/cloud_channel_client_samples.cc set-client-endpoint -*/ - -/*! @page channel_v1::CloudChannelReportsServiceClient-endpoint-snippet Override channel_v1::CloudChannelReportsServiceClient Endpoint Configuration - -@snippet google/cloud/channel/v1/samples/cloud_channel_reports_client_samples.cc set-client-endpoint - */ // diff --git a/google/cloud/channel/doc/override-retry-policies.dox b/google/cloud/channel/doc/override-retry-policies.dox index 0b361974f26a9..2dc2fa9dc6066 100644 --- a/google/cloud/channel/doc/override-retry-policies.dox +++ b/google/cloud/channel/doc/override-retry-policies.dox @@ -80,11 +80,6 @@ This will override the polling policies for `channel_v1::CloudChannelServiceClie @snippet cloud_channel_client_samples.cc set-polling-policy -Follow these links to find examples for other \c *Client classes: - -- [\c channel_v1::CloudChannelServiceClient](@ref channel_v1::CloudChannelServiceClient-retry-snippet) -- [\c channel_v1::CloudChannelReportsServiceClient](@ref channel_v1::CloudChannelReportsServiceClient-retry-snippet) - @section channel-override-retry-more-information More Information @@ -109,17 +104,5 @@ Assuming you have created a custom idempotency policy. Such as: @snippet google/cloud/channel/v1/samples/cloud_channel_client_samples.cc custom-idempotency-policy -*/ - -/*! @page channel_v1::CloudChannelReportsServiceClient-retry-snippet Override channel_v1::CloudChannelReportsServiceClient Retry Policies - -This shows how to override the retry policies for channel_v1::CloudChannelReportsServiceClient: - -@snippet google/cloud/channel/v1/samples/cloud_channel_reports_client_samples.cc set-retry-policy - -Assuming you have created a custom idempotency policy. Such as: - -@snippet google/cloud/channel/v1/samples/cloud_channel_reports_client_samples.cc custom-idempotency-policy - */ // diff --git a/google/cloud/channel/doc/override-universe-domain.dox b/google/cloud/channel/doc/override-universe-domain.dox index 824898a382df8..0389701576c56 100644 --- a/google/cloud/channel/doc/override-universe-domain.dox +++ b/google/cloud/channel/doc/override-universe-domain.dox @@ -10,11 +10,6 @@ For example, this will override the default universe domain for `channel_v1::Clo @snippet cloud_channel_client_samples.cc set-client-universe-domain -Follow these links to find examples for other \c *Client classes: - -- [\c channel_v1::CloudChannelServiceClient](@ref channel_v1::CloudChannelServiceClient-universe-domain-snippet) -- [\c channel_v1::CloudChannelReportsServiceClient](@ref channel_v1::CloudChannelReportsServiceClient-universe-domain-snippet) - */ @@ -25,11 +20,5 @@ Follow these links to find examples for other \c *Client classes: @snippet google/cloud/channel/v1/samples/cloud_channel_client_samples.cc set-client-universe-domain -*/ - -/*! @page channel_v1::CloudChannelReportsServiceClient-universe-domain-snippet Override channel_v1::CloudChannelReportsServiceClient Universe Domain - -@snippet google/cloud/channel/v1/samples/cloud_channel_reports_client_samples.cc set-client-universe-domain - */ // diff --git a/google/cloud/channel/mocks/mock_cloud_channel_connection.h b/google/cloud/channel/mocks/mock_cloud_channel_connection.h deleted file mode 100644 index 4540650bf0b4c..0000000000000 --- a/google/cloud/channel/mocks/mock_cloud_channel_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_MOCKS_MOCK_CLOUD_CHANNEL_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_MOCKS_MOCK_CLOUD_CHANNEL_CONNECTION_H - -#include "google/cloud/channel/cloud_channel_connection.h" -#include "google/cloud/channel/v1/mocks/mock_cloud_channel_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in channel_v1_mocks instead of the aliases -/// defined in this namespace. -namespace channel_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use channel_v1_mocks::MockCloudChannelServiceConnection -/// directly. -using ::google::cloud::channel_v1_mocks::MockCloudChannelServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_MOCKS_MOCK_CLOUD_CHANNEL_CONNECTION_H diff --git a/google/cloud/channel/quickstart/.bazelrc b/google/cloud/channel/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/channel/quickstart/.bazelrc +++ b/google/cloud/channel/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/channel/quickstart/CMakeLists.txt index e2a211fe548c2..493f9ed5cc126 100644 --- a/google/cloud/channel/quickstart/CMakeLists.txt +++ b/google/cloud/channel/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Channel API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-channel-quickstart CXX) find_package(google_cloud_cpp_channel REQUIRED) diff --git a/google/cloud/channel/quickstart/WORKSPACE.bazel b/google/cloud/channel/quickstart/WORKSPACE.bazel index 48593c49c2dad..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 = "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/channel/v1/cloud_channel_client.h b/google/cloud/channel/v1/cloud_channel_client.h index c80d3cbe4720c..4c47a2118b348 100644 --- a/google/cloud/channel/v1/cloud_channel_client.h +++ b/google/cloud/channel/v1/cloud_channel_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -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/channel/v1/cloud_channel_connection.h b/google/cloud/channel/v1/cloud_channel_connection.h index 0ec28e6728247..c5cbedb009859 100644 --- a/google/cloud/channel/v1/cloud_channel_connection.h +++ b/google/cloud/channel/v1/cloud_channel_connection.h @@ -21,6 +21,8 @@ #include "google/cloud/channel/v1/cloud_channel_connection_idempotency_policy.h" #include "google/cloud/channel/v1/internal/cloud_channel_retry_traits.h" +#include "google/cloud/channel/v1/operations.pb.h" +#include "google/cloud/channel/v1/service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,9 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/channel/v1/cloud_channel_connection_idempotency_policy.h b/google/cloud/channel/v1/cloud_channel_connection_idempotency_policy.h index 62d4db160aa35..0e124e9158ccb 100644 --- a/google/cloud/channel/v1/cloud_channel_connection_idempotency_policy.h +++ b/google/cloud/channel/v1/cloud_channel_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_CLOUD_CHANNEL_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_CLOUD_CHANNEL_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/channel/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/channel/v1/cloud_channel_reports_client.cc b/google/cloud/channel/v1/cloud_channel_reports_client.cc deleted file mode 100644 index 48de414b35fb1..0000000000000 --- a/google/cloud/channel/v1/cloud_channel_reports_client.cc +++ /dev/null @@ -1,157 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#include "google/cloud/channel/v1/cloud_channel_reports_client.h" -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1 { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -CloudChannelReportsServiceClient::CloudChannelReportsServiceClient( - std::shared_ptr connection, - Options opts) - : connection_(std::move(connection)), - options_( - internal::MergeOptions(std::move(opts), connection_->options())) {} -CloudChannelReportsServiceClient::~CloudChannelReportsServiceClient() = default; - -future> -CloudChannelReportsServiceClient::RunReportJob( - google::cloud::channel::v1::RunReportJobRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->RunReportJob(request); -} - -StatusOr -CloudChannelReportsServiceClient::RunReportJob( - NoAwaitTag, google::cloud::channel::v1::RunReportJobRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->RunReportJob(NoAwaitTag{}, request); -} - -future> -CloudChannelReportsServiceClient::RunReportJob( - google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->RunReportJob(operation); -} - -StreamRange -CloudChannelReportsServiceClient::FetchReportResults( - std::string const& report_job, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::channel::v1::FetchReportResultsRequest request; - request.set_report_job(report_job); - return connection_->FetchReportResults(request); -} - -StreamRange -CloudChannelReportsServiceClient::FetchReportResults( - google::cloud::channel::v1::FetchReportResultsRequest request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->FetchReportResults(std::move(request)); -} - -StreamRange -CloudChannelReportsServiceClient::ListReports(std::string const& parent, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::channel::v1::ListReportsRequest request; - request.set_parent(parent); - return connection_->ListReports(request); -} - -StreamRange -CloudChannelReportsServiceClient::ListReports( - google::cloud::channel::v1::ListReportsRequest request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->ListReports(std::move(request)); -} - -StreamRange -CloudChannelReportsServiceClient::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 -CloudChannelReportsServiceClient::ListOperations( - google::longrunning::ListOperationsRequest request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->ListOperations(std::move(request)); -} - -StatusOr -CloudChannelReportsServiceClient::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 -CloudChannelReportsServiceClient::GetOperation( - google::longrunning::GetOperationRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->GetOperation(request); -} - -Status CloudChannelReportsServiceClient::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 CloudChannelReportsServiceClient::DeleteOperation( - google::longrunning::DeleteOperationRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->DeleteOperation(request); -} - -Status CloudChannelReportsServiceClient::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 CloudChannelReportsServiceClient::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 channel_v1 -} // namespace cloud -} // namespace google diff --git a/google/cloud/channel/v1/cloud_channel_reports_client.h b/google/cloud/channel/v1/cloud_channel_reports_client.h deleted file mode 100644 index d349accf1a6fc..0000000000000 --- a/google/cloud/channel/v1/cloud_channel_reports_client.h +++ /dev/null @@ -1,673 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_CLOUD_CHANNEL_REPORTS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_CLOUD_CHANNEL_REPORTS_CLIENT_H - -#include "google/cloud/channel/v1/cloud_channel_reports_connection.h" -#include "google/cloud/future.h" -#include "google/cloud/no_await_tag.h" -#include "google/cloud/options.h" -#include "google/cloud/polling_policy.h" -#include "google/cloud/status_or.h" -#include "google/cloud/version.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1 { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// -/// CloudChannelReportsService lets Google Cloud resellers and -/// distributors retrieve and combine a variety of data in Cloud Channel for -/// multiple products (Google Cloud, Google Voice, and Google Workspace.) -/// -/// Deprecated: This service is being deprecated. Please use [Export Channel -/// Services data to -/// BigQuery](https://cloud.google.com/channel/docs/rebilling/export-data-to-bigquery) -/// instead. -/// -/// @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 GOOGLE_CLOUD_CPP_DEPRECATED( - "CloudChannelReportsService has been deprecated and will be turned down in " - "the future.") CloudChannelReportsServiceClient { - public: - explicit CloudChannelReportsServiceClient( - std::shared_ptr connection, - Options opts = {}); - ~CloudChannelReportsServiceClient(); - - ///@{ - /// @name Copy and move support - CloudChannelReportsServiceClient(CloudChannelReportsServiceClient const&) = - default; - CloudChannelReportsServiceClient& operator=( - CloudChannelReportsServiceClient const&) = default; - CloudChannelReportsServiceClient(CloudChannelReportsServiceClient&&) = - default; - CloudChannelReportsServiceClient& operator=( - CloudChannelReportsServiceClient&&) = default; - ///@} - - ///@{ - /// @name Equality - friend bool operator==(CloudChannelReportsServiceClient const& a, - CloudChannelReportsServiceClient const& b) { - return a.connection_ == b.connection_; - } - friend bool operator!=(CloudChannelReportsServiceClient const& a, - CloudChannelReportsServiceClient const& b) { - return !(a == b); - } - ///@} - - // clang-format off - /// - /// @deprecated This RPC is deprecated. - /// - /// Begins generation of data for a given report. The report - /// identifier is a UID (for example, `613bf59q`). - /// - /// Possible error codes: - /// - /// * PERMISSION_DENIED: The user doesn't have access to this report. - /// * INVALID_ARGUMENT: Required request parameters are missing - /// or invalid. - /// * NOT_FOUND: The report identifier was not found. - /// * INTERNAL: Any non-user error related to a technical issue - /// in the backend. Contact Cloud Channel support. - /// * UNKNOWN: Any non-user error related to a technical issue - /// in the backend. Contact Cloud Channel support. - /// - /// Return value: - /// The ID of a long-running operation. - /// - /// To get the results of the operation, call the GetOperation method of - /// CloudChannelOperationsService. The Operation metadata contains an - /// instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. - /// - /// To get the results of report generation, call - /// [CloudChannelReportsService.FetchReportResults][google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults] - /// with the - /// [RunReportJobResponse.report_job][google.cloud.channel.v1.RunReportJobResponse.report_job]. - /// - /// Deprecated: Please use [Export Channel Services data to - /// BigQuery](https://cloud.google.com/channel/docs/rebilling/export-data-to-bigquery) - /// instead. - /// - /// @param request Unary RPCs, such as the one wrapped by this - /// function, receive a single `request` proto message which includes all - /// the inputs for the RPC. In this case, the proto message is a - /// [google.cloud.channel.v1.RunReportJobRequest]. - /// Proto messages are converted to C++ 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.channel.v1.RunReportJobResponse] proto message. - /// The C++ class representing this message is created by Protobuf, using - /// the [Protobuf mapping rules]. - /// - /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ - /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator - /// [Long Running Operation]: https://google.aip.dev/151 - /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string - /// [`future`]: @ref google::cloud::future - /// [`StatusOr`]: @ref google::cloud::StatusOr - /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults]: @googleapis_reference_link{google/cloud/channel/v1/reports_service.proto#L97} - /// [google.cloud.channel.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/channel/v1/operations.proto#L26} - /// [google.cloud.channel.v1.RunReportJobRequest]: @googleapis_reference_link{google/cloud/channel/v1/reports_service.proto#L124} - /// [google.cloud.channel.v1.RunReportJobResponse]: @googleapis_reference_link{google/cloud/channel/v1/reports_service.proto#L163} - /// [google.cloud.channel.v1.RunReportJobResponse.report_job]: @googleapis_reference_link{google/cloud/channel/v1/reports_service.proto#L169} - /// - // clang-format on - GOOGLE_CLOUD_CPP_DEPRECATED("This RPC is deprecated.") - future> - RunReportJob(google::cloud::channel::v1::RunReportJobRequest const& request, - Options opts = {}); - - // clang-format off - /// - /// @deprecated This RPC is deprecated. - /// - /// @copybrief RunReportJob - /// - /// Specifying the [`NoAwaitTag`] immediately returns the - /// [`google::longrunning::Operation`] that corresponds to the Long Running - /// Operation that has been started. No polling for operation status occurs. - /// - /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag - /// - // clang-format on - GOOGLE_CLOUD_CPP_DEPRECATED("This RPC is deprecated.") - StatusOr RunReportJob( - NoAwaitTag, - google::cloud::channel::v1::RunReportJobRequest const& request, - Options opts = {}); - - // clang-format off - /// - /// @deprecated This RPC is deprecated. - /// - /// @copybrief RunReportJob - /// - /// 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 - GOOGLE_CLOUD_CPP_DEPRECATED("This RPC is deprecated.") - future> - RunReportJob(google::longrunning::Operation const& operation, - Options opts = {}); - - // clang-format off - /// - /// @deprecated This RPC is deprecated. - /// - /// Retrieves data generated by - /// [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob]. - /// - /// Deprecated: Please use [Export Channel Services data to - /// BigQuery](https://cloud.google.com/channel/docs/rebilling/export-data-to-bigquery) - /// instead. - /// - /// @param report_job Required. The report job created by - /// [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob]. - /// Report_job uses the format: - /// accounts/{account_id}/reportJobs/{report_job_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.channel.v1.Row], 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.channel.v1.CloudChannelReportsService.RunReportJob]: @googleapis_reference_link{google/cloud/channel/v1/reports_service.proto#L79} - /// [google.cloud.channel.v1.FetchReportResultsRequest]: @googleapis_reference_link{google/cloud/channel/v1/reports_service.proto#L179} - /// [google.cloud.channel.v1.Row]: @googleapis_reference_link{google/cloud/channel/v1/reports_service.proto#L399} - /// - // clang-format on - GOOGLE_CLOUD_CPP_DEPRECATED("This RPC is deprecated.") - StreamRange FetchReportResults( - std::string const& report_job, Options opts = {}); - - // clang-format off - /// - /// @deprecated This RPC is deprecated. - /// - /// Retrieves data generated by - /// [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob]. - /// - /// Deprecated: Please use [Export Channel Services data to - /// BigQuery](https://cloud.google.com/channel/docs/rebilling/export-data-to-bigquery) - /// instead. - /// - /// @param request Unary RPCs, such as the one wrapped by this - /// function, receive a single `request` proto message which includes all - /// the inputs for the RPC. In this case, the proto message is a - /// [google.cloud.channel.v1.FetchReportResultsRequest]. - /// Proto messages are converted to C++ 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.channel.v1.Row], 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.channel.v1.CloudChannelReportsService.RunReportJob]: @googleapis_reference_link{google/cloud/channel/v1/reports_service.proto#L79} - /// [google.cloud.channel.v1.FetchReportResultsRequest]: @googleapis_reference_link{google/cloud/channel/v1/reports_service.proto#L179} - /// [google.cloud.channel.v1.Row]: @googleapis_reference_link{google/cloud/channel/v1/reports_service.proto#L399} - /// - // clang-format on - GOOGLE_CLOUD_CPP_DEPRECATED("This RPC is deprecated.") - StreamRange FetchReportResults( - google::cloud::channel::v1::FetchReportResultsRequest request, - Options opts = {}); - - // clang-format off - /// - /// @deprecated This RPC is deprecated. - /// - /// Lists the reports that RunReportJob can run. These reports include an ID, - /// a description, and the list of columns that will be in the result. - /// - /// Deprecated: Please use [Export Channel Services data to - /// BigQuery](https://cloud.google.com/channel/docs/rebilling/export-data-to-bigquery) - /// instead. - /// - /// @param parent Required. The resource name of the partner account to list available - /// reports for. Parent uses the format: accounts/{account_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.channel.v1.Report], 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.channel.v1.ListReportsRequest]: @googleapis_reference_link{google/cloud/channel/v1/reports_service.proto#L236} - /// [google.cloud.channel.v1.Report]: @googleapis_reference_link{google/cloud/channel/v1/reports_service.proto#L474} - /// - // clang-format on - GOOGLE_CLOUD_CPP_DEPRECATED("This RPC is deprecated.") - StreamRange ListReports( - std::string const& parent, Options opts = {}); - - // clang-format off - /// - /// @deprecated This RPC is deprecated. - /// - /// Lists the reports that RunReportJob can run. These reports include an ID, - /// a description, and the list of columns that will be in the result. - /// - /// Deprecated: Please use [Export Channel Services data to - /// BigQuery](https://cloud.google.com/channel/docs/rebilling/export-data-to-bigquery) - /// instead. - /// - /// @param request Unary RPCs, such as the one wrapped by this - /// function, receive a single `request` proto message which includes all - /// the inputs for the RPC. In this case, the proto message is a - /// [google.cloud.channel.v1.ListReportsRequest]. - /// Proto messages are converted to C++ 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.channel.v1.Report], 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.channel.v1.ListReportsRequest]: @googleapis_reference_link{google/cloud/channel/v1/reports_service.proto#L236} - /// [google.cloud.channel.v1.Report]: @googleapis_reference_link{google/cloud/channel/v1/reports_service.proto#L474} - /// - // clang-format on - GOOGLE_CLOUD_CPP_DEPRECATED("This RPC is deprecated.") - StreamRange ListReports( - google::cloud::channel::v1::ListReportsRequest 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#L38} - /// - // clang-format on - Status CancelOperation(std::string const& name, Options opts = {}); - - // clang-format off - /// - /// Starts asynchronous cancellation on a long-running operation. The server - /// makes a best effort to cancel the operation, but success is not - /// guaranteed. If the server doesn't support this method, it returns - /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use - /// [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - /// other methods to check whether the cancellation succeeded or whether the - /// operation completed despite cancellation. On successful cancellation, - /// the operation is not deleted; instead, it becomes an operation with - /// an [Operation.error][google.longrunning.Operation.error] value with a - /// [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to - /// `Code.CANCELLED`. - /// - /// @param request Unary RPCs, such as the one wrapped by this - /// function, receive a single `request` proto message which includes all - /// the inputs for the RPC. In this case, the proto message is a - /// [google.longrunning.CancelOperationRequest]. - /// Proto messages are converted to C++ classes by Protobuf, using the - /// [Protobuf mapping rules]. - /// @param opts Optional. Override the class-level options, such as retry and - /// backoff policies. - /// @return a [`Status`] object. If the request failed, the - /// status contains the details of the failure. - /// - /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ - /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator - /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string - /// [`future`]: @ref google::cloud::future - /// [`StatusOr`]: @ref google::cloud::StatusOr - /// [`Status`]: @ref google::cloud::Status - /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} - /// [google.longrunning.Operation.error]: @googleapis_reference_link{google/longrunning/operations.proto#L144} - /// [google.longrunning.Operations.GetOperation]: @googleapis_reference_link{google/longrunning/operations.proto#L70} - /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} - /// - // clang-format on - Status CancelOperation( - google::longrunning::CancelOperationRequest const& request, - Options opts = {}); - - private: - std::shared_ptr connection_; - Options options_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1 -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_CLOUD_CHANNEL_REPORTS_CLIENT_H diff --git a/google/cloud/channel/v1/cloud_channel_reports_connection.cc b/google/cloud/channel/v1/cloud_channel_reports_connection.cc deleted file mode 100644 index dc14ad37ba0ee..0000000000000 --- a/google/cloud/channel/v1/cloud_channel_reports_connection.cc +++ /dev/null @@ -1,126 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#include "google/cloud/channel/v1/cloud_channel_reports_connection.h" -#include "google/cloud/channel/v1/cloud_channel_reports_options.h" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_connection_impl.h" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_option_defaults.h" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_stub_factory.h" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_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 channel_v1 { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -CloudChannelReportsServiceConnection::~CloudChannelReportsServiceConnection() = - default; - -future> -CloudChannelReportsServiceConnection::RunReportJob( - google::cloud::channel::v1::RunReportJobRequest const&) { - return google::cloud::make_ready_future< - StatusOr>( - Status(StatusCode::kUnimplemented, "not implemented")); -} - -StatusOr -CloudChannelReportsServiceConnection::RunReportJob( - NoAwaitTag, google::cloud::channel::v1::RunReportJobRequest const&) { - return StatusOr( - Status(StatusCode::kUnimplemented, "not implemented")); -} - -future> -CloudChannelReportsServiceConnection::RunReportJob( - google::longrunning::Operation const&) { - return google::cloud::make_ready_future< - StatusOr>( - Status(StatusCode::kUnimplemented, "not implemented")); -} - -StreamRange -CloudChannelReportsServiceConnection::FetchReportResults( - google::cloud::channel::v1:: - FetchReportResultsRequest) { // NOLINT(performance-unnecessary-value-param) - return google::cloud::internal::MakeUnimplementedPaginationRange< - StreamRange>(); -} - -StreamRange -CloudChannelReportsServiceConnection::ListReports( - google::cloud::channel::v1:: - ListReportsRequest) { // NOLINT(performance-unnecessary-value-param) - return google::cloud::internal::MakeUnimplementedPaginationRange< - StreamRange>(); -} - -StreamRange -CloudChannelReportsServiceConnection::ListOperations( - google::longrunning:: - ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) - return google::cloud::internal::MakeUnimplementedPaginationRange< - StreamRange>(); -} - -StatusOr -CloudChannelReportsServiceConnection::GetOperation( - google::longrunning::GetOperationRequest const&) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - -Status CloudChannelReportsServiceConnection::DeleteOperation( - google::longrunning::DeleteOperationRequest const&) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - -Status CloudChannelReportsServiceConnection::CancelOperation( - google::longrunning::CancelOperationRequest const&) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - -std::shared_ptr -MakeCloudChannelReportsServiceConnection(Options options) { - internal::CheckExpectedOptions( - options, __func__); - options = channel_v1_internal::CloudChannelReportsServiceDefaultOptions( - std::move(options)); - auto background = internal::MakeBackgroundThreadsFactory(options)(); - auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); - auto stub = channel_v1_internal::CreateDefaultCloudChannelReportsServiceStub( - std::move(auth), options); - return channel_v1_internal::MakeCloudChannelReportsServiceTracingConnection( - std::make_shared< - channel_v1_internal::CloudChannelReportsServiceConnectionImpl>( - std::move(background), std::move(stub), std::move(options))); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1 -} // namespace cloud -} // namespace google diff --git a/google/cloud/channel/v1/cloud_channel_reports_connection.h b/google/cloud/channel/v1/cloud_channel_reports_connection.h deleted file mode 100644 index 9c887fd5acf50..0000000000000 --- a/google/cloud/channel/v1/cloud_channel_reports_connection.h +++ /dev/null @@ -1,267 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_CLOUD_CHANNEL_REPORTS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_CLOUD_CHANNEL_REPORTS_CONNECTION_H - -#include "google/cloud/channel/v1/cloud_channel_reports_connection_idempotency_policy.h" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_retry_traits.h" -#include "google/cloud/backoff_policy.h" -#include "google/cloud/future.h" -#include "google/cloud/internal/retry_policy_impl.h" -#include "google/cloud/no_await_tag.h" -#include "google/cloud/options.h" -#include "google/cloud/polling_policy.h" -#include "google/cloud/status_or.h" -#include "google/cloud/stream_range.h" -#include "google/cloud/version.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1 { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// The retry policy for `CloudChannelReportsServiceConnection`. -class CloudChannelReportsServiceRetryPolicy - : 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 `CloudChannelReportsServiceConnection` 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 CloudChannelReportsServiceLimitedErrorCountRetryPolicy - : public CloudChannelReportsServiceRetryPolicy { - 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 CloudChannelReportsServiceLimitedErrorCountRetryPolicy( - int maximum_failures) - : impl_(maximum_failures) {} - - CloudChannelReportsServiceLimitedErrorCountRetryPolicy( - CloudChannelReportsServiceLimitedErrorCountRetryPolicy&& rhs) noexcept - : CloudChannelReportsServiceLimitedErrorCountRetryPolicy( - rhs.maximum_failures()) {} - CloudChannelReportsServiceLimitedErrorCountRetryPolicy( - CloudChannelReportsServiceLimitedErrorCountRetryPolicy const& - rhs) noexcept - : CloudChannelReportsServiceLimitedErrorCountRetryPolicy( - 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< - CloudChannelReportsServiceLimitedErrorCountRetryPolicy>( - maximum_failures()); - } - - // This is provided only for backwards compatibility. - using BaseType = CloudChannelReportsServiceRetryPolicy; - - private: - google::cloud::internal::LimitedErrorCountRetryPolicy< - channel_v1_internal::CloudChannelReportsServiceRetryTraits> - impl_; -}; - -/** - * A retry policy for `CloudChannelReportsServiceConnection` 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 CloudChannelReportsServiceLimitedTimeRetryPolicy - : public CloudChannelReportsServiceRetryPolicy { - 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 CloudChannelReportsServiceLimitedTimeRetryPolicy( - std::chrono::duration maximum_duration) - : impl_(maximum_duration) {} - - CloudChannelReportsServiceLimitedTimeRetryPolicy( - CloudChannelReportsServiceLimitedTimeRetryPolicy&& rhs) noexcept - : CloudChannelReportsServiceLimitedTimeRetryPolicy( - rhs.maximum_duration()) {} - CloudChannelReportsServiceLimitedTimeRetryPolicy( - CloudChannelReportsServiceLimitedTimeRetryPolicy const& rhs) noexcept - : CloudChannelReportsServiceLimitedTimeRetryPolicy( - 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 = CloudChannelReportsServiceRetryPolicy; - - private: - google::cloud::internal::LimitedTimeRetryPolicy< - channel_v1_internal::CloudChannelReportsServiceRetryTraits> - impl_; -}; - -/** - * The `CloudChannelReportsServiceConnection` object for - * `CloudChannelReportsServiceClient`. - * - * This interface defines virtual methods for each of the user-facing overload - * sets in `CloudChannelReportsServiceClient`. This allows users to inject - * custom behavior (e.g., with a Google Mock object) when writing tests that use - * objects of type `CloudChannelReportsServiceClient`. - * - * To create a concrete instance, see - * `MakeCloudChannelReportsServiceConnection()`. - * - * For mocking, see - * `channel_v1_mocks::MockCloudChannelReportsServiceConnection`. - */ -class CloudChannelReportsServiceConnection { - public: - virtual ~CloudChannelReportsServiceConnection() = 0; - - virtual Options options() { return Options{}; } - - virtual future> - RunReportJob(google::cloud::channel::v1::RunReportJobRequest const& request); - - virtual StatusOr RunReportJob( - NoAwaitTag, - google::cloud::channel::v1::RunReportJobRequest const& request); - - virtual future> - RunReportJob(google::longrunning::Operation const& operation); - - virtual StreamRange FetchReportResults( - google::cloud::channel::v1::FetchReportResultsRequest request); - - virtual StreamRange ListReports( - google::cloud::channel::v1::ListReportsRequest 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 - * `CloudChannelReportsServiceConnection`. - * - * The returned connection object should not be used directly; instead it - * should be passed as an argument to the constructor of - * CloudChannelReportsServiceClient. - * - * The optional @p options argument may be used to configure aspects of the - * returned `CloudChannelReportsServiceConnection`. Expected options are any of - * the types in the following option lists: - * - * - `google::cloud::CommonOptionList` - * - `google::cloud::GrpcOptionList` - * - `google::cloud::UnifiedCredentialsOptionList` - * - `google::cloud::channel_v1::CloudChannelReportsServicePolicyOptionList` - * - * @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 - * `CloudChannelReportsServiceConnection` created by this function. - */ -std::shared_ptr -MakeCloudChannelReportsServiceConnection(Options options = {}); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1 -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_CLOUD_CHANNEL_REPORTS_CONNECTION_H diff --git a/google/cloud/channel/v1/cloud_channel_reports_connection_idempotency_policy.cc b/google/cloud/channel/v1/cloud_channel_reports_connection_idempotency_policy.cc deleted file mode 100644 index a7d2ad092e2c8..0000000000000 --- a/google/cloud/channel/v1/cloud_channel_reports_connection_idempotency_policy.cc +++ /dev/null @@ -1,86 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#include "google/cloud/channel/v1/cloud_channel_reports_connection_idempotency_policy.h" -#include - -namespace google { -namespace cloud { -namespace channel_v1 { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -using ::google::cloud::Idempotency; - -CloudChannelReportsServiceConnectionIdempotencyPolicy:: - ~CloudChannelReportsServiceConnectionIdempotencyPolicy() = default; - -std::unique_ptr -CloudChannelReportsServiceConnectionIdempotencyPolicy::clone() const { - return std::make_unique< - CloudChannelReportsServiceConnectionIdempotencyPolicy>(*this); -} - -Idempotency CloudChannelReportsServiceConnectionIdempotencyPolicy::RunReportJob( - google::cloud::channel::v1::RunReportJobRequest const&) { - return Idempotency::kNonIdempotent; -} - -Idempotency -CloudChannelReportsServiceConnectionIdempotencyPolicy::FetchReportResults( - google::cloud::channel::v1::FetchReportResultsRequest) { // NOLINT - return Idempotency::kNonIdempotent; -} - -Idempotency CloudChannelReportsServiceConnectionIdempotencyPolicy::ListReports( - google::cloud::channel::v1::ListReportsRequest) { // NOLINT - return Idempotency::kIdempotent; -} - -Idempotency -CloudChannelReportsServiceConnectionIdempotencyPolicy::ListOperations( - google::longrunning::ListOperationsRequest) { // NOLINT - return Idempotency::kIdempotent; -} - -Idempotency CloudChannelReportsServiceConnectionIdempotencyPolicy::GetOperation( - google::longrunning::GetOperationRequest const&) { - return Idempotency::kIdempotent; -} - -Idempotency -CloudChannelReportsServiceConnectionIdempotencyPolicy::DeleteOperation( - google::longrunning::DeleteOperationRequest const&) { - return Idempotency::kNonIdempotent; -} - -Idempotency -CloudChannelReportsServiceConnectionIdempotencyPolicy::CancelOperation( - google::longrunning::CancelOperationRequest const&) { - return Idempotency::kNonIdempotent; -} - -std::unique_ptr -MakeDefaultCloudChannelReportsServiceConnectionIdempotencyPolicy() { - return std::make_unique< - CloudChannelReportsServiceConnectionIdempotencyPolicy>(); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1 -} // namespace cloud -} // namespace google diff --git a/google/cloud/channel/v1/cloud_channel_reports_connection_idempotency_policy.h b/google/cloud/channel/v1/cloud_channel_reports_connection_idempotency_policy.h deleted file mode 100644 index a6a7424863161..0000000000000 --- a/google/cloud/channel/v1/cloud_channel_reports_connection_idempotency_policy.h +++ /dev/null @@ -1,71 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_CLOUD_CHANNEL_REPORTS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_CLOUD_CHANNEL_REPORTS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/idempotency.h" -#include "google/cloud/version.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1 { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -class CloudChannelReportsServiceConnectionIdempotencyPolicy { - public: - virtual ~CloudChannelReportsServiceConnectionIdempotencyPolicy(); - - /// Create a new copy of this object. - virtual std::unique_ptr - clone() const; - - virtual google::cloud::Idempotency RunReportJob( - google::cloud::channel::v1::RunReportJobRequest const& request); - - virtual google::cloud::Idempotency FetchReportResults( - google::cloud::channel::v1::FetchReportResultsRequest request); - - virtual google::cloud::Idempotency ListReports( - google::cloud::channel::v1::ListReportsRequest 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 -MakeDefaultCloudChannelReportsServiceConnectionIdempotencyPolicy(); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1 -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_CLOUD_CHANNEL_REPORTS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/channel/v1/cloud_channel_reports_options.h b/google/cloud/channel/v1/cloud_channel_reports_options.h deleted file mode 100644 index 7bd68ee312f06..0000000000000 --- a/google/cloud/channel/v1/cloud_channel_reports_options.h +++ /dev/null @@ -1,88 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_CLOUD_CHANNEL_REPORTS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_CLOUD_CHANNEL_REPORTS_OPTIONS_H - -#include "google/cloud/channel/v1/cloud_channel_reports_connection.h" -#include "google/cloud/channel/v1/cloud_channel_reports_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 channel_v1 { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * Use with `google::cloud::Options` to configure the retry policy. - * - * @ingroup google-cloud-channel-options - */ -struct CloudChannelReportsServiceRetryPolicyOption { - using Type = std::shared_ptr; -}; - -/** - * Use with `google::cloud::Options` to configure the backoff policy. - * - * @ingroup google-cloud-channel-options - */ -struct CloudChannelReportsServiceBackoffPolicyOption { - using Type = std::shared_ptr; -}; - -/** - * Use with `google::cloud::Options` to configure which operations are retried. - * - * @ingroup google-cloud-channel-options - */ -struct CloudChannelReportsServiceConnectionIdempotencyPolicyOption { - using Type = - std::shared_ptr; -}; - -/** - * Use with `google::cloud::Options` to configure the long-running operations - * polling policy. - * - * @ingroup google-cloud-channel-options - */ -struct CloudChannelReportsServicePollingPolicyOption { - using Type = std::shared_ptr; -}; - -/** - * The options applicable to CloudChannelReportsService. - * - * @ingroup google-cloud-channel-options - */ -using CloudChannelReportsServicePolicyOptionList = - OptionList; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1 -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_CLOUD_CHANNEL_REPORTS_OPTIONS_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_auth_decorator.cc b/google/cloud/channel/v1/internal/cloud_channel_auth_decorator.cc index 4a0cc61e80317..c704aee422511 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_auth_decorator.cc +++ b/google/cloud/channel/v1/internal/cloud_channel_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/channel/v1/service.proto #include "google/cloud/channel/v1/internal/cloud_channel_auth_decorator.h" -#include +#include "google/cloud/channel/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace channel_v1_internal { @@ -778,3 +781,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace channel_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/channel/v1/internal/cloud_channel_auth_decorator.h b/google/cloud/channel/v1/internal/cloud_channel_auth_decorator.h index aee4d6b999693..7aaa5cc4879d4 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_auth_decorator.h +++ b/google/cloud/channel/v1/internal/cloud_channel_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/channel/v1/internal/cloud_channel_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 channel_v1_internal { @@ -413,4 +416,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_AUTH_DECORATOR_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_connection_impl.h b/google/cloud/channel/v1/internal/cloud_channel_connection_impl.h index ead015cc32d79..85f902b90b18a 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_connection_impl.h +++ b/google/cloud/channel/v1/internal/cloud_channel_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/channel/v1/internal/cloud_channel_logging_decorator.cc b/google/cloud/channel/v1/internal/cloud_channel_logging_decorator.cc index 9588713bda69c..47d7c2184eca0 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_logging_decorator.cc +++ b/google/cloud/channel/v1/internal/cloud_channel_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/channel/v1/service.proto #include "google/cloud/channel/v1/internal/cloud_channel_logging_decorator.h" +#include "google/cloud/channel/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace channel_v1_internal { @@ -977,3 +980,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace channel_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/channel/v1/internal/cloud_channel_logging_decorator.h b/google/cloud/channel/v1/internal/cloud_channel_logging_decorator.h index 7aa2607885ef5..be0abf0a86dad 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_logging_decorator.h +++ b/google/cloud/channel/v1/internal/cloud_channel_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/channel/v1/internal/cloud_channel_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 channel_v1_internal { @@ -413,4 +416,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_LOGGING_DECORATOR_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_metadata_decorator.cc b/google/cloud/channel/v1/internal/cloud_channel_metadata_decorator.cc index 2e7206be445c1..b271195dc3e5f 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_metadata_decorator.cc +++ b/google/cloud/channel/v1/internal/cloud_channel_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/channel/v1/service.proto #include "google/cloud/channel/v1/internal/cloud_channel_metadata_decorator.h" +#include "google/cloud/channel/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 channel_v1_internal { @@ -716,3 +720,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace channel_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/channel/v1/internal/cloud_channel_metadata_decorator.h b/google/cloud/channel/v1/internal/cloud_channel_metadata_decorator.h index d78046e855f1e..36cae2276620c 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_metadata_decorator.h +++ b/google/cloud/channel/v1/internal/cloud_channel_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/channel/v1/internal/cloud_channel_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 channel_v1_internal { @@ -419,4 +422,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_METADATA_DECORATOR_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_option_defaults.cc b/google/cloud/channel/v1/internal/cloud_channel_option_defaults.cc index 3eddedba1ac0b..fbe71c25fbcf6 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_option_defaults.cc +++ b/google/cloud/channel/v1/internal/cloud_channel_option_defaults.cc @@ -42,7 +42,7 @@ Options CloudChannelServiceDefaultOptions(Options options) { if (!options.has()) { options.set( channel_v1::CloudChannelServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_auth_decorator.cc b/google/cloud/channel/v1/internal/cloud_channel_reports_auth_decorator.cc deleted file mode 100644 index de6c83addd0f7..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_auth_decorator.cc +++ /dev/null @@ -1,154 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#include "google/cloud/channel/v1/internal/cloud_channel_reports_auth_decorator.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -CloudChannelReportsServiceAuth::CloudChannelReportsServiceAuth( - std::shared_ptr auth, - std::shared_ptr child) - : auth_(std::move(auth)), child_(std::move(child)) {} - -future> -CloudChannelReportsServiceAuth::AsyncRunReportJob( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::channel::v1::RunReportJobRequest 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->AsyncRunReportJob(cq, *std::move(context), - std::move(options), request); - }); -} - -StatusOr -CloudChannelReportsServiceAuth::RunReportJob( - grpc::ClientContext& context, Options options, - google::cloud::channel::v1::RunReportJobRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->RunReportJob(context, options, request); -} - -StatusOr -CloudChannelReportsServiceAuth::FetchReportResults( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::FetchReportResultsRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->FetchReportResults(context, options, request); -} - -StatusOr -CloudChannelReportsServiceAuth::ListReports( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::ListReportsRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->ListReports(context, options, request); -} - -StatusOr -CloudChannelReportsServiceAuth::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 -CloudChannelReportsServiceAuth::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 CloudChannelReportsServiceAuth::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 CloudChannelReportsServiceAuth::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> -CloudChannelReportsServiceAuth::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 CloudChannelReportsServiceAuth::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 channel_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_auth_decorator.h b/google/cloud/channel/v1/internal/cloud_channel_reports_auth_decorator.h deleted file mode 100644 index e85a1f1fa6850..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_auth_decorator.h +++ /dev/null @@ -1,100 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_AUTH_DECORATOR_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_AUTH_DECORATOR_H - -#include "google/cloud/channel/v1/internal/cloud_channel_reports_stub.h" -#include "google/cloud/internal/unified_grpc_credentials.h" -#include "google/cloud/version.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -class CloudChannelReportsServiceAuth : public CloudChannelReportsServiceStub { - public: - ~CloudChannelReportsServiceAuth() override = default; - CloudChannelReportsServiceAuth( - std::shared_ptr auth, - std::shared_ptr child); - - future> AsyncRunReportJob( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::channel::v1::RunReportJobRequest const& request) override; - - StatusOr RunReportJob( - grpc::ClientContext& context, Options options, - google::cloud::channel::v1::RunReportJobRequest const& request) override; - - StatusOr - FetchReportResults( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::FetchReportResultsRequest const& request) - override; - - StatusOr ListReports( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::ListReportsRequest 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 channel_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_AUTH_DECORATOR_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_connection_impl.cc b/google/cloud/channel/v1/internal/cloud_channel_reports_connection_impl.cc deleted file mode 100644 index cc83bc433b1bf..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_connection_impl.cc +++ /dev/null @@ -1,314 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#include "google/cloud/channel/v1/internal/cloud_channel_reports_connection_impl.h" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_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 channel_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< - channel_v1::CloudChannelReportsServiceConnectionIdempotencyPolicy> -idempotency_policy(Options const& options) { - return options - .get() - ->clone(); -} - -std::unique_ptr polling_policy(Options const& options) { - return options - .get() - ->clone(); -} - -} // namespace - -CloudChannelReportsServiceConnectionImpl:: - CloudChannelReportsServiceConnectionImpl( - std::unique_ptr background, - std::shared_ptr - stub, - Options options) - : background_(std::move(background)), - stub_(std::move(stub)), - options_(internal::MergeOptions( - std::move(options), - CloudChannelReportsServiceConnection::options())) {} - -future> -CloudChannelReportsServiceConnectionImpl::RunReportJob( - google::cloud::channel::v1::RunReportJobRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - auto request_copy = request; - auto const idempotent = - idempotency_policy(*current)->RunReportJob(request_copy); - return google::cloud::internal::AsyncLongRunningOperation< - google::cloud::channel::v1::RunReportJobResponse>( - background_->cq(), current, std::move(request_copy), - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::channel::v1::RunReportJobRequest const& request) { - return stub->AsyncRunReportJob(cq, 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::channel::v1::RunReportJobResponse>, - retry_policy(*current), backoff_policy(*current), idempotent, - polling_policy(*current), __func__); -} - -StatusOr -CloudChannelReportsServiceConnectionImpl::RunReportJob( - NoAwaitTag, - google::cloud::channel::v1::RunReportJobRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->RunReportJob(request), - [this](grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::RunReportJobRequest const& request) { - return stub_->RunReportJob(context, options, request); - }, - *current, request, __func__); -} - -future> -CloudChannelReportsServiceConnectionImpl::RunReportJob( - 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 RunReportJob", - GCP_ERROR_INFO().WithMetadata("operation", - operation.metadata().DebugString()))); - } - - return google::cloud::internal::AsyncAwaitLongRunningOperation< - google::cloud::channel::v1::RunReportJobResponse>( - 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::channel::v1::RunReportJobResponse>, - polling_policy(*current), __func__); -} - -StreamRange -CloudChannelReportsServiceConnectionImpl::FetchReportResults( - google::cloud::channel::v1::FetchReportResultsRequest request) { - request.clear_page_token(); - auto current = google::cloud::internal::SaveCurrentOptions(); - auto idempotency = idempotency_policy(*current)->FetchReportResults(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::channel::v1::FetchReportResultsRequest const& r) { - return google::cloud::internal::RetryLoop( - retry->clone(), backoff->clone(), idempotency, - [stub](grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::FetchReportResultsRequest const& - request) { - return stub->FetchReportResults(context, options, request); - }, - options, r, function_name); - }, - [](google::cloud::channel::v1::FetchReportResultsResponse r) { - std::vector result(r.rows().size()); - auto& messages = *r.mutable_rows(); - std::move(messages.begin(), messages.end(), result.begin()); - return result; - }); -} - -StreamRange -CloudChannelReportsServiceConnectionImpl::ListReports( - google::cloud::channel::v1::ListReportsRequest request) { - request.clear_page_token(); - auto current = google::cloud::internal::SaveCurrentOptions(); - auto idempotency = idempotency_policy(*current)->ListReports(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::channel::v1::ListReportsRequest const& r) { - return google::cloud::internal::RetryLoop( - retry->clone(), backoff->clone(), idempotency, - [stub]( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::ListReportsRequest const& request) { - return stub->ListReports(context, options, request); - }, - options, r, function_name); - }, - [](google::cloud::channel::v1::ListReportsResponse r) { - std::vector result( - r.reports().size()); - auto& messages = *r.mutable_reports(); - std::move(messages.begin(), messages.end(), result.begin()); - return result; - }); -} - -StreamRange -CloudChannelReportsServiceConnectionImpl::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 -CloudChannelReportsServiceConnectionImpl::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 CloudChannelReportsServiceConnectionImpl::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 CloudChannelReportsServiceConnectionImpl::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 channel_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_connection_impl.h b/google/cloud/channel/v1/internal/cloud_channel_reports_connection_impl.h deleted file mode 100644 index bcbb394c2a822..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_connection_impl.h +++ /dev/null @@ -1,95 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_CONNECTION_IMPL_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_CONNECTION_IMPL_H - -#include "google/cloud/channel/v1/cloud_channel_reports_connection.h" -#include "google/cloud/channel/v1/cloud_channel_reports_connection_idempotency_policy.h" -#include "google/cloud/channel/v1/cloud_channel_reports_options.h" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_retry_traits.h" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_stub.h" -#include "google/cloud/background_threads.h" -#include "google/cloud/backoff_policy.h" -#include "google/cloud/future.h" -#include "google/cloud/options.h" -#include "google/cloud/polling_policy.h" -#include "google/cloud/status_or.h" -#include "google/cloud/stream_range.h" -#include "google/cloud/version.h" -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -class CloudChannelReportsServiceConnectionImpl - : public channel_v1::CloudChannelReportsServiceConnection { - public: - ~CloudChannelReportsServiceConnectionImpl() override = default; - - CloudChannelReportsServiceConnectionImpl( - std::unique_ptr background, - std::shared_ptr stub, - Options options); - - Options options() override { return options_; } - - future> - RunReportJob( - google::cloud::channel::v1::RunReportJobRequest const& request) override; - - StatusOr RunReportJob( - NoAwaitTag, - google::cloud::channel::v1::RunReportJobRequest const& request) override; - - future> - RunReportJob(google::longrunning::Operation const& operation) override; - - StreamRange FetchReportResults( - google::cloud::channel::v1::FetchReportResultsRequest request) override; - - StreamRange ListReports( - google::cloud::channel::v1::ListReportsRequest 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 channel_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_CONNECTION_IMPL_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_logging_decorator.cc b/google/cloud/channel/v1/internal/cloud_channel_reports_logging_decorator.cc deleted file mode 100644 index ae543652e5b16..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_logging_decorator.cc +++ /dev/null @@ -1,177 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#include "google/cloud/channel/v1/internal/cloud_channel_reports_logging_decorator.h" -#include "google/cloud/internal/log_wrapper.h" -#include "google/cloud/status_or.h" -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -CloudChannelReportsServiceLogging::CloudChannelReportsServiceLogging( - std::shared_ptr child, - TracingOptions tracing_options, std::set const&) - : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} - -future> -CloudChannelReportsServiceLogging::AsyncRunReportJob( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::channel::v1::RunReportJobRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::channel::v1::RunReportJobRequest const& request) { - return child_->AsyncRunReportJob(cq, std::move(context), - std::move(options), request); - }, - cq, std::move(context), std::move(options), request, __func__, - tracing_options_); -} - -StatusOr -CloudChannelReportsServiceLogging::RunReportJob( - grpc::ClientContext& context, Options options, - google::cloud::channel::v1::RunReportJobRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::RunReportJobRequest const& request) { - return child_->RunReportJob(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -CloudChannelReportsServiceLogging::FetchReportResults( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::FetchReportResultsRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::FetchReportResultsRequest const& - request) { - return child_->FetchReportResults(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -CloudChannelReportsServiceLogging::ListReports( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::ListReportsRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::ListReportsRequest const& request) { - return child_->ListReports(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -CloudChannelReportsServiceLogging::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 -CloudChannelReportsServiceLogging::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 CloudChannelReportsServiceLogging::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 CloudChannelReportsServiceLogging::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> -CloudChannelReportsServiceLogging::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 CloudChannelReportsServiceLogging::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 channel_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_logging_decorator.h b/google/cloud/channel/v1/internal/cloud_channel_reports_logging_decorator.h deleted file mode 100644 index 3f684aee67146..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_logging_decorator.h +++ /dev/null @@ -1,101 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_LOGGING_DECORATOR_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_LOGGING_DECORATOR_H - -#include "google/cloud/channel/v1/internal/cloud_channel_reports_stub.h" -#include "google/cloud/tracing_options.h" -#include "google/cloud/version.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -class CloudChannelReportsServiceLogging - : public CloudChannelReportsServiceStub { - public: - ~CloudChannelReportsServiceLogging() override = default; - CloudChannelReportsServiceLogging( - std::shared_ptr child, - TracingOptions tracing_options, std::set const& components); - - future> AsyncRunReportJob( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::channel::v1::RunReportJobRequest const& request) override; - - StatusOr RunReportJob( - grpc::ClientContext& context, Options options, - google::cloud::channel::v1::RunReportJobRequest const& request) override; - - StatusOr - FetchReportResults( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::FetchReportResultsRequest const& request) - override; - - StatusOr ListReports( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::ListReportsRequest 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_; -}; // CloudChannelReportsServiceLogging - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_LOGGING_DECORATOR_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_metadata_decorator.cc b/google/cloud/channel/v1/internal/cloud_channel_reports_metadata_decorator.cc deleted file mode 100644 index bc044f97300f5..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_metadata_decorator.cc +++ /dev/null @@ -1,160 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#include "google/cloud/channel/v1/internal/cloud_channel_reports_metadata_decorator.h" -#include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/api_client_header.h" -#include "google/cloud/internal/url_encode.h" -#include "google/cloud/status_or.h" -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -CloudChannelReportsServiceMetadata::CloudChannelReportsServiceMetadata( - 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> -CloudChannelReportsServiceMetadata::AsyncRunReportJob( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::channel::v1::RunReportJobRequest const& request) { - SetMetadata(*context, *options, - absl::StrCat("name=", internal::UrlEncode(request.name()))); - return child_->AsyncRunReportJob(cq, std::move(context), std::move(options), - request); -} - -StatusOr -CloudChannelReportsServiceMetadata::RunReportJob( - grpc::ClientContext& context, Options options, - google::cloud::channel::v1::RunReportJobRequest const& request) { - SetMetadata(context, options, - absl::StrCat("name=", internal::UrlEncode(request.name()))); - return child_->RunReportJob(context, options, request); -} - -StatusOr -CloudChannelReportsServiceMetadata::FetchReportResults( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::FetchReportResultsRequest const& request) { - SetMetadata( - context, options, - absl::StrCat("report_job=", internal::UrlEncode(request.report_job()))); - return child_->FetchReportResults(context, options, request); -} - -StatusOr -CloudChannelReportsServiceMetadata::ListReports( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::ListReportsRequest const& request) { - SetMetadata(context, options, - absl::StrCat("parent=", internal::UrlEncode(request.parent()))); - return child_->ListReports(context, options, request); -} - -StatusOr -CloudChannelReportsServiceMetadata::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 -CloudChannelReportsServiceMetadata::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 CloudChannelReportsServiceMetadata::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 CloudChannelReportsServiceMetadata::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> -CloudChannelReportsServiceMetadata::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 CloudChannelReportsServiceMetadata::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 CloudChannelReportsServiceMetadata::SetMetadata( - grpc::ClientContext& context, Options const& options, - std::string const& request_params) { - context.AddMetadata("x-goog-request-params", request_params); - SetMetadata(context, options); -} - -void CloudChannelReportsServiceMetadata::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 channel_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_metadata_decorator.h b/google/cloud/channel/v1/internal/cloud_channel_reports_metadata_decorator.h deleted file mode 100644 index f5dcf7a0088e1..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_metadata_decorator.h +++ /dev/null @@ -1,107 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_METADATA_DECORATOR_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_METADATA_DECORATOR_H - -#include "google/cloud/channel/v1/internal/cloud_channel_reports_stub.h" -#include "google/cloud/options.h" -#include "google/cloud/version.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -class CloudChannelReportsServiceMetadata - : public CloudChannelReportsServiceStub { - public: - ~CloudChannelReportsServiceMetadata() override = default; - CloudChannelReportsServiceMetadata( - std::shared_ptr child, - std::multimap fixed_metadata, - std::string api_client_header = ""); - - future> AsyncRunReportJob( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::channel::v1::RunReportJobRequest const& request) override; - - StatusOr RunReportJob( - grpc::ClientContext& context, Options options, - google::cloud::channel::v1::RunReportJobRequest const& request) override; - - StatusOr - FetchReportResults( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::FetchReportResultsRequest const& request) - override; - - StatusOr ListReports( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::ListReportsRequest 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 channel_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_METADATA_DECORATOR_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_option_defaults.cc b/google/cloud/channel/v1/internal/cloud_channel_reports_option_defaults.cc deleted file mode 100644 index c868bafb49bcc..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_option_defaults.cc +++ /dev/null @@ -1,87 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#include "google/cloud/channel/v1/internal/cloud_channel_reports_option_defaults.h" -#include "google/cloud/channel/v1/cloud_channel_reports_connection.h" -#include "google/cloud/channel/v1/cloud_channel_reports_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 channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -namespace { -auto constexpr kBackoffScaling = 2.0; -} // namespace - -Options CloudChannelReportsServiceDefaultOptions(Options options) { - options = internal::PopulateCommonOptions( - std::move(options), - "GOOGLE_CLOUD_CPP_CLOUD_CHANNEL_REPORTS_SERVICE_ENDPOINT", "", - "GOOGLE_CLOUD_CPP_CLOUD_CHANNEL_REPORTS_SERVICE_AUTHORITY", - "cloudchannel.googleapis.com"); - options = internal::PopulateGrpcOptions(std::move(options)); - if (!options.has()) { - options.set( - channel_v1::CloudChannelReportsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) - .clone()); - } - if (!options - .has()) { - options.set( - ExponentialBackoffPolicy( - std::chrono::seconds(0), std::chrono::seconds(1), - std::chrono::minutes(5), kBackoffScaling, kBackoffScaling) - .clone()); - } - if (!options - .has()) { - options.set( - GenericPollingPolicy< - channel_v1::CloudChannelReportsServiceRetryPolicyOption::Type, - channel_v1::CloudChannelReportsServiceBackoffPolicyOption::Type>( - options - .get() - ->clone(), - ExponentialBackoffPolicy(std::chrono::seconds(1), - std::chrono::minutes(5), kBackoffScaling) - .clone()) - .clone()); - } - if (!options.has< - channel_v1:: - CloudChannelReportsServiceConnectionIdempotencyPolicyOption>()) { - options.set< - channel_v1:: - CloudChannelReportsServiceConnectionIdempotencyPolicyOption>( - channel_v1:: - MakeDefaultCloudChannelReportsServiceConnectionIdempotencyPolicy()); - } - - return options; -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_option_defaults.h b/google/cloud/channel/v1/internal/cloud_channel_reports_option_defaults.h deleted file mode 100644 index 10223a941de77..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_option_defaults.h +++ /dev/null @@ -1,37 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_OPTION_DEFAULTS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_OPTION_DEFAULTS_H - -#include "google/cloud/options.h" -#include "google/cloud/version.h" - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -Options CloudChannelReportsServiceDefaultOptions(Options options); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_OPTION_DEFAULTS_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_retry_traits.h b/google/cloud/channel/v1/internal/cloud_channel_reports_retry_traits.h deleted file mode 100644 index 50ca7f3779b6c..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_retry_traits.h +++ /dev/null @@ -1,43 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_RETRY_TRAITS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_RETRY_TRAITS_H - -#include "google/cloud/status.h" -#include "google/cloud/version.h" - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// Define the gRPC status code semantics for retrying requests. -struct CloudChannelReportsServiceRetryTraits { - static bool IsPermanentFailure(google::cloud::Status const& status) { - return status.code() != StatusCode::kOk && - status.code() != StatusCode::kUnavailable; - } -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_RETRY_TRAITS_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_sources.cc b/google/cloud/channel/v1/internal/cloud_channel_reports_sources.cc deleted file mode 100644 index 6a7a46f323f2b..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_sources.cc +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -// NOLINTBEGIN(bugprone-suspicious-include) -#include "google/cloud/channel/v1/cloud_channel_reports_client.cc" -#include "google/cloud/channel/v1/cloud_channel_reports_connection.cc" -#include "google/cloud/channel/v1/cloud_channel_reports_connection_idempotency_policy.cc" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_auth_decorator.cc" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_connection_impl.cc" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_logging_decorator.cc" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_metadata_decorator.cc" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_option_defaults.cc" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_stub.cc" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_stub_factory.cc" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_tracing_connection.cc" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_tracing_stub.cc" -// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_stub.cc b/google/cloud/channel/v1/internal/cloud_channel_reports_stub.cc deleted file mode 100644 index aa567a8d3a89f..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_stub.cc +++ /dev/null @@ -1,176 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#include "google/cloud/channel/v1/internal/cloud_channel_reports_stub.h" -#include "google/cloud/grpc_error_delegate.h" -#include "google/cloud/status_or.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -CloudChannelReportsServiceStub::~CloudChannelReportsServiceStub() = default; - -future> -DefaultCloudChannelReportsServiceStub::AsyncRunReportJob( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions, - google::cloud::channel::v1::RunReportJobRequest const& request) { - return internal::MakeUnaryRpcImpl< - google::cloud::channel::v1::RunReportJobRequest, - google::longrunning::Operation>( - cq, - [this](grpc::ClientContext* context, - google::cloud::channel::v1::RunReportJobRequest const& request, - grpc::CompletionQueue* cq) { - return grpc_stub_->AsyncRunReportJob(context, request, cq); - }, - request, std::move(context)); -} - -StatusOr -DefaultCloudChannelReportsServiceStub::RunReportJob( - grpc::ClientContext& context, Options, - google::cloud::channel::v1::RunReportJobRequest const& request) { - google::longrunning::Operation response; - auto status = grpc_stub_->RunReportJob(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultCloudChannelReportsServiceStub::FetchReportResults( - grpc::ClientContext& context, Options const&, - google::cloud::channel::v1::FetchReportResultsRequest const& request) { - google::cloud::channel::v1::FetchReportResultsResponse response; - auto status = grpc_stub_->FetchReportResults(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultCloudChannelReportsServiceStub::ListReports( - grpc::ClientContext& context, Options const&, - google::cloud::channel::v1::ListReportsRequest const& request) { - google::cloud::channel::v1::ListReportsResponse response; - auto status = grpc_stub_->ListReports(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultCloudChannelReportsServiceStub::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 -DefaultCloudChannelReportsServiceStub::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 DefaultCloudChannelReportsServiceStub::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 DefaultCloudChannelReportsServiceStub::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> -DefaultCloudChannelReportsServiceStub::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 DefaultCloudChannelReportsServiceStub::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 channel_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_stub.h b/google/cloud/channel/v1/internal/cloud_channel_reports_stub.h deleted file mode 100644 index 3f9f864a9b297..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_stub.h +++ /dev/null @@ -1,163 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_STUB_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_STUB_H - -#include "google/cloud/completion_queue.h" -#include "google/cloud/future.h" -#include "google/cloud/options.h" -#include "google/cloud/status_or.h" -#include "google/cloud/version.h" -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -class CloudChannelReportsServiceStub { - public: - virtual ~CloudChannelReportsServiceStub() = 0; - - virtual future> AsyncRunReportJob( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::channel::v1::RunReportJobRequest const& request) = 0; - - virtual StatusOr RunReportJob( - grpc::ClientContext& context, Options options, - google::cloud::channel::v1::RunReportJobRequest const& request) = 0; - - virtual StatusOr - FetchReportResults( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::FetchReportResultsRequest const& request) = 0; - - virtual StatusOr ListReports( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::ListReportsRequest 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 DefaultCloudChannelReportsServiceStub - : public CloudChannelReportsServiceStub { - public: - DefaultCloudChannelReportsServiceStub( - std::unique_ptr< - google::cloud::channel::v1::CloudChannelReportsService::StubInterface> - grpc_stub, - std::unique_ptr - operations_stub) - : grpc_stub_(std::move(grpc_stub)), - operations_stub_(std::move(operations_stub)) {} - - future> AsyncRunReportJob( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::channel::v1::RunReportJobRequest const& request) override; - - StatusOr RunReportJob( - grpc::ClientContext& context, Options options, - google::cloud::channel::v1::RunReportJobRequest const& request) override; - - StatusOr - FetchReportResults( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::FetchReportResultsRequest const& request) - override; - - StatusOr ListReports( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::ListReportsRequest 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::channel::v1::CloudChannelReportsService::StubInterface> - grpc_stub_; - std::unique_ptr - operations_stub_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_STUB_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_stub_factory.cc b/google/cloud/channel/v1/internal/cloud_channel_reports_stub_factory.cc deleted file mode 100644 index c9d47efa3b930..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_stub_factory.cc +++ /dev/null @@ -1,75 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#include "google/cloud/channel/v1/internal/cloud_channel_reports_stub_factory.h" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_auth_decorator.h" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_logging_decorator.h" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_metadata_decorator.h" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_stub.h" -#include "google/cloud/channel/v1/internal/cloud_channel_reports_tracing_stub.h" -#include "google/cloud/common_options.h" -#include "google/cloud/grpc_options.h" -#include "google/cloud/internal/algorithm.h" -#include "google/cloud/internal/opentelemetry.h" -#include "google/cloud/log.h" -#include "google/cloud/options.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -std::shared_ptr -CreateDefaultCloudChannelReportsServiceStub( - std::shared_ptr auth, - Options const& options) { - auto channel = auth->CreateChannel(options.get(), - internal::MakeChannelArguments(options)); - auto service_grpc_stub = - google::cloud::channel::v1::CloudChannelReportsService::NewStub(channel); - std::shared_ptr stub = - std::make_shared( - std::move(service_grpc_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 = MakeCloudChannelReportsServiceTracingStub(std::move(stub)); - } - return stub; -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_stub_factory.h b/google/cloud/channel/v1/internal/cloud_channel_reports_stub_factory.h deleted file mode 100644 index 56dce648fbd5f..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_stub_factory.h +++ /dev/null @@ -1,43 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_STUB_FACTORY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_STUB_FACTORY_H - -#include "google/cloud/channel/v1/internal/cloud_channel_reports_stub.h" -#include "google/cloud/internal/unified_grpc_credentials.h" -#include "google/cloud/options.h" -#include "google/cloud/version.h" -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -std::shared_ptr -CreateDefaultCloudChannelReportsServiceStub( - std::shared_ptr auth, - Options const& options); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_STUB_FACTORY_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_tracing_connection.cc b/google/cloud/channel/v1/internal/cloud_channel_reports_tracing_connection.cc deleted file mode 100644 index b81bc97be669e..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_tracing_connection.cc +++ /dev/null @@ -1,140 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#include "google/cloud/channel/v1/internal/cloud_channel_reports_tracing_connection.h" -#include "google/cloud/internal/opentelemetry.h" -#include "google/cloud/internal/traced_stream_range.h" -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -CloudChannelReportsServiceTracingConnection:: - CloudChannelReportsServiceTracingConnection( - std::shared_ptr child) - : child_(std::move(child)) {} - -future> -CloudChannelReportsServiceTracingConnection::RunReportJob( - google::cloud::channel::v1::RunReportJobRequest const& request) { - auto span = internal::MakeSpan( - "channel_v1::CloudChannelReportsServiceConnection::RunReportJob"); - internal::OTelScope scope(span); - return internal::EndSpan(std::move(span), child_->RunReportJob(request)); -} - -StatusOr -CloudChannelReportsServiceTracingConnection::RunReportJob( - NoAwaitTag, - google::cloud::channel::v1::RunReportJobRequest const& request) { - auto span = internal::MakeSpan( - "channel_v1::CloudChannelReportsServiceConnection::RunReportJob"); - opentelemetry::trace::Scope scope(span); - return internal::EndSpan(*span, child_->RunReportJob(NoAwaitTag{}, request)); -} - -future> -CloudChannelReportsServiceTracingConnection::RunReportJob( - google::longrunning::Operation const& operation) { - auto span = internal::MakeSpan( - "channel_v1::CloudChannelReportsServiceConnection::RunReportJob"); - internal::OTelScope scope(span); - return internal::EndSpan(std::move(span), child_->RunReportJob(operation)); -} - -StreamRange -CloudChannelReportsServiceTracingConnection::FetchReportResults( - google::cloud::channel::v1::FetchReportResultsRequest request) { - auto span = internal::MakeSpan( - "channel_v1::CloudChannelReportsServiceConnection::FetchReportResults"); - internal::OTelScope scope(span); - auto sr = child_->FetchReportResults(std::move(request)); - return internal::MakeTracedStreamRange( - std::move(span), std::move(sr)); -} - -StreamRange -CloudChannelReportsServiceTracingConnection::ListReports( - google::cloud::channel::v1::ListReportsRequest request) { - auto span = internal::MakeSpan( - "channel_v1::CloudChannelReportsServiceConnection::ListReports"); - internal::OTelScope scope(span); - auto sr = child_->ListReports(std::move(request)); - return internal::MakeTracedStreamRange( - std::move(span), std::move(sr)); -} - -StreamRange -CloudChannelReportsServiceTracingConnection::ListOperations( - google::longrunning::ListOperationsRequest request) { - auto span = internal::MakeSpan( - "channel_v1::CloudChannelReportsServiceConnection::ListOperations"); - internal::OTelScope scope(span); - auto sr = child_->ListOperations(std::move(request)); - return internal::MakeTracedStreamRange( - std::move(span), std::move(sr)); -} - -StatusOr -CloudChannelReportsServiceTracingConnection::GetOperation( - google::longrunning::GetOperationRequest const& request) { - auto span = internal::MakeSpan( - "channel_v1::CloudChannelReportsServiceConnection::GetOperation"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->GetOperation(request)); -} - -Status CloudChannelReportsServiceTracingConnection::DeleteOperation( - google::longrunning::DeleteOperationRequest const& request) { - auto span = internal::MakeSpan( - "channel_v1::CloudChannelReportsServiceConnection::DeleteOperation"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->DeleteOperation(request)); -} - -Status CloudChannelReportsServiceTracingConnection::CancelOperation( - google::longrunning::CancelOperationRequest const& request) { - auto span = internal::MakeSpan( - "channel_v1::CloudChannelReportsServiceConnection::CancelOperation"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->CancelOperation(request)); -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::shared_ptr -MakeCloudChannelReportsServiceTracingConnection( - std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - if (internal::TracingEnabled(conn->options())) { - conn = std::make_shared( - std::move(conn)); - } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - return conn; -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_tracing_connection.h b/google/cloud/channel/v1/internal/cloud_channel_reports_tracing_connection.h deleted file mode 100644 index 1e76d8af0e401..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_tracing_connection.h +++ /dev/null @@ -1,93 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_TRACING_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_TRACING_CONNECTION_H - -#include "google/cloud/channel/v1/cloud_channel_reports_connection.h" -#include "google/cloud/version.h" -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -class CloudChannelReportsServiceTracingConnection - : public channel_v1::CloudChannelReportsServiceConnection { - public: - ~CloudChannelReportsServiceTracingConnection() override = default; - - explicit CloudChannelReportsServiceTracingConnection( - std::shared_ptr child); - - Options options() override { return child_->options(); } - - future> - RunReportJob( - google::cloud::channel::v1::RunReportJobRequest const& request) override; - - StatusOr RunReportJob( - NoAwaitTag, - google::cloud::channel::v1::RunReportJobRequest const& request) override; - - future> - RunReportJob(google::longrunning::Operation const& operation) override; - - StreamRange FetchReportResults( - google::cloud::channel::v1::FetchReportResultsRequest request) override; - - StreamRange ListReports( - google::cloud::channel::v1::ListReportsRequest request) override; - - StreamRange ListOperations( - google::longrunning::ListOperationsRequest request) override; - - StatusOr GetOperation( - google::longrunning::GetOperationRequest const& request) override; - - Status DeleteOperation( - google::longrunning::DeleteOperationRequest const& request) override; - - Status CancelOperation( - google::longrunning::CancelOperationRequest const& request) override; - - private: - std::shared_ptr child_; -}; - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -/** - * Conditionally applies the tracing decorator to the given connection. - * - * The connection is only decorated if tracing is enabled (as determined by the - * connection's options). - */ -std::shared_ptr -MakeCloudChannelReportsServiceTracingConnection( - std::shared_ptr conn); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_TRACING_CONNECTION_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_tracing_stub.cc b/google/cloud/channel/v1/internal/cloud_channel_reports_tracing_stub.cc deleted file mode 100644 index ce153912ae552..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_tracing_stub.cc +++ /dev/null @@ -1,176 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#include "google/cloud/channel/v1/internal/cloud_channel_reports_tracing_stub.h" -#include "google/cloud/internal/grpc_opentelemetry.h" -#include -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -CloudChannelReportsServiceTracingStub::CloudChannelReportsServiceTracingStub( - std::shared_ptr child) - : child_(std::move(child)), propagator_(internal::MakePropagator()) {} - -future> -CloudChannelReportsServiceTracingStub::AsyncRunReportJob( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::channel::v1::RunReportJobRequest const& request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.channel.v1.CloudChannelReportsService", "RunReportJob"); - internal::OTelScope scope(span); - internal::InjectTraceContext(*context, *propagator_); - auto f = child_->AsyncRunReportJob(cq, context, std::move(options), request); - return internal::EndSpan(std::move(context), std::move(span), std::move(f)); -} - -StatusOr -CloudChannelReportsServiceTracingStub::RunReportJob( - grpc::ClientContext& context, Options options, - google::cloud::channel::v1::RunReportJobRequest const& request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.channel.v1.CloudChannelReportsService", "RunReportJob"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->RunReportJob(context, options, request)); -} - -StatusOr -CloudChannelReportsServiceTracingStub::FetchReportResults( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::FetchReportResultsRequest const& request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.channel.v1.CloudChannelReportsService", - "FetchReportResults"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan( - context, *span, child_->FetchReportResults(context, options, request)); -} - -StatusOr -CloudChannelReportsServiceTracingStub::ListReports( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::ListReportsRequest const& request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.channel.v1.CloudChannelReportsService", "ListReports"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->ListReports(context, options, request)); -} - -StatusOr -CloudChannelReportsServiceTracingStub::ListOperations( - grpc::ClientContext& context, Options const& options, - google::longrunning::ListOperationsRequest const& request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.channel.v1.CloudChannelReportsService", "ListOperations"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->ListOperations(context, options, request)); -} - -StatusOr -CloudChannelReportsServiceTracingStub::GetOperation( - grpc::ClientContext& context, Options const& options, - google::longrunning::GetOperationRequest const& request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.channel.v1.CloudChannelReportsService", "GetOperation"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->GetOperation(context, options, request)); -} - -Status CloudChannelReportsServiceTracingStub::DeleteOperation( - grpc::ClientContext& context, Options const& options, - google::longrunning::DeleteOperationRequest const& request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.channel.v1.CloudChannelReportsService", "DeleteOperation"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->DeleteOperation(context, options, request)); -} - -Status CloudChannelReportsServiceTracingStub::CancelOperation( - grpc::ClientContext& context, Options const& options, - google::longrunning::CancelOperationRequest const& request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.channel.v1.CloudChannelReportsService", "CancelOperation"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->CancelOperation(context, options, request)); -} - -future> -CloudChannelReportsServiceTracingStub::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 CloudChannelReportsServiceTracingStub::AsyncCancelOperation( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::longrunning::CancelOperationRequest const& request) { - auto span = internal::MakeSpanGrpc("google.longrunning.Operations", - "CancelOperation"); - internal::OTelScope scope(span); - internal::InjectTraceContext(*context, *propagator_); - auto f = - child_->AsyncCancelOperation(cq, context, std::move(options), request); - return internal::EndSpan(std::move(context), std::move(span), std::move(f)); -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::shared_ptr -MakeCloudChannelReportsServiceTracingStub( - std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - return std::make_shared( - std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/channel/v1/internal/cloud_channel_reports_tracing_stub.h b/google/cloud/channel/v1/internal/cloud_channel_reports_tracing_stub.h deleted file mode 100644 index 14bf63f41bc3e..0000000000000 --- a/google/cloud/channel/v1/internal/cloud_channel_reports_tracing_stub.h +++ /dev/null @@ -1,114 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_TRACING_STUB_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_TRACING_STUB_H - -#include "google/cloud/channel/v1/internal/cloud_channel_reports_stub.h" -#include "google/cloud/internal/trace_propagator.h" -#include "google/cloud/options.h" -#include "google/cloud/version.h" -#include - -namespace google { -namespace cloud { -namespace channel_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -class CloudChannelReportsServiceTracingStub - : public CloudChannelReportsServiceStub { - public: - ~CloudChannelReportsServiceTracingStub() override = default; - - explicit CloudChannelReportsServiceTracingStub( - std::shared_ptr child); - - future> AsyncRunReportJob( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::channel::v1::RunReportJobRequest const& request) override; - - StatusOr RunReportJob( - grpc::ClientContext& context, Options options, - google::cloud::channel::v1::RunReportJobRequest const& request) override; - - StatusOr - FetchReportResults( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::FetchReportResultsRequest const& request) - override; - - StatusOr ListReports( - grpc::ClientContext& context, Options const& options, - google::cloud::channel::v1::ListReportsRequest const& request) override; - - StatusOr ListOperations( - grpc::ClientContext& context, Options const& options, - google::longrunning::ListOperationsRequest const& request) override; - - StatusOr GetOperation( - grpc::ClientContext& context, Options const& options, - google::longrunning::GetOperationRequest const& request) override; - - Status DeleteOperation( - grpc::ClientContext& context, Options const& options, - google::longrunning::DeleteOperationRequest const& request) override; - - Status CancelOperation( - grpc::ClientContext& context, Options const& options, - google::longrunning::CancelOperationRequest const& request) override; - - future> AsyncGetOperation( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::longrunning::GetOperationRequest const& request) override; - - future AsyncCancelOperation( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::longrunning::CancelOperationRequest const& request) override; - - private: - std::shared_ptr child_; - std::shared_ptr - propagator_; -}; - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -/** - * Applies the tracing decorator to the given stub. - * - * The stub is only decorated if the library has been compiled with - * OpenTelemetry. - */ -std::shared_ptr -MakeCloudChannelReportsServiceTracingStub( - std::shared_ptr stub); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace channel_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_REPORTS_TRACING_STUB_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_stub.cc b/google/cloud/channel/v1/internal/cloud_channel_stub.cc index 0ad92f342fa49..068c98c5e6ef8 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_stub.cc +++ b/google/cloud/channel/v1/internal/cloud_channel_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/channel/v1/service.proto #include "google/cloud/channel/v1/internal/cloud_channel_stub.h" +#include "google/cloud/channel/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace channel_v1_internal { @@ -951,3 +954,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace channel_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/channel/v1/internal/cloud_channel_stub.h b/google/cloud/channel/v1/internal/cloud_channel_stub.h index 6b7bb835f04a8..72bd05332e220 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_stub.h +++ b/google/cloud/channel/v1/internal/cloud_channel_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_STUB_H +#include "google/cloud/channel/v1/operations.pb.h" +#include "google/cloud/channel/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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace channel_v1_internal { @@ -792,4 +795,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_STUB_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_stub_factory.cc b/google/cloud/channel/v1/internal/cloud_channel_stub_factory.cc index 88a5583af633a..21efbbb0bfc14 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_stub_factory.cc +++ b/google/cloud/channel/v1/internal/cloud_channel_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/channel/v1/internal/cloud_channel_metadata_decorator.h" #include "google/cloud/channel/v1/internal/cloud_channel_stub.h" #include "google/cloud/channel/v1/internal/cloud_channel_tracing_stub.h" +#include "google/cloud/channel/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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace channel_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace channel_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/channel/v1/internal/cloud_channel_stub_factory.h b/google/cloud/channel/v1/internal/cloud_channel_stub_factory.h index a1c45ad9cdc0e..7322b629edd76 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_stub_factory.h +++ b/google/cloud/channel/v1/internal/cloud_channel_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace channel_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_STUB_FACTORY_H diff --git a/google/cloud/channel/v1/internal/cloud_channel_tracing_connection.cc b/google/cloud/channel/v1/internal/cloud_channel_tracing_connection.cc index 672ae3d06a808..1627d8fedb6fe 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_tracing_connection.cc +++ b/google/cloud/channel/v1/internal/cloud_channel_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace channel_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudChannelServiceTracingConnection::CloudChannelServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -819,17 +817,13 @@ Status CloudChannelServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudChannelServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/channel/v1/internal/cloud_channel_tracing_connection.h b/google/cloud/channel/v1/internal/cloud_channel_tracing_connection.h index 6d26fbb179696..3b50746e24413 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_tracing_connection.h +++ b/google/cloud/channel/v1/internal/cloud_channel_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace channel_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudChannelServiceTracingConnection : public channel_v1::CloudChannelServiceConnection { public: @@ -350,8 +348,6 @@ class CloudChannelServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/channel/v1/internal/cloud_channel_tracing_stub.cc b/google/cloud/channel/v1/internal/cloud_channel_tracing_stub.cc index 02c87a30d0370..ae26a6968a698 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_tracing_stub.cc +++ b/google/cloud/channel/v1/internal/cloud_channel_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace channel_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudChannelServiceTracingStub::CloudChannelServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -909,18 +910,14 @@ future CloudChannelServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudChannelServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace channel_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/channel/v1/internal/cloud_channel_tracing_stub.h b/google/cloud/channel/v1/internal/cloud_channel_tracing_stub.h index 3842087878f33..2063682ea12f5 100644 --- a/google/cloud/channel/v1/internal/cloud_channel_tracing_stub.h +++ b/google/cloud/channel/v1/internal/cloud_channel_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace channel_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudChannelServiceTracingStub : public CloudChannelServiceStub { public: ~CloudChannelServiceTracingStub() override = default; @@ -409,8 +410,6 @@ class CloudChannelServiceTracingStub : public CloudChannelServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -425,4 +424,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_INTERNAL_CLOUD_CHANNEL_TRACING_STUB_H diff --git a/google/cloud/channel/v1/mocks/mock_cloud_channel_reports_connection.h b/google/cloud/channel/v1/mocks/mock_cloud_channel_reports_connection.h deleted file mode 100644 index 7e371da033dc3..0000000000000 --- a/google/cloud/channel/v1/mocks/mock_cloud_channel_reports_connection.h +++ /dev/null @@ -1,119 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_MOCKS_MOCK_CLOUD_CHANNEL_REPORTS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_MOCKS_MOCK_CLOUD_CHANNEL_REPORTS_CONNECTION_H - -#include "google/cloud/channel/v1/cloud_channel_reports_connection.h" -#include - -namespace google { -namespace cloud { -namespace channel_v1_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * A class to mock `CloudChannelReportsServiceConnection`. - * - * Application developers may want to test their code with simulated responses, - * including errors, from an object of type `CloudChannelReportsServiceClient`. - * To do so, construct an object of type `CloudChannelReportsServiceClient` 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 MockCloudChannelReportsServiceConnection - : public channel_v1::CloudChannelReportsServiceConnection { - public: - MOCK_METHOD(Options, options, (), (override)); - - /// To disambiguate calls, use: - /// - /// @code - /// using ::testing::_; - /// using ::testing::Matcher; - /// EXPECT_CALL(*mock, - /// RunReportJob(Matcher(_))) - /// @endcode - MOCK_METHOD( - future>, - RunReportJob, - (google::cloud::channel::v1::RunReportJobRequest const& request), - (override)); - - /// To disambiguate calls, use: - /// - /// @code - /// using ::testing::_; - /// EXPECT_CALL(*mock, RunReportJob(_, _)) - /// @endcode - MOCK_METHOD(StatusOr, RunReportJob, - (NoAwaitTag, - google::cloud::channel::v1::RunReportJobRequest const& request), - (override)); - - /// To disambiguate calls, use: - /// - /// @code - /// using ::testing::_; - /// using ::testing::Matcher; - /// EXPECT_CALL(*mock, RunReportJob(Matcher(_))) - /// @endcode - MOCK_METHOD( - future>, - RunReportJob, (google::longrunning::Operation const& operation), - (override)); - - MOCK_METHOD((StreamRange), - FetchReportResults, - (google::cloud::channel::v1::FetchReportResultsRequest request), - (override)); - - MOCK_METHOD((StreamRange), ListReports, - (google::cloud::channel::v1::ListReportsRequest 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 channel_v1_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHANNEL_V1_MOCKS_MOCK_CLOUD_CHANNEL_REPORTS_CONNECTION_H diff --git a/google/cloud/channel/v1/samples/cloud_channel_reports_client_samples.cc b/google/cloud/channel/v1/samples/cloud_channel_reports_client_samples.cc deleted file mode 100644 index 32ff801201d3a..0000000000000 --- a/google/cloud/channel/v1/samples/cloud_channel_reports_client_samples.cc +++ /dev/null @@ -1,240 +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. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/channel/v1/reports_service.proto - -#include "google/cloud/channel/v1/cloud_channel_reports_client.h" -#include "google/cloud/channel/v1/cloud_channel_reports_connection_idempotency_policy.h" -#include "google/cloud/channel/v1/cloud_channel_reports_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: channel_v1::CloudChannelReportsServiceClient -// 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::channel_v1::CloudChannelReportsServiceClient( - google::cloud::channel_v1::MakeCloudChannelReportsServiceConnection( - 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::channel_v1::CloudChannelReportsServiceClient( - google::cloud::channel_v1::MakeCloudChannelReportsServiceConnection( - *ud_options)); - //! [set-client-universe-domain] -} - -//! [custom-idempotency-policy] -class CustomIdempotencyPolicy - : public google::cloud::channel_v1:: - CloudChannelReportsServiceConnectionIdempotencyPolicy { - 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::channel_v1:: - CloudChannelReportsServiceLimitedErrorCountRetryPolicy(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::channel_v1::MakeCloudChannelReportsServiceConnection( - options); - - // c1 and c2 share the same retry policies - auto c1 = - google::cloud::channel_v1::CloudChannelReportsServiceClient(connection); - auto c2 = - google::cloud::channel_v1::CloudChannelReportsServiceClient(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::channel_v1::CloudChannelReportsServiceClient( - connection, google::cloud::Options{} - .set( - google::cloud::channel_v1:: - CloudChannelReportsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(5)) - .clone())); - - // You can also override the policies in a single call: - // c3.SomeRpc(..., google::cloud::Options{} - // .set( - // google::cloud::channel_v1::CloudChannelReportsServiceLimitedErrorCountRetryPolicy(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::channel_v1:: - CloudChannelReportsServiceRetryPolicyOption::Type, - google::cloud::channel_v1:: - CloudChannelReportsServiceBackoffPolicyOption::Type>( - google::cloud::channel_v1:: - CloudChannelReportsServiceLimitedTimeRetryPolicy( - /*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::channel_v1::MakeCloudChannelReportsServiceConnection( - options); - - // c1 and c2 share the same polling policies. - auto c1 = - google::cloud::channel_v1::CloudChannelReportsServiceClient(connection); - auto c2 = - google::cloud::channel_v1::CloudChannelReportsServiceClient(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::channel_v1::CloudChannelReportsServiceClient( - google::cloud::channel_v1::MakeCloudChannelReportsServiceConnection( - 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/chronicle/BUILD.bazel b/google/cloud/chronicle/BUILD.bazel index cb61c2ee5b520..e74ae0ccf533e 100644 --- a/google/cloud/chronicle/BUILD.bazel +++ b/google/cloud/chronicle/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/chronicle/v1:chronicle_cc_grpc", + "@googleapis//google/cloud/chronicle/v1:chronicle_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/chronicle/quickstart/CMakeLists.txt b/google/cloud/chronicle/quickstart/CMakeLists.txt index 62835fae8fa36..9aba02742583a 100644 --- a/google/cloud/chronicle/quickstart/CMakeLists.txt +++ b/google/cloud/chronicle/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Chronicle API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-chronicle-quickstart CXX) find_package(google_cloud_cpp_chronicle REQUIRED) diff --git a/google/cloud/chronicle/quickstart/WORKSPACE.bazel b/google/cloud/chronicle/quickstart/WORKSPACE.bazel index 98526ce5cbde4..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 = "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/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/data_access_control_connection.h b/google/cloud/chronicle/v1/data_access_control_connection.h index 1f8e5fceec5f2..bd79ba6a5ae6a 100644 --- a/google/cloud/chronicle/v1/data_access_control_connection.h +++ b/google/cloud/chronicle/v1/data_access_control_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_DATA_ACCESS_CONTROL_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_DATA_ACCESS_CONTROL_CONNECTION_H +#include "google/cloud/chronicle/v1/data_access_control.pb.h" #include "google/cloud/chronicle/v1/data_access_control_connection_idempotency_policy.h" #include "google/cloud/chronicle/v1/internal/data_access_control_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/chronicle/v1/data_access_control_connection_idempotency_policy.h b/google/cloud/chronicle/v1/data_access_control_connection_idempotency_policy.h index d301a6e432278..b23edf91309e4 100644 --- a/google/cloud/chronicle/v1/data_access_control_connection_idempotency_policy.h +++ b/google/cloud/chronicle/v1/data_access_control_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_DATA_ACCESS_CONTROL_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_DATA_ACCESS_CONTROL_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/chronicle/v1/data_access_control.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/entity_connection.h b/google/cloud/chronicle/v1/entity_connection.h index 60dcb4b15c634..e74f0b148449f 100644 --- a/google/cloud/chronicle/v1/entity_connection.h +++ b/google/cloud/chronicle/v1/entity_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_ENTITY_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_ENTITY_CONNECTION_H +#include "google/cloud/chronicle/v1/entity.pb.h" #include "google/cloud/chronicle/v1/entity_connection_idempotency_policy.h" #include "google/cloud/chronicle/v1/internal/entity_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/chronicle/v1/entity_connection_idempotency_policy.h b/google/cloud/chronicle/v1/entity_connection_idempotency_policy.h index 36a2e36918dee..41c9f279cc395 100644 --- a/google/cloud/chronicle/v1/entity_connection_idempotency_policy.h +++ b/google/cloud/chronicle/v1/entity_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_ENTITY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_ENTITY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/chronicle/v1/entity.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/instance_connection.h b/google/cloud/chronicle/v1/instance_connection.h index 1ebbffab66389..da080a9fff4a9 100644 --- a/google/cloud/chronicle/v1/instance_connection.h +++ b/google/cloud/chronicle/v1/instance_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INSTANCE_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INSTANCE_CONNECTION_H +#include "google/cloud/chronicle/v1/instance.pb.h" #include "google/cloud/chronicle/v1/instance_connection_idempotency_policy.h" #include "google/cloud/chronicle/v1/internal/instance_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/chronicle/v1/instance_connection_idempotency_policy.h b/google/cloud/chronicle/v1/instance_connection_idempotency_policy.h index 9f9d1b51b0074..ee33464c1ed63 100644 --- a/google/cloud/chronicle/v1/instance_connection_idempotency_policy.h +++ b/google/cloud/chronicle/v1/instance_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INSTANCE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INSTANCE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/chronicle/v1/instance.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/chronicle/v1/internal/data_access_control_auth_decorator.cc b/google/cloud/chronicle/v1/internal/data_access_control_auth_decorator.cc index 0883a28a57a98..bac3978f6ac6f 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_auth_decorator.cc +++ b/google/cloud/chronicle/v1/internal/data_access_control_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/chronicle/v1/data_access_control.proto #include "google/cloud/chronicle/v1/internal/data_access_control_auth_decorator.h" -#include +#include "google/cloud/chronicle/v1/data_access_control.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -157,3 +160,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/data_access_control_auth_decorator.h b/google/cloud/chronicle/v1/internal/data_access_control_auth_decorator.h index bbed015020215..0e15f07e0c326 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_auth_decorator.h +++ b/google/cloud/chronicle/v1/internal/data_access_control_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -116,4 +119,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_DATA_ACCESS_CONTROL_AUTH_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/data_access_control_logging_decorator.cc b/google/cloud/chronicle/v1/internal/data_access_control_logging_decorator.cc index b8171aa291fe9..1ac26ac3a5ee0 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_logging_decorator.cc +++ b/google/cloud/chronicle/v1/internal/data_access_control_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/chronicle/v1/data_access_control.proto #include "google/cloud/chronicle/v1/internal/data_access_control_logging_decorator.h" +#include "google/cloud/chronicle/v1/data_access_control.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -213,3 +216,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/data_access_control_logging_decorator.h b/google/cloud/chronicle/v1/internal/data_access_control_logging_decorator.h index d2ae16a199faf..c49f198192778 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_logging_decorator.h +++ b/google/cloud/chronicle/v1/internal/data_access_control_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -116,4 +119,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_DATA_ACCESS_CONTROL_LOGGING_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/data_access_control_metadata_decorator.cc b/google/cloud/chronicle/v1/internal/data_access_control_metadata_decorator.cc index f474a24eeda5a..0e8e75b40cc55 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_metadata_decorator.cc +++ b/google/cloud/chronicle/v1/internal/data_access_control_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/chronicle/v1/data_access_control.proto #include "google/cloud/chronicle/v1/internal/data_access_control_metadata_decorator.h" +#include "google/cloud/chronicle/v1/data_access_control.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 chronicle_v1_internal { @@ -187,3 +191,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/data_access_control_metadata_decorator.h b/google/cloud/chronicle/v1/internal/data_access_control_metadata_decorator.h index c82e095c51ef2..34c1d175f538b 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_metadata_decorator.h +++ b/google/cloud/chronicle/v1/internal/data_access_control_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -122,4 +125,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_DATA_ACCESS_CONTROL_METADATA_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/data_access_control_option_defaults.cc b/google/cloud/chronicle/v1/internal/data_access_control_option_defaults.cc index a3b6534c5e28d..bdbe430ac0839 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_option_defaults.cc +++ b/google/cloud/chronicle/v1/internal/data_access_control_option_defaults.cc @@ -43,7 +43,7 @@ Options DataAccessControlServiceDefaultOptions(Options options) { if (!options.has()) { options.set( chronicle_v1::DataAccessControlServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/chronicle/v1/internal/data_access_control_stub.cc b/google/cloud/chronicle/v1/internal/data_access_control_stub.cc index b9bbb92ae2bd7..8728ac743c8e0 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_stub.cc +++ b/google/cloud/chronicle/v1/internal/data_access_control_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/chronicle/v1/data_access_control.proto #include "google/cloud/chronicle/v1/internal/data_access_control_stub.h" +#include "google/cloud/chronicle/v1/data_access_control.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -198,3 +201,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/data_access_control_stub.h b/google/cloud/chronicle/v1/internal/data_access_control_stub.h index c712cc8bef942..95527ea25d850 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_stub.h +++ b/google/cloud/chronicle/v1/internal/data_access_control_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_DATA_ACCESS_CONTROL_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_DATA_ACCESS_CONTROL_STUB_H +#include "google/cloud/chronicle/v1/data_access_control.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -204,4 +207,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_DATA_ACCESS_CONTROL_STUB_H diff --git a/google/cloud/chronicle/v1/internal/data_access_control_stub_factory.cc b/google/cloud/chronicle/v1/internal/data_access_control_stub_factory.cc index 88767096de9f4..0b19371ae4776 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_stub_factory.cc +++ b/google/cloud/chronicle/v1/internal/data_access_control_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/chronicle/v1/data_access_control.proto #include "google/cloud/chronicle/v1/internal/data_access_control_stub_factory.h" +#include "google/cloud/chronicle/v1/data_access_control.grpc.pb.h" #include "google/cloud/chronicle/v1/internal/data_access_control_auth_decorator.h" #include "google/cloud/chronicle/v1/internal/data_access_control_logging_decorator.h" #include "google/cloud/chronicle/v1/internal/data_access_control_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/data_access_control_stub_factory.h b/google/cloud/chronicle/v1/internal/data_access_control_stub_factory.h index 15e79df9a32f6..e42ba55a2aa6c 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_stub_factory.h +++ b/google/cloud/chronicle/v1/internal/data_access_control_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_DATA_ACCESS_CONTROL_STUB_FACTORY_H diff --git a/google/cloud/chronicle/v1/internal/data_access_control_tracing_connection.cc b/google/cloud/chronicle/v1/internal/data_access_control_tracing_connection.cc index 01acaa41bdb5c..6e3880499aafd 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_tracing_connection.cc +++ b/google/cloud/chronicle/v1/internal/data_access_control_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataAccessControlServiceTracingConnection:: DataAccessControlServiceTracingConnection( std::shared_ptr child) @@ -170,17 +168,13 @@ Status DataAccessControlServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataAccessControlServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/chronicle/v1/internal/data_access_control_tracing_connection.h b/google/cloud/chronicle/v1/internal/data_access_control_tracing_connection.h index 6e0eb2b21f97e..664a0ccc56d03 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_tracing_connection.h +++ b/google/cloud/chronicle/v1/internal/data_access_control_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataAccessControlServiceTracingConnection : public chronicle_v1::DataAccessControlServiceConnection { public: @@ -96,8 +94,6 @@ class DataAccessControlServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/chronicle/v1/internal/data_access_control_tracing_stub.cc b/google/cloud/chronicle/v1/internal/data_access_control_tracing_stub.cc index 53c62ace43d35..408f1d56af9ff 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_tracing_stub.cc +++ b/google/cloud/chronicle/v1/internal/data_access_control_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataAccessControlServiceTracingStub::DataAccessControlServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -206,19 +207,15 @@ Status DataAccessControlServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataAccessControlServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/data_access_control_tracing_stub.h b/google/cloud/chronicle/v1/internal/data_access_control_tracing_stub.h index 522314e6a8301..db5f6520a2f78 100644 --- a/google/cloud/chronicle/v1/internal/data_access_control_tracing_stub.h +++ b/google/cloud/chronicle/v1/internal/data_access_control_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataAccessControlServiceTracingStub : public DataAccessControlServiceStub { public: @@ -114,8 +115,6 @@ class DataAccessControlServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -131,4 +130,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_DATA_ACCESS_CONTROL_TRACING_STUB_H diff --git a/google/cloud/chronicle/v1/internal/entity_auth_decorator.cc b/google/cloud/chronicle/v1/internal/entity_auth_decorator.cc index cbb71885cb326..e2b91d5fa2e6f 100644 --- a/google/cloud/chronicle/v1/internal/entity_auth_decorator.cc +++ b/google/cloud/chronicle/v1/internal/entity_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/chronicle/v1/entity.proto #include "google/cloud/chronicle/v1/internal/entity_auth_decorator.h" -#include +#include "google/cloud/chronicle/v1/entity.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -112,3 +115,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/entity_auth_decorator.h b/google/cloud/chronicle/v1/internal/entity_auth_decorator.h index 82f2770584b1c..abada2a8b909a 100644 --- a/google/cloud/chronicle/v1/internal/entity_auth_decorator.h +++ b/google/cloud/chronicle/v1/internal/entity_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -89,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_ENTITY_AUTH_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/entity_logging_decorator.cc b/google/cloud/chronicle/v1/internal/entity_logging_decorator.cc index a6d1eb0439248..9e0dfcf85d675 100644 --- a/google/cloud/chronicle/v1/internal/entity_logging_decorator.cc +++ b/google/cloud/chronicle/v1/internal/entity_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/chronicle/v1/entity.proto #include "google/cloud/chronicle/v1/internal/entity_logging_decorator.h" +#include "google/cloud/chronicle/v1/entity.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -147,3 +150,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/entity_logging_decorator.h b/google/cloud/chronicle/v1/internal/entity_logging_decorator.h index 75eb817c65b76..6164aa5d5a3fd 100644 --- a/google/cloud/chronicle/v1/internal/entity_logging_decorator.h +++ b/google/cloud/chronicle/v1/internal/entity_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -89,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_ENTITY_LOGGING_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/entity_metadata_decorator.cc b/google/cloud/chronicle/v1/internal/entity_metadata_decorator.cc index 1a2e50788c3b9..74746658ea652 100644 --- a/google/cloud/chronicle/v1/internal/entity_metadata_decorator.cc +++ b/google/cloud/chronicle/v1/internal/entity_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/chronicle/v1/entity.proto #include "google/cloud/chronicle/v1/internal/entity_metadata_decorator.h" +#include "google/cloud/chronicle/v1/entity.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 chronicle_v1_internal { @@ -139,3 +143,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/entity_metadata_decorator.h b/google/cloud/chronicle/v1/internal/entity_metadata_decorator.h index 40de837462046..dfb1fb438f507 100644 --- a/google/cloud/chronicle/v1/internal/entity_metadata_decorator.h +++ b/google/cloud/chronicle/v1/internal/entity_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_ENTITY_METADATA_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/entity_option_defaults.cc b/google/cloud/chronicle/v1/internal/entity_option_defaults.cc index bfe30047c2e23..b1d3b77850360 100644 --- a/google/cloud/chronicle/v1/internal/entity_option_defaults.cc +++ b/google/cloud/chronicle/v1/internal/entity_option_defaults.cc @@ -41,7 +41,7 @@ Options EntityServiceDefaultOptions(Options options) { if (!options.has()) { options.set( chronicle_v1::EntityServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/chronicle/v1/internal/entity_stub.cc b/google/cloud/chronicle/v1/internal/entity_stub.cc index cd7d6190cfe11..f1c881b59776c 100644 --- a/google/cloud/chronicle/v1/internal/entity_stub.cc +++ b/google/cloud/chronicle/v1/internal/entity_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/chronicle/v1/entity.proto #include "google/cloud/chronicle/v1/internal/entity_stub.h" +#include "google/cloud/chronicle/v1/entity.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -138,3 +141,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/entity_stub.h b/google/cloud/chronicle/v1/internal/entity_stub.h index 1a404d8cea01f..5b91769605bda 100644 --- a/google/cloud/chronicle/v1/internal/entity_stub.h +++ b/google/cloud/chronicle/v1/internal/entity_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_ENTITY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_ENTITY_STUB_H +#include "google/cloud/chronicle/v1/entity.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -138,4 +141,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_ENTITY_STUB_H diff --git a/google/cloud/chronicle/v1/internal/entity_stub_factory.cc b/google/cloud/chronicle/v1/internal/entity_stub_factory.cc index 1eb8e5bc733ed..1a7dad1522cab 100644 --- a/google/cloud/chronicle/v1/internal/entity_stub_factory.cc +++ b/google/cloud/chronicle/v1/internal/entity_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/chronicle/v1/entity.proto #include "google/cloud/chronicle/v1/internal/entity_stub_factory.h" +#include "google/cloud/chronicle/v1/entity.grpc.pb.h" #include "google/cloud/chronicle/v1/internal/entity_auth_decorator.h" #include "google/cloud/chronicle/v1/internal/entity_logging_decorator.h" #include "google/cloud/chronicle/v1/internal/entity_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/entity_stub_factory.h b/google/cloud/chronicle/v1/internal/entity_stub_factory.h index d0b59753d29c0..69591fb81bff8 100644 --- a/google/cloud/chronicle/v1/internal/entity_stub_factory.h +++ b/google/cloud/chronicle/v1/internal/entity_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_ENTITY_STUB_FACTORY_H diff --git a/google/cloud/chronicle/v1/internal/entity_tracing_connection.cc b/google/cloud/chronicle/v1/internal/entity_tracing_connection.cc index 2c5ab9df0177c..22f71bcea1295 100644 --- a/google/cloud/chronicle/v1/internal/entity_tracing_connection.cc +++ b/google/cloud/chronicle/v1/internal/entity_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EntityServiceTracingConnection::EntityServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -115,16 +113,12 @@ Status EntityServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEntityServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/chronicle/v1/internal/entity_tracing_connection.h b/google/cloud/chronicle/v1/internal/entity_tracing_connection.h index 47cc97ae44925..cc4ca4e810be3 100644 --- a/google/cloud/chronicle/v1/internal/entity_tracing_connection.h +++ b/google/cloud/chronicle/v1/internal/entity_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EntityServiceTracingConnection : public chronicle_v1::EntityServiceConnection { public: @@ -75,8 +73,6 @@ class EntityServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/chronicle/v1/internal/entity_tracing_stub.cc b/google/cloud/chronicle/v1/internal/entity_tracing_stub.cc index adf91a5bba8d2..feaea0664bc90 100644 --- a/google/cloud/chronicle/v1/internal/entity_tracing_stub.cc +++ b/google/cloud/chronicle/v1/internal/entity_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EntityServiceTracingStub::EntityServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -136,18 +137,14 @@ Status EntityServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEntityServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/entity_tracing_stub.h b/google/cloud/chronicle/v1/internal/entity_tracing_stub.h index 2aba006cc1652..a71ce99927c71 100644 --- a/google/cloud/chronicle/v1/internal/entity_tracing_stub.h +++ b/google/cloud/chronicle/v1/internal/entity_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EntityServiceTracingStub : public EntityServiceStub { public: ~EntityServiceTracingStub() override = default; @@ -85,8 +86,6 @@ class EntityServiceTracingStub : public EntityServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -101,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_ENTITY_TRACING_STUB_H diff --git a/google/cloud/chronicle/v1/internal/instance_auth_decorator.cc b/google/cloud/chronicle/v1/internal/instance_auth_decorator.cc index 5539c5be18f62..89c6e234701a9 100644 --- a/google/cloud/chronicle/v1/internal/instance_auth_decorator.cc +++ b/google/cloud/chronicle/v1/internal/instance_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/chronicle/v1/instance.proto #include "google/cloud/chronicle/v1/internal/instance_auth_decorator.h" -#include +#include "google/cloud/chronicle/v1/instance.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/instance_auth_decorator.h b/google/cloud/chronicle/v1/internal/instance_auth_decorator.h index 75050feb4ef84..23c30d4b181ac 100644 --- a/google/cloud/chronicle/v1/internal/instance_auth_decorator.h +++ b/google/cloud/chronicle/v1/internal/instance_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -68,4 +71,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_INSTANCE_AUTH_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/instance_logging_decorator.cc b/google/cloud/chronicle/v1/internal/instance_logging_decorator.cc index 3e25154707887..6b6ffa3b7163c 100644 --- a/google/cloud/chronicle/v1/internal/instance_logging_decorator.cc +++ b/google/cloud/chronicle/v1/internal/instance_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/chronicle/v1/instance.proto #include "google/cloud/chronicle/v1/internal/instance_logging_decorator.h" +#include "google/cloud/chronicle/v1/instance.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -96,3 +99,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/instance_logging_decorator.h b/google/cloud/chronicle/v1/internal/instance_logging_decorator.h index 3544308629197..bada53eeeb1ed 100644 --- a/google/cloud/chronicle/v1/internal/instance_logging_decorator.h +++ b/google/cloud/chronicle/v1/internal/instance_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -68,4 +71,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_INSTANCE_LOGGING_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/instance_metadata_decorator.cc b/google/cloud/chronicle/v1/internal/instance_metadata_decorator.cc index 7c123955e7f0b..1263990a96f72 100644 --- a/google/cloud/chronicle/v1/internal/instance_metadata_decorator.cc +++ b/google/cloud/chronicle/v1/internal/instance_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/chronicle/v1/instance.proto #include "google/cloud/chronicle/v1/internal/instance_metadata_decorator.h" +#include "google/cloud/chronicle/v1/instance.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 chronicle_v1_internal { @@ -103,3 +107,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/instance_metadata_decorator.h b/google/cloud/chronicle/v1/internal/instance_metadata_decorator.h index e1ed3e859b907..576800a54bd87 100644 --- a/google/cloud/chronicle/v1/internal/instance_metadata_decorator.h +++ b/google/cloud/chronicle/v1/internal/instance_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -74,4 +77,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_INSTANCE_METADATA_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/instance_option_defaults.cc b/google/cloud/chronicle/v1/internal/instance_option_defaults.cc index 6aa886ee6c0fc..7e71e8daa0e7c 100644 --- a/google/cloud/chronicle/v1/internal/instance_option_defaults.cc +++ b/google/cloud/chronicle/v1/internal/instance_option_defaults.cc @@ -42,7 +42,7 @@ Options InstanceServiceDefaultOptions(Options options) { if (!options.has()) { options.set( chronicle_v1::InstanceServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/chronicle/v1/internal/instance_stub.cc b/google/cloud/chronicle/v1/internal/instance_stub.cc index 2f40ff4484566..ee3cac403090b 100644 --- a/google/cloud/chronicle/v1/internal/instance_stub.cc +++ b/google/cloud/chronicle/v1/internal/instance_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/chronicle/v1/instance.proto #include "google/cloud/chronicle/v1/internal/instance_stub.h" +#include "google/cloud/chronicle/v1/instance.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -92,3 +95,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/instance_stub.h b/google/cloud/chronicle/v1/internal/instance_stub.h index e434675f51dab..68b8bde4dd8bf 100644 --- a/google/cloud/chronicle/v1/internal/instance_stub.h +++ b/google/cloud/chronicle/v1/internal/instance_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_INSTANCE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_INSTANCE_STUB_H +#include "google/cloud/chronicle/v1/instance.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -100,4 +103,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_INSTANCE_STUB_H diff --git a/google/cloud/chronicle/v1/internal/instance_stub_factory.cc b/google/cloud/chronicle/v1/internal/instance_stub_factory.cc index f4398575b0ff4..92ca8e0dde6fb 100644 --- a/google/cloud/chronicle/v1/internal/instance_stub_factory.cc +++ b/google/cloud/chronicle/v1/internal/instance_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/chronicle/v1/instance.proto #include "google/cloud/chronicle/v1/internal/instance_stub_factory.h" +#include "google/cloud/chronicle/v1/instance.grpc.pb.h" #include "google/cloud/chronicle/v1/internal/instance_auth_decorator.h" #include "google/cloud/chronicle/v1/internal/instance_logging_decorator.h" #include "google/cloud/chronicle/v1/internal/instance_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/instance_stub_factory.h b/google/cloud/chronicle/v1/internal/instance_stub_factory.h index 649b57ab36c78..d3a8cd97753fe 100644 --- a/google/cloud/chronicle/v1/internal/instance_stub_factory.h +++ b/google/cloud/chronicle/v1/internal/instance_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_INSTANCE_STUB_FACTORY_H diff --git a/google/cloud/chronicle/v1/internal/instance_tracing_connection.cc b/google/cloud/chronicle/v1/internal/instance_tracing_connection.cc index a1c834c5919d8..b8f12aa568096 100644 --- a/google/cloud/chronicle/v1/internal/instance_tracing_connection.cc +++ b/google/cloud/chronicle/v1/internal/instance_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InstanceServiceTracingConnection::InstanceServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -78,16 +76,12 @@ Status InstanceServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeInstanceServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/chronicle/v1/internal/instance_tracing_connection.h b/google/cloud/chronicle/v1/internal/instance_tracing_connection.h index 0337e5b5c4585..51827ff014df9 100644 --- a/google/cloud/chronicle/v1/internal/instance_tracing_connection.h +++ b/google/cloud/chronicle/v1/internal/instance_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InstanceServiceTracingConnection : public chronicle_v1::InstanceServiceConnection { public: @@ -59,8 +57,6 @@ class InstanceServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/chronicle/v1/internal/instance_tracing_stub.cc b/google/cloud/chronicle/v1/internal/instance_tracing_stub.cc index 3bc224e248793..6b46144500027 100644 --- a/google/cloud/chronicle/v1/internal/instance_tracing_stub.cc +++ b/google/cloud/chronicle/v1/internal/instance_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InstanceServiceTracingStub::InstanceServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -90,18 +91,14 @@ Status InstanceServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeInstanceServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/instance_tracing_stub.h b/google/cloud/chronicle/v1/internal/instance_tracing_stub.h index 106a8ec4e342e..27d3c0ba72350 100644 --- a/google/cloud/chronicle/v1/internal/instance_tracing_stub.h +++ b/google/cloud/chronicle/v1/internal/instance_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InstanceServiceTracingStub : public InstanceServiceStub { public: ~InstanceServiceTracingStub() override = default; @@ -65,8 +66,6 @@ class InstanceServiceTracingStub : public InstanceServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -81,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_INSTANCE_TRACING_STUB_H diff --git a/google/cloud/chronicle/v1/internal/reference_list_auth_decorator.cc b/google/cloud/chronicle/v1/internal/reference_list_auth_decorator.cc index 0b846f6b538bd..314e7cc127856 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_auth_decorator.cc +++ b/google/cloud/chronicle/v1/internal/reference_list_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/chronicle/v1/reference_list.proto #include "google/cloud/chronicle/v1/internal/reference_list_auth_decorator.h" -#include +#include "google/cloud/chronicle/v1/reference_list.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -104,3 +107,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/reference_list_auth_decorator.h b/google/cloud/chronicle/v1/internal/reference_list_auth_decorator.h index 75f5cfbdc1821..9e38614873d1b 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_auth_decorator.h +++ b/google/cloud/chronicle/v1/internal/reference_list_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -85,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_REFERENCE_LIST_AUTH_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/reference_list_logging_decorator.cc b/google/cloud/chronicle/v1/internal/reference_list_logging_decorator.cc index abe604a50514a..1fb8101e8b41b 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_logging_decorator.cc +++ b/google/cloud/chronicle/v1/internal/reference_list_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/chronicle/v1/reference_list.proto #include "google/cloud/chronicle/v1/internal/reference_list_logging_decorator.h" +#include "google/cloud/chronicle/v1/reference_list.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -137,3 +140,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/reference_list_logging_decorator.h b/google/cloud/chronicle/v1/internal/reference_list_logging_decorator.h index bbd2c197f3aa1..72efdecae6fe9 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_logging_decorator.h +++ b/google/cloud/chronicle/v1/internal/reference_list_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -85,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_REFERENCE_LIST_LOGGING_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/reference_list_metadata_decorator.cc b/google/cloud/chronicle/v1/internal/reference_list_metadata_decorator.cc index e9c53e44abb33..a5cb76a1d4e41 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_metadata_decorator.cc +++ b/google/cloud/chronicle/v1/internal/reference_list_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/chronicle/v1/reference_list.proto #include "google/cloud/chronicle/v1/internal/reference_list_metadata_decorator.h" +#include "google/cloud/chronicle/v1/reference_list.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 chronicle_v1_internal { @@ -133,3 +137,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/reference_list_metadata_decorator.h b/google/cloud/chronicle/v1/internal/reference_list_metadata_decorator.h index 91febd2f340eb..edc9a3cb6ec2f 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_metadata_decorator.h +++ b/google/cloud/chronicle/v1/internal/reference_list_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -91,4 +94,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_REFERENCE_LIST_METADATA_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/reference_list_option_defaults.cc b/google/cloud/chronicle/v1/internal/reference_list_option_defaults.cc index 423b0501e90c2..fb3d0e4f0d619 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_option_defaults.cc +++ b/google/cloud/chronicle/v1/internal/reference_list_option_defaults.cc @@ -42,7 +42,7 @@ Options ReferenceListServiceDefaultOptions(Options options) { if (!options.has()) { options.set( chronicle_v1::ReferenceListServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/chronicle/v1/internal/reference_list_stub.cc b/google/cloud/chronicle/v1/internal/reference_list_stub.cc index 4a2e266bd3bdd..907675b05c8de 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_stub.cc +++ b/google/cloud/chronicle/v1/internal/reference_list_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/chronicle/v1/reference_list.proto #include "google/cloud/chronicle/v1/internal/reference_list_stub.h" +#include "google/cloud/chronicle/v1/reference_list.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -128,3 +131,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/reference_list_stub.h b/google/cloud/chronicle/v1/internal/reference_list_stub.h index 2497249414676..a8b63fbcae893 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_stub.h +++ b/google/cloud/chronicle/v1/internal/reference_list_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_REFERENCE_LIST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_REFERENCE_LIST_STUB_H +#include "google/cloud/chronicle/v1/reference_list.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -137,4 +140,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_REFERENCE_LIST_STUB_H diff --git a/google/cloud/chronicle/v1/internal/reference_list_stub_factory.cc b/google/cloud/chronicle/v1/internal/reference_list_stub_factory.cc index 52e5210f62b04..93035c170781b 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_stub_factory.cc +++ b/google/cloud/chronicle/v1/internal/reference_list_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/chronicle/v1/internal/reference_list_metadata_decorator.h" #include "google/cloud/chronicle/v1/internal/reference_list_stub.h" #include "google/cloud/chronicle/v1/internal/reference_list_tracing_stub.h" +#include "google/cloud/chronicle/v1/reference_list.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/reference_list_stub_factory.h b/google/cloud/chronicle/v1/internal/reference_list_stub_factory.h index d23b3f967a991..8a72abec0f3d4 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_stub_factory.h +++ b/google/cloud/chronicle/v1/internal/reference_list_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_REFERENCE_LIST_STUB_FACTORY_H diff --git a/google/cloud/chronicle/v1/internal/reference_list_tracing_connection.cc b/google/cloud/chronicle/v1/internal/reference_list_tracing_connection.cc index b13725bf0eb8f..3959b926b0ae4 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_tracing_connection.cc +++ b/google/cloud/chronicle/v1/internal/reference_list_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ReferenceListServiceTracingConnection::ReferenceListServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -108,17 +106,13 @@ Status ReferenceListServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeReferenceListServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/chronicle/v1/internal/reference_list_tracing_connection.h b/google/cloud/chronicle/v1/internal/reference_list_tracing_connection.h index caa10fec97bc4..b973808cb3902 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_tracing_connection.h +++ b/google/cloud/chronicle/v1/internal/reference_list_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ReferenceListServiceTracingConnection : public chronicle_v1::ReferenceListServiceConnection { public: @@ -71,8 +69,6 @@ class ReferenceListServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/chronicle/v1/internal/reference_list_tracing_stub.cc b/google/cloud/chronicle/v1/internal/reference_list_tracing_stub.cc index 0d42dfc86bbae..f6910cc114f6e 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_tracing_stub.cc +++ b/google/cloud/chronicle/v1/internal/reference_list_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ReferenceListServiceTracingStub::ReferenceListServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -126,18 +127,14 @@ Status ReferenceListServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeReferenceListServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/reference_list_tracing_stub.h b/google/cloud/chronicle/v1/internal/reference_list_tracing_stub.h index f825e660f8e88..82a6d0c8500cc 100644 --- a/google/cloud/chronicle/v1/internal/reference_list_tracing_stub.h +++ b/google/cloud/chronicle/v1/internal/reference_list_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ReferenceListServiceTracingStub : public ReferenceListServiceStub { public: ~ReferenceListServiceTracingStub() override = default; @@ -82,8 +83,6 @@ class ReferenceListServiceTracingStub : public ReferenceListServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -98,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_REFERENCE_LIST_TRACING_STUB_H diff --git a/google/cloud/chronicle/v1/internal/rule_auth_decorator.cc b/google/cloud/chronicle/v1/internal/rule_auth_decorator.cc index c78084a277d8b..d2a8afd039dda 100644 --- a/google/cloud/chronicle/v1/internal/rule_auth_decorator.cc +++ b/google/cloud/chronicle/v1/internal/rule_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/chronicle/v1/rule.proto #include "google/cloud/chronicle/v1/internal/rule_auth_decorator.h" -#include +#include "google/cloud/chronicle/v1/rule.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -226,3 +229,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/rule_auth_decorator.h b/google/cloud/chronicle/v1/internal/rule_auth_decorator.h index 143dc06330f98..f0647c468d154 100644 --- a/google/cloud/chronicle/v1/internal/rule_auth_decorator.h +++ b/google/cloud/chronicle/v1/internal/rule_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/chronicle/v1/internal/rule_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 chronicle_v1_internal { @@ -141,4 +144,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_RULE_AUTH_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/rule_connection_impl.h b/google/cloud/chronicle/v1/internal/rule_connection_impl.h index dd57661095737..f4ac4846aeb69 100644 --- a/google/cloud/chronicle/v1/internal/rule_connection_impl.h +++ b/google/cloud/chronicle/v1/internal/rule_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/chronicle/v1/internal/rule_logging_decorator.cc b/google/cloud/chronicle/v1/internal/rule_logging_decorator.cc index bd6fc3621d389..afbd8688a2e23 100644 --- a/google/cloud/chronicle/v1/internal/rule_logging_decorator.cc +++ b/google/cloud/chronicle/v1/internal/rule_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/chronicle/v1/rule.proto #include "google/cloud/chronicle/v1/internal/rule_logging_decorator.h" +#include "google/cloud/chronicle/v1/rule.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -283,3 +286,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/rule_logging_decorator.h b/google/cloud/chronicle/v1/internal/rule_logging_decorator.h index ce752da559723..616288ff0e884 100644 --- a/google/cloud/chronicle/v1/internal/rule_logging_decorator.h +++ b/google/cloud/chronicle/v1/internal/rule_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/chronicle/v1/internal/rule_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 chronicle_v1_internal { @@ -141,4 +144,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_RULE_LOGGING_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/rule_metadata_decorator.cc b/google/cloud/chronicle/v1/internal/rule_metadata_decorator.cc index 05fb39870b36b..1cc53c47744c7 100644 --- a/google/cloud/chronicle/v1/internal/rule_metadata_decorator.cc +++ b/google/cloud/chronicle/v1/internal/rule_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/chronicle/v1/rule.proto #include "google/cloud/chronicle/v1/internal/rule_metadata_decorator.h" +#include "google/cloud/chronicle/v1/rule.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 chronicle_v1_internal { @@ -235,3 +239,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/rule_metadata_decorator.h b/google/cloud/chronicle/v1/internal/rule_metadata_decorator.h index faf93bf4ebcdc..64f51b16327b2 100644 --- a/google/cloud/chronicle/v1/internal/rule_metadata_decorator.h +++ b/google/cloud/chronicle/v1/internal/rule_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/chronicle/v1/internal/rule_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 chronicle_v1_internal { @@ -146,4 +149,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_RULE_METADATA_DECORATOR_H diff --git a/google/cloud/chronicle/v1/internal/rule_option_defaults.cc b/google/cloud/chronicle/v1/internal/rule_option_defaults.cc index 1d90bf1cdff61..7617fcaf88979 100644 --- a/google/cloud/chronicle/v1/internal/rule_option_defaults.cc +++ b/google/cloud/chronicle/v1/internal/rule_option_defaults.cc @@ -41,7 +41,7 @@ Options RuleServiceDefaultOptions(Options options) { if (!options.has()) { options.set( chronicle_v1::RuleServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/chronicle/v1/internal/rule_stub.cc b/google/cloud/chronicle/v1/internal/rule_stub.cc index 2f803b3d564c1..dd039996109c8 100644 --- a/google/cloud/chronicle/v1/internal/rule_stub.cc +++ b/google/cloud/chronicle/v1/internal/rule_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/chronicle/v1/rule.proto #include "google/cloud/chronicle/v1/internal/rule_stub.h" +#include "google/cloud/chronicle/v1/rule.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -278,3 +281,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/rule_stub.h b/google/cloud/chronicle/v1/internal/rule_stub.h index 7b11cf8b99e27..4996d9f1a8337 100644 --- a/google/cloud/chronicle/v1/internal/rule_stub.h +++ b/google/cloud/chronicle/v1/internal/rule_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_RULE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_RULE_STUB_H +#include "google/cloud/chronicle/v1/rule.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -244,4 +247,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_RULE_STUB_H diff --git a/google/cloud/chronicle/v1/internal/rule_stub_factory.cc b/google/cloud/chronicle/v1/internal/rule_stub_factory.cc index bc6865e1a72c9..43e25de55b02c 100644 --- a/google/cloud/chronicle/v1/internal/rule_stub_factory.cc +++ b/google/cloud/chronicle/v1/internal/rule_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/chronicle/v1/internal/rule_metadata_decorator.h" #include "google/cloud/chronicle/v1/internal/rule_stub.h" #include "google/cloud/chronicle/v1/internal/rule_tracing_stub.h" +#include "google/cloud/chronicle/v1/rule.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/rule_stub_factory.h b/google/cloud/chronicle/v1/internal/rule_stub_factory.h index 11288e0101520..9e3865c7d999a 100644 --- a/google/cloud/chronicle/v1/internal/rule_stub_factory.h +++ b/google/cloud/chronicle/v1/internal/rule_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_RULE_STUB_FACTORY_H diff --git a/google/cloud/chronicle/v1/internal/rule_tracing_connection.cc b/google/cloud/chronicle/v1/internal/rule_tracing_connection.cc index 4228c83a06ad0..24e81551bf57d 100644 --- a/google/cloud/chronicle/v1/internal/rule_tracing_connection.cc +++ b/google/cloud/chronicle/v1/internal/rule_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RuleServiceTracingConnection::RuleServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -205,16 +203,12 @@ Status RuleServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRuleServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/chronicle/v1/internal/rule_tracing_connection.h b/google/cloud/chronicle/v1/internal/rule_tracing_connection.h index 6014919b587c1..00f9e9410d162 100644 --- a/google/cloud/chronicle/v1/internal/rule_tracing_connection.h +++ b/google/cloud/chronicle/v1/internal/rule_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RuleServiceTracingConnection : public chronicle_v1::RuleServiceConnection { public: @@ -105,8 +103,6 @@ class RuleServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/chronicle/v1/internal/rule_tracing_stub.cc b/google/cloud/chronicle/v1/internal/rule_tracing_stub.cc index 4801020c0913f..62c740843f18f 100644 --- a/google/cloud/chronicle/v1/internal/rule_tracing_stub.cc +++ b/google/cloud/chronicle/v1/internal/rule_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RuleServiceTracingStub::RuleServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -260,18 +261,14 @@ future RuleServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRuleServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace chronicle_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/chronicle/v1/internal/rule_tracing_stub.h b/google/cloud/chronicle/v1/internal/rule_tracing_stub.h index 99b938f41d0c5..c9b96ab03574b 100644 --- a/google/cloud/chronicle/v1/internal/rule_tracing_stub.h +++ b/google/cloud/chronicle/v1/internal/rule_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace chronicle_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RuleServiceTracingStub : public RuleServiceStub { public: ~RuleServiceTracingStub() override = default; @@ -136,8 +137,6 @@ class RuleServiceTracingStub : public RuleServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -152,4 +151,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_INTERNAL_RULE_TRACING_STUB_H 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/reference_list_connection.h b/google/cloud/chronicle/v1/reference_list_connection.h index 52e14bf459435..d90768d5d597f 100644 --- a/google/cloud/chronicle/v1/reference_list_connection.h +++ b/google/cloud/chronicle/v1/reference_list_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_REFERENCE_LIST_CONNECTION_H #include "google/cloud/chronicle/v1/internal/reference_list_retry_traits.h" +#include "google/cloud/chronicle/v1/reference_list.pb.h" #include "google/cloud/chronicle/v1/reference_list_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/chronicle/v1/reference_list_connection_idempotency_policy.h b/google/cloud/chronicle/v1/reference_list_connection_idempotency_policy.h index 4293d09352eb5..821453a3682e8 100644 --- a/google/cloud/chronicle/v1/reference_list_connection_idempotency_policy.h +++ b/google/cloud/chronicle/v1/reference_list_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_REFERENCE_LIST_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_REFERENCE_LIST_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/chronicle/v1/reference_list.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/chronicle/v1/rule_client.h b/google/cloud/chronicle/v1/rule_client.h index c6c572b01f8ec..d48f810aeb083 100644 --- a/google/cloud/chronicle/v1/rule_client.h +++ b/google/cloud/chronicle/v1/rule_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/chronicle/v1/rule_connection.h b/google/cloud/chronicle/v1/rule_connection.h index ed412847f655b..653908b764fb9 100644 --- a/google/cloud/chronicle/v1/rule_connection.h +++ b/google/cloud/chronicle/v1/rule_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_RULE_CONNECTION_H #include "google/cloud/chronicle/v1/internal/rule_retry_traits.h" +#include "google/cloud/chronicle/v1/rule.pb.h" #include "google/cloud/chronicle/v1/rule_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/chronicle/v1/rule_connection_idempotency_policy.h b/google/cloud/chronicle/v1/rule_connection_idempotency_policy.h index 06a1eb59d3ffa..287fdd6ed8cba 100644 --- a/google/cloud/chronicle/v1/rule_connection_idempotency_policy.h +++ b/google/cloud/chronicle/v1/rule_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_RULE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CHRONICLE_V1_RULE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/chronicle/v1/rule.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/cloudbuild/BUILD.bazel b/google/cloud/cloudbuild/BUILD.bazel index 6f4e41867eaaa..feb32e7596cc3 100644 --- a/google/cloud/cloudbuild/BUILD.bazel +++ b/google/cloud/cloudbuild/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/devtools/cloudbuild/v1:cloudbuild_cc_grpc", - "@com_google_googleapis//google/devtools/cloudbuild/v2:cloudbuild_cc_grpc", + "@googleapis//google/devtools/cloudbuild/v1:cloudbuild_cc_grpc", + "@googleapis//google/devtools/cloudbuild/v2:cloudbuild_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/cloudbuild/CMakeLists.txt b/google/cloud/cloudbuild/CMakeLists.txt index 092f04447428e..41283f601ce7a 100644 --- a/google/cloud/cloudbuild/CMakeLists.txt +++ b/google/cloud/cloudbuild/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(cloudbuild "Cloud Build API" - SERVICE_DIRS "__EMPTY__" "v1/" "v2/") + SERVICE_DIRS "v1/" "v2/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(cloudbuild_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/cloudbuild/cloud_build_client.h b/google/cloud/cloudbuild/cloud_build_client.h deleted file mode 100644 index 78d7e12c027e0..0000000000000 --- a/google/cloud/cloudbuild/cloud_build_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudbuild/v1/cloudbuild.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_CLOUD_BUILD_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_CLOUD_BUILD_CLIENT_H - -#include "google/cloud/cloudbuild/cloud_build_connection.h" -#include "google/cloud/cloudbuild/v1/cloud_build_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in cloudbuild_v1 instead of the aliases defined in -/// this namespace. -namespace cloudbuild { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use cloudbuild_v1::CloudBuildClient directly. -using ::google::cloud::cloudbuild_v1::CloudBuildClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace cloudbuild -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_CLOUD_BUILD_CLIENT_H diff --git a/google/cloud/cloudbuild/cloud_build_connection.h b/google/cloud/cloudbuild/cloud_build_connection.h deleted file mode 100644 index cd8380d8a59a1..0000000000000 --- a/google/cloud/cloudbuild/cloud_build_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudbuild/v1/cloudbuild.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_CLOUD_BUILD_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_CLOUD_BUILD_CONNECTION_H - -#include "google/cloud/cloudbuild/cloud_build_connection_idempotency_policy.h" -#include "google/cloud/cloudbuild/v1/cloud_build_connection.h" - -namespace google { -namespace cloud { -namespace cloudbuild { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use cloudbuild_v1::MakeCloudBuildConnection directly. -using ::google::cloud::cloudbuild_v1::MakeCloudBuildConnection; - -/// @deprecated Use cloudbuild_v1::CloudBuildConnection directly. -using ::google::cloud::cloudbuild_v1::CloudBuildConnection; - -/// @deprecated Use cloudbuild_v1::CloudBuildLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::cloudbuild_v1::CloudBuildLimitedErrorCountRetryPolicy; - -/// @deprecated Use cloudbuild_v1::CloudBuildLimitedTimeRetryPolicy directly. -using ::google::cloud::cloudbuild_v1::CloudBuildLimitedTimeRetryPolicy; - -/// @deprecated Use cloudbuild_v1::CloudBuildRetryPolicy directly. -using ::google::cloud::cloudbuild_v1::CloudBuildRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace cloudbuild -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_CLOUD_BUILD_CONNECTION_H diff --git a/google/cloud/cloudbuild/cloud_build_connection_idempotency_policy.h b/google/cloud/cloudbuild/cloud_build_connection_idempotency_policy.h deleted file mode 100644 index 0e1647882fc7b..0000000000000 --- a/google/cloud/cloudbuild/cloud_build_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudbuild/v1/cloudbuild.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_CLOUD_BUILD_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_CLOUD_BUILD_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/cloudbuild/v1/cloud_build_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace cloudbuild { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// cloudbuild_v1::MakeDefaultCloudBuildConnectionIdempotencyPolicy directly. -using ::google::cloud::cloudbuild_v1:: - MakeDefaultCloudBuildConnectionIdempotencyPolicy; - -/// @deprecated Use cloudbuild_v1::CloudBuildConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::cloudbuild_v1::CloudBuildConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace cloudbuild -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_CLOUD_BUILD_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/cloudbuild/cloud_build_options.h b/google/cloud/cloudbuild/cloud_build_options.h deleted file mode 100644 index 3c28f4ea7a1d9..0000000000000 --- a/google/cloud/cloudbuild/cloud_build_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudbuild/v1/cloudbuild.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_CLOUD_BUILD_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_CLOUD_BUILD_OPTIONS_H - -#include "google/cloud/cloudbuild/cloud_build_connection.h" -#include "google/cloud/cloudbuild/cloud_build_connection_idempotency_policy.h" -#include "google/cloud/cloudbuild/v1/cloud_build_options.h" - -namespace google { -namespace cloud { -namespace cloudbuild { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use cloudbuild_v1::CloudBuildPollingPolicyOption directly. -using ::google::cloud::cloudbuild_v1::CloudBuildPollingPolicyOption; - -/// @deprecated Use cloudbuild_v1::CloudBuildBackoffPolicyOption directly. -using ::google::cloud::cloudbuild_v1::CloudBuildBackoffPolicyOption; - -/// @deprecated Use cloudbuild_v1::CloudBuildConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::cloudbuild_v1:: - CloudBuildConnectionIdempotencyPolicyOption; - -/// @deprecated Use cloudbuild_v1::CloudBuildPolicyOptionList directly. -using ::google::cloud::cloudbuild_v1::CloudBuildPolicyOptionList; - -/// @deprecated Use cloudbuild_v1::CloudBuildRetryPolicyOption directly. -using ::google::cloud::cloudbuild_v1::CloudBuildRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace cloudbuild -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_CLOUD_BUILD_OPTIONS_H diff --git a/google/cloud/cloudbuild/mocks/mock_cloud_build_connection.h b/google/cloud/cloudbuild/mocks/mock_cloud_build_connection.h deleted file mode 100644 index e0d2063cf4807..0000000000000 --- a/google/cloud/cloudbuild/mocks/mock_cloud_build_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudbuild/v1/cloudbuild.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_MOCKS_MOCK_CLOUD_BUILD_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_MOCKS_MOCK_CLOUD_BUILD_CONNECTION_H - -#include "google/cloud/cloudbuild/cloud_build_connection.h" -#include "google/cloud/cloudbuild/v1/mocks/mock_cloud_build_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in cloudbuild_v1_mocks instead of the aliases -/// defined in this namespace. -namespace cloudbuild_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use cloudbuild_v1_mocks::MockCloudBuildConnection directly. -using ::google::cloud::cloudbuild_v1_mocks::MockCloudBuildConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace cloudbuild_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_MOCKS_MOCK_CLOUD_BUILD_CONNECTION_H diff --git a/google/cloud/cloudbuild/quickstart/.bazelrc b/google/cloud/cloudbuild/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/cloudbuild/quickstart/.bazelrc +++ b/google/cloud/cloudbuild/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/cloudbuild/quickstart/CMakeLists.txt index e8856a775a27f..6d1c145832e49 100644 --- a/google/cloud/cloudbuild/quickstart/CMakeLists.txt +++ b/google/cloud/cloudbuild/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Build API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-cloudbuild-quickstart CXX) find_package(google_cloud_cpp_cloudbuild REQUIRED) diff --git a/google/cloud/cloudbuild/quickstart/WORKSPACE.bazel b/google/cloud/cloudbuild/quickstart/WORKSPACE.bazel index 4ffae1e48e679..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 = "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/cloudbuild/v1/cloud_build_client.h b/google/cloud/cloudbuild/v1/cloud_build_client.h index 52906b7445f19..ddcd57c8c76ca 100644 --- a/google/cloud/cloudbuild/v1/cloud_build_client.h +++ b/google/cloud/cloudbuild/v1/cloud_build_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/cloudbuild/v1/cloud_build_connection.h b/google/cloud/cloudbuild/v1/cloud_build_connection.h index 18d9eff75627f..3f112924e1363 100644 --- a/google/cloud/cloudbuild/v1/cloud_build_connection.h +++ b/google/cloud/cloudbuild/v1/cloud_build_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/devtools/cloudbuild/v1/cloudbuild.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/cloudbuild/v1/cloud_build_connection_idempotency_policy.h b/google/cloud/cloudbuild/v1/cloud_build_connection_idempotency_policy.h index 5c7129afbfc58..b88d73db53fd6 100644 --- a/google/cloud/cloudbuild/v1/cloud_build_connection_idempotency_policy.h +++ b/google/cloud/cloudbuild/v1/cloud_build_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/devtools/cloudbuild/v1/cloudbuild.grpc.pb.h" #include namespace google { diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_auth_decorator.cc b/google/cloud/cloudbuild/v1/internal/cloud_build_auth_decorator.cc index 9aa458c6ab286..35c70a4a8eb9e 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_auth_decorator.cc +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/devtools/cloudbuild/v1/cloudbuild.proto #include "google/cloud/cloudbuild/v1/internal/cloud_build_auth_decorator.h" -#include +#include "google/devtools/cloudbuild/v1/cloudbuild.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudbuild_v1_internal { @@ -377,3 +380,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudbuild_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_auth_decorator.h b/google/cloud/cloudbuild/v1/internal/cloud_build_auth_decorator.h index b7acdb2835a13..652c7cf6035da 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_auth_decorator.h +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/cloudbuild/v1/internal/cloud_build_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 cloudbuild_v1_internal { @@ -209,4 +212,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_V1_INTERNAL_CLOUD_BUILD_AUTH_DECORATOR_H diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_connection_impl.h b/google/cloud/cloudbuild/v1/internal/cloud_build_connection_impl.h index d4f74776629ca..b19634b925c16 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_connection_impl.h +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_logging_decorator.cc b/google/cloud/cloudbuild/v1/internal/cloud_build_logging_decorator.cc index 606744afef08d..0e73d82306ea7 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_logging_decorator.cc +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/cloudbuild/v1/internal/cloud_build_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/devtools/cloudbuild/v1/cloudbuild.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudbuild_v1_internal { @@ -450,3 +453,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudbuild_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_logging_decorator.h b/google/cloud/cloudbuild/v1/internal/cloud_build_logging_decorator.h index cd3c045d183a7..f6558a441054d 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_logging_decorator.h +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/cloudbuild/v1/internal/cloud_build_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 cloudbuild_v1_internal { @@ -209,4 +212,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_V1_INTERNAL_CLOUD_BUILD_LOGGING_DECORATOR_H diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_metadata_decorator.cc b/google/cloud/cloudbuild/v1/internal/cloud_build_metadata_decorator.cc index 12f94aa083435..855e0cfe17377 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_metadata_decorator.cc +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_metadata_decorator.cc @@ -18,18 +18,21 @@ #include "google/cloud/cloudbuild/v1/internal/cloud_build_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/routing_matcher.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/devtools/cloudbuild/v1/cloudbuild.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudbuild_v1_internal { @@ -826,3 +829,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudbuild_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_metadata_decorator.h b/google/cloud/cloudbuild/v1/internal/cloud_build_metadata_decorator.h index 5b3bfdcf65cb1..5fe745222c33c 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_metadata_decorator.h +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/cloudbuild/v1/internal/cloud_build_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 cloudbuild_v1_internal { @@ -214,4 +217,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_V1_INTERNAL_CLOUD_BUILD_METADATA_DECORATOR_H diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_option_defaults.cc b/google/cloud/cloudbuild/v1/internal/cloud_build_option_defaults.cc index e1e4df26ba586..7b5b1d41fb60b 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_option_defaults.cc +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_option_defaults.cc @@ -41,7 +41,7 @@ Options CloudBuildDefaultOptions(Options options) { if (!options.has()) { options.set( cloudbuild_v1::CloudBuildLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_stub.cc b/google/cloud/cloudbuild/v1/internal/cloud_build_stub.cc index 03cca5c99d1ed..167ea36d9485c 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_stub.cc +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/cloudbuild/v1/internal/cloud_build_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/devtools/cloudbuild/v1/cloudbuild.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 cloudbuild_v1_internal { @@ -435,3 +438,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudbuild_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_stub.h b/google/cloud/cloudbuild/v1/internal/cloud_build_stub.h index 1d2a9433cbbd0..8eacdc4f25c08 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_stub.h +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/devtools/cloudbuild/v1/cloudbuild.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 cloudbuild_v1_internal { @@ -381,4 +384,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_V1_INTERNAL_CLOUD_BUILD_STUB_H diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_stub_factory.cc b/google/cloud/cloudbuild/v1/internal/cloud_build_stub_factory.cc index 328b5a4490a5a..fa3ef7121bb23 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_stub_factory.cc +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/devtools/cloudbuild/v1/cloudbuild.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudbuild_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudbuild_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_stub_factory.h b/google/cloud/cloudbuild/v1/internal/cloud_build_stub_factory.h index 79aa8ee8d37d1..f8995c034edfc 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_stub_factory.h +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudbuild_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_V1_INTERNAL_CLOUD_BUILD_STUB_FACTORY_H diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_connection.cc b/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_connection.cc index 5a29e0adc3c25..cb4da7e6e5509 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_connection.cc +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace cloudbuild_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudBuildTracingConnection::CloudBuildTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -358,16 +356,12 @@ CloudBuildTracingConnection::GetDefaultServiceAccount( return internal::EndSpan(*span, child_->GetDefaultServiceAccount(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudBuildTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_connection.h b/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_connection.h index aa869ff6da9cf..2c84b90a1d779 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_connection.h +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace cloudbuild_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudBuildTracingConnection : public cloudbuild_v1::CloudBuildConnection { public: ~CloudBuildTracingConnection() override = default; @@ -181,8 +179,6 @@ class CloudBuildTracingConnection : public cloudbuild_v1::CloudBuildConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_stub.cc b/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_stub.cc index f2c96b12e436d..f192c08b4ec64 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_stub.cc +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudbuild_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudBuildTracingStub::CloudBuildTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -391,18 +392,14 @@ future CloudBuildTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudBuildTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudbuild_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_stub.h b/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_stub.h index f666b99db0bc6..bad0fed4df4d9 100644 --- a/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_stub.h +++ b/google/cloud/cloudbuild/v1/internal/cloud_build_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudbuild_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudBuildTracingStub : public CloudBuildStub { public: ~CloudBuildTracingStub() override = default; @@ -204,8 +205,6 @@ class CloudBuildTracingStub : public CloudBuildStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -220,4 +219,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_V1_INTERNAL_CLOUD_BUILD_TRACING_STUB_H diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_auth_decorator.cc b/google/cloud/cloudbuild/v2/internal/repository_manager_auth_decorator.cc index 9e138c0b78e32..00efdbbc19af0 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_auth_decorator.cc +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/devtools/cloudbuild/v2/repositories.proto #include "google/cloud/cloudbuild/v2/internal/repository_manager_auth_decorator.h" -#include +#include "google/devtools/cloudbuild/v2/repositories.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudbuild_v2_internal { @@ -362,3 +365,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudbuild_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_auth_decorator.h b/google/cloud/cloudbuild/v2/internal/repository_manager_auth_decorator.h index 6e6c9f24314cc..fcbdd395c3e22 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_auth_decorator.h +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/cloudbuild/v2/internal/repository_manager_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 cloudbuild_v2_internal { @@ -197,4 +200,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_V2_INTERNAL_REPOSITORY_MANAGER_AUTH_DECORATOR_H diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_connection_impl.h b/google/cloud/cloudbuild/v2/internal/repository_manager_connection_impl.h index 5e52aa52ac165..a519b8b044698 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_connection_impl.h +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_logging_decorator.cc b/google/cloud/cloudbuild/v2/internal/repository_manager_logging_decorator.cc index 02145614dd495..508530de87c80 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_logging_decorator.cc +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/cloudbuild/v2/internal/repository_manager_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/devtools/cloudbuild/v2/repositories.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudbuild_v2_internal { @@ -430,3 +433,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudbuild_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_logging_decorator.h b/google/cloud/cloudbuild/v2/internal/repository_manager_logging_decorator.h index ebed4bf03e31c..f7c77122df790 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_logging_decorator.h +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/cloudbuild/v2/internal/repository_manager_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 cloudbuild_v2_internal { @@ -197,4 +200,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_V2_INTERNAL_REPOSITORY_MANAGER_LOGGING_DECORATOR_H diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_metadata_decorator.cc b/google/cloud/cloudbuild/v2/internal/repository_manager_metadata_decorator.cc index c41d0353f572d..589102ca78da3 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_metadata_decorator.cc +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/cloudbuild/v2/internal/repository_manager_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/devtools/cloudbuild/v2/repositories.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudbuild_v2_internal { @@ -337,3 +341,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudbuild_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_metadata_decorator.h b/google/cloud/cloudbuild/v2/internal/repository_manager_metadata_decorator.h index e5fc51ee14216..7b7347ca108db 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_metadata_decorator.h +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/cloudbuild/v2/internal/repository_manager_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 cloudbuild_v2_internal { @@ -203,4 +206,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_V2_INTERNAL_REPOSITORY_MANAGER_METADATA_DECORATOR_H diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_option_defaults.cc b/google/cloud/cloudbuild/v2/internal/repository_manager_option_defaults.cc index f7d18b8a3be0b..7633e8d235ed2 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_option_defaults.cc +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_option_defaults.cc @@ -42,7 +42,7 @@ Options RepositoryManagerDefaultOptions(Options options) { if (!options.has()) { options.set( cloudbuild_v2::RepositoryManagerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_stub.cc b/google/cloud/cloudbuild/v2/internal/repository_manager_stub.cc index 443fdc9416b0f..5f45b9c2ac93b 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_stub.cc +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/cloudbuild/v2/internal/repository_manager_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/devtools/cloudbuild/v2/repositories.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 cloudbuild_v2_internal { @@ -420,3 +423,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudbuild_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_stub.h b/google/cloud/cloudbuild/v2/internal/repository_manager_stub.h index 40ad0f305d4a2..5f55f3594cbb8 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_stub.h +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_stub.h @@ -24,13 +24,16 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/devtools/cloudbuild/v2/cloudbuild.pb.h" +#include "google/devtools/cloudbuild/v2/repositories.grpc.pb.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 cloudbuild_v2_internal { @@ -373,4 +376,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_V2_INTERNAL_REPOSITORY_MANAGER_STUB_H diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_stub_factory.cc b/google/cloud/cloudbuild/v2/internal/repository_manager_stub_factory.cc index 22e79cb252be1..adf8a0f51c1d0 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_stub_factory.cc +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_stub_factory.cc @@ -28,12 +28,15 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include +#include "google/devtools/cloudbuild/v2/repositories.grpc.pb.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 cloudbuild_v2_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudbuild_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_stub_factory.h b/google/cloud/cloudbuild/v2/internal/repository_manager_stub_factory.h index 290c54b36c9a5..725d75db58df8 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_stub_factory.h +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudbuild_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_V2_INTERNAL_REPOSITORY_MANAGER_STUB_FACTORY_H diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_connection.cc b/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_connection.cc index 8baa92ccfb81b..40c3889f92d5f 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_connection.cc +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace cloudbuild_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RepositoryManagerTracingConnection::RepositoryManagerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -345,17 +343,13 @@ Status RepositoryManagerTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRepositoryManagerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_connection.h b/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_connection.h index 30ce486e4f321..615b82f55ad67 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_connection.h +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace cloudbuild_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RepositoryManagerTracingConnection : public cloudbuild_v2::RepositoryManagerConnection { public: @@ -174,8 +172,6 @@ class RepositoryManagerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_stub.cc b/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_stub.cc index 0c659197212db..7aedbc6f30d1b 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_stub.cc +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudbuild_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RepositoryManagerTracingStub::RepositoryManagerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -384,18 +385,14 @@ future RepositoryManagerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRepositoryManagerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudbuild_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_stub.h b/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_stub.h index 4d59563cee158..cf25c49958d24 100644 --- a/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_stub.h +++ b/google/cloud/cloudbuild/v2/internal/repository_manager_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudbuild_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RepositoryManagerTracingStub : public RepositoryManagerStub { public: ~RepositoryManagerTracingStub() override = default; @@ -193,8 +194,6 @@ class RepositoryManagerTracingStub : public RepositoryManagerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -209,4 +208,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDBUILD_V2_INTERNAL_REPOSITORY_MANAGER_TRACING_STUB_H diff --git a/google/cloud/cloudbuild/v2/repository_manager_client.h b/google/cloud/cloudbuild/v2/repository_manager_client.h index 7f1258dd24de4..2b1436fc0735e 100644 --- a/google/cloud/cloudbuild/v2/repository_manager_client.h +++ b/google/cloud/cloudbuild/v2/repository_manager_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/cloudbuild/v2/repository_manager_connection.h b/google/cloud/cloudbuild/v2/repository_manager_connection.h index e5ad0d319a22f..2df6d6c23b599 100644 --- a/google/cloud/cloudbuild/v2/repository_manager_connection.h +++ b/google/cloud/cloudbuild/v2/repository_manager_connection.h @@ -30,9 +30,9 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/devtools/cloudbuild/v2/cloudbuild.pb.h" +#include "google/devtools/cloudbuild/v2/repositories.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/cloudbuild/v2/repository_manager_connection_idempotency_policy.h b/google/cloud/cloudbuild/v2/repository_manager_connection_idempotency_policy.h index 5a49d8264f8be..351405a52bee7 100644 --- a/google/cloud/cloudbuild/v2/repository_manager_connection_idempotency_policy.h +++ b/google/cloud/cloudbuild/v2/repository_manager_connection_idempotency_policy.h @@ -21,9 +21,9 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/devtools/cloudbuild/v2/repositories.grpc.pb.h" +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/cloudcontrolspartner/BUILD.bazel b/google/cloud/cloudcontrolspartner/BUILD.bazel index 0471dc9d7e7d9..6a020af37eb0d 100644 --- a/google/cloud/cloudcontrolspartner/BUILD.bazel +++ b/google/cloud/cloudcontrolspartner/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/cloudcontrolspartner/v1:cloudcontrolspartner_cc_grpc", + "@googleapis//google/cloud/cloudcontrolspartner/v1:cloudcontrolspartner_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/cloudcontrolspartner/quickstart/.bazelrc b/google/cloud/cloudcontrolspartner/quickstart/.bazelrc index 15d5c055db074..343e7f623d628 100644 --- a/google/cloud/cloudcontrolspartner/quickstart/.bazelrc +++ b/google/cloud/cloudcontrolspartner/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/cloudcontrolspartner/quickstart/CMakeLists.txt index 24b0740ed62d6..2ad4e2b8d9682 100644 --- a/google/cloud/cloudcontrolspartner/quickstart/CMakeLists.txt +++ b/google/cloud/cloudcontrolspartner/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Controls Partner API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-cloudcontrolspartner-quickstart CXX) find_package(google_cloud_cpp_cloudcontrolspartner REQUIRED) diff --git a/google/cloud/cloudcontrolspartner/quickstart/WORKSPACE.bazel b/google/cloud/cloudcontrolspartner/quickstart/WORKSPACE.bazel index 17dded45b178d..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 = "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/cloudcontrolspartner/v1/cloud_controls_partner_core_connection.h b/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_core_connection.h index 91640272acde1..a0842ad5bb7a9 100644 --- a/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_core_connection.h +++ b/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_core_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_CLOUD_CONTROLS_PARTNER_CORE_CONNECTION_H #include "google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_core_connection_idempotency_policy.h" +#include "google/cloud/cloudcontrolspartner/v1/core.pb.h" #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_core_connection_idempotency_policy.h b/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_core_connection_idempotency_policy.h index 4af283a696ccf..6903111c20944 100644 --- a/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_core_connection_idempotency_policy.h +++ b/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_core_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_CLOUD_CONTROLS_PARTNER_CORE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_CLOUD_CONTROLS_PARTNER_CORE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/cloudcontrolspartner/v1/core.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_monitoring_connection.h b/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_monitoring_connection.h index 1189f591d077c..3c2a362bf8201 100644 --- a/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_monitoring_connection.h +++ b/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_monitoring_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_monitoring_connection_idempotency_policy.h" #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_retry_traits.h" +#include "google/cloud/cloudcontrolspartner/v1/monitoring.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 #include namespace google { diff --git a/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_monitoring_connection_idempotency_policy.h b/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_monitoring_connection_idempotency_policy.h index 2779ee4069c37..165b3969e6f49 100644 --- a/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_monitoring_connection_idempotency_policy.h +++ b/google/cloud/cloudcontrolspartner/v1/cloud_controls_partner_monitoring_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_CLOUD_CONTROLS_PARTNER_MONITORING_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_CLOUD_CONTROLS_PARTNER_MONITORING_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/cloudcontrolspartner/v1/monitoring.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_auth_decorator.cc b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_auth_decorator.cc index cb2e4b5a7a60e..9b827a95ae6ed 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_auth_decorator.cc +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/cloudcontrolspartner/v1/core.proto #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_auth_decorator.h" -#include +#include "google/cloud/cloudcontrolspartner/v1/core.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -144,3 +147,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudcontrolspartner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_auth_decorator.h b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_auth_decorator.h index 7e2fa38302a29..881a75217a987 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_auth_decorator.h +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_CORE_AUTH_DECORATOR_H diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_logging_decorator.cc b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_logging_decorator.cc index c8146d10cdd73..6fd8e93afff06 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_logging_decorator.cc +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/cloudcontrolspartner/v1/core.proto #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_logging_decorator.h" +#include "google/cloud/cloudcontrolspartner/v1/core.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -197,3 +200,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudcontrolspartner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_logging_decorator.h b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_logging_decorator.h index b06d356d45234..32fece7a8052e 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_logging_decorator.h +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_CORE_LOGGING_DECORATOR_H diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_metadata_decorator.cc b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_metadata_decorator.cc index 7a9866acd5add..5ca3ce29a3d75 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_metadata_decorator.cc +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/cloudcontrolspartner/v1/core.proto #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_metadata_decorator.h" +#include "google/cloud/cloudcontrolspartner/v1/core.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 cloudcontrolspartner_v1_internal { @@ -171,3 +175,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudcontrolspartner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_metadata_decorator.h b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_metadata_decorator.h index 1cb5f3382e1cd..d800e72adac47 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_metadata_decorator.h +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -115,4 +118,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_CORE_METADATA_DECORATOR_H diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_option_defaults.cc b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_option_defaults.cc index f1584af6ac231..790d224e56391 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_option_defaults.cc +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_option_defaults.cc @@ -45,7 +45,7 @@ Options CloudControlsPartnerCoreDefaultOptions(Options options) { options.set< cloudcontrolspartner_v1::CloudControlsPartnerCoreRetryPolicyOption>( cloudcontrolspartner_v1::CloudControlsPartnerCoreLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -178,3 +181,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudcontrolspartner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_stub.h b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_stub.h index fea018eeb0bf7..2f2208da62296 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_stub.h +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_CORE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_CORE_STUB_H +#include "google/cloud/cloudcontrolspartner/v1/core.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -181,4 +184,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_CORE_STUB_H diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_stub_factory.cc b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_stub_factory.cc index a7769c2443774..d3c6b1ad31420 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_stub_factory.cc +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/cloudcontrolspartner/v1/core.proto #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_stub_factory.h" +#include "google/cloud/cloudcontrolspartner/v1/core.grpc.pb.h" #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_auth_decorator.h" #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_logging_decorator.h" #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudcontrolspartner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_stub_factory.h b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_stub_factory.h index 6b7235e788bbb..ed830aba5a24e 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_stub_factory.h +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_CORE_STUB_FACTORY_H diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_connection.cc b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_connection.cc index 3ca1c06f34c82..5c28d0841bbb6 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_connection.cc +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace cloudcontrolspartner_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudControlsPartnerCoreTracingConnection:: CloudControlsPartnerCoreTracingConnection( std::shared_ptr< @@ -162,18 +160,14 @@ Status CloudControlsPartnerCoreTracingConnection::DeleteCustomer( return internal::EndSpan(*span, child_->DeleteCustomer(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudControlsPartnerCoreTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_connection.h b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_connection.h index 73a380a83b226..e6e39ab34e386 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_connection.h +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace cloudcontrolspartner_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudControlsPartnerCoreTracingConnection : public cloudcontrolspartner_v1::CloudControlsPartnerCoreConnection { public: @@ -94,8 +92,6 @@ class CloudControlsPartnerCoreTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_stub.cc b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_stub.cc index 20ec1742f85af..c3d058793f0ba 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_stub.cc +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudControlsPartnerCoreTracingStub::CloudControlsPartnerCoreTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -186,19 +187,15 @@ Status CloudControlsPartnerCoreTracingStub::DeleteCustomer( child_->DeleteCustomer(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudControlsPartnerCoreTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudcontrolspartner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_stub.h b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_stub.h index 21623dfd3d980..20a0ea5885a56 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_stub.h +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_core_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudControlsPartnerCoreTracingStub : public CloudControlsPartnerCoreStub { public: @@ -107,8 +108,6 @@ class CloudControlsPartnerCoreTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -124,4 +123,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_CORE_TRACING_STUB_H diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_auth_decorator.cc b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_auth_decorator.cc index 5fd5020ad7873..edeeedac2e7d2 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_auth_decorator.cc +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/cloudcontrolspartner/v1/monitoring.proto #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_auth_decorator.h" -#include +#include "google/cloud/cloudcontrolspartner/v1/monitoring.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -55,3 +58,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudcontrolspartner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_auth_decorator.h b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_auth_decorator.h index 9298293652631..bd2050474e464 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_auth_decorator.h +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -60,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_MONITORING_AUTH_DECORATOR_H diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_logging_decorator.cc b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_logging_decorator.cc index 72241c42dbb8d..c96e3cd7765d0 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_logging_decorator.cc +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/cloudcontrolspartner/v1/monitoring.proto #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_logging_decorator.h" +#include "google/cloud/cloudcontrolspartner/v1/monitoring.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudcontrolspartner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_logging_decorator.h b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_logging_decorator.h index 03333779aedb3..9e8206b598cdd 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_logging_decorator.h +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -60,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_MONITORING_LOGGING_DECORATOR_H diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_metadata_decorator.cc b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_metadata_decorator.cc index 3aae0753c892c..89c818ea7d1a1 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_metadata_decorator.cc +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/cloudcontrolspartner/v1/monitoring.proto #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_metadata_decorator.h" +#include "google/cloud/cloudcontrolspartner/v1/monitoring.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 cloudcontrolspartner_v1_internal { @@ -81,3 +85,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudcontrolspartner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_metadata_decorator.h b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_metadata_decorator.h index 62c20a5f9228a..311847c880623 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_metadata_decorator.h +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -66,4 +69,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_MONITORING_METADATA_DECORATOR_H diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_option_defaults.cc b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_option_defaults.cc index dd1d8d2e8d397..95f41dc8714bf 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_option_defaults.cc +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_option_defaults.cc @@ -46,7 +46,7 @@ Options CloudControlsPartnerMonitoringDefaultOptions(Options options) { CloudControlsPartnerMonitoringRetryPolicyOption>( cloudcontrolspartner_v1:: CloudControlsPartnerMonitoringLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -61,3 +64,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudcontrolspartner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_stub.h b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_stub.h index e1020dee7b163..d2953a12a6d7a 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_stub.h +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_MONITORING_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_MONITORING_STUB_H +#include "google/cloud/cloudcontrolspartner/v1/monitoring.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -80,4 +83,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_MONITORING_STUB_H diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_stub_factory.cc b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_stub_factory.cc index 7f5e7d4dc1b08..cbf8070584488 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_stub_factory.cc +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_metadata_decorator.h" #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_stub.h" #include "google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_stub.h" +#include "google/cloud/cloudcontrolspartner/v1/monitoring.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudcontrolspartner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_stub_factory.h b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_stub_factory.h index 5623fd8ddd8f6..8c47395f1e6f8 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_stub_factory.h +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_MONITORING_STUB_FACTORY_H diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_connection.cc b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_connection.cc index 64c1eb6fd7c6a..bdb57665b79a4 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_connection.cc +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace cloudcontrolspartner_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudControlsPartnerMonitoringTracingConnection:: CloudControlsPartnerMonitoringTracingConnection( std::shared_ptr< @@ -60,20 +58,16 @@ CloudControlsPartnerMonitoringTracingConnection::GetViolation( return internal::EndSpan(*span, child_->GetViolation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< cloudcontrolspartner_v1::CloudControlsPartnerMonitoringConnection> MakeCloudControlsPartnerMonitoringTracingConnection( std::shared_ptr< cloudcontrolspartner_v1::CloudControlsPartnerMonitoringConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_connection.h b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_connection.h index 74459492a29a8..c5caecc2262ad 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_connection.h +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace cloudcontrolspartner_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudControlsPartnerMonitoringTracingConnection : public cloudcontrolspartner_v1::CloudControlsPartnerMonitoringConnection { public: @@ -56,8 +54,6 @@ class CloudControlsPartnerMonitoringTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_stub.cc b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_stub.cc index 5aa5eb9ea3911..367c73d5a13df 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_stub.cc +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudControlsPartnerMonitoringTracingStub:: CloudControlsPartnerMonitoringTracingStub( std::shared_ptr child) @@ -61,20 +62,16 @@ CloudControlsPartnerMonitoringTracingStub::GetViolation( child_->GetViolation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudControlsPartnerMonitoringTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudcontrolspartner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_stub.h b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_stub.h index 5b49beaa4b5bb..2cf6eeecbfd57 100644 --- a/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_stub.h +++ b/google/cloud/cloudcontrolspartner/v1/internal/cloud_controls_partner_monitoring_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudcontrolspartner_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudControlsPartnerMonitoringTracingStub : public CloudControlsPartnerMonitoringStub { public: @@ -57,8 +58,6 @@ class CloudControlsPartnerMonitoringTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -74,4 +73,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDCONTROLSPARTNER_V1_INTERNAL_CLOUD_CONTROLS_PARTNER_MONITORING_TRACING_STUB_H diff --git a/google/cloud/cloudquotas/BUILD.bazel b/google/cloud/cloudquotas/BUILD.bazel index 7929be1bd3354..c5960f7fe9a56 100644 --- a/google/cloud/cloudquotas/BUILD.bazel +++ b/google/cloud/cloudquotas/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/api/cloudquotas/v1:cloudquotas_cc_grpc", + "@googleapis//google/api/cloudquotas/v1:cloudquotas_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/cloudquotas/CMakeLists.txt b/google/cloud/cloudquotas/CMakeLists.txt index d80fe662aff6d..95de9c1540d16 100644 --- a/google/cloud/cloudquotas/CMakeLists.txt +++ b/google/cloud/cloudquotas/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(cloudquotas "Cloud Quotas API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(cloudquotas_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/cloudquotas/quickstart/.bazelrc b/google/cloud/cloudquotas/quickstart/.bazelrc index 15d5c055db074..343e7f623d628 100644 --- a/google/cloud/cloudquotas/quickstart/.bazelrc +++ b/google/cloud/cloudquotas/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/cloudquotas/quickstart/CMakeLists.txt index 3b1aa9a07fb31..830fb3b016bc5 100644 --- a/google/cloud/cloudquotas/quickstart/CMakeLists.txt +++ b/google/cloud/cloudquotas/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Quotas API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-cloudquotas-quickstart CXX) find_package(google_cloud_cpp_cloudquotas REQUIRED) diff --git a/google/cloud/cloudquotas/quickstart/WORKSPACE.bazel b/google/cloud/cloudquotas/quickstart/WORKSPACE.bazel index a8ef827d0e759..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 = "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/cloudquotas/v1/cloud_quotas_connection.h b/google/cloud/cloudquotas/v1/cloud_quotas_connection.h index 917d43bd1c271..efaf3c13b7cf9 100644 --- a/google/cloud/cloudquotas/v1/cloud_quotas_connection.h +++ b/google/cloud/cloudquotas/v1/cloud_quotas_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/api/cloudquotas/v1/cloudquotas.pb.h" #include namespace google { diff --git a/google/cloud/cloudquotas/v1/cloud_quotas_connection_idempotency_policy.h b/google/cloud/cloudquotas/v1/cloud_quotas_connection_idempotency_policy.h index 95dd038997a5e..a4960d69bffd4 100644 --- a/google/cloud/cloudquotas/v1/cloud_quotas_connection_idempotency_policy.h +++ b/google/cloud/cloudquotas/v1/cloud_quotas_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/api/cloudquotas/v1/cloudquotas.grpc.pb.h" #include namespace google { diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_auth_decorator.cc b/google/cloud/cloudquotas/v1/internal/cloud_quotas_auth_decorator.cc index c1519f89e0f5e..12c7f8c71f48d 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_auth_decorator.cc +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/api/cloudquotas/v1/cloudquotas.proto #include "google/cloud/cloudquotas/v1/internal/cloud_quotas_auth_decorator.h" -#include +#include "google/api/cloudquotas/v1/cloudquotas.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudquotas_v1_internal { @@ -88,3 +91,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudquotas_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_auth_decorator.h b/google/cloud/cloudquotas/v1/internal/cloud_quotas_auth_decorator.h index 41cac82933268..6eb9e264a4d5f 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_auth_decorator.h +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudquotas_v1_internal { @@ -79,4 +82,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDQUOTAS_V1_INTERNAL_CLOUD_QUOTAS_AUTH_DECORATOR_H diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_logging_decorator.cc b/google/cloud/cloudquotas/v1/internal/cloud_quotas_logging_decorator.cc index 7c5f62a0ae59f..913dd7ef0e260 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_logging_decorator.cc +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/cloudquotas/v1/internal/cloud_quotas_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/api/cloudquotas/v1/cloudquotas.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudquotas_v1_internal { @@ -116,3 +119,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudquotas_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_logging_decorator.h b/google/cloud/cloudquotas/v1/internal/cloud_quotas_logging_decorator.h index 9efc5cf31e215..b148071fae44d 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_logging_decorator.h +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudquotas_v1_internal { @@ -79,4 +82,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDQUOTAS_V1_INTERNAL_CLOUD_QUOTAS_LOGGING_DECORATOR_H diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_metadata_decorator.cc b/google/cloud/cloudquotas/v1/internal/cloud_quotas_metadata_decorator.cc index 7919f263cb7a6..2b8691f27d8d2 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_metadata_decorator.cc +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/cloudquotas/v1/internal/cloud_quotas_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/api/cloudquotas/v1/cloudquotas.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudquotas_v1_internal { @@ -117,3 +121,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudquotas_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_metadata_decorator.h b/google/cloud/cloudquotas/v1/internal/cloud_quotas_metadata_decorator.h index c93f58dfb9701..efea75d7d5a61 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_metadata_decorator.h +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudquotas_v1_internal { @@ -84,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDQUOTAS_V1_INTERNAL_CLOUD_QUOTAS_METADATA_DECORATOR_H diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_option_defaults.cc b/google/cloud/cloudquotas/v1/internal/cloud_quotas_option_defaults.cc index f5fa43eb2f075..141661fe14420 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_option_defaults.cc +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_option_defaults.cc @@ -41,7 +41,7 @@ Options CloudQuotasDefaultOptions(Options options) { if (!options.has()) { options.set( cloudquotas_v1::CloudQuotasLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub.cc b/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub.cc index b104fa391eac8..576ec92ba8b65 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub.cc +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/cloudquotas/v1/internal/cloud_quotas_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/api/cloudquotas/v1/cloudquotas.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudquotas_v1_internal { @@ -106,3 +109,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudquotas_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub.h b/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub.h index 4abf7e9fbfc3c..e571d8bc2f1ec 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub.h +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/api/cloudquotas/v1/cloudquotas.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudquotas_v1_internal { @@ -117,4 +120,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDQUOTAS_V1_INTERNAL_CLOUD_QUOTAS_STUB_H diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub_factory.cc b/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub_factory.cc index 422ee6ec9421a..68af3777c3662 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub_factory.cc +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/api/cloudquotas/v1/cloudquotas.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudquotas_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudquotas_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub_factory.h b/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub_factory.h index 26fccec5bceec..f47f208ef02ef 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub_factory.h +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudquotas_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDQUOTAS_V1_INTERNAL_CLOUD_QUOTAS_STUB_FACTORY_H diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_connection.cc b/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_connection.cc index eda0ac4a1374b..eaf1cb269aee0 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_connection.cc +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace cloudquotas_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudQuotasTracingConnection::CloudQuotasTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -92,16 +90,12 @@ CloudQuotasTracingConnection::UpdateQuotaPreference( return internal::EndSpan(*span, child_->UpdateQuotaPreference(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudQuotasTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_connection.h b/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_connection.h index 7ea809272ef85..7e08fd89ede5e 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_connection.h +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace cloudquotas_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudQuotasTracingConnection : public cloudquotas_v1::CloudQuotasConnection { public: @@ -67,8 +65,6 @@ class CloudQuotasTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_stub.cc b/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_stub.cc index e54613bdd9431..00f48fc22be00 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_stub.cc +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudquotas_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudQuotasTracingStub::CloudQuotasTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -104,18 +105,14 @@ CloudQuotasTracingStub::UpdateQuotaPreference( context, *span, child_->UpdateQuotaPreference(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudQuotasTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudquotas_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_stub.h b/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_stub.h index f401ea10b2c7e..c0c34afb022e6 100644 --- a/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_stub.h +++ b/google/cloud/cloudquotas/v1/internal/cloud_quotas_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudquotas_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudQuotasTracingStub : public CloudQuotasStub { public: ~CloudQuotasTracingStub() override = default; @@ -75,8 +76,6 @@ class CloudQuotasTracingStub : public CloudQuotasStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -91,4 +90,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDQUOTAS_V1_INTERNAL_CLOUD_QUOTAS_TRACING_STUB_H diff --git a/google/cloud/cloudsecuritycompliance/BUILD.bazel b/google/cloud/cloudsecuritycompliance/BUILD.bazel index b28ec4f51d6ce..7941ef2a97956 100644 --- a/google/cloud/cloudsecuritycompliance/BUILD.bazel +++ b/google/cloud/cloudsecuritycompliance/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/cloudsecuritycompliance/v1:cloudsecuritycompliance_cc_grpc", + "@googleapis//google/cloud/cloudsecuritycompliance/v1:cloudsecuritycompliance_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/cloudsecuritycompliance/quickstart/CMakeLists.txt b/google/cloud/cloudsecuritycompliance/quickstart/CMakeLists.txt index fb5a2b6f561e0..596ac7dc6adc6 100644 --- a/google/cloud/cloudsecuritycompliance/quickstart/CMakeLists.txt +++ b/google/cloud/cloudsecuritycompliance/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Security Compliance API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-cloudsecuritycompliance-quickstart CXX) find_package(google_cloud_cpp_cloudsecuritycompliance REQUIRED) diff --git a/google/cloud/cloudsecuritycompliance/quickstart/WORKSPACE.bazel b/google/cloud/cloudsecuritycompliance/quickstart/WORKSPACE.bazel index 4b79397e6626c..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 = "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/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/config_connection.h b/google/cloud/cloudsecuritycompliance/v1/config_connection.h index f022b6c558367..a32f579853584 100644 --- a/google/cloud/cloudsecuritycompliance/v1/config_connection.h +++ b/google/cloud/cloudsecuritycompliance/v1/config_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_CONFIG_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_CONFIG_CONNECTION_H +#include "google/cloud/cloudsecuritycompliance/v1/config.pb.h" #include "google/cloud/cloudsecuritycompliance/v1/config_connection_idempotency_policy.h" #include "google/cloud/cloudsecuritycompliance/v1/internal/config_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/cloudsecuritycompliance/v1/config_connection_idempotency_policy.h b/google/cloud/cloudsecuritycompliance/v1/config_connection_idempotency_policy.h index b4a9e65df5ea3..92fa468039262 100644 --- a/google/cloud/cloudsecuritycompliance/v1/config_connection_idempotency_policy.h +++ b/google/cloud/cloudsecuritycompliance/v1/config_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_CONFIG_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_CONFIG_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/cloudsecuritycompliance/v1/config.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/cloudsecuritycompliance/v1/deployment_client.h b/google/cloud/cloudsecuritycompliance/v1/deployment_client.h index c1c31ef98dd49..68c32c938d0dc 100644 --- a/google/cloud/cloudsecuritycompliance/v1/deployment_client.h +++ b/google/cloud/cloudsecuritycompliance/v1/deployment_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/cloudsecuritycompliance/v1/deployment_connection.h b/google/cloud/cloudsecuritycompliance/v1/deployment_connection.h index 21eff2cbd974a..71f94e4837bfc 100644 --- a/google/cloud/cloudsecuritycompliance/v1/deployment_connection.h +++ b/google/cloud/cloudsecuritycompliance/v1/deployment_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_DEPLOYMENT_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_DEPLOYMENT_CONNECTION_H +#include "google/cloud/cloudsecuritycompliance/v1/deployment.pb.h" #include "google/cloud/cloudsecuritycompliance/v1/deployment_connection_idempotency_policy.h" #include "google/cloud/cloudsecuritycompliance/v1/internal/deployment_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/cloudsecuritycompliance/v1/deployment_connection_idempotency_policy.h b/google/cloud/cloudsecuritycompliance/v1/deployment_connection_idempotency_policy.h index 7244ee72d7051..cd588d672dc0d 100644 --- a/google/cloud/cloudsecuritycompliance/v1/deployment_connection_idempotency_policy.h +++ b/google/cloud/cloudsecuritycompliance/v1/deployment_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_DEPLOYMENT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_DEPLOYMENT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/cloudsecuritycompliance/v1/deployment.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_auth_decorator.cc b/google/cloud/cloudsecuritycompliance/v1/internal/config_auth_decorator.cc index 98a7284432885..88abc6338fcd0 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_auth_decorator.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/cloudsecuritycompliance/v1/config.proto #include "google/cloud/cloudsecuritycompliance/v1/internal/config_auth_decorator.h" -#include +#include "google/cloud/cloudsecuritycompliance/v1/config.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -183,3 +186,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudsecuritycompliance_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_auth_decorator.h b/google/cloud/cloudsecuritycompliance/v1/internal/config_auth_decorator.h index 94271389027e2..4ae7a6fd0b384 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_auth_decorator.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -127,4 +130,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_CONFIG_AUTH_DECORATOR_H diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_logging_decorator.cc b/google/cloud/cloudsecuritycompliance/v1/internal/config_logging_decorator.cc index 6849f22f61f79..6d39669ccbc58 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_logging_decorator.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/cloudsecuritycompliance/v1/config.proto #include "google/cloud/cloudsecuritycompliance/v1/internal/config_logging_decorator.h" +#include "google/cloud/cloudsecuritycompliance/v1/config.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -246,3 +249,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudsecuritycompliance_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_logging_decorator.h b/google/cloud/cloudsecuritycompliance/v1/internal/config_logging_decorator.h index e2d4b1b6810c9..f25adbe7050de 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_logging_decorator.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -127,4 +130,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_CONFIG_LOGGING_DECORATOR_H diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_metadata_decorator.cc b/google/cloud/cloudsecuritycompliance/v1/internal/config_metadata_decorator.cc index e81e290d578ff..1433d42f2b7b0 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_metadata_decorator.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/cloudsecuritycompliance/v1/config.proto #include "google/cloud/cloudsecuritycompliance/v1/internal/config_metadata_decorator.h" +#include "google/cloud/cloudsecuritycompliance/v1/config.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 cloudsecuritycompliance_v1_internal { @@ -212,3 +216,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudsecuritycompliance_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_metadata_decorator.h b/google/cloud/cloudsecuritycompliance/v1/internal/config_metadata_decorator.h index 377fa220b19d7..5390a7fd96aae 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_metadata_decorator.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -132,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_CONFIG_METADATA_DECORATOR_H diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_option_defaults.cc b/google/cloud/cloudsecuritycompliance/v1/internal/config_option_defaults.cc index deac9cf3e3a21..261472fa914e4 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_option_defaults.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_option_defaults.cc @@ -42,7 +42,7 @@ Options ConfigDefaultOptions(Options options) { if (!options.has()) { options.set( cloudsecuritycompliance_v1::ConfigLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_stub.cc b/google/cloud/cloudsecuritycompliance/v1/internal/config_stub.cc index f73ef34de1e36..a28a3736bed07 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_stub.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/cloudsecuritycompliance/v1/config.proto #include "google/cloud/cloudsecuritycompliance/v1/internal/config_stub.h" +#include "google/cloud/cloudsecuritycompliance/v1/config.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -231,3 +234,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudsecuritycompliance_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_stub.h b/google/cloud/cloudsecuritycompliance/v1/internal/config_stub.h index 1307478c4d341..95da7771f34a7 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_stub.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_CONFIG_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_CONFIG_STUB_H +#include "google/cloud/cloudsecuritycompliance/v1/config.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -228,4 +231,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_CONFIG_STUB_H diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_stub_factory.cc b/google/cloud/cloudsecuritycompliance/v1/internal/config_stub_factory.cc index 5c513355b7010..69da477d228a7 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_stub_factory.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/cloudsecuritycompliance/v1/config.proto #include "google/cloud/cloudsecuritycompliance/v1/internal/config_stub_factory.h" +#include "google/cloud/cloudsecuritycompliance/v1/config.grpc.pb.h" #include "google/cloud/cloudsecuritycompliance/v1/internal/config_auth_decorator.h" #include "google/cloud/cloudsecuritycompliance/v1/internal/config_logging_decorator.h" #include "google/cloud/cloudsecuritycompliance/v1/internal/config_metadata_decorator.h" #include "google/cloud/cloudsecuritycompliance/v1/internal/config_stub.h" #include "google/cloud/cloudsecuritycompliance/v1/internal/config_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudsecuritycompliance_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_stub_factory.h b/google/cloud/cloudsecuritycompliance/v1/internal/config_stub_factory.h index 7f818f74ad38b..2276228357928 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_stub_factory.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_CONFIG_STUB_FACTORY_H diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_connection.cc b/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_connection.cc index a8e43b8a54d5c..7d34da1fa9df4 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_connection.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace cloudsecuritycompliance_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConfigTracingConnection::ConfigTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -191,16 +189,12 @@ Status ConfigTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConfigTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_connection.h b/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_connection.h index 0e1e4476d0274..fb0c2adba5983 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_connection.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace cloudsecuritycompliance_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConfigTracingConnection : public cloudsecuritycompliance_v1::ConfigConnection { public: @@ -107,8 +105,6 @@ class ConfigTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_stub.cc b/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_stub.cc index eee6450de15ea..d83e9b2c00bb2 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_stub.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConfigTracingStub::ConfigTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -227,18 +228,14 @@ Status ConfigTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConfigTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudsecuritycompliance_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_stub.h b/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_stub.h index 7a5c7e63bdd3d..7e6e9bc7ee0f3 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_stub.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/config_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConfigTracingStub : public ConfigStub { public: ~ConfigTracingStub() override = default; @@ -123,8 +124,6 @@ class ConfigTracingStub : public ConfigStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -139,4 +138,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_CONFIG_TRACING_STUB_H diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_auth_decorator.cc b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_auth_decorator.cc index 8052c7c8622cf..c574ee5fa7570 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_auth_decorator.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/cloudsecuritycompliance/v1/deployment.proto #include "google/cloud/cloudsecuritycompliance/v1/internal/deployment_auth_decorator.h" -#include +#include "google/cloud/cloudsecuritycompliance/v1/deployment.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -225,3 +228,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudsecuritycompliance_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_auth_decorator.h b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_auth_decorator.h index ef3a51305777e..80e21aeaebc07 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_auth_decorator.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 cloudsecuritycompliance_v1_internal { @@ -137,4 +140,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_DEPLOYMENT_AUTH_DECORATOR_H diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_connection_impl.h b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_connection_impl.h index 546036f6432a8..1b88dea1c6df7 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_connection_impl.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_logging_decorator.cc b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_logging_decorator.cc index 6b123abd3da72..09ca14fd521b4 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_logging_decorator.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/cloudsecuritycompliance/v1/deployment.proto #include "google/cloud/cloudsecuritycompliance/v1/internal/deployment_logging_decorator.h" +#include "google/cloud/cloudsecuritycompliance/v1/deployment.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -268,3 +271,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudsecuritycompliance_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_logging_decorator.h b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_logging_decorator.h index b45f74f218c31..2a66763abb2e3 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_logging_decorator.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 cloudsecuritycompliance_v1_internal { @@ -137,4 +140,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_DEPLOYMENT_LOGGING_DECORATOR_H diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_metadata_decorator.cc b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_metadata_decorator.cc index e63f9893108c6..1adae9892c2c4 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_metadata_decorator.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/cloudsecuritycompliance/v1/deployment.proto #include "google/cloud/cloudsecuritycompliance/v1/internal/deployment_metadata_decorator.h" +#include "google/cloud/cloudsecuritycompliance/v1/deployment.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 cloudsecuritycompliance_v1_internal { @@ -222,3 +226,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudsecuritycompliance_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_metadata_decorator.h b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_metadata_decorator.h index 36cb3b8c9287a..e58f1bec24fd5 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_metadata_decorator.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 cloudsecuritycompliance_v1_internal { @@ -142,4 +145,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_DEPLOYMENT_METADATA_DECORATOR_H diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_option_defaults.cc b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_option_defaults.cc index 712e23ae7da3c..94ba05e81788a 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_option_defaults.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_option_defaults.cc @@ -42,7 +42,7 @@ Options DeploymentDefaultOptions(Options options) { if (!options.has()) { options.set( cloudsecuritycompliance_v1::DeploymentLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub.cc b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub.cc index 06db4eb09d964..b1b8d336f2170 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/cloudsecuritycompliance/v1/deployment.proto #include "google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub.h" +#include "google/cloud/cloudsecuritycompliance/v1/deployment.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -270,3 +273,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudsecuritycompliance_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub.h b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub.h index d9078cc571e05..d2d1e6253cbd4 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_DEPLOYMENT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_DEPLOYMENT_STUB_H +#include "google/cloud/cloudsecuritycompliance/v1/deployment.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -247,4 +250,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_DEPLOYMENT_STUB_H diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub_factory.cc b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub_factory.cc index 62a23594d5751..26f57bbe06815 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub_factory.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/cloudsecuritycompliance/v1/deployment.proto #include "google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub_factory.h" +#include "google/cloud/cloudsecuritycompliance/v1/deployment.grpc.pb.h" #include "google/cloud/cloudsecuritycompliance/v1/internal/deployment_auth_decorator.h" #include "google/cloud/cloudsecuritycompliance/v1/internal/deployment_logging_decorator.h" #include "google/cloud/cloudsecuritycompliance/v1/internal/deployment_metadata_decorator.h" #include "google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub.h" #include "google/cloud/cloudsecuritycompliance/v1/internal/deployment_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudsecuritycompliance_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub_factory.h b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub_factory.h index 5b32876f813c0..460c8a87eebaf 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub_factory.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_DEPLOYMENT_STUB_FACTORY_H diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_connection.cc b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_connection.cc index 5a1f123d62546..53f06497763cb 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_connection.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace cloudsecuritycompliance_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DeploymentTracingConnection::DeploymentTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -211,16 +209,12 @@ Status DeploymentTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDeploymentTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_connection.h b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_connection.h index 5d27fee5b3fbf..1792bc99685e7 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_connection.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace cloudsecuritycompliance_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DeploymentTracingConnection : public cloudsecuritycompliance_v1::DeploymentConnection { public: @@ -113,8 +111,6 @@ class DeploymentTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_stub.cc b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_stub.cc index 08a3d5fbc5b61..0692331588484 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_stub.cc +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DeploymentTracingStub::DeploymentTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -254,18 +255,14 @@ future DeploymentTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDeploymentTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloudsecuritycompliance_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_stub.h b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_stub.h index 2801c15b62a2d..5972adaa08a85 100644 --- a/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_stub.h +++ b/google/cloud/cloudsecuritycompliance/v1/internal/deployment_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace cloudsecuritycompliance_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DeploymentTracingStub : public DeploymentStub { public: ~DeploymentTracingStub() override = default; @@ -132,8 +133,6 @@ class DeploymentTracingStub : public DeploymentStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -148,4 +147,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CLOUDSECURITYCOMPLIANCE_V1_INTERNAL_DEPLOYMENT_TRACING_STUB_H diff --git a/google/cloud/commerce/BUILD.bazel b/google/cloud/commerce/BUILD.bazel index 3f6c419fd9dee..90e894cc5492b 100644 --- a/google/cloud/commerce/BUILD.bazel +++ b/google/cloud/commerce/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["consumer/procurement/v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/commerce/consumer/procurement/v1:procurement_cc_grpc", + "@googleapis//google/cloud/commerce/consumer/procurement/v1:procurement_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_client.h b/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_client.h index 69e5e3c2a77c5..fd7711d77fa8f 100644 --- a/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_client.h +++ b/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_client.h @@ -27,7 +27,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_connection.h b/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_connection.h index 7d44e9f282bea..9780ce3871a8f 100644 --- a/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_connection.h +++ b/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_connection.h @@ -22,6 +22,7 @@ #include "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_connection_idempotency_policy.h" #include "google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_retry_traits.h" +#include "google/cloud/commerce/consumer/procurement/v1/procurement_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -31,8 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_connection_idempotency_policy.h b/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_connection_idempotency_policy.h index 45a5553bb45cd..8a58ec4dfad26 100644 --- a/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_connection_idempotency_policy.h +++ b/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_connection_idempotency_policy.h @@ -20,10 +20,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMMERCE_CONSUMER_PROCUREMENT_V1_CONSUMER_PROCUREMENT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMMERCE_CONSUMER_PROCUREMENT_V1_CONSUMER_PROCUREMENT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/commerce/consumer/procurement/v1/procurement_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_auth_decorator.cc b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_auth_decorator.cc index f3bbcdd155d1a..ea03dc4d1fda8 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_auth_decorator.cc +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_auth_decorator.cc @@ -18,10 +18,13 @@ // google/cloud/commerce/consumer/procurement/v1/procurement_service.proto #include "google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_auth_decorator.h" -#include +#include "google/cloud/commerce/consumer/procurement/v1/procurement_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace commerce_consumer_procurement_v1_internal { @@ -194,3 +197,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace commerce_consumer_procurement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_auth_decorator.h b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_auth_decorator.h index 2cea83a32e97b..44f5526251d68 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_auth_decorator.h +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_auth_decorator.h @@ -23,11 +23,14 @@ #include "google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 commerce_consumer_procurement_v1_internal { @@ -113,4 +116,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMMERCE_CONSUMER_PROCUREMENT_V1_INTERNAL_CONSUMER_PROCUREMENT_AUTH_DECORATOR_H diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_connection_impl.h b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_connection_impl.h index f90aa44cde680..aa9761f35bfaa 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_connection_impl.h +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_connection_impl.h @@ -33,7 +33,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_logging_decorator.cc b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_logging_decorator.cc index f4112ba4f7e03..12de786591e9d 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_logging_decorator.cc +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_logging_decorator.cc @@ -18,14 +18,17 @@ // google/cloud/commerce/consumer/procurement/v1/procurement_service.proto #include "google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_logging_decorator.h" +#include "google/cloud/commerce/consumer/procurement/v1/procurement_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace commerce_consumer_procurement_v1_internal { @@ -217,3 +220,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace commerce_consumer_procurement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_logging_decorator.h b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_logging_decorator.h index fade59ebe8d23..b160fbca6ddde 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_logging_decorator.h +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_logging_decorator.h @@ -23,11 +23,14 @@ #include "google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 commerce_consumer_procurement_v1_internal { @@ -114,4 +117,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMMERCE_CONSUMER_PROCUREMENT_V1_INTERNAL_CONSUMER_PROCUREMENT_LOGGING_DECORATOR_H diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_metadata_decorator.cc b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_metadata_decorator.cc index f2ebe935ebbd5..14f856e60a745 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_metadata_decorator.cc +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_metadata_decorator.cc @@ -18,17 +18,21 @@ // google/cloud/commerce/consumer/procurement/v1/procurement_service.proto #include "google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_metadata_decorator.h" +#include "google/cloud/commerce/consumer/procurement/v1/procurement_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 commerce_consumer_procurement_v1_internal { @@ -183,3 +187,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace commerce_consumer_procurement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_metadata_decorator.h b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_metadata_decorator.h index b96fadbe17a51..668c094f88543 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_metadata_decorator.h +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_metadata_decorator.h @@ -23,11 +23,14 @@ #include "google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 commerce_consumer_procurement_v1_internal { @@ -120,4 +123,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMMERCE_CONSUMER_PROCUREMENT_V1_INTERNAL_CONSUMER_PROCUREMENT_METADATA_DECORATOR_H diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_option_defaults.cc b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_option_defaults.cc index 5f4d354b2d219..9c9ccdd3139c4 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_option_defaults.cc +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_option_defaults.cc @@ -47,7 +47,7 @@ Options ConsumerProcurementServiceDefaultOptions(Options options) { ConsumerProcurementServiceRetryPolicyOption>( commerce_consumer_procurement_v1:: ConsumerProcurementServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace commerce_consumer_procurement_v1_internal { @@ -213,3 +216,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace commerce_consumer_procurement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub.h b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub.h index 9fe9b058d6397..9844d3bf56b96 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub.h +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub.h @@ -20,16 +20,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMMERCE_CONSUMER_PROCUREMENT_V1_INTERNAL_CONSUMER_PROCUREMENT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMMERCE_CONSUMER_PROCUREMENT_V1_INTERNAL_CONSUMER_PROCUREMENT_STUB_H +#include "google/cloud/commerce/consumer/procurement/v1/procurement_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace commerce_consumer_procurement_v1_internal { @@ -192,4 +195,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMMERCE_CONSUMER_PROCUREMENT_V1_INTERNAL_CONSUMER_PROCUREMENT_STUB_H diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub_factory.cc b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub_factory.cc index 4d153314b72c2..1337c400a4a57 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub_factory.cc +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub_factory.cc @@ -23,17 +23,20 @@ #include "google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_metadata_decorator.h" #include "google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub.h" #include "google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_stub.h" +#include "google/cloud/commerce/consumer/procurement/v1/procurement_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace commerce_consumer_procurement_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace commerce_consumer_procurement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub_factory.h b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub_factory.h index 58011a048ef98..2c465a5940215 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub_factory.h +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_stub_factory.h @@ -26,6 +26,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace commerce_consumer_procurement_v1_internal { @@ -41,4 +44,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMMERCE_CONSUMER_PROCUREMENT_V1_INTERNAL_CONSUMER_PROCUREMENT_STUB_FACTORY_H diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_connection.cc b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_connection.cc index 49398380b8a2e..8afff2029f9e7 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_connection.cc +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace commerce_consumer_procurement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConsumerProcurementServiceTracingConnection:: ConsumerProcurementServiceTracingConnection( std::shared_ptrGetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< commerce_consumer_procurement_v1::ConsumerProcurementServiceConnection> MakeConsumerProcurementServiceTracingConnection( std::shared_ptr< commerce_consumer_procurement_v1::ConsumerProcurementServiceConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_connection.h b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_connection.h index 602e0f14fb302..076064fda4f1a 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_connection.h +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace commerce_consumer_procurement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConsumerProcurementServiceTracingConnection : public commerce_consumer_procurement_v1:: ConsumerProcurementServiceConnection { @@ -95,8 +93,6 @@ class ConsumerProcurementServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_stub.cc b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_stub.cc index a689dedf84605..917c166bbd782 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_stub.cc +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace commerce_consumer_procurement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConsumerProcurementServiceTracingStub::ConsumerProcurementServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -201,20 +202,16 @@ future ConsumerProcurementServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConsumerProcurementServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace commerce_consumer_procurement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_stub.h b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_stub.h index 18e3cf2a8744c..8fbb3d4eba596 100644 --- a/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_stub.h +++ b/google/cloud/commerce/consumer/procurement/v1/internal/consumer_procurement_tracing_stub.h @@ -26,13 +26,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace commerce_consumer_procurement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConsumerProcurementServiceTracingStub : public ConsumerProcurementServiceStub { public: @@ -110,8 +111,6 @@ class ConsumerProcurementServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -127,4 +126,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMMERCE_CONSUMER_PROCUREMENT_V1_INTERNAL_CONSUMER_PROCUREMENT_TRACING_STUB_H diff --git a/google/cloud/commerce/quickstart/.bazelrc b/google/cloud/commerce/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/commerce/quickstart/.bazelrc +++ b/google/cloud/commerce/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/commerce/quickstart/CMakeLists.txt index e9cb7c0280ce4..f94daef0c5337 100644 --- a/google/cloud/commerce/quickstart/CMakeLists.txt +++ b/google/cloud/commerce/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Commerce Consumer Procurement API C++ # client library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-commerce-quickstart CXX) find_package(google_cloud_cpp_commerce REQUIRED) diff --git a/google/cloud/commerce/quickstart/WORKSPACE.bazel b/google/cloud/commerce/quickstart/WORKSPACE.bazel index 8753c6abb6a04..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 = "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/completion_queue_test.cc b/google/cloud/completion_queue_test.cc index 62e5bcdaa3287..6348e00089f05 100644 --- a/google/cloud/completion_queue_test.cc +++ b/google/cloud/completion_queue_test.cc @@ -20,8 +20,8 @@ #include "google/cloud/testing_util/fake_completion_queue_impl.h" #include "google/cloud/testing_util/mock_async_response_reader.h" #include "google/cloud/testing_util/status_matchers.h" -#include -#include +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include #include #include diff --git a/google/cloud/composer/BUILD.bazel b/google/cloud/composer/BUILD.bazel index 3e4dab0ac399b..c55718ad0934c 100644 --- a/google/cloud/composer/BUILD.bazel +++ b/google/cloud/composer/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/orchestration/airflow/service/v1:service_cc_grpc", + "@googleapis//google/cloud/orchestration/airflow/service/v1:service_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/composer/CMakeLists.txt b/google/cloud/composer/CMakeLists.txt index 05a373cc88c5d..7c82919446123 100644 --- a/google/cloud/composer/CMakeLists.txt +++ b/google/cloud/composer/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(composer "Cloud Composer API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(composer_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/composer/environments_client.h b/google/cloud/composer/environments_client.h deleted file mode 100644 index f8b5505e24e85..0000000000000 --- a/google/cloud/composer/environments_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orchestration/airflow/service/v1/environments.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_ENVIRONMENTS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_ENVIRONMENTS_CLIENT_H - -#include "google/cloud/composer/environments_connection.h" -#include "google/cloud/composer/v1/environments_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in composer_v1 instead of the aliases defined in -/// this namespace. -namespace composer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use composer_v1::EnvironmentsClient directly. -using ::google::cloud::composer_v1::EnvironmentsClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace composer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_ENVIRONMENTS_CLIENT_H diff --git a/google/cloud/composer/environments_connection.h b/google/cloud/composer/environments_connection.h deleted file mode 100644 index c9183ed955800..0000000000000 --- a/google/cloud/composer/environments_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orchestration/airflow/service/v1/environments.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_ENVIRONMENTS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_ENVIRONMENTS_CONNECTION_H - -#include "google/cloud/composer/environments_connection_idempotency_policy.h" -#include "google/cloud/composer/v1/environments_connection.h" - -namespace google { -namespace cloud { -namespace composer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use composer_v1::MakeEnvironmentsConnection directly. -using ::google::cloud::composer_v1::MakeEnvironmentsConnection; - -/// @deprecated Use composer_v1::EnvironmentsConnection directly. -using ::google::cloud::composer_v1::EnvironmentsConnection; - -/// @deprecated Use composer_v1::EnvironmentsLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::composer_v1::EnvironmentsLimitedErrorCountRetryPolicy; - -/// @deprecated Use composer_v1::EnvironmentsLimitedTimeRetryPolicy directly. -using ::google::cloud::composer_v1::EnvironmentsLimitedTimeRetryPolicy; - -/// @deprecated Use composer_v1::EnvironmentsRetryPolicy directly. -using ::google::cloud::composer_v1::EnvironmentsRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace composer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_ENVIRONMENTS_CONNECTION_H diff --git a/google/cloud/composer/environments_connection_idempotency_policy.h b/google/cloud/composer/environments_connection_idempotency_policy.h deleted file mode 100644 index fa242f6dfc11a..0000000000000 --- a/google/cloud/composer/environments_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orchestration/airflow/service/v1/environments.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_ENVIRONMENTS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_ENVIRONMENTS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/composer/v1/environments_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace composer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// composer_v1::MakeDefaultEnvironmentsConnectionIdempotencyPolicy directly. -using ::google::cloud::composer_v1:: - MakeDefaultEnvironmentsConnectionIdempotencyPolicy; - -/// @deprecated Use composer_v1::EnvironmentsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::composer_v1::EnvironmentsConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace composer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_ENVIRONMENTS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/composer/environments_options.h b/google/cloud/composer/environments_options.h deleted file mode 100644 index 2e3b9ac49a6f8..0000000000000 --- a/google/cloud/composer/environments_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orchestration/airflow/service/v1/environments.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_ENVIRONMENTS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_ENVIRONMENTS_OPTIONS_H - -#include "google/cloud/composer/environments_connection.h" -#include "google/cloud/composer/environments_connection_idempotency_policy.h" -#include "google/cloud/composer/v1/environments_options.h" - -namespace google { -namespace cloud { -namespace composer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use composer_v1::EnvironmentsPollingPolicyOption directly. -using ::google::cloud::composer_v1::EnvironmentsPollingPolicyOption; - -/// @deprecated Use composer_v1::EnvironmentsBackoffPolicyOption directly. -using ::google::cloud::composer_v1::EnvironmentsBackoffPolicyOption; - -/// @deprecated Use composer_v1::EnvironmentsConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::composer_v1:: - EnvironmentsConnectionIdempotencyPolicyOption; - -/// @deprecated Use composer_v1::EnvironmentsPolicyOptionList directly. -using ::google::cloud::composer_v1::EnvironmentsPolicyOptionList; - -/// @deprecated Use composer_v1::EnvironmentsRetryPolicyOption directly. -using ::google::cloud::composer_v1::EnvironmentsRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace composer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_ENVIRONMENTS_OPTIONS_H diff --git a/google/cloud/composer/image_versions_client.h b/google/cloud/composer/image_versions_client.h deleted file mode 100644 index f3d03214ea0ab..0000000000000 --- a/google/cloud/composer/image_versions_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orchestration/airflow/service/v1/image_versions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_IMAGE_VERSIONS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_IMAGE_VERSIONS_CLIENT_H - -#include "google/cloud/composer/image_versions_connection.h" -#include "google/cloud/composer/v1/image_versions_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in composer_v1 instead of the aliases defined in -/// this namespace. -namespace composer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use composer_v1::ImageVersionsClient directly. -using ::google::cloud::composer_v1::ImageVersionsClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace composer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_IMAGE_VERSIONS_CLIENT_H diff --git a/google/cloud/composer/image_versions_connection.h b/google/cloud/composer/image_versions_connection.h deleted file mode 100644 index 843ad599a1473..0000000000000 --- a/google/cloud/composer/image_versions_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orchestration/airflow/service/v1/image_versions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_IMAGE_VERSIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_IMAGE_VERSIONS_CONNECTION_H - -#include "google/cloud/composer/image_versions_connection_idempotency_policy.h" -#include "google/cloud/composer/v1/image_versions_connection.h" - -namespace google { -namespace cloud { -namespace composer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use composer_v1::MakeImageVersionsConnection directly. -using ::google::cloud::composer_v1::MakeImageVersionsConnection; - -/// @deprecated Use composer_v1::ImageVersionsConnection directly. -using ::google::cloud::composer_v1::ImageVersionsConnection; - -/// @deprecated Use composer_v1::ImageVersionsLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::composer_v1::ImageVersionsLimitedErrorCountRetryPolicy; - -/// @deprecated Use composer_v1::ImageVersionsLimitedTimeRetryPolicy directly. -using ::google::cloud::composer_v1::ImageVersionsLimitedTimeRetryPolicy; - -/// @deprecated Use composer_v1::ImageVersionsRetryPolicy directly. -using ::google::cloud::composer_v1::ImageVersionsRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace composer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_IMAGE_VERSIONS_CONNECTION_H diff --git a/google/cloud/composer/image_versions_connection_idempotency_policy.h b/google/cloud/composer/image_versions_connection_idempotency_policy.h deleted file mode 100644 index 759574c080acb..0000000000000 --- a/google/cloud/composer/image_versions_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orchestration/airflow/service/v1/image_versions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_IMAGE_VERSIONS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_IMAGE_VERSIONS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/composer/v1/image_versions_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace composer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// composer_v1::MakeDefaultImageVersionsConnectionIdempotencyPolicy directly. -using ::google::cloud::composer_v1:: - MakeDefaultImageVersionsConnectionIdempotencyPolicy; - -/// @deprecated Use composer_v1::ImageVersionsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::composer_v1::ImageVersionsConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace composer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_IMAGE_VERSIONS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/composer/image_versions_options.h b/google/cloud/composer/image_versions_options.h deleted file mode 100644 index 5453676d3a01b..0000000000000 --- a/google/cloud/composer/image_versions_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orchestration/airflow/service/v1/image_versions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_IMAGE_VERSIONS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_IMAGE_VERSIONS_OPTIONS_H - -#include "google/cloud/composer/image_versions_connection.h" -#include "google/cloud/composer/image_versions_connection_idempotency_policy.h" -#include "google/cloud/composer/v1/image_versions_options.h" - -namespace google { -namespace cloud { -namespace composer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use composer_v1::ImageVersionsBackoffPolicyOption directly. -using ::google::cloud::composer_v1::ImageVersionsBackoffPolicyOption; - -/// @deprecated Use composer_v1::ImageVersionsConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::composer_v1:: - ImageVersionsConnectionIdempotencyPolicyOption; - -/// @deprecated Use composer_v1::ImageVersionsPolicyOptionList directly. -using ::google::cloud::composer_v1::ImageVersionsPolicyOptionList; - -/// @deprecated Use composer_v1::ImageVersionsRetryPolicyOption directly. -using ::google::cloud::composer_v1::ImageVersionsRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace composer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_IMAGE_VERSIONS_OPTIONS_H diff --git a/google/cloud/composer/mocks/mock_environments_connection.h b/google/cloud/composer/mocks/mock_environments_connection.h deleted file mode 100644 index 17e1dba9d6cfe..0000000000000 --- a/google/cloud/composer/mocks/mock_environments_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orchestration/airflow/service/v1/environments.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_MOCKS_MOCK_ENVIRONMENTS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_MOCKS_MOCK_ENVIRONMENTS_CONNECTION_H - -#include "google/cloud/composer/environments_connection.h" -#include "google/cloud/composer/v1/mocks/mock_environments_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in composer_v1_mocks instead of the aliases -/// defined in this namespace. -namespace composer_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use composer_v1_mocks::MockEnvironmentsConnection directly. -using ::google::cloud::composer_v1_mocks::MockEnvironmentsConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace composer_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_MOCKS_MOCK_ENVIRONMENTS_CONNECTION_H diff --git a/google/cloud/composer/mocks/mock_image_versions_connection.h b/google/cloud/composer/mocks/mock_image_versions_connection.h deleted file mode 100644 index c50f742e9d40b..0000000000000 --- a/google/cloud/composer/mocks/mock_image_versions_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orchestration/airflow/service/v1/image_versions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_MOCKS_MOCK_IMAGE_VERSIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_MOCKS_MOCK_IMAGE_VERSIONS_CONNECTION_H - -#include "google/cloud/composer/image_versions_connection.h" -#include "google/cloud/composer/v1/mocks/mock_image_versions_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in composer_v1_mocks instead of the aliases -/// defined in this namespace. -namespace composer_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use composer_v1_mocks::MockImageVersionsConnection directly. -using ::google::cloud::composer_v1_mocks::MockImageVersionsConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace composer_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_MOCKS_MOCK_IMAGE_VERSIONS_CONNECTION_H diff --git a/google/cloud/composer/quickstart/.bazelrc b/google/cloud/composer/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/composer/quickstart/.bazelrc +++ b/google/cloud/composer/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/composer/quickstart/CMakeLists.txt index e9b99b7707151..a66281759a771 100644 --- a/google/cloud/composer/quickstart/CMakeLists.txt +++ b/google/cloud/composer/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Composer API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-composer-quickstart CXX) find_package(google_cloud_cpp_composer REQUIRED) diff --git a/google/cloud/composer/quickstart/WORKSPACE.bazel b/google/cloud/composer/quickstart/WORKSPACE.bazel index 618b39ed7167f..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 = "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/composer/v1/environments_client.h b/google/cloud/composer/v1/environments_client.h index a4490c060e50e..8be63abe764e4 100644 --- a/google/cloud/composer/v1/environments_client.h +++ b/google/cloud/composer/v1/environments_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/composer/v1/environments_connection.h b/google/cloud/composer/v1/environments_connection.h index b692dba2e035c..815253430e639 100644 --- a/google/cloud/composer/v1/environments_connection.h +++ b/google/cloud/composer/v1/environments_connection.h @@ -21,6 +21,8 @@ #include "google/cloud/composer/v1/environments_connection_idempotency_policy.h" #include "google/cloud/composer/v1/internal/environments_retry_traits.h" +#include "google/cloud/orchestration/airflow/service/v1/environments.pb.h" +#include "google/cloud/orchestration/airflow/service/v1/operations.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,9 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/composer/v1/environments_connection_idempotency_policy.h b/google/cloud/composer/v1/environments_connection_idempotency_policy.h index 7a991ae78c9e3..a38fffd58a2e3 100644 --- a/google/cloud/composer/v1/environments_connection_idempotency_policy.h +++ b/google/cloud/composer/v1/environments_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_ENVIRONMENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_ENVIRONMENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/orchestration/airflow/service/v1/environments.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/composer/v1/image_versions_connection.h b/google/cloud/composer/v1/image_versions_connection.h index 6c02af64bee2f..d6f812584cf04 100644 --- a/google/cloud/composer/v1/image_versions_connection.h +++ b/google/cloud/composer/v1/image_versions_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/composer/v1/image_versions_connection_idempotency_policy.h" #include "google/cloud/composer/v1/internal/image_versions_retry_traits.h" +#include "google/cloud/orchestration/airflow/service/v1/image_versions.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 #include namespace google { diff --git a/google/cloud/composer/v1/image_versions_connection_idempotency_policy.h b/google/cloud/composer/v1/image_versions_connection_idempotency_policy.h index 0a29d323989e6..51e964fb024ca 100644 --- a/google/cloud/composer/v1/image_versions_connection_idempotency_policy.h +++ b/google/cloud/composer/v1/image_versions_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_IMAGE_VERSIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_IMAGE_VERSIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/orchestration/airflow/service/v1/image_versions.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/composer/v1/internal/environments_auth_decorator.cc b/google/cloud/composer/v1/internal/environments_auth_decorator.cc index fa67e9f88f605..91ec4bb4a4538 100644 --- a/google/cloud/composer/v1/internal/environments_auth_decorator.cc +++ b/google/cloud/composer/v1/internal/environments_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/orchestration/airflow/service/v1/environments.proto #include "google/cloud/composer/v1/internal/environments_auth_decorator.h" -#include +#include "google/cloud/orchestration/airflow/service/v1/environments.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -488,3 +491,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace composer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/composer/v1/internal/environments_auth_decorator.h b/google/cloud/composer/v1/internal/environments_auth_decorator.h index 9a7451248f49a..9588314169463 100644 --- a/google/cloud/composer/v1/internal/environments_auth_decorator.h +++ b/google/cloud/composer/v1/internal/environments_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/composer/v1/internal/environments_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 composer_v1_internal { @@ -266,4 +269,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_ENVIRONMENTS_AUTH_DECORATOR_H diff --git a/google/cloud/composer/v1/internal/environments_connection_impl.h b/google/cloud/composer/v1/internal/environments_connection_impl.h index dd47cb264a1d3..4ef3aad8253d3 100644 --- a/google/cloud/composer/v1/internal/environments_connection_impl.h +++ b/google/cloud/composer/v1/internal/environments_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/composer/v1/internal/environments_logging_decorator.cc b/google/cloud/composer/v1/internal/environments_logging_decorator.cc index 11f10516141ae..4c3a023e3bebf 100644 --- a/google/cloud/composer/v1/internal/environments_logging_decorator.cc +++ b/google/cloud/composer/v1/internal/environments_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/orchestration/airflow/service/v1/environments.proto #include "google/cloud/composer/v1/internal/environments_logging_decorator.h" +#include "google/cloud/orchestration/airflow/service/v1/environments.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -589,3 +592,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace composer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/composer/v1/internal/environments_logging_decorator.h b/google/cloud/composer/v1/internal/environments_logging_decorator.h index 6c5074fed6957..575db71e7f21c 100644 --- a/google/cloud/composer/v1/internal/environments_logging_decorator.h +++ b/google/cloud/composer/v1/internal/environments_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/composer/v1/internal/environments_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 composer_v1_internal { @@ -266,4 +269,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_ENVIRONMENTS_LOGGING_DECORATOR_H diff --git a/google/cloud/composer/v1/internal/environments_metadata_decorator.cc b/google/cloud/composer/v1/internal/environments_metadata_decorator.cc index 47c09d914c151..fc6b78b4ff276 100644 --- a/google/cloud/composer/v1/internal/environments_metadata_decorator.cc +++ b/google/cloud/composer/v1/internal/environments_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/orchestration/airflow/service/v1/environments.proto #include "google/cloud/composer/v1/internal/environments_metadata_decorator.h" +#include "google/cloud/orchestration/airflow/service/v1/environments.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 composer_v1_internal { @@ -464,3 +468,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace composer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/composer/v1/internal/environments_metadata_decorator.h b/google/cloud/composer/v1/internal/environments_metadata_decorator.h index fb1ced4893c03..95c66ed7c8664 100644 --- a/google/cloud/composer/v1/internal/environments_metadata_decorator.h +++ b/google/cloud/composer/v1/internal/environments_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/composer/v1/internal/environments_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 composer_v1_internal { @@ -271,4 +274,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_ENVIRONMENTS_METADATA_DECORATOR_H diff --git a/google/cloud/composer/v1/internal/environments_option_defaults.cc b/google/cloud/composer/v1/internal/environments_option_defaults.cc index e9ed95daba5c9..6fbb132acc7c3 100644 --- a/google/cloud/composer/v1/internal/environments_option_defaults.cc +++ b/google/cloud/composer/v1/internal/environments_option_defaults.cc @@ -41,7 +41,7 @@ Options EnvironmentsDefaultOptions(Options options) { if (!options.has()) { options.set( composer_v1::EnvironmentsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/composer/v1/internal/environments_stub.cc b/google/cloud/composer/v1/internal/environments_stub.cc index 7ebdb01c2a4ff..3bafe9504d8a6 100644 --- a/google/cloud/composer/v1/internal/environments_stub.cc +++ b/google/cloud/composer/v1/internal/environments_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/orchestration/airflow/service/v1/environments.proto #include "google/cloud/composer/v1/internal/environments_stub.h" +#include "google/cloud/orchestration/airflow/service/v1/environments.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -594,3 +597,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace composer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/composer/v1/internal/environments_stub.h b/google/cloud/composer/v1/internal/environments_stub.h index 4820fafa5acec..2daa939116dda 100644 --- a/google/cloud/composer/v1/internal/environments_stub.h +++ b/google/cloud/composer/v1/internal/environments_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_ENVIRONMENTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_ENVIRONMENTS_STUB_H +#include "google/cloud/orchestration/airflow/service/v1/environments.grpc.pb.h" +#include "google/cloud/orchestration/airflow/service/v1/operations.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -497,4 +500,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_ENVIRONMENTS_STUB_H diff --git a/google/cloud/composer/v1/internal/environments_stub_factory.cc b/google/cloud/composer/v1/internal/environments_stub_factory.cc index 78409e6ece640..023ee94433394 100644 --- a/google/cloud/composer/v1/internal/environments_stub_factory.cc +++ b/google/cloud/composer/v1/internal/environments_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/composer/v1/internal/environments_metadata_decorator.h" #include "google/cloud/composer/v1/internal/environments_stub.h" #include "google/cloud/composer/v1/internal/environments_tracing_stub.h" +#include "google/cloud/orchestration/airflow/service/v1/environments.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace composer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/composer/v1/internal/environments_stub_factory.h b/google/cloud/composer/v1/internal/environments_stub_factory.h index 719ebaa202ba4..48e5845122e21 100644 --- a/google/cloud/composer/v1/internal/environments_stub_factory.h +++ b/google/cloud/composer/v1/internal/environments_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_ENVIRONMENTS_STUB_FACTORY_H diff --git a/google/cloud/composer/v1/internal/environments_tracing_connection.cc b/google/cloud/composer/v1/internal/environments_tracing_connection.cc index 41770c57548db..a7c6a973864f6 100644 --- a/google/cloud/composer/v1/internal/environments_tracing_connection.cc +++ b/google/cloud/composer/v1/internal/environments_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace composer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EnvironmentsTracingConnection::EnvironmentsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -483,16 +481,12 @@ Status EnvironmentsTracingConnection::DeleteOperation( return internal::EndSpan(*span, child_->DeleteOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEnvironmentsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/composer/v1/internal/environments_tracing_connection.h b/google/cloud/composer/v1/internal/environments_tracing_connection.h index fdcf998ab7968..f3139bee00d10 100644 --- a/google/cloud/composer/v1/internal/environments_tracing_connection.h +++ b/google/cloud/composer/v1/internal/environments_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace composer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EnvironmentsTracingConnection : public composer_v1::EnvironmentsConnection { public: @@ -236,8 +234,6 @@ class EnvironmentsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/composer/v1/internal/environments_tracing_stub.cc b/google/cloud/composer/v1/internal/environments_tracing_stub.cc index 3b53fe08c1d4f..12439a72ad956 100644 --- a/google/cloud/composer/v1/internal/environments_tracing_stub.cc +++ b/google/cloud/composer/v1/internal/environments_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EnvironmentsTracingStub::EnvironmentsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -569,18 +570,14 @@ future EnvironmentsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEnvironmentsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace composer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/composer/v1/internal/environments_tracing_stub.h b/google/cloud/composer/v1/internal/environments_tracing_stub.h index 544effd2789d6..c6d7e4f9d459f 100644 --- a/google/cloud/composer/v1/internal/environments_tracing_stub.h +++ b/google/cloud/composer/v1/internal/environments_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EnvironmentsTracingStub : public EnvironmentsStub { public: ~EnvironmentsTracingStub() override = default; @@ -261,8 +262,6 @@ class EnvironmentsTracingStub : public EnvironmentsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -277,4 +276,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_ENVIRONMENTS_TRACING_STUB_H diff --git a/google/cloud/composer/v1/internal/image_versions_auth_decorator.cc b/google/cloud/composer/v1/internal/image_versions_auth_decorator.cc index ce5812957630f..a43fc3e3e4925 100644 --- a/google/cloud/composer/v1/internal/image_versions_auth_decorator.cc +++ b/google/cloud/composer/v1/internal/image_versions_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/orchestration/airflow/service/v1/image_versions.proto #include "google/cloud/composer/v1/internal/image_versions_auth_decorator.h" -#include +#include "google/cloud/orchestration/airflow/service/v1/image_versions.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace composer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/composer/v1/internal/image_versions_auth_decorator.h b/google/cloud/composer/v1/internal/image_versions_auth_decorator.h index eac4ee7a52ff4..f1cc8308ee868 100644 --- a/google/cloud/composer/v1/internal/image_versions_auth_decorator.h +++ b/google/cloud/composer/v1/internal/image_versions_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -66,4 +69,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_IMAGE_VERSIONS_AUTH_DECORATOR_H diff --git a/google/cloud/composer/v1/internal/image_versions_logging_decorator.cc b/google/cloud/composer/v1/internal/image_versions_logging_decorator.cc index 8f09a5ab1c34a..65410d13c8f61 100644 --- a/google/cloud/composer/v1/internal/image_versions_logging_decorator.cc +++ b/google/cloud/composer/v1/internal/image_versions_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/orchestration/airflow/service/v1/image_versions.proto #include "google/cloud/composer/v1/internal/image_versions_logging_decorator.h" +#include "google/cloud/orchestration/airflow/service/v1/image_versions.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -88,3 +91,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace composer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/composer/v1/internal/image_versions_logging_decorator.h b/google/cloud/composer/v1/internal/image_versions_logging_decorator.h index 36a3e04bde0ff..b4a489999b0e0 100644 --- a/google/cloud/composer/v1/internal/image_versions_logging_decorator.h +++ b/google/cloud/composer/v1/internal/image_versions_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -66,4 +69,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_IMAGE_VERSIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/composer/v1/internal/image_versions_metadata_decorator.cc b/google/cloud/composer/v1/internal/image_versions_metadata_decorator.cc index f8154d23d6c9c..71f00431819dc 100644 --- a/google/cloud/composer/v1/internal/image_versions_metadata_decorator.cc +++ b/google/cloud/composer/v1/internal/image_versions_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/orchestration/airflow/service/v1/image_versions.proto #include "google/cloud/composer/v1/internal/image_versions_metadata_decorator.h" +#include "google/cloud/orchestration/airflow/service/v1/image_versions.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 composer_v1_internal { @@ -97,3 +101,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace composer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/composer/v1/internal/image_versions_metadata_decorator.h b/google/cloud/composer/v1/internal/image_versions_metadata_decorator.h index 515721d280981..4c41e417e6401 100644 --- a/google/cloud/composer/v1/internal/image_versions_metadata_decorator.h +++ b/google/cloud/composer/v1/internal/image_versions_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -71,4 +74,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_IMAGE_VERSIONS_METADATA_DECORATOR_H diff --git a/google/cloud/composer/v1/internal/image_versions_option_defaults.cc b/google/cloud/composer/v1/internal/image_versions_option_defaults.cc index 33f9e36be3c61..30b4f6d0d5f0e 100644 --- a/google/cloud/composer/v1/internal/image_versions_option_defaults.cc +++ b/google/cloud/composer/v1/internal/image_versions_option_defaults.cc @@ -41,7 +41,7 @@ Options ImageVersionsDefaultOptions(Options options) { if (!options.has()) { options.set( composer_v1::ImageVersionsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/composer/v1/internal/image_versions_stub.cc b/google/cloud/composer/v1/internal/image_versions_stub.cc index 51bed33d3b5c9..c4714b8c373aa 100644 --- a/google/cloud/composer/v1/internal/image_versions_stub.cc +++ b/google/cloud/composer/v1/internal/image_versions_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/orchestration/airflow/service/v1/image_versions.proto #include "google/cloud/composer/v1/internal/image_versions_stub.h" +#include "google/cloud/orchestration/airflow/service/v1/image_versions.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -83,3 +86,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace composer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/composer/v1/internal/image_versions_stub.h b/google/cloud/composer/v1/internal/image_versions_stub.h index 223e1c941dc08..302ea51e2313b 100644 --- a/google/cloud/composer/v1/internal/image_versions_stub.h +++ b/google/cloud/composer/v1/internal/image_versions_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_IMAGE_VERSIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_IMAGE_VERSIONS_STUB_H +#include "google/cloud/orchestration/airflow/service/v1/image_versions.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_IMAGE_VERSIONS_STUB_H diff --git a/google/cloud/composer/v1/internal/image_versions_stub_factory.cc b/google/cloud/composer/v1/internal/image_versions_stub_factory.cc index ae10e6b4f1686..b26eb3f9a6af3 100644 --- a/google/cloud/composer/v1/internal/image_versions_stub_factory.cc +++ b/google/cloud/composer/v1/internal/image_versions_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/composer/v1/internal/image_versions_metadata_decorator.h" #include "google/cloud/composer/v1/internal/image_versions_stub.h" #include "google/cloud/composer/v1/internal/image_versions_tracing_stub.h" +#include "google/cloud/orchestration/airflow/service/v1/image_versions.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace composer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/composer/v1/internal/image_versions_stub_factory.h b/google/cloud/composer/v1/internal/image_versions_stub_factory.h index 28413b5b9199f..7a6fbed8a3c37 100644 --- a/google/cloud/composer/v1/internal/image_versions_stub_factory.h +++ b/google/cloud/composer/v1/internal/image_versions_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_IMAGE_VERSIONS_STUB_FACTORY_H diff --git a/google/cloud/composer/v1/internal/image_versions_tracing_connection.cc b/google/cloud/composer/v1/internal/image_versions_tracing_connection.cc index 0504b56bb9c47..87faaaf077095 100644 --- a/google/cloud/composer/v1/internal/image_versions_tracing_connection.cc +++ b/google/cloud/composer/v1/internal/image_versions_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace composer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ImageVersionsTracingConnection::ImageVersionsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -74,16 +72,12 @@ Status ImageVersionsTracingConnection::DeleteOperation( return internal::EndSpan(*span, child_->DeleteOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeImageVersionsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/composer/v1/internal/image_versions_tracing_connection.h b/google/cloud/composer/v1/internal/image_versions_tracing_connection.h index 7d9ba32e726fa..785234d4817b1 100644 --- a/google/cloud/composer/v1/internal/image_versions_tracing_connection.h +++ b/google/cloud/composer/v1/internal/image_versions_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace composer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ImageVersionsTracingConnection : public composer_v1::ImageVersionsConnection { public: @@ -57,8 +55,6 @@ class ImageVersionsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/composer/v1/internal/image_versions_tracing_stub.cc b/google/cloud/composer/v1/internal/image_versions_tracing_stub.cc index 38a13f6c82d31..7d61192cb0ecd 100644 --- a/google/cloud/composer/v1/internal/image_versions_tracing_stub.cc +++ b/google/cloud/composer/v1/internal/image_versions_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ImageVersionsTracingStub::ImageVersionsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -84,18 +85,14 @@ Status ImageVersionsTracingStub::DeleteOperation( child_->DeleteOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeImageVersionsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace composer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/composer/v1/internal/image_versions_tracing_stub.h b/google/cloud/composer/v1/internal/image_versions_tracing_stub.h index 4a9247bf952d4..91e04ed586ad3 100644 --- a/google/cloud/composer/v1/internal/image_versions_tracing_stub.h +++ b/google/cloud/composer/v1/internal/image_versions_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace composer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ImageVersionsTracingStub : public ImageVersionsStub { public: ~ImageVersionsTracingStub() override = default; @@ -62,8 +63,6 @@ class ImageVersionsTracingStub : public ImageVersionsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -78,4 +77,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPOSER_V1_INTERNAL_IMAGE_VERSIONS_TRACING_STUB_H diff --git a/google/cloud/compute/accelerator_types/v1/accelerator_types_connection.h b/google/cloud/compute/accelerator_types/v1/accelerator_types_connection.h index a02435242f742..baa321fb1c489 100644 --- a/google/cloud/compute/accelerator_types/v1/accelerator_types_connection.h +++ b/google/cloud/compute/accelerator_types/v1/accelerator_types_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ACCELERATOR_TYPES_V1_ACCELERATOR_TYPES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ACCELERATOR_TYPES_V1_ACCELERATOR_TYPES_CONNECTION_H +#include "google/cloud/compute/accelerator_types/v1/accelerator_types.pb.h" #include "google/cloud/compute/accelerator_types/v1/accelerator_types_connection_idempotency_policy.h" #include "google/cloud/compute/accelerator_types/v1/internal/accelerator_types_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/accelerator_types/v1/accelerator_types_connection_idempotency_policy.h b/google/cloud/compute/accelerator_types/v1/accelerator_types_connection_idempotency_policy.h index 169e70d49587f..76776511d6c2c 100644 --- a/google/cloud/compute/accelerator_types/v1/accelerator_types_connection_idempotency_policy.h +++ b/google/cloud/compute/accelerator_types/v1/accelerator_types_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ACCELERATOR_TYPES_V1_ACCELERATOR_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ACCELERATOR_TYPES_V1_ACCELERATOR_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/accelerator_types/v1/accelerator_types.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/accelerator_types/v1/accelerator_types_proto_export.h b/google/cloud/compute/accelerator_types/v1/accelerator_types_proto_export.h index 5c1054ef5e0b3..ffb487ab234e8 100644 --- a/google/cloud/compute/accelerator_types/v1/accelerator_types_proto_export.h +++ b/google/cloud/compute/accelerator_types/v1/accelerator_types_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ACCELERATOR_TYPES_V1_ACCELERATOR_TYPES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_002.pb.h" +#include "google/cloud/compute/v1/internal/common_023.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ACCELERATOR_TYPES_V1_ACCELERATOR_TYPES_PROTO_EXPORT_H diff --git a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_option_defaults.cc b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_option_defaults.cc index 17cc1ba257c6e..e3aad639ce22b 100644 --- a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_option_defaults.cc +++ b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_option_defaults.cc @@ -43,7 +43,7 @@ Options AcceleratorTypesDefaultOptions(Options options) { options.set< compute_accelerator_types_v1::AcceleratorTypesRetryPolicyOption>( compute_accelerator_types_v1::AcceleratorTypesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include #include diff --git a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_metadata_decorator.cc b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_metadata_decorator.cc index 2798bbca24632..56492df9a34aa 100644 --- a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_metadata_decorator.cc +++ b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/accelerator_types/v1/accelerator_types.proto #include "google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_metadata_decorator.h b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_metadata_decorator.h index 0af9dc0e03e87..ad1979aa85a56 100644 --- a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_metadata_decorator.h +++ b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ACCELERATOR_TYPES_V1_INTERNAL_ACCELERATOR_TYPES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ACCELERATOR_TYPES_V1_INTERNAL_ACCELERATOR_TYPES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/accelerator_types/v1/accelerator_types.pb.h" #include "google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.cc b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.cc index cb35d61928d96..6ddf3087b8c45 100644 --- a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.cc +++ b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/accelerator_types/v1/accelerator_types.proto #include "google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.h" +#include "google/cloud/compute/accelerator_types/v1/accelerator_types.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.h b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.h index de14eca3de9b9..bb6bf99d87600 100644 --- a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.h +++ b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ACCELERATOR_TYPES_V1_INTERNAL_ACCELERATOR_TYPES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ACCELERATOR_TYPES_V1_INTERNAL_ACCELERATOR_TYPES_REST_STUB_H +#include "google/cloud/compute/accelerator_types/v1/accelerator_types.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_tracing_connection.cc b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_tracing_connection.cc index 9e12c42890b70..2a14a9a84865a 100644 --- a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_tracing_connection.cc +++ b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_accelerator_types_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AcceleratorTypesTracingConnection::AcceleratorTypesTracingConnection( std::shared_ptr child) @@ -75,17 +73,13 @@ AcceleratorTypesTracingConnection::ListAcceleratorTypes( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAcceleratorTypesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_tracing_connection.h b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_tracing_connection.h index a7fe4718e407d..9e59a9bd0dae9 100644 --- a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_tracing_connection.h +++ b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_accelerator_types_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AcceleratorTypesTracingConnection : public compute_accelerator_types_v1::AcceleratorTypesConnection { public: @@ -60,8 +58,6 @@ class AcceleratorTypesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/addresses/v1/addresses_connection.h b/google/cloud/compute/addresses/v1/addresses_connection.h index 1974fb2c4941e..e06856afb8acc 100644 --- a/google/cloud/compute/addresses/v1/addresses_connection.h +++ b/google/cloud/compute/addresses/v1/addresses_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ADDRESSES_V1_ADDRESSES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ADDRESSES_V1_ADDRESSES_CONNECTION_H +#include "google/cloud/compute/addresses/v1/addresses.pb.h" #include "google/cloud/compute/addresses/v1/addresses_connection_idempotency_policy.h" #include "google/cloud/compute/addresses/v1/internal/addresses_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/addresses/v1/addresses_connection_idempotency_policy.h b/google/cloud/compute/addresses/v1/addresses_connection_idempotency_policy.h index b096072bf54a2..c4449b9e64435 100644 --- a/google/cloud/compute/addresses/v1/addresses_connection_idempotency_policy.h +++ b/google/cloud/compute/addresses/v1/addresses_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ADDRESSES_V1_ADDRESSES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ADDRESSES_V1_ADDRESSES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/addresses/v1/addresses.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/addresses/v1/addresses_proto_export.h b/google/cloud/compute/addresses/v1/addresses_proto_export.h index 6a9828f83cfb1..7ccf3339454b3 100644 --- a/google/cloud/compute/addresses/v1/addresses_proto_export.h +++ b/google/cloud/compute/addresses/v1/addresses_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ADDRESSES_V1_ADDRESSES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_004.pb.h" +#include "google/cloud/compute/v1/internal/common_005.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_107.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ADDRESSES_V1_ADDRESSES_PROTO_EXPORT_H diff --git a/google/cloud/compute/addresses/v1/internal/addresses_option_defaults.cc b/google/cloud/compute/addresses/v1/internal/addresses_option_defaults.cc index 1abf1e42ebadd..1db2c737f7dcb 100644 --- a/google/cloud/compute/addresses/v1/internal/addresses_option_defaults.cc +++ b/google/cloud/compute/addresses/v1/internal/addresses_option_defaults.cc @@ -41,7 +41,7 @@ Options AddressesDefaultOptions(Options options) { if (!options.has()) { options.set( compute_addresses_v1::AddressesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/addresses/v1/internal/addresses_rest_connection_impl.h b/google/cloud/compute/addresses/v1/internal/addresses_rest_connection_impl.h index 9a9776badd979..4375ec5e5f1ce 100644 --- a/google/cloud/compute/addresses/v1/internal/addresses_rest_connection_impl.h +++ b/google/cloud/compute/addresses/v1/internal/addresses_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/addresses/v1/addresses_options.h" #include "google/cloud/compute/addresses/v1/internal/addresses_rest_stub.h" #include "google/cloud/compute/addresses/v1/internal/addresses_retry_traits.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/addresses/v1/internal/addresses_rest_logging_decorator.h b/google/cloud/compute/addresses/v1/internal/addresses_rest_logging_decorator.h index d926900d6017d..ec6b11bbb8a95 100644 --- a/google/cloud/compute/addresses/v1/internal/addresses_rest_logging_decorator.h +++ b/google/cloud/compute/addresses/v1/internal/addresses_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ADDRESSES_V1_INTERNAL_ADDRESSES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ADDRESSES_V1_INTERNAL_ADDRESSES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/addresses/v1/addresses.pb.h" #include "google/cloud/compute/addresses/v1/internal/addresses_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/addresses/v1/internal/addresses_rest_metadata_decorator.cc b/google/cloud/compute/addresses/v1/internal/addresses_rest_metadata_decorator.cc index 3b267755d1573..98fdcca0785f6 100644 --- a/google/cloud/compute/addresses/v1/internal/addresses_rest_metadata_decorator.cc +++ b/google/cloud/compute/addresses/v1/internal/addresses_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/addresses/v1/addresses.proto #include "google/cloud/compute/addresses/v1/internal/addresses_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/addresses/v1/internal/addresses_rest_metadata_decorator.h b/google/cloud/compute/addresses/v1/internal/addresses_rest_metadata_decorator.h index 0d8baa6fdad03..14d1d54796646 100644 --- a/google/cloud/compute/addresses/v1/internal/addresses_rest_metadata_decorator.h +++ b/google/cloud/compute/addresses/v1/internal/addresses_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ADDRESSES_V1_INTERNAL_ADDRESSES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ADDRESSES_V1_INTERNAL_ADDRESSES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/addresses/v1/addresses.pb.h" #include "google/cloud/compute/addresses/v1/internal/addresses_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.cc b/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.cc index 92d57a920feeb..0ba9642434deb 100644 --- a/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.cc +++ b/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/addresses/v1/addresses.proto #include "google/cloud/compute/addresses/v1/internal/addresses_rest_stub.h" +#include "google/cloud/compute/addresses/v1/addresses.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.h b/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.h index 800535c718d76..4918d07bcd167 100644 --- a/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.h +++ b/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ADDRESSES_V1_INTERNAL_ADDRESSES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ADDRESSES_V1_INTERNAL_ADDRESSES_REST_STUB_H +#include "google/cloud/compute/addresses/v1/addresses.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/addresses/v1/internal/addresses_tracing_connection.cc b/google/cloud/compute/addresses/v1/internal/addresses_tracing_connection.cc index 87795dcde9ef2..42f2867024dfd 100644 --- a/google/cloud/compute/addresses/v1/internal/addresses_tracing_connection.cc +++ b/google/cloud/compute/addresses/v1/internal/addresses_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_addresses_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AddressesTracingConnection::AddressesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -186,16 +184,12 @@ AddressesTracingConnection::SetLabels( return internal::EndSpan(std::move(span), child_->SetLabels(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAddressesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/addresses/v1/internal/addresses_tracing_connection.h b/google/cloud/compute/addresses/v1/internal/addresses_tracing_connection.h index 619106dda7aae..e2b12ab96f45d 100644 --- a/google/cloud/compute/addresses/v1/internal/addresses_tracing_connection.h +++ b/google/cloud/compute/addresses/v1/internal/addresses_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_addresses_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AddressesTracingConnection : public compute_addresses_v1::AddressesConnection { public: @@ -106,8 +104,6 @@ class AddressesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/autoscalers/v1/autoscalers_connection.h b/google/cloud/compute/autoscalers/v1/autoscalers_connection.h index 8463b2ee34219..6a596effbd0bf 100644 --- a/google/cloud/compute/autoscalers/v1/autoscalers_connection.h +++ b/google/cloud/compute/autoscalers/v1/autoscalers_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_AUTOSCALERS_V1_AUTOSCALERS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_AUTOSCALERS_V1_AUTOSCALERS_CONNECTION_H +#include "google/cloud/compute/autoscalers/v1/autoscalers.pb.h" #include "google/cloud/compute/autoscalers/v1/autoscalers_connection_idempotency_policy.h" #include "google/cloud/compute/autoscalers/v1/internal/autoscalers_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/autoscalers/v1/autoscalers_connection_idempotency_policy.h b/google/cloud/compute/autoscalers/v1/autoscalers_connection_idempotency_policy.h index 541f876f06ad6..7369d904468dc 100644 --- a/google/cloud/compute/autoscalers/v1/autoscalers_connection_idempotency_policy.h +++ b/google/cloud/compute/autoscalers/v1/autoscalers_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_AUTOSCALERS_V1_AUTOSCALERS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_AUTOSCALERS_V1_AUTOSCALERS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/autoscalers/v1/autoscalers.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/autoscalers/v1/autoscalers_proto_export.h b/google/cloud/compute/autoscalers/v1/autoscalers_proto_export.h index 1bfdc49b59491..16ac4b159f05c 100644 --- a/google/cloud/compute/autoscalers/v1/autoscalers_proto_export.h +++ b/google/cloud/compute/autoscalers/v1/autoscalers_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_AUTOSCALERS_V1_AUTOSCALERS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_008.pb.h" +#include "google/cloud/compute/v1/internal/common_009.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_040.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_AUTOSCALERS_V1_AUTOSCALERS_PROTO_EXPORT_H diff --git a/google/cloud/compute/autoscalers/v1/internal/autoscalers_option_defaults.cc b/google/cloud/compute/autoscalers/v1/internal/autoscalers_option_defaults.cc index f7500d29d868c..2a9f54fa6bd0b 100644 --- a/google/cloud/compute/autoscalers/v1/internal/autoscalers_option_defaults.cc +++ b/google/cloud/compute/autoscalers/v1/internal/autoscalers_option_defaults.cc @@ -41,7 +41,7 @@ Options AutoscalersDefaultOptions(Options options) { if (!options.has()) { options.set( compute_autoscalers_v1::AutoscalersLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_connection_impl.h b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_connection_impl.h index 08435b52b39a6..fe60e6d32f5ac 100644 --- a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_connection_impl.h +++ b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/autoscalers/v1/autoscalers_options.h" #include "google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.h" #include "google/cloud/compute/autoscalers/v1/internal/autoscalers_retry_traits.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_logging_decorator.h b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_logging_decorator.h index ea187e5777b84..5b814a57e5cdb 100644 --- a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_logging_decorator.h +++ b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_AUTOSCALERS_V1_INTERNAL_AUTOSCALERS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_AUTOSCALERS_V1_INTERNAL_AUTOSCALERS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/autoscalers/v1/autoscalers.pb.h" #include "google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_metadata_decorator.cc b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_metadata_decorator.cc index eb83fb6db6af8..5529940ed838f 100644 --- a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_metadata_decorator.cc +++ b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/autoscalers/v1/autoscalers.proto #include "google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_metadata_decorator.h b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_metadata_decorator.h index f49e2d866cace..d748627b19c48 100644 --- a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_metadata_decorator.h +++ b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_AUTOSCALERS_V1_INTERNAL_AUTOSCALERS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_AUTOSCALERS_V1_INTERNAL_AUTOSCALERS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/autoscalers/v1/autoscalers.pb.h" #include "google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.cc b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.cc index 06ce3a1edbe09..7f13490b072d9 100644 --- a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.cc +++ b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/autoscalers/v1/autoscalers.proto #include "google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.h" +#include "google/cloud/compute/autoscalers/v1/autoscalers.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.h b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.h index 4ee705eddb9d9..c6569984ee812 100644 --- a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.h +++ b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_AUTOSCALERS_V1_INTERNAL_AUTOSCALERS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_AUTOSCALERS_V1_INTERNAL_AUTOSCALERS_REST_STUB_H +#include "google/cloud/compute/autoscalers/v1/autoscalers.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/autoscalers/v1/internal/autoscalers_tracing_connection.cc b/google/cloud/compute/autoscalers/v1/internal/autoscalers_tracing_connection.cc index 59383608f5a7d..63e0aa9602558 100644 --- a/google/cloud/compute/autoscalers/v1/internal/autoscalers_tracing_connection.cc +++ b/google/cloud/compute/autoscalers/v1/internal/autoscalers_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_autoscalers_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AutoscalersTracingConnection::AutoscalersTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -198,16 +196,12 @@ AutoscalersTracingConnection::UpdateAutoscaler( child_->UpdateAutoscaler(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAutoscalersTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/autoscalers/v1/internal/autoscalers_tracing_connection.h b/google/cloud/compute/autoscalers/v1/internal/autoscalers_tracing_connection.h index 16af91862c042..7b1847d4cb931 100644 --- a/google/cloud/compute/autoscalers/v1/internal/autoscalers_tracing_connection.h +++ b/google/cloud/compute/autoscalers/v1/internal/autoscalers_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_autoscalers_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AutoscalersTracingConnection : public compute_autoscalers_v1::AutoscalersConnection { public: @@ -102,8 +100,6 @@ class AutoscalersTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/backend_buckets/v1/backend_buckets_connection.h b/google/cloud/compute/backend_buckets/v1/backend_buckets_connection.h index de280f2c81bff..2ab9fe847ef94 100644 --- a/google/cloud/compute/backend_buckets/v1/backend_buckets_connection.h +++ b/google/cloud/compute/backend_buckets/v1/backend_buckets_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_BUCKETS_V1_BACKEND_BUCKETS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_BUCKETS_V1_BACKEND_BUCKETS_CONNECTION_H +#include "google/cloud/compute/backend_buckets/v1/backend_buckets.pb.h" #include "google/cloud/compute/backend_buckets/v1/backend_buckets_connection_idempotency_policy.h" #include "google/cloud/compute/backend_buckets/v1/internal/backend_buckets_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/backend_buckets/v1/backend_buckets_connection_idempotency_policy.h b/google/cloud/compute/backend_buckets/v1/backend_buckets_connection_idempotency_policy.h index b5440de631fc5..3599e6ad76d4f 100644 --- a/google/cloud/compute/backend_buckets/v1/backend_buckets_connection_idempotency_policy.h +++ b/google/cloud/compute/backend_buckets/v1/backend_buckets_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_BUCKETS_V1_BACKEND_BUCKETS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_BUCKETS_V1_BACKEND_BUCKETS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/backend_buckets/v1/backend_buckets.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/backend_buckets/v1/backend_buckets_proto_export.h b/google/cloud/compute/backend_buckets/v1/backend_buckets_proto_export.h index 971b25fd59947..3e8399bd2ecec 100644 --- a/google/cloud/compute/backend_buckets/v1/backend_buckets_proto_export.h +++ b/google/cloud/compute/backend_buckets/v1/backend_buckets_proto_export.h @@ -26,14 +26,14 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_BUCKETS_V1_BACKEND_BUCKETS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_010.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_047.pb.h" +#include "google/cloud/compute/v1/internal/common_118.pb.h" +#include "google/cloud/compute/v1/internal/common_121.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_BUCKETS_V1_BACKEND_BUCKETS_PROTO_EXPORT_H diff --git a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_option_defaults.cc b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_option_defaults.cc index 00439c6f37844..b75d274484ad1 100644 --- a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_option_defaults.cc +++ b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_option_defaults.cc @@ -42,7 +42,7 @@ Options BackendBucketsDefaultOptions(Options options) { compute_backend_buckets_v1::BackendBucketsRetryPolicyOption>()) { options.set( compute_backend_buckets_v1::BackendBucketsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_connection_impl.h b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_connection_impl.h index 32c81f56546d8..a714e33c7b09a 100644 --- a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_connection_impl.h +++ b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/backend_buckets/v1/backend_buckets_options.h" #include "google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.h" #include "google/cloud/compute/backend_buckets/v1/internal/backend_buckets_retry_traits.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_logging_decorator.h b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_logging_decorator.h index cedc30fa2bc85..68ab2f27e797b 100644 --- a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_logging_decorator.h +++ b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_BUCKETS_V1_INTERNAL_BACKEND_BUCKETS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_BUCKETS_V1_INTERNAL_BACKEND_BUCKETS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/backend_buckets/v1/backend_buckets.pb.h" #include "google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_metadata_decorator.cc b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_metadata_decorator.cc index 7b75d94b33f1f..b5541093271aa 100644 --- a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_metadata_decorator.cc +++ b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/backend_buckets/v1/backend_buckets.proto #include "google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_metadata_decorator.h b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_metadata_decorator.h index 90d674531e5c8..660359ad74c88 100644 --- a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_metadata_decorator.h +++ b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_BUCKETS_V1_INTERNAL_BACKEND_BUCKETS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_BUCKETS_V1_INTERNAL_BACKEND_BUCKETS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/backend_buckets/v1/backend_buckets.pb.h" #include "google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.cc b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.cc index ec0e898ee48d1..cdc795a8900c4 100644 --- a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.cc +++ b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/backend_buckets/v1/backend_buckets.proto #include "google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.h" +#include "google/cloud/compute/backend_buckets/v1/backend_buckets.pb.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.h b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.h index a2dec92e271a8..d607a319a6ef2 100644 --- a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.h +++ b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_BUCKETS_V1_INTERNAL_BACKEND_BUCKETS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_BUCKETS_V1_INTERNAL_BACKEND_BUCKETS_REST_STUB_H +#include "google/cloud/compute/backend_buckets/v1/backend_buckets.pb.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_tracing_connection.cc b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_tracing_connection.cc index 4d1d8b24c2e15..6d9fce1a05ff4 100644 --- a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_tracing_connection.cc +++ b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_backend_buckets_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BackendBucketsTracingConnection::BackendBucketsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -328,17 +326,13 @@ BackendBucketsTracingConnection::UpdateBackendBucket( child_->UpdateBackendBucket(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBackendBucketsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_tracing_connection.h b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_tracing_connection.h index 3bf2a13a3f03c..e74d0931b01e1 100644 --- a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_tracing_connection.h +++ b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_backend_buckets_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BackendBucketsTracingConnection : public compute_backend_buckets_v1::BackendBucketsConnection { public: @@ -149,8 +147,6 @@ class BackendBucketsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/backend_services/v1/backend_services_connection.h b/google/cloud/compute/backend_services/v1/backend_services_connection.h index 1e1462ff71061..734e2a613b550 100644 --- a/google/cloud/compute/backend_services/v1/backend_services_connection.h +++ b/google/cloud/compute/backend_services/v1/backend_services_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_SERVICES_V1_BACKEND_SERVICES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_SERVICES_V1_BACKEND_SERVICES_CONNECTION_H +#include "google/cloud/compute/backend_services/v1/backend_services.pb.h" #include "google/cloud/compute/backend_services/v1/backend_services_connection_idempotency_policy.h" #include "google/cloud/compute/backend_services/v1/internal/backend_services_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/backend_services/v1/backend_services_connection_idempotency_policy.h b/google/cloud/compute/backend_services/v1/backend_services_connection_idempotency_policy.h index 2ae879dfde6e7..dbac8ebc9db2c 100644 --- a/google/cloud/compute/backend_services/v1/backend_services_connection_idempotency_policy.h +++ b/google/cloud/compute/backend_services/v1/backend_services_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_SERVICES_V1_BACKEND_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_SERVICES_V1_BACKEND_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/backend_services/v1/backend_services.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/backend_services/v1/backend_services_proto_export.h b/google/cloud/compute/backend_services/v1/backend_services_proto_export.h index 5726bee61e467..e6336f1942e21 100644 --- a/google/cloud/compute/backend_services/v1/backend_services_proto_export.h +++ b/google/cloud/compute/backend_services/v1/backend_services_proto_export.h @@ -26,17 +26,17 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_SERVICES_V1_BACKEND_SERVICES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_000.pb.h" +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_011.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_047.pb.h" +#include "google/cloud/compute/v1/internal/common_052.pb.h" +#include "google/cloud/compute/v1/internal/common_118.pb.h" +#include "google/cloud/compute/v1/internal/common_121.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_SERVICES_V1_BACKEND_SERVICES_PROTO_EXPORT_H diff --git a/google/cloud/compute/backend_services/v1/internal/backend_services_option_defaults.cc b/google/cloud/compute/backend_services/v1/internal/backend_services_option_defaults.cc index 2b2b39a3b8741..7f484be5a1d03 100644 --- a/google/cloud/compute/backend_services/v1/internal/backend_services_option_defaults.cc +++ b/google/cloud/compute/backend_services/v1/internal/backend_services_option_defaults.cc @@ -42,7 +42,7 @@ Options BackendServicesDefaultOptions(Options options) { compute_backend_services_v1::BackendServicesRetryPolicyOption>()) { options.set( compute_backend_services_v1::BackendServicesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_connection_impl.h b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_connection_impl.h index d2f314f1ee081..c24e2e3dae62d 100644 --- a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_connection_impl.h +++ b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/backend_services/v1/backend_services_options.h" #include "google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.h" #include "google/cloud/compute/backend_services/v1/internal/backend_services_retry_traits.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_logging_decorator.h b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_logging_decorator.h index 76494fe13de37..92471d616240b 100644 --- a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_logging_decorator.h +++ b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_SERVICES_V1_INTERNAL_BACKEND_SERVICES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_SERVICES_V1_INTERNAL_BACKEND_SERVICES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/backend_services/v1/backend_services.pb.h" #include "google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_metadata_decorator.cc b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_metadata_decorator.cc index d9a5d55237da4..cd3e8bbb8a069 100644 --- a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_metadata_decorator.cc +++ b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/backend_services/v1/backend_services.proto #include "google/cloud/compute/backend_services/v1/internal/backend_services_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_metadata_decorator.h b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_metadata_decorator.h index 70e437f1e1175..cc6816c86b0a9 100644 --- a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_metadata_decorator.h +++ b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_SERVICES_V1_INTERNAL_BACKEND_SERVICES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_SERVICES_V1_INTERNAL_BACKEND_SERVICES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/backend_services/v1/backend_services.pb.h" #include "google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.cc b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.cc index 1e5d454624be5..63c7c257fad2d 100644 --- a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.cc +++ b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/backend_services/v1/backend_services.proto #include "google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.h" +#include "google/cloud/compute/backend_services/v1/backend_services.pb.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.h b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.h index 38fb4362043b4..de1f44a8bebd0 100644 --- a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.h +++ b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_SERVICES_V1_INTERNAL_BACKEND_SERVICES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_BACKEND_SERVICES_V1_INTERNAL_BACKEND_SERVICES_REST_STUB_H +#include "google/cloud/compute/backend_services/v1/backend_services.pb.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/backend_services/v1/internal/backend_services_tracing_connection.cc b/google/cloud/compute/backend_services/v1/internal/backend_services_tracing_connection.cc index a11a6cf8741be..dcb5076fc6566 100644 --- a/google/cloud/compute/backend_services/v1/internal/backend_services_tracing_connection.cc +++ b/google/cloud/compute/backend_services/v1/internal/backend_services_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_backend_services_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BackendServicesTracingConnection::BackendServicesTracingConnection( std::shared_ptr child) @@ -405,17 +403,13 @@ BackendServicesTracingConnection::UpdateBackendService( child_->UpdateBackendService(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBackendServicesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/backend_services/v1/internal/backend_services_tracing_connection.h b/google/cloud/compute/backend_services/v1/internal/backend_services_tracing_connection.h index 6700e43d634aa..dbe1cc35cd8f0 100644 --- a/google/cloud/compute/backend_services/v1/internal/backend_services_tracing_connection.h +++ b/google/cloud/compute/backend_services/v1/internal/backend_services_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_backend_services_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BackendServicesTracingConnection : public compute_backend_services_v1::BackendServicesConnection { public: @@ -177,8 +175,6 @@ class BackendServicesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/compute_library.bzl b/google/cloud/compute/compute_library.bzl index 014e2840bfee1..d0afcb0e16f14 100644 --- a/google/cloud/compute/compute_library.bzl +++ b/google/cloud/compute/compute_library.bzl @@ -63,7 +63,7 @@ def compute_library(service_dir, inner_deps = []): visibility = ["//:__pkg__"], deps = [ ":google_cloud_cpp_compute_" + service, - "@com_google_googletest//:gtest", + "@googletest//:gtest", ], ) @@ -77,7 +77,7 @@ def compute_library(service_dir, inner_deps = []): "//:grpc_utils", "//google/cloud:google_cloud_cpp_rest_internal", "//google/cloud:google_cloud_cpp_rest_protobuf_internal", - "//protos:system_includes", + # "//protos:system_includes", "//protos/google/cloud/compute:cc_proto", ] + inner_deps, ) diff --git a/google/cloud/compute/disk_types/v1/disk_types_connection.h b/google/cloud/compute/disk_types/v1/disk_types_connection.h index 0b29ddc91dafd..88c31a59cd78f 100644 --- a/google/cloud/compute/disk_types/v1/disk_types_connection.h +++ b/google/cloud/compute/disk_types/v1/disk_types_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISK_TYPES_V1_DISK_TYPES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISK_TYPES_V1_DISK_TYPES_CONNECTION_H +#include "google/cloud/compute/disk_types/v1/disk_types.pb.h" #include "google/cloud/compute/disk_types/v1/disk_types_connection_idempotency_policy.h" #include "google/cloud/compute/disk_types/v1/internal/disk_types_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/disk_types/v1/disk_types_connection_idempotency_policy.h b/google/cloud/compute/disk_types/v1/disk_types_connection_idempotency_policy.h index 1aa25525eec82..6f4963641deba 100644 --- a/google/cloud/compute/disk_types/v1/disk_types_connection_idempotency_policy.h +++ b/google/cloud/compute/disk_types/v1/disk_types_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISK_TYPES_V1_DISK_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISK_TYPES_V1_DISK_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/disk_types/v1/disk_types.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/disk_types/v1/disk_types_proto_export.h b/google/cloud/compute/disk_types/v1/disk_types_proto_export.h index 2a80c4c51d3b6..4e6922ebcda89 100644 --- a/google/cloud/compute/disk_types/v1/disk_types_proto_export.h +++ b/google/cloud/compute/disk_types/v1/disk_types_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISK_TYPES_V1_DISK_TYPES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_023.pb.h" +#include "google/cloud/compute/v1/internal/common_026.pb.h" +#include "google/cloud/compute/v1/internal/common_027.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISK_TYPES_V1_DISK_TYPES_PROTO_EXPORT_H diff --git a/google/cloud/compute/disk_types/v1/internal/disk_types_option_defaults.cc b/google/cloud/compute/disk_types/v1/internal/disk_types_option_defaults.cc index bcdbd75a2d149..8e5135ec9fcc0 100644 --- a/google/cloud/compute/disk_types/v1/internal/disk_types_option_defaults.cc +++ b/google/cloud/compute/disk_types/v1/internal/disk_types_option_defaults.cc @@ -41,7 +41,7 @@ Options DiskTypesDefaultOptions(Options options) { if (!options.has()) { options.set( compute_disk_types_v1::DiskTypesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/disk_types/v1/internal/disk_types_rest_logging_decorator.h b/google/cloud/compute/disk_types/v1/internal/disk_types_rest_logging_decorator.h index 0e9236358aa29..262c05cba1b46 100644 --- a/google/cloud/compute/disk_types/v1/internal/disk_types_rest_logging_decorator.h +++ b/google/cloud/compute/disk_types/v1/internal/disk_types_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISK_TYPES_V1_INTERNAL_DISK_TYPES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISK_TYPES_V1_INTERNAL_DISK_TYPES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/disk_types/v1/disk_types.pb.h" #include "google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/compute/disk_types/v1/internal/disk_types_rest_metadata_decorator.cc b/google/cloud/compute/disk_types/v1/internal/disk_types_rest_metadata_decorator.cc index 21313ab7689ac..7721d69917c6c 100644 --- a/google/cloud/compute/disk_types/v1/internal/disk_types_rest_metadata_decorator.cc +++ b/google/cloud/compute/disk_types/v1/internal/disk_types_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/disk_types/v1/disk_types.proto #include "google/cloud/compute/disk_types/v1/internal/disk_types_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/disk_types/v1/internal/disk_types_rest_metadata_decorator.h b/google/cloud/compute/disk_types/v1/internal/disk_types_rest_metadata_decorator.h index c6be52a27cd1b..f49bba68ad66e 100644 --- a/google/cloud/compute/disk_types/v1/internal/disk_types_rest_metadata_decorator.h +++ b/google/cloud/compute/disk_types/v1/internal/disk_types_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISK_TYPES_V1_INTERNAL_DISK_TYPES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISK_TYPES_V1_INTERNAL_DISK_TYPES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/disk_types/v1/disk_types.pb.h" #include "google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.cc b/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.cc index 5681155a14f3a..ae54b14bae63b 100644 --- a/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.cc +++ b/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/disk_types/v1/disk_types.proto #include "google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.h" +#include "google/cloud/compute/disk_types/v1/disk_types.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.h b/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.h index 96af6442c4479..78ab00742378b 100644 --- a/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.h +++ b/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISK_TYPES_V1_INTERNAL_DISK_TYPES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISK_TYPES_V1_INTERNAL_DISK_TYPES_REST_STUB_H +#include "google/cloud/compute/disk_types/v1/disk_types.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/disk_types/v1/internal/disk_types_tracing_connection.cc b/google/cloud/compute/disk_types/v1/internal/disk_types_tracing_connection.cc index 532c61af3a982..b4b9b840a1398 100644 --- a/google/cloud/compute/disk_types/v1/internal/disk_types_tracing_connection.cc +++ b/google/cloud/compute/disk_types/v1/internal/disk_types_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_disk_types_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DiskTypesTracingConnection::DiskTypesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -69,16 +67,12 @@ DiskTypesTracingConnection::ListDiskTypes( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDiskTypesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/disk_types/v1/internal/disk_types_tracing_connection.h b/google/cloud/compute/disk_types/v1/internal/disk_types_tracing_connection.h index cf1c117ae461c..6a0ac70153730 100644 --- a/google/cloud/compute/disk_types/v1/internal/disk_types_tracing_connection.h +++ b/google/cloud/compute/disk_types/v1/internal/disk_types_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_disk_types_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DiskTypesTracingConnection : public compute_disk_types_v1::DiskTypesConnection { public: @@ -57,8 +55,6 @@ class DiskTypesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/disks/v1/disks_connection.h b/google/cloud/compute/disks/v1/disks_connection.h index 52e4036d8e657..199caa3e494e2 100644 --- a/google/cloud/compute/disks/v1/disks_connection.h +++ b/google/cloud/compute/disks/v1/disks_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISKS_V1_DISKS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISKS_V1_DISKS_CONNECTION_H +#include "google/cloud/compute/disks/v1/disks.pb.h" #include "google/cloud/compute/disks/v1/disks_connection_idempotency_policy.h" #include "google/cloud/compute/disks/v1/internal/disks_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/disks/v1/disks_connection_idempotency_policy.h b/google/cloud/compute/disks/v1/disks_connection_idempotency_policy.h index e340a7e299230..d22799ceb8c5c 100644 --- a/google/cloud/compute/disks/v1/disks_connection_idempotency_policy.h +++ b/google/cloud/compute/disks/v1/disks_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISKS_V1_DISKS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISKS_V1_DISKS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/disks/v1/disks.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/disks/v1/disks_proto_export.h b/google/cloud/compute/disks/v1/disks_proto_export.h index 50f3a7178a2a0..4a9a5c623c90b 100644 --- a/google/cloud/compute/disks/v1/disks_proto_export.h +++ b/google/cloud/compute/disks/v1/disks_proto_export.h @@ -26,16 +26,16 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISKS_V1_DISKS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_014.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_017.pb.h" +#include "google/cloud/compute/v1/internal/common_021.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_122.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" +#include "google/cloud/compute/v1/internal/common_151.pb.h" +#include "google/cloud/compute/v1/internal/common_152.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISKS_V1_DISKS_PROTO_EXPORT_H diff --git a/google/cloud/compute/disks/v1/internal/disks_option_defaults.cc b/google/cloud/compute/disks/v1/internal/disks_option_defaults.cc index c44587cd299d7..fa5640021201d 100644 --- a/google/cloud/compute/disks/v1/internal/disks_option_defaults.cc +++ b/google/cloud/compute/disks/v1/internal/disks_option_defaults.cc @@ -40,7 +40,7 @@ Options DisksDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - compute_disks_v1::DisksLimitedTimeRetryPolicy(std::chrono::minutes(30)) + compute_disks_v1::DisksLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/disks/v1/internal/disks_rest_connection_impl.h b/google/cloud/compute/disks/v1/internal/disks_rest_connection_impl.h index 867340946d65c..d1b4c98defb06 100644 --- a/google/cloud/compute/disks/v1/internal/disks_rest_connection_impl.h +++ b/google/cloud/compute/disks/v1/internal/disks_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/disks/v1/disks_options.h" #include "google/cloud/compute/disks/v1/internal/disks_rest_stub.h" #include "google/cloud/compute/disks/v1/internal/disks_retry_traits.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/disks/v1/internal/disks_rest_logging_decorator.h b/google/cloud/compute/disks/v1/internal/disks_rest_logging_decorator.h index 347ca0b28687b..5d71c35f8bb9c 100644 --- a/google/cloud/compute/disks/v1/internal/disks_rest_logging_decorator.h +++ b/google/cloud/compute/disks/v1/internal/disks_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISKS_V1_INTERNAL_DISKS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISKS_V1_INTERNAL_DISKS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/disks/v1/disks.pb.h" #include "google/cloud/compute/disks/v1/internal/disks_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/disks/v1/internal/disks_rest_metadata_decorator.cc b/google/cloud/compute/disks/v1/internal/disks_rest_metadata_decorator.cc index 807de2f35a467..8a54cf4cb66ff 100644 --- a/google/cloud/compute/disks/v1/internal/disks_rest_metadata_decorator.cc +++ b/google/cloud/compute/disks/v1/internal/disks_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/disks/v1/disks.proto #include "google/cloud/compute/disks/v1/internal/disks_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/disks/v1/internal/disks_rest_metadata_decorator.h b/google/cloud/compute/disks/v1/internal/disks_rest_metadata_decorator.h index 807c5881b0b15..7557be5a73ddb 100644 --- a/google/cloud/compute/disks/v1/internal/disks_rest_metadata_decorator.h +++ b/google/cloud/compute/disks/v1/internal/disks_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISKS_V1_INTERNAL_DISKS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISKS_V1_INTERNAL_DISKS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/disks/v1/disks.pb.h" #include "google/cloud/compute/disks/v1/internal/disks_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/disks/v1/internal/disks_rest_stub.cc b/google/cloud/compute/disks/v1/internal/disks_rest_stub.cc index f7ef6066e38e1..4b5ae808fff2b 100644 --- a/google/cloud/compute/disks/v1/internal/disks_rest_stub.cc +++ b/google/cloud/compute/disks/v1/internal/disks_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/disks/v1/disks.proto #include "google/cloud/compute/disks/v1/internal/disks_rest_stub.h" +#include "google/cloud/compute/disks/v1/disks.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/disks/v1/internal/disks_rest_stub.h b/google/cloud/compute/disks/v1/internal/disks_rest_stub.h index 226ec07a61fcc..f9123b9a39534 100644 --- a/google/cloud/compute/disks/v1/internal/disks_rest_stub.h +++ b/google/cloud/compute/disks/v1/internal/disks_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISKS_V1_INTERNAL_DISKS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_DISKS_V1_INTERNAL_DISKS_REST_STUB_H +#include "google/cloud/compute/disks/v1/disks.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/disks/v1/internal/disks_tracing_connection.cc b/google/cloud/compute/disks/v1/internal/disks_tracing_connection.cc index 4071184a022ab..271ce8de2d4fd 100644 --- a/google/cloud/compute/disks/v1/internal/disks_tracing_connection.cc +++ b/google/cloud/compute/disks/v1/internal/disks_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_disks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DisksTracingConnection::DisksTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -485,15 +483,11 @@ DisksTracingConnection::UpdateDisk( return internal::EndSpan(std::move(span), child_->UpdateDisk(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDisksTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/disks/v1/internal/disks_tracing_connection.h b/google/cloud/compute/disks/v1/internal/disks_tracing_connection.h index d3b50df9aa47a..8cf191957cde5 100644 --- a/google/cloud/compute/disks/v1/internal/disks_tracing_connection.h +++ b/google/cloud/compute/disks/v1/internal/disks_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_disks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DisksTracingConnection : public compute_disks_v1::DisksConnection { public: ~DisksTracingConnection() override = default; @@ -234,8 +232,6 @@ class DisksTracingConnection : public compute_disks_v1::DisksConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways_connection.h b/google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways_connection.h index 25fee098fcbab..ee21aacbdd402 100644 --- a/google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways_connection.h +++ b/google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways_connection.h @@ -20,6 +20,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_EXTERNAL_VPN_GATEWAYS_V1_EXTERNAL_VPN_GATEWAYS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_EXTERNAL_VPN_GATEWAYS_V1_EXTERNAL_VPN_GATEWAYS_CONNECTION_H +#include "google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways.pb.h" #include "google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways_connection_idempotency_policy.h" #include "google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways_connection_idempotency_policy.h b/google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways_connection_idempotency_policy.h index f1967ce875fe2..5a2b0270d6e34 100644 --- a/google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways_connection_idempotency_policy.h +++ b/google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_EXTERNAL_VPN_GATEWAYS_V1_EXTERNAL_VPN_GATEWAYS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_EXTERNAL_VPN_GATEWAYS_V1_EXTERNAL_VPN_GATEWAYS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways_proto_export.h b/google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways_proto_export.h index 6cf1145ffbbf7..9e6083481dbe9 100644 --- a/google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways_proto_export.h +++ b/google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_EXTERNAL_VPN_GATEWAYS_V1_EXTERNAL_VPN_GATEWAYS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_032.pb.h" +#include "google/cloud/compute/v1/internal/common_046.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_EXTERNAL_VPN_GATEWAYS_V1_EXTERNAL_VPN_GATEWAYS_PROTO_EXPORT_H diff --git a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_option_defaults.cc b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_option_defaults.cc index df18d0c4243f9..f73ac32dc6a1d 100644 --- a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_option_defaults.cc +++ b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_option_defaults.cc @@ -45,7 +45,7 @@ Options ExternalVpnGatewaysDefaultOptions(Options options) { options.set< compute_external_vpn_gateways_v1::ExternalVpnGatewaysRetryPolicyOption>( compute_external_vpn_gateways_v1:: - ExternalVpnGatewaysLimitedTimeRetryPolicy(std::chrono::minutes(30)) + ExternalVpnGatewaysLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_logging_decorator.h b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_logging_decorator.h index 6eec805689074..c6f19affdcf31 100644 --- a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_logging_decorator.h +++ b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_EXTERNAL_VPN_GATEWAYS_V1_INTERNAL_EXTERNAL_VPN_GATEWAYS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_EXTERNAL_VPN_GATEWAYS_V1_INTERNAL_EXTERNAL_VPN_GATEWAYS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways.pb.h" #include "google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_metadata_decorator.cc b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_metadata_decorator.cc index 18f59fdd7b78d..18705296f995e 100644 --- a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_metadata_decorator.cc +++ b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways.proto #include "google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_metadata_decorator.h b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_metadata_decorator.h index 74232cb3ba24b..7f91f66d1cedf 100644 --- a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_metadata_decorator.h +++ b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_EXTERNAL_VPN_GATEWAYS_V1_INTERNAL_EXTERNAL_VPN_GATEWAYS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_EXTERNAL_VPN_GATEWAYS_V1_INTERNAL_EXTERNAL_VPN_GATEWAYS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways.pb.h" #include "google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.cc b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.cc index f1952a748cc82..2b9c051250f1e 100644 --- a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.cc +++ b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways.proto #include "google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.h" +#include "google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways.pb.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.h b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.h index 8f91716039ae8..bf5735559b65f 100644 --- a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.h +++ b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_EXTERNAL_VPN_GATEWAYS_V1_INTERNAL_EXTERNAL_VPN_GATEWAYS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_EXTERNAL_VPN_GATEWAYS_V1_INTERNAL_EXTERNAL_VPN_GATEWAYS_REST_STUB_H +#include "google/cloud/compute/external_vpn_gateways/v1/external_vpn_gateways.pb.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_tracing_connection.cc b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_tracing_connection.cc index 9ee9175f72537..dbc58fa77c5ed 100644 --- a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_tracing_connection.cc +++ b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_external_vpn_gateways_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ExternalVpnGatewaysTracingConnection::ExternalVpnGatewaysTracingConnection( std::shared_ptr< compute_external_vpn_gateways_v1::ExternalVpnGatewaysConnection> @@ -174,19 +172,15 @@ ExternalVpnGatewaysTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeExternalVpnGatewaysTracingConnection( std::shared_ptr< compute_external_vpn_gateways_v1::ExternalVpnGatewaysConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_tracing_connection.h b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_tracing_connection.h index 7b86c59bea8b1..3b9214435f3ac 100644 --- a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_tracing_connection.h +++ b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_external_vpn_gateways_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ExternalVpnGatewaysTracingConnection : public compute_external_vpn_gateways_v1::ExternalVpnGatewaysConnection { public: @@ -100,8 +98,6 @@ class ExternalVpnGatewaysTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/firewall_policies/v1/firewall_policies_connection.h b/google/cloud/compute/firewall_policies/v1/firewall_policies_connection.h index 0ad9456907c97..e97f912574edd 100644 --- a/google/cloud/compute/firewall_policies/v1/firewall_policies_connection.h +++ b/google/cloud/compute/firewall_policies/v1/firewall_policies_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALL_POLICIES_V1_FIREWALL_POLICIES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALL_POLICIES_V1_FIREWALL_POLICIES_CONNECTION_H +#include "google/cloud/compute/firewall_policies/v1/firewall_policies.pb.h" #include "google/cloud/compute/firewall_policies/v1/firewall_policies_connection_idempotency_policy.h" #include "google/cloud/compute/firewall_policies/v1/internal/firewall_policies_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/firewall_policies/v1/firewall_policies_connection_idempotency_policy.h b/google/cloud/compute/firewall_policies/v1/firewall_policies_connection_idempotency_policy.h index f4b0a15c99be1..62cecaf282207 100644 --- a/google/cloud/compute/firewall_policies/v1/firewall_policies_connection_idempotency_policy.h +++ b/google/cloud/compute/firewall_policies/v1/firewall_policies_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALL_POLICIES_V1_FIREWALL_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALL_POLICIES_V1_FIREWALL_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/firewall_policies/v1/firewall_policies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/firewall_policies/v1/firewall_policies_proto_export.h b/google/cloud/compute/firewall_policies/v1/firewall_policies_proto_export.h index 5af3fdcf13552..bcd7cd1c3dc5d 100644 --- a/google/cloud/compute/firewall_policies/v1/firewall_policies_proto_export.h +++ b/google/cloud/compute/firewall_policies/v1/firewall_policies_proto_export.h @@ -26,13 +26,13 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALL_POLICIES_V1_FIREWALL_POLICIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_036.pb.h" +#include "google/cloud/compute/v1/internal/common_038.pb.h" +#include "google/cloud/compute/v1/internal/common_039.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALL_POLICIES_V1_FIREWALL_POLICIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_option_defaults.cc b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_option_defaults.cc index 91da7b8526262..6ae7bdfd6777d 100644 --- a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_option_defaults.cc +++ b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_option_defaults.cc @@ -43,7 +43,7 @@ Options FirewallPoliciesDefaultOptions(Options options) { options.set< compute_firewall_policies_v1::FirewallPoliciesRetryPolicyOption>( compute_firewall_policies_v1::FirewallPoliciesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_logging_decorator.h b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_logging_decorator.h index f90a26b7b7882..f12035b374ea1 100644 --- a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_logging_decorator.h +++ b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALL_POLICIES_V1_INTERNAL_FIREWALL_POLICIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALL_POLICIES_V1_INTERNAL_FIREWALL_POLICIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/firewall_policies/v1/firewall_policies.pb.h" #include "google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.h" +#include "google/cloud/compute/global_organization_operations/v1/global_organization_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_metadata_decorator.cc b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_metadata_decorator.cc index e9fe00ab2cd04..d52826a7f143e 100644 --- a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_metadata_decorator.cc +++ b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/firewall_policies/v1/firewall_policies.proto #include "google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_metadata_decorator.h b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_metadata_decorator.h index 999ee0e3c8404..6bb29eb60dbfa 100644 --- a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_metadata_decorator.h +++ b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALL_POLICIES_V1_INTERNAL_FIREWALL_POLICIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALL_POLICIES_V1_INTERNAL_FIREWALL_POLICIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/firewall_policies/v1/firewall_policies.pb.h" #include "google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.h" +#include "google/cloud/compute/global_organization_operations/v1/global_organization_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.cc b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.cc index 7cd537c35e2cc..f94c01a8b1cc2 100644 --- a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.cc +++ b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/firewall_policies/v1/firewall_policies.proto #include "google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.h" +#include "google/cloud/compute/firewall_policies/v1/firewall_policies.pb.h" +#include "google/cloud/compute/global_organization_operations/v1/global_organization_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.h b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.h index bba276c555118..d9de6b7cd4e55 100644 --- a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.h +++ b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALL_POLICIES_V1_INTERNAL_FIREWALL_POLICIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALL_POLICIES_V1_INTERNAL_FIREWALL_POLICIES_REST_STUB_H +#include "google/cloud/compute/firewall_policies/v1/firewall_policies.pb.h" +#include "google/cloud/compute/global_organization_operations/v1/global_organization_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_tracing_connection.cc b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_tracing_connection.cc index d0843e5275cb0..4e4ac7975244e 100644 --- a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_tracing_connection.cc +++ b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_firewall_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FirewallPoliciesTracingConnection::FirewallPoliciesTracingConnection( std::shared_ptr child) @@ -445,17 +443,13 @@ FirewallPoliciesTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFirewallPoliciesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_tracing_connection.h b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_tracing_connection.h index 60a9a77c599b4..d45a78edc3890 100644 --- a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_tracing_connection.h +++ b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_firewall_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FirewallPoliciesTracingConnection : public compute_firewall_policies_v1::FirewallPoliciesConnection { public: @@ -195,8 +193,6 @@ class FirewallPoliciesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/firewalls/v1/firewalls_connection.h b/google/cloud/compute/firewalls/v1/firewalls_connection.h index d686a7390a33c..306f907e634a3 100644 --- a/google/cloud/compute/firewalls/v1/firewalls_connection.h +++ b/google/cloud/compute/firewalls/v1/firewalls_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALLS_V1_FIREWALLS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALLS_V1_FIREWALLS_CONNECTION_H +#include "google/cloud/compute/firewalls/v1/firewalls.pb.h" #include "google/cloud/compute/firewalls/v1/firewalls_connection_idempotency_policy.h" #include "google/cloud/compute/firewalls/v1/internal/firewalls_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/firewalls/v1/firewalls_connection_idempotency_policy.h b/google/cloud/compute/firewalls/v1/firewalls_connection_idempotency_policy.h index 664b20510f22c..57a9d5014eaf0 100644 --- a/google/cloud/compute/firewalls/v1/firewalls_connection_idempotency_policy.h +++ b/google/cloud/compute/firewalls/v1/firewalls_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALLS_V1_FIREWALLS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALLS_V1_FIREWALLS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/firewalls/v1/firewalls.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/firewalls/v1/firewalls_proto_export.h b/google/cloud/compute/firewalls/v1/firewalls_proto_export.h index d6fcd239f3fbe..7a630bcdc8e4a 100644 --- a/google/cloud/compute/firewalls/v1/firewalls_proto_export.h +++ b/google/cloud/compute/firewalls/v1/firewalls_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALLS_V1_FIREWALLS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_034.pb.h" +#include "google/cloud/compute/v1/internal/common_035.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALLS_V1_FIREWALLS_PROTO_EXPORT_H diff --git a/google/cloud/compute/firewalls/v1/internal/firewalls_option_defaults.cc b/google/cloud/compute/firewalls/v1/internal/firewalls_option_defaults.cc index fa0789b1a7b29..aa07e31f909f3 100644 --- a/google/cloud/compute/firewalls/v1/internal/firewalls_option_defaults.cc +++ b/google/cloud/compute/firewalls/v1/internal/firewalls_option_defaults.cc @@ -41,7 +41,7 @@ Options FirewallsDefaultOptions(Options options) { if (!options.has()) { options.set( compute_firewalls_v1::FirewallsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_connection_impl.h b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_connection_impl.h index 843f62cca0b09..ee060f3e03447 100644 --- a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_connection_impl.h +++ b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/firewalls/v1/firewalls_options.h" #include "google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.h" #include "google/cloud/compute/firewalls/v1/internal/firewalls_retry_traits.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_logging_decorator.h b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_logging_decorator.h index 0c4c801d4ccbd..b89384fe97444 100644 --- a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_logging_decorator.h +++ b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALLS_V1_INTERNAL_FIREWALLS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALLS_V1_INTERNAL_FIREWALLS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/firewalls/v1/firewalls.pb.h" #include "google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_metadata_decorator.cc b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_metadata_decorator.cc index d6080494489e3..ac2ca5fecbc44 100644 --- a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_metadata_decorator.cc +++ b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/firewalls/v1/firewalls.proto #include "google/cloud/compute/firewalls/v1/internal/firewalls_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_metadata_decorator.h b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_metadata_decorator.h index f78426ee1106f..92373eb1203f9 100644 --- a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_metadata_decorator.h +++ b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALLS_V1_INTERNAL_FIREWALLS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALLS_V1_INTERNAL_FIREWALLS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/firewalls/v1/firewalls.pb.h" #include "google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.cc b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.cc index b73f2d2ff33ce..49f4effd50b5c 100644 --- a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.cc +++ b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/firewalls/v1/firewalls.proto #include "google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.h" +#include "google/cloud/compute/firewalls/v1/firewalls.pb.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.h b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.h index 82b7b51e8d2a1..25405c2ca0d1f 100644 --- a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.h +++ b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALLS_V1_INTERNAL_FIREWALLS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FIREWALLS_V1_INTERNAL_FIREWALLS_REST_STUB_H +#include "google/cloud/compute/firewalls/v1/firewalls.pb.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/firewalls/v1/internal/firewalls_tracing_connection.cc b/google/cloud/compute/firewalls/v1/internal/firewalls_tracing_connection.cc index 3de8471ef6d88..98fc7e257429f 100644 --- a/google/cloud/compute/firewalls/v1/internal/firewalls_tracing_connection.cc +++ b/google/cloud/compute/firewalls/v1/internal/firewalls_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_firewalls_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FirewallsTracingConnection::FirewallsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -178,16 +176,12 @@ FirewallsTracingConnection::UpdateFirewall( return internal::EndSpan(std::move(span), child_->UpdateFirewall(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFirewallsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/firewalls/v1/internal/firewalls_tracing_connection.h b/google/cloud/compute/firewalls/v1/internal/firewalls_tracing_connection.h index 5dd274ecdabad..d002d9ee7d3e4 100644 --- a/google/cloud/compute/firewalls/v1/internal/firewalls_tracing_connection.h +++ b/google/cloud/compute/firewalls/v1/internal/firewalls_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_firewalls_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FirewallsTracingConnection : public compute_firewalls_v1::FirewallsConnection { public: @@ -100,8 +98,6 @@ class FirewallsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/forwarding_rules/v1/forwarding_rules_connection.h b/google/cloud/compute/forwarding_rules/v1/forwarding_rules_connection.h index 916e1237698c3..a1e833bb376a1 100644 --- a/google/cloud/compute/forwarding_rules/v1/forwarding_rules_connection.h +++ b/google/cloud/compute/forwarding_rules/v1/forwarding_rules_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FORWARDING_RULES_V1_FORWARDING_RULES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FORWARDING_RULES_V1_FORWARDING_RULES_CONNECTION_H +#include "google/cloud/compute/forwarding_rules/v1/forwarding_rules.pb.h" #include "google/cloud/compute/forwarding_rules/v1/forwarding_rules_connection_idempotency_policy.h" #include "google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/forwarding_rules/v1/forwarding_rules_connection_idempotency_policy.h b/google/cloud/compute/forwarding_rules/v1/forwarding_rules_connection_idempotency_policy.h index 405c7b1026318..1a835c08eead2 100644 --- a/google/cloud/compute/forwarding_rules/v1/forwarding_rules_connection_idempotency_policy.h +++ b/google/cloud/compute/forwarding_rules/v1/forwarding_rules_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FORWARDING_RULES_V1_FORWARDING_RULES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FORWARDING_RULES_V1_FORWARDING_RULES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/forwarding_rules/v1/forwarding_rules.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/forwarding_rules/v1/forwarding_rules_proto_export.h b/google/cloud/compute/forwarding_rules/v1/forwarding_rules_proto_export.h index 31d4d9aefd639..61a7f37821cf3 100644 --- a/google/cloud/compute/forwarding_rules/v1/forwarding_rules_proto_export.h +++ b/google/cloud/compute/forwarding_rules/v1/forwarding_rules_proto_export.h @@ -26,12 +26,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FORWARDING_RULES_V1_FORWARDING_RULES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_041.pb.h" +#include "google/cloud/compute/v1/internal/common_042.pb.h" +#include "google/cloud/compute/v1/internal/common_082.pb.h" +#include "google/cloud/compute/v1/internal/common_107.pb.h" +#include "google/cloud/compute/v1/internal/common_140.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FORWARDING_RULES_V1_FORWARDING_RULES_PROTO_EXPORT_H diff --git a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_option_defaults.cc b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_option_defaults.cc index 00477aaec5507..bc958512e7caa 100644 --- a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_option_defaults.cc +++ b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_option_defaults.cc @@ -42,7 +42,7 @@ Options ForwardingRulesDefaultOptions(Options options) { compute_forwarding_rules_v1::ForwardingRulesRetryPolicyOption>()) { options.set( compute_forwarding_rules_v1::ForwardingRulesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_connection_impl.h b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_connection_impl.h index 6cc9c9e198436..4a51bd342ad36 100644 --- a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_connection_impl.h +++ b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/forwarding_rules/v1/forwarding_rules_options.h" #include "google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.h" #include "google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_retry_traits.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_logging_decorator.h b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_logging_decorator.h index ddb6272802446..33ef656c88dad 100644 --- a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_logging_decorator.h +++ b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FORWARDING_RULES_V1_INTERNAL_FORWARDING_RULES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FORWARDING_RULES_V1_INTERNAL_FORWARDING_RULES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/forwarding_rules/v1/forwarding_rules.pb.h" #include "google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_metadata_decorator.cc b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_metadata_decorator.cc index eae05e9c57f47..2824c7ee479c5 100644 --- a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_metadata_decorator.cc +++ b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/forwarding_rules/v1/forwarding_rules.proto #include "google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_metadata_decorator.h b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_metadata_decorator.h index d1fea6b7b4ceb..65b98747489b1 100644 --- a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_metadata_decorator.h +++ b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FORWARDING_RULES_V1_INTERNAL_FORWARDING_RULES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FORWARDING_RULES_V1_INTERNAL_FORWARDING_RULES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/forwarding_rules/v1/forwarding_rules.pb.h" #include "google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.cc b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.cc index e0c5917e2ce89..1a10a95c99e4c 100644 --- a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.cc +++ b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/forwarding_rules/v1/forwarding_rules.proto #include "google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.h" +#include "google/cloud/compute/forwarding_rules/v1/forwarding_rules.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.h b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.h index f806ae1681a88..0d40ad443b4fd 100644 --- a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.h +++ b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FORWARDING_RULES_V1_INTERNAL_FORWARDING_RULES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_FORWARDING_RULES_V1_INTERNAL_FORWARDING_RULES_REST_STUB_H +#include "google/cloud/compute/forwarding_rules/v1/forwarding_rules.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_tracing_connection.cc b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_tracing_connection.cc index 626f5961cf85a..3cee62888d2fd 100644 --- a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_tracing_connection.cc +++ b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_forwarding_rules_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ForwardingRulesTracingConnection::ForwardingRulesTracingConnection( std::shared_ptr child) @@ -239,17 +237,13 @@ ForwardingRulesTracingConnection::SetTarget( return internal::EndSpan(std::move(span), child_->SetTarget(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeForwardingRulesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_tracing_connection.h b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_tracing_connection.h index a885541afb5cd..d78ed59f062c7 100644 --- a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_tracing_connection.h +++ b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_forwarding_rules_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ForwardingRulesTracingConnection : public compute_forwarding_rules_v1::ForwardingRulesConnection { public: @@ -120,8 +118,6 @@ class ForwardingRulesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/global_addresses/v1/global_addresses_connection.h b/google/cloud/compute/global_addresses/v1/global_addresses_connection.h index 36af8d2e1aa68..6821a8893b501 100644 --- a/google/cloud/compute/global_addresses/v1/global_addresses_connection.h +++ b/google/cloud/compute/global_addresses/v1/global_addresses_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ADDRESSES_V1_GLOBAL_ADDRESSES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ADDRESSES_V1_GLOBAL_ADDRESSES_CONNECTION_H +#include "google/cloud/compute/global_addresses/v1/global_addresses.pb.h" #include "google/cloud/compute/global_addresses/v1/global_addresses_connection_idempotency_policy.h" #include "google/cloud/compute/global_addresses/v1/internal/global_addresses_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/global_addresses/v1/global_addresses_connection_idempotency_policy.h b/google/cloud/compute/global_addresses/v1/global_addresses_connection_idempotency_policy.h index 05ac635ead64c..9dd39bbc3f342 100644 --- a/google/cloud/compute/global_addresses/v1/global_addresses_connection_idempotency_policy.h +++ b/google/cloud/compute/global_addresses/v1/global_addresses_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ADDRESSES_V1_GLOBAL_ADDRESSES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ADDRESSES_V1_GLOBAL_ADDRESSES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/global_addresses/v1/global_addresses.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/global_addresses/v1/global_addresses_proto_export.h b/google/cloud/compute/global_addresses/v1/global_addresses_proto_export.h index 2b6e035d75b88..b0644b347d78c 100644 --- a/google/cloud/compute/global_addresses/v1/global_addresses_proto_export.h +++ b/google/cloud/compute/global_addresses/v1/global_addresses_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ADDRESSES_V1_GLOBAL_ADDRESSES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_004.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_044.pb.h" +#include "google/cloud/compute/v1/internal/common_046.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ADDRESSES_V1_GLOBAL_ADDRESSES_PROTO_EXPORT_H diff --git a/google/cloud/compute/global_addresses/v1/internal/global_addresses_option_defaults.cc b/google/cloud/compute/global_addresses/v1/internal/global_addresses_option_defaults.cc index ae1fe864566c7..83560bdd50298 100644 --- a/google/cloud/compute/global_addresses/v1/internal/global_addresses_option_defaults.cc +++ b/google/cloud/compute/global_addresses/v1/internal/global_addresses_option_defaults.cc @@ -42,7 +42,7 @@ Options GlobalAddressesDefaultOptions(Options options) { compute_global_addresses_v1::GlobalAddressesRetryPolicyOption>()) { options.set( compute_global_addresses_v1::GlobalAddressesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_connection_impl.h b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_connection_impl.h index 9dcebe11efcd4..c4728b4212c91 100644 --- a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_connection_impl.h +++ b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/global_addresses/v1/global_addresses_options.h" #include "google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.h" #include "google/cloud/compute/global_addresses/v1/internal/global_addresses_retry_traits.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_logging_decorator.h b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_logging_decorator.h index 8f746c9b5fbf7..d5ba84324f16b 100644 --- a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_logging_decorator.h +++ b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ADDRESSES_V1_INTERNAL_GLOBAL_ADDRESSES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ADDRESSES_V1_INTERNAL_GLOBAL_ADDRESSES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_addresses/v1/global_addresses.pb.h" #include "google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_metadata_decorator.cc b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_metadata_decorator.cc index 582241dcfbb79..e22bf20cf3676 100644 --- a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_metadata_decorator.cc +++ b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/global_addresses/v1/global_addresses.proto #include "google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_metadata_decorator.h b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_metadata_decorator.h index 3e7abe2d3cb82..1aa0271e26443 100644 --- a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_metadata_decorator.h +++ b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ADDRESSES_V1_INTERNAL_GLOBAL_ADDRESSES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ADDRESSES_V1_INTERNAL_GLOBAL_ADDRESSES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_addresses/v1/global_addresses.pb.h" #include "google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.cc b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.cc index aec352a15c1ea..731ebc3898ffd 100644 --- a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.cc +++ b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/global_addresses/v1/global_addresses.proto #include "google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.h" +#include "google/cloud/compute/global_addresses/v1/global_addresses.pb.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.h b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.h index 29d639968d48f..f1f1a4cbff8d1 100644 --- a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.h +++ b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ADDRESSES_V1_INTERNAL_GLOBAL_ADDRESSES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ADDRESSES_V1_INTERNAL_GLOBAL_ADDRESSES_REST_STUB_H +#include "google/cloud/compute/global_addresses/v1/global_addresses.pb.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/global_addresses/v1/internal/global_addresses_tracing_connection.cc b/google/cloud/compute/global_addresses/v1/internal/global_addresses_tracing_connection.cc index 43ce077775d21..34b6c4c69b648 100644 --- a/google/cloud/compute/global_addresses/v1/internal/global_addresses_tracing_connection.cc +++ b/google/cloud/compute/global_addresses/v1/internal/global_addresses_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_global_addresses_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GlobalAddressesTracingConnection::GlobalAddressesTracingConnection( std::shared_ptr child) @@ -175,17 +173,13 @@ GlobalAddressesTracingConnection::SetLabels( return internal::EndSpan(std::move(span), child_->SetLabels(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGlobalAddressesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/global_addresses/v1/internal/global_addresses_tracing_connection.h b/google/cloud/compute/global_addresses/v1/internal/global_addresses_tracing_connection.h index c37b2c276a4e0..9ee4fa21ee56b 100644 --- a/google/cloud/compute/global_addresses/v1/internal/global_addresses_tracing_connection.h +++ b/google/cloud/compute/global_addresses/v1/internal/global_addresses_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_global_addresses_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GlobalAddressesTracingConnection : public compute_global_addresses_v1::GlobalAddressesConnection { public: @@ -100,8 +98,6 @@ class GlobalAddressesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules_connection.h b/google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules_connection.h index d474a3e7a2b53..52f0a05ea09b3 100644 --- a/google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules_connection.h +++ b/google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules_connection.h @@ -20,6 +20,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_FORWARDING_RULES_V1_GLOBAL_FORWARDING_RULES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_FORWARDING_RULES_V1_GLOBAL_FORWARDING_RULES_CONNECTION_H +#include "google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules.pb.h" #include "google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules_connection_idempotency_policy.h" #include "google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules_connection_idempotency_policy.h b/google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules_connection_idempotency_policy.h index 9638038e19b43..0213beb4d3e29 100644 --- a/google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules_connection_idempotency_policy.h +++ b/google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_FORWARDING_RULES_V1_GLOBAL_FORWARDING_RULES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_FORWARDING_RULES_V1_GLOBAL_FORWARDING_RULES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules_proto_export.h b/google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules_proto_export.h index 5a0ab360334a7..c09990225c10b 100644 --- a/google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules_proto_export.h +++ b/google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules_proto_export.h @@ -26,11 +26,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_FORWARDING_RULES_V1_GLOBAL_FORWARDING_RULES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_041.pb.h" +#include "google/cloud/compute/v1/internal/common_046.pb.h" +#include "google/cloud/compute/v1/internal/common_082.pb.h" +#include "google/cloud/compute/v1/internal/common_140.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_FORWARDING_RULES_V1_GLOBAL_FORWARDING_RULES_PROTO_EXPORT_H diff --git a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_option_defaults.cc b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_option_defaults.cc index a79ab5851dc51..5f7142d29ca8d 100644 --- a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_option_defaults.cc +++ b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_option_defaults.cc @@ -46,7 +46,7 @@ Options GlobalForwardingRulesDefaultOptions(Options options) { GlobalForwardingRulesRetryPolicyOption>( compute_global_forwarding_rules_v1:: GlobalForwardingRulesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_logging_decorator.h b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_logging_decorator.h index b394d85c984cf..5062878f48f4e 100644 --- a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_logging_decorator.h +++ b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_FORWARDING_RULES_V1_INTERNAL_GLOBAL_FORWARDING_RULES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_FORWARDING_RULES_V1_INTERNAL_GLOBAL_FORWARDING_RULES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules.pb.h" #include "google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_metadata_decorator.cc b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_metadata_decorator.cc index 26638bce4726a..088f4a1d1e44a 100644 --- a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_metadata_decorator.cc +++ b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules.proto #include "google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_metadata_decorator.h b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_metadata_decorator.h index c6189a6195fba..d16c3cdf4e844 100644 --- a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_metadata_decorator.h +++ b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_FORWARDING_RULES_V1_INTERNAL_GLOBAL_FORWARDING_RULES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_FORWARDING_RULES_V1_INTERNAL_GLOBAL_FORWARDING_RULES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules.pb.h" #include "google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.cc b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.cc index 0f6bb7bf7cef2..41cecffb11fd7 100644 --- a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.cc +++ b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules.proto #include "google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.h" +#include "google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules.pb.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.h b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.h index 0a7bd54efad4c..6fd78e018d521 100644 --- a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.h +++ b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_FORWARDING_RULES_V1_INTERNAL_GLOBAL_FORWARDING_RULES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_FORWARDING_RULES_V1_INTERNAL_GLOBAL_FORWARDING_RULES_REST_STUB_H +#include "google/cloud/compute/global_forwarding_rules/v1/global_forwarding_rules.pb.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_tracing_connection.cc b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_tracing_connection.cc index c1518bc87afa3..97edea702f291 100644 --- a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_tracing_connection.cc +++ b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_global_forwarding_rules_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GlobalForwardingRulesTracingConnection::GlobalForwardingRulesTracingConnection( std::shared_ptr< compute_global_forwarding_rules_v1::GlobalForwardingRulesConnection> @@ -230,20 +228,16 @@ GlobalForwardingRulesTracingConnection::SetTarget( return internal::EndSpan(std::move(span), child_->SetTarget(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_global_forwarding_rules_v1::GlobalForwardingRulesConnection> MakeGlobalForwardingRulesTracingConnection( std::shared_ptr< compute_global_forwarding_rules_v1::GlobalForwardingRulesConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_tracing_connection.h b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_tracing_connection.h index 9f1f84a8948ee..4380dc1a6fa56 100644 --- a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_tracing_connection.h +++ b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_global_forwarding_rules_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GlobalForwardingRulesTracingConnection : public compute_global_forwarding_rules_v1:: GlobalForwardingRulesConnection { @@ -119,8 +117,6 @@ class GlobalForwardingRulesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups_connection.h b/google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups_connection.h index c040c4b929b09..919057308d41c 100644 --- a/google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups_connection.h +++ b/google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups_connection.h @@ -20,6 +20,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_NETWORK_ENDPOINT_GROUPS_V1_GLOBAL_NETWORK_ENDPOINT_GROUPS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_NETWORK_ENDPOINT_GROUPS_V1_GLOBAL_NETWORK_ENDPOINT_GROUPS_CONNECTION_H +#include "google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups.pb.h" #include "google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups_connection_idempotency_policy.h" #include "google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups_connection_idempotency_policy.h b/google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups_connection_idempotency_policy.h index 58992201b2b80..81906b6d238a9 100644 --- a/google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups_connection_idempotency_policy.h +++ b/google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_NETWORK_ENDPOINT_GROUPS_V1_GLOBAL_NETWORK_ENDPOINT_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_NETWORK_ENDPOINT_GROUPS_V1_GLOBAL_NETWORK_ENDPOINT_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups_proto_export.h b/google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups_proto_export.h index 3a78587fd7ce8..85c0a2ff64177 100644 --- a/google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups_proto_export.h +++ b/google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_NETWORK_ENDPOINT_GROUPS_V1_GLOBAL_NETWORK_ENDPOINT_GROUPS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_012.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_045.pb.h" +#include "google/cloud/compute/v1/internal/common_049.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_NETWORK_ENDPOINT_GROUPS_V1_GLOBAL_NETWORK_ENDPOINT_GROUPS_PROTO_EXPORT_H diff --git a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_option_defaults.cc b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_option_defaults.cc index 517cc47bd7a8b..a5207875a16c4 100644 --- a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_option_defaults.cc +++ b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_option_defaults.cc @@ -47,7 +47,7 @@ Options GlobalNetworkEndpointGroupsDefaultOptions(Options options) { GlobalNetworkEndpointGroupsRetryPolicyOption>( compute_global_network_endpoint_groups_v1:: GlobalNetworkEndpointGroupsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_logging_decorator.h b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_logging_decorator.h index df034ecdbcc1d..e9348ed5e4351 100644 --- a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_logging_decorator.h +++ b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_NETWORK_ENDPOINT_GROUPS_V1_INTERNAL_GLOBAL_NETWORK_ENDPOINT_GROUPS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_NETWORK_ENDPOINT_GROUPS_V1_INTERNAL_GLOBAL_NETWORK_ENDPOINT_GROUPS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups.pb.h" #include "google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_metadata_decorator.cc b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_metadata_decorator.cc index 1f831f6a68bb5..548c530f858fd 100644 --- a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_metadata_decorator.cc +++ b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups.proto #include "google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_metadata_decorator.h b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_metadata_decorator.h index f9f27c66d3339..62ac23ede3332 100644 --- a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_metadata_decorator.h +++ b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_NETWORK_ENDPOINT_GROUPS_V1_INTERNAL_GLOBAL_NETWORK_ENDPOINT_GROUPS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_NETWORK_ENDPOINT_GROUPS_V1_INTERNAL_GLOBAL_NETWORK_ENDPOINT_GROUPS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups.pb.h" #include "google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.cc b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.cc index 7a9d0a7f5d0e5..8ed5d61da2288 100644 --- a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.cc +++ b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups.proto #include "google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.h" +#include "google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups.pb.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.h b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.h index a0d086cbc808b..54bf65b56f883 100644 --- a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.h +++ b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_NETWORK_ENDPOINT_GROUPS_V1_INTERNAL_GLOBAL_NETWORK_ENDPOINT_GROUPS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_NETWORK_ENDPOINT_GROUPS_V1_INTERNAL_GLOBAL_NETWORK_ENDPOINT_GROUPS_REST_STUB_H +#include "google/cloud/compute/global_network_endpoint_groups/v1/global_network_endpoint_groups.pb.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_tracing_connection.cc b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_tracing_connection.cc index 395ecd76fe812..0d1ca9230a3a0 100644 --- a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_tracing_connection.cc +++ b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_global_network_endpoint_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GlobalNetworkEndpointGroupsTracingConnection:: GlobalNetworkEndpointGroupsTracingConnection( std::shared_ptr MakeGlobalNetworkEndpointGroupsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_tracing_connection.h b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_tracing_connection.h index d9cb04e416891..b5cf80e70d826 100644 --- a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_tracing_connection.h +++ b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_global_network_endpoint_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GlobalNetworkEndpointGroupsTracingConnection : public compute_global_network_endpoint_groups_v1:: GlobalNetworkEndpointGroupsConnection { @@ -123,8 +121,6 @@ class GlobalNetworkEndpointGroupsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/global_operations/v1/global_operations_connection.h b/google/cloud/compute/global_operations/v1/global_operations_connection.h index bb1fa3207966f..7b37e9c128b40 100644 --- a/google/cloud/compute/global_operations/v1/global_operations_connection.h +++ b/google/cloud/compute/global_operations/v1/global_operations_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_OPERATIONS_V1_GLOBAL_OPERATIONS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_OPERATIONS_V1_GLOBAL_OPERATIONS_CONNECTION_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/global_operations/v1/global_operations_connection_idempotency_policy.h" #include "google/cloud/compute/global_operations/v1/internal/global_operations_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/global_operations/v1/global_operations_connection_idempotency_policy.h b/google/cloud/compute/global_operations/v1/global_operations_connection_idempotency_policy.h index 1456bd7a638c1..eb9db1c7005f8 100644 --- a/google/cloud/compute/global_operations/v1/global_operations_connection_idempotency_policy.h +++ b/google/cloud/compute/global_operations/v1/global_operations_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_OPERATIONS_V1_GLOBAL_OPERATIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_OPERATIONS_V1_GLOBAL_OPERATIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/global_operations/v1/global_operations_proto_export.h b/google/cloud/compute/global_operations/v1/global_operations_proto_export.h index 948edb0e600d5..a852292680565 100644 --- a/google/cloud/compute/global_operations/v1/global_operations_proto_export.h +++ b/google/cloud/compute/global_operations/v1/global_operations_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_OPERATIONS_V1_GLOBAL_OPERATIONS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_091.pb.h" +#include "google/cloud/compute/v1/internal/common_092.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_OPERATIONS_V1_GLOBAL_OPERATIONS_PROTO_EXPORT_H diff --git a/google/cloud/compute/global_operations/v1/internal/global_operations_option_defaults.cc b/google/cloud/compute/global_operations/v1/internal/global_operations_option_defaults.cc index 63fc80a6e1705..12cadf4a038c7 100644 --- a/google/cloud/compute/global_operations/v1/internal/global_operations_option_defaults.cc +++ b/google/cloud/compute/global_operations/v1/internal/global_operations_option_defaults.cc @@ -43,7 +43,7 @@ Options GlobalOperationsDefaultOptions(Options options) { options.set< compute_global_operations_v1::GlobalOperationsRetryPolicyOption>( compute_global_operations_v1::GlobalOperationsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include #include diff --git a/google/cloud/compute/global_operations/v1/internal/global_operations_rest_metadata_decorator.cc b/google/cloud/compute/global_operations/v1/internal/global_operations_rest_metadata_decorator.cc index b973f74e831c0..2e0d6ee8c111e 100644 --- a/google/cloud/compute/global_operations/v1/internal/global_operations_rest_metadata_decorator.cc +++ b/google/cloud/compute/global_operations/v1/internal/global_operations_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/global_operations/v1/global_operations.proto #include "google/cloud/compute/global_operations/v1/internal/global_operations_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/global_operations/v1/internal/global_operations_rest_metadata_decorator.h b/google/cloud/compute/global_operations/v1/internal/global_operations_rest_metadata_decorator.h index 2f4d226ed34a0..c691a96c4b976 100644 --- a/google/cloud/compute/global_operations/v1/internal/global_operations_rest_metadata_decorator.h +++ b/google/cloud/compute/global_operations/v1/internal/global_operations_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_OPERATIONS_V1_INTERNAL_GLOBAL_OPERATIONS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_OPERATIONS_V1_INTERNAL_GLOBAL_OPERATIONS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.cc b/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.cc index 7053cc0447708..148dae3314979 100644 --- a/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.cc +++ b/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/global_operations/v1/global_operations.proto #include "google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.h b/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.h index 63ca4d5701179..99fa038c34624 100644 --- a/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.h +++ b/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_OPERATIONS_V1_INTERNAL_GLOBAL_OPERATIONS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_OPERATIONS_V1_INTERNAL_GLOBAL_OPERATIONS_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/global_operations/v1/internal/global_operations_tracing_connection.cc b/google/cloud/compute/global_operations/v1/internal/global_operations_tracing_connection.cc index 4531311a30dd5..880f012c46728 100644 --- a/google/cloud/compute/global_operations/v1/internal/global_operations_tracing_connection.cc +++ b/google/cloud/compute/global_operations/v1/internal/global_operations_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_global_operations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GlobalOperationsTracingConnection::GlobalOperationsTracingConnection( std::shared_ptr child) @@ -93,17 +91,13 @@ GlobalOperationsTracingConnection::Wait( return internal::EndSpan(*span, child_->Wait(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGlobalOperationsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/global_operations/v1/internal/global_operations_tracing_connection.h b/google/cloud/compute/global_operations/v1/internal/global_operations_tracing_connection.h index 6d34354421f18..c214ebdea70fd 100644 --- a/google/cloud/compute/global_operations/v1/internal/global_operations_tracing_connection.h +++ b/google/cloud/compute/global_operations/v1/internal/global_operations_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_global_operations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GlobalOperationsTracingConnection : public compute_global_operations_v1::GlobalOperationsConnection { public: @@ -67,8 +65,6 @@ class GlobalOperationsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/global_organization_operations/v1/global_organization_operations_connection.h b/google/cloud/compute/global_organization_operations/v1/global_organization_operations_connection.h index 6abcdf536143c..8d0853fbcae26 100644 --- a/google/cloud/compute/global_organization_operations/v1/global_organization_operations_connection.h +++ b/google/cloud/compute/global_organization_operations/v1/global_organization_operations_connection.h @@ -20,6 +20,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ORGANIZATION_OPERATIONS_V1_GLOBAL_ORGANIZATION_OPERATIONS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ORGANIZATION_OPERATIONS_V1_GLOBAL_ORGANIZATION_OPERATIONS_CONNECTION_H +#include "google/cloud/compute/global_organization_operations/v1/global_organization_operations.pb.h" #include "google/cloud/compute/global_organization_operations/v1/global_organization_operations_connection_idempotency_policy.h" #include "google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -28,7 +29,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/global_organization_operations/v1/global_organization_operations_connection_idempotency_policy.h b/google/cloud/compute/global_organization_operations/v1/global_organization_operations_connection_idempotency_policy.h index f570f75b64a04..85f7e1e71c11a 100644 --- a/google/cloud/compute/global_organization_operations/v1/global_organization_operations_connection_idempotency_policy.h +++ b/google/cloud/compute/global_organization_operations/v1/global_organization_operations_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ORGANIZATION_OPERATIONS_V1_GLOBAL_ORGANIZATION_OPERATIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ORGANIZATION_OPERATIONS_V1_GLOBAL_ORGANIZATION_OPERATIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/global_organization_operations/v1/global_organization_operations.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/global_organization_operations/v1/global_organization_operations_proto_export.h b/google/cloud/compute/global_organization_operations/v1/global_organization_operations_proto_export.h index 9cfc65b086722..dabfdd3777981 100644 --- a/google/cloud/compute/global_organization_operations/v1/global_organization_operations_proto_export.h +++ b/google/cloud/compute/global_organization_operations/v1/global_organization_operations_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ORGANIZATION_OPERATIONS_V1_GLOBAL_ORGANIZATION_OPERATIONS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_092.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ORGANIZATION_OPERATIONS_V1_GLOBAL_ORGANIZATION_OPERATIONS_PROTO_EXPORT_H diff --git a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_option_defaults.cc b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_option_defaults.cc index 80a39ac5c40ad..f6a36af6b5fff 100644 --- a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_option_defaults.cc +++ b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_option_defaults.cc @@ -47,7 +47,7 @@ Options GlobalOrganizationOperationsDefaultOptions(Options options) { GlobalOrganizationOperationsRetryPolicyOption>( compute_global_organization_operations_v1:: GlobalOrganizationOperationsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include #include diff --git a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_metadata_decorator.cc b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_metadata_decorator.cc index c53a9abd19663..ea3d8e0a0a694 100644 --- a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_metadata_decorator.cc +++ b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/global_organization_operations/v1/global_organization_operations.proto #include "google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_metadata_decorator.h b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_metadata_decorator.h index 7706b415dfdec..ea8cc7448a2e3 100644 --- a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_metadata_decorator.h +++ b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ORGANIZATION_OPERATIONS_V1_INTERNAL_GLOBAL_ORGANIZATION_OPERATIONS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ORGANIZATION_OPERATIONS_V1_INTERNAL_GLOBAL_ORGANIZATION_OPERATIONS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_organization_operations/v1/global_organization_operations.pb.h" #include "google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_stub.cc b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_stub.cc index 6aa5cfdb5a12f..43edc23418fd3 100644 --- a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_stub.cc +++ b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_stub.cc @@ -18,11 +18,11 @@ // google/cloud/compute/global_organization_operations/v1/global_organization_operations.proto #include "google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_stub.h" +#include "google/cloud/compute/global_organization_operations/v1/global_organization_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_stub.h b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_stub.h index baa90d8f1188b..3ce16faec42d5 100644 --- a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_stub.h +++ b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_stub.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ORGANIZATION_OPERATIONS_V1_INTERNAL_GLOBAL_ORGANIZATION_OPERATIONS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_ORGANIZATION_OPERATIONS_V1_INTERNAL_GLOBAL_ORGANIZATION_OPERATIONS_REST_STUB_H +#include "google/cloud/compute/global_organization_operations/v1/global_organization_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_tracing_connection.cc b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_tracing_connection.cc index 19894b8612dee..d5c7c30490015 100644 --- a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_tracing_connection.cc +++ b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_global_organization_operations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GlobalOrganizationOperationsTracingConnection:: GlobalOrganizationOperationsTracingConnection( std::shared_ptr MakeGlobalOrganizationOperationsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_tracing_connection.h b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_tracing_connection.h index b5a00a6c77941..1d551b3822eba 100644 --- a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_tracing_connection.h +++ b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_global_organization_operations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GlobalOrganizationOperationsTracingConnection : public compute_global_organization_operations_v1:: GlobalOrganizationOperationsConnection { @@ -63,8 +61,6 @@ class GlobalOrganizationOperationsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes_connection.h b/google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes_connection.h index e482a2f2f1c02..889c1f83b27aa 100644 --- a/google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes_connection.h +++ b/google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes_connection.h @@ -20,6 +20,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_PUBLIC_DELEGATED_PREFIXES_V1_GLOBAL_PUBLIC_DELEGATED_PREFIXES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_PUBLIC_DELEGATED_PREFIXES_V1_GLOBAL_PUBLIC_DELEGATED_PREFIXES_CONNECTION_H +#include "google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes.pb.h" #include "google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes_connection_idempotency_policy.h" #include "google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes_connection_idempotency_policy.h b/google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes_connection_idempotency_policy.h index 02f5160520231..518754b9a6d8b 100644 --- a/google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes_connection_idempotency_policy.h +++ b/google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_PUBLIC_DELEGATED_PREFIXES_V1_GLOBAL_PUBLIC_DELEGATED_PREFIXES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_PUBLIC_DELEGATED_PREFIXES_V1_GLOBAL_PUBLIC_DELEGATED_PREFIXES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes_proto_export.h b/google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes_proto_export.h index dcec4963a1567..3bdf0adb99009 100644 --- a/google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes_proto_export.h +++ b/google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_PUBLIC_DELEGATED_PREFIXES_V1_GLOBAL_PUBLIC_DELEGATED_PREFIXES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_096.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_PUBLIC_DELEGATED_PREFIXES_V1_GLOBAL_PUBLIC_DELEGATED_PREFIXES_PROTO_EXPORT_H diff --git a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_option_defaults.cc b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_option_defaults.cc index b4895e46b6e0a..a617d69838759 100644 --- a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_option_defaults.cc +++ b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_option_defaults.cc @@ -47,7 +47,7 @@ Options GlobalPublicDelegatedPrefixesDefaultOptions(Options options) { GlobalPublicDelegatedPrefixesRetryPolicyOption>( compute_global_public_delegated_prefixes_v1:: GlobalPublicDelegatedPrefixesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_logging_decorator.h b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_logging_decorator.h index e5b594868ac48..fb49a38450665 100644 --- a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_logging_decorator.h +++ b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_PUBLIC_DELEGATED_PREFIXES_V1_INTERNAL_GLOBAL_PUBLIC_DELEGATED_PREFIXES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_PUBLIC_DELEGATED_PREFIXES_V1_INTERNAL_GLOBAL_PUBLIC_DELEGATED_PREFIXES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes.pb.h" #include "google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_metadata_decorator.cc b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_metadata_decorator.cc index 5ac5f9624f19b..ad6cebb348ec7 100644 --- a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_metadata_decorator.cc +++ b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes.proto #include "google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_metadata_decorator.h b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_metadata_decorator.h index 5b408b13209ed..f1b776d49f4ee 100644 --- a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_metadata_decorator.h +++ b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_PUBLIC_DELEGATED_PREFIXES_V1_INTERNAL_GLOBAL_PUBLIC_DELEGATED_PREFIXES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_PUBLIC_DELEGATED_PREFIXES_V1_INTERNAL_GLOBAL_PUBLIC_DELEGATED_PREFIXES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes.pb.h" #include "google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.cc b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.cc index 9fc1f7d2baa1f..8331b8c39d350 100644 --- a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.cc +++ b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes.proto #include "google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.h b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.h index 96f7f5af217b9..bb18c3812e678 100644 --- a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.h +++ b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_PUBLIC_DELEGATED_PREFIXES_V1_INTERNAL_GLOBAL_PUBLIC_DELEGATED_PREFIXES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_GLOBAL_PUBLIC_DELEGATED_PREFIXES_V1_INTERNAL_GLOBAL_PUBLIC_DELEGATED_PREFIXES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/global_public_delegated_prefixes/v1/global_public_delegated_prefixes.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_tracing_connection.cc b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_tracing_connection.cc index 8214dab74573e..fdbb9e2dc10df 100644 --- a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_tracing_connection.cc +++ b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_global_public_delegated_prefixes_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GlobalPublicDelegatedPrefixesTracingConnection:: GlobalPublicDelegatedPrefixesTracingConnection( std::shared_ptrPatchPublicDelegatedPrefix(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGlobalPublicDelegatedPrefixesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_tracing_connection.h b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_tracing_connection.h index 4d60c19389a68..91fc3331b55ec 100644 --- a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_tracing_connection.h +++ b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_global_public_delegated_prefixes_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GlobalPublicDelegatedPrefixesTracingConnection : public compute_global_public_delegated_prefixes_v1:: GlobalPublicDelegatedPrefixesConnection { @@ -105,8 +103,6 @@ class GlobalPublicDelegatedPrefixesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/health_checks/v1/health_checks_connection.h b/google/cloud/compute/health_checks/v1/health_checks_connection.h index 2b1d604807980..64cac99cbb912 100644 --- a/google/cloud/compute/health_checks/v1/health_checks_connection.h +++ b/google/cloud/compute/health_checks/v1/health_checks_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HEALTH_CHECKS_V1_HEALTH_CHECKS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HEALTH_CHECKS_V1_HEALTH_CHECKS_CONNECTION_H +#include "google/cloud/compute/health_checks/v1/health_checks.pb.h" #include "google/cloud/compute/health_checks/v1/health_checks_connection_idempotency_policy.h" #include "google/cloud/compute/health_checks/v1/internal/health_checks_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/health_checks/v1/health_checks_connection_idempotency_policy.h b/google/cloud/compute/health_checks/v1/health_checks_connection_idempotency_policy.h index de1dd32d0708e..33509b33bac1c 100644 --- a/google/cloud/compute/health_checks/v1/health_checks_connection_idempotency_policy.h +++ b/google/cloud/compute/health_checks/v1/health_checks_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HEALTH_CHECKS_V1_HEALTH_CHECKS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HEALTH_CHECKS_V1_HEALTH_CHECKS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/health_checks/v1/health_checks.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/health_checks/v1/health_checks_proto_export.h b/google/cloud/compute/health_checks/v1/health_checks_proto_export.h index 370a45ec6955a..5c60b105d1b1d 100644 --- a/google/cloud/compute/health_checks/v1/health_checks_proto_export.h +++ b/google/cloud/compute/health_checks/v1/health_checks_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HEALTH_CHECKS_V1_HEALTH_CHECKS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_043.pb.h" +#include "google/cloud/compute/v1/internal/common_051.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HEALTH_CHECKS_V1_HEALTH_CHECKS_PROTO_EXPORT_H diff --git a/google/cloud/compute/health_checks/v1/internal/health_checks_option_defaults.cc b/google/cloud/compute/health_checks/v1/internal/health_checks_option_defaults.cc index 6e5d71d34ddd3..5293b47135d70 100644 --- a/google/cloud/compute/health_checks/v1/internal/health_checks_option_defaults.cc +++ b/google/cloud/compute/health_checks/v1/internal/health_checks_option_defaults.cc @@ -41,7 +41,7 @@ Options HealthChecksDefaultOptions(Options options) { if (!options.has()) { options.set( compute_health_checks_v1::HealthChecksLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_connection_impl.h b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_connection_impl.h index 9556f3daecb25..ecfec7fd13ecb 100644 --- a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_connection_impl.h +++ b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HEALTH_CHECKS_V1_INTERNAL_HEALTH_CHECKS_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HEALTH_CHECKS_V1_INTERNAL_HEALTH_CHECKS_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/health_checks/v1/health_checks_connection.h" #include "google/cloud/compute/health_checks/v1/health_checks_connection_idempotency_policy.h" #include "google/cloud/compute/health_checks/v1/health_checks_options.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_logging_decorator.h b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_logging_decorator.h index 8223380c4d150..c78abceaf2b87 100644 --- a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_logging_decorator.h +++ b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HEALTH_CHECKS_V1_INTERNAL_HEALTH_CHECKS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HEALTH_CHECKS_V1_INTERNAL_HEALTH_CHECKS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/health_checks/v1/health_checks.pb.h" #include "google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_metadata_decorator.cc b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_metadata_decorator.cc index a4719011ac5a8..028b6a2155dcc 100644 --- a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_metadata_decorator.cc +++ b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/health_checks/v1/health_checks.proto #include "google/cloud/compute/health_checks/v1/internal/health_checks_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_metadata_decorator.h b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_metadata_decorator.h index bd8e9958f435e..93b69705c98ec 100644 --- a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_metadata_decorator.h +++ b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HEALTH_CHECKS_V1_INTERNAL_HEALTH_CHECKS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HEALTH_CHECKS_V1_INTERNAL_HEALTH_CHECKS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/health_checks/v1/health_checks.pb.h" #include "google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.cc b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.cc index 3f34d96af82eb..a333f888b8030 100644 --- a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.cc +++ b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/health_checks/v1/health_checks.proto #include "google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/health_checks/v1/health_checks.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.h b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.h index a7dbeca38c2cc..05a450573c646 100644 --- a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.h +++ b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HEALTH_CHECKS_V1_INTERNAL_HEALTH_CHECKS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HEALTH_CHECKS_V1_INTERNAL_HEALTH_CHECKS_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/health_checks/v1/health_checks.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/health_checks/v1/internal/health_checks_tracing_connection.cc b/google/cloud/compute/health_checks/v1/internal/health_checks_tracing_connection.cc index 3ba5d35de0f19..833f7dc3027ef 100644 --- a/google/cloud/compute/health_checks/v1/internal/health_checks_tracing_connection.cc +++ b/google/cloud/compute/health_checks/v1/internal/health_checks_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_health_checks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - HealthChecksTracingConnection::HealthChecksTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -195,16 +193,12 @@ HealthChecksTracingConnection::UpdateHealthCheck( child_->UpdateHealthCheck(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeHealthChecksTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/health_checks/v1/internal/health_checks_tracing_connection.h b/google/cloud/compute/health_checks/v1/internal/health_checks_tracing_connection.h index 8d954ee26b01c..974780dd37442 100644 --- a/google/cloud/compute/health_checks/v1/internal/health_checks_tracing_connection.h +++ b/google/cloud/compute/health_checks/v1/internal/health_checks_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_health_checks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class HealthChecksTracingConnection : public compute_health_checks_v1::HealthChecksConnection { public: @@ -105,8 +103,6 @@ class HealthChecksTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/http_health_checks/v1/http_health_checks_connection.h b/google/cloud/compute/http_health_checks/v1/http_health_checks_connection.h index 232b424b1631b..bfbd229fb0c98 100644 --- a/google/cloud/compute/http_health_checks/v1/http_health_checks_connection.h +++ b/google/cloud/compute/http_health_checks/v1/http_health_checks_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTP_HEALTH_CHECKS_V1_HTTP_HEALTH_CHECKS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTP_HEALTH_CHECKS_V1_HTTP_HEALTH_CHECKS_CONNECTION_H +#include "google/cloud/compute/http_health_checks/v1/http_health_checks.pb.h" #include "google/cloud/compute/http_health_checks/v1/http_health_checks_connection_idempotency_policy.h" #include "google/cloud/compute/http_health_checks/v1/internal/http_health_checks_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/http_health_checks/v1/http_health_checks_connection_idempotency_policy.h b/google/cloud/compute/http_health_checks/v1/http_health_checks_connection_idempotency_policy.h index c5705aec85109..0331861527f92 100644 --- a/google/cloud/compute/http_health_checks/v1/http_health_checks_connection_idempotency_policy.h +++ b/google/cloud/compute/http_health_checks/v1/http_health_checks_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTP_HEALTH_CHECKS_V1_HTTP_HEALTH_CHECKS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTP_HEALTH_CHECKS_V1_HTTP_HEALTH_CHECKS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/http_health_checks/v1/http_health_checks.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/http_health_checks/v1/http_health_checks_proto_export.h b/google/cloud/compute/http_health_checks/v1/http_health_checks_proto_export.h index 31a6731d06a95..a13ad208156f7 100644 --- a/google/cloud/compute/http_health_checks/v1/http_health_checks_proto_export.h +++ b/google/cloud/compute/http_health_checks/v1/http_health_checks_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTP_HEALTH_CHECKS_V1_HTTP_HEALTH_CHECKS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_053.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTP_HEALTH_CHECKS_V1_HTTP_HEALTH_CHECKS_PROTO_EXPORT_H diff --git a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_option_defaults.cc b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_option_defaults.cc index 428787728b4c0..1bafcb6eb7ff2 100644 --- a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_option_defaults.cc +++ b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_option_defaults.cc @@ -44,7 +44,7 @@ Options HttpHealthChecksDefaultOptions(Options options) { options.set< compute_http_health_checks_v1::HttpHealthChecksRetryPolicyOption>( compute_http_health_checks_v1::HttpHealthChecksLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_logging_decorator.h b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_logging_decorator.h index 208659d5958b8..3b222e76e2943 100644 --- a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_logging_decorator.h +++ b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTP_HEALTH_CHECKS_V1_INTERNAL_HTTP_HEALTH_CHECKS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTP_HEALTH_CHECKS_V1_INTERNAL_HTTP_HEALTH_CHECKS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/http_health_checks/v1/http_health_checks.pb.h" #include "google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_metadata_decorator.cc b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_metadata_decorator.cc index 0b3aa9049129c..88f77638f7d67 100644 --- a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_metadata_decorator.cc +++ b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/http_health_checks/v1/http_health_checks.proto #include "google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_metadata_decorator.h b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_metadata_decorator.h index 929687ed0cea0..f754cfe186d5e 100644 --- a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_metadata_decorator.h +++ b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTP_HEALTH_CHECKS_V1_INTERNAL_HTTP_HEALTH_CHECKS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTP_HEALTH_CHECKS_V1_INTERNAL_HTTP_HEALTH_CHECKS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/http_health_checks/v1/http_health_checks.pb.h" #include "google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.cc b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.cc index 5f29e7bf9edf5..b6337a65fe9d2 100644 --- a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.cc +++ b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/http_health_checks/v1/http_health_checks.proto #include "google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/http_health_checks/v1/http_health_checks.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.h b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.h index adc1c38d7592c..54d00d9043be2 100644 --- a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.h +++ b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTP_HEALTH_CHECKS_V1_INTERNAL_HTTP_HEALTH_CHECKS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTP_HEALTH_CHECKS_V1_INTERNAL_HTTP_HEALTH_CHECKS_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/http_health_checks/v1/http_health_checks.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_tracing_connection.cc b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_tracing_connection.cc index 35a0dafd16512..6133ccec68b9f 100644 --- a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_tracing_connection.cc +++ b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_http_health_checks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - HttpHealthChecksTracingConnection::HttpHealthChecksTracingConnection( std::shared_ptr child) @@ -199,17 +197,13 @@ HttpHealthChecksTracingConnection::UpdateHttpHealthCheck( child_->UpdateHttpHealthCheck(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeHttpHealthChecksTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_tracing_connection.h b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_tracing_connection.h index 81db483011e1d..3ee4fc55438ea 100644 --- a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_tracing_connection.h +++ b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_http_health_checks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class HttpHealthChecksTracingConnection : public compute_http_health_checks_v1::HttpHealthChecksConnection { public: @@ -105,8 +103,6 @@ class HttpHealthChecksTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/https_health_checks/v1/https_health_checks_connection.h b/google/cloud/compute/https_health_checks/v1/https_health_checks_connection.h index 1eef33f981762..49a98c41909e0 100644 --- a/google/cloud/compute/https_health_checks/v1/https_health_checks_connection.h +++ b/google/cloud/compute/https_health_checks/v1/https_health_checks_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTPS_HEALTH_CHECKS_V1_HTTPS_HEALTH_CHECKS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTPS_HEALTH_CHECKS_V1_HTTPS_HEALTH_CHECKS_CONNECTION_H +#include "google/cloud/compute/https_health_checks/v1/https_health_checks.pb.h" #include "google/cloud/compute/https_health_checks/v1/https_health_checks_connection_idempotency_policy.h" #include "google/cloud/compute/https_health_checks/v1/internal/https_health_checks_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/https_health_checks/v1/https_health_checks_connection_idempotency_policy.h b/google/cloud/compute/https_health_checks/v1/https_health_checks_connection_idempotency_policy.h index bd5ab768587d0..9d2c5fa4840c1 100644 --- a/google/cloud/compute/https_health_checks/v1/https_health_checks_connection_idempotency_policy.h +++ b/google/cloud/compute/https_health_checks/v1/https_health_checks_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTPS_HEALTH_CHECKS_V1_HTTPS_HEALTH_CHECKS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTPS_HEALTH_CHECKS_V1_HTTPS_HEALTH_CHECKS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/https_health_checks/v1/https_health_checks.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/https_health_checks/v1/https_health_checks_proto_export.h b/google/cloud/compute/https_health_checks/v1/https_health_checks_proto_export.h index cbf50f8173116..51f70130f5f90 100644 --- a/google/cloud/compute/https_health_checks/v1/https_health_checks_proto_export.h +++ b/google/cloud/compute/https_health_checks/v1/https_health_checks_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTPS_HEALTH_CHECKS_V1_HTTPS_HEALTH_CHECKS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_054.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTPS_HEALTH_CHECKS_V1_HTTPS_HEALTH_CHECKS_PROTO_EXPORT_H diff --git a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_option_defaults.cc b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_option_defaults.cc index 0a30d8b4d38a6..66f9243573a46 100644 --- a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_option_defaults.cc +++ b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_option_defaults.cc @@ -44,7 +44,7 @@ Options HttpsHealthChecksDefaultOptions(Options options) { options.set< compute_https_health_checks_v1::HttpsHealthChecksRetryPolicyOption>( compute_https_health_checks_v1::HttpsHealthChecksLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_logging_decorator.h b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_logging_decorator.h index 29d12cb121c8a..a4044050d7a70 100644 --- a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_logging_decorator.h +++ b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTPS_HEALTH_CHECKS_V1_INTERNAL_HTTPS_HEALTH_CHECKS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTPS_HEALTH_CHECKS_V1_INTERNAL_HTTPS_HEALTH_CHECKS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/https_health_checks/v1/https_health_checks.pb.h" #include "google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_metadata_decorator.cc b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_metadata_decorator.cc index 3577688374139..22095930504b9 100644 --- a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_metadata_decorator.cc +++ b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/https_health_checks/v1/https_health_checks.proto #include "google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_metadata_decorator.h b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_metadata_decorator.h index 2f681a6c3e2cc..1ba2fe726fbf3 100644 --- a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_metadata_decorator.h +++ b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTPS_HEALTH_CHECKS_V1_INTERNAL_HTTPS_HEALTH_CHECKS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTPS_HEALTH_CHECKS_V1_INTERNAL_HTTPS_HEALTH_CHECKS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/https_health_checks/v1/https_health_checks.pb.h" #include "google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.cc b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.cc index abb69ebd058a7..d2651fe27e8b9 100644 --- a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.cc +++ b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/https_health_checks/v1/https_health_checks.proto #include "google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/https_health_checks/v1/https_health_checks.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.h b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.h index dae0e36e2d679..839455228655b 100644 --- a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.h +++ b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTPS_HEALTH_CHECKS_V1_INTERNAL_HTTPS_HEALTH_CHECKS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_HTTPS_HEALTH_CHECKS_V1_INTERNAL_HTTPS_HEALTH_CHECKS_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/https_health_checks/v1/https_health_checks.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_tracing_connection.cc b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_tracing_connection.cc index f9cb9d6350eb6..003dc4e104b07 100644 --- a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_tracing_connection.cc +++ b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_https_health_checks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - HttpsHealthChecksTracingConnection::HttpsHealthChecksTracingConnection( std::shared_ptr child) @@ -199,18 +197,14 @@ HttpsHealthChecksTracingConnection::UpdateHttpsHealthCheck( child_->UpdateHttpsHealthCheck(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeHttpsHealthChecksTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_tracing_connection.h b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_tracing_connection.h index ee4415896bad5..623f2c83bc1f5 100644 --- a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_tracing_connection.h +++ b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_https_health_checks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class HttpsHealthChecksTracingConnection : public compute_https_health_checks_v1::HttpsHealthChecksConnection { public: @@ -107,8 +105,6 @@ class HttpsHealthChecksTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/image_family_views/v1/image_family_views_connection.h b/google/cloud/compute/image_family_views/v1/image_family_views_connection.h index 762803e3465b0..a96e38c33f528 100644 --- a/google/cloud/compute/image_family_views/v1/image_family_views_connection.h +++ b/google/cloud/compute/image_family_views/v1/image_family_views_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGE_FAMILY_VIEWS_V1_IMAGE_FAMILY_VIEWS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGE_FAMILY_VIEWS_V1_IMAGE_FAMILY_VIEWS_CONNECTION_H +#include "google/cloud/compute/image_family_views/v1/image_family_views.pb.h" #include "google/cloud/compute/image_family_views/v1/image_family_views_connection_idempotency_policy.h" #include "google/cloud/compute/image_family_views/v1/internal/image_family_views_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/image_family_views/v1/image_family_views_connection_idempotency_policy.h b/google/cloud/compute/image_family_views/v1/image_family_views_connection_idempotency_policy.h index c74e9e06ad121..09b22b75836ee 100644 --- a/google/cloud/compute/image_family_views/v1/image_family_views_connection_idempotency_policy.h +++ b/google/cloud/compute/image_family_views/v1/image_family_views_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGE_FAMILY_VIEWS_V1_IMAGE_FAMILY_VIEWS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGE_FAMILY_VIEWS_V1_IMAGE_FAMILY_VIEWS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/image_family_views/v1/image_family_views.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/image_family_views/v1/image_family_views_proto_export.h b/google/cloud/compute/image_family_views/v1/image_family_views_proto_export.h index fc067ff2de344..146a2bb003e35 100644 --- a/google/cloud/compute/image_family_views/v1/image_family_views_proto_export.h +++ b/google/cloud/compute/image_family_views/v1/image_family_views_proto_export.h @@ -26,11 +26,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGE_FAMILY_VIEWS_V1_IMAGE_FAMILY_VIEWS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_021.pb.h" +#include "google/cloud/compute/v1/internal/common_023.pb.h" +#include "google/cloud/compute/v1/internal/common_033.pb.h" +#include "google/cloud/compute/v1/internal/common_055.pb.h" +#include "google/cloud/compute/v1/internal/common_056.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGE_FAMILY_VIEWS_V1_IMAGE_FAMILY_VIEWS_PROTO_EXPORT_H diff --git a/google/cloud/compute/image_family_views/v1/internal/image_family_views_option_defaults.cc b/google/cloud/compute/image_family_views/v1/internal/image_family_views_option_defaults.cc index 6dde93c72257b..dc5113e9f9f9c 100644 --- a/google/cloud/compute/image_family_views/v1/internal/image_family_views_option_defaults.cc +++ b/google/cloud/compute/image_family_views/v1/internal/image_family_views_option_defaults.cc @@ -44,7 +44,7 @@ Options ImageFamilyViewsDefaultOptions(Options options) { options.set< compute_image_family_views_v1::ImageFamilyViewsRetryPolicyOption>( compute_image_family_views_v1::ImageFamilyViewsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include #include diff --git a/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_metadata_decorator.cc b/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_metadata_decorator.cc index 6715491000ff0..15c2a0a8bd076 100644 --- a/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_metadata_decorator.cc +++ b/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/image_family_views/v1/image_family_views.proto #include "google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_metadata_decorator.h b/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_metadata_decorator.h index 2eeeaa856f688..206246ba7eb42 100644 --- a/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_metadata_decorator.h +++ b/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGE_FAMILY_VIEWS_V1_INTERNAL_IMAGE_FAMILY_VIEWS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGE_FAMILY_VIEWS_V1_INTERNAL_IMAGE_FAMILY_VIEWS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/image_family_views/v1/image_family_views.pb.h" #include "google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.cc b/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.cc index f38c7cb7ec434..63971fb671abc 100644 --- a/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.cc +++ b/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/image_family_views/v1/image_family_views.proto #include "google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.h" +#include "google/cloud/compute/image_family_views/v1/image_family_views.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.h b/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.h index 39e3f07933450..e0eb9af3e660f 100644 --- a/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.h +++ b/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGE_FAMILY_VIEWS_V1_INTERNAL_IMAGE_FAMILY_VIEWS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGE_FAMILY_VIEWS_V1_INTERNAL_IMAGE_FAMILY_VIEWS_REST_STUB_H +#include "google/cloud/compute/image_family_views/v1/image_family_views.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/image_family_views/v1/internal/image_family_views_tracing_connection.cc b/google/cloud/compute/image_family_views/v1/internal/image_family_views_tracing_connection.cc index 510420f154d0e..85c41acea1cdf 100644 --- a/google/cloud/compute/image_family_views/v1/internal/image_family_views_tracing_connection.cc +++ b/google/cloud/compute/image_family_views/v1/internal/image_family_views_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace compute_image_family_views_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ImageFamilyViewsTracingConnection::ImageFamilyViewsTracingConnection( std::shared_ptr child) @@ -44,17 +42,13 @@ ImageFamilyViewsTracingConnection::GetImageFamilyView( return internal::EndSpan(*span, child_->GetImageFamilyView(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeImageFamilyViewsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/image_family_views/v1/internal/image_family_views_tracing_connection.h b/google/cloud/compute/image_family_views/v1/internal/image_family_views_tracing_connection.h index b1251ec5d15b7..c79c7304088a0 100644 --- a/google/cloud/compute/image_family_views/v1/internal/image_family_views_tracing_connection.h +++ b/google/cloud/compute/image_family_views/v1/internal/image_family_views_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_image_family_views_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ImageFamilyViewsTracingConnection : public compute_image_family_views_v1::ImageFamilyViewsConnection { public: @@ -50,8 +48,6 @@ class ImageFamilyViewsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/images/v1/images_connection.h b/google/cloud/compute/images/v1/images_connection.h index d99bb28b73b51..032f39646bcbc 100644 --- a/google/cloud/compute/images/v1/images_connection.h +++ b/google/cloud/compute/images/v1/images_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGES_V1_IMAGES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGES_V1_IMAGES_CONNECTION_H +#include "google/cloud/compute/images/v1/images.pb.h" #include "google/cloud/compute/images/v1/images_connection_idempotency_policy.h" #include "google/cloud/compute/images/v1/internal/images_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/images/v1/images_connection_idempotency_policy.h b/google/cloud/compute/images/v1/images_connection_idempotency_policy.h index bd35efb38c5bf..96bfe2ca31240 100644 --- a/google/cloud/compute/images/v1/images_connection_idempotency_policy.h +++ b/google/cloud/compute/images/v1/images_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGES_V1_IMAGES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGES_V1_IMAGES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/images/v1/images.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/images/v1/images_proto_export.h b/google/cloud/compute/images/v1/images_proto_export.h index 8c2dec9a27d57..f3f6cb0503048 100644 --- a/google/cloud/compute/images/v1/images_proto_export.h +++ b/google/cloud/compute/images/v1/images_proto_export.h @@ -26,17 +26,17 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGES_V1_IMAGES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_021.pb.h" +#include "google/cloud/compute/v1/internal/common_023.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_033.pb.h" +#include "google/cloud/compute/v1/internal/common_046.pb.h" +#include "google/cloud/compute/v1/internal/common_047.pb.h" +#include "google/cloud/compute/v1/internal/common_055.pb.h" +#include "google/cloud/compute/v1/internal/common_057.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGES_V1_IMAGES_PROTO_EXPORT_H diff --git a/google/cloud/compute/images/v1/internal/images_option_defaults.cc b/google/cloud/compute/images/v1/internal/images_option_defaults.cc index 6c47501850f7f..e9c790ce480c2 100644 --- a/google/cloud/compute/images/v1/internal/images_option_defaults.cc +++ b/google/cloud/compute/images/v1/internal/images_option_defaults.cc @@ -41,7 +41,7 @@ Options ImagesDefaultOptions(Options options) { if (!options.has()) { options.set( compute_images_v1::ImagesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/images/v1/internal/images_rest_connection_impl.h b/google/cloud/compute/images/v1/internal/images_rest_connection_impl.h index 6b9e78ffe99e6..b03c8d83990d0 100644 --- a/google/cloud/compute/images/v1/internal/images_rest_connection_impl.h +++ b/google/cloud/compute/images/v1/internal/images_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGES_V1_INTERNAL_IMAGES_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGES_V1_INTERNAL_IMAGES_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/images/v1/images_connection.h" #include "google/cloud/compute/images/v1/images_connection_idempotency_policy.h" #include "google/cloud/compute/images/v1/images_options.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/images/v1/internal/images_rest_logging_decorator.h b/google/cloud/compute/images/v1/internal/images_rest_logging_decorator.h index 8b09031c69def..e10ca39c2bae4 100644 --- a/google/cloud/compute/images/v1/internal/images_rest_logging_decorator.h +++ b/google/cloud/compute/images/v1/internal/images_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGES_V1_INTERNAL_IMAGES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGES_V1_INTERNAL_IMAGES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/images/v1/images.pb.h" #include "google/cloud/compute/images/v1/internal/images_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/images/v1/internal/images_rest_metadata_decorator.cc b/google/cloud/compute/images/v1/internal/images_rest_metadata_decorator.cc index 7552ce1fadb35..73829ac945ccc 100644 --- a/google/cloud/compute/images/v1/internal/images_rest_metadata_decorator.cc +++ b/google/cloud/compute/images/v1/internal/images_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/images/v1/images.proto #include "google/cloud/compute/images/v1/internal/images_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/images/v1/internal/images_rest_metadata_decorator.h b/google/cloud/compute/images/v1/internal/images_rest_metadata_decorator.h index e0f76df2bde9c..0bcd441b2358c 100644 --- a/google/cloud/compute/images/v1/internal/images_rest_metadata_decorator.h +++ b/google/cloud/compute/images/v1/internal/images_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGES_V1_INTERNAL_IMAGES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGES_V1_INTERNAL_IMAGES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/images/v1/images.pb.h" #include "google/cloud/compute/images/v1/internal/images_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/images/v1/internal/images_rest_stub.cc b/google/cloud/compute/images/v1/internal/images_rest_stub.cc index 28689f74484bb..da9f6019af8bc 100644 --- a/google/cloud/compute/images/v1/internal/images_rest_stub.cc +++ b/google/cloud/compute/images/v1/internal/images_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/images/v1/images.proto #include "google/cloud/compute/images/v1/internal/images_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/images/v1/images.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/images/v1/internal/images_rest_stub.h b/google/cloud/compute/images/v1/internal/images_rest_stub.h index d91dfe754258e..beffdbfb4bc94 100644 --- a/google/cloud/compute/images/v1/internal/images_rest_stub.h +++ b/google/cloud/compute/images/v1/internal/images_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGES_V1_INTERNAL_IMAGES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_IMAGES_V1_INTERNAL_IMAGES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/images/v1/images.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/images/v1/internal/images_tracing_connection.cc b/google/cloud/compute/images/v1/internal/images_tracing_connection.cc index 229d78fef945b..fd3396db79480 100644 --- a/google/cloud/compute/images/v1/internal/images_tracing_connection.cc +++ b/google/cloud/compute/images/v1/internal/images_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_images_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ImagesTracingConnection::ImagesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -237,16 +235,12 @@ ImagesTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeImagesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/images/v1/internal/images_tracing_connection.h b/google/cloud/compute/images/v1/internal/images_tracing_connection.h index ae8024b7803fe..46c62b9a72a56 100644 --- a/google/cloud/compute/images/v1/internal/images_tracing_connection.h +++ b/google/cloud/compute/images/v1/internal/images_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_images_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ImagesTracingConnection : public compute_images_v1::ImagesConnection { public: ~ImagesTracingConnection() override = default; @@ -128,8 +126,6 @@ class ImagesTracingConnection : public compute_images_v1::ImagesConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests_connection.h b/google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests_connection.h index ccef4edcec104..46948a3f913ce 100644 --- a/google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests_connection.h +++ b/google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests_connection.h @@ -20,6 +20,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_V1_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_V1_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_CONNECTION_H +#include "google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests.pb.h" #include "google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests_connection_idempotency_policy.h" #include "google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests_connection_idempotency_policy.h b/google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests_connection_idempotency_policy.h index 1ea821af37246..49473681d357e 100644 --- a/google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests_connection_idempotency_policy.h +++ b/google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_V1_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_V1_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests_proto_export.h b/google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests_proto_export.h index 10366067b50fa..2faf312babb8f 100644 --- a/google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests_proto_export.h +++ b/google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_V1_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_062.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_V1_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_PROTO_EXPORT_H diff --git a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_option_defaults.cc b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_option_defaults.cc index e8c88aab3be92..a65f5f15fde23 100644 --- a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_option_defaults.cc +++ b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_option_defaults.cc @@ -47,7 +47,7 @@ Options InstanceGroupManagerResizeRequestsDefaultOptions(Options options) { InstanceGroupManagerResizeRequestsRetryPolicyOption>( compute_instance_group_manager_resize_requests_v1:: InstanceGroupManagerResizeRequestsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_connection_impl.h b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_connection_impl.h index 9168e56ddcac0..f49f9336b14a5 100644 --- a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_connection_impl.h +++ b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_connection_impl.h @@ -25,13 +25,13 @@ #include "google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests_options.h" #include "google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.h" #include "google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_retry_traits.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_logging_decorator.h b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_logging_decorator.h index 30c7e63ceb8da..c7c016d51637c 100644 --- a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_logging_decorator.h +++ b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_V1_INTERNAL_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_V1_INTERNAL_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests.pb.h" #include "google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_metadata_decorator.cc b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_metadata_decorator.cc index b31af9ebd966d..3b0c33b64473e 100644 --- a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_metadata_decorator.cc +++ b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests.proto #include "google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_metadata_decorator.h b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_metadata_decorator.h index 78149bff6edca..b3dcef4a5d809 100644 --- a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_metadata_decorator.h +++ b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_V1_INTERNAL_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_V1_INTERNAL_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests.pb.h" #include "google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.cc b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.cc index 29bd4ccaafbee..2163d1e2fdedc 100644 --- a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.cc +++ b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests.proto #include "google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.h" +#include "google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.h b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.h index bc761578966cc..340c586e3cfe9 100644 --- a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.h +++ b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_V1_INTERNAL_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_V1_INTERNAL_INSTANCE_GROUP_MANAGER_RESIZE_REQUESTS_REST_STUB_H +#include "google/cloud/compute/instance_group_manager_resize_requests/v1/instance_group_manager_resize_requests.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_tracing_connection.cc b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_tracing_connection.cc index 4b7b1730b3356..5db39e52f3b0c 100644 --- a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_tracing_connection.cc +++ b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_instance_group_manager_resize_requests_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InstanceGroupManagerResizeRequestsTracingConnection:: InstanceGroupManagerResizeRequestsTracingConnection( std::shared_ptr MakeInstanceGroupManagerResizeRequestsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_tracing_connection.h b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_tracing_connection.h index abc797c1606b9..ee0d518853d00 100644 --- a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_tracing_connection.h +++ b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_instance_group_manager_resize_requests_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InstanceGroupManagerResizeRequestsTracingConnection : public compute_instance_group_manager_resize_requests_v1:: InstanceGroupManagerResizeRequestsConnection { @@ -107,8 +105,6 @@ class InstanceGroupManagerResizeRequestsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/instance_group_managers/v1/instance_group_managers_connection.h b/google/cloud/compute/instance_group_managers/v1/instance_group_managers_connection.h index 729287452b7b4..0c8e4a89d39b5 100644 --- a/google/cloud/compute/instance_group_managers/v1/instance_group_managers_connection.h +++ b/google/cloud/compute/instance_group_managers/v1/instance_group_managers_connection.h @@ -20,6 +20,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGERS_V1_INSTANCE_GROUP_MANAGERS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGERS_V1_INSTANCE_GROUP_MANAGERS_CONNECTION_H +#include "google/cloud/compute/instance_group_managers/v1/instance_group_managers.pb.h" #include "google/cloud/compute/instance_group_managers/v1/instance_group_managers_connection_idempotency_policy.h" #include "google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/instance_group_managers/v1/instance_group_managers_connection_idempotency_policy.h b/google/cloud/compute/instance_group_managers/v1/instance_group_managers_connection_idempotency_policy.h index 4642adc850653..f92e87f3bd5c2 100644 --- a/google/cloud/compute/instance_group_managers/v1/instance_group_managers_connection_idempotency_policy.h +++ b/google/cloud/compute/instance_group_managers/v1/instance_group_managers_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGERS_V1_INSTANCE_GROUP_MANAGERS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGERS_V1_INSTANCE_GROUP_MANAGERS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/instance_group_managers/v1/instance_group_managers.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/instance_group_managers/v1/instance_group_managers_proto_export.h b/google/cloud/compute/instance_group_managers/v1/instance_group_managers_proto_export.h index 7d16c0adb716a..145560402f9c2 100644 --- a/google/cloud/compute/instance_group_managers/v1/instance_group_managers_proto_export.h +++ b/google/cloud/compute/instance_group_managers/v1/instance_group_managers_proto_export.h @@ -26,11 +26,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGERS_V1_INSTANCE_GROUP_MANAGERS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_028.pb.h" +#include "google/cloud/compute/v1/internal/common_040.pb.h" +#include "google/cloud/compute/v1/internal/common_061.pb.h" +#include "google/cloud/compute/v1/internal/common_083.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGERS_V1_INSTANCE_GROUP_MANAGERS_PROTO_EXPORT_H diff --git a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_option_defaults.cc b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_option_defaults.cc index f1629ab3f7e14..1427aae8e6beb 100644 --- a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_option_defaults.cc +++ b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_option_defaults.cc @@ -46,7 +46,7 @@ Options InstanceGroupManagersDefaultOptions(Options options) { InstanceGroupManagersRetryPolicyOption>( compute_instance_group_managers_v1:: InstanceGroupManagersLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_logging_decorator.h b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_logging_decorator.h index 7f5700935f353..3ab17bd676f64 100644 --- a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_logging_decorator.h +++ b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGERS_V1_INTERNAL_INSTANCE_GROUP_MANAGERS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGERS_V1_INTERNAL_INSTANCE_GROUP_MANAGERS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/instance_group_managers/v1/instance_group_managers.pb.h" #include "google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_metadata_decorator.cc b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_metadata_decorator.cc index 24783fc788116..5f89deba3732e 100644 --- a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_metadata_decorator.cc +++ b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/instance_group_managers/v1/instance_group_managers.proto #include "google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_metadata_decorator.h b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_metadata_decorator.h index 9f45284f5a733..07188df200b53 100644 --- a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_metadata_decorator.h +++ b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGERS_V1_INTERNAL_INSTANCE_GROUP_MANAGERS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGERS_V1_INTERNAL_INSTANCE_GROUP_MANAGERS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/instance_group_managers/v1/instance_group_managers.pb.h" #include "google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.cc b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.cc index 6db8ab4a8a3c5..d70d2a1945d36 100644 --- a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.cc +++ b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/instance_group_managers/v1/instance_group_managers.proto #include "google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.h" +#include "google/cloud/compute/instance_group_managers/v1/instance_group_managers.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.h b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.h index 03431f352633f..90719f386dcc1 100644 --- a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.h +++ b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGERS_V1_INTERNAL_INSTANCE_GROUP_MANAGERS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUP_MANAGERS_V1_INTERNAL_INSTANCE_GROUP_MANAGERS_REST_STUB_H +#include "google/cloud/compute/instance_group_managers/v1/instance_group_managers.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_tracing_connection.cc b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_tracing_connection.cc index 98cbe255dce1f..78363d452094d 100644 --- a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_tracing_connection.cc +++ b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_instance_group_managers_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InstanceGroupManagersTracingConnection::InstanceGroupManagersTracingConnection( std::shared_ptr< compute_instance_group_managers_v1::InstanceGroupManagersConnection> @@ -729,20 +727,16 @@ InstanceGroupManagersTracingConnection::UpdatePerInstanceConfigs( child_->UpdatePerInstanceConfigs(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_instance_group_managers_v1::InstanceGroupManagersConnection> MakeInstanceGroupManagersTracingConnection( std::shared_ptr< compute_instance_group_managers_v1::InstanceGroupManagersConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_tracing_connection.h b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_tracing_connection.h index bc4903491085c..75a368d5e5cc9 100644 --- a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_tracing_connection.h +++ b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_instance_group_managers_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InstanceGroupManagersTracingConnection : public compute_instance_group_managers_v1:: InstanceGroupManagersConnection { @@ -300,8 +298,6 @@ class InstanceGroupManagersTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/instance_groups/v1/instance_groups_connection.h b/google/cloud/compute/instance_groups/v1/instance_groups_connection.h index 6a4e91ef3f30c..3fd4fe1ca3bdd 100644 --- a/google/cloud/compute/instance_groups/v1/instance_groups_connection.h +++ b/google/cloud/compute/instance_groups/v1/instance_groups_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUPS_V1_INSTANCE_GROUPS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUPS_V1_INSTANCE_GROUPS_CONNECTION_H +#include "google/cloud/compute/instance_groups/v1/instance_groups.pb.h" #include "google/cloud/compute/instance_groups/v1/instance_groups_connection_idempotency_policy.h" #include "google/cloud/compute/instance_groups/v1/internal/instance_groups_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/instance_groups/v1/instance_groups_connection_idempotency_policy.h b/google/cloud/compute/instance_groups/v1/instance_groups_connection_idempotency_policy.h index 15baaf2fee932..4af7d05610ffe 100644 --- a/google/cloud/compute/instance_groups/v1/instance_groups_connection_idempotency_policy.h +++ b/google/cloud/compute/instance_groups/v1/instance_groups_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUPS_V1_INSTANCE_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUPS_V1_INSTANCE_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/instance_groups/v1/instance_groups.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/instance_groups/v1/instance_groups_proto_export.h b/google/cloud/compute/instance_groups/v1/instance_groups_proto_export.h index a8f09a3aedbe3..8eb5aa4cfea08 100644 --- a/google/cloud/compute/instance_groups/v1/instance_groups_proto_export.h +++ b/google/cloud/compute/instance_groups/v1/instance_groups_proto_export.h @@ -26,11 +26,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUPS_V1_INSTANCE_GROUPS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_059.pb.h" +#include "google/cloud/compute/v1/internal/common_060.pb.h" +#include "google/cloud/compute/v1/internal/common_063.pb.h" +#include "google/cloud/compute/v1/internal/common_083.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUPS_V1_INSTANCE_GROUPS_PROTO_EXPORT_H diff --git a/google/cloud/compute/instance_groups/v1/internal/instance_groups_option_defaults.cc b/google/cloud/compute/instance_groups/v1/internal/instance_groups_option_defaults.cc index d497f0bea5fa6..ccbe72e31896b 100644 --- a/google/cloud/compute/instance_groups/v1/internal/instance_groups_option_defaults.cc +++ b/google/cloud/compute/instance_groups/v1/internal/instance_groups_option_defaults.cc @@ -42,7 +42,7 @@ Options InstanceGroupsDefaultOptions(Options options) { compute_instance_groups_v1::InstanceGroupsRetryPolicyOption>()) { options.set( compute_instance_groups_v1::InstanceGroupsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_connection_impl.h b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_connection_impl.h index 28cb90fa597ab..fb7274910a49a 100644 --- a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_connection_impl.h +++ b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/instance_groups/v1/instance_groups_options.h" #include "google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.h" #include "google/cloud/compute/instance_groups/v1/internal/instance_groups_retry_traits.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_logging_decorator.h b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_logging_decorator.h index 66d4023e82ab3..7b57f38e1a55d 100644 --- a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_logging_decorator.h +++ b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUPS_V1_INTERNAL_INSTANCE_GROUPS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUPS_V1_INTERNAL_INSTANCE_GROUPS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/instance_groups/v1/instance_groups.pb.h" #include "google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_metadata_decorator.cc b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_metadata_decorator.cc index ed920d4408ab4..5ed7fe3cc4fe9 100644 --- a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_metadata_decorator.cc +++ b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/instance_groups/v1/instance_groups.proto #include "google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_metadata_decorator.h b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_metadata_decorator.h index 4a2ce26e2bcb6..bfbe7cbcbac7e 100644 --- a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_metadata_decorator.h +++ b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUPS_V1_INTERNAL_INSTANCE_GROUPS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUPS_V1_INTERNAL_INSTANCE_GROUPS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/instance_groups/v1/instance_groups.pb.h" #include "google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.cc b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.cc index 6325015b90dc5..11942205405be 100644 --- a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.cc +++ b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/instance_groups/v1/instance_groups.proto #include "google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.h" +#include "google/cloud/compute/instance_groups/v1/instance_groups.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.h b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.h index a697028599288..699c86660ad21 100644 --- a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.h +++ b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUPS_V1_INTERNAL_INSTANCE_GROUPS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_GROUPS_V1_INTERNAL_INSTANCE_GROUPS_REST_STUB_H +#include "google/cloud/compute/instance_groups/v1/instance_groups.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/instance_groups/v1/internal/instance_groups_tracing_connection.cc b/google/cloud/compute/instance_groups/v1/internal/instance_groups_tracing_connection.cc index bdab63c583d9d..60969134a114a 100644 --- a/google/cloud/compute/instance_groups/v1/internal/instance_groups_tracing_connection.cc +++ b/google/cloud/compute/instance_groups/v1/internal/instance_groups_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_instance_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InstanceGroupsTracingConnection::InstanceGroupsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -244,17 +242,13 @@ InstanceGroupsTracingConnection::SetNamedPorts( return internal::EndSpan(std::move(span), child_->SetNamedPorts(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeInstanceGroupsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/instance_groups/v1/internal/instance_groups_tracing_connection.h b/google/cloud/compute/instance_groups/v1/internal/instance_groups_tracing_connection.h index d77123a6031f2..2411e33285b74 100644 --- a/google/cloud/compute/instance_groups/v1/internal/instance_groups_tracing_connection.h +++ b/google/cloud/compute/instance_groups/v1/internal/instance_groups_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_instance_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InstanceGroupsTracingConnection : public compute_instance_groups_v1::InstanceGroupsConnection { public: @@ -121,8 +119,6 @@ class InstanceGroupsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/instance_settings/v1/instance_settings_connection.h b/google/cloud/compute/instance_settings/v1/instance_settings_connection.h index 7529e10fd2ec5..6b4d8ebe6b163 100644 --- a/google/cloud/compute/instance_settings/v1/instance_settings_connection.h +++ b/google/cloud/compute/instance_settings/v1/instance_settings_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_SETTINGS_V1_INSTANCE_SETTINGS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_SETTINGS_V1_INSTANCE_SETTINGS_CONNECTION_H +#include "google/cloud/compute/instance_settings/v1/instance_settings.pb.h" #include "google/cloud/compute/instance_settings/v1/instance_settings_connection_idempotency_policy.h" #include "google/cloud/compute/instance_settings/v1/internal/instance_settings_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -29,7 +30,6 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/instance_settings/v1/instance_settings_connection_idempotency_policy.h b/google/cloud/compute/instance_settings/v1/instance_settings_connection_idempotency_policy.h index b2285d51f35ef..21ec7faa367a2 100644 --- a/google/cloud/compute/instance_settings/v1/instance_settings_connection_idempotency_policy.h +++ b/google/cloud/compute/instance_settings/v1/instance_settings_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_SETTINGS_V1_INSTANCE_SETTINGS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_SETTINGS_V1_INSTANCE_SETTINGS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/instance_settings/v1/instance_settings.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/instance_settings/v1/instance_settings_proto_export.h b/google/cloud/compute/instance_settings/v1/instance_settings_proto_export.h index 88547360125b8..f9beef5cc16eb 100644 --- a/google/cloud/compute/instance_settings/v1/instance_settings_proto_export.h +++ b/google/cloud/compute/instance_settings/v1/instance_settings_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_SETTINGS_V1_INSTANCE_SETTINGS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_064.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_SETTINGS_V1_INSTANCE_SETTINGS_PROTO_EXPORT_H diff --git a/google/cloud/compute/instance_settings/v1/internal/instance_settings_option_defaults.cc b/google/cloud/compute/instance_settings/v1/internal/instance_settings_option_defaults.cc index ed65f7a106016..2e06a8d5859d5 100644 --- a/google/cloud/compute/instance_settings/v1/internal/instance_settings_option_defaults.cc +++ b/google/cloud/compute/instance_settings/v1/internal/instance_settings_option_defaults.cc @@ -43,7 +43,7 @@ Options InstanceSettingsDefaultOptions(Options options) { options.set< compute_instance_settings_v1::InstanceSettingsRetryPolicyOption>( compute_instance_settings_v1::InstanceSettingsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_logging_decorator.h b/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_logging_decorator.h index 7d4e623e01497..4bbe985fb5084 100644 --- a/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_logging_decorator.h +++ b/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_SETTINGS_V1_INTERNAL_INSTANCE_SETTINGS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_SETTINGS_V1_INTERNAL_INSTANCE_SETTINGS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/instance_settings/v1/instance_settings.pb.h" #include "google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_metadata_decorator.cc b/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_metadata_decorator.cc index 0b43ec982754e..77e34cef80652 100644 --- a/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_metadata_decorator.cc +++ b/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/instance_settings/v1/instance_settings.proto #include "google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_metadata_decorator.h b/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_metadata_decorator.h index 4004b6e7732ea..af6f6ce2d0899 100644 --- a/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_metadata_decorator.h +++ b/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_SETTINGS_V1_INTERNAL_INSTANCE_SETTINGS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_SETTINGS_V1_INTERNAL_INSTANCE_SETTINGS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/instance_settings/v1/instance_settings.pb.h" #include "google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.cc b/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.cc index ce1ad54c7edf8..96d4d325b5bad 100644 --- a/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.cc +++ b/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/instance_settings/v1/instance_settings.proto #include "google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.h" +#include "google/cloud/compute/instance_settings/v1/instance_settings.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.h b/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.h index b162ddb71a4de..6fee378673b70 100644 --- a/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.h +++ b/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_SETTINGS_V1_INTERNAL_INSTANCE_SETTINGS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_SETTINGS_V1_INTERNAL_INSTANCE_SETTINGS_REST_STUB_H +#include "google/cloud/compute/instance_settings/v1/instance_settings.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/instance_settings/v1/internal/instance_settings_tracing_connection.cc b/google/cloud/compute/instance_settings/v1/internal/instance_settings_tracing_connection.cc index 09eddab8dca73..404dc84b97358 100644 --- a/google/cloud/compute/instance_settings/v1/internal/instance_settings_tracing_connection.cc +++ b/google/cloud/compute/instance_settings/v1/internal/instance_settings_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace compute_instance_settings_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InstanceSettingsTracingConnection::InstanceSettingsTracingConnection( std::shared_ptr child) @@ -79,17 +77,13 @@ InstanceSettingsTracingConnection::PatchInstanceSettings( child_->PatchInstanceSettings(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeInstanceSettingsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/instance_settings/v1/internal/instance_settings_tracing_connection.h b/google/cloud/compute/instance_settings/v1/internal/instance_settings_tracing_connection.h index cafc7b9b9290c..b1f6826ed6128 100644 --- a/google/cloud/compute/instance_settings/v1/internal/instance_settings_tracing_connection.h +++ b/google/cloud/compute/instance_settings/v1/internal/instance_settings_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_instance_settings_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InstanceSettingsTracingConnection : public compute_instance_settings_v1::InstanceSettingsConnection { public: @@ -63,8 +61,6 @@ class InstanceSettingsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/instance_templates/v1/instance_templates_connection.h b/google/cloud/compute/instance_templates/v1/instance_templates_connection.h index ae5b14565e6c4..dc78c3643e8d7 100644 --- a/google/cloud/compute/instance_templates/v1/instance_templates_connection.h +++ b/google/cloud/compute/instance_templates/v1/instance_templates_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_TEMPLATES_V1_INSTANCE_TEMPLATES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_TEMPLATES_V1_INSTANCE_TEMPLATES_CONNECTION_H +#include "google/cloud/compute/instance_templates/v1/instance_templates.pb.h" #include "google/cloud/compute/instance_templates/v1/instance_templates_connection_idempotency_policy.h" #include "google/cloud/compute/instance_templates/v1/internal/instance_templates_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/instance_templates/v1/instance_templates_connection_idempotency_policy.h b/google/cloud/compute/instance_templates/v1/instance_templates_connection_idempotency_policy.h index 9722097fcba0f..3dae768f430f2 100644 --- a/google/cloud/compute/instance_templates/v1/instance_templates_connection_idempotency_policy.h +++ b/google/cloud/compute/instance_templates/v1/instance_templates_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_TEMPLATES_V1_INSTANCE_TEMPLATES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_TEMPLATES_V1_INSTANCE_TEMPLATES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/instance_templates/v1/instance_templates.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/instance_templates/v1/instance_templates_proto_export.h b/google/cloud/compute/instance_templates/v1/instance_templates_proto_export.h index a3a2df8da44b0..143ec0382f3cc 100644 --- a/google/cloud/compute/instance_templates/v1/instance_templates_proto_export.h +++ b/google/cloud/compute/instance_templates/v1/instance_templates_proto_export.h @@ -26,19 +26,19 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_TEMPLATES_V1_INSTANCE_TEMPLATES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_001.pb.h" +#include "google/cloud/compute/v1/internal/common_003.pb.h" +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_021.pb.h" +#include "google/cloud/compute/v1/internal/common_024.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_033.pb.h" +#include "google/cloud/compute/v1/internal/common_047.pb.h" +#include "google/cloud/compute/v1/internal/common_065.pb.h" +#include "google/cloud/compute/v1/internal/common_081.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_TEMPLATES_V1_INSTANCE_TEMPLATES_PROTO_EXPORT_H diff --git a/google/cloud/compute/instance_templates/v1/internal/instance_templates_option_defaults.cc b/google/cloud/compute/instance_templates/v1/internal/instance_templates_option_defaults.cc index deed4214c082b..479464ca7389b 100644 --- a/google/cloud/compute/instance_templates/v1/internal/instance_templates_option_defaults.cc +++ b/google/cloud/compute/instance_templates/v1/internal/instance_templates_option_defaults.cc @@ -44,7 +44,7 @@ Options InstanceTemplatesDefaultOptions(Options options) { options.set< compute_instance_templates_v1::InstanceTemplatesRetryPolicyOption>( compute_instance_templates_v1::InstanceTemplatesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_logging_decorator.h b/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_logging_decorator.h index e3fb828562817..b302cedc81dc4 100644 --- a/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_logging_decorator.h +++ b/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_TEMPLATES_V1_INTERNAL_INSTANCE_TEMPLATES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_TEMPLATES_V1_INTERNAL_INSTANCE_TEMPLATES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/instance_templates/v1/instance_templates.pb.h" #include "google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_metadata_decorator.cc b/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_metadata_decorator.cc index 123f008d6896c..80d0f1846763b 100644 --- a/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_metadata_decorator.cc +++ b/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/instance_templates/v1/instance_templates.proto #include "google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_metadata_decorator.h b/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_metadata_decorator.h index 959ca46063a91..c1cac63aed397 100644 --- a/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_metadata_decorator.h +++ b/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_TEMPLATES_V1_INTERNAL_INSTANCE_TEMPLATES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_TEMPLATES_V1_INTERNAL_INSTANCE_TEMPLATES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/instance_templates/v1/instance_templates.pb.h" #include "google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.cc b/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.cc index 6595885c14b59..415882e165419 100644 --- a/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.cc +++ b/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/instance_templates/v1/instance_templates.proto #include "google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/instance_templates/v1/instance_templates.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.h b/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.h index 72d4fe32a4439..81c28de28deb0 100644 --- a/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.h +++ b/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_TEMPLATES_V1_INTERNAL_INSTANCE_TEMPLATES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCE_TEMPLATES_V1_INTERNAL_INSTANCE_TEMPLATES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/instance_templates/v1/instance_templates.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/instance_templates/v1/internal/instance_templates_tracing_connection.cc b/google/cloud/compute/instance_templates/v1/internal/instance_templates_tracing_connection.cc index 3ed9a3e0f431d..1ab294ee2c3ff 100644 --- a/google/cloud/compute/instance_templates/v1/internal/instance_templates_tracing_connection.cc +++ b/google/cloud/compute/instance_templates/v1/internal/instance_templates_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_instance_templates_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InstanceTemplatesTracingConnection::InstanceTemplatesTracingConnection( std::shared_ptr child) @@ -178,18 +176,14 @@ InstanceTemplatesTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeInstanceTemplatesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/instance_templates/v1/internal/instance_templates_tracing_connection.h b/google/cloud/compute/instance_templates/v1/internal/instance_templates_tracing_connection.h index 9661f9087a690..78e1996075958 100644 --- a/google/cloud/compute/instance_templates/v1/internal/instance_templates_tracing_connection.h +++ b/google/cloud/compute/instance_templates/v1/internal/instance_templates_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_instance_templates_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InstanceTemplatesTracingConnection : public compute_instance_templates_v1::InstanceTemplatesConnection { public: @@ -100,8 +98,6 @@ class InstanceTemplatesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/instances/v1/instances_connection.h b/google/cloud/compute/instances/v1/instances_connection.h index cb9b5b3d3828d..9a4aeee7d0a83 100644 --- a/google/cloud/compute/instances/v1/instances_connection.h +++ b/google/cloud/compute/instances/v1/instances_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCES_V1_INSTANCES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCES_V1_INSTANCES_CONNECTION_H +#include "google/cloud/compute/instances/v1/instances.pb.h" #include "google/cloud/compute/instances/v1/instances_connection_idempotency_policy.h" #include "google/cloud/compute/instances/v1/internal/instances_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/instances/v1/instances_connection_idempotency_policy.h b/google/cloud/compute/instances/v1/instances_connection_idempotency_policy.h index 1e8a4d35ad0d7..772320437dad3 100644 --- a/google/cloud/compute/instances/v1/instances_connection_idempotency_policy.h +++ b/google/cloud/compute/instances/v1/instances_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCES_V1_INSTANCES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCES_V1_INSTANCES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/instances/v1/instances.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/instances/v1/instances_proto_export.h b/google/cloud/compute/instances/v1/instances_proto_export.h index 22c108f83ec8a..31058ec707203 100644 --- a/google/cloud/compute/instances/v1/instances_proto_export.h +++ b/google/cloud/compute/instances/v1/instances_proto_export.h @@ -26,22 +26,22 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCES_V1_INSTANCES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_001.pb.h" +#include "google/cloud/compute/v1/internal/common_003.pb.h" +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_015.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_021.pb.h" +#include "google/cloud/compute/v1/internal/common_022.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_033.pb.h" +#include "google/cloud/compute/v1/internal/common_034.pb.h" +#include "google/cloud/compute/v1/internal/common_039.pb.h" +#include "google/cloud/compute/v1/internal/common_081.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" +#include "google/cloud/compute/v1/internal/common_146.pb.h" +#include "google/cloud/compute/v1/internal/common_152.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCES_V1_INSTANCES_PROTO_EXPORT_H diff --git a/google/cloud/compute/instances/v1/internal/instances_option_defaults.cc b/google/cloud/compute/instances/v1/internal/instances_option_defaults.cc index fa54e7c489421..87856aa7e379e 100644 --- a/google/cloud/compute/instances/v1/internal/instances_option_defaults.cc +++ b/google/cloud/compute/instances/v1/internal/instances_option_defaults.cc @@ -41,7 +41,7 @@ Options InstancesDefaultOptions(Options options) { if (!options.has()) { options.set( compute_instances_v1::InstancesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/instances/v1/internal/instances_rest_connection_impl.h b/google/cloud/compute/instances/v1/internal/instances_rest_connection_impl.h index 5f8020a7443cd..375d08283ffcc 100644 --- a/google/cloud/compute/instances/v1/internal/instances_rest_connection_impl.h +++ b/google/cloud/compute/instances/v1/internal/instances_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/instances/v1/instances_options.h" #include "google/cloud/compute/instances/v1/internal/instances_rest_stub.h" #include "google/cloud/compute/instances/v1/internal/instances_retry_traits.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/instances/v1/internal/instances_rest_logging_decorator.h b/google/cloud/compute/instances/v1/internal/instances_rest_logging_decorator.h index 202656fe5c14f..13637e55d4487 100644 --- a/google/cloud/compute/instances/v1/internal/instances_rest_logging_decorator.h +++ b/google/cloud/compute/instances/v1/internal/instances_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCES_V1_INTERNAL_INSTANCES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCES_V1_INTERNAL_INSTANCES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/instances/v1/instances.pb.h" #include "google/cloud/compute/instances/v1/internal/instances_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/instances/v1/internal/instances_rest_metadata_decorator.cc b/google/cloud/compute/instances/v1/internal/instances_rest_metadata_decorator.cc index e569018817183..da3001805d4eb 100644 --- a/google/cloud/compute/instances/v1/internal/instances_rest_metadata_decorator.cc +++ b/google/cloud/compute/instances/v1/internal/instances_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/instances/v1/instances.proto #include "google/cloud/compute/instances/v1/internal/instances_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/instances/v1/internal/instances_rest_metadata_decorator.h b/google/cloud/compute/instances/v1/internal/instances_rest_metadata_decorator.h index 590764e345456..4e57e4b711aed 100644 --- a/google/cloud/compute/instances/v1/internal/instances_rest_metadata_decorator.h +++ b/google/cloud/compute/instances/v1/internal/instances_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCES_V1_INTERNAL_INSTANCES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCES_V1_INTERNAL_INSTANCES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/instances/v1/instances.pb.h" #include "google/cloud/compute/instances/v1/internal/instances_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/instances/v1/internal/instances_rest_stub.cc b/google/cloud/compute/instances/v1/internal/instances_rest_stub.cc index 009bebf415096..7a19c4610725e 100644 --- a/google/cloud/compute/instances/v1/internal/instances_rest_stub.cc +++ b/google/cloud/compute/instances/v1/internal/instances_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/instances/v1/instances.proto #include "google/cloud/compute/instances/v1/internal/instances_rest_stub.h" +#include "google/cloud/compute/instances/v1/instances.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/instances/v1/internal/instances_rest_stub.h b/google/cloud/compute/instances/v1/internal/instances_rest_stub.h index cebffdf70e2a7..5329c7daacdc7 100644 --- a/google/cloud/compute/instances/v1/internal/instances_rest_stub.h +++ b/google/cloud/compute/instances/v1/internal/instances_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCES_V1_INTERNAL_INSTANCES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANCES_V1_INTERNAL_INSTANCES_REST_STUB_H +#include "google/cloud/compute/instances/v1/instances.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/instances/v1/internal/instances_tracing_connection.cc b/google/cloud/compute/instances/v1/internal/instances_tracing_connection.cc index 44e9c477016c6..b4d7c0859518f 100644 --- a/google/cloud/compute/instances/v1/internal/instances_tracing_connection.cc +++ b/google/cloud/compute/instances/v1/internal/instances_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_instances_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InstancesTracingConnection::InstancesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -1288,16 +1286,12 @@ InstancesTracingConnection::UpdateShieldedInstanceConfig( child_->UpdateShieldedInstanceConfig(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeInstancesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/instances/v1/internal/instances_tracing_connection.h b/google/cloud/compute/instances/v1/internal/instances_tracing_connection.h index fbc8a2b1c9d4e..f076434a3bfcc 100644 --- a/google/cloud/compute/instances/v1/internal/instances_tracing_connection.h +++ b/google/cloud/compute/instances/v1/internal/instances_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_instances_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InstancesTracingConnection : public compute_instances_v1::InstancesConnection { public: @@ -544,8 +542,6 @@ class InstancesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/instant_snapshots/v1/instant_snapshots_connection.h b/google/cloud/compute/instant_snapshots/v1/instant_snapshots_connection.h index d889d707da3c0..8cd42e6b28858 100644 --- a/google/cloud/compute/instant_snapshots/v1/instant_snapshots_connection.h +++ b/google/cloud/compute/instant_snapshots/v1/instant_snapshots_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANT_SNAPSHOTS_V1_INSTANT_SNAPSHOTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANT_SNAPSHOTS_V1_INSTANT_SNAPSHOTS_CONNECTION_H +#include "google/cloud/compute/instant_snapshots/v1/instant_snapshots.pb.h" #include "google/cloud/compute/instant_snapshots/v1/instant_snapshots_connection_idempotency_policy.h" #include "google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/instant_snapshots/v1/instant_snapshots_connection_idempotency_policy.h b/google/cloud/compute/instant_snapshots/v1/instant_snapshots_connection_idempotency_policy.h index a06ce5c6e7750..2048c7d7f1616 100644 --- a/google/cloud/compute/instant_snapshots/v1/instant_snapshots_connection_idempotency_policy.h +++ b/google/cloud/compute/instant_snapshots/v1/instant_snapshots_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANT_SNAPSHOTS_V1_INSTANT_SNAPSHOTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANT_SNAPSHOTS_V1_INSTANT_SNAPSHOTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/instant_snapshots/v1/instant_snapshots.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/instant_snapshots/v1/instant_snapshots_proto_export.h b/google/cloud/compute/instant_snapshots/v1/instant_snapshots_proto_export.h index 523e8482cebbc..2df65dca61d48 100644 --- a/google/cloud/compute/instant_snapshots/v1/instant_snapshots_proto_export.h +++ b/google/cloud/compute/instant_snapshots/v1/instant_snapshots_proto_export.h @@ -26,14 +26,14 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANT_SNAPSHOTS_V1_INSTANT_SNAPSHOTS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_066.pb.h" +#include "google/cloud/compute/v1/internal/common_067.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" +#include "google/cloud/compute/v1/internal/common_151.pb.h" +#include "google/cloud/compute/v1/internal/common_152.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANT_SNAPSHOTS_V1_INSTANT_SNAPSHOTS_PROTO_EXPORT_H diff --git a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_option_defaults.cc b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_option_defaults.cc index 8b983cb99233c..79ab972e3a012 100644 --- a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_option_defaults.cc +++ b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_option_defaults.cc @@ -43,7 +43,7 @@ Options InstantSnapshotsDefaultOptions(Options options) { options.set< compute_instant_snapshots_v1::InstantSnapshotsRetryPolicyOption>( compute_instant_snapshots_v1::InstantSnapshotsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_logging_decorator.h b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_logging_decorator.h index 975d114a2928d..58c61f46aff54 100644 --- a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_logging_decorator.h +++ b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANT_SNAPSHOTS_V1_INTERNAL_INSTANT_SNAPSHOTS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANT_SNAPSHOTS_V1_INTERNAL_INSTANT_SNAPSHOTS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/instant_snapshots/v1/instant_snapshots.pb.h" #include "google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_metadata_decorator.cc b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_metadata_decorator.cc index 6f3bb752a0946..9c6b9b5f19890 100644 --- a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_metadata_decorator.cc +++ b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/instant_snapshots/v1/instant_snapshots.proto #include "google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_metadata_decorator.h b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_metadata_decorator.h index 37d455ba53497..73324e8c993e4 100644 --- a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_metadata_decorator.h +++ b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANT_SNAPSHOTS_V1_INTERNAL_INSTANT_SNAPSHOTS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANT_SNAPSHOTS_V1_INTERNAL_INSTANT_SNAPSHOTS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/instant_snapshots/v1/instant_snapshots.pb.h" #include "google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_stub.cc b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_stub.cc index f89b83c90ad88..c0196aa3b0c60 100644 --- a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_stub.cc +++ b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/instant_snapshots/v1/instant_snapshots.proto #include "google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_stub.h" +#include "google/cloud/compute/instant_snapshots/v1/instant_snapshots.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_stub.h b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_stub.h index 3e7027fa17822..5a6457a1c82e4 100644 --- a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_stub.h +++ b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANT_SNAPSHOTS_V1_INTERNAL_INSTANT_SNAPSHOTS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INSTANT_SNAPSHOTS_V1_INTERNAL_INSTANT_SNAPSHOTS_REST_STUB_H +#include "google/cloud/compute/instant_snapshots/v1/instant_snapshots.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_tracing_connection.cc b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_tracing_connection.cc index 41fd5f4829e87..1f0a3dbab1a04 100644 --- a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_tracing_connection.cc +++ b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_instant_snapshots_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InstantSnapshotsTracingConnection::InstantSnapshotsTracingConnection( std::shared_ptr child) @@ -206,17 +204,13 @@ InstantSnapshotsTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeInstantSnapshotsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_tracing_connection.h b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_tracing_connection.h index eeeb051cb9a94..ab51177169ee9 100644 --- a/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_tracing_connection.h +++ b/google/cloud/compute/instant_snapshots/v1/internal/instant_snapshots_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_instant_snapshots_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InstantSnapshotsTracingConnection : public compute_instant_snapshots_v1::InstantSnapshotsConnection { public: @@ -109,8 +107,6 @@ class InstantSnapshotsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/integration_tests/compute_integration_test.cc b/google/cloud/compute/integration_tests/compute_integration_test.cc index 53161ae74c22d..6f8c0a01d05cc 100644 --- a/google/cloud/compute/integration_tests/compute_integration_test.cc +++ b/google/cloud/compute/integration_tests/compute_integration_test.cc @@ -16,13 +16,13 @@ #include "google/cloud/compute/disks/v1/disks_proto_export.h" #include "google/cloud/compute/instances/v1/instances_client.h" #include "google/cloud/compute/networks/v1/networks_client.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/parse_rfc3339.h" #include "google/cloud/internal/random.h" #include "google/cloud/testing_util/integration_test.h" #include "google/cloud/testing_util/status_matchers.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include #include #include diff --git a/google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups_connection.h b/google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups_connection.h index b79074386f2c4..8498258bdbbe1 100644 --- a/google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups_connection.h +++ b/google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups_connection.h @@ -20,6 +20,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENT_GROUPS_V1_INTERCONNECT_ATTACHMENT_GROUPS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENT_GROUPS_V1_INTERCONNECT_ATTACHMENT_GROUPS_CONNECTION_H +#include "google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups.pb.h" #include "google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups_connection_idempotency_policy.h" #include "google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups_connection_idempotency_policy.h b/google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups_connection_idempotency_policy.h index bfc89a8c128aa..fb3ad666c33e8 100644 --- a/google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups_connection_idempotency_policy.h +++ b/google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENT_GROUPS_V1_INTERCONNECT_ATTACHMENT_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENT_GROUPS_V1_INTERCONNECT_ATTACHMENT_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups_proto_export.h b/google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups_proto_export.h index b82a4077b72b4..ec6516a3afcc3 100644 --- a/google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups_proto_export.h +++ b/google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups_proto_export.h @@ -26,12 +26,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENT_GROUPS_V1_INTERCONNECT_ATTACHMENT_GROUPS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_047.pb.h" +#include "google/cloud/compute/v1/internal/common_071.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENT_GROUPS_V1_INTERCONNECT_ATTACHMENT_GROUPS_PROTO_EXPORT_H diff --git a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_option_defaults.cc b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_option_defaults.cc index 93ecd93d3f886..11ba22394649a 100644 --- a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_option_defaults.cc +++ b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_option_defaults.cc @@ -47,7 +47,7 @@ Options InterconnectAttachmentGroupsDefaultOptions(Options options) { InterconnectAttachmentGroupsRetryPolicyOption>( compute_interconnect_attachment_groups_v1:: InterconnectAttachmentGroupsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_logging_decorator.h b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_logging_decorator.h index 246f81a566d73..248c68c9caf4e 100644 --- a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_logging_decorator.h +++ b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENT_GROUPS_V1_INTERNAL_INTERCONNECT_ATTACHMENT_GROUPS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENT_GROUPS_V1_INTERNAL_INTERCONNECT_ATTACHMENT_GROUPS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups.pb.h" #include "google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_metadata_decorator.cc b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_metadata_decorator.cc index 1dff603449285..9a0f35a22d0d9 100644 --- a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_metadata_decorator.cc +++ b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups.proto #include "google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_metadata_decorator.h b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_metadata_decorator.h index edc5149779615..95b3357533f3d 100644 --- a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_metadata_decorator.h +++ b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENT_GROUPS_V1_INTERNAL_INTERCONNECT_ATTACHMENT_GROUPS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENT_GROUPS_V1_INTERNAL_INTERCONNECT_ATTACHMENT_GROUPS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups.pb.h" #include "google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_stub.cc b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_stub.cc index bd662bb8bb181..2731ebf036c19 100644 --- a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_stub.cc +++ b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups.proto #include "google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_stub.h b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_stub.h index e5d1d22427978..0511d849c57c7 100644 --- a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_stub.h +++ b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENT_GROUPS_V1_INTERNAL_INTERCONNECT_ATTACHMENT_GROUPS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENT_GROUPS_V1_INTERNAL_INTERCONNECT_ATTACHMENT_GROUPS_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/interconnect_attachment_groups/v1/interconnect_attachment_groups.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_tracing_connection.cc b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_tracing_connection.cc index b1c3348b0a086..c443bdaad77f9 100644 --- a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_tracing_connection.cc +++ b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_interconnect_attachment_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InterconnectAttachmentGroupsTracingConnection:: InterconnectAttachmentGroupsTracingConnection( std::shared_ptrTestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeInterconnectAttachmentGroupsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_tracing_connection.h b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_tracing_connection.h index 296ab19150236..e82b1a078ec33 100644 --- a/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_tracing_connection.h +++ b/google/cloud/compute/interconnect_attachment_groups/v1/internal/interconnect_attachment_groups_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_interconnect_attachment_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InterconnectAttachmentGroupsTracingConnection : public compute_interconnect_attachment_groups_v1:: InterconnectAttachmentGroupsConnection { @@ -124,8 +122,6 @@ class InterconnectAttachmentGroupsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/interconnect_attachments/v1/interconnect_attachments_connection.h b/google/cloud/compute/interconnect_attachments/v1/interconnect_attachments_connection.h index b12d576445d58..2212f39369caf 100644 --- a/google/cloud/compute/interconnect_attachments/v1/interconnect_attachments_connection.h +++ b/google/cloud/compute/interconnect_attachments/v1/interconnect_attachments_connection.h @@ -20,6 +20,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENTS_V1_INTERCONNECT_ATTACHMENTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENTS_V1_INTERCONNECT_ATTACHMENTS_CONNECTION_H +#include "google/cloud/compute/interconnect_attachments/v1/interconnect_attachments.pb.h" #include "google/cloud/compute/interconnect_attachments/v1/interconnect_attachments_connection_idempotency_policy.h" #include "google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_attachments/v1/interconnect_attachments_connection_idempotency_policy.h b/google/cloud/compute/interconnect_attachments/v1/interconnect_attachments_connection_idempotency_policy.h index 3701f13e3e169..2a16146d32189 100644 --- a/google/cloud/compute/interconnect_attachments/v1/interconnect_attachments_connection_idempotency_policy.h +++ b/google/cloud/compute/interconnect_attachments/v1/interconnect_attachments_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENTS_V1_INTERCONNECT_ATTACHMENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENTS_V1_INTERCONNECT_ATTACHMENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/interconnect_attachments/v1/interconnect_attachments.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_attachments/v1/interconnect_attachments_proto_export.h b/google/cloud/compute/interconnect_attachments/v1/interconnect_attachments_proto_export.h index 457050ff4cf36..87d65a390321b 100644 --- a/google/cloud/compute/interconnect_attachments/v1/interconnect_attachments_proto_export.h +++ b/google/cloud/compute/interconnect_attachments/v1/interconnect_attachments_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENTS_V1_INTERCONNECT_ATTACHMENTS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_069.pb.h" +#include "google/cloud/compute/v1/internal/common_070.pb.h" +#include "google/cloud/compute/v1/internal/common_107.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENTS_V1_INTERCONNECT_ATTACHMENTS_PROTO_EXPORT_H diff --git a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_option_defaults.cc b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_option_defaults.cc index 42ea3b3eeb892..9078aa8f7d112 100644 --- a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_option_defaults.cc +++ b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_option_defaults.cc @@ -46,7 +46,7 @@ Options InterconnectAttachmentsDefaultOptions(Options options) { InterconnectAttachmentsRetryPolicyOption>( compute_interconnect_attachments_v1:: InterconnectAttachmentsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_logging_decorator.h b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_logging_decorator.h index f454d1b98b3d9..bd4a4f70e96aa 100644 --- a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_logging_decorator.h +++ b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENTS_V1_INTERNAL_INTERCONNECT_ATTACHMENTS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENTS_V1_INTERNAL_INTERCONNECT_ATTACHMENTS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/interconnect_attachments/v1/interconnect_attachments.pb.h" #include "google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_metadata_decorator.cc b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_metadata_decorator.cc index 0edab236eea64..e339aae30ad86 100644 --- a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_metadata_decorator.cc +++ b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/interconnect_attachments/v1/interconnect_attachments.proto #include "google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_metadata_decorator.h b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_metadata_decorator.h index eb25f42460f09..24a528053ac84 100644 --- a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_metadata_decorator.h +++ b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENTS_V1_INTERNAL_INTERCONNECT_ATTACHMENTS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENTS_V1_INTERNAL_INTERCONNECT_ATTACHMENTS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/interconnect_attachments/v1/interconnect_attachments.pb.h" #include "google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.cc b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.cc index 2d8a443c99137..d22e54085e6f3 100644 --- a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.cc +++ b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/interconnect_attachments/v1/interconnect_attachments.proto #include "google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.h" +#include "google/cloud/compute/interconnect_attachments/v1/interconnect_attachments.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.h b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.h index 4afa037100fe3..6617bd18b4794 100644 --- a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.h +++ b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENTS_V1_INTERNAL_INTERCONNECT_ATTACHMENTS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_ATTACHMENTS_V1_INTERNAL_INTERCONNECT_ATTACHMENTS_REST_STUB_H +#include "google/cloud/compute/interconnect_attachments/v1/interconnect_attachments.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_tracing_connection.cc b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_tracing_connection.cc index 73841f9cd5a64..e3cd97fb95aaf 100644 --- a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_tracing_connection.cc +++ b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_interconnect_attachments_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InterconnectAttachmentsTracingConnection:: InterconnectAttachmentsTracingConnection( std::shared_ptrSetLabels(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_interconnect_attachments_v1::InterconnectAttachmentsConnection> MakeInterconnectAttachmentsTracingConnection( std::shared_ptr< compute_interconnect_attachments_v1::InterconnectAttachmentsConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_tracing_connection.h b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_tracing_connection.h index eba6596fad106..262767d0c9f60 100644 --- a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_tracing_connection.h +++ b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_interconnect_attachments_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InterconnectAttachmentsTracingConnection : public compute_interconnect_attachments_v1:: InterconnectAttachmentsConnection { @@ -122,8 +120,6 @@ class InterconnectAttachmentsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/interconnect_groups/v1/interconnect_groups_connection.h b/google/cloud/compute/interconnect_groups/v1/interconnect_groups_connection.h index df444f090223d..28e744b366dbd 100644 --- a/google/cloud/compute/interconnect_groups/v1/interconnect_groups_connection.h +++ b/google/cloud/compute/interconnect_groups/v1/interconnect_groups_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_GROUPS_V1_INTERCONNECT_GROUPS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_GROUPS_V1_INTERCONNECT_GROUPS_CONNECTION_H +#include "google/cloud/compute/interconnect_groups/v1/interconnect_groups.pb.h" #include "google/cloud/compute/interconnect_groups/v1/interconnect_groups_connection_idempotency_policy.h" #include "google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_groups/v1/interconnect_groups_connection_idempotency_policy.h b/google/cloud/compute/interconnect_groups/v1/interconnect_groups_connection_idempotency_policy.h index 26effa0fcb2d0..8fe74a41624f2 100644 --- a/google/cloud/compute/interconnect_groups/v1/interconnect_groups_connection_idempotency_policy.h +++ b/google/cloud/compute/interconnect_groups/v1/interconnect_groups_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_GROUPS_V1_INTERCONNECT_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_GROUPS_V1_INTERCONNECT_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/interconnect_groups/v1/interconnect_groups.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_groups/v1/interconnect_groups_proto_export.h b/google/cloud/compute/interconnect_groups/v1/interconnect_groups_proto_export.h index 97051ff570fd2..942bc1daa59a6 100644 --- a/google/cloud/compute/interconnect_groups/v1/interconnect_groups_proto_export.h +++ b/google/cloud/compute/interconnect_groups/v1/interconnect_groups_proto_export.h @@ -26,13 +26,13 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_GROUPS_V1_INTERCONNECT_GROUPS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_047.pb.h" +#include "google/cloud/compute/v1/internal/common_072.pb.h" +#include "google/cloud/compute/v1/internal/common_073.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_GROUPS_V1_INTERCONNECT_GROUPS_PROTO_EXPORT_H diff --git a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_option_defaults.cc b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_option_defaults.cc index 0707264129314..78bd9081c82ae 100644 --- a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_option_defaults.cc +++ b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_option_defaults.cc @@ -44,7 +44,7 @@ Options InterconnectGroupsDefaultOptions(Options options) { options.set< compute_interconnect_groups_v1::InterconnectGroupsRetryPolicyOption>( compute_interconnect_groups_v1:: - InterconnectGroupsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + InterconnectGroupsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_logging_decorator.h b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_logging_decorator.h index 98f4fd3cd08c1..772e3ceef84ff 100644 --- a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_logging_decorator.h +++ b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_GROUPS_V1_INTERNAL_INTERCONNECT_GROUPS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_GROUPS_V1_INTERNAL_INTERCONNECT_GROUPS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/interconnect_groups/v1/interconnect_groups.pb.h" #include "google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_metadata_decorator.cc b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_metadata_decorator.cc index 56e0b9c39e1fa..ae701ceabb26f 100644 --- a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_metadata_decorator.cc +++ b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/interconnect_groups/v1/interconnect_groups.proto #include "google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_metadata_decorator.h b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_metadata_decorator.h index cd4876fe0e717..767db4c4790a0 100644 --- a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_metadata_decorator.h +++ b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_GROUPS_V1_INTERNAL_INTERCONNECT_GROUPS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_GROUPS_V1_INTERNAL_INTERCONNECT_GROUPS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/interconnect_groups/v1/interconnect_groups.pb.h" #include "google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_stub.cc b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_stub.cc index d2962b3180ed1..3fc08df52ed80 100644 --- a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_stub.cc +++ b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/interconnect_groups/v1/interconnect_groups.proto #include "google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/interconnect_groups/v1/interconnect_groups.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_stub.h b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_stub.h index e12f035580abf..4807d340f4175 100644 --- a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_stub.h +++ b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_GROUPS_V1_INTERNAL_INTERCONNECT_GROUPS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_GROUPS_V1_INTERNAL_INTERCONNECT_GROUPS_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/interconnect_groups/v1/interconnect_groups.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_tracing_connection.cc b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_tracing_connection.cc index 6dd8b638058dc..2d7bf6e9fed60 100644 --- a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_tracing_connection.cc +++ b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_interconnect_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InterconnectGroupsTracingConnection::InterconnectGroupsTracingConnection( std::shared_ptr< compute_interconnect_groups_v1::InterconnectGroupsConnection> @@ -242,19 +240,15 @@ InterconnectGroupsTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeInterconnectGroupsTracingConnection( std::shared_ptr< compute_interconnect_groups_v1::InterconnectGroupsConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_tracing_connection.h b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_tracing_connection.h index b60bcb1254673..8658aab4fa986 100644 --- a/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_tracing_connection.h +++ b/google/cloud/compute/interconnect_groups/v1/internal/interconnect_groups_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_interconnect_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InterconnectGroupsTracingConnection : public compute_interconnect_groups_v1::InterconnectGroupsConnection { public: @@ -122,8 +120,6 @@ class InterconnectGroupsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/interconnect_locations/v1/interconnect_locations_connection.h b/google/cloud/compute/interconnect_locations/v1/interconnect_locations_connection.h index 97a07d7349fbd..26a0d34423ba6 100644 --- a/google/cloud/compute/interconnect_locations/v1/interconnect_locations_connection.h +++ b/google/cloud/compute/interconnect_locations/v1/interconnect_locations_connection.h @@ -20,6 +20,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_LOCATIONS_V1_INTERCONNECT_LOCATIONS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_LOCATIONS_V1_INTERCONNECT_LOCATIONS_CONNECTION_H +#include "google/cloud/compute/interconnect_locations/v1/interconnect_locations.pb.h" #include "google/cloud/compute/interconnect_locations/v1/interconnect_locations_connection_idempotency_policy.h" #include "google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -28,7 +29,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_locations/v1/interconnect_locations_connection_idempotency_policy.h b/google/cloud/compute/interconnect_locations/v1/interconnect_locations_connection_idempotency_policy.h index 482d44d5d8175..a3e85cd50307c 100644 --- a/google/cloud/compute/interconnect_locations/v1/interconnect_locations_connection_idempotency_policy.h +++ b/google/cloud/compute/interconnect_locations/v1/interconnect_locations_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_LOCATIONS_V1_INTERCONNECT_LOCATIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_LOCATIONS_V1_INTERCONNECT_LOCATIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/interconnect_locations/v1/interconnect_locations.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_locations/v1/interconnect_locations_proto_export.h b/google/cloud/compute/interconnect_locations/v1/interconnect_locations_proto_export.h index 2312f2a28562b..049a82f5dab94 100644 --- a/google/cloud/compute/interconnect_locations/v1/interconnect_locations_proto_export.h +++ b/google/cloud/compute/interconnect_locations/v1/interconnect_locations_proto_export.h @@ -26,7 +26,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_LOCATIONS_V1_INTERCONNECT_LOCATIONS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include +#include "google/cloud/compute/v1/internal/common_074.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_LOCATIONS_V1_INTERCONNECT_LOCATIONS_PROTO_EXPORT_H diff --git a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_option_defaults.cc b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_option_defaults.cc index d3c314070f9a9..7079a74b3cf87 100644 --- a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_option_defaults.cc +++ b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_option_defaults.cc @@ -46,7 +46,7 @@ Options InterconnectLocationsDefaultOptions(Options options) { InterconnectLocationsRetryPolicyOption>( compute_interconnect_locations_v1:: InterconnectLocationsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include #include diff --git a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_metadata_decorator.cc b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_metadata_decorator.cc index 2fc09054435c7..59dc00be6ca7f 100644 --- a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_metadata_decorator.cc +++ b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/interconnect_locations/v1/interconnect_locations.proto #include "google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_metadata_decorator.h b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_metadata_decorator.h index 2531336de3022..62afed4607817 100644 --- a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_metadata_decorator.h +++ b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_LOCATIONS_V1_INTERNAL_INTERCONNECT_LOCATIONS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_LOCATIONS_V1_INTERNAL_INTERCONNECT_LOCATIONS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/interconnect_locations/v1/interconnect_locations.pb.h" #include "google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.cc b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.cc index 4cc5bf9b1881e..f2bd1fe366d46 100644 --- a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.cc +++ b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.cc @@ -18,11 +18,11 @@ // google/cloud/compute/interconnect_locations/v1/interconnect_locations.proto #include "google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.h" +#include "google/cloud/compute/interconnect_locations/v1/interconnect_locations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.h b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.h index 630d4ad8c90e9..17b2d60fe7446 100644 --- a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.h +++ b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_LOCATIONS_V1_INTERNAL_INTERCONNECT_LOCATIONS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_LOCATIONS_V1_INTERNAL_INTERCONNECT_LOCATIONS_REST_STUB_H +#include "google/cloud/compute/interconnect_locations/v1/interconnect_locations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_tracing_connection.cc b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_tracing_connection.cc index 8f7ed15f17e38..be084abc5f62c 100644 --- a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_tracing_connection.cc +++ b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_interconnect_locations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InterconnectLocationsTracingConnection::InterconnectLocationsTracingConnection( std::shared_ptr< compute_interconnect_locations_v1::InterconnectLocationsConnection> @@ -61,20 +59,16 @@ InterconnectLocationsTracingConnection::ListInterconnectLocations( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_interconnect_locations_v1::InterconnectLocationsConnection> MakeInterconnectLocationsTracingConnection( std::shared_ptr< compute_interconnect_locations_v1::InterconnectLocationsConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_tracing_connection.h b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_tracing_connection.h index a3fbc277c7a01..1e5484a2b2c77 100644 --- a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_tracing_connection.h +++ b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_interconnect_locations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InterconnectLocationsTracingConnection : public compute_interconnect_locations_v1:: InterconnectLocationsConnection { @@ -60,8 +58,6 @@ class InterconnectLocationsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations_connection.h b/google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations_connection.h index 8429dc64f890d..acfaca4f8cc1f 100644 --- a/google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations_connection.h +++ b/google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations_connection.h @@ -20,6 +20,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_REMOTE_LOCATIONS_V1_INTERCONNECT_REMOTE_LOCATIONS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_REMOTE_LOCATIONS_V1_INTERCONNECT_REMOTE_LOCATIONS_CONNECTION_H +#include "google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations.pb.h" #include "google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations_connection_idempotency_policy.h" #include "google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -28,7 +29,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations_connection_idempotency_policy.h b/google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations_connection_idempotency_policy.h index 01a0e7683f731..1f78d402b0264 100644 --- a/google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations_connection_idempotency_policy.h +++ b/google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_REMOTE_LOCATIONS_V1_INTERCONNECT_REMOTE_LOCATIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_REMOTE_LOCATIONS_V1_INTERCONNECT_REMOTE_LOCATIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations_proto_export.h b/google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations_proto_export.h index 9258d785a36a1..dee12ca0726a4 100644 --- a/google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations_proto_export.h +++ b/google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_REMOTE_LOCATIONS_V1_INTERCONNECT_REMOTE_LOCATIONS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_070.pb.h" +#include "google/cloud/compute/v1/internal/common_075.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_REMOTE_LOCATIONS_V1_INTERCONNECT_REMOTE_LOCATIONS_PROTO_EXPORT_H diff --git a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_option_defaults.cc b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_option_defaults.cc index a349dd8455643..64f55096c55e3 100644 --- a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_option_defaults.cc +++ b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_option_defaults.cc @@ -47,7 +47,7 @@ Options InterconnectRemoteLocationsDefaultOptions(Options options) { InterconnectRemoteLocationsRetryPolicyOption>( compute_interconnect_remote_locations_v1:: InterconnectRemoteLocationsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include #include diff --git a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_metadata_decorator.cc b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_metadata_decorator.cc index 78cdc59d27774..d0d12dc65951b 100644 --- a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_metadata_decorator.cc +++ b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations.proto #include "google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_metadata_decorator.h b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_metadata_decorator.h index 00cbdf1f0f333..d9ff68cbcb89d 100644 --- a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_metadata_decorator.h +++ b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_REMOTE_LOCATIONS_V1_INTERNAL_INTERCONNECT_REMOTE_LOCATIONS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_REMOTE_LOCATIONS_V1_INTERNAL_INTERCONNECT_REMOTE_LOCATIONS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations.pb.h" #include "google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.cc b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.cc index 32d9159bced85..1fe473f92b6ec 100644 --- a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.cc +++ b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.cc @@ -18,11 +18,11 @@ // google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations.proto #include "google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.h" +#include "google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.h b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.h index 18a3f782557dc..0ba0f5c42103b 100644 --- a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.h +++ b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_REMOTE_LOCATIONS_V1_INTERNAL_INTERCONNECT_REMOTE_LOCATIONS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECT_REMOTE_LOCATIONS_V1_INTERNAL_INTERCONNECT_REMOTE_LOCATIONS_REST_STUB_H +#include "google/cloud/compute/interconnect_remote_locations/v1/interconnect_remote_locations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_tracing_connection.cc b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_tracing_connection.cc index fbf8ef66d8066..cd9116ccd2f85 100644 --- a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_tracing_connection.cc +++ b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_interconnect_remote_locations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InterconnectRemoteLocationsTracingConnection:: InterconnectRemoteLocationsTracingConnection( std::shared_ptr MakeInterconnectRemoteLocationsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_tracing_connection.h b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_tracing_connection.h index 2ab266ae11ec9..57607a7197416 100644 --- a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_tracing_connection.h +++ b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_interconnect_remote_locations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InterconnectRemoteLocationsTracingConnection : public compute_interconnect_remote_locations_v1:: InterconnectRemoteLocationsConnection { @@ -60,8 +58,6 @@ class InterconnectRemoteLocationsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/interconnects/v1/interconnects_connection.h b/google/cloud/compute/interconnects/v1/interconnects_connection.h index c44d90e5b761e..40efe62925122 100644 --- a/google/cloud/compute/interconnects/v1/interconnects_connection.h +++ b/google/cloud/compute/interconnects/v1/interconnects_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECTS_V1_INTERCONNECTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECTS_V1_INTERCONNECTS_CONNECTION_H +#include "google/cloud/compute/interconnects/v1/interconnects.pb.h" #include "google/cloud/compute/interconnects/v1/interconnects_connection_idempotency_policy.h" #include "google/cloud/compute/interconnects/v1/internal/interconnects_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnects/v1/interconnects_connection_idempotency_policy.h b/google/cloud/compute/interconnects/v1/interconnects_connection_idempotency_policy.h index c7d3f4c72ab6e..d3e4840d0ab33 100644 --- a/google/cloud/compute/interconnects/v1/interconnects_connection_idempotency_policy.h +++ b/google/cloud/compute/interconnects/v1/interconnects_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECTS_V1_INTERCONNECTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECTS_V1_INTERCONNECTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/interconnects/v1/interconnects.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnects/v1/interconnects_proto_export.h b/google/cloud/compute/interconnects/v1/interconnects_proto_export.h index 61b2191a97a3a..28d03f527b2ee 100644 --- a/google/cloud/compute/interconnects/v1/interconnects_proto_export.h +++ b/google/cloud/compute/interconnects/v1/interconnects_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECTS_V1_INTERCONNECTS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_046.pb.h" +#include "google/cloud/compute/v1/internal/common_068.pb.h" +#include "google/cloud/compute/v1/internal/common_072.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECTS_V1_INTERCONNECTS_PROTO_EXPORT_H diff --git a/google/cloud/compute/interconnects/v1/internal/interconnects_option_defaults.cc b/google/cloud/compute/interconnects/v1/internal/interconnects_option_defaults.cc index ed32d336a6ccf..60d6fd0a6582f 100644 --- a/google/cloud/compute/interconnects/v1/internal/interconnects_option_defaults.cc +++ b/google/cloud/compute/interconnects/v1/internal/interconnects_option_defaults.cc @@ -42,7 +42,7 @@ Options InterconnectsDefaultOptions(Options options) { .has()) { options.set( compute_interconnects_v1::InterconnectsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_connection_impl.h b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_connection_impl.h index af643e271b2fe..a574a560a4c55 100644 --- a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_connection_impl.h +++ b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECTS_V1_INTERNAL_INTERCONNECTS_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECTS_V1_INTERNAL_INTERCONNECTS_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/interconnects/v1/interconnects_connection.h" #include "google/cloud/compute/interconnects/v1/interconnects_connection_idempotency_policy.h" #include "google/cloud/compute/interconnects/v1/interconnects_options.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_logging_decorator.h b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_logging_decorator.h index c18b61ea4cdcf..44e3516b668fc 100644 --- a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_logging_decorator.h +++ b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECTS_V1_INTERNAL_INTERCONNECTS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECTS_V1_INTERNAL_INTERCONNECTS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/interconnects/v1/interconnects.pb.h" #include "google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_metadata_decorator.cc b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_metadata_decorator.cc index 56e6680589718..909fa3c8561bd 100644 --- a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_metadata_decorator.cc +++ b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/interconnects/v1/interconnects.proto #include "google/cloud/compute/interconnects/v1/internal/interconnects_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_metadata_decorator.h b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_metadata_decorator.h index adda6c50f02e4..a7de627b2c9a6 100644 --- a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_metadata_decorator.h +++ b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECTS_V1_INTERNAL_INTERCONNECTS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECTS_V1_INTERNAL_INTERCONNECTS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/interconnects/v1/interconnects.pb.h" #include "google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.cc b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.cc index 3d6b0f1413334..d7cada1c2b298 100644 --- a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.cc +++ b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/interconnects/v1/interconnects.proto #include "google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/interconnects/v1/interconnects.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.h b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.h index ed4220d6f8a11..faf5f097d5a8d 100644 --- a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.h +++ b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECTS_V1_INTERNAL_INTERCONNECTS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_INTERCONNECTS_V1_INTERNAL_INTERCONNECTS_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/interconnects/v1/interconnects.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/interconnects/v1/internal/interconnects_tracing_connection.cc b/google/cloud/compute/interconnects/v1/internal/interconnects_tracing_connection.cc index 1f2c5796c70c5..3c50451d70899 100644 --- a/google/cloud/compute/interconnects/v1/internal/interconnects_tracing_connection.cc +++ b/google/cloud/compute/interconnects/v1/internal/interconnects_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_interconnects_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InterconnectsTracingConnection::InterconnectsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -201,16 +199,12 @@ InterconnectsTracingConnection::SetLabels( return internal::EndSpan(std::move(span), child_->SetLabels(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeInterconnectsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/interconnects/v1/internal/interconnects_tracing_connection.h b/google/cloud/compute/interconnects/v1/internal/interconnects_tracing_connection.h index ee092d0361b18..dd28b22768089 100644 --- a/google/cloud/compute/interconnects/v1/internal/interconnects_tracing_connection.h +++ b/google/cloud/compute/interconnects/v1/internal/interconnects_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_interconnects_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InterconnectsTracingConnection : public compute_interconnects_v1::InterconnectsConnection { public: @@ -109,8 +107,6 @@ class InterconnectsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/license_codes/v1/internal/license_codes_option_defaults.cc b/google/cloud/compute/license_codes/v1/internal/license_codes_option_defaults.cc index d82f73d304838..d62584e28b56b 100644 --- a/google/cloud/compute/license_codes/v1/internal/license_codes_option_defaults.cc +++ b/google/cloud/compute/license_codes/v1/internal/license_codes_option_defaults.cc @@ -41,7 +41,7 @@ Options LicenseCodesDefaultOptions(Options options) { if (!options.has()) { options.set( compute_license_codes_v1::LicenseCodesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/compute/license_codes/v1/internal/license_codes_rest_logging_decorator.h b/google/cloud/compute/license_codes/v1/internal/license_codes_rest_logging_decorator.h index 9928f17eeccd4..1338441af6042 100644 --- a/google/cloud/compute/license_codes/v1/internal/license_codes_rest_logging_decorator.h +++ b/google/cloud/compute/license_codes/v1/internal/license_codes_rest_logging_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSE_CODES_V1_INTERNAL_LICENSE_CODES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.h" +#include "google/cloud/compute/license_codes/v1/license_codes.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/compute/license_codes/v1/internal/license_codes_rest_metadata_decorator.cc b/google/cloud/compute/license_codes/v1/internal/license_codes_rest_metadata_decorator.cc index 243b2c72216d3..ed0e1c2c1bd01 100644 --- a/google/cloud/compute/license_codes/v1/internal/license_codes_rest_metadata_decorator.cc +++ b/google/cloud/compute/license_codes/v1/internal/license_codes_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/license_codes/v1/license_codes.proto #include "google/cloud/compute/license_codes/v1/internal/license_codes_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/license_codes/v1/internal/license_codes_rest_metadata_decorator.h b/google/cloud/compute/license_codes/v1/internal/license_codes_rest_metadata_decorator.h index 0ee675915c058..774af7f60c9c0 100644 --- a/google/cloud/compute/license_codes/v1/internal/license_codes_rest_metadata_decorator.h +++ b/google/cloud/compute/license_codes/v1/internal/license_codes_rest_metadata_decorator.h @@ -20,10 +20,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSE_CODES_V1_INTERNAL_LICENSE_CODES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.h" +#include "google/cloud/compute/license_codes/v1/license_codes.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.cc b/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.cc index ac720e511d092..1dfe9b231b9fa 100644 --- a/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.cc +++ b/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/license_codes/v1/license_codes.proto #include "google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.h" +#include "google/cloud/compute/license_codes/v1/license_codes.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.h b/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.h index 1795166d74bee..3de76502f66d8 100644 --- a/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.h +++ b/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSE_CODES_V1_INTERNAL_LICENSE_CODES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSE_CODES_V1_INTERNAL_LICENSE_CODES_REST_STUB_H +#include "google/cloud/compute/license_codes/v1/license_codes.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/license_codes/v1/internal/license_codes_tracing_connection.cc b/google/cloud/compute/license_codes/v1/internal/license_codes_tracing_connection.cc index 7f3d1ea4e7aa3..8d61a0afeb6e7 100644 --- a/google/cloud/compute/license_codes/v1/internal/license_codes_tracing_connection.cc +++ b/google/cloud/compute/license_codes/v1/internal/license_codes_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace compute_license_codes_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LicenseCodesTracingConnection::LicenseCodesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -52,16 +50,12 @@ LicenseCodesTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLicenseCodesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/license_codes/v1/internal/license_codes_tracing_connection.h b/google/cloud/compute/license_codes/v1/internal/license_codes_tracing_connection.h index 1bf365e7ccbd8..962b1ae73645f 100644 --- a/google/cloud/compute/license_codes/v1/internal/license_codes_tracing_connection.h +++ b/google/cloud/compute/license_codes/v1/internal/license_codes_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_license_codes_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LicenseCodesTracingConnection : public compute_license_codes_v1::LicenseCodesConnection { public: @@ -52,8 +50,6 @@ class LicenseCodesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/license_codes/v1/license_codes_connection.h b/google/cloud/compute/license_codes/v1/license_codes_connection.h index 3f3abfc397baf..ad811d4af8318 100644 --- a/google/cloud/compute/license_codes/v1/license_codes_connection.h +++ b/google/cloud/compute/license_codes/v1/license_codes_connection.h @@ -20,13 +20,13 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSE_CODES_V1_LICENSE_CODES_CONNECTION_H #include "google/cloud/compute/license_codes/v1/internal/license_codes_retry_traits.h" +#include "google/cloud/compute/license_codes/v1/license_codes.pb.h" #include "google/cloud/compute/license_codes/v1/license_codes_connection_idempotency_policy.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/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/license_codes/v1/license_codes_connection_idempotency_policy.h b/google/cloud/compute/license_codes/v1/license_codes_connection_idempotency_policy.h index d9d23efc8acbd..9fb95dc04f653 100644 --- a/google/cloud/compute/license_codes/v1/license_codes_connection_idempotency_policy.h +++ b/google/cloud/compute/license_codes/v1/license_codes_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSE_CODES_V1_LICENSE_CODES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSE_CODES_V1_LICENSE_CODES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/license_codes/v1/license_codes.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/license_codes/v1/license_codes_proto_export.h b/google/cloud/compute/license_codes/v1/license_codes_proto_export.h index d6add981d1c52..1615730514d13 100644 --- a/google/cloud/compute/license_codes/v1/license_codes_proto_export.h +++ b/google/cloud/compute/license_codes/v1/license_codes_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSE_CODES_V1_LICENSE_CODES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_077.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSE_CODES_V1_LICENSE_CODES_PROTO_EXPORT_H diff --git a/google/cloud/compute/licenses/v1/internal/licenses_option_defaults.cc b/google/cloud/compute/licenses/v1/internal/licenses_option_defaults.cc index fd474641c775c..b9c85f772d796 100644 --- a/google/cloud/compute/licenses/v1/internal/licenses_option_defaults.cc +++ b/google/cloud/compute/licenses/v1/internal/licenses_option_defaults.cc @@ -41,7 +41,7 @@ Options LicensesDefaultOptions(Options options) { if (!options.has()) { options.set( compute_licenses_v1::LicensesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/licenses/v1/internal/licenses_rest_connection_impl.h b/google/cloud/compute/licenses/v1/internal/licenses_rest_connection_impl.h index 246ee2e79ec34..88bc28b1708e0 100644 --- a/google/cloud/compute/licenses/v1/internal/licenses_rest_connection_impl.h +++ b/google/cloud/compute/licenses/v1/internal/licenses_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSES_V1_INTERNAL_LICENSES_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSES_V1_INTERNAL_LICENSES_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/licenses/v1/internal/licenses_rest_stub.h" #include "google/cloud/compute/licenses/v1/internal/licenses_retry_traits.h" #include "google/cloud/compute/licenses/v1/licenses_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/licenses/v1/internal/licenses_rest_logging_decorator.h b/google/cloud/compute/licenses/v1/internal/licenses_rest_logging_decorator.h index 887179762ccc2..501eb7675f7c7 100644 --- a/google/cloud/compute/licenses/v1/internal/licenses_rest_logging_decorator.h +++ b/google/cloud/compute/licenses/v1/internal/licenses_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSES_V1_INTERNAL_LICENSES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSES_V1_INTERNAL_LICENSES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/licenses/v1/internal/licenses_rest_stub.h" +#include "google/cloud/compute/licenses/v1/licenses.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/licenses/v1/internal/licenses_rest_metadata_decorator.cc b/google/cloud/compute/licenses/v1/internal/licenses_rest_metadata_decorator.cc index ca07301cf0288..2e5791d409949 100644 --- a/google/cloud/compute/licenses/v1/internal/licenses_rest_metadata_decorator.cc +++ b/google/cloud/compute/licenses/v1/internal/licenses_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/licenses/v1/licenses.proto #include "google/cloud/compute/licenses/v1/internal/licenses_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/licenses/v1/internal/licenses_rest_metadata_decorator.h b/google/cloud/compute/licenses/v1/internal/licenses_rest_metadata_decorator.h index 5b095a83d65f0..6073f931e32ae 100644 --- a/google/cloud/compute/licenses/v1/internal/licenses_rest_metadata_decorator.h +++ b/google/cloud/compute/licenses/v1/internal/licenses_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSES_V1_INTERNAL_LICENSES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSES_V1_INTERNAL_LICENSES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/licenses/v1/internal/licenses_rest_stub.h" +#include "google/cloud/compute/licenses/v1/licenses.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.cc b/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.cc index 6bae346f75e40..3831542ddcaa9 100644 --- a/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.cc +++ b/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/licenses/v1/licenses.proto #include "google/cloud/compute/licenses/v1/internal/licenses_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/licenses/v1/licenses.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.h b/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.h index 639bce77efcd6..fb150d125282a 100644 --- a/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.h +++ b/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSES_V1_INTERNAL_LICENSES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSES_V1_INTERNAL_LICENSES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/licenses/v1/licenses.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/licenses/v1/internal/licenses_tracing_connection.cc b/google/cloud/compute/licenses/v1/internal/licenses_tracing_connection.cc index 5a3d38c15e0d3..ad25da957fbad 100644 --- a/google/cloud/compute/licenses/v1/internal/licenses_tracing_connection.cc +++ b/google/cloud/compute/licenses/v1/internal/licenses_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_licenses_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LicensesTracingConnection::LicensesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -174,16 +172,12 @@ LicensesTracingConnection::UpdateLicense( return internal::EndSpan(std::move(span), child_->UpdateLicense(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLicensesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/licenses/v1/internal/licenses_tracing_connection.h b/google/cloud/compute/licenses/v1/internal/licenses_tracing_connection.h index 1ae7ae196ca2b..f435b0f284a56 100644 --- a/google/cloud/compute/licenses/v1/internal/licenses_tracing_connection.h +++ b/google/cloud/compute/licenses/v1/internal/licenses_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_licenses_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LicensesTracingConnection : public compute_licenses_v1::LicensesConnection { public: @@ -100,8 +98,6 @@ class LicensesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/licenses/v1/licenses_connection.h b/google/cloud/compute/licenses/v1/licenses_connection.h index cb19e814d2fd2..fb99f38f8c5c6 100644 --- a/google/cloud/compute/licenses/v1/licenses_connection.h +++ b/google/cloud/compute/licenses/v1/licenses_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSES_V1_LICENSES_CONNECTION_H #include "google/cloud/compute/licenses/v1/internal/licenses_retry_traits.h" +#include "google/cloud/compute/licenses/v1/licenses.pb.h" #include "google/cloud/compute/licenses/v1/licenses_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/licenses/v1/licenses_connection_idempotency_policy.h b/google/cloud/compute/licenses/v1/licenses_connection_idempotency_policy.h index 01159edd15bce..4fc9f9058b5f7 100644 --- a/google/cloud/compute/licenses/v1/licenses_connection_idempotency_policy.h +++ b/google/cloud/compute/licenses/v1/licenses_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSES_V1_LICENSES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSES_V1_LICENSES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/licenses/v1/licenses.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/licenses/v1/licenses_proto_export.h b/google/cloud/compute/licenses/v1/licenses_proto_export.h index 585fb1b7ecfec..d57c206a4b996 100644 --- a/google/cloud/compute/licenses/v1/licenses_proto_export.h +++ b/google/cloud/compute/licenses/v1/licenses_proto_export.h @@ -26,13 +26,13 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSES_V1_LICENSES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_047.pb.h" +#include "google/cloud/compute/v1/internal/common_076.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_LICENSES_V1_LICENSES_PROTO_EXPORT_H diff --git a/google/cloud/compute/machine_images/v1/internal/machine_images_option_defaults.cc b/google/cloud/compute/machine_images/v1/internal/machine_images_option_defaults.cc index 2fb973d9123b8..7c589ede55cb6 100644 --- a/google/cloud/compute/machine_images/v1/internal/machine_images_option_defaults.cc +++ b/google/cloud/compute/machine_images/v1/internal/machine_images_option_defaults.cc @@ -42,7 +42,7 @@ Options MachineImagesDefaultOptions(Options options) { .has()) { options.set( compute_machine_images_v1::MachineImagesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_connection_impl.h b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_connection_impl.h index 19635db9a9c26..8bcb8c5542792 100644 --- a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_connection_impl.h +++ b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_IMAGES_V1_INTERNAL_MACHINE_IMAGES_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_IMAGES_V1_INTERNAL_MACHINE_IMAGES_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.h" #include "google/cloud/compute/machine_images/v1/internal/machine_images_retry_traits.h" #include "google/cloud/compute/machine_images/v1/machine_images_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_logging_decorator.h b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_logging_decorator.h index 84faa66928d00..5292f16fa50f7 100644 --- a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_logging_decorator.h +++ b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_IMAGES_V1_INTERNAL_MACHINE_IMAGES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_IMAGES_V1_INTERNAL_MACHINE_IMAGES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.h" +#include "google/cloud/compute/machine_images/v1/machine_images.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_metadata_decorator.cc b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_metadata_decorator.cc index f92b9772e3ccc..c48ef3bcf6748 100644 --- a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_metadata_decorator.cc +++ b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/machine_images/v1/machine_images.proto #include "google/cloud/compute/machine_images/v1/internal/machine_images_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_metadata_decorator.h b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_metadata_decorator.h index 3e7443145b7f7..8cfe029e33bf7 100644 --- a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_metadata_decorator.h +++ b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_IMAGES_V1_INTERNAL_MACHINE_IMAGES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_IMAGES_V1_INTERNAL_MACHINE_IMAGES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.h" +#include "google/cloud/compute/machine_images/v1/machine_images.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.cc b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.cc index 6eda66033a5ec..5434166efbaae 100644 --- a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.cc +++ b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/machine_images/v1/machine_images.proto #include "google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/machine_images/v1/machine_images.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.h b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.h index 09d988764f7cf..1601362c40dc4 100644 --- a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.h +++ b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_IMAGES_V1_INTERNAL_MACHINE_IMAGES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_IMAGES_V1_INTERNAL_MACHINE_IMAGES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/machine_images/v1/machine_images.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/machine_images/v1/internal/machine_images_tracing_connection.cc b/google/cloud/compute/machine_images/v1/internal/machine_images_tracing_connection.cc index 3a8d9a816e639..cc4fdbd157f3d 100644 --- a/google/cloud/compute/machine_images/v1/internal/machine_images_tracing_connection.cc +++ b/google/cloud/compute/machine_images/v1/internal/machine_images_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_machine_images_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MachineImagesTracingConnection::MachineImagesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -180,16 +178,12 @@ MachineImagesTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMachineImagesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/machine_images/v1/internal/machine_images_tracing_connection.h b/google/cloud/compute/machine_images/v1/internal/machine_images_tracing_connection.h index eb7d12ed68a51..cf7afc783af37 100644 --- a/google/cloud/compute/machine_images/v1/internal/machine_images_tracing_connection.h +++ b/google/cloud/compute/machine_images/v1/internal/machine_images_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_machine_images_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MachineImagesTracingConnection : public compute_machine_images_v1::MachineImagesConnection { public: @@ -101,8 +99,6 @@ class MachineImagesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/machine_images/v1/machine_images_connection.h b/google/cloud/compute/machine_images/v1/machine_images_connection.h index ed2ec13cfb471..b94e99dcc9b04 100644 --- a/google/cloud/compute/machine_images/v1/machine_images_connection.h +++ b/google/cloud/compute/machine_images/v1/machine_images_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_IMAGES_V1_MACHINE_IMAGES_CONNECTION_H #include "google/cloud/compute/machine_images/v1/internal/machine_images_retry_traits.h" +#include "google/cloud/compute/machine_images/v1/machine_images.pb.h" #include "google/cloud/compute/machine_images/v1/machine_images_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/machine_images/v1/machine_images_connection_idempotency_policy.h b/google/cloud/compute/machine_images/v1/machine_images_connection_idempotency_policy.h index f87edd0a046d9..b24aef23d791b 100644 --- a/google/cloud/compute/machine_images/v1/machine_images_connection_idempotency_policy.h +++ b/google/cloud/compute/machine_images/v1/machine_images_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_IMAGES_V1_MACHINE_IMAGES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_IMAGES_V1_MACHINE_IMAGES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/machine_images/v1/machine_images.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/machine_images/v1/machine_images_proto_export.h b/google/cloud/compute/machine_images/v1/machine_images_proto_export.h index 5c5a4885bebd4..7252eaec96f6b 100644 --- a/google/cloud/compute/machine_images/v1/machine_images_proto_export.h +++ b/google/cloud/compute/machine_images/v1/machine_images_proto_export.h @@ -26,19 +26,19 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_IMAGES_V1_MACHINE_IMAGES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_001.pb.h" +#include "google/cloud/compute/v1/internal/common_003.pb.h" +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_021.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_033.pb.h" +#include "google/cloud/compute/v1/internal/common_046.pb.h" +#include "google/cloud/compute/v1/internal/common_047.pb.h" +#include "google/cloud/compute/v1/internal/common_079.pb.h" +#include "google/cloud/compute/v1/internal/common_081.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_IMAGES_V1_MACHINE_IMAGES_PROTO_EXPORT_H diff --git a/google/cloud/compute/machine_types/v1/internal/machine_types_option_defaults.cc b/google/cloud/compute/machine_types/v1/internal/machine_types_option_defaults.cc index b933d8fab62d9..bf717d121b177 100644 --- a/google/cloud/compute/machine_types/v1/internal/machine_types_option_defaults.cc +++ b/google/cloud/compute/machine_types/v1/internal/machine_types_option_defaults.cc @@ -41,7 +41,7 @@ Options MachineTypesDefaultOptions(Options options) { if (!options.has()) { options.set( compute_machine_types_v1::MachineTypesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/compute/machine_types/v1/internal/machine_types_rest_logging_decorator.h b/google/cloud/compute/machine_types/v1/internal/machine_types_rest_logging_decorator.h index 4824416d561c1..e66598f8c5005 100644 --- a/google/cloud/compute/machine_types/v1/internal/machine_types_rest_logging_decorator.h +++ b/google/cloud/compute/machine_types/v1/internal/machine_types_rest_logging_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_TYPES_V1_INTERNAL_MACHINE_TYPES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.h" +#include "google/cloud/compute/machine_types/v1/machine_types.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/compute/machine_types/v1/internal/machine_types_rest_metadata_decorator.cc b/google/cloud/compute/machine_types/v1/internal/machine_types_rest_metadata_decorator.cc index 3f6924d4b3774..a629bee92acf2 100644 --- a/google/cloud/compute/machine_types/v1/internal/machine_types_rest_metadata_decorator.cc +++ b/google/cloud/compute/machine_types/v1/internal/machine_types_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/machine_types/v1/machine_types.proto #include "google/cloud/compute/machine_types/v1/internal/machine_types_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/machine_types/v1/internal/machine_types_rest_metadata_decorator.h b/google/cloud/compute/machine_types/v1/internal/machine_types_rest_metadata_decorator.h index 583e332627926..1aa64dcf4a3df 100644 --- a/google/cloud/compute/machine_types/v1/internal/machine_types_rest_metadata_decorator.h +++ b/google/cloud/compute/machine_types/v1/internal/machine_types_rest_metadata_decorator.h @@ -20,10 +20,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_TYPES_V1_INTERNAL_MACHINE_TYPES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.h" +#include "google/cloud/compute/machine_types/v1/machine_types.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.cc b/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.cc index c7b21cd6bffb8..d73c1d85cf0ab 100644 --- a/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.cc +++ b/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/machine_types/v1/machine_types.proto #include "google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.h" +#include "google/cloud/compute/machine_types/v1/machine_types.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.h b/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.h index 3a96878799ee0..cd0b8f259294e 100644 --- a/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.h +++ b/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_TYPES_V1_INTERNAL_MACHINE_TYPES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_TYPES_V1_INTERNAL_MACHINE_TYPES_REST_STUB_H +#include "google/cloud/compute/machine_types/v1/machine_types.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/machine_types/v1/internal/machine_types_tracing_connection.cc b/google/cloud/compute/machine_types/v1/internal/machine_types_tracing_connection.cc index de7a314ef4b1e..a8e1f2478fa2f 100644 --- a/google/cloud/compute/machine_types/v1/internal/machine_types_tracing_connection.cc +++ b/google/cloud/compute/machine_types/v1/internal/machine_types_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_machine_types_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MachineTypesTracingConnection::MachineTypesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -71,16 +69,12 @@ MachineTypesTracingConnection::ListMachineTypes( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMachineTypesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/machine_types/v1/internal/machine_types_tracing_connection.h b/google/cloud/compute/machine_types/v1/internal/machine_types_tracing_connection.h index a55388a9328b1..afa620099d820 100644 --- a/google/cloud/compute/machine_types/v1/internal/machine_types_tracing_connection.h +++ b/google/cloud/compute/machine_types/v1/internal/machine_types_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_machine_types_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MachineTypesTracingConnection : public compute_machine_types_v1::MachineTypesConnection { public: @@ -58,8 +56,6 @@ class MachineTypesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/machine_types/v1/machine_types_connection.h b/google/cloud/compute/machine_types/v1/machine_types_connection.h index f5f084a6c91b5..69f360dca0079 100644 --- a/google/cloud/compute/machine_types/v1/machine_types_connection.h +++ b/google/cloud/compute/machine_types/v1/machine_types_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_TYPES_V1_MACHINE_TYPES_CONNECTION_H #include "google/cloud/compute/machine_types/v1/internal/machine_types_retry_traits.h" +#include "google/cloud/compute/machine_types/v1/machine_types.pb.h" #include "google/cloud/compute/machine_types/v1/machine_types_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/machine_types/v1/machine_types_connection_idempotency_policy.h b/google/cloud/compute/machine_types/v1/machine_types_connection_idempotency_policy.h index b6325bfdd63b3..9ab63d4632218 100644 --- a/google/cloud/compute/machine_types/v1/machine_types_connection_idempotency_policy.h +++ b/google/cloud/compute/machine_types/v1/machine_types_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_TYPES_V1_MACHINE_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_TYPES_V1_MACHINE_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/machine_types/v1/machine_types.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/machine_types/v1/machine_types_proto_export.h b/google/cloud/compute/machine_types/v1/machine_types_proto_export.h index 8aabb7352dd99..38e374ce17ad9 100644 --- a/google/cloud/compute/machine_types/v1/machine_types_proto_export.h +++ b/google/cloud/compute/machine_types/v1/machine_types_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_TYPES_V1_MACHINE_TYPES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_023.pb.h" +#include "google/cloud/compute/v1/internal/common_080.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_MACHINE_TYPES_V1_MACHINE_TYPES_PROTO_EXPORT_H diff --git a/google/cloud/compute/network_attachments/v1/internal/network_attachments_option_defaults.cc b/google/cloud/compute/network_attachments/v1/internal/network_attachments_option_defaults.cc index 4346b2e0bb308..e91c7c50a71af 100644 --- a/google/cloud/compute/network_attachments/v1/internal/network_attachments_option_defaults.cc +++ b/google/cloud/compute/network_attachments/v1/internal/network_attachments_option_defaults.cc @@ -44,7 +44,7 @@ Options NetworkAttachmentsDefaultOptions(Options options) { options.set< compute_network_attachments_v1::NetworkAttachmentsRetryPolicyOption>( compute_network_attachments_v1:: - NetworkAttachmentsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + NetworkAttachmentsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_logging_decorator.h b/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_logging_decorator.h index 34b2c090c4054..6a287f4bbd1d8 100644 --- a/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_logging_decorator.h +++ b/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_logging_decorator.h @@ -20,12 +20,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ATTACHMENTS_V1_INTERNAL_NETWORK_ATTACHMENTS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.h" +#include "google/cloud/compute/network_attachments/v1/network_attachments.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_metadata_decorator.cc b/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_metadata_decorator.cc index 3d6e713a3a01e..b22166a2af570 100644 --- a/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_metadata_decorator.cc +++ b/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/network_attachments/v1/network_attachments.proto #include "google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_metadata_decorator.h b/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_metadata_decorator.h index 22eae75654e03..e64b2c46de46d 100644 --- a/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_metadata_decorator.h +++ b/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ATTACHMENTS_V1_INTERNAL_NETWORK_ATTACHMENTS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.h" +#include "google/cloud/compute/network_attachments/v1/network_attachments.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.cc b/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.cc index c9128f555ed90..d3f3dbf5ffa55 100644 --- a/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.cc +++ b/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/network_attachments/v1/network_attachments.proto #include "google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.h" +#include "google/cloud/compute/network_attachments/v1/network_attachments.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.h b/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.h index deb7afe662acf..f91cf71688e18 100644 --- a/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.h +++ b/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ATTACHMENTS_V1_INTERNAL_NETWORK_ATTACHMENTS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ATTACHMENTS_V1_INTERNAL_NETWORK_ATTACHMENTS_REST_STUB_H +#include "google/cloud/compute/network_attachments/v1/network_attachments.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/network_attachments/v1/internal/network_attachments_tracing_connection.cc b/google/cloud/compute/network_attachments/v1/internal/network_attachments_tracing_connection.cc index 6e1f70f6398e0..8ab7e2777dd66 100644 --- a/google/cloud/compute/network_attachments/v1/internal/network_attachments_tracing_connection.cc +++ b/google/cloud/compute/network_attachments/v1/internal/network_attachments_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_network_attachments_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NetworkAttachmentsTracingConnection::NetworkAttachmentsTracingConnection( std::shared_ptr< compute_network_attachments_v1::NetworkAttachmentsConnection> @@ -214,19 +212,15 @@ NetworkAttachmentsTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNetworkAttachmentsTracingConnection( std::shared_ptr< compute_network_attachments_v1::NetworkAttachmentsConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/network_attachments/v1/internal/network_attachments_tracing_connection.h b/google/cloud/compute/network_attachments/v1/internal/network_attachments_tracing_connection.h index abc4790d101da..a63676a0d4b0e 100644 --- a/google/cloud/compute/network_attachments/v1/internal/network_attachments_tracing_connection.h +++ b/google/cloud/compute/network_attachments/v1/internal/network_attachments_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_network_attachments_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NetworkAttachmentsTracingConnection : public compute_network_attachments_v1::NetworkAttachmentsConnection { public: @@ -113,8 +111,6 @@ class NetworkAttachmentsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/network_attachments/v1/network_attachments_connection.h b/google/cloud/compute/network_attachments/v1/network_attachments_connection.h index bfbe8faf9ad86..92996014a147c 100644 --- a/google/cloud/compute/network_attachments/v1/network_attachments_connection.h +++ b/google/cloud/compute/network_attachments/v1/network_attachments_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ATTACHMENTS_V1_NETWORK_ATTACHMENTS_CONNECTION_H #include "google/cloud/compute/network_attachments/v1/internal/network_attachments_retry_traits.h" +#include "google/cloud/compute/network_attachments/v1/network_attachments.pb.h" #include "google/cloud/compute/network_attachments/v1/network_attachments_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/network_attachments/v1/network_attachments_connection_idempotency_policy.h b/google/cloud/compute/network_attachments/v1/network_attachments_connection_idempotency_policy.h index 9eb4b1b0674ca..b5d2005935e3f 100644 --- a/google/cloud/compute/network_attachments/v1/network_attachments_connection_idempotency_policy.h +++ b/google/cloud/compute/network_attachments/v1/network_attachments_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ATTACHMENTS_V1_NETWORK_ATTACHMENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ATTACHMENTS_V1_NETWORK_ATTACHMENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/network_attachments/v1/network_attachments.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/network_attachments/v1/network_attachments_proto_export.h b/google/cloud/compute/network_attachments/v1/network_attachments_proto_export.h index 229f09aa8a5a5..e714541e48486 100644 --- a/google/cloud/compute/network_attachments/v1/network_attachments_proto_export.h +++ b/google/cloud/compute/network_attachments/v1/network_attachments_proto_export.h @@ -26,12 +26,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ATTACHMENTS_V1_NETWORK_ATTACHMENTS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_084.pb.h" +#include "google/cloud/compute/v1/internal/common_108.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ATTACHMENTS_V1_NETWORK_ATTACHMENTS_PROTO_EXPORT_H diff --git a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_option_defaults.cc b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_option_defaults.cc index ef702a50121ac..48fe58ffb7f5a 100644 --- a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_option_defaults.cc +++ b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_option_defaults.cc @@ -47,7 +47,7 @@ Options NetworkEdgeSecurityServicesDefaultOptions(Options options) { NetworkEdgeSecurityServicesRetryPolicyOption>( compute_network_edge_security_services_v1:: NetworkEdgeSecurityServicesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_logging_decorator.h b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_logging_decorator.h index 870b81a59df33..4d212abe3a20c 100644 --- a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_logging_decorator.h +++ b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_logging_decorator.h @@ -21,12 +21,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_EDGE_SECURITY_SERVICES_V1_INTERNAL_NETWORK_EDGE_SECURITY_SERVICES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.h" +#include "google/cloud/compute/network_edge_security_services/v1/network_edge_security_services.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_metadata_decorator.cc b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_metadata_decorator.cc index faa57b8beddf4..afd5b501d761c 100644 --- a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_metadata_decorator.cc +++ b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/network_edge_security_services/v1/network_edge_security_services.proto #include "google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_metadata_decorator.h b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_metadata_decorator.h index 0fd766bc68ab6..90a1d0d2f2559 100644 --- a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_metadata_decorator.h +++ b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_metadata_decorator.h @@ -21,11 +21,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_EDGE_SECURITY_SERVICES_V1_INTERNAL_NETWORK_EDGE_SECURITY_SERVICES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.h" +#include "google/cloud/compute/network_edge_security_services/v1/network_edge_security_services.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.cc b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.cc index ee9ded0d7ee21..1b2461b46a454 100644 --- a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.cc +++ b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/network_edge_security_services/v1/network_edge_security_services.proto #include "google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.h" +#include "google/cloud/compute/network_edge_security_services/v1/network_edge_security_services.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.h b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.h index 301c03bf5dcb5..2148f7c056254 100644 --- a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.h +++ b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_EDGE_SECURITY_SERVICES_V1_INTERNAL_NETWORK_EDGE_SECURITY_SERVICES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_EDGE_SECURITY_SERVICES_V1_INTERNAL_NETWORK_EDGE_SECURITY_SERVICES_REST_STUB_H +#include "google/cloud/compute/network_edge_security_services/v1/network_edge_security_services.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_tracing_connection.cc b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_tracing_connection.cc index bd24ed487f782..187ea67799607 100644 --- a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_tracing_connection.cc +++ b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_network_edge_security_services_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NetworkEdgeSecurityServicesTracingConnection:: NetworkEdgeSecurityServicesTracingConnection( std::shared_ptrPatchNetworkEdgeSecurityService(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNetworkEdgeSecurityServicesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_tracing_connection.h b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_tracing_connection.h index 9dc17abff7e72..0d36794c4712c 100644 --- a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_tracing_connection.h +++ b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_network_edge_security_services_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NetworkEdgeSecurityServicesTracingConnection : public compute_network_edge_security_services_v1:: NetworkEdgeSecurityServicesConnection { @@ -106,8 +104,6 @@ class NetworkEdgeSecurityServicesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/network_edge_security_services/v1/network_edge_security_services_connection.h b/google/cloud/compute/network_edge_security_services/v1/network_edge_security_services_connection.h index c7e80a684a434..95504dfcd7f42 100644 --- a/google/cloud/compute/network_edge_security_services/v1/network_edge_security_services_connection.h +++ b/google/cloud/compute/network_edge_security_services/v1/network_edge_security_services_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_EDGE_SECURITY_SERVICES_V1_NETWORK_EDGE_SECURITY_SERVICES_CONNECTION_H #include "google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_retry_traits.h" +#include "google/cloud/compute/network_edge_security_services/v1/network_edge_security_services.pb.h" #include "google/cloud/compute/network_edge_security_services/v1/network_edge_security_services_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/network_edge_security_services/v1/network_edge_security_services_connection_idempotency_policy.h b/google/cloud/compute/network_edge_security_services/v1/network_edge_security_services_connection_idempotency_policy.h index 499c903239fb4..717e9c8119d3c 100644 --- a/google/cloud/compute/network_edge_security_services/v1/network_edge_security_services_connection_idempotency_policy.h +++ b/google/cloud/compute/network_edge_security_services/v1/network_edge_security_services_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_EDGE_SECURITY_SERVICES_V1_NETWORK_EDGE_SECURITY_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_EDGE_SECURITY_SERVICES_V1_NETWORK_EDGE_SECURITY_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/network_edge_security_services/v1/network_edge_security_services.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/network_edge_security_services/v1/network_edge_security_services_proto_export.h b/google/cloud/compute/network_edge_security_services/v1/network_edge_security_services_proto_export.h index 49233af3c687c..3298cb4063517 100644 --- a/google/cloud/compute/network_edge_security_services/v1/network_edge_security_services_proto_export.h +++ b/google/cloud/compute/network_edge_security_services/v1/network_edge_security_services_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_EDGE_SECURITY_SERVICES_V1_NETWORK_EDGE_SECURITY_SERVICES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_085.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_EDGE_SECURITY_SERVICES_V1_NETWORK_EDGE_SECURITY_SERVICES_PROTO_EXPORT_H diff --git a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_option_defaults.cc b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_option_defaults.cc index a03b3908ff606..d1ba6a30228ca 100644 --- a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_option_defaults.cc +++ b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_option_defaults.cc @@ -46,7 +46,7 @@ Options NetworkEndpointGroupsDefaultOptions(Options options) { NetworkEndpointGroupsRetryPolicyOption>( compute_network_endpoint_groups_v1:: NetworkEndpointGroupsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_logging_decorator.h b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_logging_decorator.h index a8f0d5f0de4e4..f8f9c9ab84ff3 100644 --- a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_logging_decorator.h +++ b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_logging_decorator.h @@ -21,12 +21,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ENDPOINT_GROUPS_V1_INTERNAL_NETWORK_ENDPOINT_GROUPS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.h" +#include "google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_metadata_decorator.cc b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_metadata_decorator.cc index 673659bad8295..796ce0b023a33 100644 --- a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_metadata_decorator.cc +++ b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups.proto #include "google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_metadata_decorator.h b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_metadata_decorator.h index 164a1b51aa094..48c2d23cf0eb6 100644 --- a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_metadata_decorator.h +++ b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_metadata_decorator.h @@ -21,11 +21,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ENDPOINT_GROUPS_V1_INTERNAL_NETWORK_ENDPOINT_GROUPS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.h" +#include "google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.cc b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.cc index 5238d7cc60562..98b67928877ec 100644 --- a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.cc +++ b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups.proto #include "google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.h" +#include "google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.h b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.h index 7a515334a2819..a0d3c3844b97c 100644 --- a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.h +++ b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ENDPOINT_GROUPS_V1_INTERNAL_NETWORK_ENDPOINT_GROUPS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ENDPOINT_GROUPS_V1_INTERNAL_NETWORK_ENDPOINT_GROUPS_REST_STUB_H +#include "google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_tracing_connection.cc b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_tracing_connection.cc index a10453c668541..85030f0583f9d 100644 --- a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_tracing_connection.cc +++ b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_network_endpoint_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NetworkEndpointGroupsTracingConnection::NetworkEndpointGroupsTracingConnection( std::shared_ptr< compute_network_endpoint_groups_v1::NetworkEndpointGroupsConnection> @@ -243,20 +241,16 @@ NetworkEndpointGroupsTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_network_endpoint_groups_v1::NetworkEndpointGroupsConnection> MakeNetworkEndpointGroupsTracingConnection( std::shared_ptr< compute_network_endpoint_groups_v1::NetworkEndpointGroupsConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_tracing_connection.h b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_tracing_connection.h index e3be63652bc00..aad7d49c58a8a 100644 --- a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_tracing_connection.h +++ b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_network_endpoint_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NetworkEndpointGroupsTracingConnection : public compute_network_endpoint_groups_v1:: NetworkEndpointGroupsConnection { @@ -130,8 +128,6 @@ class NetworkEndpointGroupsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups_connection.h b/google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups_connection.h index c1d8d612f3d83..a0087a40d2f92 100644 --- a/google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups_connection.h +++ b/google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ENDPOINT_GROUPS_V1_NETWORK_ENDPOINT_GROUPS_CONNECTION_H #include "google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_retry_traits.h" +#include "google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups.pb.h" #include "google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups_connection_idempotency_policy.h b/google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups_connection_idempotency_policy.h index ab4a9ee647882..fc1eb335629ae 100644 --- a/google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups_connection_idempotency_policy.h +++ b/google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ENDPOINT_GROUPS_V1_NETWORK_ENDPOINT_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ENDPOINT_GROUPS_V1_NETWORK_ENDPOINT_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups_proto_export.h b/google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups_proto_export.h index f9605fe6a1ce8..c878ac3acd9f5 100644 --- a/google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups_proto_export.h +++ b/google/cloud/compute/network_endpoint_groups/v1/network_endpoint_groups_proto_export.h @@ -26,11 +26,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ENDPOINT_GROUPS_V1_NETWORK_ENDPOINT_GROUPS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_012.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_049.pb.h" +#include "google/cloud/compute/v1/internal/common_086.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_ENDPOINT_GROUPS_V1_NETWORK_ENDPOINT_GROUPS_PROTO_EXPORT_H diff --git a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_option_defaults.cc b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_option_defaults.cc index 2862794e8e8fa..781fa82828f0e 100644 --- a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_option_defaults.cc +++ b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_option_defaults.cc @@ -46,7 +46,7 @@ Options NetworkFirewallPoliciesDefaultOptions(Options options) { NetworkFirewallPoliciesRetryPolicyOption>( compute_network_firewall_policies_v1:: NetworkFirewallPoliciesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_logging_decorator.h b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_logging_decorator.h index b454b919a989a..04fc22cade9fe 100644 --- a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_logging_decorator.h +++ b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_FIREWALL_POLICIES_V1_INTERNAL_NETWORK_FIREWALL_POLICIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_FIREWALL_POLICIES_V1_INTERNAL_NETWORK_FIREWALL_POLICIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.h" +#include "google/cloud/compute/network_firewall_policies/v1/network_firewall_policies.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_metadata_decorator.cc b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_metadata_decorator.cc index 35bb33b516f62..06a028f630d3e 100644 --- a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_metadata_decorator.cc +++ b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/network_firewall_policies/v1/network_firewall_policies.proto #include "google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_metadata_decorator.h b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_metadata_decorator.h index 40b834a44cb0c..99b20572df99c 100644 --- a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_metadata_decorator.h +++ b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_FIREWALL_POLICIES_V1_INTERNAL_NETWORK_FIREWALL_POLICIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_FIREWALL_POLICIES_V1_INTERNAL_NETWORK_FIREWALL_POLICIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.h" +#include "google/cloud/compute/network_firewall_policies/v1/network_firewall_policies.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.cc b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.cc index 0e12d853ea1ac..64463ab30e197 100644 --- a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.cc +++ b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/network_firewall_policies/v1/network_firewall_policies.proto #include "google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/network_firewall_policies/v1/network_firewall_policies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.h b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.h index af253efc22625..9d24c69570e8b 100644 --- a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.h +++ b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_FIREWALL_POLICIES_V1_INTERNAL_NETWORK_FIREWALL_POLICIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_FIREWALL_POLICIES_V1_INTERNAL_NETWORK_FIREWALL_POLICIES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/network_firewall_policies/v1/network_firewall_policies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_tracing_connection.cc b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_tracing_connection.cc index c7a67afd5e305..9168cd9f6c4c6 100644 --- a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_tracing_connection.cc +++ b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_network_firewall_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NetworkFirewallPoliciesTracingConnection:: NetworkFirewallPoliciesTracingConnection( std::shared_ptrTestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_network_firewall_policies_v1::NetworkFirewallPoliciesConnection> MakeNetworkFirewallPoliciesTracingConnection( std::shared_ptr< compute_network_firewall_policies_v1::NetworkFirewallPoliciesConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_tracing_connection.h b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_tracing_connection.h index 30816b042afe9..566eef2bd7757 100644 --- a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_tracing_connection.h +++ b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_network_firewall_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NetworkFirewallPoliciesTracingConnection : public compute_network_firewall_policies_v1:: NetworkFirewallPoliciesConnection { @@ -236,8 +234,6 @@ class NetworkFirewallPoliciesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/network_firewall_policies/v1/network_firewall_policies_connection.h b/google/cloud/compute/network_firewall_policies/v1/network_firewall_policies_connection.h index 359cdb90ef565..8445b73ff879a 100644 --- a/google/cloud/compute/network_firewall_policies/v1/network_firewall_policies_connection.h +++ b/google/cloud/compute/network_firewall_policies/v1/network_firewall_policies_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_FIREWALL_POLICIES_V1_NETWORK_FIREWALL_POLICIES_CONNECTION_H #include "google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_retry_traits.h" +#include "google/cloud/compute/network_firewall_policies/v1/network_firewall_policies.pb.h" #include "google/cloud/compute/network_firewall_policies/v1/network_firewall_policies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/network_firewall_policies/v1/network_firewall_policies_connection_idempotency_policy.h b/google/cloud/compute/network_firewall_policies/v1/network_firewall_policies_connection_idempotency_policy.h index 4998b36683a7a..98f62889ec740 100644 --- a/google/cloud/compute/network_firewall_policies/v1/network_firewall_policies_connection_idempotency_policy.h +++ b/google/cloud/compute/network_firewall_policies/v1/network_firewall_policies_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_FIREWALL_POLICIES_V1_NETWORK_FIREWALL_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_FIREWALL_POLICIES_V1_NETWORK_FIREWALL_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/network_firewall_policies/v1/network_firewall_policies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/network_firewall_policies/v1/network_firewall_policies_proto_export.h b/google/cloud/compute/network_firewall_policies/v1/network_firewall_policies_proto_export.h index 5fa91bc7e2cf6..b79d4dd7d1912 100644 --- a/google/cloud/compute/network_firewall_policies/v1/network_firewall_policies_proto_export.h +++ b/google/cloud/compute/network_firewall_policies/v1/network_firewall_policies_proto_export.h @@ -26,14 +26,14 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_FIREWALL_POLICIES_V1_NETWORK_FIREWALL_POLICIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_037.pb.h" +#include "google/cloud/compute/v1/internal/common_038.pb.h" +#include "google/cloud/compute/v1/internal/common_039.pb.h" +#include "google/cloud/compute/v1/internal/common_047.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_FIREWALL_POLICIES_V1_NETWORK_FIREWALL_POLICIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/network_profiles/v1/internal/network_profiles_option_defaults.cc b/google/cloud/compute/network_profiles/v1/internal/network_profiles_option_defaults.cc index e1a511682ec65..e8a7ddbe8fd08 100644 --- a/google/cloud/compute/network_profiles/v1/internal/network_profiles_option_defaults.cc +++ b/google/cloud/compute/network_profiles/v1/internal/network_profiles_option_defaults.cc @@ -42,7 +42,7 @@ Options NetworkProfilesDefaultOptions(Options options) { compute_network_profiles_v1::NetworkProfilesRetryPolicyOption>()) { options.set( compute_network_profiles_v1::NetworkProfilesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_logging_decorator.h b/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_logging_decorator.h index b93923715ce7e..4c836974099f4 100644 --- a/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_logging_decorator.h +++ b/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_logging_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_PROFILES_V1_INTERNAL_NETWORK_PROFILES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_stub.h" +#include "google/cloud/compute/network_profiles/v1/network_profiles.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_metadata_decorator.cc b/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_metadata_decorator.cc index 58db3d0360657..3841cb4200ddf 100644 --- a/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_metadata_decorator.cc +++ b/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/network_profiles/v1/network_profiles.proto #include "google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_metadata_decorator.h b/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_metadata_decorator.h index 9285c050670b2..c6a2aa2c2f5c6 100644 --- a/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_metadata_decorator.h +++ b/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_metadata_decorator.h @@ -20,10 +20,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_PROFILES_V1_INTERNAL_NETWORK_PROFILES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_stub.h" +#include "google/cloud/compute/network_profiles/v1/network_profiles.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_stub.cc b/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_stub.cc index 011e7b4777b3d..eaa177086dda1 100644 --- a/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_stub.cc +++ b/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/network_profiles/v1/network_profiles.proto #include "google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_stub.h" +#include "google/cloud/compute/network_profiles/v1/network_profiles.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_stub.h b/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_stub.h index df6b26d419042..fcdc08f0ec4de 100644 --- a/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_stub.h +++ b/google/cloud/compute/network_profiles/v1/internal/network_profiles_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_PROFILES_V1_INTERNAL_NETWORK_PROFILES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_PROFILES_V1_INTERNAL_NETWORK_PROFILES_REST_STUB_H +#include "google/cloud/compute/network_profiles/v1/network_profiles.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/network_profiles/v1/internal/network_profiles_tracing_connection.cc b/google/cloud/compute/network_profiles/v1/internal/network_profiles_tracing_connection.cc index e23181efd22f8..cf6ba11d1226e 100644 --- a/google/cloud/compute/network_profiles/v1/internal/network_profiles_tracing_connection.cc +++ b/google/cloud/compute/network_profiles/v1/internal/network_profiles_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_network_profiles_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NetworkProfilesTracingConnection::NetworkProfilesTracingConnection( std::shared_ptr child) @@ -59,17 +57,13 @@ NetworkProfilesTracingConnection::ListNetworkProfiles( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNetworkProfilesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/network_profiles/v1/internal/network_profiles_tracing_connection.h b/google/cloud/compute/network_profiles/v1/internal/network_profiles_tracing_connection.h index 9897fe5ce1eeb..2e8c86c1286f6 100644 --- a/google/cloud/compute/network_profiles/v1/internal/network_profiles_tracing_connection.h +++ b/google/cloud/compute/network_profiles/v1/internal/network_profiles_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_network_profiles_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NetworkProfilesTracingConnection : public compute_network_profiles_v1::NetworkProfilesConnection { public: @@ -54,8 +52,6 @@ class NetworkProfilesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/network_profiles/v1/network_profiles_connection.h b/google/cloud/compute/network_profiles/v1/network_profiles_connection.h index 7f9016cab2898..bbc77697b0761 100644 --- a/google/cloud/compute/network_profiles/v1/network_profiles_connection.h +++ b/google/cloud/compute/network_profiles/v1/network_profiles_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_PROFILES_V1_NETWORK_PROFILES_CONNECTION_H #include "google/cloud/compute/network_profiles/v1/internal/network_profiles_retry_traits.h" +#include "google/cloud/compute/network_profiles/v1/network_profiles.pb.h" #include "google/cloud/compute/network_profiles/v1/network_profiles_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/network_profiles/v1/network_profiles_connection_idempotency_policy.h b/google/cloud/compute/network_profiles/v1/network_profiles_connection_idempotency_policy.h index 639378ba3078e..05a7200452ad9 100644 --- a/google/cloud/compute/network_profiles/v1/network_profiles_connection_idempotency_policy.h +++ b/google/cloud/compute/network_profiles/v1/network_profiles_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_PROFILES_V1_NETWORK_PROFILES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_PROFILES_V1_NETWORK_PROFILES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/network_profiles/v1/network_profiles.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/network_profiles/v1/network_profiles_proto_export.h b/google/cloud/compute/network_profiles/v1/network_profiles_proto_export.h index 0f1f511aef7ae..859d60f5ce192 100644 --- a/google/cloud/compute/network_profiles/v1/network_profiles_proto_export.h +++ b/google/cloud/compute/network_profiles/v1/network_profiles_proto_export.h @@ -26,7 +26,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_PROFILES_V1_NETWORK_PROFILES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include +#include "google/cloud/compute/v1/internal/common_087.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORK_PROFILES_V1_NETWORK_PROFILES_PROTO_EXPORT_H diff --git a/google/cloud/compute/networks/v1/internal/networks_option_defaults.cc b/google/cloud/compute/networks/v1/internal/networks_option_defaults.cc index f7818161c8e64..5826e9706af7d 100644 --- a/google/cloud/compute/networks/v1/internal/networks_option_defaults.cc +++ b/google/cloud/compute/networks/v1/internal/networks_option_defaults.cc @@ -41,7 +41,7 @@ Options NetworksDefaultOptions(Options options) { if (!options.has()) { options.set( compute_networks_v1::NetworksLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/networks/v1/internal/networks_rest_connection_impl.h b/google/cloud/compute/networks/v1/internal/networks_rest_connection_impl.h index 736d168656083..f190b4f89410c 100644 --- a/google/cloud/compute/networks/v1/internal/networks_rest_connection_impl.h +++ b/google/cloud/compute/networks/v1/internal/networks_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORKS_V1_INTERNAL_NETWORKS_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORKS_V1_INTERNAL_NETWORKS_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/networks/v1/internal/networks_rest_stub.h" #include "google/cloud/compute/networks/v1/internal/networks_retry_traits.h" #include "google/cloud/compute/networks/v1/networks_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/networks/v1/internal/networks_rest_logging_decorator.h b/google/cloud/compute/networks/v1/internal/networks_rest_logging_decorator.h index e2fa39a8e24ea..534999b6e3172 100644 --- a/google/cloud/compute/networks/v1/internal/networks_rest_logging_decorator.h +++ b/google/cloud/compute/networks/v1/internal/networks_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORKS_V1_INTERNAL_NETWORKS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORKS_V1_INTERNAL_NETWORKS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/networks/v1/internal/networks_rest_stub.h" +#include "google/cloud/compute/networks/v1/networks.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/networks/v1/internal/networks_rest_metadata_decorator.cc b/google/cloud/compute/networks/v1/internal/networks_rest_metadata_decorator.cc index 2e9a2bc81665b..8716be2a8e979 100644 --- a/google/cloud/compute/networks/v1/internal/networks_rest_metadata_decorator.cc +++ b/google/cloud/compute/networks/v1/internal/networks_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/networks/v1/networks.proto #include "google/cloud/compute/networks/v1/internal/networks_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/networks/v1/internal/networks_rest_metadata_decorator.h b/google/cloud/compute/networks/v1/internal/networks_rest_metadata_decorator.h index 52534abef42d1..1203473a96899 100644 --- a/google/cloud/compute/networks/v1/internal/networks_rest_metadata_decorator.h +++ b/google/cloud/compute/networks/v1/internal/networks_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORKS_V1_INTERNAL_NETWORKS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORKS_V1_INTERNAL_NETWORKS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/networks/v1/internal/networks_rest_stub.h" +#include "google/cloud/compute/networks/v1/networks.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/networks/v1/internal/networks_rest_stub.cc b/google/cloud/compute/networks/v1/internal/networks_rest_stub.cc index 3d30b5bb27e0b..8eb6fae4c43b2 100644 --- a/google/cloud/compute/networks/v1/internal/networks_rest_stub.cc +++ b/google/cloud/compute/networks/v1/internal/networks_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/networks/v1/networks.proto #include "google/cloud/compute/networks/v1/internal/networks_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/networks/v1/networks.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/networks/v1/internal/networks_rest_stub.h b/google/cloud/compute/networks/v1/internal/networks_rest_stub.h index fc9b4ae602cfd..157f26f4f7a18 100644 --- a/google/cloud/compute/networks/v1/internal/networks_rest_stub.h +++ b/google/cloud/compute/networks/v1/internal/networks_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORKS_V1_INTERNAL_NETWORKS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORKS_V1_INTERNAL_NETWORKS_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/networks/v1/networks.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/networks/v1/internal/networks_tracing_connection.cc b/google/cloud/compute/networks/v1/internal/networks_tracing_connection.cc index 831be36e871fe..38cf287a271ed 100644 --- a/google/cloud/compute/networks/v1/internal/networks_tracing_connection.cc +++ b/google/cloud/compute/networks/v1/internal/networks_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_networks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NetworksTracingConnection::NetworksTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -290,16 +288,12 @@ NetworksTracingConnection::UpdatePeering( return internal::EndSpan(std::move(span), child_->UpdatePeering(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNetworksTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/networks/v1/internal/networks_tracing_connection.h b/google/cloud/compute/networks/v1/internal/networks_tracing_connection.h index b52c96d3857e9..7cea9949404ba 100644 --- a/google/cloud/compute/networks/v1/internal/networks_tracing_connection.h +++ b/google/cloud/compute/networks/v1/internal/networks_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_networks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NetworksTracingConnection : public compute_networks_v1::NetworksConnection { public: @@ -147,8 +145,6 @@ class NetworksTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/networks/v1/networks_connection.h b/google/cloud/compute/networks/v1/networks_connection.h index 2ca7221dd06a4..05cb2e06f4deb 100644 --- a/google/cloud/compute/networks/v1/networks_connection.h +++ b/google/cloud/compute/networks/v1/networks_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORKS_V1_NETWORKS_CONNECTION_H #include "google/cloud/compute/networks/v1/internal/networks_retry_traits.h" +#include "google/cloud/compute/networks/v1/networks.pb.h" #include "google/cloud/compute/networks/v1/networks_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/networks/v1/networks_connection_idempotency_policy.h b/google/cloud/compute/networks/v1/networks_connection_idempotency_policy.h index 268938d7c4e14..2700e292ffc3a 100644 --- a/google/cloud/compute/networks/v1/networks_connection_idempotency_policy.h +++ b/google/cloud/compute/networks/v1/networks_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORKS_V1_NETWORKS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORKS_V1_NETWORKS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/networks/v1/networks.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/networks/v1/networks_proto_export.h b/google/cloud/compute/networks/v1/networks_proto_export.h index 76ea555b4b3fa..063a722deecb9 100644 --- a/google/cloud/compute/networks/v1/networks_proto_export.h +++ b/google/cloud/compute/networks/v1/networks_proto_export.h @@ -26,15 +26,15 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORKS_V1_NETWORKS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_030.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_034.pb.h" +#include "google/cloud/compute/v1/internal/common_039.pb.h" +#include "google/cloud/compute/v1/internal/common_108.pb.h" +#include "google/cloud/compute/v1/internal/common_132.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NETWORKS_V1_NETWORKS_PROTO_EXPORT_H diff --git a/google/cloud/compute/node_groups/v1/internal/node_groups_option_defaults.cc b/google/cloud/compute/node_groups/v1/internal/node_groups_option_defaults.cc index a2a72bbcbcf77..eb99aaf96a0ec 100644 --- a/google/cloud/compute/node_groups/v1/internal/node_groups_option_defaults.cc +++ b/google/cloud/compute/node_groups/v1/internal/node_groups_option_defaults.cc @@ -41,7 +41,7 @@ Options NodeGroupsDefaultOptions(Options options) { if (!options.has()) { options.set( compute_node_groups_v1::NodeGroupsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_connection_impl.h b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_connection_impl.h index b89ee7a89f5b6..49f2c8a7595f1 100644 --- a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_connection_impl.h +++ b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/node_groups/v1/node_groups_connection.h" #include "google/cloud/compute/node_groups/v1/node_groups_connection_idempotency_policy.h" #include "google/cloud/compute/node_groups/v1/node_groups_options.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_logging_decorator.h b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_logging_decorator.h index 526b443960c4a..848c74dd24bcd 100644 --- a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_logging_decorator.h +++ b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_logging_decorator.h @@ -20,12 +20,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_GROUPS_V1_INTERNAL_NODE_GROUPS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.h" +#include "google/cloud/compute/node_groups/v1/node_groups.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_metadata_decorator.cc b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_metadata_decorator.cc index a655a52aabeca..eb6fce2138215 100644 --- a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_metadata_decorator.cc +++ b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/node_groups/v1/node_groups.proto #include "google/cloud/compute/node_groups/v1/internal/node_groups_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_metadata_decorator.h b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_metadata_decorator.h index 6576b07635232..30e0d2508db0d 100644 --- a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_metadata_decorator.h +++ b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_GROUPS_V1_INTERNAL_NODE_GROUPS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.h" +#include "google/cloud/compute/node_groups/v1/node_groups.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.cc b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.cc index c136c1131e899..fbb879457b1d6 100644 --- a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.cc +++ b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/node_groups/v1/node_groups.proto #include "google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.h" +#include "google/cloud/compute/node_groups/v1/node_groups.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.h b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.h index 83e76d2797efe..2fb884d09738b 100644 --- a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.h +++ b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_GROUPS_V1_INTERNAL_NODE_GROUPS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_GROUPS_V1_INTERNAL_NODE_GROUPS_REST_STUB_H +#include "google/cloud/compute/node_groups/v1/node_groups.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/node_groups/v1/internal/node_groups_tracing_connection.cc b/google/cloud/compute/node_groups/v1/internal/node_groups_tracing_connection.cc index fa9314fba5132..8b72ee9081254 100644 --- a/google/cloud/compute/node_groups/v1/internal/node_groups_tracing_connection.cc +++ b/google/cloud/compute/node_groups/v1/internal/node_groups_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_node_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NodeGroupsTracingConnection::NodeGroupsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -360,16 +358,12 @@ NodeGroupsTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNodeGroupsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/node_groups/v1/internal/node_groups_tracing_connection.h b/google/cloud/compute/node_groups/v1/internal/node_groups_tracing_connection.h index 733b81a3ce1e4..a4d17a6c3ac6c 100644 --- a/google/cloud/compute/node_groups/v1/internal/node_groups_tracing_connection.h +++ b/google/cloud/compute/node_groups/v1/internal/node_groups_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_node_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NodeGroupsTracingConnection : public compute_node_groups_v1::NodeGroupsConnection { public: @@ -168,8 +166,6 @@ class NodeGroupsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/node_groups/v1/node_groups_connection.h b/google/cloud/compute/node_groups/v1/node_groups_connection.h index bd96dfadcfae5..b1fd36020ccd4 100644 --- a/google/cloud/compute/node_groups/v1/node_groups_connection.h +++ b/google/cloud/compute/node_groups/v1/node_groups_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_GROUPS_V1_NODE_GROUPS_CONNECTION_H #include "google/cloud/compute/node_groups/v1/internal/node_groups_retry_traits.h" +#include "google/cloud/compute/node_groups/v1/node_groups.pb.h" #include "google/cloud/compute/node_groups/v1/node_groups_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/node_groups/v1/node_groups_connection_idempotency_policy.h b/google/cloud/compute/node_groups/v1/node_groups_connection_idempotency_policy.h index 4dfd1c6701dcf..f408133e3ca63 100644 --- a/google/cloud/compute/node_groups/v1/node_groups_connection_idempotency_policy.h +++ b/google/cloud/compute/node_groups/v1/node_groups_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_GROUPS_V1_NODE_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_GROUPS_V1_NODE_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/node_groups/v1/node_groups.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/node_groups/v1/node_groups_proto_export.h b/google/cloud/compute/node_groups/v1/node_groups_proto_export.h index 008ca3dafc63f..0c94514e229d5 100644 --- a/google/cloud/compute/node_groups/v1/node_groups_proto_export.h +++ b/google/cloud/compute/node_groups/v1/node_groups_proto_export.h @@ -26,17 +26,17 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_GROUPS_V1_NODE_GROUPS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_001.pb.h" +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_058.pb.h" +#include "google/cloud/compute/v1/internal/common_078.pb.h" +#include "google/cloud/compute/v1/internal/common_120.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" +#include "google/cloud/compute/v1/internal/common_146.pb.h" +#include "google/cloud/compute/v1/internal/common_152.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_GROUPS_V1_NODE_GROUPS_PROTO_EXPORT_H diff --git a/google/cloud/compute/node_templates/v1/internal/node_templates_option_defaults.cc b/google/cloud/compute/node_templates/v1/internal/node_templates_option_defaults.cc index a62cf615e53ff..918c6182f0036 100644 --- a/google/cloud/compute/node_templates/v1/internal/node_templates_option_defaults.cc +++ b/google/cloud/compute/node_templates/v1/internal/node_templates_option_defaults.cc @@ -42,7 +42,7 @@ Options NodeTemplatesDefaultOptions(Options options) { .has()) { options.set( compute_node_templates_v1::NodeTemplatesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_connection_impl.h b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_connection_impl.h index e4513335b9941..a9816dd3e0e8a 100644 --- a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_connection_impl.h +++ b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/node_templates/v1/node_templates_connection.h" #include "google/cloud/compute/node_templates/v1/node_templates_connection_idempotency_policy.h" #include "google/cloud/compute/node_templates/v1/node_templates_options.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_logging_decorator.h b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_logging_decorator.h index 455742b49a456..500ff71eec501 100644 --- a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_logging_decorator.h +++ b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_logging_decorator.h @@ -20,12 +20,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TEMPLATES_V1_INTERNAL_NODE_TEMPLATES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.h" +#include "google/cloud/compute/node_templates/v1/node_templates.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_metadata_decorator.cc b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_metadata_decorator.cc index a00ddc043c404..4c22ff29e1b4c 100644 --- a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_metadata_decorator.cc +++ b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/node_templates/v1/node_templates.proto #include "google/cloud/compute/node_templates/v1/internal/node_templates_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_metadata_decorator.h b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_metadata_decorator.h index b682d77ed11ab..6a84a61901567 100644 --- a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_metadata_decorator.h +++ b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TEMPLATES_V1_INTERNAL_NODE_TEMPLATES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.h" +#include "google/cloud/compute/node_templates/v1/node_templates.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.cc b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.cc index ed799987f61b0..4e7bf1d0e79d8 100644 --- a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.cc +++ b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/node_templates/v1/node_templates.proto #include "google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.h" +#include "google/cloud/compute/node_templates/v1/node_templates.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.h b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.h index d6b66d2568d33..86b062e1b148c 100644 --- a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.h +++ b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TEMPLATES_V1_INTERNAL_NODE_TEMPLATES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TEMPLATES_V1_INTERNAL_NODE_TEMPLATES_REST_STUB_H +#include "google/cloud/compute/node_templates/v1/node_templates.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/node_templates/v1/internal/node_templates_tracing_connection.cc b/google/cloud/compute/node_templates/v1/internal/node_templates_tracing_connection.cc index c36da22f3066c..53667ebb45e68 100644 --- a/google/cloud/compute/node_templates/v1/internal/node_templates_tracing_connection.cc +++ b/google/cloud/compute/node_templates/v1/internal/node_templates_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_node_templates_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NodeTemplatesTracingConnection::NodeTemplatesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -165,16 +163,12 @@ NodeTemplatesTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNodeTemplatesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/node_templates/v1/internal/node_templates_tracing_connection.h b/google/cloud/compute/node_templates/v1/internal/node_templates_tracing_connection.h index afb6ab2953149..8e0b0513ab6ab 100644 --- a/google/cloud/compute/node_templates/v1/internal/node_templates_tracing_connection.h +++ b/google/cloud/compute/node_templates/v1/internal/node_templates_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_node_templates_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NodeTemplatesTracingConnection : public compute_node_templates_v1::NodeTemplatesConnection { public: @@ -95,8 +93,6 @@ class NodeTemplatesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/node_templates/v1/node_templates_connection.h b/google/cloud/compute/node_templates/v1/node_templates_connection.h index 2b14e2cb3e4a6..a7c462fe60bb8 100644 --- a/google/cloud/compute/node_templates/v1/node_templates_connection.h +++ b/google/cloud/compute/node_templates/v1/node_templates_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TEMPLATES_V1_NODE_TEMPLATES_CONNECTION_H #include "google/cloud/compute/node_templates/v1/internal/node_templates_retry_traits.h" +#include "google/cloud/compute/node_templates/v1/node_templates.pb.h" #include "google/cloud/compute/node_templates/v1/node_templates_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/node_templates/v1/node_templates_connection_idempotency_policy.h b/google/cloud/compute/node_templates/v1/node_templates_connection_idempotency_policy.h index ef0a7baa3d778..dc3022056b270 100644 --- a/google/cloud/compute/node_templates/v1/node_templates_connection_idempotency_policy.h +++ b/google/cloud/compute/node_templates/v1/node_templates_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TEMPLATES_V1_NODE_TEMPLATES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TEMPLATES_V1_NODE_TEMPLATES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/node_templates/v1/node_templates.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/node_templates/v1/node_templates_proto_export.h b/google/cloud/compute/node_templates/v1/node_templates_proto_export.h index 350ea5837eba1..471001ad9c7a3 100644 --- a/google/cloud/compute/node_templates/v1/node_templates_proto_export.h +++ b/google/cloud/compute/node_templates/v1/node_templates_proto_export.h @@ -26,14 +26,14 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TEMPLATES_V1_NODE_TEMPLATES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_001.pb.h" +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_078.pb.h" +#include "google/cloud/compute/v1/internal/common_088.pb.h" +#include "google/cloud/compute/v1/internal/common_108.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TEMPLATES_V1_NODE_TEMPLATES_PROTO_EXPORT_H diff --git a/google/cloud/compute/node_types/v1/internal/node_types_option_defaults.cc b/google/cloud/compute/node_types/v1/internal/node_types_option_defaults.cc index 105bbaee15b22..27fb1eaf0dec4 100644 --- a/google/cloud/compute/node_types/v1/internal/node_types_option_defaults.cc +++ b/google/cloud/compute/node_types/v1/internal/node_types_option_defaults.cc @@ -41,7 +41,7 @@ Options NodeTypesDefaultOptions(Options options) { if (!options.has()) { options.set( compute_node_types_v1::NodeTypesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/node_types/v1/internal/node_types_rest_logging_decorator.h b/google/cloud/compute/node_types/v1/internal/node_types_rest_logging_decorator.h index 58ade8ed6cab3..d7cc47b42c33c 100644 --- a/google/cloud/compute/node_types/v1/internal/node_types_rest_logging_decorator.h +++ b/google/cloud/compute/node_types/v1/internal/node_types_rest_logging_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TYPES_V1_INTERNAL_NODE_TYPES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/node_types/v1/internal/node_types_rest_stub.h" +#include "google/cloud/compute/node_types/v1/node_types.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/compute/node_types/v1/internal/node_types_rest_metadata_decorator.cc b/google/cloud/compute/node_types/v1/internal/node_types_rest_metadata_decorator.cc index 3fd7203473f8a..465dc2050d995 100644 --- a/google/cloud/compute/node_types/v1/internal/node_types_rest_metadata_decorator.cc +++ b/google/cloud/compute/node_types/v1/internal/node_types_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/node_types/v1/node_types.proto #include "google/cloud/compute/node_types/v1/internal/node_types_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/node_types/v1/internal/node_types_rest_metadata_decorator.h b/google/cloud/compute/node_types/v1/internal/node_types_rest_metadata_decorator.h index c17744f80c0a4..ec5cf6b0276ba 100644 --- a/google/cloud/compute/node_types/v1/internal/node_types_rest_metadata_decorator.h +++ b/google/cloud/compute/node_types/v1/internal/node_types_rest_metadata_decorator.h @@ -20,10 +20,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TYPES_V1_INTERNAL_NODE_TYPES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/node_types/v1/internal/node_types_rest_stub.h" +#include "google/cloud/compute/node_types/v1/node_types.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.cc b/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.cc index 4cd4d68e05383..1b581f3124aef 100644 --- a/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.cc +++ b/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/node_types/v1/node_types.proto #include "google/cloud/compute/node_types/v1/internal/node_types_rest_stub.h" +#include "google/cloud/compute/node_types/v1/node_types.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.h b/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.h index 6cbd235297a8c..e016a0095e670 100644 --- a/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.h +++ b/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TYPES_V1_INTERNAL_NODE_TYPES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TYPES_V1_INTERNAL_NODE_TYPES_REST_STUB_H +#include "google/cloud/compute/node_types/v1/node_types.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/node_types/v1/internal/node_types_tracing_connection.cc b/google/cloud/compute/node_types/v1/internal/node_types_tracing_connection.cc index 94e47d85c4ef9..2a880afb46db2 100644 --- a/google/cloud/compute/node_types/v1/internal/node_types_tracing_connection.cc +++ b/google/cloud/compute/node_types/v1/internal/node_types_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_node_types_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NodeTypesTracingConnection::NodeTypesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -69,16 +67,12 @@ NodeTypesTracingConnection::ListNodeTypes( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNodeTypesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/node_types/v1/internal/node_types_tracing_connection.h b/google/cloud/compute/node_types/v1/internal/node_types_tracing_connection.h index 5ab288d047296..f87fad28d5275 100644 --- a/google/cloud/compute/node_types/v1/internal/node_types_tracing_connection.h +++ b/google/cloud/compute/node_types/v1/internal/node_types_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_node_types_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NodeTypesTracingConnection : public compute_node_types_v1::NodeTypesConnection { public: @@ -57,8 +55,6 @@ class NodeTypesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/node_types/v1/node_types_connection.h b/google/cloud/compute/node_types/v1/node_types_connection.h index 14ab64ea4a5e6..a56008f300336 100644 --- a/google/cloud/compute/node_types/v1/node_types_connection.h +++ b/google/cloud/compute/node_types/v1/node_types_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TYPES_V1_NODE_TYPES_CONNECTION_H #include "google/cloud/compute/node_types/v1/internal/node_types_retry_traits.h" +#include "google/cloud/compute/node_types/v1/node_types.pb.h" #include "google/cloud/compute/node_types/v1/node_types_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/node_types/v1/node_types_connection_idempotency_policy.h b/google/cloud/compute/node_types/v1/node_types_connection_idempotency_policy.h index 3e59700e4e472..d12a64beb7d23 100644 --- a/google/cloud/compute/node_types/v1/node_types_connection_idempotency_policy.h +++ b/google/cloud/compute/node_types/v1/node_types_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TYPES_V1_NODE_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TYPES_V1_NODE_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/node_types/v1/node_types.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/node_types/v1/node_types_proto_export.h b/google/cloud/compute/node_types/v1/node_types_proto_export.h index a5a001a97d612..879dc6fdf95b8 100644 --- a/google/cloud/compute/node_types/v1/node_types_proto_export.h +++ b/google/cloud/compute/node_types/v1/node_types_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TYPES_V1_NODE_TYPES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_023.pb.h" +#include "google/cloud/compute/v1/internal/common_089.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_NODE_TYPES_V1_NODE_TYPES_PROTO_EXPORT_H diff --git a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_option_defaults.cc b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_option_defaults.cc index fffe167647030..868af41448269 100644 --- a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_option_defaults.cc +++ b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_option_defaults.cc @@ -43,7 +43,7 @@ Options PacketMirroringsDefaultOptions(Options options) { options.set< compute_packet_mirrorings_v1::PacketMirroringsRetryPolicyOption>( compute_packet_mirrorings_v1::PacketMirroringsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_logging_decorator.h b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_logging_decorator.h index 24bbf5eececdd..c2baf4351e7e5 100644 --- a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_logging_decorator.h +++ b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_logging_decorator.h @@ -20,12 +20,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PACKET_MIRRORINGS_V1_INTERNAL_PACKET_MIRRORINGS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.h" +#include "google/cloud/compute/packet_mirrorings/v1/packet_mirrorings.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_metadata_decorator.cc b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_metadata_decorator.cc index fe5c0d5fe3d70..f2bb91fbd6205 100644 --- a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_metadata_decorator.cc +++ b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/packet_mirrorings/v1/packet_mirrorings.proto #include "google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_metadata_decorator.h b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_metadata_decorator.h index 050b3ab2cbe81..ccb6870fd3ec4 100644 --- a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_metadata_decorator.h +++ b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PACKET_MIRRORINGS_V1_INTERNAL_PACKET_MIRRORINGS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.h" +#include "google/cloud/compute/packet_mirrorings/v1/packet_mirrorings.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.cc b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.cc index 34ce9025b4104..f5c663df2a7f4 100644 --- a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.cc +++ b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/packet_mirrorings/v1/packet_mirrorings.proto #include "google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.h" +#include "google/cloud/compute/packet_mirrorings/v1/packet_mirrorings.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.h b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.h index afb6da36bbb27..fec8188773255 100644 --- a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.h +++ b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PACKET_MIRRORINGS_V1_INTERNAL_PACKET_MIRRORINGS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PACKET_MIRRORINGS_V1_INTERNAL_PACKET_MIRRORINGS_REST_STUB_H +#include "google/cloud/compute/packet_mirrorings/v1/packet_mirrorings.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_tracing_connection.cc b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_tracing_connection.cc index 90a22548f1661..bae1d0ab90686 100644 --- a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_tracing_connection.cc +++ b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_packet_mirrorings_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PacketMirroringsTracingConnection::PacketMirroringsTracingConnection( std::shared_ptr child) @@ -191,17 +189,13 @@ PacketMirroringsTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePacketMirroringsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_tracing_connection.h b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_tracing_connection.h index d6445efa2bc1e..750c7bc7754d2 100644 --- a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_tracing_connection.h +++ b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_packet_mirrorings_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PacketMirroringsTracingConnection : public compute_packet_mirrorings_v1::PacketMirroringsConnection { public: @@ -102,8 +100,6 @@ class PacketMirroringsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/packet_mirrorings/v1/packet_mirrorings_connection.h b/google/cloud/compute/packet_mirrorings/v1/packet_mirrorings_connection.h index 0041f8dbd403e..a4f3e8d5f6d9f 100644 --- a/google/cloud/compute/packet_mirrorings/v1/packet_mirrorings_connection.h +++ b/google/cloud/compute/packet_mirrorings/v1/packet_mirrorings_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PACKET_MIRRORINGS_V1_PACKET_MIRRORINGS_CONNECTION_H #include "google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_retry_traits.h" +#include "google/cloud/compute/packet_mirrorings/v1/packet_mirrorings.pb.h" #include "google/cloud/compute/packet_mirrorings/v1/packet_mirrorings_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/packet_mirrorings/v1/packet_mirrorings_connection_idempotency_policy.h b/google/cloud/compute/packet_mirrorings/v1/packet_mirrorings_connection_idempotency_policy.h index a1bc82484b6ca..891cf58f65e35 100644 --- a/google/cloud/compute/packet_mirrorings/v1/packet_mirrorings_connection_idempotency_policy.h +++ b/google/cloud/compute/packet_mirrorings/v1/packet_mirrorings_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PACKET_MIRRORINGS_V1_PACKET_MIRRORINGS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PACKET_MIRRORINGS_V1_PACKET_MIRRORINGS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/packet_mirrorings/v1/packet_mirrorings.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/packet_mirrorings/v1/packet_mirrorings_proto_export.h b/google/cloud/compute/packet_mirrorings/v1/packet_mirrorings_proto_export.h index 74ef9b7e7dbdc..f410b79d44368 100644 --- a/google/cloud/compute/packet_mirrorings/v1/packet_mirrorings_proto_export.h +++ b/google/cloud/compute/packet_mirrorings/v1/packet_mirrorings_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PACKET_MIRRORINGS_V1_PACKET_MIRRORINGS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_093.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PACKET_MIRRORINGS_V1_PACKET_MIRRORINGS_PROTO_EXPORT_H diff --git a/google/cloud/compute/projects/v1/internal/projects_option_defaults.cc b/google/cloud/compute/projects/v1/internal/projects_option_defaults.cc index e311542d1aa91..d17c6e04c7ea1 100644 --- a/google/cloud/compute/projects/v1/internal/projects_option_defaults.cc +++ b/google/cloud/compute/projects/v1/internal/projects_option_defaults.cc @@ -41,7 +41,7 @@ Options ProjectsDefaultOptions(Options options) { if (!options.has()) { options.set( compute_projects_v1::ProjectsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/projects/v1/internal/projects_rest_connection_impl.h b/google/cloud/compute/projects/v1/internal/projects_rest_connection_impl.h index ed342d604d33b..75843d1488026 100644 --- a/google/cloud/compute/projects/v1/internal/projects_rest_connection_impl.h +++ b/google/cloud/compute/projects/v1/internal/projects_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PROJECTS_V1_INTERNAL_PROJECTS_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PROJECTS_V1_INTERNAL_PROJECTS_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/projects/v1/internal/projects_rest_stub.h" #include "google/cloud/compute/projects/v1/internal/projects_retry_traits.h" #include "google/cloud/compute/projects/v1/projects_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/projects/v1/internal/projects_rest_logging_decorator.h b/google/cloud/compute/projects/v1/internal/projects_rest_logging_decorator.h index 2f9576b93a57c..724cc4f058d0d 100644 --- a/google/cloud/compute/projects/v1/internal/projects_rest_logging_decorator.h +++ b/google/cloud/compute/projects/v1/internal/projects_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PROJECTS_V1_INTERNAL_PROJECTS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PROJECTS_V1_INTERNAL_PROJECTS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/projects/v1/internal/projects_rest_stub.h" +#include "google/cloud/compute/projects/v1/projects.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/projects/v1/internal/projects_rest_metadata_decorator.cc b/google/cloud/compute/projects/v1/internal/projects_rest_metadata_decorator.cc index a38bc80cb1ab0..c225aa412834f 100644 --- a/google/cloud/compute/projects/v1/internal/projects_rest_metadata_decorator.cc +++ b/google/cloud/compute/projects/v1/internal/projects_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/projects/v1/projects.proto #include "google/cloud/compute/projects/v1/internal/projects_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/projects/v1/internal/projects_rest_metadata_decorator.h b/google/cloud/compute/projects/v1/internal/projects_rest_metadata_decorator.h index c8da3ccc8ecf9..0823e2e8aba1d 100644 --- a/google/cloud/compute/projects/v1/internal/projects_rest_metadata_decorator.h +++ b/google/cloud/compute/projects/v1/internal/projects_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PROJECTS_V1_INTERNAL_PROJECTS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PROJECTS_V1_INTERNAL_PROJECTS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/projects/v1/internal/projects_rest_stub.h" +#include "google/cloud/compute/projects/v1/projects.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/projects/v1/internal/projects_rest_stub.cc b/google/cloud/compute/projects/v1/internal/projects_rest_stub.cc index eef501c19ca98..f489315b3bc0f 100644 --- a/google/cloud/compute/projects/v1/internal/projects_rest_stub.cc +++ b/google/cloud/compute/projects/v1/internal/projects_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/projects/v1/projects.proto #include "google/cloud/compute/projects/v1/internal/projects_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/projects/v1/projects.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/projects/v1/internal/projects_rest_stub.h b/google/cloud/compute/projects/v1/internal/projects_rest_stub.h index e36ffe88a623d..302dcc76faf40 100644 --- a/google/cloud/compute/projects/v1/internal/projects_rest_stub.h +++ b/google/cloud/compute/projects/v1/internal/projects_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PROJECTS_V1_INTERNAL_PROJECTS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PROJECTS_V1_INTERNAL_PROJECTS_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/projects/v1/projects.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/projects/v1/internal/projects_tracing_connection.cc b/google/cloud/compute/projects/v1/internal/projects_tracing_connection.cc index 1e64392ec75da..38012163162be 100644 --- a/google/cloud/compute/projects/v1/internal/projects_tracing_connection.cc +++ b/google/cloud/compute/projects/v1/internal/projects_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_projects_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ProjectsTracingConnection::ProjectsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -386,16 +384,12 @@ ProjectsTracingConnection::SetUsageExportBucket( child_->SetUsageExportBucket(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeProjectsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/projects/v1/internal/projects_tracing_connection.h b/google/cloud/compute/projects/v1/internal/projects_tracing_connection.h index 173bd0a1ebf8b..a1f28e7714cde 100644 --- a/google/cloud/compute/projects/v1/internal/projects_tracing_connection.h +++ b/google/cloud/compute/projects/v1/internal/projects_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_projects_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ProjectsTracingConnection : public compute_projects_v1::ProjectsConnection { public: @@ -188,8 +186,6 @@ class ProjectsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/projects/v1/projects_connection.h b/google/cloud/compute/projects/v1/projects_connection.h index cc2d4af46f782..32151d0ccae5a 100644 --- a/google/cloud/compute/projects/v1/projects_connection.h +++ b/google/cloud/compute/projects/v1/projects_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PROJECTS_V1_PROJECTS_CONNECTION_H #include "google/cloud/compute/projects/v1/internal/projects_retry_traits.h" +#include "google/cloud/compute/projects/v1/projects.pb.h" #include "google/cloud/compute/projects/v1/projects_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/projects/v1/projects_connection_idempotency_policy.h b/google/cloud/compute/projects/v1/projects_connection_idempotency_policy.h index 37ca40331527e..4f49566616f14 100644 --- a/google/cloud/compute/projects/v1/projects_connection_idempotency_policy.h +++ b/google/cloud/compute/projects/v1/projects_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PROJECTS_V1_PROJECTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PROJECTS_V1_PROJECTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/projects/v1/projects.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/projects/v1/projects_proto_export.h b/google/cloud/compute/projects/v1/projects_proto_export.h index 42cfbf7f2f195..81463ab7e1eb1 100644 --- a/google/cloud/compute/projects/v1/projects_proto_export.h +++ b/google/cloud/compute/projects/v1/projects_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PROJECTS_V1_PROJECTS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_025.pb.h" +#include "google/cloud/compute/v1/internal/common_081.pb.h" +#include "google/cloud/compute/v1/internal/common_098.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PROJECTS_V1_PROJECTS_PROTO_EXPORT_H diff --git a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_option_defaults.cc b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_option_defaults.cc index baeddbbab2723..2197338416d2d 100644 --- a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_option_defaults.cc +++ b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_option_defaults.cc @@ -47,7 +47,7 @@ Options PublicAdvertisedPrefixesDefaultOptions(Options options) { PublicAdvertisedPrefixesRetryPolicyOption>( compute_public_advertised_prefixes_v1:: PublicAdvertisedPrefixesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_logging_decorator.h b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_logging_decorator.h index e03ff20c62973..8e939439a649f 100644 --- a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_logging_decorator.h +++ b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_ADVERTISED_PREFIXES_V1_INTERNAL_PUBLIC_ADVERTISED_PREFIXES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_ADVERTISED_PREFIXES_V1_INTERNAL_PUBLIC_ADVERTISED_PREFIXES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.h" +#include "google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_metadata_decorator.cc b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_metadata_decorator.cc index 25d979e840302..5450951fe5f68 100644 --- a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_metadata_decorator.cc +++ b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes.proto #include "google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_metadata_decorator.h b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_metadata_decorator.h index b6941163d377f..2451f6f976f61 100644 --- a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_metadata_decorator.h +++ b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_ADVERTISED_PREFIXES_V1_INTERNAL_PUBLIC_ADVERTISED_PREFIXES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_ADVERTISED_PREFIXES_V1_INTERNAL_PUBLIC_ADVERTISED_PREFIXES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.h" +#include "google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.cc b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.cc index a9ef3f3603ad3..50e370a8acde4 100644 --- a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.cc +++ b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes.proto #include "google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.h b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.h index ea67b3c71de17..f3b80db3528fd 100644 --- a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.h +++ b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_ADVERTISED_PREFIXES_V1_INTERNAL_PUBLIC_ADVERTISED_PREFIXES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_ADVERTISED_PREFIXES_V1_INTERNAL_PUBLIC_ADVERTISED_PREFIXES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_tracing_connection.cc b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_tracing_connection.cc index 1fafdc1b25abd..8014b865c5da6 100644 --- a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_tracing_connection.cc +++ b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_public_advertised_prefixes_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PublicAdvertisedPrefixesTracingConnection:: PublicAdvertisedPrefixesTracingConnection( std::shared_ptrWithdraw(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_public_advertised_prefixes_v1::PublicAdvertisedPrefixesConnection> MakePublicAdvertisedPrefixesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_tracing_connection.h b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_tracing_connection.h index 783b15a01dd2c..e4a5b44a03081 100644 --- a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_tracing_connection.h +++ b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_public_advertised_prefixes_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PublicAdvertisedPrefixesTracingConnection : public compute_public_advertised_prefixes_v1:: PublicAdvertisedPrefixesConnection { @@ -127,8 +125,6 @@ class PublicAdvertisedPrefixesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes_connection.h b/google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes_connection.h index c1938963f04a6..b474194f209ec 100644 --- a/google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes_connection.h +++ b/google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_ADVERTISED_PREFIXES_V1_PUBLIC_ADVERTISED_PREFIXES_CONNECTION_H #include "google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_retry_traits.h" +#include "google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes.pb.h" #include "google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes_connection_idempotency_policy.h b/google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes_connection_idempotency_policy.h index 79b101d5f144b..b97c2fb7e3739 100644 --- a/google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes_connection_idempotency_policy.h +++ b/google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_ADVERTISED_PREFIXES_V1_PUBLIC_ADVERTISED_PREFIXES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_ADVERTISED_PREFIXES_V1_PUBLIC_ADVERTISED_PREFIXES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes_proto_export.h b/google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes_proto_export.h index 473df486bf6bf..263f7641c7568 100644 --- a/google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes_proto_export.h +++ b/google/cloud/compute/public_advertised_prefixes/v1/public_advertised_prefixes_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_ADVERTISED_PREFIXES_V1_PUBLIC_ADVERTISED_PREFIXES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_095.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_ADVERTISED_PREFIXES_V1_PUBLIC_ADVERTISED_PREFIXES_PROTO_EXPORT_H diff --git a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_option_defaults.cc b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_option_defaults.cc index 4dad9af04002f..7af196ad259e7 100644 --- a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_option_defaults.cc +++ b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_option_defaults.cc @@ -46,7 +46,7 @@ Options PublicDelegatedPrefixesDefaultOptions(Options options) { PublicDelegatedPrefixesRetryPolicyOption>( compute_public_delegated_prefixes_v1:: PublicDelegatedPrefixesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_logging_decorator.h b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_logging_decorator.h index cf8c4dd574859..7ad6b5ec41613 100644 --- a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_logging_decorator.h +++ b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_logging_decorator.h @@ -21,12 +21,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_DELEGATED_PREFIXES_V1_INTERNAL_PUBLIC_DELEGATED_PREFIXES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.h" +#include "google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_metadata_decorator.cc b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_metadata_decorator.cc index ac0ef4bec2564..f5709a3685ed3 100644 --- a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_metadata_decorator.cc +++ b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes.proto #include "google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_metadata_decorator.h b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_metadata_decorator.h index 0668de27a218f..6e774cedbc0aa 100644 --- a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_metadata_decorator.h +++ b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_metadata_decorator.h @@ -21,11 +21,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_DELEGATED_PREFIXES_V1_INTERNAL_PUBLIC_DELEGATED_PREFIXES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.h" +#include "google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.cc b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.cc index 063281250bd09..a71b60e10fff1 100644 --- a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.cc +++ b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes.proto #include "google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.h" +#include "google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.h b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.h index 6b53180eb35ca..1fbb7d4899b63 100644 --- a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.h +++ b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_DELEGATED_PREFIXES_V1_INTERNAL_PUBLIC_DELEGATED_PREFIXES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_DELEGATED_PREFIXES_V1_INTERNAL_PUBLIC_DELEGATED_PREFIXES_REST_STUB_H +#include "google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_tracing_connection.cc b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_tracing_connection.cc index e823e2c85b419..0409a253473ea 100644 --- a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_tracing_connection.cc +++ b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_public_delegated_prefixes_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PublicDelegatedPrefixesTracingConnection:: PublicDelegatedPrefixesTracingConnection( std::shared_ptrWithdraw(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_public_delegated_prefixes_v1::PublicDelegatedPrefixesConnection> MakePublicDelegatedPrefixesTracingConnection( std::shared_ptr< compute_public_delegated_prefixes_v1::PublicDelegatedPrefixesConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_tracing_connection.h b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_tracing_connection.h index a398200147c90..d9f9f53d416be 100644 --- a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_tracing_connection.h +++ b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_public_delegated_prefixes_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PublicDelegatedPrefixesTracingConnection : public compute_public_delegated_prefixes_v1:: PublicDelegatedPrefixesConnection { @@ -133,8 +131,6 @@ class PublicDelegatedPrefixesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes_connection.h b/google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes_connection.h index da9cf94ae63fb..b91a5b2ca9834 100644 --- a/google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes_connection.h +++ b/google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_DELEGATED_PREFIXES_V1_PUBLIC_DELEGATED_PREFIXES_CONNECTION_H #include "google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_retry_traits.h" +#include "google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes.pb.h" #include "google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes_connection_idempotency_policy.h b/google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes_connection_idempotency_policy.h index 81d4c06e793e2..625595b30da49 100644 --- a/google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes_connection_idempotency_policy.h +++ b/google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_DELEGATED_PREFIXES_V1_PUBLIC_DELEGATED_PREFIXES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_DELEGATED_PREFIXES_V1_PUBLIC_DELEGATED_PREFIXES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes_proto_export.h b/google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes_proto_export.h index 2233ade939dbf..e372bd05444bf 100644 --- a/google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes_proto_export.h +++ b/google/cloud/compute/public_delegated_prefixes/v1/public_delegated_prefixes_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_DELEGATED_PREFIXES_V1_PUBLIC_DELEGATED_PREFIXES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_096.pb.h" +#include "google/cloud/compute/v1/internal/common_097.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_PUBLIC_DELEGATED_PREFIXES_V1_PUBLIC_DELEGATED_PREFIXES_PROTO_EXPORT_H diff --git a/google/cloud/compute/quickstart/.bazelrc b/google/cloud/compute/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/compute/quickstart/.bazelrc +++ b/google/cloud/compute/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/compute/quickstart/CMakeLists.txt index f8ac077644adb..6eb7e6fd45d24 100644 --- a/google/cloud/compute/quickstart/CMakeLists.txt +++ b/google/cloud/compute/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Compute Engine API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-compute-quickstart CXX) find_package(google_cloud_cpp_compute REQUIRED) diff --git a/google/cloud/compute/quickstart/WORKSPACE.bazel b/google/cloud/compute/quickstart/WORKSPACE.bazel index 8538ced141122..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 = "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/compute/region_autoscalers/v1/internal/region_autoscalers_option_defaults.cc b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_option_defaults.cc index 8c0ca79576d35..0d0a1f30fd88f 100644 --- a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_option_defaults.cc +++ b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_option_defaults.cc @@ -44,7 +44,7 @@ Options RegionAutoscalersDefaultOptions(Options options) { options.set< compute_region_autoscalers_v1::RegionAutoscalersRetryPolicyOption>( compute_region_autoscalers_v1::RegionAutoscalersLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_logging_decorator.h b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_logging_decorator.h index aafbb719fe5a0..9904b8b9a74a4 100644 --- a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_logging_decorator.h +++ b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_logging_decorator.h @@ -20,12 +20,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_AUTOSCALERS_V1_INTERNAL_REGION_AUTOSCALERS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.h" +#include "google/cloud/compute/region_autoscalers/v1/region_autoscalers.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_metadata_decorator.cc b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_metadata_decorator.cc index 9c9daaa378bdb..46732319e1d73 100644 --- a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/region_autoscalers/v1/region_autoscalers.proto #include "google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_metadata_decorator.h b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_metadata_decorator.h index 0ad1e7f0c02ee..2c348291d45a5 100644 --- a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_metadata_decorator.h +++ b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_AUTOSCALERS_V1_INTERNAL_REGION_AUTOSCALERS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.h" +#include "google/cloud/compute/region_autoscalers/v1/region_autoscalers.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.cc b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.cc index fa52326022849..963888c10e3d5 100644 --- a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.cc +++ b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/region_autoscalers/v1/region_autoscalers.proto #include "google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.h" +#include "google/cloud/compute/region_autoscalers/v1/region_autoscalers.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.h b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.h index 4b7c5a1dc9a55..05ea74a003823 100644 --- a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.h +++ b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_AUTOSCALERS_V1_INTERNAL_REGION_AUTOSCALERS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_AUTOSCALERS_V1_INTERNAL_REGION_AUTOSCALERS_REST_STUB_H +#include "google/cloud/compute/region_autoscalers/v1/region_autoscalers.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_tracing_connection.cc b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_tracing_connection.cc index 417f40967f98c..38c91e7b3ea57 100644 --- a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_tracing_connection.cc +++ b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_region_autoscalers_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionAutoscalersTracingConnection::RegionAutoscalersTracingConnection( std::shared_ptr child) @@ -194,18 +192,14 @@ RegionAutoscalersTracingConnection::UpdateAutoscaler( child_->UpdateAutoscaler(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegionAutoscalersTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_tracing_connection.h b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_tracing_connection.h index f5285ce7e1259..ae8399daf9f67 100644 --- a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_tracing_connection.h +++ b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_autoscalers_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionAutoscalersTracingConnection : public compute_region_autoscalers_v1::RegionAutoscalersConnection { public: @@ -99,8 +97,6 @@ class RegionAutoscalersTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_autoscalers/v1/region_autoscalers_connection.h b/google/cloud/compute/region_autoscalers/v1/region_autoscalers_connection.h index 56d6790d4156c..8e27b4b0b13df 100644 --- a/google/cloud/compute/region_autoscalers/v1/region_autoscalers_connection.h +++ b/google/cloud/compute/region_autoscalers/v1/region_autoscalers_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_AUTOSCALERS_V1_REGION_AUTOSCALERS_CONNECTION_H #include "google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_retry_traits.h" +#include "google/cloud/compute/region_autoscalers/v1/region_autoscalers.pb.h" #include "google/cloud/compute/region_autoscalers/v1/region_autoscalers_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_autoscalers/v1/region_autoscalers_connection_idempotency_policy.h b/google/cloud/compute/region_autoscalers/v1/region_autoscalers_connection_idempotency_policy.h index 7ba6dec19f201..edcca9e61ae84 100644 --- a/google/cloud/compute/region_autoscalers/v1/region_autoscalers_connection_idempotency_policy.h +++ b/google/cloud/compute/region_autoscalers/v1/region_autoscalers_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_AUTOSCALERS_V1_REGION_AUTOSCALERS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_AUTOSCALERS_V1_REGION_AUTOSCALERS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_autoscalers/v1/region_autoscalers.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_autoscalers/v1/region_autoscalers_proto_export.h b/google/cloud/compute/region_autoscalers/v1/region_autoscalers_proto_export.h index 900992f36ec55..96b540cda01b4 100644 --- a/google/cloud/compute/region_autoscalers/v1/region_autoscalers_proto_export.h +++ b/google/cloud/compute/region_autoscalers/v1/region_autoscalers_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_AUTOSCALERS_V1_REGION_AUTOSCALERS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_008.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_040.pb.h" +#include "google/cloud/compute/v1/internal/common_100.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_AUTOSCALERS_V1_REGION_AUTOSCALERS_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_option_defaults.cc b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_option_defaults.cc index b2514b5e0e509..e23b1cbc7d7ae 100644 --- a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_option_defaults.cc +++ b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_option_defaults.cc @@ -46,7 +46,7 @@ Options RegionBackendServicesDefaultOptions(Options options) { RegionBackendServicesRetryPolicyOption>( compute_region_backend_services_v1:: RegionBackendServicesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_logging_decorator.h b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_logging_decorator.h index d4f089e08961d..7ec9edec79598 100644 --- a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_logging_decorator.h +++ b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_logging_decorator.h @@ -21,12 +21,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_BACKEND_SERVICES_V1_INTERNAL_REGION_BACKEND_SERVICES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.h" +#include "google/cloud/compute/region_backend_services/v1/region_backend_services.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_metadata_decorator.cc b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_metadata_decorator.cc index acc6afdf85ffa..6245ee3435f1d 100644 --- a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_backend_services/v1/region_backend_services.proto #include "google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_metadata_decorator.h b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_metadata_decorator.h index 282407fd4c3c8..973f7564da386 100644 --- a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_metadata_decorator.h +++ b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_metadata_decorator.h @@ -21,11 +21,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_BACKEND_SERVICES_V1_INTERNAL_REGION_BACKEND_SERVICES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.h" +#include "google/cloud/compute/region_backend_services/v1/region_backend_services.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.cc b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.cc index 5e319e8091b2a..679b6c65a8af4 100644 --- a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.cc +++ b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_backend_services/v1/region_backend_services.proto #include "google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.h" +#include "google/cloud/compute/region_backend_services/v1/region_backend_services.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.h b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.h index 3265cc5cca3af..5d29518182e5b 100644 --- a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.h +++ b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_BACKEND_SERVICES_V1_INTERNAL_REGION_BACKEND_SERVICES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_BACKEND_SERVICES_V1_INTERNAL_REGION_BACKEND_SERVICES_REST_STUB_H +#include "google/cloud/compute/region_backend_services/v1/region_backend_services.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_tracing_connection.cc b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_tracing_connection.cc index 1fe377b01c0f6..1a2eb7c53e712 100644 --- a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_tracing_connection.cc +++ b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_backend_services_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionBackendServicesTracingConnection::RegionBackendServicesTracingConnection( std::shared_ptr< compute_region_backend_services_v1::RegionBackendServicesConnection> @@ -293,20 +291,16 @@ RegionBackendServicesTracingConnection::UpdateBackendService( child_->UpdateBackendService(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_region_backend_services_v1::RegionBackendServicesConnection> MakeRegionBackendServicesTracingConnection( std::shared_ptr< compute_region_backend_services_v1::RegionBackendServicesConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_tracing_connection.h b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_tracing_connection.h index 2807dfb5dc7fb..52eaa8a0f4915 100644 --- a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_tracing_connection.h +++ b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_backend_services_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionBackendServicesTracingConnection : public compute_region_backend_services_v1:: RegionBackendServicesConnection { @@ -142,8 +140,6 @@ class RegionBackendServicesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_backend_services/v1/region_backend_services_connection.h b/google/cloud/compute/region_backend_services/v1/region_backend_services_connection.h index 639eef6247102..8852ea311c4e3 100644 --- a/google/cloud/compute/region_backend_services/v1/region_backend_services_connection.h +++ b/google/cloud/compute/region_backend_services/v1/region_backend_services_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_BACKEND_SERVICES_V1_REGION_BACKEND_SERVICES_CONNECTION_H #include "google/cloud/compute/region_backend_services/v1/internal/region_backend_services_retry_traits.h" +#include "google/cloud/compute/region_backend_services/v1/region_backend_services.pb.h" #include "google/cloud/compute/region_backend_services/v1/region_backend_services_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_backend_services/v1/region_backend_services_connection_idempotency_policy.h b/google/cloud/compute/region_backend_services/v1/region_backend_services_connection_idempotency_policy.h index bfddece424f8d..928c1274ab2d1 100644 --- a/google/cloud/compute/region_backend_services/v1/region_backend_services_connection_idempotency_policy.h +++ b/google/cloud/compute/region_backend_services/v1/region_backend_services_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_BACKEND_SERVICES_V1_REGION_BACKEND_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_BACKEND_SERVICES_V1_REGION_BACKEND_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_backend_services/v1/region_backend_services.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_backend_services/v1/region_backend_services_proto_export.h b/google/cloud/compute/region_backend_services/v1/region_backend_services_proto_export.h index 35870c0a3c857..d049495648f3a 100644 --- a/google/cloud/compute/region_backend_services/v1/region_backend_services_proto_export.h +++ b/google/cloud/compute/region_backend_services/v1/region_backend_services_proto_export.h @@ -26,15 +26,15 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_BACKEND_SERVICES_V1_REGION_BACKEND_SERVICES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_000.pb.h" +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_052.pb.h" +#include "google/cloud/compute/v1/internal/common_108.pb.h" +#include "google/cloud/compute/v1/internal/common_118.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_BACKEND_SERVICES_V1_REGION_BACKEND_SERVICES_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_commitments/v1/internal/region_commitments_option_defaults.cc b/google/cloud/compute/region_commitments/v1/internal/region_commitments_option_defaults.cc index b397d17be702f..c0b86a012e1b9 100644 --- a/google/cloud/compute/region_commitments/v1/internal/region_commitments_option_defaults.cc +++ b/google/cloud/compute/region_commitments/v1/internal/region_commitments_option_defaults.cc @@ -44,7 +44,7 @@ Options RegionCommitmentsDefaultOptions(Options options) { options.set< compute_region_commitments_v1::RegionCommitmentsRetryPolicyOption>( compute_region_commitments_v1::RegionCommitmentsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_logging_decorator.h b/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_logging_decorator.h index c74ab99ba439c..b0d3c0e9165ed 100644 --- a/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_logging_decorator.h +++ b/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_logging_decorator.h @@ -20,12 +20,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_COMMITMENTS_V1_INTERNAL_REGION_COMMITMENTS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.h" +#include "google/cloud/compute/region_commitments/v1/region_commitments.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_metadata_decorator.cc b/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_metadata_decorator.cc index a95f1cd062165..83afc01c360fd 100644 --- a/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/region_commitments/v1/region_commitments.proto #include "google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_metadata_decorator.h b/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_metadata_decorator.h index 995c44380ee37..381e0e1e5cd79 100644 --- a/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_metadata_decorator.h +++ b/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_COMMITMENTS_V1_INTERNAL_REGION_COMMITMENTS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.h" +#include "google/cloud/compute/region_commitments/v1/region_commitments.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.cc b/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.cc index 5da166f40d922..615cf55850088 100644 --- a/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.cc +++ b/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/region_commitments/v1/region_commitments.proto #include "google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.h" +#include "google/cloud/compute/region_commitments/v1/region_commitments.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.h b/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.h index 034e10a3dd738..1ae63de7e6401 100644 --- a/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.h +++ b/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_COMMITMENTS_V1_INTERNAL_REGION_COMMITMENTS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_COMMITMENTS_V1_INTERNAL_REGION_COMMITMENTS_REST_STUB_H +#include "google/cloud/compute/region_commitments/v1/region_commitments.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_commitments/v1/internal/region_commitments_tracing_connection.cc b/google/cloud/compute/region_commitments/v1/internal/region_commitments_tracing_connection.cc index 21ae5e97d329a..fbb2013b40ddf 100644 --- a/google/cloud/compute/region_commitments/v1/internal/region_commitments_tracing_connection.cc +++ b/google/cloud/compute/region_commitments/v1/internal/region_commitments_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_region_commitments_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionCommitmentsTracingConnection::RegionCommitmentsTracingConnection( std::shared_ptr child) @@ -142,18 +140,14 @@ RegionCommitmentsTracingConnection::UpdateCommitment( child_->UpdateCommitment(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegionCommitmentsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_commitments/v1/internal/region_commitments_tracing_connection.h b/google/cloud/compute/region_commitments/v1/internal/region_commitments_tracing_connection.h index dee2c8bc1bdb2..c10340d8ea5c8 100644 --- a/google/cloud/compute/region_commitments/v1/internal/region_commitments_tracing_connection.h +++ b/google/cloud/compute/region_commitments/v1/internal/region_commitments_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_commitments_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionCommitmentsTracingConnection : public compute_region_commitments_v1::RegionCommitmentsConnection { public: @@ -83,8 +81,6 @@ class RegionCommitmentsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_commitments/v1/region_commitments_connection.h b/google/cloud/compute/region_commitments/v1/region_commitments_connection.h index 3fe0cbde09ae0..dfba56afc3491 100644 --- a/google/cloud/compute/region_commitments/v1/region_commitments_connection.h +++ b/google/cloud/compute/region_commitments/v1/region_commitments_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_COMMITMENTS_V1_REGION_COMMITMENTS_CONNECTION_H #include "google/cloud/compute/region_commitments/v1/internal/region_commitments_retry_traits.h" +#include "google/cloud/compute/region_commitments/v1/region_commitments.pb.h" #include "google/cloud/compute/region_commitments/v1/region_commitments_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_commitments/v1/region_commitments_connection_idempotency_policy.h b/google/cloud/compute/region_commitments/v1/region_commitments_connection_idempotency_policy.h index 1b5cf2cd7c590..7c9b367a02ccf 100644 --- a/google/cloud/compute/region_commitments/v1/region_commitments_connection_idempotency_policy.h +++ b/google/cloud/compute/region_commitments/v1/region_commitments_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_COMMITMENTS_V1_REGION_COMMITMENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_COMMITMENTS_V1_REGION_COMMITMENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_commitments/v1/region_commitments.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_commitments/v1/region_commitments_proto_export.h b/google/cloud/compute/region_commitments/v1/region_commitments_proto_export.h index 5521d8caf491f..6f39ec34042f9 100644 --- a/google/cloud/compute/region_commitments/v1/region_commitments_proto_export.h +++ b/google/cloud/compute/region_commitments/v1/region_commitments_proto_export.h @@ -26,14 +26,14 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_COMMITMENTS_V1_REGION_COMMITMENTS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_001.pb.h" +#include "google/cloud/compute/v1/internal/common_006.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_019.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_048.pb.h" +#include "google/cloud/compute/v1/internal/common_120.pb.h" +#include "google/cloud/compute/v1/internal/common_146.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_COMMITMENTS_V1_REGION_COMMITMENTS_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_option_defaults.cc b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_option_defaults.cc index daa32ba6ef4dd..902aa97f57a82 100644 --- a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_option_defaults.cc +++ b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_option_defaults.cc @@ -42,7 +42,7 @@ Options RegionDiskTypesDefaultOptions(Options options) { compute_region_disk_types_v1::RegionDiskTypesRetryPolicyOption>()) { options.set( compute_region_disk_types_v1::RegionDiskTypesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_logging_decorator.h b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_logging_decorator.h index a511b8345bc82..5f7d3edb3dda5 100644 --- a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_logging_decorator.h +++ b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_logging_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISK_TYPES_V1_INTERNAL_REGION_DISK_TYPES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.h" +#include "google/cloud/compute/region_disk_types/v1/region_disk_types.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_metadata_decorator.cc b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_metadata_decorator.cc index 7d2eadf3053ac..478a39de159d2 100644 --- a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/region_disk_types/v1/region_disk_types.proto #include "google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_metadata_decorator.h b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_metadata_decorator.h index ecb93e942deb8..ecd292495146f 100644 --- a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_metadata_decorator.h +++ b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_metadata_decorator.h @@ -20,10 +20,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISK_TYPES_V1_INTERNAL_REGION_DISK_TYPES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.h" +#include "google/cloud/compute/region_disk_types/v1/region_disk_types.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.cc b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.cc index 52e9e07a8cce5..a216550828551 100644 --- a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.cc +++ b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/region_disk_types/v1/region_disk_types.proto #include "google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.h" +#include "google/cloud/compute/region_disk_types/v1/region_disk_types.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.h b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.h index 2c84de16bf84a..386eaf7c9dbb1 100644 --- a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.h +++ b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISK_TYPES_V1_INTERNAL_REGION_DISK_TYPES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISK_TYPES_V1_INTERNAL_REGION_DISK_TYPES_REST_STUB_H +#include "google/cloud/compute/region_disk_types/v1/region_disk_types.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_tracing_connection.cc b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_tracing_connection.cc index 45e9859eda60f..8250831a99fc2 100644 --- a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_tracing_connection.cc +++ b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_region_disk_types_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionDiskTypesTracingConnection::RegionDiskTypesTracingConnection( std::shared_ptr child) @@ -58,17 +56,13 @@ RegionDiskTypesTracingConnection::ListRegionDiskTypes( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegionDiskTypesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_tracing_connection.h b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_tracing_connection.h index bfdd9b9241bde..bfe4a7ea4e6f4 100644 --- a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_tracing_connection.h +++ b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_disk_types_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionDiskTypesTracingConnection : public compute_region_disk_types_v1::RegionDiskTypesConnection { public: @@ -54,8 +52,6 @@ class RegionDiskTypesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_disk_types/v1/region_disk_types_connection.h b/google/cloud/compute/region_disk_types/v1/region_disk_types_connection.h index 6680af5546f43..db75dfa537f3a 100644 --- a/google/cloud/compute/region_disk_types/v1/region_disk_types_connection.h +++ b/google/cloud/compute/region_disk_types/v1/region_disk_types_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISK_TYPES_V1_REGION_DISK_TYPES_CONNECTION_H #include "google/cloud/compute/region_disk_types/v1/internal/region_disk_types_retry_traits.h" +#include "google/cloud/compute/region_disk_types/v1/region_disk_types.pb.h" #include "google/cloud/compute/region_disk_types/v1/region_disk_types_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_disk_types/v1/region_disk_types_connection_idempotency_policy.h b/google/cloud/compute/region_disk_types/v1/region_disk_types_connection_idempotency_policy.h index c33be9d7c239a..fc49f6cd766d8 100644 --- a/google/cloud/compute/region_disk_types/v1/region_disk_types_connection_idempotency_policy.h +++ b/google/cloud/compute/region_disk_types/v1/region_disk_types_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISK_TYPES_V1_REGION_DISK_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISK_TYPES_V1_REGION_DISK_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_disk_types/v1/region_disk_types.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_disk_types/v1/region_disk_types_proto_export.h b/google/cloud/compute/region_disk_types/v1/region_disk_types_proto_export.h index 0ddf12a582050..fc8d3d29cffe4 100644 --- a/google/cloud/compute/region_disk_types/v1/region_disk_types_proto_export.h +++ b/google/cloud/compute/region_disk_types/v1/region_disk_types_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISK_TYPES_V1_REGION_DISK_TYPES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_023.pb.h" +#include "google/cloud/compute/v1/internal/common_026.pb.h" +#include "google/cloud/compute/v1/internal/common_101.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISK_TYPES_V1_REGION_DISK_TYPES_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_disks/v1/internal/region_disks_option_defaults.cc b/google/cloud/compute/region_disks/v1/internal/region_disks_option_defaults.cc index cab89fdeda901..9bbb9b9f6618e 100644 --- a/google/cloud/compute/region_disks/v1/internal/region_disks_option_defaults.cc +++ b/google/cloud/compute/region_disks/v1/internal/region_disks_option_defaults.cc @@ -41,7 +41,7 @@ Options RegionDisksDefaultOptions(Options options) { if (!options.has()) { options.set( compute_region_disks_v1::RegionDisksLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_connection_impl.h b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_connection_impl.h index b51bc9c76cf03..a336f0ac2bd92 100644 --- a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_connection_impl.h +++ b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/region_disks/v1/region_disks_connection.h" #include "google/cloud/compute/region_disks/v1/region_disks_connection_idempotency_policy.h" #include "google/cloud/compute/region_disks/v1/region_disks_options.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_logging_decorator.h b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_logging_decorator.h index 6af0965e2f1ef..6e6b773edf131 100644 --- a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_logging_decorator.h +++ b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_logging_decorator.h @@ -20,12 +20,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISKS_V1_INTERNAL_REGION_DISKS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.h" +#include "google/cloud/compute/region_disks/v1/region_disks.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_metadata_decorator.cc b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_metadata_decorator.cc index 52bd2697f3a08..64be6ec7a6b69 100644 --- a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/region_disks/v1/region_disks.proto #include "google/cloud/compute/region_disks/v1/internal/region_disks_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_metadata_decorator.h b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_metadata_decorator.h index f12668f7c878b..fb0315454a9f3 100644 --- a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_metadata_decorator.h +++ b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISKS_V1_INTERNAL_REGION_DISKS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.h" +#include "google/cloud/compute/region_disks/v1/region_disks.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.cc b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.cc index 8f9582451f017..87a5fc1c09fcb 100644 --- a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.cc +++ b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/region_disks/v1/region_disks.proto #include "google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.h" +#include "google/cloud/compute/region_disks/v1/region_disks.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.h b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.h index f897937372206..051309674f6a6 100644 --- a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.h +++ b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISKS_V1_INTERNAL_REGION_DISKS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISKS_V1_INTERNAL_REGION_DISKS_REST_STUB_H +#include "google/cloud/compute/region_disks/v1/region_disks.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_disks/v1/internal/region_disks_tracing_connection.cc b/google/cloud/compute/region_disks/v1/internal/region_disks_tracing_connection.cc index 29adc384a34fc..2b85dac179a6b 100644 --- a/google/cloud/compute/region_disks/v1/internal/region_disks_tracing_connection.cc +++ b/google/cloud/compute/region_disks/v1/internal/region_disks_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_region_disks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionDisksTracingConnection::RegionDisksTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -459,16 +457,12 @@ RegionDisksTracingConnection::UpdateDisk( return internal::EndSpan(std::move(span), child_->UpdateDisk(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegionDisksTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_disks/v1/internal/region_disks_tracing_connection.h b/google/cloud/compute/region_disks/v1/internal/region_disks_tracing_connection.h index c916c4f429799..ebc54d08a6128 100644 --- a/google/cloud/compute/region_disks/v1/internal/region_disks_tracing_connection.h +++ b/google/cloud/compute/region_disks/v1/internal/region_disks_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_disks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionDisksTracingConnection : public compute_region_disks_v1::RegionDisksConnection { public: @@ -211,8 +209,6 @@ class RegionDisksTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_disks/v1/region_disks_connection.h b/google/cloud/compute/region_disks/v1/region_disks_connection.h index c5f96da313317..c216eadeeaab9 100644 --- a/google/cloud/compute/region_disks/v1/region_disks_connection.h +++ b/google/cloud/compute/region_disks/v1/region_disks_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISKS_V1_REGION_DISKS_CONNECTION_H #include "google/cloud/compute/region_disks/v1/internal/region_disks_retry_traits.h" +#include "google/cloud/compute/region_disks/v1/region_disks.pb.h" #include "google/cloud/compute/region_disks/v1/region_disks_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_disks/v1/region_disks_connection_idempotency_policy.h b/google/cloud/compute/region_disks/v1/region_disks_connection_idempotency_policy.h index cd8e146f6b735..c683ec6a17696 100644 --- a/google/cloud/compute/region_disks/v1/region_disks_connection_idempotency_policy.h +++ b/google/cloud/compute/region_disks/v1/region_disks_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISKS_V1_REGION_DISKS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISKS_V1_REGION_DISKS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_disks/v1/region_disks.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_disks/v1/region_disks_proto_export.h b/google/cloud/compute/region_disks/v1/region_disks_proto_export.h index f4ad8218c88e6..ef63807d80d40 100644 --- a/google/cloud/compute/region_disks/v1/region_disks_proto_export.h +++ b/google/cloud/compute/region_disks/v1/region_disks_proto_export.h @@ -26,16 +26,16 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISKS_V1_REGION_DISKS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_014.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_021.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_102.pb.h" +#include "google/cloud/compute/v1/internal/common_107.pb.h" +#include "google/cloud/compute/v1/internal/common_108.pb.h" +#include "google/cloud/compute/v1/internal/common_122.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_DISKS_V1_REGION_DISKS_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_option_defaults.cc b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_option_defaults.cc index 98d8a25cb8a4c..9567bb52ca1d1 100644 --- a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_option_defaults.cc +++ b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_option_defaults.cc @@ -47,7 +47,7 @@ Options RegionHealthCheckServicesDefaultOptions(Options options) { RegionHealthCheckServicesRetryPolicyOption>( compute_region_health_check_services_v1:: RegionHealthCheckServicesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_logging_decorator.h b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_logging_decorator.h index 3a7088377446b..ab266db99d23b 100644 --- a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_logging_decorator.h +++ b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_logging_decorator.h @@ -21,12 +21,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECK_SERVICES_V1_INTERNAL_REGION_HEALTH_CHECK_SERVICES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.h" +#include "google/cloud/compute/region_health_check_services/v1/region_health_check_services.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_metadata_decorator.cc b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_metadata_decorator.cc index 28ddde6f2d7bf..eb2a69c33ee0b 100644 --- a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_health_check_services/v1/region_health_check_services.proto #include "google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_metadata_decorator.h b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_metadata_decorator.h index 5b5b7659809c5..669298532b390 100644 --- a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_metadata_decorator.h +++ b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_metadata_decorator.h @@ -21,11 +21,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECK_SERVICES_V1_INTERNAL_REGION_HEALTH_CHECK_SERVICES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.h" +#include "google/cloud/compute/region_health_check_services/v1/region_health_check_services.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.cc b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.cc index d681012da5878..af9bb1012a88c 100644 --- a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.cc +++ b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_health_check_services/v1/region_health_check_services.proto #include "google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.h" +#include "google/cloud/compute/region_health_check_services/v1/region_health_check_services.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.h b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.h index 31c032acd579e..225bb02adafcb 100644 --- a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.h +++ b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECK_SERVICES_V1_INTERNAL_REGION_HEALTH_CHECK_SERVICES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECK_SERVICES_V1_INTERNAL_REGION_HEALTH_CHECK_SERVICES_REST_STUB_H +#include "google/cloud/compute/region_health_check_services/v1/region_health_check_services.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_tracing_connection.cc b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_tracing_connection.cc index 51502f080d59d..45054b8035ae3 100644 --- a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_tracing_connection.cc +++ b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_health_check_services_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionHealthCheckServicesTracingConnection:: RegionHealthCheckServicesTracingConnection( std::shared_ptrPatchHealthCheckService(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegionHealthCheckServicesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_tracing_connection.h b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_tracing_connection.h index e86ba2661c051..4385443e7406c 100644 --- a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_tracing_connection.h +++ b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_health_check_services_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionHealthCheckServicesTracingConnection : public compute_region_health_check_services_v1:: RegionHealthCheckServicesConnection { @@ -102,8 +100,6 @@ class RegionHealthCheckServicesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_health_check_services/v1/region_health_check_services_connection.h b/google/cloud/compute/region_health_check_services/v1/region_health_check_services_connection.h index 38c21a6c89064..af3889b1f8351 100644 --- a/google/cloud/compute/region_health_check_services/v1/region_health_check_services_connection.h +++ b/google/cloud/compute/region_health_check_services/v1/region_health_check_services_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECK_SERVICES_V1_REGION_HEALTH_CHECK_SERVICES_CONNECTION_H #include "google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_retry_traits.h" +#include "google/cloud/compute/region_health_check_services/v1/region_health_check_services.pb.h" #include "google/cloud/compute/region_health_check_services/v1/region_health_check_services_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_health_check_services/v1/region_health_check_services_connection_idempotency_policy.h b/google/cloud/compute/region_health_check_services/v1/region_health_check_services_connection_idempotency_policy.h index 6a469b7642189..cfda50f881cbf 100644 --- a/google/cloud/compute/region_health_check_services/v1/region_health_check_services_connection_idempotency_policy.h +++ b/google/cloud/compute/region_health_check_services/v1/region_health_check_services_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECK_SERVICES_V1_REGION_HEALTH_CHECK_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECK_SERVICES_V1_REGION_HEALTH_CHECK_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_health_check_services/v1/region_health_check_services.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_health_check_services/v1/region_health_check_services_proto_export.h b/google/cloud/compute/region_health_check_services/v1/region_health_check_services_proto_export.h index 13f7a165a4f43..6ecb9638ff449 100644 --- a/google/cloud/compute/region_health_check_services/v1/region_health_check_services_proto_export.h +++ b/google/cloud/compute/region_health_check_services/v1/region_health_check_services_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECK_SERVICES_V1_REGION_HEALTH_CHECK_SERVICES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_050.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECK_SERVICES_V1_REGION_HEALTH_CHECK_SERVICES_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_option_defaults.cc b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_option_defaults.cc index 9503bf74202f7..616a5e0a1d46f 100644 --- a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_option_defaults.cc +++ b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_option_defaults.cc @@ -45,7 +45,7 @@ Options RegionHealthChecksDefaultOptions(Options options) { options.set< compute_region_health_checks_v1::RegionHealthChecksRetryPolicyOption>( compute_region_health_checks_v1:: - RegionHealthChecksLimitedTimeRetryPolicy(std::chrono::minutes(30)) + RegionHealthChecksLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_logging_decorator.h b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_logging_decorator.h index 7a24eefb2a5ad..a7bb9261e8593 100644 --- a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_logging_decorator.h +++ b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_logging_decorator.h @@ -21,12 +21,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECKS_V1_INTERNAL_REGION_HEALTH_CHECKS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.h" +#include "google/cloud/compute/region_health_checks/v1/region_health_checks.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_metadata_decorator.cc b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_metadata_decorator.cc index 96703ba31c31d..01a0600afff61 100644 --- a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_health_checks/v1/region_health_checks.proto #include "google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_metadata_decorator.h b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_metadata_decorator.h index 57074cc3a495d..659d15aabdd1c 100644 --- a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_metadata_decorator.h +++ b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_metadata_decorator.h @@ -21,11 +21,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECKS_V1_INTERNAL_REGION_HEALTH_CHECKS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.h" +#include "google/cloud/compute/region_health_checks/v1/region_health_checks.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.cc b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.cc index 9f3650216197a..a14d569c5df0c 100644 --- a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.cc +++ b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_health_checks/v1/region_health_checks.proto #include "google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.h" +#include "google/cloud/compute/region_health_checks/v1/region_health_checks.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.h b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.h index 2fbd07f3c69dd..43bc9934e03c0 100644 --- a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.h +++ b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECKS_V1_INTERNAL_REGION_HEALTH_CHECKS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECKS_V1_INTERNAL_REGION_HEALTH_CHECKS_REST_STUB_H +#include "google/cloud/compute/region_health_checks/v1/region_health_checks.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_tracing_connection.cc b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_tracing_connection.cc index cb70f4c7f5652..de5360789d69a 100644 --- a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_tracing_connection.cc +++ b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_health_checks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionHealthChecksTracingConnection::RegionHealthChecksTracingConnection( std::shared_ptr< compute_region_health_checks_v1::RegionHealthChecksConnection> @@ -197,19 +195,15 @@ RegionHealthChecksTracingConnection::UpdateHealthCheck( child_->UpdateHealthCheck(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegionHealthChecksTracingConnection( std::shared_ptr< compute_region_health_checks_v1::RegionHealthChecksConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_tracing_connection.h b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_tracing_connection.h index f30add004db7c..ed58f596b6f06 100644 --- a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_tracing_connection.h +++ b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_health_checks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionHealthChecksTracingConnection : public compute_region_health_checks_v1::RegionHealthChecksConnection { public: @@ -103,8 +101,6 @@ class RegionHealthChecksTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_health_checks/v1/region_health_checks_connection.h b/google/cloud/compute/region_health_checks/v1/region_health_checks_connection.h index c4d6ae18dc95f..f97036dcd60b0 100644 --- a/google/cloud/compute/region_health_checks/v1/region_health_checks_connection.h +++ b/google/cloud/compute/region_health_checks/v1/region_health_checks_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECKS_V1_REGION_HEALTH_CHECKS_CONNECTION_H #include "google/cloud/compute/region_health_checks/v1/internal/region_health_checks_retry_traits.h" +#include "google/cloud/compute/region_health_checks/v1/region_health_checks.pb.h" #include "google/cloud/compute/region_health_checks/v1/region_health_checks_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_health_checks/v1/region_health_checks_connection_idempotency_policy.h b/google/cloud/compute/region_health_checks/v1/region_health_checks_connection_idempotency_policy.h index 3c4e68e4df5af..2b81e53261701 100644 --- a/google/cloud/compute/region_health_checks/v1/region_health_checks_connection_idempotency_policy.h +++ b/google/cloud/compute/region_health_checks/v1/region_health_checks_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECKS_V1_REGION_HEALTH_CHECKS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECKS_V1_REGION_HEALTH_CHECKS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_health_checks/v1/region_health_checks.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_health_checks/v1/region_health_checks_proto_export.h b/google/cloud/compute/region_health_checks/v1/region_health_checks_proto_export.h index 4a437f28c7f24..31816f7f7222a 100644 --- a/google/cloud/compute/region_health_checks/v1/region_health_checks_proto_export.h +++ b/google/cloud/compute/region_health_checks/v1/region_health_checks_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECKS_V1_REGION_HEALTH_CHECKS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_043.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_HEALTH_CHECKS_V1_REGION_HEALTH_CHECKS_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_option_defaults.cc b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_option_defaults.cc index 1f922ea910892..27c19c391ca38 100644 --- a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_option_defaults.cc +++ b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_option_defaults.cc @@ -47,7 +47,7 @@ Options RegionInstanceGroupManagersDefaultOptions(Options options) { RegionInstanceGroupManagersRetryPolicyOption>( compute_region_instance_group_managers_v1:: RegionInstanceGroupManagersLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_logging_decorator.h b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_logging_decorator.h index 510f72198a7c1..aaf5ed8ffdb20 100644 --- a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_logging_decorator.h +++ b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_logging_decorator.h @@ -21,12 +21,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUP_MANAGERS_V1_INTERNAL_REGION_INSTANCE_GROUP_MANAGERS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.h" +#include "google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_metadata_decorator.cc b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_metadata_decorator.cc index 381a17a757fb1..99738471d8f24 100644 --- a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers.proto #include "google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_metadata_decorator.h b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_metadata_decorator.h index 119526b877143..2b297b4850c8c 100644 --- a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_metadata_decorator.h +++ b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_metadata_decorator.h @@ -21,11 +21,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUP_MANAGERS_V1_INTERNAL_REGION_INSTANCE_GROUP_MANAGERS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.h" +#include "google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.cc b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.cc index 461e1eb05d79d..298543db9c1d5 100644 --- a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.cc +++ b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers.proto #include "google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.h" +#include "google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.h b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.h index 14babb7f4b35a..1eb90909520ba 100644 --- a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.h +++ b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUP_MANAGERS_V1_INTERNAL_REGION_INSTANCE_GROUP_MANAGERS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUP_MANAGERS_V1_INTERNAL_REGION_INSTANCE_GROUP_MANAGERS_REST_STUB_H +#include "google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_tracing_connection.cc b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_tracing_connection.cc index e98d43b002f59..faa34535df4ba 100644 --- a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_tracing_connection.cc +++ b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_instance_group_managers_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionInstanceGroupManagersTracingConnection:: RegionInstanceGroupManagersTracingConnection( std::shared_ptrUpdatePerInstanceConfigs(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegionInstanceGroupManagersTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_tracing_connection.h b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_tracing_connection.h index 6fc7c181fe055..024596a8480b8 100644 --- a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_tracing_connection.h +++ b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_instance_group_managers_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionInstanceGroupManagersTracingConnection : public compute_region_instance_group_managers_v1:: RegionInstanceGroupManagersConnection { @@ -301,8 +299,6 @@ class RegionInstanceGroupManagersTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers_connection.h b/google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers_connection.h index ab8a55e081bb7..fe533657c8b4f 100644 --- a/google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers_connection.h +++ b/google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUP_MANAGERS_V1_REGION_INSTANCE_GROUP_MANAGERS_CONNECTION_H #include "google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_retry_traits.h" +#include "google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers.pb.h" #include "google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers_connection_idempotency_policy.h b/google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers_connection_idempotency_policy.h index 1526d304648be..9e96c2de407c6 100644 --- a/google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers_connection_idempotency_policy.h +++ b/google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUP_MANAGERS_V1_REGION_INSTANCE_GROUP_MANAGERS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUP_MANAGERS_V1_REGION_INSTANCE_GROUP_MANAGERS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers_proto_export.h b/google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers_proto_export.h index a15454a4e20b0..6c0131758eb73 100644 --- a/google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers_proto_export.h +++ b/google/cloud/compute/region_instance_group_managers/v1/region_instance_group_managers_proto_export.h @@ -26,11 +26,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUP_MANAGERS_V1_REGION_INSTANCE_GROUP_MANAGERS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_028.pb.h" +#include "google/cloud/compute/v1/internal/common_040.pb.h" +#include "google/cloud/compute/v1/internal/common_083.pb.h" +#include "google/cloud/compute/v1/internal/common_104.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUP_MANAGERS_V1_REGION_INSTANCE_GROUP_MANAGERS_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_option_defaults.cc b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_option_defaults.cc index 1c1410144bb80..55d9471e995d9 100644 --- a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_option_defaults.cc +++ b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_option_defaults.cc @@ -45,7 +45,7 @@ Options RegionInstanceGroupsDefaultOptions(Options options) { options.set( compute_region_instance_groups_v1:: - RegionInstanceGroupsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + RegionInstanceGroupsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_logging_decorator.h b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_logging_decorator.h index 6ccabc4d85b09..4f1eeb87ad946 100644 --- a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_logging_decorator.h +++ b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_logging_decorator.h @@ -21,12 +21,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUPS_V1_INTERNAL_REGION_INSTANCE_GROUPS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.h" +#include "google/cloud/compute/region_instance_groups/v1/region_instance_groups.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_metadata_decorator.cc b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_metadata_decorator.cc index c6030b7ba99f2..6842dabeeb6c4 100644 --- a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_instance_groups/v1/region_instance_groups.proto #include "google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_metadata_decorator.h b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_metadata_decorator.h index 3988c56a24e0d..ca8f31e0721e7 100644 --- a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_metadata_decorator.h +++ b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_metadata_decorator.h @@ -21,11 +21,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUPS_V1_INTERNAL_REGION_INSTANCE_GROUPS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.h" +#include "google/cloud/compute/region_instance_groups/v1/region_instance_groups.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.cc b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.cc index c0d90241f54fd..ef666e695badb 100644 --- a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.cc +++ b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_instance_groups/v1/region_instance_groups.proto #include "google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.h" +#include "google/cloud/compute/region_instance_groups/v1/region_instance_groups.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.h b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.h index 47874ed90ada9..3adbce621927b 100644 --- a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.h +++ b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUPS_V1_INTERNAL_REGION_INSTANCE_GROUPS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUPS_V1_INTERNAL_REGION_INSTANCE_GROUPS_REST_STUB_H +#include "google/cloud/compute/region_instance_groups/v1/region_instance_groups.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_tracing_connection.cc b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_tracing_connection.cc index 9dd70d5cca64b..b6772a08d0e94 100644 --- a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_tracing_connection.cc +++ b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_instance_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionInstanceGroupsTracingConnection::RegionInstanceGroupsTracingConnection( std::shared_ptr< compute_region_instance_groups_v1::RegionInstanceGroupsConnection> @@ -107,20 +105,16 @@ RegionInstanceGroupsTracingConnection::SetNamedPorts( return internal::EndSpan(std::move(span), child_->SetNamedPorts(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_region_instance_groups_v1::RegionInstanceGroupsConnection> MakeRegionInstanceGroupsTracingConnection( std::shared_ptr< compute_region_instance_groups_v1::RegionInstanceGroupsConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_tracing_connection.h b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_tracing_connection.h index d330ef6103090..b938be2124e93 100644 --- a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_tracing_connection.h +++ b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_instance_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionInstanceGroupsTracingConnection : public compute_region_instance_groups_v1::RegionInstanceGroupsConnection { public: @@ -73,8 +71,6 @@ class RegionInstanceGroupsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_instance_groups/v1/region_instance_groups_connection.h b/google/cloud/compute/region_instance_groups/v1/region_instance_groups_connection.h index c2586ee09b8aa..4f674000595ec 100644 --- a/google/cloud/compute/region_instance_groups/v1/region_instance_groups_connection.h +++ b/google/cloud/compute/region_instance_groups/v1/region_instance_groups_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUPS_V1_REGION_INSTANCE_GROUPS_CONNECTION_H #include "google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_retry_traits.h" +#include "google/cloud/compute/region_instance_groups/v1/region_instance_groups.pb.h" #include "google/cloud/compute/region_instance_groups/v1/region_instance_groups_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_instance_groups/v1/region_instance_groups_connection_idempotency_policy.h b/google/cloud/compute/region_instance_groups/v1/region_instance_groups_connection_idempotency_policy.h index 519e25253cf6e..d2002fc52f5d9 100644 --- a/google/cloud/compute/region_instance_groups/v1/region_instance_groups_connection_idempotency_policy.h +++ b/google/cloud/compute/region_instance_groups/v1/region_instance_groups_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUPS_V1_REGION_INSTANCE_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUPS_V1_REGION_INSTANCE_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_instance_groups/v1/region_instance_groups.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_instance_groups/v1/region_instance_groups_proto_export.h b/google/cloud/compute/region_instance_groups/v1/region_instance_groups_proto_export.h index 30f7cb2d984c1..4d1785ab2e343 100644 --- a/google/cloud/compute/region_instance_groups/v1/region_instance_groups_proto_export.h +++ b/google/cloud/compute/region_instance_groups/v1/region_instance_groups_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUPS_V1_REGION_INSTANCE_GROUPS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_059.pb.h" +#include "google/cloud/compute/v1/internal/common_083.pb.h" +#include "google/cloud/compute/v1/internal/common_103.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_GROUPS_V1_REGION_INSTANCE_GROUPS_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_option_defaults.cc b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_option_defaults.cc index cda2d70a9c9e7..19a18f4e520d2 100644 --- a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_option_defaults.cc +++ b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_option_defaults.cc @@ -46,7 +46,7 @@ Options RegionInstanceTemplatesDefaultOptions(Options options) { RegionInstanceTemplatesRetryPolicyOption>( compute_region_instance_templates_v1:: RegionInstanceTemplatesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_logging_decorator.h b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_logging_decorator.h index 347a9b031dd4b..3e50e1c683d5f 100644 --- a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_logging_decorator.h +++ b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_logging_decorator.h @@ -21,12 +21,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_TEMPLATES_V1_INTERNAL_REGION_INSTANCE_TEMPLATES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.h" +#include "google/cloud/compute/region_instance_templates/v1/region_instance_templates.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_metadata_decorator.cc b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_metadata_decorator.cc index d52ea5af6d98d..ffb3c1f3fdb5f 100644 --- a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_instance_templates/v1/region_instance_templates.proto #include "google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_metadata_decorator.h b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_metadata_decorator.h index d2c780b1807e2..b780da0f6eb87 100644 --- a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_metadata_decorator.h +++ b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_metadata_decorator.h @@ -21,11 +21,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_TEMPLATES_V1_INTERNAL_REGION_INSTANCE_TEMPLATES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.h" +#include "google/cloud/compute/region_instance_templates/v1/region_instance_templates.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.cc b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.cc index 83438f4fb4cd9..4e29be2d70722 100644 --- a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.cc +++ b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_instance_templates/v1/region_instance_templates.proto #include "google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.h" +#include "google/cloud/compute/region_instance_templates/v1/region_instance_templates.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.h b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.h index a43f580905f17..d8e83f0c49138 100644 --- a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.h +++ b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_TEMPLATES_V1_INTERNAL_REGION_INSTANCE_TEMPLATES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_TEMPLATES_V1_INTERNAL_REGION_INSTANCE_TEMPLATES_REST_STUB_H +#include "google/cloud/compute/region_instance_templates/v1/region_instance_templates.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_tracing_connection.cc b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_tracing_connection.cc index 891d7268f7dac..2be0f27f6de40 100644 --- a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_tracing_connection.cc +++ b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_instance_templates_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionInstanceTemplatesTracingConnection:: RegionInstanceTemplatesTracingConnection( std::shared_ptr MakeRegionInstanceTemplatesTracingConnection( std::shared_ptr< compute_region_instance_templates_v1::RegionInstanceTemplatesConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_tracing_connection.h b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_tracing_connection.h index 59ac012eb1475..06b1bf44432c1 100644 --- a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_tracing_connection.h +++ b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_instance_templates_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionInstanceTemplatesTracingConnection : public compute_region_instance_templates_v1:: RegionInstanceTemplatesConnection { @@ -86,8 +84,6 @@ class RegionInstanceTemplatesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_instance_templates/v1/region_instance_templates_connection.h b/google/cloud/compute/region_instance_templates/v1/region_instance_templates_connection.h index 6be30c80ced53..b38d16ffd9021 100644 --- a/google/cloud/compute/region_instance_templates/v1/region_instance_templates_connection.h +++ b/google/cloud/compute/region_instance_templates/v1/region_instance_templates_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_TEMPLATES_V1_REGION_INSTANCE_TEMPLATES_CONNECTION_H #include "google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_retry_traits.h" +#include "google/cloud/compute/region_instance_templates/v1/region_instance_templates.pb.h" #include "google/cloud/compute/region_instance_templates/v1/region_instance_templates_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_instance_templates/v1/region_instance_templates_connection_idempotency_policy.h b/google/cloud/compute/region_instance_templates/v1/region_instance_templates_connection_idempotency_policy.h index 511ed02697a01..7675b61136356 100644 --- a/google/cloud/compute/region_instance_templates/v1/region_instance_templates_connection_idempotency_policy.h +++ b/google/cloud/compute/region_instance_templates/v1/region_instance_templates_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_TEMPLATES_V1_REGION_INSTANCE_TEMPLATES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_TEMPLATES_V1_REGION_INSTANCE_TEMPLATES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_instance_templates/v1/region_instance_templates.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_instance_templates/v1/region_instance_templates_proto_export.h b/google/cloud/compute/region_instance_templates/v1/region_instance_templates_proto_export.h index 98789c49a7a5b..dcfd45d71cbce 100644 --- a/google/cloud/compute/region_instance_templates/v1/region_instance_templates_proto_export.h +++ b/google/cloud/compute/region_instance_templates/v1/region_instance_templates_proto_export.h @@ -26,14 +26,14 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_TEMPLATES_V1_REGION_INSTANCE_TEMPLATES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_001.pb.h" +#include "google/cloud/compute/v1/internal/common_003.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_021.pb.h" +#include "google/cloud/compute/v1/internal/common_024.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_033.pb.h" +#include "google/cloud/compute/v1/internal/common_081.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCE_TEMPLATES_V1_REGION_INSTANCE_TEMPLATES_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_instances/v1/internal/region_instances_option_defaults.cc b/google/cloud/compute/region_instances/v1/internal/region_instances_option_defaults.cc index f0e6cf810eaba..0ce79ef880960 100644 --- a/google/cloud/compute/region_instances/v1/internal/region_instances_option_defaults.cc +++ b/google/cloud/compute/region_instances/v1/internal/region_instances_option_defaults.cc @@ -42,7 +42,7 @@ Options RegionInstancesDefaultOptions(Options options) { compute_region_instances_v1::RegionInstancesRetryPolicyOption>()) { options.set( compute_region_instances_v1::RegionInstancesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/compute/region_instances/v1/internal/region_instances_rest_connection_impl.h b/google/cloud/compute/region_instances/v1/internal/region_instances_rest_connection_impl.h index 7fdd4e30cde97..99656c48da093 100644 --- a/google/cloud/compute/region_instances/v1/internal/region_instances_rest_connection_impl.h +++ b/google/cloud/compute/region_instances/v1/internal/region_instances_rest_connection_impl.h @@ -24,12 +24,12 @@ #include "google/cloud/compute/region_instances/v1/region_instances_connection.h" #include "google/cloud/compute/region_instances/v1/region_instances_connection_idempotency_policy.h" #include "google/cloud/compute/region_instances/v1/region_instances_options.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.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/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_instances/v1/internal/region_instances_rest_logging_decorator.h b/google/cloud/compute/region_instances/v1/internal/region_instances_rest_logging_decorator.h index 72f1397f28770..35047d264517b 100644 --- a/google/cloud/compute/region_instances/v1/internal/region_instances_rest_logging_decorator.h +++ b/google/cloud/compute/region_instances/v1/internal/region_instances_rest_logging_decorator.h @@ -20,12 +20,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCES_V1_INTERNAL_REGION_INSTANCES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.h" +#include "google/cloud/compute/region_instances/v1/region_instances.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_instances/v1/internal/region_instances_rest_metadata_decorator.cc b/google/cloud/compute/region_instances/v1/internal/region_instances_rest_metadata_decorator.cc index 5f4d3c4975f17..6b04c59491478 100644 --- a/google/cloud/compute/region_instances/v1/internal/region_instances_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_instances/v1/internal/region_instances_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/region_instances/v1/region_instances.proto #include "google/cloud/compute/region_instances/v1/internal/region_instances_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_instances/v1/internal/region_instances_rest_metadata_decorator.h b/google/cloud/compute/region_instances/v1/internal/region_instances_rest_metadata_decorator.h index aabd7730761dc..2a169ef765a96 100644 --- a/google/cloud/compute/region_instances/v1/internal/region_instances_rest_metadata_decorator.h +++ b/google/cloud/compute/region_instances/v1/internal/region_instances_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCES_V1_INTERNAL_REGION_INSTANCES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.h" +#include "google/cloud/compute/region_instances/v1/region_instances.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.cc b/google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.cc index 1b1348fff5a94..08f2304c1559b 100644 --- a/google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.cc +++ b/google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/region_instances/v1/region_instances.proto #include "google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.h" +#include "google/cloud/compute/region_instances/v1/region_instances.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.h b/google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.h index 6ef14264de647..99bd1076ce7e1 100644 --- a/google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.h +++ b/google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCES_V1_INTERNAL_REGION_INSTANCES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCES_V1_INTERNAL_REGION_INSTANCES_REST_STUB_H +#include "google/cloud/compute/region_instances/v1/region_instances.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_instances/v1/internal/region_instances_tracing_connection.cc b/google/cloud/compute/region_instances/v1/internal/region_instances_tracing_connection.cc index 0efa1b72a8631..32813d7b98b17 100644 --- a/google/cloud/compute/region_instances/v1/internal/region_instances_tracing_connection.cc +++ b/google/cloud/compute/region_instances/v1/internal/region_instances_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace compute_region_instances_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionInstancesTracingConnection::RegionInstancesTracingConnection( std::shared_ptr child) @@ -63,17 +61,13 @@ RegionInstancesTracingConnection::BulkInsert( return internal::EndSpan(std::move(span), child_->BulkInsert(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegionInstancesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_instances/v1/internal/region_instances_tracing_connection.h b/google/cloud/compute/region_instances/v1/internal/region_instances_tracing_connection.h index 76fb4a3c1a356..c7106ccf5ad23 100644 --- a/google/cloud/compute/region_instances/v1/internal/region_instances_tracing_connection.h +++ b/google/cloud/compute/region_instances/v1/internal/region_instances_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_instances_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionInstancesTracingConnection : public compute_region_instances_v1::RegionInstancesConnection { public: @@ -57,8 +55,6 @@ class RegionInstancesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_instances/v1/region_instances_connection.h b/google/cloud/compute/region_instances/v1/region_instances_connection.h index c1571fc93186e..52d8215f7601c 100644 --- a/google/cloud/compute/region_instances/v1/region_instances_connection.h +++ b/google/cloud/compute/region_instances/v1/region_instances_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCES_V1_REGION_INSTANCES_CONNECTION_H #include "google/cloud/compute/region_instances/v1/internal/region_instances_retry_traits.h" +#include "google/cloud/compute/region_instances/v1/region_instances.pb.h" #include "google/cloud/compute/region_instances/v1/region_instances_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -29,7 +30,6 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_instances/v1/region_instances_connection_idempotency_policy.h b/google/cloud/compute/region_instances/v1/region_instances_connection_idempotency_policy.h index fd7e2555f0d55..1ac8c327f5aa3 100644 --- a/google/cloud/compute/region_instances/v1/region_instances_connection_idempotency_policy.h +++ b/google/cloud/compute/region_instances/v1/region_instances_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCES_V1_REGION_INSTANCES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCES_V1_REGION_INSTANCES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_instances/v1/region_instances.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_instances/v1/region_instances_proto_export.h b/google/cloud/compute/region_instances/v1/region_instances_proto_export.h index 70812da9a58fa..d80a7bdcbaec8 100644 --- a/google/cloud/compute/region_instances/v1/region_instances_proto_export.h +++ b/google/cloud/compute/region_instances/v1/region_instances_proto_export.h @@ -26,14 +26,14 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCES_V1_REGION_INSTANCES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_001.pb.h" +#include "google/cloud/compute/v1/internal/common_003.pb.h" +#include "google/cloud/compute/v1/internal/common_015.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_021.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_033.pb.h" +#include "google/cloud/compute/v1/internal/common_081.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANCES_V1_REGION_INSTANCES_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_option_defaults.cc b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_option_defaults.cc index 305cfaced0983..4d7464d723037 100644 --- a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_option_defaults.cc +++ b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_option_defaults.cc @@ -46,7 +46,7 @@ Options RegionInstantSnapshotsDefaultOptions(Options options) { RegionInstantSnapshotsRetryPolicyOption>( compute_region_instant_snapshots_v1:: RegionInstantSnapshotsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_logging_decorator.h b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_logging_decorator.h index 6cb5f53f8b338..4549881263db8 100644 --- a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_logging_decorator.h +++ b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_logging_decorator.h @@ -21,12 +21,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANT_SNAPSHOTS_V1_INTERNAL_REGION_INSTANT_SNAPSHOTS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_stub.h" +#include "google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_metadata_decorator.cc b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_metadata_decorator.cc index 2a8ddfe69817a..32d24562a5eba 100644 --- a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots.proto #include "google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_metadata_decorator.h b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_metadata_decorator.h index 5eb3dd1942a86..cbba5fd972294 100644 --- a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_metadata_decorator.h +++ b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_metadata_decorator.h @@ -21,11 +21,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANT_SNAPSHOTS_V1_INTERNAL_REGION_INSTANT_SNAPSHOTS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_stub.h" +#include "google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_stub.cc b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_stub.cc index db95810560da9..33b77c91afe1a 100644 --- a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_stub.cc +++ b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots.proto #include "google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_stub.h" +#include "google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_stub.h b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_stub.h index 56b65c0da5f5c..02eb11ae742fb 100644 --- a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_stub.h +++ b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANT_SNAPSHOTS_V1_INTERNAL_REGION_INSTANT_SNAPSHOTS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANT_SNAPSHOTS_V1_INTERNAL_REGION_INSTANT_SNAPSHOTS_REST_STUB_H +#include "google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_tracing_connection.cc b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_tracing_connection.cc index 22ef4a8f86a1e..fe968db893167 100644 --- a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_tracing_connection.cc +++ b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_instant_snapshots_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionInstantSnapshotsTracingConnection:: RegionInstantSnapshotsTracingConnection( std::shared_ptrTestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_region_instant_snapshots_v1::RegionInstantSnapshotsConnection> MakeRegionInstantSnapshotsTracingConnection( std::shared_ptr< compute_region_instant_snapshots_v1::RegionInstantSnapshotsConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_tracing_connection.h b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_tracing_connection.h index 331394e917294..b57b60df77c88 100644 --- a/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_tracing_connection.h +++ b/google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_instant_snapshots_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionInstantSnapshotsTracingConnection : public compute_region_instant_snapshots_v1:: RegionInstantSnapshotsConnection { @@ -108,8 +106,6 @@ class RegionInstantSnapshotsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots_connection.h b/google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots_connection.h index fcbf100d61250..62cb69203513f 100644 --- a/google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots_connection.h +++ b/google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANT_SNAPSHOTS_V1_REGION_INSTANT_SNAPSHOTS_CONNECTION_H #include "google/cloud/compute/region_instant_snapshots/v1/internal/region_instant_snapshots_retry_traits.h" +#include "google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots.pb.h" #include "google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots_connection_idempotency_policy.h b/google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots_connection_idempotency_policy.h index f9b1f3359ba5d..4e26507123edf 100644 --- a/google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots_connection_idempotency_policy.h +++ b/google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANT_SNAPSHOTS_V1_REGION_INSTANT_SNAPSHOTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANT_SNAPSHOTS_V1_REGION_INSTANT_SNAPSHOTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots_proto_export.h b/google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots_proto_export.h index e8c81feeeb5b6..1bbe01062fe9c 100644 --- a/google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots_proto_export.h +++ b/google/cloud/compute/region_instant_snapshots/v1/region_instant_snapshots_proto_export.h @@ -26,13 +26,13 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANT_SNAPSHOTS_V1_REGION_INSTANT_SNAPSHOTS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_066.pb.h" +#include "google/cloud/compute/v1/internal/common_107.pb.h" +#include "google/cloud/compute/v1/internal/common_108.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_INSTANT_SNAPSHOTS_V1_REGION_INSTANT_SNAPSHOTS_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_option_defaults.cc b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_option_defaults.cc index c6d49ba053220..7a5aca2eea7ae 100644 --- a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_option_defaults.cc +++ b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_option_defaults.cc @@ -47,7 +47,7 @@ Options RegionNetworkEndpointGroupsDefaultOptions(Options options) { RegionNetworkEndpointGroupsRetryPolicyOption>( compute_region_network_endpoint_groups_v1:: RegionNetworkEndpointGroupsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_logging_decorator.h b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_logging_decorator.h index 1629b48b61701..a5b91e13ab7a3 100644 --- a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_logging_decorator.h +++ b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_logging_decorator.h @@ -21,12 +21,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_ENDPOINT_GROUPS_V1_INTERNAL_REGION_NETWORK_ENDPOINT_GROUPS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.h" +#include "google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_metadata_decorator.cc b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_metadata_decorator.cc index 0f553602713ef..a83581d7b594d 100644 --- a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups.proto #include "google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_metadata_decorator.h b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_metadata_decorator.h index 60dd9b0398816..3f1eb58cf087b 100644 --- a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_metadata_decorator.h +++ b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_metadata_decorator.h @@ -21,11 +21,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_ENDPOINT_GROUPS_V1_INTERNAL_REGION_NETWORK_ENDPOINT_GROUPS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.h" +#include "google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.cc b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.cc index 8a25dae5f4cab..c7fc9dac250b5 100644 --- a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.cc +++ b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups.proto #include "google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.h" +#include "google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.h b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.h index 837b9fbef1366..a085cb8df0d1b 100644 --- a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.h +++ b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_ENDPOINT_GROUPS_V1_INTERNAL_REGION_NETWORK_ENDPOINT_GROUPS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_ENDPOINT_GROUPS_V1_INTERNAL_REGION_NETWORK_ENDPOINT_GROUPS_REST_STUB_H +#include "google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_tracing_connection.cc b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_tracing_connection.cc index 3d5b9fb0a7db2..a5b360e840b79 100644 --- a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_tracing_connection.cc +++ b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_network_endpoint_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionNetworkEndpointGroupsTracingConnection:: RegionNetworkEndpointGroupsTracingConnection( std::shared_ptr MakeRegionNetworkEndpointGroupsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_tracing_connection.h b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_tracing_connection.h index 90d32a22d22d8..e7cb4c8ba8ccb 100644 --- a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_tracing_connection.h +++ b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_network_endpoint_groups_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionNetworkEndpointGroupsTracingConnection : public compute_region_network_endpoint_groups_v1:: RegionNetworkEndpointGroupsConnection { @@ -123,8 +121,6 @@ class RegionNetworkEndpointGroupsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups_connection.h b/google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups_connection.h index 65b1af822ef2c..e17d51fa1b18b 100644 --- a/google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups_connection.h +++ b/google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_ENDPOINT_GROUPS_V1_REGION_NETWORK_ENDPOINT_GROUPS_CONNECTION_H #include "google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_retry_traits.h" +#include "google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups.pb.h" #include "google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups_connection_idempotency_policy.h b/google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups_connection_idempotency_policy.h index edc2c52269283..95a817d926c44 100644 --- a/google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups_connection_idempotency_policy.h +++ b/google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_ENDPOINT_GROUPS_V1_REGION_NETWORK_ENDPOINT_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_ENDPOINT_GROUPS_V1_REGION_NETWORK_ENDPOINT_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups_proto_export.h b/google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups_proto_export.h index e5477f91040b2..6e5138a5e1c7f 100644 --- a/google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups_proto_export.h +++ b/google/cloud/compute/region_network_endpoint_groups/v1/region_network_endpoint_groups_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_ENDPOINT_GROUPS_V1_REGION_NETWORK_ENDPOINT_GROUPS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_012.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_049.pb.h" +#include "google/cloud/compute/v1/internal/common_105.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_ENDPOINT_GROUPS_V1_REGION_NETWORK_ENDPOINT_GROUPS_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_option_defaults.cc b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_option_defaults.cc index 51aa9a2cb5f84..4a00e8210de0a 100644 --- a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_option_defaults.cc +++ b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_option_defaults.cc @@ -47,7 +47,7 @@ Options RegionNetworkFirewallPoliciesDefaultOptions(Options options) { RegionNetworkFirewallPoliciesRetryPolicyOption>( compute_region_network_firewall_policies_v1:: RegionNetworkFirewallPoliciesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_logging_decorator.h b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_logging_decorator.h index 5cc0408569f4d..c54d0bbac6b44 100644 --- a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_logging_decorator.h +++ b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_logging_decorator.h @@ -21,12 +21,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_FIREWALL_POLICIES_V1_INTERNAL_REGION_NETWORK_FIREWALL_POLICIES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.h" +#include "google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_metadata_decorator.cc b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_metadata_decorator.cc index 999fc19498f67..a26ab2ab58381 100644 --- a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies.proto #include "google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_metadata_decorator.h b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_metadata_decorator.h index b0b7d59b7b2ae..74d186d0bd399 100644 --- a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_metadata_decorator.h +++ b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_metadata_decorator.h @@ -21,11 +21,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_FIREWALL_POLICIES_V1_INTERNAL_REGION_NETWORK_FIREWALL_POLICIES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.h" +#include "google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.cc b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.cc index def7c0c3c64bf..8c4b2954d601d 100644 --- a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.cc +++ b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies.proto #include "google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.h" +#include "google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.h b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.h index 2fe963e5da0ab..6846c3a013a23 100644 --- a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.h +++ b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_FIREWALL_POLICIES_V1_INTERNAL_REGION_NETWORK_FIREWALL_POLICIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_FIREWALL_POLICIES_V1_INTERNAL_REGION_NETWORK_FIREWALL_POLICIES_REST_STUB_H +#include "google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_tracing_connection.cc b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_tracing_connection.cc index 07833d6e9c957..747ca7fe4641e 100644 --- a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_tracing_connection.cc +++ b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_network_firewall_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionNetworkFirewallPoliciesTracingConnection:: RegionNetworkFirewallPoliciesTracingConnection( std::shared_ptrTestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegionNetworkFirewallPoliciesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_tracing_connection.h b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_tracing_connection.h index a6d88540b935b..a4aac5082683c 100644 --- a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_tracing_connection.h +++ b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_network_firewall_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionNetworkFirewallPoliciesTracingConnection : public compute_region_network_firewall_policies_v1:: RegionNetworkFirewallPoliciesConnection { @@ -202,8 +200,6 @@ class RegionNetworkFirewallPoliciesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies_connection.h b/google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies_connection.h index 4ed7837008e41..0106ca9ebc1da 100644 --- a/google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies_connection.h +++ b/google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_FIREWALL_POLICIES_V1_REGION_NETWORK_FIREWALL_POLICIES_CONNECTION_H #include "google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_retry_traits.h" +#include "google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies.pb.h" #include "google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies_connection_idempotency_policy.h b/google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies_connection_idempotency_policy.h index ac1b9d0c34140..4137bfaabfce7 100644 --- a/google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies_connection_idempotency_policy.h +++ b/google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_FIREWALL_POLICIES_V1_REGION_NETWORK_FIREWALL_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_FIREWALL_POLICIES_V1_REGION_NETWORK_FIREWALL_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies_proto_export.h b/google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies_proto_export.h index 85ed79a883758..e46e7cb4a6351 100644 --- a/google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies_proto_export.h +++ b/google/cloud/compute/region_network_firewall_policies/v1/region_network_firewall_policies_proto_export.h @@ -26,15 +26,15 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_FIREWALL_POLICIES_V1_REGION_NETWORK_FIREWALL_POLICIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_034.pb.h" +#include "google/cloud/compute/v1/internal/common_038.pb.h" +#include "google/cloud/compute/v1/internal/common_039.pb.h" +#include "google/cloud/compute/v1/internal/common_106.pb.h" +#include "google/cloud/compute/v1/internal/common_108.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NETWORK_FIREWALL_POLICIES_V1_REGION_NETWORK_FIREWALL_POLICIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_option_defaults.cc b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_option_defaults.cc index 200948123d1b7..bc2bc4e94e2cf 100644 --- a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_option_defaults.cc +++ b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_option_defaults.cc @@ -47,7 +47,7 @@ Options RegionNotificationEndpointsDefaultOptions(Options options) { RegionNotificationEndpointsRetryPolicyOption>( compute_region_notification_endpoints_v1:: RegionNotificationEndpointsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_logging_decorator.h b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_logging_decorator.h index 7e902b7049fb7..5f2f1501ee2e5 100644 --- a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_logging_decorator.h +++ b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_logging_decorator.h @@ -21,12 +21,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NOTIFICATION_ENDPOINTS_V1_INTERNAL_REGION_NOTIFICATION_ENDPOINTS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.h" +#include "google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_metadata_decorator.cc b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_metadata_decorator.cc index 91270b5a1abea..08a4d93c5b81a 100644 --- a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints.proto #include "google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_metadata_decorator.h b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_metadata_decorator.h index 924e3a7dc623b..d149fd3e3fa23 100644 --- a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_metadata_decorator.h +++ b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_metadata_decorator.h @@ -21,11 +21,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NOTIFICATION_ENDPOINTS_V1_INTERNAL_REGION_NOTIFICATION_ENDPOINTS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.h" +#include "google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.cc b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.cc index bc6635cdd1cc7..e6767501d82cd 100644 --- a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.cc +++ b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints.proto #include "google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.h" +#include "google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.h b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.h index 574e758373f81..ceb581c607627 100644 --- a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.h +++ b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NOTIFICATION_ENDPOINTS_V1_INTERNAL_REGION_NOTIFICATION_ENDPOINTS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NOTIFICATION_ENDPOINTS_V1_INTERNAL_REGION_NOTIFICATION_ENDPOINTS_REST_STUB_H +#include "google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints.pb.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_tracing_connection.cc b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_tracing_connection.cc index dce894c7b37d6..72e64f5209ed5 100644 --- a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_tracing_connection.cc +++ b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_notification_endpoints_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionNotificationEndpointsTracingConnection:: RegionNotificationEndpointsTracingConnection( std::shared_ptr MakeRegionNotificationEndpointsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_tracing_connection.h b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_tracing_connection.h index b75adcb18aa4b..e11257bce71fd 100644 --- a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_tracing_connection.h +++ b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_notification_endpoints_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionNotificationEndpointsTracingConnection : public compute_region_notification_endpoints_v1:: RegionNotificationEndpointsConnection { @@ -90,8 +88,6 @@ class RegionNotificationEndpointsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints_connection.h b/google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints_connection.h index 2d4baa9080b36..1f3f39fb505c2 100644 --- a/google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints_connection.h +++ b/google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NOTIFICATION_ENDPOINTS_V1_REGION_NOTIFICATION_ENDPOINTS_CONNECTION_H #include "google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_retry_traits.h" +#include "google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints.pb.h" #include "google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints_connection_idempotency_policy.h b/google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints_connection_idempotency_policy.h index ba4915ecb49db..363d843a52fb6 100644 --- a/google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints_connection_idempotency_policy.h +++ b/google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NOTIFICATION_ENDPOINTS_V1_REGION_NOTIFICATION_ENDPOINTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NOTIFICATION_ENDPOINTS_V1_REGION_NOTIFICATION_ENDPOINTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints_proto_export.h b/google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints_proto_export.h index 448babd845714..f2db8aff21857 100644 --- a/google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints_proto_export.h +++ b/google/cloud/compute/region_notification_endpoints/v1/region_notification_endpoints_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NOTIFICATION_ENDPOINTS_V1_REGION_NOTIFICATION_ENDPOINTS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_090.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_NOTIFICATION_ENDPOINTS_V1_REGION_NOTIFICATION_ENDPOINTS_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_operations/v1/internal/region_operations_option_defaults.cc b/google/cloud/compute/region_operations/v1/internal/region_operations_option_defaults.cc index bc802a216a58c..4e34bf18ea042 100644 --- a/google/cloud/compute/region_operations/v1/internal/region_operations_option_defaults.cc +++ b/google/cloud/compute/region_operations/v1/internal/region_operations_option_defaults.cc @@ -43,7 +43,7 @@ Options RegionOperationsDefaultOptions(Options options) { options.set< compute_region_operations_v1::RegionOperationsRetryPolicyOption>( compute_region_operations_v1::RegionOperationsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include #include diff --git a/google/cloud/compute/region_operations/v1/internal/region_operations_rest_metadata_decorator.cc b/google/cloud/compute/region_operations/v1/internal/region_operations_rest_metadata_decorator.cc index 78bf7ffe9f7c5..4eb3e5be7d6ad 100644 --- a/google/cloud/compute/region_operations/v1/internal/region_operations_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_operations/v1/internal/region_operations_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/region_operations/v1/region_operations.proto #include "google/cloud/compute/region_operations/v1/internal/region_operations_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_operations/v1/internal/region_operations_rest_metadata_decorator.h b/google/cloud/compute/region_operations/v1/internal/region_operations_rest_metadata_decorator.h index 19a5ba64f9c6e..8758a2d5b26d0 100644 --- a/google/cloud/compute/region_operations/v1/internal/region_operations_rest_metadata_decorator.h +++ b/google/cloud/compute/region_operations/v1/internal/region_operations_rest_metadata_decorator.h @@ -20,10 +20,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_OPERATIONS_V1_INTERNAL_REGION_OPERATIONS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.cc b/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.cc index f8a7b1b90bf79..10406f71ff212 100644 --- a/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.cc +++ b/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/region_operations/v1/region_operations.proto #include "google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.h b/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.h index fefd0b193a9f2..7d61dd7eb9d47 100644 --- a/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.h +++ b/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_OPERATIONS_V1_INTERNAL_REGION_OPERATIONS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_OPERATIONS_V1_INTERNAL_REGION_OPERATIONS_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_operations/v1/internal/region_operations_tracing_connection.cc b/google/cloud/compute/region_operations/v1/internal/region_operations_tracing_connection.cc index 10667a410b1c5..800d1d67330a2 100644 --- a/google/cloud/compute/region_operations/v1/internal/region_operations_tracing_connection.cc +++ b/google/cloud/compute/region_operations/v1/internal/region_operations_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_region_operations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionOperationsTracingConnection::RegionOperationsTracingConnection( std::shared_ptr child) @@ -78,17 +76,13 @@ RegionOperationsTracingConnection::Wait( return internal::EndSpan(*span, child_->Wait(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegionOperationsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_operations/v1/internal/region_operations_tracing_connection.h b/google/cloud/compute/region_operations/v1/internal/region_operations_tracing_connection.h index c6d906f7d6164..76032a4425601 100644 --- a/google/cloud/compute/region_operations/v1/internal/region_operations_tracing_connection.h +++ b/google/cloud/compute/region_operations/v1/internal/region_operations_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_operations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionOperationsTracingConnection : public compute_region_operations_v1::RegionOperationsConnection { public: @@ -61,8 +59,6 @@ class RegionOperationsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_operations/v1/region_operations_connection.h b/google/cloud/compute/region_operations/v1/region_operations_connection.h index e4cdf15fb0d28..50e3d5d6345da 100644 --- a/google/cloud/compute/region_operations/v1/region_operations_connection.h +++ b/google/cloud/compute/region_operations/v1/region_operations_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_OPERATIONS_V1_REGION_OPERATIONS_CONNECTION_H #include "google/cloud/compute/region_operations/v1/internal/region_operations_retry_traits.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_operations/v1/region_operations_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_operations/v1/region_operations_connection_idempotency_policy.h b/google/cloud/compute/region_operations/v1/region_operations_connection_idempotency_policy.h index add5932223a06..4892e13f90f84 100644 --- a/google/cloud/compute/region_operations/v1/region_operations_connection_idempotency_policy.h +++ b/google/cloud/compute/region_operations/v1/region_operations_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_OPERATIONS_V1_REGION_OPERATIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_OPERATIONS_V1_REGION_OPERATIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_operations/v1/region_operations_proto_export.h b/google/cloud/compute/region_operations/v1/region_operations_proto_export.h index cd3e9fce976a6..16e0afa4ae4e8 100644 --- a/google/cloud/compute/region_operations/v1/region_operations_proto_export.h +++ b/google/cloud/compute/region_operations/v1/region_operations_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_OPERATIONS_V1_REGION_OPERATIONS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_092.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_OPERATIONS_V1_REGION_OPERATIONS_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_option_defaults.cc b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_option_defaults.cc index ac821e6c9d3ac..55112811f0541 100644 --- a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_option_defaults.cc +++ b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_option_defaults.cc @@ -46,7 +46,7 @@ Options RegionSecurityPoliciesDefaultOptions(Options options) { RegionSecurityPoliciesRetryPolicyOption>( compute_region_security_policies_v1:: RegionSecurityPoliciesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_logging_decorator.h b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_logging_decorator.h index 2872615f3c161..60db561a97938 100644 --- a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_logging_decorator.h +++ b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SECURITY_POLICIES_V1_INTERNAL_REGION_SECURITY_POLICIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SECURITY_POLICIES_V1_INTERNAL_REGION_SECURITY_POLICIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.h" +#include "google/cloud/compute/region_security_policies/v1/region_security_policies.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_metadata_decorator.cc b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_metadata_decorator.cc index 46274d0cb9fbc..1d5550fa27018 100644 --- a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_security_policies/v1/region_security_policies.proto #include "google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_metadata_decorator.h b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_metadata_decorator.h index a14ae6357de2c..0a61951a6917b 100644 --- a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_metadata_decorator.h +++ b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SECURITY_POLICIES_V1_INTERNAL_REGION_SECURITY_POLICIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SECURITY_POLICIES_V1_INTERNAL_REGION_SECURITY_POLICIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.h" +#include "google/cloud/compute/region_security_policies/v1/region_security_policies.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.cc b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.cc index adf76b8fd70d4..cb6f86b997d2a 100644 --- a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.cc +++ b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_security_policies/v1/region_security_policies.proto #include "google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/region_security_policies/v1/region_security_policies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.h b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.h index 8f2b65ae1165e..b5a097bfdcf04 100644 --- a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.h +++ b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SECURITY_POLICIES_V1_INTERNAL_REGION_SECURITY_POLICIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SECURITY_POLICIES_V1_INTERNAL_REGION_SECURITY_POLICIES_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/region_security_policies/v1/region_security_policies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_tracing_connection.cc b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_tracing_connection.cc index 05574e88e5415..f9ed523bd7552 100644 --- a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_tracing_connection.cc +++ b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_security_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionSecurityPoliciesTracingConnection:: RegionSecurityPoliciesTracingConnection( std::shared_ptrSetLabels(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_region_security_policies_v1::RegionSecurityPoliciesConnection> MakeRegionSecurityPoliciesTracingConnection( std::shared_ptr< compute_region_security_policies_v1::RegionSecurityPoliciesConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_tracing_connection.h b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_tracing_connection.h index 2de11377df9c5..d417429bfebd0 100644 --- a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_tracing_connection.h +++ b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_security_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionSecurityPoliciesTracingConnection : public compute_region_security_policies_v1:: RegionSecurityPoliciesConnection { @@ -146,8 +144,6 @@ class RegionSecurityPoliciesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_security_policies/v1/region_security_policies_connection.h b/google/cloud/compute/region_security_policies/v1/region_security_policies_connection.h index f39d281e9e424..df42296c04197 100644 --- a/google/cloud/compute/region_security_policies/v1/region_security_policies_connection.h +++ b/google/cloud/compute/region_security_policies/v1/region_security_policies_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SECURITY_POLICIES_V1_REGION_SECURITY_POLICIES_CONNECTION_H #include "google/cloud/compute/region_security_policies/v1/internal/region_security_policies_retry_traits.h" +#include "google/cloud/compute/region_security_policies/v1/region_security_policies.pb.h" #include "google/cloud/compute/region_security_policies/v1/region_security_policies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_security_policies/v1/region_security_policies_connection_idempotency_policy.h b/google/cloud/compute/region_security_policies/v1/region_security_policies_connection_idempotency_policy.h index dc89ae9b910b5..b74ad9dbe4b94 100644 --- a/google/cloud/compute/region_security_policies/v1/region_security_policies_connection_idempotency_policy.h +++ b/google/cloud/compute/region_security_policies/v1/region_security_policies_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SECURITY_POLICIES_V1_REGION_SECURITY_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SECURITY_POLICIES_V1_REGION_SECURITY_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_security_policies/v1/region_security_policies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_security_policies/v1/region_security_policies_proto_export.h b/google/cloud/compute/region_security_policies/v1/region_security_policies_proto_export.h index 0d0dccc2b84f9..dc572e34b9865 100644 --- a/google/cloud/compute/region_security_policies/v1/region_security_policies_proto_export.h +++ b/google/cloud/compute/region_security_policies/v1/region_security_policies_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SECURITY_POLICIES_V1_REGION_SECURITY_POLICIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_107.pb.h" +#include "google/cloud/compute/v1/internal/common_117.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SECURITY_POLICIES_V1_REGION_SECURITY_POLICIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_option_defaults.cc b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_option_defaults.cc index 78d96964d7aff..593b0b7324882 100644 --- a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_option_defaults.cc +++ b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_option_defaults.cc @@ -46,7 +46,7 @@ Options RegionSslCertificatesDefaultOptions(Options options) { RegionSslCertificatesRetryPolicyOption>( compute_region_ssl_certificates_v1:: RegionSslCertificatesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_logging_decorator.h b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_logging_decorator.h index d2b7ab2d21ac5..e23d99b69db84 100644 --- a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_logging_decorator.h +++ b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_CERTIFICATES_V1_INTERNAL_REGION_SSL_CERTIFICATES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_CERTIFICATES_V1_INTERNAL_REGION_SSL_CERTIFICATES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.h" +#include "google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_metadata_decorator.cc b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_metadata_decorator.cc index d4f49e025f743..7ea0b8c57fb8b 100644 --- a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates.proto #include "google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_metadata_decorator.h b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_metadata_decorator.h index c99e103112dcd..f402de9c3309c 100644 --- a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_metadata_decorator.h +++ b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_CERTIFICATES_V1_INTERNAL_REGION_SSL_CERTIFICATES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_CERTIFICATES_V1_INTERNAL_REGION_SSL_CERTIFICATES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.h" +#include "google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.cc b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.cc index e206a396b718f..4ce68f9735391 100644 --- a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.cc +++ b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates.proto #include "google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.h b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.h index 740ae7115f490..38fe32cbecbbd 100644 --- a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.h +++ b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_CERTIFICATES_V1_INTERNAL_REGION_SSL_CERTIFICATES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_CERTIFICATES_V1_INTERNAL_REGION_SSL_CERTIFICATES_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_tracing_connection.cc b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_tracing_connection.cc index f9bf20c533d30..53849fada216c 100644 --- a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_tracing_connection.cc +++ b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_ssl_certificates_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionSslCertificatesTracingConnection::RegionSslCertificatesTracingConnection( std::shared_ptr< compute_region_ssl_certificates_v1::RegionSslCertificatesConnection> @@ -131,20 +129,16 @@ RegionSslCertificatesTracingConnection::ListRegionSslCertificates( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_region_ssl_certificates_v1::RegionSslCertificatesConnection> MakeRegionSslCertificatesTracingConnection( std::shared_ptr< compute_region_ssl_certificates_v1::RegionSslCertificatesConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_tracing_connection.h b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_tracing_connection.h index dd281b6fefcd7..c71615b356e9b 100644 --- a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_tracing_connection.h +++ b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_ssl_certificates_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionSslCertificatesTracingConnection : public compute_region_ssl_certificates_v1:: RegionSslCertificatesConnection { @@ -85,8 +83,6 @@ class RegionSslCertificatesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates_connection.h b/google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates_connection.h index 0eca5b1a03b88..4d2aadedf8d21 100644 --- a/google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates_connection.h +++ b/google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_CERTIFICATES_V1_REGION_SSL_CERTIFICATES_CONNECTION_H #include "google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_retry_traits.h" +#include "google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates.pb.h" #include "google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates_connection_idempotency_policy.h b/google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates_connection_idempotency_policy.h index 95de6079594be..e19d4988a4e45 100644 --- a/google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates_connection_idempotency_policy.h +++ b/google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_CERTIFICATES_V1_REGION_SSL_CERTIFICATES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_CERTIFICATES_V1_REGION_SSL_CERTIFICATES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates_proto_export.h b/google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates_proto_export.h index 23d7abfcb1a68..53f07c86c3bab 100644 --- a/google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates_proto_export.h +++ b/google/cloud/compute/region_ssl_certificates/v1/region_ssl_certificates_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_CERTIFICATES_V1_REGION_SSL_CERTIFICATES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_125.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_CERTIFICATES_V1_REGION_SSL_CERTIFICATES_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_option_defaults.cc b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_option_defaults.cc index 58f9c602690a9..972e108782c47 100644 --- a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_option_defaults.cc +++ b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_option_defaults.cc @@ -44,7 +44,7 @@ Options RegionSslPoliciesDefaultOptions(Options options) { options.set< compute_region_ssl_policies_v1::RegionSslPoliciesRetryPolicyOption>( compute_region_ssl_policies_v1::RegionSslPoliciesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_logging_decorator.h b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_logging_decorator.h index 32cafd8bf7a23..0ca98dc103178 100644 --- a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_logging_decorator.h +++ b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_POLICIES_V1_INTERNAL_REGION_SSL_POLICIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_POLICIES_V1_INTERNAL_REGION_SSL_POLICIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.h" +#include "google/cloud/compute/region_ssl_policies/v1/region_ssl_policies.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_metadata_decorator.cc b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_metadata_decorator.cc index dd2ae88ec71fe..24318cc2a9665 100644 --- a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/region_ssl_policies/v1/region_ssl_policies.proto #include "google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_metadata_decorator.h b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_metadata_decorator.h index 4193441636897..4f7fa6d7d8ade 100644 --- a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_metadata_decorator.h +++ b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_POLICIES_V1_INTERNAL_REGION_SSL_POLICIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_POLICIES_V1_INTERNAL_REGION_SSL_POLICIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.h" +#include "google/cloud/compute/region_ssl_policies/v1/region_ssl_policies.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.cc b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.cc index 5232e384a6b5a..eec2c3b41ae41 100644 --- a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.cc +++ b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/region_ssl_policies/v1/region_ssl_policies.proto #include "google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/region_ssl_policies/v1/region_ssl_policies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.h b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.h index 127383c34e39c..6b97f77a54e68 100644 --- a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.h +++ b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_POLICIES_V1_INTERNAL_REGION_SSL_POLICIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_POLICIES_V1_INTERNAL_REGION_SSL_POLICIES_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/region_ssl_policies/v1/region_ssl_policies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_tracing_connection.cc b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_tracing_connection.cc index 7c47d434c1a0d..9684473e78494 100644 --- a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_tracing_connection.cc +++ b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_region_ssl_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionSslPoliciesTracingConnection::RegionSslPoliciesTracingConnection( std::shared_ptr child) @@ -170,18 +168,14 @@ RegionSslPoliciesTracingConnection::PatchSslPolicy( return internal::EndSpan(std::move(span), child_->PatchSslPolicy(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegionSslPoliciesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_tracing_connection.h b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_tracing_connection.h index b2a4d540befed..0e845fbaf3fb9 100644 --- a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_tracing_connection.h +++ b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_ssl_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionSslPoliciesTracingConnection : public compute_region_ssl_policies_v1::RegionSslPoliciesConnection { public: @@ -94,8 +92,6 @@ class RegionSslPoliciesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_ssl_policies/v1/region_ssl_policies_connection.h b/google/cloud/compute/region_ssl_policies/v1/region_ssl_policies_connection.h index 15aa268f40c18..a016f0f17e7eb 100644 --- a/google/cloud/compute/region_ssl_policies/v1/region_ssl_policies_connection.h +++ b/google/cloud/compute/region_ssl_policies/v1/region_ssl_policies_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_POLICIES_V1_REGION_SSL_POLICIES_CONNECTION_H #include "google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_retry_traits.h" +#include "google/cloud/compute/region_ssl_policies/v1/region_ssl_policies.pb.h" #include "google/cloud/compute/region_ssl_policies/v1/region_ssl_policies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_ssl_policies/v1/region_ssl_policies_connection_idempotency_policy.h b/google/cloud/compute/region_ssl_policies/v1/region_ssl_policies_connection_idempotency_policy.h index bdb01636d1845..76cc1400f5f1f 100644 --- a/google/cloud/compute/region_ssl_policies/v1/region_ssl_policies_connection_idempotency_policy.h +++ b/google/cloud/compute/region_ssl_policies/v1/region_ssl_policies_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_POLICIES_V1_REGION_SSL_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_POLICIES_V1_REGION_SSL_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_ssl_policies/v1/region_ssl_policies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_ssl_policies/v1/region_ssl_policies_proto_export.h b/google/cloud/compute/region_ssl_policies/v1/region_ssl_policies_proto_export.h index 63a7330380069..d14a283cdc0f8 100644 --- a/google/cloud/compute/region_ssl_policies/v1/region_ssl_policies_proto_export.h +++ b/google/cloud/compute/region_ssl_policies/v1/region_ssl_policies_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_POLICIES_V1_REGION_SSL_POLICIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_128.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_SSL_POLICIES_V1_REGION_SSL_POLICIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_option_defaults.cc b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_option_defaults.cc index fc9f2179f1919..1af4cd916b9e4 100644 --- a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_option_defaults.cc +++ b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_option_defaults.cc @@ -47,7 +47,7 @@ Options RegionTargetHttpProxiesDefaultOptions(Options options) { RegionTargetHttpProxiesRetryPolicyOption>( compute_region_target_http_proxies_v1:: RegionTargetHttpProxiesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_logging_decorator.h b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_logging_decorator.h index e0de07cda6486..52754dac4b277 100644 --- a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_logging_decorator.h +++ b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTP_PROXIES_V1_INTERNAL_REGION_TARGET_HTTP_PROXIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTP_PROXIES_V1_INTERNAL_REGION_TARGET_HTTP_PROXIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.h" +#include "google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_metadata_decorator.cc b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_metadata_decorator.cc index e48956ddd013a..80aa4351183e9 100644 --- a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies.proto #include "google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_metadata_decorator.h b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_metadata_decorator.h index bfbeb0615b1ac..b4ef5df49c81f 100644 --- a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_metadata_decorator.h +++ b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTP_PROXIES_V1_INTERNAL_REGION_TARGET_HTTP_PROXIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTP_PROXIES_V1_INTERNAL_REGION_TARGET_HTTP_PROXIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.h" +#include "google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.cc b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.cc index c0925bcb97c35..d7ae7c2bf4058 100644 --- a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.cc +++ b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies.proto #include "google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.h b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.h index 4da5a139dc961..8c6e2981a5faf 100644 --- a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.h +++ b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTP_PROXIES_V1_INTERNAL_REGION_TARGET_HTTP_PROXIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTP_PROXIES_V1_INTERNAL_REGION_TARGET_HTTP_PROXIES_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_tracing_connection.cc b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_tracing_connection.cc index a61563788ad34..0072cfda416d1 100644 --- a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_tracing_connection.cc +++ b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_target_http_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionTargetHttpProxiesTracingConnection:: RegionTargetHttpProxiesTracingConnection( std::shared_ptrSetUrlMap(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_region_target_http_proxies_v1::RegionTargetHttpProxiesConnection> MakeRegionTargetHttpProxiesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_tracing_connection.h b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_tracing_connection.h index 1c72fa6bd9aa2..ecb629dca46c3 100644 --- a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_tracing_connection.h +++ b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_target_http_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionTargetHttpProxiesTracingConnection : public compute_region_target_http_proxies_v1:: RegionTargetHttpProxiesConnection { @@ -96,8 +94,6 @@ class RegionTargetHttpProxiesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies_connection.h b/google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies_connection.h index 1b65284352522..df33511f671be 100644 --- a/google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies_connection.h +++ b/google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTP_PROXIES_V1_REGION_TARGET_HTTP_PROXIES_CONNECTION_H #include "google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_retry_traits.h" +#include "google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies.pb.h" #include "google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies_connection_idempotency_policy.h b/google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies_connection_idempotency_policy.h index 7e1ff31d5abe4..d6aaf0ad065f2 100644 --- a/google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies_connection_idempotency_policy.h +++ b/google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTP_PROXIES_V1_REGION_TARGET_HTTP_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTP_PROXIES_V1_REGION_TARGET_HTTP_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies_proto_export.h b/google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies_proto_export.h index 84ab4c15de03f..7a536280922ea 100644 --- a/google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies_proto_export.h +++ b/google/cloud/compute/region_target_http_proxies/v1/region_target_http_proxies_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTP_PROXIES_V1_REGION_TARGET_HTTP_PROXIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_135.pb.h" +#include "google/cloud/compute/v1/internal/common_147.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTP_PROXIES_V1_REGION_TARGET_HTTP_PROXIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_option_defaults.cc b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_option_defaults.cc index aa1c98cbcb988..b116c929d9944 100644 --- a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_option_defaults.cc +++ b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_option_defaults.cc @@ -47,7 +47,7 @@ Options RegionTargetHttpsProxiesDefaultOptions(Options options) { RegionTargetHttpsProxiesRetryPolicyOption>( compute_region_target_https_proxies_v1:: RegionTargetHttpsProxiesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_logging_decorator.h b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_logging_decorator.h index 236d510557e47..6730930c89d05 100644 --- a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_logging_decorator.h +++ b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTPS_PROXIES_V1_INTERNAL_REGION_TARGET_HTTPS_PROXIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTPS_PROXIES_V1_INTERNAL_REGION_TARGET_HTTPS_PROXIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.h" +#include "google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_metadata_decorator.cc b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_metadata_decorator.cc index 360f025d62011..c05e4ba2c419f 100644 --- a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies.proto #include "google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_metadata_decorator.h b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_metadata_decorator.h index 52f94cec09cd1..3874bd162f1b9 100644 --- a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_metadata_decorator.h +++ b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTPS_PROXIES_V1_INTERNAL_REGION_TARGET_HTTPS_PROXIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTPS_PROXIES_V1_INTERNAL_REGION_TARGET_HTTPS_PROXIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.h" +#include "google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.cc b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.cc index 63865a21f9c33..e229fad2e32a4 100644 --- a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.cc +++ b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies.proto #include "google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.h b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.h index 24fe0d2d11446..7cd465f4fbfe4 100644 --- a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.h +++ b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTPS_PROXIES_V1_INTERNAL_REGION_TARGET_HTTPS_PROXIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTPS_PROXIES_V1_INTERNAL_REGION_TARGET_HTTPS_PROXIES_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_tracing_connection.cc b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_tracing_connection.cc index 2d3a8debc542c..82d85ef0408bb 100644 --- a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_tracing_connection.cc +++ b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_target_https_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionTargetHttpsProxiesTracingConnection:: RegionTargetHttpsProxiesTracingConnection( std::shared_ptrSetUrlMap(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_region_target_https_proxies_v1::RegionTargetHttpsProxiesConnection> MakeRegionTargetHttpsProxiesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_tracing_connection.h b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_tracing_connection.h index d7ed4f56a0265..5f18d3b132efb 100644 --- a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_tracing_connection.h +++ b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_target_https_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionTargetHttpsProxiesTracingConnection : public compute_region_target_https_proxies_v1:: RegionTargetHttpsProxiesConnection { @@ -122,8 +120,6 @@ class RegionTargetHttpsProxiesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies_connection.h b/google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies_connection.h index 56e0bfcd55c8d..30864e4abc260 100644 --- a/google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies_connection.h +++ b/google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTPS_PROXIES_V1_REGION_TARGET_HTTPS_PROXIES_CONNECTION_H #include "google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_retry_traits.h" +#include "google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies.pb.h" #include "google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies_connection_idempotency_policy.h b/google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies_connection_idempotency_policy.h index 216ed83e7baa9..cb4b94b98581c 100644 --- a/google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies_connection_idempotency_policy.h +++ b/google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTPS_PROXIES_V1_REGION_TARGET_HTTPS_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTPS_PROXIES_V1_REGION_TARGET_HTTPS_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies_proto_export.h b/google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies_proto_export.h index d187a7835e005..ae98cca47bc24 100644 --- a/google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies_proto_export.h +++ b/google/cloud/compute/region_target_https_proxies/v1/region_target_https_proxies_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTPS_PROXIES_V1_REGION_TARGET_HTTPS_PROXIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_109.pb.h" +#include "google/cloud/compute/v1/internal/common_137.pb.h" +#include "google/cloud/compute/v1/internal/common_147.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_HTTPS_PROXIES_V1_REGION_TARGET_HTTPS_PROXIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_option_defaults.cc b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_option_defaults.cc index eb070d5168c5c..1c31aebc4275d 100644 --- a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_option_defaults.cc +++ b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_option_defaults.cc @@ -46,7 +46,7 @@ Options RegionTargetTcpProxiesDefaultOptions(Options options) { RegionTargetTcpProxiesRetryPolicyOption>( compute_region_target_tcp_proxies_v1:: RegionTargetTcpProxiesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_logging_decorator.h b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_logging_decorator.h index 8b7837df07e3e..d517b3b76d207 100644 --- a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_logging_decorator.h +++ b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_TCP_PROXIES_V1_INTERNAL_REGION_TARGET_TCP_PROXIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_TCP_PROXIES_V1_INTERNAL_REGION_TARGET_TCP_PROXIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.h" +#include "google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_metadata_decorator.cc b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_metadata_decorator.cc index 73b69854fd861..c6e583d66561f 100644 --- a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies.proto #include "google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_metadata_decorator.h b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_metadata_decorator.h index 37ef6c3bd457e..84e897ce39bc1 100644 --- a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_metadata_decorator.h +++ b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_TCP_PROXIES_V1_INTERNAL_REGION_TARGET_TCP_PROXIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_TCP_PROXIES_V1_INTERNAL_REGION_TARGET_TCP_PROXIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.h" +#include "google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.cc b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.cc index e6dc95929b12e..5fda464ba515f 100644 --- a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.cc +++ b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies.proto #include "google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.h b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.h index 52599646d0c76..bb9f7887e23b2 100644 --- a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.h +++ b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_TCP_PROXIES_V1_INTERNAL_REGION_TARGET_TCP_PROXIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_TCP_PROXIES_V1_INTERNAL_REGION_TARGET_TCP_PROXIES_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_tracing_connection.cc b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_tracing_connection.cc index f5d55bd564c76..5041660227d35 100644 --- a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_tracing_connection.cc +++ b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_target_tcp_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionTargetTcpProxiesTracingConnection:: RegionTargetTcpProxiesTracingConnection( std::shared_ptr MakeRegionTargetTcpProxiesTracingConnection( std::shared_ptr< compute_region_target_tcp_proxies_v1::RegionTargetTcpProxiesConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_tracing_connection.h b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_tracing_connection.h index ad6d2171c35f9..e29fb1bc98bf7 100644 --- a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_tracing_connection.h +++ b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_region_target_tcp_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionTargetTcpProxiesTracingConnection : public compute_region_target_tcp_proxies_v1:: RegionTargetTcpProxiesConnection { @@ -85,8 +83,6 @@ class RegionTargetTcpProxiesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies_connection.h b/google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies_connection.h index 1e643be7ca735..9a189e8570c5f 100644 --- a/google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies_connection.h +++ b/google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_TCP_PROXIES_V1_REGION_TARGET_TCP_PROXIES_CONNECTION_H #include "google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_retry_traits.h" +#include "google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies.pb.h" #include "google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies_connection_idempotency_policy.h b/google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies_connection_idempotency_policy.h index 23cda2e9ba754..704d0664e0702 100644 --- a/google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies_connection_idempotency_policy.h +++ b/google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_TCP_PROXIES_V1_REGION_TARGET_TCP_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_TCP_PROXIES_V1_REGION_TARGET_TCP_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies_proto_export.h b/google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies_proto_export.h index ec39272193fe5..cb711e208aa3c 100644 --- a/google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies_proto_export.h +++ b/google/cloud/compute/region_target_tcp_proxies/v1/region_target_tcp_proxies_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_TCP_PROXIES_V1_REGION_TARGET_TCP_PROXIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_143.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_TARGET_TCP_PROXIES_V1_REGION_TARGET_TCP_PROXIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_option_defaults.cc b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_option_defaults.cc index 16ba71de5acc6..7ede5ca7896a1 100644 --- a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_option_defaults.cc +++ b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_option_defaults.cc @@ -42,7 +42,7 @@ Options RegionUrlMapsDefaultOptions(Options options) { .has()) { options.set( compute_region_url_maps_v1::RegionUrlMapsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_connection_impl.h b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_connection_impl.h index 9f0789e442d12..edff4e69e81f0 100644 --- a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_connection_impl.h +++ b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_URL_MAPS_V1_INTERNAL_REGION_URL_MAPS_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_URL_MAPS_V1_INTERNAL_REGION_URL_MAPS_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.h" #include "google/cloud/compute/region_url_maps/v1/internal/region_url_maps_retry_traits.h" #include "google/cloud/compute/region_url_maps/v1/region_url_maps_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_logging_decorator.h b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_logging_decorator.h index 0560b92eef0ef..82b3103928393 100644 --- a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_logging_decorator.h +++ b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_URL_MAPS_V1_INTERNAL_REGION_URL_MAPS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_URL_MAPS_V1_INTERNAL_REGION_URL_MAPS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.h" +#include "google/cloud/compute/region_url_maps/v1/region_url_maps.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_metadata_decorator.cc b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_metadata_decorator.cc index ef5e30b95c471..4bb6f854ea1ed 100644 --- a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/region_url_maps/v1/region_url_maps.proto #include "google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_metadata_decorator.h b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_metadata_decorator.h index 73b9dc263c0ca..1191b054ffb6d 100644 --- a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_metadata_decorator.h +++ b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_URL_MAPS_V1_INTERNAL_REGION_URL_MAPS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_URL_MAPS_V1_INTERNAL_REGION_URL_MAPS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.h" +#include "google/cloud/compute/region_url_maps/v1/region_url_maps.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.cc b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.cc index ca48cc6305336..da92040f381cd 100644 --- a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.cc +++ b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/region_url_maps/v1/region_url_maps.proto #include "google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/region_url_maps/v1/region_url_maps.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.h b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.h index 0cf691e2d3aa6..44e90fa7d0a41 100644 --- a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.h +++ b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_URL_MAPS_V1_INTERNAL_REGION_URL_MAPS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_URL_MAPS_V1_INTERNAL_REGION_URL_MAPS_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/region_url_maps/v1/region_url_maps.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_tracing_connection.cc b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_tracing_connection.cc index 0766ca6488ede..a5ba4d18ea4c8 100644 --- a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_tracing_connection.cc +++ b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_region_url_maps_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionUrlMapsTracingConnection::RegionUrlMapsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -185,16 +183,12 @@ RegionUrlMapsTracingConnection::Validate( return internal::EndSpan(*span, child_->Validate(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegionUrlMapsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_tracing_connection.h b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_tracing_connection.h index 3b6b4a818558d..9ed4e1937d235 100644 --- a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_tracing_connection.h +++ b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_url_maps_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionUrlMapsTracingConnection : public compute_region_url_maps_v1::RegionUrlMapsConnection { public: @@ -101,8 +99,6 @@ class RegionUrlMapsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_url_maps/v1/region_url_maps_connection.h b/google/cloud/compute/region_url_maps/v1/region_url_maps_connection.h index 17fdde1c66f88..f0fd222601661 100644 --- a/google/cloud/compute/region_url_maps/v1/region_url_maps_connection.h +++ b/google/cloud/compute/region_url_maps/v1/region_url_maps_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_URL_MAPS_V1_REGION_URL_MAPS_CONNECTION_H #include "google/cloud/compute/region_url_maps/v1/internal/region_url_maps_retry_traits.h" +#include "google/cloud/compute/region_url_maps/v1/region_url_maps.pb.h" #include "google/cloud/compute/region_url_maps/v1/region_url_maps_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_url_maps/v1/region_url_maps_connection_idempotency_policy.h b/google/cloud/compute/region_url_maps/v1/region_url_maps_connection_idempotency_policy.h index 190c97b25b9e1..0e3a8c02f8bc7 100644 --- a/google/cloud/compute/region_url_maps/v1/region_url_maps_connection_idempotency_policy.h +++ b/google/cloud/compute/region_url_maps/v1/region_url_maps_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_URL_MAPS_V1_REGION_URL_MAPS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_URL_MAPS_V1_REGION_URL_MAPS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_url_maps/v1/region_url_maps.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_url_maps/v1/region_url_maps_proto_export.h b/google/cloud/compute/region_url_maps/v1/region_url_maps_proto_export.h index 92f3a6c602ed6..f37775f1a5030 100644 --- a/google/cloud/compute/region_url_maps/v1/region_url_maps_proto_export.h +++ b/google/cloud/compute/region_url_maps/v1/region_url_maps_proto_export.h @@ -26,11 +26,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_URL_MAPS_V1_REGION_URL_MAPS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_020.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_082.pb.h" +#include "google/cloud/compute/v1/internal/common_110.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_URL_MAPS_V1_REGION_URL_MAPS_PROTO_EXPORT_H diff --git a/google/cloud/compute/region_zones/v1/internal/region_zones_option_defaults.cc b/google/cloud/compute/region_zones/v1/internal/region_zones_option_defaults.cc index 887093d955c54..9c4bfc282c72e 100644 --- a/google/cloud/compute/region_zones/v1/internal/region_zones_option_defaults.cc +++ b/google/cloud/compute/region_zones/v1/internal/region_zones_option_defaults.cc @@ -41,7 +41,7 @@ Options RegionZonesDefaultOptions(Options options) { if (!options.has()) { options.set( compute_region_zones_v1::RegionZonesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/region_zones/v1/internal/region_zones_rest_logging_decorator.h b/google/cloud/compute/region_zones/v1/internal/region_zones_rest_logging_decorator.h index f2d0529d4c1af..647504969e2b7 100644 --- a/google/cloud/compute/region_zones/v1/internal/region_zones_rest_logging_decorator.h +++ b/google/cloud/compute/region_zones/v1/internal/region_zones_rest_logging_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_ZONES_V1_INTERNAL_REGION_ZONES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.h" +#include "google/cloud/compute/region_zones/v1/region_zones.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/compute/region_zones/v1/internal/region_zones_rest_metadata_decorator.cc b/google/cloud/compute/region_zones/v1/internal/region_zones_rest_metadata_decorator.cc index 6349d635626c0..e10357a26a3ab 100644 --- a/google/cloud/compute/region_zones/v1/internal/region_zones_rest_metadata_decorator.cc +++ b/google/cloud/compute/region_zones/v1/internal/region_zones_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/region_zones/v1/region_zones.proto #include "google/cloud/compute/region_zones/v1/internal/region_zones_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/region_zones/v1/internal/region_zones_rest_metadata_decorator.h b/google/cloud/compute/region_zones/v1/internal/region_zones_rest_metadata_decorator.h index 9173cd1a8b801..5d1774ab430ef 100644 --- a/google/cloud/compute/region_zones/v1/internal/region_zones_rest_metadata_decorator.h +++ b/google/cloud/compute/region_zones/v1/internal/region_zones_rest_metadata_decorator.h @@ -20,10 +20,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_ZONES_V1_INTERNAL_REGION_ZONES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.h" +#include "google/cloud/compute/region_zones/v1/region_zones.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.cc b/google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.cc index d75d70d7f2a9c..7da5e6a7e991d 100644 --- a/google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.cc +++ b/google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/region_zones/v1/region_zones.proto #include "google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.h" +#include "google/cloud/compute/region_zones/v1/region_zones.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.h b/google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.h index 1b6c75379fca2..3af45d3f2b610 100644 --- a/google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.h +++ b/google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_ZONES_V1_INTERNAL_REGION_ZONES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_ZONES_V1_INTERNAL_REGION_ZONES_REST_STUB_H +#include "google/cloud/compute/region_zones/v1/region_zones.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_zones/v1/internal/region_zones_tracing_connection.cc b/google/cloud/compute/region_zones/v1/internal/region_zones_tracing_connection.cc index e49791b34788d..0ca1edfb279f2 100644 --- a/google/cloud/compute/region_zones/v1/internal/region_zones_tracing_connection.cc +++ b/google/cloud/compute/region_zones/v1/internal/region_zones_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_region_zones_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionZonesTracingConnection::RegionZonesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -45,16 +43,12 @@ RegionZonesTracingConnection::ListRegionZones( std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegionZonesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/region_zones/v1/internal/region_zones_tracing_connection.h b/google/cloud/compute/region_zones/v1/internal/region_zones_tracing_connection.h index 38f57b54bcd08..331b830abfd9b 100644 --- a/google/cloud/compute/region_zones/v1/internal/region_zones_tracing_connection.h +++ b/google/cloud/compute/region_zones/v1/internal/region_zones_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_region_zones_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionZonesTracingConnection : public compute_region_zones_v1::RegionZonesConnection { public: @@ -48,8 +46,6 @@ class RegionZonesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/region_zones/v1/region_zones_connection.h b/google/cloud/compute/region_zones/v1/region_zones_connection.h index 16589cbc982e3..916ce9883b55a 100644 --- a/google/cloud/compute/region_zones/v1/region_zones_connection.h +++ b/google/cloud/compute/region_zones/v1/region_zones_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_ZONES_V1_REGION_ZONES_CONNECTION_H #include "google/cloud/compute/region_zones/v1/internal/region_zones_retry_traits.h" +#include "google/cloud/compute/region_zones/v1/region_zones.pb.h" #include "google/cloud/compute/region_zones/v1/region_zones_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_zones/v1/region_zones_connection_idempotency_policy.h b/google/cloud/compute/region_zones/v1/region_zones_connection_idempotency_policy.h index 35c1e8f5dc634..ebc78bb595c9f 100644 --- a/google/cloud/compute/region_zones/v1/region_zones_connection_idempotency_policy.h +++ b/google/cloud/compute/region_zones/v1/region_zones_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_ZONES_V1_REGION_ZONES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_ZONES_V1_REGION_ZONES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/region_zones/v1/region_zones.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/region_zones/v1/region_zones_proto_export.h b/google/cloud/compute/region_zones/v1/region_zones_proto_export.h index 4941aeffc2489..de43f725c90f7 100644 --- a/google/cloud/compute/region_zones/v1/region_zones_proto_export.h +++ b/google/cloud/compute/region_zones/v1/region_zones_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_ZONES_V1_REGION_ZONES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_023.pb.h" +#include "google/cloud/compute/v1/internal/common_150.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGION_ZONES_V1_REGION_ZONES_PROTO_EXPORT_H diff --git a/google/cloud/compute/regions/v1/internal/regions_option_defaults.cc b/google/cloud/compute/regions/v1/internal/regions_option_defaults.cc index ed1f634226a4a..3f70634ecd6c3 100644 --- a/google/cloud/compute/regions/v1/internal/regions_option_defaults.cc +++ b/google/cloud/compute/regions/v1/internal/regions_option_defaults.cc @@ -41,7 +41,7 @@ Options RegionsDefaultOptions(Options options) { if (!options.has()) { options.set( compute_regions_v1::RegionsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/regions/v1/internal/regions_rest_logging_decorator.h b/google/cloud/compute/regions/v1/internal/regions_rest_logging_decorator.h index 24e36a6091cc8..3f7122b2f8794 100644 --- a/google/cloud/compute/regions/v1/internal/regions_rest_logging_decorator.h +++ b/google/cloud/compute/regions/v1/internal/regions_rest_logging_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGIONS_V1_INTERNAL_REGIONS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/regions/v1/internal/regions_rest_stub.h" +#include "google/cloud/compute/regions/v1/regions.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/compute/regions/v1/internal/regions_rest_metadata_decorator.cc b/google/cloud/compute/regions/v1/internal/regions_rest_metadata_decorator.cc index 0e44f5eb2cadf..87b4191d8059f 100644 --- a/google/cloud/compute/regions/v1/internal/regions_rest_metadata_decorator.cc +++ b/google/cloud/compute/regions/v1/internal/regions_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/regions/v1/regions.proto #include "google/cloud/compute/regions/v1/internal/regions_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/regions/v1/internal/regions_rest_metadata_decorator.h b/google/cloud/compute/regions/v1/internal/regions_rest_metadata_decorator.h index e1e26b32200b8..f614911eeca5f 100644 --- a/google/cloud/compute/regions/v1/internal/regions_rest_metadata_decorator.h +++ b/google/cloud/compute/regions/v1/internal/regions_rest_metadata_decorator.h @@ -20,10 +20,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGIONS_V1_INTERNAL_REGIONS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/regions/v1/internal/regions_rest_stub.h" +#include "google/cloud/compute/regions/v1/regions.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/regions/v1/internal/regions_rest_stub.cc b/google/cloud/compute/regions/v1/internal/regions_rest_stub.cc index 9d907fef4b2fe..1dec5ccf293c0 100644 --- a/google/cloud/compute/regions/v1/internal/regions_rest_stub.cc +++ b/google/cloud/compute/regions/v1/internal/regions_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/regions/v1/regions.proto #include "google/cloud/compute/regions/v1/internal/regions_rest_stub.h" +#include "google/cloud/compute/regions/v1/regions.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/regions/v1/internal/regions_rest_stub.h b/google/cloud/compute/regions/v1/internal/regions_rest_stub.h index 58b19443ecbe9..0c326d4dfd032 100644 --- a/google/cloud/compute/regions/v1/internal/regions_rest_stub.h +++ b/google/cloud/compute/regions/v1/internal/regions_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGIONS_V1_INTERNAL_REGIONS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGIONS_V1_INTERNAL_REGIONS_REST_STUB_H +#include "google/cloud/compute/regions/v1/regions.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/regions/v1/internal/regions_tracing_connection.cc b/google/cloud/compute/regions/v1/internal/regions_tracing_connection.cc index a83c58e3e9ddc..9c7a97e0c382d 100644 --- a/google/cloud/compute/regions/v1/internal/regions_tracing_connection.cc +++ b/google/cloud/compute/regions/v1/internal/regions_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_regions_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegionsTracingConnection::RegionsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -53,16 +51,12 @@ RegionsTracingConnection::ListRegions( google::cloud::cpp::compute::v1::Region>(std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegionsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/regions/v1/internal/regions_tracing_connection.h b/google/cloud/compute/regions/v1/internal/regions_tracing_connection.h index 83ac35c355a9e..b57d28d45ab96 100644 --- a/google/cloud/compute/regions/v1/internal/regions_tracing_connection.h +++ b/google/cloud/compute/regions/v1/internal/regions_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_regions_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegionsTracingConnection : public compute_regions_v1::RegionsConnection { public: ~RegionsTracingConnection() override = default; @@ -51,8 +49,6 @@ class RegionsTracingConnection : public compute_regions_v1::RegionsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/regions/v1/regions_connection.h b/google/cloud/compute/regions/v1/regions_connection.h index 9ac789bce5581..fe8a251a90d55 100644 --- a/google/cloud/compute/regions/v1/regions_connection.h +++ b/google/cloud/compute/regions/v1/regions_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGIONS_V1_REGIONS_CONNECTION_H #include "google/cloud/compute/regions/v1/internal/regions_retry_traits.h" +#include "google/cloud/compute/regions/v1/regions.pb.h" #include "google/cloud/compute/regions/v1/regions_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/regions/v1/regions_connection_idempotency_policy.h b/google/cloud/compute/regions/v1/regions_connection_idempotency_policy.h index 935e679fa5de6..5c45d2533acae 100644 --- a/google/cloud/compute/regions/v1/regions_connection_idempotency_policy.h +++ b/google/cloud/compute/regions/v1/regions_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGIONS_V1_REGIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGIONS_V1_REGIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/regions/v1/regions.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/regions/v1/regions_proto_export.h b/google/cloud/compute/regions/v1/regions_proto_export.h index 47bca199d3e12..e9ffa0bc8fed5 100644 --- a/google/cloud/compute/regions/v1/regions_proto_export.h +++ b/google/cloud/compute/regions/v1/regions_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGIONS_V1_REGIONS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_023.pb.h" +#include "google/cloud/compute/v1/internal/common_098.pb.h" +#include "google/cloud/compute/v1/internal/common_099.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_REGIONS_V1_REGIONS_PROTO_EXPORT_H diff --git a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_option_defaults.cc b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_option_defaults.cc index b94bf76126c35..784b17e563dfd 100644 --- a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_option_defaults.cc +++ b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_option_defaults.cc @@ -44,7 +44,7 @@ Options ReservationBlocksDefaultOptions(Options options) { options.set< compute_reservation_blocks_v1::ReservationBlocksRetryPolicyOption>( compute_reservation_blocks_v1::ReservationBlocksLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_logging_decorator.h b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_logging_decorator.h index 3209d2b0d7f89..471b3be22cc85 100644 --- a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_logging_decorator.h +++ b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_logging_decorator.h @@ -20,12 +20,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_BLOCKS_V1_INTERNAL_RESERVATION_BLOCKS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_stub.h" +#include "google/cloud/compute/reservation_blocks/v1/reservation_blocks.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_metadata_decorator.cc b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_metadata_decorator.cc index e810ed30af237..366924b7d2e60 100644 --- a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_metadata_decorator.cc +++ b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/reservation_blocks/v1/reservation_blocks.proto #include "google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_metadata_decorator.h b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_metadata_decorator.h index a3eed725b9c50..05cb920355fb1 100644 --- a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_metadata_decorator.h +++ b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_BLOCKS_V1_INTERNAL_RESERVATION_BLOCKS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_stub.h" +#include "google/cloud/compute/reservation_blocks/v1/reservation_blocks.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_stub.cc b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_stub.cc index ba872ca13ba8a..837ed439c5d55 100644 --- a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_stub.cc +++ b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/reservation_blocks/v1/reservation_blocks.proto #include "google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_stub.h" +#include "google/cloud/compute/reservation_blocks/v1/reservation_blocks.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_stub.h b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_stub.h index 6f3775648df42..fe3b18c2e2b31 100644 --- a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_stub.h +++ b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_BLOCKS_V1_INTERNAL_RESERVATION_BLOCKS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_BLOCKS_V1_INTERNAL_RESERVATION_BLOCKS_REST_STUB_H +#include "google/cloud/compute/reservation_blocks/v1/reservation_blocks.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_tracing_connection.cc b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_tracing_connection.cc index ae407f0b7943c..be03952d3f5b7 100644 --- a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_tracing_connection.cc +++ b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_reservation_blocks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ReservationBlocksTracingConnection::ReservationBlocksTracingConnection( std::shared_ptr child) @@ -95,18 +93,14 @@ ReservationBlocksTracingConnection::PerformMaintenance( child_->PerformMaintenance(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeReservationBlocksTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_tracing_connection.h b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_tracing_connection.h index f2aa5692d8792..923b20756ae42 100644 --- a/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_tracing_connection.h +++ b/google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_reservation_blocks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ReservationBlocksTracingConnection : public compute_reservation_blocks_v1::ReservationBlocksConnection { public: @@ -68,8 +66,6 @@ class ReservationBlocksTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/reservation_blocks/v1/reservation_blocks_connection.h b/google/cloud/compute/reservation_blocks/v1/reservation_blocks_connection.h index fffde3656dbe5..511fb51c96896 100644 --- a/google/cloud/compute/reservation_blocks/v1/reservation_blocks_connection.h +++ b/google/cloud/compute/reservation_blocks/v1/reservation_blocks_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_BLOCKS_V1_RESERVATION_BLOCKS_CONNECTION_H #include "google/cloud/compute/reservation_blocks/v1/internal/reservation_blocks_retry_traits.h" +#include "google/cloud/compute/reservation_blocks/v1/reservation_blocks.pb.h" #include "google/cloud/compute/reservation_blocks/v1/reservation_blocks_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/reservation_blocks/v1/reservation_blocks_connection_idempotency_policy.h b/google/cloud/compute/reservation_blocks/v1/reservation_blocks_connection_idempotency_policy.h index cb522fc225312..3d89167901ea1 100644 --- a/google/cloud/compute/reservation_blocks/v1/reservation_blocks_connection_idempotency_policy.h +++ b/google/cloud/compute/reservation_blocks/v1/reservation_blocks_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_BLOCKS_V1_RESERVATION_BLOCKS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_BLOCKS_V1_RESERVATION_BLOCKS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/reservation_blocks/v1/reservation_blocks.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/reservation_blocks/v1/reservation_blocks_proto_export.h b/google/cloud/compute/reservation_blocks/v1/reservation_blocks_proto_export.h index 472bdf2ab5ff4..88aca6ea49b87 100644 --- a/google/cloud/compute/reservation_blocks/v1/reservation_blocks_proto_export.h +++ b/google/cloud/compute/reservation_blocks/v1/reservation_blocks_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_BLOCKS_V1_RESERVATION_BLOCKS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_048.pb.h" +#include "google/cloud/compute/v1/internal/common_112.pb.h" +#include "google/cloud/compute/v1/internal/common_146.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_BLOCKS_V1_RESERVATION_BLOCKS_PROTO_EXPORT_H diff --git a/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_option_defaults.cc b/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_option_defaults.cc index ffa66d7f9e4ad..18024fc0cfaaa 100644 --- a/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_option_defaults.cc +++ b/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_option_defaults.cc @@ -45,7 +45,7 @@ Options ReservationSubBlocksDefaultOptions(Options options) { options.set( compute_reservation_sub_blocks_v1:: - ReservationSubBlocksLimitedTimeRetryPolicy(std::chrono::minutes(30)) + ReservationSubBlocksLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has #include #include #include diff --git a/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_metadata_decorator.cc b/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_metadata_decorator.cc index 85b95822088e9..d10d4e707e9ca 100644 --- a/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_metadata_decorator.cc +++ b/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks.proto #include "google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_metadata_decorator.h b/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_metadata_decorator.h index 380d16e1f3a83..178b7e76cb1f0 100644 --- a/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_metadata_decorator.h +++ b/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_metadata_decorator.h @@ -21,10 +21,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_SUB_BLOCKS_V1_INTERNAL_RESERVATION_SUB_BLOCKS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_stub.h" +#include "google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_stub.cc b/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_stub.cc index 5bdaa067fae12..db542fe5b0697 100644 --- a/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_stub.cc +++ b/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_stub.cc @@ -18,11 +18,11 @@ // google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks.proto #include "google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_stub.h" +#include "google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_stub.h b/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_stub.h index dcbf778613d27..a469779eb964d 100644 --- a/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_stub.h +++ b/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_rest_stub.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_SUB_BLOCKS_V1_INTERNAL_RESERVATION_SUB_BLOCKS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_SUB_BLOCKS_V1_INTERNAL_RESERVATION_SUB_BLOCKS_REST_STUB_H +#include "google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_tracing_connection.cc b/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_tracing_connection.cc index 4a155cb612158..19c78d6bb1833 100644 --- a/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_tracing_connection.cc +++ b/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_reservation_sub_blocks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ReservationSubBlocksTracingConnection::ReservationSubBlocksTracingConnection( std::shared_ptr< compute_reservation_sub_blocks_v1::ReservationSubBlocksConnection> @@ -62,20 +60,16 @@ ReservationSubBlocksTracingConnection::ListReservationSubBlocks( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr< compute_reservation_sub_blocks_v1::ReservationSubBlocksConnection> MakeReservationSubBlocksTracingConnection( std::shared_ptr< compute_reservation_sub_blocks_v1::ReservationSubBlocksConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_tracing_connection.h b/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_tracing_connection.h index 633507cc2d7a0..a9f931da2eaff 100644 --- a/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_tracing_connection.h +++ b/google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_reservation_sub_blocks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ReservationSubBlocksTracingConnection : public compute_reservation_sub_blocks_v1::ReservationSubBlocksConnection { public: @@ -59,8 +57,6 @@ class ReservationSubBlocksTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks_connection.h b/google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks_connection.h index bbfc4aecc4db9..4a5f11208dc3a 100644 --- a/google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks_connection.h +++ b/google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_SUB_BLOCKS_V1_RESERVATION_SUB_BLOCKS_CONNECTION_H #include "google/cloud/compute/reservation_sub_blocks/v1/internal/reservation_sub_blocks_retry_traits.h" +#include "google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks.pb.h" #include "google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -28,7 +29,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks_connection_idempotency_policy.h b/google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks_connection_idempotency_policy.h index 99069bb8746fa..43d85621d4f68 100644 --- a/google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks_connection_idempotency_policy.h +++ b/google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_SUB_BLOCKS_V1_RESERVATION_SUB_BLOCKS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_SUB_BLOCKS_V1_RESERVATION_SUB_BLOCKS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks_proto_export.h b/google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks_proto_export.h index 22cb47ac88f6a..182c254584614 100644 --- a/google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks_proto_export.h +++ b/google/cloud/compute/reservation_sub_blocks/v1/reservation_sub_blocks_proto_export.h @@ -26,7 +26,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_SUB_BLOCKS_V1_RESERVATION_SUB_BLOCKS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include +#include "google/cloud/compute/v1/internal/common_113.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATION_SUB_BLOCKS_V1_RESERVATION_SUB_BLOCKS_PROTO_EXPORT_H diff --git a/google/cloud/compute/reservations/v1/internal/reservations_option_defaults.cc b/google/cloud/compute/reservations/v1/internal/reservations_option_defaults.cc index c50bdf37ca313..acc0170293372 100644 --- a/google/cloud/compute/reservations/v1/internal/reservations_option_defaults.cc +++ b/google/cloud/compute/reservations/v1/internal/reservations_option_defaults.cc @@ -41,7 +41,7 @@ Options ReservationsDefaultOptions(Options options) { if (!options.has()) { options.set( compute_reservations_v1::ReservationsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/compute/reservations/v1/internal/reservations_rest_connection_impl.h b/google/cloud/compute/reservations/v1/internal/reservations_rest_connection_impl.h index 3149b6294a36d..5bf187ea0d533 100644 --- a/google/cloud/compute/reservations/v1/internal/reservations_rest_connection_impl.h +++ b/google/cloud/compute/reservations/v1/internal/reservations_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/reservations/v1/reservations_connection.h" #include "google/cloud/compute/reservations/v1/reservations_connection_idempotency_policy.h" #include "google/cloud/compute/reservations/v1/reservations_options.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/reservations/v1/internal/reservations_rest_logging_decorator.h b/google/cloud/compute/reservations/v1/internal/reservations_rest_logging_decorator.h index a168132d98dd0..b124b6128f968 100644 --- a/google/cloud/compute/reservations/v1/internal/reservations_rest_logging_decorator.h +++ b/google/cloud/compute/reservations/v1/internal/reservations_rest_logging_decorator.h @@ -20,12 +20,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATIONS_V1_INTERNAL_RESERVATIONS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/reservations/v1/internal/reservations_rest_stub.h" +#include "google/cloud/compute/reservations/v1/reservations.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/reservations/v1/internal/reservations_rest_metadata_decorator.cc b/google/cloud/compute/reservations/v1/internal/reservations_rest_metadata_decorator.cc index 8fda19bf3b0a0..ab2ecab4a0f60 100644 --- a/google/cloud/compute/reservations/v1/internal/reservations_rest_metadata_decorator.cc +++ b/google/cloud/compute/reservations/v1/internal/reservations_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/reservations/v1/reservations.proto #include "google/cloud/compute/reservations/v1/internal/reservations_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/reservations/v1/internal/reservations_rest_metadata_decorator.h b/google/cloud/compute/reservations/v1/internal/reservations_rest_metadata_decorator.h index 0c2871287747e..6521d2b9318e8 100644 --- a/google/cloud/compute/reservations/v1/internal/reservations_rest_metadata_decorator.h +++ b/google/cloud/compute/reservations/v1/internal/reservations_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATIONS_V1_INTERNAL_RESERVATIONS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/reservations/v1/internal/reservations_rest_stub.h" +#include "google/cloud/compute/reservations/v1/reservations.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.cc b/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.cc index c716ea8d158f1..3959c59213d95 100644 --- a/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.cc +++ b/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/reservations/v1/reservations.proto #include "google/cloud/compute/reservations/v1/internal/reservations_rest_stub.h" +#include "google/cloud/compute/reservations/v1/reservations.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.h b/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.h index dd7a58443aab8..774c2c5624b2d 100644 --- a/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.h +++ b/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATIONS_V1_INTERNAL_RESERVATIONS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATIONS_V1_INTERNAL_RESERVATIONS_REST_STUB_H +#include "google/cloud/compute/reservations/v1/reservations.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/reservations/v1/internal/reservations_tracing_connection.cc b/google/cloud/compute/reservations/v1/internal/reservations_tracing_connection.cc index 92376aa94882c..a28d3e2b04c47 100644 --- a/google/cloud/compute/reservations/v1/internal/reservations_tracing_connection.cc +++ b/google/cloud/compute/reservations/v1/internal/reservations_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_reservations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ReservationsTracingConnection::ReservationsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -256,16 +254,12 @@ ReservationsTracingConnection::UpdateReservation( child_->UpdateReservation(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeReservationsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/reservations/v1/internal/reservations_tracing_connection.h b/google/cloud/compute/reservations/v1/internal/reservations_tracing_connection.h index 6e39bee02a69d..1cb4f1d5f359c 100644 --- a/google/cloud/compute/reservations/v1/internal/reservations_tracing_connection.h +++ b/google/cloud/compute/reservations/v1/internal/reservations_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_reservations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ReservationsTracingConnection : public compute_reservations_v1::ReservationsConnection { public: @@ -130,8 +128,6 @@ class ReservationsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/reservations/v1/reservations_connection.h b/google/cloud/compute/reservations/v1/reservations_connection.h index 97bdb9598f486..d710da0aea180 100644 --- a/google/cloud/compute/reservations/v1/reservations_connection.h +++ b/google/cloud/compute/reservations/v1/reservations_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATIONS_V1_RESERVATIONS_CONNECTION_H #include "google/cloud/compute/reservations/v1/internal/reservations_retry_traits.h" +#include "google/cloud/compute/reservations/v1/reservations.pb.h" #include "google/cloud/compute/reservations/v1/reservations_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/reservations/v1/reservations_connection_idempotency_policy.h b/google/cloud/compute/reservations/v1/reservations_connection_idempotency_policy.h index 5401741fe28fa..6f357dc330149 100644 --- a/google/cloud/compute/reservations/v1/reservations_connection_idempotency_policy.h +++ b/google/cloud/compute/reservations/v1/reservations_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATIONS_V1_RESERVATIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATIONS_V1_RESERVATIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/reservations/v1/reservations.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/reservations/v1/reservations_proto_export.h b/google/cloud/compute/reservations/v1/reservations_proto_export.h index 415890993ed00..62ac023a86131 100644 --- a/google/cloud/compute/reservations/v1/reservations_proto_export.h +++ b/google/cloud/compute/reservations/v1/reservations_proto_export.h @@ -26,18 +26,18 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATIONS_V1_RESERVATIONS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_001.pb.h" +#include "google/cloud/compute/v1/internal/common_006.pb.h" +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_048.pb.h" +#include "google/cloud/compute/v1/internal/common_111.pb.h" +#include "google/cloud/compute/v1/internal/common_120.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" +#include "google/cloud/compute/v1/internal/common_146.pb.h" +#include "google/cloud/compute/v1/internal/common_152.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESERVATIONS_V1_RESERVATIONS_PROTO_EXPORT_H diff --git a/google/cloud/compute/resource_policies/v1/internal/resource_policies_option_defaults.cc b/google/cloud/compute/resource_policies/v1/internal/resource_policies_option_defaults.cc index 0e98c91086bbc..9b2a689795ca7 100644 --- a/google/cloud/compute/resource_policies/v1/internal/resource_policies_option_defaults.cc +++ b/google/cloud/compute/resource_policies/v1/internal/resource_policies_option_defaults.cc @@ -43,7 +43,7 @@ Options ResourcePoliciesDefaultOptions(Options options) { options.set< compute_resource_policies_v1::ResourcePoliciesRetryPolicyOption>( compute_resource_policies_v1::ResourcePoliciesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_logging_decorator.h b/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_logging_decorator.h index 472abdb64f2af..2b00a08679171 100644 --- a/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_logging_decorator.h +++ b/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESOURCE_POLICIES_V1_INTERNAL_RESOURCE_POLICIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESOURCE_POLICIES_V1_INTERNAL_RESOURCE_POLICIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.h" +#include "google/cloud/compute/resource_policies/v1/resource_policies.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_metadata_decorator.cc b/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_metadata_decorator.cc index 6fd84cdeec3f9..9a78716eaf7dc 100644 --- a/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_metadata_decorator.cc +++ b/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/resource_policies/v1/resource_policies.proto #include "google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_metadata_decorator.h b/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_metadata_decorator.h index 4711b974a30ec..85c434e06d9fc 100644 --- a/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_metadata_decorator.h +++ b/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESOURCE_POLICIES_V1_INTERNAL_RESOURCE_POLICIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESOURCE_POLICIES_V1_INTERNAL_RESOURCE_POLICIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.h" +#include "google/cloud/compute/resource_policies/v1/resource_policies.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.cc b/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.cc index f0ba2ea4aa1c6..2cc4c962b70fe 100644 --- a/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.cc +++ b/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/resource_policies/v1/resource_policies.proto #include "google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/resource_policies/v1/resource_policies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.h b/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.h index abaca69ce51d6..12d8c10eff247 100644 --- a/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.h +++ b/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESOURCE_POLICIES_V1_INTERNAL_RESOURCE_POLICIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESOURCE_POLICIES_V1_INTERNAL_RESOURCE_POLICIES_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/resource_policies/v1/resource_policies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/resource_policies/v1/internal/resource_policies_tracing_connection.cc b/google/cloud/compute/resource_policies/v1/internal/resource_policies_tracing_connection.cc index c058576ebb84b..e3e9aa0ddec0f 100644 --- a/google/cloud/compute/resource_policies/v1/internal/resource_policies_tracing_connection.cc +++ b/google/cloud/compute/resource_policies/v1/internal/resource_policies_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_resource_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ResourcePoliciesTracingConnection::ResourcePoliciesTracingConnection( std::shared_ptr child) @@ -211,17 +209,13 @@ ResourcePoliciesTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeResourcePoliciesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/resource_policies/v1/internal/resource_policies_tracing_connection.h b/google/cloud/compute/resource_policies/v1/internal/resource_policies_tracing_connection.h index a71d26a73c141..5719108e08b81 100644 --- a/google/cloud/compute/resource_policies/v1/internal/resource_policies_tracing_connection.h +++ b/google/cloud/compute/resource_policies/v1/internal/resource_policies_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_resource_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ResourcePoliciesTracingConnection : public compute_resource_policies_v1::ResourcePoliciesConnection { public: @@ -108,8 +106,6 @@ class ResourcePoliciesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/resource_policies/v1/resource_policies_connection.h b/google/cloud/compute/resource_policies/v1/resource_policies_connection.h index c8fa418e08162..ab90573a2f082 100644 --- a/google/cloud/compute/resource_policies/v1/resource_policies_connection.h +++ b/google/cloud/compute/resource_policies/v1/resource_policies_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESOURCE_POLICIES_V1_RESOURCE_POLICIES_CONNECTION_H #include "google/cloud/compute/resource_policies/v1/internal/resource_policies_retry_traits.h" +#include "google/cloud/compute/resource_policies/v1/resource_policies.pb.h" #include "google/cloud/compute/resource_policies/v1/resource_policies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/resource_policies/v1/resource_policies_connection_idempotency_policy.h b/google/cloud/compute/resource_policies/v1/resource_policies_connection_idempotency_policy.h index 4c7ef4dffa090..7d43a94d8954e 100644 --- a/google/cloud/compute/resource_policies/v1/resource_policies_connection_idempotency_policy.h +++ b/google/cloud/compute/resource_policies/v1/resource_policies_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESOURCE_POLICIES_V1_RESOURCE_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESOURCE_POLICIES_V1_RESOURCE_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/resource_policies/v1/resource_policies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/resource_policies/v1/resource_policies_proto_export.h b/google/cloud/compute/resource_policies/v1/resource_policies_proto_export.h index f503bf1ac6b74..1863bee555dcf 100644 --- a/google/cloud/compute/resource_policies/v1/resource_policies_proto_export.h +++ b/google/cloud/compute/resource_policies/v1/resource_policies_proto_export.h @@ -26,12 +26,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESOURCE_POLICIES_V1_RESOURCE_POLICIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_108.pb.h" +#include "google/cloud/compute/v1/internal/common_114.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_RESOURCE_POLICIES_V1_RESOURCE_POLICIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/routers/v1/internal/routers_option_defaults.cc b/google/cloud/compute/routers/v1/internal/routers_option_defaults.cc index 7c768eb94cb11..9ed4cf6cb305d 100644 --- a/google/cloud/compute/routers/v1/internal/routers_option_defaults.cc +++ b/google/cloud/compute/routers/v1/internal/routers_option_defaults.cc @@ -41,7 +41,7 @@ Options RoutersDefaultOptions(Options options) { if (!options.has()) { options.set( compute_routers_v1::RoutersLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/routers/v1/internal/routers_rest_connection_impl.h b/google/cloud/compute/routers/v1/internal/routers_rest_connection_impl.h index 2d4a617742330..9b52454754c99 100644 --- a/google/cloud/compute/routers/v1/internal/routers_rest_connection_impl.h +++ b/google/cloud/compute/routers/v1/internal/routers_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTERS_V1_INTERNAL_ROUTERS_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTERS_V1_INTERNAL_ROUTERS_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/routers/v1/internal/routers_rest_stub.h" #include "google/cloud/compute/routers/v1/internal/routers_retry_traits.h" #include "google/cloud/compute/routers/v1/routers_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/routers/v1/internal/routers_rest_logging_decorator.h b/google/cloud/compute/routers/v1/internal/routers_rest_logging_decorator.h index b876b086b397c..eb10d4f068f4c 100644 --- a/google/cloud/compute/routers/v1/internal/routers_rest_logging_decorator.h +++ b/google/cloud/compute/routers/v1/internal/routers_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTERS_V1_INTERNAL_ROUTERS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTERS_V1_INTERNAL_ROUTERS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/routers/v1/internal/routers_rest_stub.h" +#include "google/cloud/compute/routers/v1/routers.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/routers/v1/internal/routers_rest_metadata_decorator.cc b/google/cloud/compute/routers/v1/internal/routers_rest_metadata_decorator.cc index 8a4d788979875..2763fe10af6c3 100644 --- a/google/cloud/compute/routers/v1/internal/routers_rest_metadata_decorator.cc +++ b/google/cloud/compute/routers/v1/internal/routers_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/routers/v1/routers.proto #include "google/cloud/compute/routers/v1/internal/routers_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/routers/v1/internal/routers_rest_metadata_decorator.h b/google/cloud/compute/routers/v1/internal/routers_rest_metadata_decorator.h index 2a5e45f2ec56a..3c31e3febaaff 100644 --- a/google/cloud/compute/routers/v1/internal/routers_rest_metadata_decorator.h +++ b/google/cloud/compute/routers/v1/internal/routers_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTERS_V1_INTERNAL_ROUTERS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTERS_V1_INTERNAL_ROUTERS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/routers/v1/internal/routers_rest_stub.h" +#include "google/cloud/compute/routers/v1/routers.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/routers/v1/internal/routers_rest_stub.cc b/google/cloud/compute/routers/v1/internal/routers_rest_stub.cc index 2606040dcf5dd..ee1096bf12dd3 100644 --- a/google/cloud/compute/routers/v1/internal/routers_rest_stub.cc +++ b/google/cloud/compute/routers/v1/internal/routers_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/routers/v1/routers.proto #include "google/cloud/compute/routers/v1/internal/routers_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/routers/v1/routers.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/routers/v1/internal/routers_rest_stub.h b/google/cloud/compute/routers/v1/internal/routers_rest_stub.h index 383e2eb8e5f6c..261af1927e8c7 100644 --- a/google/cloud/compute/routers/v1/internal/routers_rest_stub.h +++ b/google/cloud/compute/routers/v1/internal/routers_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTERS_V1_INTERNAL_ROUTERS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTERS_V1_INTERNAL_ROUTERS_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/routers/v1/routers.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/routers/v1/internal/routers_tracing_connection.cc b/google/cloud/compute/routers/v1/internal/routers_tracing_connection.cc index a19829b029e33..bec02c39781d1 100644 --- a/google/cloud/compute/routers/v1/internal/routers_tracing_connection.cc +++ b/google/cloud/compute/routers/v1/internal/routers_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_routers_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RoutersTracingConnection::RoutersTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -352,16 +350,12 @@ RoutersTracingConnection::UpdateRoutePolicy( child_->UpdateRoutePolicy(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRoutersTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/routers/v1/internal/routers_tracing_connection.h b/google/cloud/compute/routers/v1/internal/routers_tracing_connection.h index ea37526f9b7ab..ffbf63a3f295b 100644 --- a/google/cloud/compute/routers/v1/internal/routers_tracing_connection.h +++ b/google/cloud/compute/routers/v1/internal/routers_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_routers_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RoutersTracingConnection : public compute_routers_v1::RoutersConnection { public: ~RoutersTracingConnection() override = default; @@ -177,8 +175,6 @@ class RoutersTracingConnection : public compute_routers_v1::RoutersConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/routers/v1/routers_connection.h b/google/cloud/compute/routers/v1/routers_connection.h index 4df108018dfea..21f9c3e2fad74 100644 --- a/google/cloud/compute/routers/v1/routers_connection.h +++ b/google/cloud/compute/routers/v1/routers_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTERS_V1_ROUTERS_CONNECTION_H #include "google/cloud/compute/routers/v1/internal/routers_retry_traits.h" +#include "google/cloud/compute/routers/v1/routers.pb.h" #include "google/cloud/compute/routers/v1/routers_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/routers/v1/routers_connection_idempotency_policy.h b/google/cloud/compute/routers/v1/routers_connection_idempotency_policy.h index 41b4649d0cc1e..f1de3e599d65b 100644 --- a/google/cloud/compute/routers/v1/routers_connection_idempotency_policy.h +++ b/google/cloud/compute/routers/v1/routers_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTERS_V1_ROUTERS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTERS_V1_ROUTERS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/routers/v1/routers.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/routers/v1/routers_proto_export.h b/google/cloud/compute/routers/v1/routers_proto_export.h index 8568f15792a1c..405c57335485c 100644 --- a/google/cloud/compute/routers/v1/routers_proto_export.h +++ b/google/cloud/compute/routers/v1/routers_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTERS_V1_ROUTERS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_013.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_115.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTERS_V1_ROUTERS_PROTO_EXPORT_H diff --git a/google/cloud/compute/routes/v1/internal/routes_option_defaults.cc b/google/cloud/compute/routes/v1/internal/routes_option_defaults.cc index 7b0caf91286da..d00860ec0b76a 100644 --- a/google/cloud/compute/routes/v1/internal/routes_option_defaults.cc +++ b/google/cloud/compute/routes/v1/internal/routes_option_defaults.cc @@ -41,7 +41,7 @@ Options RoutesDefaultOptions(Options options) { if (!options.has()) { options.set( compute_routes_v1::RoutesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/routes/v1/internal/routes_rest_connection_impl.h b/google/cloud/compute/routes/v1/internal/routes_rest_connection_impl.h index 484d1ba128eaa..115a2ef2757ef 100644 --- a/google/cloud/compute/routes/v1/internal/routes_rest_connection_impl.h +++ b/google/cloud/compute/routes/v1/internal/routes_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTES_V1_INTERNAL_ROUTES_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTES_V1_INTERNAL_ROUTES_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/routes/v1/internal/routes_rest_stub.h" #include "google/cloud/compute/routes/v1/internal/routes_retry_traits.h" #include "google/cloud/compute/routes/v1/routes_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/routes/v1/internal/routes_rest_logging_decorator.h b/google/cloud/compute/routes/v1/internal/routes_rest_logging_decorator.h index 619698a3ac8d6..7a8a9ea8ed26f 100644 --- a/google/cloud/compute/routes/v1/internal/routes_rest_logging_decorator.h +++ b/google/cloud/compute/routes/v1/internal/routes_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTES_V1_INTERNAL_ROUTES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTES_V1_INTERNAL_ROUTES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/routes/v1/internal/routes_rest_stub.h" +#include "google/cloud/compute/routes/v1/routes.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/routes/v1/internal/routes_rest_metadata_decorator.cc b/google/cloud/compute/routes/v1/internal/routes_rest_metadata_decorator.cc index 34d8d66a5b2f1..818766a2b48e6 100644 --- a/google/cloud/compute/routes/v1/internal/routes_rest_metadata_decorator.cc +++ b/google/cloud/compute/routes/v1/internal/routes_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/routes/v1/routes.proto #include "google/cloud/compute/routes/v1/internal/routes_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/routes/v1/internal/routes_rest_metadata_decorator.h b/google/cloud/compute/routes/v1/internal/routes_rest_metadata_decorator.h index d24bd8673ec9f..50258b5aad3bc 100644 --- a/google/cloud/compute/routes/v1/internal/routes_rest_metadata_decorator.h +++ b/google/cloud/compute/routes/v1/internal/routes_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTES_V1_INTERNAL_ROUTES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTES_V1_INTERNAL_ROUTES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/routes/v1/internal/routes_rest_stub.h" +#include "google/cloud/compute/routes/v1/routes.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/routes/v1/internal/routes_rest_stub.cc b/google/cloud/compute/routes/v1/internal/routes_rest_stub.cc index d0fff81074c4e..eacfd65950be4 100644 --- a/google/cloud/compute/routes/v1/internal/routes_rest_stub.cc +++ b/google/cloud/compute/routes/v1/internal/routes_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/routes/v1/routes.proto #include "google/cloud/compute/routes/v1/internal/routes_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/routes/v1/routes.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/routes/v1/internal/routes_rest_stub.h b/google/cloud/compute/routes/v1/internal/routes_rest_stub.h index 9a21682581483..9ed3cd9f4246d 100644 --- a/google/cloud/compute/routes/v1/internal/routes_rest_stub.h +++ b/google/cloud/compute/routes/v1/internal/routes_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTES_V1_INTERNAL_ROUTES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTES_V1_INTERNAL_ROUTES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/routes/v1/routes.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/routes/v1/internal/routes_tracing_connection.cc b/google/cloud/compute/routes/v1/internal/routes_tracing_connection.cc index 0e2c9e08c513e..5b0b2b32276be 100644 --- a/google/cloud/compute/routes/v1/internal/routes_tracing_connection.cc +++ b/google/cloud/compute/routes/v1/internal/routes_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_routes_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RoutesTracingConnection::RoutesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -113,16 +111,12 @@ RoutesTracingConnection::ListRoutes( google::cloud::cpp::compute::v1::Route>(std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRoutesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/routes/v1/internal/routes_tracing_connection.h b/google/cloud/compute/routes/v1/internal/routes_tracing_connection.h index 23be80fbfceba..9fa1a83a198a2 100644 --- a/google/cloud/compute/routes/v1/internal/routes_tracing_connection.h +++ b/google/cloud/compute/routes/v1/internal/routes_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_routes_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RoutesTracingConnection : public compute_routes_v1::RoutesConnection { public: ~RoutesTracingConnection() override = default; @@ -75,8 +73,6 @@ class RoutesTracingConnection : public compute_routes_v1::RoutesConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/routes/v1/routes_connection.h b/google/cloud/compute/routes/v1/routes_connection.h index b950e3ec2013f..1ee615c1fa68f 100644 --- a/google/cloud/compute/routes/v1/routes_connection.h +++ b/google/cloud/compute/routes/v1/routes_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTES_V1_ROUTES_CONNECTION_H #include "google/cloud/compute/routes/v1/internal/routes_retry_traits.h" +#include "google/cloud/compute/routes/v1/routes.pb.h" #include "google/cloud/compute/routes/v1/routes_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/routes/v1/routes_connection_idempotency_policy.h b/google/cloud/compute/routes/v1/routes_connection_idempotency_policy.h index 1ad279af6c4e9..bdbd0ca4e2128 100644 --- a/google/cloud/compute/routes/v1/routes_connection_idempotency_policy.h +++ b/google/cloud/compute/routes/v1/routes_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTES_V1_ROUTES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTES_V1_ROUTES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/routes/v1/routes.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/routes/v1/routes_proto_export.h b/google/cloud/compute/routes/v1/routes_proto_export.h index 8e4038d6b9dca..f6371fbf47845 100644 --- a/google/cloud/compute/routes/v1/routes_proto_export.h +++ b/google/cloud/compute/routes/v1/routes_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTES_V1_ROUTES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_115.pb.h" +#include "google/cloud/compute/v1/internal/common_116.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ROUTES_V1_ROUTES_PROTO_EXPORT_H diff --git a/google/cloud/compute/samples/disk_samples.cc b/google/cloud/compute/samples/disk_samples.cc index babb641559fa9..68e00ff7e9efc 100644 --- a/google/cloud/compute/samples/disk_samples.cc +++ b/google/cloud/compute/samples/disk_samples.cc @@ -14,11 +14,11 @@ #include "google/cloud/compute/disks/v1/disks_client.h" #include "google/cloud/future.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/random.h" #include "google/cloud/status_or.h" #include "google/cloud/testing_util/example_driver.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_split.h" #include #include diff --git a/google/cloud/compute/security_policies/v1/internal/security_policies_option_defaults.cc b/google/cloud/compute/security_policies/v1/internal/security_policies_option_defaults.cc index e64418fb0222a..cf6e9cd69b16e 100644 --- a/google/cloud/compute/security_policies/v1/internal/security_policies_option_defaults.cc +++ b/google/cloud/compute/security_policies/v1/internal/security_policies_option_defaults.cc @@ -43,7 +43,7 @@ Options SecurityPoliciesDefaultOptions(Options options) { options.set< compute_security_policies_v1::SecurityPoliciesRetryPolicyOption>( compute_security_policies_v1::SecurityPoliciesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/security_policies/v1/internal/security_policies_rest_logging_decorator.h b/google/cloud/compute/security_policies/v1/internal/security_policies_rest_logging_decorator.h index ba82168ad1ee9..20402dde3f2e7 100644 --- a/google/cloud/compute/security_policies/v1/internal/security_policies_rest_logging_decorator.h +++ b/google/cloud/compute/security_policies/v1/internal/security_policies_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SECURITY_POLICIES_V1_INTERNAL_SECURITY_POLICIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SECURITY_POLICIES_V1_INTERNAL_SECURITY_POLICIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.h" +#include "google/cloud/compute/security_policies/v1/security_policies.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/security_policies/v1/internal/security_policies_rest_metadata_decorator.cc b/google/cloud/compute/security_policies/v1/internal/security_policies_rest_metadata_decorator.cc index 476106d66f799..8fe85dfe543ad 100644 --- a/google/cloud/compute/security_policies/v1/internal/security_policies_rest_metadata_decorator.cc +++ b/google/cloud/compute/security_policies/v1/internal/security_policies_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/security_policies/v1/security_policies.proto #include "google/cloud/compute/security_policies/v1/internal/security_policies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/security_policies/v1/internal/security_policies_rest_metadata_decorator.h b/google/cloud/compute/security_policies/v1/internal/security_policies_rest_metadata_decorator.h index 45a67bbddfc09..6332448222e4b 100644 --- a/google/cloud/compute/security_policies/v1/internal/security_policies_rest_metadata_decorator.h +++ b/google/cloud/compute/security_policies/v1/internal/security_policies_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SECURITY_POLICIES_V1_INTERNAL_SECURITY_POLICIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SECURITY_POLICIES_V1_INTERNAL_SECURITY_POLICIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.h" +#include "google/cloud/compute/security_policies/v1/security_policies.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.cc b/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.cc index be4f6427460df..b7c67b03195af 100644 --- a/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.cc +++ b/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/security_policies/v1/security_policies.proto #include "google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/security_policies/v1/security_policies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.h b/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.h index d31b2a64a9bcc..ef24bddad43fc 100644 --- a/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.h +++ b/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SECURITY_POLICIES_V1_INTERNAL_SECURITY_POLICIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SECURITY_POLICIES_V1_INTERNAL_SECURITY_POLICIES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/security_policies/v1/security_policies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/security_policies/v1/internal/security_policies_tracing_connection.cc b/google/cloud/compute/security_policies/v1/internal/security_policies_tracing_connection.cc index 6d76f78379fcd..4ba0ffb3c9261 100644 --- a/google/cloud/compute/security_policies/v1/internal/security_policies_tracing_connection.cc +++ b/google/cloud/compute/security_policies/v1/internal/security_policies_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_security_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SecurityPoliciesTracingConnection::SecurityPoliciesTracingConnection( std::shared_ptr child) @@ -323,17 +321,13 @@ SecurityPoliciesTracingConnection::SetLabels( return internal::EndSpan(std::move(span), child_->SetLabels(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSecurityPoliciesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/security_policies/v1/internal/security_policies_tracing_connection.h b/google/cloud/compute/security_policies/v1/internal/security_policies_tracing_connection.h index 09b5130bad045..71f273778d6d3 100644 --- a/google/cloud/compute/security_policies/v1/internal/security_policies_tracing_connection.h +++ b/google/cloud/compute/security_policies/v1/internal/security_policies_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_security_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SecurityPoliciesTracingConnection : public compute_security_policies_v1::SecurityPoliciesConnection { public: @@ -151,8 +149,6 @@ class SecurityPoliciesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/security_policies/v1/security_policies_connection.h b/google/cloud/compute/security_policies/v1/security_policies_connection.h index 021f303f2b437..97ed465bd69df 100644 --- a/google/cloud/compute/security_policies/v1/security_policies_connection.h +++ b/google/cloud/compute/security_policies/v1/security_policies_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SECURITY_POLICIES_V1_SECURITY_POLICIES_CONNECTION_H #include "google/cloud/compute/security_policies/v1/internal/security_policies_retry_traits.h" +#include "google/cloud/compute/security_policies/v1/security_policies.pb.h" #include "google/cloud/compute/security_policies/v1/security_policies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/security_policies/v1/security_policies_connection_idempotency_policy.h b/google/cloud/compute/security_policies/v1/security_policies_connection_idempotency_policy.h index 4e69ed4712483..ad6e6e97bf2d8 100644 --- a/google/cloud/compute/security_policies/v1/security_policies_connection_idempotency_policy.h +++ b/google/cloud/compute/security_policies/v1/security_policies_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SECURITY_POLICIES_V1_SECURITY_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SECURITY_POLICIES_V1_SECURITY_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/security_policies/v1/security_policies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/security_policies/v1/security_policies_proto_export.h b/google/cloud/compute/security_policies/v1/security_policies_proto_export.h index 5194fad56d50c..bd3ba6eb69771 100644 --- a/google/cloud/compute/security_policies/v1/security_policies_proto_export.h +++ b/google/cloud/compute/security_policies/v1/security_policies_proto_export.h @@ -26,11 +26,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SECURITY_POLICIES_V1_SECURITY_POLICIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_046.pb.h" +#include "google/cloud/compute/v1/internal/common_094.pb.h" +#include "google/cloud/compute/v1/internal/common_117.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SECURITY_POLICIES_V1_SECURITY_POLICIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/service_attachments/v1/internal/service_attachments_option_defaults.cc b/google/cloud/compute/service_attachments/v1/internal/service_attachments_option_defaults.cc index 09606a0e98dae..b61771f6edc9d 100644 --- a/google/cloud/compute/service_attachments/v1/internal/service_attachments_option_defaults.cc +++ b/google/cloud/compute/service_attachments/v1/internal/service_attachments_option_defaults.cc @@ -44,7 +44,7 @@ Options ServiceAttachmentsDefaultOptions(Options options) { options.set< compute_service_attachments_v1::ServiceAttachmentsRetryPolicyOption>( compute_service_attachments_v1:: - ServiceAttachmentsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + ServiceAttachmentsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_logging_decorator.h b/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_logging_decorator.h index f236ea0db0817..b601ccafddd24 100644 --- a/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_logging_decorator.h +++ b/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SERVICE_ATTACHMENTS_V1_INTERNAL_SERVICE_ATTACHMENTS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SERVICE_ATTACHMENTS_V1_INTERNAL_SERVICE_ATTACHMENTS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.h" +#include "google/cloud/compute/service_attachments/v1/service_attachments.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_metadata_decorator.cc b/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_metadata_decorator.cc index 9dc3870bec941..0f6e0fcaefffa 100644 --- a/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_metadata_decorator.cc +++ b/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/service_attachments/v1/service_attachments.proto #include "google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_metadata_decorator.h b/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_metadata_decorator.h index 7ad94d39f421d..87b5c3684efe9 100644 --- a/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_metadata_decorator.h +++ b/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SERVICE_ATTACHMENTS_V1_INTERNAL_SERVICE_ATTACHMENTS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SERVICE_ATTACHMENTS_V1_INTERNAL_SERVICE_ATTACHMENTS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.h" +#include "google/cloud/compute/service_attachments/v1/service_attachments.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.cc b/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.cc index 9506c084d0663..340878aa67e93 100644 --- a/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.cc +++ b/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/service_attachments/v1/service_attachments.proto #include "google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/service_attachments/v1/service_attachments.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.h b/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.h index b010812dd769e..39e99d0b95e38 100644 --- a/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.h +++ b/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SERVICE_ATTACHMENTS_V1_INTERNAL_SERVICE_ATTACHMENTS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SERVICE_ATTACHMENTS_V1_INTERNAL_SERVICE_ATTACHMENTS_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/service_attachments/v1/service_attachments.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/service_attachments/v1/internal/service_attachments_tracing_connection.cc b/google/cloud/compute/service_attachments/v1/internal/service_attachments_tracing_connection.cc index ce618d8c07900..928899ba92544 100644 --- a/google/cloud/compute/service_attachments/v1/internal/service_attachments_tracing_connection.cc +++ b/google/cloud/compute/service_attachments/v1/internal/service_attachments_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_service_attachments_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServiceAttachmentsTracingConnection::ServiceAttachmentsTracingConnection( std::shared_ptr< compute_service_attachments_v1::ServiceAttachmentsConnection> @@ -214,19 +212,15 @@ ServiceAttachmentsTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServiceAttachmentsTracingConnection( std::shared_ptr< compute_service_attachments_v1::ServiceAttachmentsConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/service_attachments/v1/internal/service_attachments_tracing_connection.h b/google/cloud/compute/service_attachments/v1/internal/service_attachments_tracing_connection.h index 6a1fd76e5bdbd..4f3c9dfc6f891 100644 --- a/google/cloud/compute/service_attachments/v1/internal/service_attachments_tracing_connection.h +++ b/google/cloud/compute/service_attachments/v1/internal/service_attachments_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_service_attachments_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServiceAttachmentsTracingConnection : public compute_service_attachments_v1::ServiceAttachmentsConnection { public: @@ -113,8 +111,6 @@ class ServiceAttachmentsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/service_attachments/v1/service_attachments_connection.h b/google/cloud/compute/service_attachments/v1/service_attachments_connection.h index 721b78f8eb962..85212762222ef 100644 --- a/google/cloud/compute/service_attachments/v1/service_attachments_connection.h +++ b/google/cloud/compute/service_attachments/v1/service_attachments_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SERVICE_ATTACHMENTS_V1_SERVICE_ATTACHMENTS_CONNECTION_H #include "google/cloud/compute/service_attachments/v1/internal/service_attachments_retry_traits.h" +#include "google/cloud/compute/service_attachments/v1/service_attachments.pb.h" #include "google/cloud/compute/service_attachments/v1/service_attachments_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/service_attachments/v1/service_attachments_connection_idempotency_policy.h b/google/cloud/compute/service_attachments/v1/service_attachments_connection_idempotency_policy.h index 765cff96dec10..058b89907d6d6 100644 --- a/google/cloud/compute/service_attachments/v1/service_attachments_connection_idempotency_policy.h +++ b/google/cloud/compute/service_attachments/v1/service_attachments_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SERVICE_ATTACHMENTS_V1_SERVICE_ATTACHMENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SERVICE_ATTACHMENTS_V1_SERVICE_ATTACHMENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/service_attachments/v1/service_attachments.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/service_attachments/v1/service_attachments_proto_export.h b/google/cloud/compute/service_attachments/v1/service_attachments_proto_export.h index a1925f34d90ab..4d61226dba6e7 100644 --- a/google/cloud/compute/service_attachments/v1/service_attachments_proto_export.h +++ b/google/cloud/compute/service_attachments/v1/service_attachments_proto_export.h @@ -26,12 +26,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SERVICE_ATTACHMENTS_V1_SERVICE_ATTACHMENTS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_108.pb.h" +#include "google/cloud/compute/v1/internal/common_119.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SERVICE_ATTACHMENTS_V1_SERVICE_ATTACHMENTS_PROTO_EXPORT_H diff --git a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_option_defaults.cc b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_option_defaults.cc index 532a305e503eb..e2e0929eece9a 100644 --- a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_option_defaults.cc +++ b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_option_defaults.cc @@ -43,7 +43,7 @@ Options SnapshotSettingsDefaultOptions(Options options) { options.set< compute_snapshot_settings_v1::SnapshotSettingsRetryPolicyOption>( compute_snapshot_settings_v1::SnapshotSettingsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_logging_decorator.h b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_logging_decorator.h index 19593ffd28765..7233f2e6f389f 100644 --- a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_logging_decorator.h +++ b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOT_SETTINGS_V1_INTERNAL_SNAPSHOT_SETTINGS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOT_SETTINGS_V1_INTERNAL_SNAPSHOT_SETTINGS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.h" +#include "google/cloud/compute/snapshot_settings/v1/snapshot_settings.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_metadata_decorator.cc b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_metadata_decorator.cc index 75533922504ca..68b4e11bf4a2d 100644 --- a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_metadata_decorator.cc +++ b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/snapshot_settings/v1/snapshot_settings.proto #include "google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_metadata_decorator.h b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_metadata_decorator.h index 52b906f692891..2853c9eb7da28 100644 --- a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_metadata_decorator.h +++ b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOT_SETTINGS_V1_INTERNAL_SNAPSHOT_SETTINGS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOT_SETTINGS_V1_INTERNAL_SNAPSHOT_SETTINGS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.h" +#include "google/cloud/compute/snapshot_settings/v1/snapshot_settings.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.cc b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.cc index 87279b266ce64..31b1eee7a2706 100644 --- a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.cc +++ b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/snapshot_settings/v1/snapshot_settings.proto #include "google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/snapshot_settings/v1/snapshot_settings.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.h b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.h index deb40a51e5de8..0a0935a601700 100644 --- a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.h +++ b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOT_SETTINGS_V1_INTERNAL_SNAPSHOT_SETTINGS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOT_SETTINGS_V1_INTERNAL_SNAPSHOT_SETTINGS_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/snapshot_settings/v1/snapshot_settings.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_tracing_connection.cc b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_tracing_connection.cc index 222d7416233b6..368d500162005 100644 --- a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_tracing_connection.cc +++ b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace compute_snapshot_settings_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SnapshotSettingsTracingConnection::SnapshotSettingsTracingConnection( std::shared_ptr child) @@ -79,17 +77,13 @@ SnapshotSettingsTracingConnection::PatchSnapshotSettings( child_->PatchSnapshotSettings(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSnapshotSettingsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_tracing_connection.h b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_tracing_connection.h index 0da5df1399c62..8f1864998229f 100644 --- a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_tracing_connection.h +++ b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_snapshot_settings_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SnapshotSettingsTracingConnection : public compute_snapshot_settings_v1::SnapshotSettingsConnection { public: @@ -63,8 +61,6 @@ class SnapshotSettingsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/snapshot_settings/v1/snapshot_settings_connection.h b/google/cloud/compute/snapshot_settings/v1/snapshot_settings_connection.h index 0e3c39e4ef327..15f2323e63bde 100644 --- a/google/cloud/compute/snapshot_settings/v1/snapshot_settings_connection.h +++ b/google/cloud/compute/snapshot_settings/v1/snapshot_settings_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOT_SETTINGS_V1_SNAPSHOT_SETTINGS_CONNECTION_H #include "google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_retry_traits.h" +#include "google/cloud/compute/snapshot_settings/v1/snapshot_settings.pb.h" #include "google/cloud/compute/snapshot_settings/v1/snapshot_settings_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -29,7 +30,6 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/snapshot_settings/v1/snapshot_settings_connection_idempotency_policy.h b/google/cloud/compute/snapshot_settings/v1/snapshot_settings_connection_idempotency_policy.h index d05e1ddfc2e8e..706a47cb52204 100644 --- a/google/cloud/compute/snapshot_settings/v1/snapshot_settings_connection_idempotency_policy.h +++ b/google/cloud/compute/snapshot_settings/v1/snapshot_settings_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOT_SETTINGS_V1_SNAPSHOT_SETTINGS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOT_SETTINGS_V1_SNAPSHOT_SETTINGS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/snapshot_settings/v1/snapshot_settings.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/snapshot_settings/v1/snapshot_settings_proto_export.h b/google/cloud/compute/snapshot_settings/v1/snapshot_settings_proto_export.h index 1c262d13488be..cff16a8f85b49 100644 --- a/google/cloud/compute/snapshot_settings/v1/snapshot_settings_proto_export.h +++ b/google/cloud/compute/snapshot_settings/v1/snapshot_settings_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOT_SETTINGS_V1_SNAPSHOT_SETTINGS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_124.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOT_SETTINGS_V1_SNAPSHOT_SETTINGS_PROTO_EXPORT_H diff --git a/google/cloud/compute/snapshots/v1/internal/snapshots_option_defaults.cc b/google/cloud/compute/snapshots/v1/internal/snapshots_option_defaults.cc index f3f2d86b9a70d..c9168053b7b93 100644 --- a/google/cloud/compute/snapshots/v1/internal/snapshots_option_defaults.cc +++ b/google/cloud/compute/snapshots/v1/internal/snapshots_option_defaults.cc @@ -41,7 +41,7 @@ Options SnapshotsDefaultOptions(Options options) { if (!options.has()) { options.set( compute_snapshots_v1::SnapshotsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_connection_impl.h b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_connection_impl.h index 60e4dbe01161f..845f6fdd46732 100644 --- a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_connection_impl.h +++ b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOTS_V1_INTERNAL_SNAPSHOTS_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOTS_V1_INTERNAL_SNAPSHOTS_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.h" #include "google/cloud/compute/snapshots/v1/internal/snapshots_retry_traits.h" #include "google/cloud/compute/snapshots/v1/snapshots_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_logging_decorator.h b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_logging_decorator.h index bf10795f30cc5..bd987a7bea166 100644 --- a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_logging_decorator.h +++ b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOTS_V1_INTERNAL_SNAPSHOTS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOTS_V1_INTERNAL_SNAPSHOTS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.h" +#include "google/cloud/compute/snapshots/v1/snapshots.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_metadata_decorator.cc b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_metadata_decorator.cc index c8ddd6b42abcf..703d7346314ac 100644 --- a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_metadata_decorator.cc +++ b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/snapshots/v1/snapshots.proto #include "google/cloud/compute/snapshots/v1/internal/snapshots_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_metadata_decorator.h b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_metadata_decorator.h index 103fc8cc1b7c9..10a45c4d89a56 100644 --- a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_metadata_decorator.h +++ b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOTS_V1_INTERNAL_SNAPSHOTS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOTS_V1_INTERNAL_SNAPSHOTS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.h" +#include "google/cloud/compute/snapshots/v1/snapshots.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.cc b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.cc index 814221457f5e5..a9511128179d8 100644 --- a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.cc +++ b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/snapshots/v1/snapshots.proto #include "google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/snapshots/v1/snapshots.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.h b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.h index 3e50a7f6e427a..875ac41116211 100644 --- a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.h +++ b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOTS_V1_INTERNAL_SNAPSHOTS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOTS_V1_INTERNAL_SNAPSHOTS_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/snapshots/v1/snapshots.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/snapshots/v1/internal/snapshots_tracing_connection.cc b/google/cloud/compute/snapshots/v1/internal/snapshots_tracing_connection.cc index 4b51382eed3a6..45fc0a248e50d 100644 --- a/google/cloud/compute/snapshots/v1/internal/snapshots_tracing_connection.cc +++ b/google/cloud/compute/snapshots/v1/internal/snapshots_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_snapshots_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SnapshotsTracingConnection::SnapshotsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -177,16 +175,12 @@ SnapshotsTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSnapshotsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/snapshots/v1/internal/snapshots_tracing_connection.h b/google/cloud/compute/snapshots/v1/internal/snapshots_tracing_connection.h index e367a41bad8bb..ce137314de40b 100644 --- a/google/cloud/compute/snapshots/v1/internal/snapshots_tracing_connection.h +++ b/google/cloud/compute/snapshots/v1/internal/snapshots_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_snapshots_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SnapshotsTracingConnection : public compute_snapshots_v1::SnapshotsConnection { public: @@ -100,8 +98,6 @@ class SnapshotsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/snapshots/v1/snapshots_connection.h b/google/cloud/compute/snapshots/v1/snapshots_connection.h index 7a0ddd4fb2902..c8478224c89bd 100644 --- a/google/cloud/compute/snapshots/v1/snapshots_connection.h +++ b/google/cloud/compute/snapshots/v1/snapshots_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOTS_V1_SNAPSHOTS_CONNECTION_H #include "google/cloud/compute/snapshots/v1/internal/snapshots_retry_traits.h" +#include "google/cloud/compute/snapshots/v1/snapshots.pb.h" #include "google/cloud/compute/snapshots/v1/snapshots_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/snapshots/v1/snapshots_connection_idempotency_policy.h b/google/cloud/compute/snapshots/v1/snapshots_connection_idempotency_policy.h index 25d19847ebcfa..f3d7fed50796b 100644 --- a/google/cloud/compute/snapshots/v1/snapshots_connection_idempotency_policy.h +++ b/google/cloud/compute/snapshots/v1/snapshots_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOTS_V1_SNAPSHOTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOTS_V1_SNAPSHOTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/snapshots/v1/snapshots.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/snapshots/v1/snapshots_proto_export.h b/google/cloud/compute/snapshots/v1/snapshots_proto_export.h index bec6d57f7ec38..20047a2da893a 100644 --- a/google/cloud/compute/snapshots/v1/snapshots_proto_export.h +++ b/google/cloud/compute/snapshots/v1/snapshots_proto_export.h @@ -26,15 +26,15 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOTS_V1_SNAPSHOTS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_021.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_046.pb.h" +#include "google/cloud/compute/v1/internal/common_047.pb.h" +#include "google/cloud/compute/v1/internal/common_122.pb.h" +#include "google/cloud/compute/v1/internal/common_123.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SNAPSHOTS_V1_SNAPSHOTS_PROTO_EXPORT_H diff --git a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_option_defaults.cc b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_option_defaults.cc index 07736fe84ade8..400f8451df365 100644 --- a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_option_defaults.cc +++ b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_option_defaults.cc @@ -42,7 +42,7 @@ Options SslCertificatesDefaultOptions(Options options) { compute_ssl_certificates_v1::SslCertificatesRetryPolicyOption>()) { options.set( compute_ssl_certificates_v1::SslCertificatesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_connection_impl.h b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_connection_impl.h index e4f8115f2e3b1..7dfbfbf90da44 100644 --- a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_connection_impl.h +++ b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_CERTIFICATES_V1_INTERNAL_SSL_CERTIFICATES_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_CERTIFICATES_V1_INTERNAL_SSL_CERTIFICATES_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.h" #include "google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_retry_traits.h" #include "google/cloud/compute/ssl_certificates/v1/ssl_certificates_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_logging_decorator.h b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_logging_decorator.h index 0fce342ed2dfc..59006b0a7867f 100644 --- a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_logging_decorator.h +++ b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_CERTIFICATES_V1_INTERNAL_SSL_CERTIFICATES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_CERTIFICATES_V1_INTERNAL_SSL_CERTIFICATES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.h" +#include "google/cloud/compute/ssl_certificates/v1/ssl_certificates.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_metadata_decorator.cc b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_metadata_decorator.cc index 285f720e9d5d5..8bb107f3e34ed 100644 --- a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_metadata_decorator.cc +++ b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/ssl_certificates/v1/ssl_certificates.proto #include "google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_metadata_decorator.h b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_metadata_decorator.h index 91b2e1d60788f..8a0ae79059425 100644 --- a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_metadata_decorator.h +++ b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_CERTIFICATES_V1_INTERNAL_SSL_CERTIFICATES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_CERTIFICATES_V1_INTERNAL_SSL_CERTIFICATES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.h" +#include "google/cloud/compute/ssl_certificates/v1/ssl_certificates.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.cc b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.cc index f2a92215a56f9..14b6928255a9f 100644 --- a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.cc +++ b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/ssl_certificates/v1/ssl_certificates.proto #include "google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/ssl_certificates/v1/ssl_certificates.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.h b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.h index 71889b1b82c70..61263482b4664 100644 --- a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.h +++ b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_CERTIFICATES_V1_INTERNAL_SSL_CERTIFICATES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_CERTIFICATES_V1_INTERNAL_SSL_CERTIFICATES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/ssl_certificates/v1/ssl_certificates.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_tracing_connection.cc b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_tracing_connection.cc index 269484d7d4a5c..d2734728e653d 100644 --- a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_tracing_connection.cc +++ b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_ssl_certificates_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SslCertificatesTracingConnection::SslCertificatesTracingConnection( std::shared_ptr child) @@ -144,17 +142,13 @@ SslCertificatesTracingConnection::ListSslCertificates( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSslCertificatesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_tracing_connection.h b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_tracing_connection.h index 4d2572c714c1d..2785c8c2ce6f7 100644 --- a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_tracing_connection.h +++ b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_ssl_certificates_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SslCertificatesTracingConnection : public compute_ssl_certificates_v1::SslCertificatesConnection { public: @@ -84,8 +82,6 @@ class SslCertificatesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/ssl_certificates/v1/ssl_certificates_connection.h b/google/cloud/compute/ssl_certificates/v1/ssl_certificates_connection.h index b6aa5e0baeef1..150fd82c2ffff 100644 --- a/google/cloud/compute/ssl_certificates/v1/ssl_certificates_connection.h +++ b/google/cloud/compute/ssl_certificates/v1/ssl_certificates_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_CERTIFICATES_V1_SSL_CERTIFICATES_CONNECTION_H #include "google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_retry_traits.h" +#include "google/cloud/compute/ssl_certificates/v1/ssl_certificates.pb.h" #include "google/cloud/compute/ssl_certificates/v1/ssl_certificates_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/ssl_certificates/v1/ssl_certificates_connection_idempotency_policy.h b/google/cloud/compute/ssl_certificates/v1/ssl_certificates_connection_idempotency_policy.h index ae8a6493b25bb..53b45f5828937 100644 --- a/google/cloud/compute/ssl_certificates/v1/ssl_certificates_connection_idempotency_policy.h +++ b/google/cloud/compute/ssl_certificates/v1/ssl_certificates_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_CERTIFICATES_V1_SSL_CERTIFICATES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_CERTIFICATES_V1_SSL_CERTIFICATES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/ssl_certificates/v1/ssl_certificates.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/ssl_certificates/v1/ssl_certificates_proto_export.h b/google/cloud/compute/ssl_certificates/v1/ssl_certificates_proto_export.h index 112733883b6ef..35f1555726484 100644 --- a/google/cloud/compute/ssl_certificates/v1/ssl_certificates_proto_export.h +++ b/google/cloud/compute/ssl_certificates/v1/ssl_certificates_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_CERTIFICATES_V1_SSL_CERTIFICATES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_125.pb.h" +#include "google/cloud/compute/v1/internal/common_126.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_CERTIFICATES_V1_SSL_CERTIFICATES_PROTO_EXPORT_H diff --git a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_option_defaults.cc b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_option_defaults.cc index 37e9bc8a11ce6..642d227e94b86 100644 --- a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_option_defaults.cc +++ b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_option_defaults.cc @@ -41,7 +41,7 @@ Options SslPoliciesDefaultOptions(Options options) { if (!options.has()) { options.set( compute_ssl_policies_v1::SslPoliciesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_connection_impl.h b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_connection_impl.h index 66e08e0f7d810..1a81b577fea29 100644 --- a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_connection_impl.h +++ b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_POLICIES_V1_INTERNAL_SSL_POLICIES_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_POLICIES_V1_INTERNAL_SSL_POLICIES_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.h" #include "google/cloud/compute/ssl_policies/v1/internal/ssl_policies_retry_traits.h" #include "google/cloud/compute/ssl_policies/v1/ssl_policies_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_logging_decorator.h b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_logging_decorator.h index 9617bc2f94b60..f7a33160a4dd6 100644 --- a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_logging_decorator.h +++ b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_POLICIES_V1_INTERNAL_SSL_POLICIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_POLICIES_V1_INTERNAL_SSL_POLICIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.h" +#include "google/cloud/compute/ssl_policies/v1/ssl_policies.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_metadata_decorator.cc b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_metadata_decorator.cc index c42b8f752c247..d4db200cbf7a5 100644 --- a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_metadata_decorator.cc +++ b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/ssl_policies/v1/ssl_policies.proto #include "google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_metadata_decorator.h b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_metadata_decorator.h index 300cbc935368e..7c2c82c11b6c4 100644 --- a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_metadata_decorator.h +++ b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_POLICIES_V1_INTERNAL_SSL_POLICIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_POLICIES_V1_INTERNAL_SSL_POLICIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.h" +#include "google/cloud/compute/ssl_policies/v1/ssl_policies.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.cc b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.cc index 8487fbf07d40e..3f1d8fadd59dc 100644 --- a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.cc +++ b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/ssl_policies/v1/ssl_policies.proto #include "google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/ssl_policies/v1/ssl_policies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.h b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.h index 895e5b1211abd..fafd63f2f5c11 100644 --- a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.h +++ b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_POLICIES_V1_INTERNAL_SSL_POLICIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_POLICIES_V1_INTERNAL_SSL_POLICIES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/ssl_policies/v1/ssl_policies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_tracing_connection.cc b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_tracing_connection.cc index 43e0610506760..d38edaad6881b 100644 --- a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_tracing_connection.cc +++ b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_ssl_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SslPoliciesTracingConnection::SslPoliciesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -175,16 +173,12 @@ SslPoliciesTracingConnection::PatchSslPolicy( return internal::EndSpan(std::move(span), child_->PatchSslPolicy(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSslPoliciesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_tracing_connection.h b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_tracing_connection.h index f6086b5de18b4..2a121ea1839b4 100644 --- a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_tracing_connection.h +++ b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_ssl_policies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SslPoliciesTracingConnection : public compute_ssl_policies_v1::SslPoliciesConnection { public: @@ -97,8 +95,6 @@ class SslPoliciesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/ssl_policies/v1/ssl_policies_connection.h b/google/cloud/compute/ssl_policies/v1/ssl_policies_connection.h index d4efb50ebc6b7..cc89ae5f2a99a 100644 --- a/google/cloud/compute/ssl_policies/v1/ssl_policies_connection.h +++ b/google/cloud/compute/ssl_policies/v1/ssl_policies_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_POLICIES_V1_SSL_POLICIES_CONNECTION_H #include "google/cloud/compute/ssl_policies/v1/internal/ssl_policies_retry_traits.h" +#include "google/cloud/compute/ssl_policies/v1/ssl_policies.pb.h" #include "google/cloud/compute/ssl_policies/v1/ssl_policies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/ssl_policies/v1/ssl_policies_connection_idempotency_policy.h b/google/cloud/compute/ssl_policies/v1/ssl_policies_connection_idempotency_policy.h index e38e222418383..7f7445b21ba6b 100644 --- a/google/cloud/compute/ssl_policies/v1/ssl_policies_connection_idempotency_policy.h +++ b/google/cloud/compute/ssl_policies/v1/ssl_policies_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_POLICIES_V1_SSL_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_POLICIES_V1_SSL_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/ssl_policies/v1/ssl_policies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/ssl_policies/v1/ssl_policies_proto_export.h b/google/cloud/compute/ssl_policies/v1/ssl_policies_proto_export.h index b1674ad6a7ba4..c5cb512953f3d 100644 --- a/google/cloud/compute/ssl_policies/v1/ssl_policies_proto_export.h +++ b/google/cloud/compute/ssl_policies/v1/ssl_policies_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_POLICIES_V1_SSL_POLICIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_127.pb.h" +#include "google/cloud/compute/v1/internal/common_128.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SSL_POLICIES_V1_SSL_POLICIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_option_defaults.cc b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_option_defaults.cc index 9919943c5c450..d9666db9c7da6 100644 --- a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_option_defaults.cc +++ b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_option_defaults.cc @@ -44,7 +44,7 @@ Options StoragePoolTypesDefaultOptions(Options options) { options.set< compute_storage_pool_types_v1::StoragePoolTypesRetryPolicyOption>( compute_storage_pool_types_v1::StoragePoolTypesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include #include diff --git a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_metadata_decorator.cc b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_metadata_decorator.cc index a2e8be5c80515..ac156f67bc2df 100644 --- a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_metadata_decorator.cc +++ b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/storage_pool_types/v1/storage_pool_types.proto #include "google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_metadata_decorator.h b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_metadata_decorator.h index 77c5cfb8ae4c0..9ef90834cbb1f 100644 --- a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_metadata_decorator.h +++ b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_metadata_decorator.h @@ -20,10 +20,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOL_TYPES_V1_INTERNAL_STORAGE_POOL_TYPES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.h" +#include "google/cloud/compute/storage_pool_types/v1/storage_pool_types.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.cc b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.cc index 28b70f327f00e..8a6060cfd1c85 100644 --- a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.cc +++ b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/storage_pool_types/v1/storage_pool_types.proto #include "google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.h" +#include "google/cloud/compute/storage_pool_types/v1/storage_pool_types.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.h b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.h index a72c5dc6e00d2..8021b63c39a98 100644 --- a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.h +++ b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOL_TYPES_V1_INTERNAL_STORAGE_POOL_TYPES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOL_TYPES_V1_INTERNAL_STORAGE_POOL_TYPES_REST_STUB_H +#include "google/cloud/compute/storage_pool_types/v1/storage_pool_types.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_tracing_connection.cc b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_tracing_connection.cc index 8fafca8623ab4..5177345d42b05 100644 --- a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_tracing_connection.cc +++ b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_storage_pool_types_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - StoragePoolTypesTracingConnection::StoragePoolTypesTracingConnection( std::shared_ptr child) @@ -75,17 +73,13 @@ StoragePoolTypesTracingConnection::ListStoragePoolTypes( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeStoragePoolTypesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_tracing_connection.h b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_tracing_connection.h index b4a273c0487b4..24a0397124d3f 100644 --- a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_tracing_connection.h +++ b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_storage_pool_types_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class StoragePoolTypesTracingConnection : public compute_storage_pool_types_v1::StoragePoolTypesConnection { public: @@ -60,8 +58,6 @@ class StoragePoolTypesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/storage_pool_types/v1/storage_pool_types_connection.h b/google/cloud/compute/storage_pool_types/v1/storage_pool_types_connection.h index 868fb2c4ca682..bb4d5f0a4571a 100644 --- a/google/cloud/compute/storage_pool_types/v1/storage_pool_types_connection.h +++ b/google/cloud/compute/storage_pool_types/v1/storage_pool_types_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOL_TYPES_V1_STORAGE_POOL_TYPES_CONNECTION_H #include "google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_retry_traits.h" +#include "google/cloud/compute/storage_pool_types/v1/storage_pool_types.pb.h" #include "google/cloud/compute/storage_pool_types/v1/storage_pool_types_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/storage_pool_types/v1/storage_pool_types_connection_idempotency_policy.h b/google/cloud/compute/storage_pool_types/v1/storage_pool_types_connection_idempotency_policy.h index c0265dedcd281..2d23895180a56 100644 --- a/google/cloud/compute/storage_pool_types/v1/storage_pool_types_connection_idempotency_policy.h +++ b/google/cloud/compute/storage_pool_types/v1/storage_pool_types_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOL_TYPES_V1_STORAGE_POOL_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOL_TYPES_V1_STORAGE_POOL_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/storage_pool_types/v1/storage_pool_types.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/storage_pool_types/v1/storage_pool_types_proto_export.h b/google/cloud/compute/storage_pool_types/v1/storage_pool_types_proto_export.h index e41b928eea713..b335bef741dec 100644 --- a/google/cloud/compute/storage_pool_types/v1/storage_pool_types_proto_export.h +++ b/google/cloud/compute/storage_pool_types/v1/storage_pool_types_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOL_TYPES_V1_STORAGE_POOL_TYPES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_023.pb.h" +#include "google/cloud/compute/v1/internal/common_131.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOL_TYPES_V1_STORAGE_POOL_TYPES_PROTO_EXPORT_H diff --git a/google/cloud/compute/storage_pools/v1/internal/storage_pools_option_defaults.cc b/google/cloud/compute/storage_pools/v1/internal/storage_pools_option_defaults.cc index 76c42e97ccf58..2277be0e9d667 100644 --- a/google/cloud/compute/storage_pools/v1/internal/storage_pools_option_defaults.cc +++ b/google/cloud/compute/storage_pools/v1/internal/storage_pools_option_defaults.cc @@ -41,7 +41,7 @@ Options StoragePoolsDefaultOptions(Options options) { if (!options.has()) { options.set( compute_storage_pools_v1::StoragePoolsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_connection_impl.h b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_connection_impl.h index c7eb039d14090..9dad6a3f1e269 100644 --- a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_connection_impl.h +++ b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/storage_pools/v1/storage_pools_connection.h" #include "google/cloud/compute/storage_pools/v1/storage_pools_connection_idempotency_policy.h" #include "google/cloud/compute/storage_pools/v1/storage_pools_options.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_logging_decorator.h b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_logging_decorator.h index 027bc70a422ca..a8442275af8dd 100644 --- a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_logging_decorator.h +++ b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_logging_decorator.h @@ -20,12 +20,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOLS_V1_INTERNAL_STORAGE_POOLS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.h" +#include "google/cloud/compute/storage_pools/v1/storage_pools.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_metadata_decorator.cc b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_metadata_decorator.cc index 5ad90c14aaf41..78ee8708b9e48 100644 --- a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_metadata_decorator.cc +++ b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/storage_pools/v1/storage_pools.proto #include "google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_metadata_decorator.h b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_metadata_decorator.h index 701b0d0c51e7f..1d6d51c26bb4b 100644 --- a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_metadata_decorator.h +++ b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOLS_V1_INTERNAL_STORAGE_POOLS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.h" +#include "google/cloud/compute/storage_pools/v1/storage_pools.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.cc b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.cc index 6b4ebe5fe9e77..712316c742a79 100644 --- a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.cc +++ b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/storage_pools/v1/storage_pools.proto #include "google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.h" +#include "google/cloud/compute/storage_pools/v1/storage_pools.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.h b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.h index 2b7a03b8a434c..6928896246d59 100644 --- a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.h +++ b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOLS_V1_INTERNAL_STORAGE_POOLS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOLS_V1_INTERNAL_STORAGE_POOLS_REST_STUB_H +#include "google/cloud/compute/storage_pools/v1/storage_pools.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/storage_pools/v1/internal/storage_pools_tracing_connection.cc b/google/cloud/compute/storage_pools/v1/internal/storage_pools_tracing_connection.cc index d37e1bfd59181..c64f202eee49a 100644 --- a/google/cloud/compute/storage_pools/v1/internal/storage_pools_tracing_connection.cc +++ b/google/cloud/compute/storage_pools/v1/internal/storage_pools_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_storage_pools_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - StoragePoolsTracingConnection::StoragePoolsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -206,16 +204,12 @@ StoragePoolsTracingConnection::UpdateStoragePool( child_->UpdateStoragePool(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeStoragePoolsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/storage_pools/v1/internal/storage_pools_tracing_connection.h b/google/cloud/compute/storage_pools/v1/internal/storage_pools_tracing_connection.h index d88ba62517969..c27ba99f705bf 100644 --- a/google/cloud/compute/storage_pools/v1/internal/storage_pools_tracing_connection.h +++ b/google/cloud/compute/storage_pools/v1/internal/storage_pools_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_storage_pools_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class StoragePoolsTracingConnection : public compute_storage_pools_v1::StoragePoolsConnection { public: @@ -110,8 +108,6 @@ class StoragePoolsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/storage_pools/v1/storage_pools_connection.h b/google/cloud/compute/storage_pools/v1/storage_pools_connection.h index e82a9ccfc40bf..90e78ad16a73f 100644 --- a/google/cloud/compute/storage_pools/v1/storage_pools_connection.h +++ b/google/cloud/compute/storage_pools/v1/storage_pools_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOLS_V1_STORAGE_POOLS_CONNECTION_H #include "google/cloud/compute/storage_pools/v1/internal/storage_pools_retry_traits.h" +#include "google/cloud/compute/storage_pools/v1/storage_pools.pb.h" #include "google/cloud/compute/storage_pools/v1/storage_pools_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/storage_pools/v1/storage_pools_connection_idempotency_policy.h b/google/cloud/compute/storage_pools/v1/storage_pools_connection_idempotency_policy.h index ae4627eaaf1e2..406c5c4f08121 100644 --- a/google/cloud/compute/storage_pools/v1/storage_pools_connection_idempotency_policy.h +++ b/google/cloud/compute/storage_pools/v1/storage_pools_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOLS_V1_STORAGE_POOLS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOLS_V1_STORAGE_POOLS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/storage_pools/v1/storage_pools.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/storage_pools/v1/storage_pools_proto_export.h b/google/cloud/compute/storage_pools/v1/storage_pools_proto_export.h index f67e0320f7d2c..d71ea8cc40522 100644 --- a/google/cloud/compute/storage_pools/v1/storage_pools_proto_export.h +++ b/google/cloud/compute/storage_pools/v1/storage_pools_proto_export.h @@ -26,12 +26,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOLS_V1_STORAGE_POOLS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_130.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" +#include "google/cloud/compute/v1/internal/common_152.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_STORAGE_POOLS_V1_STORAGE_POOLS_PROTO_EXPORT_H diff --git a/google/cloud/compute/subnetworks/v1/internal/subnetworks_option_defaults.cc b/google/cloud/compute/subnetworks/v1/internal/subnetworks_option_defaults.cc index dbcc274c20a5a..949a95c3d61ee 100644 --- a/google/cloud/compute/subnetworks/v1/internal/subnetworks_option_defaults.cc +++ b/google/cloud/compute/subnetworks/v1/internal/subnetworks_option_defaults.cc @@ -41,7 +41,7 @@ Options SubnetworksDefaultOptions(Options options) { if (!options.has()) { options.set( compute_subnetworks_v1::SubnetworksLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_connection_impl.h b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_connection_impl.h index 21401e6b8675c..26fca92487fef 100644 --- a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_connection_impl.h +++ b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SUBNETWORKS_V1_INTERNAL_SUBNETWORKS_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SUBNETWORKS_V1_INTERNAL_SUBNETWORKS_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.h" #include "google/cloud/compute/subnetworks/v1/internal/subnetworks_retry_traits.h" #include "google/cloud/compute/subnetworks/v1/subnetworks_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_logging_decorator.h b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_logging_decorator.h index c7333e5f7f466..d044611ce4e04 100644 --- a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_logging_decorator.h +++ b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SUBNETWORKS_V1_INTERNAL_SUBNETWORKS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SUBNETWORKS_V1_INTERNAL_SUBNETWORKS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.h" +#include "google/cloud/compute/subnetworks/v1/subnetworks.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_metadata_decorator.cc b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_metadata_decorator.cc index e7018020eda7c..5d471efc119b0 100644 --- a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_metadata_decorator.cc +++ b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/subnetworks/v1/subnetworks.proto #include "google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_metadata_decorator.h b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_metadata_decorator.h index f195d2f7d5344..76345e12056ee 100644 --- a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_metadata_decorator.h +++ b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SUBNETWORKS_V1_INTERNAL_SUBNETWORKS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SUBNETWORKS_V1_INTERNAL_SUBNETWORKS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.h" +#include "google/cloud/compute/subnetworks/v1/subnetworks.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.cc b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.cc index 9ed1f5bc9e6b7..bfb4d1f74071e 100644 --- a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.cc +++ b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/subnetworks/v1/subnetworks.proto #include "google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/subnetworks/v1/subnetworks.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.h b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.h index 601a3a721e417..cee167ab6cbed 100644 --- a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.h +++ b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SUBNETWORKS_V1_INTERNAL_SUBNETWORKS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SUBNETWORKS_V1_INTERNAL_SUBNETWORKS_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/subnetworks/v1/subnetworks.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/subnetworks/v1/internal/subnetworks_tracing_connection.cc b/google/cloud/compute/subnetworks/v1/internal/subnetworks_tracing_connection.cc index a27467785dd2f..863c6b620715c 100644 --- a/google/cloud/compute/subnetworks/v1/internal/subnetworks_tracing_connection.cc +++ b/google/cloud/compute/subnetworks/v1/internal/subnetworks_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_subnetworks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SubnetworksTracingConnection::SubnetworksTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -274,16 +272,12 @@ SubnetworksTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSubnetworksTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/subnetworks/v1/internal/subnetworks_tracing_connection.h b/google/cloud/compute/subnetworks/v1/internal/subnetworks_tracing_connection.h index aae0a52e66a98..a5b5ae00137f7 100644 --- a/google/cloud/compute/subnetworks/v1/internal/subnetworks_tracing_connection.h +++ b/google/cloud/compute/subnetworks/v1/internal/subnetworks_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_subnetworks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SubnetworksTracingConnection : public compute_subnetworks_v1::SubnetworksConnection { public: @@ -132,8 +130,6 @@ class SubnetworksTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/subnetworks/v1/subnetworks_connection.h b/google/cloud/compute/subnetworks/v1/subnetworks_connection.h index a6af885b51c65..2042868c07f47 100644 --- a/google/cloud/compute/subnetworks/v1/subnetworks_connection.h +++ b/google/cloud/compute/subnetworks/v1/subnetworks_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SUBNETWORKS_V1_SUBNETWORKS_CONNECTION_H #include "google/cloud/compute/subnetworks/v1/internal/subnetworks_retry_traits.h" +#include "google/cloud/compute/subnetworks/v1/subnetworks.pb.h" #include "google/cloud/compute/subnetworks/v1/subnetworks_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/subnetworks/v1/subnetworks_connection_idempotency_policy.h b/google/cloud/compute/subnetworks/v1/subnetworks_connection_idempotency_policy.h index 69d0684bcc15e..6ad7b3b4b2614 100644 --- a/google/cloud/compute/subnetworks/v1/subnetworks_connection_idempotency_policy.h +++ b/google/cloud/compute/subnetworks/v1/subnetworks_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SUBNETWORKS_V1_SUBNETWORKS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SUBNETWORKS_V1_SUBNETWORKS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/subnetworks/v1/subnetworks.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/subnetworks/v1/subnetworks_proto_export.h b/google/cloud/compute/subnetworks/v1/subnetworks_proto_export.h index 55ea306099f93..34e22f287766b 100644 --- a/google/cloud/compute/subnetworks/v1/subnetworks_proto_export.h +++ b/google/cloud/compute/subnetworks/v1/subnetworks_proto_export.h @@ -26,12 +26,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SUBNETWORKS_V1_SUBNETWORKS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_007.pb.h" +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_031.pb.h" +#include "google/cloud/compute/v1/internal/common_108.pb.h" +#include "google/cloud/compute/v1/internal/common_132.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_SUBNETWORKS_V1_SUBNETWORKS_PROTO_EXPORT_H diff --git a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_option_defaults.cc b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_option_defaults.cc index 4ade4fa8b8c4d..ddceb307a6bb4 100644 --- a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_option_defaults.cc +++ b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_option_defaults.cc @@ -44,7 +44,7 @@ Options TargetGrpcProxiesDefaultOptions(Options options) { options.set< compute_target_grpc_proxies_v1::TargetGrpcProxiesRetryPolicyOption>( compute_target_grpc_proxies_v1::TargetGrpcProxiesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_logging_decorator.h b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_logging_decorator.h index c0d10a20fe64a..95a05698bddd4 100644 --- a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_logging_decorator.h +++ b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_GRPC_PROXIES_V1_INTERNAL_TARGET_GRPC_PROXIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_GRPC_PROXIES_V1_INTERNAL_TARGET_GRPC_PROXIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.h" +#include "google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_metadata_decorator.cc b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_metadata_decorator.cc index 8b9d0f5ebec0e..d9e10897fbdb6 100644 --- a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_metadata_decorator.cc +++ b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies.proto #include "google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_metadata_decorator.h b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_metadata_decorator.h index 963a174cbffe6..69fe12c2bfb55 100644 --- a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_metadata_decorator.h +++ b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_GRPC_PROXIES_V1_INTERNAL_TARGET_GRPC_PROXIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_GRPC_PROXIES_V1_INTERNAL_TARGET_GRPC_PROXIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.h" +#include "google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.cc b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.cc index 66fbcb7c4b237..1881ec77e8701 100644 --- a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.cc +++ b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies.proto #include "google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.h b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.h index 00a9c31f24392..5391b5c66221e 100644 --- a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.h +++ b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_GRPC_PROXIES_V1_INTERNAL_TARGET_GRPC_PROXIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_GRPC_PROXIES_V1_INTERNAL_TARGET_GRPC_PROXIES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_tracing_connection.cc b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_tracing_connection.cc index 3806e729907c9..707184eb1e07e 100644 --- a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_tracing_connection.cc +++ b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_target_grpc_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TargetGrpcProxiesTracingConnection::TargetGrpcProxiesTracingConnection( std::shared_ptr child) @@ -164,18 +162,14 @@ TargetGrpcProxiesTracingConnection::PatchTargetGrpcProxy( child_->PatchTargetGrpcProxy(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTargetGrpcProxiesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_tracing_connection.h b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_tracing_connection.h index 7dbc5bee69a20..c0c5c26b9281d 100644 --- a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_tracing_connection.h +++ b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_target_grpc_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TargetGrpcProxiesTracingConnection : public compute_target_grpc_proxies_v1::TargetGrpcProxiesConnection { public: @@ -93,8 +91,6 @@ class TargetGrpcProxiesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies_connection.h b/google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies_connection.h index 4879df0421d8b..ed109627165a4 100644 --- a/google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies_connection.h +++ b/google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_GRPC_PROXIES_V1_TARGET_GRPC_PROXIES_CONNECTION_H #include "google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_retry_traits.h" +#include "google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies.pb.h" #include "google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies_connection_idempotency_policy.h b/google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies_connection_idempotency_policy.h index a38b196c604d7..c6f23ae610eca 100644 --- a/google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies_connection_idempotency_policy.h +++ b/google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_GRPC_PROXIES_V1_TARGET_GRPC_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_GRPC_PROXIES_V1_TARGET_GRPC_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies_proto_export.h b/google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies_proto_export.h index 3886cf82f6693..d59c48640a678 100644 --- a/google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies_proto_export.h +++ b/google/cloud/compute/target_grpc_proxies/v1/target_grpc_proxies_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_GRPC_PROXIES_V1_TARGET_GRPC_PROXIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_133.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_GRPC_PROXIES_V1_TARGET_GRPC_PROXIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_option_defaults.cc b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_option_defaults.cc index abe7f69a26b0c..c16e4ac903d7f 100644 --- a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_option_defaults.cc +++ b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_option_defaults.cc @@ -44,7 +44,7 @@ Options TargetHttpProxiesDefaultOptions(Options options) { options.set< compute_target_http_proxies_v1::TargetHttpProxiesRetryPolicyOption>( compute_target_http_proxies_v1::TargetHttpProxiesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_logging_decorator.h b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_logging_decorator.h index b67788e056eed..ccab17a999154 100644 --- a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_logging_decorator.h +++ b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTP_PROXIES_V1_INTERNAL_TARGET_HTTP_PROXIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTP_PROXIES_V1_INTERNAL_TARGET_HTTP_PROXIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.h" +#include "google/cloud/compute/target_http_proxies/v1/target_http_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_metadata_decorator.cc b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_metadata_decorator.cc index 365c0a0479de3..febb737b93fa9 100644 --- a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_metadata_decorator.cc +++ b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/target_http_proxies/v1/target_http_proxies.proto #include "google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_metadata_decorator.h b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_metadata_decorator.h index 84dd2f2a3ba5b..9eb912a9c67b1 100644 --- a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_metadata_decorator.h +++ b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTP_PROXIES_V1_INTERNAL_TARGET_HTTP_PROXIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTP_PROXIES_V1_INTERNAL_TARGET_HTTP_PROXIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.h" +#include "google/cloud/compute/target_http_proxies/v1/target_http_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.cc b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.cc index 12b5e8a5e5cea..ff3cae2a3b054 100644 --- a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.cc +++ b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/target_http_proxies/v1/target_http_proxies.proto #include "google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/target_http_proxies/v1/target_http_proxies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.h b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.h index 220758080d1ba..add5b5fda859c 100644 --- a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.h +++ b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTP_PROXIES_V1_INTERNAL_TARGET_HTTP_PROXIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTP_PROXIES_V1_INTERNAL_TARGET_HTTP_PROXIES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/target_http_proxies/v1/target_http_proxies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_tracing_connection.cc b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_tracing_connection.cc index 7e5bc76f1dce7..be30397ac8c9a 100644 --- a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_tracing_connection.cc +++ b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_target_http_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TargetHttpProxiesTracingConnection::TargetHttpProxiesTracingConnection( std::shared_ptr child) @@ -209,18 +207,14 @@ TargetHttpProxiesTracingConnection::SetUrlMap( return internal::EndSpan(std::move(span), child_->SetUrlMap(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTargetHttpProxiesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_tracing_connection.h b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_tracing_connection.h index 2a90ae4579aa0..fe8b9d3d7050b 100644 --- a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_tracing_connection.h +++ b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_target_http_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TargetHttpProxiesTracingConnection : public compute_target_http_proxies_v1::TargetHttpProxiesConnection { public: @@ -111,8 +109,6 @@ class TargetHttpProxiesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/target_http_proxies/v1/target_http_proxies_connection.h b/google/cloud/compute/target_http_proxies/v1/target_http_proxies_connection.h index 3a28cd0a442f5..fe2b3355f8786 100644 --- a/google/cloud/compute/target_http_proxies/v1/target_http_proxies_connection.h +++ b/google/cloud/compute/target_http_proxies/v1/target_http_proxies_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTP_PROXIES_V1_TARGET_HTTP_PROXIES_CONNECTION_H #include "google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_retry_traits.h" +#include "google/cloud/compute/target_http_proxies/v1/target_http_proxies.pb.h" #include "google/cloud/compute/target_http_proxies/v1/target_http_proxies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_http_proxies/v1/target_http_proxies_connection_idempotency_policy.h b/google/cloud/compute/target_http_proxies/v1/target_http_proxies_connection_idempotency_policy.h index 7c6cf422c574e..37e384de31c50 100644 --- a/google/cloud/compute/target_http_proxies/v1/target_http_proxies_connection_idempotency_policy.h +++ b/google/cloud/compute/target_http_proxies/v1/target_http_proxies_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTP_PROXIES_V1_TARGET_HTTP_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTP_PROXIES_V1_TARGET_HTTP_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/target_http_proxies/v1/target_http_proxies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_http_proxies/v1/target_http_proxies_proto_export.h b/google/cloud/compute/target_http_proxies/v1/target_http_proxies_proto_export.h index 1b958868d465c..98f1de712447b 100644 --- a/google/cloud/compute/target_http_proxies/v1/target_http_proxies_proto_export.h +++ b/google/cloud/compute/target_http_proxies/v1/target_http_proxies_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTP_PROXIES_V1_TARGET_HTTP_PROXIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_134.pb.h" +#include "google/cloud/compute/v1/internal/common_135.pb.h" +#include "google/cloud/compute/v1/internal/common_147.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTP_PROXIES_V1_TARGET_HTTP_PROXIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_option_defaults.cc b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_option_defaults.cc index 8f84eb9925785..c81d0ac4c4d7e 100644 --- a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_option_defaults.cc +++ b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_option_defaults.cc @@ -45,7 +45,7 @@ Options TargetHttpsProxiesDefaultOptions(Options options) { options.set< compute_target_https_proxies_v1::TargetHttpsProxiesRetryPolicyOption>( compute_target_https_proxies_v1:: - TargetHttpsProxiesLimitedTimeRetryPolicy(std::chrono::minutes(30)) + TargetHttpsProxiesLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_logging_decorator.h b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_logging_decorator.h index 695e8dcab4b22..fafd52b30f5b9 100644 --- a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_logging_decorator.h +++ b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_logging_decorator.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTPS_PROXIES_V1_INTERNAL_TARGET_HTTPS_PROXIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTPS_PROXIES_V1_INTERNAL_TARGET_HTTPS_PROXIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.h" +#include "google/cloud/compute/target_https_proxies/v1/target_https_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_metadata_decorator.cc b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_metadata_decorator.cc index 934a151b7c430..3188174e00a7b 100644 --- a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_metadata_decorator.cc +++ b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_metadata_decorator.cc @@ -18,10 +18,10 @@ // google/cloud/compute/target_https_proxies/v1/target_https_proxies.proto #include "google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_metadata_decorator.h b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_metadata_decorator.h index 66ced86a67312..d04093c0c2303 100644 --- a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_metadata_decorator.h +++ b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_metadata_decorator.h @@ -20,12 +20,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTPS_PROXIES_V1_INTERNAL_TARGET_HTTPS_PROXIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTPS_PROXIES_V1_INTERNAL_TARGET_HTTPS_PROXIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.h" +#include "google/cloud/compute/target_https_proxies/v1/target_https_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.cc b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.cc index b944461c8df24..4352382f379e3 100644 --- a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.cc +++ b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.cc @@ -18,12 +18,12 @@ // google/cloud/compute/target_https_proxies/v1/target_https_proxies.proto #include "google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/target_https_proxies/v1/target_https_proxies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.h b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.h index f200b5782ffe3..bfb36ac6112ab 100644 --- a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.h +++ b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.h @@ -20,13 +20,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTPS_PROXIES_V1_INTERNAL_TARGET_HTTPS_PROXIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTPS_PROXIES_V1_INTERNAL_TARGET_HTTPS_PROXIES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/target_https_proxies/v1/target_https_proxies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_tracing_connection.cc b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_tracing_connection.cc index 23000669654cc..5e88c40d576af 100644 --- a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_tracing_connection.cc +++ b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace compute_target_https_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TargetHttpsProxiesTracingConnection::TargetHttpsProxiesTracingConnection( std::shared_ptr< compute_target_https_proxies_v1::TargetHttpsProxiesConnection> @@ -348,19 +346,15 @@ TargetHttpsProxiesTracingConnection::SetUrlMap( return internal::EndSpan(std::move(span), child_->SetUrlMap(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTargetHttpsProxiesTracingConnection( std::shared_ptr< compute_target_https_proxies_v1::TargetHttpsProxiesConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_tracing_connection.h b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_tracing_connection.h index 3985209fb2b68..075ec6d7ce00c 100644 --- a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_tracing_connection.h +++ b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace compute_target_https_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TargetHttpsProxiesTracingConnection : public compute_target_https_proxies_v1::TargetHttpsProxiesConnection { public: @@ -159,8 +157,6 @@ class TargetHttpsProxiesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/target_https_proxies/v1/target_https_proxies_connection.h b/google/cloud/compute/target_https_proxies/v1/target_https_proxies_connection.h index 63653f3bfd723..8902f47b1f666 100644 --- a/google/cloud/compute/target_https_proxies/v1/target_https_proxies_connection.h +++ b/google/cloud/compute/target_https_proxies/v1/target_https_proxies_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTPS_PROXIES_V1_TARGET_HTTPS_PROXIES_CONNECTION_H #include "google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_retry_traits.h" +#include "google/cloud/compute/target_https_proxies/v1/target_https_proxies.pb.h" #include "google/cloud/compute/target_https_proxies/v1/target_https_proxies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -31,7 +32,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_https_proxies/v1/target_https_proxies_connection_idempotency_policy.h b/google/cloud/compute/target_https_proxies/v1/target_https_proxies_connection_idempotency_policy.h index 8329a21af5e5b..f7dc253e31e08 100644 --- a/google/cloud/compute/target_https_proxies/v1/target_https_proxies_connection_idempotency_policy.h +++ b/google/cloud/compute/target_https_proxies/v1/target_https_proxies_connection_idempotency_policy.h @@ -20,9 +20,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTPS_PROXIES_V1_TARGET_HTTPS_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTPS_PROXIES_V1_TARGET_HTTPS_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/target_https_proxies/v1/target_https_proxies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_https_proxies/v1/target_https_proxies_proto_export.h b/google/cloud/compute/target_https_proxies/v1/target_https_proxies_proto_export.h index c33d13125ea47..3bff5a44ef7e2 100644 --- a/google/cloud/compute/target_https_proxies/v1/target_https_proxies_proto_export.h +++ b/google/cloud/compute/target_https_proxies/v1/target_https_proxies_proto_export.h @@ -26,11 +26,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTPS_PROXIES_V1_TARGET_HTTPS_PROXIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_129.pb.h" +#include "google/cloud/compute/v1/internal/common_136.pb.h" +#include "google/cloud/compute/v1/internal/common_137.pb.h" +#include "google/cloud/compute/v1/internal/common_147.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_HTTPS_PROXIES_V1_TARGET_HTTPS_PROXIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/target_instances/v1/internal/target_instances_option_defaults.cc b/google/cloud/compute/target_instances/v1/internal/target_instances_option_defaults.cc index 0207ffca0a0da..6f5a01410cbdc 100644 --- a/google/cloud/compute/target_instances/v1/internal/target_instances_option_defaults.cc +++ b/google/cloud/compute/target_instances/v1/internal/target_instances_option_defaults.cc @@ -42,7 +42,7 @@ Options TargetInstancesDefaultOptions(Options options) { compute_target_instances_v1::TargetInstancesRetryPolicyOption>()) { options.set( compute_target_instances_v1::TargetInstancesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_connection_impl.h b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_connection_impl.h index 64b401bfa7e8e..fafcfee77c7e1 100644 --- a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_connection_impl.h +++ b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_connection_impl.h @@ -24,13 +24,13 @@ #include "google/cloud/compute/target_instances/v1/target_instances_connection.h" #include "google/cloud/compute/target_instances/v1/target_instances_connection_idempotency_policy.h" #include "google/cloud/compute/target_instances/v1/target_instances_options.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.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 #include namespace google { diff --git a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_logging_decorator.h b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_logging_decorator.h index 84e63190b3c64..10706071bd783 100644 --- a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_logging_decorator.h +++ b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_logging_decorator.h @@ -20,12 +20,12 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_INSTANCES_V1_INTERNAL_TARGET_INSTANCES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.h" +#include "google/cloud/compute/target_instances/v1/target_instances.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_metadata_decorator.cc b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_metadata_decorator.cc index 9a817956ec901..3ffdbda20ce3a 100644 --- a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_metadata_decorator.cc +++ b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/target_instances/v1/target_instances.proto #include "google/cloud/compute/target_instances/v1/internal/target_instances_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_metadata_decorator.h b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_metadata_decorator.h index b7781db0572aa..ed4a4d6342af1 100644 --- a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_metadata_decorator.h +++ b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_metadata_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_INSTANCES_V1_INTERNAL_TARGET_INSTANCES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.h" +#include "google/cloud/compute/target_instances/v1/target_instances.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.cc b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.cc index 3404912888203..81e8c12bcb160 100644 --- a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.cc +++ b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/target_instances/v1/target_instances.proto #include "google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.h" +#include "google/cloud/compute/target_instances/v1/target_instances.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.h b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.h index cf846f1ac808b..dbf138d5470af 100644 --- a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.h +++ b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_INSTANCES_V1_INTERNAL_TARGET_INSTANCES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_INSTANCES_V1_INTERNAL_TARGET_INSTANCES_REST_STUB_H +#include "google/cloud/compute/target_instances/v1/target_instances.pb.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/target_instances/v1/internal/target_instances_tracing_connection.cc b/google/cloud/compute/target_instances/v1/internal/target_instances_tracing_connection.cc index fb0bfa139bd90..938a614b5f807 100644 --- a/google/cloud/compute/target_instances/v1/internal/target_instances_tracing_connection.cc +++ b/google/cloud/compute/target_instances/v1/internal/target_instances_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_target_instances_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TargetInstancesTracingConnection::TargetInstancesTracingConnection( std::shared_ptr child) @@ -178,17 +176,13 @@ TargetInstancesTracingConnection::SetSecurityPolicy( child_->SetSecurityPolicy(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTargetInstancesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/target_instances/v1/internal/target_instances_tracing_connection.h b/google/cloud/compute/target_instances/v1/internal/target_instances_tracing_connection.h index 8d8ef6d65b7ce..049586b689e60 100644 --- a/google/cloud/compute/target_instances/v1/internal/target_instances_tracing_connection.h +++ b/google/cloud/compute/target_instances/v1/internal/target_instances_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_target_instances_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TargetInstancesTracingConnection : public compute_target_instances_v1::TargetInstancesConnection { public: @@ -96,8 +94,6 @@ class TargetInstancesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/target_instances/v1/target_instances_connection.h b/google/cloud/compute/target_instances/v1/target_instances_connection.h index aacef0d8e12c4..18eb77a6bdd44 100644 --- a/google/cloud/compute/target_instances/v1/target_instances_connection.h +++ b/google/cloud/compute/target_instances/v1/target_instances_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_INSTANCES_V1_TARGET_INSTANCES_CONNECTION_H #include "google/cloud/compute/target_instances/v1/internal/target_instances_retry_traits.h" +#include "google/cloud/compute/target_instances/v1/target_instances.pb.h" #include "google/cloud/compute/target_instances/v1/target_instances_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_instances/v1/target_instances_connection_idempotency_policy.h b/google/cloud/compute/target_instances/v1/target_instances_connection_idempotency_policy.h index debcb3fc7ce9f..766e3771e1fc4 100644 --- a/google/cloud/compute/target_instances/v1/target_instances_connection_idempotency_policy.h +++ b/google/cloud/compute/target_instances/v1/target_instances_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_INSTANCES_V1_TARGET_INSTANCES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_INSTANCES_V1_TARGET_INSTANCES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/target_instances/v1/target_instances.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_instances/v1/target_instances_proto_export.h b/google/cloud/compute/target_instances/v1/target_instances_proto_export.h index 477bb9b527d1f..4c9edebaabaf2 100644 --- a/google/cloud/compute/target_instances/v1/target_instances_proto_export.h +++ b/google/cloud/compute/target_instances/v1/target_instances_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_INSTANCES_V1_TARGET_INSTANCES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_118.pb.h" +#include "google/cloud/compute/v1/internal/common_138.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_INSTANCES_V1_TARGET_INSTANCES_PROTO_EXPORT_H diff --git a/google/cloud/compute/target_pools/v1/internal/target_pools_option_defaults.cc b/google/cloud/compute/target_pools/v1/internal/target_pools_option_defaults.cc index fb22bfb2f5387..8faedab4078ed 100644 --- a/google/cloud/compute/target_pools/v1/internal/target_pools_option_defaults.cc +++ b/google/cloud/compute/target_pools/v1/internal/target_pools_option_defaults.cc @@ -41,7 +41,7 @@ Options TargetPoolsDefaultOptions(Options options) { if (!options.has()) { options.set( compute_target_pools_v1::TargetPoolsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_connection_impl.h b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_connection_impl.h index 3209854375ee7..e564a34d379c8 100644 --- a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_connection_impl.h +++ b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_POOLS_V1_INTERNAL_TARGET_POOLS_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_POOLS_V1_INTERNAL_TARGET_POOLS_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.h" #include "google/cloud/compute/target_pools/v1/internal/target_pools_retry_traits.h" #include "google/cloud/compute/target_pools/v1/target_pools_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_logging_decorator.h b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_logging_decorator.h index 8237059e64fd2..1db83a1253083 100644 --- a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_logging_decorator.h +++ b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_POOLS_V1_INTERNAL_TARGET_POOLS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_POOLS_V1_INTERNAL_TARGET_POOLS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.h" +#include "google/cloud/compute/target_pools/v1/target_pools.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_metadata_decorator.cc b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_metadata_decorator.cc index 8e810ea4099a9..908ef562a5f77 100644 --- a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_metadata_decorator.cc +++ b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/target_pools/v1/target_pools.proto #include "google/cloud/compute/target_pools/v1/internal/target_pools_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_metadata_decorator.h b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_metadata_decorator.h index 42e5116a3d807..7d31c4e6af8af 100644 --- a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_metadata_decorator.h +++ b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_POOLS_V1_INTERNAL_TARGET_POOLS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_POOLS_V1_INTERNAL_TARGET_POOLS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.h" +#include "google/cloud/compute/target_pools/v1/target_pools.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.cc b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.cc index b1473a9493ec4..c0d1a3a560185 100644 --- a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.cc +++ b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/target_pools/v1/target_pools.proto #include "google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/target_pools/v1/target_pools.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.h b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.h index 2ae04cc765284..6f6691f901265 100644 --- a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.h +++ b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_POOLS_V1_INTERNAL_TARGET_POOLS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_POOLS_V1_INTERNAL_TARGET_POOLS_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/target_pools/v1/target_pools.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/target_pools/v1/internal/target_pools_tracing_connection.cc b/google/cloud/compute/target_pools/v1/internal/target_pools_tracing_connection.cc index 4742233bcb6db..793b6810d6017 100644 --- a/google/cloud/compute/target_pools/v1/internal/target_pools_tracing_connection.cc +++ b/google/cloud/compute/target_pools/v1/internal/target_pools_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_target_pools_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TargetPoolsTracingConnection::TargetPoolsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -327,16 +325,12 @@ TargetPoolsTracingConnection::SetSecurityPolicy( child_->SetSecurityPolicy(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTargetPoolsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/target_pools/v1/internal/target_pools_tracing_connection.h b/google/cloud/compute/target_pools/v1/internal/target_pools_tracing_connection.h index ac6d45abd3037..f119b0ba11fb4 100644 --- a/google/cloud/compute/target_pools/v1/internal/target_pools_tracing_connection.h +++ b/google/cloud/compute/target_pools/v1/internal/target_pools_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_target_pools_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TargetPoolsTracingConnection : public compute_target_pools_v1::TargetPoolsConnection { public: @@ -154,8 +152,6 @@ class TargetPoolsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/target_pools/v1/target_pools_connection.h b/google/cloud/compute/target_pools/v1/target_pools_connection.h index 41b1fae1dcf94..4cb09cef7221a 100644 --- a/google/cloud/compute/target_pools/v1/target_pools_connection.h +++ b/google/cloud/compute/target_pools/v1/target_pools_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_POOLS_V1_TARGET_POOLS_CONNECTION_H #include "google/cloud/compute/target_pools/v1/internal/target_pools_retry_traits.h" +#include "google/cloud/compute/target_pools/v1/target_pools.pb.h" #include "google/cloud/compute/target_pools/v1/target_pools_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_pools/v1/target_pools_connection_idempotency_policy.h b/google/cloud/compute/target_pools/v1/target_pools_connection_idempotency_policy.h index 2a286426640e4..fd9dafc079137 100644 --- a/google/cloud/compute/target_pools/v1/target_pools_connection_idempotency_policy.h +++ b/google/cloud/compute/target_pools/v1/target_pools_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_POOLS_V1_TARGET_POOLS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_POOLS_V1_TARGET_POOLS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/target_pools/v1/target_pools.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_pools/v1/target_pools_proto_export.h b/google/cloud/compute/target_pools/v1/target_pools_proto_export.h index 9c18758151907..c38bcff3b167b 100644 --- a/google/cloud/compute/target_pools/v1/target_pools_proto_export.h +++ b/google/cloud/compute/target_pools/v1/target_pools_proto_export.h @@ -26,13 +26,13 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_POOLS_V1_TARGET_POOLS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_049.pb.h" +#include "google/cloud/compute/v1/internal/common_052.pb.h" +#include "google/cloud/compute/v1/internal/common_063.pb.h" +#include "google/cloud/compute/v1/internal/common_118.pb.h" +#include "google/cloud/compute/v1/internal/common_139.pb.h" +#include "google/cloud/compute/v1/internal/common_140.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_POOLS_V1_TARGET_POOLS_PROTO_EXPORT_H diff --git a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_option_defaults.cc b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_option_defaults.cc index ed24c5093cd74..0ed912db29125 100644 --- a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_option_defaults.cc +++ b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_option_defaults.cc @@ -44,7 +44,7 @@ Options TargetSslProxiesDefaultOptions(Options options) { options.set< compute_target_ssl_proxies_v1::TargetSslProxiesRetryPolicyOption>( compute_target_ssl_proxies_v1::TargetSslProxiesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_logging_decorator.h b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_logging_decorator.h index be5db1f1706e6..590327bf0e574 100644 --- a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_logging_decorator.h +++ b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_SSL_PROXIES_V1_INTERNAL_TARGET_SSL_PROXIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_SSL_PROXIES_V1_INTERNAL_TARGET_SSL_PROXIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.h" +#include "google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_metadata_decorator.cc b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_metadata_decorator.cc index 531508701372c..31bb9c96ae8e2 100644 --- a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_metadata_decorator.cc +++ b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies.proto #include "google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_metadata_decorator.h b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_metadata_decorator.h index a92c472a72108..89f83ebe7df1e 100644 --- a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_metadata_decorator.h +++ b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_SSL_PROXIES_V1_INTERNAL_TARGET_SSL_PROXIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_SSL_PROXIES_V1_INTERNAL_TARGET_SSL_PROXIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.h" +#include "google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.cc b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.cc index 7f45b90ab5bc1..712df00fe786c 100644 --- a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.cc +++ b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies.proto #include "google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.h b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.h index 2e92f6191edfd..9ce8af0d9b570 100644 --- a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.h +++ b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_SSL_PROXIES_V1_INTERNAL_TARGET_SSL_PROXIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_SSL_PROXIES_V1_INTERNAL_TARGET_SSL_PROXIES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_tracing_connection.cc b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_tracing_connection.cc index 79138a9bd7a0b..c6f282c81fea4 100644 --- a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_tracing_connection.cc +++ b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_target_ssl_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TargetSslProxiesTracingConnection::TargetSslProxiesTracingConnection( std::shared_ptr child) @@ -297,17 +295,13 @@ TargetSslProxiesTracingConnection::SetSslPolicy( return internal::EndSpan(std::move(span), child_->SetSslPolicy(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTargetSslProxiesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_tracing_connection.h b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_tracing_connection.h index 6baa93fcf5e82..57feb389d0b73 100644 --- a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_tracing_connection.h +++ b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_target_ssl_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TargetSslProxiesTracingConnection : public compute_target_ssl_proxies_v1::TargetSslProxiesConnection { public: @@ -136,8 +134,6 @@ class TargetSslProxiesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies_connection.h b/google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies_connection.h index 864cbdcc0046a..f616b746a18a3 100644 --- a/google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies_connection.h +++ b/google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_SSL_PROXIES_V1_TARGET_SSL_PROXIES_CONNECTION_H #include "google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_retry_traits.h" +#include "google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies.pb.h" #include "google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies_connection_idempotency_policy.h b/google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies_connection_idempotency_policy.h index 27d03f7e67e98..354e5032c8d85 100644 --- a/google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies_connection_idempotency_policy.h +++ b/google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_SSL_PROXIES_V1_TARGET_SSL_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_SSL_PROXIES_V1_TARGET_SSL_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies_proto_export.h b/google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies_proto_export.h index df926fd2bc2f2..2518416d36cba 100644 --- a/google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies_proto_export.h +++ b/google/cloud/compute/target_ssl_proxies/v1/target_ssl_proxies_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_SSL_PROXIES_V1_TARGET_SSL_PROXIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_129.pb.h" +#include "google/cloud/compute/v1/internal/common_141.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_SSL_PROXIES_V1_TARGET_SSL_PROXIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_option_defaults.cc b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_option_defaults.cc index fa465b0fdb621..a63d328720a3a 100644 --- a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_option_defaults.cc +++ b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_option_defaults.cc @@ -44,7 +44,7 @@ Options TargetTcpProxiesDefaultOptions(Options options) { options.set< compute_target_tcp_proxies_v1::TargetTcpProxiesRetryPolicyOption>( compute_target_tcp_proxies_v1::TargetTcpProxiesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_logging_decorator.h b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_logging_decorator.h index cca46f131d861..32a13953a0756 100644 --- a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_logging_decorator.h +++ b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_TCP_PROXIES_V1_INTERNAL_TARGET_TCP_PROXIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_TCP_PROXIES_V1_INTERNAL_TARGET_TCP_PROXIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.h" +#include "google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_metadata_decorator.cc b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_metadata_decorator.cc index a1bdb2510d408..561a8472587bb 100644 --- a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_metadata_decorator.cc +++ b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies.proto #include "google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_metadata_decorator.h b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_metadata_decorator.h index 787320a69916a..857d0dbd28f4f 100644 --- a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_metadata_decorator.h +++ b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_TCP_PROXIES_V1_INTERNAL_TARGET_TCP_PROXIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_TCP_PROXIES_V1_INTERNAL_TARGET_TCP_PROXIES_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.h" +#include "google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.cc b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.cc index fb0b05a9f65bc..7f88bcaebe19a 100644 --- a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.cc +++ b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies.proto #include "google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.h b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.h index 208143b989f97..4b88f8554ec80 100644 --- a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.h +++ b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_TCP_PROXIES_V1_INTERNAL_TARGET_TCP_PROXIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_TCP_PROXIES_V1_INTERNAL_TARGET_TCP_PROXIES_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_tracing_connection.cc b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_tracing_connection.cc index 63b252994d77b..90c2c77e2bf1a 100644 --- a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_tracing_connection.cc +++ b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_target_tcp_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TargetTcpProxiesTracingConnection::TargetTcpProxiesTracingConnection( std::shared_ptr child) @@ -212,17 +210,13 @@ TargetTcpProxiesTracingConnection::SetProxyHeader( return internal::EndSpan(std::move(span), child_->SetProxyHeader(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTargetTcpProxiesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_tracing_connection.h b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_tracing_connection.h index e2ec695e6a367..7e47641266caa 100644 --- a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_tracing_connection.h +++ b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_target_tcp_proxies_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TargetTcpProxiesTracingConnection : public compute_target_tcp_proxies_v1::TargetTcpProxiesConnection { public: @@ -107,8 +105,6 @@ class TargetTcpProxiesTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies_connection.h b/google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies_connection.h index e7adcffc8205c..a03358010eee0 100644 --- a/google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies_connection.h +++ b/google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_TCP_PROXIES_V1_TARGET_TCP_PROXIES_CONNECTION_H #include "google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_retry_traits.h" +#include "google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies.pb.h" #include "google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies_connection_idempotency_policy.h b/google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies_connection_idempotency_policy.h index 920e1640f65d9..71168c8ed4cb7 100644 --- a/google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies_connection_idempotency_policy.h +++ b/google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_TCP_PROXIES_V1_TARGET_TCP_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_TCP_PROXIES_V1_TARGET_TCP_PROXIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies_proto_export.h b/google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies_proto_export.h index 86ba1890fd9a9..d8adacff18dd7 100644 --- a/google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies_proto_export.h +++ b/google/cloud/compute/target_tcp_proxies/v1/target_tcp_proxies_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_TCP_PROXIES_V1_TARGET_TCP_PROXIES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_142.pb.h" +#include "google/cloud/compute/v1/internal/common_143.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_TCP_PROXIES_V1_TARGET_TCP_PROXIES_PROTO_EXPORT_H diff --git a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_option_defaults.cc b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_option_defaults.cc index 72ddd84900d21..410bc32edcb9e 100644 --- a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_option_defaults.cc +++ b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_option_defaults.cc @@ -44,7 +44,7 @@ Options TargetVpnGatewaysDefaultOptions(Options options) { options.set< compute_target_vpn_gateways_v1::TargetVpnGatewaysRetryPolicyOption>( compute_target_vpn_gateways_v1::TargetVpnGatewaysLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include namespace google { diff --git a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_logging_decorator.h b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_logging_decorator.h index eed118e6869b8..d4fc9b9eae80b 100644 --- a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_logging_decorator.h +++ b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_VPN_GATEWAYS_V1_INTERNAL_TARGET_VPN_GATEWAYS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_VPN_GATEWAYS_V1_INTERNAL_TARGET_VPN_GATEWAYS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.h" +#include "google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_metadata_decorator.cc b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_metadata_decorator.cc index 1ded399b09692..1c83c94a426fb 100644 --- a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_metadata_decorator.cc +++ b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways.proto #include "google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_metadata_decorator.h b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_metadata_decorator.h index e86bd8cc995c5..64a040462ccee 100644 --- a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_metadata_decorator.h +++ b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_VPN_GATEWAYS_V1_INTERNAL_TARGET_VPN_GATEWAYS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_VPN_GATEWAYS_V1_INTERNAL_TARGET_VPN_GATEWAYS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.h" +#include "google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.cc b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.cc index 1b735cc8bb792..431c1c5b9f8a4 100644 --- a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.cc +++ b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways.proto #include "google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.h b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.h index 6fc29d3fefe78..22ecf1e2a45a8 100644 --- a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.h +++ b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_VPN_GATEWAYS_V1_INTERNAL_TARGET_VPN_GATEWAYS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_VPN_GATEWAYS_V1_INTERNAL_TARGET_VPN_GATEWAYS_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_tracing_connection.cc b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_tracing_connection.cc index 41b830f04bd44..fcabd315ecc39 100644 --- a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_tracing_connection.cc +++ b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_target_vpn_gateways_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TargetVpnGatewaysTracingConnection::TargetVpnGatewaysTracingConnection( std::shared_ptr child) @@ -174,18 +172,14 @@ TargetVpnGatewaysTracingConnection::SetLabels( return internal::EndSpan(std::move(span), child_->SetLabels(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTargetVpnGatewaysTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_tracing_connection.h b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_tracing_connection.h index 3ad02e905d0de..bdf08a300fe40 100644 --- a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_tracing_connection.h +++ b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_target_vpn_gateways_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TargetVpnGatewaysTracingConnection : public compute_target_vpn_gateways_v1::TargetVpnGatewaysConnection { public: @@ -99,8 +97,6 @@ class TargetVpnGatewaysTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways_connection.h b/google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways_connection.h index 86d100d21d472..cbb8ce8b44c82 100644 --- a/google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways_connection.h +++ b/google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_VPN_GATEWAYS_V1_TARGET_VPN_GATEWAYS_CONNECTION_H #include "google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_retry_traits.h" +#include "google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways.pb.h" #include "google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways_connection_idempotency_policy.h b/google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways_connection_idempotency_policy.h index cd40af3fe791a..3b1c3ddd31dcc 100644 --- a/google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways_connection_idempotency_policy.h +++ b/google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_VPN_GATEWAYS_V1_TARGET_VPN_GATEWAYS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_VPN_GATEWAYS_V1_TARGET_VPN_GATEWAYS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways_proto_export.h b/google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways_proto_export.h index b636d530e1e62..ccdd2e817d00b 100644 --- a/google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways_proto_export.h +++ b/google/cloud/compute/target_vpn_gateways/v1/target_vpn_gateways_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_VPN_GATEWAYS_V1_TARGET_VPN_GATEWAYS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_107.pb.h" +#include "google/cloud/compute/v1/internal/common_144.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_TARGET_VPN_GATEWAYS_V1_TARGET_VPN_GATEWAYS_PROTO_EXPORT_H diff --git a/google/cloud/compute/url_maps/v1/internal/url_maps_option_defaults.cc b/google/cloud/compute/url_maps/v1/internal/url_maps_option_defaults.cc index 6cce3eb0945e0..358217a8c1a08 100644 --- a/google/cloud/compute/url_maps/v1/internal/url_maps_option_defaults.cc +++ b/google/cloud/compute/url_maps/v1/internal/url_maps_option_defaults.cc @@ -41,7 +41,7 @@ Options UrlMapsDefaultOptions(Options options) { if (!options.has()) { options.set( compute_url_maps_v1::UrlMapsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_connection_impl.h b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_connection_impl.h index dc9a2d253b7f2..082b0038ea46b 100644 --- a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_connection_impl.h +++ b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_URL_MAPS_V1_INTERNAL_URL_MAPS_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_URL_MAPS_V1_INTERNAL_URL_MAPS_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.h" #include "google/cloud/compute/url_maps/v1/internal/url_maps_retry_traits.h" #include "google/cloud/compute/url_maps/v1/url_maps_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_logging_decorator.h b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_logging_decorator.h index 4d176a04d960a..8bf58112f8054 100644 --- a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_logging_decorator.h +++ b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_URL_MAPS_V1_INTERNAL_URL_MAPS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_URL_MAPS_V1_INTERNAL_URL_MAPS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.h" +#include "google/cloud/compute/url_maps/v1/url_maps.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_metadata_decorator.cc b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_metadata_decorator.cc index f2730db5e5dd5..550e7baee1f34 100644 --- a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_metadata_decorator.cc +++ b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/url_maps/v1/url_maps.proto #include "google/cloud/compute/url_maps/v1/internal/url_maps_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_metadata_decorator.h b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_metadata_decorator.h index aa770354fe8d6..62eeb60893749 100644 --- a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_metadata_decorator.h +++ b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_URL_MAPS_V1_INTERNAL_URL_MAPS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_URL_MAPS_V1_INTERNAL_URL_MAPS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" #include "google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.h" +#include "google/cloud/compute/url_maps/v1/url_maps.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.cc b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.cc index a7268e89a6cc2..76cbf1ce2759e 100644 --- a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.cc +++ b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/url_maps/v1/url_maps.proto #include "google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.h" +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/url_maps/v1/url_maps.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.h b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.h index b7dd4fa6fb8e3..553a9cd6c7ae4 100644 --- a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.h +++ b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_URL_MAPS_V1_INTERNAL_URL_MAPS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_URL_MAPS_V1_INTERNAL_URL_MAPS_REST_STUB_H +#include "google/cloud/compute/global_operations/v1/global_operations.pb.h" +#include "google/cloud/compute/url_maps/v1/url_maps.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/url_maps/v1/internal/url_maps_tracing_connection.cc b/google/cloud/compute/url_maps/v1/internal/url_maps_tracing_connection.cc index 36eb502e47f0f..ffb4a9cc3bd15 100644 --- a/google/cloud/compute/url_maps/v1/internal/url_maps_tracing_connection.cc +++ b/google/cloud/compute/url_maps/v1/internal/url_maps_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_url_maps_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - UrlMapsTracingConnection::UrlMapsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -228,16 +226,12 @@ UrlMapsTracingConnection::Validate( return internal::EndSpan(*span, child_->Validate(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeUrlMapsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/url_maps/v1/internal/url_maps_tracing_connection.h b/google/cloud/compute/url_maps/v1/internal/url_maps_tracing_connection.h index b80fc54b84daa..a4c4382c763d7 100644 --- a/google/cloud/compute/url_maps/v1/internal/url_maps_tracing_connection.h +++ b/google/cloud/compute/url_maps/v1/internal/url_maps_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_url_maps_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class UrlMapsTracingConnection : public compute_url_maps_v1::UrlMapsConnection { public: ~UrlMapsTracingConnection() override = default; @@ -121,8 +119,6 @@ class UrlMapsTracingConnection : public compute_url_maps_v1::UrlMapsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/url_maps/v1/url_maps_connection.h b/google/cloud/compute/url_maps/v1/url_maps_connection.h index 49b249a0b4c39..931d51d72d425 100644 --- a/google/cloud/compute/url_maps/v1/url_maps_connection.h +++ b/google/cloud/compute/url_maps/v1/url_maps_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_URL_MAPS_V1_URL_MAPS_CONNECTION_H #include "google/cloud/compute/url_maps/v1/internal/url_maps_retry_traits.h" +#include "google/cloud/compute/url_maps/v1/url_maps.pb.h" #include "google/cloud/compute/url_maps/v1/url_maps_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/url_maps/v1/url_maps_connection_idempotency_policy.h b/google/cloud/compute/url_maps/v1/url_maps_connection_idempotency_policy.h index 18342e33017f6..b22ff0bec4526 100644 --- a/google/cloud/compute/url_maps/v1/url_maps_connection_idempotency_policy.h +++ b/google/cloud/compute/url_maps/v1/url_maps_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_URL_MAPS_V1_URL_MAPS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_URL_MAPS_V1_URL_MAPS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/url_maps/v1/url_maps.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/url_maps/v1/url_maps_proto_export.h b/google/cloud/compute/url_maps/v1/url_maps_proto_export.h index 176268d82c88f..074ac7e920b9c 100644 --- a/google/cloud/compute/url_maps/v1/url_maps_proto_export.h +++ b/google/cloud/compute/url_maps/v1/url_maps_proto_export.h @@ -26,11 +26,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_URL_MAPS_V1_URL_MAPS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_018.pb.h" +#include "google/cloud/compute/v1/internal/common_020.pb.h" +#include "google/cloud/compute/v1/internal/common_029.pb.h" +#include "google/cloud/compute/v1/internal/common_082.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_URL_MAPS_V1_URL_MAPS_PROTO_EXPORT_H diff --git a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_option_defaults.cc b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_option_defaults.cc index df43e4e3e79a2..809e5fd4f5c9f 100644 --- a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_option_defaults.cc +++ b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_option_defaults.cc @@ -41,7 +41,7 @@ Options VpnGatewaysDefaultOptions(Options options) { if (!options.has()) { options.set( compute_vpn_gateways_v1::VpnGatewaysLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_connection_impl.h b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_connection_impl.h index bf6ce1ab85e12..6c564608a821e 100644 --- a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_connection_impl.h +++ b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_GATEWAYS_V1_INTERNAL_VPN_GATEWAYS_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_GATEWAYS_V1_INTERNAL_VPN_GATEWAYS_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.h" #include "google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_retry_traits.h" #include "google/cloud/compute/vpn_gateways/v1/vpn_gateways_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_logging_decorator.h b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_logging_decorator.h index bf2dca5445bf4..3ccfa5e3ffa92 100644 --- a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_logging_decorator.h +++ b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_GATEWAYS_V1_INTERNAL_VPN_GATEWAYS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_GATEWAYS_V1_INTERNAL_VPN_GATEWAYS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.h" +#include "google/cloud/compute/vpn_gateways/v1/vpn_gateways.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_metadata_decorator.cc b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_metadata_decorator.cc index e39c1f7c73041..ba45e04df5659 100644 --- a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_metadata_decorator.cc +++ b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/vpn_gateways/v1/vpn_gateways.proto #include "google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_metadata_decorator.h b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_metadata_decorator.h index f9ba0a6838a8a..c8fbae65e9b6c 100644 --- a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_metadata_decorator.h +++ b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_GATEWAYS_V1_INTERNAL_VPN_GATEWAYS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_GATEWAYS_V1_INTERNAL_VPN_GATEWAYS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.h" +#include "google/cloud/compute/vpn_gateways/v1/vpn_gateways.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.cc b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.cc index ea1ead991e1af..9adcb5a9d1dd4 100644 --- a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.cc +++ b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/vpn_gateways/v1/vpn_gateways.proto #include "google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/vpn_gateways/v1/vpn_gateways.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.h b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.h index b5f76079a2939..961bb88a11bd6 100644 --- a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.h +++ b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_GATEWAYS_V1_INTERNAL_VPN_GATEWAYS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_GATEWAYS_V1_INTERNAL_VPN_GATEWAYS_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/vpn_gateways/v1/vpn_gateways.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_tracing_connection.cc b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_tracing_connection.cc index efea810f31237..4933537e60b8f 100644 --- a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_tracing_connection.cc +++ b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_vpn_gateways_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VpnGatewaysTracingConnection::VpnGatewaysTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -183,16 +181,12 @@ VpnGatewaysTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVpnGatewaysTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_tracing_connection.h b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_tracing_connection.h index 3091e646922e8..df23fbb318111 100644 --- a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_tracing_connection.h +++ b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_vpn_gateways_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VpnGatewaysTracingConnection : public compute_vpn_gateways_v1::VpnGatewaysConnection { public: @@ -101,8 +99,6 @@ class VpnGatewaysTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/vpn_gateways/v1/vpn_gateways_connection.h b/google/cloud/compute/vpn_gateways/v1/vpn_gateways_connection.h index 20a67db7e0f4d..0e06980fcf430 100644 --- a/google/cloud/compute/vpn_gateways/v1/vpn_gateways_connection.h +++ b/google/cloud/compute/vpn_gateways/v1/vpn_gateways_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_GATEWAYS_V1_VPN_GATEWAYS_CONNECTION_H #include "google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_retry_traits.h" +#include "google/cloud/compute/vpn_gateways/v1/vpn_gateways.pb.h" #include "google/cloud/compute/vpn_gateways/v1/vpn_gateways_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/vpn_gateways/v1/vpn_gateways_connection_idempotency_policy.h b/google/cloud/compute/vpn_gateways/v1/vpn_gateways_connection_idempotency_policy.h index 79798c432f4fc..a9b9405463746 100644 --- a/google/cloud/compute/vpn_gateways/v1/vpn_gateways_connection_idempotency_policy.h +++ b/google/cloud/compute/vpn_gateways/v1/vpn_gateways_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_GATEWAYS_V1_VPN_GATEWAYS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_GATEWAYS_V1_VPN_GATEWAYS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/vpn_gateways/v1/vpn_gateways.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/vpn_gateways/v1/vpn_gateways_proto_export.h b/google/cloud/compute/vpn_gateways/v1/vpn_gateways_proto_export.h index 6d263eccca367..4511d005df643 100644 --- a/google/cloud/compute/vpn_gateways/v1/vpn_gateways_proto_export.h +++ b/google/cloud/compute/vpn_gateways/v1/vpn_gateways_proto_export.h @@ -26,10 +26,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_GATEWAYS_V1_VPN_GATEWAYS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_107.pb.h" +#include "google/cloud/compute/v1/internal/common_145.pb.h" +#include "google/cloud/compute/v1/internal/common_148.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_GATEWAYS_V1_VPN_GATEWAYS_PROTO_EXPORT_H diff --git a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_option_defaults.cc b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_option_defaults.cc index 5886219d8feee..6bdada5d83172 100644 --- a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_option_defaults.cc +++ b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_option_defaults.cc @@ -41,7 +41,7 @@ Options VpnTunnelsDefaultOptions(Options options) { if (!options.has()) { options.set( compute_vpn_tunnels_v1::VpnTunnelsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_connection_impl.h b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_connection_impl.h index a88211da6df67..f0a101cc83ac2 100644 --- a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_connection_impl.h +++ b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_connection_impl.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_TUNNELS_V1_INTERNAL_VPN_TUNNELS_REST_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_TUNNELS_V1_INTERNAL_VPN_TUNNELS_REST_CONNECTION_IMPL_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.h" #include "google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_retry_traits.h" #include "google/cloud/compute/vpn_tunnels/v1/vpn_tunnels_connection.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_logging_decorator.h b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_logging_decorator.h index 94de8dff3ac73..517dd0cb0deec 100644 --- a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_logging_decorator.h +++ b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_logging_decorator.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_TUNNELS_V1_INTERNAL_VPN_TUNNELS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_TUNNELS_V1_INTERNAL_VPN_TUNNELS_REST_LOGGING_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.h" +#include "google/cloud/compute/vpn_tunnels/v1/vpn_tunnels.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include #include #include #include diff --git a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_metadata_decorator.cc b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_metadata_decorator.cc index f0fd13e2a7720..d7194deaa261c 100644 --- a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_metadata_decorator.cc +++ b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/vpn_tunnels/v1/vpn_tunnels.proto #include "google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_metadata_decorator.h b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_metadata_decorator.h index 66f310c5eaaf9..96c8394dbe23f 100644 --- a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_metadata_decorator.h +++ b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_metadata_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_TUNNELS_V1_INTERNAL_VPN_TUNNELS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_TUNNELS_V1_INTERNAL_VPN_TUNNELS_REST_METADATA_DECORATOR_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" #include "google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.h" +#include "google/cloud/compute/vpn_tunnels/v1/vpn_tunnels.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include #include #include diff --git a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.cc b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.cc index 1b88c250ed773..1c0792a32499e 100644 --- a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.cc +++ b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.cc @@ -17,12 +17,12 @@ // source: google/cloud/compute/vpn_tunnels/v1/vpn_tunnels.proto #include "google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.h" +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/vpn_tunnels/v1/vpn_tunnels.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.h b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.h index 0cd3f46fd6d22..0c0a379bd8033 100644 --- a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.h +++ b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.h @@ -19,13 +19,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_TUNNELS_V1_INTERNAL_VPN_TUNNELS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_TUNNELS_V1_INTERNAL_VPN_TUNNELS_REST_STUB_H +#include "google/cloud/compute/region_operations/v1/region_operations.pb.h" +#include "google/cloud/compute/vpn_tunnels/v1/vpn_tunnels.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_tracing_connection.cc b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_tracing_connection.cc index 705de28107c23..d4fce79e45a66 100644 --- a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_tracing_connection.cc +++ b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_vpn_tunnels_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VpnTunnelsTracingConnection::VpnTunnelsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -162,16 +160,12 @@ VpnTunnelsTracingConnection::SetLabels( return internal::EndSpan(std::move(span), child_->SetLabels(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVpnTunnelsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_tracing_connection.h b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_tracing_connection.h index 8ebf213bf5267..a3458246108cf 100644 --- a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_tracing_connection.h +++ b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_vpn_tunnels_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VpnTunnelsTracingConnection : public compute_vpn_tunnels_v1::VpnTunnelsConnection { public: @@ -92,8 +90,6 @@ class VpnTunnelsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/vpn_tunnels/v1/vpn_tunnels_connection.h b/google/cloud/compute/vpn_tunnels/v1/vpn_tunnels_connection.h index 99b2340e052df..b07b7b38c371d 100644 --- a/google/cloud/compute/vpn_tunnels/v1/vpn_tunnels_connection.h +++ b/google/cloud/compute/vpn_tunnels/v1/vpn_tunnels_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_TUNNELS_V1_VPN_TUNNELS_CONNECTION_H #include "google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_retry_traits.h" +#include "google/cloud/compute/vpn_tunnels/v1/vpn_tunnels.pb.h" #include "google/cloud/compute/vpn_tunnels/v1/vpn_tunnels_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,7 +31,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/vpn_tunnels/v1/vpn_tunnels_connection_idempotency_policy.h b/google/cloud/compute/vpn_tunnels/v1/vpn_tunnels_connection_idempotency_policy.h index 5bf3eca60b723..5921d87a9869b 100644 --- a/google/cloud/compute/vpn_tunnels/v1/vpn_tunnels_connection_idempotency_policy.h +++ b/google/cloud/compute/vpn_tunnels/v1/vpn_tunnels_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_TUNNELS_V1_VPN_TUNNELS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_TUNNELS_V1_VPN_TUNNELS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/vpn_tunnels/v1/vpn_tunnels.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/vpn_tunnels/v1/vpn_tunnels_proto_export.h b/google/cloud/compute/vpn_tunnels/v1/vpn_tunnels_proto_export.h index e7773e8debe51..d551a462fbb5f 100644 --- a/google/cloud/compute/vpn_tunnels/v1/vpn_tunnels_proto_export.h +++ b/google/cloud/compute/vpn_tunnels/v1/vpn_tunnels_proto_export.h @@ -26,9 +26,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_TUNNELS_V1_VPN_TUNNELS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_107.pb.h" +#include "google/cloud/compute/v1/internal/common_149.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_VPN_TUNNELS_V1_VPN_TUNNELS_PROTO_EXPORT_H diff --git a/google/cloud/compute/zone_operations/v1/internal/zone_operations_option_defaults.cc b/google/cloud/compute/zone_operations/v1/internal/zone_operations_option_defaults.cc index f87152e301873..2446dd73cce02 100644 --- a/google/cloud/compute/zone_operations/v1/internal/zone_operations_option_defaults.cc +++ b/google/cloud/compute/zone_operations/v1/internal/zone_operations_option_defaults.cc @@ -42,7 +42,7 @@ Options ZoneOperationsDefaultOptions(Options options) { compute_zone_operations_v1::ZoneOperationsRetryPolicyOption>()) { options.set( compute_zone_operations_v1::ZoneOperationsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_logging_decorator.h b/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_logging_decorator.h index b7b1201ce9743..8ed9f3fd2c05f 100644 --- a/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_logging_decorator.h +++ b/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_logging_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONE_OPERATIONS_V1_INTERNAL_ZONE_OPERATIONS_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_metadata_decorator.cc b/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_metadata_decorator.cc index b1643744b57e1..01d63f21c3abb 100644 --- a/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_metadata_decorator.cc +++ b/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/zone_operations/v1/zone_operations.proto #include "google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_metadata_decorator.h b/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_metadata_decorator.h index cc6075b63b229..e92f05f9f4240 100644 --- a/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_metadata_decorator.h +++ b/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_metadata_decorator.h @@ -20,10 +20,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONE_OPERATIONS_V1_INTERNAL_ZONE_OPERATIONS_REST_METADATA_DECORATOR_H #include "google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.cc b/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.cc index b8598bda34eb2..f672e5261bf4b 100644 --- a/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.cc +++ b/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/zone_operations/v1/zone_operations.proto #include "google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.h b/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.h index eb1531554b7ee..98b8359951da9 100644 --- a/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.h +++ b/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONE_OPERATIONS_V1_INTERNAL_ZONE_OPERATIONS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONE_OPERATIONS_V1_INTERNAL_ZONE_OPERATIONS_REST_STUB_H +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/zone_operations/v1/internal/zone_operations_tracing_connection.cc b/google/cloud/compute/zone_operations/v1/internal/zone_operations_tracing_connection.cc index 38811303c68b0..5c9deadbd7833 100644 --- a/google/cloud/compute/zone_operations/v1/internal/zone_operations_tracing_connection.cc +++ b/google/cloud/compute/zone_operations/v1/internal/zone_operations_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_zone_operations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ZoneOperationsTracingConnection::ZoneOperationsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -76,17 +74,13 @@ ZoneOperationsTracingConnection::Wait( return internal::EndSpan(*span, child_->Wait(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeZoneOperationsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/zone_operations/v1/internal/zone_operations_tracing_connection.h b/google/cloud/compute/zone_operations/v1/internal/zone_operations_tracing_connection.h index a4795a24ca225..fa16aa5f1c01c 100644 --- a/google/cloud/compute/zone_operations/v1/internal/zone_operations_tracing_connection.h +++ b/google/cloud/compute/zone_operations/v1/internal/zone_operations_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_zone_operations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ZoneOperationsTracingConnection : public compute_zone_operations_v1::ZoneOperationsConnection { public: @@ -60,8 +58,6 @@ class ZoneOperationsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/zone_operations/v1/zone_operations_connection.h b/google/cloud/compute/zone_operations/v1/zone_operations_connection.h index d4e8903e632f6..f8fb4f8f6ac4e 100644 --- a/google/cloud/compute/zone_operations/v1/zone_operations_connection.h +++ b/google/cloud/compute/zone_operations/v1/zone_operations_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONE_OPERATIONS_V1_ZONE_OPERATIONS_CONNECTION_H #include "google/cloud/compute/zone_operations/v1/internal/zone_operations_retry_traits.h" +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/compute/zone_operations/v1/zone_operations_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/zone_operations/v1/zone_operations_connection_idempotency_policy.h b/google/cloud/compute/zone_operations/v1/zone_operations_connection_idempotency_policy.h index 17a2c484f4e35..cf63aba8cbf61 100644 --- a/google/cloud/compute/zone_operations/v1/zone_operations_connection_idempotency_policy.h +++ b/google/cloud/compute/zone_operations/v1/zone_operations_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONE_OPERATIONS_V1_ZONE_OPERATIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONE_OPERATIONS_V1_ZONE_OPERATIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/zone_operations/v1/zone_operations.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/zone_operations/v1/zone_operations_proto_export.h b/google/cloud/compute/zone_operations/v1/zone_operations_proto_export.h index da248b1100fe4..f5d9d5a810e1e 100644 --- a/google/cloud/compute/zone_operations/v1/zone_operations_proto_export.h +++ b/google/cloud/compute/zone_operations/v1/zone_operations_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONE_OPERATIONS_V1_ZONE_OPERATIONS_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_016.pb.h" +#include "google/cloud/compute/v1/internal/common_092.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONE_OPERATIONS_V1_ZONE_OPERATIONS_PROTO_EXPORT_H diff --git a/google/cloud/compute/zones/v1/internal/zones_option_defaults.cc b/google/cloud/compute/zones/v1/internal/zones_option_defaults.cc index 6d35c5c951536..54dbaa133a9fa 100644 --- a/google/cloud/compute/zones/v1/internal/zones_option_defaults.cc +++ b/google/cloud/compute/zones/v1/internal/zones_option_defaults.cc @@ -40,7 +40,7 @@ Options ZonesDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - compute_zones_v1::ZonesLimitedTimeRetryPolicy(std::chrono::minutes(30)) + compute_zones_v1::ZonesLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/compute/zones/v1/internal/zones_rest_logging_decorator.h b/google/cloud/compute/zones/v1/internal/zones_rest_logging_decorator.h index ade0bbe161b82..3abbe0f97d2ef 100644 --- a/google/cloud/compute/zones/v1/internal/zones_rest_logging_decorator.h +++ b/google/cloud/compute/zones/v1/internal/zones_rest_logging_decorator.h @@ -20,11 +20,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONES_V1_INTERNAL_ZONES_REST_LOGGING_DECORATOR_H #include "google/cloud/compute/zones/v1/internal/zones_rest_stub.h" +#include "google/cloud/compute/zones/v1/zones.pb.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/compute/zones/v1/internal/zones_rest_metadata_decorator.cc b/google/cloud/compute/zones/v1/internal/zones_rest_metadata_decorator.cc index bcad8bbc8d939..70fbe6f488369 100644 --- a/google/cloud/compute/zones/v1/internal/zones_rest_metadata_decorator.cc +++ b/google/cloud/compute/zones/v1/internal/zones_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/compute/zones/v1/zones.proto #include "google/cloud/compute/zones/v1/internal/zones_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/compute/zones/v1/internal/zones_rest_metadata_decorator.h b/google/cloud/compute/zones/v1/internal/zones_rest_metadata_decorator.h index d3786c361782d..0a8ad4bf1c067 100644 --- a/google/cloud/compute/zones/v1/internal/zones_rest_metadata_decorator.h +++ b/google/cloud/compute/zones/v1/internal/zones_rest_metadata_decorator.h @@ -20,10 +20,10 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONES_V1_INTERNAL_ZONES_REST_METADATA_DECORATOR_H #include "google/cloud/compute/zones/v1/internal/zones_rest_stub.h" +#include "google/cloud/compute/zones/v1/zones.pb.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/compute/zones/v1/internal/zones_rest_stub.cc b/google/cloud/compute/zones/v1/internal/zones_rest_stub.cc index ec35fce04a606..ea644b20dd516 100644 --- a/google/cloud/compute/zones/v1/internal/zones_rest_stub.cc +++ b/google/cloud/compute/zones/v1/internal/zones_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/compute/zones/v1/zones.proto #include "google/cloud/compute/zones/v1/internal/zones_rest_stub.h" +#include "google/cloud/compute/zones/v1/zones.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/compute/zones/v1/internal/zones_rest_stub.h b/google/cloud/compute/zones/v1/internal/zones_rest_stub.h index 30d33cfc52a98..86c7bb5545414 100644 --- a/google/cloud/compute/zones/v1/internal/zones_rest_stub.h +++ b/google/cloud/compute/zones/v1/internal/zones_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONES_V1_INTERNAL_ZONES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONES_V1_INTERNAL_ZONES_REST_STUB_H +#include "google/cloud/compute/zones/v1/zones.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/zones/v1/internal/zones_tracing_connection.cc b/google/cloud/compute/zones/v1/internal/zones_tracing_connection.cc index 4b6cfa2f18095..53f12ce3d31aa 100644 --- a/google/cloud/compute/zones/v1/internal/zones_tracing_connection.cc +++ b/google/cloud/compute/zones/v1/internal/zones_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace compute_zones_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ZonesTracingConnection::ZonesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -51,15 +49,11 @@ ZonesTracingConnection::ListZones( std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeZonesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/compute/zones/v1/internal/zones_tracing_connection.h b/google/cloud/compute/zones/v1/internal/zones_tracing_connection.h index 7057f347987fe..7677441534d0d 100644 --- a/google/cloud/compute/zones/v1/internal/zones_tracing_connection.h +++ b/google/cloud/compute/zones/v1/internal/zones_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace compute_zones_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ZonesTracingConnection : public compute_zones_v1::ZonesConnection { public: ~ZonesTracingConnection() override = default; @@ -51,8 +49,6 @@ class ZonesTracingConnection : public compute_zones_v1::ZonesConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/compute/zones/v1/zones_connection.h b/google/cloud/compute/zones/v1/zones_connection.h index 326f8bfee0292..5a999723a6eab 100644 --- a/google/cloud/compute/zones/v1/zones_connection.h +++ b/google/cloud/compute/zones/v1/zones_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONES_V1_ZONES_CONNECTION_H #include "google/cloud/compute/zones/v1/internal/zones_retry_traits.h" +#include "google/cloud/compute/zones/v1/zones.pb.h" #include "google/cloud/compute/zones/v1/zones_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/zones/v1/zones_connection_idempotency_policy.h b/google/cloud/compute/zones/v1/zones_connection_idempotency_policy.h index c8ac6e8ac446f..bcc7d5cccc30b 100644 --- a/google/cloud/compute/zones/v1/zones_connection_idempotency_policy.h +++ b/google/cloud/compute/zones/v1/zones_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONES_V1_ZONES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONES_V1_ZONES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/compute/zones/v1/zones.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/compute/zones/v1/zones_proto_export.h b/google/cloud/compute/zones/v1/zones_proto_export.h index 85ba6f8146ff8..be0f981cd6a7b 100644 --- a/google/cloud/compute/zones/v1/zones_proto_export.h +++ b/google/cloud/compute/zones/v1/zones_proto_export.h @@ -26,8 +26,8 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONES_V1_ZONES_PROTO_EXPORT_H // IWYU pragma: begin_exports -#include -#include +#include "google/cloud/compute/v1/internal/common_023.pb.h" +#include "google/cloud/compute/v1/internal/common_150.pb.h" // IWYU pragma: end_exports #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_COMPUTE_ZONES_V1_ZONES_PROTO_EXPORT_H diff --git a/google/cloud/confidentialcomputing/BUILD.bazel b/google/cloud/confidentialcomputing/BUILD.bazel index 472ceffc849d7..e02a81d44a4a7 100644 --- a/google/cloud/confidentialcomputing/BUILD.bazel +++ b/google/cloud/confidentialcomputing/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/confidentialcomputing/v1:confidentialcomputing_cc_grpc", + "@googleapis//google/cloud/confidentialcomputing/v1:confidentialcomputing_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/confidentialcomputing/quickstart/.bazelrc b/google/cloud/confidentialcomputing/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/confidentialcomputing/quickstart/.bazelrc +++ b/google/cloud/confidentialcomputing/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/confidentialcomputing/quickstart/CMakeLists.txt index 088a297eaab87..b578e116060b2 100644 --- a/google/cloud/confidentialcomputing/quickstart/CMakeLists.txt +++ b/google/cloud/confidentialcomputing/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Confidential Computing API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-confidentialcomputing-quickstart CXX) find_package(google_cloud_cpp_confidentialcomputing REQUIRED) diff --git a/google/cloud/confidentialcomputing/quickstart/WORKSPACE.bazel b/google/cloud/confidentialcomputing/quickstart/WORKSPACE.bazel index 74d5f95bace2b..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 = "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/confidentialcomputing/v1/confidential_computing_client.h b/google/cloud/confidentialcomputing/v1/confidential_computing_client.h index 3b0fa5861702d..32d7a5d466f58 100644 --- a/google/cloud/confidentialcomputing/v1/confidential_computing_client.h +++ b/google/cloud/confidentialcomputing/v1/confidential_computing_client.h @@ -176,7 +176,7 @@ class ConfidentialComputingClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.confidentialcomputing.v1.VerifyAttestationRequest]: @googleapis_reference_link{google/cloud/confidentialcomputing/v1/service.proto#L183} - /// [google.cloud.confidentialcomputing.v1.VerifyAttestationResponse]: @googleapis_reference_link{google/cloud/confidentialcomputing/v1/service.proto#L263} + /// [google.cloud.confidentialcomputing.v1.VerifyAttestationResponse]: @googleapis_reference_link{google/cloud/confidentialcomputing/v1/service.proto#L363} /// // clang-format on StatusOr @@ -209,8 +209,8 @@ class ConfidentialComputingClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.confidentialcomputing.v1.VerifyConfidentialSpaceRequest]: @googleapis_reference_link{google/cloud/confidentialcomputing/v1/service.proto#L411} - /// [google.cloud.confidentialcomputing.v1.VerifyConfidentialSpaceResponse]: @googleapis_reference_link{google/cloud/confidentialcomputing/v1/service.proto#L493} + /// [google.cloud.confidentialcomputing.v1.VerifyConfidentialSpaceRequest]: @googleapis_reference_link{google/cloud/confidentialcomputing/v1/service.proto#L511} + /// [google.cloud.confidentialcomputing.v1.VerifyConfidentialSpaceResponse]: @googleapis_reference_link{google/cloud/confidentialcomputing/v1/service.proto#L598} /// // clang-format on StatusOr< @@ -243,8 +243,8 @@ class ConfidentialComputingClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.confidentialcomputing.v1.VerifyConfidentialGkeRequest]: @googleapis_reference_link{google/cloud/confidentialcomputing/v1/service.proto#L511} - /// [google.cloud.confidentialcomputing.v1.VerifyConfidentialGkeResponse]: @googleapis_reference_link{google/cloud/confidentialcomputing/v1/service.proto#L533} + /// [google.cloud.confidentialcomputing.v1.VerifyConfidentialGkeRequest]: @googleapis_reference_link{google/cloud/confidentialcomputing/v1/service.proto#L616} + /// [google.cloud.confidentialcomputing.v1.VerifyConfidentialGkeResponse]: @googleapis_reference_link{google/cloud/confidentialcomputing/v1/service.proto#L657} /// // clang-format on StatusOr< diff --git a/google/cloud/confidentialcomputing/v1/confidential_computing_connection.h b/google/cloud/confidentialcomputing/v1/confidential_computing_connection.h index 8fd5df94cb5d6..d5fd77ad8ee68 100644 --- a/google/cloud/confidentialcomputing/v1/confidential_computing_connection.h +++ b/google/cloud/confidentialcomputing/v1/confidential_computing_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/confidentialcomputing/v1/confidential_computing_connection_idempotency_policy.h" #include "google/cloud/confidentialcomputing/v1/internal/confidential_computing_retry_traits.h" +#include "google/cloud/confidentialcomputing/v1/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 #include namespace google { diff --git a/google/cloud/confidentialcomputing/v1/confidential_computing_connection_idempotency_policy.h b/google/cloud/confidentialcomputing/v1/confidential_computing_connection_idempotency_policy.h index 17cb6121d061f..9794b2586f4ec 100644 --- a/google/cloud/confidentialcomputing/v1/confidential_computing_connection_idempotency_policy.h +++ b/google/cloud/confidentialcomputing/v1/confidential_computing_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIDENTIALCOMPUTING_V1_CONFIDENTIAL_COMPUTING_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIDENTIALCOMPUTING_V1_CONFIDENTIAL_COMPUTING_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/confidentialcomputing/v1/service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_auth_decorator.cc b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_auth_decorator.cc index bf79dc0072be2..d36df1c7e0c5d 100644 --- a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_auth_decorator.cc +++ b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/confidentialcomputing/v1/service.proto #include "google/cloud/confidentialcomputing/v1/internal/confidential_computing_auth_decorator.h" -#include +#include "google/cloud/confidentialcomputing/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace confidentialcomputing_v1_internal { @@ -95,3 +98,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace confidentialcomputing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_auth_decorator.h b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_auth_decorator.h index e93814869588b..17f915ea8609b 100644 --- a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_auth_decorator.h +++ b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace confidentialcomputing_v1_internal { @@ -81,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIDENTIALCOMPUTING_V1_INTERNAL_CONFIDENTIAL_COMPUTING_AUTH_DECORATOR_H diff --git a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_logging_decorator.cc b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_logging_decorator.cc index 2a4e0204765fd..266b2bc5b3d37 100644 --- a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_logging_decorator.cc +++ b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/confidentialcomputing/v1/service.proto #include "google/cloud/confidentialcomputing/v1/internal/confidential_computing_logging_decorator.h" +#include "google/cloud/confidentialcomputing/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace confidentialcomputing_v1_internal { @@ -121,3 +124,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace confidentialcomputing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_logging_decorator.h b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_logging_decorator.h index 0814ea58d7c16..b1c63df1b8ae4 100644 --- a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_logging_decorator.h +++ b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace confidentialcomputing_v1_internal { @@ -81,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIDENTIALCOMPUTING_V1_INTERNAL_CONFIDENTIAL_COMPUTING_LOGGING_DECORATOR_H diff --git a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_metadata_decorator.cc b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_metadata_decorator.cc index 9112e6878a103..070873380c5c2 100644 --- a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_metadata_decorator.cc +++ b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/confidentialcomputing/v1/service.proto #include "google/cloud/confidentialcomputing/v1/internal/confidential_computing_metadata_decorator.h" +#include "google/cloud/confidentialcomputing/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 confidentialcomputing_v1_internal { @@ -124,3 +128,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace confidentialcomputing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_metadata_decorator.h b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_metadata_decorator.h index 2f10d4f39ef02..bce36387b6e53 100644 --- a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_metadata_decorator.h +++ b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace confidentialcomputing_v1_internal { @@ -87,4 +90,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIDENTIALCOMPUTING_V1_INTERNAL_CONFIDENTIAL_COMPUTING_METADATA_DECORATOR_H diff --git a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_option_defaults.cc b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_option_defaults.cc index 8933b073831e9..45952740d3172 100644 --- a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_option_defaults.cc +++ b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_option_defaults.cc @@ -44,7 +44,7 @@ Options ConfidentialComputingDefaultOptions(Options options) { options.set< confidentialcomputing_v1::ConfidentialComputingRetryPolicyOption>( confidentialcomputing_v1::ConfidentialComputingLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace confidentialcomputing_v1_internal { @@ -115,3 +118,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace confidentialcomputing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_stub.h b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_stub.h index 7dc8bfeb6380d..cdf88f6bac7f2 100644 --- a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_stub.h +++ b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIDENTIALCOMPUTING_V1_INTERNAL_CONFIDENTIAL_COMPUTING_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIDENTIALCOMPUTING_V1_INTERNAL_CONFIDENTIAL_COMPUTING_STUB_H +#include "google/cloud/confidentialcomputing/v1/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 -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace confidentialcomputing_v1_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIDENTIALCOMPUTING_V1_INTERNAL_CONFIDENTIAL_COMPUTING_STUB_H diff --git a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_stub_factory.cc b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_stub_factory.cc index 7103c3697ec62..a20090e32a038 100644 --- a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_stub_factory.cc +++ b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/confidentialcomputing/v1/internal/confidential_computing_metadata_decorator.h" #include "google/cloud/confidentialcomputing/v1/internal/confidential_computing_stub.h" #include "google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_stub.h" +#include "google/cloud/confidentialcomputing/v1/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 -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace confidentialcomputing_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace confidentialcomputing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_stub_factory.h b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_stub_factory.h index 5952d897ad289..3ef20587315dc 100644 --- a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_stub_factory.h +++ b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace confidentialcomputing_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIDENTIALCOMPUTING_V1_INTERNAL_CONFIDENTIAL_COMPUTING_STUB_FACTORY_H diff --git a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_connection.cc b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_connection.cc index 96c7ec4bafb85..4389d1f4ccff4 100644 --- a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_connection.cc +++ b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace confidentialcomputing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConfidentialComputingTracingConnection::ConfidentialComputingTracingConnection( std::shared_ptr child) @@ -101,18 +99,14 @@ ConfidentialComputingTracingConnection::GetLocation( return internal::EndSpan(*span, child_->GetLocation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConfidentialComputingTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_connection.h b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_connection.h index 273159a152136..c70e74c69ff82 100644 --- a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_connection.h +++ b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace confidentialcomputing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConfidentialComputingTracingConnection : public confidentialcomputing_v1::ConfidentialComputingConnection { public: @@ -73,8 +71,6 @@ class ConfidentialComputingTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_stub.cc b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_stub.cc index bfdb263a5aec3..a817eadf5184d 100644 --- a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_stub.cc +++ b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace confidentialcomputing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConfidentialComputingTracingStub::ConfidentialComputingTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -117,18 +118,14 @@ ConfidentialComputingTracingStub::GetLocation( child_->GetLocation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConfidentialComputingTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace confidentialcomputing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_stub.h b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_stub.h index 15eb0228d957c..d43fdcf22507d 100644 --- a/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_stub.h +++ b/google/cloud/confidentialcomputing/v1/internal/confidential_computing_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace confidentialcomputing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConfidentialComputingTracingStub : public ConfidentialComputingStub { public: ~ConfidentialComputingTracingStub() override = default; @@ -78,8 +79,6 @@ class ConfidentialComputingTracingStub : public ConfidentialComputingStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -94,4 +93,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIDENTIALCOMPUTING_V1_INTERNAL_CONFIDENTIAL_COMPUTING_TRACING_STUB_H diff --git a/google/cloud/config-grpc-utils.cmake.in b/google/cloud/config-grpc-utils.cmake.in new file mode 100644 index 0000000000000..adad7bb9ba946 --- /dev/null +++ b/google/cloud/config-grpc-utils.cmake.in @@ -0,0 +1,21 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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(CMakeFindDependencyMacro) +# google_cloud_cpp_googleapis finds both gRPC and Protobuf, no need to load them here. +find_dependency(google_cloud_cpp_googleapis) +find_dependency(google_cloud_cpp_common) +find_dependency(absl) + +include("${CMAKE_CURRENT_LIST_DIR}/grpc_utils-targets.cmake") diff --git a/google/cloud/config/BUILD.bazel b/google/cloud/config/BUILD.bazel index b9fc4817edc99..de37451c99310 100644 --- a/google/cloud/config/BUILD.bazel +++ b/google/cloud/config/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/config/v1:config_cc_grpc", + "@googleapis//google/cloud/config/v1:config_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/config/quickstart/.bazelrc b/google/cloud/config/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/config/quickstart/.bazelrc +++ b/google/cloud/config/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/config/quickstart/CMakeLists.txt index d856820e8985c..e4f9c67a9f23e 100644 --- a/google/cloud/config/quickstart/CMakeLists.txt +++ b/google/cloud/config/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Infrastructure Manager API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-config-quickstart CXX) find_package(google_cloud_cpp_config REQUIRED) diff --git a/google/cloud/config/quickstart/WORKSPACE.bazel b/google/cloud/config/quickstart/WORKSPACE.bazel index 7ef1468f5034e..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 = "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/config/v1/config_client.h b/google/cloud/config/v1/config_client.h index 3e0a7a5cf30f5..6d6e75e02d945 100644 --- a/google/cloud/config/v1/config_client.h +++ b/google/cloud/config/v1/config_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/config/v1/config_connection.h b/google/cloud/config/v1/config_connection.h index 4b77a259197c5..7479af60a5816 100644 --- a/google/cloud/config/v1/config_connection.h +++ b/google/cloud/config/v1/config_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIG_V1_CONFIG_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIG_V1_CONFIG_CONNECTION_H +#include "google/cloud/config/v1/config.pb.h" #include "google/cloud/config/v1/config_connection_idempotency_policy.h" #include "google/cloud/config/v1/internal/config_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/config/v1/config_connection_idempotency_policy.h b/google/cloud/config/v1/config_connection_idempotency_policy.h index 8fa52bc5b5c0e..513820fdfb5a0 100644 --- a/google/cloud/config/v1/config_connection_idempotency_policy.h +++ b/google/cloud/config/v1/config_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIG_V1_CONFIG_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIG_V1_CONFIG_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/config/v1/config.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/config/v1/internal/config_auth_decorator.cc b/google/cloud/config/v1/internal/config_auth_decorator.cc index d9f4112ae415d..3b91fb0b60e3c 100644 --- a/google/cloud/config/v1/internal/config_auth_decorator.cc +++ b/google/cloud/config/v1/internal/config_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/config/v1/config.proto #include "google/cloud/config/v1/internal/config_auth_decorator.h" -#include +#include "google/cloud/config/v1/config.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace config_v1_internal { @@ -551,3 +554,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace config_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/config/v1/internal/config_auth_decorator.h b/google/cloud/config/v1/internal/config_auth_decorator.h index c991dc79efe76..1717e96e38af3 100644 --- a/google/cloud/config/v1/internal/config_auth_decorator.h +++ b/google/cloud/config/v1/internal/config_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/config/v1/internal/config_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 config_v1_internal { @@ -289,4 +292,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIG_V1_INTERNAL_CONFIG_AUTH_DECORATOR_H diff --git a/google/cloud/config/v1/internal/config_connection_impl.h b/google/cloud/config/v1/internal/config_connection_impl.h index 9f8aa32911545..96576e74d46df 100644 --- a/google/cloud/config/v1/internal/config_connection_impl.h +++ b/google/cloud/config/v1/internal/config_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/config/v1/internal/config_logging_decorator.cc b/google/cloud/config/v1/internal/config_logging_decorator.cc index b245d96dc21ea..25822666baf9c 100644 --- a/google/cloud/config/v1/internal/config_logging_decorator.cc +++ b/google/cloud/config/v1/internal/config_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/config/v1/config.proto #include "google/cloud/config/v1/internal/config_logging_decorator.h" +#include "google/cloud/config/v1/config.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace config_v1_internal { @@ -677,3 +680,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace config_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/config/v1/internal/config_logging_decorator.h b/google/cloud/config/v1/internal/config_logging_decorator.h index 79d738de2bb54..4f65bb06510ee 100644 --- a/google/cloud/config/v1/internal/config_logging_decorator.h +++ b/google/cloud/config/v1/internal/config_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/config/v1/internal/config_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 config_v1_internal { @@ -289,4 +292,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIG_V1_INTERNAL_CONFIG_LOGGING_DECORATOR_H diff --git a/google/cloud/config/v1/internal/config_metadata_decorator.cc b/google/cloud/config/v1/internal/config_metadata_decorator.cc index 64637d320119b..3ca7329946af9 100644 --- a/google/cloud/config/v1/internal/config_metadata_decorator.cc +++ b/google/cloud/config/v1/internal/config_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/config/v1/config.proto #include "google/cloud/config/v1/internal/config_metadata_decorator.h" +#include "google/cloud/config/v1/config.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 config_v1_internal { @@ -514,3 +518,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace config_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/config/v1/internal/config_metadata_decorator.h b/google/cloud/config/v1/internal/config_metadata_decorator.h index 6b9693855d80f..ef49c990d5278 100644 --- a/google/cloud/config/v1/internal/config_metadata_decorator.h +++ b/google/cloud/config/v1/internal/config_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/config/v1/internal/config_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 config_v1_internal { @@ -294,4 +297,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIG_V1_INTERNAL_CONFIG_METADATA_DECORATOR_H diff --git a/google/cloud/config/v1/internal/config_option_defaults.cc b/google/cloud/config/v1/internal/config_option_defaults.cc index 1d24c64d486ed..50c67a578d823 100644 --- a/google/cloud/config/v1/internal/config_option_defaults.cc +++ b/google/cloud/config/v1/internal/config_option_defaults.cc @@ -40,7 +40,7 @@ Options ConfigDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - config_v1::ConfigLimitedTimeRetryPolicy(std::chrono::minutes(30)) + config_v1::ConfigLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/config/v1/internal/config_stub.cc b/google/cloud/config/v1/internal/config_stub.cc index 87dff5ee2ec89..9fc2f12c8358a 100644 --- a/google/cloud/config/v1/internal/config_stub.cc +++ b/google/cloud/config/v1/internal/config_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/config/v1/config.proto #include "google/cloud/config/v1/internal/config_stub.h" +#include "google/cloud/config/v1/config.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace config_v1_internal { @@ -665,3 +668,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace config_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/config/v1/internal/config_stub.h b/google/cloud/config/v1/internal/config_stub.h index f0d94b765cf19..bde086b09ff21 100644 --- a/google/cloud/config/v1/internal/config_stub.h +++ b/google/cloud/config/v1/internal/config_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIG_V1_INTERNAL_CONFIG_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIG_V1_INTERNAL_CONFIG_STUB_H +#include "google/cloud/config/v1/config.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 -#include -#include -#include +#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 config_v1_internal { @@ -547,4 +550,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIG_V1_INTERNAL_CONFIG_STUB_H diff --git a/google/cloud/config/v1/internal/config_stub_factory.cc b/google/cloud/config/v1/internal/config_stub_factory.cc index e24c8dfd41525..da89927c543e1 100644 --- a/google/cloud/config/v1/internal/config_stub_factory.cc +++ b/google/cloud/config/v1/internal/config_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/config/v1/config.proto #include "google/cloud/config/v1/internal/config_stub_factory.h" +#include "google/cloud/config/v1/config.grpc.pb.h" #include "google/cloud/config/v1/internal/config_auth_decorator.h" #include "google/cloud/config/v1/internal/config_logging_decorator.h" #include "google/cloud/config/v1/internal/config_metadata_decorator.h" #include "google/cloud/config/v1/internal/config_stub.h" #include "google/cloud/config/v1/internal/config_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 -#include -#include -#include +#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 config_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace config_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/config/v1/internal/config_stub_factory.h b/google/cloud/config/v1/internal/config_stub_factory.h index 0751410ae9b02..d33375028483a 100644 --- a/google/cloud/config/v1/internal/config_stub_factory.h +++ b/google/cloud/config/v1/internal/config_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace config_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIG_V1_INTERNAL_CONFIG_STUB_FACTORY_H diff --git a/google/cloud/config/v1/internal/config_tracing_connection.cc b/google/cloud/config/v1/internal/config_tracing_connection.cc index c2a3ae0ad14fd..76db85be6dec1 100644 --- a/google/cloud/config/v1/internal/config_tracing_connection.cc +++ b/google/cloud/config/v1/internal/config_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace config_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConfigTracingConnection::ConfigTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -531,15 +529,11 @@ Status ConfigTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConfigTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/config/v1/internal/config_tracing_connection.h b/google/cloud/config/v1/internal/config_tracing_connection.h index 86a9de7ab029c..5e55fb590abf7 100644 --- a/google/cloud/config/v1/internal/config_tracing_connection.h +++ b/google/cloud/config/v1/internal/config_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace config_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConfigTracingConnection : public config_v1::ConfigConnection { public: ~ConfigTracingConnection() override = default; @@ -237,8 +235,6 @@ class ConfigTracingConnection : public config_v1::ConfigConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/config/v1/internal/config_tracing_stub.cc b/google/cloud/config/v1/internal/config_tracing_stub.cc index 363fab4a30a35..daf95bb93a976 100644 --- a/google/cloud/config/v1/internal/config_tracing_stub.cc +++ b/google/cloud/config/v1/internal/config_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace config_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConfigTracingStub::ConfigTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -622,18 +623,14 @@ future ConfigTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConfigTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace config_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/config/v1/internal/config_tracing_stub.h b/google/cloud/config/v1/internal/config_tracing_stub.h index f73c83168cb44..5d5aaa1916f63 100644 --- a/google/cloud/config/v1/internal/config_tracing_stub.h +++ b/google/cloud/config/v1/internal/config_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace config_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConfigTracingStub : public ConfigStub { public: ~ConfigTracingStub() override = default; @@ -284,8 +285,6 @@ class ConfigTracingStub : public ConfigStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -300,4 +299,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIG_V1_INTERNAL_CONFIG_TRACING_STUB_H diff --git a/google/cloud/configdelivery/BUILD.bazel b/google/cloud/configdelivery/BUILD.bazel index 1444e57dd280f..b0f3ef668a7f7 100644 --- a/google/cloud/configdelivery/BUILD.bazel +++ b/google/cloud/configdelivery/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/configdelivery/v1:configdelivery_cc_grpc", + "@googleapis//google/cloud/configdelivery/v1:configdelivery_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/configdelivery/quickstart/CMakeLists.txt b/google/cloud/configdelivery/quickstart/CMakeLists.txt index 38bba03e73b83..69ddd3e6199dd 100644 --- a/google/cloud/configdelivery/quickstart/CMakeLists.txt +++ b/google/cloud/configdelivery/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Config Delivery API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-configdelivery-quickstart CXX) find_package(google_cloud_cpp_configdelivery REQUIRED) diff --git a/google/cloud/configdelivery/quickstart/WORKSPACE.bazel b/google/cloud/configdelivery/quickstart/WORKSPACE.bazel index a5671fd3d99bf..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 = "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/configdelivery/v1/config_delivery_client.h b/google/cloud/configdelivery/v1/config_delivery_client.h index eb7c386a0ec93..ad4870718ef56 100644 --- a/google/cloud/configdelivery/v1/config_delivery_client.h +++ b/google/cloud/configdelivery/v1/config_delivery_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/configdelivery/v1/config_delivery_connection.h b/google/cloud/configdelivery/v1/config_delivery_connection.h index d462068e43eec..c83b451b9009c 100644 --- a/google/cloud/configdelivery/v1/config_delivery_connection.h +++ b/google/cloud/configdelivery/v1/config_delivery_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_CONNECTION_H +#include "google/cloud/configdelivery/v1/config_delivery.pb.h" #include "google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.h" #include "google/cloud/configdelivery/v1/internal/config_delivery_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.h b/google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.h index b0326d395f790..eca0b270e9a87 100644 --- a/google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.h +++ b/google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/configdelivery/v1/config_delivery.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.cc b/google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.cc index f09273505ba3d..234c34c30bb6b 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.cc +++ b/google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/configdelivery/v1/config_delivery.proto #include "google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.h" -#include +#include "google/cloud/configdelivery/v1/config_delivery.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace configdelivery_v1_internal { @@ -649,3 +652,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace configdelivery_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.h b/google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.h index 81e7e338c201c..697c762ed3c16 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.h +++ b/google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/configdelivery/v1/internal/config_delivery_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace configdelivery_v1_internal { @@ -317,4 +320,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_AUTH_DECORATOR_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_connection_impl.h b/google/cloud/configdelivery/v1/internal/config_delivery_connection_impl.h index 4aa8dda1309a4..1f55eb2ed0cf3 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_connection_impl.h +++ b/google/cloud/configdelivery/v1/internal/config_delivery_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.cc b/google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.cc index 989c51757fb60..cf3fe8fec9088 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.cc +++ b/google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/configdelivery/v1/config_delivery.proto #include "google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.h" +#include "google/cloud/configdelivery/v1/config_delivery.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace configdelivery_v1_internal { @@ -765,3 +768,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace configdelivery_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.h b/google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.h index 821fa4e395ecd..a5f62981e9f46 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.h +++ b/google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/configdelivery/v1/internal/config_delivery_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 configdelivery_v1_internal { @@ -317,4 +320,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_LOGGING_DECORATOR_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.cc b/google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.cc index 8276552cbc883..6b2ff5e2eb81a 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.cc +++ b/google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/configdelivery/v1/config_delivery.proto #include "google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.h" +#include "google/cloud/configdelivery/v1/config_delivery.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 configdelivery_v1_internal { @@ -557,3 +561,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace configdelivery_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.h b/google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.h index f76fe9f041eb5..467676a148db0 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.h +++ b/google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/configdelivery/v1/internal/config_delivery_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 configdelivery_v1_internal { @@ -322,4 +325,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_METADATA_DECORATOR_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_option_defaults.cc b/google/cloud/configdelivery/v1/internal/config_delivery_option_defaults.cc index d287ef68e5c5f..fc52442e5d24e 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_option_defaults.cc +++ b/google/cloud/configdelivery/v1/internal/config_delivery_option_defaults.cc @@ -42,7 +42,7 @@ Options ConfigDeliveryDefaultOptions(Options options) { if (!options.has()) { options.set( configdelivery_v1::ConfigDeliveryLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_stub.cc b/google/cloud/configdelivery/v1/internal/config_delivery_stub.cc index 78339da67a3e8..42fcd87074f59 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_stub.cc +++ b/google/cloud/configdelivery/v1/internal/config_delivery_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/configdelivery/v1/config_delivery.proto #include "google/cloud/configdelivery/v1/internal/config_delivery_stub.h" +#include "google/cloud/configdelivery/v1/config_delivery.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace configdelivery_v1_internal { @@ -747,3 +750,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace configdelivery_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_stub.h b/google/cloud/configdelivery/v1/internal/config_delivery_stub.h index 265ae3c757927..e339da5e7e9cc 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_stub.h +++ b/google/cloud/configdelivery/v1/internal/config_delivery_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_STUB_H +#include "google/cloud/configdelivery/v1/config_delivery.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace configdelivery_v1_internal { @@ -612,4 +615,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_STUB_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.cc b/google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.cc index ebdd64aa64bb7..a10f3257b4634 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.cc +++ b/google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/configdelivery/v1/config_delivery.proto #include "google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.h" +#include "google/cloud/configdelivery/v1/config_delivery.grpc.pb.h" #include "google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.h" #include "google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.h" #include "google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.h" #include "google/cloud/configdelivery/v1/internal/config_delivery_stub.h" #include "google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.h" +#include "google/cloud/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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace configdelivery_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace configdelivery_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.h b/google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.h index aa9c8ea4bb0fb..40c1f77ce3059 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.h +++ b/google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace configdelivery_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_STUB_FACTORY_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.cc b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.cc index fa6ff7c7415be..7de719809e8c0 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.cc +++ b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace configdelivery_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConfigDeliveryTracingConnection::ConfigDeliveryTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -646,16 +644,12 @@ Status ConfigDeliveryTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConfigDeliveryTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.h b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.h index 10878523305e3..e1b331e4588d9 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.h +++ b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace configdelivery_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConfigDeliveryTracingConnection : public configdelivery_v1::ConfigDeliveryConnection { public: @@ -289,8 +287,6 @@ class ConfigDeliveryTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.cc b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.cc index 74263bff488b0..7405be3910853 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.cc +++ b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace configdelivery_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConfigDeliveryTracingStub::ConfigDeliveryTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -662,18 +663,14 @@ future ConfigDeliveryTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConfigDeliveryTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace configdelivery_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.h b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.h index 1aa34c1a8688b..93e8a5820f974 100644 --- a/google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.h +++ b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace configdelivery_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConfigDeliveryTracingStub : public ConfigDeliveryStub { public: ~ConfigDeliveryTracingStub() override = default; @@ -312,8 +313,6 @@ class ConfigDeliveryTracingStub : public ConfigDeliveryStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -328,4 +327,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_TRACING_STUB_H diff --git a/google/cloud/connectors/BUILD.bazel b/google/cloud/connectors/BUILD.bazel index ed474bb371edc..6ec21767c37f1 100644 --- a/google/cloud/connectors/BUILD.bazel +++ b/google/cloud/connectors/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/connectors/v1:connectors_cc_grpc", + "@googleapis//google/cloud/connectors/v1:connectors_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/connectors/CMakeLists.txt b/google/cloud/connectors/CMakeLists.txt index 09fa025f1cd28..13c429a85fe32 100644 --- a/google/cloud/connectors/CMakeLists.txt +++ b/google/cloud/connectors/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(connectors "Connectors API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(connectors_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/connectors/connectors_client.h b/google/cloud/connectors/connectors_client.h deleted file mode 100644 index 6e4a548409db4..0000000000000 --- a/google/cloud/connectors/connectors_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/connectors/v1/connectors_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_CONNECTORS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_CONNECTORS_CLIENT_H - -#include "google/cloud/connectors/connectors_connection.h" -#include "google/cloud/connectors/v1/connectors_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in connectors_v1 instead of the aliases defined in -/// this namespace. -namespace connectors { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use connectors_v1::ConnectorsClient directly. -using ::google::cloud::connectors_v1::ConnectorsClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace connectors -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_CONNECTORS_CLIENT_H diff --git a/google/cloud/connectors/connectors_connection.h b/google/cloud/connectors/connectors_connection.h deleted file mode 100644 index fcb186fa66327..0000000000000 --- a/google/cloud/connectors/connectors_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/connectors/v1/connectors_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_CONNECTORS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_CONNECTORS_CONNECTION_H - -#include "google/cloud/connectors/connectors_connection_idempotency_policy.h" -#include "google/cloud/connectors/v1/connectors_connection.h" - -namespace google { -namespace cloud { -namespace connectors { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use connectors_v1::MakeConnectorsConnection directly. -using ::google::cloud::connectors_v1::MakeConnectorsConnection; - -/// @deprecated Use connectors_v1::ConnectorsConnection directly. -using ::google::cloud::connectors_v1::ConnectorsConnection; - -/// @deprecated Use connectors_v1::ConnectorsLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::connectors_v1::ConnectorsLimitedErrorCountRetryPolicy; - -/// @deprecated Use connectors_v1::ConnectorsLimitedTimeRetryPolicy directly. -using ::google::cloud::connectors_v1::ConnectorsLimitedTimeRetryPolicy; - -/// @deprecated Use connectors_v1::ConnectorsRetryPolicy directly. -using ::google::cloud::connectors_v1::ConnectorsRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace connectors -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_CONNECTORS_CONNECTION_H diff --git a/google/cloud/connectors/connectors_connection_idempotency_policy.h b/google/cloud/connectors/connectors_connection_idempotency_policy.h deleted file mode 100644 index 43b62714ce751..0000000000000 --- a/google/cloud/connectors/connectors_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/connectors/v1/connectors_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_CONNECTORS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_CONNECTORS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/connectors/v1/connectors_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace connectors { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// connectors_v1::MakeDefaultConnectorsConnectionIdempotencyPolicy directly. -using ::google::cloud::connectors_v1:: - MakeDefaultConnectorsConnectionIdempotencyPolicy; - -/// @deprecated Use connectors_v1::ConnectorsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::connectors_v1::ConnectorsConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace connectors -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_CONNECTORS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/connectors/connectors_options.h b/google/cloud/connectors/connectors_options.h deleted file mode 100644 index f1e33e05c84a6..0000000000000 --- a/google/cloud/connectors/connectors_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/connectors/v1/connectors_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_CONNECTORS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_CONNECTORS_OPTIONS_H - -#include "google/cloud/connectors/connectors_connection.h" -#include "google/cloud/connectors/connectors_connection_idempotency_policy.h" -#include "google/cloud/connectors/v1/connectors_options.h" - -namespace google { -namespace cloud { -namespace connectors { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use connectors_v1::ConnectorsPollingPolicyOption directly. -using ::google::cloud::connectors_v1::ConnectorsPollingPolicyOption; - -/// @deprecated Use connectors_v1::ConnectorsBackoffPolicyOption directly. -using ::google::cloud::connectors_v1::ConnectorsBackoffPolicyOption; - -/// @deprecated Use connectors_v1::ConnectorsConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::connectors_v1:: - ConnectorsConnectionIdempotencyPolicyOption; - -/// @deprecated Use connectors_v1::ConnectorsPolicyOptionList directly. -using ::google::cloud::connectors_v1::ConnectorsPolicyOptionList; - -/// @deprecated Use connectors_v1::ConnectorsRetryPolicyOption directly. -using ::google::cloud::connectors_v1::ConnectorsRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace connectors -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_CONNECTORS_OPTIONS_H diff --git a/google/cloud/connectors/mocks/mock_connectors_connection.h b/google/cloud/connectors/mocks/mock_connectors_connection.h deleted file mode 100644 index e366152ec9e49..0000000000000 --- a/google/cloud/connectors/mocks/mock_connectors_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/connectors/v1/connectors_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_MOCKS_MOCK_CONNECTORS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_MOCKS_MOCK_CONNECTORS_CONNECTION_H - -#include "google/cloud/connectors/connectors_connection.h" -#include "google/cloud/connectors/v1/mocks/mock_connectors_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in connectors_v1_mocks instead of the aliases -/// defined in this namespace. -namespace connectors_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use connectors_v1_mocks::MockConnectorsConnection directly. -using ::google::cloud::connectors_v1_mocks::MockConnectorsConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace connectors_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_MOCKS_MOCK_CONNECTORS_CONNECTION_H diff --git a/google/cloud/connectors/quickstart/.bazelrc b/google/cloud/connectors/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/connectors/quickstart/.bazelrc +++ b/google/cloud/connectors/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/connectors/quickstart/CMakeLists.txt index f4a4e9993a7d9..7cf214a78a280 100644 --- a/google/cloud/connectors/quickstart/CMakeLists.txt +++ b/google/cloud/connectors/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Connectors API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-connectors-quickstart CXX) find_package(google_cloud_cpp_connectors REQUIRED) diff --git a/google/cloud/connectors/quickstart/WORKSPACE.bazel b/google/cloud/connectors/quickstart/WORKSPACE.bazel index 4ee50386475c9..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 = "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/connectors/v1/connectors_client.h b/google/cloud/connectors/v1/connectors_client.h index 08ad5d3d790f4..e307a3dcecaa4 100644 --- a/google/cloud/connectors/v1/connectors_client.h +++ b/google/cloud/connectors/v1/connectors_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/connectors/v1/connectors_connection.h b/google/cloud/connectors/v1/connectors_connection.h index 3f597c26a07c4..29ff136263cb9 100644 --- a/google/cloud/connectors/v1/connectors_connection.h +++ b/google/cloud/connectors/v1/connectors_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_V1_CONNECTORS_CONNECTION_H #include "google/cloud/connectors/v1/connectors_connection_idempotency_policy.h" +#include "google/cloud/connectors/v1/connectors_service.pb.h" #include "google/cloud/connectors/v1/internal/connectors_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/connectors/v1/connectors_connection_idempotency_policy.h b/google/cloud/connectors/v1/connectors_connection_idempotency_policy.h index 4fcfcae0d9b51..bb20c74dc76bb 100644 --- a/google/cloud/connectors/v1/connectors_connection_idempotency_policy.h +++ b/google/cloud/connectors/v1/connectors_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_V1_CONNECTORS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_V1_CONNECTORS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/connectors/v1/connectors_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/connectors/v1/internal/connectors_auth_decorator.cc b/google/cloud/connectors/v1/internal/connectors_auth_decorator.cc index 8b38cad5eab73..7d0231ad02a30 100644 --- a/google/cloud/connectors/v1/internal/connectors_auth_decorator.cc +++ b/google/cloud/connectors/v1/internal/connectors_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/connectors/v1/connectors_service.proto #include "google/cloud/connectors/v1/internal/connectors_auth_decorator.h" -#include +#include "google/cloud/connectors/v1/connectors_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace connectors_v1_internal { @@ -380,3 +383,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace connectors_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/connectors/v1/internal/connectors_auth_decorator.h b/google/cloud/connectors/v1/internal/connectors_auth_decorator.h index 285c8f811d54a..d451c984406d8 100644 --- a/google/cloud/connectors/v1/internal/connectors_auth_decorator.h +++ b/google/cloud/connectors/v1/internal/connectors_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/connectors/v1/internal/connectors_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 connectors_v1_internal { @@ -215,4 +218,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_V1_INTERNAL_CONNECTORS_AUTH_DECORATOR_H diff --git a/google/cloud/connectors/v1/internal/connectors_connection_impl.h b/google/cloud/connectors/v1/internal/connectors_connection_impl.h index 8c178d775acc4..219d923b60458 100644 --- a/google/cloud/connectors/v1/internal/connectors_connection_impl.h +++ b/google/cloud/connectors/v1/internal/connectors_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/connectors/v1/internal/connectors_logging_decorator.cc b/google/cloud/connectors/v1/internal/connectors_logging_decorator.cc index cd76a4cd522da..edc5444deb6f6 100644 --- a/google/cloud/connectors/v1/internal/connectors_logging_decorator.cc +++ b/google/cloud/connectors/v1/internal/connectors_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/connectors/v1/connectors_service.proto #include "google/cloud/connectors/v1/internal/connectors_logging_decorator.h" +#include "google/cloud/connectors/v1/connectors_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace connectors_v1_internal { @@ -478,3 +481,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace connectors_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/connectors/v1/internal/connectors_logging_decorator.h b/google/cloud/connectors/v1/internal/connectors_logging_decorator.h index 326d43f60b982..2b0c5d8652d91 100644 --- a/google/cloud/connectors/v1/internal/connectors_logging_decorator.h +++ b/google/cloud/connectors/v1/internal/connectors_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/connectors/v1/internal/connectors_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 connectors_v1_internal { @@ -215,4 +218,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_V1_INTERNAL_CONNECTORS_LOGGING_DECORATOR_H diff --git a/google/cloud/connectors/v1/internal/connectors_metadata_decorator.cc b/google/cloud/connectors/v1/internal/connectors_metadata_decorator.cc index 4e822977184b5..2e0c461480c8a 100644 --- a/google/cloud/connectors/v1/internal/connectors_metadata_decorator.cc +++ b/google/cloud/connectors/v1/internal/connectors_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/connectors/v1/connectors_service.proto #include "google/cloud/connectors/v1/internal/connectors_metadata_decorator.h" +#include "google/cloud/connectors/v1/connectors_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 connectors_v1_internal { @@ -368,3 +372,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace connectors_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/connectors/v1/internal/connectors_metadata_decorator.h b/google/cloud/connectors/v1/internal/connectors_metadata_decorator.h index 9aa8b87ed10aa..13b5234d63f57 100644 --- a/google/cloud/connectors/v1/internal/connectors_metadata_decorator.h +++ b/google/cloud/connectors/v1/internal/connectors_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/connectors/v1/internal/connectors_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 connectors_v1_internal { @@ -220,4 +223,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_V1_INTERNAL_CONNECTORS_METADATA_DECORATOR_H diff --git a/google/cloud/connectors/v1/internal/connectors_option_defaults.cc b/google/cloud/connectors/v1/internal/connectors_option_defaults.cc index ab10343a4db8a..58a4bac7e73a1 100644 --- a/google/cloud/connectors/v1/internal/connectors_option_defaults.cc +++ b/google/cloud/connectors/v1/internal/connectors_option_defaults.cc @@ -41,7 +41,7 @@ Options ConnectorsDefaultOptions(Options options) { if (!options.has()) { options.set( connectors_v1::ConnectorsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/connectors/v1/internal/connectors_stub.cc b/google/cloud/connectors/v1/internal/connectors_stub.cc index 3d9df364f5794..249b272418cf4 100644 --- a/google/cloud/connectors/v1/internal/connectors_stub.cc +++ b/google/cloud/connectors/v1/internal/connectors_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/connectors/v1/connectors_service.proto #include "google/cloud/connectors/v1/internal/connectors_stub.h" +#include "google/cloud/connectors/v1/connectors_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace connectors_v1_internal { @@ -468,3 +471,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace connectors_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/connectors/v1/internal/connectors_stub.h b/google/cloud/connectors/v1/internal/connectors_stub.h index 5ff14c6de401d..dcecfe3d3bdc7 100644 --- a/google/cloud/connectors/v1/internal/connectors_stub.h +++ b/google/cloud/connectors/v1/internal/connectors_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_V1_INTERNAL_CONNECTORS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_V1_INTERNAL_CONNECTORS_STUB_H +#include "google/cloud/connectors/v1/connectors_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 -#include -#include -#include +#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 connectors_v1_internal { @@ -409,4 +412,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_V1_INTERNAL_CONNECTORS_STUB_H diff --git a/google/cloud/connectors/v1/internal/connectors_stub_factory.cc b/google/cloud/connectors/v1/internal/connectors_stub_factory.cc index 7a77292b3bb81..fdf50343002b9 100644 --- a/google/cloud/connectors/v1/internal/connectors_stub_factory.cc +++ b/google/cloud/connectors/v1/internal/connectors_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/connectors/v1/connectors_service.proto #include "google/cloud/connectors/v1/internal/connectors_stub_factory.h" +#include "google/cloud/connectors/v1/connectors_service.grpc.pb.h" #include "google/cloud/connectors/v1/internal/connectors_auth_decorator.h" #include "google/cloud/connectors/v1/internal/connectors_logging_decorator.h" #include "google/cloud/connectors/v1/internal/connectors_metadata_decorator.h" #include "google/cloud/connectors/v1/internal/connectors_stub.h" #include "google/cloud/connectors/v1/internal/connectors_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 -#include -#include -#include +#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 connectors_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace connectors_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/connectors/v1/internal/connectors_stub_factory.h b/google/cloud/connectors/v1/internal/connectors_stub_factory.h index ce6340f3c2786..1a0d293f287b8 100644 --- a/google/cloud/connectors/v1/internal/connectors_stub_factory.h +++ b/google/cloud/connectors/v1/internal/connectors_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace connectors_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_V1_INTERNAL_CONNECTORS_STUB_FACTORY_H diff --git a/google/cloud/connectors/v1/internal/connectors_tracing_connection.cc b/google/cloud/connectors/v1/internal/connectors_tracing_connection.cc index dbd5230433b22..cc62002d8f8af 100644 --- a/google/cloud/connectors/v1/internal/connectors_tracing_connection.cc +++ b/google/cloud/connectors/v1/internal/connectors_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace connectors_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConnectorsTracingConnection::ConnectorsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -371,16 +369,12 @@ Status ConnectorsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConnectorsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/connectors/v1/internal/connectors_tracing_connection.h b/google/cloud/connectors/v1/internal/connectors_tracing_connection.h index 493cc4b0cb4e0..8832e5f9fbc93 100644 --- a/google/cloud/connectors/v1/internal/connectors_tracing_connection.h +++ b/google/cloud/connectors/v1/internal/connectors_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace connectors_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConnectorsTracingConnection : public connectors_v1::ConnectorsConnection { public: ~ConnectorsTracingConnection() override = default; @@ -173,8 +171,6 @@ class ConnectorsTracingConnection : public connectors_v1::ConnectorsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/connectors/v1/internal/connectors_tracing_stub.cc b/google/cloud/connectors/v1/internal/connectors_tracing_stub.cc index 7dc6cdbe3d0e8..18a3b16b42e10 100644 --- a/google/cloud/connectors/v1/internal/connectors_tracing_stub.cc +++ b/google/cloud/connectors/v1/internal/connectors_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace connectors_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConnectorsTracingStub::ConnectorsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -436,18 +437,14 @@ future ConnectorsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConnectorsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace connectors_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/connectors/v1/internal/connectors_tracing_stub.h b/google/cloud/connectors/v1/internal/connectors_tracing_stub.h index fcba16b4a69c3..79d0f1fbbc2b4 100644 --- a/google/cloud/connectors/v1/internal/connectors_tracing_stub.h +++ b/google/cloud/connectors/v1/internal/connectors_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace connectors_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConnectorsTracingStub : public ConnectorsStub { public: ~ConnectorsTracingStub() override = default; @@ -210,8 +211,6 @@ class ConnectorsTracingStub : public ConnectorsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -226,4 +225,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONNECTORS_V1_INTERNAL_CONNECTORS_TRACING_STUB_H diff --git a/google/cloud/contactcenterinsights/BUILD.bazel b/google/cloud/contactcenterinsights/BUILD.bazel index c900667d6cbf1..224c97c52f581 100644 --- a/google/cloud/contactcenterinsights/BUILD.bazel +++ b/google/cloud/contactcenterinsights/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/contactcenterinsights/v1:contactcenterinsights_cc_grpc", + "@googleapis//google/cloud/contactcenterinsights/v1:contactcenterinsights_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/contactcenterinsights/CMakeLists.txt b/google/cloud/contactcenterinsights/CMakeLists.txt index 33f15b8894b31..8671a704d20ec 100644 --- a/google/cloud/contactcenterinsights/CMakeLists.txt +++ b/google/cloud/contactcenterinsights/CMakeLists.txt @@ -17,8 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( - contactcenterinsights "Contact Center AI Insights API" - SERVICE_DIRS "__EMPTY__" "v1/") + contactcenterinsights "Contact Center AI Insights API" SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(contactcenterinsights_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/contactcenterinsights/contact_center_insights_client.h b/google/cloud/contactcenterinsights/contact_center_insights_client.h deleted file mode 100644 index 8f61a3f07c1b4..0000000000000 --- a/google/cloud/contactcenterinsights/contact_center_insights_client.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/contactcenterinsights/v1/contact_center_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_CONTACT_CENTER_INSIGHTS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_CONTACT_CENTER_INSIGHTS_CLIENT_H - -#include "google/cloud/contactcenterinsights/contact_center_insights_connection.h" -#include "google/cloud/contactcenterinsights/v1/contact_center_insights_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in contactcenterinsights_v1 instead of the aliases defined -/// in this namespace. -namespace contactcenterinsights { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use contactcenterinsights_v1::ContactCenterInsightsClient -/// directly. -using ::google::cloud::contactcenterinsights_v1::ContactCenterInsightsClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace contactcenterinsights -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_CONTACT_CENTER_INSIGHTS_CLIENT_H diff --git a/google/cloud/contactcenterinsights/contact_center_insights_connection.h b/google/cloud/contactcenterinsights/contact_center_insights_connection.h deleted file mode 100644 index 6b5c26f9b1a12..0000000000000 --- a/google/cloud/contactcenterinsights/contact_center_insights_connection.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/contactcenterinsights/v1/contact_center_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_CONTACT_CENTER_INSIGHTS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_CONTACT_CENTER_INSIGHTS_CONNECTION_H - -#include "google/cloud/contactcenterinsights/contact_center_insights_connection_idempotency_policy.h" -#include "google/cloud/contactcenterinsights/v1/contact_center_insights_connection.h" - -namespace google { -namespace cloud { -namespace contactcenterinsights { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// contactcenterinsights_v1::MakeContactCenterInsightsConnection directly. -using ::google::cloud::contactcenterinsights_v1:: - MakeContactCenterInsightsConnection; - -/// @deprecated Use contactcenterinsights_v1::ContactCenterInsightsConnection -/// directly. -using ::google::cloud::contactcenterinsights_v1:: - ContactCenterInsightsConnection; - -/// @deprecated Use -/// contactcenterinsights_v1::ContactCenterInsightsLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::contactcenterinsights_v1:: - ContactCenterInsightsLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// contactcenterinsights_v1::ContactCenterInsightsLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::contactcenterinsights_v1:: - ContactCenterInsightsLimitedTimeRetryPolicy; - -/// @deprecated Use contactcenterinsights_v1::ContactCenterInsightsRetryPolicy -/// directly. -using ::google::cloud::contactcenterinsights_v1:: - ContactCenterInsightsRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace contactcenterinsights -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_CONTACT_CENTER_INSIGHTS_CONNECTION_H diff --git a/google/cloud/contactcenterinsights/contact_center_insights_connection_idempotency_policy.h b/google/cloud/contactcenterinsights/contact_center_insights_connection_idempotency_policy.h deleted file mode 100644 index 9bca83667e658..0000000000000 --- a/google/cloud/contactcenterinsights/contact_center_insights_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/contactcenterinsights/v1/contact_center_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_CONTACT_CENTER_INSIGHTS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_CONTACT_CENTER_INSIGHTS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/contactcenterinsights/v1/contact_center_insights_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace contactcenterinsights { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// contactcenterinsights_v1::MakeDefaultContactCenterInsightsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::contactcenterinsights_v1:: - MakeDefaultContactCenterInsightsConnectionIdempotencyPolicy; - -/// @deprecated Use -/// contactcenterinsights_v1::ContactCenterInsightsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::contactcenterinsights_v1:: - ContactCenterInsightsConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace contactcenterinsights -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_CONTACT_CENTER_INSIGHTS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/contactcenterinsights/contact_center_insights_options.h b/google/cloud/contactcenterinsights/contact_center_insights_options.h deleted file mode 100644 index 5c5654263c91f..0000000000000 --- a/google/cloud/contactcenterinsights/contact_center_insights_options.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/contactcenterinsights/v1/contact_center_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_CONTACT_CENTER_INSIGHTS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_CONTACT_CENTER_INSIGHTS_OPTIONS_H - -#include "google/cloud/contactcenterinsights/contact_center_insights_connection.h" -#include "google/cloud/contactcenterinsights/contact_center_insights_connection_idempotency_policy.h" -#include "google/cloud/contactcenterinsights/v1/contact_center_insights_options.h" - -namespace google { -namespace cloud { -namespace contactcenterinsights { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// contactcenterinsights_v1::ContactCenterInsightsPollingPolicyOption directly. -using ::google::cloud::contactcenterinsights_v1:: - ContactCenterInsightsPollingPolicyOption; - -/// @deprecated Use -/// contactcenterinsights_v1::ContactCenterInsightsBackoffPolicyOption directly. -using ::google::cloud::contactcenterinsights_v1:: - ContactCenterInsightsBackoffPolicyOption; - -/// @deprecated Use -/// contactcenterinsights_v1::ContactCenterInsightsConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::contactcenterinsights_v1:: - ContactCenterInsightsConnectionIdempotencyPolicyOption; - -/// @deprecated Use -/// contactcenterinsights_v1::ContactCenterInsightsPolicyOptionList directly. -using ::google::cloud::contactcenterinsights_v1:: - ContactCenterInsightsPolicyOptionList; - -/// @deprecated Use -/// contactcenterinsights_v1::ContactCenterInsightsRetryPolicyOption directly. -using ::google::cloud::contactcenterinsights_v1:: - ContactCenterInsightsRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace contactcenterinsights -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_CONTACT_CENTER_INSIGHTS_OPTIONS_H diff --git a/google/cloud/contactcenterinsights/mocks/mock_contact_center_insights_connection.h b/google/cloud/contactcenterinsights/mocks/mock_contact_center_insights_connection.h deleted file mode 100644 index 33302ef8d27f6..0000000000000 --- a/google/cloud/contactcenterinsights/mocks/mock_contact_center_insights_connection.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/contactcenterinsights/v1/contact_center_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_MOCKS_MOCK_CONTACT_CENTER_INSIGHTS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_MOCKS_MOCK_CONTACT_CENTER_INSIGHTS_CONNECTION_H - -#include "google/cloud/contactcenterinsights/contact_center_insights_connection.h" -#include "google/cloud/contactcenterinsights/v1/mocks/mock_contact_center_insights_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in contactcenterinsights_v1_mocks instead of the aliases -/// defined in this namespace. -namespace contactcenterinsights_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// contactcenterinsights_v1_mocks::MockContactCenterInsightsConnection -/// directly. -using ::google::cloud::contactcenterinsights_v1_mocks:: - MockContactCenterInsightsConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace contactcenterinsights_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_MOCKS_MOCK_CONTACT_CENTER_INSIGHTS_CONNECTION_H diff --git a/google/cloud/contactcenterinsights/quickstart/.bazelrc b/google/cloud/contactcenterinsights/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/contactcenterinsights/quickstart/.bazelrc +++ b/google/cloud/contactcenterinsights/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/contactcenterinsights/quickstart/CMakeLists.txt index 2e16ae1ff1606..9b2c3194c6695 100644 --- a/google/cloud/contactcenterinsights/quickstart/CMakeLists.txt +++ b/google/cloud/contactcenterinsights/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Contact Center AI Insights API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-contactcenterinsights-quickstart CXX) find_package(google_cloud_cpp_contactcenterinsights REQUIRED) diff --git a/google/cloud/contactcenterinsights/quickstart/WORKSPACE.bazel b/google/cloud/contactcenterinsights/quickstart/WORKSPACE.bazel index a0334401cd214..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 = "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/contactcenterinsights/v1/contact_center_insights_client.h b/google/cloud/contactcenterinsights/v1/contact_center_insights_client.h index 2ed3a6325c7cf..ce4ea973251a8 100644 --- a/google/cloud/contactcenterinsights/v1/contact_center_insights_client.h +++ b/google/cloud/contactcenterinsights/v1/contact_center_insights_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/contactcenterinsights/v1/contact_center_insights_connection.h b/google/cloud/contactcenterinsights/v1/contact_center_insights_connection.h index 755d450774296..2285fa0ef52b8 100644 --- a/google/cloud/contactcenterinsights/v1/contact_center_insights_connection.h +++ b/google/cloud/contactcenterinsights/v1/contact_center_insights_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_V1_CONTACT_CENTER_INSIGHTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_V1_CONTACT_CENTER_INSIGHTS_CONNECTION_H +#include "google/cloud/contactcenterinsights/v1/contact_center_insights.pb.h" #include "google/cloud/contactcenterinsights/v1/contact_center_insights_connection_idempotency_policy.h" #include "google/cloud/contactcenterinsights/v1/internal/contact_center_insights_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/contactcenterinsights/v1/contact_center_insights_connection_idempotency_policy.h b/google/cloud/contactcenterinsights/v1/contact_center_insights_connection_idempotency_policy.h index 24a1e2cde9571..044877c5dc5b8 100644 --- a/google/cloud/contactcenterinsights/v1/contact_center_insights_connection_idempotency_policy.h +++ b/google/cloud/contactcenterinsights/v1/contact_center_insights_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_V1_CONTACT_CENTER_INSIGHTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_V1_CONTACT_CENTER_INSIGHTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/contactcenterinsights/v1/contact_center_insights.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_auth_decorator.cc b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_auth_decorator.cc index 872efafbb665c..61df428a4b8ff 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_auth_decorator.cc +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/contactcenterinsights/v1/contact_center_insights.proto #include "google/cloud/contactcenterinsights/v1/internal/contact_center_insights_auth_decorator.h" -#include +#include "google/cloud/contactcenterinsights/v1/contact_center_insights.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contactcenterinsights_v1_internal { @@ -1184,3 +1187,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contactcenterinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_auth_decorator.h b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_auth_decorator.h index 47d371911a3e1..d775f35fcbb29 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_auth_decorator.h +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 contactcenterinsights_v1_internal { @@ -600,4 +603,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_V1_INTERNAL_CONTACT_CENTER_INSIGHTS_AUTH_DECORATOR_H diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_connection_impl.h b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_connection_impl.h index b1cf65a34c9cd..b69209e1075e8 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_connection_impl.h +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_logging_decorator.cc b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_logging_decorator.cc index 82d612b4df553..6d48bc01a7efe 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_logging_decorator.cc +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/contactcenterinsights/v1/contact_center_insights.proto #include "google/cloud/contactcenterinsights/v1/internal/contact_center_insights_logging_decorator.h" +#include "google/cloud/contactcenterinsights/v1/contact_center_insights.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contactcenterinsights_v1_internal { @@ -1486,3 +1489,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contactcenterinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_logging_decorator.h b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_logging_decorator.h index e1e30db08fa9c..a7c9b0e2ae77d 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_logging_decorator.h +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 contactcenterinsights_v1_internal { @@ -600,4 +603,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_V1_INTERNAL_CONTACT_CENTER_INSIGHTS_LOGGING_DECORATOR_H diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_metadata_decorator.cc b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_metadata_decorator.cc index 59fd2f11e80e8..a4eaac6d661f0 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_metadata_decorator.cc +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/contactcenterinsights/v1/contact_center_insights.proto #include "google/cloud/contactcenterinsights/v1/internal/contact_center_insights_metadata_decorator.h" +#include "google/cloud/contactcenterinsights/v1/contact_center_insights.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 contactcenterinsights_v1_internal { @@ -1082,3 +1086,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contactcenterinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_metadata_decorator.h b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_metadata_decorator.h index c3ee7946ce053..b41591ee6cec4 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_metadata_decorator.h +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 contactcenterinsights_v1_internal { @@ -606,4 +609,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_V1_INTERNAL_CONTACT_CENTER_INSIGHTS_METADATA_DECORATOR_H diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_option_defaults.cc b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_option_defaults.cc index 5c2980b60a6c7..b4a8fd363fd5e 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_option_defaults.cc +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_option_defaults.cc @@ -44,7 +44,7 @@ Options ContactCenterInsightsDefaultOptions(Options options) { options.set< contactcenterinsights_v1::ContactCenterInsightsRetryPolicyOption>( contactcenterinsights_v1::ContactCenterInsightsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contactcenterinsights_v1_internal { @@ -1420,3 +1423,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contactcenterinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub.h b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub.h index d5b093e96f8d2..4fc6f7105466f 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub.h +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_V1_INTERNAL_CONTACT_CENTER_INSIGHTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_V1_INTERNAL_CONTACT_CENTER_INSIGHTS_STUB_H +#include "google/cloud/contactcenterinsights/v1/contact_center_insights.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contactcenterinsights_v1_internal { @@ -1191,4 +1194,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_V1_INTERNAL_CONTACT_CENTER_INSIGHTS_STUB_H diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub_factory.cc b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub_factory.cc index cf7539a18ca4a..ef3b9bcc13e65 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub_factory.cc +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/contactcenterinsights/v1/contact_center_insights.proto #include "google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub_factory.h" +#include "google/cloud/contactcenterinsights/v1/contact_center_insights.grpc.pb.h" #include "google/cloud/contactcenterinsights/v1/internal/contact_center_insights_auth_decorator.h" #include "google/cloud/contactcenterinsights/v1/internal/contact_center_insights_logging_decorator.h" #include "google/cloud/contactcenterinsights/v1/internal/contact_center_insights_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contactcenterinsights_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contactcenterinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub_factory.h b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub_factory.h index fb6de5e89f08c..ed8bfeb787484 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub_factory.h +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contactcenterinsights_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_V1_INTERNAL_CONTACT_CENTER_INSIGHTS_STUB_FACTORY_H diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_connection.cc b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_connection.cc index fbbf105dcca6a..91b6cb00c3512 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_connection.cc +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace contactcenterinsights_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ContactCenterInsightsTracingConnection::ContactCenterInsightsTracingConnection( std::shared_ptr child) @@ -1318,18 +1316,14 @@ Status ContactCenterInsightsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeContactCenterInsightsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_connection.h b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_connection.h index d3eee12b54092..593528c2159a6 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_connection.h +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace contactcenterinsights_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ContactCenterInsightsTracingConnection : public contactcenterinsights_v1::ContactCenterInsightsConnection { public: @@ -562,8 +560,6 @@ class ContactCenterInsightsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_stub.cc b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_stub.cc index 29f6c7280ebfe..273916fda714c 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_stub.cc +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contactcenterinsights_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ContactCenterInsightsTracingStub::ContactCenterInsightsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -1424,18 +1425,14 @@ future ContactCenterInsightsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeContactCenterInsightsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contactcenterinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_stub.h b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_stub.h index ab87e8c69b9e0..cfaf060d10b52 100644 --- a/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_stub.h +++ b/google/cloud/contactcenterinsights/v1/internal/contact_center_insights_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contactcenterinsights_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ContactCenterInsightsTracingStub : public ContactCenterInsightsStub { public: ~ContactCenterInsightsTracingStub() override = default; @@ -596,8 +597,6 @@ class ContactCenterInsightsTracingStub : public ContactCenterInsightsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -612,4 +611,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTACTCENTERINSIGHTS_V1_INTERNAL_CONTACT_CENTER_INSIGHTS_TRACING_STUB_H diff --git a/google/cloud/container/BUILD.bazel b/google/cloud/container/BUILD.bazel index b2d7b3b02cbc1..2434390321951 100644 --- a/google/cloud/container/BUILD.bazel +++ b/google/cloud/container/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/container/v1:container_cc_grpc", + "@googleapis//google/container/v1:container_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/container/CMakeLists.txt b/google/cloud/container/CMakeLists.txt index a48f47b0f5aae..0e59e74c3ec1a 100644 --- a/google/cloud/container/CMakeLists.txt +++ b/google/cloud/container/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(container "Kubernetes Engine API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(container_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/container/cluster_manager_client.h b/google/cloud/container/cluster_manager_client.h deleted file mode 100644 index 2cfc33bb0b1b3..0000000000000 --- a/google/cloud/container/cluster_manager_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/container/v1/cluster_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_CLUSTER_MANAGER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_CLUSTER_MANAGER_CLIENT_H - -#include "google/cloud/container/cluster_manager_connection.h" -#include "google/cloud/container/v1/cluster_manager_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in container_v1 instead of the aliases defined in -/// this namespace. -namespace container { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use container_v1::ClusterManagerClient directly. -using ::google::cloud::container_v1::ClusterManagerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace container -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_CLUSTER_MANAGER_CLIENT_H diff --git a/google/cloud/container/cluster_manager_connection.h b/google/cloud/container/cluster_manager_connection.h deleted file mode 100644 index c8d2146e75a5c..0000000000000 --- a/google/cloud/container/cluster_manager_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/container/v1/cluster_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_CLUSTER_MANAGER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_CLUSTER_MANAGER_CONNECTION_H - -#include "google/cloud/container/cluster_manager_connection_idempotency_policy.h" -#include "google/cloud/container/v1/cluster_manager_connection.h" - -namespace google { -namespace cloud { -namespace container { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use container_v1::MakeClusterManagerConnection directly. -using ::google::cloud::container_v1::MakeClusterManagerConnection; - -/// @deprecated Use container_v1::ClusterManagerConnection directly. -using ::google::cloud::container_v1::ClusterManagerConnection; - -/// @deprecated Use container_v1::ClusterManagerLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::container_v1::ClusterManagerLimitedErrorCountRetryPolicy; - -/// @deprecated Use container_v1::ClusterManagerLimitedTimeRetryPolicy directly. -using ::google::cloud::container_v1::ClusterManagerLimitedTimeRetryPolicy; - -/// @deprecated Use container_v1::ClusterManagerRetryPolicy directly. -using ::google::cloud::container_v1::ClusterManagerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace container -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_CLUSTER_MANAGER_CONNECTION_H diff --git a/google/cloud/container/cluster_manager_connection_idempotency_policy.h b/google/cloud/container/cluster_manager_connection_idempotency_policy.h deleted file mode 100644 index 9476103de4ad0..0000000000000 --- a/google/cloud/container/cluster_manager_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/container/v1/cluster_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_CLUSTER_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_CLUSTER_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/container/v1/cluster_manager_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace container { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// container_v1::MakeDefaultClusterManagerConnectionIdempotencyPolicy directly. -using ::google::cloud::container_v1:: - MakeDefaultClusterManagerConnectionIdempotencyPolicy; - -/// @deprecated Use container_v1::ClusterManagerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::container_v1::ClusterManagerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace container -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_CLUSTER_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/container/cluster_manager_options.h b/google/cloud/container/cluster_manager_options.h deleted file mode 100644 index 6e722b4ee47ea..0000000000000 --- a/google/cloud/container/cluster_manager_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/container/v1/cluster_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_CLUSTER_MANAGER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_CLUSTER_MANAGER_OPTIONS_H - -#include "google/cloud/container/cluster_manager_connection.h" -#include "google/cloud/container/cluster_manager_connection_idempotency_policy.h" -#include "google/cloud/container/v1/cluster_manager_options.h" - -namespace google { -namespace cloud { -namespace container { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use container_v1::ClusterManagerBackoffPolicyOption directly. -using ::google::cloud::container_v1::ClusterManagerBackoffPolicyOption; - -/// @deprecated Use -/// container_v1::ClusterManagerConnectionIdempotencyPolicyOption directly. -using ::google::cloud::container_v1:: - ClusterManagerConnectionIdempotencyPolicyOption; - -/// @deprecated Use container_v1::ClusterManagerPolicyOptionList directly. -using ::google::cloud::container_v1::ClusterManagerPolicyOptionList; - -/// @deprecated Use container_v1::ClusterManagerRetryPolicyOption directly. -using ::google::cloud::container_v1::ClusterManagerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace container -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_CLUSTER_MANAGER_OPTIONS_H diff --git a/google/cloud/container/mocks/mock_cluster_manager_connection.h b/google/cloud/container/mocks/mock_cluster_manager_connection.h deleted file mode 100644 index 17f08ba5a0524..0000000000000 --- a/google/cloud/container/mocks/mock_cluster_manager_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/container/v1/cluster_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_MOCKS_MOCK_CLUSTER_MANAGER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_MOCKS_MOCK_CLUSTER_MANAGER_CONNECTION_H - -#include "google/cloud/container/cluster_manager_connection.h" -#include "google/cloud/container/v1/mocks/mock_cluster_manager_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in container_v1_mocks instead of the aliases -/// defined in this namespace. -namespace container_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use container_v1_mocks::MockClusterManagerConnection directly. -using ::google::cloud::container_v1_mocks::MockClusterManagerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace container_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_MOCKS_MOCK_CLUSTER_MANAGER_CONNECTION_H diff --git a/google/cloud/container/quickstart/.bazelrc b/google/cloud/container/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/container/quickstart/.bazelrc +++ b/google/cloud/container/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/container/quickstart/CMakeLists.txt index 72c928a4525a8..879fa857902bd 100644 --- a/google/cloud/container/quickstart/CMakeLists.txt +++ b/google/cloud/container/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Kubernetes Engine API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-container-quickstart CXX) find_package(google_cloud_cpp_container REQUIRED) diff --git a/google/cloud/container/quickstart/WORKSPACE.bazel b/google/cloud/container/quickstart/WORKSPACE.bazel index aa733ec584098..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 = "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/container/v1/cluster_manager_connection.h b/google/cloud/container/v1/cluster_manager_connection.h index 018c91e9a5bbf..103048140a131 100644 --- a/google/cloud/container/v1/cluster_manager_connection.h +++ b/google/cloud/container/v1/cluster_manager_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/container/v1/cluster_service.pb.h" #include namespace google { diff --git a/google/cloud/container/v1/cluster_manager_connection_idempotency_policy.h b/google/cloud/container/v1/cluster_manager_connection_idempotency_policy.h index 0586ff1a7c9bc..738aacec124d7 100644 --- a/google/cloud/container/v1/cluster_manager_connection_idempotency_policy.h +++ b/google/cloud/container/v1/cluster_manager_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/container/v1/cluster_service.grpc.pb.h" #include namespace google { diff --git a/google/cloud/container/v1/internal/cluster_manager_auth_decorator.cc b/google/cloud/container/v1/internal/cluster_manager_auth_decorator.cc index 4f9dd987efdf5..d9015331b8973 100644 --- a/google/cloud/container/v1/internal/cluster_manager_auth_decorator.cc +++ b/google/cloud/container/v1/internal/cluster_manager_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/container/v1/cluster_service.proto #include "google/cloud/container/v1/internal/cluster_manager_auth_decorator.h" -#include +#include "google/container/v1/cluster_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace container_v1_internal { @@ -339,3 +342,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace container_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/container/v1/internal/cluster_manager_auth_decorator.h b/google/cloud/container/v1/internal/cluster_manager_auth_decorator.h index 98f2df2da971b..33dbee27bada8 100644 --- a/google/cloud/container/v1/internal/cluster_manager_auth_decorator.h +++ b/google/cloud/container/v1/internal/cluster_manager_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace container_v1_internal { @@ -204,4 +207,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_V1_INTERNAL_CLUSTER_MANAGER_AUTH_DECORATOR_H diff --git a/google/cloud/container/v1/internal/cluster_manager_logging_decorator.cc b/google/cloud/container/v1/internal/cluster_manager_logging_decorator.cc index 960548280ba68..7b6c2446fd0b5 100644 --- a/google/cloud/container/v1/internal/cluster_manager_logging_decorator.cc +++ b/google/cloud/container/v1/internal/cluster_manager_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/container/v1/internal/cluster_manager_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/container/v1/cluster_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace container_v1_internal { @@ -468,3 +471,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace container_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/container/v1/internal/cluster_manager_logging_decorator.h b/google/cloud/container/v1/internal/cluster_manager_logging_decorator.h index 6734c047c3244..5b8376db3230e 100644 --- a/google/cloud/container/v1/internal/cluster_manager_logging_decorator.h +++ b/google/cloud/container/v1/internal/cluster_manager_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace container_v1_internal { @@ -204,4 +207,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_V1_INTERNAL_CLUSTER_MANAGER_LOGGING_DECORATOR_H diff --git a/google/cloud/container/v1/internal/cluster_manager_metadata_decorator.cc b/google/cloud/container/v1/internal/cluster_manager_metadata_decorator.cc index 35de0110ff0fd..ce4989076f964 100644 --- a/google/cloud/container/v1/internal/cluster_manager_metadata_decorator.cc +++ b/google/cloud/container/v1/internal/cluster_manager_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/container/v1/internal/cluster_manager_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/container/v1/cluster_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace container_v1_internal { @@ -377,3 +381,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace container_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/container/v1/internal/cluster_manager_metadata_decorator.h b/google/cloud/container/v1/internal/cluster_manager_metadata_decorator.h index 415abc58a4716..8dd9a2e80f6f9 100644 --- a/google/cloud/container/v1/internal/cluster_manager_metadata_decorator.h +++ b/google/cloud/container/v1/internal/cluster_manager_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace container_v1_internal { @@ -209,4 +212,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_V1_INTERNAL_CLUSTER_MANAGER_METADATA_DECORATOR_H diff --git a/google/cloud/container/v1/internal/cluster_manager_option_defaults.cc b/google/cloud/container/v1/internal/cluster_manager_option_defaults.cc index 426a4cd842c00..05535bde33ce1 100644 --- a/google/cloud/container/v1/internal/cluster_manager_option_defaults.cc +++ b/google/cloud/container/v1/internal/cluster_manager_option_defaults.cc @@ -41,7 +41,7 @@ Options ClusterManagerDefaultOptions(Options options) { if (!options.has()) { options.set( container_v1::ClusterManagerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/container/v1/internal/cluster_manager_stub.cc b/google/cloud/container/v1/internal/cluster_manager_stub.cc index bae1aaee63141..221a7df3ef45d 100644 --- a/google/cloud/container/v1/internal/cluster_manager_stub.cc +++ b/google/cloud/container/v1/internal/cluster_manager_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/container/v1/internal/cluster_manager_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/container/v1/cluster_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace container_v1_internal { @@ -468,3 +471,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace container_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/container/v1/internal/cluster_manager_stub.h b/google/cloud/container/v1/internal/cluster_manager_stub.h index 8392d01c4087c..90f803a9c341c 100644 --- a/google/cloud/container/v1/internal/cluster_manager_stub.h +++ b/google/cloud/container/v1/internal/cluster_manager_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/container/v1/cluster_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace container_v1_internal { @@ -361,4 +364,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_V1_INTERNAL_CLUSTER_MANAGER_STUB_H diff --git a/google/cloud/container/v1/internal/cluster_manager_stub_factory.cc b/google/cloud/container/v1/internal/cluster_manager_stub_factory.cc index 5b3e2419c3890..0ef707042f5d8 100644 --- a/google/cloud/container/v1/internal/cluster_manager_stub_factory.cc +++ b/google/cloud/container/v1/internal/cluster_manager_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/container/v1/cluster_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace container_v1_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace container_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/container/v1/internal/cluster_manager_stub_factory.h b/google/cloud/container/v1/internal/cluster_manager_stub_factory.h index cf4930392b4e9..b7a15728355f1 100644 --- a/google/cloud/container/v1/internal/cluster_manager_stub_factory.h +++ b/google/cloud/container/v1/internal/cluster_manager_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace container_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_V1_INTERNAL_CLUSTER_MANAGER_STUB_FACTORY_H diff --git a/google/cloud/container/v1/internal/cluster_manager_tracing_connection.cc b/google/cloud/container/v1/internal/cluster_manager_tracing_connection.cc index 9fe9f71cade3e..d1a8a05498bfa 100644 --- a/google/cloud/container/v1/internal/cluster_manager_tracing_connection.cc +++ b/google/cloud/container/v1/internal/cluster_manager_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace container_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ClusterManagerTracingConnection::ClusterManagerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -357,16 +355,12 @@ ClusterManagerTracingConnection::FetchNodePoolUpgradeInfo( return internal::EndSpan(*span, child_->FetchNodePoolUpgradeInfo(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeClusterManagerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/container/v1/internal/cluster_manager_tracing_connection.h b/google/cloud/container/v1/internal/cluster_manager_tracing_connection.h index 70897433b7a89..f68f7d980f562 100644 --- a/google/cloud/container/v1/internal/cluster_manager_tracing_connection.h +++ b/google/cloud/container/v1/internal/cluster_manager_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace container_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ClusterManagerTracingConnection : public container_v1::ClusterManagerConnection { public: @@ -162,8 +160,6 @@ class ClusterManagerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/container/v1/internal/cluster_manager_tracing_stub.cc b/google/cloud/container/v1/internal/cluster_manager_tracing_stub.cc index 1f4f124fe3a78..9df2520823115 100644 --- a/google/cloud/container/v1/internal/cluster_manager_tracing_stub.cc +++ b/google/cloud/container/v1/internal/cluster_manager_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace container_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ClusterManagerTracingStub::ClusterManagerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -466,18 +467,14 @@ ClusterManagerTracingStub::FetchNodePoolUpgradeInfo( child_->FetchNodePoolUpgradeInfo(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeClusterManagerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace container_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/container/v1/internal/cluster_manager_tracing_stub.h b/google/cloud/container/v1/internal/cluster_manager_tracing_stub.h index 16c30c99574e5..fb05bd606e83b 100644 --- a/google/cloud/container/v1/internal/cluster_manager_tracing_stub.h +++ b/google/cloud/container/v1/internal/cluster_manager_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace container_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ClusterManagerTracingStub : public ClusterManagerStub { public: ~ClusterManagerTracingStub() override = default; @@ -200,8 +201,6 @@ class ClusterManagerTracingStub : public ClusterManagerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -216,4 +215,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINER_V1_INTERNAL_CLUSTER_MANAGER_TRACING_STUB_H diff --git a/google/cloud/containeranalysis/BUILD.bazel b/google/cloud/containeranalysis/BUILD.bazel index f4ece6c9cb439..5b9a8a7d1384d 100644 --- a/google/cloud/containeranalysis/BUILD.bazel +++ b/google/cloud/containeranalysis/BUILD.bazel @@ -19,13 +19,12 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/devtools/containeranalysis/v1:containeranalysis_cc_grpc", - "@com_google_googleapis//grafeas/v1:grafeas_cc_grpc", + "@googleapis//google/devtools/containeranalysis/v1:containeranalysis_cc_grpc", + "@googleapis//grafeas/v1:grafeas_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/containeranalysis/CMakeLists.txt b/google/cloud/containeranalysis/CMakeLists.txt index 9a49ae976d0c4..c72d0536edb04 100644 --- a/google/cloud/containeranalysis/CMakeLists.txt +++ b/google/cloud/containeranalysis/CMakeLists.txt @@ -18,7 +18,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( containeranalysis "Container Analysis API" - SERVICE_DIRS "__EMPTY__" "v1/" + SERVICE_DIRS "v1/" SHARED_PROTO_DEPS "grafeas") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) diff --git a/google/cloud/containeranalysis/container_analysis_client.h b/google/cloud/containeranalysis/container_analysis_client.h deleted file mode 100644 index 3206ecbda3a37..0000000000000 --- a/google/cloud/containeranalysis/container_analysis_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/containeranalysis/v1/containeranalysis.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_CONTAINER_ANALYSIS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_CONTAINER_ANALYSIS_CLIENT_H - -#include "google/cloud/containeranalysis/container_analysis_connection.h" -#include "google/cloud/containeranalysis/v1/container_analysis_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in containeranalysis_v1 instead of the aliases defined in -/// this namespace. -namespace containeranalysis { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use containeranalysis_v1::ContainerAnalysisClient directly. -using ::google::cloud::containeranalysis_v1::ContainerAnalysisClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace containeranalysis -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_CONTAINER_ANALYSIS_CLIENT_H diff --git a/google/cloud/containeranalysis/container_analysis_connection.h b/google/cloud/containeranalysis/container_analysis_connection.h deleted file mode 100644 index 5d041a82725af..0000000000000 --- a/google/cloud/containeranalysis/container_analysis_connection.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/containeranalysis/v1/containeranalysis.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_CONTAINER_ANALYSIS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_CONTAINER_ANALYSIS_CONNECTION_H - -#include "google/cloud/containeranalysis/container_analysis_connection_idempotency_policy.h" -#include "google/cloud/containeranalysis/v1/container_analysis_connection.h" - -namespace google { -namespace cloud { -namespace containeranalysis { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use containeranalysis_v1::MakeContainerAnalysisConnection -/// directly. -using ::google::cloud::containeranalysis_v1::MakeContainerAnalysisConnection; - -/// @deprecated Use containeranalysis_v1::ContainerAnalysisConnection directly. -using ::google::cloud::containeranalysis_v1::ContainerAnalysisConnection; - -/// @deprecated Use -/// containeranalysis_v1::ContainerAnalysisLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::containeranalysis_v1:: - ContainerAnalysisLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// containeranalysis_v1::ContainerAnalysisLimitedTimeRetryPolicy directly. -using ::google::cloud::containeranalysis_v1:: - ContainerAnalysisLimitedTimeRetryPolicy; - -/// @deprecated Use containeranalysis_v1::ContainerAnalysisRetryPolicy directly. -using ::google::cloud::containeranalysis_v1::ContainerAnalysisRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace containeranalysis -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_CONTAINER_ANALYSIS_CONNECTION_H diff --git a/google/cloud/containeranalysis/container_analysis_connection_idempotency_policy.h b/google/cloud/containeranalysis/container_analysis_connection_idempotency_policy.h deleted file mode 100644 index f470e99249080..0000000000000 --- a/google/cloud/containeranalysis/container_analysis_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/containeranalysis/v1/containeranalysis.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_CONTAINER_ANALYSIS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_CONTAINER_ANALYSIS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/containeranalysis/v1/container_analysis_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace containeranalysis { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// containeranalysis_v1::MakeDefaultContainerAnalysisConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::containeranalysis_v1:: - MakeDefaultContainerAnalysisConnectionIdempotencyPolicy; - -/// @deprecated Use -/// containeranalysis_v1::ContainerAnalysisConnectionIdempotencyPolicy directly. -using ::google::cloud::containeranalysis_v1:: - ContainerAnalysisConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace containeranalysis -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_CONTAINER_ANALYSIS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/containeranalysis/container_analysis_options.h b/google/cloud/containeranalysis/container_analysis_options.h deleted file mode 100644 index 3155dccd131b6..0000000000000 --- a/google/cloud/containeranalysis/container_analysis_options.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/containeranalysis/v1/containeranalysis.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_CONTAINER_ANALYSIS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_CONTAINER_ANALYSIS_OPTIONS_H - -#include "google/cloud/containeranalysis/container_analysis_connection.h" -#include "google/cloud/containeranalysis/container_analysis_connection_idempotency_policy.h" -#include "google/cloud/containeranalysis/v1/container_analysis_options.h" - -namespace google { -namespace cloud { -namespace containeranalysis { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use containeranalysis_v1::ContainerAnalysisBackoffPolicyOption -/// directly. -using ::google::cloud::containeranalysis_v1:: - ContainerAnalysisBackoffPolicyOption; - -/// @deprecated Use -/// containeranalysis_v1::ContainerAnalysisConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::containeranalysis_v1:: - ContainerAnalysisConnectionIdempotencyPolicyOption; - -/// @deprecated Use containeranalysis_v1::ContainerAnalysisPolicyOptionList -/// directly. -using ::google::cloud::containeranalysis_v1::ContainerAnalysisPolicyOptionList; - -/// @deprecated Use containeranalysis_v1::ContainerAnalysisRetryPolicyOption -/// directly. -using ::google::cloud::containeranalysis_v1::ContainerAnalysisRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace containeranalysis -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_CONTAINER_ANALYSIS_OPTIONS_H diff --git a/google/cloud/containeranalysis/grafeas_client.h b/google/cloud/containeranalysis/grafeas_client.h deleted file mode 100644 index a0c498a947217..0000000000000 --- a/google/cloud/containeranalysis/grafeas_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: grafeas/v1/grafeas.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_GRAFEAS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_GRAFEAS_CLIENT_H - -#include "google/cloud/containeranalysis/grafeas_connection.h" -#include "google/cloud/containeranalysis/v1/grafeas_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in containeranalysis_v1 instead of the aliases defined in -/// this namespace. -namespace containeranalysis { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use containeranalysis_v1::GrafeasClient directly. -using ::google::cloud::containeranalysis_v1::GrafeasClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace containeranalysis -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_GRAFEAS_CLIENT_H diff --git a/google/cloud/containeranalysis/grafeas_connection.h b/google/cloud/containeranalysis/grafeas_connection.h deleted file mode 100644 index 5063a359e95eb..0000000000000 --- a/google/cloud/containeranalysis/grafeas_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: grafeas/v1/grafeas.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_GRAFEAS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_GRAFEAS_CONNECTION_H - -#include "google/cloud/containeranalysis/grafeas_connection_idempotency_policy.h" -#include "google/cloud/containeranalysis/v1/grafeas_connection.h" - -namespace google { -namespace cloud { -namespace containeranalysis { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use containeranalysis_v1::MakeGrafeasConnection directly. -using ::google::cloud::containeranalysis_v1::MakeGrafeasConnection; - -/// @deprecated Use containeranalysis_v1::GrafeasConnection directly. -using ::google::cloud::containeranalysis_v1::GrafeasConnection; - -/// @deprecated Use containeranalysis_v1::GrafeasLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::containeranalysis_v1:: - GrafeasLimitedErrorCountRetryPolicy; - -/// @deprecated Use containeranalysis_v1::GrafeasLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::containeranalysis_v1::GrafeasLimitedTimeRetryPolicy; - -/// @deprecated Use containeranalysis_v1::GrafeasRetryPolicy directly. -using ::google::cloud::containeranalysis_v1::GrafeasRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace containeranalysis -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_GRAFEAS_CONNECTION_H diff --git a/google/cloud/containeranalysis/grafeas_connection_idempotency_policy.h b/google/cloud/containeranalysis/grafeas_connection_idempotency_policy.h deleted file mode 100644 index 00119fd153c1b..0000000000000 --- a/google/cloud/containeranalysis/grafeas_connection_idempotency_policy.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: grafeas/v1/grafeas.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_GRAFEAS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_GRAFEAS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/containeranalysis/v1/grafeas_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace containeranalysis { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// containeranalysis_v1::MakeDefaultGrafeasConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::containeranalysis_v1:: - MakeDefaultGrafeasConnectionIdempotencyPolicy; - -/// @deprecated Use containeranalysis_v1::GrafeasConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::containeranalysis_v1::GrafeasConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace containeranalysis -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_GRAFEAS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/containeranalysis/grafeas_options.h b/google/cloud/containeranalysis/grafeas_options.h deleted file mode 100644 index eb401b2f4cb0e..0000000000000 --- a/google/cloud/containeranalysis/grafeas_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: grafeas/v1/grafeas.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_GRAFEAS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_GRAFEAS_OPTIONS_H - -#include "google/cloud/containeranalysis/grafeas_connection.h" -#include "google/cloud/containeranalysis/grafeas_connection_idempotency_policy.h" -#include "google/cloud/containeranalysis/v1/grafeas_options.h" - -namespace google { -namespace cloud { -namespace containeranalysis { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use containeranalysis_v1::GrafeasBackoffPolicyOption directly. -using ::google::cloud::containeranalysis_v1::GrafeasBackoffPolicyOption; - -/// @deprecated Use -/// containeranalysis_v1::GrafeasConnectionIdempotencyPolicyOption directly. -using ::google::cloud::containeranalysis_v1:: - GrafeasConnectionIdempotencyPolicyOption; - -/// @deprecated Use containeranalysis_v1::GrafeasPolicyOptionList directly. -using ::google::cloud::containeranalysis_v1::GrafeasPolicyOptionList; - -/// @deprecated Use containeranalysis_v1::GrafeasRetryPolicyOption directly. -using ::google::cloud::containeranalysis_v1::GrafeasRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace containeranalysis -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_GRAFEAS_OPTIONS_H diff --git a/google/cloud/containeranalysis/mocks/mock_container_analysis_connection.h b/google/cloud/containeranalysis/mocks/mock_container_analysis_connection.h deleted file mode 100644 index 021e4e6267ab1..0000000000000 --- a/google/cloud/containeranalysis/mocks/mock_container_analysis_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/containeranalysis/v1/containeranalysis.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_MOCKS_MOCK_CONTAINER_ANALYSIS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_MOCKS_MOCK_CONTAINER_ANALYSIS_CONNECTION_H - -#include "google/cloud/containeranalysis/container_analysis_connection.h" -#include "google/cloud/containeranalysis/v1/mocks/mock_container_analysis_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in containeranalysis_v1_mocks instead of the aliases -/// defined in this namespace. -namespace containeranalysis_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use containeranalysis_v1_mocks::MockContainerAnalysisConnection -/// directly. -using ::google::cloud::containeranalysis_v1_mocks:: - MockContainerAnalysisConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace containeranalysis_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_MOCKS_MOCK_CONTAINER_ANALYSIS_CONNECTION_H diff --git a/google/cloud/containeranalysis/mocks/mock_grafeas_connection.h b/google/cloud/containeranalysis/mocks/mock_grafeas_connection.h deleted file mode 100644 index f205f0fca3710..0000000000000 --- a/google/cloud/containeranalysis/mocks/mock_grafeas_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: grafeas/v1/grafeas.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_MOCKS_MOCK_GRAFEAS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_MOCKS_MOCK_GRAFEAS_CONNECTION_H - -#include "google/cloud/containeranalysis/grafeas_connection.h" -#include "google/cloud/containeranalysis/v1/mocks/mock_grafeas_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in containeranalysis_v1_mocks instead of the aliases -/// defined in this namespace. -namespace containeranalysis_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use containeranalysis_v1_mocks::MockGrafeasConnection directly. -using ::google::cloud::containeranalysis_v1_mocks::MockGrafeasConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace containeranalysis_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_MOCKS_MOCK_GRAFEAS_CONNECTION_H diff --git a/google/cloud/containeranalysis/quickstart/.bazelrc b/google/cloud/containeranalysis/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/containeranalysis/quickstart/.bazelrc +++ b/google/cloud/containeranalysis/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/containeranalysis/quickstart/CMakeLists.txt index e34c9c2e2cec9..1ea25628e8978 100644 --- a/google/cloud/containeranalysis/quickstart/CMakeLists.txt +++ b/google/cloud/containeranalysis/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Container Analysis API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-containeranalysis-quickstart CXX) find_package(google_cloud_cpp_containeranalysis REQUIRED) diff --git a/google/cloud/containeranalysis/quickstart/WORKSPACE.bazel b/google/cloud/containeranalysis/quickstart/WORKSPACE.bazel index d5177d4a61d73..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 = "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/containeranalysis/v1/container_analysis_connection.h b/google/cloud/containeranalysis/v1/container_analysis_connection.h index 59a64733509e8..ab5907bb62f83 100644 --- a/google/cloud/containeranalysis/v1/container_analysis_connection.h +++ b/google/cloud/containeranalysis/v1/container_analysis_connection.h @@ -26,8 +26,8 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/devtools/containeranalysis/v1/containeranalysis.pb.h" +#include "grafeas/v1/grafeas.pb.h" #include namespace google { diff --git a/google/cloud/containeranalysis/v1/container_analysis_connection_idempotency_policy.h b/google/cloud/containeranalysis/v1/container_analysis_connection_idempotency_policy.h index 1c4559ab3be1c..88efa555588b8 100644 --- a/google/cloud/containeranalysis/v1/container_analysis_connection_idempotency_policy.h +++ b/google/cloud/containeranalysis/v1/container_analysis_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/devtools/containeranalysis/v1/containeranalysis.grpc.pb.h" #include namespace google { diff --git a/google/cloud/containeranalysis/v1/grafeas_connection.h b/google/cloud/containeranalysis/v1/grafeas_connection.h index c5a86effc70f4..bbf752505c335 100644 --- a/google/cloud/containeranalysis/v1/grafeas_connection.h +++ b/google/cloud/containeranalysis/v1/grafeas_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "grafeas/v1/grafeas.pb.h" #include namespace google { diff --git a/google/cloud/containeranalysis/v1/grafeas_connection_idempotency_policy.h b/google/cloud/containeranalysis/v1/grafeas_connection_idempotency_policy.h index 22c02176e5f78..d9f2325e85376 100644 --- a/google/cloud/containeranalysis/v1/grafeas_connection_idempotency_policy.h +++ b/google/cloud/containeranalysis/v1/grafeas_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "grafeas/v1/grafeas.grpc.pb.h" #include namespace google { diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_auth_decorator.cc b/google/cloud/containeranalysis/v1/internal/container_analysis_auth_decorator.cc index f8dbe7f191f02..e9707374c020d 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_auth_decorator.cc +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/devtools/containeranalysis/v1/containeranalysis.proto #include "google/cloud/containeranalysis/v1/internal/container_analysis_auth_decorator.h" -#include +#include "google/devtools/containeranalysis/v1/containeranalysis.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -80,3 +83,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace containeranalysis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_auth_decorator.h b/google/cloud/containeranalysis/v1/internal/container_analysis_auth_decorator.h index f64f18be254cc..6d3b2c84f9db3 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_auth_decorator.h +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -72,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_V1_INTERNAL_CONTAINER_ANALYSIS_AUTH_DECORATOR_H diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_logging_decorator.cc b/google/cloud/containeranalysis/v1/internal/container_analysis_logging_decorator.cc index d1144fa9aae2d..e9af3faeca5a5 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_logging_decorator.cc +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/containeranalysis/v1/internal/container_analysis_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/devtools/containeranalysis/v1/containeranalysis.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -102,3 +105,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace containeranalysis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_logging_decorator.h b/google/cloud/containeranalysis/v1/internal/container_analysis_logging_decorator.h index ba2186ac86c21..2be0d93a95a23 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_logging_decorator.h +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -72,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_V1_INTERNAL_CONTAINER_ANALYSIS_LOGGING_DECORATOR_H diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_metadata_decorator.cc b/google/cloud/containeranalysis/v1/internal/container_analysis_metadata_decorator.cc index cb8b95085b906..9a02886015b2f 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_metadata_decorator.cc +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/containeranalysis/v1/internal/container_analysis_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/devtools/containeranalysis/v1/containeranalysis.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -109,3 +113,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace containeranalysis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_metadata_decorator.h b/google/cloud/containeranalysis/v1/internal/container_analysis_metadata_decorator.h index a78db8ea8973e..772570fba6003 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_metadata_decorator.h +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -78,4 +81,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_V1_INTERNAL_CONTAINER_ANALYSIS_METADATA_DECORATOR_H diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_option_defaults.cc b/google/cloud/containeranalysis/v1/internal/container_analysis_option_defaults.cc index b5f5153b1f38e..a443d0ca0f1fb 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_option_defaults.cc +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_option_defaults.cc @@ -43,7 +43,7 @@ Options ContainerAnalysisDefaultOptions(Options options) { .has()) { options.set( containeranalysis_v1::ContainerAnalysisLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_stub.cc b/google/cloud/containeranalysis/v1/internal/container_analysis_stub.cc index 23073dd60b177..d530172072945 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_stub.cc +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/containeranalysis/v1/internal/container_analysis_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/devtools/containeranalysis/v1/containeranalysis.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -96,3 +99,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace containeranalysis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_stub.h b/google/cloud/containeranalysis/v1/internal/container_analysis_stub.h index 06336b4e1fce0..367ce2c46ca23 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_stub.h +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_stub.h @@ -22,11 +22,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/devtools/containeranalysis/v1/containeranalysis.grpc.pb.h" +#include "grafeas/v1/grafeas.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -105,4 +108,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_V1_INTERNAL_CONTAINER_ANALYSIS_STUB_H diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_stub_factory.cc b/google/cloud/containeranalysis/v1/internal/container_analysis_stub_factory.cc index 420f44269f365..2b5ece2f747e6 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_stub_factory.cc +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/devtools/containeranalysis/v1/containeranalysis.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace containeranalysis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_stub_factory.h b/google/cloud/containeranalysis/v1/internal/container_analysis_stub_factory.h index f9e3c0533b0ee..be767f0192170 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_stub_factory.h +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_V1_INTERNAL_CONTAINER_ANALYSIS_STUB_FACTORY_H diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_connection.cc b/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_connection.cc index fe633be067169..312552a7242df 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_connection.cc +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace containeranalysis_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ContainerAnalysisTracingConnection::ContainerAnalysisTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -81,17 +79,13 @@ ContainerAnalysisTracingConnection::ExportSBOM( return internal::EndSpan(*span, child_->ExportSBOM(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeContainerAnalysisTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_connection.h b/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_connection.h index 8554e743456b5..c0b2de2567597 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_connection.h +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace containeranalysis_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ContainerAnalysisTracingConnection : public containeranalysis_v1::ContainerAnalysisConnection { public: @@ -63,8 +61,6 @@ class ContainerAnalysisTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_stub.cc b/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_stub.cc index 790b04bf50ebc..491a63bdc9695 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_stub.cc +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ContainerAnalysisTracingStub::ContainerAnalysisTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -95,18 +96,14 @@ ContainerAnalysisTracingStub::ExportSBOM( child_->ExportSBOM(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeContainerAnalysisTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace containeranalysis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_stub.h b/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_stub.h index e3caba67aaf39..5f4bda94c49ea 100644 --- a/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_stub.h +++ b/google/cloud/containeranalysis/v1/internal/container_analysis_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ContainerAnalysisTracingStub : public ContainerAnalysisStub { public: ~ContainerAnalysisTracingStub() override = default; @@ -69,8 +70,6 @@ class ContainerAnalysisTracingStub : public ContainerAnalysisStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -85,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_V1_INTERNAL_CONTAINER_ANALYSIS_TRACING_STUB_H diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_auth_decorator.cc b/google/cloud/containeranalysis/v1/internal/grafeas_auth_decorator.cc index 521ca7490bea0..16ef9984eef3e 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_auth_decorator.cc +++ b/google/cloud/containeranalysis/v1/internal/grafeas_auth_decorator.cc @@ -17,10 +17,13 @@ // source: grafeas/v1/grafeas.proto #include "google/cloud/containeranalysis/v1/internal/grafeas_auth_decorator.h" -#include +#include "grafeas/v1/grafeas.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -149,3 +152,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace containeranalysis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_auth_decorator.h b/google/cloud/containeranalysis/v1/internal/grafeas_auth_decorator.h index b13518b73587e..f39f8717437f4 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_auth_decorator.h +++ b/google/cloud/containeranalysis/v1/internal/grafeas_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_V1_INTERNAL_GRAFEAS_AUTH_DECORATOR_H diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_logging_decorator.cc b/google/cloud/containeranalysis/v1/internal/grafeas_logging_decorator.cc index 836b80e8027bd..2391785e20387 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_logging_decorator.cc +++ b/google/cloud/containeranalysis/v1/internal/grafeas_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/containeranalysis/v1/internal/grafeas_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "grafeas/v1/grafeas.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -196,3 +199,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace containeranalysis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_logging_decorator.h b/google/cloud/containeranalysis/v1/internal/grafeas_logging_decorator.h index 08c5ea915ff64..af7ecf323e81c 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_logging_decorator.h +++ b/google/cloud/containeranalysis/v1/internal/grafeas_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_V1_INTERNAL_GRAFEAS_LOGGING_DECORATOR_H diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_metadata_decorator.cc b/google/cloud/containeranalysis/v1/internal/grafeas_metadata_decorator.cc index 589fc9d80fa5a..2f0523c024ec2 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_metadata_decorator.cc +++ b/google/cloud/containeranalysis/v1/internal/grafeas_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/containeranalysis/v1/internal/grafeas_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "grafeas/v1/grafeas.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -176,3 +180,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace containeranalysis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_metadata_decorator.h b/google/cloud/containeranalysis/v1/internal/grafeas_metadata_decorator.h index 7041e8dfd4797..0ae85faa8c4b9 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_metadata_decorator.h +++ b/google/cloud/containeranalysis/v1/internal/grafeas_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -108,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_V1_INTERNAL_GRAFEAS_METADATA_DECORATOR_H diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_option_defaults.cc b/google/cloud/containeranalysis/v1/internal/grafeas_option_defaults.cc index 850253aab8dd0..45f40a51ab899 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_option_defaults.cc +++ b/google/cloud/containeranalysis/v1/internal/grafeas_option_defaults.cc @@ -41,7 +41,7 @@ Options GrafeasDefaultOptions(Options options) { if (!options.has()) { options.set( containeranalysis_v1::GrafeasLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_stub.cc b/google/cloud/containeranalysis/v1/internal/grafeas_stub.cc index e5e03aeb57d56..5310ffc43b9b1 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_stub.cc +++ b/google/cloud/containeranalysis/v1/internal/grafeas_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/containeranalysis/v1/internal/grafeas_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "grafeas/v1/grafeas.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -193,3 +196,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace containeranalysis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_stub.h b/google/cloud/containeranalysis/v1/internal/grafeas_stub.h index 3d5c538a331ab..3bba2789cb6d9 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_stub.h +++ b/google/cloud/containeranalysis/v1/internal/grafeas_stub.h @@ -22,11 +22,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "grafeas/v1/grafeas.grpc.pb.h" +#include "grafeas/v1/grafeas.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -165,4 +168,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_V1_INTERNAL_GRAFEAS_STUB_H diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_stub_factory.cc b/google/cloud/containeranalysis/v1/internal/grafeas_stub_factory.cc index 9a6d3b87fbf6b..11dffe5c426eb 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_stub_factory.cc +++ b/google/cloud/containeranalysis/v1/internal/grafeas_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "grafeas/v1/grafeas.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -67,3 +70,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace containeranalysis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_stub_factory.h b/google/cloud/containeranalysis/v1/internal/grafeas_stub_factory.h index 3580185f612f1..4b0c8ebc1e91b 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_stub_factory.h +++ b/google/cloud/containeranalysis/v1/internal/grafeas_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_V1_INTERNAL_GRAFEAS_STUB_FACTORY_H diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_tracing_connection.cc b/google/cloud/containeranalysis/v1/internal/grafeas_tracing_connection.cc index 4482c4fa683c6..0e5b38f6c1287 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_tracing_connection.cc +++ b/google/cloud/containeranalysis/v1/internal/grafeas_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace containeranalysis_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GrafeasTracingConnection::GrafeasTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -154,16 +152,12 @@ GrafeasTracingConnection::ListNoteOccurrences( std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGrafeasTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_tracing_connection.h b/google/cloud/containeranalysis/v1/internal/grafeas_tracing_connection.h index 16f7239110651..f0fc0e16dfcdd 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_tracing_connection.h +++ b/google/cloud/containeranalysis/v1/internal/grafeas_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace containeranalysis_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GrafeasTracingConnection : public containeranalysis_v1::GrafeasConnection { public: @@ -85,8 +83,6 @@ class GrafeasTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_tracing_stub.cc b/google/cloud/containeranalysis/v1/internal/grafeas_tracing_stub.cc index 2eb1ed828366f..14217d5589d1b 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_tracing_stub.cc +++ b/google/cloud/containeranalysis/v1/internal/grafeas_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GrafeasTracingStub::GrafeasTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -178,18 +179,14 @@ GrafeasTracingStub::ListNoteOccurrences( context, *span, child_->ListNoteOccurrences(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGrafeasTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace containeranalysis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/containeranalysis/v1/internal/grafeas_tracing_stub.h b/google/cloud/containeranalysis/v1/internal/grafeas_tracing_stub.h index a0c1933cda188..077a159570067 100644 --- a/google/cloud/containeranalysis/v1/internal/grafeas_tracing_stub.h +++ b/google/cloud/containeranalysis/v1/internal/grafeas_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace containeranalysis_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GrafeasTracingStub : public GrafeasStub { public: ~GrafeasTracingStub() override = default; @@ -99,8 +100,6 @@ class GrafeasTracingStub : public GrafeasStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -115,4 +114,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTAINERANALYSIS_V1_INTERNAL_GRAFEAS_TRACING_STUB_H diff --git a/google/cloud/contentwarehouse/BUILD.bazel b/google/cloud/contentwarehouse/BUILD.bazel index b5a662ef40055..03f9997275e6f 100644 --- a/google/cloud/contentwarehouse/BUILD.bazel +++ b/google/cloud/contentwarehouse/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/contentwarehouse/v1:contentwarehouse_cc_grpc", + "@googleapis//google/cloud/contentwarehouse/v1:contentwarehouse_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/contentwarehouse/quickstart/.bazelrc b/google/cloud/contentwarehouse/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/contentwarehouse/quickstart/.bazelrc +++ b/google/cloud/contentwarehouse/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/contentwarehouse/quickstart/CMakeLists.txt index be8b29a0c302c..b303a40c283ee 100644 --- a/google/cloud/contentwarehouse/quickstart/CMakeLists.txt +++ b/google/cloud/contentwarehouse/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Document AI Warehouse API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-contentwarehouse-quickstart CXX) find_package(google_cloud_cpp_contentwarehouse REQUIRED) diff --git a/google/cloud/contentwarehouse/quickstart/WORKSPACE.bazel b/google/cloud/contentwarehouse/quickstart/WORKSPACE.bazel index 7439172daa28c..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 = "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/contentwarehouse/v1/document_connection.h b/google/cloud/contentwarehouse/v1/document_connection.h index 1a0e008da62ff..94189af074f15 100644 --- a/google/cloud/contentwarehouse/v1/document_connection.h +++ b/google/cloud/contentwarehouse/v1/document_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_DOCUMENT_CONNECTION_H #include "google/cloud/contentwarehouse/v1/document_connection_idempotency_policy.h" +#include "google/cloud/contentwarehouse/v1/document_service.pb.h" #include "google/cloud/contentwarehouse/v1/internal/document_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/contentwarehouse/v1/document_connection_idempotency_policy.h b/google/cloud/contentwarehouse/v1/document_connection_idempotency_policy.h index 4e26deb025356..0079dbc52ad0d 100644 --- a/google/cloud/contentwarehouse/v1/document_connection_idempotency_policy.h +++ b/google/cloud/contentwarehouse/v1/document_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_DOCUMENT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_DOCUMENT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/contentwarehouse/v1/document_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/contentwarehouse/v1/document_link_connection.h b/google/cloud/contentwarehouse/v1/document_link_connection.h index ea8b4a54c08e3..c24d8c0fba134 100644 --- a/google/cloud/contentwarehouse/v1/document_link_connection.h +++ b/google/cloud/contentwarehouse/v1/document_link_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_DOCUMENT_LINK_CONNECTION_H #include "google/cloud/contentwarehouse/v1/document_link_connection_idempotency_policy.h" +#include "google/cloud/contentwarehouse/v1/document_link_service.pb.h" #include "google/cloud/contentwarehouse/v1/internal/document_link_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/contentwarehouse/v1/document_link_connection_idempotency_policy.h b/google/cloud/contentwarehouse/v1/document_link_connection_idempotency_policy.h index ba62e4baed9bf..be4728b058504 100644 --- a/google/cloud/contentwarehouse/v1/document_link_connection_idempotency_policy.h +++ b/google/cloud/contentwarehouse/v1/document_link_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_DOCUMENT_LINK_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_DOCUMENT_LINK_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/contentwarehouse/v1/document_link_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/contentwarehouse/v1/document_schema_connection.h b/google/cloud/contentwarehouse/v1/document_schema_connection.h index f7155e890b530..39f4c51bca8b0 100644 --- a/google/cloud/contentwarehouse/v1/document_schema_connection.h +++ b/google/cloud/contentwarehouse/v1/document_schema_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_DOCUMENT_SCHEMA_CONNECTION_H #include "google/cloud/contentwarehouse/v1/document_schema_connection_idempotency_policy.h" +#include "google/cloud/contentwarehouse/v1/document_schema_service.pb.h" #include "google/cloud/contentwarehouse/v1/internal/document_schema_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/contentwarehouse/v1/document_schema_connection_idempotency_policy.h b/google/cloud/contentwarehouse/v1/document_schema_connection_idempotency_policy.h index 106a9fb21fcb7..0a165cd774846 100644 --- a/google/cloud/contentwarehouse/v1/document_schema_connection_idempotency_policy.h +++ b/google/cloud/contentwarehouse/v1/document_schema_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_DOCUMENT_SCHEMA_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_DOCUMENT_SCHEMA_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/contentwarehouse/v1/document_schema_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/contentwarehouse/v1/internal/document_auth_decorator.cc b/google/cloud/contentwarehouse/v1/internal/document_auth_decorator.cc index bd096b6e74c46..9059e69aa642a 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_auth_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/contentwarehouse/v1/document_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_auth_decorator.h" -#include +#include "google/cloud/contentwarehouse/v1/document_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -115,3 +118,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_auth_decorator.h b/google/cloud/contentwarehouse/v1/internal/document_auth_decorator.h index 074877a10a580..3b3d0846e8fd8 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_auth_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/document_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -95,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_AUTH_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_auth_decorator.cc b/google/cloud/contentwarehouse/v1/internal/document_link_auth_decorator.cc index 7e007fb590c60..d3b4a55ec6466 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_auth_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_link_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/contentwarehouse/v1/document_link_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_link_auth_decorator.h" -#include +#include "google/cloud/contentwarehouse/v1/document_link_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -82,3 +85,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_auth_decorator.h b/google/cloud/contentwarehouse/v1/internal/document_link_auth_decorator.h index c9398bf30ac30..957b1a1d8a5d2 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_auth_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/document_link_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -75,4 +78,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_LINK_AUTH_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_logging_decorator.cc b/google/cloud/contentwarehouse/v1/internal/document_link_logging_decorator.cc index c582ca2016a5a..c9c5b58bfcca6 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_logging_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_link_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/contentwarehouse/v1/document_link_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_link_logging_decorator.h" +#include "google/cloud/contentwarehouse/v1/document_link_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -110,3 +113,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_logging_decorator.h b/google/cloud/contentwarehouse/v1/internal/document_link_logging_decorator.h index 376a542fd47db..3cc21adf37016 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_logging_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/document_link_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -75,4 +78,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_LINK_LOGGING_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_metadata_decorator.cc b/google/cloud/contentwarehouse/v1/internal/document_link_metadata_decorator.cc index 86f0fa2a3009f..d9444b00a1d15 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_metadata_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_link_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/contentwarehouse/v1/document_link_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_link_metadata_decorator.h" +#include "google/cloud/contentwarehouse/v1/document_link_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 contentwarehouse_v1_internal { @@ -109,3 +113,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_metadata_decorator.h b/google/cloud/contentwarehouse/v1/internal/document_link_metadata_decorator.h index 1a555e0c07d19..624ee4fb05d9a 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_metadata_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/document_link_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -81,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_LINK_METADATA_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_option_defaults.cc b/google/cloud/contentwarehouse/v1/internal/document_link_option_defaults.cc index 4baabc11eb300..b0fe777b79e6d 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_option_defaults.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_link_option_defaults.cc @@ -43,7 +43,7 @@ Options DocumentLinkServiceDefaultOptions(Options options) { .has()) { options.set( contentwarehouse_v1::DocumentLinkServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_stub.cc b/google/cloud/contentwarehouse/v1/internal/document_link_stub.cc index 6c35e145b4503..148dbd31ae288 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_stub.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_link_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/contentwarehouse/v1/document_link_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_link_stub.h" +#include "google/cloud/contentwarehouse/v1/document_link_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -97,3 +100,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_stub.h b/google/cloud/contentwarehouse/v1/internal/document_link_stub.h index 5caceb24f9083..2b77749ac940d 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_stub.h +++ b/google/cloud/contentwarehouse/v1/internal/document_link_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_LINK_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_LINK_STUB_H +#include "google/cloud/contentwarehouse/v1/document_link_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -117,4 +120,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_LINK_STUB_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_stub_factory.cc b/google/cloud/contentwarehouse/v1/internal/document_link_stub_factory.cc index 729a6b130042f..133d2a045f3e2 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_stub_factory.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_link_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/contentwarehouse/v1/document_link_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_link_stub_factory.h" +#include "google/cloud/contentwarehouse/v1/document_link_service.grpc.pb.h" #include "google/cloud/contentwarehouse/v1/internal/document_link_auth_decorator.h" #include "google/cloud/contentwarehouse/v1/internal/document_link_logging_decorator.h" #include "google/cloud/contentwarehouse/v1/internal/document_link_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_stub_factory.h b/google/cloud/contentwarehouse/v1/internal/document_link_stub_factory.h index 09da8b77cfb3e..390411fe1007b 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_stub_factory.h +++ b/google/cloud/contentwarehouse/v1/internal/document_link_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_LINK_STUB_FACTORY_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_tracing_connection.cc b/google/cloud/contentwarehouse/v1/internal/document_link_tracing_connection.cc index e1c6bdc1fb2dc..5c74a37f9699c 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_tracing_connection.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_link_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DocumentLinkServiceTracingConnection::DocumentLinkServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -83,17 +81,13 @@ DocumentLinkServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDocumentLinkServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_tracing_connection.h b/google/cloud/contentwarehouse/v1/internal/document_link_tracing_connection.h index b75a6924ac05d..026271ad1d422 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_tracing_connection.h +++ b/google/cloud/contentwarehouse/v1/internal/document_link_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DocumentLinkServiceTracingConnection : public contentwarehouse_v1::DocumentLinkServiceConnection { public: @@ -67,8 +65,6 @@ class DocumentLinkServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_tracing_stub.cc b/google/cloud/contentwarehouse/v1/internal/document_link_tracing_stub.cc index 735a8e651cfef..f5a85cbd5ed5d 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_tracing_stub.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_link_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DocumentLinkServiceTracingStub::DocumentLinkServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -99,18 +100,14 @@ DocumentLinkServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDocumentLinkServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_link_tracing_stub.h b/google/cloud/contentwarehouse/v1/internal/document_link_tracing_stub.h index ff1da9d6cf312..389701e83daff 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_link_tracing_stub.h +++ b/google/cloud/contentwarehouse/v1/internal/document_link_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DocumentLinkServiceTracingStub : public DocumentLinkServiceStub { public: ~DocumentLinkServiceTracingStub() override = default; @@ -72,8 +73,6 @@ class DocumentLinkServiceTracingStub : public DocumentLinkServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -88,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_LINK_TRACING_STUB_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_logging_decorator.cc b/google/cloud/contentwarehouse/v1/internal/document_logging_decorator.cc index a859786f37b36..9f3f18c8d5cea 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_logging_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/contentwarehouse/v1/document_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_logging_decorator.h" +#include "google/cloud/contentwarehouse/v1/document_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -154,3 +157,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_logging_decorator.h b/google/cloud/contentwarehouse/v1/internal/document_logging_decorator.h index 6bd8841ee2f24..b77aa472de689 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_logging_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/document_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -95,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_LOGGING_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_metadata_decorator.cc b/google/cloud/contentwarehouse/v1/internal/document_metadata_decorator.cc index edd11702bfe2c..27da802c2db87 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_metadata_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/contentwarehouse/v1/document_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_metadata_decorator.h" +#include "google/cloud/contentwarehouse/v1/document_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 contentwarehouse_v1_internal { @@ -143,3 +147,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_metadata_decorator.h b/google/cloud/contentwarehouse/v1/internal/document_metadata_decorator.h index ff9b071cb10a6..ad19ac8a1aec9 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_metadata_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/document_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -101,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_METADATA_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_option_defaults.cc b/google/cloud/contentwarehouse/v1/internal/document_option_defaults.cc index 727b9ea245d1a..65460e2f6a3b9 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_option_defaults.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_option_defaults.cc @@ -42,7 +42,7 @@ Options DocumentServiceDefaultOptions(Options options) { if (!options.has()) { options.set( contentwarehouse_v1::DocumentServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_auth_decorator.cc b/google/cloud/contentwarehouse/v1/internal/document_schema_auth_decorator.cc index be98a81f23a53..2c350195055ca 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_auth_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/contentwarehouse/v1/document_schema_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_schema_auth_decorator.h" -#include +#include "google/cloud/contentwarehouse/v1/document_schema_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -93,3 +96,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_auth_decorator.h b/google/cloud/contentwarehouse/v1/internal/document_schema_auth_decorator.h index 06272dd5e3c22..fc1395d127886 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_auth_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -81,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_SCHEMA_AUTH_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_logging_decorator.cc b/google/cloud/contentwarehouse/v1/internal/document_schema_logging_decorator.cc index f4280a535b4d4..e29d301f67326 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_logging_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/contentwarehouse/v1/document_schema_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_schema_logging_decorator.h" +#include "google/cloud/contentwarehouse/v1/document_schema_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -122,3 +125,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_logging_decorator.h b/google/cloud/contentwarehouse/v1/internal/document_schema_logging_decorator.h index 557bc7b7b8f22..e810b29bd3c54 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_logging_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -81,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_SCHEMA_LOGGING_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_metadata_decorator.cc b/google/cloud/contentwarehouse/v1/internal/document_schema_metadata_decorator.cc index fa5bfcfb5c70b..f650140093527 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_metadata_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/contentwarehouse/v1/document_schema_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_schema_metadata_decorator.h" +#include "google/cloud/contentwarehouse/v1/document_schema_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 contentwarehouse_v1_internal { @@ -119,3 +123,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_metadata_decorator.h b/google/cloud/contentwarehouse/v1/internal/document_schema_metadata_decorator.h index 00048426f3057..082e3e2bdb287 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_metadata_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -87,4 +90,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_SCHEMA_METADATA_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_option_defaults.cc b/google/cloud/contentwarehouse/v1/internal/document_schema_option_defaults.cc index cdbdba7f6ef37..b174017cf759d 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_option_defaults.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_option_defaults.cc @@ -43,7 +43,7 @@ Options DocumentSchemaServiceDefaultOptions(Options options) { contentwarehouse_v1::DocumentSchemaServiceRetryPolicyOption>()) { options.set( contentwarehouse_v1::DocumentSchemaServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_stub.cc b/google/cloud/contentwarehouse/v1/internal/document_schema_stub.cc index b5f90f23da515..3b3323ae6c912 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_stub.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/contentwarehouse/v1/document_schema_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_schema_stub.h" +#include "google/cloud/contentwarehouse/v1/document_schema_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -110,3 +113,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_stub.h b/google/cloud/contentwarehouse/v1/internal/document_schema_stub.h index fe28d202c138d..46114ec70916f 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_stub.h +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_SCHEMA_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_SCHEMA_STUB_H +#include "google/cloud/contentwarehouse/v1/document_schema_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -128,4 +131,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_SCHEMA_STUB_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_stub_factory.cc b/google/cloud/contentwarehouse/v1/internal/document_schema_stub_factory.cc index c206a6822428a..5a8367409e2ec 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_stub_factory.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/contentwarehouse/v1/document_schema_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_schema_stub_factory.h" +#include "google/cloud/contentwarehouse/v1/document_schema_service.grpc.pb.h" #include "google/cloud/contentwarehouse/v1/internal/document_schema_auth_decorator.h" #include "google/cloud/contentwarehouse/v1/internal/document_schema_logging_decorator.h" #include "google/cloud/contentwarehouse/v1/internal/document_schema_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_stub_factory.h b/google/cloud/contentwarehouse/v1/internal/document_schema_stub_factory.h index a0b22900e2f55..d16c38778dcb1 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_stub_factory.h +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_SCHEMA_STUB_FACTORY_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_connection.cc b/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_connection.cc index 837217d615dbd..a45bc7ad15286 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_connection.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DocumentSchemaServiceTracingConnection::DocumentSchemaServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -98,18 +96,14 @@ DocumentSchemaServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDocumentSchemaServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_connection.h b/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_connection.h index acfc27b0ad6e5..b66a57b9ff67f 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_connection.h +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DocumentSchemaServiceTracingConnection : public contentwarehouse_v1::DocumentSchemaServiceConnection { public: @@ -72,8 +70,6 @@ class DocumentSchemaServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_stub.cc b/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_stub.cc index 046918e125192..a94facca54bb5 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_stub.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DocumentSchemaServiceTracingStub::DocumentSchemaServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -113,18 +114,14 @@ DocumentSchemaServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDocumentSchemaServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_stub.h b/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_stub.h index aff71233fe280..3d0b217aa5b6a 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_stub.h +++ b/google/cloud/contentwarehouse/v1/internal/document_schema_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DocumentSchemaServiceTracingStub : public DocumentSchemaServiceStub { public: ~DocumentSchemaServiceTracingStub() override = default; @@ -78,8 +79,6 @@ class DocumentSchemaServiceTracingStub : public DocumentSchemaServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -94,4 +93,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_SCHEMA_TRACING_STUB_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_stub.cc b/google/cloud/contentwarehouse/v1/internal/document_stub.cc index 0056d39943e2b..b534db64fa5ee 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_stub.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/contentwarehouse/v1/document_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_stub.h" +#include "google/cloud/contentwarehouse/v1/document_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -142,3 +145,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_stub.h b/google/cloud/contentwarehouse/v1/internal/document_stub.h index 1d2b340d5f42c..fa0b25ece4b49 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_stub.h +++ b/google/cloud/contentwarehouse/v1/internal/document_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_STUB_H +#include "google/cloud/contentwarehouse/v1/document_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -154,4 +157,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_STUB_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_stub_factory.cc b/google/cloud/contentwarehouse/v1/internal/document_stub_factory.cc index fce775c02c652..506f66bd8f5a2 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_stub_factory.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/contentwarehouse/v1/document_service.proto #include "google/cloud/contentwarehouse/v1/internal/document_stub_factory.h" +#include "google/cloud/contentwarehouse/v1/document_service.grpc.pb.h" #include "google/cloud/contentwarehouse/v1/internal/document_auth_decorator.h" #include "google/cloud/contentwarehouse/v1/internal/document_logging_decorator.h" #include "google/cloud/contentwarehouse/v1/internal/document_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_stub_factory.h b/google/cloud/contentwarehouse/v1/internal/document_stub_factory.h index 23d4c0b2b3c60..70dbdf296bd4f 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_stub_factory.h +++ b/google/cloud/contentwarehouse/v1/internal/document_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_STUB_FACTORY_H diff --git a/google/cloud/contentwarehouse/v1/internal/document_tracing_connection.cc b/google/cloud/contentwarehouse/v1/internal/document_tracing_connection.cc index df7383aaa15a3..b4fd6cf9182cc 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_tracing_connection.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DocumentServiceTracingConnection::DocumentServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -117,16 +115,12 @@ DocumentServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDocumentServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/contentwarehouse/v1/internal/document_tracing_connection.h b/google/cloud/contentwarehouse/v1/internal/document_tracing_connection.h index 5af3d469fa257..13e8a61d83083 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_tracing_connection.h +++ b/google/cloud/contentwarehouse/v1/internal/document_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DocumentServiceTracingConnection : public contentwarehouse_v1::DocumentServiceConnection { public: @@ -82,8 +80,6 @@ class DocumentServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/contentwarehouse/v1/internal/document_tracing_stub.cc b/google/cloud/contentwarehouse/v1/internal/document_tracing_stub.cc index 9d3b1616e366a..84c4594ebbf44 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_tracing_stub.cc +++ b/google/cloud/contentwarehouse/v1/internal/document_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DocumentServiceTracingStub::DocumentServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -140,18 +141,14 @@ DocumentServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDocumentServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/document_tracing_stub.h b/google/cloud/contentwarehouse/v1/internal/document_tracing_stub.h index 60f94eea40e65..53646f430d1f9 100644 --- a/google/cloud/contentwarehouse/v1/internal/document_tracing_stub.h +++ b/google/cloud/contentwarehouse/v1/internal/document_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DocumentServiceTracingStub : public DocumentServiceStub { public: ~DocumentServiceTracingStub() override = default; @@ -92,8 +93,6 @@ class DocumentServiceTracingStub : public DocumentServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -108,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_DOCUMENT_TRACING_STUB_H diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_auth_decorator.cc b/google/cloud/contentwarehouse/v1/internal/pipeline_auth_decorator.cc index dc0b668dfa452..7ed4b2706cf2d 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_auth_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/contentwarehouse/v1/pipeline_service.proto #include "google/cloud/contentwarehouse/v1/internal/pipeline_auth_decorator.h" -#include +#include "google/cloud/contentwarehouse/v1/pipeline_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -107,3 +110,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_auth_decorator.h b/google/cloud/contentwarehouse/v1/internal/pipeline_auth_decorator.h index cf8ba9e1d20ee..3afa7a360ac3a 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_auth_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/contentwarehouse/v1/internal/pipeline_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 contentwarehouse_v1_internal { @@ -77,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_PIPELINE_AUTH_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_connection_impl.h b/google/cloud/contentwarehouse/v1/internal/pipeline_connection_impl.h index 3782eb9922589..d0f7a208dce27 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_connection_impl.h +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_connection_impl.h @@ -31,7 +31,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_logging_decorator.cc b/google/cloud/contentwarehouse/v1/internal/pipeline_logging_decorator.cc index af3d140cad4f6..02a1f936f015c 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_logging_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/contentwarehouse/v1/pipeline_service.proto #include "google/cloud/contentwarehouse/v1/internal/pipeline_logging_decorator.h" +#include "google/cloud/contentwarehouse/v1/pipeline_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -116,3 +119,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_logging_decorator.h b/google/cloud/contentwarehouse/v1/internal/pipeline_logging_decorator.h index 5fa75955414de..5b79723bc54c0 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_logging_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/contentwarehouse/v1/internal/pipeline_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 contentwarehouse_v1_internal { @@ -77,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_PIPELINE_LOGGING_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_metadata_decorator.cc b/google/cloud/contentwarehouse/v1/internal/pipeline_metadata_decorator.cc index 7ca500b1f6536..1aa6602061334 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_metadata_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/contentwarehouse/v1/pipeline_service.proto #include "google/cloud/contentwarehouse/v1/internal/pipeline_metadata_decorator.h" +#include "google/cloud/contentwarehouse/v1/pipeline_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 contentwarehouse_v1_internal { @@ -112,3 +116,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_metadata_decorator.h b/google/cloud/contentwarehouse/v1/internal/pipeline_metadata_decorator.h index 7635e920db968..ca9597120970c 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_metadata_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/contentwarehouse/v1/internal/pipeline_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 contentwarehouse_v1_internal { @@ -83,4 +86,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_PIPELINE_METADATA_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_option_defaults.cc b/google/cloud/contentwarehouse/v1/internal/pipeline_option_defaults.cc index 1bf5987c832c8..b31bee42094e7 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_option_defaults.cc +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_option_defaults.cc @@ -42,7 +42,7 @@ Options PipelineServiceDefaultOptions(Options options) { if (!options.has()) { options.set( contentwarehouse_v1::PipelineServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_stub.cc b/google/cloud/contentwarehouse/v1/internal/pipeline_stub.cc index 636475244abbf..88ccedc465232 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_stub.cc +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/contentwarehouse/v1/pipeline_service.proto #include "google/cloud/contentwarehouse/v1/internal/pipeline_stub.h" +#include "google/cloud/contentwarehouse/v1/pipeline_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -117,3 +120,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_stub.h b/google/cloud/contentwarehouse/v1/internal/pipeline_stub.h index 85dc61e3ef989..f304e65d2e2b0 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_stub.h +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_PIPELINE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_PIPELINE_STUB_H +#include "google/cloud/contentwarehouse/v1/pipeline_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -119,4 +122,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_PIPELINE_STUB_H diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_stub_factory.cc b/google/cloud/contentwarehouse/v1/internal/pipeline_stub_factory.cc index 84f3b406da6c4..9c280a74c3024 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_stub_factory.cc +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/contentwarehouse/v1/internal/pipeline_metadata_decorator.h" #include "google/cloud/contentwarehouse/v1/internal/pipeline_stub.h" #include "google/cloud/contentwarehouse/v1/internal/pipeline_tracing_stub.h" +#include "google/cloud/contentwarehouse/v1/pipeline_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_stub_factory.h b/google/cloud/contentwarehouse/v1/internal/pipeline_stub_factory.h index a62b06e1411c3..941144893cc55 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_stub_factory.h +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_PIPELINE_STUB_FACTORY_H diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_connection.cc b/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_connection.cc index d3de82f3ebb26..4887b91b02380 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_connection.cc +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PipelineServiceTracingConnection::PipelineServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -69,16 +67,12 @@ PipelineServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePipelineServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_connection.h b/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_connection.h index d8d73dec5e33f..973572ce078a4 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_connection.h +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PipelineServiceTracingConnection : public contentwarehouse_v1::PipelineServiceConnection { public: @@ -59,8 +57,6 @@ class PipelineServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_stub.cc b/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_stub.cc index a9556c5946158..585ed82acb148 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_stub.cc +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PipelineServiceTracingStub::PipelineServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -98,18 +99,14 @@ future PipelineServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePipelineServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_stub.h b/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_stub.h index 5eb7b04a69086..6fbf9bab512ae 100644 --- a/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_stub.h +++ b/google/cloud/contentwarehouse/v1/internal/pipeline_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PipelineServiceTracingStub : public PipelineServiceStub { public: ~PipelineServiceTracingStub() override = default; @@ -73,8 +74,6 @@ class PipelineServiceTracingStub : public PipelineServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -89,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_PIPELINE_TRACING_STUB_H diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_auth_decorator.cc b/google/cloud/contentwarehouse/v1/internal/rule_set_auth_decorator.cc index cb7f49891c55a..319d0f3ff4b41 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_auth_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/contentwarehouse/v1/ruleset_service.proto #include "google/cloud/contentwarehouse/v1/internal/rule_set_auth_decorator.h" -#include +#include "google/cloud/contentwarehouse/v1/ruleset_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -87,3 +90,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_auth_decorator.h b/google/cloud/contentwarehouse/v1/internal/rule_set_auth_decorator.h index f015e782ba22b..5de27ec5d62cc 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_auth_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -77,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_RULE_SET_AUTH_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_logging_decorator.cc b/google/cloud/contentwarehouse/v1/internal/rule_set_logging_decorator.cc index 37420f218df31..864be1d5dd518 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_logging_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/contentwarehouse/v1/ruleset_service.proto #include "google/cloud/contentwarehouse/v1/internal/rule_set_logging_decorator.h" +#include "google/cloud/contentwarehouse/v1/ruleset_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -114,3 +117,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_logging_decorator.h b/google/cloud/contentwarehouse/v1/internal/rule_set_logging_decorator.h index 8b6b767b46673..acaf1e2cdb67c 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_logging_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -77,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_RULE_SET_LOGGING_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_metadata_decorator.cc b/google/cloud/contentwarehouse/v1/internal/rule_set_metadata_decorator.cc index 6e6edad9f52f3..3c5820657ae99 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_metadata_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/contentwarehouse/v1/ruleset_service.proto #include "google/cloud/contentwarehouse/v1/internal/rule_set_metadata_decorator.h" +#include "google/cloud/contentwarehouse/v1/ruleset_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 contentwarehouse_v1_internal { @@ -113,3 +117,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_metadata_decorator.h b/google/cloud/contentwarehouse/v1/internal/rule_set_metadata_decorator.h index 1a28ac7a391a0..f6a5791c7f9fd 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_metadata_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -82,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_RULE_SET_METADATA_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_option_defaults.cc b/google/cloud/contentwarehouse/v1/internal/rule_set_option_defaults.cc index 6acde6d027f41..8587d97fd594b 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_option_defaults.cc +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_option_defaults.cc @@ -42,7 +42,7 @@ Options RuleSetServiceDefaultOptions(Options options) { if (!options.has()) { options.set( contentwarehouse_v1::RuleSetServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_stub.cc b/google/cloud/contentwarehouse/v1/internal/rule_set_stub.cc index 82ee24c4d4b6a..5840dd0301dac 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_stub.cc +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/contentwarehouse/v1/ruleset_service.proto #include "google/cloud/contentwarehouse/v1/internal/rule_set_stub.h" +#include "google/cloud/contentwarehouse/v1/ruleset_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -105,3 +108,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_stub.h b/google/cloud/contentwarehouse/v1/internal/rule_set_stub.h index 43ae676998869..1ba1f58116a60 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_stub.h +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_RULE_SET_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_RULE_SET_STUB_H +#include "google/cloud/contentwarehouse/v1/ruleset_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -119,4 +122,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_RULE_SET_STUB_H diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_stub_factory.cc b/google/cloud/contentwarehouse/v1/internal/rule_set_stub_factory.cc index a6bf26af3ab4a..cee766252ec52 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_stub_factory.cc +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/contentwarehouse/v1/internal/rule_set_metadata_decorator.h" #include "google/cloud/contentwarehouse/v1/internal/rule_set_stub.h" #include "google/cloud/contentwarehouse/v1/internal/rule_set_tracing_stub.h" +#include "google/cloud/contentwarehouse/v1/ruleset_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_stub_factory.h b/google/cloud/contentwarehouse/v1/internal/rule_set_stub_factory.h index 7138198bbf9c2..027a5994f35b3 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_stub_factory.h +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_RULE_SET_STUB_FACTORY_H diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_connection.cc b/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_connection.cc index 3c4b92ca28914..bb19998db0a38 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_connection.cc +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RuleSetServiceTracingConnection::RuleSetServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -89,16 +87,12 @@ RuleSetServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRuleSetServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_connection.h b/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_connection.h index eab8ad7ff8cbd..5228bddd7ab02 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_connection.h +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RuleSetServiceTracingConnection : public contentwarehouse_v1::RuleSetServiceConnection { public: @@ -67,8 +65,6 @@ class RuleSetServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_stub.cc b/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_stub.cc index c23759fb7d9c7..32bf5017c27b7 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_stub.cc +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RuleSetServiceTracingStub::RuleSetServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -103,18 +104,14 @@ RuleSetServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRuleSetServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_stub.h b/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_stub.h index 16cdce7cc9132..a60d7ef6b6e0c 100644 --- a/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_stub.h +++ b/google/cloud/contentwarehouse/v1/internal/rule_set_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RuleSetServiceTracingStub : public RuleSetServiceStub { public: ~RuleSetServiceTracingStub() override = default; @@ -73,8 +74,6 @@ class RuleSetServiceTracingStub : public RuleSetServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -89,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_RULE_SET_TRACING_STUB_H diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_auth_decorator.cc b/google/cloud/contentwarehouse/v1/internal/synonym_set_auth_decorator.cc index 4edd992bc7c7a..7aef592fd59eb 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_auth_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/contentwarehouse/v1/synonymset_service.proto #include "google/cloud/contentwarehouse/v1/internal/synonym_set_auth_decorator.h" -#include +#include "google/cloud/contentwarehouse/v1/synonymset_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -91,3 +94,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_auth_decorator.h b/google/cloud/contentwarehouse/v1/internal/synonym_set_auth_decorator.h index e8b162485a4c2..3b5a616bface1 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_auth_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -78,4 +81,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_SYNONYM_SET_AUTH_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_logging_decorator.cc b/google/cloud/contentwarehouse/v1/internal/synonym_set_logging_decorator.cc index 0d4adcce19d2f..e6743d0ef6fc8 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_logging_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/contentwarehouse/v1/synonymset_service.proto #include "google/cloud/contentwarehouse/v1/internal/synonym_set_logging_decorator.h" +#include "google/cloud/contentwarehouse/v1/synonymset_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -118,3 +121,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_logging_decorator.h b/google/cloud/contentwarehouse/v1/internal/synonym_set_logging_decorator.h index 724fce941f5f1..bafb69212966d 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_logging_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -78,4 +81,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_SYNONYM_SET_LOGGING_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_metadata_decorator.cc b/google/cloud/contentwarehouse/v1/internal/synonym_set_metadata_decorator.cc index 0b7f711cb0fd7..5fb6c833ba16e 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_metadata_decorator.cc +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/contentwarehouse/v1/synonymset_service.proto #include "google/cloud/contentwarehouse/v1/internal/synonym_set_metadata_decorator.h" +#include "google/cloud/contentwarehouse/v1/synonymset_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 contentwarehouse_v1_internal { @@ -118,3 +122,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_metadata_decorator.h b/google/cloud/contentwarehouse/v1/internal/synonym_set_metadata_decorator.h index ccd0100ad5ee1..d43d04a5092d2 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_metadata_decorator.h +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -84,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_SYNONYM_SET_METADATA_DECORATOR_H diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_option_defaults.cc b/google/cloud/contentwarehouse/v1/internal/synonym_set_option_defaults.cc index ca95566d7609c..09d505f2084d4 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_option_defaults.cc +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_option_defaults.cc @@ -42,7 +42,7 @@ Options SynonymSetServiceDefaultOptions(Options options) { if (!options.has()) { options.set( contentwarehouse_v1::SynonymSetServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_stub.cc b/google/cloud/contentwarehouse/v1/internal/synonym_set_stub.cc index ca470a9247428..7c612f92fcc1d 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_stub.cc +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/contentwarehouse/v1/synonymset_service.proto #include "google/cloud/contentwarehouse/v1/internal/synonym_set_stub.h" +#include "google/cloud/contentwarehouse/v1/synonymset_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -109,3 +112,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_stub.h b/google/cloud/contentwarehouse/v1/internal/synonym_set_stub.h index 8dfc31f47fec7..188177981d021 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_stub.h +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_SYNONYM_SET_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_SYNONYM_SET_STUB_H +#include "google/cloud/contentwarehouse/v1/synonymset_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -123,4 +126,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_SYNONYM_SET_STUB_H diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_stub_factory.cc b/google/cloud/contentwarehouse/v1/internal/synonym_set_stub_factory.cc index 759edc82ec2dd..69b024ce86d30 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_stub_factory.cc +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/contentwarehouse/v1/internal/synonym_set_metadata_decorator.h" #include "google/cloud/contentwarehouse/v1/internal/synonym_set_stub.h" #include "google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_stub.h" +#include "google/cloud/contentwarehouse/v1/synonymset_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_stub_factory.h b/google/cloud/contentwarehouse/v1/internal/synonym_set_stub_factory.h index ed8322cd9fb55..3026b32a167e0 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_stub_factory.h +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_SYNONYM_SET_STUB_FACTORY_H diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_connection.cc b/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_connection.cc index bb2865afc18ca..27c9aff8b3922 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_connection.cc +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SynonymSetServiceTracingConnection::SynonymSetServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -92,17 +90,13 @@ SynonymSetServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSynonymSetServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_connection.h b/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_connection.h index 4d6c0995b8d5e..d935bacde1ee5 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_connection.h +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SynonymSetServiceTracingConnection : public contentwarehouse_v1::SynonymSetServiceConnection { public: @@ -67,8 +65,6 @@ class SynonymSetServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_stub.cc b/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_stub.cc index 62c5c7b891ab8..423605bf2f307 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_stub.cc +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SynonymSetServiceTracingStub::SynonymSetServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -107,18 +108,14 @@ SynonymSetServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSynonymSetServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace contentwarehouse_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_stub.h b/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_stub.h index 15a5990dd591f..761c2d5626ea0 100644 --- a/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_stub.h +++ b/google/cloud/contentwarehouse/v1/internal/synonym_set_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace contentwarehouse_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SynonymSetServiceTracingStub : public SynonymSetServiceStub { public: ~SynonymSetServiceTracingStub() override = default; @@ -75,8 +76,6 @@ class SynonymSetServiceTracingStub : public SynonymSetServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -91,4 +90,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_INTERNAL_SYNONYM_SET_TRACING_STUB_H diff --git a/google/cloud/contentwarehouse/v1/pipeline_client.h b/google/cloud/contentwarehouse/v1/pipeline_client.h index 665989edf0194..55953b08ca558 100644 --- a/google/cloud/contentwarehouse/v1/pipeline_client.h +++ b/google/cloud/contentwarehouse/v1/pipeline_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/contentwarehouse/v1/pipeline_connection.h b/google/cloud/contentwarehouse/v1/pipeline_connection.h index d75a80c18d0b2..7f8b50c0183c1 100644 --- a/google/cloud/contentwarehouse/v1/pipeline_connection.h +++ b/google/cloud/contentwarehouse/v1/pipeline_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/contentwarehouse/v1/internal/pipeline_retry_traits.h" #include "google/cloud/contentwarehouse/v1/pipeline_connection_idempotency_policy.h" +#include "google/cloud/contentwarehouse/v1/pipeline_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -29,8 +30,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/contentwarehouse/v1/pipeline_connection_idempotency_policy.h b/google/cloud/contentwarehouse/v1/pipeline_connection_idempotency_policy.h index 13ceb0191e746..b99816f6ca36a 100644 --- a/google/cloud/contentwarehouse/v1/pipeline_connection_idempotency_policy.h +++ b/google/cloud/contentwarehouse/v1/pipeline_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_PIPELINE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_PIPELINE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/contentwarehouse/v1/pipeline_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/contentwarehouse/v1/rule_set_connection.h b/google/cloud/contentwarehouse/v1/rule_set_connection.h index 81c8e9911688b..18f2cf37e6e18 100644 --- a/google/cloud/contentwarehouse/v1/rule_set_connection.h +++ b/google/cloud/contentwarehouse/v1/rule_set_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/contentwarehouse/v1/internal/rule_set_retry_traits.h" #include "google/cloud/contentwarehouse/v1/rule_set_connection_idempotency_policy.h" +#include "google/cloud/contentwarehouse/v1/ruleset_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 #include namespace google { diff --git a/google/cloud/contentwarehouse/v1/rule_set_connection_idempotency_policy.h b/google/cloud/contentwarehouse/v1/rule_set_connection_idempotency_policy.h index 5646146b64a6e..743115f6f9e5f 100644 --- a/google/cloud/contentwarehouse/v1/rule_set_connection_idempotency_policy.h +++ b/google/cloud/contentwarehouse/v1/rule_set_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_RULE_SET_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_RULE_SET_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/contentwarehouse/v1/ruleset_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/contentwarehouse/v1/synonym_set_connection.h b/google/cloud/contentwarehouse/v1/synonym_set_connection.h index b0c06ffe7f4e0..3d06ac29d8f3a 100644 --- a/google/cloud/contentwarehouse/v1/synonym_set_connection.h +++ b/google/cloud/contentwarehouse/v1/synonym_set_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/contentwarehouse/v1/internal/synonym_set_retry_traits.h" #include "google/cloud/contentwarehouse/v1/synonym_set_connection_idempotency_policy.h" +#include "google/cloud/contentwarehouse/v1/synonymset_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 #include namespace google { diff --git a/google/cloud/contentwarehouse/v1/synonym_set_connection_idempotency_policy.h b/google/cloud/contentwarehouse/v1/synonym_set_connection_idempotency_policy.h index 05e669f491467..41b4aaf313a6d 100644 --- a/google/cloud/contentwarehouse/v1/synonym_set_connection_idempotency_policy.h +++ b/google/cloud/contentwarehouse/v1/synonym_set_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_SYNONYM_SET_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONTENTWAREHOUSE_V1_SYNONYM_SET_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/contentwarehouse/v1/synonymset_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/credentials.cc b/google/cloud/credentials.cc index bd7d2c2be7c8b..69a757c62b2ea 100644 --- a/google/cloud/credentials.cc +++ b/google/cloud/credentials.cc @@ -48,7 +48,13 @@ std::shared_ptr MakeImpersonateServiceAccountCredentials( std::shared_ptr MakeServiceAccountCredentials( std::string json_object, Options opts) { return std::make_shared( - std::move(json_object), std::move(opts)); + std::move(json_object), absl::nullopt, std::move(opts)); +} + +std::shared_ptr MakeServiceAccountCredentialsFromFile( + std::string const& file_path, Options opts) { + return std::make_shared( + absl::nullopt, file_path, std::move(opts)); } std::shared_ptr MakeExternalAccountCredentials( diff --git a/google/cloud/credentials.h b/google/cloud/credentials.h index 93166067d1974..29c884c38d640 100644 --- a/google/cloud/credentials.h +++ b/google/cloud/credentials.h @@ -301,6 +301,64 @@ std::shared_ptr MakeImpersonateServiceAccountCredentials( std::shared_ptr MakeServiceAccountCredentials( std::string json_object, Options opts = {}); +/** + * Creates service account credentials from a service account key contained in + * a file. + * + * A [service account] is an account for an application or compute workload + * instead of an individual end user. The recommended practice is to use + * Google Default Credentials, which relies on the configuration of the Google + * Cloud system hosting your application (GCE, GKE, Cloud Run) to authenticate + * your workload or application. But sometimes you may need to create and + * download a [service account key], for example, to use a service account + * when running your application on a system that is not part of Google Cloud. + * + * Service account credentials are used in this latter case. + * + * You can create multiple service account keys for a single service account. + * When you create a service account key, the key is returned as string, in the + * format described by [aip/4112]. This string contains an id for the service + * account, as well as the cryptographical materials (a RSA private key) + * required to authenticate the caller. + * + * Therefore, services account keys should be treated as any other secret + * with security implications. Think of them as unencrypted passwords. Do not + * store them where unauthorized persons or programs may read them. + * + * As stated above, most applications should probably use default credentials, + * maybe pointing them to a file with these contents. Using this function may be + * useful when the service account key is obtained from Cloud Secret Manager or + * a similar service. + * + * [aip/4112]: https://google.aip.dev/auth/4112 + * [service account]: https://cloud.google.com/iam/docs/overview#service_account + * [service account key]: + * https://cloud.google.com/iam/docs/creating-managing-service-account-keys#iam-service-account-keys-create-cpp + * + * Use `ScopesOption` to restrict the authentication scope for the obtained + * credentials. + * + * @ingroup guac + * + * @note While JSON file formats are supported for both REST and gRPC transport, + * PKCS#12 is only supported for REST transport. + * + * @param file_path path to file containing the service account key + * Typically applications read this from a file, or download the contents from + * something like Google's secret manager service. + * @param opts optional configuration values. + * + * `ScopesOption` the scopes to request during the authorization grant. If + * omitted, the cloud-platform scope, defined by + * `GoogleOAuthScopeCloudPlatform()`, is used as a default. + * `SubjectOption` for domain-wide delegation; the email address of the user for + * which to request delegated access. If omitted AND no "subject" is defined + * in the provided file, no "subject" attribute is included in the + * authorization grant. + */ +std::shared_ptr MakeServiceAccountCredentialsFromFile( + std::string const& file_path, Options opts = {}); + /** * Creates credentials based on external accounts. * @@ -406,7 +464,9 @@ struct DelegatesOption { }; /** - * Configure the scopes for `MakeImpersonateServiceAccountCredentials()` + * Configure the scopes for `MakeImpersonateServiceAccountCredentials()`. + * Override the scopes for `MakeServiceAccountCredentials` and + * `MakeServiceAccountCredentialsFromFile()`. * * @ingroup options * @ingroup guac @@ -415,6 +475,17 @@ struct ScopesOption { using Type = std::vector; }; +/** + * Overrides the subject for `MakeServiceAccountCredentials` and + * `MakeServiceAccountCredentialsFromFile()`. + * + * @ingroup options + * @ingroup guac + */ +struct SubjectOption { + using Type = std::string; +}; + /** * Configure the access token lifetime * diff --git a/google/cloud/datacatalog/BUILD.bazel b/google/cloud/datacatalog/BUILD.bazel index a74b7443c852f..10cd1d1e5138b 100644 --- a/google/cloud/datacatalog/BUILD.bazel +++ b/google/cloud/datacatalog/BUILD.bazel @@ -19,14 +19,15 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", + "lineage/configmanagement/v1/", "lineage/v1/", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/datacatalog/lineage/v1:lineage_cc_grpc", - "@com_google_googleapis//google/cloud/datacatalog/v1:datacatalog_cc_grpc", + "@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", ] cc_gapic_library( diff --git a/google/cloud/datacatalog/CMakeLists.txt b/google/cloud/datacatalog/CMakeLists.txt index b4d7349a95348..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 "__EMPTY__" "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/data_catalog_client.h b/google/cloud/datacatalog/data_catalog_client.h deleted file mode 100644 index 15b940e0e6713..0000000000000 --- a/google/cloud/datacatalog/data_catalog_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/datacatalog.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_DATA_CATALOG_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_DATA_CATALOG_CLIENT_H - -#include "google/cloud/datacatalog/data_catalog_connection.h" -#include "google/cloud/datacatalog/v1/data_catalog_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in datacatalog_v1 instead of the aliases defined in -/// this namespace. -namespace datacatalog { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datacatalog_v1::DataCatalogClient directly. -using ::google::cloud::datacatalog_v1::DataCatalogClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_DATA_CATALOG_CLIENT_H diff --git a/google/cloud/datacatalog/data_catalog_connection.h b/google/cloud/datacatalog/data_catalog_connection.h deleted file mode 100644 index 8c475a57951c9..0000000000000 --- a/google/cloud/datacatalog/data_catalog_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/datacatalog.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_DATA_CATALOG_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_DATA_CATALOG_CONNECTION_H - -#include "google/cloud/datacatalog/data_catalog_connection_idempotency_policy.h" -#include "google/cloud/datacatalog/v1/data_catalog_connection.h" - -namespace google { -namespace cloud { -namespace datacatalog { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datacatalog_v1::MakeDataCatalogConnection directly. -using ::google::cloud::datacatalog_v1::MakeDataCatalogConnection; - -/// @deprecated Use datacatalog_v1::DataCatalogConnection directly. -using ::google::cloud::datacatalog_v1::DataCatalogConnection; - -/// @deprecated Use datacatalog_v1::DataCatalogLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::datacatalog_v1::DataCatalogLimitedErrorCountRetryPolicy; - -/// @deprecated Use datacatalog_v1::DataCatalogLimitedTimeRetryPolicy directly. -using ::google::cloud::datacatalog_v1::DataCatalogLimitedTimeRetryPolicy; - -/// @deprecated Use datacatalog_v1::DataCatalogRetryPolicy directly. -using ::google::cloud::datacatalog_v1::DataCatalogRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_DATA_CATALOG_CONNECTION_H diff --git a/google/cloud/datacatalog/data_catalog_connection_idempotency_policy.h b/google/cloud/datacatalog/data_catalog_connection_idempotency_policy.h deleted file mode 100644 index 25b4a013ba3c1..0000000000000 --- a/google/cloud/datacatalog/data_catalog_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/datacatalog.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_DATA_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_DATA_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/datacatalog/v1/data_catalog_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace datacatalog { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// datacatalog_v1::MakeDefaultDataCatalogConnectionIdempotencyPolicy directly. -using ::google::cloud::datacatalog_v1:: - MakeDefaultDataCatalogConnectionIdempotencyPolicy; - -/// @deprecated Use datacatalog_v1::DataCatalogConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::datacatalog_v1::DataCatalogConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_DATA_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/datacatalog/data_catalog_options.h b/google/cloud/datacatalog/data_catalog_options.h deleted file mode 100644 index 6bb9d41b0247a..0000000000000 --- a/google/cloud/datacatalog/data_catalog_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/datacatalog.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_DATA_CATALOG_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_DATA_CATALOG_OPTIONS_H - -#include "google/cloud/datacatalog/data_catalog_connection.h" -#include "google/cloud/datacatalog/data_catalog_connection_idempotency_policy.h" -#include "google/cloud/datacatalog/v1/data_catalog_options.h" - -namespace google { -namespace cloud { -namespace datacatalog { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datacatalog_v1::DataCatalogPollingPolicyOption directly. -using ::google::cloud::datacatalog_v1::DataCatalogPollingPolicyOption; - -/// @deprecated Use datacatalog_v1::DataCatalogBackoffPolicyOption directly. -using ::google::cloud::datacatalog_v1::DataCatalogBackoffPolicyOption; - -/// @deprecated Use datacatalog_v1::DataCatalogConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::datacatalog_v1:: - DataCatalogConnectionIdempotencyPolicyOption; - -/// @deprecated Use datacatalog_v1::DataCatalogPolicyOptionList directly. -using ::google::cloud::datacatalog_v1::DataCatalogPolicyOptionList; - -/// @deprecated Use datacatalog_v1::DataCatalogRetryPolicyOption directly. -using ::google::cloud::datacatalog_v1::DataCatalogRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_DATA_CATALOG_OPTIONS_H 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/internal/lineage_auth_decorator.cc b/google/cloud/datacatalog/lineage/v1/internal/lineage_auth_decorator.cc index f599e0e94e085..c434a5913ade8 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_auth_decorator.cc +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/datacatalog/lineage/v1/lineage.proto #include "google/cloud/datacatalog/lineage/v1/internal/lineage_auth_decorator.h" -#include +#include "google/cloud/datacatalog/lineage/v1/lineage.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_lineage_v1_internal { @@ -303,3 +306,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_lineage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_auth_decorator.h b/google/cloud/datacatalog/lineage/v1/internal/lineage_auth_decorator.h index 0cc484afb1941..731968c145d83 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_auth_decorator.h +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datacatalog/lineage/v1/internal/lineage_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 datacatalog_lineage_v1_internal { @@ -184,4 +187,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_V1_INTERNAL_LINEAGE_AUTH_DECORATOR_H diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_connection_impl.h b/google/cloud/datacatalog/lineage/v1/internal/lineage_connection_impl.h index baa52e9b49665..11eeedc039213 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_connection_impl.h +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_logging_decorator.cc b/google/cloud/datacatalog/lineage/v1/internal/lineage_logging_decorator.cc index f9e9269144195..edf839eda5557 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_logging_decorator.cc +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/datacatalog/lineage/v1/lineage.proto #include "google/cloud/datacatalog/lineage/v1/internal/lineage_logging_decorator.h" +#include "google/cloud/datacatalog/lineage/v1/lineage.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_lineage_v1_internal { @@ -391,3 +394,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_lineage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_logging_decorator.h b/google/cloud/datacatalog/lineage/v1/internal/lineage_logging_decorator.h index 419139faa9b8b..b56ea9dc265e3 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_logging_decorator.h +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datacatalog/lineage/v1/internal/lineage_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 datacatalog_lineage_v1_internal { @@ -184,4 +187,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_V1_INTERNAL_LINEAGE_LOGGING_DECORATOR_H diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_metadata_decorator.cc b/google/cloud/datacatalog/lineage/v1/internal/lineage_metadata_decorator.cc index dc5f60ecd18c9..a9c3441524fb6 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_metadata_decorator.cc +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/datacatalog/lineage/v1/lineage.proto #include "google/cloud/datacatalog/lineage/v1/internal/lineage_metadata_decorator.h" +#include "google/cloud/datacatalog/lineage/v1/lineage.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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_v1_internal { @@ -306,3 +310,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_lineage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_metadata_decorator.h b/google/cloud/datacatalog/lineage/v1/internal/lineage_metadata_decorator.h index d8981eb24fb4e..0c5b0934040d4 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_metadata_decorator.h +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datacatalog/lineage/v1/internal/lineage_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 datacatalog_lineage_v1_internal { @@ -189,4 +192,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_V1_INTERNAL_LINEAGE_METADATA_DECORATOR_H diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_option_defaults.cc b/google/cloud/datacatalog/lineage/v1/internal/lineage_option_defaults.cc index 241a4375df96b..b884461d0b575 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_option_defaults.cc +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_option_defaults.cc @@ -41,7 +41,7 @@ Options LineageDefaultOptions(Options options) { if (!options.has()) { options.set( datacatalog_lineage_v1::LineageLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_stub.cc b/google/cloud/datacatalog/lineage/v1/internal/lineage_stub.cc index 467d84a47a7d9..28e1d78959874 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_stub.cc +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/datacatalog/lineage/v1/lineage.proto #include "google/cloud/datacatalog/lineage/v1/internal/lineage_stub.h" +#include "google/cloud/datacatalog/lineage/v1/lineage.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#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_v1_internal { @@ -377,3 +380,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_lineage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_stub.h b/google/cloud/datacatalog/lineage/v1/internal/lineage_stub.h index 4a202cfdc2312..a6811ca047ec3 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_stub.h +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_V1_INTERNAL_LINEAGE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_V1_INTERNAL_LINEAGE_STUB_H +#include "google/cloud/datacatalog/lineage/v1/lineage.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 -#include +#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_v1_internal { @@ -337,4 +340,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_V1_INTERNAL_LINEAGE_STUB_H diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_stub_factory.cc b/google/cloud/datacatalog/lineage/v1/internal/lineage_stub_factory.cc index 4572c83e58e00..27e718084692f 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_stub_factory.cc +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/datacatalog/lineage/v1/internal/lineage_metadata_decorator.h" #include "google/cloud/datacatalog/lineage/v1/internal/lineage_stub.h" #include "google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_stub.h" +#include "google/cloud/datacatalog/lineage/v1/lineage.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 -#include +#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_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_lineage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_stub_factory.h b/google/cloud/datacatalog/lineage/v1/internal/lineage_stub_factory.h index 1e5aed97b248a..9856a9ce91dfd 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_stub_factory.h +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_lineage_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_V1_INTERNAL_LINEAGE_STUB_FACTORY_H diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_connection.cc b/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_connection.cc index a4b196313f0f3..6b10058914afa 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_connection.cc +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace datacatalog_lineage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LineageTracingConnection::LineageTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -282,16 +280,12 @@ Status LineageTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLineageTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_connection.h b/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_connection.h index 2f22589aaed79..5a8c7adae6d3c 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_connection.h +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace datacatalog_lineage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LineageTracingConnection : public datacatalog_lineage_v1::LineageConnection { public: @@ -147,8 +145,6 @@ class LineageTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_stub.cc b/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_stub.cc index 81b5722aa09b8..9a3186cd4ceb9 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_stub.cc +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_lineage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LineageTracingStub::LineageTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -351,18 +352,14 @@ future LineageTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLineageTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_lineage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_stub.h b/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_stub.h index a8d99d6fd2115..7abe8cec882c6 100644 --- a/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_stub.h +++ b/google/cloud/datacatalog/lineage/v1/internal/lineage_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_lineage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LineageTracingStub : public LineageStub { public: ~LineageTracingStub() override = default; @@ -179,8 +180,6 @@ class LineageTracingStub : public LineageStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -195,4 +194,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_V1_INTERNAL_LINEAGE_TRACING_STUB_H diff --git a/google/cloud/datacatalog/lineage/v1/lineage_client.h b/google/cloud/datacatalog/lineage/v1/lineage_client.h index b944fb1648022..bb1a12b16551e 100644 --- a/google/cloud/datacatalog/lineage/v1/lineage_client.h +++ b/google/cloud/datacatalog/lineage/v1/lineage_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/lineage/v1/lineage_connection.h b/google/cloud/datacatalog/lineage/v1/lineage_connection.h index 446363fc6616a..eff6d33e8eabc 100644 --- a/google/cloud/datacatalog/lineage/v1/lineage_connection.h +++ b/google/cloud/datacatalog/lineage/v1/lineage_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_V1_LINEAGE_CONNECTION_H #include "google/cloud/datacatalog/lineage/v1/internal/lineage_retry_traits.h" +#include "google/cloud/datacatalog/lineage/v1/lineage.pb.h" #include "google/cloud/datacatalog/lineage/v1/lineage_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datacatalog/lineage/v1/lineage_connection_idempotency_policy.h b/google/cloud/datacatalog/lineage/v1/lineage_connection_idempotency_policy.h index 7140a000c207c..92baca262b953 100644 --- a/google/cloud/datacatalog/lineage/v1/lineage_connection_idempotency_policy.h +++ b/google/cloud/datacatalog/lineage/v1/lineage_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_V1_LINEAGE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_V1_LINEAGE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/datacatalog/lineage/v1/lineage.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datacatalog/mocks/mock_data_catalog_connection.h b/google/cloud/datacatalog/mocks/mock_data_catalog_connection.h deleted file mode 100644 index 0aae3a14df6b7..0000000000000 --- a/google/cloud/datacatalog/mocks/mock_data_catalog_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/datacatalog.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_MOCKS_MOCK_DATA_CATALOG_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_MOCKS_MOCK_DATA_CATALOG_CONNECTION_H - -#include "google/cloud/datacatalog/data_catalog_connection.h" -#include "google/cloud/datacatalog/v1/mocks/mock_data_catalog_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in datacatalog_v1_mocks instead of the aliases -/// defined in this namespace. -namespace datacatalog_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datacatalog_v1_mocks::MockDataCatalogConnection directly. -using ::google::cloud::datacatalog_v1_mocks::MockDataCatalogConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_MOCKS_MOCK_DATA_CATALOG_CONNECTION_H diff --git a/google/cloud/datacatalog/mocks/mock_policy_tag_manager_connection.h b/google/cloud/datacatalog/mocks/mock_policy_tag_manager_connection.h deleted file mode 100644 index 528f997ae60c2..0000000000000 --- a/google/cloud/datacatalog/mocks/mock_policy_tag_manager_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/policytagmanager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_MOCKS_MOCK_POLICY_TAG_MANAGER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_MOCKS_MOCK_POLICY_TAG_MANAGER_CONNECTION_H - -#include "google/cloud/datacatalog/policy_tag_manager_connection.h" -#include "google/cloud/datacatalog/v1/mocks/mock_policy_tag_manager_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in datacatalog_v1_mocks instead of the aliases -/// defined in this namespace. -namespace datacatalog_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datacatalog_v1_mocks::MockPolicyTagManagerConnection -/// directly. -using ::google::cloud::datacatalog_v1_mocks::MockPolicyTagManagerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_MOCKS_MOCK_POLICY_TAG_MANAGER_CONNECTION_H diff --git a/google/cloud/datacatalog/mocks/mock_policy_tag_manager_serialization_connection.h b/google/cloud/datacatalog/mocks/mock_policy_tag_manager_serialization_connection.h deleted file mode 100644 index 5b22812dd5a08..0000000000000 --- a/google/cloud/datacatalog/mocks/mock_policy_tag_manager_serialization_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/policytagmanagerserialization.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_MOCKS_MOCK_POLICY_TAG_MANAGER_SERIALIZATION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_MOCKS_MOCK_POLICY_TAG_MANAGER_SERIALIZATION_CONNECTION_H - -#include "google/cloud/datacatalog/policy_tag_manager_serialization_connection.h" -#include "google/cloud/datacatalog/v1/mocks/mock_policy_tag_manager_serialization_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in datacatalog_v1_mocks instead of the aliases -/// defined in this namespace. -namespace datacatalog_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// datacatalog_v1_mocks::MockPolicyTagManagerSerializationConnection directly. -using ::google::cloud::datacatalog_v1_mocks:: - MockPolicyTagManagerSerializationConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_MOCKS_MOCK_POLICY_TAG_MANAGER_SERIALIZATION_CONNECTION_H diff --git a/google/cloud/datacatalog/policy_tag_manager_client.h b/google/cloud/datacatalog/policy_tag_manager_client.h deleted file mode 100644 index 27cad84c2632d..0000000000000 --- a/google/cloud/datacatalog/policy_tag_manager_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/policytagmanager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_CLIENT_H - -#include "google/cloud/datacatalog/policy_tag_manager_connection.h" -#include "google/cloud/datacatalog/v1/policy_tag_manager_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in datacatalog_v1 instead of the aliases defined in -/// this namespace. -namespace datacatalog { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datacatalog_v1::PolicyTagManagerClient directly. -using ::google::cloud::datacatalog_v1::PolicyTagManagerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_CLIENT_H diff --git a/google/cloud/datacatalog/policy_tag_manager_connection.h b/google/cloud/datacatalog/policy_tag_manager_connection.h deleted file mode 100644 index 5e49928394ea5..0000000000000 --- a/google/cloud/datacatalog/policy_tag_manager_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/policytagmanager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_CONNECTION_H - -#include "google/cloud/datacatalog/policy_tag_manager_connection_idempotency_policy.h" -#include "google/cloud/datacatalog/v1/policy_tag_manager_connection.h" - -namespace google { -namespace cloud { -namespace datacatalog { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datacatalog_v1::MakePolicyTagManagerConnection directly. -using ::google::cloud::datacatalog_v1::MakePolicyTagManagerConnection; - -/// @deprecated Use datacatalog_v1::PolicyTagManagerConnection directly. -using ::google::cloud::datacatalog_v1::PolicyTagManagerConnection; - -/// @deprecated Use datacatalog_v1::PolicyTagManagerLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::datacatalog_v1:: - PolicyTagManagerLimitedErrorCountRetryPolicy; - -/// @deprecated Use datacatalog_v1::PolicyTagManagerLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::datacatalog_v1::PolicyTagManagerLimitedTimeRetryPolicy; - -/// @deprecated Use datacatalog_v1::PolicyTagManagerRetryPolicy directly. -using ::google::cloud::datacatalog_v1::PolicyTagManagerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_CONNECTION_H diff --git a/google/cloud/datacatalog/policy_tag_manager_connection_idempotency_policy.h b/google/cloud/datacatalog/policy_tag_manager_connection_idempotency_policy.h deleted file mode 100644 index c18a7f71447c2..0000000000000 --- a/google/cloud/datacatalog/policy_tag_manager_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/policytagmanager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/datacatalog/v1/policy_tag_manager_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace datacatalog { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// datacatalog_v1::MakeDefaultPolicyTagManagerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::datacatalog_v1:: - MakeDefaultPolicyTagManagerConnectionIdempotencyPolicy; - -/// @deprecated Use datacatalog_v1::PolicyTagManagerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::datacatalog_v1:: - PolicyTagManagerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/datacatalog/policy_tag_manager_options.h b/google/cloud/datacatalog/policy_tag_manager_options.h deleted file mode 100644 index d8f7c18f42ba2..0000000000000 --- a/google/cloud/datacatalog/policy_tag_manager_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/policytagmanager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_OPTIONS_H - -#include "google/cloud/datacatalog/policy_tag_manager_connection.h" -#include "google/cloud/datacatalog/policy_tag_manager_connection_idempotency_policy.h" -#include "google/cloud/datacatalog/v1/policy_tag_manager_options.h" - -namespace google { -namespace cloud { -namespace datacatalog { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datacatalog_v1::PolicyTagManagerBackoffPolicyOption -/// directly. -using ::google::cloud::datacatalog_v1::PolicyTagManagerBackoffPolicyOption; - -/// @deprecated Use -/// datacatalog_v1::PolicyTagManagerConnectionIdempotencyPolicyOption directly. -using ::google::cloud::datacatalog_v1:: - PolicyTagManagerConnectionIdempotencyPolicyOption; - -/// @deprecated Use datacatalog_v1::PolicyTagManagerPolicyOptionList directly. -using ::google::cloud::datacatalog_v1::PolicyTagManagerPolicyOptionList; - -/// @deprecated Use datacatalog_v1::PolicyTagManagerRetryPolicyOption directly. -using ::google::cloud::datacatalog_v1::PolicyTagManagerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_OPTIONS_H diff --git a/google/cloud/datacatalog/policy_tag_manager_serialization_client.h b/google/cloud/datacatalog/policy_tag_manager_serialization_client.h deleted file mode 100644 index 5f2bac534fe20..0000000000000 --- a/google/cloud/datacatalog/policy_tag_manager_serialization_client.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/policytagmanagerserialization.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_SERIALIZATION_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_SERIALIZATION_CLIENT_H - -#include "google/cloud/datacatalog/policy_tag_manager_serialization_connection.h" -#include "google/cloud/datacatalog/v1/policy_tag_manager_serialization_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in datacatalog_v1 instead of the aliases defined in -/// this namespace. -namespace datacatalog { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datacatalog_v1::PolicyTagManagerSerializationClient -/// directly. -using ::google::cloud::datacatalog_v1::PolicyTagManagerSerializationClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_SERIALIZATION_CLIENT_H diff --git a/google/cloud/datacatalog/policy_tag_manager_serialization_connection.h b/google/cloud/datacatalog/policy_tag_manager_serialization_connection.h deleted file mode 100644 index bc2440632f89c..0000000000000 --- a/google/cloud/datacatalog/policy_tag_manager_serialization_connection.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/policytagmanagerserialization.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_SERIALIZATION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_SERIALIZATION_CONNECTION_H - -#include "google/cloud/datacatalog/policy_tag_manager_serialization_connection_idempotency_policy.h" -#include "google/cloud/datacatalog/v1/policy_tag_manager_serialization_connection.h" - -namespace google { -namespace cloud { -namespace datacatalog { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datacatalog_v1::MakePolicyTagManagerSerializationConnection -/// directly. -using ::google::cloud::datacatalog_v1:: - MakePolicyTagManagerSerializationConnection; - -/// @deprecated Use datacatalog_v1::PolicyTagManagerSerializationConnection -/// directly. -using ::google::cloud::datacatalog_v1::PolicyTagManagerSerializationConnection; - -/// @deprecated Use -/// datacatalog_v1::PolicyTagManagerSerializationLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::datacatalog_v1:: - PolicyTagManagerSerializationLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// datacatalog_v1::PolicyTagManagerSerializationLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::datacatalog_v1:: - PolicyTagManagerSerializationLimitedTimeRetryPolicy; - -/// @deprecated Use datacatalog_v1::PolicyTagManagerSerializationRetryPolicy -/// directly. -using ::google::cloud::datacatalog_v1::PolicyTagManagerSerializationRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_SERIALIZATION_CONNECTION_H diff --git a/google/cloud/datacatalog/policy_tag_manager_serialization_connection_idempotency_policy.h b/google/cloud/datacatalog/policy_tag_manager_serialization_connection_idempotency_policy.h deleted file mode 100644 index eb29b0933339d..0000000000000 --- a/google/cloud/datacatalog/policy_tag_manager_serialization_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/policytagmanagerserialization.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_SERIALIZATION_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_SERIALIZATION_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/datacatalog/v1/policy_tag_manager_serialization_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace datacatalog { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// datacatalog_v1::MakeDefaultPolicyTagManagerSerializationConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::datacatalog_v1:: - MakeDefaultPolicyTagManagerSerializationConnectionIdempotencyPolicy; - -/// @deprecated Use -/// datacatalog_v1::PolicyTagManagerSerializationConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::datacatalog_v1:: - PolicyTagManagerSerializationConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_SERIALIZATION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/datacatalog/policy_tag_manager_serialization_options.h b/google/cloud/datacatalog/policy_tag_manager_serialization_options.h deleted file mode 100644 index 95bf790320221..0000000000000 --- a/google/cloud/datacatalog/policy_tag_manager_serialization_options.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/v1/policytagmanagerserialization.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_SERIALIZATION_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_SERIALIZATION_OPTIONS_H - -#include "google/cloud/datacatalog/policy_tag_manager_serialization_connection.h" -#include "google/cloud/datacatalog/policy_tag_manager_serialization_connection_idempotency_policy.h" -#include "google/cloud/datacatalog/v1/policy_tag_manager_serialization_options.h" - -namespace google { -namespace cloud { -namespace datacatalog { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// datacatalog_v1::PolicyTagManagerSerializationBackoffPolicyOption directly. -using ::google::cloud::datacatalog_v1:: - PolicyTagManagerSerializationBackoffPolicyOption; - -/// @deprecated Use -/// datacatalog_v1::PolicyTagManagerSerializationConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::datacatalog_v1:: - PolicyTagManagerSerializationConnectionIdempotencyPolicyOption; - -/// @deprecated Use -/// datacatalog_v1::PolicyTagManagerSerializationPolicyOptionList directly. -using ::google::cloud::datacatalog_v1:: - PolicyTagManagerSerializationPolicyOptionList; - -/// @deprecated Use -/// datacatalog_v1::PolicyTagManagerSerializationRetryPolicyOption directly. -using ::google::cloud::datacatalog_v1:: - PolicyTagManagerSerializationRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datacatalog -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_POLICY_TAG_MANAGER_SERIALIZATION_OPTIONS_H diff --git a/google/cloud/datacatalog/quickstart/.bazelrc b/google/cloud/datacatalog/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/datacatalog/quickstart/.bazelrc +++ b/google/cloud/datacatalog/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/datacatalog/quickstart/CMakeLists.txt index cf40943ded865..1ca8f16d8f765 100644 --- a/google/cloud/datacatalog/quickstart/CMakeLists.txt +++ b/google/cloud/datacatalog/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Google Cloud Data Catalog API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-datacatalog-quickstart CXX) find_package(google_cloud_cpp_datacatalog REQUIRED) diff --git a/google/cloud/datacatalog/quickstart/WORKSPACE.bazel b/google/cloud/datacatalog/quickstart/WORKSPACE.bazel index 7521cec70389e..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 = "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/datacatalog/v1/data_catalog_client.h b/google/cloud/datacatalog/v1/data_catalog_client.h index 248ba7592868b..020f7c2e81c6a 100644 --- a/google/cloud/datacatalog/v1/data_catalog_client.h +++ b/google/cloud/datacatalog/v1/data_catalog_client.h @@ -28,7 +28,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/data_catalog_connection.h b/google/cloud/datacatalog/v1/data_catalog_connection.h index 1f4eff41b8ee2..3344cb0986954 100644 --- a/google/cloud/datacatalog/v1/data_catalog_connection.h +++ b/google/cloud/datacatalog/v1/data_catalog_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_DATA_CATALOG_CONNECTION_H #include "google/cloud/datacatalog/v1/data_catalog_connection_idempotency_policy.h" +#include "google/cloud/datacatalog/v1/datacatalog.pb.h" #include "google/cloud/datacatalog/v1/internal/data_catalog_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datacatalog/v1/data_catalog_connection_idempotency_policy.h b/google/cloud/datacatalog/v1/data_catalog_connection_idempotency_policy.h index f275e053522c5..aa45df7d659fb 100644 --- a/google/cloud/datacatalog/v1/data_catalog_connection_idempotency_policy.h +++ b/google/cloud/datacatalog/v1/data_catalog_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_DATA_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_DATA_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/datacatalog/v1/datacatalog.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_auth_decorator.cc b/google/cloud/datacatalog/v1/internal/data_catalog_auth_decorator.cc index d1a1c566bd0a7..2a0a7a402cf5f 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_auth_decorator.cc +++ b/google/cloud/datacatalog/v1/internal/data_catalog_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/datacatalog/v1/datacatalog.proto #include "google/cloud/datacatalog/v1/internal/data_catalog_auth_decorator.h" -#include +#include "google/cloud/datacatalog/v1/datacatalog.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -468,3 +471,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_auth_decorator.h b/google/cloud/datacatalog/v1/internal/data_catalog_auth_decorator.h index 200ef12b5a137..1f17ff9e0ccda 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_auth_decorator.h +++ b/google/cloud/datacatalog/v1/internal/data_catalog_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datacatalog/v1/internal/data_catalog_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 datacatalog_v1_internal { @@ -270,4 +273,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_DATA_CATALOG_AUTH_DECORATOR_H diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_connection_impl.h b/google/cloud/datacatalog/v1/internal/data_catalog_connection_impl.h index da29c5e4be240..6b664f8a86ece 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_connection_impl.h +++ b/google/cloud/datacatalog/v1/internal/data_catalog_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_logging_decorator.cc b/google/cloud/datacatalog/v1/internal/data_catalog_logging_decorator.cc index dbb0359020a45..f79676d8d9ddd 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_logging_decorator.cc +++ b/google/cloud/datacatalog/v1/internal/data_catalog_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/datacatalog/v1/datacatalog.proto #include "google/cloud/datacatalog/v1/internal/data_catalog_logging_decorator.h" +#include "google/cloud/datacatalog/v1/datacatalog.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -625,3 +628,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_logging_decorator.h b/google/cloud/datacatalog/v1/internal/data_catalog_logging_decorator.h index 83db5b8695a2f..7da8b1d623261 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_logging_decorator.h +++ b/google/cloud/datacatalog/v1/internal/data_catalog_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datacatalog/v1/internal/data_catalog_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 datacatalog_v1_internal { @@ -270,4 +273,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_DATA_CATALOG_LOGGING_DECORATOR_H diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_metadata_decorator.cc b/google/cloud/datacatalog/v1/internal/data_catalog_metadata_decorator.cc index 80c40c24f219b..2c5410ae9ef2a 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_metadata_decorator.cc +++ b/google/cloud/datacatalog/v1/internal/data_catalog_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/datacatalog/v1/datacatalog.proto #include "google/cloud/datacatalog/v1/internal/data_catalog_metadata_decorator.h" +#include "google/cloud/datacatalog/v1/datacatalog.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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_v1_internal { @@ -473,3 +477,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_metadata_decorator.h b/google/cloud/datacatalog/v1/internal/data_catalog_metadata_decorator.h index 16a76e987369a..63f0a2d7611cc 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_metadata_decorator.h +++ b/google/cloud/datacatalog/v1/internal/data_catalog_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datacatalog/v1/internal/data_catalog_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 datacatalog_v1_internal { @@ -275,4 +278,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_DATA_CATALOG_METADATA_DECORATOR_H diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_option_defaults.cc b/google/cloud/datacatalog/v1/internal/data_catalog_option_defaults.cc index 6477d731725a4..13bbdb4ea11b6 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_option_defaults.cc +++ b/google/cloud/datacatalog/v1/internal/data_catalog_option_defaults.cc @@ -41,7 +41,7 @@ Options DataCatalogDefaultOptions(Options options) { if (!options.has()) { options.set( datacatalog_v1::DataCatalogLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_stub.cc b/google/cloud/datacatalog/v1/internal/data_catalog_stub.cc index 579418305978c..1f907dd747f18 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_stub.cc +++ b/google/cloud/datacatalog/v1/internal/data_catalog_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/datacatalog/v1/datacatalog.proto #include "google/cloud/datacatalog/v1/internal/data_catalog_stub.h" +#include "google/cloud/datacatalog/v1/datacatalog.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#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_v1_internal { @@ -602,3 +605,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_stub.h b/google/cloud/datacatalog/v1/internal/data_catalog_stub.h index 664df2f51dc72..0e6460339653c 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_stub.h +++ b/google/cloud/datacatalog/v1/internal/data_catalog_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_DATA_CATALOG_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_DATA_CATALOG_STUB_H +#include "google/cloud/datacatalog/v1/datacatalog.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 -#include +#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_v1_internal { @@ -500,4 +503,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_DATA_CATALOG_STUB_H diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_stub_factory.cc b/google/cloud/datacatalog/v1/internal/data_catalog_stub_factory.cc index 0b235bec129f3..86e6750279083 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_stub_factory.cc +++ b/google/cloud/datacatalog/v1/internal/data_catalog_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/datacatalog/v1/datacatalog.proto #include "google/cloud/datacatalog/v1/internal/data_catalog_stub_factory.h" +#include "google/cloud/datacatalog/v1/datacatalog.grpc.pb.h" #include "google/cloud/datacatalog/v1/internal/data_catalog_auth_decorator.h" #include "google/cloud/datacatalog/v1/internal/data_catalog_logging_decorator.h" #include "google/cloud/datacatalog/v1/internal/data_catalog_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#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_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_stub_factory.h b/google/cloud/datacatalog/v1/internal/data_catalog_stub_factory.h index 73384d2f16ead..69269dd1126a0 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_stub_factory.h +++ b/google/cloud/datacatalog/v1/internal/data_catalog_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_DATA_CATALOG_STUB_FACTORY_H diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_tracing_connection.cc b/google/cloud/datacatalog/v1/internal/data_catalog_tracing_connection.cc index 52b877759e810..2e346e6a88c4e 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_tracing_connection.cc +++ b/google/cloud/datacatalog/v1/internal/data_catalog_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace datacatalog_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataCatalogTracingConnection::DataCatalogTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -450,16 +448,12 @@ Status DataCatalogTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataCatalogTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_tracing_connection.h b/google/cloud/datacatalog/v1/internal/data_catalog_tracing_connection.h index 058b061dc472d..5ad0b31269b69 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_tracing_connection.h +++ b/google/cloud/datacatalog/v1/internal/data_catalog_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace datacatalog_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataCatalogTracingConnection : public datacatalog_v1::DataCatalogConnection { public: @@ -212,8 +210,6 @@ class DataCatalogTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_tracing_stub.cc b/google/cloud/datacatalog/v1/internal/data_catalog_tracing_stub.cc index 1513b501f091e..464b85030249c 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_tracing_stub.cc +++ b/google/cloud/datacatalog/v1/internal/data_catalog_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataCatalogTracingStub::DataCatalogTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -578,18 +579,14 @@ future DataCatalogTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataCatalogTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/data_catalog_tracing_stub.h b/google/cloud/datacatalog/v1/internal/data_catalog_tracing_stub.h index dd2d9f58955af..f148e8d7ec1c8 100644 --- a/google/cloud/datacatalog/v1/internal/data_catalog_tracing_stub.h +++ b/google/cloud/datacatalog/v1/internal/data_catalog_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataCatalogTracingStub : public DataCatalogStub { public: ~DataCatalogTracingStub() override = default; @@ -265,8 +266,6 @@ class DataCatalogTracingStub : public DataCatalogStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -281,4 +280,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_DATA_CATALOG_TRACING_STUB_H diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_auth_decorator.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_auth_decorator.cc index bfadd7de1cc6c..2f90e985af585 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_auth_decorator.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/datacatalog/v1/policytagmanager.proto #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_auth_decorator.h" -#include +#include "google/cloud/datacatalog/v1/policytagmanager.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -181,3 +184,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_auth_decorator.h b/google/cloud/datacatalog/v1/internal/policy_tag_manager_auth_decorator.h index 5173c57076629..e67e1c34561c2 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_auth_decorator.h +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -126,4 +129,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_AUTH_DECORATOR_H diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_logging_decorator.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_logging_decorator.cc index 239a8b71f486b..045a67803a472 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_logging_decorator.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/datacatalog/v1/policytagmanager.proto #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_logging_decorator.h" +#include "google/cloud/datacatalog/v1/policytagmanager.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -246,3 +249,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_logging_decorator.h b/google/cloud/datacatalog/v1/internal/policy_tag_manager_logging_decorator.h index 71d9a7d2fdaad..382f25f86f2fa 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_logging_decorator.h +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -126,4 +129,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_LOGGING_DECORATOR_H diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_metadata_decorator.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_metadata_decorator.cc index a6d9b68fb98d2..a9add24af16bd 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_metadata_decorator.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/datacatalog/v1/policytagmanager.proto #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_metadata_decorator.h" +#include "google/cloud/datacatalog/v1/policytagmanager.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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_v1_internal { @@ -212,3 +216,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_metadata_decorator.h b/google/cloud/datacatalog/v1/internal/policy_tag_manager_metadata_decorator.h index 87cc73c88207b..b995d00514548 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_metadata_decorator.h +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -132,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_METADATA_DECORATOR_H diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_option_defaults.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_option_defaults.cc index 16d0ca6eb6d04..89a31d229d0f0 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_option_defaults.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_option_defaults.cc @@ -42,7 +42,7 @@ Options PolicyTagManagerDefaultOptions(Options options) { if (!options.has()) { options.set( datacatalog_v1::PolicyTagManagerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_auth_decorator.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_auth_decorator.cc index bd618b48985ac..21f6d76b06b98 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_auth_decorator.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/datacatalog/v1/policytagmanagerserialization.proto #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_auth_decorator.h" -#include +#include "google/cloud/datacatalog/v1/policytagmanagerserialization.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -96,3 +99,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_auth_decorator.h b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_auth_decorator.h index bab43aac659c5..1857a2510d92f 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_auth_decorator.h +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -82,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_SERIALIZATION_AUTH_DECORATOR_H diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_logging_decorator.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_logging_decorator.cc index 12f75384394f4..0203d9c24f781 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_logging_decorator.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/datacatalog/v1/policytagmanagerserialization.proto #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_logging_decorator.h" +#include "google/cloud/datacatalog/v1/policytagmanagerserialization.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -124,3 +127,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_logging_decorator.h b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_logging_decorator.h index d9d69f2b7c06a..e1919beb0b1cc 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_logging_decorator.h +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -82,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_SERIALIZATION_LOGGING_DECORATOR_H diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_metadata_decorator.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_metadata_decorator.cc index 335f9291d99fb..0e92ec70cb67e 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_metadata_decorator.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/datacatalog/v1/policytagmanagerserialization.proto #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_metadata_decorator.h" +#include "google/cloud/datacatalog/v1/policytagmanagerserialization.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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_v1_internal { @@ -122,3 +126,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_metadata_decorator.h b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_metadata_decorator.h index f881dbc55048e..deed5055119f4 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_metadata_decorator.h +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -88,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_SERIALIZATION_METADATA_DECORATOR_H diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_option_defaults.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_option_defaults.cc index 791511552c51f..2d5b806714090 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_option_defaults.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_option_defaults.cc @@ -44,7 +44,7 @@ Options PolicyTagManagerSerializationDefaultOptions(Options options) { datacatalog_v1::PolicyTagManagerSerializationRetryPolicyOption>()) { options.set( datacatalog_v1::PolicyTagManagerSerializationLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub.cc index 5753a45fd7c69..9fa7822998b38 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/datacatalog/v1/policytagmanagerserialization.proto #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub.h" +#include "google/cloud/datacatalog/v1/policytagmanagerserialization.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -117,3 +120,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub.h b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub.h index 4c1741e577c40..ad5bdd24b597e 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub.h +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_SERIALIZATION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_SERIALIZATION_STUB_H +#include "google/cloud/datacatalog/v1/policytagmanagerserialization.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#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_v1_internal { @@ -128,4 +131,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_SERIALIZATION_STUB_H diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub_factory.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub_factory.cc index 149ec45cb211f..f3ad90dfb60b4 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub_factory.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_metadata_decorator.h" #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub.h" #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_stub.h" +#include "google/cloud/datacatalog/v1/policytagmanagerserialization.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 -#include +#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_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub_factory.h b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub_factory.h index c364f820c0529..2a266f46c663e 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub_factory.h +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_SERIALIZATION_STUB_FACTORY_H diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_connection.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_connection.cc index 3f073c0164763..24add7e974475 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_connection.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace datacatalog_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PolicyTagManagerSerializationTracingConnection:: PolicyTagManagerSerializationTracingConnection( std::shared_ptr @@ -104,18 +102,14 @@ Status PolicyTagManagerSerializationTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePolicyTagManagerSerializationTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_connection.h b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_connection.h index b34793c502b8a..827062633bb94 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_connection.h +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace datacatalog_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PolicyTagManagerSerializationTracingConnection : public datacatalog_v1::PolicyTagManagerSerializationConnection { public: @@ -72,8 +70,6 @@ class PolicyTagManagerSerializationTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_stub.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_stub.cc index 5122c53afee9a..ae1dca6e38835 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_stub.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PolicyTagManagerSerializationTracingStub:: PolicyTagManagerSerializationTracingStub( std::shared_ptr child) @@ -122,20 +123,16 @@ Status PolicyTagManagerSerializationTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePolicyTagManagerSerializationTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_stub.h b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_stub.h index f8396acc2f6e2..ca3861bb9685d 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_stub.h +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PolicyTagManagerSerializationTracingStub : public PolicyTagManagerSerializationStub { public: @@ -79,8 +80,6 @@ class PolicyTagManagerSerializationTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -96,4 +95,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_SERIALIZATION_TRACING_STUB_H diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub.cc index 6046bd327802c..deb6e2ace8af7 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/datacatalog/v1/policytagmanager.proto #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_stub.h" +#include "google/cloud/datacatalog/v1/policytagmanager.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -232,3 +235,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub.h b/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub.h index 5e07f2791840c..118483fc2dde7 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub.h +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_STUB_H +#include "google/cloud/datacatalog/v1/policytagmanager.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#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_v1_internal { @@ -213,4 +216,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_STUB_H diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub_factory.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub_factory.cc index 89bb82319d8b8..32a6831d03fdb 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub_factory.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_metadata_decorator.h" #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_stub.h" #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_stub.h" +#include "google/cloud/datacatalog/v1/policytagmanager.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 -#include +#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_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub_factory.h b/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub_factory.h index 62621cd983056..56afd66c5e914 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub_factory.h +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_STUB_FACTORY_H diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_connection.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_connection.cc index d2f79e86df8e9..a4ac7beb1afb5 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_connection.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace datacatalog_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PolicyTagManagerTracingConnection::PolicyTagManagerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -189,16 +187,12 @@ Status PolicyTagManagerTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePolicyTagManagerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_connection.h b/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_connection.h index 65551da106834..30c44a85a3583 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_connection.h +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace datacatalog_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PolicyTagManagerTracingConnection : public datacatalog_v1::PolicyTagManagerConnection { public: @@ -103,8 +101,6 @@ class PolicyTagManagerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_stub.cc b/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_stub.cc index b1550cdf7374a..f94fb337c3bae 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_stub.cc +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PolicyTagManagerTracingStub::PolicyTagManagerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -230,18 +231,14 @@ Status PolicyTagManagerTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePolicyTagManagerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datacatalog_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_stub.h b/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_stub.h index 78c3c9977137e..3fe8edfb0f6d5 100644 --- a/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_stub.h +++ b/google/cloud/datacatalog/v1/internal/policy_tag_manager_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datacatalog_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PolicyTagManagerTracingStub : public PolicyTagManagerStub { public: ~PolicyTagManagerTracingStub() override = default; @@ -123,8 +124,6 @@ class PolicyTagManagerTracingStub : public PolicyTagManagerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -139,4 +138,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_INTERNAL_POLICY_TAG_MANAGER_TRACING_STUB_H 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_connection.h b/google/cloud/datacatalog/v1/policy_tag_manager_connection.h index 80c0a2873f408..401e5f3a5c271 100644 --- a/google/cloud/datacatalog/v1/policy_tag_manager_connection.h +++ b/google/cloud/datacatalog/v1/policy_tag_manager_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_retry_traits.h" #include "google/cloud/datacatalog/v1/policy_tag_manager_connection_idempotency_policy.h" +#include "google/cloud/datacatalog/v1/policytagmanager.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 #include namespace google { diff --git a/google/cloud/datacatalog/v1/policy_tag_manager_connection_idempotency_policy.h b/google/cloud/datacatalog/v1/policy_tag_manager_connection_idempotency_policy.h index fed5d1f9f4ea3..1b780b3526ee0 100644 --- a/google/cloud/datacatalog/v1/policy_tag_manager_connection_idempotency_policy.h +++ b/google/cloud/datacatalog/v1/policy_tag_manager_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_POLICY_TAG_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_POLICY_TAG_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/datacatalog/v1/policytagmanager.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/datacatalog/v1/policy_tag_manager_serialization_connection.h b/google/cloud/datacatalog/v1/policy_tag_manager_serialization_connection.h index d1c99dfec7d74..6ec50bcf0ef2d 100644 --- a/google/cloud/datacatalog/v1/policy_tag_manager_serialization_connection.h +++ b/google/cloud/datacatalog/v1/policy_tag_manager_serialization_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/datacatalog/v1/internal/policy_tag_manager_serialization_retry_traits.h" #include "google/cloud/datacatalog/v1/policy_tag_manager_serialization_connection_idempotency_policy.h" +#include "google/cloud/datacatalog/v1/policytagmanagerserialization.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 #include namespace google { diff --git a/google/cloud/datacatalog/v1/policy_tag_manager_serialization_connection_idempotency_policy.h b/google/cloud/datacatalog/v1/policy_tag_manager_serialization_connection_idempotency_policy.h index d1877fb198986..7fd3842597c1a 100644 --- a/google/cloud/datacatalog/v1/policy_tag_manager_serialization_connection_idempotency_policy.h +++ b/google/cloud/datacatalog/v1/policy_tag_manager_serialization_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_POLICY_TAG_MANAGER_SERIALIZATION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_V1_POLICY_TAG_MANAGER_SERIALIZATION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/datacatalog/v1/policytagmanagerserialization.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataform/BUILD.bazel b/google/cloud/dataform/BUILD.bazel index 6830f5cbb51b4..7737258985b5f 100644 --- a/google/cloud/dataform/BUILD.bazel +++ b/google/cloud/dataform/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/dataform/v1:dataform_cc_grpc", + "@googleapis//google/cloud/dataform/v1:dataform_cc_grpc", ] cc_gapic_library( 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/CMakeLists.txt b/google/cloud/dataform/quickstart/CMakeLists.txt index be8a1c9c4c448..aa9e72e50fe0b 100644 --- a/google/cloud/dataform/quickstart/CMakeLists.txt +++ b/google/cloud/dataform/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Dataform API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-dataform-quickstart CXX) find_package(google_cloud_cpp_dataform REQUIRED) diff --git a/google/cloud/dataform/quickstart/WORKSPACE.bazel b/google/cloud/dataform/quickstart/WORKSPACE.bazel index b84001eaaea50..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 = "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/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 9d0fa117219c6..f8e4cd3daec9a 100644 --- a/google/cloud/dataform/v1/dataform_connection.h +++ b/google/cloud/dataform/v1/dataform_connection.h @@ -19,15 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFORM_V1_DATAFORM_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFORM_V1_DATAFORM_CONNECTION_H +#include "google/cloud/dataform/v1/dataform.pb.h" #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 +#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 0082bd6b45684..b6b557cc99736 100644 --- a/google/cloud/dataform/v1/dataform_connection_idempotency_policy.h +++ b/google/cloud/dataform/v1/dataform_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFORM_V1_DATAFORM_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFORM_V1_DATAFORM_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataform/v1/dataform.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#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 0e3e3a7300ad4..f37b53ff05815 100644 --- a/google/cloud/dataform/v1/internal/dataform_auth_decorator.cc +++ b/google/cloud/dataform/v1/internal/dataform_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataform/v1/dataform.proto #include "google/cloud/dataform/v1/internal/dataform_auth_decorator.h" -#include +#include "google/cloud/dataform/v1/dataform.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataform_v1_internal { @@ -31,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, @@ -74,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, @@ -516,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, @@ -533,32 +775,78 @@ 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 } // namespace dataform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataform/v1/internal/dataform_auth_decorator.h b/google/cloud/dataform/v1/internal/dataform_auth_decorator.h index b92f9b4c59e2b..163e21427085c 100644 --- a/google/cloud/dataform/v1/internal/dataform_auth_decorator.h +++ b/google/cloud/dataform/v1/internal/dataform_auth_decorator.h @@ -22,10 +22,14 @@ #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 +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataform_v1_internal { @@ -38,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& @@ -63,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, @@ -324,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; @@ -332,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_; @@ -354,4 +491,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFORM_V1_INTERNAL_DATAFORM_AUTH_DECORATOR_H 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 a095eb986e252..733178c8f3274 100644 --- a/google/cloud/dataform/v1/internal/dataform_logging_decorator.cc +++ b/google/cloud/dataform/v1/internal/dataform_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataform/v1/dataform.proto #include "google/cloud/dataform/v1/internal/dataform_logging_decorator.h" +#include "google/cloud/dataform/v1/dataform.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataform_v1_internal { @@ -35,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, @@ -98,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, @@ -731,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, @@ -754,41 +1060,89 @@ 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 } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataform/v1/internal/dataform_logging_decorator.h b/google/cloud/dataform/v1/internal/dataform_logging_decorator.h index 402f63f58596c..42ca59763a375 100644 --- a/google/cloud/dataform/v1/internal/dataform_logging_decorator.h +++ b/google/cloud/dataform/v1/internal/dataform_logging_decorator.h @@ -22,10 +22,14 @@ #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 +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataform_v1_internal { @@ -38,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& @@ -63,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, @@ -324,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; @@ -332,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_; @@ -354,4 +491,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFORM_V1_INTERNAL_DATAFORM_LOGGING_DECORATOR_H diff --git a/google/cloud/dataform/v1/internal/dataform_metadata_decorator.cc b/google/cloud/dataform/v1/internal/dataform_metadata_decorator.cc index f6909febb3c50..c36cc314caa87 100644 --- a/google/cloud/dataform/v1/internal/dataform_metadata_decorator.cc +++ b/google/cloud/dataform/v1/internal/dataform_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataform/v1/dataform.proto #include "google/cloud/dataform/v1/internal/dataform_metadata_decorator.h" +#include "google/cloud/dataform/v1/dataform.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dataform_v1_internal { @@ -44,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, @@ -89,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, @@ -550,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, @@ -567,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, @@ -612,3 +861,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataform/v1/internal/dataform_metadata_decorator.h b/google/cloud/dataform/v1/internal/dataform_metadata_decorator.h index af404da057ba7..a860abff1462c 100644 --- a/google/cloud/dataform/v1/internal/dataform_metadata_decorator.h +++ b/google/cloud/dataform/v1/internal/dataform_metadata_decorator.h @@ -22,10 +22,14 @@ #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 +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataform_v1_internal { @@ -38,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& @@ -63,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, @@ -324,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; @@ -332,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, @@ -359,4 +496,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFORM_V1_INTERNAL_DATAFORM_METADATA_DECORATOR_H diff --git a/google/cloud/dataform/v1/internal/dataform_option_defaults.cc b/google/cloud/dataform/v1/internal/dataform_option_defaults.cc index 000d2ae922f44..d82d5ba6b5ab3 100644 --- a/google/cloud/dataform/v1/internal/dataform_option_defaults.cc +++ b/google/cloud/dataform/v1/internal/dataform_option_defaults.cc @@ -40,7 +40,7 @@ Options DataformDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dataform_v1::DataformLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dataform_v1::DataformLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { @@ -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 14f3779c500ab..a1ad5763c42b6 100644 --- a/google/cloud/dataform/v1/internal/dataform_stub.cc +++ b/google/cloud/dataform/v1/internal/dataform_stub.cc @@ -17,12 +17,16 @@ // source: google/cloud/dataform/v1/dataform.proto #include "google/cloud/dataform/v1/internal/dataform_stub.h" +#include "google/cloud/dataform/v1/dataform.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataform_v1_internal { @@ -30,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&, @@ -89,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&, @@ -698,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&, @@ -721,42 +1019,93 @@ 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 } // namespace dataform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataform/v1/internal/dataform_stub.h b/google/cloud/dataform/v1/internal/dataform_stub.h index 66b69fea33f36..3820e1d1d1f57 100644 --- a/google/cloud/dataform/v1/internal/dataform_stub.h +++ b/google/cloud/dataform/v1/internal/dataform_stub.h @@ -19,15 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFORM_V1_INTERNAL_DATAFORM_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFORM_V1_INTERNAL_DATAFORM_STUB_H +#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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataform_v1_internal { @@ -37,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, @@ -58,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, @@ -325,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, @@ -334,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, @@ -385,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, @@ -646,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; @@ -654,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 @@ -679,4 +946,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFORM_V1_INTERNAL_DATAFORM_STUB_H diff --git a/google/cloud/dataform/v1/internal/dataform_stub_factory.cc b/google/cloud/dataform/v1/internal/dataform_stub_factory.cc index cc2e12d96752e..1e09c9f2e9bd4 100644 --- a/google/cloud/dataform/v1/internal/dataform_stub_factory.cc +++ b/google/cloud/dataform/v1/internal/dataform_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dataform/v1/dataform.proto #include "google/cloud/dataform/v1/internal/dataform_stub_factory.h" +#include "google/cloud/dataform/v1/dataform.grpc.pb.h" #include "google/cloud/dataform/v1/internal/dataform_auth_decorator.h" #include "google/cloud/dataform/v1/internal/dataform_logging_decorator.h" #include "google/cloud/dataform/v1/internal/dataform_metadata_decorator.h" #include "google/cloud/dataform/v1/internal/dataform_stub.h" #include "google/cloud/dataform/v1/internal/dataform_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataform_v1_internal { @@ -46,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)); @@ -74,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataform/v1/internal/dataform_stub_factory.h b/google/cloud/dataform/v1/internal/dataform_stub_factory.h index a252e615daf24..47ccb13b41f88 100644 --- a/google/cloud/dataform/v1/internal/dataform_stub_factory.h +++ b/google/cloud/dataform/v1/internal/dataform_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataform_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFORM_V1_INTERNAL_DATAFORM_STUB_FACTORY_H diff --git a/google/cloud/dataform/v1/internal/dataform_tracing_connection.cc b/google/cloud/dataform/v1/internal/dataform_tracing_connection.cc index a6867e1fa6bbb..574efa2ae3776 100644 --- a/google/cloud/dataform/v1/internal/dataform_tracing_connection.cc +++ b/google/cloud/dataform/v1/internal/dataform_tracing_connection.cc @@ -27,12 +27,215 @@ namespace cloud { namespace dataform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - 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) { @@ -79,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& @@ -553,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) { @@ -573,40 +830,47 @@ 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"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->SetIamPolicy(request)); + 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::GetIamPolicy( - google::iam::v1::GetIamPolicyRequest const& request) { +StatusOr +DataformTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { auto span = - internal::MakeSpan("dataform_v1::DataformConnection::GetIamPolicy"); + internal::MakeSpan("dataform_v1::DataformConnection::GetOperation"); auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->GetIamPolicy(request)); + return internal::EndSpan(*span, child_->GetOperation(request)); } -StatusOr -DataformTracingConnection::TestIamPermissions( - google::iam::v1::TestIamPermissionsRequest const& request) { +Status DataformTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { auto span = - internal::MakeSpan("dataform_v1::DataformConnection::TestIamPermissions"); + internal::MakeSpan("dataform_v1::DataformConnection::DeleteOperation"); auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->TestIamPermissions(request)); + return internal::EndSpan(*span, child_->DeleteOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY +Status DataformTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} std::shared_ptr MakeDataformTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataform/v1/internal/dataform_tracing_connection.h b/google/cloud/dataform/v1/internal/dataform_tracing_connection.h index 15ba1bc4bb1ed..b65f08a26606d 100644 --- a/google/cloud/dataform/v1/internal/dataform_tracing_connection.h +++ b/google/cloud/dataform/v1/internal/dataform_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataformTracingConnection : public dataform_v1::DataformConnection { public: ~DataformTracingConnection() override = default; @@ -39,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; @@ -58,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& @@ -264,27 +360,37 @@ 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_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataform/v1/internal/dataform_tracing_stub.cc b/google/cloud/dataform/v1/internal/dataform_tracing_stub.cc index ceaccdf86123a..774c501fdbfed 100644 --- a/google/cloud/dataform/v1/internal/dataform_tracing_stub.cc +++ b/google/cloud/dataform/v1/internal/dataform_tracing_stub.cc @@ -21,16 +21,236 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - 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, @@ -90,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, @@ -697,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, @@ -720,52 +1000,87 @@ 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)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY +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( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataform_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataform/v1/internal/dataform_tracing_stub.h b/google/cloud/dataform/v1/internal/dataform_tracing_stub.h index 73b48d3c34868..be685cbebf49d 100644 --- a/google/cloud/dataform/v1/internal/dataform_tracing_stub.h +++ b/google/cloud/dataform/v1/internal/dataform_tracing_stub.h @@ -25,19 +25,113 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataform_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataformTracingStub : public DataformStub { public: ~DataformTracingStub() override = default; 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& @@ -63,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, @@ -324,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; @@ -332,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_; @@ -350,8 +484,6 @@ class DataformTracingStub : public DataformStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -366,4 +498,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFORM_V1_INTERNAL_DATAFORM_TRACING_STUB_H 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/BUILD.bazel b/google/cloud/datafusion/BUILD.bazel index e0f625fcaf941..2f17c36f3b050 100644 --- a/google/cloud/datafusion/BUILD.bazel +++ b/google/cloud/datafusion/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/datafusion/v1:datafusion_cc_grpc", + "@googleapis//google/cloud/datafusion/v1:datafusion_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/datafusion/quickstart/.bazelrc b/google/cloud/datafusion/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/datafusion/quickstart/.bazelrc +++ b/google/cloud/datafusion/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/datafusion/quickstart/CMakeLists.txt index 73aea975d1026..7204feeb9f998 100644 --- a/google/cloud/datafusion/quickstart/CMakeLists.txt +++ b/google/cloud/datafusion/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Data Fusion API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-datafusion-quickstart CXX) find_package(google_cloud_cpp_datafusion REQUIRED) diff --git a/google/cloud/datafusion/quickstart/WORKSPACE.bazel b/google/cloud/datafusion/quickstart/WORKSPACE.bazel index 90a333e1c63e1..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 = "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/datafusion/v1/data_fusion_client.h b/google/cloud/datafusion/v1/data_fusion_client.h index e8d1adef95792..78f47a5fe5708 100644 --- a/google/cloud/datafusion/v1/data_fusion_client.h +++ b/google/cloud/datafusion/v1/data_fusion_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/datafusion/v1/data_fusion_connection.h b/google/cloud/datafusion/v1/data_fusion_connection.h index 6dace44ec720d..67ef49ab4892f 100644 --- a/google/cloud/datafusion/v1/data_fusion_connection.h +++ b/google/cloud/datafusion/v1/data_fusion_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFUSION_V1_DATA_FUSION_CONNECTION_H #include "google/cloud/datafusion/v1/data_fusion_connection_idempotency_policy.h" +#include "google/cloud/datafusion/v1/datafusion.pb.h" #include "google/cloud/datafusion/v1/internal/data_fusion_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datafusion/v1/data_fusion_connection_idempotency_policy.h b/google/cloud/datafusion/v1/data_fusion_connection_idempotency_policy.h index 0ca1675580b36..0378e65924c1f 100644 --- a/google/cloud/datafusion/v1/data_fusion_connection_idempotency_policy.h +++ b/google/cloud/datafusion/v1/data_fusion_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFUSION_V1_DATA_FUSION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFUSION_V1_DATA_FUSION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/datafusion/v1/datafusion.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/datafusion/v1/internal/data_fusion_auth_decorator.cc b/google/cloud/datafusion/v1/internal/data_fusion_auth_decorator.cc index d8285e3b368cc..d9a9723ed2783 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_auth_decorator.cc +++ b/google/cloud/datafusion/v1/internal/data_fusion_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/datafusion/v1/datafusion.proto #include "google/cloud/datafusion/v1/internal/data_fusion_auth_decorator.h" -#include +#include "google/cloud/datafusion/v1/datafusion.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datafusion_v1_internal { @@ -210,3 +213,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datafusion_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datafusion/v1/internal/data_fusion_auth_decorator.h b/google/cloud/datafusion/v1/internal/data_fusion_auth_decorator.h index 0895715a7a6b9..aa81f3a0a2b57 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_auth_decorator.h +++ b/google/cloud/datafusion/v1/internal/data_fusion_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datafusion/v1/internal/data_fusion_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 datafusion_v1_internal { @@ -125,4 +128,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFUSION_V1_INTERNAL_DATA_FUSION_AUTH_DECORATOR_H diff --git a/google/cloud/datafusion/v1/internal/data_fusion_connection_impl.h b/google/cloud/datafusion/v1/internal/data_fusion_connection_impl.h index 0ddfa4aedc3c2..95e917d17e3e1 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_connection_impl.h +++ b/google/cloud/datafusion/v1/internal/data_fusion_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datafusion/v1/internal/data_fusion_logging_decorator.cc b/google/cloud/datafusion/v1/internal/data_fusion_logging_decorator.cc index adc84dc4aa6e1..902a70e45bc9d 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_logging_decorator.cc +++ b/google/cloud/datafusion/v1/internal/data_fusion_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/datafusion/v1/datafusion.proto #include "google/cloud/datafusion/v1/internal/data_fusion_logging_decorator.h" +#include "google/cloud/datafusion/v1/datafusion.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datafusion_v1_internal { @@ -237,3 +240,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datafusion_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datafusion/v1/internal/data_fusion_logging_decorator.h b/google/cloud/datafusion/v1/internal/data_fusion_logging_decorator.h index 1d9a19916d891..6285b5d98e66b 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_logging_decorator.h +++ b/google/cloud/datafusion/v1/internal/data_fusion_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datafusion/v1/internal/data_fusion_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 datafusion_v1_internal { @@ -125,4 +128,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFUSION_V1_INTERNAL_DATA_FUSION_LOGGING_DECORATOR_H diff --git a/google/cloud/datafusion/v1/internal/data_fusion_metadata_decorator.cc b/google/cloud/datafusion/v1/internal/data_fusion_metadata_decorator.cc index 24926ccaf78a3..d7d530c9dad40 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_metadata_decorator.cc +++ b/google/cloud/datafusion/v1/internal/data_fusion_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/datafusion/v1/datafusion.proto #include "google/cloud/datafusion/v1/internal/data_fusion_metadata_decorator.h" +#include "google/cloud/datafusion/v1/datafusion.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 datafusion_v1_internal { @@ -194,3 +198,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datafusion_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datafusion/v1/internal/data_fusion_metadata_decorator.h b/google/cloud/datafusion/v1/internal/data_fusion_metadata_decorator.h index 0014b869fbc91..ff95aca0c89ea 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_metadata_decorator.h +++ b/google/cloud/datafusion/v1/internal/data_fusion_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datafusion/v1/internal/data_fusion_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 datafusion_v1_internal { @@ -130,4 +133,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFUSION_V1_INTERNAL_DATA_FUSION_METADATA_DECORATOR_H diff --git a/google/cloud/datafusion/v1/internal/data_fusion_option_defaults.cc b/google/cloud/datafusion/v1/internal/data_fusion_option_defaults.cc index 4e7fc6e93acca..dfcec84cf1367 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_option_defaults.cc +++ b/google/cloud/datafusion/v1/internal/data_fusion_option_defaults.cc @@ -41,7 +41,7 @@ Options DataFusionDefaultOptions(Options options) { if (!options.has()) { options.set( datafusion_v1::DataFusionLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/datafusion/v1/internal/data_fusion_stub.cc b/google/cloud/datafusion/v1/internal/data_fusion_stub.cc index 5f8d35c679980..1e98a2d7de0fc 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_stub.cc +++ b/google/cloud/datafusion/v1/internal/data_fusion_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/datafusion/v1/datafusion.proto #include "google/cloud/datafusion/v1/internal/data_fusion_stub.h" +#include "google/cloud/datafusion/v1/datafusion.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datafusion_v1_internal { @@ -231,3 +234,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datafusion_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datafusion/v1/internal/data_fusion_stub.h b/google/cloud/datafusion/v1/internal/data_fusion_stub.h index 9632710614bc4..3ad65b6412364 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_stub.h +++ b/google/cloud/datafusion/v1/internal/data_fusion_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFUSION_V1_INTERNAL_DATA_FUSION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFUSION_V1_INTERNAL_DATA_FUSION_STUB_H +#include "google/cloud/datafusion/v1/datafusion.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datafusion_v1_internal { @@ -204,4 +207,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFUSION_V1_INTERNAL_DATA_FUSION_STUB_H diff --git a/google/cloud/datafusion/v1/internal/data_fusion_stub_factory.cc b/google/cloud/datafusion/v1/internal/data_fusion_stub_factory.cc index e12249e2c1bcc..f9912f6f1cce8 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_stub_factory.cc +++ b/google/cloud/datafusion/v1/internal/data_fusion_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/datafusion/v1/datafusion.proto #include "google/cloud/datafusion/v1/internal/data_fusion_stub_factory.h" +#include "google/cloud/datafusion/v1/datafusion.grpc.pb.h" #include "google/cloud/datafusion/v1/internal/data_fusion_auth_decorator.h" #include "google/cloud/datafusion/v1/internal/data_fusion_logging_decorator.h" #include "google/cloud/datafusion/v1/internal/data_fusion_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datafusion_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datafusion_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datafusion/v1/internal/data_fusion_stub_factory.h b/google/cloud/datafusion/v1/internal/data_fusion_stub_factory.h index a47ae647857fd..7d7d5f019f6ab 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_stub_factory.h +++ b/google/cloud/datafusion/v1/internal/data_fusion_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datafusion_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFUSION_V1_INTERNAL_DATA_FUSION_STUB_FACTORY_H diff --git a/google/cloud/datafusion/v1/internal/data_fusion_tracing_connection.cc b/google/cloud/datafusion/v1/internal/data_fusion_tracing_connection.cc index 8792fb01f7e48..10cefdecd5782 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_tracing_connection.cc +++ b/google/cloud/datafusion/v1/internal/data_fusion_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace datafusion_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataFusionTracingConnection::DataFusionTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -180,16 +178,12 @@ DataFusionTracingConnection::RestartInstance( return internal::EndSpan(std::move(span), child_->RestartInstance(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataFusionTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/datafusion/v1/internal/data_fusion_tracing_connection.h b/google/cloud/datafusion/v1/internal/data_fusion_tracing_connection.h index 9eb8ab1a3d669..1df8a64f6d73c 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_tracing_connection.h +++ b/google/cloud/datafusion/v1/internal/data_fusion_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace datafusion_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataFusionTracingConnection : public datafusion_v1::DataFusionConnection { public: ~DataFusionTracingConnection() override = default; @@ -102,8 +100,6 @@ class DataFusionTracingConnection : public datafusion_v1::DataFusionConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/datafusion/v1/internal/data_fusion_tracing_stub.cc b/google/cloud/datafusion/v1/internal/data_fusion_tracing_stub.cc index bd0002b7ed9f1..1183f63e97eca 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_tracing_stub.cc +++ b/google/cloud/datafusion/v1/internal/data_fusion_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datafusion_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataFusionTracingStub::DataFusionTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -201,18 +202,14 @@ future DataFusionTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataFusionTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datafusion_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datafusion/v1/internal/data_fusion_tracing_stub.h b/google/cloud/datafusion/v1/internal/data_fusion_tracing_stub.h index 39dc3e4745f72..fbf8ae84f6f7b 100644 --- a/google/cloud/datafusion/v1/internal/data_fusion_tracing_stub.h +++ b/google/cloud/datafusion/v1/internal/data_fusion_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datafusion_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataFusionTracingStub : public DataFusionStub { public: ~DataFusionTracingStub() override = default; @@ -120,8 +121,6 @@ class DataFusionTracingStub : public DataFusionStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -136,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAFUSION_V1_INTERNAL_DATA_FUSION_TRACING_STUB_H diff --git a/google/cloud/datamigration/BUILD.bazel b/google/cloud/datamigration/BUILD.bazel index 2e50d98b52e8b..d4dc162637afc 100644 --- a/google/cloud/datamigration/BUILD.bazel +++ b/google/cloud/datamigration/BUILD.bazel @@ -19,13 +19,12 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/clouddms/logging/v1:logging_cc_grpc", - "@com_google_googleapis//google/cloud/clouddms/v1:clouddms_cc_grpc", + "@googleapis//google/cloud/clouddms/logging/v1:logging_cc_grpc", + "@googleapis//google/cloud/clouddms/v1:clouddms_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/datamigration/CMakeLists.txt b/google/cloud/datamigration/CMakeLists.txt index f8a58f2775cd5..98905df924456 100644 --- a/google/cloud/datamigration/CMakeLists.txt +++ b/google/cloud/datamigration/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(datamigration "Database Migration API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(datamigration_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/datamigration/data_migration_client.h b/google/cloud/datamigration/data_migration_client.h deleted file mode 100644 index 4ddf58b668a24..0000000000000 --- a/google/cloud/datamigration/data_migration_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/clouddms/v1/clouddms.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_DATA_MIGRATION_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_DATA_MIGRATION_CLIENT_H - -#include "google/cloud/datamigration/data_migration_connection.h" -#include "google/cloud/datamigration/v1/data_migration_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in datamigration_v1 instead of the aliases defined in -/// this namespace. -namespace datamigration { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datamigration_v1::DataMigrationServiceClient directly. -using ::google::cloud::datamigration_v1::DataMigrationServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datamigration -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_DATA_MIGRATION_CLIENT_H diff --git a/google/cloud/datamigration/data_migration_connection.h b/google/cloud/datamigration/data_migration_connection.h deleted file mode 100644 index 56e2e5041a5b2..0000000000000 --- a/google/cloud/datamigration/data_migration_connection.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/clouddms/v1/clouddms.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_DATA_MIGRATION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_DATA_MIGRATION_CONNECTION_H - -#include "google/cloud/datamigration/data_migration_connection_idempotency_policy.h" -#include "google/cloud/datamigration/v1/data_migration_connection.h" - -namespace google { -namespace cloud { -namespace datamigration { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datamigration_v1::MakeDataMigrationServiceConnection -/// directly. -using ::google::cloud::datamigration_v1::MakeDataMigrationServiceConnection; - -/// @deprecated Use datamigration_v1::DataMigrationServiceConnection directly. -using ::google::cloud::datamigration_v1::DataMigrationServiceConnection; - -/// @deprecated Use -/// datamigration_v1::DataMigrationServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::datamigration_v1:: - DataMigrationServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use datamigration_v1::DataMigrationServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::datamigration_v1:: - DataMigrationServiceLimitedTimeRetryPolicy; - -/// @deprecated Use datamigration_v1::DataMigrationServiceRetryPolicy directly. -using ::google::cloud::datamigration_v1::DataMigrationServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datamigration -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_DATA_MIGRATION_CONNECTION_H diff --git a/google/cloud/datamigration/data_migration_connection_idempotency_policy.h b/google/cloud/datamigration/data_migration_connection_idempotency_policy.h deleted file mode 100644 index 3105678972b21..0000000000000 --- a/google/cloud/datamigration/data_migration_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/clouddms/v1/clouddms.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_DATA_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_DATA_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/datamigration/v1/data_migration_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace datamigration { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// datamigration_v1::MakeDefaultDataMigrationServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::datamigration_v1:: - MakeDefaultDataMigrationServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// datamigration_v1::DataMigrationServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::datamigration_v1:: - DataMigrationServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datamigration -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_DATA_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/datamigration/data_migration_options.h b/google/cloud/datamigration/data_migration_options.h deleted file mode 100644 index a62307a49afe3..0000000000000 --- a/google/cloud/datamigration/data_migration_options.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/clouddms/v1/clouddms.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_DATA_MIGRATION_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_DATA_MIGRATION_OPTIONS_H - -#include "google/cloud/datamigration/data_migration_connection.h" -#include "google/cloud/datamigration/data_migration_connection_idempotency_policy.h" -#include "google/cloud/datamigration/v1/data_migration_options.h" - -namespace google { -namespace cloud { -namespace datamigration { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datamigration_v1::DataMigrationServicePollingPolicyOption -/// directly. -using ::google::cloud::datamigration_v1:: - DataMigrationServicePollingPolicyOption; - -/// @deprecated Use datamigration_v1::DataMigrationServiceBackoffPolicyOption -/// directly. -using ::google::cloud::datamigration_v1:: - DataMigrationServiceBackoffPolicyOption; - -/// @deprecated Use -/// datamigration_v1::DataMigrationServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::datamigration_v1:: - DataMigrationServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use datamigration_v1::DataMigrationServicePolicyOptionList -/// directly. -using ::google::cloud::datamigration_v1::DataMigrationServicePolicyOptionList; - -/// @deprecated Use datamigration_v1::DataMigrationServiceRetryPolicyOption -/// directly. -using ::google::cloud::datamigration_v1::DataMigrationServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datamigration -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_DATA_MIGRATION_OPTIONS_H diff --git a/google/cloud/datamigration/mocks/mock_data_migration_connection.h b/google/cloud/datamigration/mocks/mock_data_migration_connection.h deleted file mode 100644 index 868c5502db110..0000000000000 --- a/google/cloud/datamigration/mocks/mock_data_migration_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/clouddms/v1/clouddms.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_MOCKS_MOCK_DATA_MIGRATION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_MOCKS_MOCK_DATA_MIGRATION_CONNECTION_H - -#include "google/cloud/datamigration/data_migration_connection.h" -#include "google/cloud/datamigration/v1/mocks/mock_data_migration_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in datamigration_v1_mocks instead of the aliases -/// defined in this namespace. -namespace datamigration_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datamigration_v1_mocks::MockDataMigrationServiceConnection -/// directly. -using ::google::cloud::datamigration_v1_mocks:: - MockDataMigrationServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datamigration_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_MOCKS_MOCK_DATA_MIGRATION_CONNECTION_H diff --git a/google/cloud/datamigration/quickstart/.bazelrc b/google/cloud/datamigration/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/datamigration/quickstart/.bazelrc +++ b/google/cloud/datamigration/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/datamigration/quickstart/CMakeLists.txt index 829d0b3219cfd..4aac1acf858d1 100644 --- a/google/cloud/datamigration/quickstart/CMakeLists.txt +++ b/google/cloud/datamigration/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Database Migration API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-datamigration-quickstart CXX) find_package(google_cloud_cpp_datamigration REQUIRED) diff --git a/google/cloud/datamigration/quickstart/WORKSPACE.bazel b/google/cloud/datamigration/quickstart/WORKSPACE.bazel index 9c2a86589e257..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 = "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/datamigration/v1/data_migration_client.h b/google/cloud/datamigration/v1/data_migration_client.h index 25eea0193f26b..ad12f389654ce 100644 --- a/google/cloud/datamigration/v1/data_migration_client.h +++ b/google/cloud/datamigration/v1/data_migration_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/datamigration/v1/data_migration_connection.h b/google/cloud/datamigration/v1/data_migration_connection.h index 517f2a4811957..86135d332f0bc 100644 --- a/google/cloud/datamigration/v1/data_migration_connection.h +++ b/google/cloud/datamigration/v1/data_migration_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_V1_DATA_MIGRATION_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_V1_DATA_MIGRATION_CONNECTION_H +#include "google/cloud/clouddms/v1/clouddms.pb.h" #include "google/cloud/datamigration/v1/data_migration_connection_idempotency_policy.h" #include "google/cloud/datamigration/v1/internal/data_migration_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datamigration/v1/data_migration_connection_idempotency_policy.h b/google/cloud/datamigration/v1/data_migration_connection_idempotency_policy.h index aece26df12a81..05f6ae62d19ae 100644 --- a/google/cloud/datamigration/v1/data_migration_connection_idempotency_policy.h +++ b/google/cloud/datamigration/v1/data_migration_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_V1_DATA_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_V1_DATA_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/clouddms/v1/clouddms.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datamigration/v1/internal/data_migration_auth_decorator.cc b/google/cloud/datamigration/v1/internal/data_migration_auth_decorator.cc index 902bcf9b69935..589c96a523ff8 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_auth_decorator.cc +++ b/google/cloud/datamigration/v1/internal/data_migration_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/clouddms/v1/clouddms.proto #include "google/cloud/datamigration/v1/internal/data_migration_auth_decorator.h" -#include +#include "google/cloud/clouddms/v1/clouddms.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datamigration_v1_internal { @@ -1006,3 +1009,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datamigration_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datamigration/v1/internal/data_migration_auth_decorator.h b/google/cloud/datamigration/v1/internal/data_migration_auth_decorator.h index a68f05bcef3f3..a0b2a889d03bb 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_auth_decorator.h +++ b/google/cloud/datamigration/v1/internal/data_migration_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datamigration/v1/internal/data_migration_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 datamigration_v1_internal { @@ -478,4 +481,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_V1_INTERNAL_DATA_MIGRATION_AUTH_DECORATOR_H diff --git a/google/cloud/datamigration/v1/internal/data_migration_connection_impl.h b/google/cloud/datamigration/v1/internal/data_migration_connection_impl.h index f8590abbd190c..da6355d62f8d1 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_connection_impl.h +++ b/google/cloud/datamigration/v1/internal/data_migration_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datamigration/v1/internal/data_migration_logging_decorator.cc b/google/cloud/datamigration/v1/internal/data_migration_logging_decorator.cc index 28adce0a2aa17..6dff90116fef0 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_logging_decorator.cc +++ b/google/cloud/datamigration/v1/internal/data_migration_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/clouddms/v1/clouddms.proto #include "google/cloud/datamigration/v1/internal/data_migration_logging_decorator.h" +#include "google/cloud/clouddms/v1/clouddms.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datamigration_v1_internal { @@ -1190,3 +1193,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datamigration_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datamigration/v1/internal/data_migration_logging_decorator.h b/google/cloud/datamigration/v1/internal/data_migration_logging_decorator.h index d93993e2116e4..575d8312fc916 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_logging_decorator.h +++ b/google/cloud/datamigration/v1/internal/data_migration_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datamigration/v1/internal/data_migration_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 datamigration_v1_internal { @@ -478,4 +481,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_V1_INTERNAL_DATA_MIGRATION_LOGGING_DECORATOR_H diff --git a/google/cloud/datamigration/v1/internal/data_migration_metadata_decorator.cc b/google/cloud/datamigration/v1/internal/data_migration_metadata_decorator.cc index f9c664ab5aab2..a063ebccade78 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_metadata_decorator.cc +++ b/google/cloud/datamigration/v1/internal/data_migration_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/clouddms/v1/clouddms.proto #include "google/cloud/datamigration/v1/internal/data_migration_metadata_decorator.h" +#include "google/cloud/clouddms/v1/clouddms.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 datamigration_v1_internal { @@ -859,3 +863,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datamigration_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datamigration/v1/internal/data_migration_metadata_decorator.h b/google/cloud/datamigration/v1/internal/data_migration_metadata_decorator.h index 532aca3c38b57..6851ec280371e 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_metadata_decorator.h +++ b/google/cloud/datamigration/v1/internal/data_migration_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datamigration/v1/internal/data_migration_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 datamigration_v1_internal { @@ -484,4 +487,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_V1_INTERNAL_DATA_MIGRATION_METADATA_DECORATOR_H diff --git a/google/cloud/datamigration/v1/internal/data_migration_option_defaults.cc b/google/cloud/datamigration/v1/internal/data_migration_option_defaults.cc index e9d9b905c10e4..2e7b7ada949b9 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_option_defaults.cc +++ b/google/cloud/datamigration/v1/internal/data_migration_option_defaults.cc @@ -42,7 +42,7 @@ Options DataMigrationServiceDefaultOptions(Options options) { if (!options.has()) { options.set( datamigration_v1::DataMigrationServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/datamigration/v1/internal/data_migration_stub.cc b/google/cloud/datamigration/v1/internal/data_migration_stub.cc index 3244738fc8d0c..27a803de02cc0 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_stub.cc +++ b/google/cloud/datamigration/v1/internal/data_migration_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/clouddms/v1/clouddms.proto #include "google/cloud/datamigration/v1/internal/data_migration_stub.h" +#include "google/cloud/clouddms/v1/clouddms.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datamigration_v1_internal { @@ -1166,3 +1169,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datamigration_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datamigration/v1/internal/data_migration_stub.h b/google/cloud/datamigration/v1/internal/data_migration_stub.h index 4495f33620185..d3a17aee66a0c 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_stub.h +++ b/google/cloud/datamigration/v1/internal/data_migration_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_V1_INTERNAL_DATA_MIGRATION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_V1_INTERNAL_DATA_MIGRATION_STUB_H +#include "google/cloud/clouddms/v1/clouddms.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 -#include -#include -#include +#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 datamigration_v1_internal { @@ -945,4 +948,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_V1_INTERNAL_DATA_MIGRATION_STUB_H diff --git a/google/cloud/datamigration/v1/internal/data_migration_stub_factory.cc b/google/cloud/datamigration/v1/internal/data_migration_stub_factory.cc index 4b4b698d5da11..d83013ab303aa 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_stub_factory.cc +++ b/google/cloud/datamigration/v1/internal/data_migration_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/clouddms/v1/clouddms.proto #include "google/cloud/datamigration/v1/internal/data_migration_stub_factory.h" +#include "google/cloud/clouddms/v1/clouddms.grpc.pb.h" #include "google/cloud/datamigration/v1/internal/data_migration_auth_decorator.h" #include "google/cloud/datamigration/v1/internal/data_migration_logging_decorator.h" #include "google/cloud/datamigration/v1/internal/data_migration_metadata_decorator.h" #include "google/cloud/datamigration/v1/internal/data_migration_stub.h" #include "google/cloud/datamigration/v1/internal/data_migration_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 -#include -#include -#include +#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 datamigration_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datamigration_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datamigration/v1/internal/data_migration_stub_factory.h b/google/cloud/datamigration/v1/internal/data_migration_stub_factory.h index 9f96af8e836c8..ff52215b5ebd1 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_stub_factory.h +++ b/google/cloud/datamigration/v1/internal/data_migration_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datamigration_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_V1_INTERNAL_DATA_MIGRATION_STUB_FACTORY_H diff --git a/google/cloud/datamigration/v1/internal/data_migration_tracing_connection.cc b/google/cloud/datamigration/v1/internal/data_migration_tracing_connection.cc index 236e26b6cc244..17834db95713b 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_tracing_connection.cc +++ b/google/cloud/datamigration/v1/internal/data_migration_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace datamigration_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataMigrationServiceTracingConnection::DataMigrationServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -1081,17 +1079,13 @@ Status DataMigrationServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataMigrationServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/datamigration/v1/internal/data_migration_tracing_connection.h b/google/cloud/datamigration/v1/internal/data_migration_tracing_connection.h index bdc6c1466c642..0b234c7455d43 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_tracing_connection.h +++ b/google/cloud/datamigration/v1/internal/data_migration_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace datamigration_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataMigrationServiceTracingConnection : public datamigration_v1::DataMigrationServiceConnection { public: @@ -458,8 +456,6 @@ class DataMigrationServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/datamigration/v1/internal/data_migration_tracing_stub.cc b/google/cloud/datamigration/v1/internal/data_migration_tracing_stub.cc index 32662986945db..d93843821304a 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_tracing_stub.cc +++ b/google/cloud/datamigration/v1/internal/data_migration_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datamigration_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataMigrationServiceTracingStub::DataMigrationServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -1083,18 +1084,14 @@ future DataMigrationServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataMigrationServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datamigration_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datamigration/v1/internal/data_migration_tracing_stub.h b/google/cloud/datamigration/v1/internal/data_migration_tracing_stub.h index 2e51226287ccb..815eb9070c330 100644 --- a/google/cloud/datamigration/v1/internal/data_migration_tracing_stub.h +++ b/google/cloud/datamigration/v1/internal/data_migration_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datamigration_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataMigrationServiceTracingStub : public DataMigrationServiceStub { public: ~DataMigrationServiceTracingStub() override = default; @@ -474,8 +475,6 @@ class DataMigrationServiceTracingStub : public DataMigrationServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -490,4 +489,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAMIGRATION_V1_INTERNAL_DATA_MIGRATION_TRACING_STUB_H diff --git a/google/cloud/dataplex/BUILD.bazel b/google/cloud/dataplex/BUILD.bazel index df24c92c4cee0..9452165e490ac 100644 --- a/google/cloud/dataplex/BUILD.bazel +++ b/google/cloud/dataplex/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/dataplex/v1:dataplex_cc_grpc", + "@googleapis//google/cloud/dataplex/v1:dataplex_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/dataplex/CMakeLists.txt b/google/cloud/dataplex/CMakeLists.txt index c749a81416852..ec4d0c413ae8c 100644 --- a/google/cloud/dataplex/CMakeLists.txt +++ b/google/cloud/dataplex/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(dataplex "Cloud Dataplex API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(dataplex_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/dataplex/content_client.h b/google/cloud/dataplex/content_client.h deleted file mode 100644 index e543583aef8f0..0000000000000 --- a/google/cloud/dataplex/content_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/content.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_CONTENT_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_CONTENT_CLIENT_H - -#include "google/cloud/dataplex/content_connection.h" -#include "google/cloud/dataplex/v1/content_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataplex_v1 instead of the aliases defined in -/// this namespace. -namespace dataplex { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataplex_v1::ContentServiceClient directly. -using ::google::cloud::dataplex_v1::ContentServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_CONTENT_CLIENT_H diff --git a/google/cloud/dataplex/content_connection.h b/google/cloud/dataplex/content_connection.h deleted file mode 100644 index f21b1a7c56d6f..0000000000000 --- a/google/cloud/dataplex/content_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/content.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_CONTENT_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_CONTENT_CONNECTION_H - -#include "google/cloud/dataplex/content_connection_idempotency_policy.h" -#include "google/cloud/dataplex/v1/content_connection.h" - -namespace google { -namespace cloud { -namespace dataplex { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataplex_v1::MakeContentServiceConnection directly. -using ::google::cloud::dataplex_v1::MakeContentServiceConnection; - -/// @deprecated Use dataplex_v1::ContentServiceConnection directly. -using ::google::cloud::dataplex_v1::ContentServiceConnection; - -/// @deprecated Use dataplex_v1::ContentServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::dataplex_v1::ContentServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use dataplex_v1::ContentServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::dataplex_v1::ContentServiceLimitedTimeRetryPolicy; - -/// @deprecated Use dataplex_v1::ContentServiceRetryPolicy directly. -using ::google::cloud::dataplex_v1::ContentServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_CONTENT_CONNECTION_H diff --git a/google/cloud/dataplex/content_connection_idempotency_policy.h b/google/cloud/dataplex/content_connection_idempotency_policy.h deleted file mode 100644 index 2b9fdaaa02913..0000000000000 --- a/google/cloud/dataplex/content_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/content.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_CONTENT_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_CONTENT_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/dataplex/v1/content_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace dataplex { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// dataplex_v1::MakeDefaultContentServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::dataplex_v1:: - MakeDefaultContentServiceConnectionIdempotencyPolicy; - -/// @deprecated Use dataplex_v1::ContentServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::dataplex_v1::ContentServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_CONTENT_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/dataplex/content_options.h b/google/cloud/dataplex/content_options.h deleted file mode 100644 index b2e4272b3247d..0000000000000 --- a/google/cloud/dataplex/content_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/content.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_CONTENT_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_CONTENT_OPTIONS_H - -#include "google/cloud/dataplex/content_connection.h" -#include "google/cloud/dataplex/content_connection_idempotency_policy.h" -#include "google/cloud/dataplex/v1/content_options.h" - -namespace google { -namespace cloud { -namespace dataplex { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataplex_v1::ContentServiceBackoffPolicyOption directly. -using ::google::cloud::dataplex_v1::ContentServiceBackoffPolicyOption; - -/// @deprecated Use dataplex_v1::ContentServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::dataplex_v1:: - ContentServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use dataplex_v1::ContentServicePolicyOptionList directly. -using ::google::cloud::dataplex_v1::ContentServicePolicyOptionList; - -/// @deprecated Use dataplex_v1::ContentServiceRetryPolicyOption directly. -using ::google::cloud::dataplex_v1::ContentServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_CONTENT_OPTIONS_H diff --git a/google/cloud/dataplex/dataplex_client.h b/google/cloud/dataplex/dataplex_client.h deleted file mode 100644 index 739cac37619be..0000000000000 --- a/google/cloud/dataplex/dataplex_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_DATAPLEX_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_DATAPLEX_CLIENT_H - -#include "google/cloud/dataplex/dataplex_connection.h" -#include "google/cloud/dataplex/v1/dataplex_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataplex_v1 instead of the aliases defined in -/// this namespace. -namespace dataplex { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataplex_v1::DataplexServiceClient directly. -using ::google::cloud::dataplex_v1::DataplexServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_DATAPLEX_CLIENT_H diff --git a/google/cloud/dataplex/dataplex_connection.h b/google/cloud/dataplex/dataplex_connection.h deleted file mode 100644 index 9cf367b268f7c..0000000000000 --- a/google/cloud/dataplex/dataplex_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_DATAPLEX_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_DATAPLEX_CONNECTION_H - -#include "google/cloud/dataplex/dataplex_connection_idempotency_policy.h" -#include "google/cloud/dataplex/v1/dataplex_connection.h" - -namespace google { -namespace cloud { -namespace dataplex { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataplex_v1::MakeDataplexServiceConnection directly. -using ::google::cloud::dataplex_v1::MakeDataplexServiceConnection; - -/// @deprecated Use dataplex_v1::DataplexServiceConnection directly. -using ::google::cloud::dataplex_v1::DataplexServiceConnection; - -/// @deprecated Use dataplex_v1::DataplexServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::dataplex_v1::DataplexServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use dataplex_v1::DataplexServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::dataplex_v1::DataplexServiceLimitedTimeRetryPolicy; - -/// @deprecated Use dataplex_v1::DataplexServiceRetryPolicy directly. -using ::google::cloud::dataplex_v1::DataplexServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_DATAPLEX_CONNECTION_H diff --git a/google/cloud/dataplex/dataplex_connection_idempotency_policy.h b/google/cloud/dataplex/dataplex_connection_idempotency_policy.h deleted file mode 100644 index 5be5941da8fed..0000000000000 --- a/google/cloud/dataplex/dataplex_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_DATAPLEX_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_DATAPLEX_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/dataplex/v1/dataplex_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace dataplex { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// dataplex_v1::MakeDefaultDataplexServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::dataplex_v1:: - MakeDefaultDataplexServiceConnectionIdempotencyPolicy; - -/// @deprecated Use dataplex_v1::DataplexServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::dataplex_v1::DataplexServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_DATAPLEX_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/dataplex/dataplex_options.h b/google/cloud/dataplex/dataplex_options.h deleted file mode 100644 index a1977fe3e3a1d..0000000000000 --- a/google/cloud/dataplex/dataplex_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_DATAPLEX_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_DATAPLEX_OPTIONS_H - -#include "google/cloud/dataplex/dataplex_connection.h" -#include "google/cloud/dataplex/dataplex_connection_idempotency_policy.h" -#include "google/cloud/dataplex/v1/dataplex_options.h" - -namespace google { -namespace cloud { -namespace dataplex { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataplex_v1::DataplexServicePollingPolicyOption directly. -using ::google::cloud::dataplex_v1::DataplexServicePollingPolicyOption; - -/// @deprecated Use dataplex_v1::DataplexServiceBackoffPolicyOption directly. -using ::google::cloud::dataplex_v1::DataplexServiceBackoffPolicyOption; - -/// @deprecated Use -/// dataplex_v1::DataplexServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::dataplex_v1:: - DataplexServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use dataplex_v1::DataplexServicePolicyOptionList directly. -using ::google::cloud::dataplex_v1::DataplexServicePolicyOptionList; - -/// @deprecated Use dataplex_v1::DataplexServiceRetryPolicyOption directly. -using ::google::cloud::dataplex_v1::DataplexServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_DATAPLEX_OPTIONS_H 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/metadata_client.h b/google/cloud/dataplex/metadata_client.h deleted file mode 100644 index cfc4fad6c5624..0000000000000 --- a/google/cloud/dataplex/metadata_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/metadata.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_METADATA_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_METADATA_CLIENT_H - -#include "google/cloud/dataplex/metadata_connection.h" -#include "google/cloud/dataplex/v1/metadata_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataplex_v1 instead of the aliases defined in -/// this namespace. -namespace dataplex { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataplex_v1::MetadataServiceClient directly. -using ::google::cloud::dataplex_v1::MetadataServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_METADATA_CLIENT_H diff --git a/google/cloud/dataplex/metadata_connection.h b/google/cloud/dataplex/metadata_connection.h deleted file mode 100644 index c52b005997f46..0000000000000 --- a/google/cloud/dataplex/metadata_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/metadata.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_METADATA_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_METADATA_CONNECTION_H - -#include "google/cloud/dataplex/metadata_connection_idempotency_policy.h" -#include "google/cloud/dataplex/v1/metadata_connection.h" - -namespace google { -namespace cloud { -namespace dataplex { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataplex_v1::MakeMetadataServiceConnection directly. -using ::google::cloud::dataplex_v1::MakeMetadataServiceConnection; - -/// @deprecated Use dataplex_v1::MetadataServiceConnection directly. -using ::google::cloud::dataplex_v1::MetadataServiceConnection; - -/// @deprecated Use dataplex_v1::MetadataServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::dataplex_v1::MetadataServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use dataplex_v1::MetadataServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::dataplex_v1::MetadataServiceLimitedTimeRetryPolicy; - -/// @deprecated Use dataplex_v1::MetadataServiceRetryPolicy directly. -using ::google::cloud::dataplex_v1::MetadataServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_METADATA_CONNECTION_H diff --git a/google/cloud/dataplex/metadata_connection_idempotency_policy.h b/google/cloud/dataplex/metadata_connection_idempotency_policy.h deleted file mode 100644 index 7677da69a9ac8..0000000000000 --- a/google/cloud/dataplex/metadata_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/metadata.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_METADATA_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_METADATA_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/dataplex/v1/metadata_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace dataplex { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// dataplex_v1::MakeDefaultMetadataServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::dataplex_v1:: - MakeDefaultMetadataServiceConnectionIdempotencyPolicy; - -/// @deprecated Use dataplex_v1::MetadataServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::dataplex_v1::MetadataServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_METADATA_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/dataplex/metadata_options.h b/google/cloud/dataplex/metadata_options.h deleted file mode 100644 index a6c4a2e7130bd..0000000000000 --- a/google/cloud/dataplex/metadata_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/metadata.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_METADATA_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_METADATA_OPTIONS_H - -#include "google/cloud/dataplex/metadata_connection.h" -#include "google/cloud/dataplex/metadata_connection_idempotency_policy.h" -#include "google/cloud/dataplex/v1/metadata_options.h" - -namespace google { -namespace cloud { -namespace dataplex { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataplex_v1::MetadataServiceBackoffPolicyOption directly. -using ::google::cloud::dataplex_v1::MetadataServiceBackoffPolicyOption; - -/// @deprecated Use -/// dataplex_v1::MetadataServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::dataplex_v1:: - MetadataServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use dataplex_v1::MetadataServicePolicyOptionList directly. -using ::google::cloud::dataplex_v1::MetadataServicePolicyOptionList; - -/// @deprecated Use dataplex_v1::MetadataServiceRetryPolicyOption directly. -using ::google::cloud::dataplex_v1::MetadataServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_METADATA_OPTIONS_H diff --git a/google/cloud/dataplex/mocks/mock_content_connection.h b/google/cloud/dataplex/mocks/mock_content_connection.h deleted file mode 100644 index d2fb4aa834cbb..0000000000000 --- a/google/cloud/dataplex/mocks/mock_content_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/content.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_MOCKS_MOCK_CONTENT_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_MOCKS_MOCK_CONTENT_CONNECTION_H - -#include "google/cloud/dataplex/content_connection.h" -#include "google/cloud/dataplex/v1/mocks/mock_content_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataplex_v1_mocks instead of the aliases -/// defined in this namespace. -namespace dataplex_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataplex_v1_mocks::MockContentServiceConnection directly. -using ::google::cloud::dataplex_v1_mocks::MockContentServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_MOCKS_MOCK_CONTENT_CONNECTION_H diff --git a/google/cloud/dataplex/mocks/mock_dataplex_connection.h b/google/cloud/dataplex/mocks/mock_dataplex_connection.h deleted file mode 100644 index a2c220ba8d874..0000000000000 --- a/google/cloud/dataplex/mocks/mock_dataplex_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_MOCKS_MOCK_DATAPLEX_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_MOCKS_MOCK_DATAPLEX_CONNECTION_H - -#include "google/cloud/dataplex/dataplex_connection.h" -#include "google/cloud/dataplex/v1/mocks/mock_dataplex_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataplex_v1_mocks instead of the aliases -/// defined in this namespace. -namespace dataplex_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataplex_v1_mocks::MockDataplexServiceConnection directly. -using ::google::cloud::dataplex_v1_mocks::MockDataplexServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_MOCKS_MOCK_DATAPLEX_CONNECTION_H diff --git a/google/cloud/dataplex/mocks/mock_metadata_connection.h b/google/cloud/dataplex/mocks/mock_metadata_connection.h deleted file mode 100644 index df37b51ff45cb..0000000000000 --- a/google/cloud/dataplex/mocks/mock_metadata_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions 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/metadata.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_MOCKS_MOCK_METADATA_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_MOCKS_MOCK_METADATA_CONNECTION_H - -#include "google/cloud/dataplex/metadata_connection.h" -#include "google/cloud/dataplex/v1/mocks/mock_metadata_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataplex_v1_mocks instead of the aliases -/// defined in this namespace. -namespace dataplex_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataplex_v1_mocks::MockMetadataServiceConnection directly. -using ::google::cloud::dataplex_v1_mocks::MockMetadataServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataplex_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_MOCKS_MOCK_METADATA_CONNECTION_H diff --git a/google/cloud/dataplex/quickstart/.bazelrc b/google/cloud/dataplex/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/dataplex/quickstart/.bazelrc +++ b/google/cloud/dataplex/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/dataplex/quickstart/CMakeLists.txt index 01c007e6ce594..4295f47f38361 100644 --- a/google/cloud/dataplex/quickstart/CMakeLists.txt +++ b/google/cloud/dataplex/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Dataplex API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-dataplex-quickstart CXX) find_package(google_cloud_cpp_dataplex REQUIRED) diff --git a/google/cloud/dataplex/quickstart/WORKSPACE.bazel b/google/cloud/dataplex/quickstart/WORKSPACE.bazel index 5944ee1dba52f..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 = "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/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 88691c4df19ff..06d1b8126066f 100644 --- a/google/cloud/dataplex/v1/catalog_client.h +++ b/google/cloud/dataplex/v1/catalog_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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 02d94ae968f1f..04a8fd73f5257 100644 --- a/google/cloud/dataplex/v1/catalog_connection.h +++ b/google/cloud/dataplex/v1/catalog_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CATALOG_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CATALOG_CONNECTION_H +#include "google/cloud/dataplex/v1/catalog.pb.h" #include "google/cloud/dataplex/v1/catalog_connection_idempotency_policy.h" #include "google/cloud/dataplex/v1/internal/catalog_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 5e0bac3b64708..560349dcc4891 100644 --- a/google/cloud/dataplex/v1/catalog_connection_idempotency_policy.h +++ b/google/cloud/dataplex/v1/catalog_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataplex/v1/catalog.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 82c10a1e4ceac..1cd1b5edbd777 100644 --- a/google/cloud/dataplex/v1/content_connection.h +++ b/google/cloud/dataplex/v1/content_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CONTENT_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CONTENT_CONNECTION_H +#include "google/cloud/dataplex/v1/content.pb.h" #include "google/cloud/dataplex/v1/content_connection_idempotency_policy.h" #include "google/cloud/dataplex/v1/internal/content_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { @@ -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 1525c33859c9c..de8e657d4670f 100644 --- a/google/cloud/dataplex/v1/content_connection_idempotency_policy.h +++ b/google/cloud/dataplex/v1/content_connection_idempotency_policy.h @@ -19,11 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CONTENT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CONTENT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataplex/v1/content.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 53845c9d3d58a..71ec3beea2b61 100644 --- a/google/cloud/dataplex/v1/data_scan_client.h +++ b/google/cloud/dataplex/v1/data_scan_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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_scan_connection.h b/google/cloud/dataplex/v1/data_scan_connection.h index f6412c4dccc26..0f86864f684db 100644 --- a/google/cloud/dataplex/v1/data_scan_connection.h +++ b/google/cloud/dataplex/v1/data_scan_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_SCAN_CONNECTION_H #include "google/cloud/dataplex/v1/data_scan_connection_idempotency_policy.h" +#include "google/cloud/dataplex/v1/datascans.pb.h" #include "google/cloud/dataplex/v1/internal/data_scan_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataplex/v1/data_scan_connection_idempotency_policy.h b/google/cloud/dataplex/v1/data_scan_connection_idempotency_policy.h index ed6353877727b..a62483907e217 100644 --- a/google/cloud/dataplex/v1/data_scan_connection_idempotency_policy.h +++ b/google/cloud/dataplex/v1/data_scan_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_SCAN_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_SCAN_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataplex/v1/datascans.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataplex/v1/data_taxonomy_client.h b/google/cloud/dataplex/v1/data_taxonomy_client.h index 3db827d88befd..070a0d01384bd 100644 --- a/google/cloud/dataplex/v1/data_taxonomy_client.h +++ b/google/cloud/dataplex/v1/data_taxonomy_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/data_taxonomy_connection.h b/google/cloud/dataplex/v1/data_taxonomy_connection.h index 69eef81d52593..323779c28198c 100644 --- a/google/cloud/dataplex/v1/data_taxonomy_connection.h +++ b/google/cloud/dataplex/v1/data_taxonomy_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_TAXONOMY_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_TAXONOMY_CONNECTION_H +#include "google/cloud/dataplex/v1/data_taxonomy.pb.h" #include "google/cloud/dataplex/v1/data_taxonomy_connection_idempotency_policy.h" #include "google/cloud/dataplex/v1/internal/data_taxonomy_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataplex/v1/data_taxonomy_connection_idempotency_policy.h b/google/cloud/dataplex/v1/data_taxonomy_connection_idempotency_policy.h index eb80386005071..22cda43da4908 100644 --- a/google/cloud/dataplex/v1/data_taxonomy_connection_idempotency_policy.h +++ b/google/cloud/dataplex/v1/data_taxonomy_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_TAXONOMY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_TAXONOMY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataplex/v1/data_taxonomy.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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 89fd114720b7b..1b2e883cbe659 100644 --- a/google/cloud/dataplex/v1/dataplex_client.h +++ b/google/cloud/dataplex/v1/dataplex_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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 250d46e6a4409..34f050c05f1cb 100644 --- a/google/cloud/dataplex/v1/dataplex_connection.h +++ b/google/cloud/dataplex/v1/dataplex_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/dataplex/v1/dataplex_connection_idempotency_policy.h" #include "google/cloud/dataplex/v1/internal/dataplex_retry_traits.h" +#include "google/cloud/dataplex/v1/service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 509c0e2ff4ece..270fbe9b317f1 100644 --- a/google/cloud/dataplex/v1/dataplex_connection_idempotency_policy.h +++ b/google/cloud/dataplex/v1/dataplex_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATAPLEX_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATAPLEX_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataplex/v1/service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 6858481895158..26ec8e02f47e6 100644 --- a/google/cloud/dataplex/v1/internal/catalog_auth_decorator.cc +++ b/google/cloud/dataplex/v1/internal/catalog_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataplex/v1/catalog.proto #include "google/cloud/dataplex/v1/internal/catalog_auth_decorator.h" -#include +#include "google/cloud/dataplex/v1/catalog.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -458,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, @@ -467,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, @@ -476,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, @@ -591,3 +723,5 @@ 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/catalog_auth_decorator.h b/google/cloud/dataplex/v1/internal/catalog_auth_decorator.h index 733eb9391df89..e3343702e4d1c 100644 --- a/google/cloud/dataplex/v1/internal/catalog_auth_decorator.h +++ b/google/cloud/dataplex/v1/internal/catalog_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataplex/v1/internal/catalog_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 { @@ -237,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; @@ -304,4 +368,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CATALOG_AUTH_DECORATOR_H 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 a3ed5e05af288..9918050b5522f 100644 --- a/google/cloud/dataplex/v1/internal/catalog_connection_impl.h +++ b/google/cloud/dataplex/v1/internal/catalog_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 2321c302c7483..c33953d4fd0ae 100644 --- a/google/cloud/dataplex/v1/internal/catalog_logging_decorator.cc +++ b/google/cloud/dataplex/v1/internal/catalog_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataplex/v1/catalog.proto #include "google/cloud/dataplex/v1/internal/catalog_logging_decorator.h" +#include "google/cloud/dataplex/v1/catalog.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -557,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, @@ -570,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, @@ -582,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, @@ -723,3 +886,5 @@ 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/catalog_logging_decorator.h b/google/cloud/dataplex/v1/internal/catalog_logging_decorator.h index 5ea639270b087..325cd2a0059d9 100644 --- a/google/cloud/dataplex/v1/internal/catalog_logging_decorator.h +++ b/google/cloud/dataplex/v1/internal/catalog_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataplex/v1/internal/catalog_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 { @@ -237,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; @@ -304,4 +368,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CATALOG_LOGGING_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.cc b/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.cc index e417862cf8d4f..d8e3a9516b250 100644 --- a/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.cc +++ b/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataplex/v1/catalog.proto #include "google/cloud/dataplex/v1/internal/catalog_metadata_decorator.h" +#include "google/cloud/dataplex/v1/catalog.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 { @@ -412,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, @@ -421,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, @@ -430,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, @@ -548,3 +665,5 @@ 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/catalog_metadata_decorator.h b/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.h index 2aaaf48276a5b..28777d3e72550 100644 --- a/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.h +++ b/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataplex/v1/internal/catalog_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 { @@ -237,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; @@ -309,4 +373,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CATALOG_METADATA_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/catalog_option_defaults.cc b/google/cloud/dataplex/v1/internal/catalog_option_defaults.cc index a9bb844e49ba5..d7ab7adc55664 100644 --- a/google/cloud/dataplex/v1/internal/catalog_option_defaults.cc +++ b/google/cloud/dataplex/v1/internal/catalog_option_defaults.cc @@ -41,7 +41,7 @@ Options CatalogServiceDefaultOptions(Options options) { if (!options.has()) { options.set( dataplex_v1::CatalogServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dataplex/v1/internal/catalog_stub.cc b/google/cloud/dataplex/v1/internal/catalog_stub.cc index 012a1a04ddd2c..0b12b6626e2fc 100644 --- a/google/cloud/dataplex/v1/internal/catalog_stub.cc +++ b/google/cloud/dataplex/v1/internal/catalog_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dataplex/v1/catalog.proto #include "google/cloud/dataplex/v1/internal/catalog_stub.h" +#include "google/cloud/dataplex/v1/catalog.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#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 { @@ -541,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&, @@ -553,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&, @@ -565,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&, @@ -713,3 +869,5 @@ 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/catalog_stub.h b/google/cloud/dataplex/v1/internal/catalog_stub.h index 169f3e2259e65..1f6d1de0a9c27 100644 --- a/google/cloud/dataplex/v1/internal/catalog_stub.h +++ b/google/cloud/dataplex/v1/internal/catalog_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CATALOG_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CATALOG_STUB_H +#include "google/cloud/dataplex/v1/catalog.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 -#include -#include -#include +#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 { @@ -221,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, @@ -494,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; @@ -566,4 +692,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CATALOG_STUB_H diff --git a/google/cloud/dataplex/v1/internal/catalog_stub_factory.cc b/google/cloud/dataplex/v1/internal/catalog_stub_factory.cc index 030575b8f6763..14e478c907a80 100644 --- a/google/cloud/dataplex/v1/internal/catalog_stub_factory.cc +++ b/google/cloud/dataplex/v1/internal/catalog_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/dataplex/v1/catalog.proto #include "google/cloud/dataplex/v1/internal/catalog_stub_factory.h" +#include "google/cloud/dataplex/v1/catalog.grpc.pb.h" #include "google/cloud/dataplex/v1/internal/catalog_auth_decorator.h" #include "google/cloud/dataplex/v1/internal/catalog_logging_decorator.h" #include "google/cloud/dataplex/v1/internal/catalog_metadata_decorator.h" #include "google/cloud/dataplex/v1/internal/catalog_stub.h" #include "google/cloud/dataplex/v1/internal/catalog_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 -#include -#include -#include +#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 { @@ -78,3 +81,5 @@ 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/catalog_stub_factory.h b/google/cloud/dataplex/v1/internal/catalog_stub_factory.h index 9d83ff95e4068..768d861d250a6 100644 --- a/google/cloud/dataplex/v1/internal/catalog_stub_factory.h +++ b/google/cloud/dataplex/v1/internal/catalog_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CATALOG_STUB_FACTORY_H diff --git a/google/cloud/dataplex/v1/internal/catalog_tracing_connection.cc b/google/cloud/dataplex/v1/internal/catalog_tracing_connection.cc index 7b99a20d41902..a9930abb7e214 100644 --- a/google/cloud/dataplex/v1/internal/catalog_tracing_connection.cc +++ b/google/cloud/dataplex/v1/internal/catalog_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dataplex_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CatalogServiceTracingConnection::CatalogServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -495,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) { @@ -504,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) { @@ -513,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) { @@ -594,16 +735,12 @@ Status CatalogServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCatalogServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataplex/v1/internal/catalog_tracing_connection.h b/google/cloud/dataplex/v1/internal/catalog_tracing_connection.h index b4fd403e2417f..fa4b8f88dece3 100644 --- a/google/cloud/dataplex/v1/internal/catalog_tracing_connection.h +++ b/google/cloud/dataplex/v1/internal/catalog_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataplex_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CatalogServiceTracingConnection : public dataplex_v1::CatalogServiceConnection { public: @@ -216,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; @@ -254,8 +309,6 @@ class CatalogServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataplex/v1/internal/catalog_tracing_stub.cc b/google/cloud/dataplex/v1/internal/catalog_tracing_stub.cc index d18490c669c5e..9e8748a9ebebd 100644 --- a/google/cloud/dataplex/v1/internal/catalog_tracing_stub.cc +++ b/google/cloud/dataplex/v1/internal/catalog_tracing_stub.cc @@ -21,13 +21,14 @@ #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 -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CatalogServiceTracingStub::CatalogServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -505,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, @@ -517,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, @@ -529,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, @@ -661,18 +803,14 @@ future CatalogServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCatalogServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataplex_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/catalog_tracing_stub.h b/google/cloud/dataplex/v1/internal/catalog_tracing_stub.h index 48ca1171ff65a..6a80b919961a2 100644 --- a/google/cloud/dataplex/v1/internal/catalog_tracing_stub.h +++ b/google/cloud/dataplex/v1/internal/catalog_tracing_stub.h @@ -25,13 +25,14 @@ #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 -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CatalogServiceTracingStub : public CatalogServiceStub { public: ~CatalogServiceTracingStub() override = default; @@ -236,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; @@ -299,8 +361,6 @@ class CatalogServiceTracingStub : public CatalogServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -315,4 +375,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CATALOG_TRACING_STUB_H 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 623c29b692aa6..5e404e8cf3611 100644 --- a/google/cloud/dataplex/v1/internal/content_auth_decorator.cc +++ b/google/cloud/dataplex/v1/internal/content_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataplex/v1/content.proto #include "google/cloud/dataplex/v1/internal/content_auth_decorator.h" -#include +#include "google/cloud/dataplex/v1/content.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -31,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( @@ -73,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, @@ -90,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, @@ -153,3 +113,5 @@ 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/content_auth_decorator.h b/google/cloud/dataplex/v1/internal/content_auth_decorator.h index 1f5316080cc0f..40baaac775492 100644 --- a/google/cloud/dataplex/v1/internal/content_auth_decorator.h +++ b/google/cloud/dataplex/v1/internal/content_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -38,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; @@ -106,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CONTENT_AUTH_DECORATOR_H 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 c6cce6e433c35..162f49b490330 100644 --- a/google/cloud/dataplex/v1/internal/content_logging_decorator.cc +++ b/google/cloud/dataplex/v1/internal/content_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataplex/v1/content.proto #include "google/cloud/dataplex/v1/internal/content_logging_decorator.h" +#include "google/cloud/dataplex/v1/content.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -35,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_); } @@ -93,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, @@ -116,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, @@ -200,3 +144,5 @@ 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/content_logging_decorator.h b/google/cloud/dataplex/v1/internal/content_logging_decorator.h index 51677930a4578..d59f536e75c3b 100644 --- a/google/cloud/dataplex/v1/internal/content_logging_decorator.h +++ b/google/cloud/dataplex/v1/internal/content_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -38,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; @@ -106,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CONTENT_LOGGING_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/content_metadata_decorator.cc b/google/cloud/dataplex/v1/internal/content_metadata_decorator.cc index 1820620905183..576e1d3e15d0a 100644 --- a/google/cloud/dataplex/v1/internal/content_metadata_decorator.cc +++ b/google/cloud/dataplex/v1/internal/content_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataplex/v1/content.proto #include "google/cloud/dataplex/v1/internal/content_metadata_decorator.h" +#include "google/cloud/dataplex/v1/content.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 { @@ -44,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 @@ -108,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, @@ -184,3 +143,5 @@ 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/content_metadata_decorator.h b/google/cloud/dataplex/v1/internal/content_metadata_decorator.h index 293f3d7d47527..61793dad4a354 100644 --- a/google/cloud/dataplex/v1/internal/content_metadata_decorator.h +++ b/google/cloud/dataplex/v1/internal/content_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -38,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; @@ -111,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CONTENT_METADATA_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/content_option_defaults.cc b/google/cloud/dataplex/v1/internal/content_option_defaults.cc index fe3cedb7d0794..b7341aa8c056d 100644 --- a/google/cloud/dataplex/v1/internal/content_option_defaults.cc +++ b/google/cloud/dataplex/v1/internal/content_option_defaults.cc @@ -41,7 +41,7 @@ Options ContentServiceDefaultOptions(Options options) { if (!options.has()) { options.set( dataplex_v1::ContentServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dataplex/v1/internal/content_stub.cc b/google/cloud/dataplex/v1/internal/content_stub.cc index f1d82d59dfa0f..6c9567fe1cf98 100644 --- a/google/cloud/dataplex/v1/internal/content_stub.cc +++ b/google/cloud/dataplex/v1/internal/content_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dataplex/v1/content.proto #include "google/cloud/dataplex/v1/internal/content_stub.h" +#include "google/cloud/dataplex/v1/content.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -30,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); } @@ -81,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); } @@ -104,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); } @@ -197,3 +142,5 @@ 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/content_stub.h b/google/cloud/dataplex/v1/internal/content_stub.h index ebb66fef88d2b..c8bad2a3ce84a 100644 --- a/google/cloud/dataplex/v1/internal/content_stub.h +++ b/google/cloud/dataplex/v1/internal/content_stub.h @@ -19,15 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CONTENT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CONTENT_STUB_H +#include "google/cloud/dataplex/v1/content.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 -#include -#include +#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 { @@ -37,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; @@ -105,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; @@ -174,6 +137,7 @@ class DefaultContentServiceStub : public ContentServiceStub { grpc_stub_; std::unique_ptr operations_stub_; + std::unique_ptr iampolicy_stub_; std::unique_ptr locations_stub_; }; @@ -183,4 +147,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CONTENT_STUB_H diff --git a/google/cloud/dataplex/v1/internal/content_stub_factory.cc b/google/cloud/dataplex/v1/internal/content_stub_factory.cc index 93a6c1992b2ba..2b24323129179 100644 --- a/google/cloud/dataplex/v1/internal/content_stub_factory.cc +++ b/google/cloud/dataplex/v1/internal/content_stub_factory.cc @@ -17,23 +17,27 @@ // source: google/cloud/dataplex/v1/content.proto #include "google/cloud/dataplex/v1/internal/content_stub_factory.h" +#include "google/cloud/dataplex/v1/content.grpc.pb.h" #include "google/cloud/dataplex/v1/internal/content_auth_decorator.h" #include "google/cloud/dataplex/v1/internal/content_logging_decorator.h" #include "google/cloud/dataplex/v1/internal/content_metadata_decorator.h" #include "google/cloud/dataplex/v1/internal/content_stub.h" #include "google/cloud/dataplex/v1/internal/content_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 -#include -#include +#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 { @@ -48,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 = @@ -77,3 +82,5 @@ 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/content_stub_factory.h b/google/cloud/dataplex/v1/internal/content_stub_factory.h index a27639f935441..33fcf7c4526bd 100644 --- a/google/cloud/dataplex/v1/internal/content_stub_factory.h +++ b/google/cloud/dataplex/v1/internal/content_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CONTENT_STUB_FACTORY_H diff --git a/google/cloud/dataplex/v1/internal/content_tracing_connection.cc b/google/cloud/dataplex/v1/internal/content_tracing_connection.cc index d29319e81dde2..b6a78bd80603e 100644 --- a/google/cloud/dataplex/v1/internal/content_tracing_connection.cc +++ b/google/cloud/dataplex/v1/internal/content_tracing_connection.cc @@ -27,45 +27,36 @@ namespace cloud { namespace dataplex_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - 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( @@ -76,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) { @@ -93,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) { @@ -160,16 +112,12 @@ Status ContentServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeContentServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataplex/v1/internal/content_tracing_connection.h b/google/cloud/dataplex/v1/internal/content_tracing_connection.h index 7dca58d364786..f38e1d0f5181d 100644 --- a/google/cloud/dataplex/v1/internal/content_tracing_connection.h +++ b/google/cloud/dataplex/v1/internal/content_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataplex_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ContentServiceTracingConnection : public dataplex_v1::ContentServiceConnection { public: @@ -40,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; @@ -88,8 +69,6 @@ class ContentServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataplex/v1/internal/content_tracing_stub.cc b/google/cloud/dataplex/v1/internal/content_tracing_stub.cc index c4a2382f6d30c..a800704ece68c 100644 --- a/google/cloud/dataplex/v1/internal/content_tracing_stub.cc +++ b/google/cloud/dataplex/v1/internal/content_tracing_stub.cc @@ -21,62 +21,51 @@ #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 -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - 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( @@ -90,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, @@ -113,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, @@ -195,18 +137,14 @@ Status ContentServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeContentServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataplex_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/content_tracing_stub.h b/google/cloud/dataplex/v1/internal/content_tracing_stub.h index 11217eabb333c..564b13deb87a3 100644 --- a/google/cloud/dataplex/v1/internal/content_tracing_stub.h +++ b/google/cloud/dataplex/v1/internal/content_tracing_stub.h @@ -25,61 +25,40 @@ #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 -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ContentServiceTracingStub : public ContentServiceStub { public: ~ContentServiceTracingStub() override = default; 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; @@ -102,8 +81,6 @@ class ContentServiceTracingStub : public ContentServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -118,4 +95,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CONTENT_TRACING_STUB_H 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/data_scan_auth_decorator.cc b/google/cloud/dataplex/v1/internal/data_scan_auth_decorator.cc index 3caffb9e2c1f8..d20935131622f 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_auth_decorator.cc +++ b/google/cloud/dataplex/v1/internal/data_scan_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataplex/v1/datascans.proto #include "google/cloud/dataplex/v1/internal/data_scan_auth_decorator.h" -#include +#include "google/cloud/dataplex/v1/datascans.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -285,3 +288,5 @@ 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_scan_auth_decorator.h b/google/cloud/dataplex/v1/internal/data_scan_auth_decorator.h index b57041e746802..63fcddeb88b1b 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_auth_decorator.h +++ b/google/cloud/dataplex/v1/internal/data_scan_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataplex/v1/internal/data_scan_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 { @@ -162,4 +165,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_SCAN_AUTH_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/data_scan_connection_impl.h b/google/cloud/dataplex/v1/internal/data_scan_connection_impl.h index cd3c80919b6b3..f26390a9fc5fd 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_connection_impl.h +++ b/google/cloud/dataplex/v1/internal/data_scan_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataplex/v1/internal/data_scan_logging_decorator.cc b/google/cloud/dataplex/v1/internal/data_scan_logging_decorator.cc index b07ac282941ed..5449c72864b0c 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_logging_decorator.cc +++ b/google/cloud/dataplex/v1/internal/data_scan_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataplex/v1/datascans.proto #include "google/cloud/dataplex/v1/internal/data_scan_logging_decorator.h" +#include "google/cloud/dataplex/v1/datascans.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -345,3 +348,5 @@ 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_scan_logging_decorator.h b/google/cloud/dataplex/v1/internal/data_scan_logging_decorator.h index f444b1150c98c..8d819c58f036b 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_logging_decorator.h +++ b/google/cloud/dataplex/v1/internal/data_scan_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataplex/v1/internal/data_scan_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 { @@ -162,4 +165,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_SCAN_LOGGING_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/data_scan_metadata_decorator.cc b/google/cloud/dataplex/v1/internal/data_scan_metadata_decorator.cc index a5a24befd80cb..916f737ebb2d5 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_metadata_decorator.cc +++ b/google/cloud/dataplex/v1/internal/data_scan_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataplex/v1/datascans.proto #include "google/cloud/dataplex/v1/internal/data_scan_metadata_decorator.h" +#include "google/cloud/dataplex/v1/datascans.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 { @@ -283,3 +287,5 @@ 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_scan_metadata_decorator.h b/google/cloud/dataplex/v1/internal/data_scan_metadata_decorator.h index 826b700b75135..ab3a8a747c13b 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_metadata_decorator.h +++ b/google/cloud/dataplex/v1/internal/data_scan_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataplex/v1/internal/data_scan_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 { @@ -168,4 +171,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_SCAN_METADATA_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/data_scan_option_defaults.cc b/google/cloud/dataplex/v1/internal/data_scan_option_defaults.cc index df13d82ab3815..352e75410448c 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_option_defaults.cc +++ b/google/cloud/dataplex/v1/internal/data_scan_option_defaults.cc @@ -42,7 +42,7 @@ Options DataScanServiceDefaultOptions(Options options) { if (!options.has()) { options.set( dataplex_v1::DataScanServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dataplex/v1/internal/data_scan_stub.cc b/google/cloud/dataplex/v1/internal/data_scan_stub.cc index e07e76f68f99d..e86b6ebc90051 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_stub.cc +++ b/google/cloud/dataplex/v1/internal/data_scan_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dataplex/v1/datascans.proto #include "google/cloud/dataplex/v1/internal/data_scan_stub.h" +#include "google/cloud/dataplex/v1/datascans.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#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 { @@ -343,3 +346,5 @@ 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_scan_stub.h b/google/cloud/dataplex/v1/internal/data_scan_stub.h index 8194d87aec372..0c763bfbb1ee5 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_stub.h +++ b/google/cloud/dataplex/v1/internal/data_scan_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_SCAN_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_SCAN_STUB_H +#include "google/cloud/dataplex/v1/datascans.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 -#include -#include -#include +#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 { @@ -295,4 +298,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_SCAN_STUB_H diff --git a/google/cloud/dataplex/v1/internal/data_scan_stub_factory.cc b/google/cloud/dataplex/v1/internal/data_scan_stub_factory.cc index 22f30c6fc01dc..6c74deb2b8576 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_stub_factory.cc +++ b/google/cloud/dataplex/v1/internal/data_scan_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/dataplex/v1/datascans.proto #include "google/cloud/dataplex/v1/internal/data_scan_stub_factory.h" +#include "google/cloud/dataplex/v1/datascans.grpc.pb.h" #include "google/cloud/dataplex/v1/internal/data_scan_auth_decorator.h" #include "google/cloud/dataplex/v1/internal/data_scan_logging_decorator.h" #include "google/cloud/dataplex/v1/internal/data_scan_metadata_decorator.h" #include "google/cloud/dataplex/v1/internal/data_scan_stub.h" #include "google/cloud/dataplex/v1/internal/data_scan_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 -#include -#include -#include +#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 { @@ -78,3 +81,5 @@ 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_scan_stub_factory.h b/google/cloud/dataplex/v1/internal/data_scan_stub_factory.h index ecaeaa9efa732..9b041d479b5be 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_stub_factory.h +++ b/google/cloud/dataplex/v1/internal/data_scan_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_SCAN_STUB_FACTORY_H diff --git a/google/cloud/dataplex/v1/internal/data_scan_tracing_connection.cc b/google/cloud/dataplex/v1/internal/data_scan_tracing_connection.cc index 8c95fbd7ea0ee..be856afb0a5c0 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_tracing_connection.cc +++ b/google/cloud/dataplex/v1/internal/data_scan_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dataplex_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataScanServiceTracingConnection::DataScanServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -262,16 +260,12 @@ Status DataScanServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataScanServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataplex/v1/internal/data_scan_tracing_connection.h b/google/cloud/dataplex/v1/internal/data_scan_tracing_connection.h index 5eb629adc7121..b60d94ef13cb9 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_tracing_connection.h +++ b/google/cloud/dataplex/v1/internal/data_scan_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataplex_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataScanServiceTracingConnection : public dataplex_v1::DataScanServiceConnection { public: @@ -128,8 +126,6 @@ class DataScanServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataplex/v1/internal/data_scan_tracing_stub.cc b/google/cloud/dataplex/v1/internal/data_scan_tracing_stub.cc index be3c6d908f33c..ca8ce1d9fb306 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_tracing_stub.cc +++ b/google/cloud/dataplex/v1/internal/data_scan_tracing_stub.cc @@ -21,13 +21,14 @@ #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 -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataScanServiceTracingStub::DataScanServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -319,18 +320,14 @@ future DataScanServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataScanServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataplex_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/data_scan_tracing_stub.h b/google/cloud/dataplex/v1/internal/data_scan_tracing_stub.h index 18e5f31aa8ae3..999f33cd0da3c 100644 --- a/google/cloud/dataplex/v1/internal/data_scan_tracing_stub.h +++ b/google/cloud/dataplex/v1/internal/data_scan_tracing_stub.h @@ -25,13 +25,14 @@ #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 -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataScanServiceTracingStub : public DataScanServiceStub { public: ~DataScanServiceTracingStub() override = default; @@ -158,8 +159,6 @@ class DataScanServiceTracingStub : public DataScanServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -174,4 +173,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_SCAN_TRACING_STUB_H diff --git a/google/cloud/dataplex/v1/internal/data_taxonomy_auth_decorator.cc b/google/cloud/dataplex/v1/internal/data_taxonomy_auth_decorator.cc index 177781b94cc0b..f482c03828aff 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_auth_decorator.cc +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataplex/v1/data_taxonomy.proto #include "google/cloud/dataplex/v1/internal/data_taxonomy_auth_decorator.h" -#include +#include "google/cloud/dataplex/v1/data_taxonomy.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -470,3 +473,5 @@ 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_taxonomy_auth_decorator.h b/google/cloud/dataplex/v1/internal/data_taxonomy_auth_decorator.h index 48ca9d750e177..c8005ff92d3bf 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_auth_decorator.h +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataplex/v1/internal/data_taxonomy_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 { @@ -242,4 +245,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_TAXONOMY_AUTH_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/data_taxonomy_connection_impl.h b/google/cloud/dataplex/v1/internal/data_taxonomy_connection_impl.h index 61eb83f336960..eac2af035a718 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_connection_impl.h +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataplex/v1/internal/data_taxonomy_logging_decorator.cc b/google/cloud/dataplex/v1/internal/data_taxonomy_logging_decorator.cc index 63da576503f42..b16780227182d 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_logging_decorator.cc +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataplex/v1/data_taxonomy.proto #include "google/cloud/dataplex/v1/internal/data_taxonomy_logging_decorator.h" +#include "google/cloud/dataplex/v1/data_taxonomy.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -559,3 +562,5 @@ 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_taxonomy_logging_decorator.h b/google/cloud/dataplex/v1/internal/data_taxonomy_logging_decorator.h index 8b02a4936371b..0348c2d12e6fa 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_logging_decorator.h +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataplex/v1/internal/data_taxonomy_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 { @@ -242,4 +245,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_TAXONOMY_LOGGING_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/data_taxonomy_metadata_decorator.cc b/google/cloud/dataplex/v1/internal/data_taxonomy_metadata_decorator.cc index cd384264fb317..758caa96348b8 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_metadata_decorator.cc +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataplex/v1/data_taxonomy.proto #include "google/cloud/dataplex/v1/internal/data_taxonomy_metadata_decorator.h" +#include "google/cloud/dataplex/v1/data_taxonomy.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 { @@ -427,3 +431,5 @@ 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_taxonomy_metadata_decorator.h b/google/cloud/dataplex/v1/internal/data_taxonomy_metadata_decorator.h index d224f2898bd0f..64213cf3d64b0 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_metadata_decorator.h +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataplex/v1/internal/data_taxonomy_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 { @@ -248,4 +251,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_TAXONOMY_METADATA_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/data_taxonomy_option_defaults.cc b/google/cloud/dataplex/v1/internal/data_taxonomy_option_defaults.cc index c4bc8871fa31b..313e014c42e91 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_option_defaults.cc +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_option_defaults.cc @@ -42,7 +42,7 @@ Options DataTaxonomyServiceDefaultOptions(Options options) { if (!options.has()) { options.set( dataplex_v1::DataTaxonomyServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dataplex/v1/internal/data_taxonomy_stub.cc b/google/cloud/dataplex/v1/internal/data_taxonomy_stub.cc index e2ed351342439..27cdbabc29634 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_stub.cc +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dataplex/v1/data_taxonomy.proto #include "google/cloud/dataplex/v1/internal/data_taxonomy_stub.h" +#include "google/cloud/dataplex/v1/data_taxonomy.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#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 { @@ -549,3 +552,5 @@ 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_taxonomy_stub.h b/google/cloud/dataplex/v1/internal/data_taxonomy_stub.h index ed8199fcf4994..1732dd4c45632 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_stub.h +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_TAXONOMY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_TAXONOMY_STUB_H +#include "google/cloud/dataplex/v1/data_taxonomy.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 -#include -#include -#include +#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 { @@ -466,4 +469,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_TAXONOMY_STUB_H diff --git a/google/cloud/dataplex/v1/internal/data_taxonomy_stub_factory.cc b/google/cloud/dataplex/v1/internal/data_taxonomy_stub_factory.cc index 8b022a9791757..7088c562f635d 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_stub_factory.cc +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/dataplex/v1/data_taxonomy.proto #include "google/cloud/dataplex/v1/internal/data_taxonomy_stub_factory.h" +#include "google/cloud/dataplex/v1/data_taxonomy.grpc.pb.h" #include "google/cloud/dataplex/v1/internal/data_taxonomy_auth_decorator.h" #include "google/cloud/dataplex/v1/internal/data_taxonomy_logging_decorator.h" #include "google/cloud/dataplex/v1/internal/data_taxonomy_metadata_decorator.h" #include "google/cloud/dataplex/v1/internal/data_taxonomy_stub.h" #include "google/cloud/dataplex/v1/internal/data_taxonomy_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 -#include -#include -#include +#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 { @@ -78,3 +81,5 @@ 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_taxonomy_stub_factory.h b/google/cloud/dataplex/v1/internal/data_taxonomy_stub_factory.h index cd5413db502e7..ab126ffa9372e 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_stub_factory.h +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_TAXONOMY_STUB_FACTORY_H diff --git a/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_connection.cc b/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_connection.cc index 0006a14ec6c35..f74b1f29fcbb6 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_connection.cc +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dataplex_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataTaxonomyServiceTracingConnection::DataTaxonomyServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -465,17 +463,13 @@ Status DataTaxonomyServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataTaxonomyServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_connection.h b/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_connection.h index a7c456744ec4b..08a1d0b33a376 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_connection.h +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataplex_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataTaxonomyServiceTracingConnection : public dataplex_v1::DataTaxonomyServiceConnection { public: @@ -215,8 +213,6 @@ class DataTaxonomyServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_stub.cc b/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_stub.cc index 689db83e3d457..77ad86ef6b4e0 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_stub.cc +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_stub.cc @@ -21,13 +21,14 @@ #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 -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataTaxonomyServiceTracingStub::DataTaxonomyServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -500,18 +501,14 @@ future DataTaxonomyServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataTaxonomyServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataplex_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_stub.h b/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_stub.h index ff196826e1557..b28ce70de7882 100644 --- a/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_stub.h +++ b/google/cloud/dataplex/v1/internal/data_taxonomy_tracing_stub.h @@ -25,13 +25,14 @@ #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 -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataTaxonomyServiceTracingStub : public DataTaxonomyServiceStub { public: ~DataTaxonomyServiceTracingStub() override = default; @@ -238,8 +239,6 @@ class DataTaxonomyServiceTracingStub : public DataTaxonomyServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -254,4 +253,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_TAXONOMY_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 a92508ba657d6..c28ff02a9e375 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_auth_decorator.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataplex/v1/service.proto #include "google/cloud/dataplex/v1/internal/dataplex_auth_decorator.h" -#include +#include "google/cloud/dataplex/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -496,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, @@ -722,3 +614,5 @@ 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/dataplex_auth_decorator.h b/google/cloud/dataplex/v1/internal/dataplex_auth_decorator.h index 806044ec00d1e..6acdd86a58cea 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_auth_decorator.h +++ b/google/cloud/dataplex/v1/internal/dataplex_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataplex/v1/internal/dataplex_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 { @@ -222,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; @@ -330,4 +283,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATAPLEX_AUTH_DECORATOR_H 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 0103c766fc611..18ecbadb5400f 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_connection_impl.h +++ b/google/cloud/dataplex/v1/internal/dataplex_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 deee104d94539..4bd547d224b0a 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_logging_decorator.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataplex/v1/service.proto #include "google/cloud/dataplex/v1/internal/dataplex_logging_decorator.h" +#include "google/cloud/dataplex/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -560,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, @@ -835,3 +704,5 @@ 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/dataplex_logging_decorator.h b/google/cloud/dataplex/v1/internal/dataplex_logging_decorator.h index 508c3f78e371b..2e6007e2b0a42 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_logging_decorator.h +++ b/google/cloud/dataplex/v1/internal/dataplex_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataplex/v1/internal/dataplex_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 { @@ -222,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; @@ -330,4 +283,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATAPLEX_LOGGING_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.cc b/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.cc index 2745afd776409..c45d9c58f5d41 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataplex/v1/service.proto #include "google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.h" +#include "google/cloud/dataplex/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 { @@ -421,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, @@ -632,3 +544,5 @@ 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/dataplex_metadata_decorator.h b/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.h index 1aed7959892a7..ed34a890b77c2 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.h +++ b/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataplex/v1/internal/dataplex_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 { @@ -223,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; @@ -336,4 +289,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATAPLEX_METADATA_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/dataplex_option_defaults.cc b/google/cloud/dataplex/v1/internal/dataplex_option_defaults.cc index fb30290141e84..ad9158e44cbfe 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_option_defaults.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_option_defaults.cc @@ -41,7 +41,7 @@ Options DataplexServiceDefaultOptions(Options options) { if (!options.has()) { options.set( dataplex_v1::DataplexServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dataplex/v1/internal/dataplex_stub.cc b/google/cloud/dataplex/v1/internal/dataplex_stub.cc index 6bcc28b96ff6d..fed71186762cc 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_stub.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dataplex/v1/service.proto #include "google/cloud/dataplex/v1/internal/dataplex_stub.h" +#include "google/cloud/dataplex/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#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 { @@ -557,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&, @@ -834,3 +708,5 @@ 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/dataplex_stub.h b/google/cloud/dataplex/v1/internal/dataplex_stub.h index 8f93b59e4d487..22275af06d423 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_stub.h +++ b/google/cloud/dataplex/v1/internal/dataplex_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATAPLEX_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATAPLEX_STUB_H +#include "google/cloud/dataplex/v1/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 -#include -#include -#include +#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 { @@ -223,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, @@ -520,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; @@ -633,4 +539,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATAPLEX_STUB_H diff --git a/google/cloud/dataplex/v1/internal/dataplex_stub_factory.cc b/google/cloud/dataplex/v1/internal/dataplex_stub_factory.cc index c77cb9d46279c..f4e7dad9e2374 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_stub_factory.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.h" #include "google/cloud/dataplex/v1/internal/dataplex_stub.h" #include "google/cloud/dataplex/v1/internal/dataplex_tracing_stub.h" +#include "google/cloud/dataplex/v1/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 -#include -#include -#include +#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 { @@ -78,3 +81,5 @@ 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/dataplex_stub_factory.h b/google/cloud/dataplex/v1/internal/dataplex_stub_factory.h index 7394633f54bbe..4e552b928404a 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_stub_factory.h +++ b/google/cloud/dataplex/v1/internal/dataplex_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATAPLEX_STUB_FACTORY_H diff --git a/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.cc b/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.cc index 32f5b04babdee..1962716efcb97 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dataplex_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataplexServiceTracingConnection::DataplexServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -510,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) { @@ -714,16 +591,12 @@ Status DataplexServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataplexServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.h b/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.h index abe90dd27735b..faacb0226046a 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.h +++ b/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataplex_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataplexServiceTracingConnection : public dataplex_v1::DataplexServiceConnection { public: @@ -205,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; @@ -282,8 +234,6 @@ class DataplexServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.cc b/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.cc index 6492eb83c7fc0..175e22b52a66d 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.cc @@ -21,13 +21,14 @@ #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 -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataplexServiceTracingStub::DataplexServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -510,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, @@ -759,18 +643,14 @@ future DataplexServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataplexServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataplex_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.h b/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.h index c12e67cca3a91..826e6cb62b3d0 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.h +++ b/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.h @@ -25,13 +25,14 @@ #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 -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataplexServiceTracingStub : public DataplexServiceStub { public: ~DataplexServiceTracingStub() override = default; @@ -222,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; @@ -326,8 +277,6 @@ class DataplexServiceTracingStub : public DataplexServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -342,4 +291,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATAPLEX_TRACING_STUB_H diff --git a/google/cloud/dataplex/v1/internal/metadata_auth_decorator.cc b/google/cloud/dataplex/v1/internal/metadata_auth_decorator.cc index 7e0a06b072dae..b20b0e0be032e 100644 --- a/google/cloud/dataplex/v1/internal/metadata_auth_decorator.cc +++ b/google/cloud/dataplex/v1/internal/metadata_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataplex/v1/metadata.proto #include "google/cloud/dataplex/v1/internal/metadata_auth_decorator.h" -#include +#include "google/cloud/dataplex/v1/metadata.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -186,3 +189,5 @@ 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/metadata_auth_decorator.h b/google/cloud/dataplex/v1/internal/metadata_auth_decorator.h index c2cf972495f6c..1d54e82c20266 100644 --- a/google/cloud/dataplex/v1/internal/metadata_auth_decorator.h +++ b/google/cloud/dataplex/v1/internal/metadata_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -123,4 +126,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_METADATA_AUTH_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/metadata_logging_decorator.cc b/google/cloud/dataplex/v1/internal/metadata_logging_decorator.cc index 15858bd0d8234..d9608256ed3e0 100644 --- a/google/cloud/dataplex/v1/internal/metadata_logging_decorator.cc +++ b/google/cloud/dataplex/v1/internal/metadata_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataplex/v1/metadata.proto #include "google/cloud/dataplex/v1/internal/metadata_logging_decorator.h" +#include "google/cloud/dataplex/v1/metadata.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -249,3 +252,5 @@ 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/metadata_logging_decorator.h b/google/cloud/dataplex/v1/internal/metadata_logging_decorator.h index 786be757ab6bf..7153ebea37285 100644 --- a/google/cloud/dataplex/v1/internal/metadata_logging_decorator.h +++ b/google/cloud/dataplex/v1/internal/metadata_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -123,4 +126,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_METADATA_LOGGING_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/metadata_metadata_decorator.cc b/google/cloud/dataplex/v1/internal/metadata_metadata_decorator.cc index 90b610f69f31b..48c8c0a2791ae 100644 --- a/google/cloud/dataplex/v1/internal/metadata_metadata_decorator.cc +++ b/google/cloud/dataplex/v1/internal/metadata_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataplex/v1/metadata.proto #include "google/cloud/dataplex/v1/internal/metadata_metadata_decorator.h" +#include "google/cloud/dataplex/v1/metadata.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 { @@ -220,3 +224,5 @@ 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/metadata_metadata_decorator.h b/google/cloud/dataplex/v1/internal/metadata_metadata_decorator.h index 24503f968c317..cf51fab00d52b 100644 --- a/google/cloud/dataplex/v1/internal/metadata_metadata_decorator.h +++ b/google/cloud/dataplex/v1/internal/metadata_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_METADATA_METADATA_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/metadata_option_defaults.cc b/google/cloud/dataplex/v1/internal/metadata_option_defaults.cc index e56fb16c079a6..f76bd4593d22e 100644 --- a/google/cloud/dataplex/v1/internal/metadata_option_defaults.cc +++ b/google/cloud/dataplex/v1/internal/metadata_option_defaults.cc @@ -41,7 +41,7 @@ Options MetadataServiceDefaultOptions(Options options) { if (!options.has()) { options.set( dataplex_v1::MetadataServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dataplex/v1/internal/metadata_stub.cc b/google/cloud/dataplex/v1/internal/metadata_stub.cc index 42391f6a483e1..a4c33b05b8382 100644 --- a/google/cloud/dataplex/v1/internal/metadata_stub.cc +++ b/google/cloud/dataplex/v1/internal/metadata_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dataplex/v1/metadata.proto #include "google/cloud/dataplex/v1/internal/metadata_stub.h" +#include "google/cloud/dataplex/v1/metadata.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -245,3 +248,5 @@ 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/metadata_stub.h b/google/cloud/dataplex/v1/internal/metadata_stub.h index 987c7a1d06834..313182a5f3209 100644 --- a/google/cloud/dataplex/v1/internal/metadata_stub.h +++ b/google/cloud/dataplex/v1/internal/metadata_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_METADATA_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_METADATA_STUB_H +#include "google/cloud/dataplex/v1/metadata.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 -#include -#include -#include +#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 { @@ -221,4 +224,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_METADATA_STUB_H diff --git a/google/cloud/dataplex/v1/internal/metadata_stub_factory.cc b/google/cloud/dataplex/v1/internal/metadata_stub_factory.cc index a9d33ef63353e..f42de38093e93 100644 --- a/google/cloud/dataplex/v1/internal/metadata_stub_factory.cc +++ b/google/cloud/dataplex/v1/internal/metadata_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/dataplex/v1/internal/metadata_metadata_decorator.h" #include "google/cloud/dataplex/v1/internal/metadata_stub.h" #include "google/cloud/dataplex/v1/internal/metadata_tracing_stub.h" +#include "google/cloud/dataplex/v1/metadata.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 -#include -#include -#include +#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 { @@ -79,3 +82,5 @@ 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/metadata_stub_factory.h b/google/cloud/dataplex/v1/internal/metadata_stub_factory.h index 68646c0668791..8823b4afce604 100644 --- a/google/cloud/dataplex/v1/internal/metadata_stub_factory.h +++ b/google/cloud/dataplex/v1/internal/metadata_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataplex_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_METADATA_STUB_FACTORY_H diff --git a/google/cloud/dataplex/v1/internal/metadata_tracing_connection.cc b/google/cloud/dataplex/v1/internal/metadata_tracing_connection.cc index 2ed4ace9cd05a..b77e8863dd984 100644 --- a/google/cloud/dataplex/v1/internal/metadata_tracing_connection.cc +++ b/google/cloud/dataplex/v1/internal/metadata_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dataplex_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MetadataServiceTracingConnection::MetadataServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -199,16 +197,12 @@ Status MetadataServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMetadataServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataplex/v1/internal/metadata_tracing_connection.h b/google/cloud/dataplex/v1/internal/metadata_tracing_connection.h index b703eec1cfa2a..e4c1ee933fc7f 100644 --- a/google/cloud/dataplex/v1/internal/metadata_tracing_connection.h +++ b/google/cloud/dataplex/v1/internal/metadata_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataplex_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MetadataServiceTracingConnection : public dataplex_v1::MetadataServiceConnection { public: @@ -100,8 +98,6 @@ class MetadataServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataplex/v1/internal/metadata_tracing_stub.cc b/google/cloud/dataplex/v1/internal/metadata_tracing_stub.cc index bff040df06516..3aafc92119f85 100644 --- a/google/cloud/dataplex/v1/internal/metadata_tracing_stub.cc +++ b/google/cloud/dataplex/v1/internal/metadata_tracing_stub.cc @@ -21,13 +21,14 @@ #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 -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MetadataServiceTracingStub::MetadataServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -242,18 +243,14 @@ Status MetadataServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMetadataServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataplex_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/metadata_tracing_stub.h b/google/cloud/dataplex/v1/internal/metadata_tracing_stub.h index 43bd2d4b51804..8e5f9df34302d 100644 --- a/google/cloud/dataplex/v1/internal/metadata_tracing_stub.h +++ b/google/cloud/dataplex/v1/internal/metadata_tracing_stub.h @@ -25,13 +25,14 @@ #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 -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MetadataServiceTracingStub : public MetadataServiceStub { public: ~MetadataServiceTracingStub() override = default; @@ -120,8 +121,6 @@ class MetadataServiceTracingStub : public MetadataServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -136,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_METADATA_TRACING_STUB_H 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/metadata_connection.h b/google/cloud/dataplex/v1/metadata_connection.h index 4bc74ba4b82aa..2524e1d5dcff9 100644 --- a/google/cloud/dataplex/v1/metadata_connection.h +++ b/google/cloud/dataplex/v1/metadata_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_METADATA_CONNECTION_H #include "google/cloud/dataplex/v1/internal/metadata_retry_traits.h" +#include "google/cloud/dataplex/v1/metadata.pb.h" #include "google/cloud/dataplex/v1/metadata_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/dataplex/v1/metadata_connection_idempotency_policy.h b/google/cloud/dataplex/v1/metadata_connection_idempotency_policy.h index 981d20cc77cbf..9d6423f496939 100644 --- a/google/cloud/dataplex/v1/metadata_connection_idempotency_policy.h +++ b/google/cloud/dataplex/v1/metadata_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_METADATA_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_METADATA_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataplex/v1/metadata.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/BUILD.bazel b/google/cloud/dataproc/BUILD.bazel index 995a3c6c8aa79..d0ed32571c296 100644 --- a/google/cloud/dataproc/BUILD.bazel +++ b/google/cloud/dataproc/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/dataproc/v1:dataproc_cc_grpc", + "@googleapis//google/cloud/dataproc/v1:dataproc_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/dataproc/CMakeLists.txt b/google/cloud/dataproc/CMakeLists.txt index b49c7ddf0216f..b19f3a6af2cc0 100644 --- a/google/cloud/dataproc/CMakeLists.txt +++ b/google/cloud/dataproc/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(dataproc "Cloud Dataproc API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(dataproc_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/dataproc/autoscaling_policy_client.h b/google/cloud/dataproc/autoscaling_policy_client.h deleted file mode 100644 index f5e12a6a7390e..0000000000000 --- a/google/cloud/dataproc/autoscaling_policy_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/autoscaling_policies.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_AUTOSCALING_POLICY_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_AUTOSCALING_POLICY_CLIENT_H - -#include "google/cloud/dataproc/autoscaling_policy_connection.h" -#include "google/cloud/dataproc/v1/autoscaling_policy_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataproc_v1 instead of the aliases defined in -/// this namespace. -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::AutoscalingPolicyServiceClient directly. -using ::google::cloud::dataproc_v1::AutoscalingPolicyServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_AUTOSCALING_POLICY_CLIENT_H diff --git a/google/cloud/dataproc/autoscaling_policy_connection.h b/google/cloud/dataproc/autoscaling_policy_connection.h deleted file mode 100644 index 44132df27d903..0000000000000 --- a/google/cloud/dataproc/autoscaling_policy_connection.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/autoscaling_policies.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_AUTOSCALING_POLICY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_AUTOSCALING_POLICY_CONNECTION_H - -#include "google/cloud/dataproc/autoscaling_policy_connection_idempotency_policy.h" -#include "google/cloud/dataproc/v1/autoscaling_policy_connection.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::MakeAutoscalingPolicyServiceConnection -/// directly. -using ::google::cloud::dataproc_v1::MakeAutoscalingPolicyServiceConnection; - -/// @deprecated Use dataproc_v1::AutoscalingPolicyServiceConnection directly. -using ::google::cloud::dataproc_v1::AutoscalingPolicyServiceConnection; - -/// @deprecated Use -/// dataproc_v1::AutoscalingPolicyServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::dataproc_v1:: - AutoscalingPolicyServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use dataproc_v1::AutoscalingPolicyServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::dataproc_v1:: - AutoscalingPolicyServiceLimitedTimeRetryPolicy; - -/// @deprecated Use dataproc_v1::AutoscalingPolicyServiceRetryPolicy directly. -using ::google::cloud::dataproc_v1::AutoscalingPolicyServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_AUTOSCALING_POLICY_CONNECTION_H diff --git a/google/cloud/dataproc/autoscaling_policy_connection_idempotency_policy.h b/google/cloud/dataproc/autoscaling_policy_connection_idempotency_policy.h deleted file mode 100644 index a2bad9f973914..0000000000000 --- a/google/cloud/dataproc/autoscaling_policy_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/autoscaling_policies.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_AUTOSCALING_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_AUTOSCALING_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/dataproc/v1/autoscaling_policy_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// dataproc_v1::MakeDefaultAutoscalingPolicyServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::dataproc_v1:: - MakeDefaultAutoscalingPolicyServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// dataproc_v1::AutoscalingPolicyServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::dataproc_v1:: - AutoscalingPolicyServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_AUTOSCALING_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/dataproc/autoscaling_policy_options.h b/google/cloud/dataproc/autoscaling_policy_options.h deleted file mode 100644 index 340bceeab9a9b..0000000000000 --- a/google/cloud/dataproc/autoscaling_policy_options.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/autoscaling_policies.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_AUTOSCALING_POLICY_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_AUTOSCALING_POLICY_OPTIONS_H - -#include "google/cloud/dataproc/autoscaling_policy_connection.h" -#include "google/cloud/dataproc/autoscaling_policy_connection_idempotency_policy.h" -#include "google/cloud/dataproc/v1/autoscaling_policy_options.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::AutoscalingPolicyServiceBackoffPolicyOption -/// directly. -using ::google::cloud::dataproc_v1::AutoscalingPolicyServiceBackoffPolicyOption; - -/// @deprecated Use -/// dataproc_v1::AutoscalingPolicyServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::dataproc_v1:: - AutoscalingPolicyServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use dataproc_v1::AutoscalingPolicyServicePolicyOptionList -/// directly. -using ::google::cloud::dataproc_v1::AutoscalingPolicyServicePolicyOptionList; - -/// @deprecated Use dataproc_v1::AutoscalingPolicyServiceRetryPolicyOption -/// directly. -using ::google::cloud::dataproc_v1::AutoscalingPolicyServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_AUTOSCALING_POLICY_OPTIONS_H diff --git a/google/cloud/dataproc/batch_controller_client.h b/google/cloud/dataproc/batch_controller_client.h deleted file mode 100644 index e87117e47ea03..0000000000000 --- a/google/cloud/dataproc/batch_controller_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/batches.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_BATCH_CONTROLLER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_BATCH_CONTROLLER_CLIENT_H - -#include "google/cloud/dataproc/batch_controller_connection.h" -#include "google/cloud/dataproc/v1/batch_controller_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataproc_v1 instead of the aliases defined in -/// this namespace. -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::BatchControllerClient directly. -using ::google::cloud::dataproc_v1::BatchControllerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_BATCH_CONTROLLER_CLIENT_H diff --git a/google/cloud/dataproc/batch_controller_connection.h b/google/cloud/dataproc/batch_controller_connection.h deleted file mode 100644 index c7e1ac545cdbb..0000000000000 --- a/google/cloud/dataproc/batch_controller_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/batches.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_BATCH_CONTROLLER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_BATCH_CONTROLLER_CONNECTION_H - -#include "google/cloud/dataproc/batch_controller_connection_idempotency_policy.h" -#include "google/cloud/dataproc/v1/batch_controller_connection.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::MakeBatchControllerConnection directly. -using ::google::cloud::dataproc_v1::MakeBatchControllerConnection; - -/// @deprecated Use dataproc_v1::BatchControllerConnection directly. -using ::google::cloud::dataproc_v1::BatchControllerConnection; - -/// @deprecated Use dataproc_v1::BatchControllerLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::dataproc_v1::BatchControllerLimitedErrorCountRetryPolicy; - -/// @deprecated Use dataproc_v1::BatchControllerLimitedTimeRetryPolicy directly. -using ::google::cloud::dataproc_v1::BatchControllerLimitedTimeRetryPolicy; - -/// @deprecated Use dataproc_v1::BatchControllerRetryPolicy directly. -using ::google::cloud::dataproc_v1::BatchControllerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_BATCH_CONTROLLER_CONNECTION_H diff --git a/google/cloud/dataproc/batch_controller_connection_idempotency_policy.h b/google/cloud/dataproc/batch_controller_connection_idempotency_policy.h deleted file mode 100644 index 02c222cb71b5b..0000000000000 --- a/google/cloud/dataproc/batch_controller_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/batches.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_BATCH_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_BATCH_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/dataproc/v1/batch_controller_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// dataproc_v1::MakeDefaultBatchControllerConnectionIdempotencyPolicy directly. -using ::google::cloud::dataproc_v1:: - MakeDefaultBatchControllerConnectionIdempotencyPolicy; - -/// @deprecated Use dataproc_v1::BatchControllerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::dataproc_v1::BatchControllerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_BATCH_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/dataproc/batch_controller_options.h b/google/cloud/dataproc/batch_controller_options.h deleted file mode 100644 index 45903839728c4..0000000000000 --- a/google/cloud/dataproc/batch_controller_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/batches.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_BATCH_CONTROLLER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_BATCH_CONTROLLER_OPTIONS_H - -#include "google/cloud/dataproc/batch_controller_connection.h" -#include "google/cloud/dataproc/batch_controller_connection_idempotency_policy.h" -#include "google/cloud/dataproc/v1/batch_controller_options.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::BatchControllerPollingPolicyOption directly. -using ::google::cloud::dataproc_v1::BatchControllerPollingPolicyOption; - -/// @deprecated Use dataproc_v1::BatchControllerBackoffPolicyOption directly. -using ::google::cloud::dataproc_v1::BatchControllerBackoffPolicyOption; - -/// @deprecated Use -/// dataproc_v1::BatchControllerConnectionIdempotencyPolicyOption directly. -using ::google::cloud::dataproc_v1:: - BatchControllerConnectionIdempotencyPolicyOption; - -/// @deprecated Use dataproc_v1::BatchControllerPolicyOptionList directly. -using ::google::cloud::dataproc_v1::BatchControllerPolicyOptionList; - -/// @deprecated Use dataproc_v1::BatchControllerRetryPolicyOption directly. -using ::google::cloud::dataproc_v1::BatchControllerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_BATCH_CONTROLLER_OPTIONS_H diff --git a/google/cloud/dataproc/cluster_controller_client.h b/google/cloud/dataproc/cluster_controller_client.h deleted file mode 100644 index 83c38621c244e..0000000000000 --- a/google/cloud/dataproc/cluster_controller_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/clusters.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_CLUSTER_CONTROLLER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_CLUSTER_CONTROLLER_CLIENT_H - -#include "google/cloud/dataproc/cluster_controller_connection.h" -#include "google/cloud/dataproc/v1/cluster_controller_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataproc_v1 instead of the aliases defined in -/// this namespace. -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::ClusterControllerClient directly. -using ::google::cloud::dataproc_v1::ClusterControllerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_CLUSTER_CONTROLLER_CLIENT_H diff --git a/google/cloud/dataproc/cluster_controller_connection.h b/google/cloud/dataproc/cluster_controller_connection.h deleted file mode 100644 index d0e87428a0741..0000000000000 --- a/google/cloud/dataproc/cluster_controller_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/clusters.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_CLUSTER_CONTROLLER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_CLUSTER_CONTROLLER_CONNECTION_H - -#include "google/cloud/dataproc/cluster_controller_connection_idempotency_policy.h" -#include "google/cloud/dataproc/v1/cluster_controller_connection.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::MakeClusterControllerConnection directly. -using ::google::cloud::dataproc_v1::MakeClusterControllerConnection; - -/// @deprecated Use dataproc_v1::ClusterControllerConnection directly. -using ::google::cloud::dataproc_v1::ClusterControllerConnection; - -/// @deprecated Use dataproc_v1::ClusterControllerLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::dataproc_v1:: - ClusterControllerLimitedErrorCountRetryPolicy; - -/// @deprecated Use dataproc_v1::ClusterControllerLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::dataproc_v1::ClusterControllerLimitedTimeRetryPolicy; - -/// @deprecated Use dataproc_v1::ClusterControllerRetryPolicy directly. -using ::google::cloud::dataproc_v1::ClusterControllerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_CLUSTER_CONTROLLER_CONNECTION_H diff --git a/google/cloud/dataproc/cluster_controller_connection_idempotency_policy.h b/google/cloud/dataproc/cluster_controller_connection_idempotency_policy.h deleted file mode 100644 index bed79b2d48f8d..0000000000000 --- a/google/cloud/dataproc/cluster_controller_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/clusters.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_CLUSTER_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_CLUSTER_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/dataproc/v1/cluster_controller_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// dataproc_v1::MakeDefaultClusterControllerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::dataproc_v1:: - MakeDefaultClusterControllerConnectionIdempotencyPolicy; - -/// @deprecated Use dataproc_v1::ClusterControllerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::dataproc_v1:: - ClusterControllerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_CLUSTER_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/dataproc/cluster_controller_options.h b/google/cloud/dataproc/cluster_controller_options.h deleted file mode 100644 index 8ae4dd0d332f3..0000000000000 --- a/google/cloud/dataproc/cluster_controller_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/clusters.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_CLUSTER_CONTROLLER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_CLUSTER_CONTROLLER_OPTIONS_H - -#include "google/cloud/dataproc/cluster_controller_connection.h" -#include "google/cloud/dataproc/cluster_controller_connection_idempotency_policy.h" -#include "google/cloud/dataproc/v1/cluster_controller_options.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::ClusterControllerPollingPolicyOption directly. -using ::google::cloud::dataproc_v1::ClusterControllerPollingPolicyOption; - -/// @deprecated Use dataproc_v1::ClusterControllerBackoffPolicyOption directly. -using ::google::cloud::dataproc_v1::ClusterControllerBackoffPolicyOption; - -/// @deprecated Use -/// dataproc_v1::ClusterControllerConnectionIdempotencyPolicyOption directly. -using ::google::cloud::dataproc_v1:: - ClusterControllerConnectionIdempotencyPolicyOption; - -/// @deprecated Use dataproc_v1::ClusterControllerPolicyOptionList directly. -using ::google::cloud::dataproc_v1::ClusterControllerPolicyOptionList; - -/// @deprecated Use dataproc_v1::ClusterControllerRetryPolicyOption directly. -using ::google::cloud::dataproc_v1::ClusterControllerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_CLUSTER_CONTROLLER_OPTIONS_H diff --git a/google/cloud/dataproc/job_controller_client.h b/google/cloud/dataproc/job_controller_client.h deleted file mode 100644 index 0a89036c04fe4..0000000000000 --- a/google/cloud/dataproc/job_controller_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/jobs.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_JOB_CONTROLLER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_JOB_CONTROLLER_CLIENT_H - -#include "google/cloud/dataproc/job_controller_connection.h" -#include "google/cloud/dataproc/v1/job_controller_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataproc_v1 instead of the aliases defined in -/// this namespace. -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::JobControllerClient directly. -using ::google::cloud::dataproc_v1::JobControllerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_JOB_CONTROLLER_CLIENT_H diff --git a/google/cloud/dataproc/job_controller_connection.h b/google/cloud/dataproc/job_controller_connection.h deleted file mode 100644 index a43952619b904..0000000000000 --- a/google/cloud/dataproc/job_controller_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/jobs.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_JOB_CONTROLLER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_JOB_CONTROLLER_CONNECTION_H - -#include "google/cloud/dataproc/job_controller_connection_idempotency_policy.h" -#include "google/cloud/dataproc/v1/job_controller_connection.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::MakeJobControllerConnection directly. -using ::google::cloud::dataproc_v1::MakeJobControllerConnection; - -/// @deprecated Use dataproc_v1::JobControllerConnection directly. -using ::google::cloud::dataproc_v1::JobControllerConnection; - -/// @deprecated Use dataproc_v1::JobControllerLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::dataproc_v1::JobControllerLimitedErrorCountRetryPolicy; - -/// @deprecated Use dataproc_v1::JobControllerLimitedTimeRetryPolicy directly. -using ::google::cloud::dataproc_v1::JobControllerLimitedTimeRetryPolicy; - -/// @deprecated Use dataproc_v1::JobControllerRetryPolicy directly. -using ::google::cloud::dataproc_v1::JobControllerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_JOB_CONTROLLER_CONNECTION_H diff --git a/google/cloud/dataproc/job_controller_connection_idempotency_policy.h b/google/cloud/dataproc/job_controller_connection_idempotency_policy.h deleted file mode 100644 index 93c55dd89ba63..0000000000000 --- a/google/cloud/dataproc/job_controller_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/jobs.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_JOB_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_JOB_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/dataproc/v1/job_controller_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// dataproc_v1::MakeDefaultJobControllerConnectionIdempotencyPolicy directly. -using ::google::cloud::dataproc_v1:: - MakeDefaultJobControllerConnectionIdempotencyPolicy; - -/// @deprecated Use dataproc_v1::JobControllerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::dataproc_v1::JobControllerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_JOB_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/dataproc/job_controller_options.h b/google/cloud/dataproc/job_controller_options.h deleted file mode 100644 index cc39bc908a9d4..0000000000000 --- a/google/cloud/dataproc/job_controller_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/jobs.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_JOB_CONTROLLER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_JOB_CONTROLLER_OPTIONS_H - -#include "google/cloud/dataproc/job_controller_connection.h" -#include "google/cloud/dataproc/job_controller_connection_idempotency_policy.h" -#include "google/cloud/dataproc/v1/job_controller_options.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::JobControllerPollingPolicyOption directly. -using ::google::cloud::dataproc_v1::JobControllerPollingPolicyOption; - -/// @deprecated Use dataproc_v1::JobControllerBackoffPolicyOption directly. -using ::google::cloud::dataproc_v1::JobControllerBackoffPolicyOption; - -/// @deprecated Use dataproc_v1::JobControllerConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::dataproc_v1:: - JobControllerConnectionIdempotencyPolicyOption; - -/// @deprecated Use dataproc_v1::JobControllerPolicyOptionList directly. -using ::google::cloud::dataproc_v1::JobControllerPolicyOptionList; - -/// @deprecated Use dataproc_v1::JobControllerRetryPolicyOption directly. -using ::google::cloud::dataproc_v1::JobControllerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_JOB_CONTROLLER_OPTIONS_H diff --git a/google/cloud/dataproc/mocks/mock_autoscaling_policy_connection.h b/google/cloud/dataproc/mocks/mock_autoscaling_policy_connection.h deleted file mode 100644 index 606b48a9bbeb5..0000000000000 --- a/google/cloud/dataproc/mocks/mock_autoscaling_policy_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/autoscaling_policies.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_AUTOSCALING_POLICY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_AUTOSCALING_POLICY_CONNECTION_H - -#include "google/cloud/dataproc/autoscaling_policy_connection.h" -#include "google/cloud/dataproc/v1/mocks/mock_autoscaling_policy_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataproc_v1_mocks instead of the aliases -/// defined in this namespace. -namespace dataproc_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1_mocks::MockAutoscalingPolicyServiceConnection -/// directly. -using ::google::cloud::dataproc_v1_mocks:: - MockAutoscalingPolicyServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_AUTOSCALING_POLICY_CONNECTION_H diff --git a/google/cloud/dataproc/mocks/mock_batch_controller_connection.h b/google/cloud/dataproc/mocks/mock_batch_controller_connection.h deleted file mode 100644 index 2d4cfb7149e4c..0000000000000 --- a/google/cloud/dataproc/mocks/mock_batch_controller_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/batches.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_BATCH_CONTROLLER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_BATCH_CONTROLLER_CONNECTION_H - -#include "google/cloud/dataproc/batch_controller_connection.h" -#include "google/cloud/dataproc/v1/mocks/mock_batch_controller_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataproc_v1_mocks instead of the aliases -/// defined in this namespace. -namespace dataproc_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1_mocks::MockBatchControllerConnection directly. -using ::google::cloud::dataproc_v1_mocks::MockBatchControllerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_BATCH_CONTROLLER_CONNECTION_H diff --git a/google/cloud/dataproc/mocks/mock_cluster_controller_connection.h b/google/cloud/dataproc/mocks/mock_cluster_controller_connection.h deleted file mode 100644 index bdbb619cc9a81..0000000000000 --- a/google/cloud/dataproc/mocks/mock_cluster_controller_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/clusters.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_CLUSTER_CONTROLLER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_CLUSTER_CONTROLLER_CONNECTION_H - -#include "google/cloud/dataproc/cluster_controller_connection.h" -#include "google/cloud/dataproc/v1/mocks/mock_cluster_controller_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataproc_v1_mocks instead of the aliases -/// defined in this namespace. -namespace dataproc_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1_mocks::MockClusterControllerConnection directly. -using ::google::cloud::dataproc_v1_mocks::MockClusterControllerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_CLUSTER_CONTROLLER_CONNECTION_H diff --git a/google/cloud/dataproc/mocks/mock_job_controller_connection.h b/google/cloud/dataproc/mocks/mock_job_controller_connection.h deleted file mode 100644 index 34dbf77570b5f..0000000000000 --- a/google/cloud/dataproc/mocks/mock_job_controller_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/jobs.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_JOB_CONTROLLER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_JOB_CONTROLLER_CONNECTION_H - -#include "google/cloud/dataproc/job_controller_connection.h" -#include "google/cloud/dataproc/v1/mocks/mock_job_controller_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataproc_v1_mocks instead of the aliases -/// defined in this namespace. -namespace dataproc_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1_mocks::MockJobControllerConnection directly. -using ::google::cloud::dataproc_v1_mocks::MockJobControllerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_JOB_CONTROLLER_CONNECTION_H diff --git a/google/cloud/dataproc/mocks/mock_workflow_template_connection.h b/google/cloud/dataproc/mocks/mock_workflow_template_connection.h deleted file mode 100644 index 511c74567f417..0000000000000 --- a/google/cloud/dataproc/mocks/mock_workflow_template_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/workflow_templates.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_WORKFLOW_TEMPLATE_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_WORKFLOW_TEMPLATE_CONNECTION_H - -#include "google/cloud/dataproc/v1/mocks/mock_workflow_template_connection.h" -#include "google/cloud/dataproc/workflow_template_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataproc_v1_mocks instead of the aliases -/// defined in this namespace. -namespace dataproc_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1_mocks::MockWorkflowTemplateServiceConnection -/// directly. -using ::google::cloud::dataproc_v1_mocks::MockWorkflowTemplateServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_MOCKS_MOCK_WORKFLOW_TEMPLATE_CONNECTION_H diff --git a/google/cloud/dataproc/quickstart/.bazelrc b/google/cloud/dataproc/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/dataproc/quickstart/.bazelrc +++ b/google/cloud/dataproc/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/dataproc/quickstart/CMakeLists.txt index 8e5f4ae5ee87e..264c92c2b4a5d 100644 --- a/google/cloud/dataproc/quickstart/CMakeLists.txt +++ b/google/cloud/dataproc/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Dataproc API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-dataproc-quickstart CXX) find_package(google_cloud_cpp_dataproc REQUIRED) diff --git a/google/cloud/dataproc/quickstart/WORKSPACE.bazel b/google/cloud/dataproc/quickstart/WORKSPACE.bazel index bb53dee74ca36..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 = "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/dataproc/v1/autoscaling_policy_client.h b/google/cloud/dataproc/v1/autoscaling_policy_client.h index 91b8d82406b4a..6f8ee20004943 100644 --- a/google/cloud/dataproc/v1/autoscaling_policy_client.h +++ b/google/cloud/dataproc/v1/autoscaling_policy_client.h @@ -120,7 +120,7 @@ class AutoscalingPolicyServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.AutoscalingPolicy]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L112} - /// [google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L274} + /// [google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L292} /// // clang-format on StatusOr @@ -153,7 +153,7 @@ class AutoscalingPolicyServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.AutoscalingPolicy]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L112} - /// [google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L274} + /// [google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L292} /// // clang-format on StatusOr @@ -184,7 +184,7 @@ class AutoscalingPolicyServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.AutoscalingPolicy]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L112} - /// [google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L317} + /// [google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L335} /// // clang-format on StatusOr @@ -219,7 +219,7 @@ class AutoscalingPolicyServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.AutoscalingPolicy]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L112} - /// [google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L317} + /// [google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L335} /// // clang-format on StatusOr @@ -256,7 +256,7 @@ class AutoscalingPolicyServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.AutoscalingPolicy]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L112} - /// [google.cloud.dataproc.v1.GetAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L297} + /// [google.cloud.dataproc.v1.GetAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L315} /// // clang-format on StatusOr GetAutoscalingPolicy( @@ -286,7 +286,7 @@ class AutoscalingPolicyServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.AutoscalingPolicy]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L112} - /// [google.cloud.dataproc.v1.GetAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L297} + /// [google.cloud.dataproc.v1.GetAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L315} /// // clang-format on StatusOr GetAutoscalingPolicy( @@ -330,7 +330,7 @@ class AutoscalingPolicyServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.AutoscalingPolicy]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L112} - /// [google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L345} + /// [google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L363} /// // clang-format on StreamRange @@ -369,7 +369,7 @@ class AutoscalingPolicyServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.AutoscalingPolicy]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L112} - /// [google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L345} + /// [google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L363} /// // clang-format on StreamRange @@ -403,7 +403,7 @@ class AutoscalingPolicyServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L325} + /// [google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L343} /// // clang-format on Status DeleteAutoscalingPolicy(std::string const& name, Options opts = {}); @@ -430,7 +430,7 @@ class AutoscalingPolicyServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L325} + /// [google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/autoscaling_policies.proto#L343} /// // clang-format on Status DeleteAutoscalingPolicy( @@ -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/autoscaling_policy_connection.h b/google/cloud/dataproc/v1/autoscaling_policy_connection.h index e424723450680..229f082092d46 100644 --- a/google/cloud/dataproc/v1/autoscaling_policy_connection.h +++ b/google/cloud/dataproc/v1/autoscaling_policy_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_AUTOSCALING_POLICY_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_AUTOSCALING_POLICY_CONNECTION_H +#include "google/cloud/dataproc/v1/autoscaling_policies.pb.h" #include "google/cloud/dataproc/v1/autoscaling_policy_connection_idempotency_policy.h" #include "google/cloud/dataproc/v1/internal/autoscaling_policy_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dataproc/v1/autoscaling_policy_connection_idempotency_policy.h b/google/cloud/dataproc/v1/autoscaling_policy_connection_idempotency_policy.h index 16474827e5bc3..b1652a05bd96a 100644 --- a/google/cloud/dataproc/v1/autoscaling_policy_connection_idempotency_policy.h +++ b/google/cloud/dataproc/v1/autoscaling_policy_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_AUTOSCALING_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_AUTOSCALING_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataproc/v1/autoscaling_policies.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataproc/v1/batch_controller_client.h b/google/cloud/dataproc/v1/batch_controller_client.h index 8e81a3379d04f..2969dccb5d869 100644 --- a/google/cloud/dataproc/v1/batch_controller_client.h +++ b/google/cloud/dataproc/v1/batch_controller_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/batch_controller_connection.h b/google/cloud/dataproc/v1/batch_controller_connection.h index 27880fb14d3e1..a484f14a1599f 100644 --- a/google/cloud/dataproc/v1/batch_controller_connection.h +++ b/google/cloud/dataproc/v1/batch_controller_connection.h @@ -20,7 +20,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_BATCH_CONTROLLER_CONNECTION_H #include "google/cloud/dataproc/v1/batch_controller_connection_idempotency_policy.h" +#include "google/cloud/dataproc/v1/batches.pb.h" #include "google/cloud/dataproc/v1/internal/batch_controller_retry_traits.h" +#include "google/cloud/dataproc/v1/operations.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,9 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/dataproc/v1/batch_controller_connection_idempotency_policy.h b/google/cloud/dataproc/v1/batch_controller_connection_idempotency_policy.h index 944402f868bf5..6ffb2b1f95a5f 100644 --- a/google/cloud/dataproc/v1/batch_controller_connection_idempotency_policy.h +++ b/google/cloud/dataproc/v1/batch_controller_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_BATCH_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_BATCH_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataproc/v1/batches.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataproc/v1/cluster_controller_client.h b/google/cloud/dataproc/v1/cluster_controller_client.h index 85e521a2116f5..757ff1be9eba7 100644 --- a/google/cloud/dataproc/v1/cluster_controller_client.h +++ b/google/cloud/dataproc/v1/cluster_controller_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -121,7 +121,7 @@ class ClusterControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.Cluster]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L160} - /// [google.cloud.dataproc.v1.CreateClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1368} + /// [google.cloud.dataproc.v1.CreateClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1387} /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L131} /// // clang-format on @@ -177,7 +177,7 @@ class ClusterControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.Cluster]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L160} - /// [google.cloud.dataproc.v1.CreateClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1368} + /// [google.cloud.dataproc.v1.CreateClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1387} /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L131} /// // clang-format on @@ -255,8 +255,8 @@ class ClusterControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.Cluster]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L160} - /// [google.cloud.dataproc.v1.ClusterStatus.State]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1018} - /// [google.cloud.dataproc.v1.UpdateClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1399} + /// [google.cloud.dataproc.v1.ClusterStatus.State]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1037} + /// [google.cloud.dataproc.v1.UpdateClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1418} /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L131} /// // clang-format on @@ -319,8 +319,8 @@ class ClusterControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.Cluster]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L160} - /// [google.cloud.dataproc.v1.ClusterStatus.State]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1018} - /// [google.cloud.dataproc.v1.UpdateClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1399} + /// [google.cloud.dataproc.v1.ClusterStatus.State]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1037} + /// [google.cloud.dataproc.v1.UpdateClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1418} /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L131} /// // clang-format on @@ -387,7 +387,7 @@ class ClusterControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.Cluster]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L160} - /// [google.cloud.dataproc.v1.StopClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1495} + /// [google.cloud.dataproc.v1.StopClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1514} /// // clang-format on future> StopCluster( @@ -453,7 +453,7 @@ class ClusterControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.Cluster]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L160} - /// [google.cloud.dataproc.v1.StartClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1526} + /// [google.cloud.dataproc.v1.StartClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1545} /// // clang-format on future> StartCluster( @@ -519,7 +519,7 @@ class ClusterControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.ClusterOperationMetadata]: @googleapis_reference_link{google/cloud/dataproc/v1/operations.proto#L137} - /// [google.cloud.dataproc.v1.DeleteClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1557} + /// [google.cloud.dataproc.v1.DeleteClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1576} /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L131} /// // clang-format on @@ -575,7 +575,7 @@ class ClusterControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.ClusterOperationMetadata]: @googleapis_reference_link{google/cloud/dataproc/v1/operations.proto#L137} - /// [google.cloud.dataproc.v1.DeleteClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1557} + /// [google.cloud.dataproc.v1.DeleteClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1576} /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L131} /// // clang-format on @@ -635,7 +635,7 @@ class ClusterControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.Cluster]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L160} - /// [google.cloud.dataproc.v1.GetClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1588} + /// [google.cloud.dataproc.v1.GetClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1607} /// // clang-format on StatusOr GetCluster( @@ -666,7 +666,7 @@ class ClusterControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.Cluster]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L160} - /// [google.cloud.dataproc.v1.GetClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1588} + /// [google.cloud.dataproc.v1.GetClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1607} /// // clang-format on StatusOr GetCluster( @@ -703,7 +703,7 @@ class ClusterControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.Cluster]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L160} - /// [google.cloud.dataproc.v1.ListClustersRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1601} + /// [google.cloud.dataproc.v1.ListClustersRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1620} /// // clang-format on StreamRange ListClusters( @@ -759,7 +759,7 @@ class ClusterControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.Cluster]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L160} - /// [google.cloud.dataproc.v1.ListClustersRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1601} + /// [google.cloud.dataproc.v1.ListClustersRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1620} /// // clang-format on StreamRange ListClusters( @@ -799,7 +799,7 @@ class ClusterControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.Cluster]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L160} - /// [google.cloud.dataproc.v1.ListClustersRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1601} + /// [google.cloud.dataproc.v1.ListClustersRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1620} /// // clang-format on StreamRange ListClusters( @@ -840,8 +840,8 @@ class ClusterControllerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataproc.v1.DiagnoseClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1649} - /// [google.cloud.dataproc.v1.DiagnoseClusterResults]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1699} + /// [google.cloud.dataproc.v1.DiagnoseClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1668} + /// [google.cloud.dataproc.v1.DiagnoseClusterResults]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1718} /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L131} /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L154} /// @@ -901,8 +901,8 @@ class ClusterControllerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataproc.v1.DiagnoseClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1649} - /// [google.cloud.dataproc.v1.DiagnoseClusterResults]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1699} + /// [google.cloud.dataproc.v1.DiagnoseClusterRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1668} + /// [google.cloud.dataproc.v1.DiagnoseClusterResults]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L1718} /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L131} /// [google.longrunning.Operation.response]: @googleapis_reference_link{google/longrunning/operations.proto#L154} /// @@ -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/cluster_controller_connection.h b/google/cloud/dataproc/v1/cluster_controller_connection.h index bd5bb4d20f1c8..ca0cd3bbebc8a 100644 --- a/google/cloud/dataproc/v1/cluster_controller_connection.h +++ b/google/cloud/dataproc/v1/cluster_controller_connection.h @@ -20,7 +20,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_CLUSTER_CONTROLLER_CONNECTION_H #include "google/cloud/dataproc/v1/cluster_controller_connection_idempotency_policy.h" +#include "google/cloud/dataproc/v1/clusters.pb.h" #include "google/cloud/dataproc/v1/internal/cluster_controller_retry_traits.h" +#include "google/cloud/dataproc/v1/operations.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,9 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/dataproc/v1/cluster_controller_connection_idempotency_policy.h b/google/cloud/dataproc/v1/cluster_controller_connection_idempotency_policy.h index c2f7b2bc1cb3d..33f683ba8e2a5 100644 --- a/google/cloud/dataproc/v1/cluster_controller_connection_idempotency_policy.h +++ b/google/cloud/dataproc/v1/cluster_controller_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_CLUSTER_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_CLUSTER_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataproc/v1/clusters.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_auth_decorator.cc b/google/cloud/dataproc/v1/internal/autoscaling_policy_auth_decorator.cc index 49b27322226d7..849bf3717c0ba 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_auth_decorator.cc +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataproc/v1/autoscaling_policies.proto #include "google/cloud/dataproc/v1/internal/autoscaling_policy_auth_decorator.h" -#include +#include "google/cloud/dataproc/v1/autoscaling_policies.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -142,3 +145,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_auth_decorator.h b/google/cloud/dataproc/v1/internal/autoscaling_policy_auth_decorator.h index a070c5aa7659d..9fdb070e7cec2 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_auth_decorator.h +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_AUTOSCALING_POLICY_AUTH_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_logging_decorator.cc b/google/cloud/dataproc/v1/internal/autoscaling_policy_logging_decorator.cc index 0c2b8302455db..66e832470f6cb 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_logging_decorator.cc +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataproc/v1/autoscaling_policies.proto #include "google/cloud/dataproc/v1/internal/autoscaling_policy_logging_decorator.h" +#include "google/cloud/dataproc/v1/autoscaling_policies.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -187,3 +190,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_logging_decorator.h b/google/cloud/dataproc/v1/internal/autoscaling_policy_logging_decorator.h index 25058834028dc..edcf0a3407eee 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_logging_decorator.h +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_AUTOSCALING_POLICY_LOGGING_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_metadata_decorator.cc b/google/cloud/dataproc/v1/internal/autoscaling_policy_metadata_decorator.cc index 62406e0ec4f0a..6356248ed8136 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_metadata_decorator.cc +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataproc/v1/autoscaling_policies.proto #include "google/cloud/dataproc/v1/internal/autoscaling_policy_metadata_decorator.h" +#include "google/cloud/dataproc/v1/autoscaling_policies.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dataproc_v1_internal { @@ -174,3 +178,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_metadata_decorator.h b/google/cloud/dataproc/v1/internal/autoscaling_policy_metadata_decorator.h index b65e030bd3d7c..9ec75c4454250 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_metadata_decorator.h +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -110,4 +113,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_AUTOSCALING_POLICY_METADATA_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_option_defaults.cc b/google/cloud/dataproc/v1/internal/autoscaling_policy_option_defaults.cc index bc38e7737b8b5..7a3527ff7eceb 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_option_defaults.cc +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dataproc/v1/internal/autoscaling_policy_option_defaults.h" #include "google/cloud/dataproc/v1/autoscaling_policy_connection.h" #include "google/cloud/dataproc/v1/autoscaling_policy_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -46,7 +46,7 @@ Options AutoscalingPolicyServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( dataproc_v1::AutoscalingPolicyServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_stub.cc b/google/cloud/dataproc/v1/internal/autoscaling_policy_stub.cc index ed499879af17f..473368d5b612e 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_stub.cc +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dataproc/v1/autoscaling_policies.proto #include "google/cloud/dataproc/v1/internal/autoscaling_policy_stub.h" +#include "google/cloud/dataproc/v1/autoscaling_policies.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -184,3 +187,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_stub.h b/google/cloud/dataproc/v1/internal/autoscaling_policy_stub.h index f962b8a63191c..7a403583f91c3 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_stub.h +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_AUTOSCALING_POLICY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_AUTOSCALING_POLICY_STUB_H +#include "google/cloud/dataproc/v1/autoscaling_policies.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include +#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 dataproc_v1_internal { @@ -180,4 +183,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_AUTOSCALING_POLICY_STUB_H diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_stub_factory.cc b/google/cloud/dataproc/v1/internal/autoscaling_policy_stub_factory.cc index eda924a21d7dc..39bdb9c6d5944 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_stub_factory.cc +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/dataproc/v1/autoscaling_policies.proto #include "google/cloud/dataproc/v1/internal/autoscaling_policy_stub_factory.h" +#include "google/cloud/dataproc/v1/autoscaling_policies.grpc.pb.h" #include "google/cloud/dataproc/v1/internal/autoscaling_policy_auth_decorator.h" #include "google/cloud/dataproc/v1/internal/autoscaling_policy_logging_decorator.h" #include "google/cloud/dataproc/v1/internal/autoscaling_policy_metadata_decorator.h" @@ -28,12 +29,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include +#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 dataproc_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_stub_factory.h b/google/cloud/dataproc/v1/internal/autoscaling_policy_stub_factory.h index 293d76c3274ca..82c338eff2f6d 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_stub_factory.h +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_AUTOSCALING_POLICY_STUB_FACTORY_H diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_connection.cc b/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_connection.cc index a1d6409113248..98f1c2be3428b 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_connection.cc +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AutoscalingPolicyServiceTracingConnection:: AutoscalingPolicyServiceTracingConnection( std::shared_ptr child) @@ -151,17 +149,13 @@ Status AutoscalingPolicyServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAutoscalingPolicyServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_connection.h b/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_connection.h index 03f05d5deb716..b0e08f876e8c3 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_connection.h +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AutoscalingPolicyServiceTracingConnection : public dataproc_v1::AutoscalingPolicyServiceConnection { public: @@ -88,8 +86,6 @@ class AutoscalingPolicyServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_stub.cc b/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_stub.cc index 79467ae253115..af0ac4d261450 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_stub.cc +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AutoscalingPolicyServiceTracingStub::AutoscalingPolicyServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -187,19 +188,15 @@ Status AutoscalingPolicyServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAutoscalingPolicyServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_stub.h b/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_stub.h index 43b4cfa209acf..d61c7062cf33d 100644 --- a/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_stub.h +++ b/google/cloud/dataproc/v1/internal/autoscaling_policy_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AutoscalingPolicyServiceTracingStub : public AutoscalingPolicyServiceStub { public: @@ -102,8 +103,6 @@ class AutoscalingPolicyServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -119,4 +118,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_AUTOSCALING_POLICY_TRACING_STUB_H diff --git a/google/cloud/dataproc/v1/internal/batch_controller_auth_decorator.cc b/google/cloud/dataproc/v1/internal/batch_controller_auth_decorator.cc index c1cc8ded95c75..f16b5a11d3fc9 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_auth_decorator.cc +++ b/google/cloud/dataproc/v1/internal/batch_controller_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataproc/v1/batches.proto #include "google/cloud/dataproc/v1/internal/batch_controller_auth_decorator.h" -#include +#include "google/cloud/dataproc/v1/batches.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -182,3 +185,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/batch_controller_auth_decorator.h b/google/cloud/dataproc/v1/internal/batch_controller_auth_decorator.h index bc234de0ea28c..cabef1be4558f 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_auth_decorator.h +++ b/google/cloud/dataproc/v1/internal/batch_controller_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/batch_controller_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -111,4 +114,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_BATCH_CONTROLLER_AUTH_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/batch_controller_connection_impl.h b/google/cloud/dataproc/v1/internal/batch_controller_connection_impl.h index 8073eebe8c34f..9a741948c21ae 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_connection_impl.h +++ b/google/cloud/dataproc/v1/internal/batch_controller_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataproc/v1/internal/batch_controller_logging_decorator.cc b/google/cloud/dataproc/v1/internal/batch_controller_logging_decorator.cc index 9c269cdafc1b2..49ff0820186a2 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_logging_decorator.cc +++ b/google/cloud/dataproc/v1/internal/batch_controller_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataproc/v1/batches.proto #include "google/cloud/dataproc/v1/internal/batch_controller_logging_decorator.h" +#include "google/cloud/dataproc/v1/batches.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -216,3 +219,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/batch_controller_logging_decorator.h b/google/cloud/dataproc/v1/internal/batch_controller_logging_decorator.h index c80938dee2e18..a79df426312af 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_logging_decorator.h +++ b/google/cloud/dataproc/v1/internal/batch_controller_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/batch_controller_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -111,4 +114,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_BATCH_CONTROLLER_LOGGING_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/batch_controller_metadata_decorator.cc b/google/cloud/dataproc/v1/internal/batch_controller_metadata_decorator.cc index 56887d7672e68..08057e5d0f577 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_metadata_decorator.cc +++ b/google/cloud/dataproc/v1/internal/batch_controller_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataproc/v1/batches.proto #include "google/cloud/dataproc/v1/internal/batch_controller_metadata_decorator.h" +#include "google/cloud/dataproc/v1/batches.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dataproc_v1_internal { @@ -190,3 +194,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/batch_controller_metadata_decorator.h b/google/cloud/dataproc/v1/internal/batch_controller_metadata_decorator.h index 09aa631709906..9272c1be08890 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_metadata_decorator.h +++ b/google/cloud/dataproc/v1/internal/batch_controller_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/batch_controller_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -117,4 +120,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_BATCH_CONTROLLER_METADATA_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/batch_controller_option_defaults.cc b/google/cloud/dataproc/v1/internal/batch_controller_option_defaults.cc index a996da8659a22..87ccd3996a502 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_option_defaults.cc +++ b/google/cloud/dataproc/v1/internal/batch_controller_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dataproc/v1/internal/batch_controller_option_defaults.h" #include "google/cloud/dataproc/v1/batch_controller_connection.h" #include "google/cloud/dataproc/v1/batch_controller_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options BatchControllerDefaultOptions(std::string const& location, if (!options.has()) { options.set( dataproc_v1::BatchControllerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dataproc/v1/internal/batch_controller_stub.cc b/google/cloud/dataproc/v1/internal/batch_controller_stub.cc index 41f138ae07125..baedab61970fe 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_stub.cc +++ b/google/cloud/dataproc/v1/internal/batch_controller_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dataproc/v1/batches.proto #include "google/cloud/dataproc/v1/internal/batch_controller_stub.h" +#include "google/cloud/dataproc/v1/batches.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -220,3 +223,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/batch_controller_stub.h b/google/cloud/dataproc/v1/internal/batch_controller_stub.h index 671c8a668d575..079ba0a2e1db0 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_stub.h +++ b/google/cloud/dataproc/v1/internal/batch_controller_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_BATCH_CONTROLLER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_BATCH_CONTROLLER_STUB_H +#include "google/cloud/dataproc/v1/batches.grpc.pb.h" +#include "google/cloud/dataproc/v1/operations.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 -#include -#include -#include +#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 dataproc_v1_internal { @@ -193,4 +196,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_BATCH_CONTROLLER_STUB_H diff --git a/google/cloud/dataproc/v1/internal/batch_controller_stub_factory.cc b/google/cloud/dataproc/v1/internal/batch_controller_stub_factory.cc index ec5d6fc7cea66..a715b0452e71a 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_stub_factory.cc +++ b/google/cloud/dataproc/v1/internal/batch_controller_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/dataproc/v1/batches.proto #include "google/cloud/dataproc/v1/internal/batch_controller_stub_factory.h" +#include "google/cloud/dataproc/v1/batches.grpc.pb.h" #include "google/cloud/dataproc/v1/internal/batch_controller_auth_decorator.h" #include "google/cloud/dataproc/v1/internal/batch_controller_logging_decorator.h" #include "google/cloud/dataproc/v1/internal/batch_controller_metadata_decorator.h" @@ -28,12 +29,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include +#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 dataproc_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/batch_controller_stub_factory.h b/google/cloud/dataproc/v1/internal/batch_controller_stub_factory.h index 3072bb4c01242..3d78d83dc0a48 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_stub_factory.h +++ b/google/cloud/dataproc/v1/internal/batch_controller_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_BATCH_CONTROLLER_STUB_FACTORY_H diff --git a/google/cloud/dataproc/v1/internal/batch_controller_tracing_connection.cc b/google/cloud/dataproc/v1/internal/batch_controller_tracing_connection.cc index 71043b5bfda2b..49035ed334745 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_tracing_connection.cc +++ b/google/cloud/dataproc/v1/internal/batch_controller_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BatchControllerTracingConnection::BatchControllerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -152,16 +150,12 @@ Status BatchControllerTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBatchControllerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataproc/v1/internal/batch_controller_tracing_connection.h b/google/cloud/dataproc/v1/internal/batch_controller_tracing_connection.h index 1c224784bfc1a..fc69309bb4c56 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_tracing_connection.h +++ b/google/cloud/dataproc/v1/internal/batch_controller_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BatchControllerTracingConnection : public dataproc_v1::BatchControllerConnection { public: @@ -84,8 +82,6 @@ class BatchControllerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataproc/v1/internal/batch_controller_tracing_stub.cc b/google/cloud/dataproc/v1/internal/batch_controller_tracing_stub.cc index 41d547c3d735e..996791c39dfbc 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_tracing_stub.cc +++ b/google/cloud/dataproc/v1/internal/batch_controller_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BatchControllerTracingStub::BatchControllerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -201,18 +202,14 @@ future BatchControllerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBatchControllerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/batch_controller_tracing_stub.h b/google/cloud/dataproc/v1/internal/batch_controller_tracing_stub.h index a7b7a1e90b022..971009ecd45cb 100644 --- a/google/cloud/dataproc/v1/internal/batch_controller_tracing_stub.h +++ b/google/cloud/dataproc/v1/internal/batch_controller_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BatchControllerTracingStub : public BatchControllerStub { public: ~BatchControllerTracingStub() override = default; @@ -107,8 +108,6 @@ class BatchControllerTracingStub : public BatchControllerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -123,4 +122,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_BATCH_CONTROLLER_TRACING_STUB_H diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_auth_decorator.cc b/google/cloud/dataproc/v1/internal/cluster_controller_auth_decorator.cc index a6db7ae55da62..7b2590d3e98ec 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_auth_decorator.cc +++ b/google/cloud/dataproc/v1/internal/cluster_controller_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataproc/v1/clusters.proto #include "google/cloud/dataproc/v1/internal/cluster_controller_auth_decorator.h" -#include +#include "google/cloud/dataproc/v1/clusters.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -315,3 +318,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_auth_decorator.h b/google/cloud/dataproc/v1/internal/cluster_controller_auth_decorator.h index 439ec36437505..219fdd8e31209 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_auth_decorator.h +++ b/google/cloud/dataproc/v1/internal/cluster_controller_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/cluster_controller_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -165,4 +168,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_CLUSTER_CONTROLLER_AUTH_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_connection_impl.h b/google/cloud/dataproc/v1/internal/cluster_controller_connection_impl.h index cf57a2f758e78..24456ce55d2ca 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_connection_impl.h +++ b/google/cloud/dataproc/v1/internal/cluster_controller_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_logging_decorator.cc b/google/cloud/dataproc/v1/internal/cluster_controller_logging_decorator.cc index 0dfb7d8de30ef..e81d5cbc508a1 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_logging_decorator.cc +++ b/google/cloud/dataproc/v1/internal/cluster_controller_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataproc/v1/clusters.proto #include "google/cloud/dataproc/v1/internal/cluster_controller_logging_decorator.h" +#include "google/cloud/dataproc/v1/clusters.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -357,3 +360,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_logging_decorator.h b/google/cloud/dataproc/v1/internal/cluster_controller_logging_decorator.h index 8a943fa61c232..61a1836c2fdff 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_logging_decorator.h +++ b/google/cloud/dataproc/v1/internal/cluster_controller_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/cluster_controller_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -165,4 +168,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_CLUSTER_CONTROLLER_LOGGING_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_metadata_decorator.cc b/google/cloud/dataproc/v1/internal/cluster_controller_metadata_decorator.cc index 5010d64ed38a6..92c17551de3fb 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_metadata_decorator.cc +++ b/google/cloud/dataproc/v1/internal/cluster_controller_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataproc/v1/clusters.proto #include "google/cloud/dataproc/v1/internal/cluster_controller_metadata_decorator.h" +#include "google/cloud/dataproc/v1/clusters.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dataproc_v1_internal { @@ -339,3 +343,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_metadata_decorator.h b/google/cloud/dataproc/v1/internal/cluster_controller_metadata_decorator.h index 5911c4fae85ca..9c7a076a4868b 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_metadata_decorator.h +++ b/google/cloud/dataproc/v1/internal/cluster_controller_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/cluster_controller_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -171,4 +174,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_CLUSTER_CONTROLLER_METADATA_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_option_defaults.cc b/google/cloud/dataproc/v1/internal/cluster_controller_option_defaults.cc index ed769a307a33c..4630cbf9643b7 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_option_defaults.cc +++ b/google/cloud/dataproc/v1/internal/cluster_controller_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dataproc/v1/internal/cluster_controller_option_defaults.h" #include "google/cloud/dataproc/v1/cluster_controller_connection.h" #include "google/cloud/dataproc/v1/cluster_controller_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options ClusterControllerDefaultOptions(std::string const& location, if (!options.has()) { options.set( dataproc_v1::ClusterControllerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_stub.cc b/google/cloud/dataproc/v1/internal/cluster_controller_stub.cc index 490cbd0cd299f..adc12a34c10f7 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_stub.cc +++ b/google/cloud/dataproc/v1/internal/cluster_controller_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dataproc/v1/clusters.proto #include "google/cloud/dataproc/v1/internal/cluster_controller_stub.h" +#include "google/cloud/dataproc/v1/clusters.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -359,3 +362,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_stub.h b/google/cloud/dataproc/v1/internal/cluster_controller_stub.h index 153f8ccae188c..eb1cfb2aff1e8 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_stub.h +++ b/google/cloud/dataproc/v1/internal/cluster_controller_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_CLUSTER_CONTROLLER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_CLUSTER_CONTROLLER_STUB_H +#include "google/cloud/dataproc/v1/clusters.grpc.pb.h" +#include "google/cloud/dataproc/v1/operations.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 -#include -#include -#include +#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 dataproc_v1_internal { @@ -293,4 +296,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_CLUSTER_CONTROLLER_STUB_H diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_stub_factory.cc b/google/cloud/dataproc/v1/internal/cluster_controller_stub_factory.cc index 1c1c63261e50d..02ca8dd114b73 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_stub_factory.cc +++ b/google/cloud/dataproc/v1/internal/cluster_controller_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/dataproc/v1/clusters.proto #include "google/cloud/dataproc/v1/internal/cluster_controller_stub_factory.h" +#include "google/cloud/dataproc/v1/clusters.grpc.pb.h" #include "google/cloud/dataproc/v1/internal/cluster_controller_auth_decorator.h" #include "google/cloud/dataproc/v1/internal/cluster_controller_logging_decorator.h" #include "google/cloud/dataproc/v1/internal/cluster_controller_metadata_decorator.h" @@ -28,12 +29,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include +#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 dataproc_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_stub_factory.h b/google/cloud/dataproc/v1/internal/cluster_controller_stub_factory.h index 269cf655747d5..cd4657bae2060 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_stub_factory.h +++ b/google/cloud/dataproc/v1/internal/cluster_controller_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_CLUSTER_CONTROLLER_STUB_FACTORY_H diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_tracing_connection.cc b/google/cloud/dataproc/v1/internal/cluster_controller_tracing_connection.cc index 6cfacd0d78bf3..cd0b9729f4e74 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_tracing_connection.cc +++ b/google/cloud/dataproc/v1/internal/cluster_controller_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ClusterControllerTracingConnection::ClusterControllerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -285,17 +283,13 @@ Status ClusterControllerTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeClusterControllerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_tracing_connection.h b/google/cloud/dataproc/v1/internal/cluster_controller_tracing_connection.h index 39e7f150022d8..9340c9c22e43c 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_tracing_connection.h +++ b/google/cloud/dataproc/v1/internal/cluster_controller_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ClusterControllerTracingConnection : public dataproc_v1::ClusterControllerConnection { public: @@ -139,8 +137,6 @@ class ClusterControllerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_tracing_stub.cc b/google/cloud/dataproc/v1/internal/cluster_controller_tracing_stub.cc index 667e86c5e8cfb..3508a1ef35b6d 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_tracing_stub.cc +++ b/google/cloud/dataproc/v1/internal/cluster_controller_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ClusterControllerTracingStub::ClusterControllerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -321,18 +322,14 @@ future ClusterControllerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeClusterControllerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/cluster_controller_tracing_stub.h b/google/cloud/dataproc/v1/internal/cluster_controller_tracing_stub.h index 5aff2cb6c8891..0edd4ed9ba76e 100644 --- a/google/cloud/dataproc/v1/internal/cluster_controller_tracing_stub.h +++ b/google/cloud/dataproc/v1/internal/cluster_controller_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ClusterControllerTracingStub : public ClusterControllerStub { public: ~ClusterControllerTracingStub() override = default; @@ -161,8 +162,6 @@ class ClusterControllerTracingStub : public ClusterControllerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -177,4 +176,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_CLUSTER_CONTROLLER_TRACING_STUB_H diff --git a/google/cloud/dataproc/v1/internal/job_controller_auth_decorator.cc b/google/cloud/dataproc/v1/internal/job_controller_auth_decorator.cc index a8e8c9d3ee654..faed846e8b3c1 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_auth_decorator.cc +++ b/google/cloud/dataproc/v1/internal/job_controller_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataproc/v1/jobs.proto #include "google/cloud/dataproc/v1/internal/job_controller_auth_decorator.h" -#include +#include "google/cloud/dataproc/v1/jobs.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -207,3 +210,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/job_controller_auth_decorator.h b/google/cloud/dataproc/v1/internal/job_controller_auth_decorator.h index 2bd9967d5a427..b30ab97711ff9 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_auth_decorator.h +++ b/google/cloud/dataproc/v1/internal/job_controller_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/job_controller_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -123,4 +126,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_JOB_CONTROLLER_AUTH_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/job_controller_connection_impl.h b/google/cloud/dataproc/v1/internal/job_controller_connection_impl.h index f9ab1f12f364f..6eb200056ed5e 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_connection_impl.h +++ b/google/cloud/dataproc/v1/internal/job_controller_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataproc/v1/internal/job_controller_logging_decorator.cc b/google/cloud/dataproc/v1/internal/job_controller_logging_decorator.cc index 305bfdc7f6779..0309f639e0a74 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_logging_decorator.cc +++ b/google/cloud/dataproc/v1/internal/job_controller_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataproc/v1/jobs.proto #include "google/cloud/dataproc/v1/internal/job_controller_logging_decorator.h" +#include "google/cloud/dataproc/v1/jobs.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -250,3 +253,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/job_controller_logging_decorator.h b/google/cloud/dataproc/v1/internal/job_controller_logging_decorator.h index cc06e148689da..0ca94302360a6 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_logging_decorator.h +++ b/google/cloud/dataproc/v1/internal/job_controller_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/job_controller_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -123,4 +126,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_JOB_CONTROLLER_LOGGING_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/job_controller_metadata_decorator.cc b/google/cloud/dataproc/v1/internal/job_controller_metadata_decorator.cc index 9765d358a7f91..3ea59809286cc 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_metadata_decorator.cc +++ b/google/cloud/dataproc/v1/internal/job_controller_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataproc/v1/jobs.proto #include "google/cloud/dataproc/v1/internal/job_controller_metadata_decorator.h" +#include "google/cloud/dataproc/v1/jobs.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dataproc_v1_internal { @@ -235,3 +239,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/job_controller_metadata_decorator.h b/google/cloud/dataproc/v1/internal/job_controller_metadata_decorator.h index bb9dcc6ab5d7d..50402ccec55f1 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_metadata_decorator.h +++ b/google/cloud/dataproc/v1/internal/job_controller_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/job_controller_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -128,4 +131,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_JOB_CONTROLLER_METADATA_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/job_controller_option_defaults.cc b/google/cloud/dataproc/v1/internal/job_controller_option_defaults.cc index 269735ea40230..7b49661b8664d 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_option_defaults.cc +++ b/google/cloud/dataproc/v1/internal/job_controller_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dataproc/v1/internal/job_controller_option_defaults.h" #include "google/cloud/dataproc/v1/job_controller_connection.h" #include "google/cloud/dataproc/v1/job_controller_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options JobControllerDefaultOptions(std::string const& location, if (!options.has()) { options.set( dataproc_v1::JobControllerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dataproc/v1/internal/job_controller_stub.cc b/google/cloud/dataproc/v1/internal/job_controller_stub.cc index 128adaea218e9..bfb2a4446617c 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_stub.cc +++ b/google/cloud/dataproc/v1/internal/job_controller_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dataproc/v1/jobs.proto #include "google/cloud/dataproc/v1/internal/job_controller_stub.h" +#include "google/cloud/dataproc/v1/jobs.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -251,3 +254,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/job_controller_stub.h b/google/cloud/dataproc/v1/internal/job_controller_stub.h index c400280c5ccdb..e8a97db27bb1c 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_stub.h +++ b/google/cloud/dataproc/v1/internal/job_controller_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_JOB_CONTROLLER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_JOB_CONTROLLER_STUB_H +#include "google/cloud/dataproc/v1/jobs.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 -#include -#include +#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 dataproc_v1_internal { @@ -215,4 +218,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_JOB_CONTROLLER_STUB_H diff --git a/google/cloud/dataproc/v1/internal/job_controller_stub_factory.cc b/google/cloud/dataproc/v1/internal/job_controller_stub_factory.cc index ee48edc105cd7..d5c509c221bce 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_stub_factory.cc +++ b/google/cloud/dataproc/v1/internal/job_controller_stub_factory.cc @@ -22,18 +22,21 @@ #include "google/cloud/dataproc/v1/internal/job_controller_metadata_decorator.h" #include "google/cloud/dataproc/v1/internal/job_controller_stub.h" #include "google/cloud/dataproc/v1/internal/job_controller_tracing_stub.h" +#include "google/cloud/dataproc/v1/jobs.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 -#include -#include +#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 dataproc_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/job_controller_stub_factory.h b/google/cloud/dataproc/v1/internal/job_controller_stub_factory.h index b1c281aa28022..c797523291c50 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_stub_factory.h +++ b/google/cloud/dataproc/v1/internal/job_controller_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_JOB_CONTROLLER_STUB_FACTORY_H diff --git a/google/cloud/dataproc/v1/internal/job_controller_tracing_connection.cc b/google/cloud/dataproc/v1/internal/job_controller_tracing_connection.cc index 5e2daa808e3c3..ee69442d44bd7 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_tracing_connection.cc +++ b/google/cloud/dataproc/v1/internal/job_controller_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - JobControllerTracingConnection::JobControllerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -179,16 +177,12 @@ Status JobControllerTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeJobControllerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataproc/v1/internal/job_controller_tracing_connection.h b/google/cloud/dataproc/v1/internal/job_controller_tracing_connection.h index 66ffbabed5b78..ef6904b1b920e 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_tracing_connection.h +++ b/google/cloud/dataproc/v1/internal/job_controller_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class JobControllerTracingConnection : public dataproc_v1::JobControllerConnection { public: @@ -93,8 +91,6 @@ class JobControllerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataproc/v1/internal/job_controller_tracing_stub.cc b/google/cloud/dataproc/v1/internal/job_controller_tracing_stub.cc index 3107041fd1872..08ca9ad81bf8a 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_tracing_stub.cc +++ b/google/cloud/dataproc/v1/internal/job_controller_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - JobControllerTracingStub::JobControllerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -233,18 +234,14 @@ future JobControllerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeJobControllerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/job_controller_tracing_stub.h b/google/cloud/dataproc/v1/internal/job_controller_tracing_stub.h index 28ffa483c5513..02bdbc4c69b7c 100644 --- a/google/cloud/dataproc/v1/internal/job_controller_tracing_stub.h +++ b/google/cloud/dataproc/v1/internal/job_controller_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class JobControllerTracingStub : public JobControllerStub { public: ~JobControllerTracingStub() override = default; @@ -118,8 +119,6 @@ class JobControllerTracingStub : public JobControllerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -134,4 +133,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_JOB_CONTROLLER_TRACING_STUB_H diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_auth_decorator.cc b/google/cloud/dataproc/v1/internal/node_group_controller_auth_decorator.cc index 76b2bf2bc5b24..9844611687727 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_auth_decorator.cc +++ b/google/cloud/dataproc/v1/internal/node_group_controller_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataproc/v1/node_groups.proto #include "google/cloud/dataproc/v1/internal/node_group_controller_auth_decorator.h" -#include +#include "google/cloud/dataproc/v1/node_groups.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -196,3 +199,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_auth_decorator.h b/google/cloud/dataproc/v1/internal/node_group_controller_auth_decorator.h index 17a245666056f..0a9de2f5371ef 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_auth_decorator.h +++ b/google/cloud/dataproc/v1/internal/node_group_controller_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/node_group_controller_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -117,4 +120,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_NODE_GROUP_CONTROLLER_AUTH_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_connection_impl.h b/google/cloud/dataproc/v1/internal/node_group_controller_connection_impl.h index 7943478eb9c89..a24b6b88d3d56 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_connection_impl.h +++ b/google/cloud/dataproc/v1/internal/node_group_controller_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_logging_decorator.cc b/google/cloud/dataproc/v1/internal/node_group_controller_logging_decorator.cc index 7db9bd2346aa3..54966594be4cc 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_logging_decorator.cc +++ b/google/cloud/dataproc/v1/internal/node_group_controller_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataproc/v1/node_groups.proto #include "google/cloud/dataproc/v1/internal/node_group_controller_logging_decorator.h" +#include "google/cloud/dataproc/v1/node_groups.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -230,3 +233,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_logging_decorator.h b/google/cloud/dataproc/v1/internal/node_group_controller_logging_decorator.h index 8fb3ad669a139..6133e14ab939c 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_logging_decorator.h +++ b/google/cloud/dataproc/v1/internal/node_group_controller_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/node_group_controller_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -117,4 +120,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_NODE_GROUP_CONTROLLER_LOGGING_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_metadata_decorator.cc b/google/cloud/dataproc/v1/internal/node_group_controller_metadata_decorator.cc index ad077d8c1dc71..35b8a0264e686 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_metadata_decorator.cc +++ b/google/cloud/dataproc/v1/internal/node_group_controller_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataproc/v1/node_groups.proto #include "google/cloud/dataproc/v1/internal/node_group_controller_metadata_decorator.h" +#include "google/cloud/dataproc/v1/node_groups.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dataproc_v1_internal { @@ -197,3 +201,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_metadata_decorator.h b/google/cloud/dataproc/v1/internal/node_group_controller_metadata_decorator.h index 37ff1a33ac928..1af1ec3f27bc6 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_metadata_decorator.h +++ b/google/cloud/dataproc/v1/internal/node_group_controller_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/node_group_controller_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -123,4 +126,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_NODE_GROUP_CONTROLLER_METADATA_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_option_defaults.cc b/google/cloud/dataproc/v1/internal/node_group_controller_option_defaults.cc index 9818622a4af40..7fe7bfe38c603 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_option_defaults.cc +++ b/google/cloud/dataproc/v1/internal/node_group_controller_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dataproc/v1/internal/node_group_controller_option_defaults.h" #include "google/cloud/dataproc/v1/node_group_controller_connection.h" #include "google/cloud/dataproc/v1/node_group_controller_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options NodeGroupControllerDefaultOptions(std::string const& location, if (!options.has()) { options.set( dataproc_v1::NodeGroupControllerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_stub.cc b/google/cloud/dataproc/v1/internal/node_group_controller_stub.cc index 0dfe8a387f321..79027cd8ae20b 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_stub.cc +++ b/google/cloud/dataproc/v1/internal/node_group_controller_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dataproc/v1/node_groups.proto #include "google/cloud/dataproc/v1/internal/node_group_controller_stub.h" +#include "google/cloud/dataproc/v1/node_groups.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -227,3 +230,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_stub.h b/google/cloud/dataproc/v1/internal/node_group_controller_stub.h index 47054c7d25bf6..46298c9d442db 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_stub.h +++ b/google/cloud/dataproc/v1/internal/node_group_controller_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_NODE_GROUP_CONTROLLER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_NODE_GROUP_CONTROLLER_STUB_H +#include "google/cloud/dataproc/v1/node_groups.grpc.pb.h" +#include "google/cloud/dataproc/v1/operations.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 -#include -#include -#include +#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 dataproc_v1_internal { @@ -201,4 +204,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_NODE_GROUP_CONTROLLER_STUB_H diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_stub_factory.cc b/google/cloud/dataproc/v1/internal/node_group_controller_stub_factory.cc index 003bfde28a3e1..655f84efcd839 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_stub_factory.cc +++ b/google/cloud/dataproc/v1/internal/node_group_controller_stub_factory.cc @@ -22,18 +22,21 @@ #include "google/cloud/dataproc/v1/internal/node_group_controller_metadata_decorator.h" #include "google/cloud/dataproc/v1/internal/node_group_controller_stub.h" #include "google/cloud/dataproc/v1/internal/node_group_controller_tracing_stub.h" +#include "google/cloud/dataproc/v1/node_groups.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 -#include -#include +#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 dataproc_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_stub_factory.h b/google/cloud/dataproc/v1/internal/node_group_controller_stub_factory.h index 35d2af10a0227..1c952690782bb 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_stub_factory.h +++ b/google/cloud/dataproc/v1/internal/node_group_controller_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_NODE_GROUP_CONTROLLER_STUB_FACTORY_H diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_tracing_connection.cc b/google/cloud/dataproc/v1/internal/node_group_controller_tracing_connection.cc index 6c062b8815e9b..4ef8158efd4b4 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_tracing_connection.cc +++ b/google/cloud/dataproc/v1/internal/node_group_controller_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NodeGroupControllerTracingConnection::NodeGroupControllerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -163,17 +161,13 @@ Status NodeGroupControllerTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNodeGroupControllerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_tracing_connection.h b/google/cloud/dataproc/v1/internal/node_group_controller_tracing_connection.h index 54cce1456d2e6..1650a7e2e627a 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_tracing_connection.h +++ b/google/cloud/dataproc/v1/internal/node_group_controller_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NodeGroupControllerTracingConnection : public dataproc_v1::NodeGroupControllerConnection { public: @@ -92,8 +90,6 @@ class NodeGroupControllerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_tracing_stub.cc b/google/cloud/dataproc/v1/internal/node_group_controller_tracing_stub.cc index 71ce41ea885d0..a98cdb355f3ab 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_tracing_stub.cc +++ b/google/cloud/dataproc/v1/internal/node_group_controller_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NodeGroupControllerTracingStub::NodeGroupControllerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -206,18 +207,14 @@ future NodeGroupControllerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNodeGroupControllerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/node_group_controller_tracing_stub.h b/google/cloud/dataproc/v1/internal/node_group_controller_tracing_stub.h index 1220209b98671..59694b9bb75f7 100644 --- a/google/cloud/dataproc/v1/internal/node_group_controller_tracing_stub.h +++ b/google/cloud/dataproc/v1/internal/node_group_controller_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NodeGroupControllerTracingStub : public NodeGroupControllerStub { public: ~NodeGroupControllerTracingStub() override = default; @@ -113,8 +114,6 @@ class NodeGroupControllerTracingStub : public NodeGroupControllerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -129,4 +128,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_NODE_GROUP_CONTROLLER_TRACING_STUB_H diff --git a/google/cloud/dataproc/v1/internal/session_controller_auth_decorator.cc b/google/cloud/dataproc/v1/internal/session_controller_auth_decorator.cc index 70f81ebf7fa0e..1ea63c4b4c14c 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_auth_decorator.cc +++ b/google/cloud/dataproc/v1/internal/session_controller_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataproc/v1/sessions.proto #include "google/cloud/dataproc/v1/internal/session_controller_auth_decorator.h" -#include +#include "google/cloud/dataproc/v1/sessions.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -232,3 +235,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/session_controller_auth_decorator.h b/google/cloud/dataproc/v1/internal/session_controller_auth_decorator.h index 8d01076b0e2da..24795baeca8b7 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_auth_decorator.h +++ b/google/cloud/dataproc/v1/internal/session_controller_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/session_controller_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -133,4 +136,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_CONTROLLER_AUTH_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/session_controller_connection_impl.h b/google/cloud/dataproc/v1/internal/session_controller_connection_impl.h index 0a2f18128008e..8dc90b77bc40e 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_connection_impl.h +++ b/google/cloud/dataproc/v1/internal/session_controller_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataproc/v1/internal/session_controller_logging_decorator.cc b/google/cloud/dataproc/v1/internal/session_controller_logging_decorator.cc index 3c1cfe37af4b6..21c63c306e84b 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_logging_decorator.cc +++ b/google/cloud/dataproc/v1/internal/session_controller_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataproc/v1/sessions.proto #include "google/cloud/dataproc/v1/internal/session_controller_logging_decorator.h" +#include "google/cloud/dataproc/v1/sessions.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -269,3 +272,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/session_controller_logging_decorator.h b/google/cloud/dataproc/v1/internal/session_controller_logging_decorator.h index 122cd5f867d3a..9dfdf77e8b831 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_logging_decorator.h +++ b/google/cloud/dataproc/v1/internal/session_controller_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/session_controller_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -133,4 +136,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_CONTROLLER_LOGGING_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/session_controller_metadata_decorator.cc b/google/cloud/dataproc/v1/internal/session_controller_metadata_decorator.cc index 19b878b1fde04..d7facb1a3a9a5 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_metadata_decorator.cc +++ b/google/cloud/dataproc/v1/internal/session_controller_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataproc/v1/sessions.proto #include "google/cloud/dataproc/v1/internal/session_controller_metadata_decorator.h" +#include "google/cloud/dataproc/v1/sessions.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dataproc_v1_internal { @@ -227,3 +231,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/session_controller_metadata_decorator.h b/google/cloud/dataproc/v1/internal/session_controller_metadata_decorator.h index 3e688938cb4d8..bf9c720cf83a5 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_metadata_decorator.h +++ b/google/cloud/dataproc/v1/internal/session_controller_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/session_controller_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -139,4 +142,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_CONTROLLER_METADATA_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/session_controller_option_defaults.cc b/google/cloud/dataproc/v1/internal/session_controller_option_defaults.cc index 2ae49f5d57f33..bfe11c008bdea 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_option_defaults.cc +++ b/google/cloud/dataproc/v1/internal/session_controller_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dataproc/v1/internal/session_controller_option_defaults.h" #include "google/cloud/dataproc/v1/session_controller_connection.h" #include "google/cloud/dataproc/v1/session_controller_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options SessionControllerDefaultOptions(std::string const& location, if (!options.has()) { options.set( dataproc_v1::SessionControllerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dataproc/v1/internal/session_controller_stub.cc b/google/cloud/dataproc/v1/internal/session_controller_stub.cc index ad369e5969203..127645a62027c 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_stub.cc +++ b/google/cloud/dataproc/v1/internal/session_controller_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dataproc/v1/sessions.proto #include "google/cloud/dataproc/v1/internal/session_controller_stub.h" +#include "google/cloud/dataproc/v1/sessions.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -270,3 +273,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/session_controller_stub.h b/google/cloud/dataproc/v1/internal/session_controller_stub.h index 89bc759e3e5e0..21385f67c29a4 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_stub.h +++ b/google/cloud/dataproc/v1/internal/session_controller_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_CONTROLLER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_CONTROLLER_STUB_H +#include "google/cloud/dataproc/v1/operations.pb.h" +#include "google/cloud/dataproc/v1/sessions.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 -#include -#include -#include +#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 dataproc_v1_internal { @@ -232,4 +235,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_CONTROLLER_STUB_H diff --git a/google/cloud/dataproc/v1/internal/session_controller_stub_factory.cc b/google/cloud/dataproc/v1/internal/session_controller_stub_factory.cc index 6d68ad906a4de..93297806e307c 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_stub_factory.cc +++ b/google/cloud/dataproc/v1/internal/session_controller_stub_factory.cc @@ -22,18 +22,21 @@ #include "google/cloud/dataproc/v1/internal/session_controller_metadata_decorator.h" #include "google/cloud/dataproc/v1/internal/session_controller_stub.h" #include "google/cloud/dataproc/v1/internal/session_controller_tracing_stub.h" +#include "google/cloud/dataproc/v1/sessions.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 -#include -#include +#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 dataproc_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/session_controller_stub_factory.h b/google/cloud/dataproc/v1/internal/session_controller_stub_factory.h index 4809747ec2b2c..18c1379a2d4be 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_stub_factory.h +++ b/google/cloud/dataproc/v1/internal/session_controller_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_CONTROLLER_STUB_FACTORY_H diff --git a/google/cloud/dataproc/v1/internal/session_controller_tracing_connection.cc b/google/cloud/dataproc/v1/internal/session_controller_tracing_connection.cc index 274a7e8f4f539..9eab4ea686c66 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_tracing_connection.cc +++ b/google/cloud/dataproc/v1/internal/session_controller_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SessionControllerTracingConnection::SessionControllerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -202,17 +200,13 @@ Status SessionControllerTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSessionControllerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataproc/v1/internal/session_controller_tracing_connection.h b/google/cloud/dataproc/v1/internal/session_controller_tracing_connection.h index 3af4be9d7533e..e25283d62753b 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_tracing_connection.h +++ b/google/cloud/dataproc/v1/internal/session_controller_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SessionControllerTracingConnection : public dataproc_v1::SessionControllerConnection { public: @@ -107,8 +105,6 @@ class SessionControllerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataproc/v1/internal/session_controller_tracing_stub.cc b/google/cloud/dataproc/v1/internal/session_controller_tracing_stub.cc index 60757189b9a75..fa9416efc91e3 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_tracing_stub.cc +++ b/google/cloud/dataproc/v1/internal/session_controller_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SessionControllerTracingStub::SessionControllerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -243,18 +244,14 @@ future SessionControllerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSessionControllerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/session_controller_tracing_stub.h b/google/cloud/dataproc/v1/internal/session_controller_tracing_stub.h index 65018a37f381c..4ca839d50b421 100644 --- a/google/cloud/dataproc/v1/internal/session_controller_tracing_stub.h +++ b/google/cloud/dataproc/v1/internal/session_controller_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SessionControllerTracingStub : public SessionControllerStub { public: ~SessionControllerTracingStub() override = default; @@ -129,8 +130,6 @@ class SessionControllerTracingStub : public SessionControllerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -145,4 +144,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_CONTROLLER_TRACING_STUB_H diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_auth_decorator.cc b/google/cloud/dataproc/v1/internal/session_template_controller_auth_decorator.cc index 0147315f67049..a6443589bac86 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_auth_decorator.cc +++ b/google/cloud/dataproc/v1/internal/session_template_controller_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataproc/v1/session_templates.proto #include "google/cloud/dataproc/v1/internal/session_template_controller_auth_decorator.h" -#include +#include "google/cloud/dataproc/v1/session_templates.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -138,3 +141,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_auth_decorator.h b/google/cloud/dataproc/v1/internal/session_template_controller_auth_decorator.h index 7275f8b862b34..25535cc193f1a 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_auth_decorator.h +++ b/google/cloud/dataproc/v1/internal/session_template_controller_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -102,4 +105,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_TEMPLATE_CONTROLLER_AUTH_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_logging_decorator.cc b/google/cloud/dataproc/v1/internal/session_template_controller_logging_decorator.cc index ae438c8262458..7af95daa43655 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_logging_decorator.cc +++ b/google/cloud/dataproc/v1/internal/session_template_controller_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataproc/v1/session_templates.proto #include "google/cloud/dataproc/v1/internal/session_template_controller_logging_decorator.h" +#include "google/cloud/dataproc/v1/session_templates.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -185,3 +188,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_logging_decorator.h b/google/cloud/dataproc/v1/internal/session_template_controller_logging_decorator.h index 75da20626f4f2..6536895c72b79 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_logging_decorator.h +++ b/google/cloud/dataproc/v1/internal/session_template_controller_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -102,4 +105,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_TEMPLATE_CONTROLLER_LOGGING_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_metadata_decorator.cc b/google/cloud/dataproc/v1/internal/session_template_controller_metadata_decorator.cc index 4ea4f02821ed5..bb6e78e8686c6 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_metadata_decorator.cc +++ b/google/cloud/dataproc/v1/internal/session_template_controller_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataproc/v1/session_templates.proto #include "google/cloud/dataproc/v1/internal/session_template_controller_metadata_decorator.h" +#include "google/cloud/dataproc/v1/session_templates.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dataproc_v1_internal { @@ -171,3 +175,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_metadata_decorator.h b/google/cloud/dataproc/v1/internal/session_template_controller_metadata_decorator.h index 86019ed3fbb9f..d4429038bfc9b 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_metadata_decorator.h +++ b/google/cloud/dataproc/v1/internal/session_template_controller_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -108,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_TEMPLATE_CONTROLLER_METADATA_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_option_defaults.cc b/google/cloud/dataproc/v1/internal/session_template_controller_option_defaults.cc index 79d4541047f7d..78072fcfd06d8 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_option_defaults.cc +++ b/google/cloud/dataproc/v1/internal/session_template_controller_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dataproc/v1/internal/session_template_controller_option_defaults.h" #include "google/cloud/dataproc/v1/session_template_controller_connection.h" #include "google/cloud/dataproc/v1/session_template_controller_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options SessionTemplateControllerDefaultOptions(std::string const& location, if (!options.has()) { options.set( dataproc_v1::SessionTemplateControllerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_stub.cc b/google/cloud/dataproc/v1/internal/session_template_controller_stub.cc index 139fab44f6140..a2f408c20b35e 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_stub.cc +++ b/google/cloud/dataproc/v1/internal/session_template_controller_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dataproc/v1/session_templates.proto #include "google/cloud/dataproc/v1/internal/session_template_controller_stub.h" +#include "google/cloud/dataproc/v1/session_templates.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -176,3 +179,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_stub.h b/google/cloud/dataproc/v1/internal/session_template_controller_stub.h index dc0a9d4b809fa..a1c095296a582 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_stub.h +++ b/google/cloud/dataproc/v1/internal/session_template_controller_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_TEMPLATE_CONTROLLER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_TEMPLATE_CONTROLLER_STUB_H +#include "google/cloud/dataproc/v1/session_templates.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include +#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 dataproc_v1_internal { @@ -178,4 +181,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_TEMPLATE_CONTROLLER_STUB_H diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_stub_factory.cc b/google/cloud/dataproc/v1/internal/session_template_controller_stub_factory.cc index 26a7268b8513f..3347176966429 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_stub_factory.cc +++ b/google/cloud/dataproc/v1/internal/session_template_controller_stub_factory.cc @@ -22,18 +22,21 @@ #include "google/cloud/dataproc/v1/internal/session_template_controller_metadata_decorator.h" #include "google/cloud/dataproc/v1/internal/session_template_controller_stub.h" #include "google/cloud/dataproc/v1/internal/session_template_controller_tracing_stub.h" +#include "google/cloud/dataproc/v1/session_templates.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 -#include -#include +#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 dataproc_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_stub_factory.h b/google/cloud/dataproc/v1/internal/session_template_controller_stub_factory.h index 4153ef5b5932b..433d7e6c28b5a 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_stub_factory.h +++ b/google/cloud/dataproc/v1/internal/session_template_controller_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_TEMPLATE_CONTROLLER_STUB_FACTORY_H diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_tracing_connection.cc b/google/cloud/dataproc/v1/internal/session_template_controller_tracing_connection.cc index bc93ce5f179b5..3a87b35cf55b8 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_tracing_connection.cc +++ b/google/cloud/dataproc/v1/internal/session_template_controller_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SessionTemplateControllerTracingConnection:: SessionTemplateControllerTracingConnection( std::shared_ptr child) @@ -147,17 +145,13 @@ Status SessionTemplateControllerTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSessionTemplateControllerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_tracing_connection.h b/google/cloud/dataproc/v1/internal/session_template_controller_tracing_connection.h index 405b531b22470..a557af4393b58 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_tracing_connection.h +++ b/google/cloud/dataproc/v1/internal/session_template_controller_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SessionTemplateControllerTracingConnection : public dataproc_v1::SessionTemplateControllerConnection { public: @@ -85,8 +83,6 @@ class SessionTemplateControllerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_tracing_stub.cc b/google/cloud/dataproc/v1/internal/session_template_controller_tracing_stub.cc index ed797220cb2f8..9e0fda5f7ebc8 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_tracing_stub.cc +++ b/google/cloud/dataproc/v1/internal/session_template_controller_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SessionTemplateControllerTracingStub::SessionTemplateControllerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -179,20 +180,16 @@ Status SessionTemplateControllerTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSessionTemplateControllerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/session_template_controller_tracing_stub.h b/google/cloud/dataproc/v1/internal/session_template_controller_tracing_stub.h index 02ed759e87ca9..75746c40b65f7 100644 --- a/google/cloud/dataproc/v1/internal/session_template_controller_tracing_stub.h +++ b/google/cloud/dataproc/v1/internal/session_template_controller_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SessionTemplateControllerTracingStub : public SessionTemplateControllerStub { public: @@ -100,8 +101,6 @@ class SessionTemplateControllerTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -117,4 +116,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_SESSION_TEMPLATE_CONTROLLER_TRACING_STUB_H diff --git a/google/cloud/dataproc/v1/internal/workflow_template_auth_decorator.cc b/google/cloud/dataproc/v1/internal/workflow_template_auth_decorator.cc index 898fe096026b0..ade04b4706063 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_auth_decorator.cc +++ b/google/cloud/dataproc/v1/internal/workflow_template_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dataproc/v1/workflow_templates.proto #include "google/cloud/dataproc/v1/internal/workflow_template_auth_decorator.h" -#include +#include "google/cloud/dataproc/v1/workflow_templates.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -236,3 +239,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/workflow_template_auth_decorator.h b/google/cloud/dataproc/v1/internal/workflow_template_auth_decorator.h index 61ef2f7f40646..fc20cc4fbd142 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_auth_decorator.h +++ b/google/cloud/dataproc/v1/internal/workflow_template_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/workflow_template_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -143,4 +146,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_WORKFLOW_TEMPLATE_AUTH_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/workflow_template_connection_impl.h b/google/cloud/dataproc/v1/internal/workflow_template_connection_impl.h index 9a694690d314c..c29d80f959f5e 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_connection_impl.h +++ b/google/cloud/dataproc/v1/internal/workflow_template_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataproc/v1/internal/workflow_template_logging_decorator.cc b/google/cloud/dataproc/v1/internal/workflow_template_logging_decorator.cc index 9792c046b33a0..8d7168a9f94f5 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_logging_decorator.cc +++ b/google/cloud/dataproc/v1/internal/workflow_template_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dataproc/v1/workflow_templates.proto #include "google/cloud/dataproc/v1/internal/workflow_template_logging_decorator.h" +#include "google/cloud/dataproc/v1/workflow_templates.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -289,3 +292,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/workflow_template_logging_decorator.h b/google/cloud/dataproc/v1/internal/workflow_template_logging_decorator.h index 8e98b02c450d5..c7764ce0a9bbc 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_logging_decorator.h +++ b/google/cloud/dataproc/v1/internal/workflow_template_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/workflow_template_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -143,4 +146,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_WORKFLOW_TEMPLATE_LOGGING_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/workflow_template_metadata_decorator.cc b/google/cloud/dataproc/v1/internal/workflow_template_metadata_decorator.cc index 5aef8d0bf8caa..40afc8e8b815b 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_metadata_decorator.cc +++ b/google/cloud/dataproc/v1/internal/workflow_template_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dataproc/v1/workflow_templates.proto #include "google/cloud/dataproc/v1/internal/workflow_template_metadata_decorator.h" +#include "google/cloud/dataproc/v1/workflow_templates.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dataproc_v1_internal { @@ -237,3 +241,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/workflow_template_metadata_decorator.h b/google/cloud/dataproc/v1/internal/workflow_template_metadata_decorator.h index df9ccfa612a2e..40906ef9d6628 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_metadata_decorator.h +++ b/google/cloud/dataproc/v1/internal/workflow_template_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dataproc/v1/internal/workflow_template_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dataproc_v1_internal { @@ -149,4 +152,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_WORKFLOW_TEMPLATE_METADATA_DECORATOR_H diff --git a/google/cloud/dataproc/v1/internal/workflow_template_option_defaults.cc b/google/cloud/dataproc/v1/internal/workflow_template_option_defaults.cc index 565292cbcac26..b17d662867c70 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_option_defaults.cc +++ b/google/cloud/dataproc/v1/internal/workflow_template_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dataproc/v1/internal/workflow_template_option_defaults.h" #include "google/cloud/dataproc/v1/workflow_template_connection.h" #include "google/cloud/dataproc/v1/workflow_template_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options WorkflowTemplateServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( dataproc_v1::WorkflowTemplateServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dataproc/v1/internal/workflow_template_stub.cc b/google/cloud/dataproc/v1/internal/workflow_template_stub.cc index c67c534831df6..3ce8d117ad516 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_stub.cc +++ b/google/cloud/dataproc/v1/internal/workflow_template_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dataproc/v1/workflow_templates.proto #include "google/cloud/dataproc/v1/internal/workflow_template_stub.h" +#include "google/cloud/dataproc/v1/workflow_templates.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -290,3 +293,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/workflow_template_stub.h b/google/cloud/dataproc/v1/internal/workflow_template_stub.h index a1c77143f0b67..fd876d86b2e04 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_stub.h +++ b/google/cloud/dataproc/v1/internal/workflow_template_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_WORKFLOW_TEMPLATE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_WORKFLOW_TEMPLATE_STUB_H +#include "google/cloud/dataproc/v1/workflow_templates.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 -#include -#include +#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 dataproc_v1_internal { @@ -258,4 +261,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_WORKFLOW_TEMPLATE_STUB_H diff --git a/google/cloud/dataproc/v1/internal/workflow_template_stub_factory.cc b/google/cloud/dataproc/v1/internal/workflow_template_stub_factory.cc index 6426cf1ed81e3..123e20d66c837 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_stub_factory.cc +++ b/google/cloud/dataproc/v1/internal/workflow_template_stub_factory.cc @@ -22,18 +22,21 @@ #include "google/cloud/dataproc/v1/internal/workflow_template_metadata_decorator.h" #include "google/cloud/dataproc/v1/internal/workflow_template_stub.h" #include "google/cloud/dataproc/v1/internal/workflow_template_tracing_stub.h" +#include "google/cloud/dataproc/v1/workflow_templates.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 -#include -#include +#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 dataproc_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/workflow_template_stub_factory.h b/google/cloud/dataproc/v1/internal/workflow_template_stub_factory.h index 5b1a55e1f9edd..22dd9e6b458fc 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_stub_factory.h +++ b/google/cloud/dataproc/v1/internal/workflow_template_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_WORKFLOW_TEMPLATE_STUB_FACTORY_H diff --git a/google/cloud/dataproc/v1/internal/workflow_template_tracing_connection.cc b/google/cloud/dataproc/v1/internal/workflow_template_tracing_connection.cc index 7be38e142f184..810e5b5fea8b9 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_tracing_connection.cc +++ b/google/cloud/dataproc/v1/internal/workflow_template_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - WorkflowTemplateServiceTracingConnection:: WorkflowTemplateServiceTracingConnection( std::shared_ptr child) @@ -216,17 +214,13 @@ Status WorkflowTemplateServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeWorkflowTemplateServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dataproc/v1/internal/workflow_template_tracing_connection.h b/google/cloud/dataproc/v1/internal/workflow_template_tracing_connection.h index 46d0d65857234..e74d0afe9f0f9 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_tracing_connection.h +++ b/google/cloud/dataproc/v1/internal/workflow_template_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class WorkflowTemplateServiceTracingConnection : public dataproc_v1::WorkflowTemplateServiceConnection { public: @@ -116,8 +114,6 @@ class WorkflowTemplateServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dataproc/v1/internal/workflow_template_tracing_stub.cc b/google/cloud/dataproc/v1/internal/workflow_template_tracing_stub.cc index 36082746dae86..008f4f18a0eae 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_tracing_stub.cc +++ b/google/cloud/dataproc/v1/internal/workflow_template_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - WorkflowTemplateServiceTracingStub::WorkflowTemplateServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -273,19 +274,15 @@ future WorkflowTemplateServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeWorkflowTemplateServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dataproc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataproc/v1/internal/workflow_template_tracing_stub.h b/google/cloud/dataproc/v1/internal/workflow_template_tracing_stub.h index 6e3a6c6a65126..a4dd3b626c0db 100644 --- a/google/cloud/dataproc/v1/internal/workflow_template_tracing_stub.h +++ b/google/cloud/dataproc/v1/internal/workflow_template_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dataproc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class WorkflowTemplateServiceTracingStub : public WorkflowTemplateServiceStub { public: ~WorkflowTemplateServiceTracingStub() override = default; @@ -139,8 +140,6 @@ class WorkflowTemplateServiceTracingStub : public WorkflowTemplateServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -156,4 +155,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_INTERNAL_WORKFLOW_TEMPLATE_TRACING_STUB_H diff --git a/google/cloud/dataproc/v1/job_controller_client.h b/google/cloud/dataproc/v1/job_controller_client.h index a0488c39774bd..8ca6f5c2b54e4 100644 --- a/google/cloud/dataproc/v1/job_controller_client.h +++ b/google/cloud/dataproc/v1/job_controller_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/job_controller_connection.h b/google/cloud/dataproc/v1/job_controller_connection.h index f4edb69373c41..4be9fba86163e 100644 --- a/google/cloud/dataproc/v1/job_controller_connection.h +++ b/google/cloud/dataproc/v1/job_controller_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/dataproc/v1/internal/job_controller_retry_traits.h" #include "google/cloud/dataproc/v1/job_controller_connection_idempotency_policy.h" +#include "google/cloud/dataproc/v1/jobs.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/dataproc/v1/job_controller_connection_idempotency_policy.h b/google/cloud/dataproc/v1/job_controller_connection_idempotency_policy.h index c21f42ad595f0..40004c0585667 100644 --- a/google/cloud/dataproc/v1/job_controller_connection_idempotency_policy.h +++ b/google/cloud/dataproc/v1/job_controller_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_JOB_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_JOB_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataproc/v1/jobs.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataproc/v1/node_group_controller_client.h b/google/cloud/dataproc/v1/node_group_controller_client.h index 7f8cf9206ee6b..d821fda576d43 100644 --- a/google/cloud/dataproc/v1/node_group_controller_client.h +++ b/google/cloud/dataproc/v1/node_group_controller_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -126,7 +126,7 @@ class NodeGroupControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.CreateNodeGroupRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/node_groups.proto#L86} - /// [google.cloud.dataproc.v1.NodeGroup]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L962} + /// [google.cloud.dataproc.v1.NodeGroup]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L981} /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L131} /// // clang-format on @@ -184,7 +184,7 @@ class NodeGroupControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.CreateNodeGroupRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/node_groups.proto#L86} - /// [google.cloud.dataproc.v1.NodeGroup]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L962} + /// [google.cloud.dataproc.v1.NodeGroup]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L981} /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L131} /// // clang-format on @@ -252,7 +252,7 @@ class NodeGroupControllerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataproc.v1.NodeGroup]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L962} + /// [google.cloud.dataproc.v1.NodeGroup]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L981} /// [google.cloud.dataproc.v1.ResizeNodeGroupRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/node_groups.proto#L122} /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L131} /// @@ -307,7 +307,7 @@ class NodeGroupControllerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataproc.v1.NodeGroup]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L962} + /// [google.cloud.dataproc.v1.NodeGroup]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L981} /// [google.cloud.dataproc.v1.ResizeNodeGroupRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/node_groups.proto#L122} /// [google.longrunning.Operation.metadata]: @googleapis_reference_link{google/longrunning/operations.proto#L131} /// @@ -366,7 +366,7 @@ class NodeGroupControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.GetNodeGroupRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/node_groups.proto#L164} - /// [google.cloud.dataproc.v1.NodeGroup]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L962} + /// [google.cloud.dataproc.v1.NodeGroup]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L981} /// // clang-format on StatusOr GetNodeGroup( @@ -397,7 +397,7 @@ class NodeGroupControllerClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataproc.v1.GetNodeGroupRequest]: @googleapis_reference_link{google/cloud/dataproc/v1/node_groups.proto#L164} - /// [google.cloud.dataproc.v1.NodeGroup]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L962} + /// [google.cloud.dataproc.v1.NodeGroup]: @googleapis_reference_link{google/cloud/dataproc/v1/clusters.proto#L981} /// // clang-format on StatusOr GetNodeGroup( @@ -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/node_group_controller_connection.h b/google/cloud/dataproc/v1/node_group_controller_connection.h index e1ea0c480821e..bbe5f2fc0ec82 100644 --- a/google/cloud/dataproc/v1/node_group_controller_connection.h +++ b/google/cloud/dataproc/v1/node_group_controller_connection.h @@ -21,6 +21,8 @@ #include "google/cloud/dataproc/v1/internal/node_group_controller_retry_traits.h" #include "google/cloud/dataproc/v1/node_group_controller_connection_idempotency_policy.h" +#include "google/cloud/dataproc/v1/node_groups.pb.h" +#include "google/cloud/dataproc/v1/operations.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,9 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/dataproc/v1/node_group_controller_connection_idempotency_policy.h b/google/cloud/dataproc/v1/node_group_controller_connection_idempotency_policy.h index 2005d1a34183c..def8b10be0c87 100644 --- a/google/cloud/dataproc/v1/node_group_controller_connection_idempotency_policy.h +++ b/google/cloud/dataproc/v1/node_group_controller_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_NODE_GROUP_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_NODE_GROUP_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataproc/v1/node_groups.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataproc/v1/session_controller_client.h b/google/cloud/dataproc/v1/session_controller_client.h index 511adf5658a23..f266d396af1aa 100644 --- a/google/cloud/dataproc/v1/session_controller_client.h +++ b/google/cloud/dataproc/v1/session_controller_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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_controller_connection.h b/google/cloud/dataproc/v1/session_controller_connection.h index 36345ea402e0d..0156c5b32b62e 100644 --- a/google/cloud/dataproc/v1/session_controller_connection.h +++ b/google/cloud/dataproc/v1/session_controller_connection.h @@ -20,7 +20,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_SESSION_CONTROLLER_CONNECTION_H #include "google/cloud/dataproc/v1/internal/session_controller_retry_traits.h" +#include "google/cloud/dataproc/v1/operations.pb.h" #include "google/cloud/dataproc/v1/session_controller_connection_idempotency_policy.h" +#include "google/cloud/dataproc/v1/sessions.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,9 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/dataproc/v1/session_controller_connection_idempotency_policy.h b/google/cloud/dataproc/v1/session_controller_connection_idempotency_policy.h index 2923d64dc5b06..662b28bc56ca2 100644 --- a/google/cloud/dataproc/v1/session_controller_connection_idempotency_policy.h +++ b/google/cloud/dataproc/v1/session_controller_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_SESSION_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_SESSION_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataproc/v1/sessions.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/session_template_controller_connection.h b/google/cloud/dataproc/v1/session_template_controller_connection.h index 688ff76299b60..7cfa2029c0e0e 100644 --- a/google/cloud/dataproc/v1/session_template_controller_connection.h +++ b/google/cloud/dataproc/v1/session_template_controller_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/dataproc/v1/internal/session_template_controller_retry_traits.h" #include "google/cloud/dataproc/v1/session_template_controller_connection_idempotency_policy.h" +#include "google/cloud/dataproc/v1/session_templates.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 #include #include diff --git a/google/cloud/dataproc/v1/session_template_controller_connection_idempotency_policy.h b/google/cloud/dataproc/v1/session_template_controller_connection_idempotency_policy.h index 2a641c638f8e1..75c484c9e33ac 100644 --- a/google/cloud/dataproc/v1/session_template_controller_connection_idempotency_policy.h +++ b/google/cloud/dataproc/v1/session_template_controller_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_SESSION_TEMPLATE_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_SESSION_TEMPLATE_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataproc/v1/session_templates.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataproc/v1/workflow_template_client.h b/google/cloud/dataproc/v1/workflow_template_client.h index 3645bf1b3245f..c78b446b1d87b 100644 --- a/google/cloud/dataproc/v1/workflow_template_client.h +++ b/google/cloud/dataproc/v1/workflow_template_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/dataproc/v1/workflow_template_connection.h b/google/cloud/dataproc/v1/workflow_template_connection.h index 44ed8e1cfbe07..9beca4f4b6a9f 100644 --- a/google/cloud/dataproc/v1/workflow_template_connection.h +++ b/google/cloud/dataproc/v1/workflow_template_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/dataproc/v1/internal/workflow_template_retry_traits.h" #include "google/cloud/dataproc/v1/workflow_template_connection_idempotency_policy.h" +#include "google/cloud/dataproc/v1/workflow_templates.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/dataproc/v1/workflow_template_connection_idempotency_policy.h b/google/cloud/dataproc/v1/workflow_template_connection_idempotency_policy.h index 86c46bc8cac38..93db3715f791b 100644 --- a/google/cloud/dataproc/v1/workflow_template_connection_idempotency_policy.h +++ b/google/cloud/dataproc/v1/workflow_template_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_WORKFLOW_TEMPLATE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_V1_WORKFLOW_TEMPLATE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dataproc/v1/workflow_templates.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dataproc/workflow_template_client.h b/google/cloud/dataproc/workflow_template_client.h deleted file mode 100644 index b5f00a555072a..0000000000000 --- a/google/cloud/dataproc/workflow_template_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/workflow_templates.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_WORKFLOW_TEMPLATE_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_WORKFLOW_TEMPLATE_CLIENT_H - -#include "google/cloud/dataproc/v1/workflow_template_client.h" -#include "google/cloud/dataproc/workflow_template_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dataproc_v1 instead of the aliases defined in -/// this namespace. -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::WorkflowTemplateServiceClient directly. -using ::google::cloud::dataproc_v1::WorkflowTemplateServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_WORKFLOW_TEMPLATE_CLIENT_H diff --git a/google/cloud/dataproc/workflow_template_connection.h b/google/cloud/dataproc/workflow_template_connection.h deleted file mode 100644 index 0b2f944da8bd0..0000000000000 --- a/google/cloud/dataproc/workflow_template_connection.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/workflow_templates.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_WORKFLOW_TEMPLATE_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_WORKFLOW_TEMPLATE_CONNECTION_H - -#include "google/cloud/dataproc/v1/workflow_template_connection.h" -#include "google/cloud/dataproc/workflow_template_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::MakeWorkflowTemplateServiceConnection directly. -using ::google::cloud::dataproc_v1::MakeWorkflowTemplateServiceConnection; - -/// @deprecated Use dataproc_v1::WorkflowTemplateServiceConnection directly. -using ::google::cloud::dataproc_v1::WorkflowTemplateServiceConnection; - -/// @deprecated Use -/// dataproc_v1::WorkflowTemplateServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::dataproc_v1:: - WorkflowTemplateServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use dataproc_v1::WorkflowTemplateServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::dataproc_v1:: - WorkflowTemplateServiceLimitedTimeRetryPolicy; - -/// @deprecated Use dataproc_v1::WorkflowTemplateServiceRetryPolicy directly. -using ::google::cloud::dataproc_v1::WorkflowTemplateServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_WORKFLOW_TEMPLATE_CONNECTION_H diff --git a/google/cloud/dataproc/workflow_template_connection_idempotency_policy.h b/google/cloud/dataproc/workflow_template_connection_idempotency_policy.h deleted file mode 100644 index 9eba029026560..0000000000000 --- a/google/cloud/dataproc/workflow_template_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/workflow_templates.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_WORKFLOW_TEMPLATE_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_WORKFLOW_TEMPLATE_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/dataproc/v1/workflow_template_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// dataproc_v1::MakeDefaultWorkflowTemplateServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::dataproc_v1:: - MakeDefaultWorkflowTemplateServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// dataproc_v1::WorkflowTemplateServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::dataproc_v1:: - WorkflowTemplateServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_WORKFLOW_TEMPLATE_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/dataproc/workflow_template_options.h b/google/cloud/dataproc/workflow_template_options.h deleted file mode 100644 index 551f29c9c8167..0000000000000 --- a/google/cloud/dataproc/workflow_template_options.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/dataproc/v1/workflow_templates.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_WORKFLOW_TEMPLATE_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_WORKFLOW_TEMPLATE_OPTIONS_H - -#include "google/cloud/dataproc/v1/workflow_template_options.h" -#include "google/cloud/dataproc/workflow_template_connection.h" -#include "google/cloud/dataproc/workflow_template_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace dataproc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dataproc_v1::WorkflowTemplateServicePollingPolicyOption -/// directly. -using ::google::cloud::dataproc_v1::WorkflowTemplateServicePollingPolicyOption; - -/// @deprecated Use dataproc_v1::WorkflowTemplateServiceBackoffPolicyOption -/// directly. -using ::google::cloud::dataproc_v1::WorkflowTemplateServiceBackoffPolicyOption; - -/// @deprecated Use -/// dataproc_v1::WorkflowTemplateServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::dataproc_v1:: - WorkflowTemplateServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use dataproc_v1::WorkflowTemplateServicePolicyOptionList -/// directly. -using ::google::cloud::dataproc_v1::WorkflowTemplateServicePolicyOptionList; - -/// @deprecated Use dataproc_v1::WorkflowTemplateServiceRetryPolicyOption -/// directly. -using ::google::cloud::dataproc_v1::WorkflowTemplateServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dataproc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPROC_WORKFLOW_TEMPLATE_OPTIONS_H diff --git a/google/cloud/datastore/BUILD.bazel b/google/cloud/datastore/BUILD.bazel index 7dd59551f7cb6..2e35b12614b8d 100644 --- a/google/cloud/datastore/BUILD.bazel +++ b/google/cloud/datastore/BUILD.bazel @@ -24,7 +24,7 @@ service_dirs = [ ] googleapis_deps = [ - "@com_google_googleapis//google/datastore/v1:datastore_cc_grpc", + "@googleapis//google/datastore/v1:datastore_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/datastore/admin/v1/datastore_admin_client.h b/google/cloud/datastore/admin/v1/datastore_admin_client.h index ea9a131878b8c..ceb96c7d6bd42 100644 --- a/google/cloud/datastore/admin/v1/datastore_admin_client.h +++ b/google/cloud/datastore/admin/v1/datastore_admin_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/admin/v1/datastore_admin_connection.h b/google/cloud/datastore/admin/v1/datastore_admin_connection.h index c9099e4d3d219..103a89ccbee99 100644 --- a/google/cloud/datastore/admin/v1/datastore_admin_connection.h +++ b/google/cloud/datastore/admin/v1/datastore_admin_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/datastore/admin/v1/datastore_admin.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datastore/admin/v1/datastore_admin_connection_idempotency_policy.h b/google/cloud/datastore/admin/v1/datastore_admin_connection_idempotency_policy.h index d78abe1cd49ba..da8562b1d7271 100644 --- a/google/cloud/datastore/admin/v1/datastore_admin_connection_idempotency_policy.h +++ b/google/cloud/datastore/admin/v1/datastore_admin_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/datastore/admin/v1/datastore_admin.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_auth_decorator.cc b/google/cloud/datastore/admin/v1/internal/datastore_admin_auth_decorator.cc index 50fc0ee8b3c64..ad6d399462a85 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_auth_decorator.cc +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/datastore/admin/v1/datastore_admin.proto #include "google/cloud/datastore/admin/v1/internal/datastore_admin_auth_decorator.h" -#include +#include "google/datastore/admin/v1/datastore_admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_admin_v1_internal { @@ -233,3 +236,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastore_admin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_auth_decorator.h b/google/cloud/datastore/admin/v1/internal/datastore_admin_auth_decorator.h index 4c4c2666859b1..86e442a940e5a 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_auth_decorator.h +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datastore/admin/v1/internal/datastore_admin_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 datastore_admin_v1_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTORE_ADMIN_V1_INTERNAL_DATASTORE_ADMIN_AUTH_DECORATOR_H diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_connection_impl.h b/google/cloud/datastore/admin/v1/internal/datastore_admin_connection_impl.h index f541a356bc2b6..621cf39ac9263 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_connection_impl.h +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_logging_decorator.cc b/google/cloud/datastore/admin/v1/internal/datastore_admin_logging_decorator.cc index 0e6b75596b449..00e2aec166080 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_logging_decorator.cc +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/datastore/admin/v1/internal/datastore_admin_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/datastore/admin/v1/datastore_admin.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_admin_v1_internal { @@ -262,3 +265,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastore_admin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_logging_decorator.h b/google/cloud/datastore/admin/v1/internal/datastore_admin_logging_decorator.h index 41cebc3dbde67..d5cae052e2440 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_logging_decorator.h +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datastore/admin/v1/internal/datastore_admin_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 datastore_admin_v1_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTORE_ADMIN_V1_INTERNAL_DATASTORE_ADMIN_LOGGING_DECORATOR_H diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_metadata_decorator.cc b/google/cloud/datastore/admin/v1/internal/datastore_admin_metadata_decorator.cc index 50fcd44fc5be0..d3809a8bf8559 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_metadata_decorator.cc +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/datastore/admin/v1/internal/datastore_admin_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/datastore/admin/v1/datastore_admin.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_admin_v1_internal { @@ -227,3 +231,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastore_admin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_metadata_decorator.h b/google/cloud/datastore/admin/v1/internal/datastore_admin_metadata_decorator.h index 8884cb69ff0d5..b418ee4e3c4db 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_metadata_decorator.h +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datastore/admin/v1/internal/datastore_admin_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 datastore_admin_v1_internal { @@ -134,4 +137,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTORE_ADMIN_V1_INTERNAL_DATASTORE_ADMIN_METADATA_DECORATOR_H diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_option_defaults.cc b/google/cloud/datastore/admin/v1/internal/datastore_admin_option_defaults.cc index 3b1e5447bb05b..469e4947fd78a 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_option_defaults.cc +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_option_defaults.cc @@ -42,7 +42,7 @@ Options DatastoreAdminDefaultOptions(Options options) { if (!options.has()) { options.set( datastore_admin_v1::DatastoreAdminLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_stub.cc b/google/cloud/datastore/admin/v1/internal/datastore_admin_stub.cc index a0f65d13304d6..ff1cf02aee97e 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_stub.cc +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/datastore/admin/v1/internal/datastore_admin_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/datastore/admin/v1/datastore_admin.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 datastore_admin_v1_internal { @@ -262,3 +265,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastore_admin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_stub.h b/google/cloud/datastore/admin/v1/internal/datastore_admin_stub.h index 2265f2417937e..4a7dc26a33a70 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_stub.h +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/datastore/admin/v1/datastore_admin.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 datastore_admin_v1_internal { @@ -219,4 +222,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTORE_ADMIN_V1_INTERNAL_DATASTORE_ADMIN_STUB_H diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_stub_factory.cc b/google/cloud/datastore/admin/v1/internal/datastore_admin_stub_factory.cc index 3bc370a35ff10..53f8ee3389c2a 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_stub_factory.cc +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/datastore/admin/v1/datastore_admin.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 datastore_admin_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastore_admin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_stub_factory.h b/google/cloud/datastore/admin/v1/internal/datastore_admin_stub_factory.h index fa31f6e6e340a..61a203ca3af6d 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_stub_factory.h +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_admin_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTORE_ADMIN_V1_INTERNAL_DATASTORE_ADMIN_STUB_FACTORY_H diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_connection.cc b/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_connection.cc index 1bf2e5beba331..cc55fecc9aa88 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_connection.cc +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace datastore_admin_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DatastoreAdminTracingConnection::DatastoreAdminTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -203,16 +201,12 @@ Status DatastoreAdminTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDatastoreAdminTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_connection.h b/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_connection.h index cc75bbe19c420..18baf26e2af5e 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_connection.h +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace datastore_admin_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DatastoreAdminTracingConnection : public datastore_admin_v1::DatastoreAdminConnection { public: @@ -106,8 +104,6 @@ class DatastoreAdminTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_stub.cc b/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_stub.cc index 6206228035d4a..7957f44ccc1d6 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_stub.cc +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_admin_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DatastoreAdminTracingStub::DatastoreAdminTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -234,18 +235,14 @@ future DatastoreAdminTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDatastoreAdminTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastore_admin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_stub.h b/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_stub.h index 10d180880c4e1..eb9d85dd4f28d 100644 --- a/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_stub.h +++ b/google/cloud/datastore/admin/v1/internal/datastore_admin_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_admin_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DatastoreAdminTracingStub : public DatastoreAdminStub { public: ~DatastoreAdminTracingStub() override = default; @@ -124,8 +125,6 @@ class DatastoreAdminTracingStub : public DatastoreAdminStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -140,4 +139,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTORE_ADMIN_V1_INTERNAL_DATASTORE_ADMIN_TRACING_STUB_H diff --git a/google/cloud/datastore/quickstart/.bazelrc b/google/cloud/datastore/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/datastore/quickstart/.bazelrc +++ b/google/cloud/datastore/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/datastore/quickstart/CMakeLists.txt index faea20bebf6e1..321cb9280941f 100644 --- a/google/cloud/datastore/quickstart/CMakeLists.txt +++ b/google/cloud/datastore/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Datastore API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-datastore-quickstart CXX) find_package(google_cloud_cpp_datastore REQUIRED) diff --git a/google/cloud/datastore/quickstart/WORKSPACE.bazel b/google/cloud/datastore/quickstart/WORKSPACE.bazel index c591461ac77ba..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 = "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/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/datastore/v1/datastore_connection.h b/google/cloud/datastore/v1/datastore_connection.h index 06e36424b98a4..46a1cc970670f 100644 --- a/google/cloud/datastore/v1/datastore_connection.h +++ b/google/cloud/datastore/v1/datastore_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/datastore/v1/datastore.pb.h" #include namespace google { diff --git a/google/cloud/datastore/v1/datastore_connection_idempotency_policy.h b/google/cloud/datastore/v1/datastore_connection_idempotency_policy.h index 339f92870f611..0752442af1aa4 100644 --- a/google/cloud/datastore/v1/datastore_connection_idempotency_policy.h +++ b/google/cloud/datastore/v1/datastore_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/datastore/v1/datastore.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datastore/v1/internal/datastore_auth_decorator.cc b/google/cloud/datastore/v1/internal/datastore_auth_decorator.cc index dc753020aefd7..4bea4bbbd12d1 100644 --- a/google/cloud/datastore/v1/internal/datastore_auth_decorator.cc +++ b/google/cloud/datastore/v1/internal/datastore_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/datastore/v1/datastore.proto #include "google/cloud/datastore/v1/internal/datastore_auth_decorator.h" -#include +#include "google/datastore/v1/datastore.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_v1_internal { @@ -134,3 +137,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastore/v1/internal/datastore_auth_decorator.h b/google/cloud/datastore/v1/internal/datastore_auth_decorator.h index 34ebff80e7215..af33c72e21f40 100644 --- a/google/cloud/datastore/v1/internal/datastore_auth_decorator.h +++ b/google/cloud/datastore/v1/internal/datastore_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_v1_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTORE_V1_INTERNAL_DATASTORE_AUTH_DECORATOR_H diff --git a/google/cloud/datastore/v1/internal/datastore_logging_decorator.cc b/google/cloud/datastore/v1/internal/datastore_logging_decorator.cc index ae2aff0b08191..9f3fb67c69f8f 100644 --- a/google/cloud/datastore/v1/internal/datastore_logging_decorator.cc +++ b/google/cloud/datastore/v1/internal/datastore_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/datastore/v1/internal/datastore_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/datastore/v1/datastore.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_v1_internal { @@ -176,3 +179,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastore/v1/internal/datastore_logging_decorator.h b/google/cloud/datastore/v1/internal/datastore_logging_decorator.h index 3fe5acb27c08a..058070244b3d1 100644 --- a/google/cloud/datastore/v1/internal/datastore_logging_decorator.h +++ b/google/cloud/datastore/v1/internal/datastore_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_v1_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTORE_V1_INTERNAL_DATASTORE_LOGGING_DECORATOR_H diff --git a/google/cloud/datastore/v1/internal/datastore_metadata_decorator.cc b/google/cloud/datastore/v1/internal/datastore_metadata_decorator.cc index 28ec5bff2f177..1842eb1f274f1 100644 --- a/google/cloud/datastore/v1/internal/datastore_metadata_decorator.cc +++ b/google/cloud/datastore/v1/internal/datastore_metadata_decorator.cc @@ -18,18 +18,21 @@ #include "google/cloud/datastore/v1/internal/datastore_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/routing_matcher.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/datastore/v1/datastore.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_v1_internal { @@ -292,3 +295,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastore/v1/internal/datastore_metadata_decorator.h b/google/cloud/datastore/v1/internal/datastore_metadata_decorator.h index ed4e7e77e87cb..d6eaa392abd82 100644 --- a/google/cloud/datastore/v1/internal/datastore_metadata_decorator.h +++ b/google/cloud/datastore/v1/internal/datastore_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_v1_internal { @@ -102,4 +105,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTORE_V1_INTERNAL_DATASTORE_METADATA_DECORATOR_H diff --git a/google/cloud/datastore/v1/internal/datastore_option_defaults.cc b/google/cloud/datastore/v1/internal/datastore_option_defaults.cc index d685127f29137..4b1b3d3263293 100644 --- a/google/cloud/datastore/v1/internal/datastore_option_defaults.cc +++ b/google/cloud/datastore/v1/internal/datastore_option_defaults.cc @@ -41,7 +41,7 @@ Options DatastoreDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - datastore_v1::DatastoreLimitedTimeRetryPolicy(std::chrono::minutes(30)) + datastore_v1::DatastoreLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/datastore/v1/internal/datastore_stub.cc b/google/cloud/datastore/v1/internal/datastore_stub.cc index 0ef6628f24e0f..d7c626c3c0b8a 100644 --- a/google/cloud/datastore/v1/internal/datastore_stub.cc +++ b/google/cloud/datastore/v1/internal/datastore_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/datastore/v1/internal/datastore_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/datastore/v1/datastore.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_v1_internal { @@ -173,3 +176,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastore/v1/internal/datastore_stub.h b/google/cloud/datastore/v1/internal/datastore_stub.h index 89b6d51c4d392..3a83b831100b3 100644 --- a/google/cloud/datastore/v1/internal/datastore_stub.h +++ b/google/cloud/datastore/v1/internal/datastore_stub.h @@ -22,11 +22,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/datastore/v1/datastore.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 datastore_v1_internal { @@ -157,4 +160,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTORE_V1_INTERNAL_DATASTORE_STUB_H diff --git a/google/cloud/datastore/v1/internal/datastore_stub_factory.cc b/google/cloud/datastore/v1/internal/datastore_stub_factory.cc index c6c447e9afe51..bdd5ea30d7ca5 100644 --- a/google/cloud/datastore/v1/internal/datastore_stub_factory.cc +++ b/google/cloud/datastore/v1/internal/datastore_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/datastore/v1/datastore.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 datastore_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastore/v1/internal/datastore_stub_factory.h b/google/cloud/datastore/v1/internal/datastore_stub_factory.h index 59ff8fda1651b..354bfb8a4216b 100644 --- a/google/cloud/datastore/v1/internal/datastore_stub_factory.h +++ b/google/cloud/datastore/v1/internal/datastore_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTORE_V1_INTERNAL_DATASTORE_STUB_FACTORY_H diff --git a/google/cloud/datastore/v1/internal/datastore_tracing_connection.cc b/google/cloud/datastore/v1/internal/datastore_tracing_connection.cc index d4f4b8375f692..06cad33326eea 100644 --- a/google/cloud/datastore/v1/internal/datastore_tracing_connection.cc +++ b/google/cloud/datastore/v1/internal/datastore_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace datastore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DatastoreTracingConnection::DatastoreTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -137,16 +135,12 @@ Status DatastoreTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDatastoreTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/datastore/v1/internal/datastore_tracing_connection.h b/google/cloud/datastore/v1/internal/datastore_tracing_connection.h index aa91ac9fad0eb..ed4689bcfc712 100644 --- a/google/cloud/datastore/v1/internal/datastore_tracing_connection.h +++ b/google/cloud/datastore/v1/internal/datastore_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace datastore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DatastoreTracingConnection : public datastore_v1::DatastoreConnection { public: ~DatastoreTracingConnection() override = default; @@ -80,8 +78,6 @@ class DatastoreTracingConnection : public datastore_v1::DatastoreConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/datastore/v1/internal/datastore_tracing_stub.cc b/google/cloud/datastore/v1/internal/datastore_tracing_stub.cc index 2a2f172352050..3c814b707c33c 100644 --- a/google/cloud/datastore/v1/internal/datastore_tracing_stub.cc +++ b/google/cloud/datastore/v1/internal/datastore_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DatastoreTracingStub::DatastoreTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -168,18 +169,14 @@ Status DatastoreTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDatastoreTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastore/v1/internal/datastore_tracing_stub.h b/google/cloud/datastore/v1/internal/datastore_tracing_stub.h index d18386e8fce74..d01a2a7e6f472 100644 --- a/google/cloud/datastore/v1/internal/datastore_tracing_stub.h +++ b/google/cloud/datastore/v1/internal/datastore_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DatastoreTracingStub : public DatastoreStub { public: ~DatastoreTracingStub() override = default; @@ -93,8 +94,6 @@ class DatastoreTracingStub : public DatastoreStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -109,4 +108,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTORE_V1_INTERNAL_DATASTORE_TRACING_STUB_H diff --git a/google/cloud/datastream/BUILD.bazel b/google/cloud/datastream/BUILD.bazel index 4971ef90eba7d..f41c27dcf4992 100644 --- a/google/cloud/datastream/BUILD.bazel +++ b/google/cloud/datastream/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/datastream/v1:datastream_cc_grpc", + "@googleapis//google/cloud/datastream/v1:datastream_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/datastream/CMakeLists.txt b/google/cloud/datastream/CMakeLists.txt index 7d1f1647a60d6..e59ba3ab14e63 100644 --- a/google/cloud/datastream/CMakeLists.txt +++ b/google/cloud/datastream/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(datastream "Datastream API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(datastream_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/datastream/datastream_client.h b/google/cloud/datastream/datastream_client.h deleted file mode 100644 index 05a31759875aa..0000000000000 --- a/google/cloud/datastream/datastream_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/datastream/v1/datastream.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_DATASTREAM_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_DATASTREAM_CLIENT_H - -#include "google/cloud/datastream/datastream_connection.h" -#include "google/cloud/datastream/v1/datastream_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in datastream_v1 instead of the aliases defined in -/// this namespace. -namespace datastream { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datastream_v1::DatastreamClient directly. -using ::google::cloud::datastream_v1::DatastreamClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datastream -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_DATASTREAM_CLIENT_H diff --git a/google/cloud/datastream/datastream_connection.h b/google/cloud/datastream/datastream_connection.h deleted file mode 100644 index dd0f934ecb2d6..0000000000000 --- a/google/cloud/datastream/datastream_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/datastream/v1/datastream.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_DATASTREAM_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_DATASTREAM_CONNECTION_H - -#include "google/cloud/datastream/datastream_connection_idempotency_policy.h" -#include "google/cloud/datastream/v1/datastream_connection.h" - -namespace google { -namespace cloud { -namespace datastream { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datastream_v1::MakeDatastreamConnection directly. -using ::google::cloud::datastream_v1::MakeDatastreamConnection; - -/// @deprecated Use datastream_v1::DatastreamConnection directly. -using ::google::cloud::datastream_v1::DatastreamConnection; - -/// @deprecated Use datastream_v1::DatastreamLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::datastream_v1::DatastreamLimitedErrorCountRetryPolicy; - -/// @deprecated Use datastream_v1::DatastreamLimitedTimeRetryPolicy directly. -using ::google::cloud::datastream_v1::DatastreamLimitedTimeRetryPolicy; - -/// @deprecated Use datastream_v1::DatastreamRetryPolicy directly. -using ::google::cloud::datastream_v1::DatastreamRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datastream -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_DATASTREAM_CONNECTION_H diff --git a/google/cloud/datastream/datastream_connection_idempotency_policy.h b/google/cloud/datastream/datastream_connection_idempotency_policy.h deleted file mode 100644 index d64567b1c1d4f..0000000000000 --- a/google/cloud/datastream/datastream_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/datastream/v1/datastream.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_DATASTREAM_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_DATASTREAM_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/datastream/v1/datastream_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace datastream { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// datastream_v1::MakeDefaultDatastreamConnectionIdempotencyPolicy directly. -using ::google::cloud::datastream_v1:: - MakeDefaultDatastreamConnectionIdempotencyPolicy; - -/// @deprecated Use datastream_v1::DatastreamConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::datastream_v1::DatastreamConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datastream -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_DATASTREAM_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/datastream/datastream_options.h b/google/cloud/datastream/datastream_options.h deleted file mode 100644 index 51ddcafce2463..0000000000000 --- a/google/cloud/datastream/datastream_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/datastream/v1/datastream.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_DATASTREAM_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_DATASTREAM_OPTIONS_H - -#include "google/cloud/datastream/datastream_connection.h" -#include "google/cloud/datastream/datastream_connection_idempotency_policy.h" -#include "google/cloud/datastream/v1/datastream_options.h" - -namespace google { -namespace cloud { -namespace datastream { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datastream_v1::DatastreamPollingPolicyOption directly. -using ::google::cloud::datastream_v1::DatastreamPollingPolicyOption; - -/// @deprecated Use datastream_v1::DatastreamBackoffPolicyOption directly. -using ::google::cloud::datastream_v1::DatastreamBackoffPolicyOption; - -/// @deprecated Use datastream_v1::DatastreamConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::datastream_v1:: - DatastreamConnectionIdempotencyPolicyOption; - -/// @deprecated Use datastream_v1::DatastreamPolicyOptionList directly. -using ::google::cloud::datastream_v1::DatastreamPolicyOptionList; - -/// @deprecated Use datastream_v1::DatastreamRetryPolicyOption directly. -using ::google::cloud::datastream_v1::DatastreamRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datastream -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_DATASTREAM_OPTIONS_H diff --git a/google/cloud/datastream/mocks/mock_datastream_connection.h b/google/cloud/datastream/mocks/mock_datastream_connection.h deleted file mode 100644 index 31451dc76b8e1..0000000000000 --- a/google/cloud/datastream/mocks/mock_datastream_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/datastream/v1/datastream.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_MOCKS_MOCK_DATASTREAM_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_MOCKS_MOCK_DATASTREAM_CONNECTION_H - -#include "google/cloud/datastream/datastream_connection.h" -#include "google/cloud/datastream/v1/mocks/mock_datastream_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in datastream_v1_mocks instead of the aliases -/// defined in this namespace. -namespace datastream_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use datastream_v1_mocks::MockDatastreamConnection directly. -using ::google::cloud::datastream_v1_mocks::MockDatastreamConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace datastream_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_MOCKS_MOCK_DATASTREAM_CONNECTION_H diff --git a/google/cloud/datastream/quickstart/.bazelrc b/google/cloud/datastream/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/datastream/quickstart/.bazelrc +++ b/google/cloud/datastream/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/datastream/quickstart/CMakeLists.txt index e1add349e9928..9df1675dbdcec 100644 --- a/google/cloud/datastream/quickstart/CMakeLists.txt +++ b/google/cloud/datastream/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Datastream API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-datastream-quickstart CXX) find_package(google_cloud_cpp_datastream REQUIRED) diff --git a/google/cloud/datastream/quickstart/WORKSPACE.bazel b/google/cloud/datastream/quickstart/WORKSPACE.bazel index 4ec8325b6835d..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 = "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/datastream/v1/datastream_client.h b/google/cloud/datastream/v1/datastream_client.h index 9004c02c24906..ede86ff07c9fc 100644 --- a/google/cloud/datastream/v1/datastream_client.h +++ b/google/cloud/datastream/v1/datastream_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/datastream/v1/datastream_connection.h b/google/cloud/datastream/v1/datastream_connection.h index 972cfe39f5a70..065f7b559cc07 100644 --- a/google/cloud/datastream/v1/datastream_connection.h +++ b/google/cloud/datastream/v1/datastream_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_V1_DATASTREAM_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_V1_DATASTREAM_CONNECTION_H +#include "google/cloud/datastream/v1/datastream.pb.h" #include "google/cloud/datastream/v1/datastream_connection_idempotency_policy.h" #include "google/cloud/datastream/v1/internal/datastream_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datastream/v1/datastream_connection_idempotency_policy.h b/google/cloud/datastream/v1/datastream_connection_idempotency_policy.h index 218721fd12df2..0f6d6a407bae1 100644 --- a/google/cloud/datastream/v1/datastream_connection_idempotency_policy.h +++ b/google/cloud/datastream/v1/datastream_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_V1_DATASTREAM_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_V1_DATASTREAM_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/datastream/v1/datastream.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datastream/v1/internal/datastream_auth_decorator.cc b/google/cloud/datastream/v1/internal/datastream_auth_decorator.cc index 10dafd93da01f..1e8cb39aa97e1 100644 --- a/google/cloud/datastream/v1/internal/datastream_auth_decorator.cc +++ b/google/cloud/datastream/v1/internal/datastream_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/datastream/v1/datastream.proto #include "google/cloud/datastream/v1/internal/datastream_auth_decorator.h" -#include +#include "google/cloud/datastream/v1/datastream.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastream_v1_internal { @@ -579,3 +582,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastream_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastream/v1/internal/datastream_auth_decorator.h b/google/cloud/datastream/v1/internal/datastream_auth_decorator.h index 241732273d01d..f1fe66bb02f5c 100644 --- a/google/cloud/datastream/v1/internal/datastream_auth_decorator.h +++ b/google/cloud/datastream/v1/internal/datastream_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datastream/v1/internal/datastream_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 datastream_v1_internal { @@ -293,4 +296,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_V1_INTERNAL_DATASTREAM_AUTH_DECORATOR_H diff --git a/google/cloud/datastream/v1/internal/datastream_connection_impl.h b/google/cloud/datastream/v1/internal/datastream_connection_impl.h index 95bd3eabcc5b7..7f2d3e2f5b8fb 100644 --- a/google/cloud/datastream/v1/internal/datastream_connection_impl.h +++ b/google/cloud/datastream/v1/internal/datastream_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/datastream/v1/internal/datastream_logging_decorator.cc b/google/cloud/datastream/v1/internal/datastream_logging_decorator.cc index 20e6289c26df2..c85771cf9d271 100644 --- a/google/cloud/datastream/v1/internal/datastream_logging_decorator.cc +++ b/google/cloud/datastream/v1/internal/datastream_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/datastream/v1/datastream.proto #include "google/cloud/datastream/v1/internal/datastream_logging_decorator.h" +#include "google/cloud/datastream/v1/datastream.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastream_v1_internal { @@ -695,3 +698,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastream_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastream/v1/internal/datastream_logging_decorator.h b/google/cloud/datastream/v1/internal/datastream_logging_decorator.h index 84020d3685403..1d2ad8558f6e7 100644 --- a/google/cloud/datastream/v1/internal/datastream_logging_decorator.h +++ b/google/cloud/datastream/v1/internal/datastream_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datastream/v1/internal/datastream_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 datastream_v1_internal { @@ -293,4 +296,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_V1_INTERNAL_DATASTREAM_LOGGING_DECORATOR_H diff --git a/google/cloud/datastream/v1/internal/datastream_metadata_decorator.cc b/google/cloud/datastream/v1/internal/datastream_metadata_decorator.cc index e44f48abdfcd5..1ea5b80aed626 100644 --- a/google/cloud/datastream/v1/internal/datastream_metadata_decorator.cc +++ b/google/cloud/datastream/v1/internal/datastream_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/datastream/v1/datastream.proto #include "google/cloud/datastream/v1/internal/datastream_metadata_decorator.h" +#include "google/cloud/datastream/v1/datastream.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 datastream_v1_internal { @@ -511,3 +515,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastream_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastream/v1/internal/datastream_metadata_decorator.h b/google/cloud/datastream/v1/internal/datastream_metadata_decorator.h index a04f014b1851d..e6cf0fca4a24c 100644 --- a/google/cloud/datastream/v1/internal/datastream_metadata_decorator.h +++ b/google/cloud/datastream/v1/internal/datastream_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/datastream/v1/internal/datastream_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 datastream_v1_internal { @@ -298,4 +301,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_V1_INTERNAL_DATASTREAM_METADATA_DECORATOR_H diff --git a/google/cloud/datastream/v1/internal/datastream_option_defaults.cc b/google/cloud/datastream/v1/internal/datastream_option_defaults.cc index 182e71d48e0b8..e3491464078bd 100644 --- a/google/cloud/datastream/v1/internal/datastream_option_defaults.cc +++ b/google/cloud/datastream/v1/internal/datastream_option_defaults.cc @@ -41,7 +41,7 @@ Options DatastreamDefaultOptions(Options options) { if (!options.has()) { options.set( datastream_v1::DatastreamLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/datastream/v1/internal/datastream_stub.cc b/google/cloud/datastream/v1/internal/datastream_stub.cc index c9ee81c7c940b..6fb7c62ab860f 100644 --- a/google/cloud/datastream/v1/internal/datastream_stub.cc +++ b/google/cloud/datastream/v1/internal/datastream_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/datastream/v1/datastream.proto #include "google/cloud/datastream/v1/internal/datastream_stub.h" +#include "google/cloud/datastream/v1/datastream.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastream_v1_internal { @@ -676,3 +679,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastream_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastream/v1/internal/datastream_stub.h b/google/cloud/datastream/v1/internal/datastream_stub.h index 736d46fb60334..d2f10890646f0 100644 --- a/google/cloud/datastream/v1/internal/datastream_stub.h +++ b/google/cloud/datastream/v1/internal/datastream_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_V1_INTERNAL_DATASTREAM_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_V1_INTERNAL_DATASTREAM_STUB_H +#include "google/cloud/datastream/v1/datastream.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastream_v1_internal { @@ -555,4 +558,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_V1_INTERNAL_DATASTREAM_STUB_H diff --git a/google/cloud/datastream/v1/internal/datastream_stub_factory.cc b/google/cloud/datastream/v1/internal/datastream_stub_factory.cc index 67a346705683f..d58de1a5f7404 100644 --- a/google/cloud/datastream/v1/internal/datastream_stub_factory.cc +++ b/google/cloud/datastream/v1/internal/datastream_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/datastream/v1/datastream.proto #include "google/cloud/datastream/v1/internal/datastream_stub_factory.h" +#include "google/cloud/datastream/v1/datastream.grpc.pb.h" #include "google/cloud/datastream/v1/internal/datastream_auth_decorator.h" #include "google/cloud/datastream/v1/internal/datastream_logging_decorator.h" #include "google/cloud/datastream/v1/internal/datastream_metadata_decorator.h" #include "google/cloud/datastream/v1/internal/datastream_stub.h" #include "google/cloud/datastream/v1/internal/datastream_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastream_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastream_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastream/v1/internal/datastream_stub_factory.h b/google/cloud/datastream/v1/internal/datastream_stub_factory.h index 0445d8c93604e..473275b5b8ab4 100644 --- a/google/cloud/datastream/v1/internal/datastream_stub_factory.h +++ b/google/cloud/datastream/v1/internal/datastream_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastream_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_V1_INTERNAL_DATASTREAM_STUB_FACTORY_H diff --git a/google/cloud/datastream/v1/internal/datastream_tracing_connection.cc b/google/cloud/datastream/v1/internal/datastream_tracing_connection.cc index a032d3bf82332..48e77e0cf177a 100644 --- a/google/cloud/datastream/v1/internal/datastream_tracing_connection.cc +++ b/google/cloud/datastream/v1/internal/datastream_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace datastream_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DatastreamTracingConnection::DatastreamTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -571,16 +569,12 @@ Status DatastreamTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDatastreamTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/datastream/v1/internal/datastream_tracing_connection.h b/google/cloud/datastream/v1/internal/datastream_tracing_connection.h index 65e6cccafd2bb..76c9db8d2fe09 100644 --- a/google/cloud/datastream/v1/internal/datastream_tracing_connection.h +++ b/google/cloud/datastream/v1/internal/datastream_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace datastream_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DatastreamTracingConnection : public datastream_v1::DatastreamConnection { public: ~DatastreamTracingConnection() override = default; @@ -260,8 +258,6 @@ class DatastreamTracingConnection : public datastream_v1::DatastreamConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/datastream/v1/internal/datastream_tracing_stub.cc b/google/cloud/datastream/v1/internal/datastream_tracing_stub.cc index aab8abe8be698..6a5e31fb5f9ec 100644 --- a/google/cloud/datastream/v1/internal/datastream_tracing_stub.cc +++ b/google/cloud/datastream/v1/internal/datastream_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastream_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DatastreamTracingStub::DatastreamTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -613,18 +614,14 @@ future DatastreamTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDatastreamTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace datastream_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datastream/v1/internal/datastream_tracing_stub.h b/google/cloud/datastream/v1/internal/datastream_tracing_stub.h index 9b8e5503a8857..3d265fbe5a315 100644 --- a/google/cloud/datastream/v1/internal/datastream_tracing_stub.h +++ b/google/cloud/datastream/v1/internal/datastream_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace datastream_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DatastreamTracingStub : public DatastreamStub { public: ~DatastreamTracingStub() override = default; @@ -288,8 +289,6 @@ class DatastreamTracingStub : public DatastreamStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -304,4 +303,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATASTREAM_V1_INTERNAL_DATASTREAM_TRACING_STUB_H diff --git a/google/cloud/deploy/BUILD.bazel b/google/cloud/deploy/BUILD.bazel index 7d2b0d82079bc..48b8fee93430a 100644 --- a/google/cloud/deploy/BUILD.bazel +++ b/google/cloud/deploy/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/deploy/v1:deploy_cc_grpc", + "@googleapis//google/cloud/deploy/v1:deploy_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/deploy/CMakeLists.txt b/google/cloud/deploy/CMakeLists.txt index 54b8843ba6edb..aca4ff1c43874 100644 --- a/google/cloud/deploy/CMakeLists.txt +++ b/google/cloud/deploy/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(deploy "Google Cloud Deploy API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(deploy_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/deploy/cloud_deploy_client.h b/google/cloud/deploy/cloud_deploy_client.h deleted file mode 100644 index 22f428899a9a0..0000000000000 --- a/google/cloud/deploy/cloud_deploy_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/deploy/v1/cloud_deploy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_CLOUD_DEPLOY_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_CLOUD_DEPLOY_CLIENT_H - -#include "google/cloud/deploy/cloud_deploy_connection.h" -#include "google/cloud/deploy/v1/cloud_deploy_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in deploy_v1 instead of the aliases defined in -/// this namespace. -namespace deploy { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use deploy_v1::CloudDeployClient directly. -using ::google::cloud::deploy_v1::CloudDeployClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace deploy -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_CLOUD_DEPLOY_CLIENT_H diff --git a/google/cloud/deploy/cloud_deploy_connection.h b/google/cloud/deploy/cloud_deploy_connection.h deleted file mode 100644 index 07ac72b2d7c99..0000000000000 --- a/google/cloud/deploy/cloud_deploy_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/deploy/v1/cloud_deploy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_CLOUD_DEPLOY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_CLOUD_DEPLOY_CONNECTION_H - -#include "google/cloud/deploy/cloud_deploy_connection_idempotency_policy.h" -#include "google/cloud/deploy/v1/cloud_deploy_connection.h" - -namespace google { -namespace cloud { -namespace deploy { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use deploy_v1::MakeCloudDeployConnection directly. -using ::google::cloud::deploy_v1::MakeCloudDeployConnection; - -/// @deprecated Use deploy_v1::CloudDeployConnection directly. -using ::google::cloud::deploy_v1::CloudDeployConnection; - -/// @deprecated Use deploy_v1::CloudDeployLimitedErrorCountRetryPolicy directly. -using ::google::cloud::deploy_v1::CloudDeployLimitedErrorCountRetryPolicy; - -/// @deprecated Use deploy_v1::CloudDeployLimitedTimeRetryPolicy directly. -using ::google::cloud::deploy_v1::CloudDeployLimitedTimeRetryPolicy; - -/// @deprecated Use deploy_v1::CloudDeployRetryPolicy directly. -using ::google::cloud::deploy_v1::CloudDeployRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace deploy -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_CLOUD_DEPLOY_CONNECTION_H diff --git a/google/cloud/deploy/cloud_deploy_connection_idempotency_policy.h b/google/cloud/deploy/cloud_deploy_connection_idempotency_policy.h deleted file mode 100644 index b3dc187055cdc..0000000000000 --- a/google/cloud/deploy/cloud_deploy_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/deploy/v1/cloud_deploy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_CLOUD_DEPLOY_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_CLOUD_DEPLOY_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/deploy/v1/cloud_deploy_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace deploy { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use deploy_v1::MakeDefaultCloudDeployConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::deploy_v1:: - MakeDefaultCloudDeployConnectionIdempotencyPolicy; - -/// @deprecated Use deploy_v1::CloudDeployConnectionIdempotencyPolicy directly. -using ::google::cloud::deploy_v1::CloudDeployConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace deploy -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_CLOUD_DEPLOY_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/deploy/cloud_deploy_options.h b/google/cloud/deploy/cloud_deploy_options.h deleted file mode 100644 index d63ae04a36d4e..0000000000000 --- a/google/cloud/deploy/cloud_deploy_options.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/deploy/v1/cloud_deploy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_CLOUD_DEPLOY_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_CLOUD_DEPLOY_OPTIONS_H - -#include "google/cloud/deploy/cloud_deploy_connection.h" -#include "google/cloud/deploy/cloud_deploy_connection_idempotency_policy.h" -#include "google/cloud/deploy/v1/cloud_deploy_options.h" - -namespace google { -namespace cloud { -namespace deploy { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use deploy_v1::CloudDeployPollingPolicyOption directly. -using ::google::cloud::deploy_v1::CloudDeployPollingPolicyOption; - -/// @deprecated Use deploy_v1::CloudDeployBackoffPolicyOption directly. -using ::google::cloud::deploy_v1::CloudDeployBackoffPolicyOption; - -/// @deprecated Use deploy_v1::CloudDeployConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::deploy_v1::CloudDeployConnectionIdempotencyPolicyOption; - -/// @deprecated Use deploy_v1::CloudDeployPolicyOptionList directly. -using ::google::cloud::deploy_v1::CloudDeployPolicyOptionList; - -/// @deprecated Use deploy_v1::CloudDeployRetryPolicyOption directly. -using ::google::cloud::deploy_v1::CloudDeployRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace deploy -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_CLOUD_DEPLOY_OPTIONS_H diff --git a/google/cloud/deploy/mocks/mock_cloud_deploy_connection.h b/google/cloud/deploy/mocks/mock_cloud_deploy_connection.h deleted file mode 100644 index 3365dbcd64b1c..0000000000000 --- a/google/cloud/deploy/mocks/mock_cloud_deploy_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/deploy/v1/cloud_deploy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_MOCKS_MOCK_CLOUD_DEPLOY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_MOCKS_MOCK_CLOUD_DEPLOY_CONNECTION_H - -#include "google/cloud/deploy/cloud_deploy_connection.h" -#include "google/cloud/deploy/v1/mocks/mock_cloud_deploy_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in deploy_v1_mocks instead of the aliases -/// defined in this namespace. -namespace deploy_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use deploy_v1_mocks::MockCloudDeployConnection directly. -using ::google::cloud::deploy_v1_mocks::MockCloudDeployConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace deploy_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_MOCKS_MOCK_CLOUD_DEPLOY_CONNECTION_H diff --git a/google/cloud/deploy/quickstart/.bazelrc b/google/cloud/deploy/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/deploy/quickstart/.bazelrc +++ b/google/cloud/deploy/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/deploy/quickstart/CMakeLists.txt index c84703393717b..ce266969c5022 100644 --- a/google/cloud/deploy/quickstart/CMakeLists.txt +++ b/google/cloud/deploy/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Google Cloud Deploy API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-deploy-quickstart CXX) find_package(google_cloud_cpp_deploy REQUIRED) diff --git a/google/cloud/deploy/quickstart/WORKSPACE.bazel b/google/cloud/deploy/quickstart/WORKSPACE.bazel index 8da748519f6c0..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 = "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/deploy/v1/cloud_deploy_client.h b/google/cloud/deploy/v1/cloud_deploy_client.h index 8964fa67b5902..2f5c1bce61932 100644 --- a/google/cloud/deploy/v1/cloud_deploy_client.h +++ b/google/cloud/deploy/v1/cloud_deploy_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/deploy/v1/cloud_deploy_connection.h b/google/cloud/deploy/v1/cloud_deploy_connection.h index 6d7447ba2d586..7257727ce2170 100644 --- a/google/cloud/deploy/v1/cloud_deploy_connection.h +++ b/google/cloud/deploy/v1/cloud_deploy_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_V1_CLOUD_DEPLOY_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_V1_CLOUD_DEPLOY_CONNECTION_H +#include "google/cloud/deploy/v1/cloud_deploy.pb.h" #include "google/cloud/deploy/v1/cloud_deploy_connection_idempotency_policy.h" #include "google/cloud/deploy/v1/internal/cloud_deploy_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/deploy/v1/cloud_deploy_connection_idempotency_policy.h b/google/cloud/deploy/v1/cloud_deploy_connection_idempotency_policy.h index 767b331dec13f..12c1a03b9de7d 100644 --- a/google/cloud/deploy/v1/cloud_deploy_connection_idempotency_policy.h +++ b/google/cloud/deploy/v1/cloud_deploy_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_V1_CLOUD_DEPLOY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_V1_CLOUD_DEPLOY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/deploy/v1/cloud_deploy.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_auth_decorator.cc b/google/cloud/deploy/v1/internal/cloud_deploy_auth_decorator.cc index 55a72a29d4493..c963dfa83f123 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_auth_decorator.cc +++ b/google/cloud/deploy/v1/internal/cloud_deploy_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/deploy/v1/cloud_deploy.proto #include "google/cloud/deploy/v1/internal/cloud_deploy_auth_decorator.h" -#include +#include "google/cloud/deploy/v1/cloud_deploy.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace deploy_v1_internal { @@ -873,3 +876,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace deploy_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_auth_decorator.h b/google/cloud/deploy/v1/internal/cloud_deploy_auth_decorator.h index 2ca503747a946..1e30006927d3d 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_auth_decorator.h +++ b/google/cloud/deploy/v1/internal/cloud_deploy_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/deploy/v1/internal/cloud_deploy_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 deploy_v1_internal { @@ -417,4 +420,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_V1_INTERNAL_CLOUD_DEPLOY_AUTH_DECORATOR_H diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_connection_impl.h b/google/cloud/deploy/v1/internal/cloud_deploy_connection_impl.h index 8756f82e492b6..f68b921055336 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_connection_impl.h +++ b/google/cloud/deploy/v1/internal/cloud_deploy_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_logging_decorator.cc b/google/cloud/deploy/v1/internal/cloud_deploy_logging_decorator.cc index d468ececdd34b..755dcdd76020d 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_logging_decorator.cc +++ b/google/cloud/deploy/v1/internal/cloud_deploy_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/deploy/v1/cloud_deploy.proto #include "google/cloud/deploy/v1/internal/cloud_deploy_logging_decorator.h" +#include "google/cloud/deploy/v1/cloud_deploy.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace deploy_v1_internal { @@ -1038,3 +1041,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace deploy_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_logging_decorator.h b/google/cloud/deploy/v1/internal/cloud_deploy_logging_decorator.h index e35a11c6eee43..723900d387336 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_logging_decorator.h +++ b/google/cloud/deploy/v1/internal/cloud_deploy_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/deploy/v1/internal/cloud_deploy_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 deploy_v1_internal { @@ -417,4 +420,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_V1_INTERNAL_CLOUD_DEPLOY_LOGGING_DECORATOR_H diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_metadata_decorator.cc b/google/cloud/deploy/v1/internal/cloud_deploy_metadata_decorator.cc index ad88e4eacf4a7..e956ad75d67a0 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_metadata_decorator.cc +++ b/google/cloud/deploy/v1/internal/cloud_deploy_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/deploy/v1/cloud_deploy.proto #include "google/cloud/deploy/v1/internal/cloud_deploy_metadata_decorator.h" +#include "google/cloud/deploy/v1/cloud_deploy.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 deploy_v1_internal { @@ -774,3 +778,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace deploy_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_metadata_decorator.h b/google/cloud/deploy/v1/internal/cloud_deploy_metadata_decorator.h index d940d90904680..8823af6255199 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_metadata_decorator.h +++ b/google/cloud/deploy/v1/internal/cloud_deploy_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/deploy/v1/internal/cloud_deploy_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 deploy_v1_internal { @@ -422,4 +425,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_V1_INTERNAL_CLOUD_DEPLOY_METADATA_DECORATOR_H diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_option_defaults.cc b/google/cloud/deploy/v1/internal/cloud_deploy_option_defaults.cc index 911b25bf97f49..6de3330fa37a4 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_option_defaults.cc +++ b/google/cloud/deploy/v1/internal/cloud_deploy_option_defaults.cc @@ -40,7 +40,7 @@ Options CloudDeployDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - deploy_v1::CloudDeployLimitedTimeRetryPolicy(std::chrono::minutes(30)) + deploy_v1::CloudDeployLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_stub.cc b/google/cloud/deploy/v1/internal/cloud_deploy_stub.cc index 0bb035dee2c1b..374939dbaa133 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_stub.cc +++ b/google/cloud/deploy/v1/internal/cloud_deploy_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/deploy/v1/cloud_deploy.proto #include "google/cloud/deploy/v1/internal/cloud_deploy_stub.h" +#include "google/cloud/deploy/v1/cloud_deploy.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace deploy_v1_internal { @@ -1028,3 +1031,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace deploy_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_stub.h b/google/cloud/deploy/v1/internal/cloud_deploy_stub.h index 4e84fdb382db5..ee3a7393c4393 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_stub.h +++ b/google/cloud/deploy/v1/internal/cloud_deploy_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_V1_INTERNAL_CLOUD_DEPLOY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_V1_INTERNAL_CLOUD_DEPLOY_STUB_H +#include "google/cloud/deploy/v1/cloud_deploy.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 -#include -#include -#include +#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 deploy_v1_internal { @@ -813,4 +816,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_V1_INTERNAL_CLOUD_DEPLOY_STUB_H diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_stub_factory.cc b/google/cloud/deploy/v1/internal/cloud_deploy_stub_factory.cc index fdeb8c2193a85..562fb91436fe8 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_stub_factory.cc +++ b/google/cloud/deploy/v1/internal/cloud_deploy_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/deploy/v1/cloud_deploy.proto #include "google/cloud/deploy/v1/internal/cloud_deploy_stub_factory.h" +#include "google/cloud/deploy/v1/cloud_deploy.grpc.pb.h" #include "google/cloud/deploy/v1/internal/cloud_deploy_auth_decorator.h" #include "google/cloud/deploy/v1/internal/cloud_deploy_logging_decorator.h" #include "google/cloud/deploy/v1/internal/cloud_deploy_metadata_decorator.h" #include "google/cloud/deploy/v1/internal/cloud_deploy_stub.h" #include "google/cloud/deploy/v1/internal/cloud_deploy_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 -#include -#include -#include +#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 deploy_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace deploy_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_stub_factory.h b/google/cloud/deploy/v1/internal/cloud_deploy_stub_factory.h index ea50c54f3cb94..b7efd6e8f202a 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_stub_factory.h +++ b/google/cloud/deploy/v1/internal/cloud_deploy_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace deploy_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_V1_INTERNAL_CLOUD_DEPLOY_STUB_FACTORY_H diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_tracing_connection.cc b/google/cloud/deploy/v1/internal/cloud_deploy_tracing_connection.cc index 657e2beaaedd4..9495348707e29 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_tracing_connection.cc +++ b/google/cloud/deploy/v1/internal/cloud_deploy_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace deploy_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudDeployTracingConnection::CloudDeployTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -887,16 +885,12 @@ Status CloudDeployTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudDeployTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_tracing_connection.h b/google/cloud/deploy/v1/internal/cloud_deploy_tracing_connection.h index 1910f08b2c1d8..f8ccd60608cf8 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_tracing_connection.h +++ b/google/cloud/deploy/v1/internal/cloud_deploy_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace deploy_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudDeployTracingConnection : public deploy_v1::CloudDeployConnection { public: ~CloudDeployTracingConnection() override = default; @@ -369,8 +367,6 @@ class CloudDeployTracingConnection : public deploy_v1::CloudDeployConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_tracing_stub.cc b/google/cloud/deploy/v1/internal/cloud_deploy_tracing_stub.cc index ee4128b749ed4..89c7a78a51f33 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_tracing_stub.cc +++ b/google/cloud/deploy/v1/internal/cloud_deploy_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace deploy_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudDeployTracingStub::CloudDeployTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -948,18 +949,14 @@ future CloudDeployTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudDeployTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace deploy_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/deploy/v1/internal/cloud_deploy_tracing_stub.h b/google/cloud/deploy/v1/internal/cloud_deploy_tracing_stub.h index 3e66bee10026d..5e3bd98360003 100644 --- a/google/cloud/deploy/v1/internal/cloud_deploy_tracing_stub.h +++ b/google/cloud/deploy/v1/internal/cloud_deploy_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace deploy_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudDeployTracingStub : public CloudDeployStub { public: ~CloudDeployTracingStub() override = default; @@ -412,8 +413,6 @@ class CloudDeployTracingStub : public CloudDeployStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -428,4 +427,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEPLOY_V1_INTERNAL_CLOUD_DEPLOY_TRACING_STUB_H diff --git a/google/cloud/developerconnect/BUILD.bazel b/google/cloud/developerconnect/BUILD.bazel index 22c1f45ea2f9a..1daf84dc05b87 100644 --- a/google/cloud/developerconnect/BUILD.bazel +++ b/google/cloud/developerconnect/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/developerconnect/v1:developerconnect_cc_grpc", + "@googleapis//google/cloud/developerconnect/v1:developerconnect_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/developerconnect/quickstart/.bazelrc b/google/cloud/developerconnect/quickstart/.bazelrc index 15d5c055db074..343e7f623d628 100644 --- a/google/cloud/developerconnect/quickstart/.bazelrc +++ b/google/cloud/developerconnect/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/developerconnect/quickstart/CMakeLists.txt index 81f6555382b97..1ecf6f64568b6 100644 --- a/google/cloud/developerconnect/quickstart/CMakeLists.txt +++ b/google/cloud/developerconnect/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Developer Connect API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-developerconnect-quickstart CXX) find_package(google_cloud_cpp_developerconnect REQUIRED) diff --git a/google/cloud/developerconnect/quickstart/WORKSPACE.bazel b/google/cloud/developerconnect/quickstart/WORKSPACE.bazel index 86a035f0ada99..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 = "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/developerconnect/v1/developer_connect_client.cc b/google/cloud/developerconnect/v1/developer_connect_client.cc index 1c8eb6da8f79f..17b87c8870705 100644 --- a/google/cloud/developerconnect/v1/developer_connect_client.cc +++ b/google/cloud/developerconnect/v1/developer_connect_client.cc @@ -740,6 +740,40 @@ DeveloperConnectClient::DeleteSelf( return connection_->DeleteSelf(operation); } +StatusOr +DeveloperConnectClient::StartOAuth(std::string const& account_connector, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::developerconnect::v1::StartOAuthRequest request; + request.set_account_connector(account_connector); + return connection_->StartOAuth(request); +} + +StatusOr +DeveloperConnectClient::StartOAuth( + google::cloud::developerconnect::v1::StartOAuthRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->StartOAuth(request); +} + +StatusOr +DeveloperConnectClient::FinishOAuth(std::string const& account_connector, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::developerconnect::v1::FinishOAuthRequest request; + request.set_account_connector(account_connector); + return connection_->FinishOAuth(request); +} + +StatusOr +DeveloperConnectClient::FinishOAuth( + google::cloud::developerconnect::v1::FinishOAuthRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->FinishOAuth(request); +} + StreamRange DeveloperConnectClient::ListLocations( google::cloud::location::ListLocationsRequest request, Options opts) { diff --git a/google/cloud/developerconnect/v1/developer_connect_client.h b/google/cloud/developerconnect/v1/developer_connect_client.h index e1f4adace6d44..52be6fb00d5d0 100644 --- a/google/cloud/developerconnect/v1/developer_connect_client.h +++ b/google/cloud/developerconnect/v1/developer_connect_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -116,8 +116,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L403} - /// [google.cloud.developerconnect.v1.ListConnectionsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L832} + /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L425} + /// [google.cloud.developerconnect.v1.ListConnectionsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L967} /// // clang-format on StreamRange ListConnections( @@ -155,8 +155,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L403} - /// [google.cloud.developerconnect.v1.ListConnectionsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L832} + /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L425} + /// [google.cloud.developerconnect.v1.ListConnectionsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L967} /// // clang-format on StreamRange ListConnections( @@ -181,8 +181,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L403} - /// [google.cloud.developerconnect.v1.GetConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L868} + /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L425} + /// [google.cloud.developerconnect.v1.GetConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1003} /// // clang-format on StatusOr GetConnection( @@ -211,8 +211,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L403} - /// [google.cloud.developerconnect.v1.GetConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L868} + /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L425} + /// [google.cloud.developerconnect.v1.GetConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1003} /// // clang-format on StatusOr GetConnection( @@ -248,8 +248,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L403} - /// [google.cloud.developerconnect.v1.CreateConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L879} + /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L425} + /// [google.cloud.developerconnect.v1.CreateConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1014} /// // clang-format on future> @@ -304,8 +304,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L403} - /// [google.cloud.developerconnect.v1.CreateConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L879} + /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L425} + /// [google.cloud.developerconnect.v1.CreateConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1014} /// // clang-format on future> @@ -374,8 +374,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L403} - /// [google.cloud.developerconnect.v1.UpdateConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L919} + /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L425} + /// [google.cloud.developerconnect.v1.UpdateConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1054} /// // clang-format on future> @@ -429,8 +429,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L403} - /// [google.cloud.developerconnect.v1.UpdateConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L919} + /// [google.cloud.developerconnect.v1.Connection]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L425} + /// [google.cloud.developerconnect.v1.UpdateConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1054} /// // clang-format on future> @@ -494,8 +494,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.DeleteConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L961} - /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1204} + /// [google.cloud.developerconnect.v1.DeleteConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1096} + /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1339} /// // clang-format on future> @@ -545,8 +545,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.DeleteConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L961} - /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1204} + /// [google.cloud.developerconnect.v1.DeleteConnectionRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1096} + /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1339} /// // clang-format on future> @@ -590,8 +590,9 @@ class DeveloperConnectClient { /// Creates a GitRepositoryLink. Upon linking a Git Repository, Developer /// Connect will configure the Git Repository to send webhook events to /// Developer Connect. Connections that use Firebase GitHub Application will - /// have events forwarded to the Firebase service. All other Connections will - /// have events forwarded to Cloud Build. + /// have events forwarded to the Firebase service. Connections that use Gemini + /// Code Assist will have events forwarded to Gemini Code Assist service. All + /// other Connections will have events forwarded to Cloud Build. /// /// @param parent Required. Value for parent. /// @param git_repository_link Required. The resource being created @@ -619,8 +620,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1353} - /// [google.cloud.developerconnect.v1.GitRepositoryLink]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1294} + /// [google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1578} + /// [google.cloud.developerconnect.v1.GitRepositoryLink]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1519} /// // clang-format on future> @@ -652,8 +653,9 @@ class DeveloperConnectClient { /// Creates a GitRepositoryLink. Upon linking a Git Repository, Developer /// Connect will configure the Git Repository to send webhook events to /// Developer Connect. Connections that use Firebase GitHub Application will - /// have events forwarded to the Firebase service. All other Connections will - /// have events forwarded to Cloud Build. + /// have events forwarded to the Firebase service. Connections that use Gemini + /// Code Assist will have events forwarded to Gemini Code Assist service. All + /// other Connections will have events forwarded to Cloud Build. /// /// @param request Unary RPCs, such as the one wrapped by this /// function, receive a single `request` proto message which includes all @@ -681,8 +683,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1353} - /// [google.cloud.developerconnect.v1.GitRepositoryLink]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1294} + /// [google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1578} + /// [google.cloud.developerconnect.v1.GitRepositoryLink]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1519} /// // clang-format on future> @@ -746,8 +748,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1395} - /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1204} + /// [google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1620} + /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1339} /// // clang-format on future> @@ -797,8 +799,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1395} - /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1204} + /// [google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1620} + /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1339} /// // clang-format on future> @@ -864,8 +866,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.GitRepositoryLink]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1294} - /// [google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1432} + /// [google.cloud.developerconnect.v1.GitRepositoryLink]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1519} + /// [google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1657} /// // clang-format on StreamRange @@ -903,8 +905,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.GitRepositoryLink]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1294} - /// [google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1432} + /// [google.cloud.developerconnect.v1.GitRepositoryLink]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1519} + /// [google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1657} /// // clang-format on StreamRange @@ -931,8 +933,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1468} - /// [google.cloud.developerconnect.v1.GitRepositoryLink]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1294} + /// [google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1693} + /// [google.cloud.developerconnect.v1.GitRepositoryLink]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1519} /// // clang-format on StatusOr @@ -961,8 +963,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1468} - /// [google.cloud.developerconnect.v1.GitRepositoryLink]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1294} + /// [google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1693} + /// [google.cloud.developerconnect.v1.GitRepositoryLink]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1519} /// // clang-format on StatusOr @@ -990,8 +992,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.FetchReadWriteTokenRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1479} - /// [google.cloud.developerconnect.v1.FetchReadWriteTokenResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1517} + /// [google.cloud.developerconnect.v1.FetchReadWriteTokenRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1704} + /// [google.cloud.developerconnect.v1.FetchReadWriteTokenResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1742} /// // clang-format on StatusOr @@ -1021,8 +1023,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.FetchReadWriteTokenRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1479} - /// [google.cloud.developerconnect.v1.FetchReadWriteTokenResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1517} + /// [google.cloud.developerconnect.v1.FetchReadWriteTokenRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1704} + /// [google.cloud.developerconnect.v1.FetchReadWriteTokenResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1742} /// // clang-format on StatusOr @@ -1050,8 +1052,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.FetchReadTokenRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1491} - /// [google.cloud.developerconnect.v1.FetchReadTokenResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1503} + /// [google.cloud.developerconnect.v1.FetchReadTokenRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1716} + /// [google.cloud.developerconnect.v1.FetchReadTokenResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1728} /// // clang-format on StatusOr @@ -1080,8 +1082,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.FetchReadTokenRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1491} - /// [google.cloud.developerconnect.v1.FetchReadTokenResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1503} + /// [google.cloud.developerconnect.v1.FetchReadTokenRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1716} + /// [google.cloud.developerconnect.v1.FetchReadTokenResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1728} /// // clang-format on StatusOr @@ -1118,8 +1120,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1531} - /// [google.cloud.developerconnect.v1.LinkableGitRepository]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1559} + /// [google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1756} + /// [google.cloud.developerconnect.v1.LinkableGitRepository]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1784} /// // clang-format on StreamRange @@ -1159,8 +1161,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1531} - /// [google.cloud.developerconnect.v1.LinkableGitRepository]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1559} + /// [google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1756} + /// [google.cloud.developerconnect.v1.LinkableGitRepository]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1784} /// // clang-format on StreamRange @@ -1191,8 +1193,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1565} - /// [google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1577} + /// [google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1790} + /// [google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1802} /// // clang-format on StatusOr< @@ -1225,8 +1227,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1565} - /// [google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1577} + /// [google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1790} + /// [google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1802} /// // clang-format on StatusOr< @@ -1262,7 +1264,7 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.FetchGitRefsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1596} + /// [google.cloud.developerconnect.v1.FetchGitRefsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1821} /// // clang-format on StreamRange FetchGitRefs( @@ -1301,7 +1303,7 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.FetchGitRefsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1596} + /// [google.cloud.developerconnect.v1.FetchGitRefsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1821} /// // clang-format on StreamRange FetchGitRefs( @@ -1335,8 +1337,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1641} - /// [google.cloud.developerconnect.v1.ListAccountConnectorsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L998} + /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1866} + /// [google.cloud.developerconnect.v1.ListAccountConnectorsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1133} /// // clang-format on StreamRange @@ -1374,8 +1376,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1641} - /// [google.cloud.developerconnect.v1.ListAccountConnectorsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L998} + /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1866} + /// [google.cloud.developerconnect.v1.ListAccountConnectorsRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1133} /// // clang-format on StreamRange @@ -1401,8 +1403,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1641} - /// [google.cloud.developerconnect.v1.GetAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1034} + /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1866} + /// [google.cloud.developerconnect.v1.GetAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1169} /// // clang-format on StatusOr @@ -1431,8 +1433,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1641} - /// [google.cloud.developerconnect.v1.GetAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1034} + /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1866} + /// [google.cloud.developerconnect.v1.GetAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1169} /// // clang-format on StatusOr @@ -1471,8 +1473,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1641} - /// [google.cloud.developerconnect.v1.CreateAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1044} + /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1866} + /// [google.cloud.developerconnect.v1.CreateAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1179} /// // clang-format on future> @@ -1529,8 +1531,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1641} - /// [google.cloud.developerconnect.v1.CreateAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1044} + /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1866} + /// [google.cloud.developerconnect.v1.CreateAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1179} /// // clang-format on future> @@ -1595,8 +1597,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1641} - /// [google.cloud.developerconnect.v1.UpdateAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1086} + /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1866} + /// [google.cloud.developerconnect.v1.UpdateAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1221} /// // clang-format on future> @@ -1652,8 +1654,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1641} - /// [google.cloud.developerconnect.v1.UpdateAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1086} + /// [google.cloud.developerconnect.v1.AccountConnector]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1866} + /// [google.cloud.developerconnect.v1.UpdateAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1221} /// // clang-format on future> @@ -1717,8 +1719,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.DeleteAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1124} - /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1204} + /// [google.cloud.developerconnect.v1.DeleteAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1259} + /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1339} /// // clang-format on future> @@ -1768,8 +1770,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.DeleteAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1124} - /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1204} + /// [google.cloud.developerconnect.v1.DeleteAccountConnectorRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1259} + /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1339} /// // clang-format on future> @@ -1827,8 +1829,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.FetchAccessTokenRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1257} - /// [google.cloud.developerconnect.v1.FetchAccessTokenResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1269} + /// [google.cloud.developerconnect.v1.FetchAccessTokenRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1392} + /// [google.cloud.developerconnect.v1.FetchAccessTokenResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1404} /// // clang-format on StatusOr @@ -1857,8 +1859,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.FetchAccessTokenRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1257} - /// [google.cloud.developerconnect.v1.FetchAccessTokenResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1269} + /// [google.cloud.developerconnect.v1.FetchAccessTokenRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1392} + /// [google.cloud.developerconnect.v1.FetchAccessTokenResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1404} /// // clang-format on StatusOr @@ -1894,8 +1896,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.ListUsersRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L367} - /// [google.cloud.developerconnect.v1.User]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1685} + /// [google.cloud.developerconnect.v1.ListUsersRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L389} + /// [google.cloud.developerconnect.v1.User]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1911} /// // clang-format on StreamRange ListUsers( @@ -1933,8 +1935,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.ListUsersRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L367} - /// [google.cloud.developerconnect.v1.User]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1685} + /// [google.cloud.developerconnect.v1.ListUsersRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L389} + /// [google.cloud.developerconnect.v1.User]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1911} /// // clang-format on StreamRange ListUsers( @@ -1966,8 +1968,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.DeleteUserRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1167} - /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1204} + /// [google.cloud.developerconnect.v1.DeleteUserRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1302} + /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1339} /// // clang-format on future> @@ -2018,8 +2020,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.DeleteUserRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1167} - /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1204} + /// [google.cloud.developerconnect.v1.DeleteUserRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1302} + /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1339} /// // clang-format on future> @@ -2074,8 +2076,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.FetchSelfRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1235} - /// [google.cloud.developerconnect.v1.User]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1685} + /// [google.cloud.developerconnect.v1.FetchSelfRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1370} + /// [google.cloud.developerconnect.v1.User]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1911} /// // clang-format on StatusOr FetchSelf( @@ -2104,8 +2106,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.FetchSelfRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1235} - /// [google.cloud.developerconnect.v1.User]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1685} + /// [google.cloud.developerconnect.v1.FetchSelfRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1370} + /// [google.cloud.developerconnect.v1.User]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1911} /// // clang-format on StatusOr FetchSelf( @@ -2137,8 +2139,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.DeleteSelfRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1246} - /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1204} + /// [google.cloud.developerconnect.v1.DeleteSelfRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1381} + /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1339} /// // clang-format on future> @@ -2189,8 +2191,8 @@ class DeveloperConnectClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.developerconnect.v1.DeleteSelfRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1246} - /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1204} + /// [google.cloud.developerconnect.v1.DeleteSelfRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1381} + /// [google.cloud.developerconnect.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1339} /// // clang-format on future> @@ -2227,6 +2229,121 @@ class DeveloperConnectClient { DeleteSelf(google::longrunning::Operation const& operation, Options opts = {}); + // clang-format off + /// + /// Starts OAuth flow for an account connector. + /// + /// @param account_connector Required. The resource name of the AccountConnector in the format + /// `projects/*/locations/*/accountConnectors/*`. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.developerconnect.v1.StartOAuthResponse]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.developerconnect.v1.StartOAuthRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1419} + /// [google.cloud.developerconnect.v1.StartOAuthResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1431} + /// + // clang-format on + StatusOr StartOAuth( + std::string const& account_connector, Options opts = {}); + + // clang-format off + /// + /// Starts OAuth flow for an account connector. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.developerconnect.v1.StartOAuthRequest]. + /// Proto messages are converted to 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.developerconnect.v1.StartOAuthResponse]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.developerconnect.v1.StartOAuthRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1419} + /// [google.cloud.developerconnect.v1.StartOAuthResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1431} + /// + // clang-format on + StatusOr StartOAuth( + google::cloud::developerconnect::v1::StartOAuthRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Finishes OAuth flow for an account connector. + /// + /// @param account_connector Required. The resource name of the AccountConnector in the format + /// `projects/*/locations/*/accountConnectors/*`. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.developerconnect.v1.FinishOAuthResponse]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.developerconnect.v1.FinishOAuthRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1459} + /// [google.cloud.developerconnect.v1.FinishOAuthResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1503} + /// + // clang-format on + StatusOr + FinishOAuth(std::string const& account_connector, Options opts = {}); + + // clang-format off + /// + /// Finishes OAuth flow for an account connector. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.developerconnect.v1.FinishOAuthRequest]. + /// Proto messages are converted to 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.developerconnect.v1.FinishOAuthResponse]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.developerconnect.v1.FinishOAuthRequest]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1459} + /// [google.cloud.developerconnect.v1.FinishOAuthResponse]: @googleapis_reference_link{google/cloud/developerconnect/v1/developer_connect.proto#L1503} + /// + // clang-format on + StatusOr + FinishOAuth( + google::cloud::developerconnect::v1::FinishOAuthRequest const& request, + Options opts = {}); + // clang-format off /// /// Lists information about the supported locations for this service. @@ -2517,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 = {}); @@ -2556,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/developerconnect/v1/developer_connect_connection.cc b/google/cloud/developerconnect/v1/developer_connect_connection.cc index c0080da0b2168..e415e395cfae3 100644 --- a/google/cloud/developerconnect/v1/developer_connect_connection.cc +++ b/google/cloud/developerconnect/v1/developer_connect_connection.cc @@ -370,6 +370,18 @@ DeveloperConnectConnection::DeleteSelf(google::longrunning::Operation const&) { Status(StatusCode::kUnimplemented, "not implemented")); } +StatusOr +DeveloperConnectConnection::StartOAuth( + google::cloud::developerconnect::v1::StartOAuthRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +DeveloperConnectConnection::FinishOAuth( + google::cloud::developerconnect::v1::FinishOAuthRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + StreamRange DeveloperConnectConnection::ListLocations( google::cloud::location:: diff --git a/google/cloud/developerconnect/v1/developer_connect_connection.h b/google/cloud/developerconnect/v1/developer_connect_connection.h index 8a991e3932d78..682e9a0e6ad2d 100644 --- a/google/cloud/developerconnect/v1/developer_connect_connection.h +++ b/google/cloud/developerconnect/v1/developer_connect_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVELOPERCONNECT_V1_DEVELOPER_CONNECT_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVELOPERCONNECT_V1_DEVELOPER_CONNECT_CONNECTION_H +#include "google/cloud/developerconnect/v1/developer_connect.pb.h" #include "google/cloud/developerconnect/v1/developer_connect_connection_idempotency_policy.h" #include "google/cloud/developerconnect/v1/internal/developer_connect_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -394,6 +394,14 @@ class DeveloperConnectConnection { StatusOr> DeleteSelf(google::longrunning::Operation const& operation); + virtual StatusOr + StartOAuth( + google::cloud::developerconnect::v1::StartOAuthRequest const& request); + + virtual StatusOr + FinishOAuth( + google::cloud::developerconnect::v1::FinishOAuthRequest const& request); + virtual StreamRange ListLocations( google::cloud::location::ListLocationsRequest request); diff --git a/google/cloud/developerconnect/v1/developer_connect_connection_idempotency_policy.cc b/google/cloud/developerconnect/v1/developer_connect_connection_idempotency_policy.cc index 44c6e0a70a00b..b4b804f687382 100644 --- a/google/cloud/developerconnect/v1/developer_connect_connection_idempotency_policy.cc +++ b/google/cloud/developerconnect/v1/developer_connect_connection_idempotency_policy.cc @@ -164,6 +164,16 @@ Idempotency DeveloperConnectConnectionIdempotencyPolicy::DeleteSelf( return Idempotency::kNonIdempotent; } +Idempotency DeveloperConnectConnectionIdempotencyPolicy::StartOAuth( + google::cloud::developerconnect::v1::StartOAuthRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DeveloperConnectConnectionIdempotencyPolicy::FinishOAuth( + google::cloud::developerconnect::v1::FinishOAuthRequest const&) { + return Idempotency::kIdempotent; +} + Idempotency DeveloperConnectConnectionIdempotencyPolicy::ListLocations( google::cloud::location::ListLocationsRequest) { // NOLINT return Idempotency::kIdempotent; diff --git a/google/cloud/developerconnect/v1/developer_connect_connection_idempotency_policy.h b/google/cloud/developerconnect/v1/developer_connect_connection_idempotency_policy.h index 1aa210279f95a..e04ebe7ed6044 100644 --- a/google/cloud/developerconnect/v1/developer_connect_connection_idempotency_policy.h +++ b/google/cloud/developerconnect/v1/developer_connect_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVELOPERCONNECT_V1_DEVELOPER_CONNECT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVELOPERCONNECT_V1_DEVELOPER_CONNECT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/developerconnect/v1/developer_connect.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -128,6 +128,12 @@ class DeveloperConnectConnectionIdempotencyPolicy { virtual google::cloud::Idempotency DeleteSelf( google::cloud::developerconnect::v1::DeleteSelfRequest const& request); + virtual google::cloud::Idempotency StartOAuth( + google::cloud::developerconnect::v1::StartOAuthRequest const& request); + + virtual google::cloud::Idempotency FinishOAuth( + google::cloud::developerconnect::v1::FinishOAuthRequest const& request); + virtual google::cloud::Idempotency ListLocations( google::cloud::location::ListLocationsRequest request); diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_auth_decorator.cc b/google/cloud/developerconnect/v1/internal/developer_connect_auth_decorator.cc index df61a374a48a6..c1077591240e8 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_auth_decorator.cc +++ b/google/cloud/developerconnect/v1/internal/developer_connect_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/developerconnect/v1/developer_connect.proto #include "google/cloud/developerconnect/v1/internal/developer_connect_auth_decorator.h" -#include +#include "google/cloud/developerconnect/v1/developer_connect.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace developerconnect_v1_internal { @@ -468,6 +471,24 @@ StatusOr DeveloperConnectAuth::DeleteSelf( return child_->DeleteSelf(context, options, request); } +StatusOr +DeveloperConnectAuth::StartOAuth( + grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::StartOAuthRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->StartOAuth(context, options, request); +} + +StatusOr +DeveloperConnectAuth::FinishOAuth( + grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::FinishOAuthRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->FinishOAuth(context, options, request); +} + StatusOr DeveloperConnectAuth::ListLocations( grpc::ClientContext& context, Options const& options, @@ -558,3 +579,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace developerconnect_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_auth_decorator.h b/google/cloud/developerconnect/v1/internal/developer_connect_auth_decorator.h index c0e6ab5c1a8c7..f5e5a2abbd13d 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_auth_decorator.h +++ b/google/cloud/developerconnect/v1/internal/developer_connect_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/developerconnect/v1/internal/developer_connect_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 developerconnect_v1_internal { @@ -241,6 +244,16 @@ class DeveloperConnectAuth : public DeveloperConnectStub { google::cloud::developerconnect::v1::DeleteSelfRequest const& request) override; + StatusOr StartOAuth( + grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::StartOAuthRequest const& request) + override; + + StatusOr + FinishOAuth(grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::FinishOAuthRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -287,4 +300,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVELOPERCONNECT_V1_INTERNAL_DEVELOPER_CONNECT_AUTH_DECORATOR_H diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_connection_impl.cc b/google/cloud/developerconnect/v1/internal/developer_connect_connection_impl.cc index ec75fcabdbebc..b77d5434d945b 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_connection_impl.cc +++ b/google/cloud/developerconnect/v1/internal/developer_connect_connection_impl.cc @@ -1367,6 +1367,36 @@ DeveloperConnectConnectionImpl::DeleteSelf( polling_policy(*current), __func__); } +StatusOr +DeveloperConnectConnectionImpl::StartOAuth( + google::cloud::developerconnect::v1::StartOAuthRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->StartOAuth(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::StartOAuthRequest const& + request) { + return stub_->StartOAuth(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +DeveloperConnectConnectionImpl::FinishOAuth( + google::cloud::developerconnect::v1::FinishOAuthRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->FinishOAuth(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::FinishOAuthRequest const& + request) { + return stub_->FinishOAuth(context, options, request); + }, + *current, request, __func__); +} + StreamRange DeveloperConnectConnectionImpl::ListLocations( google::cloud::location::ListLocationsRequest request) { diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_connection_impl.h b/google/cloud/developerconnect/v1/internal/developer_connect_connection_impl.h index 80d10ea4ff264..164d6e1f1ae68 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_connection_impl.h +++ b/google/cloud/developerconnect/v1/internal/developer_connect_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -250,6 +250,14 @@ class DeveloperConnectConnectionImpl future> DeleteSelf(google::longrunning::Operation const& operation) override; + StatusOr StartOAuth( + google::cloud::developerconnect::v1::StartOAuthRequest const& request) + override; + + StatusOr + FinishOAuth(google::cloud::developerconnect::v1::FinishOAuthRequest const& + request) override; + StreamRange ListLocations( google::cloud::location::ListLocationsRequest request) override; diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_logging_decorator.cc b/google/cloud/developerconnect/v1/internal/developer_connect_logging_decorator.cc index 39e7b17b9a6db..9d806470553ad 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_logging_decorator.cc +++ b/google/cloud/developerconnect/v1/internal/developer_connect_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/developerconnect/v1/developer_connect.proto #include "google/cloud/developerconnect/v1/internal/developer_connect_logging_decorator.h" +#include "google/cloud/developerconnect/v1/developer_connect.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace developerconnect_v1_internal { @@ -563,6 +566,32 @@ StatusOr DeveloperConnectLogging::DeleteSelf( context, options, request, __func__, tracing_options_); } +StatusOr +DeveloperConnectLogging::StartOAuth( + grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::StartOAuthRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::StartOAuthRequest const& + request) { + return child_->StartOAuth(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DeveloperConnectLogging::FinishOAuth( + grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::FinishOAuthRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::FinishOAuthRequest const& + request) { + return child_->FinishOAuth(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr DeveloperConnectLogging::ListLocations( grpc::ClientContext& context, Options const& options, @@ -671,3 +700,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace developerconnect_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_logging_decorator.h b/google/cloud/developerconnect/v1/internal/developer_connect_logging_decorator.h index 84e7cbaef9730..cf80bcf0c0857 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_logging_decorator.h +++ b/google/cloud/developerconnect/v1/internal/developer_connect_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/developerconnect/v1/internal/developer_connect_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 developerconnect_v1_internal { @@ -241,6 +244,16 @@ class DeveloperConnectLogging : public DeveloperConnectStub { google::cloud::developerconnect::v1::DeleteSelfRequest const& request) override; + StatusOr StartOAuth( + grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::StartOAuthRequest const& request) + override; + + StatusOr + FinishOAuth(grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::FinishOAuthRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -287,4 +300,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVELOPERCONNECT_V1_INTERNAL_DEVELOPER_CONNECT_LOGGING_DECORATOR_H diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_metadata_decorator.cc b/google/cloud/developerconnect/v1/internal/developer_connect_metadata_decorator.cc index 3acfe6524b33e..05e072627008e 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_metadata_decorator.cc +++ b/google/cloud/developerconnect/v1/internal/developer_connect_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/developerconnect/v1/developer_connect.proto #include "google/cloud/developerconnect/v1/internal/developer_connect_metadata_decorator.h" +#include "google/cloud/developerconnect/v1/developer_connect.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 developerconnect_v1_internal { @@ -416,6 +420,26 @@ StatusOr DeveloperConnectMetadata::DeleteSelf( return child_->DeleteSelf(context, options, request); } +StatusOr +DeveloperConnectMetadata::StartOAuth( + grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::StartOAuthRequest const& request) { + SetMetadata(context, options, + absl::StrCat("account_connector=", + internal::UrlEncode(request.account_connector()))); + return child_->StartOAuth(context, options, request); +} + +StatusOr +DeveloperConnectMetadata::FinishOAuth( + grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::FinishOAuthRequest const& request) { + SetMetadata(context, options, + absl::StrCat("account_connector=", + internal::UrlEncode(request.account_connector()))); + return child_->FinishOAuth(context, options, request); +} + StatusOr DeveloperConnectMetadata::ListLocations( grpc::ClientContext& context, Options const& options, @@ -507,3 +531,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace developerconnect_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_metadata_decorator.h b/google/cloud/developerconnect/v1/internal/developer_connect_metadata_decorator.h index c95f807c30ab7..95505227a0c5f 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_metadata_decorator.h +++ b/google/cloud/developerconnect/v1/internal/developer_connect_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/developerconnect/v1/internal/developer_connect_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 developerconnect_v1_internal { @@ -242,6 +245,16 @@ class DeveloperConnectMetadata : public DeveloperConnectStub { google::cloud::developerconnect::v1::DeleteSelfRequest const& request) override; + StatusOr StartOAuth( + grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::StartOAuthRequest const& request) + override; + + StatusOr + FinishOAuth(grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::FinishOAuthRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -293,4 +306,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVELOPERCONNECT_V1_INTERNAL_DEVELOPER_CONNECT_METADATA_DECORATOR_H diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_option_defaults.cc b/google/cloud/developerconnect/v1/internal/developer_connect_option_defaults.cc index ece038a3a3a68..85d768e9b4ca1 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_option_defaults.cc +++ b/google/cloud/developerconnect/v1/internal/developer_connect_option_defaults.cc @@ -42,7 +42,7 @@ Options DeveloperConnectDefaultOptions(Options options) { if (!options.has()) { options.set( developerconnect_v1::DeveloperConnectLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_stub.cc b/google/cloud/developerconnect/v1/internal/developer_connect_stub.cc index 5431f4285cee5..cbaebfd0db6c6 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_stub.cc +++ b/google/cloud/developerconnect/v1/internal/developer_connect_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/developerconnect/v1/developer_connect.proto #include "google/cloud/developerconnect/v1/internal/developer_connect_stub.h" +#include "google/cloud/developerconnect/v1/developer_connect.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace developerconnect_v1_internal { @@ -545,6 +548,30 @@ DefaultDeveloperConnectStub::DeleteSelf( return response; } +StatusOr +DefaultDeveloperConnectStub::StartOAuth( + grpc::ClientContext& context, Options const&, + google::cloud::developerconnect::v1::StartOAuthRequest const& request) { + google::cloud::developerconnect::v1::StartOAuthResponse response; + auto status = grpc_stub_->StartOAuth(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDeveloperConnectStub::FinishOAuth( + grpc::ClientContext& context, Options const&, + google::cloud::developerconnect::v1::FinishOAuthRequest const& request) { + google::cloud::developerconnect::v1::FinishOAuthResponse response; + auto status = grpc_stub_->FinishOAuth(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultDeveloperConnectStub::ListLocations( grpc::ClientContext& context, Options const&, @@ -658,3 +685,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace developerconnect_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_stub.h b/google/cloud/developerconnect/v1/internal/developer_connect_stub.h index b6acc6d64b31c..69792a9662cac 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_stub.h +++ b/google/cloud/developerconnect/v1/internal/developer_connect_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVELOPERCONNECT_V1_INTERNAL_DEVELOPER_CONNECT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVELOPERCONNECT_V1_INTERNAL_DEVELOPER_CONNECT_STUB_H +#include "google/cloud/developerconnect/v1/developer_connect.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace developerconnect_v1_internal { @@ -252,6 +255,16 @@ class DeveloperConnectStub { google::cloud::developerconnect::v1::DeleteSelfRequest const& request) = 0; + virtual StatusOr + StartOAuth(grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::StartOAuthRequest const& + request) = 0; + + virtual StatusOr + FinishOAuth(grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::FinishOAuthRequest const& + request) = 0; + virtual StatusOr ListLocations( grpc::ClientContext& context, Options const& options, @@ -506,6 +519,16 @@ class DefaultDeveloperConnectStub : public DeveloperConnectStub { google::cloud::developerconnect::v1::DeleteSelfRequest const& request) override; + StatusOr StartOAuth( + grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::StartOAuthRequest const& request) + override; + + StatusOr + FinishOAuth(grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::FinishOAuthRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -557,4 +580,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVELOPERCONNECT_V1_INTERNAL_DEVELOPER_CONNECT_STUB_H diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_stub_factory.cc b/google/cloud/developerconnect/v1/internal/developer_connect_stub_factory.cc index 76533bf4e8237..385e7e96b1fb1 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_stub_factory.cc +++ b/google/cloud/developerconnect/v1/internal/developer_connect_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/developerconnect/v1/developer_connect.proto #include "google/cloud/developerconnect/v1/internal/developer_connect_stub_factory.h" +#include "google/cloud/developerconnect/v1/developer_connect.grpc.pb.h" #include "google/cloud/developerconnect/v1/internal/developer_connect_auth_decorator.h" #include "google/cloud/developerconnect/v1/internal/developer_connect_logging_decorator.h" #include "google/cloud/developerconnect/v1/internal/developer_connect_metadata_decorator.h" #include "google/cloud/developerconnect/v1/internal/developer_connect_stub.h" #include "google/cloud/developerconnect/v1/internal/developer_connect_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace developerconnect_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace developerconnect_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_stub_factory.h b/google/cloud/developerconnect/v1/internal/developer_connect_stub_factory.h index 6b3d99da5005d..1732c56984aa4 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_stub_factory.h +++ b/google/cloud/developerconnect/v1/internal/developer_connect_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace developerconnect_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVELOPERCONNECT_V1_INTERNAL_DEVELOPER_CONNECT_STUB_FACTORY_H diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_tracing_connection.cc b/google/cloud/developerconnect/v1/internal/developer_connect_tracing_connection.cc index e3559c494d770..5fd28add6d869 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_tracing_connection.cc +++ b/google/cloud/developerconnect/v1/internal/developer_connect_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace developerconnect_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DeveloperConnectTracingConnection::DeveloperConnectTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -517,6 +515,24 @@ DeveloperConnectTracingConnection::DeleteSelf( return internal::EndSpan(std::move(span), child_->DeleteSelf(operation)); } +StatusOr +DeveloperConnectTracingConnection::StartOAuth( + google::cloud::developerconnect::v1::StartOAuthRequest const& request) { + auto span = internal::MakeSpan( + "developerconnect_v1::DeveloperConnectConnection::StartOAuth"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->StartOAuth(request)); +} + +StatusOr +DeveloperConnectTracingConnection::FinishOAuth( + google::cloud::developerconnect::v1::FinishOAuthRequest const& request) { + auto span = internal::MakeSpan( + "developerconnect_v1::DeveloperConnectConnection::FinishOAuth"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->FinishOAuth(request)); +} + StreamRange DeveloperConnectTracingConnection::ListLocations( google::cloud::location::ListLocationsRequest request) { @@ -573,16 +589,12 @@ Status DeveloperConnectTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDeveloperConnectTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_tracing_connection.h b/google/cloud/developerconnect/v1/internal/developer_connect_tracing_connection.h index 58ee29cb2a0d7..fc4383caaa23f 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_tracing_connection.h +++ b/google/cloud/developerconnect/v1/internal/developer_connect_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace developerconnect_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DeveloperConnectTracingConnection : public developerconnect_v1::DeveloperConnectConnection { public: @@ -238,6 +236,14 @@ class DeveloperConnectTracingConnection future> DeleteSelf(google::longrunning::Operation const& operation) override; + StatusOr StartOAuth( + google::cloud::developerconnect::v1::StartOAuthRequest const& request) + override; + + StatusOr + FinishOAuth(google::cloud::developerconnect::v1::FinishOAuthRequest const& + request) override; + StreamRange ListLocations( google::cloud::location::ListLocationsRequest request) override; @@ -260,8 +266,6 @@ class DeveloperConnectTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_tracing_stub.cc b/google/cloud/developerconnect/v1/internal/developer_connect_tracing_stub.cc index c12b8e93613f1..c33aaf1bfa6f9 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_tracing_stub.cc +++ b/google/cloud/developerconnect/v1/internal/developer_connect_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace developerconnect_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DeveloperConnectTracingStub::DeveloperConnectTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -519,6 +520,30 @@ DeveloperConnectTracingStub::DeleteSelf( child_->DeleteSelf(context, options, request)); } +StatusOr +DeveloperConnectTracingStub::StartOAuth( + grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::StartOAuthRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.developerconnect.v1.DeveloperConnect", "StartOAuth"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->StartOAuth(context, options, request)); +} + +StatusOr +DeveloperConnectTracingStub::FinishOAuth( + grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::FinishOAuthRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.developerconnect.v1.DeveloperConnect", "FinishOAuth"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->FinishOAuth(context, options, request)); +} + StatusOr DeveloperConnectTracingStub::ListLocations( grpc::ClientContext& context, Options const& options, @@ -617,18 +642,14 @@ future DeveloperConnectTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDeveloperConnectTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace developerconnect_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/developerconnect/v1/internal/developer_connect_tracing_stub.h b/google/cloud/developerconnect/v1/internal/developer_connect_tracing_stub.h index c62c8f2e02b20..43cc0a22d6299 100644 --- a/google/cloud/developerconnect/v1/internal/developer_connect_tracing_stub.h +++ b/google/cloud/developerconnect/v1/internal/developer_connect_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace developerconnect_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DeveloperConnectTracingStub : public DeveloperConnectStub { public: ~DeveloperConnectTracingStub() override = default; @@ -241,6 +242,16 @@ class DeveloperConnectTracingStub : public DeveloperConnectStub { google::cloud::developerconnect::v1::DeleteSelfRequest const& request) override; + StatusOr StartOAuth( + grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::StartOAuthRequest const& request) + override; + + StatusOr + FinishOAuth(grpc::ClientContext& context, Options const& options, + google::cloud::developerconnect::v1::FinishOAuthRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -283,8 +294,6 @@ class DeveloperConnectTracingStub : public DeveloperConnectStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -299,4 +308,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVELOPERCONNECT_V1_INTERNAL_DEVELOPER_CONNECT_TRACING_STUB_H diff --git a/google/cloud/developerconnect/v1/mocks/mock_developer_connect_connection.h b/google/cloud/developerconnect/v1/mocks/mock_developer_connect_connection.h index eb0003c599849..b13761ef5ab8a 100644 --- a/google/cloud/developerconnect/v1/mocks/mock_developer_connect_connection.h +++ b/google/cloud/developerconnect/v1/mocks/mock_developer_connect_connection.h @@ -550,6 +550,18 @@ class MockDeveloperConnectConnection DeleteSelf, (google::longrunning::Operation const& operation), (override)); + MOCK_METHOD( + StatusOr, + StartOAuth, + (google::cloud::developerconnect::v1::StartOAuthRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, + FinishOAuth, + (google::cloud::developerconnect::v1::FinishOAuthRequest const& request), + (override)); + MOCK_METHOD((StreamRange), ListLocations, (google::cloud::location::ListLocationsRequest request), (override)); diff --git a/google/cloud/devicestreaming/BUILD.bazel b/google/cloud/devicestreaming/BUILD.bazel index 78dc8d385fc9a..b5631c2d8f900 100644 --- a/google/cloud/devicestreaming/BUILD.bazel +++ b/google/cloud/devicestreaming/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/devicestreaming/v1:devicestreaming_cc_grpc", + "@googleapis//google/cloud/devicestreaming/v1:devicestreaming_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/devicestreaming/quickstart/CMakeLists.txt b/google/cloud/devicestreaming/quickstart/CMakeLists.txt index 0283ff05a9068..f40c1e4a7ef0d 100644 --- a/google/cloud/devicestreaming/quickstart/CMakeLists.txt +++ b/google/cloud/devicestreaming/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Device Streaming API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-devicestreaming-quickstart CXX) find_package(google_cloud_cpp_devicestreaming REQUIRED) diff --git a/google/cloud/devicestreaming/quickstart/WORKSPACE.bazel b/google/cloud/devicestreaming/quickstart/WORKSPACE.bazel index f7657e35ad130..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 = "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/devicestreaming/v1/direct_access_connection.h b/google/cloud/devicestreaming/v1/direct_access_connection.h index 2ceb1056e83ee..1fe7995f416e7 100644 --- a/google/cloud/devicestreaming/v1/direct_access_connection.h +++ b/google/cloud/devicestreaming/v1/direct_access_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/devicestreaming/v1/direct_access_connection_idempotency_policy.h" #include "google/cloud/devicestreaming/v1/internal/direct_access_retry_traits.h" +#include "google/cloud/devicestreaming/v1/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" @@ -28,7 +29,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/devicestreaming/v1/direct_access_connection_idempotency_policy.h b/google/cloud/devicestreaming/v1/direct_access_connection_idempotency_policy.h index 89bb2ddd6c7a1..c9d65f2d3ffcb 100644 --- a/google/cloud/devicestreaming/v1/direct_access_connection_idempotency_policy.h +++ b/google/cloud/devicestreaming/v1/direct_access_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVICESTREAMING_V1_DIRECT_ACCESS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVICESTREAMING_V1_DIRECT_ACCESS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/devicestreaming/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_auth_decorator.cc b/google/cloud/devicestreaming/v1/internal/direct_access_auth_decorator.cc index 6c36051cd92b5..00f4e353f6bd4 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_auth_decorator.cc +++ b/google/cloud/devicestreaming/v1/internal/direct_access_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/devicestreaming/v1/service.proto #include "google/cloud/devicestreaming/v1/internal/direct_access_auth_decorator.h" +#include "google/cloud/devicestreaming/v1/service.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace devicestreaming_v1_internal { @@ -104,3 +107,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace devicestreaming_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_auth_decorator.h b/google/cloud/devicestreaming/v1/internal/direct_access_auth_decorator.h index 9ac7a703825d8..7dfa9ef4ead2f 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_auth_decorator.h +++ b/google/cloud/devicestreaming/v1/internal/direct_access_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace devicestreaming_v1_internal { @@ -83,4 +86,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVICESTREAMING_V1_INTERNAL_DIRECT_ACCESS_AUTH_DECORATOR_H diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_logging_decorator.cc b/google/cloud/devicestreaming/v1/internal/direct_access_logging_decorator.cc index 650f0d055bf5d..b79a7867bb3f2 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_logging_decorator.cc +++ b/google/cloud/devicestreaming/v1/internal/direct_access_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/devicestreaming/v1/service.proto #include "google/cloud/devicestreaming/v1/internal/direct_access_logging_decorator.h" +#include "google/cloud/devicestreaming/v1/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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace devicestreaming_v1_internal { @@ -138,3 +141,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace devicestreaming_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_logging_decorator.h b/google/cloud/devicestreaming/v1/internal/direct_access_logging_decorator.h index e66c5655b3fba..904bb02150f2e 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_logging_decorator.h +++ b/google/cloud/devicestreaming/v1/internal/direct_access_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace devicestreaming_v1_internal { @@ -84,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVICESTREAMING_V1_INTERNAL_DIRECT_ACCESS_LOGGING_DECORATOR_H diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_metadata_decorator.cc b/google/cloud/devicestreaming/v1/internal/direct_access_metadata_decorator.cc index 72dfb9f07e801..e06ddd2e8e9fa 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_metadata_decorator.cc +++ b/google/cloud/devicestreaming/v1/internal/direct_access_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/devicestreaming/v1/service.proto #include "google/cloud/devicestreaming/v1/internal/direct_access_metadata_decorator.h" +#include "google/cloud/devicestreaming/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 devicestreaming_v1_internal { @@ -123,3 +127,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace devicestreaming_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_metadata_decorator.h b/google/cloud/devicestreaming/v1/internal/direct_access_metadata_decorator.h index 7ea1efea526bf..6b0f899abf9ac 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_metadata_decorator.h +++ b/google/cloud/devicestreaming/v1/internal/direct_access_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace devicestreaming_v1_internal { @@ -89,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVICESTREAMING_V1_INTERNAL_DIRECT_ACCESS_METADATA_DECORATOR_H diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_option_defaults.cc b/google/cloud/devicestreaming/v1/internal/direct_access_option_defaults.cc index 49924d813f8ac..85002122d2867 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_option_defaults.cc +++ b/google/cloud/devicestreaming/v1/internal/direct_access_option_defaults.cc @@ -43,7 +43,7 @@ Options DirectAccessServiceDefaultOptions(Options options) { .has()) { options.set( devicestreaming_v1::DirectAccessServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_stub.cc b/google/cloud/devicestreaming/v1/internal/direct_access_stub.cc index 1d69c186e8ef5..b9639618b30ef 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_stub.cc +++ b/google/cloud/devicestreaming/v1/internal/direct_access_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/devicestreaming/v1/service.proto #include "google/cloud/devicestreaming/v1/internal/direct_access_stub.h" +#include "google/cloud/devicestreaming/v1/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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace devicestreaming_v1_internal { @@ -115,3 +118,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace devicestreaming_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_stub.h b/google/cloud/devicestreaming/v1/internal/direct_access_stub.h index b28276d2e73e0..11d5c94ba6f8a 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_stub.h +++ b/google/cloud/devicestreaming/v1/internal/direct_access_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVICESTREAMING_V1_INTERNAL_DIRECT_ACCESS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVICESTREAMING_V1_INTERNAL_DIRECT_ACCESS_STUB_H +#include "google/cloud/devicestreaming/v1/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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace devicestreaming_v1_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVICESTREAMING_V1_INTERNAL_DIRECT_ACCESS_STUB_H diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_stub_factory.cc b/google/cloud/devicestreaming/v1/internal/direct_access_stub_factory.cc index c74f8c2a02aa4..fb43b7a6b7876 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_stub_factory.cc +++ b/google/cloud/devicestreaming/v1/internal/direct_access_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/devicestreaming/v1/internal/direct_access_metadata_decorator.h" #include "google/cloud/devicestreaming/v1/internal/direct_access_stub.h" #include "google/cloud/devicestreaming/v1/internal/direct_access_tracing_stub.h" +#include "google/cloud/devicestreaming/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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace devicestreaming_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace devicestreaming_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_stub_factory.h b/google/cloud/devicestreaming/v1/internal/direct_access_stub_factory.h index af7013a448e35..0f7d248463ce2 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_stub_factory.h +++ b/google/cloud/devicestreaming/v1/internal/direct_access_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace devicestreaming_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVICESTREAMING_V1_INTERNAL_DIRECT_ACCESS_STUB_FACTORY_H diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_tracing_connection.cc b/google/cloud/devicestreaming/v1/internal/direct_access_tracing_connection.cc index 710cdd2c40a0a..1f5d8b9631ecc 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_tracing_connection.cc +++ b/google/cloud/devicestreaming/v1/internal/direct_access_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace devicestreaming_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DirectAccessServiceTracingConnection::DirectAccessServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -91,17 +89,13 @@ DirectAccessServiceTracingConnection::AsyncAdbConnect() { return child_->AsyncAdbConnect(); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDirectAccessServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_tracing_connection.h b/google/cloud/devicestreaming/v1/internal/direct_access_tracing_connection.h index bb4ed007044fc..034cffd194abb 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_tracing_connection.h +++ b/google/cloud/devicestreaming/v1/internal/direct_access_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace devicestreaming_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DirectAccessServiceTracingConnection : public devicestreaming_v1::DirectAccessServiceConnection { public: @@ -72,8 +70,6 @@ class DirectAccessServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_tracing_stub.cc b/google/cloud/devicestreaming/v1/internal/direct_access_tracing_stub.cc index a36f9db21ac87..49097bbf64a15 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_tracing_stub.cc +++ b/google/cloud/devicestreaming/v1/internal/direct_access_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace devicestreaming_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DirectAccessServiceTracingStub::DirectAccessServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -119,18 +120,14 @@ DirectAccessServiceTracingStub::AsyncAdbConnect( std::move(context), std::move(stream), std::move(span)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDirectAccessServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace devicestreaming_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/devicestreaming/v1/internal/direct_access_tracing_stub.h b/google/cloud/devicestreaming/v1/internal/direct_access_tracing_stub.h index debd060c9bcc9..a239851cca408 100644 --- a/google/cloud/devicestreaming/v1/internal/direct_access_tracing_stub.h +++ b/google/cloud/devicestreaming/v1/internal/direct_access_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace devicestreaming_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DirectAccessServiceTracingStub : public DirectAccessServiceStub { public: ~DirectAccessServiceTracingStub() override = default; @@ -80,8 +81,6 @@ class DirectAccessServiceTracingStub : public DirectAccessServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -96,4 +95,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DEVICESTREAMING_V1_INTERNAL_DIRECT_ACCESS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/BUILD.bazel b/google/cloud/dialogflow_cx/BUILD.bazel index 4c8a6bba0c1d8..abde82fd7e771 100644 --- a/google/cloud/dialogflow_cx/BUILD.bazel +++ b/google/cloud/dialogflow_cx/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = [""] googleapis_deps = [ - "@com_google_googleapis//google/cloud/dialogflow/cx/v3:cx_cc_grpc", + "@googleapis//google/cloud/dialogflow/cx/v3:cx_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/dialogflow_cx/agents_client.h b/google/cloud/dialogflow_cx/agents_client.h index e0b3766d29671..9a596a7b87bb9 100644 --- a/google/cloud/dialogflow_cx/agents_client.h +++ b/google/cloud/dialogflow_cx/agents_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/agents_connection.h b/google/cloud/dialogflow_cx/agents_connection.h index 12e30dd0b7552..73ef8e09877aa 100644 --- a/google/cloud/dialogflow_cx/agents_connection.h +++ b/google/cloud/dialogflow_cx/agents_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_AGENTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_AGENTS_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/agent.pb.h" #include "google/cloud/dialogflow_cx/agents_connection_idempotency_policy.h" #include "google/cloud/dialogflow_cx/internal/agents_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,9 +31,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/protobuf/struct.pb.h" #include #include diff --git a/google/cloud/dialogflow_cx/agents_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/agents_connection_idempotency_policy.h index e1f6482cd48e9..1217d966c722c 100644 --- a/google/cloud/dialogflow_cx/agents_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/agents_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_AGENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_AGENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/agent.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/changelogs_connection.h b/google/cloud/dialogflow_cx/changelogs_connection.h index a72380a2e8c29..6578355f68cae 100644 --- a/google/cloud/dialogflow_cx/changelogs_connection.h +++ b/google/cloud/dialogflow_cx/changelogs_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_CHANGELOGS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_CHANGELOGS_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/changelog.pb.h" #include "google/cloud/dialogflow_cx/changelogs_connection_idempotency_policy.h" #include "google/cloud/dialogflow_cx/internal/changelogs_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_cx/changelogs_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/changelogs_connection_idempotency_policy.h index 426681eb00136..b7342c66ef9be 100644 --- a/google/cloud/dialogflow_cx/changelogs_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/changelogs_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_CHANGELOGS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_CHANGELOGS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/changelog.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/deployments_connection.h b/google/cloud/dialogflow_cx/deployments_connection.h index 04eb0b90a8285..3fbc9c288e0cb 100644 --- a/google/cloud/dialogflow_cx/deployments_connection.h +++ b/google/cloud/dialogflow_cx/deployments_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_DEPLOYMENTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_DEPLOYMENTS_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/deployment.pb.h" #include "google/cloud/dialogflow_cx/deployments_connection_idempotency_policy.h" #include "google/cloud/dialogflow_cx/internal/deployments_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_cx/deployments_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/deployments_connection_idempotency_policy.h index 65b7bdd9debde..99a921449c806 100644 --- a/google/cloud/dialogflow_cx/deployments_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/deployments_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_DEPLOYMENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_DEPLOYMENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/deployment.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/entity_types_client.h b/google/cloud/dialogflow_cx/entity_types_client.h index e3afcc032058f..35f20b997cf22 100644 --- a/google/cloud/dialogflow_cx/entity_types_client.h +++ b/google/cloud/dialogflow_cx/entity_types_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/entity_types_connection.h b/google/cloud/dialogflow_cx/entity_types_connection.h index 0d6785404a4f4..e177b21ebfa3e 100644 --- a/google/cloud/dialogflow_cx/entity_types_connection.h +++ b/google/cloud/dialogflow_cx/entity_types_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_ENTITY_TYPES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_ENTITY_TYPES_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/entity_type.pb.h" #include "google/cloud/dialogflow_cx/entity_types_connection_idempotency_policy.h" #include "google/cloud/dialogflow_cx/internal/entity_types_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/dialogflow_cx/entity_types_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/entity_types_connection_idempotency_policy.h index b074f11f7c526..4e9721a225fe4 100644 --- a/google/cloud/dialogflow_cx/entity_types_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/entity_types_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_ENTITY_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_ENTITY_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/entity_type.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/environments_client.h b/google/cloud/dialogflow_cx/environments_client.h index 2393e156adc00..fc55c00496651 100644 --- a/google/cloud/dialogflow_cx/environments_client.h +++ b/google/cloud/dialogflow_cx/environments_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/environments_connection.h b/google/cloud/dialogflow_cx/environments_connection.h index ac43a6c2e18cd..4aac8739a817f 100644 --- a/google/cloud/dialogflow_cx/environments_connection.h +++ b/google/cloud/dialogflow_cx/environments_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_ENVIRONMENTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_ENVIRONMENTS_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/environment.pb.h" #include "google/cloud/dialogflow_cx/environments_connection_idempotency_policy.h" #include "google/cloud/dialogflow_cx/internal/environments_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,9 +31,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/protobuf/struct.pb.h" #include #include diff --git a/google/cloud/dialogflow_cx/environments_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/environments_connection_idempotency_policy.h index 384e08ace0f51..a96e15cd28087 100644 --- a/google/cloud/dialogflow_cx/environments_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/environments_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_ENVIRONMENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_ENVIRONMENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/environment.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/experiments_connection.h b/google/cloud/dialogflow_cx/experiments_connection.h index ec98ef7b63f98..c8a39caf0dac6 100644 --- a/google/cloud/dialogflow_cx/experiments_connection.h +++ b/google/cloud/dialogflow_cx/experiments_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_EXPERIMENTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_EXPERIMENTS_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/experiment.pb.h" #include "google/cloud/dialogflow_cx/experiments_connection_idempotency_policy.h" #include "google/cloud/dialogflow_cx/internal/experiments_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_cx/experiments_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/experiments_connection_idempotency_policy.h index 8e8178baa1bbb..d7ed25935a220 100644 --- a/google/cloud/dialogflow_cx/experiments_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/experiments_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_EXPERIMENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_EXPERIMENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/experiment.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/flows_client.h b/google/cloud/dialogflow_cx/flows_client.h index 4199f31ca29dd..2d22e1e8d6ff3 100644 --- a/google/cloud/dialogflow_cx/flows_client.h +++ b/google/cloud/dialogflow_cx/flows_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/flows_connection.h b/google/cloud/dialogflow_cx/flows_connection.h index 88872e88dd4d7..a7349b3fc44ab 100644 --- a/google/cloud/dialogflow_cx/flows_connection.h +++ b/google/cloud/dialogflow_cx/flows_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_FLOWS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_FLOWS_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/flow.pb.h" #include "google/cloud/dialogflow_cx/flows_connection_idempotency_policy.h" #include "google/cloud/dialogflow_cx/internal/flows_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,9 +31,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/protobuf/struct.pb.h" #include #include diff --git a/google/cloud/dialogflow_cx/flows_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/flows_connection_idempotency_policy.h index 7528205402957..c05cc32c5e84e 100644 --- a/google/cloud/dialogflow_cx/flows_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/flows_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_FLOWS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_FLOWS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/flow.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/generators_connection.h b/google/cloud/dialogflow_cx/generators_connection.h index 9af589083b776..cf6f4f38310c5 100644 --- a/google/cloud/dialogflow_cx/generators_connection.h +++ b/google/cloud/dialogflow_cx/generators_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_GENERATORS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_GENERATORS_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/generator.pb.h" #include "google/cloud/dialogflow_cx/generators_connection_idempotency_policy.h" #include "google/cloud/dialogflow_cx/internal/generators_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_cx/generators_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/generators_connection_idempotency_policy.h index 86b5206882115..028a57d9eb7ac 100644 --- a/google/cloud/dialogflow_cx/generators_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/generators_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_GENERATORS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_GENERATORS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/generator.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/intents_client.h b/google/cloud/dialogflow_cx/intents_client.h index b13b17d616110..a9475c6af854d 100644 --- a/google/cloud/dialogflow_cx/intents_client.h +++ b/google/cloud/dialogflow_cx/intents_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/intents_connection.h b/google/cloud/dialogflow_cx/intents_connection.h index 8aad39120d489..0ecf95ce8b763 100644 --- a/google/cloud/dialogflow_cx/intents_connection.h +++ b/google/cloud/dialogflow_cx/intents_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTENTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTENTS_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/intent.pb.h" #include "google/cloud/dialogflow_cx/intents_connection_idempotency_policy.h" #include "google/cloud/dialogflow_cx/internal/intents_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/dialogflow_cx/intents_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/intents_connection_idempotency_policy.h index 415a6dac52a97..83bbb3176878b 100644 --- a/google/cloud/dialogflow_cx/intents_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/intents_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/intent.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/internal/agents_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/agents_auth_decorator.cc index dadf71aeb7af7..04de740947308 100644 --- a/google/cloud/dialogflow_cx/internal/agents_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/agents_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/agent.proto #include "google/cloud/dialogflow_cx/internal/agents_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/agent.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -246,3 +249,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/agents_auth_decorator.h b/google/cloud/dialogflow_cx/internal/agents_auth_decorator.h index 486fb77262c33..751141db40d98 100644 --- a/google/cloud/dialogflow_cx/internal/agents_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/agents_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/agents_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -153,4 +156,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_AGENTS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/agents_connection_impl.h b/google/cloud/dialogflow_cx/internal/agents_connection_impl.h index d6eeb119fb407..a8a6d5acc3bf7 100644 --- a/google/cloud/dialogflow_cx/internal/agents_connection_impl.h +++ b/google/cloud/dialogflow_cx/internal/agents_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/internal/agents_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/agents_logging_decorator.cc index e0803efbe9d21..7e19ca39a6832 100644 --- a/google/cloud/dialogflow_cx/internal/agents_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/agents_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/agent.proto #include "google/cloud/dialogflow_cx/internal/agents_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/agent.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -310,3 +313,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/agents_logging_decorator.h b/google/cloud/dialogflow_cx/internal/agents_logging_decorator.h index fa06b8deb7f36..b83d2e01c36e3 100644 --- a/google/cloud/dialogflow_cx/internal/agents_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/agents_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/agents_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -153,4 +156,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_AGENTS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/agents_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/agents_metadata_decorator.cc index 29b158a00a099..bf7120b52f5a0 100644 --- a/google/cloud/dialogflow_cx/internal/agents_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/agents_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/agent.proto #include "google/cloud/dialogflow_cx/internal/agents_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/agent.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -249,3 +253,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/agents_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/agents_metadata_decorator.h index 1149dcab4b146..7558e13bf22ab 100644 --- a/google/cloud/dialogflow_cx/internal/agents_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/agents_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/agents_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -158,4 +161,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_AGENTS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/agents_option_defaults.cc b/google/cloud/dialogflow_cx/internal/agents_option_defaults.cc index 5ea54c448a0f1..850fa96b7704d 100644 --- a/google/cloud/dialogflow_cx/internal/agents_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/agents_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/agents_option_defaults.h" #include "google/cloud/dialogflow_cx/agents_connection.h" #include "google/cloud/dialogflow_cx/agents_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options AgentsDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dialogflow_cx::AgentsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dialogflow_cx::AgentsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/agents_stub.cc b/google/cloud/dialogflow_cx/internal/agents_stub.cc index 4a55e1aa0899d..cae9cb5a1467a 100644 --- a/google/cloud/dialogflow_cx/internal/agents_stub.cc +++ b/google/cloud/dialogflow_cx/internal/agents_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/cx/v3/agent.proto #include "google/cloud/dialogflow_cx/internal/agents_stub.h" +#include "google/cloud/dialogflow/cx/v3/agent.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -302,3 +305,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/agents_stub.h b/google/cloud/dialogflow_cx/internal/agents_stub.h index 9e4f91c087016..8f3d79507ee0c 100644 --- a/google/cloud/dialogflow_cx/internal/agents_stub.h +++ b/google/cloud/dialogflow_cx/internal/agents_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_AGENTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_AGENTS_STUB_H +#include "google/cloud/dialogflow/cx/v3/agent.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 -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/protobuf/struct.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -271,4 +274,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_AGENTS_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/agents_stub_factory.cc b/google/cloud/dialogflow_cx/internal/agents_stub_factory.cc index e8e17f0752a14..8965a810447af 100644 --- a/google/cloud/dialogflow_cx/internal/agents_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/agents_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/agent.proto #include "google/cloud/dialogflow_cx/internal/agents_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/agent.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/agents_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/agents_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/agents_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/agents_stub.h" #include "google/cloud/dialogflow_cx/internal/agents_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/agents_stub_factory.h b/google/cloud/dialogflow_cx/internal/agents_stub_factory.h index 204e937fef589..dccf8208487a8 100644 --- a/google/cloud/dialogflow_cx/internal/agents_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/agents_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_AGENTS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/agents_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/agents_tracing_connection.cc index cd8fbdd8b22c7..155d772db2a90 100644 --- a/google/cloud/dialogflow_cx/internal/agents_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/agents_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AgentsTracingConnection::AgentsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -217,15 +215,11 @@ Status AgentsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAgentsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/agents_tracing_connection.h b/google/cloud/dialogflow_cx/internal/agents_tracing_connection.h index 2cc05d29086b7..aa94f1a4776d8 100644 --- a/google/cloud/dialogflow_cx/internal/agents_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/agents_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AgentsTracingConnection : public dialogflow_cx::AgentsConnection { public: ~AgentsTracingConnection() override = default; @@ -120,8 +118,6 @@ class AgentsTracingConnection : public dialogflow_cx::AgentsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/agents_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/agents_tracing_stub.cc index 32b950043890c..6b8a04afe8a90 100644 --- a/google/cloud/dialogflow_cx/internal/agents_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/agents_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AgentsTracingStub::AgentsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -277,18 +278,14 @@ future AgentsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAgentsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/agents_tracing_stub.h b/google/cloud/dialogflow_cx/internal/agents_tracing_stub.h index 5ae16ab41577e..38f2f93261173 100644 --- a/google/cloud/dialogflow_cx/internal/agents_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/agents_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AgentsTracingStub : public AgentsStub { public: ~AgentsTracingStub() override = default; @@ -148,8 +149,6 @@ class AgentsTracingStub : public AgentsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -164,4 +163,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_AGENTS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/changelogs_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/changelogs_auth_decorator.cc index 01be514c6b38c..52c3b96a360ba 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/changelogs_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/changelog.proto #include "google/cloud/dialogflow_cx/internal/changelogs_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/changelog.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -95,3 +98,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/changelogs_auth_decorator.h b/google/cloud/dialogflow_cx/internal/changelogs_auth_decorator.h index 7e5af2c0a95fa..96a48eb4addd1 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/changelogs_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -78,4 +81,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_CHANGELOGS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/changelogs_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/changelogs_logging_decorator.cc index 3ddfccf3d1e89..7e33665eedb63 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/changelogs_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/changelog.proto #include "google/cloud/dialogflow_cx/internal/changelogs_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/changelog.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -122,3 +125,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/changelogs_logging_decorator.h b/google/cloud/dialogflow_cx/internal/changelogs_logging_decorator.h index 1b002506f56ba..7f953679a3f50 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/changelogs_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -78,4 +81,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_CHANGELOGS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/changelogs_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/changelogs_metadata_decorator.cc index 7629efea8ef85..bb88889fe7c48 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/changelogs_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/changelog.proto #include "google/cloud/dialogflow_cx/internal/changelogs_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/changelog.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -121,3 +125,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/changelogs_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/changelogs_metadata_decorator.h index ef0f1ce9eada0..23d79ec59c31f 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/changelogs_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -83,4 +86,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_CHANGELOGS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/changelogs_option_defaults.cc b/google/cloud/dialogflow_cx/internal/changelogs_option_defaults.cc index bf8178a965533..7e54b3326491e 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/changelogs_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/changelogs_option_defaults.h" #include "google/cloud/dialogflow_cx/changelogs_connection.h" #include "google/cloud/dialogflow_cx/changelogs_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options ChangelogsDefaultOptions(std::string const& location, Options options) { if (!options.has()) { options.set( dialogflow_cx::ChangelogsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/changelogs_stub.cc b/google/cloud/dialogflow_cx/internal/changelogs_stub.cc index 8beab905b3efa..d59ab3a4ac919 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_stub.cc +++ b/google/cloud/dialogflow_cx/internal/changelogs_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/cx/v3/changelog.proto #include "google/cloud/dialogflow_cx/internal/changelogs_stub.h" +#include "google/cloud/dialogflow/cx/v3/changelog.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -115,3 +118,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/changelogs_stub.h b/google/cloud/dialogflow_cx/internal/changelogs_stub.h index cd58b0dbab3ba..7ace71ca462a6 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_stub.h +++ b/google/cloud/dialogflow_cx/internal/changelogs_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_CHANGELOGS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_CHANGELOGS_STUB_H +#include "google/cloud/dialogflow/cx/v3/changelog.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -127,4 +130,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_CHANGELOGS_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/changelogs_stub_factory.cc b/google/cloud/dialogflow_cx/internal/changelogs_stub_factory.cc index 56232069d55b0..5908f41470c29 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/changelogs_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/changelog.proto #include "google/cloud/dialogflow_cx/internal/changelogs_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/changelog.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/changelogs_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/changelogs_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/changelogs_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/changelogs_stub.h" #include "google/cloud/dialogflow_cx/internal/changelogs_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/changelogs_stub_factory.h b/google/cloud/dialogflow_cx/internal/changelogs_stub_factory.h index 0f06e89240d7c..5e7744998e592 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/changelogs_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_CHANGELOGS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/changelogs_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/changelogs_tracing_connection.cc index f30a1142a85a4..848d553b0de32 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/changelogs_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ChangelogsTracingConnection::ChangelogsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -102,16 +100,12 @@ Status ChangelogsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeChangelogsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/changelogs_tracing_connection.h b/google/cloud/dialogflow_cx/internal/changelogs_tracing_connection.h index 7af01c4067dce..21b23cfe01efd 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/changelogs_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ChangelogsTracingConnection : public dialogflow_cx::ChangelogsConnection { public: ~ChangelogsTracingConnection() override = default; @@ -66,8 +64,6 @@ class ChangelogsTracingConnection : public dialogflow_cx::ChangelogsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/changelogs_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/changelogs_tracing_stub.cc index e731c16051979..0a84cee293da1 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/changelogs_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ChangelogsTracingStub::ChangelogsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -113,18 +114,14 @@ Status ChangelogsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeChangelogsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/changelogs_tracing_stub.h b/google/cloud/dialogflow_cx/internal/changelogs_tracing_stub.h index 34eff99a81c9a..7b5c59458717c 100644 --- a/google/cloud/dialogflow_cx/internal/changelogs_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/changelogs_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ChangelogsTracingStub : public ChangelogsStub { public: ~ChangelogsTracingStub() override = default; @@ -74,8 +75,6 @@ class ChangelogsTracingStub : public ChangelogsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -90,4 +89,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_CHANGELOGS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/deployments_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/deployments_auth_decorator.cc index 18b2832b7d246..1a42883ff6b0f 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/deployments_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/deployment.proto #include "google/cloud/dialogflow_cx/internal/deployments_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/deployment.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -95,3 +98,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/deployments_auth_decorator.h b/google/cloud/dialogflow_cx/internal/deployments_auth_decorator.h index 29eabf3644578..0c7acdf20be9b 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/deployments_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -79,4 +82,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_DEPLOYMENTS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/deployments_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/deployments_logging_decorator.cc index a336798505c40..a34e09d9795fb 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/deployments_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/deployment.proto #include "google/cloud/dialogflow_cx/internal/deployments_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/deployment.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -122,3 +125,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/deployments_logging_decorator.h b/google/cloud/dialogflow_cx/internal/deployments_logging_decorator.h index aa27d593cff4b..a74811756c413 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/deployments_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -79,4 +82,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_DEPLOYMENTS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/deployments_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/deployments_metadata_decorator.cc index 5c2fe17f2eef5..466277b811883 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/deployments_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/deployment.proto #include "google/cloud/dialogflow_cx/internal/deployments_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/deployment.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -121,3 +125,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/deployments_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/deployments_metadata_decorator.h index 18017116abb59..5765e30a2f935 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/deployments_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -84,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_DEPLOYMENTS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/deployments_option_defaults.cc b/google/cloud/dialogflow_cx/internal/deployments_option_defaults.cc index e99d806e90ca8..7a2a594e6ccfb 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/deployments_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/deployments_option_defaults.h" #include "google/cloud/dialogflow_cx/deployments_connection.h" #include "google/cloud/dialogflow_cx/deployments_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options DeploymentsDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_cx::DeploymentsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/deployments_stub.cc b/google/cloud/dialogflow_cx/internal/deployments_stub.cc index 05b277edd2a3f..af06b9595641e 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_stub.cc +++ b/google/cloud/dialogflow_cx/internal/deployments_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/cx/v3/deployment.proto #include "google/cloud/dialogflow_cx/internal/deployments_stub.h" +#include "google/cloud/dialogflow/cx/v3/deployment.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -115,3 +118,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/deployments_stub.h b/google/cloud/dialogflow_cx/internal/deployments_stub.h index 2d6777b56eb0f..0bd60067a7bb2 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_stub.h +++ b/google/cloud/dialogflow_cx/internal/deployments_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_DEPLOYMENTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_DEPLOYMENTS_STUB_H +#include "google/cloud/dialogflow/cx/v3/deployment.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_DEPLOYMENTS_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/deployments_stub_factory.cc b/google/cloud/dialogflow_cx/internal/deployments_stub_factory.cc index 726f44a15a279..71a17f60c21d0 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/deployments_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/deployment.proto #include "google/cloud/dialogflow_cx/internal/deployments_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/deployment.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/deployments_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/deployments_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/deployments_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/deployments_stub.h" #include "google/cloud/dialogflow_cx/internal/deployments_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/deployments_stub_factory.h b/google/cloud/dialogflow_cx/internal/deployments_stub_factory.h index 1ead352135be5..edbd47f9b71a7 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/deployments_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_DEPLOYMENTS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/deployments_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/deployments_tracing_connection.cc index 13cc319073a48..a0d1bf20b709c 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/deployments_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DeploymentsTracingConnection::DeploymentsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -102,16 +100,12 @@ Status DeploymentsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDeploymentsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/deployments_tracing_connection.h b/google/cloud/dialogflow_cx/internal/deployments_tracing_connection.h index 3cf7a578678df..7b2856c3a2180 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/deployments_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DeploymentsTracingConnection : public dialogflow_cx::DeploymentsConnection { public: @@ -67,8 +65,6 @@ class DeploymentsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/deployments_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/deployments_tracing_stub.cc index 6d0167f14d928..7f205cab3cfaa 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/deployments_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DeploymentsTracingStub::DeploymentsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -113,18 +114,14 @@ Status DeploymentsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDeploymentsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/deployments_tracing_stub.h b/google/cloud/dialogflow_cx/internal/deployments_tracing_stub.h index 24e9b53708bad..eb4b1b3436d5d 100644 --- a/google/cloud/dialogflow_cx/internal/deployments_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/deployments_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DeploymentsTracingStub : public DeploymentsStub { public: ~DeploymentsTracingStub() override = default; @@ -75,8 +76,6 @@ class DeploymentsTracingStub : public DeploymentsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -91,4 +90,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_DEPLOYMENTS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/entity_types_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/entity_types_auth_decorator.cc index a861ee8ca988f..e2801065bd862 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/entity_types_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/entity_type.proto #include "google/cloud/dialogflow_cx/internal/entity_types_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/entity_type.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -217,3 +220,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/entity_types_auth_decorator.h b/google/cloud/dialogflow_cx/internal/entity_types_auth_decorator.h index a910505f05f61..538e10ff99401 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/entity_types_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/entity_types_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -131,4 +134,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENTITY_TYPES_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/entity_types_connection_impl.h b/google/cloud/dialogflow_cx/internal/entity_types_connection_impl.h index abbdab069dd47..0ab2f926ad982 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_connection_impl.h +++ b/google/cloud/dialogflow_cx/internal/entity_types_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/internal/entity_types_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/entity_types_logging_decorator.cc index 308b3da57a4a8..bb6a67e583486 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/entity_types_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/entity_type.proto #include "google/cloud/dialogflow_cx/internal/entity_types_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/entity_type.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -261,3 +264,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/entity_types_logging_decorator.h b/google/cloud/dialogflow_cx/internal/entity_types_logging_decorator.h index 0ebea1600ed04..7bd598decada5 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/entity_types_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/entity_types_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -131,4 +134,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENTITY_TYPES_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/entity_types_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/entity_types_metadata_decorator.cc index 305fa1edaa33a..62604f10bed18 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/entity_types_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/entity_type.proto #include "google/cloud/dialogflow_cx/internal/entity_types_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/entity_type.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -215,3 +219,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/entity_types_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/entity_types_metadata_decorator.h index 7a61f5708f391..2a9bb0d05dc37 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/entity_types_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/entity_types_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -136,4 +139,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENTITY_TYPES_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/entity_types_option_defaults.cc b/google/cloud/dialogflow_cx/internal/entity_types_option_defaults.cc index 6486718b990e9..6233b5f5d3af0 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/entity_types_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/entity_types_option_defaults.h" #include "google/cloud/dialogflow_cx/entity_types_connection.h" #include "google/cloud/dialogflow_cx/entity_types_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options EntityTypesDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_cx::EntityTypesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/entity_types_stub.cc b/google/cloud/dialogflow_cx/internal/entity_types_stub.cc index a2c08b990a0a6..24810d5fab432 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_stub.cc +++ b/google/cloud/dialogflow_cx/internal/entity_types_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/cx/v3/entity_type.proto #include "google/cloud/dialogflow_cx/internal/entity_types_stub.h" +#include "google/cloud/dialogflow/cx/v3/entity_type.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -256,3 +259,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/entity_types_stub.h b/google/cloud/dialogflow_cx/internal/entity_types_stub.h index 898b19e3e4a6f..4ac0694d4a9bc 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_stub.h +++ b/google/cloud/dialogflow_cx/internal/entity_types_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENTITY_TYPES_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENTITY_TYPES_STUB_H +#include "google/cloud/dialogflow/cx/v3/entity_type.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -237,4 +240,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENTITY_TYPES_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/entity_types_stub_factory.cc b/google/cloud/dialogflow_cx/internal/entity_types_stub_factory.cc index 93d1fd496defc..a63efc53ac6bd 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/entity_types_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/entity_type.proto #include "google/cloud/dialogflow_cx/internal/entity_types_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/entity_type.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/entity_types_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/entity_types_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/entity_types_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/entity_types_stub.h" #include "google/cloud/dialogflow_cx/internal/entity_types_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/entity_types_stub_factory.h b/google/cloud/dialogflow_cx/internal/entity_types_stub_factory.h index aec0dcdeee408..c28aae29f30b5 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/entity_types_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENTITY_TYPES_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/entity_types_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/entity_types_tracing_connection.cc index 2819ff5fb640c..a5e5d48bfe8cf 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/entity_types_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EntityTypesTracingConnection::EntityTypesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -192,16 +190,12 @@ Status EntityTypesTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEntityTypesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/entity_types_tracing_connection.h b/google/cloud/dialogflow_cx/internal/entity_types_tracing_connection.h index 5d06913176635..a2c5d40a00555 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/entity_types_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EntityTypesTracingConnection : public dialogflow_cx::EntityTypesConnection { public: @@ -105,8 +103,6 @@ class EntityTypesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/entity_types_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/entity_types_tracing_stub.cc index 7748fe4a567e6..3bc65f478c7e0 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/entity_types_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EntityTypesTracingStub::EntityTypesTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -234,18 +235,14 @@ future EntityTypesTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEntityTypesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/entity_types_tracing_stub.h b/google/cloud/dialogflow_cx/internal/entity_types_tracing_stub.h index e3a16393be881..ad1fcf2ed4212 100644 --- a/google/cloud/dialogflow_cx/internal/entity_types_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/entity_types_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EntityTypesTracingStub : public EntityTypesStub { public: ~EntityTypesTracingStub() override = default; @@ -126,8 +127,6 @@ class EntityTypesTracingStub : public EntityTypesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -142,4 +141,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENTITY_TYPES_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/environments_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/environments_auth_decorator.cc index ac44b31bc8eb9..b0dd7bf9ed596 100644 --- a/google/cloud/dialogflow_cx/internal/environments_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/environments_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/environment.proto #include "google/cloud/dialogflow_cx/internal/environments_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/environment.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -278,3 +281,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/environments_auth_decorator.h b/google/cloud/dialogflow_cx/internal/environments_auth_decorator.h index 57cf489dc6203..a875114227efd 100644 --- a/google/cloud/dialogflow_cx/internal/environments_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/environments_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/environments_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -157,4 +160,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENVIRONMENTS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/environments_connection_impl.h b/google/cloud/dialogflow_cx/internal/environments_connection_impl.h index a0f501b53e027..4e7b496588c1a 100644 --- a/google/cloud/dialogflow_cx/internal/environments_connection_impl.h +++ b/google/cloud/dialogflow_cx/internal/environments_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/internal/environments_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/environments_logging_decorator.cc index d2b62810277c3..8b9d713b236d6 100644 --- a/google/cloud/dialogflow_cx/internal/environments_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/environments_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/environment.proto #include "google/cloud/dialogflow_cx/internal/environments_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/environment.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -328,3 +331,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/environments_logging_decorator.h b/google/cloud/dialogflow_cx/internal/environments_logging_decorator.h index 3fb6804fff21e..ffc031b039787 100644 --- a/google/cloud/dialogflow_cx/internal/environments_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/environments_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/environments_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -157,4 +160,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENVIRONMENTS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/environments_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/environments_metadata_decorator.cc index c4e2af0b31768..c336aeb180024 100644 --- a/google/cloud/dialogflow_cx/internal/environments_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/environments_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/environment.proto #include "google/cloud/dialogflow_cx/internal/environments_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/environment.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -268,3 +272,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/environments_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/environments_metadata_decorator.h index 8eb436b84d2dd..46137debee54a 100644 --- a/google/cloud/dialogflow_cx/internal/environments_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/environments_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/environments_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -162,4 +165,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENVIRONMENTS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/environments_option_defaults.cc b/google/cloud/dialogflow_cx/internal/environments_option_defaults.cc index d590fb729b29d..4c42dd6c1c55f 100644 --- a/google/cloud/dialogflow_cx/internal/environments_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/environments_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/environments_option_defaults.h" #include "google/cloud/dialogflow_cx/environments_connection.h" #include "google/cloud/dialogflow_cx/environments_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options EnvironmentsDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_cx::EnvironmentsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/environments_stub.cc b/google/cloud/dialogflow_cx/internal/environments_stub.cc index a791dfc01384a..550242467b239 100644 --- a/google/cloud/dialogflow_cx/internal/environments_stub.cc +++ b/google/cloud/dialogflow_cx/internal/environments_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/cx/v3/environment.proto #include "google/cloud/dialogflow_cx/internal/environments_stub.h" +#include "google/cloud/dialogflow/cx/v3/environment.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -325,3 +328,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/environments_stub.h b/google/cloud/dialogflow_cx/internal/environments_stub.h index 2f3dccf245290..81f0bebca4015 100644 --- a/google/cloud/dialogflow_cx/internal/environments_stub.h +++ b/google/cloud/dialogflow_cx/internal/environments_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENVIRONMENTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENVIRONMENTS_STUB_H +#include "google/cloud/dialogflow/cx/v3/environment.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 -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/protobuf/struct.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -290,4 +293,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENVIRONMENTS_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/environments_stub_factory.cc b/google/cloud/dialogflow_cx/internal/environments_stub_factory.cc index 027be8f1cb724..5a37e51b1585a 100644 --- a/google/cloud/dialogflow_cx/internal/environments_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/environments_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/environment.proto #include "google/cloud/dialogflow_cx/internal/environments_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/environment.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/environments_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/environments_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/environments_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/environments_stub.h" #include "google/cloud/dialogflow_cx/internal/environments_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/environments_stub_factory.h b/google/cloud/dialogflow_cx/internal/environments_stub_factory.h index 03cc1442ff75e..5699d2280ef98 100644 --- a/google/cloud/dialogflow_cx/internal/environments_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/environments_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENVIRONMENTS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/environments_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/environments_tracing_connection.cc index 99407f0c60f4b..c7413da5a6351 100644 --- a/google/cloud/dialogflow_cx/internal/environments_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/environments_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EnvironmentsTracingConnection::EnvironmentsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -261,16 +259,12 @@ Status EnvironmentsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEnvironmentsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/environments_tracing_connection.h b/google/cloud/dialogflow_cx/internal/environments_tracing_connection.h index 88c66c23ef022..0eacdfc7c3d2f 100644 --- a/google/cloud/dialogflow_cx/internal/environments_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/environments_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EnvironmentsTracingConnection : public dialogflow_cx::EnvironmentsConnection { public: @@ -132,8 +130,6 @@ class EnvironmentsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/environments_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/environments_tracing_stub.cc index 3d263a6567f75..a376155b1082c 100644 --- a/google/cloud/dialogflow_cx/internal/environments_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/environments_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EnvironmentsTracingStub::EnvironmentsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -295,18 +296,14 @@ future EnvironmentsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEnvironmentsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/environments_tracing_stub.h b/google/cloud/dialogflow_cx/internal/environments_tracing_stub.h index 317eacb796ab6..0d1be4e47e85f 100644 --- a/google/cloud/dialogflow_cx/internal/environments_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/environments_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EnvironmentsTracingStub : public EnvironmentsStub { public: ~EnvironmentsTracingStub() override = default; @@ -152,8 +153,6 @@ class EnvironmentsTracingStub : public EnvironmentsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -168,4 +167,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_ENVIRONMENTS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/experiments_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/experiments_auth_decorator.cc index 6fb163d0aff35..7edb01437cd30 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/experiments_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/experiment.proto #include "google/cloud/dialogflow_cx/internal/experiments_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/experiment.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -139,3 +142,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/experiments_auth_decorator.h b/google/cloud/dialogflow_cx/internal/experiments_auth_decorator.h index 1aea7c80f0f4a..5c44d84855a64 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/experiments_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_EXPERIMENTS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/experiments_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/experiments_logging_decorator.cc index a44bd6699461e..d11de7c355f66 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/experiments_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/experiment.proto #include "google/cloud/dialogflow_cx/internal/experiments_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/experiment.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -186,3 +189,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/experiments_logging_decorator.h b/google/cloud/dialogflow_cx/internal/experiments_logging_decorator.h index 7db6a9a7efdb8..979de3ed7fc69 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/experiments_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_EXPERIMENTS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/experiments_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/experiments_metadata_decorator.cc index 7369c0a0cedfc..bcb1bdaae121d 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/experiments_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/experiment.proto #include "google/cloud/dialogflow_cx/internal/experiments_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/experiment.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -166,3 +170,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/experiments_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/experiments_metadata_decorator.h index faac8780fdd36..bb68b3007f8f2 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/experiments_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_EXPERIMENTS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/experiments_option_defaults.cc b/google/cloud/dialogflow_cx/internal/experiments_option_defaults.cc index 99bb0ff998455..d90d3adca099b 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/experiments_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/experiments_option_defaults.h" #include "google/cloud/dialogflow_cx/experiments_connection.h" #include "google/cloud/dialogflow_cx/experiments_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options ExperimentsDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_cx::ExperimentsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/experiments_stub.cc b/google/cloud/dialogflow_cx/internal/experiments_stub.cc index 4be081005316e..50fc94903e859 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_stub.cc +++ b/google/cloud/dialogflow_cx/internal/experiments_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/cx/v3/experiment.proto #include "google/cloud/dialogflow_cx/internal/experiments_stub.h" +#include "google/cloud/dialogflow/cx/v3/experiment.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -174,3 +177,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/experiments_stub.h b/google/cloud/dialogflow_cx/internal/experiments_stub.h index 0236cf1e595a9..128dd262aae37 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_stub.h +++ b/google/cloud/dialogflow_cx/internal/experiments_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_EXPERIMENTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_EXPERIMENTS_STUB_H +#include "google/cloud/dialogflow/cx/v3/experiment.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -182,4 +185,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_EXPERIMENTS_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/experiments_stub_factory.cc b/google/cloud/dialogflow_cx/internal/experiments_stub_factory.cc index e400f880f2e7c..fc60e551315b4 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/experiments_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/experiment.proto #include "google/cloud/dialogflow_cx/internal/experiments_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/experiment.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/experiments_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/experiments_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/experiments_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/experiments_stub.h" #include "google/cloud/dialogflow_cx/internal/experiments_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/experiments_stub_factory.h b/google/cloud/dialogflow_cx/internal/experiments_stub_factory.h index 3f9f5b394d9e4..5c409a2e5c8cc 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/experiments_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_EXPERIMENTS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/experiments_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/experiments_tracing_connection.cc index 78679007d7662..d24dfe1f379f4 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/experiments_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ExperimentsTracingConnection::ExperimentsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -146,16 +144,12 @@ Status ExperimentsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeExperimentsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/experiments_tracing_connection.h b/google/cloud/dialogflow_cx/internal/experiments_tracing_connection.h index 8e5c7a3d0bdc5..0ae6229956956 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/experiments_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ExperimentsTracingConnection : public dialogflow_cx::ExperimentsConnection { public: @@ -87,8 +85,6 @@ class ExperimentsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/experiments_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/experiments_tracing_stub.cc index 36b6b78c20751..8cf6df99ad259 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/experiments_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ExperimentsTracingStub::ExperimentsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -172,18 +173,14 @@ Status ExperimentsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeExperimentsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/experiments_tracing_stub.h b/google/cloud/dialogflow_cx/internal/experiments_tracing_stub.h index 88ed681e031ca..b55eb3eda71a1 100644 --- a/google/cloud/dialogflow_cx/internal/experiments_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/experiments_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ExperimentsTracingStub : public ExperimentsStub { public: ~ExperimentsTracingStub() override = default; @@ -100,8 +101,6 @@ class ExperimentsTracingStub : public ExperimentsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -116,4 +115,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_EXPERIMENTS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/flows_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/flows_auth_decorator.cc index 5db6e1de4ac53..9fbc27c4ed30b 100644 --- a/google/cloud/dialogflow_cx/internal/flows_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/flows_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/flow.proto #include "google/cloud/dialogflow_cx/internal/flows_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/flow.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -252,3 +255,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/flows_auth_decorator.h b/google/cloud/dialogflow_cx/internal/flows_auth_decorator.h index a0d9b334bd820..a1c92f60dbe79 100644 --- a/google/cloud/dialogflow_cx/internal/flows_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/flows_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/flows_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -152,4 +155,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_FLOWS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/flows_connection_impl.h b/google/cloud/dialogflow_cx/internal/flows_connection_impl.h index 4438302af31e7..e309b7eaec089 100644 --- a/google/cloud/dialogflow_cx/internal/flows_connection_impl.h +++ b/google/cloud/dialogflow_cx/internal/flows_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/internal/flows_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/flows_logging_decorator.cc index 074e3a69b5c3b..033221209e00e 100644 --- a/google/cloud/dialogflow_cx/internal/flows_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/flows_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/flow.proto #include "google/cloud/dialogflow_cx/internal/flows_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/flow.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -308,3 +311,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/flows_logging_decorator.h b/google/cloud/dialogflow_cx/internal/flows_logging_decorator.h index ecea7850eb805..8a0c188358c37 100644 --- a/google/cloud/dialogflow_cx/internal/flows_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/flows_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/flows_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -151,4 +154,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_FLOWS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/flows_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/flows_metadata_decorator.cc index 958064c72847f..ec79bf4c79b85 100644 --- a/google/cloud/dialogflow_cx/internal/flows_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/flows_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/flow.proto #include "google/cloud/dialogflow_cx/internal/flows_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/flow.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -244,3 +248,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/flows_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/flows_metadata_decorator.h index f152047448ae4..c2ec4383b592e 100644 --- a/google/cloud/dialogflow_cx/internal/flows_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/flows_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/flows_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -157,4 +160,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_FLOWS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/flows_option_defaults.cc b/google/cloud/dialogflow_cx/internal/flows_option_defaults.cc index d1a4a03b3e87c..34a49d778b9da 100644 --- a/google/cloud/dialogflow_cx/internal/flows_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/flows_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/flows_option_defaults.h" #include "google/cloud/dialogflow_cx/flows_connection.h" #include "google/cloud/dialogflow_cx/flows_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options FlowsDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dialogflow_cx::FlowsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dialogflow_cx::FlowsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/flows_stub.cc b/google/cloud/dialogflow_cx/internal/flows_stub.cc index b6d178b804618..060e2d549db2b 100644 --- a/google/cloud/dialogflow_cx/internal/flows_stub.cc +++ b/google/cloud/dialogflow_cx/internal/flows_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/cx/v3/flow.proto #include "google/cloud/dialogflow_cx/internal/flows_stub.h" +#include "google/cloud/dialogflow/cx/v3/flow.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -302,3 +305,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/flows_stub.h b/google/cloud/dialogflow_cx/internal/flows_stub.h index 569730071d37b..657398cdaeacf 100644 --- a/google/cloud/dialogflow_cx/internal/flows_stub.h +++ b/google/cloud/dialogflow_cx/internal/flows_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_FLOWS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_FLOWS_STUB_H +#include "google/cloud/dialogflow/cx/v3/flow.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 -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/protobuf/struct.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -266,4 +269,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_FLOWS_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/flows_stub_factory.cc b/google/cloud/dialogflow_cx/internal/flows_stub_factory.cc index e7fbac9ded224..59aba0839ed8c 100644 --- a/google/cloud/dialogflow_cx/internal/flows_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/flows_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/flow.proto #include "google/cloud/dialogflow_cx/internal/flows_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/flow.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/flows_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/flows_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/flows_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/flows_stub.h" #include "google/cloud/dialogflow_cx/internal/flows_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/flows_stub_factory.h b/google/cloud/dialogflow_cx/internal/flows_stub_factory.h index 4080345154e41..056ce74ad6b0e 100644 --- a/google/cloud/dialogflow_cx/internal/flows_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/flows_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_FLOWS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/flows_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/flows_tracing_connection.cc index 2ba436177489a..7407edc28a0bb 100644 --- a/google/cloud/dialogflow_cx/internal/flows_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/flows_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FlowsTracingConnection::FlowsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -208,15 +206,11 @@ Status FlowsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFlowsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/flows_tracing_connection.h b/google/cloud/dialogflow_cx/internal/flows_tracing_connection.h index 3c27aba0eef82..9cd262de0d57e 100644 --- a/google/cloud/dialogflow_cx/internal/flows_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/flows_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FlowsTracingConnection : public dialogflow_cx::FlowsConnection { public: ~FlowsTracingConnection() override = default; @@ -121,8 +119,6 @@ class FlowsTracingConnection : public dialogflow_cx::FlowsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/flows_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/flows_tracing_stub.cc index a2319941a89b2..ae0710453c21e 100644 --- a/google/cloud/dialogflow_cx/internal/flows_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/flows_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FlowsTracingStub::FlowsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -273,18 +274,14 @@ future FlowsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFlowsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/flows_tracing_stub.h b/google/cloud/dialogflow_cx/internal/flows_tracing_stub.h index 6cb42fa58dc4b..78e0911c51113 100644 --- a/google/cloud/dialogflow_cx/internal/flows_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/flows_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FlowsTracingStub : public FlowsStub { public: ~FlowsTracingStub() override = default; @@ -147,8 +148,6 @@ class FlowsTracingStub : public FlowsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -163,4 +162,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_FLOWS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/generators_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/generators_auth_decorator.cc index bc81446a29aae..e66d759aadf11 100644 --- a/google/cloud/dialogflow_cx/internal/generators_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/generators_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/generator.proto #include "google/cloud/dialogflow_cx/internal/generators_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/generator.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -121,3 +124,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/generators_auth_decorator.h b/google/cloud/dialogflow_cx/internal/generators_auth_decorator.h index e6a8296adde1f..50dcb561a1320 100644 --- a/google/cloud/dialogflow_cx/internal/generators_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/generators_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -93,4 +96,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_GENERATORS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/generators_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/generators_logging_decorator.cc index 0b1cdbc2eeff6..9a998dc67ce92 100644 --- a/google/cloud/dialogflow_cx/internal/generators_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/generators_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/generator.proto #include "google/cloud/dialogflow_cx/internal/generators_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/generator.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -160,3 +163,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/generators_logging_decorator.h b/google/cloud/dialogflow_cx/internal/generators_logging_decorator.h index e1893da93d88b..dc487ccac5fed 100644 --- a/google/cloud/dialogflow_cx/internal/generators_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/generators_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -93,4 +96,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_GENERATORS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/generators_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/generators_metadata_decorator.cc index 25240f4f0eb06..7ce157f0d2954 100644 --- a/google/cloud/dialogflow_cx/internal/generators_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/generators_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/generator.proto #include "google/cloud/dialogflow_cx/internal/generators_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/generator.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -148,3 +152,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/generators_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/generators_metadata_decorator.h index 6393282bf709d..2c3891ed9bb23 100644 --- a/google/cloud/dialogflow_cx/internal/generators_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/generators_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -98,4 +101,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_GENERATORS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/generators_option_defaults.cc b/google/cloud/dialogflow_cx/internal/generators_option_defaults.cc index 37cc78a21ae9d..ab4bc1690e024 100644 --- a/google/cloud/dialogflow_cx/internal/generators_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/generators_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/generators_option_defaults.h" #include "google/cloud/dialogflow_cx/generators_connection.h" #include "google/cloud/dialogflow_cx/generators_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options GeneratorsDefaultOptions(std::string const& location, Options options) { if (!options.has()) { options.set( dialogflow_cx::GeneratorsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/generators_stub.cc b/google/cloud/dialogflow_cx/internal/generators_stub.cc index 38fa773d742d2..8724523e98ab4 100644 --- a/google/cloud/dialogflow_cx/internal/generators_stub.cc +++ b/google/cloud/dialogflow_cx/internal/generators_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/cx/v3/generator.proto #include "google/cloud/dialogflow_cx/internal/generators_stub.h" +#include "google/cloud/dialogflow/cx/v3/generator.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -150,3 +153,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/generators_stub.h b/google/cloud/dialogflow_cx/internal/generators_stub.h index 5bd16ec421a1e..ae6553ebead59 100644 --- a/google/cloud/dialogflow_cx/internal/generators_stub.h +++ b/google/cloud/dialogflow_cx/internal/generators_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_GENERATORS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_GENERATORS_STUB_H +#include "google/cloud/dialogflow/cx/v3/generator.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -159,4 +162,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_GENERATORS_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/generators_stub_factory.cc b/google/cloud/dialogflow_cx/internal/generators_stub_factory.cc index 7b6a6c6a8521c..d214417c1fb9d 100644 --- a/google/cloud/dialogflow_cx/internal/generators_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/generators_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/generator.proto #include "google/cloud/dialogflow_cx/internal/generators_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/generator.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/generators_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/generators_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/generators_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/generators_stub.h" #include "google/cloud/dialogflow_cx/internal/generators_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/generators_stub_factory.h b/google/cloud/dialogflow_cx/internal/generators_stub_factory.h index ac4e72b92f2d3..5661bcc0d90ef 100644 --- a/google/cloud/dialogflow_cx/internal/generators_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/generators_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_GENERATORS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/generators_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/generators_tracing_connection.cc index 6c80a4ba30ca3..d54210e237892 100644 --- a/google/cloud/dialogflow_cx/internal/generators_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/generators_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GeneratorsTracingConnection::GeneratorsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -128,16 +126,12 @@ Status GeneratorsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGeneratorsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/generators_tracing_connection.h b/google/cloud/dialogflow_cx/internal/generators_tracing_connection.h index 188b7f8d5cd30..ac0674926b22f 100644 --- a/google/cloud/dialogflow_cx/internal/generators_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/generators_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GeneratorsTracingConnection : public dialogflow_cx::GeneratorsConnection { public: ~GeneratorsTracingConnection() override = default; @@ -78,8 +76,6 @@ class GeneratorsTracingConnection : public dialogflow_cx::GeneratorsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/generators_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/generators_tracing_stub.cc index ead9f1e37b0f5..851876bd53145 100644 --- a/google/cloud/dialogflow_cx/internal/generators_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/generators_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GeneratorsTracingStub::GeneratorsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -148,18 +149,14 @@ Status GeneratorsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGeneratorsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/generators_tracing_stub.h b/google/cloud/dialogflow_cx/internal/generators_tracing_stub.h index fd82370195351..25528db9a9070 100644 --- a/google/cloud/dialogflow_cx/internal/generators_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/generators_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GeneratorsTracingStub : public GeneratorsStub { public: ~GeneratorsTracingStub() override = default; @@ -89,8 +90,6 @@ class GeneratorsTracingStub : public GeneratorsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -105,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_GENERATORS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/intents_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/intents_auth_decorator.cc index d2e33abc66021..96d3d36cd49c3 100644 --- a/google/cloud/dialogflow_cx/internal/intents_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/intents_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/intent.proto #include "google/cloud/dialogflow_cx/internal/intents_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/intent.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -209,3 +212,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/intents_auth_decorator.h b/google/cloud/dialogflow_cx/internal/intents_auth_decorator.h index b7363c81baa2d..ea012fcfabf8e 100644 --- a/google/cloud/dialogflow_cx/internal/intents_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/intents_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/intents_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -130,4 +133,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_INTENTS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/intents_connection_impl.h b/google/cloud/dialogflow_cx/internal/intents_connection_impl.h index 58d2cc474994b..0af1536631afb 100644 --- a/google/cloud/dialogflow_cx/internal/intents_connection_impl.h +++ b/google/cloud/dialogflow_cx/internal/intents_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/internal/intents_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/intents_logging_decorator.cc index 11e02e606afb7..822e5f35166c5 100644 --- a/google/cloud/dialogflow_cx/internal/intents_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/intents_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/intent.proto #include "google/cloud/dialogflow_cx/internal/intents_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/intent.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -256,3 +259,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/intents_logging_decorator.h b/google/cloud/dialogflow_cx/internal/intents_logging_decorator.h index 4158494a072bf..a3bce35c2c6e1 100644 --- a/google/cloud/dialogflow_cx/internal/intents_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/intents_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/intents_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -130,4 +133,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_INTENTS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/intents_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/intents_metadata_decorator.cc index dc3b6fb2f2a68..a95a72acf4f07 100644 --- a/google/cloud/dialogflow_cx/internal/intents_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/intents_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/intent.proto #include "google/cloud/dialogflow_cx/internal/intents_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/intent.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -210,3 +214,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/intents_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/intents_metadata_decorator.h index 8b1907c955c0b..edee170a5177c 100644 --- a/google/cloud/dialogflow_cx/internal/intents_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/intents_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/intents_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -135,4 +138,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_INTENTS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/intents_option_defaults.cc b/google/cloud/dialogflow_cx/internal/intents_option_defaults.cc index 6e77cdc85f246..4b2d64a108a07 100644 --- a/google/cloud/dialogflow_cx/internal/intents_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/intents_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/intents_option_defaults.h" #include "google/cloud/dialogflow_cx/intents_connection.h" #include "google/cloud/dialogflow_cx/intents_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options IntentsDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dialogflow_cx::IntentsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dialogflow_cx::IntentsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/intents_stub.cc b/google/cloud/dialogflow_cx/internal/intents_stub.cc index ba731b07e5820..c7a970968a281 100644 --- a/google/cloud/dialogflow_cx/internal/intents_stub.cc +++ b/google/cloud/dialogflow_cx/internal/intents_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/cx/v3/intent.proto #include "google/cloud/dialogflow_cx/internal/intents_stub.h" +#include "google/cloud/dialogflow/cx/v3/intent.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -250,3 +253,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/intents_stub.h b/google/cloud/dialogflow_cx/internal/intents_stub.h index cf2d49a28c2a6..bb9a0ac422a5c 100644 --- a/google/cloud/dialogflow_cx/internal/intents_stub.h +++ b/google/cloud/dialogflow_cx/internal/intents_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_INTENTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_INTENTS_STUB_H +#include "google/cloud/dialogflow/cx/v3/intent.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -229,4 +232,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_INTENTS_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/intents_stub_factory.cc b/google/cloud/dialogflow_cx/internal/intents_stub_factory.cc index 5d041ebdcef7b..b348dc6f08b6e 100644 --- a/google/cloud/dialogflow_cx/internal/intents_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/intents_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/intent.proto #include "google/cloud/dialogflow_cx/internal/intents_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/intent.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/intents_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/intents_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/intents_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/intents_stub.h" #include "google/cloud/dialogflow_cx/internal/intents_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/intents_stub_factory.h b/google/cloud/dialogflow_cx/internal/intents_stub_factory.h index 3f3d1e40689ef..b0178449882ac 100644 --- a/google/cloud/dialogflow_cx/internal/intents_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/intents_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_INTENTS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/intents_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/intents_tracing_connection.cc index 8401b6a96cdc2..db02ba2dd18c5 100644 --- a/google/cloud/dialogflow_cx/internal/intents_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/intents_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IntentsTracingConnection::IntentsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -182,15 +180,11 @@ Status IntentsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIntentsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/intents_tracing_connection.h b/google/cloud/dialogflow_cx/internal/intents_tracing_connection.h index fec29bfa741e3..6d9d413ec744a 100644 --- a/google/cloud/dialogflow_cx/internal/intents_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/intents_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IntentsTracingConnection : public dialogflow_cx::IntentsConnection { public: ~IntentsTracingConnection() override = default; @@ -101,8 +99,6 @@ class IntentsTracingConnection : public dialogflow_cx::IntentsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/intents_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/intents_tracing_stub.cc index 33dc34730dffc..a53224969977e 100644 --- a/google/cloud/dialogflow_cx/internal/intents_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/intents_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IntentsTracingStub::IntentsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -225,18 +226,14 @@ future IntentsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIntentsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/intents_tracing_stub.h b/google/cloud/dialogflow_cx/internal/intents_tracing_stub.h index 81a6c743a755c..c505f21ddbaab 100644 --- a/google/cloud/dialogflow_cx/internal/intents_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/intents_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IntentsTracingStub : public IntentsStub { public: ~IntentsTracingStub() override = default; @@ -125,8 +126,6 @@ class IntentsTracingStub : public IntentsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -141,4 +140,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_INTENTS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/pages_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/pages_auth_decorator.cc index 8f85473a90b5e..4e6bf84c235dc 100644 --- a/google/cloud/dialogflow_cx/internal/pages_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/pages_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/page.proto #include "google/cloud/dialogflow_cx/internal/pages_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/page.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -117,3 +120,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/pages_auth_decorator.h b/google/cloud/dialogflow_cx/internal/pages_auth_decorator.h index 6d20463aa0006..b8952d9ae0c19 100644 --- a/google/cloud/dialogflow_cx/internal/pages_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/pages_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -92,4 +95,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_PAGES_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/pages_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/pages_logging_decorator.cc index f83e7a3b425a2..819119425d39c 100644 --- a/google/cloud/dialogflow_cx/internal/pages_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/pages_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/page.proto #include "google/cloud/dialogflow_cx/internal/pages_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/page.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -156,3 +159,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/pages_logging_decorator.h b/google/cloud/dialogflow_cx/internal/pages_logging_decorator.h index 63d3ca8b6eec5..db5069e78d596 100644 --- a/google/cloud/dialogflow_cx/internal/pages_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/pages_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -91,4 +94,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_PAGES_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/pages_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/pages_metadata_decorator.cc index d13c67f371459..92e69cd5b7dcc 100644 --- a/google/cloud/dialogflow_cx/internal/pages_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/pages_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/page.proto #include "google/cloud/dialogflow_cx/internal/pages_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/page.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -145,3 +149,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/pages_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/pages_metadata_decorator.h index e071f45e876d1..3f73cd964b4ed 100644 --- a/google/cloud/dialogflow_cx/internal/pages_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/pages_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_PAGES_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/pages_option_defaults.cc b/google/cloud/dialogflow_cx/internal/pages_option_defaults.cc index d8c3b9c91ab71..68cbdc4180a46 100644 --- a/google/cloud/dialogflow_cx/internal/pages_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/pages_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/pages_option_defaults.h" #include "google/cloud/dialogflow_cx/pages_connection.h" #include "google/cloud/dialogflow_cx/pages_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options PagesDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dialogflow_cx::PagesLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dialogflow_cx::PagesLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/pages_stub.cc b/google/cloud/dialogflow_cx/internal/pages_stub.cc index 9712b36720241..29aca24ca5811 100644 --- a/google/cloud/dialogflow_cx/internal/pages_stub.cc +++ b/google/cloud/dialogflow_cx/internal/pages_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/cx/v3/page.proto #include "google/cloud/dialogflow_cx/internal/pages_stub.h" +#include "google/cloud/dialogflow/cx/v3/page.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -147,3 +150,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/pages_stub.h b/google/cloud/dialogflow_cx/internal/pages_stub.h index 55da130c4c8f7..9c2d6301b2816 100644 --- a/google/cloud/dialogflow_cx/internal/pages_stub.h +++ b/google/cloud/dialogflow_cx/internal/pages_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_PAGES_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_PAGES_STUB_H +#include "google/cloud/dialogflow/cx/v3/page.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -151,4 +154,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_PAGES_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/pages_stub_factory.cc b/google/cloud/dialogflow_cx/internal/pages_stub_factory.cc index b2b4442bcd1d3..22b3d48641b4e 100644 --- a/google/cloud/dialogflow_cx/internal/pages_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/pages_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/page.proto #include "google/cloud/dialogflow_cx/internal/pages_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/page.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/pages_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/pages_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/pages_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/pages_stub.h" #include "google/cloud/dialogflow_cx/internal/pages_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/pages_stub_factory.h b/google/cloud/dialogflow_cx/internal/pages_stub_factory.h index 55ddadcc44ac5..7423940ce88dd 100644 --- a/google/cloud/dialogflow_cx/internal/pages_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/pages_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_PAGES_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/pages_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/pages_tracing_connection.cc index 53ca82aac59cb..4fea6cb2afd12 100644 --- a/google/cloud/dialogflow_cx/internal/pages_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/pages_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PagesTracingConnection::PagesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -119,15 +117,11 @@ Status PagesTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePagesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/pages_tracing_connection.h b/google/cloud/dialogflow_cx/internal/pages_tracing_connection.h index 4992da370f381..7949408c90bc0 100644 --- a/google/cloud/dialogflow_cx/internal/pages_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/pages_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PagesTracingConnection : public dialogflow_cx::PagesConnection { public: ~PagesTracingConnection() override = default; @@ -76,8 +74,6 @@ class PagesTracingConnection : public dialogflow_cx::PagesConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/pages_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/pages_tracing_stub.cc index 414a9dac21184..ba51176eae0fe 100644 --- a/google/cloud/dialogflow_cx/internal/pages_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/pages_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PagesTracingStub::PagesTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -144,18 +145,14 @@ Status PagesTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePagesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/pages_tracing_stub.h b/google/cloud/dialogflow_cx/internal/pages_tracing_stub.h index 70dfc762c0318..4fa48cf3ba092 100644 --- a/google/cloud/dialogflow_cx/internal/pages_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/pages_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PagesTracingStub : public PagesStub { public: ~PagesTracingStub() override = default; @@ -88,8 +89,6 @@ class PagesTracingStub : public PagesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -104,4 +103,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_PAGES_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/security_settings_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/security_settings_auth_decorator.cc index 2c2aaf0d53b73..6301e7ae0b6fa 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/security_settings_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/security_settings.proto #include "google/cloud/dialogflow_cx/internal/security_settings_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/security_settings.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -128,3 +131,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/security_settings_auth_decorator.h b/google/cloud/dialogflow_cx/internal/security_settings_auth_decorator.h index 6fd8730dca1be..f6b402aca3a82 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/security_settings_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SECURITY_SETTINGS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/security_settings_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/security_settings_logging_decorator.cc index 7aa5e99c754f5..8d414ea69e4bf 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/security_settings_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/security_settings.proto #include "google/cloud/dialogflow_cx/internal/security_settings_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/security_settings.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -169,3 +172,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/security_settings_logging_decorator.h b/google/cloud/dialogflow_cx/internal/security_settings_logging_decorator.h index 27aa40064688e..a58ec0bc7cbf9 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/security_settings_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SECURITY_SETTINGS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/security_settings_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/security_settings_metadata_decorator.cc index 5ea146c4ce05b..fd489cfcd764e 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/security_settings_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/security_settings.proto #include "google/cloud/dialogflow_cx/internal/security_settings_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/security_settings.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -156,3 +160,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/security_settings_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/security_settings_metadata_decorator.h index 4bb894c9d4cb1..7bb8c979f96eb 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/security_settings_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SECURITY_SETTINGS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/security_settings_option_defaults.cc b/google/cloud/dialogflow_cx/internal/security_settings_option_defaults.cc index fcb818ea1a6c8..f61eccd756899 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/security_settings_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/security_settings_option_defaults.h" #include "google/cloud/dialogflow_cx/security_settings_connection.h" #include "google/cloud/dialogflow_cx/security_settings_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options SecuritySettingsServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_cx::SecuritySettingsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/dialogflow_cx/internal/security_settings_stub.cc b/google/cloud/dialogflow_cx/internal/security_settings_stub.cc index 9a95efdd234a4..2ea2d067a54af 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_stub.cc +++ b/google/cloud/dialogflow_cx/internal/security_settings_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/cx/v3/security_settings.proto #include "google/cloud/dialogflow_cx/internal/security_settings_stub.h" +#include "google/cloud/dialogflow/cx/v3/security_settings.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -160,3 +163,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/security_settings_stub.h b/google/cloud/dialogflow_cx/internal/security_settings_stub.h index 5d2d0390e3d4e..9a9d749d12d2f 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_stub.h +++ b/google/cloud/dialogflow_cx/internal/security_settings_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SECURITY_SETTINGS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SECURITY_SETTINGS_STUB_H +#include "google/cloud/dialogflow/cx/v3/security_settings.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -167,4 +170,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SECURITY_SETTINGS_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/security_settings_stub_factory.cc b/google/cloud/dialogflow_cx/internal/security_settings_stub_factory.cc index 638e04b548de0..8c287fe8903b5 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/security_settings_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/security_settings.proto #include "google/cloud/dialogflow_cx/internal/security_settings_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/security_settings.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/security_settings_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/security_settings_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/security_settings_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/security_settings_stub.h" #include "google/cloud/dialogflow_cx/internal/security_settings_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/security_settings_stub_factory.h b/google/cloud/dialogflow_cx/internal/security_settings_stub_factory.h index 065a18a9c60e4..b973d82cb8e53 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/security_settings_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SECURITY_SETTINGS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/security_settings_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/security_settings_tracing_connection.cc index fb11953ba28bb..7a09d1de098d5 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/security_settings_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SecuritySettingsServiceTracingConnection:: SecuritySettingsServiceTracingConnection( std::shared_ptr child) @@ -136,17 +134,13 @@ Status SecuritySettingsServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSecuritySettingsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/security_settings_tracing_connection.h b/google/cloud/dialogflow_cx/internal/security_settings_tracing_connection.h index ba1db15830778..519977ad18846 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/security_settings_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SecuritySettingsServiceTracingConnection : public dialogflow_cx::SecuritySettingsServiceConnection { public: @@ -83,8 +81,6 @@ class SecuritySettingsServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/security_settings_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/security_settings_tracing_stub.cc index 5db71ed18a828..627875a5c64a4 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/security_settings_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SecuritySettingsServiceTracingStub::SecuritySettingsServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -165,19 +166,15 @@ Status SecuritySettingsServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSecuritySettingsServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/security_settings_tracing_stub.h b/google/cloud/dialogflow_cx/internal/security_settings_tracing_stub.h index b61970d9abb71..6d9357a1e4f2b 100644 --- a/google/cloud/dialogflow_cx/internal/security_settings_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/security_settings_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SecuritySettingsServiceTracingStub : public SecuritySettingsServiceStub { public: ~SecuritySettingsServiceTracingStub() override = default; @@ -94,8 +95,6 @@ class SecuritySettingsServiceTracingStub : public SecuritySettingsServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -111,4 +110,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SECURITY_SETTINGS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/session_entity_types_auth_decorator.cc index 300e67bcb0a0e..fa6e9a898ea88 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/session_entity_type.proto #include "google/cloud/dialogflow_cx/internal/session_entity_types_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/session_entity_type.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -126,3 +129,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_auth_decorator.h b/google/cloud/dialogflow_cx/internal/session_entity_types_auth_decorator.h index 035eb3d8c9b4f..26e9674e4f4d0 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSION_ENTITY_TYPES_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/session_entity_types_logging_decorator.cc index 6d6fb9908a2fc..30b92ae158c6c 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/session_entity_type.proto #include "google/cloud/dialogflow_cx/internal/session_entity_types_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/session_entity_type.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -168,3 +171,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_logging_decorator.h b/google/cloud/dialogflow_cx/internal/session_entity_types_logging_decorator.h index d12b7963c606e..89ea2bab3985b 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSION_ENTITY_TYPES_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/session_entity_types_metadata_decorator.cc index 082fe6d4d80e1..b84d8b7d70e0f 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/session_entity_type.proto #include "google/cloud/dialogflow_cx/internal/session_entity_types_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/session_entity_type.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -156,3 +160,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/session_entity_types_metadata_decorator.h index 26522eb897403..e7f28f18081e3 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSION_ENTITY_TYPES_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_option_defaults.cc b/google/cloud/dialogflow_cx/internal/session_entity_types_option_defaults.cc index 1fa0c7d777e50..0ae26f26a0b56 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/session_entity_types_option_defaults.h" #include "google/cloud/dialogflow_cx/session_entity_types_connection.h" #include "google/cloud/dialogflow_cx/session_entity_types_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options SessionEntityTypesDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_cx::SessionEntityTypesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_stub.cc b/google/cloud/dialogflow_cx/internal/session_entity_types_stub.cc index f821d91b480cd..22994ab2745dc 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_stub.cc +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/cx/v3/session_entity_type.proto #include "google/cloud/dialogflow_cx/internal/session_entity_types_stub.h" +#include "google/cloud/dialogflow/cx/v3/session_entity_type.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -161,3 +164,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_stub.h b/google/cloud/dialogflow_cx/internal/session_entity_types_stub.h index d64d3b5ab40eb..0c3f01fa766f3 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_stub.h +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSION_ENTITY_TYPES_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSION_ENTITY_TYPES_STUB_H +#include "google/cloud/dialogflow/cx/v3/session_entity_type.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -167,4 +170,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSION_ENTITY_TYPES_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_stub_factory.cc b/google/cloud/dialogflow_cx/internal/session_entity_types_stub_factory.cc index 81e91f05f3a4a..ac5f342a30df5 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/session_entity_type.proto #include "google/cloud/dialogflow_cx/internal/session_entity_types_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/session_entity_type.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/session_entity_types_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/session_entity_types_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/session_entity_types_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/session_entity_types_stub.h" #include "google/cloud/dialogflow_cx/internal/session_entity_types_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_stub_factory.h b/google/cloud/dialogflow_cx/internal/session_entity_types_stub_factory.h index c627e00672c5a..a3829a331e4bd 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSION_ENTITY_TYPES_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_connection.cc index b455a0009aa2e..f7536a92a3683 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SessionEntityTypesTracingConnection::SessionEntityTypesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -132,17 +130,13 @@ Status SessionEntityTypesTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSessionEntityTypesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_connection.h b/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_connection.h index 7299ae45339f1..a26dc6610bc79 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SessionEntityTypesTracingConnection : public dialogflow_cx::SessionEntityTypesConnection { public: @@ -83,8 +81,6 @@ class SessionEntityTypesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_stub.cc index 95f2650e485e7..f438e5e06eb34 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SessionEntityTypesTracingStub::SessionEntityTypesTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -164,18 +165,14 @@ Status SessionEntityTypesTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSessionEntityTypesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_stub.h b/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_stub.h index 103e2ae0b4bbd..17997e59f24d2 100644 --- a/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/session_entity_types_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SessionEntityTypesTracingStub : public SessionEntityTypesStub { public: ~SessionEntityTypesTracingStub() override = default; @@ -94,8 +95,6 @@ class SessionEntityTypesTracingStub : public SessionEntityTypesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -110,4 +109,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSION_ENTITY_TYPES_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/sessions_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/sessions_auth_decorator.cc index e5d9c8b1dbdb0..6738840bfbc46 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/sessions_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/dialogflow/cx/v3/session.proto #include "google/cloud/dialogflow_cx/internal/sessions_auth_decorator.h" +#include "google/cloud/dialogflow/cx/v3/session.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -147,3 +150,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/sessions_auth_decorator.h b/google/cloud/dialogflow_cx/internal/sessions_auth_decorator.h index 14ed21263a431..f0176519886e5 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/sessions_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSIONS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/sessions_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/sessions_logging_decorator.cc index 7e2bf47261b8e..d8ae5ca707af1 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/sessions_logging_decorator.cc @@ -17,16 +17,19 @@ // source: google/cloud/dialogflow/cx/v3/session.proto #include "google/cloud/dialogflow_cx/internal/sessions_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/session.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -202,3 +205,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/sessions_logging_decorator.h b/google/cloud/dialogflow_cx/internal/sessions_logging_decorator.h index 2f87fba252897..6492c7a6ddbb6 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/sessions_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -105,4 +108,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/sessions_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/sessions_metadata_decorator.cc index e374054aa9478..d00ad0765e7b3 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/sessions_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/session.proto #include "google/cloud/dialogflow_cx/internal/sessions_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/session.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -165,3 +169,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/sessions_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/sessions_metadata_decorator.h index 2f54604fecce1..5c82abfb7cabc 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/sessions_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSIONS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/sessions_option_defaults.cc b/google/cloud/dialogflow_cx/internal/sessions_option_defaults.cc index 93b2b775da298..428d8903990ea 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/sessions_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/sessions_option_defaults.h" #include "google/cloud/dialogflow_cx/sessions_connection.h" #include "google/cloud/dialogflow_cx/sessions_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options SessionsDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dialogflow_cx::SessionsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dialogflow_cx::SessionsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/sessions_stub.cc b/google/cloud/dialogflow_cx/internal/sessions_stub.cc index af2c81bb4e383..665b1c373eacc 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_stub.cc +++ b/google/cloud/dialogflow_cx/internal/sessions_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/cx/v3/session.proto #include "google/cloud/dialogflow_cx/internal/sessions_stub.h" +#include "google/cloud/dialogflow/cx/v3/session.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -168,3 +171,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/sessions_stub.h b/google/cloud/dialogflow_cx/internal/sessions_stub.h index d83fcdc30edbd..d0c9f8672aec1 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_stub.h +++ b/google/cloud/dialogflow_cx/internal/sessions_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSIONS_STUB_H +#include "google/cloud/dialogflow/cx/v3/session.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -182,4 +185,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSIONS_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/sessions_stub_factory.cc b/google/cloud/dialogflow_cx/internal/sessions_stub_factory.cc index 2d66f32a3a41f..952b121527d59 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/sessions_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/session.proto #include "google/cloud/dialogflow_cx/internal/sessions_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/session.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/sessions_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/sessions_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/sessions_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/sessions_stub.h" #include "google/cloud/dialogflow_cx/internal/sessions_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/sessions_stub_factory.h b/google/cloud/dialogflow_cx/internal/sessions_stub_factory.h index 422a992e5dbdb..6495e5a5335d7 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/sessions_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSIONS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/sessions_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/sessions_tracing_connection.cc index f09aba810d24b..76a80afd3437b 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/sessions_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SessionsTracingConnection::SessionsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -136,16 +134,12 @@ Status SessionsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSessionsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/sessions_tracing_connection.h b/google/cloud/dialogflow_cx/internal/sessions_tracing_connection.h index e8b81e6e4d877..2ec11f1be56d4 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/sessions_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SessionsTracingConnection : public dialogflow_cx::SessionsConnection { public: ~SessionsTracingConnection() override = default; @@ -85,8 +83,6 @@ class SessionsTracingConnection : public dialogflow_cx::SessionsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/sessions_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/sessions_tracing_stub.cc index 0b77cc2e8f0fe..8a71ce2a75612 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/sessions_tracing_stub.cc @@ -23,13 +23,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SessionsTracingStub::SessionsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -172,18 +173,14 @@ Status SessionsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSessionsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/sessions_tracing_stub.h b/google/cloud/dialogflow_cx/internal/sessions_tracing_stub.h index 9df8634c2176d..c68c274542b6f 100644 --- a/google/cloud/dialogflow_cx/internal/sessions_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/sessions_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SessionsTracingStub : public SessionsStub { public: ~SessionsTracingStub() override = default; @@ -100,8 +101,6 @@ class SessionsTracingStub : public SessionsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -116,4 +115,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_SESSIONS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/test_cases_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/test_cases_auth_decorator.cc index 1f9981010aec7..432e83b6c8891 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/test_cases_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/test_case.proto #include "google/cloud/dialogflow_cx/internal/test_cases_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/test_case.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -302,3 +305,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/test_cases_auth_decorator.h b/google/cloud/dialogflow_cx/internal/test_cases_auth_decorator.h index d5216f19f5720..a41ffa1afd6a3 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/test_cases_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/test_cases_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -171,4 +174,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TEST_CASES_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/test_cases_connection_impl.h b/google/cloud/dialogflow_cx/internal/test_cases_connection_impl.h index 32661cc36ecd5..8192c7e3aec12 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_connection_impl.h +++ b/google/cloud/dialogflow_cx/internal/test_cases_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/internal/test_cases_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/test_cases_logging_decorator.cc index f103d19b0630a..313e36fdb6b71 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/test_cases_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/test_case.proto #include "google/cloud/dialogflow_cx/internal/test_cases_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/test_case.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -366,3 +369,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/test_cases_logging_decorator.h b/google/cloud/dialogflow_cx/internal/test_cases_logging_decorator.h index 883be0ff23d0f..a84d838181e9d 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/test_cases_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/test_cases_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -171,4 +174,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TEST_CASES_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/test_cases_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/test_cases_metadata_decorator.cc index 57578122bdd87..6adf0e114086b 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/test_cases_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/test_case.proto #include "google/cloud/dialogflow_cx/internal/test_cases_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/test_case.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -284,3 +288,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/test_cases_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/test_cases_metadata_decorator.h index 8ed1ba64d7c96..c44e2b6c01899 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/test_cases_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/test_cases_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -176,4 +179,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TEST_CASES_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/test_cases_option_defaults.cc b/google/cloud/dialogflow_cx/internal/test_cases_option_defaults.cc index 712af073f9ee6..506941ae54a77 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/test_cases_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/test_cases_option_defaults.h" #include "google/cloud/dialogflow_cx/test_cases_connection.h" #include "google/cloud/dialogflow_cx/test_cases_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options TestCasesDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dialogflow_cx::TestCasesLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dialogflow_cx::TestCasesLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/test_cases_stub.cc b/google/cloud/dialogflow_cx/internal/test_cases_stub.cc index 7cc653abdd904..4a726f29219a4 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_stub.cc +++ b/google/cloud/dialogflow_cx/internal/test_cases_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/cx/v3/test_case.proto #include "google/cloud/dialogflow_cx/internal/test_cases_stub.h" +#include "google/cloud/dialogflow/cx/v3/test_case.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -353,3 +356,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/test_cases_stub.h b/google/cloud/dialogflow_cx/internal/test_cases_stub.h index 4666e4eee91fc..42c2170d94173 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_stub.h +++ b/google/cloud/dialogflow_cx/internal/test_cases_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TEST_CASES_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TEST_CASES_STUB_H +#include "google/cloud/dialogflow/cx/v3/test_case.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -313,4 +316,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TEST_CASES_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/test_cases_stub_factory.cc b/google/cloud/dialogflow_cx/internal/test_cases_stub_factory.cc index 0bc3ca4878bf6..1370103f31a5a 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/test_cases_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/test_case.proto #include "google/cloud/dialogflow_cx/internal/test_cases_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/test_case.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/test_cases_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/test_cases_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/test_cases_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/test_cases_stub.h" #include "google/cloud/dialogflow_cx/internal/test_cases_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/test_cases_stub_factory.h b/google/cloud/dialogflow_cx/internal/test_cases_stub_factory.h index 3cb94b872b41f..35280159bda06 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/test_cases_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TEST_CASES_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/test_cases_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/test_cases_tracing_connection.cc index a9ed9c69fee3a..183aff5246fd0 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/test_cases_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TestCasesTracingConnection::TestCasesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -279,16 +277,12 @@ Status TestCasesTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTestCasesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/test_cases_tracing_connection.h b/google/cloud/dialogflow_cx/internal/test_cases_tracing_connection.h index 2568d3ab2fb01..1ff1e3b91e2dd 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/test_cases_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TestCasesTracingConnection : public dialogflow_cx::TestCasesConnection { public: ~TestCasesTracingConnection() override = default; @@ -142,8 +140,6 @@ class TestCasesTracingConnection : public dialogflow_cx::TestCasesConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/test_cases_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/test_cases_tracing_stub.cc index 2393b4bdad6e8..f9e5cf3a092a4 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/test_cases_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TestCasesTracingStub::TestCasesTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -321,18 +322,14 @@ future TestCasesTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTestCasesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/test_cases_tracing_stub.h b/google/cloud/dialogflow_cx/internal/test_cases_tracing_stub.h index d6a12429b5af4..504d8284eab31 100644 --- a/google/cloud/dialogflow_cx/internal/test_cases_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/test_cases_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TestCasesTracingStub : public TestCasesStub { public: ~TestCasesTracingStub() override = default; @@ -166,8 +167,6 @@ class TestCasesTracingStub : public TestCasesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -182,4 +181,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TEST_CASES_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/transition_route_groups_auth_decorator.cc index 7f585279ab85c..1ef147d8b8f4f 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/transition_route_group.proto #include "google/cloud/dialogflow_cx/internal/transition_route_groups_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/transition_route_group.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -128,3 +131,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_auth_decorator.h b/google/cloud/dialogflow_cx/internal/transition_route_groups_auth_decorator.h index 3f895483e22f6..b527e1bb6c417 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TRANSITION_ROUTE_GROUPS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/transition_route_groups_logging_decorator.cc index 6280787768d5b..6e892e7599f89 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/transition_route_group.proto #include "google/cloud/dialogflow_cx/internal/transition_route_groups_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/transition_route_group.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -167,3 +170,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_logging_decorator.h b/google/cloud/dialogflow_cx/internal/transition_route_groups_logging_decorator.h index 6750dd2221478..9d66af7f4417b 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TRANSITION_ROUTE_GROUPS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/transition_route_groups_metadata_decorator.cc index efcd5c33634a6..9cf725dff6199 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/transition_route_group.proto #include "google/cloud/dialogflow_cx/internal/transition_route_groups_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/transition_route_group.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -156,3 +160,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/transition_route_groups_metadata_decorator.h index d0d3bc69a6bd5..0ed4db3a0675b 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TRANSITION_ROUTE_GROUPS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_option_defaults.cc b/google/cloud/dialogflow_cx/internal/transition_route_groups_option_defaults.cc index 7d39da29b9952..5d4976d86b9e1 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/transition_route_groups_option_defaults.h" #include "google/cloud/dialogflow_cx/transition_route_groups_connection.h" #include "google/cloud/dialogflow_cx/transition_route_groups_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options TransitionRouteGroupsDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_cx::TransitionRouteGroupsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_stub.cc b/google/cloud/dialogflow_cx/internal/transition_route_groups_stub.cc index 3339652de96b5..51b6014ffd946 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_stub.cc +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/cx/v3/transition_route_group.proto #include "google/cloud/dialogflow_cx/internal/transition_route_groups_stub.h" +#include "google/cloud/dialogflow/cx/v3/transition_route_group.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -162,3 +165,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_stub.h b/google/cloud/dialogflow_cx/internal/transition_route_groups_stub.h index f9ec1278c2c1d..715d787ba4c03 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_stub.h +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TRANSITION_ROUTE_GROUPS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TRANSITION_ROUTE_GROUPS_STUB_H +#include "google/cloud/dialogflow/cx/v3/transition_route_group.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -167,4 +170,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TRANSITION_ROUTE_GROUPS_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_stub_factory.cc b/google/cloud/dialogflow_cx/internal/transition_route_groups_stub_factory.cc index 62e3e5e34e814..dd4e01a7c9c6b 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/transition_route_group.proto #include "google/cloud/dialogflow_cx/internal/transition_route_groups_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/transition_route_group.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/transition_route_groups_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/transition_route_groups_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/transition_route_groups_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/transition_route_groups_stub.h" #include "google/cloud/dialogflow_cx/internal/transition_route_groups_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_stub_factory.h b/google/cloud/dialogflow_cx/internal/transition_route_groups_stub_factory.h index 97a74117adf92..d221b002b1c33 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TRANSITION_ROUTE_GROUPS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_connection.cc index cff83eaba9f6c..801da52381797 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TransitionRouteGroupsTracingConnection::TransitionRouteGroupsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -138,17 +136,13 @@ Status TransitionRouteGroupsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTransitionRouteGroupsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_connection.h b/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_connection.h index 07bc2a4b3036e..68d6841e0f394 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TransitionRouteGroupsTracingConnection : public dialogflow_cx::TransitionRouteGroupsConnection { public: @@ -83,8 +81,6 @@ class TransitionRouteGroupsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_stub.cc index d4b31dc216e2c..4058600462e18 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TransitionRouteGroupsTracingStub::TransitionRouteGroupsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -165,18 +166,14 @@ Status TransitionRouteGroupsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTransitionRouteGroupsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_stub.h b/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_stub.h index 14d9fe781cb9d..fa0920e71f5db 100644 --- a/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/transition_route_groups_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TransitionRouteGroupsTracingStub : public TransitionRouteGroupsStub { public: ~TransitionRouteGroupsTracingStub() override = default; @@ -94,8 +95,6 @@ class TransitionRouteGroupsTracingStub : public TransitionRouteGroupsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -110,4 +109,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_TRANSITION_ROUTE_GROUPS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/versions_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/versions_auth_decorator.cc index 8d0a07a2b3f4b..a3b27e389c44a 100644 --- a/google/cloud/dialogflow_cx/internal/versions_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/versions_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/version.proto #include "google/cloud/dialogflow_cx/internal/versions_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/version.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -211,3 +214,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/versions_auth_decorator.h b/google/cloud/dialogflow_cx/internal/versions_auth_decorator.h index 2bda16edea3cb..835567c22f16f 100644 --- a/google/cloud/dialogflow_cx/internal/versions_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/versions_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/versions_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -131,4 +134,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_VERSIONS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/versions_connection_impl.h b/google/cloud/dialogflow_cx/internal/versions_connection_impl.h index 776fe5ba812bd..92400a4361253 100644 --- a/google/cloud/dialogflow_cx/internal/versions_connection_impl.h +++ b/google/cloud/dialogflow_cx/internal/versions_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/internal/versions_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/versions_logging_decorator.cc index 2e22558caa989..090e4fd9643a4 100644 --- a/google/cloud/dialogflow_cx/internal/versions_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/versions_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/version.proto #include "google/cloud/dialogflow_cx/internal/versions_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/version.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -257,3 +260,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/versions_logging_decorator.h b/google/cloud/dialogflow_cx/internal/versions_logging_decorator.h index 167ef0917c36a..0246b1fd8356c 100644 --- a/google/cloud/dialogflow_cx/internal/versions_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/versions_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/versions_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -131,4 +134,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_VERSIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/versions_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/versions_metadata_decorator.cc index 955105677eb06..b9a52618f5fb2 100644 --- a/google/cloud/dialogflow_cx/internal/versions_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/versions_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/version.proto #include "google/cloud/dialogflow_cx/internal/versions_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/version.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -212,3 +216,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/versions_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/versions_metadata_decorator.h index 338a8579588a7..b246d5fb136e2 100644 --- a/google/cloud/dialogflow_cx/internal/versions_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/versions_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_cx/internal/versions_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_cx_internal { @@ -136,4 +139,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_VERSIONS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/versions_option_defaults.cc b/google/cloud/dialogflow_cx/internal/versions_option_defaults.cc index 8973a99bab94a..283348d07da97 100644 --- a/google/cloud/dialogflow_cx/internal/versions_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/versions_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/versions_option_defaults.h" #include "google/cloud/dialogflow_cx/versions_connection.h" #include "google/cloud/dialogflow_cx/versions_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options VersionsDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dialogflow_cx::VersionsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dialogflow_cx::VersionsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/versions_stub.cc b/google/cloud/dialogflow_cx/internal/versions_stub.cc index 442ebb64bf6a1..cc625ef3feb9f 100644 --- a/google/cloud/dialogflow_cx/internal/versions_stub.cc +++ b/google/cloud/dialogflow_cx/internal/versions_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/cx/v3/version.proto #include "google/cloud/dialogflow_cx/internal/versions_stub.h" +#include "google/cloud/dialogflow/cx/v3/version.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -250,3 +253,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/versions_stub.h b/google/cloud/dialogflow_cx/internal/versions_stub.h index b5b3d202cc9fc..4b14a75b588dd 100644 --- a/google/cloud/dialogflow_cx/internal/versions_stub.h +++ b/google/cloud/dialogflow_cx/internal/versions_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_VERSIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_VERSIONS_STUB_H +#include "google/cloud/dialogflow/cx/v3/version.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 -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/protobuf/struct.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -231,4 +234,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_VERSIONS_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/versions_stub_factory.cc b/google/cloud/dialogflow_cx/internal/versions_stub_factory.cc index 900ac939e0b0b..64586b98ea548 100644 --- a/google/cloud/dialogflow_cx/internal/versions_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/versions_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/version.proto #include "google/cloud/dialogflow_cx/internal/versions_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/version.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/versions_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/versions_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/versions_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/versions_stub.h" #include "google/cloud/dialogflow_cx/internal/versions_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/versions_stub_factory.h b/google/cloud/dialogflow_cx/internal/versions_stub_factory.h index 27496ff8e59c0..d920215a984b3 100644 --- a/google/cloud/dialogflow_cx/internal/versions_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/versions_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_VERSIONS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/versions_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/versions_tracing_connection.cc index 882cd39d84753..654cc840eae83 100644 --- a/google/cloud/dialogflow_cx/internal/versions_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/versions_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VersionsTracingConnection::VersionsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -183,16 +181,12 @@ Status VersionsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVersionsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/versions_tracing_connection.h b/google/cloud/dialogflow_cx/internal/versions_tracing_connection.h index 691ca1ab1a87e..ad6e9c5bf5cf1 100644 --- a/google/cloud/dialogflow_cx/internal/versions_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/versions_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VersionsTracingConnection : public dialogflow_cx::VersionsConnection { public: ~VersionsTracingConnection() override = default; @@ -102,8 +100,6 @@ class VersionsTracingConnection : public dialogflow_cx::VersionsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/versions_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/versions_tracing_stub.cc index 425fa673543ff..cce59139ae771 100644 --- a/google/cloud/dialogflow_cx/internal/versions_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/versions_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VersionsTracingStub::VersionsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -225,18 +226,14 @@ future VersionsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVersionsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/versions_tracing_stub.h b/google/cloud/dialogflow_cx/internal/versions_tracing_stub.h index e03112a2207ba..aeb6666eb26e2 100644 --- a/google/cloud/dialogflow_cx/internal/versions_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/versions_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VersionsTracingStub : public VersionsStub { public: ~VersionsTracingStub() override = default; @@ -126,8 +127,6 @@ class VersionsTracingStub : public VersionsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -142,4 +141,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_VERSIONS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/webhooks_auth_decorator.cc b/google/cloud/dialogflow_cx/internal/webhooks_auth_decorator.cc index 9272dbd8ed069..1c47ca68bd6e5 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_auth_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/webhooks_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/cx/v3/webhook.proto #include "google/cloud/dialogflow_cx/internal/webhooks_auth_decorator.h" -#include +#include "google/cloud/dialogflow/cx/v3/webhook.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -120,3 +123,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/webhooks_auth_decorator.h b/google/cloud/dialogflow_cx/internal/webhooks_auth_decorator.h index 3690d2ac9c546..59e6f55da9413 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_auth_decorator.h +++ b/google/cloud/dialogflow_cx/internal/webhooks_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -93,4 +96,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_WEBHOOKS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/webhooks_logging_decorator.cc b/google/cloud/dialogflow_cx/internal/webhooks_logging_decorator.cc index 8f2c07d392975..f7c62136dbb43 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_logging_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/webhooks_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/cx/v3/webhook.proto #include "google/cloud/dialogflow_cx/internal/webhooks_logging_decorator.h" +#include "google/cloud/dialogflow/cx/v3/webhook.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -160,3 +163,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/webhooks_logging_decorator.h b/google/cloud/dialogflow_cx/internal/webhooks_logging_decorator.h index cbd0f5f40a30c..13b9239576a83 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_logging_decorator.h +++ b/google/cloud/dialogflow_cx/internal/webhooks_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -93,4 +96,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_WEBHOOKS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/webhooks_metadata_decorator.cc b/google/cloud/dialogflow_cx/internal/webhooks_metadata_decorator.cc index d8495d3445acb..a4872bc34a172 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_metadata_decorator.cc +++ b/google/cloud/dialogflow_cx/internal/webhooks_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/cx/v3/webhook.proto #include "google/cloud/dialogflow_cx/internal/webhooks_metadata_decorator.h" +#include "google/cloud/dialogflow/cx/v3/webhook.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_cx_internal { @@ -148,3 +152,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/webhooks_metadata_decorator.h b/google/cloud/dialogflow_cx/internal/webhooks_metadata_decorator.h index f0d96236c9f93..e3d3a9c6c670c 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_metadata_decorator.h +++ b/google/cloud/dialogflow_cx/internal/webhooks_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -98,4 +101,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_WEBHOOKS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_cx/internal/webhooks_option_defaults.cc b/google/cloud/dialogflow_cx/internal/webhooks_option_defaults.cc index 204f4c8a3d9c6..8fffc8ea1c3b4 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_option_defaults.cc +++ b/google/cloud/dialogflow_cx/internal/webhooks_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_cx/internal/webhooks_option_defaults.h" #include "google/cloud/dialogflow_cx/webhooks_connection.h" #include "google/cloud/dialogflow_cx/webhooks_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options WebhooksDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dialogflow_cx::WebhooksLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dialogflow_cx::WebhooksLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_cx/internal/webhooks_stub.cc b/google/cloud/dialogflow_cx/internal/webhooks_stub.cc index ce4efa306c110..cb67d8b9ee3cd 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_stub.cc +++ b/google/cloud/dialogflow_cx/internal/webhooks_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/cx/v3/webhook.proto #include "google/cloud/dialogflow_cx/internal/webhooks_stub.h" +#include "google/cloud/dialogflow/cx/v3/webhook.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -150,3 +153,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/webhooks_stub.h b/google/cloud/dialogflow_cx/internal/webhooks_stub.h index 54669df1256e5..0a3236db84b6a 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_stub.h +++ b/google/cloud/dialogflow_cx/internal/webhooks_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_WEBHOOKS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_WEBHOOKS_STUB_H +#include "google/cloud/dialogflow/cx/v3/webhook.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -156,4 +159,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_WEBHOOKS_STUB_H diff --git a/google/cloud/dialogflow_cx/internal/webhooks_stub_factory.cc b/google/cloud/dialogflow_cx/internal/webhooks_stub_factory.cc index aa6627b1aff05..8ea9f74b537c2 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_stub_factory.cc +++ b/google/cloud/dialogflow_cx/internal/webhooks_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/cx/v3/webhook.proto #include "google/cloud/dialogflow_cx/internal/webhooks_stub_factory.h" +#include "google/cloud/dialogflow/cx/v3/webhook.grpc.pb.h" #include "google/cloud/dialogflow_cx/internal/webhooks_auth_decorator.h" #include "google/cloud/dialogflow_cx/internal/webhooks_logging_decorator.h" #include "google/cloud/dialogflow_cx/internal/webhooks_metadata_decorator.h" #include "google/cloud/dialogflow_cx/internal/webhooks_stub.h" #include "google/cloud/dialogflow_cx/internal/webhooks_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/webhooks_stub_factory.h b/google/cloud/dialogflow_cx/internal/webhooks_stub_factory.h index 4fd8a6fb431b1..0ec33e30512ad 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_stub_factory.h +++ b/google/cloud/dialogflow_cx/internal/webhooks_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_WEBHOOKS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_cx/internal/webhooks_tracing_connection.cc b/google/cloud/dialogflow_cx/internal/webhooks_tracing_connection.cc index 078b02d68cb93..3fba25769349b 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_tracing_connection.cc +++ b/google/cloud/dialogflow_cx/internal/webhooks_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - WebhooksTracingConnection::WebhooksTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -128,16 +126,12 @@ Status WebhooksTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeWebhooksTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_cx/internal/webhooks_tracing_connection.h b/google/cloud/dialogflow_cx/internal/webhooks_tracing_connection.h index c2c3e6851bed1..5c3560e87253d 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_tracing_connection.h +++ b/google/cloud/dialogflow_cx/internal/webhooks_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class WebhooksTracingConnection : public dialogflow_cx::WebhooksConnection { public: ~WebhooksTracingConnection() override = default; @@ -77,8 +75,6 @@ class WebhooksTracingConnection : public dialogflow_cx::WebhooksConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_cx/internal/webhooks_tracing_stub.cc b/google/cloud/dialogflow_cx/internal/webhooks_tracing_stub.cc index f1a64d8b68bfb..ccdf373832025 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_tracing_stub.cc +++ b/google/cloud/dialogflow_cx/internal/webhooks_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - WebhooksTracingStub::WebhooksTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -147,18 +148,14 @@ Status WebhooksTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeWebhooksTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_cx_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_cx/internal/webhooks_tracing_stub.h b/google/cloud/dialogflow_cx/internal/webhooks_tracing_stub.h index 6a31da520bfcb..767073ac4f570 100644 --- a/google/cloud/dialogflow_cx/internal/webhooks_tracing_stub.h +++ b/google/cloud/dialogflow_cx/internal/webhooks_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_cx_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class WebhooksTracingStub : public WebhooksStub { public: ~WebhooksTracingStub() override = default; @@ -89,8 +90,6 @@ class WebhooksTracingStub : public WebhooksStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -105,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_INTERNAL_WEBHOOKS_TRACING_STUB_H 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/pages_connection.h b/google/cloud/dialogflow_cx/pages_connection.h index ba69f6c944709..2ad6bd33d9c57 100644 --- a/google/cloud/dialogflow_cx/pages_connection.h +++ b/google/cloud/dialogflow_cx/pages_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_PAGES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_PAGES_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/page.pb.h" #include "google/cloud/dialogflow_cx/internal/pages_retry_traits.h" #include "google/cloud/dialogflow_cx/pages_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_cx/pages_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/pages_connection_idempotency_policy.h index 54133958ec11c..fbcbff1308106 100644 --- a/google/cloud/dialogflow_cx/pages_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/pages_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_PAGES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_PAGES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/page.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/quickstart/.bazelrc b/google/cloud/dialogflow_cx/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/dialogflow_cx/quickstart/.bazelrc +++ b/google/cloud/dialogflow_cx/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/dialogflow_cx/quickstart/CMakeLists.txt index 8782e8b34f7e9..f497064f3b92b 100644 --- a/google/cloud/dialogflow_cx/quickstart/CMakeLists.txt +++ b/google/cloud/dialogflow_cx/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Dialogflow API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-dialogflow_cx-quickstart CXX) find_package(google_cloud_cpp_dialogflow_cx REQUIRED) diff --git a/google/cloud/dialogflow_cx/quickstart/WORKSPACE.bazel b/google/cloud/dialogflow_cx/quickstart/WORKSPACE.bazel index f04ac4449aee4..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 = "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/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/security_settings_connection.h b/google/cloud/dialogflow_cx/security_settings_connection.h index 1db1e120e3f61..c4e63ac5df60f 100644 --- a/google/cloud/dialogflow_cx/security_settings_connection.h +++ b/google/cloud/dialogflow_cx/security_settings_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SECURITY_SETTINGS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SECURITY_SETTINGS_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/security_settings.pb.h" #include "google/cloud/dialogflow_cx/internal/security_settings_retry_traits.h" #include "google/cloud/dialogflow_cx/security_settings_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_cx/security_settings_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/security_settings_connection_idempotency_policy.h index 8625fd8c1f072..032f1a8f7790e 100644 --- a/google/cloud/dialogflow_cx/security_settings_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/security_settings_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SECURITY_SETTINGS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SECURITY_SETTINGS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/security_settings.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/session_entity_types_connection.h b/google/cloud/dialogflow_cx/session_entity_types_connection.h index c5e885ff37970..e6b19ec426079 100644 --- a/google/cloud/dialogflow_cx/session_entity_types_connection.h +++ b/google/cloud/dialogflow_cx/session_entity_types_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SESSION_ENTITY_TYPES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SESSION_ENTITY_TYPES_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/session_entity_type.pb.h" #include "google/cloud/dialogflow_cx/internal/session_entity_types_retry_traits.h" #include "google/cloud/dialogflow_cx/session_entity_types_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_cx/session_entity_types_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/session_entity_types_connection_idempotency_policy.h index 0ecdf38336c8b..694c6802227f6 100644 --- a/google/cloud/dialogflow_cx/session_entity_types_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/session_entity_types_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SESSION_ENTITY_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SESSION_ENTITY_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/session_entity_type.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/sessions_connection.h b/google/cloud/dialogflow_cx/sessions_connection.h index 69767c2305b09..3d84d8a2fe208 100644 --- a/google/cloud/dialogflow_cx/sessions_connection.h +++ b/google/cloud/dialogflow_cx/sessions_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SESSIONS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SESSIONS_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/session.pb.h" #include "google/cloud/dialogflow_cx/internal/sessions_retry_traits.h" #include "google/cloud/dialogflow_cx/sessions_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -28,7 +29,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_cx/sessions_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/sessions_connection_idempotency_policy.h index 018abe47b3c81..84619b4463918 100644 --- a/google/cloud/dialogflow_cx/sessions_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/sessions_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SESSIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SESSIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/session.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/test_cases_client.h b/google/cloud/dialogflow_cx/test_cases_client.h index 29d3fc99542a7..43edc1bb5e55d 100644 --- a/google/cloud/dialogflow_cx/test_cases_client.h +++ b/google/cloud/dialogflow_cx/test_cases_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/test_cases_connection.h b/google/cloud/dialogflow_cx/test_cases_connection.h index 03b2b58d8e5dd..21921a3be243c 100644 --- a/google/cloud/dialogflow_cx/test_cases_connection.h +++ b/google/cloud/dialogflow_cx/test_cases_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_TEST_CASES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_TEST_CASES_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/test_case.pb.h" #include "google/cloud/dialogflow_cx/internal/test_cases_retry_traits.h" #include "google/cloud/dialogflow_cx/test_cases_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/dialogflow_cx/test_cases_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/test_cases_connection_idempotency_policy.h index 58a00f42b2dc3..2c065c52edfe1 100644 --- a/google/cloud/dialogflow_cx/test_cases_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/test_cases_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_TEST_CASES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_TEST_CASES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/test_case.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/transition_route_groups_connection.h b/google/cloud/dialogflow_cx/transition_route_groups_connection.h index 59649117d382d..3cad847992f72 100644 --- a/google/cloud/dialogflow_cx/transition_route_groups_connection.h +++ b/google/cloud/dialogflow_cx/transition_route_groups_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_TRANSITION_ROUTE_GROUPS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_TRANSITION_ROUTE_GROUPS_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/transition_route_group.pb.h" #include "google/cloud/dialogflow_cx/internal/transition_route_groups_retry_traits.h" #include "google/cloud/dialogflow_cx/transition_route_groups_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_cx/transition_route_groups_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/transition_route_groups_connection_idempotency_policy.h index 267f3b226ec66..4dcd54a51e2b0 100644 --- a/google/cloud/dialogflow_cx/transition_route_groups_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/transition_route_groups_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_TRANSITION_ROUTE_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_TRANSITION_ROUTE_GROUPS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/transition_route_group.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_cx/versions_client.h b/google/cloud/dialogflow_cx/versions_client.h index 30fff3002664b..2499019f674bb 100644 --- a/google/cloud/dialogflow_cx/versions_client.h +++ b/google/cloud/dialogflow_cx/versions_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/versions_connection.h b/google/cloud/dialogflow_cx/versions_connection.h index 13f2cc295e699..a320bab2ca436 100644 --- a/google/cloud/dialogflow_cx/versions_connection.h +++ b/google/cloud/dialogflow_cx/versions_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_VERSIONS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_VERSIONS_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/version.pb.h" #include "google/cloud/dialogflow_cx/internal/versions_retry_traits.h" #include "google/cloud/dialogflow_cx/versions_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -30,9 +31,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/protobuf/struct.pb.h" #include #include diff --git a/google/cloud/dialogflow_cx/versions_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/versions_connection_idempotency_policy.h index 7dacaff9f166a..8469f13376ded 100644 --- a/google/cloud/dialogflow_cx/versions_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/versions_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_VERSIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_VERSIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/version.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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_cx/webhooks_connection.h b/google/cloud/dialogflow_cx/webhooks_connection.h index 656e5de808058..c8a35ac3e9ab8 100644 --- a/google/cloud/dialogflow_cx/webhooks_connection.h +++ b/google/cloud/dialogflow_cx/webhooks_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_WEBHOOKS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_WEBHOOKS_CONNECTION_H +#include "google/cloud/dialogflow/cx/v3/webhook.pb.h" #include "google/cloud/dialogflow_cx/internal/webhooks_retry_traits.h" #include "google/cloud/dialogflow_cx/webhooks_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_cx/webhooks_connection_idempotency_policy.h b/google/cloud/dialogflow_cx/webhooks_connection_idempotency_policy.h index 9f131147cf944..8c6b7b9fe2a0f 100644 --- a/google/cloud/dialogflow_cx/webhooks_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_cx/webhooks_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_WEBHOOKS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_WEBHOOKS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/cx/v3/webhook.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/BUILD.bazel b/google/cloud/dialogflow_es/BUILD.bazel index 891db088da2ec..34b4e49287673 100644 --- a/google/cloud/dialogflow_es/BUILD.bazel +++ b/google/cloud/dialogflow_es/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = [""] googleapis_deps = [ - "@com_google_googleapis//google/cloud/dialogflow/v2:dialogflow_cc_grpc", + "@googleapis//google/cloud/dialogflow/v2:dialogflow_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/dialogflow_es/agents_client.h b/google/cloud/dialogflow_es/agents_client.h index bd176d10d8590..8a74749fe1d68 100644 --- a/google/cloud/dialogflow_es/agents_client.h +++ b/google/cloud/dialogflow_es/agents_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/agents_connection.h b/google/cloud/dialogflow_es/agents_connection.h index 75a34a8e493f7..65562a4d17597 100644 --- a/google/cloud/dialogflow_es/agents_connection.h +++ b/google/cloud/dialogflow_es/agents_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_AGENTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_AGENTS_CONNECTION_H +#include "google/cloud/dialogflow/v2/agent.pb.h" #include "google/cloud/dialogflow_es/agents_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/internal/agents_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,9 +31,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/protobuf/struct.pb.h" #include #include diff --git a/google/cloud/dialogflow_es/agents_connection_idempotency_policy.h b/google/cloud/dialogflow_es/agents_connection_idempotency_policy.h index b1a59cd22b0e0..cab4320727978 100644 --- a/google/cloud/dialogflow_es/agents_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/agents_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_AGENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_AGENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/agent.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/answer_records_connection.h b/google/cloud/dialogflow_es/answer_records_connection.h index 0420e3ccca703..b0cc19b818d78 100644 --- a/google/cloud/dialogflow_es/answer_records_connection.h +++ b/google/cloud/dialogflow_es/answer_records_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ANSWER_RECORDS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ANSWER_RECORDS_CONNECTION_H +#include "google/cloud/dialogflow/v2/answer_record.pb.h" #include "google/cloud/dialogflow_es/answer_records_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/internal/answer_records_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_es/answer_records_connection_idempotency_policy.h b/google/cloud/dialogflow_es/answer_records_connection_idempotency_policy.h index 058e1eabb5859..c22be1c8a22a0 100644 --- a/google/cloud/dialogflow_es/answer_records_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/answer_records_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ANSWER_RECORDS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ANSWER_RECORDS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/answer_record.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/contexts_connection.h b/google/cloud/dialogflow_es/contexts_connection.h index 24cbc38c4016c..c6680cd1609d6 100644 --- a/google/cloud/dialogflow_es/contexts_connection.h +++ b/google/cloud/dialogflow_es/contexts_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONTEXTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONTEXTS_CONNECTION_H +#include "google/cloud/dialogflow/v2/context.pb.h" #include "google/cloud/dialogflow_es/contexts_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/internal/contexts_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_es/contexts_connection_idempotency_policy.h b/google/cloud/dialogflow_es/contexts_connection_idempotency_policy.h index 5c32a64cce4e7..553ab1448cf18 100644 --- a/google/cloud/dialogflow_es/contexts_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/contexts_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONTEXTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONTEXTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/context.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/conversation_datasets_client.h b/google/cloud/dialogflow_es/conversation_datasets_client.h index a161a65f4db22..99d528b52707e 100644 --- a/google/cloud/dialogflow_es/conversation_datasets_client.h +++ b/google/cloud/dialogflow_es/conversation_datasets_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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_datasets_connection.h b/google/cloud/dialogflow_es/conversation_datasets_connection.h index fa99430519956..44da840ab5869 100644 --- a/google/cloud/dialogflow_es/conversation_datasets_connection.h +++ b/google/cloud/dialogflow_es/conversation_datasets_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATION_DATASETS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATION_DATASETS_CONNECTION_H +#include "google/cloud/dialogflow/v2/conversation_dataset.pb.h" #include "google/cloud/dialogflow_es/conversation_datasets_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/internal/conversation_datasets_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/dialogflow_es/conversation_datasets_connection_idempotency_policy.h b/google/cloud/dialogflow_es/conversation_datasets_connection_idempotency_policy.h index 91f66c445a335..c46074ddb5dd0 100644 --- a/google/cloud/dialogflow_es/conversation_datasets_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/conversation_datasets_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATION_DATASETS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATION_DATASETS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/conversation_dataset.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/conversation_models_client.h b/google/cloud/dialogflow_es/conversation_models_client.h index c5ce44040cbb0..fb6ce048d935e 100644 --- a/google/cloud/dialogflow_es/conversation_models_client.h +++ b/google/cloud/dialogflow_es/conversation_models_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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_models_connection.h b/google/cloud/dialogflow_es/conversation_models_connection.h index 8bda5ccaab45c..235a784048f7f 100644 --- a/google/cloud/dialogflow_es/conversation_models_connection.h +++ b/google/cloud/dialogflow_es/conversation_models_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATION_MODELS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATION_MODELS_CONNECTION_H +#include "google/cloud/dialogflow/v2/conversation_model.pb.h" #include "google/cloud/dialogflow_es/conversation_models_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/internal/conversation_models_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/dialogflow_es/conversation_models_connection_idempotency_policy.h b/google/cloud/dialogflow_es/conversation_models_connection_idempotency_policy.h index b6a90141cfa1c..4eec02306292f 100644 --- a/google/cloud/dialogflow_es/conversation_models_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/conversation_models_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATION_MODELS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATION_MODELS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/conversation_model.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/conversation_profiles_client.h b/google/cloud/dialogflow_es/conversation_profiles_client.h index 5ce2fec49ad32..e9bd0232a333b 100644 --- a/google/cloud/dialogflow_es/conversation_profiles_client.h +++ b/google/cloud/dialogflow_es/conversation_profiles_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/conversation_profiles_connection.h b/google/cloud/dialogflow_es/conversation_profiles_connection.h index 75eafc20599f0..fb6f9ded7f156 100644 --- a/google/cloud/dialogflow_es/conversation_profiles_connection.h +++ b/google/cloud/dialogflow_es/conversation_profiles_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATION_PROFILES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATION_PROFILES_CONNECTION_H +#include "google/cloud/dialogflow/v2/conversation_profile.pb.h" #include "google/cloud/dialogflow_es/conversation_profiles_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/internal/conversation_profiles_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/dialogflow_es/conversation_profiles_connection_idempotency_policy.h b/google/cloud/dialogflow_es/conversation_profiles_connection_idempotency_policy.h index 613836222d388..c845e528171dc 100644 --- a/google/cloud/dialogflow_es/conversation_profiles_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/conversation_profiles_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATION_PROFILES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATION_PROFILES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/conversation_profile.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/conversations_connection.h b/google/cloud/dialogflow_es/conversations_connection.h index c84b7ed7cd744..d1109cc6fc705 100644 --- a/google/cloud/dialogflow_es/conversations_connection.h +++ b/google/cloud/dialogflow_es/conversations_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATIONS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATIONS_CONNECTION_H +#include "google/cloud/dialogflow/v2/conversation.pb.h" #include "google/cloud/dialogflow_es/conversations_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/internal/conversations_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_es/conversations_connection_idempotency_policy.h b/google/cloud/dialogflow_es/conversations_connection_idempotency_policy.h index ff63bfbde9d6d..783d6bb089192 100644 --- a/google/cloud/dialogflow_es/conversations_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/conversations_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_CONVERSATIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/conversation.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/documents_client.h b/google/cloud/dialogflow_es/documents_client.h index 97f9b8229e036..1e258f256ce42 100644 --- a/google/cloud/dialogflow_es/documents_client.h +++ b/google/cloud/dialogflow_es/documents_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/documents_connection.h b/google/cloud/dialogflow_es/documents_connection.h index 4fea6e998b960..006915733738d 100644 --- a/google/cloud/dialogflow_es/documents_connection.h +++ b/google/cloud/dialogflow_es/documents_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_DOCUMENTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_DOCUMENTS_CONNECTION_H +#include "google/cloud/dialogflow/v2/document.pb.h" #include "google/cloud/dialogflow_es/documents_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/internal/documents_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/dialogflow_es/documents_connection_idempotency_policy.h b/google/cloud/dialogflow_es/documents_connection_idempotency_policy.h index df6e2052946c9..088840d2da999 100644 --- a/google/cloud/dialogflow_es/documents_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/documents_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_DOCUMENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_DOCUMENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/document.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/encryption_spec_client.h b/google/cloud/dialogflow_es/encryption_spec_client.h index d663cb64de21b..6bb45f445bc35 100644 --- a/google/cloud/dialogflow_es/encryption_spec_client.h +++ b/google/cloud/dialogflow_es/encryption_spec_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/encryption_spec_connection.h b/google/cloud/dialogflow_es/encryption_spec_connection.h index 244c0b4851dc4..90a0acb0dd526 100644 --- a/google/cloud/dialogflow_es/encryption_spec_connection.h +++ b/google/cloud/dialogflow_es/encryption_spec_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ENCRYPTION_SPEC_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ENCRYPTION_SPEC_CONNECTION_H +#include "google/cloud/dialogflow/v2/encryption_spec.pb.h" #include "google/cloud/dialogflow_es/encryption_spec_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/internal/encryption_spec_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/dialogflow_es/encryption_spec_connection_idempotency_policy.h b/google/cloud/dialogflow_es/encryption_spec_connection_idempotency_policy.h index 4cf9115040e4b..a7a79ff2e975c 100644 --- a/google/cloud/dialogflow_es/encryption_spec_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/encryption_spec_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ENCRYPTION_SPEC_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ENCRYPTION_SPEC_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/encryption_spec.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/entity_types_client.h b/google/cloud/dialogflow_es/entity_types_client.h index a59cdaaff8a98..ae0fe2e3e0118 100644 --- a/google/cloud/dialogflow_es/entity_types_client.h +++ b/google/cloud/dialogflow_es/entity_types_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/entity_types_connection.h b/google/cloud/dialogflow_es/entity_types_connection.h index b44c5b2393efa..7722b2a9bcd47 100644 --- a/google/cloud/dialogflow_es/entity_types_connection.h +++ b/google/cloud/dialogflow_es/entity_types_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ENTITY_TYPES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ENTITY_TYPES_CONNECTION_H +#include "google/cloud/dialogflow/v2/entity_type.pb.h" #include "google/cloud/dialogflow_es/entity_types_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/internal/entity_types_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,9 +31,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/protobuf/struct.pb.h" #include #include diff --git a/google/cloud/dialogflow_es/entity_types_connection_idempotency_policy.h b/google/cloud/dialogflow_es/entity_types_connection_idempotency_policy.h index 7e896ea74d661..e47ee45d1eb87 100644 --- a/google/cloud/dialogflow_es/entity_types_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/entity_types_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ENTITY_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ENTITY_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/entity_type.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/environments_connection.h b/google/cloud/dialogflow_es/environments_connection.h index 7a2c937b529de..1b0c84690e5e2 100644 --- a/google/cloud/dialogflow_es/environments_connection.h +++ b/google/cloud/dialogflow_es/environments_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ENVIRONMENTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ENVIRONMENTS_CONNECTION_H +#include "google/cloud/dialogflow/v2/environment.pb.h" #include "google/cloud/dialogflow_es/environments_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/internal/environments_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_es/environments_connection_idempotency_policy.h b/google/cloud/dialogflow_es/environments_connection_idempotency_policy.h index 5ce5ef5ac37d4..1b7a5dd732c82 100644 --- a/google/cloud/dialogflow_es/environments_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/environments_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ENVIRONMENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_ENVIRONMENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/environment.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/fulfillments_connection.h b/google/cloud/dialogflow_es/fulfillments_connection.h index 048dc448411c2..c184c481827dc 100644 --- a/google/cloud/dialogflow_es/fulfillments_connection.h +++ b/google/cloud/dialogflow_es/fulfillments_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_FULFILLMENTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_FULFILLMENTS_CONNECTION_H +#include "google/cloud/dialogflow/v2/fulfillment.pb.h" #include "google/cloud/dialogflow_es/fulfillments_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/internal/fulfillments_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_es/fulfillments_connection_idempotency_policy.h b/google/cloud/dialogflow_es/fulfillments_connection_idempotency_policy.h index 5e6e3dc407104..f42465e910fc7 100644 --- a/google/cloud/dialogflow_es/fulfillments_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/fulfillments_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_FULFILLMENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_FULFILLMENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/fulfillment.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/generators_connection.h b/google/cloud/dialogflow_es/generators_connection.h index 3b9bd277d6632..33e2c05b66c45 100644 --- a/google/cloud/dialogflow_es/generators_connection.h +++ b/google/cloud/dialogflow_es/generators_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_GENERATORS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_GENERATORS_CONNECTION_H +#include "google/cloud/dialogflow/v2/generator.pb.h" #include "google/cloud/dialogflow_es/generators_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/internal/generators_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_es/generators_connection_idempotency_policy.h b/google/cloud/dialogflow_es/generators_connection_idempotency_policy.h index 089858fc6949a..5a37b374b5f12 100644 --- a/google/cloud/dialogflow_es/generators_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/generators_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_GENERATORS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_GENERATORS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/generator.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/intents_client.h b/google/cloud/dialogflow_es/intents_client.h index c1751613400ff..805ce491f628b 100644 --- a/google/cloud/dialogflow_es/intents_client.h +++ b/google/cloud/dialogflow_es/intents_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/intents_connection.h b/google/cloud/dialogflow_es/intents_connection.h index b198d3f2bddab..62996a5d04b2a 100644 --- a/google/cloud/dialogflow_es/intents_connection.h +++ b/google/cloud/dialogflow_es/intents_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTENTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTENTS_CONNECTION_H +#include "google/cloud/dialogflow/v2/intent.pb.h" #include "google/cloud/dialogflow_es/intents_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/internal/intents_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,9 +31,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/protobuf/struct.pb.h" #include #include diff --git a/google/cloud/dialogflow_es/intents_connection_idempotency_policy.h b/google/cloud/dialogflow_es/intents_connection_idempotency_policy.h index ce1be9ae11824..c5b2e99312deb 100644 --- a/google/cloud/dialogflow_es/intents_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/intents_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/intent.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/internal/agents_auth_decorator.cc b/google/cloud/dialogflow_es/internal/agents_auth_decorator.cc index f886bc170b823..7aec3b6e2c80b 100644 --- a/google/cloud/dialogflow_es/internal/agents_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/agents_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/agent.proto #include "google/cloud/dialogflow_es/internal/agents_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/agent.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -262,3 +265,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/agents_auth_decorator.h b/google/cloud/dialogflow_es/internal/agents_auth_decorator.h index 60a1c64685fed..9d8ef54e45cb4 100644 --- a/google/cloud/dialogflow_es/internal/agents_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/agents_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/agents_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -149,4 +152,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_AGENTS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/agents_connection_impl.h b/google/cloud/dialogflow_es/internal/agents_connection_impl.h index 780687645c700..a846a1dba54c0 100644 --- a/google/cloud/dialogflow_es/internal/agents_connection_impl.h +++ b/google/cloud/dialogflow_es/internal/agents_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/internal/agents_logging_decorator.cc b/google/cloud/dialogflow_es/internal/agents_logging_decorator.cc index eb7df10f992db..77e800c186ada 100644 --- a/google/cloud/dialogflow_es/internal/agents_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/agents_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/agent.proto #include "google/cloud/dialogflow_es/internal/agents_logging_decorator.h" +#include "google/cloud/dialogflow/v2/agent.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -307,3 +310,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/agents_logging_decorator.h b/google/cloud/dialogflow_es/internal/agents_logging_decorator.h index 80f19c5ccbece..44aead3ad4554 100644 --- a/google/cloud/dialogflow_es/internal/agents_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/agents_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/agents_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -149,4 +152,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_AGENTS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/agents_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/agents_metadata_decorator.cc index 3613340f24fc2..8232335df47cc 100644 --- a/google/cloud/dialogflow_es/internal/agents_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/agents_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/agent.proto #include "google/cloud/dialogflow_es/internal/agents_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/agent.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -249,3 +253,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/agents_metadata_decorator.h b/google/cloud/dialogflow_es/internal/agents_metadata_decorator.h index 4ed41e60e0826..ded8079b67a96 100644 --- a/google/cloud/dialogflow_es/internal/agents_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/agents_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/agents_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -154,4 +157,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_AGENTS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/agents_option_defaults.cc b/google/cloud/dialogflow_es/internal/agents_option_defaults.cc index 7ab12ed41b7a8..b95ed00945511 100644 --- a/google/cloud/dialogflow_es/internal/agents_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/agents_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/agents_option_defaults.h" #include "google/cloud/dialogflow_es/agents_connection.h" #include "google/cloud/dialogflow_es/agents_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options AgentsDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dialogflow_es::AgentsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dialogflow_es::AgentsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/agents_stub.cc b/google/cloud/dialogflow_es/internal/agents_stub.cc index 29cdea7fcf52c..bf6b2faa42263 100644 --- a/google/cloud/dialogflow_es/internal/agents_stub.cc +++ b/google/cloud/dialogflow_es/internal/agents_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/v2/agent.proto #include "google/cloud/dialogflow_es/internal/agents_stub.h" +#include "google/cloud/dialogflow/v2/agent.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -304,3 +307,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/agents_stub.h b/google/cloud/dialogflow_es/internal/agents_stub.h index 5dd099fec530f..451d9a7c67f79 100644 --- a/google/cloud/dialogflow_es/internal/agents_stub.h +++ b/google/cloud/dialogflow_es/internal/agents_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_AGENTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_AGENTS_STUB_H +#include "google/cloud/dialogflow/v2/agent.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 -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/protobuf/struct.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -264,4 +267,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_AGENTS_STUB_H diff --git a/google/cloud/dialogflow_es/internal/agents_stub_factory.cc b/google/cloud/dialogflow_es/internal/agents_stub_factory.cc index ef6eac42e88e2..1b93928142f66 100644 --- a/google/cloud/dialogflow_es/internal/agents_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/agents_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/agent.proto #include "google/cloud/dialogflow_es/internal/agents_stub_factory.h" +#include "google/cloud/dialogflow/v2/agent.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/agents_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/agents_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/agents_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/agents_stub.h" #include "google/cloud/dialogflow_es/internal/agents_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/agents_stub_factory.h b/google/cloud/dialogflow_es/internal/agents_stub_factory.h index 519f9e27bd1f9..30ecc965f6324 100644 --- a/google/cloud/dialogflow_es/internal/agents_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/agents_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_AGENTS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/agents_tracing_connection.cc b/google/cloud/dialogflow_es/internal/agents_tracing_connection.cc index ce20dd6f8af5e..50626bdf3b7e5 100644 --- a/google/cloud/dialogflow_es/internal/agents_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/agents_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AgentsTracingConnection::AgentsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -225,15 +223,11 @@ Status AgentsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAgentsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/agents_tracing_connection.h b/google/cloud/dialogflow_es/internal/agents_tracing_connection.h index 01f3d4b5d2a15..5f36e62fd81a5 100644 --- a/google/cloud/dialogflow_es/internal/agents_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/agents_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AgentsTracingConnection : public dialogflow_es::AgentsConnection { public: ~AgentsTracingConnection() override = default; @@ -120,8 +118,6 @@ class AgentsTracingConnection : public dialogflow_es::AgentsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/agents_tracing_stub.cc b/google/cloud/dialogflow_es/internal/agents_tracing_stub.cc index d0d7ff8dd5606..d51db1620445f 100644 --- a/google/cloud/dialogflow_es/internal/agents_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/agents_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AgentsTracingStub::AgentsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -273,18 +274,14 @@ future AgentsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAgentsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/agents_tracing_stub.h b/google/cloud/dialogflow_es/internal/agents_tracing_stub.h index f822514aa1635..f96ca39072013 100644 --- a/google/cloud/dialogflow_es/internal/agents_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/agents_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AgentsTracingStub : public AgentsStub { public: ~AgentsTracingStub() override = default; @@ -144,8 +145,6 @@ class AgentsTracingStub : public AgentsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -160,4 +159,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_AGENTS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/answer_records_auth_decorator.cc b/google/cloud/dialogflow_es/internal/answer_records_auth_decorator.cc index e7eb32a9b5b5e..1354b406e28e8 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/answer_records_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/answer_record.proto #include "google/cloud/dialogflow_es/internal/answer_records_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/answer_record.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -95,3 +98,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/answer_records_auth_decorator.h b/google/cloud/dialogflow_es/internal/answer_records_auth_decorator.h index 9c8914a680960..c406a59afce5d 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/answer_records_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -79,4 +82,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ANSWER_RECORDS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/answer_records_logging_decorator.cc b/google/cloud/dialogflow_es/internal/answer_records_logging_decorator.cc index 3d228f681f4c9..f6684f7843ab9 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/answer_records_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/answer_record.proto #include "google/cloud/dialogflow_es/internal/answer_records_logging_decorator.h" +#include "google/cloud/dialogflow/v2/answer_record.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -122,3 +125,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/answer_records_logging_decorator.h b/google/cloud/dialogflow_es/internal/answer_records_logging_decorator.h index 19d3068dcfd86..bd70b280e63f2 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/answer_records_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -79,4 +82,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ANSWER_RECORDS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/answer_records_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/answer_records_metadata_decorator.cc index 9a67143f97cd4..2573f78bea30b 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/answer_records_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/answer_record.proto #include "google/cloud/dialogflow_es/internal/answer_records_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/answer_record.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -123,3 +127,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/answer_records_metadata_decorator.h b/google/cloud/dialogflow_es/internal/answer_records_metadata_decorator.h index 294eb6df4ad08..aea55005b627d 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/answer_records_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -84,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ANSWER_RECORDS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/answer_records_option_defaults.cc b/google/cloud/dialogflow_es/internal/answer_records_option_defaults.cc index 7f07e2033bd05..02a460b66380a 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/answer_records_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/answer_records_option_defaults.h" #include "google/cloud/dialogflow_es/answer_records_connection.h" #include "google/cloud/dialogflow_es/answer_records_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options AnswerRecordsDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_es::AnswerRecordsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/answer_records_stub.cc b/google/cloud/dialogflow_es/internal/answer_records_stub.cc index 5eefeb85545ed..03218b7cc3fbd 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_stub.cc +++ b/google/cloud/dialogflow_es/internal/answer_records_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/v2/answer_record.proto #include "google/cloud/dialogflow_es/internal/answer_records_stub.h" +#include "google/cloud/dialogflow/v2/answer_record.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -116,3 +119,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/answer_records_stub.h b/google/cloud/dialogflow_es/internal/answer_records_stub.h index b5d2e25113524..ee05d16ccb104 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_stub.h +++ b/google/cloud/dialogflow_es/internal/answer_records_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ANSWER_RECORDS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ANSWER_RECORDS_STUB_H +#include "google/cloud/dialogflow/v2/answer_record.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -130,4 +133,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ANSWER_RECORDS_STUB_H diff --git a/google/cloud/dialogflow_es/internal/answer_records_stub_factory.cc b/google/cloud/dialogflow_es/internal/answer_records_stub_factory.cc index ad318881d723c..918050ff19173 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/answer_records_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/answer_record.proto #include "google/cloud/dialogflow_es/internal/answer_records_stub_factory.h" +#include "google/cloud/dialogflow/v2/answer_record.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/answer_records_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/answer_records_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/answer_records_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/answer_records_stub.h" #include "google/cloud/dialogflow_es/internal/answer_records_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/answer_records_stub_factory.h b/google/cloud/dialogflow_es/internal/answer_records_stub_factory.h index 34688bbdb6d72..5a398d08b583c 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/answer_records_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ANSWER_RECORDS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/answer_records_tracing_connection.cc b/google/cloud/dialogflow_es/internal/answer_records_tracing_connection.cc index 017760478a98b..8f0e07d0cc0fd 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/answer_records_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AnswerRecordsTracingConnection::AnswerRecordsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -102,16 +100,12 @@ Status AnswerRecordsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAnswerRecordsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/answer_records_tracing_connection.h b/google/cloud/dialogflow_es/internal/answer_records_tracing_connection.h index 053a893330b28..10cb9f93ea2ea 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/answer_records_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AnswerRecordsTracingConnection : public dialogflow_es::AnswerRecordsConnection { public: @@ -66,8 +64,6 @@ class AnswerRecordsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/answer_records_tracing_stub.cc b/google/cloud/dialogflow_es/internal/answer_records_tracing_stub.cc index f3cf17b00bd9b..897bc1db83c55 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/answer_records_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AnswerRecordsTracingStub::AnswerRecordsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -114,18 +115,14 @@ Status AnswerRecordsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAnswerRecordsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/answer_records_tracing_stub.h b/google/cloud/dialogflow_es/internal/answer_records_tracing_stub.h index 4a25399c4bcaf..b95d8d7ac728e 100644 --- a/google/cloud/dialogflow_es/internal/answer_records_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/answer_records_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AnswerRecordsTracingStub : public AnswerRecordsStub { public: ~AnswerRecordsTracingStub() override = default; @@ -75,8 +76,6 @@ class AnswerRecordsTracingStub : public AnswerRecordsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -91,4 +90,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ANSWER_RECORDS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/contexts_auth_decorator.cc b/google/cloud/dialogflow_es/internal/contexts_auth_decorator.cc index f41fea037d147..b45d8db9370aa 100644 --- a/google/cloud/dialogflow_es/internal/contexts_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/contexts_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/context.proto #include "google/cloud/dialogflow_es/internal/contexts_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/context.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -126,3 +129,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/contexts_auth_decorator.h b/google/cloud/dialogflow_es/internal/contexts_auth_decorator.h index 948b923b60eac..c0f4e54a19dac 100644 --- a/google/cloud/dialogflow_es/internal/contexts_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/contexts_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONTEXTS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/contexts_logging_decorator.cc b/google/cloud/dialogflow_es/internal/contexts_logging_decorator.cc index fe66c6e82f291..c6ba06c72feaa 100644 --- a/google/cloud/dialogflow_es/internal/contexts_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/contexts_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/context.proto #include "google/cloud/dialogflow_es/internal/contexts_logging_decorator.h" +#include "google/cloud/dialogflow/v2/context.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -168,3 +171,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/contexts_logging_decorator.h b/google/cloud/dialogflow_es/internal/contexts_logging_decorator.h index 7e5977dbbeeb7..ee0eadab98c77 100644 --- a/google/cloud/dialogflow_es/internal/contexts_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/contexts_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONTEXTS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/contexts_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/contexts_metadata_decorator.cc index 2f43012a9c0be..8cbb7c3dae555 100644 --- a/google/cloud/dialogflow_es/internal/contexts_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/contexts_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/context.proto #include "google/cloud/dialogflow_es/internal/contexts_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/context.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -155,3 +159,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/contexts_metadata_decorator.h b/google/cloud/dialogflow_es/internal/contexts_metadata_decorator.h index 7ce93cb189d2a..a6c2bd0e4524d 100644 --- a/google/cloud/dialogflow_es/internal/contexts_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/contexts_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -102,4 +105,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONTEXTS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/contexts_option_defaults.cc b/google/cloud/dialogflow_es/internal/contexts_option_defaults.cc index e246ea0b809b7..2215309bea1a3 100644 --- a/google/cloud/dialogflow_es/internal/contexts_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/contexts_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/contexts_option_defaults.h" #include "google/cloud/dialogflow_es/contexts_connection.h" #include "google/cloud/dialogflow_es/contexts_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options ContextsDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dialogflow_es::ContextsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dialogflow_es::ContextsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/contexts_stub.cc b/google/cloud/dialogflow_es/internal/contexts_stub.cc index 69d6806604a97..104901bacfff9 100644 --- a/google/cloud/dialogflow_es/internal/contexts_stub.cc +++ b/google/cloud/dialogflow_es/internal/contexts_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/v2/context.proto #include "google/cloud/dialogflow_es/internal/contexts_stub.h" +#include "google/cloud/dialogflow/v2/context.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -161,3 +164,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/contexts_stub.h b/google/cloud/dialogflow_es/internal/contexts_stub.h index 22b8dbf264a08..9783db429f95a 100644 --- a/google/cloud/dialogflow_es/internal/contexts_stub.h +++ b/google/cloud/dialogflow_es/internal/contexts_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONTEXTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONTEXTS_STUB_H +#include "google/cloud/dialogflow/v2/context.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -161,4 +164,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONTEXTS_STUB_H diff --git a/google/cloud/dialogflow_es/internal/contexts_stub_factory.cc b/google/cloud/dialogflow_es/internal/contexts_stub_factory.cc index 729866f97cee2..41666dd768d9d 100644 --- a/google/cloud/dialogflow_es/internal/contexts_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/contexts_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/context.proto #include "google/cloud/dialogflow_es/internal/contexts_stub_factory.h" +#include "google/cloud/dialogflow/v2/context.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/contexts_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/contexts_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/contexts_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/contexts_stub.h" #include "google/cloud/dialogflow_es/internal/contexts_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/contexts_stub_factory.h b/google/cloud/dialogflow_es/internal/contexts_stub_factory.h index 58817a5492c28..6f70389581d3e 100644 --- a/google/cloud/dialogflow_es/internal/contexts_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/contexts_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONTEXTS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/contexts_tracing_connection.cc b/google/cloud/dialogflow_es/internal/contexts_tracing_connection.cc index f41d06741313e..25264417dd9ac 100644 --- a/google/cloud/dialogflow_es/internal/contexts_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/contexts_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ContextsTracingConnection::ContextsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -135,16 +133,12 @@ Status ContextsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeContextsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/contexts_tracing_connection.h b/google/cloud/dialogflow_es/internal/contexts_tracing_connection.h index 96ea4b943c562..826b421215cc6 100644 --- a/google/cloud/dialogflow_es/internal/contexts_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/contexts_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ContextsTracingConnection : public dialogflow_es::ContextsConnection { public: ~ContextsTracingConnection() override = default; @@ -80,8 +78,6 @@ class ContextsTracingConnection : public dialogflow_es::ContextsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/contexts_tracing_stub.cc b/google/cloud/dialogflow_es/internal/contexts_tracing_stub.cc index f03a75f891c53..1af6149e74aeb 100644 --- a/google/cloud/dialogflow_es/internal/contexts_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/contexts_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ContextsTracingStub::ContextsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -158,18 +159,14 @@ Status ContextsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeContextsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/contexts_tracing_stub.h b/google/cloud/dialogflow_es/internal/contexts_tracing_stub.h index 87fe72f5074c8..5f3d0a193c6f7 100644 --- a/google/cloud/dialogflow_es/internal/contexts_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/contexts_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ContextsTracingStub : public ContextsStub { public: ~ContextsTracingStub() override = default; @@ -93,8 +94,6 @@ class ContextsTracingStub : public ContextsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -109,4 +108,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONTEXTS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_auth_decorator.cc b/google/cloud/dialogflow_es/internal/conversation_datasets_auth_decorator.cc index f3ada29605abf..c3909bd67ef63 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/conversation_dataset.proto #include "google/cloud/dialogflow_es/internal/conversation_datasets_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/conversation_dataset.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -227,3 +230,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_auth_decorator.h b/google/cloud/dialogflow_es/internal/conversation_datasets_auth_decorator.h index 2667217e7180c..81daa13ae90cf 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/conversation_datasets_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -131,4 +134,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_DATASETS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_connection_impl.h b/google/cloud/dialogflow_es/internal/conversation_datasets_connection_impl.h index 8d2b57f45589a..78a38964ea823 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_connection_impl.h +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_logging_decorator.cc b/google/cloud/dialogflow_es/internal/conversation_datasets_logging_decorator.cc index 6e7962f40d20f..c8f8c6e25d04a 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/conversation_dataset.proto #include "google/cloud/dialogflow_es/internal/conversation_datasets_logging_decorator.h" +#include "google/cloud/dialogflow/v2/conversation_dataset.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -268,3 +271,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_logging_decorator.h b/google/cloud/dialogflow_es/internal/conversation_datasets_logging_decorator.h index e9a949fd6cc31..8ef7e31449542 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/conversation_datasets_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -131,4 +134,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_DATASETS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/conversation_datasets_metadata_decorator.cc index 824bee67453af..7ffa04f9553d8 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/conversation_dataset.proto #include "google/cloud/dialogflow_es/internal/conversation_datasets_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/conversation_dataset.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -217,3 +221,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_metadata_decorator.h b/google/cloud/dialogflow_es/internal/conversation_datasets_metadata_decorator.h index 48774ba5427d0..3bb0fdce353f2 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/conversation_datasets_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -137,4 +140,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_DATASETS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_option_defaults.cc b/google/cloud/dialogflow_es/internal/conversation_datasets_option_defaults.cc index 4d9fbb6fb19c9..6f5afda0f02a9 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/conversation_datasets_option_defaults.h" #include "google/cloud/dialogflow_es/conversation_datasets_connection.h" #include "google/cloud/dialogflow_es/conversation_datasets_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options ConversationDatasetsDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_es::ConversationDatasetsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_stub.cc b/google/cloud/dialogflow_es/internal/conversation_datasets_stub.cc index a6871b3669eaf..1f1aa890b21eb 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_stub.cc +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/v2/conversation_dataset.proto #include "google/cloud/dialogflow_es/internal/conversation_datasets_stub.h" +#include "google/cloud/dialogflow/v2/conversation_dataset.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -265,3 +268,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_stub.h b/google/cloud/dialogflow_es/internal/conversation_datasets_stub.h index e81ee6255998f..bd54ae64a5d08 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_stub.h +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_DATASETS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_DATASETS_STUB_H +#include "google/cloud/dialogflow/v2/conversation_dataset.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -236,4 +239,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_DATASETS_STUB_H diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_stub_factory.cc b/google/cloud/dialogflow_es/internal/conversation_datasets_stub_factory.cc index 736bd848375a9..dc073d576a0a2 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/conversation_dataset.proto #include "google/cloud/dialogflow_es/internal/conversation_datasets_stub_factory.h" +#include "google/cloud/dialogflow/v2/conversation_dataset.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/conversation_datasets_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/conversation_datasets_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/conversation_datasets_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/conversation_datasets_stub.h" #include "google/cloud/dialogflow_es/internal/conversation_datasets_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_stub_factory.h b/google/cloud/dialogflow_es/internal/conversation_datasets_stub_factory.h index e96c3623df077..5ce7458bf7ea4 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_DATASETS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_connection.cc b/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_connection.cc index d9cc70dc3e7f2..e0fdf0cbff90f 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConversationDatasetsTracingConnection::ConversationDatasetsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -213,17 +211,13 @@ Status ConversationDatasetsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConversationDatasetsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_connection.h b/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_connection.h index 48920e83f816d..7b6cded789e6d 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConversationDatasetsTracingConnection : public dialogflow_es::ConversationDatasetsConnection { public: @@ -115,8 +113,6 @@ class ConversationDatasetsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_stub.cc b/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_stub.cc index 7dead452e5ea5..30d1d5cf8ff40 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConversationDatasetsTracingStub::ConversationDatasetsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -245,18 +246,14 @@ future ConversationDatasetsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConversationDatasetsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_stub.h b/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_stub.h index 8d42999214a57..cd7967afd8336 100644 --- a/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/conversation_datasets_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConversationDatasetsTracingStub : public ConversationDatasetsStub { public: ~ConversationDatasetsTracingStub() override = default; @@ -127,8 +128,6 @@ class ConversationDatasetsTracingStub : public ConversationDatasetsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -143,4 +142,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_DATASETS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/conversation_models_auth_decorator.cc b/google/cloud/dialogflow_es/internal/conversation_models_auth_decorator.cc index aae3b5e7796a9..99ab5cc8b21a8 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/conversation_models_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/conversation_model.proto #include "google/cloud/dialogflow_es/internal/conversation_models_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/conversation_model.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -308,3 +311,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_models_auth_decorator.h b/google/cloud/dialogflow_es/internal/conversation_models_auth_decorator.h index 65965652491ea..77204749bab13 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/conversation_models_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/conversation_models_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -168,4 +171,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_MODELS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/conversation_models_connection_impl.h b/google/cloud/dialogflow_es/internal/conversation_models_connection_impl.h index de3fdd28ff5ce..831c50a1a5762 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_connection_impl.h +++ b/google/cloud/dialogflow_es/internal/conversation_models_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/internal/conversation_models_logging_decorator.cc b/google/cloud/dialogflow_es/internal/conversation_models_logging_decorator.cc index e1d7777fef097..4effb27d36bba 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/conversation_models_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/conversation_model.proto #include "google/cloud/dialogflow_es/internal/conversation_models_logging_decorator.h" +#include "google/cloud/dialogflow/v2/conversation_model.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -370,3 +373,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_models_logging_decorator.h b/google/cloud/dialogflow_es/internal/conversation_models_logging_decorator.h index 1c5ac09d0bd3b..d56abdad94034 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/conversation_models_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/conversation_models_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -168,4 +171,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_MODELS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/conversation_models_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/conversation_models_metadata_decorator.cc index 8c35ce72ee964..654e75ff45280 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/conversation_models_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/conversation_model.proto #include "google/cloud/dialogflow_es/internal/conversation_models_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/conversation_model.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -283,3 +287,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_models_metadata_decorator.h b/google/cloud/dialogflow_es/internal/conversation_models_metadata_decorator.h index ee1827b663aa7..16c53e8dc18cb 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/conversation_models_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/conversation_models_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -174,4 +177,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_MODELS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/conversation_models_option_defaults.cc b/google/cloud/dialogflow_es/internal/conversation_models_option_defaults.cc index e023dbc02e734..0aa886ac791be 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/conversation_models_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/conversation_models_option_defaults.h" #include "google/cloud/dialogflow_es/conversation_models_connection.h" #include "google/cloud/dialogflow_es/conversation_models_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options ConversationModelsDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_es::ConversationModelsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/conversation_models_stub.cc b/google/cloud/dialogflow_es/internal/conversation_models_stub.cc index 7ec52c36c1ed8..90c13c852d353 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_stub.cc +++ b/google/cloud/dialogflow_es/internal/conversation_models_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/v2/conversation_model.proto #include "google/cloud/dialogflow_es/internal/conversation_models_stub.h" +#include "google/cloud/dialogflow/v2/conversation_model.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -364,3 +367,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_models_stub.h b/google/cloud/dialogflow_es/internal/conversation_models_stub.h index b06aedf3e20e7..43c3e8ef46c70 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_stub.h +++ b/google/cloud/dialogflow_es/internal/conversation_models_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_MODELS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_MODELS_STUB_H +#include "google/cloud/dialogflow/v2/conversation_model.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -313,4 +316,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_MODELS_STUB_H diff --git a/google/cloud/dialogflow_es/internal/conversation_models_stub_factory.cc b/google/cloud/dialogflow_es/internal/conversation_models_stub_factory.cc index b9588a62a1527..679ea6cf8ef51 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/conversation_models_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/conversation_model.proto #include "google/cloud/dialogflow_es/internal/conversation_models_stub_factory.h" +#include "google/cloud/dialogflow/v2/conversation_model.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/conversation_models_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/conversation_models_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/conversation_models_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/conversation_models_stub.h" #include "google/cloud/dialogflow_es/internal/conversation_models_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_models_stub_factory.h b/google/cloud/dialogflow_es/internal/conversation_models_stub_factory.h index 2d85555097645..57063bdbd8746 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/conversation_models_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_MODELS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/conversation_models_tracing_connection.cc b/google/cloud/dialogflow_es/internal/conversation_models_tracing_connection.cc index 5afa2351d1a59..db8334434acb3 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/conversation_models_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConversationModelsTracingConnection::ConversationModelsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -301,17 +299,13 @@ Status ConversationModelsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConversationModelsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/conversation_models_tracing_connection.h b/google/cloud/dialogflow_es/internal/conversation_models_tracing_connection.h index 441c40a290e11..e646cc5777b6e 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/conversation_models_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConversationModelsTracingConnection : public dialogflow_es::ConversationModelsConnection { public: @@ -155,8 +153,6 @@ class ConversationModelsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/conversation_models_tracing_stub.cc b/google/cloud/dialogflow_es/internal/conversation_models_tracing_stub.cc index 9f1e7af19914c..088ec335f88ae 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/conversation_models_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConversationModelsTracingStub::ConversationModelsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -337,18 +338,14 @@ future ConversationModelsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConversationModelsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_models_tracing_stub.h b/google/cloud/dialogflow_es/internal/conversation_models_tracing_stub.h index 6ab727cd8f9e2..3492826b798ef 100644 --- a/google/cloud/dialogflow_es/internal/conversation_models_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/conversation_models_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConversationModelsTracingStub : public ConversationModelsStub { public: ~ConversationModelsTracingStub() override = default; @@ -164,8 +165,6 @@ class ConversationModelsTracingStub : public ConversationModelsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -180,4 +179,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_MODELS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_auth_decorator.cc b/google/cloud/dialogflow_es/internal/conversation_profiles_auth_decorator.cc index 8cf6b4fd78450..c1f138893ed30 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/conversation_profile.proto #include "google/cloud/dialogflow_es/internal/conversation_profiles_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/conversation_profile.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -225,3 +228,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_auth_decorator.h b/google/cloud/dialogflow_es/internal/conversation_profiles_auth_decorator.h index a52ea337d249e..08d34bad1de21 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/conversation_profiles_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -136,4 +139,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_PROFILES_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_connection_impl.h b/google/cloud/dialogflow_es/internal/conversation_profiles_connection_impl.h index ba2829b44a97c..ea9c66f545f14 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_connection_impl.h +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_logging_decorator.cc b/google/cloud/dialogflow_es/internal/conversation_profiles_logging_decorator.cc index 64140d2088831..a433437c72511 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/conversation_profile.proto #include "google/cloud/dialogflow_es/internal/conversation_profiles_logging_decorator.h" +#include "google/cloud/dialogflow/v2/conversation_profile.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -274,3 +277,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_logging_decorator.h b/google/cloud/dialogflow_es/internal/conversation_profiles_logging_decorator.h index a0f85a9e3e494..7861595ed72fd 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/conversation_profiles_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -136,4 +139,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_PROFILES_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/conversation_profiles_metadata_decorator.cc index bbc01deac5cc4..7b0f5ce7703e8 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/conversation_profile.proto #include "google/cloud/dialogflow_es/internal/conversation_profiles_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/conversation_profile.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -233,3 +237,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_metadata_decorator.h b/google/cloud/dialogflow_es/internal/conversation_profiles_metadata_decorator.h index ce623f0bc6ead..f8338376dff1d 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/conversation_profiles_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -142,4 +145,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_PROFILES_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_option_defaults.cc b/google/cloud/dialogflow_es/internal/conversation_profiles_option_defaults.cc index 24d8d1bad3023..c769872880c61 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/conversation_profiles_option_defaults.h" #include "google/cloud/dialogflow_es/conversation_profiles_connection.h" #include "google/cloud/dialogflow_es/conversation_profiles_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options ConversationProfilesDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_es::ConversationProfilesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_stub.cc b/google/cloud/dialogflow_es/internal/conversation_profiles_stub.cc index 738c66e6d2e1e..fd4f8144ba50c 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_stub.cc +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/v2/conversation_profile.proto #include "google/cloud/dialogflow_es/internal/conversation_profiles_stub.h" +#include "google/cloud/dialogflow/v2/conversation_profile.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -272,3 +275,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_stub.h b/google/cloud/dialogflow_es/internal/conversation_profiles_stub.h index 95a6150935be2..058bcb9ded154 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_stub.h +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_PROFILES_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_PROFILES_STUB_H +#include "google/cloud/dialogflow/v2/conversation_profile.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -245,4 +248,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_PROFILES_STUB_H diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_stub_factory.cc b/google/cloud/dialogflow_es/internal/conversation_profiles_stub_factory.cc index 9c8701f862472..a2f963264140d 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/conversation_profile.proto #include "google/cloud/dialogflow_es/internal/conversation_profiles_stub_factory.h" +#include "google/cloud/dialogflow/v2/conversation_profile.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/conversation_profiles_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/conversation_profiles_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/conversation_profiles_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/conversation_profiles_stub.h" #include "google/cloud/dialogflow_es/internal/conversation_profiles_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_stub_factory.h b/google/cloud/dialogflow_es/internal/conversation_profiles_stub_factory.h index d775b39fd564e..df716c83e28af 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_PROFILES_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_connection.cc b/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_connection.cc index 514db7e718199..15b8bb840a0d7 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConversationProfilesTracingConnection::ConversationProfilesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -208,17 +206,13 @@ Status ConversationProfilesTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConversationProfilesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_connection.h b/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_connection.h index 5a994ec4737d0..c7ceb3d29d55a 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConversationProfilesTracingConnection : public dialogflow_es::ConversationProfilesConnection { public: @@ -111,8 +109,6 @@ class ConversationProfilesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_stub.cc b/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_stub.cc index 6445f6e6e9873..1d16c931a079e 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConversationProfilesTracingStub::ConversationProfilesTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -257,18 +258,14 @@ future ConversationProfilesTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConversationProfilesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_stub.h b/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_stub.h index 9994722b6a7d5..e99dc184fae79 100644 --- a/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/conversation_profiles_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConversationProfilesTracingStub : public ConversationProfilesStub { public: ~ConversationProfilesTracingStub() override = default; @@ -132,8 +133,6 @@ class ConversationProfilesTracingStub : public ConversationProfilesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -148,4 +147,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATION_PROFILES_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/conversations_auth_decorator.cc b/google/cloud/dialogflow_es/internal/conversations_auth_decorator.cc index 51e5850f67b1e..42d3edcf39eb3 100644 --- a/google/cloud/dialogflow_es/internal/conversations_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/conversations_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/conversation.proto #include "google/cloud/dialogflow_es/internal/conversations_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/conversation.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -180,3 +183,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversations_auth_decorator.h b/google/cloud/dialogflow_es/internal/conversations_auth_decorator.h index bf73f843358f8..1fa4a18a9f47f 100644 --- a/google/cloud/dialogflow_es/internal/conversations_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/conversations_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATIONS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/conversations_logging_decorator.cc b/google/cloud/dialogflow_es/internal/conversations_logging_decorator.cc index 7b4b17d87bb2c..9213169fe5a83 100644 --- a/google/cloud/dialogflow_es/internal/conversations_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/conversations_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/conversation.proto #include "google/cloud/dialogflow_es/internal/conversations_logging_decorator.h" +#include "google/cloud/dialogflow/v2/conversation.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -245,3 +248,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversations_logging_decorator.h b/google/cloud/dialogflow_es/internal/conversations_logging_decorator.h index ca2e5438c173c..07b96b862b631 100644 --- a/google/cloud/dialogflow_es/internal/conversations_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/conversations_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/conversations_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/conversations_metadata_decorator.cc index 756b5da85f48f..10e1b79b5d2ad 100644 --- a/google/cloud/dialogflow_es/internal/conversations_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/conversations_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/conversation.proto #include "google/cloud/dialogflow_es/internal/conversations_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/conversation.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -211,3 +215,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversations_metadata_decorator.h b/google/cloud/dialogflow_es/internal/conversations_metadata_decorator.h index cb899d3fe9fd5..b00575920dd0d 100644 --- a/google/cloud/dialogflow_es/internal/conversations_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/conversations_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -134,4 +137,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATIONS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/conversations_option_defaults.cc b/google/cloud/dialogflow_es/internal/conversations_option_defaults.cc index a16fac8026da8..b91d819ca62b8 100644 --- a/google/cloud/dialogflow_es/internal/conversations_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/conversations_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/conversations_option_defaults.h" #include "google/cloud/dialogflow_es/conversations_connection.h" #include "google/cloud/dialogflow_es/conversations_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options ConversationsDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_es::ConversationsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/conversations_stub.cc b/google/cloud/dialogflow_es/internal/conversations_stub.cc index 375c6000f5bf2..b5e160ef71d5d 100644 --- a/google/cloud/dialogflow_es/internal/conversations_stub.cc +++ b/google/cloud/dialogflow_es/internal/conversations_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/v2/conversation.proto #include "google/cloud/dialogflow_es/internal/conversations_stub.h" +#include "google/cloud/dialogflow/v2/conversation.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -232,3 +235,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversations_stub.h b/google/cloud/dialogflow_es/internal/conversations_stub.h index 702fcc7d1884f..4edd3ccc95d94 100644 --- a/google/cloud/dialogflow_es/internal/conversations_stub.h +++ b/google/cloud/dialogflow_es/internal/conversations_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATIONS_STUB_H +#include "google/cloud/dialogflow/v2/conversation.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -234,4 +237,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATIONS_STUB_H diff --git a/google/cloud/dialogflow_es/internal/conversations_stub_factory.cc b/google/cloud/dialogflow_es/internal/conversations_stub_factory.cc index 4d91f838a99c1..8d589b2f36e7a 100644 --- a/google/cloud/dialogflow_es/internal/conversations_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/conversations_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/conversation.proto #include "google/cloud/dialogflow_es/internal/conversations_stub_factory.h" +#include "google/cloud/dialogflow/v2/conversation.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/conversations_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/conversations_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/conversations_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/conversations_stub.h" #include "google/cloud/dialogflow_es/internal/conversations_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversations_stub_factory.h b/google/cloud/dialogflow_es/internal/conversations_stub_factory.h index b4ce90fa08223..c437c76069af8 100644 --- a/google/cloud/dialogflow_es/internal/conversations_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/conversations_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATIONS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/conversations_tracing_connection.cc b/google/cloud/dialogflow_es/internal/conversations_tracing_connection.cc index 541c63c872d0f..7c96b871fe577 100644 --- a/google/cloud/dialogflow_es/internal/conversations_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/conversations_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConversationsTracingConnection::ConversationsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -189,16 +187,12 @@ Status ConversationsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConversationsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/conversations_tracing_connection.h b/google/cloud/dialogflow_es/internal/conversations_tracing_connection.h index 35109ca60d333..aff2e8830bc1e 100644 --- a/google/cloud/dialogflow_es/internal/conversations_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/conversations_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConversationsTracingConnection : public dialogflow_es::ConversationsConnection { public: @@ -106,8 +104,6 @@ class ConversationsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/conversations_tracing_stub.cc b/google/cloud/dialogflow_es/internal/conversations_tracing_stub.cc index 6330763910d3f..4fdbd0cb018ee 100644 --- a/google/cloud/dialogflow_es/internal/conversations_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/conversations_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConversationsTracingStub::ConversationsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -230,18 +231,14 @@ Status ConversationsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConversationsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/conversations_tracing_stub.h b/google/cloud/dialogflow_es/internal/conversations_tracing_stub.h index 59be254a438ea..9b47303185a88 100644 --- a/google/cloud/dialogflow_es/internal/conversations_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/conversations_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConversationsTracingStub : public ConversationsStub { public: ~ConversationsTracingStub() override = default; @@ -125,8 +126,6 @@ class ConversationsTracingStub : public ConversationsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -141,4 +140,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_CONVERSATIONS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/documents_auth_decorator.cc b/google/cloud/dialogflow_es/internal/documents_auth_decorator.cc index 251c9ecb6e744..b6085ef67637e 100644 --- a/google/cloud/dialogflow_es/internal/documents_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/documents_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/document.proto #include "google/cloud/dialogflow_es/internal/documents_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/document.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -298,3 +301,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/documents_auth_decorator.h b/google/cloud/dialogflow_es/internal/documents_auth_decorator.h index fe7d36473fd79..6138f273b14e5 100644 --- a/google/cloud/dialogflow_es/internal/documents_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/documents_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/documents_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -163,4 +166,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_DOCUMENTS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/documents_connection_impl.h b/google/cloud/dialogflow_es/internal/documents_connection_impl.h index c753e4c642757..7633b82253c4e 100644 --- a/google/cloud/dialogflow_es/internal/documents_connection_impl.h +++ b/google/cloud/dialogflow_es/internal/documents_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/internal/documents_logging_decorator.cc b/google/cloud/dialogflow_es/internal/documents_logging_decorator.cc index 657a9b07f70d4..0020be8c5923b 100644 --- a/google/cloud/dialogflow_es/internal/documents_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/documents_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/document.proto #include "google/cloud/dialogflow_es/internal/documents_logging_decorator.h" +#include "google/cloud/dialogflow/v2/document.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -341,3 +344,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/documents_logging_decorator.h b/google/cloud/dialogflow_es/internal/documents_logging_decorator.h index ea5a5fe94d2ae..2f054bfcc113f 100644 --- a/google/cloud/dialogflow_es/internal/documents_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/documents_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/documents_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -163,4 +166,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_DOCUMENTS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/documents_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/documents_metadata_decorator.cc index e39a8d4b9875d..f995e942c76d7 100644 --- a/google/cloud/dialogflow_es/internal/documents_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/documents_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/document.proto #include "google/cloud/dialogflow_es/internal/documents_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/document.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -266,3 +270,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/documents_metadata_decorator.h b/google/cloud/dialogflow_es/internal/documents_metadata_decorator.h index e7d7390fa1011..ebcd991969a39 100644 --- a/google/cloud/dialogflow_es/internal/documents_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/documents_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/documents_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -168,4 +171,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_DOCUMENTS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/documents_option_defaults.cc b/google/cloud/dialogflow_es/internal/documents_option_defaults.cc index 1abba8c7ec876..b0dd7cbfa17a8 100644 --- a/google/cloud/dialogflow_es/internal/documents_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/documents_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/documents_option_defaults.h" #include "google/cloud/dialogflow_es/documents_connection.h" #include "google/cloud/dialogflow_es/documents_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options DocumentsDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dialogflow_es::DocumentsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dialogflow_es::DocumentsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/documents_stub.cc b/google/cloud/dialogflow_es/internal/documents_stub.cc index 75d7de091e12d..fc964fb7c5da9 100644 --- a/google/cloud/dialogflow_es/internal/documents_stub.cc +++ b/google/cloud/dialogflow_es/internal/documents_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/v2/document.proto #include "google/cloud/dialogflow_es/internal/documents_stub.h" +#include "google/cloud/dialogflow/v2/document.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -335,3 +338,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/documents_stub.h b/google/cloud/dialogflow_es/internal/documents_stub.h index f50bb26d6c28c..bc98844502e81 100644 --- a/google/cloud/dialogflow_es/internal/documents_stub.h +++ b/google/cloud/dialogflow_es/internal/documents_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_DOCUMENTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_DOCUMENTS_STUB_H +#include "google/cloud/dialogflow/v2/document.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -283,4 +286,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_DOCUMENTS_STUB_H diff --git a/google/cloud/dialogflow_es/internal/documents_stub_factory.cc b/google/cloud/dialogflow_es/internal/documents_stub_factory.cc index 2c80903dd0bd1..88a7eb9f092a8 100644 --- a/google/cloud/dialogflow_es/internal/documents_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/documents_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/document.proto #include "google/cloud/dialogflow_es/internal/documents_stub_factory.h" +#include "google/cloud/dialogflow/v2/document.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/documents_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/documents_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/documents_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/documents_stub.h" #include "google/cloud/dialogflow_es/internal/documents_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/documents_stub_factory.h b/google/cloud/dialogflow_es/internal/documents_stub_factory.h index 3d836f8c2fe8d..c118bd1f42841 100644 --- a/google/cloud/dialogflow_es/internal/documents_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/documents_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_DOCUMENTS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/documents_tracing_connection.cc b/google/cloud/dialogflow_es/internal/documents_tracing_connection.cc index 310bd2aebfcc6..a1ff1a285a224 100644 --- a/google/cloud/dialogflow_es/internal/documents_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/documents_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DocumentsTracingConnection::DocumentsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -275,16 +273,12 @@ Status DocumentsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDocumentsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/documents_tracing_connection.h b/google/cloud/dialogflow_es/internal/documents_tracing_connection.h index 75fde695e6d68..5aef5bdb83483 100644 --- a/google/cloud/dialogflow_es/internal/documents_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/documents_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DocumentsTracingConnection : public dialogflow_es::DocumentsConnection { public: ~DocumentsTracingConnection() override = default; @@ -137,8 +135,6 @@ class DocumentsTracingConnection : public dialogflow_es::DocumentsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/documents_tracing_stub.cc b/google/cloud/dialogflow_es/internal/documents_tracing_stub.cc index 515bf7b8a7cea..4ca46e37ebcc6 100644 --- a/google/cloud/dialogflow_es/internal/documents_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/documents_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DocumentsTracingStub::DocumentsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -296,18 +297,14 @@ future DocumentsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDocumentsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/documents_tracing_stub.h b/google/cloud/dialogflow_es/internal/documents_tracing_stub.h index 5927be7b7d580..41174f4e8c389 100644 --- a/google/cloud/dialogflow_es/internal/documents_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/documents_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DocumentsTracingStub : public DocumentsStub { public: ~DocumentsTracingStub() override = default; @@ -158,8 +159,6 @@ class DocumentsTracingStub : public DocumentsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -174,4 +173,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_DOCUMENTS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_auth_decorator.cc b/google/cloud/dialogflow_es/internal/encryption_spec_auth_decorator.cc index b6d9c4e6376e0..d7ff35c5daa4b 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/encryption_spec_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/encryption_spec.proto #include "google/cloud/dialogflow_es/internal/encryption_spec_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/encryption_spec.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -155,3 +158,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_auth_decorator.h b/google/cloud/dialogflow_es/internal/encryption_spec_auth_decorator.h index 813bcccb81cff..7fd14845b826c 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/encryption_spec_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/encryption_spec_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENCRYPTION_SPEC_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_connection_impl.h b/google/cloud/dialogflow_es/internal/encryption_spec_connection_impl.h index 9449b6d22b968..527568f90164e 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_connection_impl.h +++ b/google/cloud/dialogflow_es/internal/encryption_spec_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_logging_decorator.cc b/google/cloud/dialogflow_es/internal/encryption_spec_logging_decorator.cc index a8cc61d3d5ccf..445bfbaa50656 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/encryption_spec_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/encryption_spec.proto #include "google/cloud/dialogflow_es/internal/encryption_spec_logging_decorator.h" +#include "google/cloud/dialogflow/v2/encryption_spec.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -182,3 +185,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_logging_decorator.h b/google/cloud/dialogflow_es/internal/encryption_spec_logging_decorator.h index 596e426bdf21b..06ed58840472b 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/encryption_spec_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/encryption_spec_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENCRYPTION_SPEC_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/encryption_spec_metadata_decorator.cc index c73e8569b7df7..acf3867bde9e4 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/encryption_spec_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/encryption_spec.proto #include "google/cloud/dialogflow_es/internal/encryption_spec_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/encryption_spec.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -164,3 +168,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_metadata_decorator.h b/google/cloud/dialogflow_es/internal/encryption_spec_metadata_decorator.h index 6cd0409429ccb..25331c1ef6ce0 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/encryption_spec_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/encryption_spec_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -105,4 +108,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENCRYPTION_SPEC_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_option_defaults.cc b/google/cloud/dialogflow_es/internal/encryption_spec_option_defaults.cc index 75d861b6a65b0..77c7143c5db30 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/encryption_spec_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/encryption_spec_option_defaults.h" #include "google/cloud/dialogflow_es/encryption_spec_connection.h" #include "google/cloud/dialogflow_es/encryption_spec_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options EncryptionSpecServiceDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_es::EncryptionSpecServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_stub.cc b/google/cloud/dialogflow_es/internal/encryption_spec_stub.cc index 491be95e26fa0..b2a24b33a0a22 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_stub.cc +++ b/google/cloud/dialogflow_es/internal/encryption_spec_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/v2/encryption_spec.proto #include "google/cloud/dialogflow_es/internal/encryption_spec_stub.h" +#include "google/cloud/dialogflow/v2/encryption_spec.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -180,3 +183,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_stub.h b/google/cloud/dialogflow_es/internal/encryption_spec_stub.h index 260f3cf97bc00..af4bd980042bd 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_stub.h +++ b/google/cloud/dialogflow_es/internal/encryption_spec_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENCRYPTION_SPEC_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENCRYPTION_SPEC_STUB_H +#include "google/cloud/dialogflow/v2/encryption_spec.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -171,4 +174,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENCRYPTION_SPEC_STUB_H diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_stub_factory.cc b/google/cloud/dialogflow_es/internal/encryption_spec_stub_factory.cc index e04be4a282aee..798c0e4292687 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/encryption_spec_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/encryption_spec.proto #include "google/cloud/dialogflow_es/internal/encryption_spec_stub_factory.h" +#include "google/cloud/dialogflow/v2/encryption_spec.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/encryption_spec_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/encryption_spec_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/encryption_spec_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/encryption_spec_stub.h" #include "google/cloud/dialogflow_es/internal/encryption_spec_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_stub_factory.h b/google/cloud/dialogflow_es/internal/encryption_spec_stub_factory.h index 03c68029d77cf..3a2e7968672a0 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/encryption_spec_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENCRYPTION_SPEC_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_tracing_connection.cc b/google/cloud/dialogflow_es/internal/encryption_spec_tracing_connection.cc index df5bcd78fba87..6ae98c97a3d7a 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/encryption_spec_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EncryptionSpecServiceTracingConnection::EncryptionSpecServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -128,17 +126,13 @@ Status EncryptionSpecServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEncryptionSpecServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_tracing_connection.h b/google/cloud/dialogflow_es/internal/encryption_spec_tracing_connection.h index 35a34fcc9bf42..c0beb5e6b59d2 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/encryption_spec_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EncryptionSpecServiceTracingConnection : public dialogflow_es::EncryptionSpecServiceConnection { public: @@ -79,8 +77,6 @@ class EncryptionSpecServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_tracing_stub.cc b/google/cloud/dialogflow_es/internal/encryption_spec_tracing_stub.cc index cd53ed068fb78..9ea5a358fde82 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/encryption_spec_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EncryptionSpecServiceTracingStub::EncryptionSpecServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -163,18 +164,14 @@ future EncryptionSpecServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEncryptionSpecServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/encryption_spec_tracing_stub.h b/google/cloud/dialogflow_es/internal/encryption_spec_tracing_stub.h index 71fd6f2e3e5f1..5b1c29fdd2977 100644 --- a/google/cloud/dialogflow_es/internal/encryption_spec_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/encryption_spec_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EncryptionSpecServiceTracingStub : public EncryptionSpecServiceStub { public: ~EncryptionSpecServiceTracingStub() override = default; @@ -95,8 +96,6 @@ class EncryptionSpecServiceTracingStub : public EncryptionSpecServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -111,4 +110,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENCRYPTION_SPEC_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/entity_types_auth_decorator.cc b/google/cloud/dialogflow_es/internal/entity_types_auth_decorator.cc index e18b96df1208b..1c017d86b31ad 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/entity_types_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/entity_type.proto #include "google/cloud/dialogflow_es/internal/entity_types_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/entity_type.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -303,3 +306,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/entity_types_auth_decorator.h b/google/cloud/dialogflow_es/internal/entity_types_auth_decorator.h index 698a8a8a4428a..2d9d9856e6cb1 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/entity_types_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/entity_types_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -166,4 +169,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENTITY_TYPES_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/entity_types_connection_impl.h b/google/cloud/dialogflow_es/internal/entity_types_connection_impl.h index 4a9280b2e717e..5c87379d5a259 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_connection_impl.h +++ b/google/cloud/dialogflow_es/internal/entity_types_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/internal/entity_types_logging_decorator.cc b/google/cloud/dialogflow_es/internal/entity_types_logging_decorator.cc index 3ed5626d268c0..8d5a0beab9052 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/entity_types_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/entity_type.proto #include "google/cloud/dialogflow_es/internal/entity_types_logging_decorator.h" +#include "google/cloud/dialogflow/v2/entity_type.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -359,3 +362,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/entity_types_logging_decorator.h b/google/cloud/dialogflow_es/internal/entity_types_logging_decorator.h index a1710cabff46e..a0096bbaca827 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/entity_types_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/entity_types_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -166,4 +169,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENTITY_TYPES_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/entity_types_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/entity_types_metadata_decorator.cc index a66c2633812b1..b507efce2670e 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/entity_types_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/entity_type.proto #include "google/cloud/dialogflow_es/internal/entity_types_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/entity_type.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -280,3 +284,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/entity_types_metadata_decorator.h b/google/cloud/dialogflow_es/internal/entity_types_metadata_decorator.h index 05cc16bc3db4c..23cf9f427971a 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/entity_types_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/entity_types_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -171,4 +174,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENTITY_TYPES_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/entity_types_option_defaults.cc b/google/cloud/dialogflow_es/internal/entity_types_option_defaults.cc index bc44186dca0ad..ea8036a406f79 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/entity_types_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/entity_types_option_defaults.h" #include "google/cloud/dialogflow_es/entity_types_connection.h" #include "google/cloud/dialogflow_es/entity_types_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options EntityTypesDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_es::EntityTypesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/entity_types_stub.cc b/google/cloud/dialogflow_es/internal/entity_types_stub.cc index 88d39297fbd93..9bf7896b52d0e 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_stub.cc +++ b/google/cloud/dialogflow_es/internal/entity_types_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/v2/entity_type.proto #include "google/cloud/dialogflow_es/internal/entity_types_stub.h" +#include "google/cloud/dialogflow/v2/entity_type.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -351,3 +354,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/entity_types_stub.h b/google/cloud/dialogflow_es/internal/entity_types_stub.h index fea939fcab29b..c6d69f7ad8301 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_stub.h +++ b/google/cloud/dialogflow_es/internal/entity_types_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENTITY_TYPES_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENTITY_TYPES_STUB_H +#include "google/cloud/dialogflow/v2/entity_type.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 -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/protobuf/struct.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -307,4 +310,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENTITY_TYPES_STUB_H diff --git a/google/cloud/dialogflow_es/internal/entity_types_stub_factory.cc b/google/cloud/dialogflow_es/internal/entity_types_stub_factory.cc index ebbe7dac4011f..11f8cc9cd56b8 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/entity_types_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/entity_type.proto #include "google/cloud/dialogflow_es/internal/entity_types_stub_factory.h" +#include "google/cloud/dialogflow/v2/entity_type.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/entity_types_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/entity_types_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/entity_types_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/entity_types_stub.h" #include "google/cloud/dialogflow_es/internal/entity_types_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/entity_types_stub_factory.h b/google/cloud/dialogflow_es/internal/entity_types_stub_factory.h index 9428bfc382a92..1f2ae01741709 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/entity_types_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENTITY_TYPES_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/entity_types_tracing_connection.cc b/google/cloud/dialogflow_es/internal/entity_types_tracing_connection.cc index 9b25e9c24b759..80ae416f589da 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/entity_types_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EntityTypesTracingConnection::EntityTypesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -287,16 +285,12 @@ Status EntityTypesTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEntityTypesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/entity_types_tracing_connection.h b/google/cloud/dialogflow_es/internal/entity_types_tracing_connection.h index c7a451a91bdca..3214539d82bb7 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/entity_types_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EntityTypesTracingConnection : public dialogflow_es::EntityTypesConnection { public: @@ -142,8 +140,6 @@ class EntityTypesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/entity_types_tracing_stub.cc b/google/cloud/dialogflow_es/internal/entity_types_tracing_stub.cc index 2bf773d17b70e..743a52e1e9029 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/entity_types_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EntityTypesTracingStub::EntityTypesTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -317,18 +318,14 @@ future EntityTypesTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEntityTypesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/entity_types_tracing_stub.h b/google/cloud/dialogflow_es/internal/entity_types_tracing_stub.h index 7757f7f17f880..fce8a1fd8bba8 100644 --- a/google/cloud/dialogflow_es/internal/entity_types_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/entity_types_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EntityTypesTracingStub : public EntityTypesStub { public: ~EntityTypesTracingStub() override = default; @@ -161,8 +162,6 @@ class EntityTypesTracingStub : public EntityTypesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -177,4 +176,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENTITY_TYPES_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/environments_auth_decorator.cc b/google/cloud/dialogflow_es/internal/environments_auth_decorator.cc index 3894d472a633f..382e39246e0c1 100644 --- a/google/cloud/dialogflow_es/internal/environments_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/environments_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/environment.proto #include "google/cloud/dialogflow_es/internal/environments_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/environment.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -131,3 +134,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/environments_auth_decorator.h b/google/cloud/dialogflow_es/internal/environments_auth_decorator.h index f9b95c96e86f4..fc185ff91352a 100644 --- a/google/cloud/dialogflow_es/internal/environments_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/environments_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENVIRONMENTS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/environments_logging_decorator.cc b/google/cloud/dialogflow_es/internal/environments_logging_decorator.cc index 355d13a9e34bf..b96060b54ab52 100644 --- a/google/cloud/dialogflow_es/internal/environments_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/environments_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/environment.proto #include "google/cloud/dialogflow_es/internal/environments_logging_decorator.h" +#include "google/cloud/dialogflow/v2/environment.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -174,3 +177,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/environments_logging_decorator.h b/google/cloud/dialogflow_es/internal/environments_logging_decorator.h index c2311c4b90923..5ed5560ae1c40 100644 --- a/google/cloud/dialogflow_es/internal/environments_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/environments_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENVIRONMENTS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/environments_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/environments_metadata_decorator.cc index 4ef5ba01da821..d7c8d7c60143f 100644 --- a/google/cloud/dialogflow_es/internal/environments_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/environments_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/environment.proto #include "google/cloud/dialogflow_es/internal/environments_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/environment.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -158,3 +162,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/environments_metadata_decorator.h b/google/cloud/dialogflow_es/internal/environments_metadata_decorator.h index c6dad4613df88..45166c0f374cf 100644 --- a/google/cloud/dialogflow_es/internal/environments_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/environments_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENVIRONMENTS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/environments_option_defaults.cc b/google/cloud/dialogflow_es/internal/environments_option_defaults.cc index 0ed2fec3ab491..3d29cc7a11bdf 100644 --- a/google/cloud/dialogflow_es/internal/environments_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/environments_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/environments_option_defaults.h" #include "google/cloud/dialogflow_es/environments_connection.h" #include "google/cloud/dialogflow_es/environments_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options EnvironmentsDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_es::EnvironmentsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/environments_stub.cc b/google/cloud/dialogflow_es/internal/environments_stub.cc index c01f4d3e37be0..2e92ecf8d9e8a 100644 --- a/google/cloud/dialogflow_es/internal/environments_stub.cc +++ b/google/cloud/dialogflow_es/internal/environments_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/v2/environment.proto #include "google/cloud/dialogflow_es/internal/environments_stub.h" +#include "google/cloud/dialogflow/v2/environment.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -164,3 +167,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/environments_stub.h b/google/cloud/dialogflow_es/internal/environments_stub.h index 32bdc10b6c32f..79b11dba641e3 100644 --- a/google/cloud/dialogflow_es/internal/environments_stub.h +++ b/google/cloud/dialogflow_es/internal/environments_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENVIRONMENTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENVIRONMENTS_STUB_H +#include "google/cloud/dialogflow/v2/environment.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -170,4 +173,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENVIRONMENTS_STUB_H diff --git a/google/cloud/dialogflow_es/internal/environments_stub_factory.cc b/google/cloud/dialogflow_es/internal/environments_stub_factory.cc index 5697432bbd7b9..050a52fd0479c 100644 --- a/google/cloud/dialogflow_es/internal/environments_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/environments_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/environment.proto #include "google/cloud/dialogflow_es/internal/environments_stub_factory.h" +#include "google/cloud/dialogflow/v2/environment.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/environments_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/environments_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/environments_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/environments_stub.h" #include "google/cloud/dialogflow_es/internal/environments_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/environments_stub_factory.h b/google/cloud/dialogflow_es/internal/environments_stub_factory.h index 8e2e618ab9bab..86733d21bf17e 100644 --- a/google/cloud/dialogflow_es/internal/environments_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/environments_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENVIRONMENTS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/environments_tracing_connection.cc b/google/cloud/dialogflow_es/internal/environments_tracing_connection.cc index 6291b4e4d33fe..902eb255bc62b 100644 --- a/google/cloud/dialogflow_es/internal/environments_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/environments_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EnvironmentsTracingConnection::EnvironmentsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -140,16 +138,12 @@ Status EnvironmentsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEnvironmentsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/environments_tracing_connection.h b/google/cloud/dialogflow_es/internal/environments_tracing_connection.h index 16477692b18b8..4cbe821654ea3 100644 --- a/google/cloud/dialogflow_es/internal/environments_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/environments_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EnvironmentsTracingConnection : public dialogflow_es::EnvironmentsConnection { public: @@ -83,8 +81,6 @@ class EnvironmentsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/environments_tracing_stub.cc b/google/cloud/dialogflow_es/internal/environments_tracing_stub.cc index 68f7fe39b4c2c..b33f62c1ce540 100644 --- a/google/cloud/dialogflow_es/internal/environments_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/environments_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EnvironmentsTracingStub::EnvironmentsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -162,18 +163,14 @@ Status EnvironmentsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEnvironmentsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/environments_tracing_stub.h b/google/cloud/dialogflow_es/internal/environments_tracing_stub.h index 4a283c83d2c48..ce0086683cb72 100644 --- a/google/cloud/dialogflow_es/internal/environments_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/environments_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EnvironmentsTracingStub : public EnvironmentsStub { public: ~EnvironmentsTracingStub() override = default; @@ -95,8 +96,6 @@ class EnvironmentsTracingStub : public EnvironmentsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -111,4 +110,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_ENVIRONMENTS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/fulfillments_auth_decorator.cc b/google/cloud/dialogflow_es/internal/fulfillments_auth_decorator.cc index 973acdea5c2f9..52f9207e60eb4 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/fulfillments_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/fulfillment.proto #include "google/cloud/dialogflow_es/internal/fulfillments_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/fulfillment.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -95,3 +98,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/fulfillments_auth_decorator.h b/google/cloud/dialogflow_es/internal/fulfillments_auth_decorator.h index 35bb253d26fe8..38cc3dc68c5d3 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/fulfillments_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -78,4 +81,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_FULFILLMENTS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/fulfillments_logging_decorator.cc b/google/cloud/dialogflow_es/internal/fulfillments_logging_decorator.cc index 4b8568f60b4b2..e140de54f801f 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/fulfillments_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/fulfillment.proto #include "google/cloud/dialogflow_es/internal/fulfillments_logging_decorator.h" +#include "google/cloud/dialogflow/v2/fulfillment.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -122,3 +125,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/fulfillments_logging_decorator.h b/google/cloud/dialogflow_es/internal/fulfillments_logging_decorator.h index e8c0e5948a5c1..69dc9cd68a43d 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/fulfillments_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -78,4 +81,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_FULFILLMENTS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/fulfillments_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/fulfillments_metadata_decorator.cc index 22e4a27f1de05..d9826bb59cf02 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/fulfillments_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/fulfillment.proto #include "google/cloud/dialogflow_es/internal/fulfillments_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/fulfillment.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -122,3 +126,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/fulfillments_metadata_decorator.h b/google/cloud/dialogflow_es/internal/fulfillments_metadata_decorator.h index 939310378cbf7..d2f68e7d89e46 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/fulfillments_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -83,4 +86,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_FULFILLMENTS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/fulfillments_option_defaults.cc b/google/cloud/dialogflow_es/internal/fulfillments_option_defaults.cc index 59e6b951f8422..8694d8ae85f3d 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/fulfillments_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/fulfillments_option_defaults.h" #include "google/cloud/dialogflow_es/fulfillments_connection.h" #include "google/cloud/dialogflow_es/fulfillments_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options FulfillmentsDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_es::FulfillmentsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/fulfillments_stub.cc b/google/cloud/dialogflow_es/internal/fulfillments_stub.cc index 4f9ec79825ee9..03b071c5dde5c 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_stub.cc +++ b/google/cloud/dialogflow_es/internal/fulfillments_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/v2/fulfillment.proto #include "google/cloud/dialogflow_es/internal/fulfillments_stub.h" +#include "google/cloud/dialogflow/v2/fulfillment.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -116,3 +119,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/fulfillments_stub.h b/google/cloud/dialogflow_es/internal/fulfillments_stub.h index 98a3fd3619b0f..463ae7da1dfa7 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_stub.h +++ b/google/cloud/dialogflow_es/internal/fulfillments_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_FULFILLMENTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_FULFILLMENTS_STUB_H +#include "google/cloud/dialogflow/v2/fulfillment.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -127,4 +130,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_FULFILLMENTS_STUB_H diff --git a/google/cloud/dialogflow_es/internal/fulfillments_stub_factory.cc b/google/cloud/dialogflow_es/internal/fulfillments_stub_factory.cc index 28937e87773c8..bbf40264daad2 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/fulfillments_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/fulfillment.proto #include "google/cloud/dialogflow_es/internal/fulfillments_stub_factory.h" +#include "google/cloud/dialogflow/v2/fulfillment.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/fulfillments_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/fulfillments_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/fulfillments_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/fulfillments_stub.h" #include "google/cloud/dialogflow_es/internal/fulfillments_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/fulfillments_stub_factory.h b/google/cloud/dialogflow_es/internal/fulfillments_stub_factory.h index ec42b7c7dab58..45b8773336f25 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/fulfillments_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_FULFILLMENTS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/fulfillments_tracing_connection.cc b/google/cloud/dialogflow_es/internal/fulfillments_tracing_connection.cc index 3641d3ab3c3cd..43e2ae1bd0142 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/fulfillments_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FulfillmentsTracingConnection::FulfillmentsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -99,16 +97,12 @@ Status FulfillmentsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFulfillmentsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/fulfillments_tracing_connection.h b/google/cloud/dialogflow_es/internal/fulfillments_tracing_connection.h index 5869d851822db..bde9f70678662 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/fulfillments_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FulfillmentsTracingConnection : public dialogflow_es::FulfillmentsConnection { public: @@ -67,8 +65,6 @@ class FulfillmentsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/fulfillments_tracing_stub.cc b/google/cloud/dialogflow_es/internal/fulfillments_tracing_stub.cc index c2e87d582c952..f02551c8c57c1 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/fulfillments_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FulfillmentsTracingStub::FulfillmentsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -114,18 +115,14 @@ Status FulfillmentsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFulfillmentsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/fulfillments_tracing_stub.h b/google/cloud/dialogflow_es/internal/fulfillments_tracing_stub.h index ba698cd5887f4..04133531ec91d 100644 --- a/google/cloud/dialogflow_es/internal/fulfillments_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/fulfillments_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FulfillmentsTracingStub : public FulfillmentsStub { public: ~FulfillmentsTracingStub() override = default; @@ -74,8 +75,6 @@ class FulfillmentsTracingStub : public FulfillmentsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -90,4 +89,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_FULFILLMENTS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/generators_auth_decorator.cc b/google/cloud/dialogflow_es/internal/generators_auth_decorator.cc index edf2a0a966732..43d70e7c595fd 100644 --- a/google/cloud/dialogflow_es/internal/generators_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/generators_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/generator.proto #include "google/cloud/dialogflow_es/internal/generators_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/generator.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -120,3 +123,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/generators_auth_decorator.h b/google/cloud/dialogflow_es/internal/generators_auth_decorator.h index aa4656a76b83a..d22404311f58f 100644 --- a/google/cloud/dialogflow_es/internal/generators_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/generators_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -93,4 +96,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_GENERATORS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/generators_logging_decorator.cc b/google/cloud/dialogflow_es/internal/generators_logging_decorator.cc index 10427994b6c97..0a80c104dfc41 100644 --- a/google/cloud/dialogflow_es/internal/generators_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/generators_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/generator.proto #include "google/cloud/dialogflow_es/internal/generators_logging_decorator.h" +#include "google/cloud/dialogflow/v2/generator.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -160,3 +163,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/generators_logging_decorator.h b/google/cloud/dialogflow_es/internal/generators_logging_decorator.h index 6bf19efb9066b..84d6342772645 100644 --- a/google/cloud/dialogflow_es/internal/generators_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/generators_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -93,4 +96,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_GENERATORS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/generators_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/generators_metadata_decorator.cc index 2effbf1cc48bb..dea5d8b81dbf3 100644 --- a/google/cloud/dialogflow_es/internal/generators_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/generators_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/generator.proto #include "google/cloud/dialogflow_es/internal/generators_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/generator.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -148,3 +152,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/generators_metadata_decorator.h b/google/cloud/dialogflow_es/internal/generators_metadata_decorator.h index 03f34796b2b12..15b7962003151 100644 --- a/google/cloud/dialogflow_es/internal/generators_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/generators_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -98,4 +101,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_GENERATORS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/generators_option_defaults.cc b/google/cloud/dialogflow_es/internal/generators_option_defaults.cc index 0ea700de25d2f..f63b70e0cbd07 100644 --- a/google/cloud/dialogflow_es/internal/generators_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/generators_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/generators_option_defaults.h" #include "google/cloud/dialogflow_es/generators_connection.h" #include "google/cloud/dialogflow_es/generators_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options GeneratorsDefaultOptions(std::string const& location, Options options) { if (!options.has()) { options.set( dialogflow_es::GeneratorsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/generators_stub.cc b/google/cloud/dialogflow_es/internal/generators_stub.cc index 33a55cbc7baa1..298127fcd3062 100644 --- a/google/cloud/dialogflow_es/internal/generators_stub.cc +++ b/google/cloud/dialogflow_es/internal/generators_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/v2/generator.proto #include "google/cloud/dialogflow_es/internal/generators_stub.h" +#include "google/cloud/dialogflow/v2/generator.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -150,3 +153,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/generators_stub.h b/google/cloud/dialogflow_es/internal/generators_stub.h index 0516f218b58cb..a831b42b197dc 100644 --- a/google/cloud/dialogflow_es/internal/generators_stub.h +++ b/google/cloud/dialogflow_es/internal/generators_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_GENERATORS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_GENERATORS_STUB_H +#include "google/cloud/dialogflow/v2/generator.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -152,4 +155,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_GENERATORS_STUB_H diff --git a/google/cloud/dialogflow_es/internal/generators_stub_factory.cc b/google/cloud/dialogflow_es/internal/generators_stub_factory.cc index 6331fa105a118..a8866e52595af 100644 --- a/google/cloud/dialogflow_es/internal/generators_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/generators_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/generator.proto #include "google/cloud/dialogflow_es/internal/generators_stub_factory.h" +#include "google/cloud/dialogflow/v2/generator.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/generators_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/generators_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/generators_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/generators_stub.h" #include "google/cloud/dialogflow_es/internal/generators_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/generators_stub_factory.h b/google/cloud/dialogflow_es/internal/generators_stub_factory.h index f5c8d33125a62..4d16b9b0e7b43 100644 --- a/google/cloud/dialogflow_es/internal/generators_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/generators_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_GENERATORS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/generators_tracing_connection.cc b/google/cloud/dialogflow_es/internal/generators_tracing_connection.cc index cd0fb508222f9..6592612070cc6 100644 --- a/google/cloud/dialogflow_es/internal/generators_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/generators_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GeneratorsTracingConnection::GeneratorsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -127,16 +125,12 @@ Status GeneratorsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGeneratorsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/generators_tracing_connection.h b/google/cloud/dialogflow_es/internal/generators_tracing_connection.h index 8a35e70b932ec..3dff2f30ae0b1 100644 --- a/google/cloud/dialogflow_es/internal/generators_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/generators_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GeneratorsTracingConnection : public dialogflow_es::GeneratorsConnection { public: ~GeneratorsTracingConnection() override = default; @@ -77,8 +75,6 @@ class GeneratorsTracingConnection : public dialogflow_es::GeneratorsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/generators_tracing_stub.cc b/google/cloud/dialogflow_es/internal/generators_tracing_stub.cc index 400f5ebe0f4cc..9aadba2c1e3fa 100644 --- a/google/cloud/dialogflow_es/internal/generators_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/generators_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GeneratorsTracingStub::GeneratorsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -148,18 +149,14 @@ Status GeneratorsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGeneratorsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/generators_tracing_stub.h b/google/cloud/dialogflow_es/internal/generators_tracing_stub.h index 053912a1c3aad..3c2600d199210 100644 --- a/google/cloud/dialogflow_es/internal/generators_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/generators_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GeneratorsTracingStub : public GeneratorsStub { public: ~GeneratorsTracingStub() override = default; @@ -89,8 +90,6 @@ class GeneratorsTracingStub : public GeneratorsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -105,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_GENERATORS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/intents_auth_decorator.cc b/google/cloud/dialogflow_es/internal/intents_auth_decorator.cc index 0af9d2c103958..73df792c0ad71 100644 --- a/google/cloud/dialogflow_es/internal/intents_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/intents_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/intent.proto #include "google/cloud/dialogflow_es/internal/intents_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/intent.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -209,3 +212,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/intents_auth_decorator.h b/google/cloud/dialogflow_es/internal/intents_auth_decorator.h index d2442a656e49f..4f2111be67584 100644 --- a/google/cloud/dialogflow_es/internal/intents_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/intents_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/intents_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -128,4 +131,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_INTENTS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/intents_connection_impl.h b/google/cloud/dialogflow_es/internal/intents_connection_impl.h index c1e9033b3d0c2..a70b7454ae157 100644 --- a/google/cloud/dialogflow_es/internal/intents_connection_impl.h +++ b/google/cloud/dialogflow_es/internal/intents_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/internal/intents_logging_decorator.cc b/google/cloud/dialogflow_es/internal/intents_logging_decorator.cc index cfa978149ba31..786c242e423b2 100644 --- a/google/cloud/dialogflow_es/internal/intents_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/intents_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/intent.proto #include "google/cloud/dialogflow_es/internal/intents_logging_decorator.h" +#include "google/cloud/dialogflow/v2/intent.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -252,3 +255,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/intents_logging_decorator.h b/google/cloud/dialogflow_es/internal/intents_logging_decorator.h index b84600c33876d..ac1cabc598df9 100644 --- a/google/cloud/dialogflow_es/internal/intents_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/intents_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/intents_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -128,4 +131,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_INTENTS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/intents_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/intents_metadata_decorator.cc index a632500b1ef25..1e881c83ec53d 100644 --- a/google/cloud/dialogflow_es/internal/intents_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/intents_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/intent.proto #include "google/cloud/dialogflow_es/internal/intents_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/intent.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -208,3 +212,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/intents_metadata_decorator.h b/google/cloud/dialogflow_es/internal/intents_metadata_decorator.h index a0b83da70e180..4057aad9b50cc 100644 --- a/google/cloud/dialogflow_es/internal/intents_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/intents_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/dialogflow_es/internal/intents_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 dialogflow_es_internal { @@ -133,4 +136,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_INTENTS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/intents_option_defaults.cc b/google/cloud/dialogflow_es/internal/intents_option_defaults.cc index afe667b1c7213..ab79fd2d19819 100644 --- a/google/cloud/dialogflow_es/internal/intents_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/intents_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/intents_option_defaults.h" #include "google/cloud/dialogflow_es/intents_connection.h" #include "google/cloud/dialogflow_es/intents_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options IntentsDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dialogflow_es::IntentsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dialogflow_es::IntentsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/intents_stub.cc b/google/cloud/dialogflow_es/internal/intents_stub.cc index eecf78a0e437d..8f312832b37d6 100644 --- a/google/cloud/dialogflow_es/internal/intents_stub.cc +++ b/google/cloud/dialogflow_es/internal/intents_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/v2/intent.proto #include "google/cloud/dialogflow_es/internal/intents_stub.h" +#include "google/cloud/dialogflow/v2/intent.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -249,3 +252,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/intents_stub.h b/google/cloud/dialogflow_es/internal/intents_stub.h index 60f357412e85e..d8735be3705ac 100644 --- a/google/cloud/dialogflow_es/internal/intents_stub.h +++ b/google/cloud/dialogflow_es/internal/intents_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_INTENTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_INTENTS_STUB_H +#include "google/cloud/dialogflow/v2/intent.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 -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/protobuf/struct.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -227,4 +230,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_INTENTS_STUB_H diff --git a/google/cloud/dialogflow_es/internal/intents_stub_factory.cc b/google/cloud/dialogflow_es/internal/intents_stub_factory.cc index 83fea3c9d75b7..342f680c2e9ad 100644 --- a/google/cloud/dialogflow_es/internal/intents_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/intents_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/intent.proto #include "google/cloud/dialogflow_es/internal/intents_stub_factory.h" +#include "google/cloud/dialogflow/v2/intent.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/intents_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/intents_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/intents_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/intents_stub.h" #include "google/cloud/dialogflow_es/internal/intents_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/intents_stub_factory.h b/google/cloud/dialogflow_es/internal/intents_stub_factory.h index 3dddb1b118967..475ba93ab553a 100644 --- a/google/cloud/dialogflow_es/internal/intents_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/intents_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_INTENTS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/intents_tracing_connection.cc b/google/cloud/dialogflow_es/internal/intents_tracing_connection.cc index 64549db776ed6..f236591267e51 100644 --- a/google/cloud/dialogflow_es/internal/intents_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/intents_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IntentsTracingConnection::IntentsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -187,15 +185,11 @@ Status IntentsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIntentsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/intents_tracing_connection.h b/google/cloud/dialogflow_es/internal/intents_tracing_connection.h index 105ad30b9531f..7203b4f368dfd 100644 --- a/google/cloud/dialogflow_es/internal/intents_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/intents_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IntentsTracingConnection : public dialogflow_es::IntentsConnection { public: ~IntentsTracingConnection() override = default; @@ -100,8 +98,6 @@ class IntentsTracingConnection : public dialogflow_es::IntentsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/intents_tracing_stub.cc b/google/cloud/dialogflow_es/internal/intents_tracing_stub.cc index 4fb9e6900e691..01485d64c6daa 100644 --- a/google/cloud/dialogflow_es/internal/intents_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/intents_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IntentsTracingStub::IntentsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -226,18 +227,14 @@ future IntentsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIntentsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/intents_tracing_stub.h b/google/cloud/dialogflow_es/internal/intents_tracing_stub.h index 9bcca67edc1d8..990e99e2bf305 100644 --- a/google/cloud/dialogflow_es/internal/intents_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/intents_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IntentsTracingStub : public IntentsStub { public: ~IntentsTracingStub() override = default; @@ -123,8 +124,6 @@ class IntentsTracingStub : public IntentsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -139,4 +138,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_INTENTS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_auth_decorator.cc b/google/cloud/dialogflow_es/internal/knowledge_bases_auth_decorator.cc index 0ed5f8fd9bd15..47f70bc1dbf76 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/knowledge_base.proto #include "google/cloud/dialogflow_es/internal/knowledge_bases_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/knowledge_base.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -121,3 +124,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_auth_decorator.h b/google/cloud/dialogflow_es/internal/knowledge_bases_auth_decorator.h index 888e50a318238..7427971ec45f4 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_KNOWLEDGE_BASES_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_logging_decorator.cc b/google/cloud/dialogflow_es/internal/knowledge_bases_logging_decorator.cc index 5132d91036f2d..8ea7e6b53ae2c 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/knowledge_base.proto #include "google/cloud/dialogflow_es/internal/knowledge_bases_logging_decorator.h" +#include "google/cloud/dialogflow/v2/knowledge_base.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -160,3 +163,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_logging_decorator.h b/google/cloud/dialogflow_es/internal/knowledge_bases_logging_decorator.h index f1f961adfac80..769d6156738ef 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_KNOWLEDGE_BASES_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/knowledge_bases_metadata_decorator.cc index eba56e2ac0f9e..8fd8dd28297b8 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/knowledge_base.proto #include "google/cloud/dialogflow_es/internal/knowledge_bases_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/knowledge_base.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -149,3 +153,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_metadata_decorator.h b/google/cloud/dialogflow_es/internal/knowledge_bases_metadata_decorator.h index c53fa6dee7c8a..ddb1be9be9e99 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_KNOWLEDGE_BASES_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_option_defaults.cc b/google/cloud/dialogflow_es/internal/knowledge_bases_option_defaults.cc index 5d230f4e6a4e8..2d5b90c9a628c 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/knowledge_bases_option_defaults.h" #include "google/cloud/dialogflow_es/knowledge_bases_connection.h" #include "google/cloud/dialogflow_es/knowledge_bases_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options KnowledgeBasesDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_es::KnowledgeBasesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_stub.cc b/google/cloud/dialogflow_es/internal/knowledge_bases_stub.cc index 214805c605279..bfd7c92246c9d 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_stub.cc +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/v2/knowledge_base.proto #include "google/cloud/dialogflow_es/internal/knowledge_bases_stub.h" +#include "google/cloud/dialogflow/v2/knowledge_base.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -152,3 +155,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_stub.h b/google/cloud/dialogflow_es/internal/knowledge_bases_stub.h index 4581fd452a0f2..010d7009637be 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_stub.h +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_KNOWLEDGE_BASES_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_KNOWLEDGE_BASES_STUB_H +#include "google/cloud/dialogflow/v2/knowledge_base.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -161,4 +164,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_KNOWLEDGE_BASES_STUB_H diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_stub_factory.cc b/google/cloud/dialogflow_es/internal/knowledge_bases_stub_factory.cc index f3343f081f766..cb115b1670603 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/knowledge_base.proto #include "google/cloud/dialogflow_es/internal/knowledge_bases_stub_factory.h" +#include "google/cloud/dialogflow/v2/knowledge_base.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/knowledge_bases_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/knowledge_bases_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/knowledge_bases_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/knowledge_bases_stub.h" #include "google/cloud/dialogflow_es/internal/knowledge_bases_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_stub_factory.h b/google/cloud/dialogflow_es/internal/knowledge_bases_stub_factory.h index 01414adc4ed1c..434d9071d5dc1 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_KNOWLEDGE_BASES_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_connection.cc b/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_connection.cc index e54a3e978e39a..5498b616dfa9a 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - KnowledgeBasesTracingConnection::KnowledgeBasesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -128,16 +126,12 @@ Status KnowledgeBasesTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeKnowledgeBasesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_connection.h b/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_connection.h index 31fdc8108611b..594283daed039 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class KnowledgeBasesTracingConnection : public dialogflow_es::KnowledgeBasesConnection { public: @@ -79,8 +77,6 @@ class KnowledgeBasesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_stub.cc b/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_stub.cc index bb2ff686c9f1c..a295a0aa02623 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - KnowledgeBasesTracingStub::KnowledgeBasesTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -150,18 +151,14 @@ Status KnowledgeBasesTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeKnowledgeBasesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_stub.h b/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_stub.h index be8598e83ca3a..c19d5b181dcc7 100644 --- a/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/knowledge_bases_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class KnowledgeBasesTracingStub : public KnowledgeBasesStub { public: ~KnowledgeBasesTracingStub() override = default; @@ -90,8 +91,6 @@ class KnowledgeBasesTracingStub : public KnowledgeBasesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -106,4 +105,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_KNOWLEDGE_BASES_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/participants_auth_decorator.cc b/google/cloud/dialogflow_es/internal/participants_auth_decorator.cc index ae14125c9717f..64cc018c51248 100644 --- a/google/cloud/dialogflow_es/internal/participants_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/participants_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/dialogflow/v2/participant.proto #include "google/cloud/dialogflow_es/internal/participants_auth_decorator.h" +#include "google/cloud/dialogflow/v2/participant.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -179,3 +182,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/participants_auth_decorator.h b/google/cloud/dialogflow_es/internal/participants_auth_decorator.h index 2db3ed9ce02e7..d22d4971ae248 100644 --- a/google/cloud/dialogflow_es/internal/participants_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/participants_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -124,4 +127,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_PARTICIPANTS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/participants_logging_decorator.cc b/google/cloud/dialogflow_es/internal/participants_logging_decorator.cc index e9a4ff83fb719..b3b5571b83747 100644 --- a/google/cloud/dialogflow_es/internal/participants_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/participants_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/dialogflow/v2/participant.proto #include "google/cloud/dialogflow_es/internal/participants_logging_decorator.h" +#include "google/cloud/dialogflow/v2/participant.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -240,3 +243,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/participants_logging_decorator.h b/google/cloud/dialogflow_es/internal/participants_logging_decorator.h index e5e2038fa35b0..e17ffa32b173c 100644 --- a/google/cloud/dialogflow_es/internal/participants_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/participants_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -125,4 +128,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_PARTICIPANTS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/participants_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/participants_metadata_decorator.cc index 3c85881422804..58df15d869f2c 100644 --- a/google/cloud/dialogflow_es/internal/participants_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/participants_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/participant.proto #include "google/cloud/dialogflow_es/internal/participants_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/participant.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -199,3 +203,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/participants_metadata_decorator.h b/google/cloud/dialogflow_es/internal/participants_metadata_decorator.h index 6550b502f86d5..dbb9976eca1cd 100644 --- a/google/cloud/dialogflow_es/internal/participants_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/participants_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_PARTICIPANTS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/participants_option_defaults.cc b/google/cloud/dialogflow_es/internal/participants_option_defaults.cc index e05b9b3b3db5e..e4e7c77c85cfd 100644 --- a/google/cloud/dialogflow_es/internal/participants_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/participants_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/participants_option_defaults.h" #include "google/cloud/dialogflow_es/participants_connection.h" #include "google/cloud/dialogflow_es/participants_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options ParticipantsDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_es::ParticipantsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/participants_stub.cc b/google/cloud/dialogflow_es/internal/participants_stub.cc index 3ee8c6fda21a1..f023b610a9353 100644 --- a/google/cloud/dialogflow_es/internal/participants_stub.cc +++ b/google/cloud/dialogflow_es/internal/participants_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/v2/participant.proto #include "google/cloud/dialogflow_es/internal/participants_stub.h" +#include "google/cloud/dialogflow/v2/participant.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -219,3 +222,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/participants_stub.h b/google/cloud/dialogflow_es/internal/participants_stub.h index a3efb4ea23804..b5494af2ac689 100644 --- a/google/cloud/dialogflow_es/internal/participants_stub.h +++ b/google/cloud/dialogflow_es/internal/participants_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_PARTICIPANTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_PARTICIPANTS_STUB_H +#include "google/cloud/dialogflow/v2/participant.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/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -223,4 +226,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_PARTICIPANTS_STUB_H diff --git a/google/cloud/dialogflow_es/internal/participants_stub_factory.cc b/google/cloud/dialogflow_es/internal/participants_stub_factory.cc index 8e11801eee331..a427947d27012 100644 --- a/google/cloud/dialogflow_es/internal/participants_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/participants_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/participant.proto #include "google/cloud/dialogflow_es/internal/participants_stub_factory.h" +#include "google/cloud/dialogflow/v2/participant.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/participants_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/participants_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/participants_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/participants_stub.h" #include "google/cloud/dialogflow_es/internal/participants_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/participants_stub_factory.h b/google/cloud/dialogflow_es/internal/participants_stub_factory.h index 2716045979a73..f47f3f0bde54e 100644 --- a/google/cloud/dialogflow_es/internal/participants_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/participants_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_PARTICIPANTS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/participants_tracing_connection.cc b/google/cloud/dialogflow_es/internal/participants_tracing_connection.cc index 728220911761d..df70bafe9c2b7 100644 --- a/google/cloud/dialogflow_es/internal/participants_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/participants_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ParticipantsTracingConnection::ParticipantsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -173,16 +171,12 @@ Status ParticipantsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeParticipantsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/participants_tracing_connection.h b/google/cloud/dialogflow_es/internal/participants_tracing_connection.h index 236ee7f7bb93f..a914ea6aaa76b 100644 --- a/google/cloud/dialogflow_es/internal/participants_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/participants_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ParticipantsTracingConnection : public dialogflow_es::ParticipantsConnection { public: @@ -102,8 +100,6 @@ class ParticipantsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/participants_tracing_stub.cc b/google/cloud/dialogflow_es/internal/participants_tracing_stub.cc index 1f6ff0d466454..aae7e43897a5e 100644 --- a/google/cloud/dialogflow_es/internal/participants_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/participants_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ParticipantsTracingStub::ParticipantsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -219,18 +220,14 @@ Status ParticipantsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeParticipantsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/participants_tracing_stub.h b/google/cloud/dialogflow_es/internal/participants_tracing_stub.h index 234cc47f9b3d1..9372f1db6c157 100644 --- a/google/cloud/dialogflow_es/internal/participants_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/participants_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ParticipantsTracingStub : public ParticipantsStub { public: ~ParticipantsTracingStub() override = default; @@ -120,8 +121,6 @@ class ParticipantsTracingStub : public ParticipantsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -136,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_PARTICIPANTS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_auth_decorator.cc b/google/cloud/dialogflow_es/internal/session_entity_types_auth_decorator.cc index 4f88141007125..15205ee6d5a87 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/session_entity_types_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/session_entity_type.proto #include "google/cloud/dialogflow_es/internal/session_entity_types_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/session_entity_type.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -125,3 +128,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_auth_decorator.h b/google/cloud/dialogflow_es/internal/session_entity_types_auth_decorator.h index fbfeb8640c151..4794b65532348 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/session_entity_types_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSION_ENTITY_TYPES_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_logging_decorator.cc b/google/cloud/dialogflow_es/internal/session_entity_types_logging_decorator.cc index 505061365240b..7b8293de7806c 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/session_entity_types_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/session_entity_type.proto #include "google/cloud/dialogflow_es/internal/session_entity_types_logging_decorator.h" +#include "google/cloud/dialogflow/v2/session_entity_type.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -169,3 +172,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_logging_decorator.h b/google/cloud/dialogflow_es/internal/session_entity_types_logging_decorator.h index c1c7871ea6d23..158a956bdb60a 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/session_entity_types_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSION_ENTITY_TYPES_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/session_entity_types_metadata_decorator.cc index f01fa8c8d131c..5350687709106 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/session_entity_types_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/session_entity_type.proto #include "google/cloud/dialogflow_es/internal/session_entity_types_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/session_entity_type.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -155,3 +159,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_metadata_decorator.h b/google/cloud/dialogflow_es/internal/session_entity_types_metadata_decorator.h index 654b451209b53..e22d7fe616087 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/session_entity_types_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSION_ENTITY_TYPES_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_option_defaults.cc b/google/cloud/dialogflow_es/internal/session_entity_types_option_defaults.cc index ff10adb60e330..d11e01c2dc7ef 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/session_entity_types_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/session_entity_types_option_defaults.h" #include "google/cloud/dialogflow_es/session_entity_types_connection.h" #include "google/cloud/dialogflow_es/session_entity_types_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options SessionEntityTypesDefaultOptions(std::string const& location, if (!options.has()) { options.set( dialogflow_es::SessionEntityTypesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_stub.cc b/google/cloud/dialogflow_es/internal/session_entity_types_stub.cc index cbab06dba02e0..37cdbde327e5a 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_stub.cc +++ b/google/cloud/dialogflow_es/internal/session_entity_types_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/v2/session_entity_type.proto #include "google/cloud/dialogflow_es/internal/session_entity_types_stub.h" +#include "google/cloud/dialogflow/v2/session_entity_type.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -160,3 +163,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_stub.h b/google/cloud/dialogflow_es/internal/session_entity_types_stub.h index 7c73d34c1186d..7fb000452d63b 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_stub.h +++ b/google/cloud/dialogflow_es/internal/session_entity_types_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSION_ENTITY_TYPES_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSION_ENTITY_TYPES_STUB_H +#include "google/cloud/dialogflow/v2/session_entity_type.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -167,4 +170,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSION_ENTITY_TYPES_STUB_H diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_stub_factory.cc b/google/cloud/dialogflow_es/internal/session_entity_types_stub_factory.cc index 937b169e71910..7ae1b4c51db83 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/session_entity_types_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/session_entity_type.proto #include "google/cloud/dialogflow_es/internal/session_entity_types_stub_factory.h" +#include "google/cloud/dialogflow/v2/session_entity_type.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/session_entity_types_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/session_entity_types_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/session_entity_types_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/session_entity_types_stub.h" #include "google/cloud/dialogflow_es/internal/session_entity_types_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_stub_factory.h b/google/cloud/dialogflow_es/internal/session_entity_types_stub_factory.h index 4cdd17d892c3e..225a17ebd1e02 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/session_entity_types_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSION_ENTITY_TYPES_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_tracing_connection.cc b/google/cloud/dialogflow_es/internal/session_entity_types_tracing_connection.cc index c67408487b7c6..64bc3aa3a12ca 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/session_entity_types_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SessionEntityTypesTracingConnection::SessionEntityTypesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -131,17 +129,13 @@ Status SessionEntityTypesTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSessionEntityTypesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_tracing_connection.h b/google/cloud/dialogflow_es/internal/session_entity_types_tracing_connection.h index f48041dba7723..08ed6091cd0b5 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/session_entity_types_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SessionEntityTypesTracingConnection : public dialogflow_es::SessionEntityTypesConnection { public: @@ -83,8 +81,6 @@ class SessionEntityTypesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_tracing_stub.cc b/google/cloud/dialogflow_es/internal/session_entity_types_tracing_stub.cc index 1628fc9d17afc..aa6a6cd041ff3 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/session_entity_types_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SessionEntityTypesTracingStub::SessionEntityTypesTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -162,18 +163,14 @@ Status SessionEntityTypesTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSessionEntityTypesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/session_entity_types_tracing_stub.h b/google/cloud/dialogflow_es/internal/session_entity_types_tracing_stub.h index 5399cd0010daf..8a9f594cff465 100644 --- a/google/cloud/dialogflow_es/internal/session_entity_types_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/session_entity_types_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SessionEntityTypesTracingStub : public SessionEntityTypesStub { public: ~SessionEntityTypesTracingStub() override = default; @@ -94,8 +95,6 @@ class SessionEntityTypesTracingStub : public SessionEntityTypesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -110,4 +109,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSION_ENTITY_TYPES_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/sessions_auth_decorator.cc b/google/cloud/dialogflow_es/internal/sessions_auth_decorator.cc index fde13dcac5733..7576fcd29936f 100644 --- a/google/cloud/dialogflow_es/internal/sessions_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/sessions_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/dialogflow/v2/session.proto #include "google/cloud/dialogflow_es/internal/sessions_auth_decorator.h" +#include "google/cloud/dialogflow/v2/session.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -106,3 +109,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/sessions_auth_decorator.h b/google/cloud/dialogflow_es/internal/sessions_auth_decorator.h index 5640fed848288..3161280855f41 100644 --- a/google/cloud/dialogflow_es/internal/sessions_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/sessions_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -81,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSIONS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/sessions_logging_decorator.cc b/google/cloud/dialogflow_es/internal/sessions_logging_decorator.cc index 7ff27c2052d9e..efd5ecc5a0d9c 100644 --- a/google/cloud/dialogflow_es/internal/sessions_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/sessions_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/dialogflow/v2/session.proto #include "google/cloud/dialogflow_es/internal/sessions_logging_decorator.h" +#include "google/cloud/dialogflow/v2/session.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -135,3 +138,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/sessions_logging_decorator.h b/google/cloud/dialogflow_es/internal/sessions_logging_decorator.h index 1234454d4dd95..3ed963ad41bfe 100644 --- a/google/cloud/dialogflow_es/internal/sessions_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/sessions_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -82,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/sessions_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/sessions_metadata_decorator.cc index 2a652b601a431..582542ec76500 100644 --- a/google/cloud/dialogflow_es/internal/sessions_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/sessions_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/session.proto #include "google/cloud/dialogflow_es/internal/sessions_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/session.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -124,3 +128,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/sessions_metadata_decorator.h b/google/cloud/dialogflow_es/internal/sessions_metadata_decorator.h index ddaa4f045eef7..4480028efdec7 100644 --- a/google/cloud/dialogflow_es/internal/sessions_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/sessions_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -86,4 +89,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSIONS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/sessions_option_defaults.cc b/google/cloud/dialogflow_es/internal/sessions_option_defaults.cc index 7ffd7c1933957..538d53c194aee 100644 --- a/google/cloud/dialogflow_es/internal/sessions_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/sessions_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/sessions_option_defaults.h" #include "google/cloud/dialogflow_es/sessions_connection.h" #include "google/cloud/dialogflow_es/sessions_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options SessionsDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dialogflow_es::SessionsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dialogflow_es::SessionsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/sessions_stub.cc b/google/cloud/dialogflow_es/internal/sessions_stub.cc index 98506692d7848..00111bad703ec 100644 --- a/google/cloud/dialogflow_es/internal/sessions_stub.cc +++ b/google/cloud/dialogflow_es/internal/sessions_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/dialogflow/v2/session.proto #include "google/cloud/dialogflow_es/internal/sessions_stub.h" +#include "google/cloud/dialogflow/v2/session.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -120,3 +123,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/sessions_stub.h b/google/cloud/dialogflow_es/internal/sessions_stub.h index a31887e2ac812..dfeb9ef7b0b07 100644 --- a/google/cloud/dialogflow_es/internal/sessions_stub.h +++ b/google/cloud/dialogflow_es/internal/sessions_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSIONS_STUB_H +#include "google/cloud/dialogflow/v2/session.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/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -134,4 +137,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSIONS_STUB_H diff --git a/google/cloud/dialogflow_es/internal/sessions_stub_factory.cc b/google/cloud/dialogflow_es/internal/sessions_stub_factory.cc index 9f9f41adf1073..b330e1f3d26df 100644 --- a/google/cloud/dialogflow_es/internal/sessions_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/sessions_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/session.proto #include "google/cloud/dialogflow_es/internal/sessions_stub_factory.h" +#include "google/cloud/dialogflow/v2/session.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/sessions_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/sessions_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/sessions_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/sessions_stub.h" #include "google/cloud/dialogflow_es/internal/sessions_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/sessions_stub_factory.h b/google/cloud/dialogflow_es/internal/sessions_stub_factory.h index bd4b331a011f1..a3d76858481b9 100644 --- a/google/cloud/dialogflow_es/internal/sessions_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/sessions_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSIONS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/sessions_tracing_connection.cc b/google/cloud/dialogflow_es/internal/sessions_tracing_connection.cc index cdd034ce46a73..8d8e3d0b3a958 100644 --- a/google/cloud/dialogflow_es/internal/sessions_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/sessions_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SessionsTracingConnection::SessionsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -97,16 +95,12 @@ Status SessionsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSessionsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/sessions_tracing_connection.h b/google/cloud/dialogflow_es/internal/sessions_tracing_connection.h index 9e709e59ecd9d..98015b5009a20 100644 --- a/google/cloud/dialogflow_es/internal/sessions_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/sessions_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SessionsTracingConnection : public dialogflow_es::SessionsConnection { public: ~SessionsTracingConnection() override = default; @@ -67,8 +65,6 @@ class SessionsTracingConnection : public dialogflow_es::SessionsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/sessions_tracing_stub.cc b/google/cloud/dialogflow_es/internal/sessions_tracing_stub.cc index 2382ab17231f4..735d63a0dc1ed 100644 --- a/google/cloud/dialogflow_es/internal/sessions_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/sessions_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SessionsTracingStub::SessionsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -119,18 +120,14 @@ Status SessionsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSessionsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/sessions_tracing_stub.h b/google/cloud/dialogflow_es/internal/sessions_tracing_stub.h index 2373cbdaa9477..6e9c2bb2e0a67 100644 --- a/google/cloud/dialogflow_es/internal/sessions_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/sessions_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SessionsTracingStub : public SessionsStub { public: ~SessionsTracingStub() override = default; @@ -77,8 +78,6 @@ class SessionsTracingStub : public SessionsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -93,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSIONS_TRACING_STUB_H diff --git a/google/cloud/dialogflow_es/internal/versions_auth_decorator.cc b/google/cloud/dialogflow_es/internal/versions_auth_decorator.cc index 886bd1c6f07a3..7b9b624a09ae0 100644 --- a/google/cloud/dialogflow_es/internal/versions_auth_decorator.cc +++ b/google/cloud/dialogflow_es/internal/versions_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/dialogflow/v2/version.proto #include "google/cloud/dialogflow_es/internal/versions_auth_decorator.h" -#include +#include "google/cloud/dialogflow/v2/version.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -118,3 +121,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/versions_auth_decorator.h b/google/cloud/dialogflow_es/internal/versions_auth_decorator.h index 54857f41bc6aa..0f4845cc45bcc 100644 --- a/google/cloud/dialogflow_es/internal/versions_auth_decorator.h +++ b/google/cloud/dialogflow_es/internal/versions_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -92,4 +95,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_VERSIONS_AUTH_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/versions_logging_decorator.cc b/google/cloud/dialogflow_es/internal/versions_logging_decorator.cc index 223869f10aaef..626d7357ee233 100644 --- a/google/cloud/dialogflow_es/internal/versions_logging_decorator.cc +++ b/google/cloud/dialogflow_es/internal/versions_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/dialogflow/v2/version.proto #include "google/cloud/dialogflow_es/internal/versions_logging_decorator.h" +#include "google/cloud/dialogflow/v2/version.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -156,3 +159,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/versions_logging_decorator.h b/google/cloud/dialogflow_es/internal/versions_logging_decorator.h index 63445f4e7516c..f720033cd7438 100644 --- a/google/cloud/dialogflow_es/internal/versions_logging_decorator.h +++ b/google/cloud/dialogflow_es/internal/versions_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -92,4 +95,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_VERSIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/versions_metadata_decorator.cc b/google/cloud/dialogflow_es/internal/versions_metadata_decorator.cc index caefaf1313e08..14666f016484c 100644 --- a/google/cloud/dialogflow_es/internal/versions_metadata_decorator.cc +++ b/google/cloud/dialogflow_es/internal/versions_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/dialogflow/v2/version.proto #include "google/cloud/dialogflow_es/internal/versions_metadata_decorator.h" +#include "google/cloud/dialogflow/v2/version.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 dialogflow_es_internal { @@ -147,3 +151,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/versions_metadata_decorator.h b/google/cloud/dialogflow_es/internal/versions_metadata_decorator.h index d79bef069e196..079b1ddd73c6d 100644 --- a/google/cloud/dialogflow_es/internal/versions_metadata_decorator.h +++ b/google/cloud/dialogflow_es/internal/versions_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_VERSIONS_METADATA_DECORATOR_H diff --git a/google/cloud/dialogflow_es/internal/versions_option_defaults.cc b/google/cloud/dialogflow_es/internal/versions_option_defaults.cc index 1e4c09787a043..df1443c8a68fd 100644 --- a/google/cloud/dialogflow_es/internal/versions_option_defaults.cc +++ b/google/cloud/dialogflow_es/internal/versions_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/dialogflow_es/internal/versions_option_defaults.h" #include "google/cloud/dialogflow_es/versions_connection.h" #include "google/cloud/dialogflow_es/versions_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options VersionsDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dialogflow_es::VersionsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dialogflow_es::VersionsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dialogflow_es/internal/versions_stub.cc b/google/cloud/dialogflow_es/internal/versions_stub.cc index 737849e7469e0..085b73b62e7df 100644 --- a/google/cloud/dialogflow_es/internal/versions_stub.cc +++ b/google/cloud/dialogflow_es/internal/versions_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/dialogflow/v2/version.proto #include "google/cloud/dialogflow_es/internal/versions_stub.h" +#include "google/cloud/dialogflow/v2/version.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -150,3 +153,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/versions_stub.h b/google/cloud/dialogflow_es/internal/versions_stub.h index f292d03d777f4..881485c7cac88 100644 --- a/google/cloud/dialogflow_es/internal/versions_stub.h +++ b/google/cloud/dialogflow_es/internal/versions_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_VERSIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_VERSIONS_STUB_H +#include "google/cloud/dialogflow/v2/version.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -151,4 +154,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_VERSIONS_STUB_H diff --git a/google/cloud/dialogflow_es/internal/versions_stub_factory.cc b/google/cloud/dialogflow_es/internal/versions_stub_factory.cc index 5a35f880b7f75..3130accd01c2d 100644 --- a/google/cloud/dialogflow_es/internal/versions_stub_factory.cc +++ b/google/cloud/dialogflow_es/internal/versions_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/dialogflow/v2/version.proto #include "google/cloud/dialogflow_es/internal/versions_stub_factory.h" +#include "google/cloud/dialogflow/v2/version.grpc.pb.h" #include "google/cloud/dialogflow_es/internal/versions_auth_decorator.h" #include "google/cloud/dialogflow_es/internal/versions_logging_decorator.h" #include "google/cloud/dialogflow_es/internal/versions_metadata_decorator.h" #include "google/cloud/dialogflow_es/internal/versions_stub.h" #include "google/cloud/dialogflow_es/internal/versions_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/versions_stub_factory.h b/google/cloud/dialogflow_es/internal/versions_stub_factory.h index 0229c64ed206f..86994f1bb72ef 100644 --- a/google/cloud/dialogflow_es/internal/versions_stub_factory.h +++ b/google/cloud/dialogflow_es/internal/versions_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_VERSIONS_STUB_FACTORY_H diff --git a/google/cloud/dialogflow_es/internal/versions_tracing_connection.cc b/google/cloud/dialogflow_es/internal/versions_tracing_connection.cc index 74f76fc5aece3..b98337246c6e8 100644 --- a/google/cloud/dialogflow_es/internal/versions_tracing_connection.cc +++ b/google/cloud/dialogflow_es/internal/versions_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VersionsTracingConnection::VersionsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -127,16 +125,12 @@ Status VersionsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVersionsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dialogflow_es/internal/versions_tracing_connection.h b/google/cloud/dialogflow_es/internal/versions_tracing_connection.h index 9add177d8d782..8ac39b326309f 100644 --- a/google/cloud/dialogflow_es/internal/versions_tracing_connection.h +++ b/google/cloud/dialogflow_es/internal/versions_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VersionsTracingConnection : public dialogflow_es::VersionsConnection { public: ~VersionsTracingConnection() override = default; @@ -76,8 +74,6 @@ class VersionsTracingConnection : public dialogflow_es::VersionsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dialogflow_es/internal/versions_tracing_stub.cc b/google/cloud/dialogflow_es/internal/versions_tracing_stub.cc index 354012cf4225e..d69bee3b939c9 100644 --- a/google/cloud/dialogflow_es/internal/versions_tracing_stub.cc +++ b/google/cloud/dialogflow_es/internal/versions_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VersionsTracingStub::VersionsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -147,18 +148,14 @@ Status VersionsTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVersionsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dialogflow_es/internal/versions_tracing_stub.h b/google/cloud/dialogflow_es/internal/versions_tracing_stub.h index 329f3539086d6..5f397ee889d4b 100644 --- a/google/cloud/dialogflow_es/internal/versions_tracing_stub.h +++ b/google/cloud/dialogflow_es/internal/versions_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VersionsTracingStub : public VersionsStub { public: ~VersionsTracingStub() override = default; @@ -88,8 +89,6 @@ class VersionsTracingStub : public VersionsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -104,4 +103,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_VERSIONS_TRACING_STUB_H 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/knowledge_bases_connection.h b/google/cloud/dialogflow_es/knowledge_bases_connection.h index d99bd477ef388..8cf65f238e221 100644 --- a/google/cloud/dialogflow_es/knowledge_bases_connection.h +++ b/google/cloud/dialogflow_es/knowledge_bases_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_KNOWLEDGE_BASES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_KNOWLEDGE_BASES_CONNECTION_H +#include "google/cloud/dialogflow/v2/knowledge_base.pb.h" #include "google/cloud/dialogflow_es/internal/knowledge_bases_retry_traits.h" #include "google/cloud/dialogflow_es/knowledge_bases_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_es/knowledge_bases_connection_idempotency_policy.h b/google/cloud/dialogflow_es/knowledge_bases_connection_idempotency_policy.h index 19ee297dad4c4..e079e30e388c6 100644 --- a/google/cloud/dialogflow_es/knowledge_bases_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/knowledge_bases_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_KNOWLEDGE_BASES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_KNOWLEDGE_BASES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/knowledge_base.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/participants_connection.h b/google/cloud/dialogflow_es/participants_connection.h index 6172d262c32bd..fde1a2b471bcf 100644 --- a/google/cloud/dialogflow_es/participants_connection.h +++ b/google/cloud/dialogflow_es/participants_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_PARTICIPANTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_PARTICIPANTS_CONNECTION_H +#include "google/cloud/dialogflow/v2/participant.pb.h" #include "google/cloud/dialogflow_es/internal/participants_retry_traits.h" #include "google/cloud/dialogflow_es/participants_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -28,7 +29,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_es/participants_connection_idempotency_policy.h b/google/cloud/dialogflow_es/participants_connection_idempotency_policy.h index 951ebd091422a..3df8057038019 100644 --- a/google/cloud/dialogflow_es/participants_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/participants_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_PARTICIPANTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_PARTICIPANTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/participant.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dialogflow_es/quickstart/.bazelrc b/google/cloud/dialogflow_es/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/dialogflow_es/quickstart/.bazelrc +++ b/google/cloud/dialogflow_es/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/dialogflow_es/quickstart/CMakeLists.txt index dcc0fa7b26cdb..c75ac7f210e55 100644 --- a/google/cloud/dialogflow_es/quickstart/CMakeLists.txt +++ b/google/cloud/dialogflow_es/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Dialogflow API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-dialogflow_es-quickstart CXX) find_package(google_cloud_cpp_dialogflow_es REQUIRED) diff --git a/google/cloud/dialogflow_es/quickstart/WORKSPACE.bazel b/google/cloud/dialogflow_es/quickstart/WORKSPACE.bazel index f04ac4449aee4..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 = "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/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/session_entity_types_connection.h b/google/cloud/dialogflow_es/session_entity_types_connection.h index 671a4c84c1042..acdc0d0a7ab1b 100644 --- a/google/cloud/dialogflow_es/session_entity_types_connection.h +++ b/google/cloud/dialogflow_es/session_entity_types_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_SESSION_ENTITY_TYPES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_SESSION_ENTITY_TYPES_CONNECTION_H +#include "google/cloud/dialogflow/v2/session_entity_type.pb.h" #include "google/cloud/dialogflow_es/internal/session_entity_types_retry_traits.h" #include "google/cloud/dialogflow_es/session_entity_types_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_es/session_entity_types_connection_idempotency_policy.h b/google/cloud/dialogflow_es/session_entity_types_connection_idempotency_policy.h index 40f4b88783f8a..7a3aaed78f3e1 100644 --- a/google/cloud/dialogflow_es/session_entity_types_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/session_entity_types_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_SESSION_ENTITY_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_SESSION_ENTITY_TYPES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/session_entity_type.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/sessions_connection.h b/google/cloud/dialogflow_es/sessions_connection.h index 87045e2e46e7b..1bc3e1f32ae4b 100644 --- a/google/cloud/dialogflow_es/sessions_connection.h +++ b/google/cloud/dialogflow_es/sessions_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_SESSIONS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_SESSIONS_CONNECTION_H +#include "google/cloud/dialogflow/v2/session.pb.h" #include "google/cloud/dialogflow_es/internal/sessions_retry_traits.h" #include "google/cloud/dialogflow_es/sessions_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -28,7 +29,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_es/sessions_connection_idempotency_policy.h b/google/cloud/dialogflow_es/sessions_connection_idempotency_policy.h index 55f650c2d6ca7..31e945c2a749a 100644 --- a/google/cloud/dialogflow_es/sessions_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/sessions_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_SESSIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_SESSIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/session.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/dialogflow_es/versions_connection.h b/google/cloud/dialogflow_es/versions_connection.h index 18a57548c0c5d..1f6670fcd7b55 100644 --- a/google/cloud/dialogflow_es/versions_connection.h +++ b/google/cloud/dialogflow_es/versions_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_VERSIONS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_VERSIONS_CONNECTION_H +#include "google/cloud/dialogflow/v2/version.pb.h" #include "google/cloud/dialogflow_es/internal/versions_retry_traits.h" #include "google/cloud/dialogflow_es/versions_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/dialogflow_es/versions_connection_idempotency_policy.h b/google/cloud/dialogflow_es/versions_connection_idempotency_policy.h index 3288acda73a9e..6962038f43aef 100644 --- a/google/cloud/dialogflow_es/versions_connection_idempotency_policy.h +++ b/google/cloud/dialogflow_es/versions_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_VERSIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_VERSIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/dialogflow/v2/version.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/BUILD.bazel b/google/cloud/discoveryengine/BUILD.bazel index 3670e12cae5ab..4e00cdb5fb071 100644 --- a/google/cloud/discoveryengine/BUILD.bazel +++ b/google/cloud/discoveryengine/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/discoveryengine/v1:discoveryengine_cc_grpc", + "@googleapis//google/cloud/discoveryengine/v1:discoveryengine_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/discoveryengine/quickstart/.bazelrc b/google/cloud/discoveryengine/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/discoveryengine/quickstart/.bazelrc +++ b/google/cloud/discoveryengine/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/discoveryengine/quickstart/CMakeLists.txt index cebf2a6828052..8558b10359396 100644 --- a/google/cloud/discoveryengine/quickstart/CMakeLists.txt +++ b/google/cloud/discoveryengine/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Discovery Engine API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-discoveryengine-quickstart CXX) find_package(google_cloud_cpp_discoveryengine REQUIRED) diff --git a/google/cloud/discoveryengine/quickstart/WORKSPACE.bazel b/google/cloud/discoveryengine/quickstart/WORKSPACE.bazel index b8f8f638a1c6e..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 = "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/discoveryengine/v1/completion_client.h b/google/cloud/discoveryengine/v1/completion_client.h index 0d82e290d0592..edc80a96905af 100644 --- a/google/cloud/discoveryengine/v1/completion_client.h +++ b/google/cloud/discoveryengine/v1/completion_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -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/completion_connection.h b/google/cloud/discoveryengine/v1/completion_connection.h index 999c873e60f35..c987880ffb52a 100644 --- a/google/cloud/discoveryengine/v1/completion_connection.h +++ b/google/cloud/discoveryengine/v1/completion_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_COMPLETION_CONNECTION_H #include "google/cloud/discoveryengine/v1/completion_connection_idempotency_policy.h" +#include "google/cloud/discoveryengine/v1/completion_service.pb.h" #include "google/cloud/discoveryengine/v1/internal/completion_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/completion_connection_idempotency_policy.h b/google/cloud/discoveryengine/v1/completion_connection_idempotency_policy.h index 3f34fec1ed967..aea26257eadcf 100644 --- a/google/cloud/discoveryengine/v1/completion_connection_idempotency_policy.h +++ b/google/cloud/discoveryengine/v1/completion_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_COMPLETION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_COMPLETION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/discoveryengine/v1/completion_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/control_connection.h b/google/cloud/discoveryengine/v1/control_connection.h index 059a4e1b2dcdd..309d9eecdbd43 100644 --- a/google/cloud/discoveryengine/v1/control_connection.h +++ b/google/cloud/discoveryengine/v1/control_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_CONTROL_CONNECTION_H #include "google/cloud/discoveryengine/v1/control_connection_idempotency_policy.h" +#include "google/cloud/discoveryengine/v1/control_service.pb.h" #include "google/cloud/discoveryengine/v1/internal/control_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/discoveryengine/v1/control_connection_idempotency_policy.h b/google/cloud/discoveryengine/v1/control_connection_idempotency_policy.h index 2b7ca3d82f4e3..4a97bea1ecc75 100644 --- a/google/cloud/discoveryengine/v1/control_connection_idempotency_policy.h +++ b/google/cloud/discoveryengine/v1/control_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_CONTROL_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_CONTROL_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/discoveryengine/v1/control_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/conversational_search_connection.h b/google/cloud/discoveryengine/v1/conversational_search_connection.h index 40550f69dbc58..0e7dc0f3938a9 100644 --- a/google/cloud/discoveryengine/v1/conversational_search_connection.h +++ b/google/cloud/discoveryengine/v1/conversational_search_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_CONVERSATIONAL_SEARCH_CONNECTION_H #include "google/cloud/discoveryengine/v1/conversational_search_connection_idempotency_policy.h" +#include "google/cloud/discoveryengine/v1/conversational_search_service.pb.h" #include "google/cloud/discoveryengine/v1/internal/conversational_search_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/discoveryengine/v1/conversational_search_connection_idempotency_policy.h b/google/cloud/discoveryengine/v1/conversational_search_connection_idempotency_policy.h index 59d29955967a3..813a34a74bbaa 100644 --- a/google/cloud/discoveryengine/v1/conversational_search_connection_idempotency_policy.h +++ b/google/cloud/discoveryengine/v1/conversational_search_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_CONVERSATIONAL_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_CONVERSATIONAL_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/discoveryengine/v1/conversational_search_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/data_store_client.h b/google/cloud/discoveryengine/v1/data_store_client.h index bdc1454257ded..eb19f5aac9048 100644 --- a/google/cloud/discoveryengine/v1/data_store_client.h +++ b/google/cloud/discoveryengine/v1/data_store_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -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/data_store_connection.h b/google/cloud/discoveryengine/v1/data_store_connection.h index 1d7c007f4c0d2..37e2edcbf0563 100644 --- a/google/cloud/discoveryengine/v1/data_store_connection.h +++ b/google/cloud/discoveryengine/v1/data_store_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_DATA_STORE_CONNECTION_H #include "google/cloud/discoveryengine/v1/data_store_connection_idempotency_policy.h" +#include "google/cloud/discoveryengine/v1/data_store_service.pb.h" #include "google/cloud/discoveryengine/v1/internal/data_store_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/data_store_connection_idempotency_policy.h b/google/cloud/discoveryengine/v1/data_store_connection_idempotency_policy.h index f51cc65dd0063..4eecdaff2daea 100644 --- a/google/cloud/discoveryengine/v1/data_store_connection_idempotency_policy.h +++ b/google/cloud/discoveryengine/v1/data_store_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_DATA_STORE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_DATA_STORE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/discoveryengine/v1/data_store_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/document_client.h b/google/cloud/discoveryengine/v1/document_client.h index 33b23cc39014e..f8e6a98ba8176 100644 --- a/google/cloud/discoveryengine/v1/document_client.h +++ b/google/cloud/discoveryengine/v1/document_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -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/document_connection.h b/google/cloud/discoveryengine/v1/document_connection.h index aef2c44d58c39..6260954c3c4ca 100644 --- a/google/cloud/discoveryengine/v1/document_connection.h +++ b/google/cloud/discoveryengine/v1/document_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_DOCUMENT_CONNECTION_H #include "google/cloud/discoveryengine/v1/document_connection_idempotency_policy.h" +#include "google/cloud/discoveryengine/v1/document_service.pb.h" #include "google/cloud/discoveryengine/v1/internal/document_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/document_connection_idempotency_policy.h b/google/cloud/discoveryengine/v1/document_connection_idempotency_policy.h index 3bb76b6005f31..e8a6c883d20be 100644 --- a/google/cloud/discoveryengine/v1/document_connection_idempotency_policy.h +++ b/google/cloud/discoveryengine/v1/document_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_DOCUMENT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_DOCUMENT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/discoveryengine/v1/document_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/engine_client.h b/google/cloud/discoveryengine/v1/engine_client.h index 26dc988e8b86e..2c985a686bfee 100644 --- a/google/cloud/discoveryengine/v1/engine_client.h +++ b/google/cloud/discoveryengine/v1/engine_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -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/engine_connection.h b/google/cloud/discoveryengine/v1/engine_connection.h index e4537710a2e39..6bd554fc42eb1 100644 --- a/google/cloud/discoveryengine/v1/engine_connection.h +++ b/google/cloud/discoveryengine/v1/engine_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_ENGINE_CONNECTION_H #include "google/cloud/discoveryengine/v1/engine_connection_idempotency_policy.h" +#include "google/cloud/discoveryengine/v1/engine_service.pb.h" #include "google/cloud/discoveryengine/v1/internal/engine_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/engine_connection_idempotency_policy.h b/google/cloud/discoveryengine/v1/engine_connection_idempotency_policy.h index 18ce8f89ec45b..3502974a7052c 100644 --- a/google/cloud/discoveryengine/v1/engine_connection_idempotency_policy.h +++ b/google/cloud/discoveryengine/v1/engine_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_ENGINE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_ENGINE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/discoveryengine/v1/engine_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/grounded_generation_connection.h b/google/cloud/discoveryengine/v1/grounded_generation_connection.h index c87846c0421a3..abc9e7aaebffb 100644 --- a/google/cloud/discoveryengine/v1/grounded_generation_connection.h +++ b/google/cloud/discoveryengine/v1/grounded_generation_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_GROUNDED_GENERATION_CONNECTION_H #include "google/cloud/discoveryengine/v1/grounded_generation_connection_idempotency_policy.h" +#include "google/cloud/discoveryengine/v1/grounded_generation_service.pb.h" #include "google/cloud/discoveryengine/v1/internal/grounded_generation_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/async_read_write_stream_impl.h" @@ -28,7 +29,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/discoveryengine/v1/grounded_generation_connection_idempotency_policy.h b/google/cloud/discoveryengine/v1/grounded_generation_connection_idempotency_policy.h index c053980f13811..e23cc6b28cdcf 100644 --- a/google/cloud/discoveryengine/v1/grounded_generation_connection_idempotency_policy.h +++ b/google/cloud/discoveryengine/v1/grounded_generation_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_GROUNDED_GENERATION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_GROUNDED_GENERATION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/discoveryengine/v1/grounded_generation_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/internal/completion_auth_decorator.cc b/google/cloud/discoveryengine/v1/internal/completion_auth_decorator.cc index 6bf0b7a2b26f4..89023dfe31b38 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_auth_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/completion_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/discoveryengine/v1/completion_service.proto #include "google/cloud/discoveryengine/v1/internal/completion_auth_decorator.h" -#include +#include "google/cloud/discoveryengine/v1/completion_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -229,3 +232,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/completion_auth_decorator.h b/google/cloud/discoveryengine/v1/internal/completion_auth_decorator.h index b579fff646e2b..66c4e70dd7069 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_auth_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/completion_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/completion_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -130,4 +133,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_COMPLETION_AUTH_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/completion_connection_impl.h b/google/cloud/discoveryengine/v1/internal/completion_connection_impl.h index 780a784739eba..213e808e987f1 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_connection_impl.h +++ b/google/cloud/discoveryengine/v1/internal/completion_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/internal/completion_logging_decorator.cc b/google/cloud/discoveryengine/v1/internal/completion_logging_decorator.cc index cbc546d4eea97..efbcc27b34cc8 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_logging_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/completion_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/discoveryengine/v1/completion_service.proto #include "google/cloud/discoveryengine/v1/internal/completion_logging_decorator.h" +#include "google/cloud/discoveryengine/v1/completion_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -259,3 +262,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/completion_logging_decorator.h b/google/cloud/discoveryengine/v1/internal/completion_logging_decorator.h index 3eb930926a316..e24c054a97b0e 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_logging_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/completion_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/completion_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -130,4 +133,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_COMPLETION_LOGGING_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/completion_metadata_decorator.cc b/google/cloud/discoveryengine/v1/internal/completion_metadata_decorator.cc index e4743faf27ade..7c6c38b9f4a8c 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_metadata_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/completion_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/discoveryengine/v1/completion_service.proto #include "google/cloud/discoveryengine/v1/internal/completion_metadata_decorator.h" +#include "google/cloud/discoveryengine/v1/completion_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 discoveryengine_v1_internal { @@ -212,3 +216,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/completion_metadata_decorator.h b/google/cloud/discoveryengine/v1/internal/completion_metadata_decorator.h index f6c3b30e55abf..e027294c76bc9 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_metadata_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/completion_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/completion_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -136,4 +139,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_COMPLETION_METADATA_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/completion_option_defaults.cc b/google/cloud/discoveryengine/v1/internal/completion_option_defaults.cc index 412ef7b70ea54..2c22b600c8a5f 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_option_defaults.cc +++ b/google/cloud/discoveryengine/v1/internal/completion_option_defaults.cc @@ -42,7 +42,7 @@ Options CompletionServiceDefaultOptions(Options options) { if (!options.has()) { options.set( discoveryengine_v1::CompletionServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/discoveryengine/v1/internal/completion_stub.cc b/google/cloud/discoveryengine/v1/internal/completion_stub.cc index a34b063ab96ab..e097a47a82244 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/completion_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/discoveryengine/v1/completion_service.proto #include "google/cloud/discoveryengine/v1/internal/completion_stub.h" +#include "google/cloud/discoveryengine/v1/completion_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -261,3 +264,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/completion_stub.h b/google/cloud/discoveryengine/v1/internal/completion_stub.h index 209aac0ab06b7..fcc6f0f70b643 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_stub.h +++ b/google/cloud/discoveryengine/v1/internal/completion_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_COMPLETION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_COMPLETION_STUB_H +#include "google/cloud/discoveryengine/v1/completion_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -227,4 +230,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_COMPLETION_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/completion_stub_factory.cc b/google/cloud/discoveryengine/v1/internal/completion_stub_factory.cc index e68387de4dba8..f0a5ea09748e2 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_stub_factory.cc +++ b/google/cloud/discoveryengine/v1/internal/completion_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/discoveryengine/v1/completion_service.proto #include "google/cloud/discoveryengine/v1/internal/completion_stub_factory.h" +#include "google/cloud/discoveryengine/v1/completion_service.grpc.pb.h" #include "google/cloud/discoveryengine/v1/internal/completion_auth_decorator.h" #include "google/cloud/discoveryengine/v1/internal/completion_logging_decorator.h" #include "google/cloud/discoveryengine/v1/internal/completion_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/completion_stub_factory.h b/google/cloud/discoveryengine/v1/internal/completion_stub_factory.h index 8e8531066be9f..c313ebef78372 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_stub_factory.h +++ b/google/cloud/discoveryengine/v1/internal/completion_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_COMPLETION_STUB_FACTORY_H diff --git a/google/cloud/discoveryengine/v1/internal/completion_tracing_connection.cc b/google/cloud/discoveryengine/v1/internal/completion_tracing_connection.cc index 7fda420a235fa..464a9734d9f1e 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_tracing_connection.cc +++ b/google/cloud/discoveryengine/v1/internal/completion_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CompletionServiceTracingConnection::CompletionServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -219,17 +217,13 @@ Status CompletionServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCompletionServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/discoveryengine/v1/internal/completion_tracing_connection.h b/google/cloud/discoveryengine/v1/internal/completion_tracing_connection.h index 86becac3c7514..857485bbe3335 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_tracing_connection.h +++ b/google/cloud/discoveryengine/v1/internal/completion_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CompletionServiceTracingConnection : public discoveryengine_v1::CompletionServiceConnection { public: @@ -121,8 +119,6 @@ class CompletionServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/discoveryengine/v1/internal/completion_tracing_stub.cc b/google/cloud/discoveryengine/v1/internal/completion_tracing_stub.cc index 515d3004e538e..c4424dd73e9fc 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_tracing_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/completion_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CompletionServiceTracingStub::CompletionServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -235,18 +236,14 @@ future CompletionServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCompletionServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/completion_tracing_stub.h b/google/cloud/discoveryengine/v1/internal/completion_tracing_stub.h index 5ab758f63daf2..1df9c1ebad99b 100644 --- a/google/cloud/discoveryengine/v1/internal/completion_tracing_stub.h +++ b/google/cloud/discoveryengine/v1/internal/completion_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CompletionServiceTracingStub : public CompletionServiceStub { public: ~CompletionServiceTracingStub() override = default; @@ -126,8 +127,6 @@ class CompletionServiceTracingStub : public CompletionServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -142,4 +141,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_COMPLETION_TRACING_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/control_auth_decorator.cc b/google/cloud/discoveryengine/v1/internal/control_auth_decorator.cc index c2a3e884b39de..52c3269eb0953 100644 --- a/google/cloud/discoveryengine/v1/internal/control_auth_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/control_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/discoveryengine/v1/control_service.proto #include "google/cloud/discoveryengine/v1/internal/control_auth_decorator.h" -#include +#include "google/cloud/discoveryengine/v1/control_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -104,3 +107,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/control_auth_decorator.h b/google/cloud/discoveryengine/v1/internal/control_auth_decorator.h index 9ef9cc89beea6..ac49050df2ad3 100644 --- a/google/cloud/discoveryengine/v1/internal/control_auth_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/control_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -85,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONTROL_AUTH_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/control_logging_decorator.cc b/google/cloud/discoveryengine/v1/internal/control_logging_decorator.cc index 655e3ff7eb887..78c39cd7d0292 100644 --- a/google/cloud/discoveryengine/v1/internal/control_logging_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/control_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/discoveryengine/v1/control_service.proto #include "google/cloud/discoveryengine/v1/internal/control_logging_decorator.h" +#include "google/cloud/discoveryengine/v1/control_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -137,3 +140,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/control_logging_decorator.h b/google/cloud/discoveryengine/v1/internal/control_logging_decorator.h index 956951a5f64e3..004463165af20 100644 --- a/google/cloud/discoveryengine/v1/internal/control_logging_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/control_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -85,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONTROL_LOGGING_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/control_metadata_decorator.cc b/google/cloud/discoveryengine/v1/internal/control_metadata_decorator.cc index 53d28c78999e7..0f46296e01e36 100644 --- a/google/cloud/discoveryengine/v1/internal/control_metadata_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/control_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/discoveryengine/v1/control_service.proto #include "google/cloud/discoveryengine/v1/internal/control_metadata_decorator.h" +#include "google/cloud/discoveryengine/v1/control_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 discoveryengine_v1_internal { @@ -131,3 +135,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/control_metadata_decorator.h b/google/cloud/discoveryengine/v1/internal/control_metadata_decorator.h index b21540d41e45f..d7d78b57a6035 100644 --- a/google/cloud/discoveryengine/v1/internal/control_metadata_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/control_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -90,4 +93,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONTROL_METADATA_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/control_option_defaults.cc b/google/cloud/discoveryengine/v1/internal/control_option_defaults.cc index 9620f2debf21e..96d726df14ce8 100644 --- a/google/cloud/discoveryengine/v1/internal/control_option_defaults.cc +++ b/google/cloud/discoveryengine/v1/internal/control_option_defaults.cc @@ -42,7 +42,7 @@ Options ControlServiceDefaultOptions(Options options) { if (!options.has()) { options.set( discoveryengine_v1::ControlServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/discoveryengine/v1/internal/control_stub.cc b/google/cloud/discoveryengine/v1/internal/control_stub.cc index 24726010f87c6..4980f8d539c66 100644 --- a/google/cloud/discoveryengine/v1/internal/control_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/control_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/discoveryengine/v1/control_service.proto #include "google/cloud/discoveryengine/v1/internal/control_stub.h" +#include "google/cloud/discoveryengine/v1/control_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -128,3 +131,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/control_stub.h b/google/cloud/discoveryengine/v1/internal/control_stub.h index dd1e2c7342023..ba3e0f425dfbc 100644 --- a/google/cloud/discoveryengine/v1/internal/control_stub.h +++ b/google/cloud/discoveryengine/v1/internal/control_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONTROL_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONTROL_STUB_H +#include "google/cloud/discoveryengine/v1/control_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -134,4 +137,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONTROL_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/control_stub_factory.cc b/google/cloud/discoveryengine/v1/internal/control_stub_factory.cc index 2f2d4329e8c1a..266dce38b801c 100644 --- a/google/cloud/discoveryengine/v1/internal/control_stub_factory.cc +++ b/google/cloud/discoveryengine/v1/internal/control_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/discoveryengine/v1/control_service.proto #include "google/cloud/discoveryengine/v1/internal/control_stub_factory.h" +#include "google/cloud/discoveryengine/v1/control_service.grpc.pb.h" #include "google/cloud/discoveryengine/v1/internal/control_auth_decorator.h" #include "google/cloud/discoveryengine/v1/internal/control_logging_decorator.h" #include "google/cloud/discoveryengine/v1/internal/control_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/control_stub_factory.h b/google/cloud/discoveryengine/v1/internal/control_stub_factory.h index 60845ee147093..dd23e64f2b7ed 100644 --- a/google/cloud/discoveryengine/v1/internal/control_stub_factory.h +++ b/google/cloud/discoveryengine/v1/internal/control_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONTROL_STUB_FACTORY_H diff --git a/google/cloud/discoveryengine/v1/internal/control_tracing_connection.cc b/google/cloud/discoveryengine/v1/internal/control_tracing_connection.cc index 2ff651087b03c..0d060d1548a7f 100644 --- a/google/cloud/discoveryengine/v1/internal/control_tracing_connection.cc +++ b/google/cloud/discoveryengine/v1/internal/control_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ControlServiceTracingConnection::ControlServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -108,16 +106,12 @@ Status ControlServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeControlServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/discoveryengine/v1/internal/control_tracing_connection.h b/google/cloud/discoveryengine/v1/internal/control_tracing_connection.h index dd5a765632857..25d76093bb46b 100644 --- a/google/cloud/discoveryengine/v1/internal/control_tracing_connection.h +++ b/google/cloud/discoveryengine/v1/internal/control_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ControlServiceTracingConnection : public discoveryengine_v1::ControlServiceConnection { public: @@ -72,8 +70,6 @@ class ControlServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/discoveryengine/v1/internal/control_tracing_stub.cc b/google/cloud/discoveryengine/v1/internal/control_tracing_stub.cc index 2c3390052fa18..9e0f04c9d70fc 100644 --- a/google/cloud/discoveryengine/v1/internal/control_tracing_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/control_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ControlServiceTracingStub::ControlServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -126,18 +127,14 @@ Status ControlServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeControlServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/control_tracing_stub.h b/google/cloud/discoveryengine/v1/internal/control_tracing_stub.h index bdf5234864e67..1b7dc62d3233d 100644 --- a/google/cloud/discoveryengine/v1/internal/control_tracing_stub.h +++ b/google/cloud/discoveryengine/v1/internal/control_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ControlServiceTracingStub : public ControlServiceStub { public: ~ControlServiceTracingStub() override = default; @@ -81,8 +82,6 @@ class ControlServiceTracingStub : public ControlServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -97,4 +96,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONTROL_TRACING_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/conversational_search_auth_decorator.cc b/google/cloud/discoveryengine/v1/internal/conversational_search_auth_decorator.cc index cbe072555afd9..6b36fbec3fea4 100644 --- a/google/cloud/discoveryengine/v1/internal/conversational_search_auth_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/conversational_search_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/discoveryengine/v1/conversational_search_service.proto #include "google/cloud/discoveryengine/v1/internal/conversational_search_auth_decorator.h" -#include +#include "google/cloud/discoveryengine/v1/conversational_search_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -193,3 +196,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/conversational_search_auth_decorator.h b/google/cloud/discoveryengine/v1/internal/conversational_search_auth_decorator.h index cc4f468fc4fd9..728940c3842a0 100644 --- a/google/cloud/discoveryengine/v1/internal/conversational_search_auth_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/conversational_search_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -134,4 +137,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONVERSATIONAL_SEARCH_AUTH_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/conversational_search_logging_decorator.cc b/google/cloud/discoveryengine/v1/internal/conversational_search_logging_decorator.cc index 7ef505b51a7dd..e5de97db41cd8 100644 --- a/google/cloud/discoveryengine/v1/internal/conversational_search_logging_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/conversational_search_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/discoveryengine/v1/conversational_search_service.proto #include "google/cloud/discoveryengine/v1/internal/conversational_search_logging_decorator.h" +#include "google/cloud/discoveryengine/v1/conversational_search_service.grpc.pb.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -278,3 +281,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/conversational_search_logging_decorator.h b/google/cloud/discoveryengine/v1/internal/conversational_search_logging_decorator.h index a11d0ec33ebf3..085268d41c7fb 100644 --- a/google/cloud/discoveryengine/v1/internal/conversational_search_logging_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/conversational_search_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -136,4 +139,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONVERSATIONAL_SEARCH_LOGGING_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/conversational_search_metadata_decorator.cc b/google/cloud/discoveryengine/v1/internal/conversational_search_metadata_decorator.cc index 9604bde6ac4b3..f3d4b14c76c46 100644 --- a/google/cloud/discoveryengine/v1/internal/conversational_search_metadata_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/conversational_search_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/discoveryengine/v1/conversational_search_service.proto #include "google/cloud/discoveryengine/v1/internal/conversational_search_metadata_decorator.h" +#include "google/cloud/discoveryengine/v1/conversational_search_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 discoveryengine_v1_internal { @@ -221,3 +225,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/conversational_search_metadata_decorator.h b/google/cloud/discoveryengine/v1/internal/conversational_search_metadata_decorator.h index 683cdbd877530..8557e34fd70b2 100644 --- a/google/cloud/discoveryengine/v1/internal/conversational_search_metadata_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/conversational_search_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -141,4 +144,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONVERSATIONAL_SEARCH_METADATA_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/conversational_search_option_defaults.cc b/google/cloud/discoveryengine/v1/internal/conversational_search_option_defaults.cc index 31981bc366f86..2fdbdbe7164d9 100644 --- a/google/cloud/discoveryengine/v1/internal/conversational_search_option_defaults.cc +++ b/google/cloud/discoveryengine/v1/internal/conversational_search_option_defaults.cc @@ -45,7 +45,7 @@ Options ConversationalSearchServiceDefaultOptions(Options options) { options.set< discoveryengine_v1::ConversationalSearchServiceRetryPolicyOption>( discoveryengine_v1::ConversationalSearchServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -239,3 +242,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/conversational_search_stub.h b/google/cloud/discoveryengine/v1/internal/conversational_search_stub.h index 792ca511ce0a4..2e3b9527ad5f8 100644 --- a/google/cloud/discoveryengine/v1/internal/conversational_search_stub.h +++ b/google/cloud/discoveryengine/v1/internal/conversational_search_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONVERSATIONAL_SEARCH_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONVERSATIONAL_SEARCH_STUB_H +#include "google/cloud/discoveryengine/v1/conversational_search_service.grpc.pb.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -238,4 +241,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONVERSATIONAL_SEARCH_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/conversational_search_stub_factory.cc b/google/cloud/discoveryengine/v1/internal/conversational_search_stub_factory.cc index 9c7cd929071a4..666095e60132f 100644 --- a/google/cloud/discoveryengine/v1/internal/conversational_search_stub_factory.cc +++ b/google/cloud/discoveryengine/v1/internal/conversational_search_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/discoveryengine/v1/conversational_search_service.proto #include "google/cloud/discoveryengine/v1/internal/conversational_search_stub_factory.h" +#include "google/cloud/discoveryengine/v1/conversational_search_service.grpc.pb.h" #include "google/cloud/discoveryengine/v1/internal/conversational_search_auth_decorator.h" #include "google/cloud/discoveryengine/v1/internal/conversational_search_logging_decorator.h" #include "google/cloud/discoveryengine/v1/internal/conversational_search_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/conversational_search_stub_factory.h b/google/cloud/discoveryengine/v1/internal/conversational_search_stub_factory.h index e02c6cfdf4a17..b67f1946ebd1f 100644 --- a/google/cloud/discoveryengine/v1/internal/conversational_search_stub_factory.h +++ b/google/cloud/discoveryengine/v1/internal/conversational_search_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONVERSATIONAL_SEARCH_STUB_FACTORY_H diff --git a/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_connection.cc b/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_connection.cc index 595126689e3b7..b8d9bd2ba5e53 100644 --- a/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_connection.cc +++ b/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConversationalSearchServiceTracingConnection:: ConversationalSearchServiceTracingConnection( std::shared_ptr< @@ -214,18 +212,14 @@ Status ConversationalSearchServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConversationalSearchServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_connection.h b/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_connection.h index 44ec66491a1fd..be9f459e26011 100644 --- a/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_connection.h +++ b/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConversationalSearchServiceTracingConnection : public discoveryengine_v1::ConversationalSearchServiceConnection { public: @@ -112,8 +110,6 @@ class ConversationalSearchServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_stub.cc b/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_stub.cc index 9cde5c8b06752..3513b2c17e4fa 100644 --- a/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConversationalSearchServiceTracingStub::ConversationalSearchServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -259,20 +260,16 @@ Status ConversationalSearchServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConversationalSearchServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_stub.h b/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_stub.h index 655a7ea866c53..6c68949de0c7b 100644 --- a/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_stub.h +++ b/google/cloud/discoveryengine/v1/internal/conversational_search_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConversationalSearchServiceTracingStub : public ConversationalSearchServiceStub { public: @@ -132,8 +133,6 @@ class ConversationalSearchServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -149,4 +148,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_CONVERSATIONAL_SEARCH_TRACING_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/data_store_auth_decorator.cc b/google/cloud/discoveryengine/v1/internal/data_store_auth_decorator.cc index ef6350d3b1f89..756b9a78ed4ef 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_auth_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/data_store_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/discoveryengine/v1/data_store_service.proto #include "google/cloud/discoveryengine/v1/internal/data_store_auth_decorator.h" -#include +#include "google/cloud/discoveryengine/v1/data_store_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -179,3 +182,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/data_store_auth_decorator.h b/google/cloud/discoveryengine/v1/internal/data_store_auth_decorator.h index 29a8a9412d476..f199bb342002c 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_auth_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/data_store_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/data_store_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -113,4 +116,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DATA_STORE_AUTH_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/data_store_connection_impl.h b/google/cloud/discoveryengine/v1/internal/data_store_connection_impl.h index 0b37285ea6739..9f74a140cec09 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_connection_impl.h +++ b/google/cloud/discoveryengine/v1/internal/data_store_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/internal/data_store_logging_decorator.cc b/google/cloud/discoveryengine/v1/internal/data_store_logging_decorator.cc index 82dcff1d19230..3dcc9be161248 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_logging_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/data_store_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/discoveryengine/v1/data_store_service.proto #include "google/cloud/discoveryengine/v1/internal/data_store_logging_decorator.h" +#include "google/cloud/discoveryengine/v1/data_store_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -211,3 +214,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/data_store_logging_decorator.h b/google/cloud/discoveryengine/v1/internal/data_store_logging_decorator.h index e2e5f5097a01a..2ebcbf62c2a47 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_logging_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/data_store_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/data_store_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -113,4 +116,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DATA_STORE_LOGGING_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/data_store_metadata_decorator.cc b/google/cloud/discoveryengine/v1/internal/data_store_metadata_decorator.cc index d0999c697c84e..d2b10a4708718 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_metadata_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/data_store_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/discoveryengine/v1/data_store_service.proto #include "google/cloud/discoveryengine/v1/internal/data_store_metadata_decorator.h" +#include "google/cloud/discoveryengine/v1/data_store_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 discoveryengine_v1_internal { @@ -179,3 +183,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/data_store_metadata_decorator.h b/google/cloud/discoveryengine/v1/internal/data_store_metadata_decorator.h index 5a57b4d68d59b..d5f755798bd1a 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_metadata_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/data_store_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/data_store_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -119,4 +122,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DATA_STORE_METADATA_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/data_store_option_defaults.cc b/google/cloud/discoveryengine/v1/internal/data_store_option_defaults.cc index 1d75f33a352c3..9a1305349d2e9 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_option_defaults.cc +++ b/google/cloud/discoveryengine/v1/internal/data_store_option_defaults.cc @@ -42,7 +42,7 @@ Options DataStoreServiceDefaultOptions(Options options) { if (!options.has()) { options.set( discoveryengine_v1::DataStoreServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/discoveryengine/v1/internal/data_store_stub.cc b/google/cloud/discoveryengine/v1/internal/data_store_stub.cc index 77adc23b091f8..b4742ee20d023 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/data_store_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/discoveryengine/v1/data_store_service.proto #include "google/cloud/discoveryengine/v1/internal/data_store_stub.h" +#include "google/cloud/discoveryengine/v1/data_store_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -207,3 +210,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/data_store_stub.h b/google/cloud/discoveryengine/v1/internal/data_store_stub.h index 6619c1d598740..c46f1720d269c 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_stub.h +++ b/google/cloud/discoveryengine/v1/internal/data_store_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DATA_STORE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DATA_STORE_STUB_H +#include "google/cloud/discoveryengine/v1/data_store_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -192,4 +195,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DATA_STORE_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/data_store_stub_factory.cc b/google/cloud/discoveryengine/v1/internal/data_store_stub_factory.cc index b5ae58facd084..474c9d884cef2 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_stub_factory.cc +++ b/google/cloud/discoveryengine/v1/internal/data_store_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/discoveryengine/v1/data_store_service.proto #include "google/cloud/discoveryengine/v1/internal/data_store_stub_factory.h" +#include "google/cloud/discoveryengine/v1/data_store_service.grpc.pb.h" #include "google/cloud/discoveryengine/v1/internal/data_store_auth_decorator.h" #include "google/cloud/discoveryengine/v1/internal/data_store_logging_decorator.h" #include "google/cloud/discoveryengine/v1/internal/data_store_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/data_store_stub_factory.h b/google/cloud/discoveryengine/v1/internal/data_store_stub_factory.h index 38225eda0ff40..ab70f93a2cfac 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_stub_factory.h +++ b/google/cloud/discoveryengine/v1/internal/data_store_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DATA_STORE_STUB_FACTORY_H diff --git a/google/cloud/discoveryengine/v1/internal/data_store_tracing_connection.cc b/google/cloud/discoveryengine/v1/internal/data_store_tracing_connection.cc index 4a0d06ef0c96d..0369c749fc4db 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_tracing_connection.cc +++ b/google/cloud/discoveryengine/v1/internal/data_store_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataStoreServiceTracingConnection::DataStoreServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -149,16 +147,12 @@ Status DataStoreServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataStoreServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/discoveryengine/v1/internal/data_store_tracing_connection.h b/google/cloud/discoveryengine/v1/internal/data_store_tracing_connection.h index bf846f5d6f820..b6f5287cb0ff5 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_tracing_connection.h +++ b/google/cloud/discoveryengine/v1/internal/data_store_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataStoreServiceTracingConnection : public discoveryengine_v1::DataStoreServiceConnection { public: @@ -91,8 +89,6 @@ class DataStoreServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/discoveryengine/v1/internal/data_store_tracing_stub.cc b/google/cloud/discoveryengine/v1/internal/data_store_tracing_stub.cc index 0de2d4d8a7cb9..7acc7e6c2a4cc 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_tracing_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/data_store_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataStoreServiceTracingStub::DataStoreServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -185,18 +186,14 @@ future DataStoreServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataStoreServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/data_store_tracing_stub.h b/google/cloud/discoveryengine/v1/internal/data_store_tracing_stub.h index 84684210b514c..6aab740711d6c 100644 --- a/google/cloud/discoveryengine/v1/internal/data_store_tracing_stub.h +++ b/google/cloud/discoveryengine/v1/internal/data_store_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataStoreServiceTracingStub : public DataStoreServiceStub { public: ~DataStoreServiceTracingStub() override = default; @@ -109,8 +110,6 @@ class DataStoreServiceTracingStub : public DataStoreServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -125,4 +124,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DATA_STORE_TRACING_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/document_auth_decorator.cc b/google/cloud/discoveryengine/v1/internal/document_auth_decorator.cc index 0157bcacd7a06..27f9d4a646608 100644 --- a/google/cloud/discoveryengine/v1/internal/document_auth_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/document_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/discoveryengine/v1/document_service.proto #include "google/cloud/discoveryengine/v1/internal/document_auth_decorator.h" -#include +#include "google/cloud/discoveryengine/v1/document_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -206,3 +209,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/document_auth_decorator.h b/google/cloud/discoveryengine/v1/internal/document_auth_decorator.h index f453d9a82bbae..1aa0f6fe29537 100644 --- a/google/cloud/discoveryengine/v1/internal/document_auth_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/document_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/document_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DOCUMENT_AUTH_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/document_connection_impl.h b/google/cloud/discoveryengine/v1/internal/document_connection_impl.h index 67a310aebf0e5..ad09378d2d18c 100644 --- a/google/cloud/discoveryengine/v1/internal/document_connection_impl.h +++ b/google/cloud/discoveryengine/v1/internal/document_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/internal/document_logging_decorator.cc b/google/cloud/discoveryengine/v1/internal/document_logging_decorator.cc index 046f17fe7305f..04d67364ccaaa 100644 --- a/google/cloud/discoveryengine/v1/internal/document_logging_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/document_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/discoveryengine/v1/document_service.proto #include "google/cloud/discoveryengine/v1/internal/document_logging_decorator.h" +#include "google/cloud/discoveryengine/v1/document_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -249,3 +252,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/document_logging_decorator.h b/google/cloud/discoveryengine/v1/internal/document_logging_decorator.h index d723ecbeeb745..07e3f98efb98a 100644 --- a/google/cloud/discoveryengine/v1/internal/document_logging_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/document_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/document_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DOCUMENT_LOGGING_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/document_metadata_decorator.cc b/google/cloud/discoveryengine/v1/internal/document_metadata_decorator.cc index 9b2913308adda..12e8c2ec38734 100644 --- a/google/cloud/discoveryengine/v1/internal/document_metadata_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/document_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/discoveryengine/v1/document_service.proto #include "google/cloud/discoveryengine/v1/internal/document_metadata_decorator.h" +#include "google/cloud/discoveryengine/v1/document_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 discoveryengine_v1_internal { @@ -206,3 +210,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/document_metadata_decorator.h b/google/cloud/discoveryengine/v1/internal/document_metadata_decorator.h index 47d783e65cefd..ffc835dc7fefa 100644 --- a/google/cloud/discoveryengine/v1/internal/document_metadata_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/document_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/document_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -135,4 +138,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DOCUMENT_METADATA_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/document_option_defaults.cc b/google/cloud/discoveryengine/v1/internal/document_option_defaults.cc index 11282094b0ef7..d5cc420166a7f 100644 --- a/google/cloud/discoveryengine/v1/internal/document_option_defaults.cc +++ b/google/cloud/discoveryengine/v1/internal/document_option_defaults.cc @@ -42,7 +42,7 @@ Options DocumentServiceDefaultOptions(Options options) { if (!options.has()) { options.set( discoveryengine_v1::DocumentServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/discoveryengine/v1/internal/document_stub.cc b/google/cloud/discoveryengine/v1/internal/document_stub.cc index 1afd2442621eb..3b9ec7b0e83cf 100644 --- a/google/cloud/discoveryengine/v1/internal/document_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/document_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/discoveryengine/v1/document_service.proto #include "google/cloud/discoveryengine/v1/internal/document_stub.h" +#include "google/cloud/discoveryengine/v1/document_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -245,3 +248,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/document_stub.h b/google/cloud/discoveryengine/v1/internal/document_stub.h index 6beea70424212..861d24c332b4c 100644 --- a/google/cloud/discoveryengine/v1/internal/document_stub.h +++ b/google/cloud/discoveryengine/v1/internal/document_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DOCUMENT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DOCUMENT_STUB_H +#include "google/cloud/discoveryengine/v1/document_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -223,4 +226,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DOCUMENT_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/document_stub_factory.cc b/google/cloud/discoveryengine/v1/internal/document_stub_factory.cc index 9bdba67dbe15c..11b41ff711ae1 100644 --- a/google/cloud/discoveryengine/v1/internal/document_stub_factory.cc +++ b/google/cloud/discoveryengine/v1/internal/document_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/discoveryengine/v1/document_service.proto #include "google/cloud/discoveryengine/v1/internal/document_stub_factory.h" +#include "google/cloud/discoveryengine/v1/document_service.grpc.pb.h" #include "google/cloud/discoveryengine/v1/internal/document_auth_decorator.h" #include "google/cloud/discoveryengine/v1/internal/document_logging_decorator.h" #include "google/cloud/discoveryengine/v1/internal/document_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/document_stub_factory.h b/google/cloud/discoveryengine/v1/internal/document_stub_factory.h index eed3fde580c31..1f788c67c989a 100644 --- a/google/cloud/discoveryengine/v1/internal/document_stub_factory.h +++ b/google/cloud/discoveryengine/v1/internal/document_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DOCUMENT_STUB_FACTORY_H diff --git a/google/cloud/discoveryengine/v1/internal/document_tracing_connection.cc b/google/cloud/discoveryengine/v1/internal/document_tracing_connection.cc index 45ffa8207e82d..b80e319c99443 100644 --- a/google/cloud/discoveryengine/v1/internal/document_tracing_connection.cc +++ b/google/cloud/discoveryengine/v1/internal/document_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DocumentServiceTracingConnection::DocumentServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -177,16 +175,12 @@ Status DocumentServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDocumentServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/discoveryengine/v1/internal/document_tracing_connection.h b/google/cloud/discoveryengine/v1/internal/document_tracing_connection.h index 350dc37e959b3..6717582a37fc5 100644 --- a/google/cloud/discoveryengine/v1/internal/document_tracing_connection.h +++ b/google/cloud/discoveryengine/v1/internal/document_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DocumentServiceTracingConnection : public discoveryengine_v1::DocumentServiceConnection { public: @@ -105,8 +103,6 @@ class DocumentServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/discoveryengine/v1/internal/document_tracing_stub.cc b/google/cloud/discoveryengine/v1/internal/document_tracing_stub.cc index 2023f11c07cea..41d7d7976f467 100644 --- a/google/cloud/discoveryengine/v1/internal/document_tracing_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/document_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DocumentServiceTracingStub::DocumentServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -223,18 +224,14 @@ future DocumentServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDocumentServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/document_tracing_stub.h b/google/cloud/discoveryengine/v1/internal/document_tracing_stub.h index c664b522bb627..1bd450a1170e0 100644 --- a/google/cloud/discoveryengine/v1/internal/document_tracing_stub.h +++ b/google/cloud/discoveryengine/v1/internal/document_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DocumentServiceTracingStub : public DocumentServiceStub { public: ~DocumentServiceTracingStub() override = default; @@ -125,8 +126,6 @@ class DocumentServiceTracingStub : public DocumentServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -141,4 +140,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_DOCUMENT_TRACING_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/engine_auth_decorator.cc b/google/cloud/discoveryengine/v1/internal/engine_auth_decorator.cc index d5cb0b2c30259..2e7464e0d6c04 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_auth_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/engine_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/discoveryengine/v1/engine_service.proto #include "google/cloud/discoveryengine/v1/internal/engine_auth_decorator.h" -#include +#include "google/cloud/discoveryengine/v1/engine_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -179,3 +182,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/engine_auth_decorator.h b/google/cloud/discoveryengine/v1/internal/engine_auth_decorator.h index 37bea7f19fd56..6b6faf2819df0 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_auth_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/engine_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/engine_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -112,4 +115,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_ENGINE_AUTH_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/engine_connection_impl.h b/google/cloud/discoveryengine/v1/internal/engine_connection_impl.h index 50011826db5dd..dc05583df4725 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_connection_impl.h +++ b/google/cloud/discoveryengine/v1/internal/engine_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/internal/engine_logging_decorator.cc b/google/cloud/discoveryengine/v1/internal/engine_logging_decorator.cc index 4dae430faf2eb..5cdc9a875b060 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_logging_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/engine_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/discoveryengine/v1/engine_service.proto #include "google/cloud/discoveryengine/v1/internal/engine_logging_decorator.h" +#include "google/cloud/discoveryengine/v1/engine_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -209,3 +212,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/engine_logging_decorator.h b/google/cloud/discoveryengine/v1/internal/engine_logging_decorator.h index 5b06c27bad3d6..9d0c38fc7763d 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_logging_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/engine_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/engine_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -112,4 +115,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_ENGINE_LOGGING_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/engine_metadata_decorator.cc b/google/cloud/discoveryengine/v1/internal/engine_metadata_decorator.cc index 7887e8021a255..44956ff23feb7 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_metadata_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/engine_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/discoveryengine/v1/engine_service.proto #include "google/cloud/discoveryengine/v1/internal/engine_metadata_decorator.h" +#include "google/cloud/discoveryengine/v1/engine_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 discoveryengine_v1_internal { @@ -177,3 +181,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/engine_metadata_decorator.h b/google/cloud/discoveryengine/v1/internal/engine_metadata_decorator.h index 10c0d20333322..b54dd53e2f169 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_metadata_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/engine_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/engine_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -117,4 +120,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_ENGINE_METADATA_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/engine_option_defaults.cc b/google/cloud/discoveryengine/v1/internal/engine_option_defaults.cc index d9e01d80b6f99..fe4bfed3b168b 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_option_defaults.cc +++ b/google/cloud/discoveryengine/v1/internal/engine_option_defaults.cc @@ -42,7 +42,7 @@ Options EngineServiceDefaultOptions(Options options) { if (!options.has()) { options.set( discoveryengine_v1::EngineServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/discoveryengine/v1/internal/engine_stub.cc b/google/cloud/discoveryengine/v1/internal/engine_stub.cc index 2d15feb2bb232..2576f06c6ee7c 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/engine_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/discoveryengine/v1/engine_service.proto #include "google/cloud/discoveryengine/v1/internal/engine_stub.h" +#include "google/cloud/discoveryengine/v1/engine_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -204,3 +207,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/engine_stub.h b/google/cloud/discoveryengine/v1/internal/engine_stub.h index 3b1e021dead75..ce78ca47aa58e 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_stub.h +++ b/google/cloud/discoveryengine/v1/internal/engine_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_ENGINE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_ENGINE_STUB_H +#include "google/cloud/discoveryengine/v1/engine_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -188,4 +191,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_ENGINE_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/engine_stub_factory.cc b/google/cloud/discoveryengine/v1/internal/engine_stub_factory.cc index 98a5a25c1c8e8..ef47fffff5ef2 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_stub_factory.cc +++ b/google/cloud/discoveryengine/v1/internal/engine_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/discoveryengine/v1/engine_service.proto #include "google/cloud/discoveryengine/v1/internal/engine_stub_factory.h" +#include "google/cloud/discoveryengine/v1/engine_service.grpc.pb.h" #include "google/cloud/discoveryengine/v1/internal/engine_auth_decorator.h" #include "google/cloud/discoveryengine/v1/internal/engine_logging_decorator.h" #include "google/cloud/discoveryengine/v1/internal/engine_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/engine_stub_factory.h b/google/cloud/discoveryengine/v1/internal/engine_stub_factory.h index 4a32b266e18ef..9b7f3b4806207 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_stub_factory.h +++ b/google/cloud/discoveryengine/v1/internal/engine_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_ENGINE_STUB_FACTORY_H diff --git a/google/cloud/discoveryengine/v1/internal/engine_tracing_connection.cc b/google/cloud/discoveryengine/v1/internal/engine_tracing_connection.cc index f87adc6628303..bf290baaaf7d9 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_tracing_connection.cc +++ b/google/cloud/discoveryengine/v1/internal/engine_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EngineServiceTracingConnection::EngineServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -147,16 +145,12 @@ Status EngineServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEngineServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/discoveryengine/v1/internal/engine_tracing_connection.h b/google/cloud/discoveryengine/v1/internal/engine_tracing_connection.h index 0ca0744ebd2d0..7f973c779e675 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_tracing_connection.h +++ b/google/cloud/discoveryengine/v1/internal/engine_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EngineServiceTracingConnection : public discoveryengine_v1::EngineServiceConnection { public: @@ -88,8 +86,6 @@ class EngineServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/discoveryengine/v1/internal/engine_tracing_stub.cc b/google/cloud/discoveryengine/v1/internal/engine_tracing_stub.cc index 672c2e3fe17ea..7563a2ab4b293 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_tracing_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/engine_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EngineServiceTracingStub::EngineServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -180,18 +181,14 @@ future EngineServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEngineServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/engine_tracing_stub.h b/google/cloud/discoveryengine/v1/internal/engine_tracing_stub.h index fbfeddc505867..b1ca9af855c8f 100644 --- a/google/cloud/discoveryengine/v1/internal/engine_tracing_stub.h +++ b/google/cloud/discoveryengine/v1/internal/engine_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EngineServiceTracingStub : public EngineServiceStub { public: ~EngineServiceTracingStub() override = default; @@ -107,8 +108,6 @@ class EngineServiceTracingStub : public EngineServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -123,4 +122,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_ENGINE_TRACING_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_auth_decorator.cc b/google/cloud/discoveryengine/v1/internal/grounded_generation_auth_decorator.cc index 29b4b91b984c5..71fda9dc9a31b 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_auth_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/discoveryengine/v1/grounded_generation_service.proto #include "google/cloud/discoveryengine/v1/internal/grounded_generation_auth_decorator.h" +#include "google/cloud/discoveryengine/v1/grounded_generation_service.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -101,3 +104,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_auth_decorator.h b/google/cloud/discoveryengine/v1/internal/grounded_generation_auth_decorator.h index 150af220afc70..25209f554295c 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_auth_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -80,4 +83,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_GROUNDED_GENERATION_AUTH_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_logging_decorator.cc b/google/cloud/discoveryengine/v1/internal/grounded_generation_logging_decorator.cc index c5e5e35291e5b..2de2fd74db6d8 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_logging_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/discoveryengine/v1/grounded_generation_service.proto #include "google/cloud/discoveryengine/v1/internal/grounded_generation_logging_decorator.h" +#include "google/cloud/discoveryengine/v1/grounded_generation_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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -127,3 +130,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_logging_decorator.h b/google/cloud/discoveryengine/v1/internal/grounded_generation_logging_decorator.h index 2044856c7cf1d..f5210f8da57a6 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_logging_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -81,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_GROUNDED_GENERATION_LOGGING_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_metadata_decorator.cc b/google/cloud/discoveryengine/v1/internal/grounded_generation_metadata_decorator.cc index 8e71cb18328b0..059e2329fbbd8 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_metadata_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/discoveryengine/v1/grounded_generation_service.proto #include "google/cloud/discoveryengine/v1/internal/grounded_generation_metadata_decorator.h" +#include "google/cloud/discoveryengine/v1/grounded_generation_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 discoveryengine_v1_internal { @@ -120,3 +124,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_metadata_decorator.h b/google/cloud/discoveryengine/v1/internal/grounded_generation_metadata_decorator.h index 424ea76a28ef6..8b493c8eb0bbe 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_metadata_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -86,4 +89,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_GROUNDED_GENERATION_METADATA_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_option_defaults.cc b/google/cloud/discoveryengine/v1/internal/grounded_generation_option_defaults.cc index 76561b98b1788..3327a7eff06c5 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_option_defaults.cc +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_option_defaults.cc @@ -44,7 +44,7 @@ Options GroundedGenerationServiceDefaultOptions(Options options) { discoveryengine_v1::GroundedGenerationServiceRetryPolicyOption>()) { options.set( discoveryengine_v1::GroundedGenerationServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_stub.cc b/google/cloud/discoveryengine/v1/internal/grounded_generation_stub.cc index 694185d99ba1c..c6337d729a4d2 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/discoveryengine/v1/grounded_generation_service.proto #include "google/cloud/discoveryengine/v1/internal/grounded_generation_stub.h" +#include "google/cloud/discoveryengine/v1/grounded_generation_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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -113,3 +116,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_stub.h b/google/cloud/discoveryengine/v1/internal/grounded_generation_stub.h index 233077c490a53..b42f2de9254d9 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_stub.h +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_GROUNDED_GENERATION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_GROUNDED_GENERATION_STUB_H +#include "google/cloud/discoveryengine/v1/grounded_generation_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_GROUNDED_GENERATION_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_stub_factory.cc b/google/cloud/discoveryengine/v1/internal/grounded_generation_stub_factory.cc index 6e3cf8ce27cf7..553278f5bbb97 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_stub_factory.cc +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/discoveryengine/v1/grounded_generation_service.proto #include "google/cloud/discoveryengine/v1/internal/grounded_generation_stub_factory.h" +#include "google/cloud/discoveryengine/v1/grounded_generation_service.grpc.pb.h" #include "google/cloud/discoveryengine/v1/internal/grounded_generation_auth_decorator.h" #include "google/cloud/discoveryengine/v1/internal/grounded_generation_logging_decorator.h" #include "google/cloud/discoveryengine/v1/internal/grounded_generation_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_stub_factory.h b/google/cloud/discoveryengine/v1/internal/grounded_generation_stub_factory.h index dd0956ae219e2..35bce94e27515 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_stub_factory.h +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_GROUNDED_GENERATION_STUB_FACTORY_H diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_connection.cc b/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_connection.cc index 5cc3ce76790f9..2d16b7ab4a4f7 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_connection.cc +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GroundedGenerationServiceTracingConnection:: GroundedGenerationServiceTracingConnection( std::shared_ptr @@ -94,18 +92,14 @@ Status GroundedGenerationServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGroundedGenerationServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_connection.h b/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_connection.h index 0718b7e359230..489748bc3e3c7 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_connection.h +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GroundedGenerationServiceTracingConnection : public discoveryengine_v1::GroundedGenerationServiceConnection { public: @@ -70,8 +68,6 @@ class GroundedGenerationServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_stub.cc b/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_stub.cc index dffa19aed231f..58b0236294099 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GroundedGenerationServiceTracingStub::GroundedGenerationServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -118,20 +119,16 @@ Status GroundedGenerationServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGroundedGenerationServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_stub.h b/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_stub.h index 5a9c30d30cb0a..4c8afdb775c21 100644 --- a/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_stub.h +++ b/google/cloud/discoveryengine/v1/internal/grounded_generation_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GroundedGenerationServiceTracingStub : public GroundedGenerationServiceStub { public: @@ -78,8 +79,6 @@ class GroundedGenerationServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -95,4 +94,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_GROUNDED_GENERATION_TRACING_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/project_auth_decorator.cc b/google/cloud/discoveryengine/v1/internal/project_auth_decorator.cc index 0ca6a327ea1bb..747e4c643a9d1 100644 --- a/google/cloud/discoveryengine/v1/internal/project_auth_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/project_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/discoveryengine/v1/project_service.proto #include "google/cloud/discoveryengine/v1/internal/project_auth_decorator.h" -#include +#include "google/cloud/discoveryengine/v1/project_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -126,3 +129,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/project_auth_decorator.h b/google/cloud/discoveryengine/v1/internal/project_auth_decorator.h index be5cc030ae373..d7c17fdd8b842 100644 --- a/google/cloud/discoveryengine/v1/internal/project_auth_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/project_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/project_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -85,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_PROJECT_AUTH_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/project_connection_impl.h b/google/cloud/discoveryengine/v1/internal/project_connection_impl.h index 59f70bce44f88..bb6378aff04e9 100644 --- a/google/cloud/discoveryengine/v1/internal/project_connection_impl.h +++ b/google/cloud/discoveryengine/v1/internal/project_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/internal/project_logging_decorator.cc b/google/cloud/discoveryengine/v1/internal/project_logging_decorator.cc index e4325fab2a566..b95fd8347d4cc 100644 --- a/google/cloud/discoveryengine/v1/internal/project_logging_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/project_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/discoveryengine/v1/project_service.proto #include "google/cloud/discoveryengine/v1/internal/project_logging_decorator.h" +#include "google/cloud/discoveryengine/v1/project_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -142,3 +145,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/project_logging_decorator.h b/google/cloud/discoveryengine/v1/internal/project_logging_decorator.h index 1b753de110d96..4352266f55980 100644 --- a/google/cloud/discoveryengine/v1/internal/project_logging_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/project_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/project_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -85,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_PROJECT_LOGGING_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/project_metadata_decorator.cc b/google/cloud/discoveryengine/v1/internal/project_metadata_decorator.cc index d3ee74b157bb9..82de8f92ae877 100644 --- a/google/cloud/discoveryengine/v1/internal/project_metadata_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/project_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/discoveryengine/v1/project_service.proto #include "google/cloud/discoveryengine/v1/internal/project_metadata_decorator.h" +#include "google/cloud/discoveryengine/v1/project_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 discoveryengine_v1_internal { @@ -132,3 +136,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/project_metadata_decorator.h b/google/cloud/discoveryengine/v1/internal/project_metadata_decorator.h index 4fd4ef9d9584b..c535d4ac7c1cb 100644 --- a/google/cloud/discoveryengine/v1/internal/project_metadata_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/project_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/project_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -90,4 +93,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_PROJECT_METADATA_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/project_option_defaults.cc b/google/cloud/discoveryengine/v1/internal/project_option_defaults.cc index 8b07e30b875ae..609ac06d551ca 100644 --- a/google/cloud/discoveryengine/v1/internal/project_option_defaults.cc +++ b/google/cloud/discoveryengine/v1/internal/project_option_defaults.cc @@ -42,7 +42,7 @@ Options ProjectServiceDefaultOptions(Options options) { if (!options.has()) { options.set( discoveryengine_v1::ProjectServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/discoveryengine/v1/internal/project_stub.cc b/google/cloud/discoveryengine/v1/internal/project_stub.cc index 5d59bf7362b49..6385dc07c8fc6 100644 --- a/google/cloud/discoveryengine/v1/internal/project_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/project_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/discoveryengine/v1/project_service.proto #include "google/cloud/discoveryengine/v1/internal/project_stub.h" +#include "google/cloud/discoveryengine/v1/project_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -142,3 +145,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/project_stub.h b/google/cloud/discoveryengine/v1/internal/project_stub.h index fd6da5e8aaa5a..1590fe97c0ca1 100644 --- a/google/cloud/discoveryengine/v1/internal/project_stub.h +++ b/google/cloud/discoveryengine/v1/internal/project_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_PROJECT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_PROJECT_STUB_H +#include "google/cloud/discoveryengine/v1/project_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -136,4 +139,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_PROJECT_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/project_stub_factory.cc b/google/cloud/discoveryengine/v1/internal/project_stub_factory.cc index e2ca3b19a60cf..437ea774ff465 100644 --- a/google/cloud/discoveryengine/v1/internal/project_stub_factory.cc +++ b/google/cloud/discoveryengine/v1/internal/project_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/discoveryengine/v1/internal/project_metadata_decorator.h" #include "google/cloud/discoveryengine/v1/internal/project_stub.h" #include "google/cloud/discoveryengine/v1/internal/project_tracing_stub.h" +#include "google/cloud/discoveryengine/v1/project_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/project_stub_factory.h b/google/cloud/discoveryengine/v1/internal/project_stub_factory.h index e35a5c9f5d9ba..8cef778ac3dc0 100644 --- a/google/cloud/discoveryengine/v1/internal/project_stub_factory.h +++ b/google/cloud/discoveryengine/v1/internal/project_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_PROJECT_STUB_FACTORY_H diff --git a/google/cloud/discoveryengine/v1/internal/project_tracing_connection.cc b/google/cloud/discoveryengine/v1/internal/project_tracing_connection.cc index 6211f5c509f5e..a4b2c9d793acb 100644 --- a/google/cloud/discoveryengine/v1/internal/project_tracing_connection.cc +++ b/google/cloud/discoveryengine/v1/internal/project_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ProjectServiceTracingConnection::ProjectServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -93,16 +91,12 @@ Status ProjectServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeProjectServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/discoveryengine/v1/internal/project_tracing_connection.h b/google/cloud/discoveryengine/v1/internal/project_tracing_connection.h index 44b0319842f06..2b9e4172cb7f5 100644 --- a/google/cloud/discoveryengine/v1/internal/project_tracing_connection.h +++ b/google/cloud/discoveryengine/v1/internal/project_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ProjectServiceTracingConnection : public discoveryengine_v1::ProjectServiceConnection { public: @@ -66,8 +64,6 @@ class ProjectServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/discoveryengine/v1/internal/project_tracing_stub.cc b/google/cloud/discoveryengine/v1/internal/project_tracing_stub.cc index aff9e88719194..e6334e5cc1f18 100644 --- a/google/cloud/discoveryengine/v1/internal/project_tracing_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/project_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ProjectServiceTracingStub::ProjectServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -124,18 +125,14 @@ future ProjectServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeProjectServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/project_tracing_stub.h b/google/cloud/discoveryengine/v1/internal/project_tracing_stub.h index 99bce2b450fc9..18bbbdf75800a 100644 --- a/google/cloud/discoveryengine/v1/internal/project_tracing_stub.h +++ b/google/cloud/discoveryengine/v1/internal/project_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ProjectServiceTracingStub : public ProjectServiceStub { public: ~ProjectServiceTracingStub() override = default; @@ -80,8 +81,6 @@ class ProjectServiceTracingStub : public ProjectServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -96,4 +95,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_PROJECT_TRACING_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/rank_auth_decorator.cc b/google/cloud/discoveryengine/v1/internal/rank_auth_decorator.cc index afbd02d36ac8f..37d2d5a7f08e2 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_auth_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/rank_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/discoveryengine/v1/rank_service.proto #include "google/cloud/discoveryengine/v1/internal/rank_auth_decorator.h" -#include +#include "google/cloud/discoveryengine/v1/rank_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/rank_auth_decorator.h b/google/cloud/discoveryengine/v1/internal/rank_auth_decorator.h index 0a5464f04d85e..9bade3abaaffc 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_auth_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/rank_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -64,4 +67,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RANK_AUTH_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/rank_logging_decorator.cc b/google/cloud/discoveryengine/v1/internal/rank_logging_decorator.cc index a46b891a73321..4f16ade48a53e 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_logging_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/rank_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/discoveryengine/v1/rank_service.proto #include "google/cloud/discoveryengine/v1/internal/rank_logging_decorator.h" +#include "google/cloud/discoveryengine/v1/rank_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -85,3 +88,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/rank_logging_decorator.h b/google/cloud/discoveryengine/v1/internal/rank_logging_decorator.h index 7ac257e0a45bb..a85e260d485b1 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_logging_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/rank_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -64,4 +67,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RANK_LOGGING_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/rank_metadata_decorator.cc b/google/cloud/discoveryengine/v1/internal/rank_metadata_decorator.cc index 8ae9eb26bedf6..60a114f59487d 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_metadata_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/rank_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/discoveryengine/v1/rank_service.proto #include "google/cloud/discoveryengine/v1/internal/rank_metadata_decorator.h" +#include "google/cloud/discoveryengine/v1/rank_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 discoveryengine_v1_internal { @@ -96,3 +100,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/rank_metadata_decorator.h b/google/cloud/discoveryengine/v1/internal/rank_metadata_decorator.h index 665e333c6911f..aec17ad29bcdc 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_metadata_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/rank_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -69,4 +72,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RANK_METADATA_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/rank_option_defaults.cc b/google/cloud/discoveryengine/v1/internal/rank_option_defaults.cc index 8ee48757d614b..d52d6a5df776f 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_option_defaults.cc +++ b/google/cloud/discoveryengine/v1/internal/rank_option_defaults.cc @@ -42,7 +42,7 @@ Options RankServiceDefaultOptions(Options options) { if (!options.has()) { options.set( discoveryengine_v1::RankServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/discoveryengine/v1/internal/rank_stub.cc b/google/cloud/discoveryengine/v1/internal/rank_stub.cc index c1698914f47f7..1caf53d560ef6 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/rank_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/discoveryengine/v1/rank_service.proto #include "google/cloud/discoveryengine/v1/internal/rank_stub.h" +#include "google/cloud/discoveryengine/v1/rank_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -80,3 +83,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/rank_stub.h b/google/cloud/discoveryengine/v1/internal/rank_stub.h index e5de4b4515e43..94080df166678 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_stub.h +++ b/google/cloud/discoveryengine/v1/internal/rank_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RANK_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RANK_STUB_H +#include "google/cloud/discoveryengine/v1/rank_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -93,4 +96,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RANK_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/rank_stub_factory.cc b/google/cloud/discoveryengine/v1/internal/rank_stub_factory.cc index 3560b93aac2a8..d3cebb6e25942 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_stub_factory.cc +++ b/google/cloud/discoveryengine/v1/internal/rank_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/discoveryengine/v1/internal/rank_metadata_decorator.h" #include "google/cloud/discoveryengine/v1/internal/rank_stub.h" #include "google/cloud/discoveryengine/v1/internal/rank_tracing_stub.h" +#include "google/cloud/discoveryengine/v1/rank_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/rank_stub_factory.h b/google/cloud/discoveryengine/v1/internal/rank_stub_factory.h index 2f79455adbbc6..b834298759679 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_stub_factory.h +++ b/google/cloud/discoveryengine/v1/internal/rank_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RANK_STUB_FACTORY_H diff --git a/google/cloud/discoveryengine/v1/internal/rank_tracing_connection.cc b/google/cloud/discoveryengine/v1/internal/rank_tracing_connection.cc index 4c65538171c5f..f711b61875daf 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_tracing_connection.cc +++ b/google/cloud/discoveryengine/v1/internal/rank_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RankServiceTracingConnection::RankServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -70,16 +68,12 @@ Status RankServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRankServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/discoveryengine/v1/internal/rank_tracing_connection.h b/google/cloud/discoveryengine/v1/internal/rank_tracing_connection.h index 01b3665491011..a17a417f016e4 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_tracing_connection.h +++ b/google/cloud/discoveryengine/v1/internal/rank_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RankServiceTracingConnection : public discoveryengine_v1::RankServiceConnection { public: @@ -56,8 +54,6 @@ class RankServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/discoveryengine/v1/internal/rank_tracing_stub.cc b/google/cloud/discoveryengine/v1/internal/rank_tracing_stub.cc index 45ff8ecd3f45e..ac734cb326895 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_tracing_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/rank_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RankServiceTracingStub::RankServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -78,18 +79,14 @@ Status RankServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRankServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/rank_tracing_stub.h b/google/cloud/discoveryengine/v1/internal/rank_tracing_stub.h index a908ee498afba..891ca565f5926 100644 --- a/google/cloud/discoveryengine/v1/internal/rank_tracing_stub.h +++ b/google/cloud/discoveryengine/v1/internal/rank_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RankServiceTracingStub : public RankServiceStub { public: ~RankServiceTracingStub() override = default; @@ -60,8 +61,6 @@ class RankServiceTracingStub : public RankServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -76,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RANK_TRACING_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_auth_decorator.cc b/google/cloud/discoveryengine/v1/internal/recommendation_auth_decorator.cc index ff5b4c990c09f..46a442ba76476 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_auth_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/recommendation_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/discoveryengine/v1/recommendation_service.proto #include "google/cloud/discoveryengine/v1/internal/recommendation_auth_decorator.h" -#include +#include "google/cloud/discoveryengine/v1/recommendation_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_auth_decorator.h b/google/cloud/discoveryengine/v1/internal/recommendation_auth_decorator.h index 27f756c14d3f9..0f76a383e8a88 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_auth_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/recommendation_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -65,4 +68,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RECOMMENDATION_AUTH_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_logging_decorator.cc b/google/cloud/discoveryengine/v1/internal/recommendation_logging_decorator.cc index c76c42f255714..957b6f410ca1b 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_logging_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/recommendation_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/discoveryengine/v1/recommendation_service.proto #include "google/cloud/discoveryengine/v1/internal/recommendation_logging_decorator.h" +#include "google/cloud/discoveryengine/v1/recommendation_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -87,3 +90,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_logging_decorator.h b/google/cloud/discoveryengine/v1/internal/recommendation_logging_decorator.h index 3539071e225bb..ed76f10ece32a 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_logging_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/recommendation_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -65,4 +68,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RECOMMENDATION_LOGGING_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_metadata_decorator.cc b/google/cloud/discoveryengine/v1/internal/recommendation_metadata_decorator.cc index 165a96d52dbd6..8c0de408028cf 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_metadata_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/recommendation_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/discoveryengine/v1/recommendation_service.proto #include "google/cloud/discoveryengine/v1/internal/recommendation_metadata_decorator.h" +#include "google/cloud/discoveryengine/v1/recommendation_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 discoveryengine_v1_internal { @@ -97,3 +101,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_metadata_decorator.h b/google/cloud/discoveryengine/v1/internal/recommendation_metadata_decorator.h index f33a6e2e829b9..dd43f59d72681 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_metadata_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/recommendation_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -71,4 +74,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RECOMMENDATION_METADATA_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_option_defaults.cc b/google/cloud/discoveryengine/v1/internal/recommendation_option_defaults.cc index ac0ac120a1158..00a2911b57950 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_option_defaults.cc +++ b/google/cloud/discoveryengine/v1/internal/recommendation_option_defaults.cc @@ -43,7 +43,7 @@ Options RecommendationServiceDefaultOptions(Options options) { .has()) { options.set( discoveryengine_v1::RecommendationServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_stub.cc b/google/cloud/discoveryengine/v1/internal/recommendation_stub.cc index 5368fdb04542a..35d7dc5915ce8 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/recommendation_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/discoveryengine/v1/recommendation_service.proto #include "google/cloud/discoveryengine/v1/internal/recommendation_stub.h" +#include "google/cloud/discoveryengine/v1/recommendation_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -81,3 +84,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_stub.h b/google/cloud/discoveryengine/v1/internal/recommendation_stub.h index 06e9005151068..b8fc547b12fe0 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_stub.h +++ b/google/cloud/discoveryengine/v1/internal/recommendation_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RECOMMENDATION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RECOMMENDATION_STUB_H +#include "google/cloud/discoveryengine/v1/recommendation_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -95,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RECOMMENDATION_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_stub_factory.cc b/google/cloud/discoveryengine/v1/internal/recommendation_stub_factory.cc index aa5321901a2de..0dc1a4f399222 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_stub_factory.cc +++ b/google/cloud/discoveryengine/v1/internal/recommendation_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/discoveryengine/v1/internal/recommendation_metadata_decorator.h" #include "google/cloud/discoveryengine/v1/internal/recommendation_stub.h" #include "google/cloud/discoveryengine/v1/internal/recommendation_tracing_stub.h" +#include "google/cloud/discoveryengine/v1/recommendation_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_stub_factory.h b/google/cloud/discoveryengine/v1/internal/recommendation_stub_factory.h index c8be7623bbd50..4f8b7a2502cf3 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_stub_factory.h +++ b/google/cloud/discoveryengine/v1/internal/recommendation_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RECOMMENDATION_STUB_FACTORY_H diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_tracing_connection.cc b/google/cloud/discoveryengine/v1/internal/recommendation_tracing_connection.cc index 56ebdb8f20fe0..81e4bdeb159bd 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_tracing_connection.cc +++ b/google/cloud/discoveryengine/v1/internal/recommendation_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RecommendationServiceTracingConnection::RecommendationServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -70,17 +68,13 @@ Status RecommendationServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRecommendationServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_tracing_connection.h b/google/cloud/discoveryengine/v1/internal/recommendation_tracing_connection.h index a0165b3e9cbc5..3e55702f26f7f 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_tracing_connection.h +++ b/google/cloud/discoveryengine/v1/internal/recommendation_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RecommendationServiceTracingConnection : public discoveryengine_v1::RecommendationServiceConnection { public: @@ -58,8 +56,6 @@ class RecommendationServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_tracing_stub.cc b/google/cloud/discoveryengine/v1/internal/recommendation_tracing_stub.cc index f3fa9ca14c512..257543b5da1fa 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_tracing_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/recommendation_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RecommendationServiceTracingStub::RecommendationServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -81,18 +82,14 @@ Status RecommendationServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRecommendationServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/recommendation_tracing_stub.h b/google/cloud/discoveryengine/v1/internal/recommendation_tracing_stub.h index a2918b9e3b2bf..697e4ea04e73e 100644 --- a/google/cloud/discoveryengine/v1/internal/recommendation_tracing_stub.h +++ b/google/cloud/discoveryengine/v1/internal/recommendation_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RecommendationServiceTracingStub : public RecommendationServiceStub { public: ~RecommendationServiceTracingStub() override = default; @@ -62,8 +63,6 @@ class RecommendationServiceTracingStub : public RecommendationServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -78,4 +77,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_RECOMMENDATION_TRACING_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/schema_auth_decorator.cc b/google/cloud/discoveryengine/v1/internal/schema_auth_decorator.cc index bc5e120e6ad98..b6266b65a8c2d 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_auth_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/schema_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/discoveryengine/v1/schema_service.proto #include "google/cloud/discoveryengine/v1/internal/schema_auth_decorator.h" -#include +#include "google/cloud/discoveryengine/v1/schema_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -198,3 +201,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/schema_auth_decorator.h b/google/cloud/discoveryengine/v1/internal/schema_auth_decorator.h index ebb9e62f60b82..6a928db420471 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_auth_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/schema_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/schema_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -119,4 +122,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SCHEMA_AUTH_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/schema_connection_impl.h b/google/cloud/discoveryengine/v1/internal/schema_connection_impl.h index 08a153668f18c..a6cef5b41853a 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_connection_impl.h +++ b/google/cloud/discoveryengine/v1/internal/schema_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/internal/schema_logging_decorator.cc b/google/cloud/discoveryengine/v1/internal/schema_logging_decorator.cc index 34bf0c2c3e9fb..78dac25d1d967 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_logging_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/schema_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/discoveryengine/v1/schema_service.proto #include "google/cloud/discoveryengine/v1/internal/schema_logging_decorator.h" +#include "google/cloud/discoveryengine/v1/schema_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -227,3 +230,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/schema_logging_decorator.h b/google/cloud/discoveryengine/v1/internal/schema_logging_decorator.h index 51d498631cffb..91cdff595395e 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_logging_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/schema_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/schema_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -119,4 +122,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SCHEMA_LOGGING_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/schema_metadata_decorator.cc b/google/cloud/discoveryengine/v1/internal/schema_metadata_decorator.cc index 83a10a84ac4d4..30d4ccb9c26c3 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_metadata_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/schema_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/discoveryengine/v1/schema_service.proto #include "google/cloud/discoveryengine/v1/internal/schema_metadata_decorator.h" +#include "google/cloud/discoveryengine/v1/schema_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 discoveryengine_v1_internal { @@ -189,3 +193,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/schema_metadata_decorator.h b/google/cloud/discoveryengine/v1/internal/schema_metadata_decorator.h index 36869f36a7b74..2715f0335db2a 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_metadata_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/schema_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/schema_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -124,4 +127,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SCHEMA_METADATA_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/schema_option_defaults.cc b/google/cloud/discoveryengine/v1/internal/schema_option_defaults.cc index ce83dfbe2ea34..11264c0970839 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_option_defaults.cc +++ b/google/cloud/discoveryengine/v1/internal/schema_option_defaults.cc @@ -42,7 +42,7 @@ Options SchemaServiceDefaultOptions(Options options) { if (!options.has()) { options.set( discoveryengine_v1::SchemaServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/discoveryengine/v1/internal/schema_stub.cc b/google/cloud/discoveryengine/v1/internal/schema_stub.cc index 833fb62641cec..2b41ca703da67 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/schema_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/discoveryengine/v1/schema_service.proto #include "google/cloud/discoveryengine/v1/internal/schema_stub.h" +#include "google/cloud/discoveryengine/v1/schema_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -222,3 +225,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/schema_stub.h b/google/cloud/discoveryengine/v1/internal/schema_stub.h index 9df5d222e280c..a641909b0115a 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_stub.h +++ b/google/cloud/discoveryengine/v1/internal/schema_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SCHEMA_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SCHEMA_STUB_H +#include "google/cloud/discoveryengine/v1/schema_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -202,4 +205,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SCHEMA_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/schema_stub_factory.cc b/google/cloud/discoveryengine/v1/internal/schema_stub_factory.cc index 9173a97a662ce..1fea5ac925d4d 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_stub_factory.cc +++ b/google/cloud/discoveryengine/v1/internal/schema_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/discoveryengine/v1/internal/schema_metadata_decorator.h" #include "google/cloud/discoveryengine/v1/internal/schema_stub.h" #include "google/cloud/discoveryengine/v1/internal/schema_tracing_stub.h" +#include "google/cloud/discoveryengine/v1/schema_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/schema_stub_factory.h b/google/cloud/discoveryengine/v1/internal/schema_stub_factory.h index 4818a43486c56..67f48c45da346 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_stub_factory.h +++ b/google/cloud/discoveryengine/v1/internal/schema_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SCHEMA_STUB_FACTORY_H diff --git a/google/cloud/discoveryengine/v1/internal/schema_tracing_connection.cc b/google/cloud/discoveryengine/v1/internal/schema_tracing_connection.cc index 157ba629ae1e1..a2327a7e60345 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_tracing_connection.cc +++ b/google/cloud/discoveryengine/v1/internal/schema_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SchemaServiceTracingConnection::SchemaServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -166,16 +164,12 @@ Status SchemaServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSchemaServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/discoveryengine/v1/internal/schema_tracing_connection.h b/google/cloud/discoveryengine/v1/internal/schema_tracing_connection.h index a24d8204ab138..8eb7ab8180172 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_tracing_connection.h +++ b/google/cloud/discoveryengine/v1/internal/schema_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SchemaServiceTracingConnection : public discoveryengine_v1::SchemaServiceConnection { public: @@ -96,8 +94,6 @@ class SchemaServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/discoveryengine/v1/internal/schema_tracing_stub.cc b/google/cloud/discoveryengine/v1/internal/schema_tracing_stub.cc index fba3138c5a9c8..9c4a35487b45a 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_tracing_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/schema_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SchemaServiceTracingStub::SchemaServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -193,18 +194,14 @@ future SchemaServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSchemaServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/schema_tracing_stub.h b/google/cloud/discoveryengine/v1/internal/schema_tracing_stub.h index 00d91f29f4ee4..3797aecfe6407 100644 --- a/google/cloud/discoveryengine/v1/internal/schema_tracing_stub.h +++ b/google/cloud/discoveryengine/v1/internal/schema_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SchemaServiceTracingStub : public SchemaServiceStub { public: ~SchemaServiceTracingStub() override = default; @@ -114,8 +115,6 @@ class SchemaServiceTracingStub : public SchemaServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -130,4 +129,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SCHEMA_TRACING_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/search_auth_decorator.cc b/google/cloud/discoveryengine/v1/internal/search_auth_decorator.cc index 23c4d6e7409eb..976a03f05bcad 100644 --- a/google/cloud/discoveryengine/v1/internal/search_auth_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/search_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/discoveryengine/v1/search_service.proto #include "google/cloud/discoveryengine/v1/internal/search_auth_decorator.h" -#include +#include "google/cloud/discoveryengine/v1/search_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/search_auth_decorator.h b/google/cloud/discoveryengine/v1/internal/search_auth_decorator.h index 3196840aa802b..96b2d339bdb64 100644 --- a/google/cloud/discoveryengine/v1/internal/search_auth_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/search_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -70,4 +73,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SEARCH_AUTH_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/search_logging_decorator.cc b/google/cloud/discoveryengine/v1/internal/search_logging_decorator.cc index 7ce4583aabb54..e45f8e85979b6 100644 --- a/google/cloud/discoveryengine/v1/internal/search_logging_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/search_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/discoveryengine/v1/search_service.proto #include "google/cloud/discoveryengine/v1/internal/search_logging_decorator.h" +#include "google/cloud/discoveryengine/v1/search_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -97,3 +100,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/search_logging_decorator.h b/google/cloud/discoveryengine/v1/internal/search_logging_decorator.h index 6894995cae1be..59f6fd856f46d 100644 --- a/google/cloud/discoveryengine/v1/internal/search_logging_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/search_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -70,4 +73,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SEARCH_LOGGING_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/search_metadata_decorator.cc b/google/cloud/discoveryengine/v1/internal/search_metadata_decorator.cc index 52f777dd88124..dac34306815d6 100644 --- a/google/cloud/discoveryengine/v1/internal/search_metadata_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/search_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/discoveryengine/v1/search_service.proto #include "google/cloud/discoveryengine/v1/internal/search_metadata_decorator.h" +#include "google/cloud/discoveryengine/v1/search_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 discoveryengine_v1_internal { @@ -106,3 +110,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/search_metadata_decorator.h b/google/cloud/discoveryengine/v1/internal/search_metadata_decorator.h index 064d4c0cf7b8d..2a5699ac21e39 100644 --- a/google/cloud/discoveryengine/v1/internal/search_metadata_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/search_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -75,4 +78,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SEARCH_METADATA_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/search_option_defaults.cc b/google/cloud/discoveryengine/v1/internal/search_option_defaults.cc index faa490f05ef94..ffb89e26c550f 100644 --- a/google/cloud/discoveryengine/v1/internal/search_option_defaults.cc +++ b/google/cloud/discoveryengine/v1/internal/search_option_defaults.cc @@ -42,7 +42,7 @@ Options SearchServiceDefaultOptions(Options options) { if (!options.has()) { options.set( discoveryengine_v1::SearchServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/discoveryengine/v1/internal/search_stub.cc b/google/cloud/discoveryengine/v1/internal/search_stub.cc index cf9f2e1ad55fe..cb220271838b7 100644 --- a/google/cloud/discoveryengine/v1/internal/search_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/search_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/discoveryengine/v1/search_service.proto #include "google/cloud/discoveryengine/v1/internal/search_stub.h" +#include "google/cloud/discoveryengine/v1/search_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -92,3 +95,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/search_stub.h b/google/cloud/discoveryengine/v1/internal/search_stub.h index c28b0ee5eaf55..9517696cebb4e 100644 --- a/google/cloud/discoveryengine/v1/internal/search_stub.h +++ b/google/cloud/discoveryengine/v1/internal/search_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SEARCH_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SEARCH_STUB_H +#include "google/cloud/discoveryengine/v1/search_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SEARCH_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/search_stub_factory.cc b/google/cloud/discoveryengine/v1/internal/search_stub_factory.cc index 76617f7cb15e1..f577a8176de3b 100644 --- a/google/cloud/discoveryengine/v1/internal/search_stub_factory.cc +++ b/google/cloud/discoveryengine/v1/internal/search_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/discoveryengine/v1/internal/search_metadata_decorator.h" #include "google/cloud/discoveryengine/v1/internal/search_stub.h" #include "google/cloud/discoveryengine/v1/internal/search_tracing_stub.h" +#include "google/cloud/discoveryengine/v1/search_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/search_stub_factory.h b/google/cloud/discoveryengine/v1/internal/search_stub_factory.h index b345ed5fcd807..97e171a9d4c69 100644 --- a/google/cloud/discoveryengine/v1/internal/search_stub_factory.h +++ b/google/cloud/discoveryengine/v1/internal/search_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SEARCH_STUB_FACTORY_H diff --git a/google/cloud/discoveryengine/v1/internal/search_tracing_connection.cc b/google/cloud/discoveryengine/v1/internal/search_tracing_connection.cc index 2855e8133aa53..a083de4803088 100644 --- a/google/cloud/discoveryengine/v1/internal/search_tracing_connection.cc +++ b/google/cloud/discoveryengine/v1/internal/search_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SearchServiceTracingConnection::SearchServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -85,16 +83,12 @@ Status SearchServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSearchServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/discoveryengine/v1/internal/search_tracing_connection.h b/google/cloud/discoveryengine/v1/internal/search_tracing_connection.h index 97e108232c77b..67203515e3a1f 100644 --- a/google/cloud/discoveryengine/v1/internal/search_tracing_connection.h +++ b/google/cloud/discoveryengine/v1/internal/search_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SearchServiceTracingConnection : public discoveryengine_v1::SearchServiceConnection { public: @@ -60,8 +58,6 @@ class SearchServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/discoveryengine/v1/internal/search_tracing_stub.cc b/google/cloud/discoveryengine/v1/internal/search_tracing_stub.cc index dd9cbe5ce9ecb..13f0bd281b020 100644 --- a/google/cloud/discoveryengine/v1/internal/search_tracing_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/search_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SearchServiceTracingStub::SearchServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -90,18 +91,14 @@ Status SearchServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSearchServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/search_tracing_stub.h b/google/cloud/discoveryengine/v1/internal/search_tracing_stub.h index 05c591bf48ea2..00dd2c8f8f077 100644 --- a/google/cloud/discoveryengine/v1/internal/search_tracing_stub.h +++ b/google/cloud/discoveryengine/v1/internal/search_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SearchServiceTracingStub : public SearchServiceStub { public: ~SearchServiceTracingStub() override = default; @@ -66,8 +67,6 @@ class SearchServiceTracingStub : public SearchServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -82,4 +81,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SEARCH_TRACING_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_auth_decorator.cc b/google/cloud/discoveryengine/v1/internal/site_search_engine_auth_decorator.cc index d4115520873a5..c57883d41ff97 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_auth_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/discoveryengine/v1/site_search_engine_service.proto #include "google/cloud/discoveryengine/v1/internal/site_search_engine_auth_decorator.h" -#include +#include "google/cloud/discoveryengine/v1/site_search_engine_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -449,3 +452,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_auth_decorator.h b/google/cloud/discoveryengine/v1/internal/site_search_engine_auth_decorator.h index dd689f58b8566..90c90f06a2d6f 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_auth_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/site_search_engine_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -224,4 +227,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SITE_SEARCH_ENGINE_AUTH_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_connection_impl.h b/google/cloud/discoveryengine/v1/internal/site_search_engine_connection_impl.h index a0f88453cec86..0d96bff555555 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_connection_impl.h +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_logging_decorator.cc b/google/cloud/discoveryengine/v1/internal/site_search_engine_logging_decorator.cc index f2bfd3cd47df2..249c3291aeb00 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_logging_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/discoveryengine/v1/site_search_engine_service.proto #include "google/cloud/discoveryengine/v1/internal/site_search_engine_logging_decorator.h" +#include "google/cloud/discoveryengine/v1/site_search_engine_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -512,3 +515,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_logging_decorator.h b/google/cloud/discoveryengine/v1/internal/site_search_engine_logging_decorator.h index 893eecf0be0f6..ce0a42a9c1e00 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_logging_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/site_search_engine_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -224,4 +227,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SITE_SEARCH_ENGINE_LOGGING_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_metadata_decorator.cc b/google/cloud/discoveryengine/v1/internal/site_search_engine_metadata_decorator.cc index 6cd5c4614ba5d..a5778988d7aa6 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_metadata_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/discoveryengine/v1/site_search_engine_service.proto #include "google/cloud/discoveryengine/v1/internal/site_search_engine_metadata_decorator.h" +#include "google/cloud/discoveryengine/v1/site_search_engine_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 discoveryengine_v1_internal { @@ -391,3 +395,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_metadata_decorator.h b/google/cloud/discoveryengine/v1/internal/site_search_engine_metadata_decorator.h index e2d20a908dd5e..9a3eb49ee4bbf 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_metadata_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/site_search_engine_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -230,4 +233,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SITE_SEARCH_ENGINE_METADATA_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_option_defaults.cc b/google/cloud/discoveryengine/v1/internal/site_search_engine_option_defaults.cc index be9cb87671fd6..ba1c2db698548 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_option_defaults.cc +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_option_defaults.cc @@ -44,7 +44,7 @@ Options SiteSearchEngineServiceDefaultOptions(Options options) { discoveryengine_v1::SiteSearchEngineServiceRetryPolicyOption>()) { options.set( discoveryengine_v1::SiteSearchEngineServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_stub.cc b/google/cloud/discoveryengine/v1/internal/site_search_engine_stub.cc index 02495f5f6255c..4e5ea7c74ee5c 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/discoveryengine/v1/site_search_engine_service.proto #include "google/cloud/discoveryengine/v1/internal/site_search_engine_stub.h" +#include "google/cloud/discoveryengine/v1/site_search_engine_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -502,3 +505,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_stub.h b/google/cloud/discoveryengine/v1/internal/site_search_engine_stub.h index 375af980e396d..1b018381266eb 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_stub.h +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SITE_SEARCH_ENGINE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SITE_SEARCH_ENGINE_STUB_H +#include "google/cloud/discoveryengine/v1/site_search_engine_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -418,4 +421,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SITE_SEARCH_ENGINE_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_stub_factory.cc b/google/cloud/discoveryengine/v1/internal/site_search_engine_stub_factory.cc index f1b61082ee684..c69b9924936e0 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_stub_factory.cc +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/discoveryengine/v1/internal/site_search_engine_metadata_decorator.h" #include "google/cloud/discoveryengine/v1/internal/site_search_engine_stub.h" #include "google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_stub.h" +#include "google/cloud/discoveryengine/v1/site_search_engine_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_stub_factory.h b/google/cloud/discoveryengine/v1/internal/site_search_engine_stub_factory.h index bc6a136610020..5b69f93b2db07 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_stub_factory.h +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SITE_SEARCH_ENGINE_STUB_FACTORY_H diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_connection.cc b/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_connection.cc index 4a7bc41665321..46797dd0dca98 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_connection.cc +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SiteSearchEngineServiceTracingConnection:: SiteSearchEngineServiceTracingConnection( std::shared_ptr @@ -459,18 +457,14 @@ Status SiteSearchEngineServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSiteSearchEngineServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_connection.h b/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_connection.h index 95aaeca1080c2..ef6f6189577ec 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_connection.h +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SiteSearchEngineServiceTracingConnection : public discoveryengine_v1::SiteSearchEngineServiceConnection { public: @@ -214,8 +212,6 @@ class SiteSearchEngineServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_stub.cc b/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_stub.cc index 0b71308719d60..d9dea9ade663b 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SiteSearchEngineServiceTracingStub::SiteSearchEngineServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -470,19 +471,15 @@ future SiteSearchEngineServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSiteSearchEngineServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_stub.h b/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_stub.h index e3f4862e8514b..dc7e62134a988 100644 --- a/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_stub.h +++ b/google/cloud/discoveryengine/v1/internal/site_search_engine_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SiteSearchEngineServiceTracingStub : public SiteSearchEngineServiceStub { public: ~SiteSearchEngineServiceTracingStub() override = default; @@ -220,8 +221,6 @@ class SiteSearchEngineServiceTracingStub : public SiteSearchEngineServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -237,4 +236,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_SITE_SEARCH_ENGINE_TRACING_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/user_event_auth_decorator.cc b/google/cloud/discoveryengine/v1/internal/user_event_auth_decorator.cc index e0568a9bfb438..c0e38904d4c7d 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_auth_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/user_event_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/discoveryengine/v1/user_event_service.proto #include "google/cloud/discoveryengine/v1/internal/user_event_auth_decorator.h" -#include +#include "google/cloud/discoveryengine/v1/user_event_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -172,3 +175,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/user_event_auth_decorator.h b/google/cloud/discoveryengine/v1/internal/user_event_auth_decorator.h index 3185c3a5f8944..936397003ec02 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_auth_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/user_event_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/user_event_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -107,4 +110,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_USER_EVENT_AUTH_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/user_event_connection_impl.h b/google/cloud/discoveryengine/v1/internal/user_event_connection_impl.h index aaf515f2b790e..14351c26c603f 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_connection_impl.h +++ b/google/cloud/discoveryengine/v1/internal/user_event_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/internal/user_event_logging_decorator.cc b/google/cloud/discoveryengine/v1/internal/user_event_logging_decorator.cc index 23e57604203bc..ab772b0b4d476 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_logging_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/user_event_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/discoveryengine/v1/user_event_service.proto #include "google/cloud/discoveryengine/v1/internal/user_event_logging_decorator.h" +#include "google/cloud/discoveryengine/v1/user_event_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -200,3 +203,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/user_event_logging_decorator.h b/google/cloud/discoveryengine/v1/internal/user_event_logging_decorator.h index 0c5b0349fe465..a32f8a0df3d08 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_logging_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/user_event_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/user_event_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -107,4 +110,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_USER_EVENT_LOGGING_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/user_event_metadata_decorator.cc b/google/cloud/discoveryengine/v1/internal/user_event_metadata_decorator.cc index 7f1102d644e8b..d2b71e2edb877 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_metadata_decorator.cc +++ b/google/cloud/discoveryengine/v1/internal/user_event_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/discoveryengine/v1/user_event_service.proto #include "google/cloud/discoveryengine/v1/internal/user_event_metadata_decorator.h" +#include "google/cloud/discoveryengine/v1/user_event_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 discoveryengine_v1_internal { @@ -171,3 +175,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/user_event_metadata_decorator.h b/google/cloud/discoveryengine/v1/internal/user_event_metadata_decorator.h index c2eae82a9a33d..718ffa6ae3e27 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_metadata_decorator.h +++ b/google/cloud/discoveryengine/v1/internal/user_event_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/discoveryengine/v1/internal/user_event_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 discoveryengine_v1_internal { @@ -113,4 +116,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_USER_EVENT_METADATA_DECORATOR_H diff --git a/google/cloud/discoveryengine/v1/internal/user_event_option_defaults.cc b/google/cloud/discoveryengine/v1/internal/user_event_option_defaults.cc index 40047f7c38438..f0d657d2a446d 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_option_defaults.cc +++ b/google/cloud/discoveryengine/v1/internal/user_event_option_defaults.cc @@ -42,7 +42,7 @@ Options UserEventServiceDefaultOptions(Options options) { if (!options.has()) { options.set( discoveryengine_v1::UserEventServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/discoveryengine/v1/internal/user_event_stub.cc b/google/cloud/discoveryengine/v1/internal/user_event_stub.cc index f9394dd5cdaf7..488e62c63c494 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/user_event_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/discoveryengine/v1/user_event_service.proto #include "google/cloud/discoveryengine/v1/internal/user_event_stub.h" +#include "google/cloud/discoveryengine/v1/user_event_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -197,3 +200,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/user_event_stub.h b/google/cloud/discoveryengine/v1/internal/user_event_stub.h index b086feb43de1e..8fbcaf83b68fb 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_stub.h +++ b/google/cloud/discoveryengine/v1/internal/user_event_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_USER_EVENT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_USER_EVENT_STUB_H +#include "google/cloud/discoveryengine/v1/user_event_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -181,4 +184,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_USER_EVENT_STUB_H diff --git a/google/cloud/discoveryengine/v1/internal/user_event_stub_factory.cc b/google/cloud/discoveryengine/v1/internal/user_event_stub_factory.cc index 664c38fc50bff..e233e5b77cbef 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_stub_factory.cc +++ b/google/cloud/discoveryengine/v1/internal/user_event_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/discoveryengine/v1/internal/user_event_metadata_decorator.h" #include "google/cloud/discoveryengine/v1/internal/user_event_stub.h" #include "google/cloud/discoveryengine/v1/internal/user_event_tracing_stub.h" +#include "google/cloud/discoveryengine/v1/user_event_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/user_event_stub_factory.h b/google/cloud/discoveryengine/v1/internal/user_event_stub_factory.h index bae4962954be8..38344f977325a 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_stub_factory.h +++ b/google/cloud/discoveryengine/v1/internal/user_event_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_USER_EVENT_STUB_FACTORY_H diff --git a/google/cloud/discoveryengine/v1/internal/user_event_tracing_connection.cc b/google/cloud/discoveryengine/v1/internal/user_event_tracing_connection.cc index 9edadeb70eeeb..dd5fc466c5eb4 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_tracing_connection.cc +++ b/google/cloud/discoveryengine/v1/internal/user_event_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - UserEventServiceTracingConnection::UserEventServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -141,16 +139,12 @@ Status UserEventServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeUserEventServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/discoveryengine/v1/internal/user_event_tracing_connection.h b/google/cloud/discoveryengine/v1/internal/user_event_tracing_connection.h index da12e973a21f1..cefdb6b810432 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_tracing_connection.h +++ b/google/cloud/discoveryengine/v1/internal/user_event_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class UserEventServiceTracingConnection : public discoveryengine_v1::UserEventServiceConnection { public: @@ -87,8 +85,6 @@ class UserEventServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/discoveryengine/v1/internal/user_event_tracing_stub.cc b/google/cloud/discoveryengine/v1/internal/user_event_tracing_stub.cc index a2550ab6825d5..b94035b6657d1 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_tracing_stub.cc +++ b/google/cloud/discoveryengine/v1/internal/user_event_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - UserEventServiceTracingStub::UserEventServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -175,18 +176,14 @@ future UserEventServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeUserEventServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace discoveryengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/discoveryengine/v1/internal/user_event_tracing_stub.h b/google/cloud/discoveryengine/v1/internal/user_event_tracing_stub.h index 598ad60a35b3f..0a752eed93c35 100644 --- a/google/cloud/discoveryengine/v1/internal/user_event_tracing_stub.h +++ b/google/cloud/discoveryengine/v1/internal/user_event_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace discoveryengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class UserEventServiceTracingStub : public UserEventServiceStub { public: ~UserEventServiceTracingStub() override = default; @@ -103,8 +104,6 @@ class UserEventServiceTracingStub : public UserEventServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -119,4 +118,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_INTERNAL_USER_EVENT_TRACING_STUB_H diff --git a/google/cloud/discoveryengine/v1/project_client.h b/google/cloud/discoveryengine/v1/project_client.h index ef677619e4789..f1836e23c4ec5 100644 --- a/google/cloud/discoveryengine/v1/project_client.h +++ b/google/cloud/discoveryengine/v1/project_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -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/project_connection.h b/google/cloud/discoveryengine/v1/project_connection.h index a28f8b7e1a7b7..061a466a9c615 100644 --- a/google/cloud/discoveryengine/v1/project_connection.h +++ b/google/cloud/discoveryengine/v1/project_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/discoveryengine/v1/internal/project_retry_traits.h" #include "google/cloud/discoveryengine/v1/project_connection_idempotency_policy.h" +#include "google/cloud/discoveryengine/v1/project_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/project_connection_idempotency_policy.h b/google/cloud/discoveryengine/v1/project_connection_idempotency_policy.h index f23a997ef84f0..e5a4b851f8cc0 100644 --- a/google/cloud/discoveryengine/v1/project_connection_idempotency_policy.h +++ b/google/cloud/discoveryengine/v1/project_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_PROJECT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_PROJECT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/discoveryengine/v1/project_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/rank_connection.h b/google/cloud/discoveryengine/v1/rank_connection.h index bc33559841400..735177ee4fd2d 100644 --- a/google/cloud/discoveryengine/v1/rank_connection.h +++ b/google/cloud/discoveryengine/v1/rank_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/discoveryengine/v1/internal/rank_retry_traits.h" #include "google/cloud/discoveryengine/v1/rank_connection_idempotency_policy.h" +#include "google/cloud/discoveryengine/v1/rank_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 #include namespace google { diff --git a/google/cloud/discoveryengine/v1/rank_connection_idempotency_policy.h b/google/cloud/discoveryengine/v1/rank_connection_idempotency_policy.h index e7dee987bb412..8182ecd3f2f90 100644 --- a/google/cloud/discoveryengine/v1/rank_connection_idempotency_policy.h +++ b/google/cloud/discoveryengine/v1/rank_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_RANK_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_RANK_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/discoveryengine/v1/rank_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/recommendation_connection.h b/google/cloud/discoveryengine/v1/recommendation_connection.h index 21b04ff237ae5..c1a7e8b4491e2 100644 --- a/google/cloud/discoveryengine/v1/recommendation_connection.h +++ b/google/cloud/discoveryengine/v1/recommendation_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/discoveryengine/v1/internal/recommendation_retry_traits.h" #include "google/cloud/discoveryengine/v1/recommendation_connection_idempotency_policy.h" +#include "google/cloud/discoveryengine/v1/recommendation_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 #include namespace google { diff --git a/google/cloud/discoveryengine/v1/recommendation_connection_idempotency_policy.h b/google/cloud/discoveryengine/v1/recommendation_connection_idempotency_policy.h index e09ce0d7ecc3a..e7de9607d6f7a 100644 --- a/google/cloud/discoveryengine/v1/recommendation_connection_idempotency_policy.h +++ b/google/cloud/discoveryengine/v1/recommendation_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_RECOMMENDATION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_RECOMMENDATION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/discoveryengine/v1/recommendation_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/schema_client.h b/google/cloud/discoveryengine/v1/schema_client.h index c1a285d3b36c3..b49d005c6a80d 100644 --- a/google/cloud/discoveryengine/v1/schema_client.h +++ b/google/cloud/discoveryengine/v1/schema_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -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/schema_connection.h b/google/cloud/discoveryengine/v1/schema_connection.h index 0c2f1d9fae0bf..8c6ea3285708f 100644 --- a/google/cloud/discoveryengine/v1/schema_connection.h +++ b/google/cloud/discoveryengine/v1/schema_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/discoveryengine/v1/internal/schema_retry_traits.h" #include "google/cloud/discoveryengine/v1/schema_connection_idempotency_policy.h" +#include "google/cloud/discoveryengine/v1/schema_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/schema_connection_idempotency_policy.h b/google/cloud/discoveryengine/v1/schema_connection_idempotency_policy.h index 6ed0d0d34c6a2..561a07c5bfdbf 100644 --- a/google/cloud/discoveryengine/v1/schema_connection_idempotency_policy.h +++ b/google/cloud/discoveryengine/v1/schema_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_SCHEMA_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_SCHEMA_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/discoveryengine/v1/schema_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/search_client.h b/google/cloud/discoveryengine/v1/search_client.h index a45b2e7b4f80f..28518dcece0ff 100644 --- a/google/cloud/discoveryengine/v1/search_client.h +++ b/google/cloud/discoveryengine/v1/search_client.h @@ -119,7 +119,7 @@ class SearchServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.discoveryengine.v1.SearchRequest]: @googleapis_reference_link{google/cloud/discoveryengine/v1/search_service.proto#L91} - /// [google.cloud.discoveryengine.v1.SearchResponse.SearchResult]: @googleapis_reference_link{google/cloud/discoveryengine/v1/search_service.proto#L1188} + /// [google.cloud.discoveryengine.v1.SearchResponse.SearchResult]: @googleapis_reference_link{google/cloud/discoveryengine/v1/search_service.proto#L1352} /// // clang-format on StreamRange @@ -171,7 +171,7 @@ class SearchServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.discoveryengine.v1.SearchRequest]: @googleapis_reference_link{google/cloud/discoveryengine/v1/search_service.proto#L91} - /// [google.cloud.discoveryengine.v1.SearchResponse.SearchResult]: @googleapis_reference_link{google/cloud/discoveryengine/v1/search_service.proto#L1188} + /// [google.cloud.discoveryengine.v1.SearchResponse.SearchResult]: @googleapis_reference_link{google/cloud/discoveryengine/v1/search_service.proto#L1352} /// [google.cloud.discoveryengine.v1.SearchService.Search]: @googleapis_reference_link{google/cloud/discoveryengine/v1/search_service.proto#L44} /// // clang-format on @@ -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/search_connection.h b/google/cloud/discoveryengine/v1/search_connection.h index 2b5fea462f6d1..d955474d0c4a6 100644 --- a/google/cloud/discoveryengine/v1/search_connection.h +++ b/google/cloud/discoveryengine/v1/search_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/discoveryengine/v1/internal/search_retry_traits.h" #include "google/cloud/discoveryengine/v1/search_connection_idempotency_policy.h" +#include "google/cloud/discoveryengine/v1/search_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 #include namespace google { diff --git a/google/cloud/discoveryengine/v1/search_connection_idempotency_policy.h b/google/cloud/discoveryengine/v1/search_connection_idempotency_policy.h index 01643cee194eb..83513e3361c99 100644 --- a/google/cloud/discoveryengine/v1/search_connection_idempotency_policy.h +++ b/google/cloud/discoveryengine/v1/search_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/discoveryengine/v1/search_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/site_search_engine_client.h b/google/cloud/discoveryengine/v1/site_search_engine_client.h index 7f0b47dfdaafc..4978c26a54e2b 100644 --- a/google/cloud/discoveryengine/v1/site_search_engine_client.h +++ b/google/cloud/discoveryengine/v1/site_search_engine_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -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/site_search_engine_connection.h b/google/cloud/discoveryengine/v1/site_search_engine_connection.h index 4d374e2bddad2..8e8b7ec3ea6fb 100644 --- a/google/cloud/discoveryengine/v1/site_search_engine_connection.h +++ b/google/cloud/discoveryengine/v1/site_search_engine_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/discoveryengine/v1/internal/site_search_engine_retry_traits.h" #include "google/cloud/discoveryengine/v1/site_search_engine_connection_idempotency_policy.h" +#include "google/cloud/discoveryengine/v1/site_search_engine_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/site_search_engine_connection_idempotency_policy.h b/google/cloud/discoveryengine/v1/site_search_engine_connection_idempotency_policy.h index 9cb7beadc17e1..e79f43930f49b 100644 --- a/google/cloud/discoveryengine/v1/site_search_engine_connection_idempotency_policy.h +++ b/google/cloud/discoveryengine/v1/site_search_engine_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_SITE_SEARCH_ENGINE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_SITE_SEARCH_ENGINE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/discoveryengine/v1/site_search_engine_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/user_event_client.h b/google/cloud/discoveryengine/v1/user_event_client.h index 38170801c8ad1..03ab0d3155b80 100644 --- a/google/cloud/discoveryengine/v1/user_event_client.h +++ b/google/cloud/discoveryengine/v1/user_event_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/discoveryengine/v1/user_event_connection.h b/google/cloud/discoveryengine/v1/user_event_connection.h index 84aeb7aa59f33..c7d999e09a79b 100644 --- a/google/cloud/discoveryengine/v1/user_event_connection.h +++ b/google/cloud/discoveryengine/v1/user_event_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/discoveryengine/v1/internal/user_event_retry_traits.h" #include "google/cloud/discoveryengine/v1/user_event_connection_idempotency_policy.h" +#include "google/cloud/discoveryengine/v1/user_event_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/discoveryengine/v1/user_event_connection_idempotency_policy.h b/google/cloud/discoveryengine/v1/user_event_connection_idempotency_policy.h index 990b3b5b9f151..458dff949ec1d 100644 --- a/google/cloud/discoveryengine/v1/user_event_connection_idempotency_policy.h +++ b/google/cloud/discoveryengine/v1/user_event_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_USER_EVENT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DISCOVERYENGINE_V1_USER_EVENT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/discoveryengine/v1/user_event_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dlp/BUILD.bazel b/google/cloud/dlp/BUILD.bazel index b1826b24b1f30..8d5b3cbbca474 100644 --- a/google/cloud/dlp/BUILD.bazel +++ b/google/cloud/dlp/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/privacy/dlp/v2:dlp_cc_grpc", + "@googleapis//google/privacy/dlp/v2:dlp_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/dlp/CMakeLists.txt b/google/cloud/dlp/CMakeLists.txt index 14c3dcf46b4b0..86ee7955928ce 100644 --- a/google/cloud/dlp/CMakeLists.txt +++ b/google/cloud/dlp/CMakeLists.txt @@ -27,7 +27,7 @@ endif () include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(dlp "Cloud Data Loss Prevention (DLP) API" - SERVICE_DIRS "__EMPTY__" "v2/") + SERVICE_DIRS "v2/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(dlp_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/dlp/dlp_client.h b/google/cloud/dlp/dlp_client.h deleted file mode 100644 index db3ad018391e1..0000000000000 --- a/google/cloud/dlp/dlp_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/privacy/dlp/v2/dlp.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_DLP_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_DLP_CLIENT_H - -#include "google/cloud/dlp/dlp_connection.h" -#include "google/cloud/dlp/v2/dlp_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dlp_v2 instead of the aliases defined in -/// this namespace. -namespace dlp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dlp_v2::DlpServiceClient directly. -using ::google::cloud::dlp_v2::DlpServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dlp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_DLP_CLIENT_H diff --git a/google/cloud/dlp/dlp_connection.h b/google/cloud/dlp/dlp_connection.h deleted file mode 100644 index 770d6ea21e895..0000000000000 --- a/google/cloud/dlp/dlp_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/privacy/dlp/v2/dlp.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_DLP_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_DLP_CONNECTION_H - -#include "google/cloud/dlp/dlp_connection_idempotency_policy.h" -#include "google/cloud/dlp/v2/dlp_connection.h" - -namespace google { -namespace cloud { -namespace dlp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dlp_v2::MakeDlpServiceConnection directly. -using ::google::cloud::dlp_v2::MakeDlpServiceConnection; - -/// @deprecated Use dlp_v2::DlpServiceConnection directly. -using ::google::cloud::dlp_v2::DlpServiceConnection; - -/// @deprecated Use dlp_v2::DlpServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::dlp_v2::DlpServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use dlp_v2::DlpServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::dlp_v2::DlpServiceLimitedTimeRetryPolicy; - -/// @deprecated Use dlp_v2::DlpServiceRetryPolicy directly. -using ::google::cloud::dlp_v2::DlpServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dlp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_DLP_CONNECTION_H diff --git a/google/cloud/dlp/dlp_connection_idempotency_policy.h b/google/cloud/dlp/dlp_connection_idempotency_policy.h deleted file mode 100644 index 27fd24fe34b9e..0000000000000 --- a/google/cloud/dlp/dlp_connection_idempotency_policy.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/privacy/dlp/v2/dlp.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_DLP_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_DLP_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/dlp/v2/dlp_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace dlp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dlp_v2::MakeDefaultDlpServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::dlp_v2::MakeDefaultDlpServiceConnectionIdempotencyPolicy; - -/// @deprecated Use dlp_v2::DlpServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::dlp_v2::DlpServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dlp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_DLP_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/dlp/dlp_options.h b/google/cloud/dlp/dlp_options.h deleted file mode 100644 index 349e32c5ba3b7..0000000000000 --- a/google/cloud/dlp/dlp_options.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/privacy/dlp/v2/dlp.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_DLP_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_DLP_OPTIONS_H - -#include "google/cloud/dlp/dlp_connection.h" -#include "google/cloud/dlp/dlp_connection_idempotency_policy.h" -#include "google/cloud/dlp/v2/dlp_options.h" - -namespace google { -namespace cloud { -namespace dlp { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dlp_v2::DlpServiceBackoffPolicyOption directly. -using ::google::cloud::dlp_v2::DlpServiceBackoffPolicyOption; - -/// @deprecated Use dlp_v2::DlpServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::dlp_v2::DlpServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use dlp_v2::DlpServicePolicyOptionList directly. -using ::google::cloud::dlp_v2::DlpServicePolicyOptionList; - -/// @deprecated Use dlp_v2::DlpServiceRetryPolicyOption directly. -using ::google::cloud::dlp_v2::DlpServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dlp -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_DLP_OPTIONS_H diff --git a/google/cloud/dlp/mocks/mock_dlp_connection.h b/google/cloud/dlp/mocks/mock_dlp_connection.h deleted file mode 100644 index fee457d1c4851..0000000000000 --- a/google/cloud/dlp/mocks/mock_dlp_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/privacy/dlp/v2/dlp.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_MOCKS_MOCK_DLP_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_MOCKS_MOCK_DLP_CONNECTION_H - -#include "google/cloud/dlp/dlp_connection.h" -#include "google/cloud/dlp/v2/mocks/mock_dlp_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in dlp_v2_mocks instead of the aliases -/// defined in this namespace. -namespace dlp_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use dlp_v2_mocks::MockDlpServiceConnection directly. -using ::google::cloud::dlp_v2_mocks::MockDlpServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace dlp_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_MOCKS_MOCK_DLP_CONNECTION_H diff --git a/google/cloud/dlp/quickstart/.bazelrc b/google/cloud/dlp/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/dlp/quickstart/.bazelrc +++ b/google/cloud/dlp/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/dlp/quickstart/CMakeLists.txt index aa2359c767898..d9401af1f860c 100644 --- a/google/cloud/dlp/quickstart/CMakeLists.txt +++ b/google/cloud/dlp/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Data Loss Prevention (DLP) API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-dlp-quickstart CXX) find_package(google_cloud_cpp_dlp REQUIRED) diff --git a/google/cloud/dlp/quickstart/WORKSPACE.bazel b/google/cloud/dlp/quickstart/WORKSPACE.bazel index 69d9004db7384..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 = "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/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/dlp/v2/dlp_connection.h b/google/cloud/dlp/v2/dlp_connection.h index 09a2b450bc241..9b5e8cd58c853 100644 --- a/google/cloud/dlp/v2/dlp_connection.h +++ b/google/cloud/dlp/v2/dlp_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/privacy/dlp/v2/dlp.pb.h" #include namespace google { diff --git a/google/cloud/dlp/v2/dlp_connection_idempotency_policy.h b/google/cloud/dlp/v2/dlp_connection_idempotency_policy.h index a5604c4f0867e..2d4d544e19839 100644 --- a/google/cloud/dlp/v2/dlp_connection_idempotency_policy.h +++ b/google/cloud/dlp/v2/dlp_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/privacy/dlp/v2/dlp.grpc.pb.h" #include namespace google { diff --git a/google/cloud/dlp/v2/internal/dlp_auth_decorator.cc b/google/cloud/dlp/v2/internal/dlp_auth_decorator.cc index ea054408d0d19..23888183c19dd 100644 --- a/google/cloud/dlp/v2/internal/dlp_auth_decorator.cc +++ b/google/cloud/dlp/v2/internal/dlp_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/privacy/dlp/v2/dlp.proto #include "google/cloud/dlp/v2/internal/dlp_auth_decorator.h" -#include +#include "google/privacy/dlp/v2/dlp.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dlp_v2_internal { @@ -511,3 +514,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dlp_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dlp/v2/internal/dlp_auth_decorator.h b/google/cloud/dlp/v2/internal/dlp_auth_decorator.h index d5c736a5b101a..603a855e24660 100644 --- a/google/cloud/dlp/v2/internal/dlp_auth_decorator.h +++ b/google/cloud/dlp/v2/internal/dlp_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dlp_v2_internal { @@ -322,4 +325,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_V2_INTERNAL_DLP_AUTH_DECORATOR_H diff --git a/google/cloud/dlp/v2/internal/dlp_logging_decorator.cc b/google/cloud/dlp/v2/internal/dlp_logging_decorator.cc index 383768bd9ccdb..6c4b0b0320b6f 100644 --- a/google/cloud/dlp/v2/internal/dlp_logging_decorator.cc +++ b/google/cloud/dlp/v2/internal/dlp_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/dlp/v2/internal/dlp_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/privacy/dlp/v2/dlp.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dlp_v2_internal { @@ -721,3 +724,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dlp_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dlp/v2/internal/dlp_logging_decorator.h b/google/cloud/dlp/v2/internal/dlp_logging_decorator.h index 2b0d569ca7d2d..9d5facc719d67 100644 --- a/google/cloud/dlp/v2/internal/dlp_logging_decorator.h +++ b/google/cloud/dlp/v2/internal/dlp_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dlp_v2_internal { @@ -322,4 +325,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_V2_INTERNAL_DLP_LOGGING_DECORATOR_H diff --git a/google/cloud/dlp/v2/internal/dlp_metadata_decorator.cc b/google/cloud/dlp/v2/internal/dlp_metadata_decorator.cc index 6de5caba1bc03..2a34bbe148e53 100644 --- a/google/cloud/dlp/v2/internal/dlp_metadata_decorator.cc +++ b/google/cloud/dlp/v2/internal/dlp_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/dlp/v2/internal/dlp_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/privacy/dlp/v2/dlp.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dlp_v2_internal { @@ -543,3 +547,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dlp_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dlp/v2/internal/dlp_metadata_decorator.h b/google/cloud/dlp/v2/internal/dlp_metadata_decorator.h index 5b37d8caa9607..0edb0100727de 100644 --- a/google/cloud/dlp/v2/internal/dlp_metadata_decorator.h +++ b/google/cloud/dlp/v2/internal/dlp_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dlp_v2_internal { @@ -327,4 +330,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_V2_INTERNAL_DLP_METADATA_DECORATOR_H diff --git a/google/cloud/dlp/v2/internal/dlp_option_defaults.cc b/google/cloud/dlp/v2/internal/dlp_option_defaults.cc index 6af319baa96bf..aa8bb69698be7 100644 --- a/google/cloud/dlp/v2/internal/dlp_option_defaults.cc +++ b/google/cloud/dlp/v2/internal/dlp_option_defaults.cc @@ -40,7 +40,7 @@ Options DlpServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - dlp_v2::DlpServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + dlp_v2::DlpServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/dlp/v2/internal/dlp_stub.cc b/google/cloud/dlp/v2/internal/dlp_stub.cc index 4a305fa973459..69a4df32b2a88 100644 --- a/google/cloud/dlp/v2/internal/dlp_stub.cc +++ b/google/cloud/dlp/v2/internal/dlp_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/dlp/v2/internal/dlp_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/privacy/dlp/v2/dlp.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dlp_v2_internal { @@ -693,3 +696,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dlp_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dlp/v2/internal/dlp_stub.h b/google/cloud/dlp/v2/internal/dlp_stub.h index 360fbe7f6a7eb..47d81069e21bd 100644 --- a/google/cloud/dlp/v2/internal/dlp_stub.h +++ b/google/cloud/dlp/v2/internal/dlp_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/privacy/dlp/v2/dlp.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dlp_v2_internal { @@ -599,4 +602,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_V2_INTERNAL_DLP_STUB_H diff --git a/google/cloud/dlp/v2/internal/dlp_stub_factory.cc b/google/cloud/dlp/v2/internal/dlp_stub_factory.cc index a393929f1aabb..725fe6d312e1f 100644 --- a/google/cloud/dlp/v2/internal/dlp_stub_factory.cc +++ b/google/cloud/dlp/v2/internal/dlp_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/privacy/dlp/v2/dlp.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dlp_v2_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dlp_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dlp/v2/internal/dlp_stub_factory.h b/google/cloud/dlp/v2/internal/dlp_stub_factory.h index aae11853d3a73..4ea4a05286d6f 100644 --- a/google/cloud/dlp/v2/internal/dlp_stub_factory.h +++ b/google/cloud/dlp/v2/internal/dlp_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dlp_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_V2_INTERNAL_DLP_STUB_FACTORY_H diff --git a/google/cloud/dlp/v2/internal/dlp_tracing_connection.cc b/google/cloud/dlp/v2/internal/dlp_tracing_connection.cc index 748eaf3957d37..3f1ce169cff35 100644 --- a/google/cloud/dlp/v2/internal/dlp_tracing_connection.cc +++ b/google/cloud/dlp/v2/internal/dlp_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace dlp_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DlpServiceTracingConnection::DlpServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -539,15 +537,11 @@ DlpServiceTracingConnection::UpdateConnection( return internal::EndSpan(*span, child_->UpdateConnection(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDlpServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/dlp/v2/internal/dlp_tracing_connection.h b/google/cloud/dlp/v2/internal/dlp_tracing_connection.h index 70f88970265c6..a6885502808c8 100644 --- a/google/cloud/dlp/v2/internal/dlp_tracing_connection.h +++ b/google/cloud/dlp/v2/internal/dlp_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace dlp_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DlpServiceTracingConnection : public dlp_v2::DlpServiceConnection { public: ~DlpServiceTracingConnection() override = default; @@ -252,8 +250,6 @@ class DlpServiceTracingConnection : public dlp_v2::DlpServiceConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/dlp/v2/internal/dlp_tracing_stub.cc b/google/cloud/dlp/v2/internal/dlp_tracing_stub.cc index 82dad418e03a9..5d7c586ca23ec 100644 --- a/google/cloud/dlp/v2/internal/dlp_tracing_stub.cc +++ b/google/cloud/dlp/v2/internal/dlp_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dlp_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DlpServiceTracingStub::DlpServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -691,18 +692,14 @@ DlpServiceTracingStub::UpdateConnection( child_->UpdateConnection(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDlpServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dlp_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dlp/v2/internal/dlp_tracing_stub.h b/google/cloud/dlp/v2/internal/dlp_tracing_stub.h index 063f21dc7b086..f35a3d2a183e2 100644 --- a/google/cloud/dlp/v2/internal/dlp_tracing_stub.h +++ b/google/cloud/dlp/v2/internal/dlp_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace dlp_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DlpServiceTracingStub : public DlpServiceStub { public: ~DlpServiceTracingStub() override = default; @@ -318,8 +319,6 @@ class DlpServiceTracingStub : public DlpServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -334,4 +333,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DLP_V2_INTERNAL_DLP_TRACING_STUB_H diff --git a/google/cloud/documentai/BUILD.bazel b/google/cloud/documentai/BUILD.bazel index cbc64b17a5a32..4201e94aae79f 100644 --- a/google/cloud/documentai/BUILD.bazel +++ b/google/cloud/documentai/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/documentai/v1:documentai_cc_grpc", + "@googleapis//google/cloud/documentai/v1:documentai_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/documentai/CMakeLists.txt b/google/cloud/documentai/CMakeLists.txt index 445b94c30a9a6..2c2cd950edea3 100644 --- a/google/cloud/documentai/CMakeLists.txt +++ b/google/cloud/documentai/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(documentai "Cloud Document AI API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(documentai_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/documentai/document_processor_client.h b/google/cloud/documentai/document_processor_client.h deleted file mode 100644 index 4f4bc078cb5c1..0000000000000 --- a/google/cloud/documentai/document_processor_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/documentai/v1/document_processor_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_DOCUMENT_PROCESSOR_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_DOCUMENT_PROCESSOR_CLIENT_H - -#include "google/cloud/documentai/document_processor_connection.h" -#include "google/cloud/documentai/v1/document_processor_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in documentai_v1 instead of the aliases defined in -/// this namespace. -namespace documentai { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use documentai_v1::DocumentProcessorServiceClient directly. -using ::google::cloud::documentai_v1::DocumentProcessorServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace documentai -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_DOCUMENT_PROCESSOR_CLIENT_H diff --git a/google/cloud/documentai/document_processor_connection.h b/google/cloud/documentai/document_processor_connection.h deleted file mode 100644 index 11f9069d037d4..0000000000000 --- a/google/cloud/documentai/document_processor_connection.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/documentai/v1/document_processor_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_DOCUMENT_PROCESSOR_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_DOCUMENT_PROCESSOR_CONNECTION_H - -#include "google/cloud/documentai/document_processor_connection_idempotency_policy.h" -#include "google/cloud/documentai/v1/document_processor_connection.h" - -namespace google { -namespace cloud { -namespace documentai { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use documentai_v1::MakeDocumentProcessorServiceConnection -/// directly. -using ::google::cloud::documentai_v1::MakeDocumentProcessorServiceConnection; - -/// @deprecated Use documentai_v1::DocumentProcessorServiceConnection directly. -using ::google::cloud::documentai_v1::DocumentProcessorServiceConnection; - -/// @deprecated Use -/// documentai_v1::DocumentProcessorServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::documentai_v1:: - DocumentProcessorServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// documentai_v1::DocumentProcessorServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::documentai_v1:: - DocumentProcessorServiceLimitedTimeRetryPolicy; - -/// @deprecated Use documentai_v1::DocumentProcessorServiceRetryPolicy directly. -using ::google::cloud::documentai_v1::DocumentProcessorServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace documentai -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_DOCUMENT_PROCESSOR_CONNECTION_H diff --git a/google/cloud/documentai/document_processor_connection_idempotency_policy.h b/google/cloud/documentai/document_processor_connection_idempotency_policy.h deleted file mode 100644 index 80f0a5b3940ab..0000000000000 --- a/google/cloud/documentai/document_processor_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/documentai/v1/document_processor_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_DOCUMENT_PROCESSOR_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_DOCUMENT_PROCESSOR_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/documentai/v1/document_processor_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace documentai { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// documentai_v1::MakeDefaultDocumentProcessorServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::documentai_v1:: - MakeDefaultDocumentProcessorServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// documentai_v1::DocumentProcessorServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::documentai_v1:: - DocumentProcessorServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace documentai -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_DOCUMENT_PROCESSOR_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/documentai/document_processor_options.h b/google/cloud/documentai/document_processor_options.h deleted file mode 100644 index 8b9ac2825a251..0000000000000 --- a/google/cloud/documentai/document_processor_options.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/documentai/v1/document_processor_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_DOCUMENT_PROCESSOR_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_DOCUMENT_PROCESSOR_OPTIONS_H - -#include "google/cloud/documentai/document_processor_connection.h" -#include "google/cloud/documentai/document_processor_connection_idempotency_policy.h" -#include "google/cloud/documentai/v1/document_processor_options.h" - -namespace google { -namespace cloud { -namespace documentai { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use documentai_v1::DocumentProcessorServicePollingPolicyOption -/// directly. -using ::google::cloud::documentai_v1:: - DocumentProcessorServicePollingPolicyOption; - -/// @deprecated Use documentai_v1::DocumentProcessorServiceBackoffPolicyOption -/// directly. -using ::google::cloud::documentai_v1:: - DocumentProcessorServiceBackoffPolicyOption; - -/// @deprecated Use -/// documentai_v1::DocumentProcessorServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::documentai_v1:: - DocumentProcessorServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use documentai_v1::DocumentProcessorServicePolicyOptionList -/// directly. -using ::google::cloud::documentai_v1::DocumentProcessorServicePolicyOptionList; - -/// @deprecated Use documentai_v1::DocumentProcessorServiceRetryPolicyOption -/// directly. -using ::google::cloud::documentai_v1::DocumentProcessorServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace documentai -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_DOCUMENT_PROCESSOR_OPTIONS_H diff --git a/google/cloud/documentai/mocks/mock_document_processor_connection.h b/google/cloud/documentai/mocks/mock_document_processor_connection.h deleted file mode 100644 index 012da8fd15fae..0000000000000 --- a/google/cloud/documentai/mocks/mock_document_processor_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/documentai/v1/document_processor_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_MOCKS_MOCK_DOCUMENT_PROCESSOR_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_MOCKS_MOCK_DOCUMENT_PROCESSOR_CONNECTION_H - -#include "google/cloud/documentai/document_processor_connection.h" -#include "google/cloud/documentai/v1/mocks/mock_document_processor_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in documentai_v1_mocks instead of the aliases -/// defined in this namespace. -namespace documentai_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use documentai_v1_mocks::MockDocumentProcessorServiceConnection -/// directly. -using ::google::cloud::documentai_v1_mocks:: - MockDocumentProcessorServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace documentai_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_MOCKS_MOCK_DOCUMENT_PROCESSOR_CONNECTION_H diff --git a/google/cloud/documentai/quickstart/.bazelrc b/google/cloud/documentai/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/documentai/quickstart/.bazelrc +++ b/google/cloud/documentai/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/documentai/quickstart/CMakeLists.txt index 88715f752227a..aefda9b4a1769 100644 --- a/google/cloud/documentai/quickstart/CMakeLists.txt +++ b/google/cloud/documentai/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Document AI API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-documentai-quickstart CXX) find_package(google_cloud_cpp_documentai REQUIRED) diff --git a/google/cloud/documentai/quickstart/WORKSPACE.bazel b/google/cloud/documentai/quickstart/WORKSPACE.bazel index 3fa46d33b7761..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 = "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/documentai/v1/document_processor_client.h b/google/cloud/documentai/v1/document_processor_client.h index 9ef93233f72a2..d2dfea4b90a5f 100644 --- a/google/cloud/documentai/v1/document_processor_client.h +++ b/google/cloud/documentai/v1/document_processor_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/documentai/v1/document_processor_connection.h b/google/cloud/documentai/v1/document_processor_connection.h index 18cddb7c9cdf4..b50ebfd3d8f83 100644 --- a/google/cloud/documentai/v1/document_processor_connection.h +++ b/google/cloud/documentai/v1/document_processor_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_V1_DOCUMENT_PROCESSOR_CONNECTION_H #include "google/cloud/documentai/v1/document_processor_connection_idempotency_policy.h" +#include "google/cloud/documentai/v1/document_processor_service.pb.h" #include "google/cloud/documentai/v1/internal/document_processor_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/documentai/v1/document_processor_connection_idempotency_policy.h b/google/cloud/documentai/v1/document_processor_connection_idempotency_policy.h index f310f188407d4..a236f8cacbbb1 100644 --- a/google/cloud/documentai/v1/document_processor_connection_idempotency_policy.h +++ b/google/cloud/documentai/v1/document_processor_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_V1_DOCUMENT_PROCESSOR_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_V1_DOCUMENT_PROCESSOR_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/documentai/v1/document_processor_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/documentai/v1/internal/document_processor_auth_decorator.cc b/google/cloud/documentai/v1/internal/document_processor_auth_decorator.cc index 327811b08d911..f315a1a2e8809 100644 --- a/google/cloud/documentai/v1/internal/document_processor_auth_decorator.cc +++ b/google/cloud/documentai/v1/internal/document_processor_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/documentai/v1/document_processor_service.proto #include "google/cloud/documentai/v1/internal/document_processor_auth_decorator.h" -#include +#include "google/cloud/documentai/v1/document_processor_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace documentai_v1_internal { @@ -546,3 +549,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace documentai_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/documentai/v1/internal/document_processor_auth_decorator.h b/google/cloud/documentai/v1/internal/document_processor_auth_decorator.h index 53a5552813526..a9871e445b141 100644 --- a/google/cloud/documentai/v1/internal/document_processor_auth_decorator.h +++ b/google/cloud/documentai/v1/internal/document_processor_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/documentai/v1/internal/document_processor_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 documentai_v1_internal { @@ -273,4 +276,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_V1_INTERNAL_DOCUMENT_PROCESSOR_AUTH_DECORATOR_H diff --git a/google/cloud/documentai/v1/internal/document_processor_connection_impl.h b/google/cloud/documentai/v1/internal/document_processor_connection_impl.h index 419bfcb8ad486..79ea030025654 100644 --- a/google/cloud/documentai/v1/internal/document_processor_connection_impl.h +++ b/google/cloud/documentai/v1/internal/document_processor_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/documentai/v1/internal/document_processor_logging_decorator.cc b/google/cloud/documentai/v1/internal/document_processor_logging_decorator.cc index 497019b4cbdb3..b2b2e5c0cb38d 100644 --- a/google/cloud/documentai/v1/internal/document_processor_logging_decorator.cc +++ b/google/cloud/documentai/v1/internal/document_processor_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/documentai/v1/document_processor_service.proto #include "google/cloud/documentai/v1/internal/document_processor_logging_decorator.h" +#include "google/cloud/documentai/v1/document_processor_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace documentai_v1_internal { @@ -644,3 +647,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace documentai_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/documentai/v1/internal/document_processor_logging_decorator.h b/google/cloud/documentai/v1/internal/document_processor_logging_decorator.h index c8f99ebbb5bf6..34eb262c59854 100644 --- a/google/cloud/documentai/v1/internal/document_processor_logging_decorator.h +++ b/google/cloud/documentai/v1/internal/document_processor_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/documentai/v1/internal/document_processor_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 documentai_v1_internal { @@ -273,4 +276,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_V1_INTERNAL_DOCUMENT_PROCESSOR_LOGGING_DECORATOR_H diff --git a/google/cloud/documentai/v1/internal/document_processor_metadata_decorator.cc b/google/cloud/documentai/v1/internal/document_processor_metadata_decorator.cc index 656a05dc841f3..c9d98f668b562 100644 --- a/google/cloud/documentai/v1/internal/document_processor_metadata_decorator.cc +++ b/google/cloud/documentai/v1/internal/document_processor_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/documentai/v1/document_processor_service.proto #include "google/cloud/documentai/v1/internal/document_processor_metadata_decorator.h" +#include "google/cloud/documentai/v1/document_processor_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 documentai_v1_internal { @@ -477,3 +481,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace documentai_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/documentai/v1/internal/document_processor_metadata_decorator.h b/google/cloud/documentai/v1/internal/document_processor_metadata_decorator.h index 3c593e945a903..2fb6941486762 100644 --- a/google/cloud/documentai/v1/internal/document_processor_metadata_decorator.h +++ b/google/cloud/documentai/v1/internal/document_processor_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/documentai/v1/internal/document_processor_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 documentai_v1_internal { @@ -279,4 +282,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_V1_INTERNAL_DOCUMENT_PROCESSOR_METADATA_DECORATOR_H diff --git a/google/cloud/documentai/v1/internal/document_processor_option_defaults.cc b/google/cloud/documentai/v1/internal/document_processor_option_defaults.cc index 435da86ad9510..d0d362287023d 100644 --- a/google/cloud/documentai/v1/internal/document_processor_option_defaults.cc +++ b/google/cloud/documentai/v1/internal/document_processor_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/documentai/v1/internal/document_processor_option_defaults.h" #include "google/cloud/documentai/v1/document_processor_connection.h" #include "google/cloud/documentai/v1/document_processor_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -47,7 +47,7 @@ Options DocumentProcessorServiceDefaultOptions(std::string const& location, .has()) { options.set( documentai_v1::DocumentProcessorServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/documentai/v1/internal/document_processor_stub.cc b/google/cloud/documentai/v1/internal/document_processor_stub.cc index 59d0ded16abc4..a88d8c1010399 100644 --- a/google/cloud/documentai/v1/internal/document_processor_stub.cc +++ b/google/cloud/documentai/v1/internal/document_processor_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/documentai/v1/document_processor_service.proto #include "google/cloud/documentai/v1/internal/document_processor_stub.h" +#include "google/cloud/documentai/v1/document_processor_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace documentai_v1_internal { @@ -626,3 +629,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace documentai_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/documentai/v1/internal/document_processor_stub.h b/google/cloud/documentai/v1/internal/document_processor_stub.h index cbb68f71430e7..c3d6364bfe068 100644 --- a/google/cloud/documentai/v1/internal/document_processor_stub.h +++ b/google/cloud/documentai/v1/internal/document_processor_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_V1_INTERNAL_DOCUMENT_PROCESSOR_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_V1_INTERNAL_DOCUMENT_PROCESSOR_STUB_H +#include "google/cloud/documentai/v1/document_processor_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace documentai_v1_internal { @@ -515,4 +518,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_V1_INTERNAL_DOCUMENT_PROCESSOR_STUB_H diff --git a/google/cloud/documentai/v1/internal/document_processor_stub_factory.cc b/google/cloud/documentai/v1/internal/document_processor_stub_factory.cc index c035d14a16940..6841ef1dfcc42 100644 --- a/google/cloud/documentai/v1/internal/document_processor_stub_factory.cc +++ b/google/cloud/documentai/v1/internal/document_processor_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/documentai/v1/document_processor_service.proto #include "google/cloud/documentai/v1/internal/document_processor_stub_factory.h" +#include "google/cloud/documentai/v1/document_processor_service.grpc.pb.h" #include "google/cloud/documentai/v1/internal/document_processor_auth_decorator.h" #include "google/cloud/documentai/v1/internal/document_processor_logging_decorator.h" #include "google/cloud/documentai/v1/internal/document_processor_metadata_decorator.h" #include "google/cloud/documentai/v1/internal/document_processor_stub.h" #include "google/cloud/documentai/v1/internal/document_processor_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace documentai_v1_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace documentai_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/documentai/v1/internal/document_processor_stub_factory.h b/google/cloud/documentai/v1/internal/document_processor_stub_factory.h index defa828177fa7..a0d8bc69e308a 100644 --- a/google/cloud/documentai/v1/internal/document_processor_stub_factory.h +++ b/google/cloud/documentai/v1/internal/document_processor_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace documentai_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_V1_INTERNAL_DOCUMENT_PROCESSOR_STUB_FACTORY_H diff --git a/google/cloud/documentai/v1/internal/document_processor_tracing_connection.cc b/google/cloud/documentai/v1/internal/document_processor_tracing_connection.cc index 1717db82317ea..83d3c7b03a8ac 100644 --- a/google/cloud/documentai/v1/internal/document_processor_tracing_connection.cc +++ b/google/cloud/documentai/v1/internal/document_processor_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace documentai_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DocumentProcessorServiceTracingConnection:: DocumentProcessorServiceTracingConnection( std::shared_ptr @@ -567,17 +565,13 @@ Status DocumentProcessorServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDocumentProcessorServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/documentai/v1/internal/document_processor_tracing_connection.h b/google/cloud/documentai/v1/internal/document_processor_tracing_connection.h index 272063c2d51e3..ec5c7c92c6ae2 100644 --- a/google/cloud/documentai/v1/internal/document_processor_tracing_connection.h +++ b/google/cloud/documentai/v1/internal/document_processor_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace documentai_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DocumentProcessorServiceTracingConnection : public documentai_v1::DocumentProcessorServiceConnection { public: @@ -258,8 +256,6 @@ class DocumentProcessorServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/documentai/v1/internal/document_processor_tracing_stub.cc b/google/cloud/documentai/v1/internal/document_processor_tracing_stub.cc index b70041e041f91..ea28898ae0ed7 100644 --- a/google/cloud/documentai/v1/internal/document_processor_tracing_stub.cc +++ b/google/cloud/documentai/v1/internal/document_processor_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace documentai_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DocumentProcessorServiceTracingStub::DocumentProcessorServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -587,19 +588,15 @@ future DocumentProcessorServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDocumentProcessorServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace documentai_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/documentai/v1/internal/document_processor_tracing_stub.h b/google/cloud/documentai/v1/internal/document_processor_tracing_stub.h index dde6da384237f..51f3d5c0838a2 100644 --- a/google/cloud/documentai/v1/internal/document_processor_tracing_stub.h +++ b/google/cloud/documentai/v1/internal/document_processor_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace documentai_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DocumentProcessorServiceTracingStub : public DocumentProcessorServiceStub { public: @@ -270,8 +271,6 @@ class DocumentProcessorServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -287,4 +286,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOCUMENTAI_V1_INTERNAL_DOCUMENT_PROCESSOR_TRACING_STUB_H diff --git a/google/cloud/domains/BUILD.bazel b/google/cloud/domains/BUILD.bazel index 652bd9f403d81..42424ef8cbcd2 100644 --- a/google/cloud/domains/BUILD.bazel +++ b/google/cloud/domains/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/domains/v1:domains_cc_grpc", + "@googleapis//google/cloud/domains/v1:domains_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/domains/quickstart/.bazelrc b/google/cloud/domains/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/domains/quickstart/.bazelrc +++ b/google/cloud/domains/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/domains/quickstart/CMakeLists.txt index 453521e81381d..4e0bbb7dcb410 100644 --- a/google/cloud/domains/quickstart/CMakeLists.txt +++ b/google/cloud/domains/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Domains API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-domains-quickstart CXX) find_package(google_cloud_cpp_domains REQUIRED) diff --git a/google/cloud/domains/quickstart/WORKSPACE.bazel b/google/cloud/domains/quickstart/WORKSPACE.bazel index 9b5eebc0c4efb..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 = "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/domains/v1/domains_client.h b/google/cloud/domains/v1/domains_client.h index 170f0d6b83b33..0eaf865ae0566 100644 --- a/google/cloud/domains/v1/domains_client.h +++ b/google/cloud/domains/v1/domains_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/domains/v1/domains_connection.h b/google/cloud/domains/v1/domains_connection.h index 7aa4aefb45a06..b237168c0f105 100644 --- a/google/cloud/domains/v1/domains_connection.h +++ b/google/cloud/domains/v1/domains_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOMAINS_V1_DOMAINS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOMAINS_V1_DOMAINS_CONNECTION_H +#include "google/cloud/domains/v1/domains.pb.h" #include "google/cloud/domains/v1/domains_connection_idempotency_policy.h" #include "google/cloud/domains/v1/internal/domains_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/domains/v1/domains_connection_idempotency_policy.h b/google/cloud/domains/v1/domains_connection_idempotency_policy.h index 1c8581d0bd484..e076694c646cb 100644 --- a/google/cloud/domains/v1/domains_connection_idempotency_policy.h +++ b/google/cloud/domains/v1/domains_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOMAINS_V1_DOMAINS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOMAINS_V1_DOMAINS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/domains/v1/domains.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/domains/v1/internal/domains_auth_decorator.cc b/google/cloud/domains/v1/internal/domains_auth_decorator.cc index d077f08296ddf..dfe52977f91fd 100644 --- a/google/cloud/domains/v1/internal/domains_auth_decorator.cc +++ b/google/cloud/domains/v1/internal/domains_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/domains/v1/domains.proto #include "google/cloud/domains/v1/internal/domains_auth_decorator.h" -#include +#include "google/cloud/domains/v1/domains.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace domains_v1_internal { @@ -364,3 +367,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace domains_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/domains/v1/internal/domains_auth_decorator.h b/google/cloud/domains/v1/internal/domains_auth_decorator.h index d7e0a9ac95225..f1f5196750dea 100644 --- a/google/cloud/domains/v1/internal/domains_auth_decorator.h +++ b/google/cloud/domains/v1/internal/domains_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/domains/v1/internal/domains_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 domains_v1_internal { @@ -197,4 +200,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOMAINS_V1_INTERNAL_DOMAINS_AUTH_DECORATOR_H diff --git a/google/cloud/domains/v1/internal/domains_connection_impl.h b/google/cloud/domains/v1/internal/domains_connection_impl.h index 3f0b728475e50..068d7d0493c57 100644 --- a/google/cloud/domains/v1/internal/domains_connection_impl.h +++ b/google/cloud/domains/v1/internal/domains_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/domains/v1/internal/domains_logging_decorator.cc b/google/cloud/domains/v1/internal/domains_logging_decorator.cc index c3c6e770bd489..71a18520fb0a5 100644 --- a/google/cloud/domains/v1/internal/domains_logging_decorator.cc +++ b/google/cloud/domains/v1/internal/domains_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/domains/v1/domains.proto #include "google/cloud/domains/v1/internal/domains_logging_decorator.h" +#include "google/cloud/domains/v1/domains.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace domains_v1_internal { @@ -421,3 +424,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace domains_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/domains/v1/internal/domains_logging_decorator.h b/google/cloud/domains/v1/internal/domains_logging_decorator.h index 0a9d97b73877a..3117974a1fde7 100644 --- a/google/cloud/domains/v1/internal/domains_logging_decorator.h +++ b/google/cloud/domains/v1/internal/domains_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/domains/v1/internal/domains_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 domains_v1_internal { @@ -197,4 +200,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOMAINS_V1_INTERNAL_DOMAINS_LOGGING_DECORATOR_H diff --git a/google/cloud/domains/v1/internal/domains_metadata_decorator.cc b/google/cloud/domains/v1/internal/domains_metadata_decorator.cc index 7123eb0148ee1..30cec7ed506ae 100644 --- a/google/cloud/domains/v1/internal/domains_metadata_decorator.cc +++ b/google/cloud/domains/v1/internal/domains_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/domains/v1/domains.proto #include "google/cloud/domains/v1/internal/domains_metadata_decorator.h" +#include "google/cloud/domains/v1/domains.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 domains_v1_internal { @@ -329,3 +333,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace domains_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/domains/v1/internal/domains_metadata_decorator.h b/google/cloud/domains/v1/internal/domains_metadata_decorator.h index f7e92e8b03358..b343e311b70c3 100644 --- a/google/cloud/domains/v1/internal/domains_metadata_decorator.h +++ b/google/cloud/domains/v1/internal/domains_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/domains/v1/internal/domains_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 domains_v1_internal { @@ -202,4 +205,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOMAINS_V1_INTERNAL_DOMAINS_METADATA_DECORATOR_H diff --git a/google/cloud/domains/v1/internal/domains_option_defaults.cc b/google/cloud/domains/v1/internal/domains_option_defaults.cc index a16e0e7e81c65..d99f2bc11072c 100644 --- a/google/cloud/domains/v1/internal/domains_option_defaults.cc +++ b/google/cloud/domains/v1/internal/domains_option_defaults.cc @@ -40,7 +40,7 @@ Options DomainsDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - domains_v1::DomainsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + domains_v1::DomainsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/domains/v1/internal/domains_stub.cc b/google/cloud/domains/v1/internal/domains_stub.cc index a8cf6bdf465c4..932d577d34d0a 100644 --- a/google/cloud/domains/v1/internal/domains_stub.cc +++ b/google/cloud/domains/v1/internal/domains_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/domains/v1/domains.proto #include "google/cloud/domains/v1/internal/domains_stub.h" +#include "google/cloud/domains/v1/domains.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace domains_v1_internal { @@ -414,3 +417,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace domains_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/domains/v1/internal/domains_stub.h b/google/cloud/domains/v1/internal/domains_stub.h index 4e1eb80ec975d..cf681c2780c49 100644 --- a/google/cloud/domains/v1/internal/domains_stub.h +++ b/google/cloud/domains/v1/internal/domains_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOMAINS_V1_INTERNAL_DOMAINS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOMAINS_V1_INTERNAL_DOMAINS_STUB_H +#include "google/cloud/domains/v1/domains.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace domains_v1_internal { @@ -353,4 +356,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOMAINS_V1_INTERNAL_DOMAINS_STUB_H diff --git a/google/cloud/domains/v1/internal/domains_stub_factory.cc b/google/cloud/domains/v1/internal/domains_stub_factory.cc index a6ac4a4fc6909..0e8b09a3f98c6 100644 --- a/google/cloud/domains/v1/internal/domains_stub_factory.cc +++ b/google/cloud/domains/v1/internal/domains_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/domains/v1/domains.proto #include "google/cloud/domains/v1/internal/domains_stub_factory.h" +#include "google/cloud/domains/v1/domains.grpc.pb.h" #include "google/cloud/domains/v1/internal/domains_auth_decorator.h" #include "google/cloud/domains/v1/internal/domains_logging_decorator.h" #include "google/cloud/domains/v1/internal/domains_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace domains_v1_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace domains_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/domains/v1/internal/domains_stub_factory.h b/google/cloud/domains/v1/internal/domains_stub_factory.h index b9bb04b6e95eb..4371b14c235ee 100644 --- a/google/cloud/domains/v1/internal/domains_stub_factory.h +++ b/google/cloud/domains/v1/internal/domains_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace domains_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOMAINS_V1_INTERNAL_DOMAINS_STUB_FACTORY_H diff --git a/google/cloud/domains/v1/internal/domains_tracing_connection.cc b/google/cloud/domains/v1/internal/domains_tracing_connection.cc index cfd7403a3271c..157e7af74ab24 100644 --- a/google/cloud/domains/v1/internal/domains_tracing_connection.cc +++ b/google/cloud/domains/v1/internal/domains_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace domains_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DomainsTracingConnection::DomainsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -349,15 +347,11 @@ DomainsTracingConnection::ResetAuthorizationCode( return internal::EndSpan(*span, child_->ResetAuthorizationCode(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDomainsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/domains/v1/internal/domains_tracing_connection.h b/google/cloud/domains/v1/internal/domains_tracing_connection.h index 1266d85827aea..e1d62354f9dc5 100644 --- a/google/cloud/domains/v1/internal/domains_tracing_connection.h +++ b/google/cloud/domains/v1/internal/domains_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace domains_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DomainsTracingConnection : public domains_v1::DomainsConnection { public: ~DomainsTracingConnection() override = default; @@ -176,8 +174,6 @@ class DomainsTracingConnection : public domains_v1::DomainsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/domains/v1/internal/domains_tracing_stub.cc b/google/cloud/domains/v1/internal/domains_tracing_stub.cc index 57b175a48f6a7..8bf01a62391b6 100644 --- a/google/cloud/domains/v1/internal/domains_tracing_stub.cc +++ b/google/cloud/domains/v1/internal/domains_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace domains_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DomainsTracingStub::DomainsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -367,18 +368,14 @@ future DomainsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDomainsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace domains_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/domains/v1/internal/domains_tracing_stub.h b/google/cloud/domains/v1/internal/domains_tracing_stub.h index 4a0eb2cecacb4..fdae47679b256 100644 --- a/google/cloud/domains/v1/internal/domains_tracing_stub.h +++ b/google/cloud/domains/v1/internal/domains_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace domains_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DomainsTracingStub : public DomainsStub { public: ~DomainsTracingStub() override = default; @@ -192,8 +193,6 @@ class DomainsTracingStub : public DomainsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -208,4 +207,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DOMAINS_V1_INTERNAL_DOMAINS_TRACING_STUB_H diff --git a/google/cloud/edgecontainer/BUILD.bazel b/google/cloud/edgecontainer/BUILD.bazel index e6a738d6d2f8b..513ce4136443b 100644 --- a/google/cloud/edgecontainer/BUILD.bazel +++ b/google/cloud/edgecontainer/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/edgecontainer/v1:edgecontainer_cc_grpc", + "@googleapis//google/cloud/edgecontainer/v1:edgecontainer_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/edgecontainer/CMakeLists.txt b/google/cloud/edgecontainer/CMakeLists.txt index 4dfc9ffa12273..1d46458ae47fa 100644 --- a/google/cloud/edgecontainer/CMakeLists.txt +++ b/google/cloud/edgecontainer/CMakeLists.txt @@ -17,8 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( - edgecontainer "Distributed Cloud Edge Container API" - SERVICE_DIRS "__EMPTY__" "v1/") + edgecontainer "Distributed Cloud Edge Container API" SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(edgecontainer_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/edgecontainer/edge_container_client.h b/google/cloud/edgecontainer/edge_container_client.h deleted file mode 100644 index d026eb46bfe13..0000000000000 --- a/google/cloud/edgecontainer/edge_container_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/edgecontainer/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_EDGE_CONTAINER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_EDGE_CONTAINER_CLIENT_H - -#include "google/cloud/edgecontainer/edge_container_connection.h" -#include "google/cloud/edgecontainer/v1/edge_container_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in edgecontainer_v1 instead of the aliases defined in -/// this namespace. -namespace edgecontainer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use edgecontainer_v1::EdgeContainerClient directly. -using ::google::cloud::edgecontainer_v1::EdgeContainerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace edgecontainer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_EDGE_CONTAINER_CLIENT_H diff --git a/google/cloud/edgecontainer/edge_container_connection.h b/google/cloud/edgecontainer/edge_container_connection.h deleted file mode 100644 index 002afd66bfca1..0000000000000 --- a/google/cloud/edgecontainer/edge_container_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/edgecontainer/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_EDGE_CONTAINER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_EDGE_CONTAINER_CONNECTION_H - -#include "google/cloud/edgecontainer/edge_container_connection_idempotency_policy.h" -#include "google/cloud/edgecontainer/v1/edge_container_connection.h" - -namespace google { -namespace cloud { -namespace edgecontainer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use edgecontainer_v1::MakeEdgeContainerConnection directly. -using ::google::cloud::edgecontainer_v1::MakeEdgeContainerConnection; - -/// @deprecated Use edgecontainer_v1::EdgeContainerConnection directly. -using ::google::cloud::edgecontainer_v1::EdgeContainerConnection; - -/// @deprecated Use edgecontainer_v1::EdgeContainerLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::edgecontainer_v1:: - EdgeContainerLimitedErrorCountRetryPolicy; - -/// @deprecated Use edgecontainer_v1::EdgeContainerLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::edgecontainer_v1::EdgeContainerLimitedTimeRetryPolicy; - -/// @deprecated Use edgecontainer_v1::EdgeContainerRetryPolicy directly. -using ::google::cloud::edgecontainer_v1::EdgeContainerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace edgecontainer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_EDGE_CONTAINER_CONNECTION_H diff --git a/google/cloud/edgecontainer/edge_container_connection_idempotency_policy.h b/google/cloud/edgecontainer/edge_container_connection_idempotency_policy.h deleted file mode 100644 index 77fac618d73a2..0000000000000 --- a/google/cloud/edgecontainer/edge_container_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/edgecontainer/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_EDGE_CONTAINER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_EDGE_CONTAINER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/edgecontainer/v1/edge_container_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace edgecontainer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// edgecontainer_v1::MakeDefaultEdgeContainerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::edgecontainer_v1:: - MakeDefaultEdgeContainerConnectionIdempotencyPolicy; - -/// @deprecated Use edgecontainer_v1::EdgeContainerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::edgecontainer_v1:: - EdgeContainerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace edgecontainer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_EDGE_CONTAINER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/edgecontainer/edge_container_options.h b/google/cloud/edgecontainer/edge_container_options.h deleted file mode 100644 index 3c09eae2f5089..0000000000000 --- a/google/cloud/edgecontainer/edge_container_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/edgecontainer/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_EDGE_CONTAINER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_EDGE_CONTAINER_OPTIONS_H - -#include "google/cloud/edgecontainer/edge_container_connection.h" -#include "google/cloud/edgecontainer/edge_container_connection_idempotency_policy.h" -#include "google/cloud/edgecontainer/v1/edge_container_options.h" - -namespace google { -namespace cloud { -namespace edgecontainer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use edgecontainer_v1::EdgeContainerPollingPolicyOption directly. -using ::google::cloud::edgecontainer_v1::EdgeContainerPollingPolicyOption; - -/// @deprecated Use edgecontainer_v1::EdgeContainerBackoffPolicyOption directly. -using ::google::cloud::edgecontainer_v1::EdgeContainerBackoffPolicyOption; - -/// @deprecated Use -/// edgecontainer_v1::EdgeContainerConnectionIdempotencyPolicyOption directly. -using ::google::cloud::edgecontainer_v1:: - EdgeContainerConnectionIdempotencyPolicyOption; - -/// @deprecated Use edgecontainer_v1::EdgeContainerPolicyOptionList directly. -using ::google::cloud::edgecontainer_v1::EdgeContainerPolicyOptionList; - -/// @deprecated Use edgecontainer_v1::EdgeContainerRetryPolicyOption directly. -using ::google::cloud::edgecontainer_v1::EdgeContainerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace edgecontainer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_EDGE_CONTAINER_OPTIONS_H diff --git a/google/cloud/edgecontainer/mocks/mock_edge_container_connection.h b/google/cloud/edgecontainer/mocks/mock_edge_container_connection.h deleted file mode 100644 index 0b909b6410b58..0000000000000 --- a/google/cloud/edgecontainer/mocks/mock_edge_container_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/edgecontainer/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_MOCKS_MOCK_EDGE_CONTAINER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_MOCKS_MOCK_EDGE_CONTAINER_CONNECTION_H - -#include "google/cloud/edgecontainer/edge_container_connection.h" -#include "google/cloud/edgecontainer/v1/mocks/mock_edge_container_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in edgecontainer_v1_mocks instead of the aliases -/// defined in this namespace. -namespace edgecontainer_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use edgecontainer_v1_mocks::MockEdgeContainerConnection -/// directly. -using ::google::cloud::edgecontainer_v1_mocks::MockEdgeContainerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace edgecontainer_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_MOCKS_MOCK_EDGE_CONTAINER_CONNECTION_H diff --git a/google/cloud/edgecontainer/quickstart/.bazelrc b/google/cloud/edgecontainer/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/edgecontainer/quickstart/.bazelrc +++ b/google/cloud/edgecontainer/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/edgecontainer/quickstart/CMakeLists.txt index e58aa6fb4731a..028c300d91a8b 100644 --- a/google/cloud/edgecontainer/quickstart/CMakeLists.txt +++ b/google/cloud/edgecontainer/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Distributed Cloud Edge Container API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-edgecontainer-quickstart CXX) find_package(google_cloud_cpp_edgecontainer REQUIRED) diff --git a/google/cloud/edgecontainer/quickstart/WORKSPACE.bazel b/google/cloud/edgecontainer/quickstart/WORKSPACE.bazel index 149a475715ff4..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 = "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/edgecontainer/v1/edge_container_client.h b/google/cloud/edgecontainer/v1/edge_container_client.h index 289715a35f619..b63fac1d81aa8 100644 --- a/google/cloud/edgecontainer/v1/edge_container_client.h +++ b/google/cloud/edgecontainer/v1/edge_container_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/edgecontainer/v1/edge_container_connection.h b/google/cloud/edgecontainer/v1/edge_container_connection.h index 89d819babd56f..ba743a0301338 100644 --- a/google/cloud/edgecontainer/v1/edge_container_connection.h +++ b/google/cloud/edgecontainer/v1/edge_container_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/edgecontainer/v1/edge_container_connection_idempotency_policy.h" #include "google/cloud/edgecontainer/v1/internal/edge_container_retry_traits.h" +#include "google/cloud/edgecontainer/v1/service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/edgecontainer/v1/edge_container_connection_idempotency_policy.h b/google/cloud/edgecontainer/v1/edge_container_connection_idempotency_policy.h index 30a678ab26f40..36d23eff181fd 100644 --- a/google/cloud/edgecontainer/v1/edge_container_connection_idempotency_policy.h +++ b/google/cloud/edgecontainer/v1/edge_container_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_V1_EDGE_CONTAINER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_V1_EDGE_CONTAINER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/edgecontainer/v1/service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_auth_decorator.cc b/google/cloud/edgecontainer/v1/internal/edge_container_auth_decorator.cc index 0bca6312d2faa..245c40589a966 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_auth_decorator.cc +++ b/google/cloud/edgecontainer/v1/internal/edge_container_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/edgecontainer/v1/service.proto #include "google/cloud/edgecontainer/v1/internal/edge_container_auth_decorator.h" -#include +#include "google/cloud/edgecontainer/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgecontainer_v1_internal { @@ -479,3 +482,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace edgecontainer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_auth_decorator.h b/google/cloud/edgecontainer/v1/internal/edge_container_auth_decorator.h index 227eb71b20a9a..639476e1cca0a 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_auth_decorator.h +++ b/google/cloud/edgecontainer/v1/internal/edge_container_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/edgecontainer/v1/internal/edge_container_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 edgecontainer_v1_internal { @@ -251,4 +254,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_V1_INTERNAL_EDGE_CONTAINER_AUTH_DECORATOR_H diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_connection_impl.h b/google/cloud/edgecontainer/v1/internal/edge_container_connection_impl.h index 90f49aa80a4fc..e1bc102ca78c0 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_connection_impl.h +++ b/google/cloud/edgecontainer/v1/internal/edge_container_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_logging_decorator.cc b/google/cloud/edgecontainer/v1/internal/edge_container_logging_decorator.cc index f94252a304109..52159a7fddf96 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_logging_decorator.cc +++ b/google/cloud/edgecontainer/v1/internal/edge_container_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/edgecontainer/v1/service.proto #include "google/cloud/edgecontainer/v1/internal/edge_container_logging_decorator.h" +#include "google/cloud/edgecontainer/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgecontainer_v1_internal { @@ -573,3 +576,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace edgecontainer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_logging_decorator.h b/google/cloud/edgecontainer/v1/internal/edge_container_logging_decorator.h index 47fef0d683305..36eeb3382257d 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_logging_decorator.h +++ b/google/cloud/edgecontainer/v1/internal/edge_container_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/edgecontainer/v1/internal/edge_container_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 edgecontainer_v1_internal { @@ -251,4 +254,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_V1_INTERNAL_EDGE_CONTAINER_LOGGING_DECORATOR_H diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_metadata_decorator.cc b/google/cloud/edgecontainer/v1/internal/edge_container_metadata_decorator.cc index 5bfa0a28422f3..06505878a0c46 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_metadata_decorator.cc +++ b/google/cloud/edgecontainer/v1/internal/edge_container_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/edgecontainer/v1/service.proto #include "google/cloud/edgecontainer/v1/internal/edge_container_metadata_decorator.h" +#include "google/cloud/edgecontainer/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 edgecontainer_v1_internal { @@ -426,3 +430,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace edgecontainer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_metadata_decorator.h b/google/cloud/edgecontainer/v1/internal/edge_container_metadata_decorator.h index af21b19661149..0a6de54803254 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_metadata_decorator.h +++ b/google/cloud/edgecontainer/v1/internal/edge_container_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/edgecontainer/v1/internal/edge_container_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 edgecontainer_v1_internal { @@ -256,4 +259,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_V1_INTERNAL_EDGE_CONTAINER_METADATA_DECORATOR_H diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_option_defaults.cc b/google/cloud/edgecontainer/v1/internal/edge_container_option_defaults.cc index c911e1f96d67c..d57254de4d5f9 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_option_defaults.cc +++ b/google/cloud/edgecontainer/v1/internal/edge_container_option_defaults.cc @@ -42,7 +42,7 @@ Options EdgeContainerDefaultOptions(Options options) { if (!options.has()) { options.set( edgecontainer_v1::EdgeContainerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_stub.cc b/google/cloud/edgecontainer/v1/internal/edge_container_stub.cc index 8baddf499d022..5ea0d134f73a7 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_stub.cc +++ b/google/cloud/edgecontainer/v1/internal/edge_container_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/edgecontainer/v1/service.proto #include "google/cloud/edgecontainer/v1/internal/edge_container_stub.h" +#include "google/cloud/edgecontainer/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgecontainer_v1_internal { @@ -562,3 +565,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace edgecontainer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_stub.h b/google/cloud/edgecontainer/v1/internal/edge_container_stub.h index 65d2470933710..86bcf1c4544b0 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_stub.h +++ b/google/cloud/edgecontainer/v1/internal/edge_container_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_V1_INTERNAL_EDGE_CONTAINER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_V1_INTERNAL_EDGE_CONTAINER_STUB_H +#include "google/cloud/edgecontainer/v1/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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgecontainer_v1_internal { @@ -477,4 +480,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_V1_INTERNAL_EDGE_CONTAINER_STUB_H diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_stub_factory.cc b/google/cloud/edgecontainer/v1/internal/edge_container_stub_factory.cc index a00a8a42569cf..9da036ec53ade 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_stub_factory.cc +++ b/google/cloud/edgecontainer/v1/internal/edge_container_stub_factory.cc @@ -22,18 +22,21 @@ #include "google/cloud/edgecontainer/v1/internal/edge_container_metadata_decorator.h" #include "google/cloud/edgecontainer/v1/internal/edge_container_stub.h" #include "google/cloud/edgecontainer/v1/internal/edge_container_tracing_stub.h" +#include "google/cloud/edgecontainer/v1/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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgecontainer_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace edgecontainer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_stub_factory.h b/google/cloud/edgecontainer/v1/internal/edge_container_stub_factory.h index 9cfb0f0023eb3..43b03ce5a85fa 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_stub_factory.h +++ b/google/cloud/edgecontainer/v1/internal/edge_container_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgecontainer_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_V1_INTERNAL_EDGE_CONTAINER_STUB_FACTORY_H diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_tracing_connection.cc b/google/cloud/edgecontainer/v1/internal/edge_container_tracing_connection.cc index 0ae731a45bae8..1418f62515d23 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_tracing_connection.cc +++ b/google/cloud/edgecontainer/v1/internal/edge_container_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace edgecontainer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EdgeContainerTracingConnection::EdgeContainerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -468,16 +466,12 @@ Status EdgeContainerTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEdgeContainerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_tracing_connection.h b/google/cloud/edgecontainer/v1/internal/edge_container_tracing_connection.h index 8d930e3fe39a3..94e13b50a26c4 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_tracing_connection.h +++ b/google/cloud/edgecontainer/v1/internal/edge_container_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace edgecontainer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EdgeContainerTracingConnection : public edgecontainer_v1::EdgeContainerConnection { public: @@ -215,8 +213,6 @@ class EdgeContainerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_tracing_stub.cc b/google/cloud/edgecontainer/v1/internal/edge_container_tracing_stub.cc index c6ea7b0d88da8..983135928c69d 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_tracing_stub.cc +++ b/google/cloud/edgecontainer/v1/internal/edge_container_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgecontainer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EdgeContainerTracingStub::EdgeContainerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -510,18 +511,14 @@ future EdgeContainerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEdgeContainerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace edgecontainer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/edgecontainer/v1/internal/edge_container_tracing_stub.h b/google/cloud/edgecontainer/v1/internal/edge_container_tracing_stub.h index aca685e333d6d..9ff2d75d513cc 100644 --- a/google/cloud/edgecontainer/v1/internal/edge_container_tracing_stub.h +++ b/google/cloud/edgecontainer/v1/internal/edge_container_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgecontainer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EdgeContainerTracingStub : public EdgeContainerStub { public: ~EdgeContainerTracingStub() override = default; @@ -246,8 +247,6 @@ class EdgeContainerTracingStub : public EdgeContainerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -262,4 +261,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGECONTAINER_V1_INTERNAL_EDGE_CONTAINER_TRACING_STUB_H diff --git a/google/cloud/edgenetwork/BUILD.bazel b/google/cloud/edgenetwork/BUILD.bazel index b0640f61a0395..b3b66dafba138 100644 --- a/google/cloud/edgenetwork/BUILD.bazel +++ b/google/cloud/edgenetwork/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/edgenetwork/v1:edgenetwork_cc_grpc", + "@googleapis//google/cloud/edgenetwork/v1:edgenetwork_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/edgenetwork/quickstart/.bazelrc b/google/cloud/edgenetwork/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/edgenetwork/quickstart/.bazelrc +++ b/google/cloud/edgenetwork/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/edgenetwork/quickstart/CMakeLists.txt index ba17a53963ff8..69f624fa10c46 100644 --- a/google/cloud/edgenetwork/quickstart/CMakeLists.txt +++ b/google/cloud/edgenetwork/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Distributed Cloud Edge Network API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-edgenetwork-quickstart CXX) find_package(google_cloud_cpp_edgenetwork REQUIRED) diff --git a/google/cloud/edgenetwork/quickstart/WORKSPACE.bazel b/google/cloud/edgenetwork/quickstart/WORKSPACE.bazel index 829bc9ebe87b2..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 = "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/edgenetwork/v1/edge_network_client.h b/google/cloud/edgenetwork/v1/edge_network_client.h index 6dd59ab3d995e..118e24b0764bc 100644 --- a/google/cloud/edgenetwork/v1/edge_network_client.h +++ b/google/cloud/edgenetwork/v1/edge_network_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/edgenetwork/v1/edge_network_connection.h b/google/cloud/edgenetwork/v1/edge_network_connection.h index aad99778e57f1..a54f6ed04151d 100644 --- a/google/cloud/edgenetwork/v1/edge_network_connection.h +++ b/google/cloud/edgenetwork/v1/edge_network_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/edgenetwork/v1/edge_network_connection_idempotency_policy.h" #include "google/cloud/edgenetwork/v1/internal/edge_network_retry_traits.h" +#include "google/cloud/edgenetwork/v1/service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/edgenetwork/v1/edge_network_connection_idempotency_policy.h b/google/cloud/edgenetwork/v1/edge_network_connection_idempotency_policy.h index 6b03944054395..84470cba1af3f 100644 --- a/google/cloud/edgenetwork/v1/edge_network_connection_idempotency_policy.h +++ b/google/cloud/edgenetwork/v1/edge_network_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGENETWORK_V1_EDGE_NETWORK_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGENETWORK_V1_EDGE_NETWORK_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/edgenetwork/v1/service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_auth_decorator.cc b/google/cloud/edgenetwork/v1/internal/edge_network_auth_decorator.cc index cca71df9bf2b5..949028455dce5 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_auth_decorator.cc +++ b/google/cloud/edgenetwork/v1/internal/edge_network_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/edgenetwork/v1/service.proto #include "google/cloud/edgenetwork/v1/internal/edge_network_auth_decorator.h" -#include +#include "google/cloud/edgenetwork/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgenetwork_v1_internal { @@ -550,3 +553,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace edgenetwork_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_auth_decorator.h b/google/cloud/edgenetwork/v1/internal/edge_network_auth_decorator.h index 6edf1f3b57c17..0662ea80e6838 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_auth_decorator.h +++ b/google/cloud/edgenetwork/v1/internal/edge_network_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/edgenetwork/v1/internal/edge_network_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 edgenetwork_v1_internal { @@ -287,4 +290,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGENETWORK_V1_INTERNAL_EDGE_NETWORK_AUTH_DECORATOR_H diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_connection_impl.h b/google/cloud/edgenetwork/v1/internal/edge_network_connection_impl.h index 98aa413619412..1c8fe1b0c404a 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_connection_impl.h +++ b/google/cloud/edgenetwork/v1/internal/edge_network_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_logging_decorator.cc b/google/cloud/edgenetwork/v1/internal/edge_network_logging_decorator.cc index b455d1c5fb61e..2fdb7bd1c9a31 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_logging_decorator.cc +++ b/google/cloud/edgenetwork/v1/internal/edge_network_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/edgenetwork/v1/service.proto #include "google/cloud/edgenetwork/v1/internal/edge_network_logging_decorator.h" +#include "google/cloud/edgenetwork/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgenetwork_v1_internal { @@ -661,3 +664,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace edgenetwork_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_logging_decorator.h b/google/cloud/edgenetwork/v1/internal/edge_network_logging_decorator.h index d6ba5b8f9eb63..77209db2353b6 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_logging_decorator.h +++ b/google/cloud/edgenetwork/v1/internal/edge_network_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/edgenetwork/v1/internal/edge_network_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 edgenetwork_v1_internal { @@ -287,4 +290,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGENETWORK_V1_INTERNAL_EDGE_NETWORK_LOGGING_DECORATOR_H diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_metadata_decorator.cc b/google/cloud/edgenetwork/v1/internal/edge_network_metadata_decorator.cc index cae664591acba..4b7b8660ba20f 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_metadata_decorator.cc +++ b/google/cloud/edgenetwork/v1/internal/edge_network_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/edgenetwork/v1/service.proto #include "google/cloud/edgenetwork/v1/internal/edge_network_metadata_decorator.h" +#include "google/cloud/edgenetwork/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 edgenetwork_v1_internal { @@ -488,3 +492,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace edgenetwork_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_metadata_decorator.h b/google/cloud/edgenetwork/v1/internal/edge_network_metadata_decorator.h index 99b598b7df4ac..541151debd935 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_metadata_decorator.h +++ b/google/cloud/edgenetwork/v1/internal/edge_network_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/edgenetwork/v1/internal/edge_network_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 edgenetwork_v1_internal { @@ -292,4 +295,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGENETWORK_V1_INTERNAL_EDGE_NETWORK_METADATA_DECORATOR_H diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_option_defaults.cc b/google/cloud/edgenetwork/v1/internal/edge_network_option_defaults.cc index cffb888c32079..44be437191c47 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_option_defaults.cc +++ b/google/cloud/edgenetwork/v1/internal/edge_network_option_defaults.cc @@ -41,7 +41,7 @@ Options EdgeNetworkDefaultOptions(Options options) { if (!options.has()) { options.set( edgenetwork_v1::EdgeNetworkLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_stub.cc b/google/cloud/edgenetwork/v1/internal/edge_network_stub.cc index 7e9a87379c071..4c16a0c81c319 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_stub.cc +++ b/google/cloud/edgenetwork/v1/internal/edge_network_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/edgenetwork/v1/service.proto #include "google/cloud/edgenetwork/v1/internal/edge_network_stub.h" +#include "google/cloud/edgenetwork/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgenetwork_v1_internal { @@ -642,3 +645,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace edgenetwork_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_stub.h b/google/cloud/edgenetwork/v1/internal/edge_network_stub.h index 13169918cde90..fc7b227da2ff5 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_stub.h +++ b/google/cloud/edgenetwork/v1/internal/edge_network_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGENETWORK_V1_INTERNAL_EDGE_NETWORK_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGENETWORK_V1_INTERNAL_EDGE_NETWORK_STUB_H +#include "google/cloud/edgenetwork/v1/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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgenetwork_v1_internal { @@ -529,4 +532,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGENETWORK_V1_INTERNAL_EDGE_NETWORK_STUB_H diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_stub_factory.cc b/google/cloud/edgenetwork/v1/internal/edge_network_stub_factory.cc index 8a15568c1b9e8..0fd376c29cd69 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_stub_factory.cc +++ b/google/cloud/edgenetwork/v1/internal/edge_network_stub_factory.cc @@ -22,18 +22,21 @@ #include "google/cloud/edgenetwork/v1/internal/edge_network_metadata_decorator.h" #include "google/cloud/edgenetwork/v1/internal/edge_network_stub.h" #include "google/cloud/edgenetwork/v1/internal/edge_network_tracing_stub.h" +#include "google/cloud/edgenetwork/v1/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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgenetwork_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace edgenetwork_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_stub_factory.h b/google/cloud/edgenetwork/v1/internal/edge_network_stub_factory.h index e244040e14b62..055b905580e5b 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_stub_factory.h +++ b/google/cloud/edgenetwork/v1/internal/edge_network_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgenetwork_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGENETWORK_V1_INTERNAL_EDGE_NETWORK_STUB_FACTORY_H diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_tracing_connection.cc b/google/cloud/edgenetwork/v1/internal/edge_network_tracing_connection.cc index 68bdb47f84190..c0f112a14f7b2 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_tracing_connection.cc +++ b/google/cloud/edgenetwork/v1/internal/edge_network_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace edgenetwork_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EdgeNetworkTracingConnection::EdgeNetworkTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -540,16 +538,12 @@ Status EdgeNetworkTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEdgeNetworkTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_tracing_connection.h b/google/cloud/edgenetwork/v1/internal/edge_network_tracing_connection.h index ba6913930e6b8..f2ce6fa373f7f 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_tracing_connection.h +++ b/google/cloud/edgenetwork/v1/internal/edge_network_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace edgenetwork_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EdgeNetworkTracingConnection : public edgenetwork_v1::EdgeNetworkConnection { public: @@ -246,8 +244,6 @@ class EdgeNetworkTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_tracing_stub.cc b/google/cloud/edgenetwork/v1/internal/edge_network_tracing_stub.cc index 17d120363ac11..97007a29e1a5d 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_tracing_stub.cc +++ b/google/cloud/edgenetwork/v1/internal/edge_network_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgenetwork_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EdgeNetworkTracingStub::EdgeNetworkTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -584,18 +585,14 @@ future EdgeNetworkTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEdgeNetworkTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace edgenetwork_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/edgenetwork/v1/internal/edge_network_tracing_stub.h b/google/cloud/edgenetwork/v1/internal/edge_network_tracing_stub.h index 3cfe7c3c3e3a5..e64f6d5bdf381 100644 --- a/google/cloud/edgenetwork/v1/internal/edge_network_tracing_stub.h +++ b/google/cloud/edgenetwork/v1/internal/edge_network_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace edgenetwork_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EdgeNetworkTracingStub : public EdgeNetworkStub { public: ~EdgeNetworkTracingStub() override = default; @@ -282,8 +283,6 @@ class EdgeNetworkTracingStub : public EdgeNetworkStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -298,4 +297,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EDGENETWORK_V1_INTERNAL_EDGE_NETWORK_TRACING_STUB_H diff --git a/google/cloud/essentialcontacts/BUILD.bazel b/google/cloud/essentialcontacts/BUILD.bazel index 6c9c69eb07c18..12173833dcb15 100644 --- a/google/cloud/essentialcontacts/BUILD.bazel +++ b/google/cloud/essentialcontacts/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/essentialcontacts/v1:essentialcontacts_cc_grpc", + "@googleapis//google/cloud/essentialcontacts/v1:essentialcontacts_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/essentialcontacts/quickstart/.bazelrc b/google/cloud/essentialcontacts/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/essentialcontacts/quickstart/.bazelrc +++ b/google/cloud/essentialcontacts/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/essentialcontacts/quickstart/CMakeLists.txt index 61c5bdb8e2273..7a7c71e913097 100644 --- a/google/cloud/essentialcontacts/quickstart/CMakeLists.txt +++ b/google/cloud/essentialcontacts/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Essential Contacts API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-essentialcontacts-quickstart CXX) find_package(google_cloud_cpp_essentialcontacts REQUIRED) diff --git a/google/cloud/essentialcontacts/quickstart/WORKSPACE.bazel b/google/cloud/essentialcontacts/quickstart/WORKSPACE.bazel index 5b4135adbeae3..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 = "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/essentialcontacts/v1/essential_contacts_connection.h b/google/cloud/essentialcontacts/v1/essential_contacts_connection.h index 3ee8524a52e4a..e46e8f76d352d 100644 --- a/google/cloud/essentialcontacts/v1/essential_contacts_connection.h +++ b/google/cloud/essentialcontacts/v1/essential_contacts_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/essentialcontacts/v1/essential_contacts_connection_idempotency_policy.h" #include "google/cloud/essentialcontacts/v1/internal/essential_contacts_retry_traits.h" +#include "google/cloud/essentialcontacts/v1/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 #include namespace google { diff --git a/google/cloud/essentialcontacts/v1/essential_contacts_connection_idempotency_policy.h b/google/cloud/essentialcontacts/v1/essential_contacts_connection_idempotency_policy.h index 5a60688aebbdb..d8a9f7b184ad4 100644 --- a/google/cloud/essentialcontacts/v1/essential_contacts_connection_idempotency_policy.h +++ b/google/cloud/essentialcontacts/v1/essential_contacts_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ESSENTIALCONTACTS_V1_ESSENTIAL_CONTACTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ESSENTIALCONTACTS_V1_ESSENTIAL_CONTACTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/essentialcontacts/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/essentialcontacts/v1/internal/essential_contacts_auth_decorator.cc b/google/cloud/essentialcontacts/v1/internal/essential_contacts_auth_decorator.cc index b9b69ca3806ff..6422905b4cc3f 100644 --- a/google/cloud/essentialcontacts/v1/internal/essential_contacts_auth_decorator.cc +++ b/google/cloud/essentialcontacts/v1/internal/essential_contacts_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/essentialcontacts/v1/service.proto #include "google/cloud/essentialcontacts/v1/internal/essential_contacts_auth_decorator.h" -#include +#include "google/cloud/essentialcontacts/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace essentialcontacts_v1_internal { @@ -98,3 +101,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace essentialcontacts_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/essentialcontacts/v1/internal/essential_contacts_auth_decorator.h b/google/cloud/essentialcontacts/v1/internal/essential_contacts_auth_decorator.h index e4d150c2c47ee..5a3b0e1a0f75b 100644 --- a/google/cloud/essentialcontacts/v1/internal/essential_contacts_auth_decorator.h +++ b/google/cloud/essentialcontacts/v1/internal/essential_contacts_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace essentialcontacts_v1_internal { @@ -84,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ESSENTIALCONTACTS_V1_INTERNAL_ESSENTIAL_CONTACTS_AUTH_DECORATOR_H diff --git a/google/cloud/essentialcontacts/v1/internal/essential_contacts_logging_decorator.cc b/google/cloud/essentialcontacts/v1/internal/essential_contacts_logging_decorator.cc index 46478b81cf283..beb4d4805a78c 100644 --- a/google/cloud/essentialcontacts/v1/internal/essential_contacts_logging_decorator.cc +++ b/google/cloud/essentialcontacts/v1/internal/essential_contacts_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/essentialcontacts/v1/service.proto #include "google/cloud/essentialcontacts/v1/internal/essential_contacts_logging_decorator.h" +#include "google/cloud/essentialcontacts/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace essentialcontacts_v1_internal { @@ -130,3 +133,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace essentialcontacts_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/essentialcontacts/v1/internal/essential_contacts_logging_decorator.h b/google/cloud/essentialcontacts/v1/internal/essential_contacts_logging_decorator.h index 90e2b288298d0..e9dc1be5f2e1f 100644 --- a/google/cloud/essentialcontacts/v1/internal/essential_contacts_logging_decorator.h +++ b/google/cloud/essentialcontacts/v1/internal/essential_contacts_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace essentialcontacts_v1_internal { @@ -84,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ESSENTIALCONTACTS_V1_INTERNAL_ESSENTIAL_CONTACTS_LOGGING_DECORATOR_H diff --git a/google/cloud/essentialcontacts/v1/internal/essential_contacts_metadata_decorator.cc b/google/cloud/essentialcontacts/v1/internal/essential_contacts_metadata_decorator.cc index efaa8c1ccc24b..cc2a4af3b8534 100644 --- a/google/cloud/essentialcontacts/v1/internal/essential_contacts_metadata_decorator.cc +++ b/google/cloud/essentialcontacts/v1/internal/essential_contacts_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/essentialcontacts/v1/service.proto #include "google/cloud/essentialcontacts/v1/internal/essential_contacts_metadata_decorator.h" +#include "google/cloud/essentialcontacts/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 essentialcontacts_v1_internal { @@ -126,3 +130,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace essentialcontacts_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/essentialcontacts/v1/internal/essential_contacts_metadata_decorator.h b/google/cloud/essentialcontacts/v1/internal/essential_contacts_metadata_decorator.h index 6ad49c66c3d54..436d6bb009b39 100644 --- a/google/cloud/essentialcontacts/v1/internal/essential_contacts_metadata_decorator.h +++ b/google/cloud/essentialcontacts/v1/internal/essential_contacts_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace essentialcontacts_v1_internal { @@ -90,4 +93,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ESSENTIALCONTACTS_V1_INTERNAL_ESSENTIAL_CONTACTS_METADATA_DECORATOR_H diff --git a/google/cloud/essentialcontacts/v1/internal/essential_contacts_option_defaults.cc b/google/cloud/essentialcontacts/v1/internal/essential_contacts_option_defaults.cc index 8e51740fdb364..56d3be087060f 100644 --- a/google/cloud/essentialcontacts/v1/internal/essential_contacts_option_defaults.cc +++ b/google/cloud/essentialcontacts/v1/internal/essential_contacts_option_defaults.cc @@ -45,7 +45,7 @@ Options EssentialContactsServiceDefaultOptions(Options options) { options.set< essentialcontacts_v1::EssentialContactsServiceRetryPolicyOption>( essentialcontacts_v1::EssentialContactsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace essentialcontacts_v1_internal { @@ -118,3 +121,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace essentialcontacts_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/essentialcontacts/v1/internal/essential_contacts_stub.h b/google/cloud/essentialcontacts/v1/internal/essential_contacts_stub.h index 6defc538cab0b..39a72607d89ff 100644 --- a/google/cloud/essentialcontacts/v1/internal/essential_contacts_stub.h +++ b/google/cloud/essentialcontacts/v1/internal/essential_contacts_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ESSENTIALCONTACTS_V1_INTERNAL_ESSENTIAL_CONTACTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ESSENTIALCONTACTS_V1_INTERNAL_ESSENTIAL_CONTACTS_STUB_H +#include "google/cloud/essentialcontacts/v1/service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace essentialcontacts_v1_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ESSENTIALCONTACTS_V1_INTERNAL_ESSENTIAL_CONTACTS_STUB_H diff --git a/google/cloud/essentialcontacts/v1/internal/essential_contacts_stub_factory.cc b/google/cloud/essentialcontacts/v1/internal/essential_contacts_stub_factory.cc index 1317f891f8905..d7064847d8561 100644 --- a/google/cloud/essentialcontacts/v1/internal/essential_contacts_stub_factory.cc +++ b/google/cloud/essentialcontacts/v1/internal/essential_contacts_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/essentialcontacts/v1/internal/essential_contacts_metadata_decorator.h" #include "google/cloud/essentialcontacts/v1/internal/essential_contacts_stub.h" #include "google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_stub.h" +#include "google/cloud/essentialcontacts/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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace essentialcontacts_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace essentialcontacts_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/essentialcontacts/v1/internal/essential_contacts_stub_factory.h b/google/cloud/essentialcontacts/v1/internal/essential_contacts_stub_factory.h index 702f5fcca90c7..a359b4972b3a0 100644 --- a/google/cloud/essentialcontacts/v1/internal/essential_contacts_stub_factory.h +++ b/google/cloud/essentialcontacts/v1/internal/essential_contacts_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace essentialcontacts_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ESSENTIALCONTACTS_V1_INTERNAL_ESSENTIAL_CONTACTS_STUB_FACTORY_H diff --git a/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_connection.cc b/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_connection.cc index c4520653e0294..e78a919dd1271 100644 --- a/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_connection.cc +++ b/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace essentialcontacts_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EssentialContactsServiceTracingConnection:: EssentialContactsServiceTracingConnection( std::shared_ptr< @@ -109,18 +107,14 @@ Status EssentialContactsServiceTracingConnection::SendTestMessage( return internal::EndSpan(*span, child_->SendTestMessage(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEssentialContactsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_connection.h b/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_connection.h index d9314b153b8c6..ca9f0d1cc5109 100644 --- a/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_connection.h +++ b/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace essentialcontacts_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EssentialContactsServiceTracingConnection : public essentialcontacts_v1::EssentialContactsServiceConnection { public: @@ -74,8 +72,6 @@ class EssentialContactsServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_stub.cc b/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_stub.cc index 193170b30a107..109fb93b7f57b 100644 --- a/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_stub.cc +++ b/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace essentialcontacts_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EssentialContactsServiceTracingStub::EssentialContactsServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -123,19 +124,15 @@ Status EssentialContactsServiceTracingStub::SendTestMessage( child_->SendTestMessage(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEssentialContactsServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace essentialcontacts_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_stub.h b/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_stub.h index 9005bd66de998..15a684ae6217d 100644 --- a/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_stub.h +++ b/google/cloud/essentialcontacts/v1/internal/essential_contacts_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace essentialcontacts_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EssentialContactsServiceTracingStub : public EssentialContactsServiceStub { public: @@ -82,8 +83,6 @@ class EssentialContactsServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -99,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ESSENTIALCONTACTS_V1_INTERNAL_ESSENTIAL_CONTACTS_TRACING_STUB_H diff --git a/google/cloud/eventarc/BUILD.bazel b/google/cloud/eventarc/BUILD.bazel index 9ce87af2e1f78..8f372ffbfbdf9 100644 --- a/google/cloud/eventarc/BUILD.bazel +++ b/google/cloud/eventarc/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "publishing/v1/", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/eventarc/publishing/v1:publishing_cc_grpc", - "@com_google_googleapis//google/cloud/eventarc/v1:eventarc_cc_grpc", + "@googleapis//google/cloud/eventarc/publishing/v1:publishing_cc_grpc", + "@googleapis//google/cloud/eventarc/v1:eventarc_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/eventarc/CMakeLists.txt b/google/cloud/eventarc/CMakeLists.txt index 65b1f628c842f..fc7def70c0de4 100644 --- a/google/cloud/eventarc/CMakeLists.txt +++ b/google/cloud/eventarc/CMakeLists.txt @@ -16,8 +16,8 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library( - eventarc "Eventarc API" SERVICE_DIRS "__EMPTY__" "publishing/v1/" "v1/") +google_cloud_cpp_add_gapic_library(eventarc "Eventarc API" + SERVICE_DIRS "publishing/v1/" "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(eventarc_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/eventarc/eventarc_client.h b/google/cloud/eventarc/eventarc_client.h deleted file mode 100644 index d2c70fd4f8acf..0000000000000 --- a/google/cloud/eventarc/eventarc_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/eventarc/v1/eventarc.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_EVENTARC_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_EVENTARC_CLIENT_H - -#include "google/cloud/eventarc/eventarc_connection.h" -#include "google/cloud/eventarc/v1/eventarc_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in eventarc_v1 instead of the aliases defined in -/// this namespace. -namespace eventarc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use eventarc_v1::EventarcClient directly. -using ::google::cloud::eventarc_v1::EventarcClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace eventarc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_EVENTARC_CLIENT_H diff --git a/google/cloud/eventarc/eventarc_connection.h b/google/cloud/eventarc/eventarc_connection.h deleted file mode 100644 index 49529ce2e4ac6..0000000000000 --- a/google/cloud/eventarc/eventarc_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/eventarc/v1/eventarc.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_EVENTARC_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_EVENTARC_CONNECTION_H - -#include "google/cloud/eventarc/eventarc_connection_idempotency_policy.h" -#include "google/cloud/eventarc/v1/eventarc_connection.h" - -namespace google { -namespace cloud { -namespace eventarc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use eventarc_v1::MakeEventarcConnection directly. -using ::google::cloud::eventarc_v1::MakeEventarcConnection; - -/// @deprecated Use eventarc_v1::EventarcConnection directly. -using ::google::cloud::eventarc_v1::EventarcConnection; - -/// @deprecated Use eventarc_v1::EventarcLimitedErrorCountRetryPolicy directly. -using ::google::cloud::eventarc_v1::EventarcLimitedErrorCountRetryPolicy; - -/// @deprecated Use eventarc_v1::EventarcLimitedTimeRetryPolicy directly. -using ::google::cloud::eventarc_v1::EventarcLimitedTimeRetryPolicy; - -/// @deprecated Use eventarc_v1::EventarcRetryPolicy directly. -using ::google::cloud::eventarc_v1::EventarcRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace eventarc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_EVENTARC_CONNECTION_H diff --git a/google/cloud/eventarc/eventarc_connection_idempotency_policy.h b/google/cloud/eventarc/eventarc_connection_idempotency_policy.h deleted file mode 100644 index 1b4965d213d1c..0000000000000 --- a/google/cloud/eventarc/eventarc_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/eventarc/v1/eventarc.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_EVENTARC_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_EVENTARC_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/eventarc/v1/eventarc_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace eventarc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use eventarc_v1::MakeDefaultEventarcConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::eventarc_v1:: - MakeDefaultEventarcConnectionIdempotencyPolicy; - -/// @deprecated Use eventarc_v1::EventarcConnectionIdempotencyPolicy directly. -using ::google::cloud::eventarc_v1::EventarcConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace eventarc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_EVENTARC_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/eventarc/eventarc_options.h b/google/cloud/eventarc/eventarc_options.h deleted file mode 100644 index 6c0360bcb57b8..0000000000000 --- a/google/cloud/eventarc/eventarc_options.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/eventarc/v1/eventarc.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_EVENTARC_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_EVENTARC_OPTIONS_H - -#include "google/cloud/eventarc/eventarc_connection.h" -#include "google/cloud/eventarc/eventarc_connection_idempotency_policy.h" -#include "google/cloud/eventarc/v1/eventarc_options.h" - -namespace google { -namespace cloud { -namespace eventarc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use eventarc_v1::EventarcPollingPolicyOption directly. -using ::google::cloud::eventarc_v1::EventarcPollingPolicyOption; - -/// @deprecated Use eventarc_v1::EventarcBackoffPolicyOption directly. -using ::google::cloud::eventarc_v1::EventarcBackoffPolicyOption; - -/// @deprecated Use eventarc_v1::EventarcConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::eventarc_v1::EventarcConnectionIdempotencyPolicyOption; - -/// @deprecated Use eventarc_v1::EventarcPolicyOptionList directly. -using ::google::cloud::eventarc_v1::EventarcPolicyOptionList; - -/// @deprecated Use eventarc_v1::EventarcRetryPolicyOption directly. -using ::google::cloud::eventarc_v1::EventarcRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace eventarc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_EVENTARC_OPTIONS_H diff --git a/google/cloud/eventarc/mocks/mock_eventarc_connection.h b/google/cloud/eventarc/mocks/mock_eventarc_connection.h deleted file mode 100644 index ab9ec3d702a12..0000000000000 --- a/google/cloud/eventarc/mocks/mock_eventarc_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/eventarc/v1/eventarc.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_MOCKS_MOCK_EVENTARC_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_MOCKS_MOCK_EVENTARC_CONNECTION_H - -#include "google/cloud/eventarc/eventarc_connection.h" -#include "google/cloud/eventarc/v1/mocks/mock_eventarc_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in eventarc_v1_mocks instead of the aliases -/// defined in this namespace. -namespace eventarc_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use eventarc_v1_mocks::MockEventarcConnection directly. -using ::google::cloud::eventarc_v1_mocks::MockEventarcConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace eventarc_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_MOCKS_MOCK_EVENTARC_CONNECTION_H diff --git a/google/cloud/eventarc/mocks/mock_publisher_connection.h b/google/cloud/eventarc/mocks/mock_publisher_connection.h deleted file mode 100644 index 692235ccd2b99..0000000000000 --- a/google/cloud/eventarc/mocks/mock_publisher_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/eventarc/publishing/v1/publisher.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_MOCKS_MOCK_PUBLISHER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_MOCKS_MOCK_PUBLISHER_CONNECTION_H - -#include "google/cloud/eventarc/publisher_connection.h" -#include "google/cloud/eventarc/publishing/v1/mocks/mock_publisher_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in eventarc_publishing_v1_mocks instead of the aliases -/// defined in this namespace. -namespace eventarc_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use eventarc_publishing_v1_mocks::MockPublisherConnection -/// directly. -using ::google::cloud::eventarc_publishing_v1_mocks::MockPublisherConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace eventarc_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_MOCKS_MOCK_PUBLISHER_CONNECTION_H diff --git a/google/cloud/eventarc/publisher_client.h b/google/cloud/eventarc/publisher_client.h deleted file mode 100644 index 1e209fb951f89..0000000000000 --- a/google/cloud/eventarc/publisher_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/eventarc/publishing/v1/publisher.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHER_CLIENT_H - -#include "google/cloud/eventarc/publisher_connection.h" -#include "google/cloud/eventarc/publishing/v1/publisher_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in eventarc_publishing_v1 instead of the aliases defined -/// in this namespace. -namespace eventarc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use eventarc_publishing_v1::PublisherClient directly. -using ::google::cloud::eventarc_publishing_v1::PublisherClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace eventarc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHER_CLIENT_H diff --git a/google/cloud/eventarc/publisher_connection.h b/google/cloud/eventarc/publisher_connection.h deleted file mode 100644 index 9b5a6a49e882a..0000000000000 --- a/google/cloud/eventarc/publisher_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/eventarc/publishing/v1/publisher.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHER_CONNECTION_H - -#include "google/cloud/eventarc/publisher_connection_idempotency_policy.h" -#include "google/cloud/eventarc/publishing/v1/publisher_connection.h" - -namespace google { -namespace cloud { -namespace eventarc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use eventarc_publishing_v1::MakePublisherConnection directly. -using ::google::cloud::eventarc_publishing_v1::MakePublisherConnection; - -/// @deprecated Use eventarc_publishing_v1::PublisherConnection directly. -using ::google::cloud::eventarc_publishing_v1::PublisherConnection; - -/// @deprecated Use -/// eventarc_publishing_v1::PublisherLimitedErrorCountRetryPolicy directly. -using ::google::cloud::eventarc_publishing_v1:: - PublisherLimitedErrorCountRetryPolicy; - -/// @deprecated Use eventarc_publishing_v1::PublisherLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::eventarc_publishing_v1::PublisherLimitedTimeRetryPolicy; - -/// @deprecated Use eventarc_publishing_v1::PublisherRetryPolicy directly. -using ::google::cloud::eventarc_publishing_v1::PublisherRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace eventarc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHER_CONNECTION_H diff --git a/google/cloud/eventarc/publisher_connection_idempotency_policy.h b/google/cloud/eventarc/publisher_connection_idempotency_policy.h deleted file mode 100644 index d17e0f928b59e..0000000000000 --- a/google/cloud/eventarc/publisher_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/eventarc/publishing/v1/publisher.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/eventarc/publishing/v1/publisher_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace eventarc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// eventarc_publishing_v1::MakeDefaultPublisherConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::eventarc_publishing_v1:: - MakeDefaultPublisherConnectionIdempotencyPolicy; - -/// @deprecated Use eventarc_publishing_v1::PublisherConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::eventarc_publishing_v1:: - PublisherConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace eventarc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/eventarc/publisher_options.h b/google/cloud/eventarc/publisher_options.h deleted file mode 100644 index 9030867f851b9..0000000000000 --- a/google/cloud/eventarc/publisher_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/eventarc/publishing/v1/publisher.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHER_OPTIONS_H - -#include "google/cloud/eventarc/publisher_connection.h" -#include "google/cloud/eventarc/publisher_connection_idempotency_policy.h" -#include "google/cloud/eventarc/publishing/v1/publisher_options.h" - -namespace google { -namespace cloud { -namespace eventarc { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use eventarc_publishing_v1::PublisherBackoffPolicyOption -/// directly. -using ::google::cloud::eventarc_publishing_v1::PublisherBackoffPolicyOption; - -/// @deprecated Use -/// eventarc_publishing_v1::PublisherConnectionIdempotencyPolicyOption directly. -using ::google::cloud::eventarc_publishing_v1:: - PublisherConnectionIdempotencyPolicyOption; - -/// @deprecated Use eventarc_publishing_v1::PublisherPolicyOptionList directly. -using ::google::cloud::eventarc_publishing_v1::PublisherPolicyOptionList; - -/// @deprecated Use eventarc_publishing_v1::PublisherRetryPolicyOption directly. -using ::google::cloud::eventarc_publishing_v1::PublisherRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace eventarc -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHER_OPTIONS_H diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_auth_decorator.cc b/google/cloud/eventarc/publishing/v1/internal/publisher_auth_decorator.cc index 83e6398a21a2f..86b468cb86025 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_auth_decorator.cc +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/eventarc/publishing/v1/publisher.proto #include "google/cloud/eventarc/publishing/v1/internal/publisher_auth_decorator.h" -#include +#include "google/cloud/eventarc/publishing/v1/publisher.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_publishing_v1_internal { @@ -65,3 +68,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace eventarc_publishing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_auth_decorator.h b/google/cloud/eventarc/publishing/v1/internal/publisher_auth_decorator.h index 103eea955b82a..2666428c6dfe1 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_auth_decorator.h +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_publishing_v1_internal { @@ -66,4 +69,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHING_V1_INTERNAL_PUBLISHER_AUTH_DECORATOR_H diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_logging_decorator.cc b/google/cloud/eventarc/publishing/v1/internal/publisher_logging_decorator.cc index 5faa6117e62df..535db88b26c5c 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_logging_decorator.cc +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/eventarc/publishing/v1/publisher.proto #include "google/cloud/eventarc/publishing/v1/internal/publisher_logging_decorator.h" +#include "google/cloud/eventarc/publishing/v1/publisher.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_publishing_v1_internal { @@ -83,3 +86,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace eventarc_publishing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_logging_decorator.h b/google/cloud/eventarc/publishing/v1/internal/publisher_logging_decorator.h index 0b8faeb2aa9e3..18530a6a3341d 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_logging_decorator.h +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_publishing_v1_internal { @@ -66,4 +69,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHING_V1_INTERNAL_PUBLISHER_LOGGING_DECORATOR_H diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_metadata_decorator.cc b/google/cloud/eventarc/publishing/v1/internal/publisher_metadata_decorator.cc index 99a5e03cef57d..266b39f245a37 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_metadata_decorator.cc +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/eventarc/publishing/v1/publisher.proto #include "google/cloud/eventarc/publishing/v1/internal/publisher_metadata_decorator.h" +#include "google/cloud/eventarc/publishing/v1/publisher.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 eventarc_publishing_v1_internal { @@ -93,3 +97,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace eventarc_publishing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_metadata_decorator.h b/google/cloud/eventarc/publishing/v1/internal/publisher_metadata_decorator.h index 024277f58222f..682fdeecb278a 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_metadata_decorator.h +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_publishing_v1_internal { @@ -71,4 +74,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHING_V1_INTERNAL_PUBLISHER_METADATA_DECORATOR_H diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_option_defaults.cc b/google/cloud/eventarc/publishing/v1/internal/publisher_option_defaults.cc index 216104339d6c9..6013cc86445b8 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_option_defaults.cc +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_option_defaults.cc @@ -42,7 +42,7 @@ Options PublisherDefaultOptions(Options options) { if (!options.has()) { options.set( eventarc_publishing_v1::PublisherLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_stub.cc b/google/cloud/eventarc/publishing/v1/internal/publisher_stub.cc index 9dd65e39bcb6f..baaadb8920e7d 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_stub.cc +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/eventarc/publishing/v1/publisher.proto #include "google/cloud/eventarc/publishing/v1/internal/publisher_stub.h" +#include "google/cloud/eventarc/publishing/v1/publisher.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_publishing_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace eventarc_publishing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_stub.h b/google/cloud/eventarc/publishing/v1/internal/publisher_stub.h index 8656329f30d4a..3f33a0a7b5e27 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_stub.h +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHING_V1_INTERNAL_PUBLISHER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHING_V1_INTERNAL_PUBLISHER_STUB_H +#include "google/cloud/eventarc/publishing/v1/publisher.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_publishing_v1_internal { @@ -92,4 +95,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHING_V1_INTERNAL_PUBLISHER_STUB_H diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_stub_factory.cc b/google/cloud/eventarc/publishing/v1/internal/publisher_stub_factory.cc index 52ec12775bcab..66ee07a42d467 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_stub_factory.cc +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/eventarc/publishing/v1/internal/publisher_metadata_decorator.h" #include "google/cloud/eventarc/publishing/v1/internal/publisher_stub.h" #include "google/cloud/eventarc/publishing/v1/internal/publisher_tracing_stub.h" +#include "google/cloud/eventarc/publishing/v1/publisher.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_publishing_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace eventarc_publishing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_stub_factory.h b/google/cloud/eventarc/publishing/v1/internal/publisher_stub_factory.h index eac2419426604..aeb19d53890c5 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_stub_factory.h +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_publishing_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHING_V1_INTERNAL_PUBLISHER_STUB_FACTORY_H diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_connection.cc b/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_connection.cc index f84756caeba7d..a2df5c54e45ef 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_connection.cc +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace eventarc_publishing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PublisherTracingConnection::PublisherTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -64,16 +62,12 @@ PublisherTracingConnection::Publish( return internal::EndSpan(*span, child_->Publish(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePublisherTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_connection.h b/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_connection.h index 373de26ec0924..e8f56076f36da 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_connection.h +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace eventarc_publishing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PublisherTracingConnection : public eventarc_publishing_v1::PublisherConnection { public: @@ -59,8 +57,6 @@ class PublisherTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_stub.cc b/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_stub.cc index 640f69dc965c4..0e4fc9011c305 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_stub.cc +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_publishing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PublisherTracingStub::PublisherTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -72,18 +73,14 @@ PublisherTracingStub::Publish( child_->Publish(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePublisherTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace eventarc_publishing_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_stub.h b/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_stub.h index d9d81e3b4b101..8b20445babeb0 100644 --- a/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_stub.h +++ b/google/cloud/eventarc/publishing/v1/internal/publisher_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_publishing_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PublisherTracingStub : public PublisherStub { public: ~PublisherTracingStub() override = default; @@ -62,8 +63,6 @@ class PublisherTracingStub : public PublisherStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -78,4 +77,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHING_V1_INTERNAL_PUBLISHER_TRACING_STUB_H diff --git a/google/cloud/eventarc/publishing/v1/publisher_connection.h b/google/cloud/eventarc/publishing/v1/publisher_connection.h index fb8e45d8f0049..d244cc64c66d7 100644 --- a/google/cloud/eventarc/publishing/v1/publisher_connection.h +++ b/google/cloud/eventarc/publishing/v1/publisher_connection.h @@ -20,13 +20,13 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHING_V1_PUBLISHER_CONNECTION_H #include "google/cloud/eventarc/publishing/v1/internal/publisher_retry_traits.h" +#include "google/cloud/eventarc/publishing/v1/publisher.pb.h" #include "google/cloud/eventarc/publishing/v1/publisher_connection_idempotency_policy.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/version.h" -#include #include namespace google { diff --git a/google/cloud/eventarc/publishing/v1/publisher_connection_idempotency_policy.h b/google/cloud/eventarc/publishing/v1/publisher_connection_idempotency_policy.h index 434139b972be4..90ac3a790c80c 100644 --- a/google/cloud/eventarc/publishing/v1/publisher_connection_idempotency_policy.h +++ b/google/cloud/eventarc/publishing/v1/publisher_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHING_V1_PUBLISHER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_PUBLISHING_V1_PUBLISHER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/eventarc/publishing/v1/publisher.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/eventarc/quickstart/.bazelrc b/google/cloud/eventarc/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/eventarc/quickstart/.bazelrc +++ b/google/cloud/eventarc/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/eventarc/quickstart/CMakeLists.txt index 9e661d39fb00b..e73032cabf4ef 100644 --- a/google/cloud/eventarc/quickstart/CMakeLists.txt +++ b/google/cloud/eventarc/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Eventarc API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-eventarc-quickstart CXX) find_package(google_cloud_cpp_eventarc REQUIRED) diff --git a/google/cloud/eventarc/quickstart/WORKSPACE.bazel b/google/cloud/eventarc/quickstart/WORKSPACE.bazel index ebf0d5b1a1256..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 = "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/eventarc/v1/eventarc_client.h b/google/cloud/eventarc/v1/eventarc_client.h index 64b3bbf3217af..01cf2d2b4f03d 100644 --- a/google/cloud/eventarc/v1/eventarc_client.h +++ b/google/cloud/eventarc/v1/eventarc_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/eventarc/v1/eventarc_connection.h b/google/cloud/eventarc/v1/eventarc_connection.h index 9dabae034cb3e..edbfa2593217b 100644 --- a/google/cloud/eventarc/v1/eventarc_connection.h +++ b/google/cloud/eventarc/v1/eventarc_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_V1_EVENTARC_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_V1_EVENTARC_CONNECTION_H +#include "google/cloud/eventarc/v1/eventarc.pb.h" #include "google/cloud/eventarc/v1/eventarc_connection_idempotency_policy.h" #include "google/cloud/eventarc/v1/internal/eventarc_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/eventarc/v1/eventarc_connection_idempotency_policy.h b/google/cloud/eventarc/v1/eventarc_connection_idempotency_policy.h index b7cdcc7cdf041..8e14bdec7792e 100644 --- a/google/cloud/eventarc/v1/eventarc_connection_idempotency_policy.h +++ b/google/cloud/eventarc/v1/eventarc_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_V1_EVENTARC_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_V1_EVENTARC_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/eventarc/v1/eventarc.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/eventarc/v1/internal/eventarc_auth_decorator.cc b/google/cloud/eventarc/v1/internal/eventarc_auth_decorator.cc index a93180cfcaab4..feee71d6149da 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_auth_decorator.cc +++ b/google/cloud/eventarc/v1/internal/eventarc_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/eventarc/v1/eventarc.proto #include "google/cloud/eventarc/v1/internal/eventarc_auth_decorator.h" -#include +#include "google/cloud/eventarc/v1/eventarc.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_v1_internal { @@ -877,3 +880,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace eventarc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/eventarc/v1/internal/eventarc_auth_decorator.h b/google/cloud/eventarc/v1/internal/eventarc_auth_decorator.h index 99a3b4ce81e32..49628689d5d88 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_auth_decorator.h +++ b/google/cloud/eventarc/v1/internal/eventarc_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/eventarc/v1/internal/eventarc_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 eventarc_v1_internal { @@ -431,4 +434,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_V1_INTERNAL_EVENTARC_AUTH_DECORATOR_H diff --git a/google/cloud/eventarc/v1/internal/eventarc_connection_impl.h b/google/cloud/eventarc/v1/internal/eventarc_connection_impl.h index faff91f54fa5e..0a4d42cb2b34f 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_connection_impl.h +++ b/google/cloud/eventarc/v1/internal/eventarc_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/eventarc/v1/internal/eventarc_logging_decorator.cc b/google/cloud/eventarc/v1/internal/eventarc_logging_decorator.cc index 01d8be8d0a083..f830e65fec9c5 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_logging_decorator.cc +++ b/google/cloud/eventarc/v1/internal/eventarc_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/eventarc/v1/eventarc.proto #include "google/cloud/eventarc/v1/internal/eventarc_logging_decorator.h" +#include "google/cloud/eventarc/v1/eventarc.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_v1_internal { @@ -1027,3 +1030,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace eventarc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/eventarc/v1/internal/eventarc_logging_decorator.h b/google/cloud/eventarc/v1/internal/eventarc_logging_decorator.h index 76c00c32a365a..8dccce2b1e6f4 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_logging_decorator.h +++ b/google/cloud/eventarc/v1/internal/eventarc_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/eventarc/v1/internal/eventarc_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 eventarc_v1_internal { @@ -431,4 +434,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_V1_INTERNAL_EVENTARC_LOGGING_DECORATOR_H diff --git a/google/cloud/eventarc/v1/internal/eventarc_metadata_decorator.cc b/google/cloud/eventarc/v1/internal/eventarc_metadata_decorator.cc index 904ee344da28f..ea011b28ecf77 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_metadata_decorator.cc +++ b/google/cloud/eventarc/v1/internal/eventarc_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/eventarc/v1/eventarc.proto #include "google/cloud/eventarc/v1/internal/eventarc_metadata_decorator.h" +#include "google/cloud/eventarc/v1/eventarc.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 eventarc_v1_internal { @@ -756,3 +760,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace eventarc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/eventarc/v1/internal/eventarc_metadata_decorator.h b/google/cloud/eventarc/v1/internal/eventarc_metadata_decorator.h index ff0dd43f13aa6..4cf9259277c4e 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_metadata_decorator.h +++ b/google/cloud/eventarc/v1/internal/eventarc_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/eventarc/v1/internal/eventarc_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 eventarc_v1_internal { @@ -436,4 +439,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_V1_INTERNAL_EVENTARC_METADATA_DECORATOR_H diff --git a/google/cloud/eventarc/v1/internal/eventarc_option_defaults.cc b/google/cloud/eventarc/v1/internal/eventarc_option_defaults.cc index cf4bb927f804a..a08cda59c6c4f 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_option_defaults.cc +++ b/google/cloud/eventarc/v1/internal/eventarc_option_defaults.cc @@ -40,7 +40,7 @@ Options EventarcDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - eventarc_v1::EventarcLimitedTimeRetryPolicy(std::chrono::minutes(30)) + eventarc_v1::EventarcLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/eventarc/v1/internal/eventarc_stub.cc b/google/cloud/eventarc/v1/internal/eventarc_stub.cc index 620a8e0d06f47..ffdaa7eb195c4 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_stub.cc +++ b/google/cloud/eventarc/v1/internal/eventarc_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/eventarc/v1/eventarc.proto #include "google/cloud/eventarc/v1/internal/eventarc_stub.h" +#include "google/cloud/eventarc/v1/eventarc.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_v1_internal { @@ -1011,3 +1014,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace eventarc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/eventarc/v1/internal/eventarc_stub.h b/google/cloud/eventarc/v1/internal/eventarc_stub.h index e1749f688a997..554cdfdfa8d1c 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_stub.h +++ b/google/cloud/eventarc/v1/internal/eventarc_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_V1_INTERNAL_EVENTARC_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_V1_INTERNAL_EVENTARC_STUB_H +#include "google/cloud/eventarc/v1/eventarc.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 -#include -#include -#include +#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 eventarc_v1_internal { @@ -821,4 +824,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_V1_INTERNAL_EVENTARC_STUB_H diff --git a/google/cloud/eventarc/v1/internal/eventarc_stub_factory.cc b/google/cloud/eventarc/v1/internal/eventarc_stub_factory.cc index 65a39d991e077..83e2534b91b93 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_stub_factory.cc +++ b/google/cloud/eventarc/v1/internal/eventarc_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/eventarc/v1/eventarc.proto #include "google/cloud/eventarc/v1/internal/eventarc_stub_factory.h" +#include "google/cloud/eventarc/v1/eventarc.grpc.pb.h" #include "google/cloud/eventarc/v1/internal/eventarc_auth_decorator.h" #include "google/cloud/eventarc/v1/internal/eventarc_logging_decorator.h" #include "google/cloud/eventarc/v1/internal/eventarc_metadata_decorator.h" #include "google/cloud/eventarc/v1/internal/eventarc_stub.h" #include "google/cloud/eventarc/v1/internal/eventarc_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 -#include -#include -#include +#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 eventarc_v1_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace eventarc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/eventarc/v1/internal/eventarc_stub_factory.h b/google/cloud/eventarc/v1/internal/eventarc_stub_factory.h index 4cbc6b0c33d58..00063b13c8ff1 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_stub_factory.h +++ b/google/cloud/eventarc/v1/internal/eventarc_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_V1_INTERNAL_EVENTARC_STUB_FACTORY_H diff --git a/google/cloud/eventarc/v1/internal/eventarc_tracing_connection.cc b/google/cloud/eventarc/v1/internal/eventarc_tracing_connection.cc index 3f6d30d082780..7c3e157bb3de5 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_tracing_connection.cc +++ b/google/cloud/eventarc/v1/internal/eventarc_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace eventarc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EventarcTracingConnection::EventarcTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -897,15 +895,11 @@ Status EventarcTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEventarcTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/eventarc/v1/internal/eventarc_tracing_connection.h b/google/cloud/eventarc/v1/internal/eventarc_tracing_connection.h index 64fffcb127045..22776eb2b7b05 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_tracing_connection.h +++ b/google/cloud/eventarc/v1/internal/eventarc_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace eventarc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EventarcTracingConnection : public eventarc_v1::EventarcConnection { public: ~EventarcTracingConnection() override = default; @@ -390,8 +388,6 @@ class EventarcTracingConnection : public eventarc_v1::EventarcConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/eventarc/v1/internal/eventarc_tracing_stub.cc b/google/cloud/eventarc/v1/internal/eventarc_tracing_stub.cc index 59628619797f5..833eef69c97fa 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_tracing_stub.cc +++ b/google/cloud/eventarc/v1/internal/eventarc_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EventarcTracingStub::EventarcTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -918,18 +919,14 @@ future EventarcTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEventarcTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace eventarc_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/eventarc/v1/internal/eventarc_tracing_stub.h b/google/cloud/eventarc/v1/internal/eventarc_tracing_stub.h index 17a97fa70d08b..6e0e932dff0f0 100644 --- a/google/cloud/eventarc/v1/internal/eventarc_tracing_stub.h +++ b/google/cloud/eventarc/v1/internal/eventarc_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace eventarc_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EventarcTracingStub : public EventarcStub { public: ~EventarcTracingStub() override = default; @@ -426,8 +427,6 @@ class EventarcTracingStub : public EventarcStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -442,4 +441,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_EVENTARC_V1_INTERNAL_EVENTARC_TRACING_STUB_H diff --git a/google/cloud/filestore/BUILD.bazel b/google/cloud/filestore/BUILD.bazel index d90f41dfd7641..e40b464141386 100644 --- a/google/cloud/filestore/BUILD.bazel +++ b/google/cloud/filestore/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/filestore/v1:filestore_cc_grpc", + "@googleapis//google/cloud/filestore/v1:filestore_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/filestore/CMakeLists.txt b/google/cloud/filestore/CMakeLists.txt index 57cc0ea26d1ef..de307654a145c 100644 --- a/google/cloud/filestore/CMakeLists.txt +++ b/google/cloud/filestore/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(filestore "Cloud Filestore API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(filestore_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/filestore/cloud_filestore_manager_client.h b/google/cloud/filestore/cloud_filestore_manager_client.h deleted file mode 100644 index 9ea078b9d49fa..0000000000000 --- a/google/cloud/filestore/cloud_filestore_manager_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/filestore/v1/cloud_filestore_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_CLOUD_FILESTORE_MANAGER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_CLOUD_FILESTORE_MANAGER_CLIENT_H - -#include "google/cloud/filestore/cloud_filestore_manager_connection.h" -#include "google/cloud/filestore/v1/cloud_filestore_manager_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in filestore_v1 instead of the aliases defined in -/// this namespace. -namespace filestore { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use filestore_v1::CloudFilestoreManagerClient directly. -using ::google::cloud::filestore_v1::CloudFilestoreManagerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace filestore -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_CLOUD_FILESTORE_MANAGER_CLIENT_H diff --git a/google/cloud/filestore/cloud_filestore_manager_connection.h b/google/cloud/filestore/cloud_filestore_manager_connection.h deleted file mode 100644 index 12109e51a218f..0000000000000 --- a/google/cloud/filestore/cloud_filestore_manager_connection.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/filestore/v1/cloud_filestore_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_CLOUD_FILESTORE_MANAGER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_CLOUD_FILESTORE_MANAGER_CONNECTION_H - -#include "google/cloud/filestore/cloud_filestore_manager_connection_idempotency_policy.h" -#include "google/cloud/filestore/v1/cloud_filestore_manager_connection.h" - -namespace google { -namespace cloud { -namespace filestore { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use filestore_v1::MakeCloudFilestoreManagerConnection directly. -using ::google::cloud::filestore_v1::MakeCloudFilestoreManagerConnection; - -/// @deprecated Use filestore_v1::CloudFilestoreManagerConnection directly. -using ::google::cloud::filestore_v1::CloudFilestoreManagerConnection; - -/// @deprecated Use -/// filestore_v1::CloudFilestoreManagerLimitedErrorCountRetryPolicy directly. -using ::google::cloud::filestore_v1:: - CloudFilestoreManagerLimitedErrorCountRetryPolicy; - -/// @deprecated Use filestore_v1::CloudFilestoreManagerLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::filestore_v1:: - CloudFilestoreManagerLimitedTimeRetryPolicy; - -/// @deprecated Use filestore_v1::CloudFilestoreManagerRetryPolicy directly. -using ::google::cloud::filestore_v1::CloudFilestoreManagerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace filestore -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_CLOUD_FILESTORE_MANAGER_CONNECTION_H diff --git a/google/cloud/filestore/cloud_filestore_manager_connection_idempotency_policy.h b/google/cloud/filestore/cloud_filestore_manager_connection_idempotency_policy.h deleted file mode 100644 index 4049f83b6dd94..0000000000000 --- a/google/cloud/filestore/cloud_filestore_manager_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/filestore/v1/cloud_filestore_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_CLOUD_FILESTORE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_CLOUD_FILESTORE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/filestore/v1/cloud_filestore_manager_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace filestore { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// filestore_v1::MakeDefaultCloudFilestoreManagerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::filestore_v1:: - MakeDefaultCloudFilestoreManagerConnectionIdempotencyPolicy; - -/// @deprecated Use -/// filestore_v1::CloudFilestoreManagerConnectionIdempotencyPolicy directly. -using ::google::cloud::filestore_v1:: - CloudFilestoreManagerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace filestore -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_CLOUD_FILESTORE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/filestore/cloud_filestore_manager_options.h b/google/cloud/filestore/cloud_filestore_manager_options.h deleted file mode 100644 index f3be83d935c33..0000000000000 --- a/google/cloud/filestore/cloud_filestore_manager_options.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/filestore/v1/cloud_filestore_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_CLOUD_FILESTORE_MANAGER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_CLOUD_FILESTORE_MANAGER_OPTIONS_H - -#include "google/cloud/filestore/cloud_filestore_manager_connection.h" -#include "google/cloud/filestore/cloud_filestore_manager_connection_idempotency_policy.h" -#include "google/cloud/filestore/v1/cloud_filestore_manager_options.h" - -namespace google { -namespace cloud { -namespace filestore { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use filestore_v1::CloudFilestoreManagerPollingPolicyOption -/// directly. -using ::google::cloud::filestore_v1::CloudFilestoreManagerPollingPolicyOption; - -/// @deprecated Use filestore_v1::CloudFilestoreManagerBackoffPolicyOption -/// directly. -using ::google::cloud::filestore_v1::CloudFilestoreManagerBackoffPolicyOption; - -/// @deprecated Use -/// filestore_v1::CloudFilestoreManagerConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::filestore_v1:: - CloudFilestoreManagerConnectionIdempotencyPolicyOption; - -/// @deprecated Use filestore_v1::CloudFilestoreManagerPolicyOptionList -/// directly. -using ::google::cloud::filestore_v1::CloudFilestoreManagerPolicyOptionList; - -/// @deprecated Use filestore_v1::CloudFilestoreManagerRetryPolicyOption -/// directly. -using ::google::cloud::filestore_v1::CloudFilestoreManagerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace filestore -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_CLOUD_FILESTORE_MANAGER_OPTIONS_H diff --git a/google/cloud/filestore/mocks/mock_cloud_filestore_manager_connection.h b/google/cloud/filestore/mocks/mock_cloud_filestore_manager_connection.h deleted file mode 100644 index 1b6660805a7d8..0000000000000 --- a/google/cloud/filestore/mocks/mock_cloud_filestore_manager_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/filestore/v1/cloud_filestore_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_MOCKS_MOCK_CLOUD_FILESTORE_MANAGER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_MOCKS_MOCK_CLOUD_FILESTORE_MANAGER_CONNECTION_H - -#include "google/cloud/filestore/cloud_filestore_manager_connection.h" -#include "google/cloud/filestore/v1/mocks/mock_cloud_filestore_manager_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in filestore_v1_mocks instead of the aliases -/// defined in this namespace. -namespace filestore_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use filestore_v1_mocks::MockCloudFilestoreManagerConnection -/// directly. -using ::google::cloud::filestore_v1_mocks::MockCloudFilestoreManagerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace filestore_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_MOCKS_MOCK_CLOUD_FILESTORE_MANAGER_CONNECTION_H diff --git a/google/cloud/filestore/quickstart/.bazelrc b/google/cloud/filestore/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/filestore/quickstart/.bazelrc +++ b/google/cloud/filestore/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/filestore/quickstart/CMakeLists.txt index d32f3dcbef89d..730f7fc3c781d 100644 --- a/google/cloud/filestore/quickstart/CMakeLists.txt +++ b/google/cloud/filestore/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Filestore API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-filestore-quickstart CXX) find_package(google_cloud_cpp_filestore REQUIRED) diff --git a/google/cloud/filestore/quickstart/WORKSPACE.bazel b/google/cloud/filestore/quickstart/WORKSPACE.bazel index 8bd1421b95ab3..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 = "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/filestore/v1/cloud_filestore_manager_client.h b/google/cloud/filestore/v1/cloud_filestore_manager_client.h index b04f15a7d5a22..c63ad038490b4 100644 --- a/google/cloud/filestore/v1/cloud_filestore_manager_client.h +++ b/google/cloud/filestore/v1/cloud_filestore_manager_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/filestore/v1/cloud_filestore_manager_connection.h b/google/cloud/filestore/v1/cloud_filestore_manager_connection.h index 3c5b5228abfd5..b4bd8c9e66460 100644 --- a/google/cloud/filestore/v1/cloud_filestore_manager_connection.h +++ b/google/cloud/filestore/v1/cloud_filestore_manager_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_V1_CLOUD_FILESTORE_MANAGER_CONNECTION_H #include "google/cloud/filestore/v1/cloud_filestore_manager_connection_idempotency_policy.h" +#include "google/cloud/filestore/v1/cloud_filestore_service.pb.h" #include "google/cloud/filestore/v1/internal/cloud_filestore_manager_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/filestore/v1/cloud_filestore_manager_connection_idempotency_policy.h b/google/cloud/filestore/v1/cloud_filestore_manager_connection_idempotency_policy.h index e7fef04ec55ca..7f6bec8b7df55 100644 --- a/google/cloud/filestore/v1/cloud_filestore_manager_connection_idempotency_policy.h +++ b/google/cloud/filestore/v1/cloud_filestore_manager_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_V1_CLOUD_FILESTORE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_V1_CLOUD_FILESTORE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/filestore/v1/cloud_filestore_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_auth_decorator.cc b/google/cloud/filestore/v1/internal/cloud_filestore_manager_auth_decorator.cc index b26f6682fe086..3392ec4a39335 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_auth_decorator.cc +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/filestore/v1/cloud_filestore_service.proto #include "google/cloud/filestore/v1/internal/cloud_filestore_manager_auth_decorator.h" -#include +#include "google/cloud/filestore/v1/cloud_filestore_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace filestore_v1_internal { @@ -525,3 +528,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace filestore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_auth_decorator.h b/google/cloud/filestore/v1/internal/cloud_filestore_manager_auth_decorator.h index 58e5fc25a1ada..d077b107c3126 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_auth_decorator.h +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/filestore/v1/internal/cloud_filestore_manager_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 filestore_v1_internal { @@ -255,4 +258,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_V1_INTERNAL_CLOUD_FILESTORE_MANAGER_AUTH_DECORATOR_H diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_connection_impl.h b/google/cloud/filestore/v1/internal/cloud_filestore_manager_connection_impl.h index d266b169bf9f8..0ded94a964573 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_connection_impl.h +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_logging_decorator.cc b/google/cloud/filestore/v1/internal/cloud_filestore_manager_logging_decorator.cc index a2811504a8f20..fdb5337c58ca8 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_logging_decorator.cc +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/filestore/v1/cloud_filestore_service.proto #include "google/cloud/filestore/v1/internal/cloud_filestore_manager_logging_decorator.h" +#include "google/cloud/filestore/v1/cloud_filestore_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace filestore_v1_internal { @@ -596,3 +599,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace filestore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_logging_decorator.h b/google/cloud/filestore/v1/internal/cloud_filestore_manager_logging_decorator.h index 011d3001fa3fe..478ab0ffa0d0d 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_logging_decorator.h +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/filestore/v1/internal/cloud_filestore_manager_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 filestore_v1_internal { @@ -255,4 +258,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_V1_INTERNAL_CLOUD_FILESTORE_MANAGER_LOGGING_DECORATOR_H diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_metadata_decorator.cc b/google/cloud/filestore/v1/internal/cloud_filestore_manager_metadata_decorator.cc index 64b3ed52f76a2..a49cefb8b8de8 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_metadata_decorator.cc +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/filestore/v1/cloud_filestore_service.proto #include "google/cloud/filestore/v1/internal/cloud_filestore_manager_metadata_decorator.h" +#include "google/cloud/filestore/v1/cloud_filestore_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 filestore_v1_internal { @@ -448,3 +452,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace filestore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_metadata_decorator.h b/google/cloud/filestore/v1/internal/cloud_filestore_manager_metadata_decorator.h index fbae8b82ac89c..1ca9abaf2a6fd 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_metadata_decorator.h +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/filestore/v1/internal/cloud_filestore_manager_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 filestore_v1_internal { @@ -261,4 +264,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_V1_INTERNAL_CLOUD_FILESTORE_MANAGER_METADATA_DECORATOR_H diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_option_defaults.cc b/google/cloud/filestore/v1/internal/cloud_filestore_manager_option_defaults.cc index a3e34227b40f9..5372e2af8fe85 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_option_defaults.cc +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_option_defaults.cc @@ -42,7 +42,7 @@ Options CloudFilestoreManagerDefaultOptions(Options options) { if (!options.has()) { options.set( filestore_v1::CloudFilestoreManagerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub.cc b/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub.cc index 3fe80ad5e9b3d..b58b50ad306d1 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub.cc +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/filestore/v1/cloud_filestore_service.proto #include "google/cloud/filestore/v1/internal/cloud_filestore_manager_stub.h" +#include "google/cloud/filestore/v1/cloud_filestore_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace filestore_v1_internal { @@ -577,3 +580,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace filestore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub.h b/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub.h index 506032533d3b8..57bcd22711a25 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub.h +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_V1_INTERNAL_CLOUD_FILESTORE_MANAGER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_V1_INTERNAL_CLOUD_FILESTORE_MANAGER_STUB_H +#include "google/cloud/filestore/v1/cloud_filestore_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace filestore_v1_internal { @@ -459,4 +462,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_V1_INTERNAL_CLOUD_FILESTORE_MANAGER_STUB_H diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub_factory.cc b/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub_factory.cc index aa34d6f270200..78d14de1b3536 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub_factory.cc +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/filestore/v1/cloud_filestore_service.proto #include "google/cloud/filestore/v1/internal/cloud_filestore_manager_stub_factory.h" +#include "google/cloud/filestore/v1/cloud_filestore_service.grpc.pb.h" #include "google/cloud/filestore/v1/internal/cloud_filestore_manager_auth_decorator.h" #include "google/cloud/filestore/v1/internal/cloud_filestore_manager_logging_decorator.h" #include "google/cloud/filestore/v1/internal/cloud_filestore_manager_metadata_decorator.h" #include "google/cloud/filestore/v1/internal/cloud_filestore_manager_stub.h" #include "google/cloud/filestore/v1/internal/cloud_filestore_manager_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace filestore_v1_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace filestore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub_factory.h b/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub_factory.h index ed60e085d0114..8a3bce2539c4f 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub_factory.h +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace filestore_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_V1_INTERNAL_CLOUD_FILESTORE_MANAGER_STUB_FACTORY_H diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_connection.cc b/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_connection.cc index 7bfe7fbaa1083..d67b09651f8e1 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_connection.cc +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace filestore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudFilestoreManagerTracingConnection::CloudFilestoreManagerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -494,17 +492,13 @@ Status CloudFilestoreManagerTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudFilestoreManagerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_connection.h b/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_connection.h index 263132117c35d..e22a0b5a311f7 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_connection.h +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace filestore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudFilestoreManagerTracingConnection : public filestore_v1::CloudFilestoreManagerConnection { public: @@ -224,8 +222,6 @@ class CloudFilestoreManagerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_stub.cc b/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_stub.cc index da7c583aca451..e389f6723b22e 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_stub.cc +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace filestore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudFilestoreManagerTracingStub::CloudFilestoreManagerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -523,18 +524,14 @@ future CloudFilestoreManagerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudFilestoreManagerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace filestore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_stub.h b/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_stub.h index dbecfe6c64135..88f41fa2248cc 100644 --- a/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_stub.h +++ b/google/cloud/filestore/v1/internal/cloud_filestore_manager_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace filestore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudFilestoreManagerTracingStub : public CloudFilestoreManagerStub { public: ~CloudFilestoreManagerTracingStub() override = default; @@ -251,8 +252,6 @@ class CloudFilestoreManagerTracingStub : public CloudFilestoreManagerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -267,4 +266,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FILESTORE_V1_INTERNAL_CLOUD_FILESTORE_MANAGER_TRACING_STUB_H diff --git a/google/cloud/financialservices/BUILD.bazel b/google/cloud/financialservices/BUILD.bazel index 48abe87cc2b9e..b3923fbc2ec5f 100644 --- a/google/cloud/financialservices/BUILD.bazel +++ b/google/cloud/financialservices/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/financialservices/v1:financialservices_cc_grpc", + "@googleapis//google/cloud/financialservices/v1:financialservices_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/financialservices/quickstart/CMakeLists.txt b/google/cloud/financialservices/quickstart/CMakeLists.txt index 496cd651e6717..dfd042956daf0 100644 --- a/google/cloud/financialservices/quickstart/CMakeLists.txt +++ b/google/cloud/financialservices/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Financial Services API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-financialservices-quickstart CXX) find_package(google_cloud_cpp_financialservices REQUIRED) diff --git a/google/cloud/financialservices/quickstart/WORKSPACE.bazel b/google/cloud/financialservices/quickstart/WORKSPACE.bazel index 0ea0bd63c7003..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 = "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/financialservices/v1/aml_client.h b/google/cloud/financialservices/v1/aml_client.h index f5f75eafb5cb5..404b885f71744 100644 --- a/google/cloud/financialservices/v1/aml_client.h +++ b/google/cloud/financialservices/v1/aml_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/financialservices/v1/aml_connection.h b/google/cloud/financialservices/v1/aml_connection.h index 80f2d830419f6..8ceb19974231b 100644 --- a/google/cloud/financialservices/v1/aml_connection.h +++ b/google/cloud/financialservices/v1/aml_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/financialservices/v1/aml_connection_idempotency_policy.h" #include "google/cloud/financialservices/v1/internal/aml_retry_traits.h" +#include "google/cloud/financialservices/v1/service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/financialservices/v1/aml_connection_idempotency_policy.h b/google/cloud/financialservices/v1/aml_connection_idempotency_policy.h index 3eea78edc8fcf..df420eb654d4e 100644 --- a/google/cloud/financialservices/v1/aml_connection_idempotency_policy.h +++ b/google/cloud/financialservices/v1/aml_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_AML_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_AML_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/financialservices/v1/service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/financialservices/v1/internal/aml_auth_decorator.cc b/google/cloud/financialservices/v1/internal/aml_auth_decorator.cc index 384ac2c136f35..4fc0f8830fecc 100644 --- a/google/cloud/financialservices/v1/internal/aml_auth_decorator.cc +++ b/google/cloud/financialservices/v1/internal/aml_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/financialservices/v1/service.proto #include "google/cloud/financialservices/v1/internal/aml_auth_decorator.h" -#include +#include "google/cloud/financialservices/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace financialservices_v1_internal { @@ -949,3 +952,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace financialservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/financialservices/v1/internal/aml_auth_decorator.h b/google/cloud/financialservices/v1/internal/aml_auth_decorator.h index 24309fc6a0bd9..274861d3ed804 100644 --- a/google/cloud/financialservices/v1/internal/aml_auth_decorator.h +++ b/google/cloud/financialservices/v1/internal/aml_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/financialservices/v1/internal/aml_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 financialservices_v1_internal { @@ -454,4 +457,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_AUTH_DECORATOR_H diff --git a/google/cloud/financialservices/v1/internal/aml_connection_impl.h b/google/cloud/financialservices/v1/internal/aml_connection_impl.h index 287594ed47c77..2b0fd0a6e88a6 100644 --- a/google/cloud/financialservices/v1/internal/aml_connection_impl.h +++ b/google/cloud/financialservices/v1/internal/aml_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/financialservices/v1/internal/aml_logging_decorator.cc b/google/cloud/financialservices/v1/internal/aml_logging_decorator.cc index 3e82b5bf591cf..2f6f2fbf24265 100644 --- a/google/cloud/financialservices/v1/internal/aml_logging_decorator.cc +++ b/google/cloud/financialservices/v1/internal/aml_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/financialservices/v1/service.proto #include "google/cloud/financialservices/v1/internal/aml_logging_decorator.h" +#include "google/cloud/financialservices/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace financialservices_v1_internal { @@ -1116,3 +1119,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace financialservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/financialservices/v1/internal/aml_logging_decorator.h b/google/cloud/financialservices/v1/internal/aml_logging_decorator.h index c9fe5e3ac72a1..ce904e02a3d1d 100644 --- a/google/cloud/financialservices/v1/internal/aml_logging_decorator.h +++ b/google/cloud/financialservices/v1/internal/aml_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/financialservices/v1/internal/aml_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 financialservices_v1_internal { @@ -453,4 +456,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_LOGGING_DECORATOR_H diff --git a/google/cloud/financialservices/v1/internal/aml_metadata_decorator.cc b/google/cloud/financialservices/v1/internal/aml_metadata_decorator.cc index 8fe9c2a109d5d..7a4309bbfb6f7 100644 --- a/google/cloud/financialservices/v1/internal/aml_metadata_decorator.cc +++ b/google/cloud/financialservices/v1/internal/aml_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/financialservices/v1/service.proto #include "google/cloud/financialservices/v1/internal/aml_metadata_decorator.h" +#include "google/cloud/financialservices/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 financialservices_v1_internal { @@ -804,3 +808,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace financialservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/financialservices/v1/internal/aml_metadata_decorator.h b/google/cloud/financialservices/v1/internal/aml_metadata_decorator.h index 55f09f85019ff..291daf6efe8e5 100644 --- a/google/cloud/financialservices/v1/internal/aml_metadata_decorator.h +++ b/google/cloud/financialservices/v1/internal/aml_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/financialservices/v1/internal/aml_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 financialservices_v1_internal { @@ -459,4 +462,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_METADATA_DECORATOR_H diff --git a/google/cloud/financialservices/v1/internal/aml_option_defaults.cc b/google/cloud/financialservices/v1/internal/aml_option_defaults.cc index 26f205cf64dc2..249a5a490d07a 100644 --- a/google/cloud/financialservices/v1/internal/aml_option_defaults.cc +++ b/google/cloud/financialservices/v1/internal/aml_option_defaults.cc @@ -41,7 +41,7 @@ Options AMLDefaultOptions(Options options) { if (!options.has()) { options.set( financialservices_v1::AMLLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/financialservices/v1/internal/aml_stub.cc b/google/cloud/financialservices/v1/internal/aml_stub.cc index 6e1cfed90b4e0..8a11a67f08218 100644 --- a/google/cloud/financialservices/v1/internal/aml_stub.cc +++ b/google/cloud/financialservices/v1/internal/aml_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/financialservices/v1/service.proto #include "google/cloud/financialservices/v1/internal/aml_stub.h" +#include "google/cloud/financialservices/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace financialservices_v1_internal { @@ -1092,3 +1095,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace financialservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/financialservices/v1/internal/aml_stub.h b/google/cloud/financialservices/v1/internal/aml_stub.h index 5af27c9421f2c..50fdd18681c99 100644 --- a/google/cloud/financialservices/v1/internal/aml_stub.h +++ b/google/cloud/financialservices/v1/internal/aml_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_STUB_H +#include "google/cloud/financialservices/v1/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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace financialservices_v1_internal { @@ -895,4 +898,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_STUB_H diff --git a/google/cloud/financialservices/v1/internal/aml_stub_factory.cc b/google/cloud/financialservices/v1/internal/aml_stub_factory.cc index 961859ed78580..860a362f01cd3 100644 --- a/google/cloud/financialservices/v1/internal/aml_stub_factory.cc +++ b/google/cloud/financialservices/v1/internal/aml_stub_factory.cc @@ -22,18 +22,21 @@ #include "google/cloud/financialservices/v1/internal/aml_metadata_decorator.h" #include "google/cloud/financialservices/v1/internal/aml_stub.h" #include "google/cloud/financialservices/v1/internal/aml_tracing_stub.h" +#include "google/cloud/financialservices/v1/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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace financialservices_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace financialservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/financialservices/v1/internal/aml_stub_factory.h b/google/cloud/financialservices/v1/internal/aml_stub_factory.h index 7113c032050f7..0c23d3b75cc31 100644 --- a/google/cloud/financialservices/v1/internal/aml_stub_factory.h +++ b/google/cloud/financialservices/v1/internal/aml_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace financialservices_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_STUB_FACTORY_H diff --git a/google/cloud/financialservices/v1/internal/aml_tracing_connection.cc b/google/cloud/financialservices/v1/internal/aml_tracing_connection.cc index 572faf72bce34..3888ef9edcc61 100644 --- a/google/cloud/financialservices/v1/internal/aml_tracing_connection.cc +++ b/google/cloud/financialservices/v1/internal/aml_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace financialservices_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AMLTracingConnection::AMLTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -995,15 +993,11 @@ Status AMLTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAMLTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/financialservices/v1/internal/aml_tracing_connection.h b/google/cloud/financialservices/v1/internal/aml_tracing_connection.h index a9c678ff98acb..9d3fa9ae9c402 100644 --- a/google/cloud/financialservices/v1/internal/aml_tracing_connection.h +++ b/google/cloud/financialservices/v1/internal/aml_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace financialservices_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AMLTracingConnection : public financialservices_v1::AMLConnection { public: ~AMLTracingConnection() override = default; @@ -451,8 +449,6 @@ class AMLTracingConnection : public financialservices_v1::AMLConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/financialservices/v1/internal/aml_tracing_stub.cc b/google/cloud/financialservices/v1/internal/aml_tracing_stub.cc index a26d273f122fe..3aed59c4db67d 100644 --- a/google/cloud/financialservices/v1/internal/aml_tracing_stub.cc +++ b/google/cloud/financialservices/v1/internal/aml_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace financialservices_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AMLTracingStub::AMLTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -969,17 +970,13 @@ future AMLTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAMLTracingStub(std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace financialservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/financialservices/v1/internal/aml_tracing_stub.h b/google/cloud/financialservices/v1/internal/aml_tracing_stub.h index b50169d3069b1..ceda5a89e5964 100644 --- a/google/cloud/financialservices/v1/internal/aml_tracing_stub.h +++ b/google/cloud/financialservices/v1/internal/aml_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace financialservices_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AMLTracingStub : public AMLStub { public: ~AMLTracingStub() override = default; @@ -449,8 +450,6 @@ class AMLTracingStub : public AMLStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -464,4 +463,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_TRACING_STUB_H diff --git a/google/cloud/functions/BUILD.bazel b/google/cloud/functions/BUILD.bazel index 6cc8a2816c353..d2b20a38463b4 100644 --- a/google/cloud/functions/BUILD.bazel +++ b/google/cloud/functions/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/functions/v1:functions_cc_grpc", - "@com_google_googleapis//google/cloud/functions/v2:functions_cc_grpc", + "@googleapis//google/cloud/functions/v1:functions_cc_grpc", + "@googleapis//google/cloud/functions/v2:functions_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/functions/CMakeLists.txt b/google/cloud/functions/CMakeLists.txt index 8833af98be455..79478486547bf 100644 --- a/google/cloud/functions/CMakeLists.txt +++ b/google/cloud/functions/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(functions "Cloud Functions API" - SERVICE_DIRS "__EMPTY__" "v1/" "v2/") + SERVICE_DIRS "v1/" "v2/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(functions_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/functions/cloud_functions_client.h b/google/cloud/functions/cloud_functions_client.h deleted file mode 100644 index 4eba2dbee7ebc..0000000000000 --- a/google/cloud/functions/cloud_functions_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/functions/v1/functions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_CLIENT_H - -#include "google/cloud/functions/cloud_functions_connection.h" -#include "google/cloud/functions/v1/cloud_functions_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in functions_v1 instead of the aliases defined in -/// this namespace. -namespace functions { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use functions_v1::CloudFunctionsServiceClient directly. -using ::google::cloud::functions_v1::CloudFunctionsServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace functions -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_CLIENT_H diff --git a/google/cloud/functions/cloud_functions_connection.h b/google/cloud/functions/cloud_functions_connection.h deleted file mode 100644 index 5e81aca5245a0..0000000000000 --- a/google/cloud/functions/cloud_functions_connection.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/functions/v1/functions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_CONNECTION_H - -#include "google/cloud/functions/cloud_functions_connection_idempotency_policy.h" -#include "google/cloud/functions/v1/cloud_functions_connection.h" - -namespace google { -namespace cloud { -namespace functions { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use functions_v1::MakeCloudFunctionsServiceConnection directly. -using ::google::cloud::functions_v1::MakeCloudFunctionsServiceConnection; - -/// @deprecated Use functions_v1::CloudFunctionsServiceConnection directly. -using ::google::cloud::functions_v1::CloudFunctionsServiceConnection; - -/// @deprecated Use -/// functions_v1::CloudFunctionsServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::functions_v1:: - CloudFunctionsServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use functions_v1::CloudFunctionsServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::functions_v1:: - CloudFunctionsServiceLimitedTimeRetryPolicy; - -/// @deprecated Use functions_v1::CloudFunctionsServiceRetryPolicy directly. -using ::google::cloud::functions_v1::CloudFunctionsServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace functions -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_CONNECTION_H diff --git a/google/cloud/functions/cloud_functions_connection_idempotency_policy.h b/google/cloud/functions/cloud_functions_connection_idempotency_policy.h deleted file mode 100644 index bc16bcc0a9e66..0000000000000 --- a/google/cloud/functions/cloud_functions_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/functions/v1/functions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/functions/v1/cloud_functions_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace functions { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// functions_v1::MakeDefaultCloudFunctionsServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::functions_v1:: - MakeDefaultCloudFunctionsServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// functions_v1::CloudFunctionsServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::functions_v1:: - CloudFunctionsServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace functions -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/functions/cloud_functions_options.h b/google/cloud/functions/cloud_functions_options.h deleted file mode 100644 index 72c4b4d5c279d..0000000000000 --- a/google/cloud/functions/cloud_functions_options.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/functions/v1/functions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_OPTIONS_H - -#include "google/cloud/functions/cloud_functions_connection.h" -#include "google/cloud/functions/cloud_functions_connection_idempotency_policy.h" -#include "google/cloud/functions/v1/cloud_functions_options.h" - -namespace google { -namespace cloud { -namespace functions { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use functions_v1::CloudFunctionsServicePollingPolicyOption -/// directly. -using ::google::cloud::functions_v1::CloudFunctionsServicePollingPolicyOption; - -/// @deprecated Use functions_v1::CloudFunctionsServiceBackoffPolicyOption -/// directly. -using ::google::cloud::functions_v1::CloudFunctionsServiceBackoffPolicyOption; - -/// @deprecated Use -/// functions_v1::CloudFunctionsServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::functions_v1:: - CloudFunctionsServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use functions_v1::CloudFunctionsServicePolicyOptionList -/// directly. -using ::google::cloud::functions_v1::CloudFunctionsServicePolicyOptionList; - -/// @deprecated Use functions_v1::CloudFunctionsServiceRetryPolicyOption -/// directly. -using ::google::cloud::functions_v1::CloudFunctionsServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace functions -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_CLOUD_FUNCTIONS_OPTIONS_H diff --git a/google/cloud/functions/mocks/mock_cloud_functions_connection.h b/google/cloud/functions/mocks/mock_cloud_functions_connection.h deleted file mode 100644 index 99ba612380279..0000000000000 --- a/google/cloud/functions/mocks/mock_cloud_functions_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/functions/v1/functions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_MOCKS_MOCK_CLOUD_FUNCTIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_MOCKS_MOCK_CLOUD_FUNCTIONS_CONNECTION_H - -#include "google/cloud/functions/cloud_functions_connection.h" -#include "google/cloud/functions/v1/mocks/mock_cloud_functions_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in functions_v1_mocks instead of the aliases -/// defined in this namespace. -namespace functions_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use functions_v1_mocks::MockCloudFunctionsServiceConnection -/// directly. -using ::google::cloud::functions_v1_mocks::MockCloudFunctionsServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace functions_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_MOCKS_MOCK_CLOUD_FUNCTIONS_CONNECTION_H diff --git a/google/cloud/functions/quickstart/.bazelrc b/google/cloud/functions/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/functions/quickstart/.bazelrc +++ b/google/cloud/functions/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/functions/quickstart/CMakeLists.txt index 1d88e9a85143f..45226baf2c057 100644 --- a/google/cloud/functions/quickstart/CMakeLists.txt +++ b/google/cloud/functions/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Functions API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-functions-quickstart CXX) find_package(google_cloud_cpp_functions REQUIRED) diff --git a/google/cloud/functions/quickstart/WORKSPACE.bazel b/google/cloud/functions/quickstart/WORKSPACE.bazel index 308703cd1c89f..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 = "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/functions/v1/cloud_functions_client.h b/google/cloud/functions/v1/cloud_functions_client.h index e116b3013d810..9df9587855a81 100644 --- a/google/cloud/functions/v1/cloud_functions_client.h +++ b/google/cloud/functions/v1/cloud_functions_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/functions/v1/cloud_functions_connection.h b/google/cloud/functions/v1/cloud_functions_connection.h index 5148126e8e3c7..e137fef704cef 100644 --- a/google/cloud/functions/v1/cloud_functions_connection.h +++ b/google/cloud/functions/v1/cloud_functions_connection.h @@ -20,7 +20,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V1_CLOUD_FUNCTIONS_CONNECTION_H #include "google/cloud/functions/v1/cloud_functions_connection_idempotency_policy.h" +#include "google/cloud/functions/v1/functions.pb.h" #include "google/cloud/functions/v1/internal/cloud_functions_retry_traits.h" +#include "google/cloud/functions/v1/operations.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,9 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/functions/v1/cloud_functions_connection_idempotency_policy.h b/google/cloud/functions/v1/cloud_functions_connection_idempotency_policy.h index dbf704d99ea47..d009d41cff41b 100644 --- a/google/cloud/functions/v1/cloud_functions_connection_idempotency_policy.h +++ b/google/cloud/functions/v1/cloud_functions_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V1_CLOUD_FUNCTIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V1_CLOUD_FUNCTIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/functions/v1/functions.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/functions/v1/internal/cloud_functions_auth_decorator.cc b/google/cloud/functions/v1/internal/cloud_functions_auth_decorator.cc index 8f9395bc74818..ef91b90872bef 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_auth_decorator.cc +++ b/google/cloud/functions/v1/internal/cloud_functions_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/functions/v1/functions.proto #include "google/cloud/functions/v1/internal/cloud_functions_auth_decorator.h" -#include +#include "google/cloud/functions/v1/functions.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace functions_v1_internal { @@ -255,3 +258,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace functions_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/functions/v1/internal/cloud_functions_auth_decorator.h b/google/cloud/functions/v1/internal/cloud_functions_auth_decorator.h index 46314a2382d5c..52ee4d2fe69fe 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_auth_decorator.h +++ b/google/cloud/functions/v1/internal/cloud_functions_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/functions/v1/internal/cloud_functions_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 functions_v1_internal { @@ -147,4 +150,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V1_INTERNAL_CLOUD_FUNCTIONS_AUTH_DECORATOR_H diff --git a/google/cloud/functions/v1/internal/cloud_functions_connection_impl.h b/google/cloud/functions/v1/internal/cloud_functions_connection_impl.h index 92772b028fd0b..253cae4fe10d7 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_connection_impl.h +++ b/google/cloud/functions/v1/internal/cloud_functions_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/functions/v1/internal/cloud_functions_logging_decorator.cc b/google/cloud/functions/v1/internal/cloud_functions_logging_decorator.cc index de8615cf4ff1d..a5b63b9519b29 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_logging_decorator.cc +++ b/google/cloud/functions/v1/internal/cloud_functions_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/functions/v1/functions.proto #include "google/cloud/functions/v1/internal/cloud_functions_logging_decorator.h" +#include "google/cloud/functions/v1/functions.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace functions_v1_internal { @@ -303,3 +306,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace functions_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/functions/v1/internal/cloud_functions_logging_decorator.h b/google/cloud/functions/v1/internal/cloud_functions_logging_decorator.h index aecc062de652d..b2b7461b7b2fe 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_logging_decorator.h +++ b/google/cloud/functions/v1/internal/cloud_functions_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/functions/v1/internal/cloud_functions_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 functions_v1_internal { @@ -147,4 +150,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V1_INTERNAL_CLOUD_FUNCTIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/functions/v1/internal/cloud_functions_metadata_decorator.cc b/google/cloud/functions/v1/internal/cloud_functions_metadata_decorator.cc index 7d817465da42d..d35e65b587a20 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_metadata_decorator.cc +++ b/google/cloud/functions/v1/internal/cloud_functions_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/functions/v1/functions.proto #include "google/cloud/functions/v1/internal/cloud_functions_metadata_decorator.h" +#include "google/cloud/functions/v1/functions.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 functions_v1_internal { @@ -250,3 +254,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace functions_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/functions/v1/internal/cloud_functions_metadata_decorator.h b/google/cloud/functions/v1/internal/cloud_functions_metadata_decorator.h index 57b57419a0eeb..398fc95415a59 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_metadata_decorator.h +++ b/google/cloud/functions/v1/internal/cloud_functions_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/functions/v1/internal/cloud_functions_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 functions_v1_internal { @@ -153,4 +156,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V1_INTERNAL_CLOUD_FUNCTIONS_METADATA_DECORATOR_H diff --git a/google/cloud/functions/v1/internal/cloud_functions_option_defaults.cc b/google/cloud/functions/v1/internal/cloud_functions_option_defaults.cc index 2947a05131879..719f33c62cbac 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_option_defaults.cc +++ b/google/cloud/functions/v1/internal/cloud_functions_option_defaults.cc @@ -42,7 +42,7 @@ Options CloudFunctionsServiceDefaultOptions(Options options) { if (!options.has()) { options.set( functions_v1::CloudFunctionsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/functions/v1/internal/cloud_functions_stub.cc b/google/cloud/functions/v1/internal/cloud_functions_stub.cc index 7651b9abc0cfa..daa299a8baa93 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_stub.cc +++ b/google/cloud/functions/v1/internal/cloud_functions_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/functions/v1/functions.proto #include "google/cloud/functions/v1/internal/cloud_functions_stub.h" +#include "google/cloud/functions/v1/functions.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace functions_v1_internal { @@ -296,3 +299,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace functions_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/functions/v1/internal/cloud_functions_stub.h b/google/cloud/functions/v1/internal/cloud_functions_stub.h index 76f6e3c0917cb..1900f68351172 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_stub.h +++ b/google/cloud/functions/v1/internal/cloud_functions_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V1_INTERNAL_CLOUD_FUNCTIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V1_INTERNAL_CLOUD_FUNCTIONS_STUB_H +#include "google/cloud/functions/v1/functions.grpc.pb.h" +#include "google/cloud/functions/v1/operations.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 -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace functions_v1_internal { @@ -262,4 +265,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V1_INTERNAL_CLOUD_FUNCTIONS_STUB_H diff --git a/google/cloud/functions/v1/internal/cloud_functions_stub_factory.cc b/google/cloud/functions/v1/internal/cloud_functions_stub_factory.cc index 325ff130ddb14..98e33ba5a61c8 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_stub_factory.cc +++ b/google/cloud/functions/v1/internal/cloud_functions_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/functions/v1/functions.proto #include "google/cloud/functions/v1/internal/cloud_functions_stub_factory.h" +#include "google/cloud/functions/v1/functions.grpc.pb.h" #include "google/cloud/functions/v1/internal/cloud_functions_auth_decorator.h" #include "google/cloud/functions/v1/internal/cloud_functions_logging_decorator.h" #include "google/cloud/functions/v1/internal/cloud_functions_metadata_decorator.h" #include "google/cloud/functions/v1/internal/cloud_functions_stub.h" #include "google/cloud/functions/v1/internal/cloud_functions_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace functions_v1_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace functions_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/functions/v1/internal/cloud_functions_stub_factory.h b/google/cloud/functions/v1/internal/cloud_functions_stub_factory.h index 5ba08508b8e60..49992c1333c6d 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_stub_factory.h +++ b/google/cloud/functions/v1/internal/cloud_functions_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace functions_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V1_INTERNAL_CLOUD_FUNCTIONS_STUB_FACTORY_H diff --git a/google/cloud/functions/v1/internal/cloud_functions_tracing_connection.cc b/google/cloud/functions/v1/internal/cloud_functions_tracing_connection.cc index 89898fae8b7c1..912466a80482c 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_tracing_connection.cc +++ b/google/cloud/functions/v1/internal/cloud_functions_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace functions_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudFunctionsServiceTracingConnection::CloudFunctionsServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -226,17 +224,13 @@ CloudFunctionsServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudFunctionsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/functions/v1/internal/cloud_functions_tracing_connection.h b/google/cloud/functions/v1/internal/cloud_functions_tracing_connection.h index 800874f7b74d1..aaa7ab4e437af 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_tracing_connection.h +++ b/google/cloud/functions/v1/internal/cloud_functions_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace functions_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudFunctionsServiceTracingConnection : public functions_v1::CloudFunctionsServiceConnection { public: @@ -118,8 +116,6 @@ class CloudFunctionsServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/functions/v1/internal/cloud_functions_tracing_stub.cc b/google/cloud/functions/v1/internal/cloud_functions_tracing_stub.cc index ab6dd00a64f65..393e58de066ce 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_tracing_stub.cc +++ b/google/cloud/functions/v1/internal/cloud_functions_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace functions_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudFunctionsServiceTracingStub::CloudFunctionsServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -273,18 +274,14 @@ future CloudFunctionsServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudFunctionsServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace functions_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/functions/v1/internal/cloud_functions_tracing_stub.h b/google/cloud/functions/v1/internal/cloud_functions_tracing_stub.h index 561bc57abe08a..8da56c63aa4d8 100644 --- a/google/cloud/functions/v1/internal/cloud_functions_tracing_stub.h +++ b/google/cloud/functions/v1/internal/cloud_functions_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace functions_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudFunctionsServiceTracingStub : public CloudFunctionsServiceStub { public: ~CloudFunctionsServiceTracingStub() override = default; @@ -143,8 +144,6 @@ class CloudFunctionsServiceTracingStub : public CloudFunctionsServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -159,4 +158,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V1_INTERNAL_CLOUD_FUNCTIONS_TRACING_STUB_H diff --git a/google/cloud/functions/v2/function_client.h b/google/cloud/functions/v2/function_client.h index fac880133abfe..dc37c21ad77a9 100644 --- a/google/cloud/functions/v2/function_client.h +++ b/google/cloud/functions/v2/function_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/functions/v2/function_connection.h b/google/cloud/functions/v2/function_connection.h index 659f016d80800..c0bef604e9e50 100644 --- a/google/cloud/functions/v2/function_connection.h +++ b/google/cloud/functions/v2/function_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V2_FUNCTION_CONNECTION_H #include "google/cloud/functions/v2/function_connection_idempotency_policy.h" +#include "google/cloud/functions/v2/functions.pb.h" #include "google/cloud/functions/v2/internal/function_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/functions/v2/function_connection_idempotency_policy.h b/google/cloud/functions/v2/function_connection_idempotency_policy.h index c4de7695a2295..dcec773ffb722 100644 --- a/google/cloud/functions/v2/function_connection_idempotency_policy.h +++ b/google/cloud/functions/v2/function_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V2_FUNCTION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V2_FUNCTION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/functions/v2/functions.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/functions/v2/internal/function_auth_decorator.cc b/google/cloud/functions/v2/internal/function_auth_decorator.cc index 24a6647e9085e..7e2d5fc839831 100644 --- a/google/cloud/functions/v2/internal/function_auth_decorator.cc +++ b/google/cloud/functions/v2/internal/function_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/functions/v2/functions.proto #include "google/cloud/functions/v2/internal/function_auth_decorator.h" -#include +#include "google/cloud/functions/v2/functions.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace functions_v2_internal { @@ -251,3 +254,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace functions_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/functions/v2/internal/function_auth_decorator.h b/google/cloud/functions/v2/internal/function_auth_decorator.h index 618439e61377e..a725cce75a89f 100644 --- a/google/cloud/functions/v2/internal/function_auth_decorator.h +++ b/google/cloud/functions/v2/internal/function_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/functions/v2/internal/function_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 functions_v2_internal { @@ -147,4 +150,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V2_INTERNAL_FUNCTION_AUTH_DECORATOR_H diff --git a/google/cloud/functions/v2/internal/function_connection_impl.h b/google/cloud/functions/v2/internal/function_connection_impl.h index 8cac7d09ef637..e577e4e73e350 100644 --- a/google/cloud/functions/v2/internal/function_connection_impl.h +++ b/google/cloud/functions/v2/internal/function_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/functions/v2/internal/function_logging_decorator.cc b/google/cloud/functions/v2/internal/function_logging_decorator.cc index 0cb12ff8e9a3b..6867828d7a9c9 100644 --- a/google/cloud/functions/v2/internal/function_logging_decorator.cc +++ b/google/cloud/functions/v2/internal/function_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/functions/v2/functions.proto #include "google/cloud/functions/v2/internal/function_logging_decorator.h" +#include "google/cloud/functions/v2/functions.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace functions_v2_internal { @@ -299,3 +302,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace functions_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/functions/v2/internal/function_logging_decorator.h b/google/cloud/functions/v2/internal/function_logging_decorator.h index 47ab7ad1eb567..ace90b8570980 100644 --- a/google/cloud/functions/v2/internal/function_logging_decorator.h +++ b/google/cloud/functions/v2/internal/function_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/functions/v2/internal/function_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 functions_v2_internal { @@ -147,4 +150,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V2_INTERNAL_FUNCTION_LOGGING_DECORATOR_H diff --git a/google/cloud/functions/v2/internal/function_metadata_decorator.cc b/google/cloud/functions/v2/internal/function_metadata_decorator.cc index 9caa21fe31ef9..588013bf757fb 100644 --- a/google/cloud/functions/v2/internal/function_metadata_decorator.cc +++ b/google/cloud/functions/v2/internal/function_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/functions/v2/functions.proto #include "google/cloud/functions/v2/internal/function_metadata_decorator.h" +#include "google/cloud/functions/v2/functions.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 functions_v2_internal { @@ -248,3 +252,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace functions_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/functions/v2/internal/function_metadata_decorator.h b/google/cloud/functions/v2/internal/function_metadata_decorator.h index fa804a69afc4e..207aa97909a8c 100644 --- a/google/cloud/functions/v2/internal/function_metadata_decorator.h +++ b/google/cloud/functions/v2/internal/function_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/functions/v2/internal/function_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 functions_v2_internal { @@ -153,4 +156,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V2_INTERNAL_FUNCTION_METADATA_DECORATOR_H diff --git a/google/cloud/functions/v2/internal/function_option_defaults.cc b/google/cloud/functions/v2/internal/function_option_defaults.cc index 3d75131e4794f..e449e70d6afa8 100644 --- a/google/cloud/functions/v2/internal/function_option_defaults.cc +++ b/google/cloud/functions/v2/internal/function_option_defaults.cc @@ -42,7 +42,7 @@ Options FunctionServiceDefaultOptions(Options options) { if (!options.has()) { options.set( functions_v2::FunctionServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/functions/v2/internal/function_stub.cc b/google/cloud/functions/v2/internal/function_stub.cc index c8f6e47f536ec..3c86eb1d443ac 100644 --- a/google/cloud/functions/v2/internal/function_stub.cc +++ b/google/cloud/functions/v2/internal/function_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/functions/v2/functions.proto #include "google/cloud/functions/v2/internal/function_stub.h" +#include "google/cloud/functions/v2/functions.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace functions_v2_internal { @@ -295,3 +298,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace functions_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/functions/v2/internal/function_stub.h b/google/cloud/functions/v2/internal/function_stub.h index ec66b556d7fb2..90f5f7b358eb7 100644 --- a/google/cloud/functions/v2/internal/function_stub.h +++ b/google/cloud/functions/v2/internal/function_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V2_INTERNAL_FUNCTION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V2_INTERNAL_FUNCTION_STUB_H +#include "google/cloud/functions/v2/functions.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 -#include -#include -#include +#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 functions_v2_internal { @@ -264,4 +267,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V2_INTERNAL_FUNCTION_STUB_H diff --git a/google/cloud/functions/v2/internal/function_stub_factory.cc b/google/cloud/functions/v2/internal/function_stub_factory.cc index 46308b77b82ae..a57b32786e851 100644 --- a/google/cloud/functions/v2/internal/function_stub_factory.cc +++ b/google/cloud/functions/v2/internal/function_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/functions/v2/functions.proto #include "google/cloud/functions/v2/internal/function_stub_factory.h" +#include "google/cloud/functions/v2/functions.grpc.pb.h" #include "google/cloud/functions/v2/internal/function_auth_decorator.h" #include "google/cloud/functions/v2/internal/function_logging_decorator.h" #include "google/cloud/functions/v2/internal/function_metadata_decorator.h" #include "google/cloud/functions/v2/internal/function_stub.h" #include "google/cloud/functions/v2/internal/function_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 -#include -#include -#include +#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 functions_v2_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace functions_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/functions/v2/internal/function_stub_factory.h b/google/cloud/functions/v2/internal/function_stub_factory.h index 8961315db2b2e..3bad2288ed444 100644 --- a/google/cloud/functions/v2/internal/function_stub_factory.h +++ b/google/cloud/functions/v2/internal/function_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace functions_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V2_INTERNAL_FUNCTION_STUB_FACTORY_H diff --git a/google/cloud/functions/v2/internal/function_tracing_connection.cc b/google/cloud/functions/v2/internal/function_tracing_connection.cc index 903893bf801d8..364270b72b18c 100644 --- a/google/cloud/functions/v2/internal/function_tracing_connection.cc +++ b/google/cloud/functions/v2/internal/function_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace functions_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FunctionServiceTracingConnection::FunctionServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -225,16 +223,12 @@ FunctionServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFunctionServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/functions/v2/internal/function_tracing_connection.h b/google/cloud/functions/v2/internal/function_tracing_connection.h index eff24648fa6cd..f9d8295ef2c01 100644 --- a/google/cloud/functions/v2/internal/function_tracing_connection.h +++ b/google/cloud/functions/v2/internal/function_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace functions_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FunctionServiceTracingConnection : public functions_v2::FunctionServiceConnection { public: @@ -118,8 +116,6 @@ class FunctionServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/functions/v2/internal/function_tracing_stub.cc b/google/cloud/functions/v2/internal/function_tracing_stub.cc index 549b3e3113481..8b4107f11e12a 100644 --- a/google/cloud/functions/v2/internal/function_tracing_stub.cc +++ b/google/cloud/functions/v2/internal/function_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace functions_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FunctionServiceTracingStub::FunctionServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -271,18 +272,14 @@ future FunctionServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFunctionServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace functions_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/functions/v2/internal/function_tracing_stub.h b/google/cloud/functions/v2/internal/function_tracing_stub.h index aec1e7f0f8ed2..ab72a2e7fcebb 100644 --- a/google/cloud/functions/v2/internal/function_tracing_stub.h +++ b/google/cloud/functions/v2/internal/function_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace functions_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FunctionServiceTracingStub : public FunctionServiceStub { public: ~FunctionServiceTracingStub() override = default; @@ -143,8 +144,6 @@ class FunctionServiceTracingStub : public FunctionServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -159,4 +158,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FUNCTIONS_V2_INTERNAL_FUNCTION_TRACING_STUB_H diff --git a/google/cloud/gkebackup/BUILD.bazel b/google/cloud/gkebackup/BUILD.bazel index 8a288759bd8e3..b8f01aa36d207 100644 --- a/google/cloud/gkebackup/BUILD.bazel +++ b/google/cloud/gkebackup/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/gkebackup/v1:gkebackup_cc_grpc", + "@googleapis//google/cloud/gkebackup/v1:gkebackup_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/gkebackup/quickstart/.bazelrc b/google/cloud/gkebackup/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/gkebackup/quickstart/.bazelrc +++ b/google/cloud/gkebackup/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/gkebackup/quickstart/CMakeLists.txt index a9917b497ec6b..4ed167d062731 100644 --- a/google/cloud/gkebackup/quickstart/CMakeLists.txt +++ b/google/cloud/gkebackup/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Backup for GKE API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-gkebackup-quickstart CXX) find_package(google_cloud_cpp_gkebackup REQUIRED) diff --git a/google/cloud/gkebackup/quickstart/WORKSPACE.bazel b/google/cloud/gkebackup/quickstart/WORKSPACE.bazel index 53c08a90f2951..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 = "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/gkebackup/v1/backup_for_gke_client.h b/google/cloud/gkebackup/v1/backup_for_gke_client.h index 4d1d11dece224..34369256cfb4c 100644 --- a/google/cloud/gkebackup/v1/backup_for_gke_client.h +++ b/google/cloud/gkebackup/v1/backup_for_gke_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/gkebackup/v1/backup_for_gke_connection.h b/google/cloud/gkebackup/v1/backup_for_gke_connection.h index 9468b0a0370e4..fbf18ca108fe3 100644 --- a/google/cloud/gkebackup/v1/backup_for_gke_connection.h +++ b/google/cloud/gkebackup/v1/backup_for_gke_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEBACKUP_V1_BACKUP_FOR_GKE_CONNECTION_H #include "google/cloud/gkebackup/v1/backup_for_gke_connection_idempotency_policy.h" +#include "google/cloud/gkebackup/v1/gkebackup.pb.h" #include "google/cloud/gkebackup/v1/internal/backup_for_gke_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/gkebackup/v1/backup_for_gke_connection_idempotency_policy.h b/google/cloud/gkebackup/v1/backup_for_gke_connection_idempotency_policy.h index 2533656d8c920..c9daaba1393c9 100644 --- a/google/cloud/gkebackup/v1/backup_for_gke_connection_idempotency_policy.h +++ b/google/cloud/gkebackup/v1/backup_for_gke_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEBACKUP_V1_BACKUP_FOR_GKE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEBACKUP_V1_BACKUP_FOR_GKE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/gkebackup/v1/gkebackup.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_auth_decorator.cc b/google/cloud/gkebackup/v1/internal/backup_for_gke_auth_decorator.cc index 946f09430517d..a1c18a44760e7 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_auth_decorator.cc +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/gkebackup/v1/gkebackup.proto #include "google/cloud/gkebackup/v1/internal/backup_for_gke_auth_decorator.h" -#include +#include "google/cloud/gkebackup/v1/gkebackup.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkebackup_v1_internal { @@ -840,3 +843,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkebackup_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_auth_decorator.h b/google/cloud/gkebackup/v1/internal/backup_for_gke_auth_decorator.h index 699de79cef6ea..f125d6c7c708a 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_auth_decorator.h +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkebackup/v1/internal/backup_for_gke_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 gkebackup_v1_internal { @@ -424,4 +427,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEBACKUP_V1_INTERNAL_BACKUP_FOR_GKE_AUTH_DECORATOR_H diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_connection_impl.h b/google/cloud/gkebackup/v1/internal/backup_for_gke_connection_impl.h index eedc5b4518933..b43f6c805c33c 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_connection_impl.h +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_logging_decorator.cc b/google/cloud/gkebackup/v1/internal/backup_for_gke_logging_decorator.cc index 4209c8643539a..e857589765364 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_logging_decorator.cc +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/gkebackup/v1/gkebackup.proto #include "google/cloud/gkebackup/v1/internal/backup_for_gke_logging_decorator.h" +#include "google/cloud/gkebackup/v1/gkebackup.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkebackup_v1_internal { @@ -1005,3 +1008,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkebackup_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_logging_decorator.h b/google/cloud/gkebackup/v1/internal/backup_for_gke_logging_decorator.h index 9f13314f97a7a..abb03bfb94804 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_logging_decorator.h +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkebackup/v1/internal/backup_for_gke_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 gkebackup_v1_internal { @@ -424,4 +427,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEBACKUP_V1_INTERNAL_BACKUP_FOR_GKE_LOGGING_DECORATOR_H diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_metadata_decorator.cc b/google/cloud/gkebackup/v1/internal/backup_for_gke_metadata_decorator.cc index 0442a0953e3a2..08068583c5a4f 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_metadata_decorator.cc +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/gkebackup/v1/gkebackup.proto #include "google/cloud/gkebackup/v1/internal/backup_for_gke_metadata_decorator.h" +#include "google/cloud/gkebackup/v1/gkebackup.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 gkebackup_v1_internal { @@ -738,3 +742,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkebackup_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_metadata_decorator.h b/google/cloud/gkebackup/v1/internal/backup_for_gke_metadata_decorator.h index 3141a0834afec..11b0a452044dc 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_metadata_decorator.h +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkebackup/v1/internal/backup_for_gke_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 gkebackup_v1_internal { @@ -429,4 +432,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEBACKUP_V1_INTERNAL_BACKUP_FOR_GKE_METADATA_DECORATOR_H diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_option_defaults.cc b/google/cloud/gkebackup/v1/internal/backup_for_gke_option_defaults.cc index b853d3424527e..f22c5cdcfcbaf 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_option_defaults.cc +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_option_defaults.cc @@ -41,7 +41,7 @@ Options BackupForGKEDefaultOptions(Options options) { if (!options.has()) { options.set( gkebackup_v1::BackupForGKELimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_stub.cc b/google/cloud/gkebackup/v1/internal/backup_for_gke_stub.cc index 7ba2224adc835..5b8f8816675ec 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_stub.cc +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/gkebackup/v1/gkebackup.proto #include "google/cloud/gkebackup/v1/internal/backup_for_gke_stub.h" +#include "google/cloud/gkebackup/v1/gkebackup.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkebackup_v1_internal { @@ -982,3 +985,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkebackup_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_stub.h b/google/cloud/gkebackup/v1/internal/backup_for_gke_stub.h index 84c5aec8daa1e..44c72598b1ed6 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_stub.h +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEBACKUP_V1_INTERNAL_BACKUP_FOR_GKE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEBACKUP_V1_INTERNAL_BACKUP_FOR_GKE_STUB_H +#include "google/cloud/gkebackup/v1/gkebackup.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 -#include -#include -#include +#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 gkebackup_v1_internal { @@ -818,4 +821,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEBACKUP_V1_INTERNAL_BACKUP_FOR_GKE_STUB_H diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_stub_factory.cc b/google/cloud/gkebackup/v1/internal/backup_for_gke_stub_factory.cc index 8301ee879d929..4cbde66ac4837 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_stub_factory.cc +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/gkebackup/v1/gkebackup.proto #include "google/cloud/gkebackup/v1/internal/backup_for_gke_stub_factory.h" +#include "google/cloud/gkebackup/v1/gkebackup.grpc.pb.h" #include "google/cloud/gkebackup/v1/internal/backup_for_gke_auth_decorator.h" #include "google/cloud/gkebackup/v1/internal/backup_for_gke_logging_decorator.h" #include "google/cloud/gkebackup/v1/internal/backup_for_gke_metadata_decorator.h" #include "google/cloud/gkebackup/v1/internal/backup_for_gke_stub.h" #include "google/cloud/gkebackup/v1/internal/backup_for_gke_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 -#include -#include -#include +#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 gkebackup_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkebackup_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_stub_factory.h b/google/cloud/gkebackup/v1/internal/backup_for_gke_stub_factory.h index f0df7d998ef70..eeda1fc859020 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_stub_factory.h +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkebackup_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEBACKUP_V1_INTERNAL_BACKUP_FOR_GKE_STUB_FACTORY_H diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_connection.cc b/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_connection.cc index 5eb1a272a1e37..d39bf76bf57f2 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_connection.cc +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace gkebackup_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BackupForGKETracingConnection::BackupForGKETracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -865,16 +863,12 @@ Status BackupForGKETracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBackupForGKETracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_connection.h b/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_connection.h index dd7ac1ab4bb0e..ff51dc211ac2b 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_connection.h +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace gkebackup_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BackupForGKETracingConnection : public gkebackup_v1::BackupForGKEConnection { public: @@ -377,8 +375,6 @@ class BackupForGKETracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_stub.cc b/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_stub.cc index 68143e42fb58a..537138da14188 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_stub.cc +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkebackup_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - BackupForGKETracingStub::BackupForGKETracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -895,18 +896,14 @@ future BackupForGKETracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeBackupForGKETracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkebackup_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_stub.h b/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_stub.h index c5d0a0ef2d631..eb4ad9980118a 100644 --- a/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_stub.h +++ b/google/cloud/gkebackup/v1/internal/backup_for_gke_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkebackup_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class BackupForGKETracingStub : public BackupForGKEStub { public: ~BackupForGKETracingStub() override = default; @@ -419,8 +420,6 @@ class BackupForGKETracingStub : public BackupForGKEStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -435,4 +434,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEBACKUP_V1_INTERNAL_BACKUP_FOR_GKE_TRACING_STUB_H diff --git a/google/cloud/gkeconnect/BUILD.bazel b/google/cloud/gkeconnect/BUILD.bazel index 261e6fe5d10db..f4b07554bd4a8 100644 --- a/google/cloud/gkeconnect/BUILD.bazel +++ b/google/cloud/gkeconnect/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["gateway/v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/gkeconnect/gateway/v1:gateway_cc_proto", + "@googleapis//google/cloud/gkeconnect/gateway/v1:gateway_cc_proto", ] cc_gapic_library( diff --git a/google/cloud/gkeconnect/gateway/v1/gateway_control_connection.h b/google/cloud/gkeconnect/gateway/v1/gateway_control_connection.h index 8a89cc3b1b49b..d89ea71250698 100644 --- a/google/cloud/gkeconnect/gateway/v1/gateway_control_connection.h +++ b/google/cloud/gkeconnect/gateway/v1/gateway_control_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKECONNECT_GATEWAY_V1_GATEWAY_CONTROL_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKECONNECT_GATEWAY_V1_GATEWAY_CONTROL_CONNECTION_H +#include "google/cloud/gkeconnect/gateway/v1/control.pb.h" #include "google/cloud/gkeconnect/gateway/v1/gateway_control_connection_idempotency_policy.h" #include "google/cloud/gkeconnect/gateway/v1/internal/gateway_control_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/gkeconnect/gateway/v1/gateway_control_connection_idempotency_policy.h b/google/cloud/gkeconnect/gateway/v1/gateway_control_connection_idempotency_policy.h index cfb48ccdff9a6..9c4a9e0ece5bb 100644 --- a/google/cloud/gkeconnect/gateway/v1/gateway_control_connection_idempotency_policy.h +++ b/google/cloud/gkeconnect/gateway/v1/gateway_control_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKECONNECT_GATEWAY_V1_GATEWAY_CONTROL_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKECONNECT_GATEWAY_V1_GATEWAY_CONTROL_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/gkeconnect/gateway/v1/control.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_option_defaults.cc b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_option_defaults.cc index 52e73baae3970..58400a7d83b19 100644 --- a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_option_defaults.cc +++ b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_option_defaults.cc @@ -42,7 +42,7 @@ Options GatewayControlDefaultOptions(Options options) { if (!options.has()) { options.set( gkeconnect_gateway_v1::GatewayControlLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_logging_decorator.h b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_logging_decorator.h index ab0a20fa4a9ce..93efbb5bcdd2d 100644 --- a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_logging_decorator.h +++ b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKECONNECT_GATEWAY_V1_INTERNAL_GATEWAY_CONTROL_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKECONNECT_GATEWAY_V1_INTERNAL_GATEWAY_CONTROL_REST_LOGGING_DECORATOR_H +#include "google/cloud/gkeconnect/gateway/v1/control.pb.h" #include "google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_metadata_decorator.cc b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_metadata_decorator.cc index 59296349c9550..b82b214f95022 100644 --- a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_metadata_decorator.cc +++ b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/gkeconnect/gateway/v1/control.proto #include "google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_metadata_decorator.h b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_metadata_decorator.h index 8f329c6df9183..dc9a6afe1b536 100644 --- a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_metadata_decorator.h +++ b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKECONNECT_GATEWAY_V1_INTERNAL_GATEWAY_CONTROL_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKECONNECT_GATEWAY_V1_INTERNAL_GATEWAY_CONTROL_REST_METADATA_DECORATOR_H +#include "google/cloud/gkeconnect/gateway/v1/control.pb.h" #include "google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_stub.cc b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_stub.cc index a1e2d2c97c7c2..b1193120b3b69 100644 --- a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_stub.cc +++ b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/gkeconnect/gateway/v1/control.proto #include "google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_stub.h" +#include "google/cloud/gkeconnect/gateway/v1/control.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_stub.h b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_stub.h index 07ca3b054ae73..e21908d93893a 100644 --- a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_stub.h +++ b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKECONNECT_GATEWAY_V1_INTERNAL_GATEWAY_CONTROL_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKECONNECT_GATEWAY_V1_INTERNAL_GATEWAY_CONTROL_REST_STUB_H +#include "google/cloud/gkeconnect/gateway/v1/control.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_tracing_connection.cc b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_tracing_connection.cc index ff35f16b8fc39..5f2d0fc2e004b 100644 --- a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_tracing_connection.cc +++ b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace gkeconnect_gateway_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GatewayControlTracingConnection::GatewayControlTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -42,16 +40,12 @@ GatewayControlTracingConnection::GenerateCredentials( return internal::EndSpan(*span, child_->GenerateCredentials(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGatewayControlTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_tracing_connection.h b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_tracing_connection.h index 96a153f93c7ee..bebbca68cf8f7 100644 --- a/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_tracing_connection.h +++ b/google/cloud/gkeconnect/gateway/v1/internal/gateway_control_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace gkeconnect_gateway_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GatewayControlTracingConnection : public gkeconnect_gateway_v1::GatewayControlConnection { public: @@ -49,8 +47,6 @@ class GatewayControlTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/gkeconnect/quickstart/.bazelrc b/google/cloud/gkeconnect/quickstart/.bazelrc index e676fbffccb52..d313ebed860ce 100644 --- a/google/cloud/gkeconnect/quickstart/.bazelrc +++ b/google/cloud/gkeconnect/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 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/CMakeLists.txt b/google/cloud/gkeconnect/quickstart/CMakeLists.txt index b0ca518700bc1..103c5148a6345 100644 --- a/google/cloud/gkeconnect/quickstart/CMakeLists.txt +++ b/google/cloud/gkeconnect/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Connect Gateway API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-gkeconnect-quickstart CXX) find_package(google_cloud_cpp_gkeconnect REQUIRED) diff --git a/google/cloud/gkeconnect/quickstart/WORKSPACE.bazel b/google/cloud/gkeconnect/quickstart/WORKSPACE.bazel index 24ae17787418e..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 = "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/gkehub/BUILD.bazel b/google/cloud/gkehub/BUILD.bazel index 45d1e842363c2..3982f69a77512 100644 --- a/google/cloud/gkehub/BUILD.bazel +++ b/google/cloud/gkehub/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/gkehub/v1:gkehub_cc_grpc", + "@googleapis//google/cloud/gkehub/v1:gkehub_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/gkehub/CMakeLists.txt b/google/cloud/gkehub/CMakeLists.txt index 04cc750e9d5a3..88670cfbdf966 100644 --- a/google/cloud/gkehub/CMakeLists.txt +++ b/google/cloud/gkehub/CMakeLists.txt @@ -16,8 +16,7 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library(gkehub "GKE Hub" SERVICE_DIRS "__EMPTY__" - "v1/") +google_cloud_cpp_add_gapic_library(gkehub "GKE Hub" SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(gkehub_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/gkehub/gke_hub_client.h b/google/cloud/gkehub/gke_hub_client.h deleted file mode 100644 index c938ec76d1e33..0000000000000 --- a/google/cloud/gkehub/gke_hub_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/gkehub/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_GKE_HUB_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_GKE_HUB_CLIENT_H - -#include "google/cloud/gkehub/gke_hub_connection.h" -#include "google/cloud/gkehub/v1/gke_hub_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in gkehub_v1 instead of the aliases defined in -/// this namespace. -namespace gkehub { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use gkehub_v1::GkeHubClient directly. -using ::google::cloud::gkehub_v1::GkeHubClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace gkehub -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_GKE_HUB_CLIENT_H diff --git a/google/cloud/gkehub/gke_hub_connection.h b/google/cloud/gkehub/gke_hub_connection.h deleted file mode 100644 index c0cc2a3065739..0000000000000 --- a/google/cloud/gkehub/gke_hub_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/gkehub/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_GKE_HUB_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_GKE_HUB_CONNECTION_H - -#include "google/cloud/gkehub/gke_hub_connection_idempotency_policy.h" -#include "google/cloud/gkehub/v1/gke_hub_connection.h" - -namespace google { -namespace cloud { -namespace gkehub { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use gkehub_v1::MakeGkeHubConnection directly. -using ::google::cloud::gkehub_v1::MakeGkeHubConnection; - -/// @deprecated Use gkehub_v1::GkeHubConnection directly. -using ::google::cloud::gkehub_v1::GkeHubConnection; - -/// @deprecated Use gkehub_v1::GkeHubLimitedErrorCountRetryPolicy directly. -using ::google::cloud::gkehub_v1::GkeHubLimitedErrorCountRetryPolicy; - -/// @deprecated Use gkehub_v1::GkeHubLimitedTimeRetryPolicy directly. -using ::google::cloud::gkehub_v1::GkeHubLimitedTimeRetryPolicy; - -/// @deprecated Use gkehub_v1::GkeHubRetryPolicy directly. -using ::google::cloud::gkehub_v1::GkeHubRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace gkehub -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_GKE_HUB_CONNECTION_H diff --git a/google/cloud/gkehub/gke_hub_connection_idempotency_policy.h b/google/cloud/gkehub/gke_hub_connection_idempotency_policy.h deleted file mode 100644 index 6a8b93f300b6b..0000000000000 --- a/google/cloud/gkehub/gke_hub_connection_idempotency_policy.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/gkehub/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_GKE_HUB_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_GKE_HUB_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/gkehub/v1/gke_hub_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace gkehub { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use gkehub_v1::MakeDefaultGkeHubConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::gkehub_v1::MakeDefaultGkeHubConnectionIdempotencyPolicy; - -/// @deprecated Use gkehub_v1::GkeHubConnectionIdempotencyPolicy directly. -using ::google::cloud::gkehub_v1::GkeHubConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace gkehub -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_GKE_HUB_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/gkehub/gke_hub_options.h b/google/cloud/gkehub/gke_hub_options.h deleted file mode 100644 index fbb801c9033b7..0000000000000 --- a/google/cloud/gkehub/gke_hub_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/gkehub/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_GKE_HUB_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_GKE_HUB_OPTIONS_H - -#include "google/cloud/gkehub/gke_hub_connection.h" -#include "google/cloud/gkehub/gke_hub_connection_idempotency_policy.h" -#include "google/cloud/gkehub/v1/gke_hub_options.h" - -namespace google { -namespace cloud { -namespace gkehub { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use gkehub_v1::GkeHubPollingPolicyOption directly. -using ::google::cloud::gkehub_v1::GkeHubPollingPolicyOption; - -/// @deprecated Use gkehub_v1::GkeHubBackoffPolicyOption directly. -using ::google::cloud::gkehub_v1::GkeHubBackoffPolicyOption; - -/// @deprecated Use gkehub_v1::GkeHubConnectionIdempotencyPolicyOption directly. -using ::google::cloud::gkehub_v1::GkeHubConnectionIdempotencyPolicyOption; - -/// @deprecated Use gkehub_v1::GkeHubPolicyOptionList directly. -using ::google::cloud::gkehub_v1::GkeHubPolicyOptionList; - -/// @deprecated Use gkehub_v1::GkeHubRetryPolicyOption directly. -using ::google::cloud::gkehub_v1::GkeHubRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace gkehub -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_GKE_HUB_OPTIONS_H diff --git a/google/cloud/gkehub/mocks/mock_gke_hub_connection.h b/google/cloud/gkehub/mocks/mock_gke_hub_connection.h deleted file mode 100644 index 05b28ca5ca551..0000000000000 --- a/google/cloud/gkehub/mocks/mock_gke_hub_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/gkehub/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_MOCKS_MOCK_GKE_HUB_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_MOCKS_MOCK_GKE_HUB_CONNECTION_H - -#include "google/cloud/gkehub/gke_hub_connection.h" -#include "google/cloud/gkehub/v1/mocks/mock_gke_hub_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in gkehub_v1_mocks instead of the aliases -/// defined in this namespace. -namespace gkehub_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use gkehub_v1_mocks::MockGkeHubConnection directly. -using ::google::cloud::gkehub_v1_mocks::MockGkeHubConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace gkehub_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_MOCKS_MOCK_GKE_HUB_CONNECTION_H diff --git a/google/cloud/gkehub/quickstart/.bazelrc b/google/cloud/gkehub/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/gkehub/quickstart/.bazelrc +++ b/google/cloud/gkehub/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/gkehub/quickstart/CMakeLists.txt index f8d4f0844e48d..0fff3a654422a 100644 --- a/google/cloud/gkehub/quickstart/CMakeLists.txt +++ b/google/cloud/gkehub/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the GKE Hub C++ client library from a larger CMake # project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-gkehub-quickstart CXX) find_package(google_cloud_cpp_gkehub REQUIRED) diff --git a/google/cloud/gkehub/quickstart/WORKSPACE.bazel b/google/cloud/gkehub/quickstart/WORKSPACE.bazel index ecaecae20f966..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 = "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/gkehub/v1/gke_hub_client.cc b/google/cloud/gkehub/v1/gke_hub_client.cc index d1e68257458cb..bd9dcd49c71df 100644 --- a/google/cloud/gkehub/v1/gke_hub_client.cc +++ b/google/cloud/gkehub/v1/gke_hub_client.cc @@ -47,6 +47,23 @@ GkeHubClient::ListMemberships( return connection_->ListMemberships(std::move(request)); } +StreamRange +GkeHubClient::ListBoundMemberships(std::string const& scope_name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::ListBoundMembershipsRequest request; + request.set_scope_name(scope_name); + return connection_->ListBoundMemberships(request); +} + +StreamRange +GkeHubClient::ListBoundMemberships( + google::cloud::gkehub::v1::ListBoundMembershipsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListBoundMemberships(std::move(request)); +} + StreamRange GkeHubClient::ListFeatures( std::string const& parent, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); @@ -364,6 +381,1005 @@ GkeHubClient::GenerateConnectManifest( return connection_->GenerateConnectManifest(request); } +future> GkeHubClient::CreateFleet( + std::string const& parent, google::cloud::gkehub::v1::Fleet const& fleet, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::CreateFleetRequest request; + request.set_parent(parent); + *request.mutable_fleet() = fleet; + return connection_->CreateFleet(request); +} + +StatusOr GkeHubClient::CreateFleet( + NoAwaitTag, std::string const& parent, + google::cloud::gkehub::v1::Fleet const& fleet, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::CreateFleetRequest request; + request.set_parent(parent); + *request.mutable_fleet() = fleet; + return connection_->CreateFleet(NoAwaitTag{}, request); +} + +future> GkeHubClient::CreateFleet( + google::cloud::gkehub::v1::CreateFleetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateFleet(request); +} + +StatusOr GkeHubClient::CreateFleet( + NoAwaitTag, google::cloud::gkehub::v1::CreateFleetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateFleet(NoAwaitTag{}, request); +} + +future> GkeHubClient::CreateFleet( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateFleet(operation); +} + +StatusOr GkeHubClient::GetFleet( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::GetFleetRequest request; + request.set_name(name); + return connection_->GetFleet(request); +} + +StatusOr GkeHubClient::GetFleet( + google::cloud::gkehub::v1::GetFleetRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetFleet(request); +} + +future> GkeHubClient::UpdateFleet( + google::cloud::gkehub::v1::Fleet const& fleet, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::UpdateFleetRequest request; + *request.mutable_fleet() = fleet; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateFleet(request); +} + +StatusOr GkeHubClient::UpdateFleet( + NoAwaitTag, google::cloud::gkehub::v1::Fleet const& fleet, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::UpdateFleetRequest request; + *request.mutable_fleet() = fleet; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateFleet(NoAwaitTag{}, request); +} + +future> GkeHubClient::UpdateFleet( + google::cloud::gkehub::v1::UpdateFleetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateFleet(request); +} + +StatusOr GkeHubClient::UpdateFleet( + NoAwaitTag, google::cloud::gkehub::v1::UpdateFleetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateFleet(NoAwaitTag{}, request); +} + +future> GkeHubClient::UpdateFleet( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateFleet(operation); +} + +future> +GkeHubClient::DeleteFleet(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::DeleteFleetRequest request; + request.set_name(name); + return connection_->DeleteFleet(request); +} + +StatusOr GkeHubClient::DeleteFleet( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::DeleteFleetRequest request; + request.set_name(name); + return connection_->DeleteFleet(NoAwaitTag{}, request); +} + +future> +GkeHubClient::DeleteFleet( + google::cloud::gkehub::v1::DeleteFleetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteFleet(request); +} + +StatusOr GkeHubClient::DeleteFleet( + NoAwaitTag, google::cloud::gkehub::v1::DeleteFleetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteFleet(NoAwaitTag{}, request); +} + +future> +GkeHubClient::DeleteFleet(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteFleet(operation); +} + +StreamRange GkeHubClient::ListFleets( + std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::ListFleetsRequest request; + request.set_parent(parent); + return connection_->ListFleets(request); +} + +StreamRange GkeHubClient::ListFleets( + google::cloud::gkehub::v1::ListFleetsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListFleets(std::move(request)); +} + +StatusOr GkeHubClient::GetScopeNamespace( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::GetScopeNamespaceRequest request; + request.set_name(name); + return connection_->GetScopeNamespace(request); +} + +StatusOr GkeHubClient::GetScopeNamespace( + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetScopeNamespace(request); +} + +future> +GkeHubClient::CreateScopeNamespace( + std::string const& parent, + google::cloud::gkehub::v1::Namespace const& scope_namespace, + std::string const& scope_namespace_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::CreateScopeNamespaceRequest request; + request.set_parent(parent); + *request.mutable_scope_namespace() = scope_namespace; + request.set_scope_namespace_id(scope_namespace_id); + return connection_->CreateScopeNamespace(request); +} + +StatusOr GkeHubClient::CreateScopeNamespace( + NoAwaitTag, std::string const& parent, + google::cloud::gkehub::v1::Namespace const& scope_namespace, + std::string const& scope_namespace_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::CreateScopeNamespaceRequest request; + request.set_parent(parent); + *request.mutable_scope_namespace() = scope_namespace; + request.set_scope_namespace_id(scope_namespace_id); + return connection_->CreateScopeNamespace(NoAwaitTag{}, request); +} + +future> +GkeHubClient::CreateScopeNamespace( + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateScopeNamespace(request); +} + +StatusOr GkeHubClient::CreateScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateScopeNamespace(NoAwaitTag{}, request); +} + +future> +GkeHubClient::CreateScopeNamespace( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateScopeNamespace(operation); +} + +future> +GkeHubClient::UpdateScopeNamespace( + google::cloud::gkehub::v1::Namespace const& scope_namespace, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest request; + *request.mutable_scope_namespace() = scope_namespace; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateScopeNamespace(request); +} + +StatusOr GkeHubClient::UpdateScopeNamespace( + NoAwaitTag, google::cloud::gkehub::v1::Namespace const& scope_namespace, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest request; + *request.mutable_scope_namespace() = scope_namespace; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateScopeNamespace(NoAwaitTag{}, request); +} + +future> +GkeHubClient::UpdateScopeNamespace( + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateScopeNamespace(request); +} + +StatusOr GkeHubClient::UpdateScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateScopeNamespace(NoAwaitTag{}, request); +} + +future> +GkeHubClient::UpdateScopeNamespace( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateScopeNamespace(operation); +} + +future> +GkeHubClient::DeleteScopeNamespace(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest request; + request.set_name(name); + return connection_->DeleteScopeNamespace(request); +} + +StatusOr GkeHubClient::DeleteScopeNamespace( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest request; + request.set_name(name); + return connection_->DeleteScopeNamespace(NoAwaitTag{}, request); +} + +future> +GkeHubClient::DeleteScopeNamespace( + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteScopeNamespace(request); +} + +StatusOr GkeHubClient::DeleteScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteScopeNamespace(NoAwaitTag{}, request); +} + +future> +GkeHubClient::DeleteScopeNamespace( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteScopeNamespace(operation); +} + +StreamRange +GkeHubClient::ListScopeNamespaces(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::ListScopeNamespacesRequest request; + request.set_parent(parent); + return connection_->ListScopeNamespaces(request); +} + +StreamRange +GkeHubClient::ListScopeNamespaces( + google::cloud::gkehub::v1::ListScopeNamespacesRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListScopeNamespaces(std::move(request)); +} + +StatusOr +GkeHubClient::GetScopeRBACRoleBinding(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest request; + request.set_name(name); + return connection_->GetScopeRBACRoleBinding(request); +} + +StatusOr +GkeHubClient::GetScopeRBACRoleBinding( + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetScopeRBACRoleBinding(request); +} + +future> +GkeHubClient::CreateScopeRBACRoleBinding( + std::string const& parent, + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + std::string const& rbacrolebinding_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest request; + request.set_parent(parent); + *request.mutable_rbacrolebinding() = rbacrolebinding; + request.set_rbacrolebinding_id(rbacrolebinding_id); + return connection_->CreateScopeRBACRoleBinding(request); +} + +StatusOr +GkeHubClient::CreateScopeRBACRoleBinding( + NoAwaitTag, std::string const& parent, + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + std::string const& rbacrolebinding_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest request; + request.set_parent(parent); + *request.mutable_rbacrolebinding() = rbacrolebinding; + request.set_rbacrolebinding_id(rbacrolebinding_id); + return connection_->CreateScopeRBACRoleBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::CreateScopeRBACRoleBinding( + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateScopeRBACRoleBinding(request); +} + +StatusOr +GkeHubClient::CreateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateScopeRBACRoleBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::CreateScopeRBACRoleBinding( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateScopeRBACRoleBinding(operation); +} + +future> +GkeHubClient::UpdateScopeRBACRoleBinding( + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest request; + *request.mutable_rbacrolebinding() = rbacrolebinding; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateScopeRBACRoleBinding(request); +} + +StatusOr +GkeHubClient::UpdateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest request; + *request.mutable_rbacrolebinding() = rbacrolebinding; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateScopeRBACRoleBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::UpdateScopeRBACRoleBinding( + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateScopeRBACRoleBinding(request); +} + +StatusOr +GkeHubClient::UpdateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateScopeRBACRoleBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::UpdateScopeRBACRoleBinding( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateScopeRBACRoleBinding(operation); +} + +future> +GkeHubClient::DeleteScopeRBACRoleBinding(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest request; + request.set_name(name); + return connection_->DeleteScopeRBACRoleBinding(request); +} + +StatusOr +GkeHubClient::DeleteScopeRBACRoleBinding(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest request; + request.set_name(name); + return connection_->DeleteScopeRBACRoleBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::DeleteScopeRBACRoleBinding( + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteScopeRBACRoleBinding(request); +} + +StatusOr +GkeHubClient::DeleteScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteScopeRBACRoleBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::DeleteScopeRBACRoleBinding( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteScopeRBACRoleBinding(operation); +} + +StreamRange +GkeHubClient::ListScopeRBACRoleBindings(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest request; + request.set_parent(parent); + return connection_->ListScopeRBACRoleBindings(request); +} + +StreamRange +GkeHubClient::ListScopeRBACRoleBindings( + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListScopeRBACRoleBindings(std::move(request)); +} + +StatusOr GkeHubClient::GetScope( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::GetScopeRequest request; + request.set_name(name); + return connection_->GetScope(request); +} + +StatusOr GkeHubClient::GetScope( + google::cloud::gkehub::v1::GetScopeRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetScope(request); +} + +future> GkeHubClient::CreateScope( + std::string const& parent, google::cloud::gkehub::v1::Scope const& scope, + std::string const& scope_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::CreateScopeRequest request; + request.set_parent(parent); + *request.mutable_scope() = scope; + request.set_scope_id(scope_id); + return connection_->CreateScope(request); +} + +StatusOr GkeHubClient::CreateScope( + NoAwaitTag, std::string const& parent, + google::cloud::gkehub::v1::Scope const& scope, std::string const& scope_id, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::CreateScopeRequest request; + request.set_parent(parent); + *request.mutable_scope() = scope; + request.set_scope_id(scope_id); + return connection_->CreateScope(NoAwaitTag{}, request); +} + +future> GkeHubClient::CreateScope( + google::cloud::gkehub::v1::CreateScopeRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateScope(request); +} + +StatusOr GkeHubClient::CreateScope( + NoAwaitTag, google::cloud::gkehub::v1::CreateScopeRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateScope(NoAwaitTag{}, request); +} + +future> GkeHubClient::CreateScope( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateScope(operation); +} + +future> GkeHubClient::UpdateScope( + google::cloud::gkehub::v1::Scope const& scope, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::UpdateScopeRequest request; + *request.mutable_scope() = scope; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateScope(request); +} + +StatusOr GkeHubClient::UpdateScope( + NoAwaitTag, google::cloud::gkehub::v1::Scope const& scope, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::UpdateScopeRequest request; + *request.mutable_scope() = scope; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateScope(NoAwaitTag{}, request); +} + +future> GkeHubClient::UpdateScope( + google::cloud::gkehub::v1::UpdateScopeRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateScope(request); +} + +StatusOr GkeHubClient::UpdateScope( + NoAwaitTag, google::cloud::gkehub::v1::UpdateScopeRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateScope(NoAwaitTag{}, request); +} + +future> GkeHubClient::UpdateScope( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateScope(operation); +} + +future> +GkeHubClient::DeleteScope(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::DeleteScopeRequest request; + request.set_name(name); + return connection_->DeleteScope(request); +} + +StatusOr GkeHubClient::DeleteScope( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::DeleteScopeRequest request; + request.set_name(name); + return connection_->DeleteScope(NoAwaitTag{}, request); +} + +future> +GkeHubClient::DeleteScope( + google::cloud::gkehub::v1::DeleteScopeRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteScope(request); +} + +StatusOr GkeHubClient::DeleteScope( + NoAwaitTag, google::cloud::gkehub::v1::DeleteScopeRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteScope(NoAwaitTag{}, request); +} + +future> +GkeHubClient::DeleteScope(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteScope(operation); +} + +StreamRange GkeHubClient::ListScopes( + std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::ListScopesRequest request; + request.set_parent(parent); + return connection_->ListScopes(request); +} + +StreamRange GkeHubClient::ListScopes( + google::cloud::gkehub::v1::ListScopesRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListScopes(std::move(request)); +} + +StreamRange GkeHubClient::ListPermittedScopes( + std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::ListPermittedScopesRequest request; + request.set_parent(parent); + return connection_->ListPermittedScopes(request); +} + +StreamRange GkeHubClient::ListPermittedScopes( + google::cloud::gkehub::v1::ListPermittedScopesRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListPermittedScopes(std::move(request)); +} + +StatusOr +GkeHubClient::GetMembershipBinding(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::GetMembershipBindingRequest request; + request.set_name(name); + return connection_->GetMembershipBinding(request); +} + +StatusOr +GkeHubClient::GetMembershipBinding( + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetMembershipBinding(request); +} + +future> +GkeHubClient::CreateMembershipBinding( + std::string const& parent, + google::cloud::gkehub::v1::MembershipBinding const& membership_binding, + std::string const& membership_binding_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::CreateMembershipBindingRequest request; + request.set_parent(parent); + *request.mutable_membership_binding() = membership_binding; + request.set_membership_binding_id(membership_binding_id); + return connection_->CreateMembershipBinding(request); +} + +StatusOr GkeHubClient::CreateMembershipBinding( + NoAwaitTag, std::string const& parent, + google::cloud::gkehub::v1::MembershipBinding const& membership_binding, + std::string const& membership_binding_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::CreateMembershipBindingRequest request; + request.set_parent(parent); + *request.mutable_membership_binding() = membership_binding; + request.set_membership_binding_id(membership_binding_id); + return connection_->CreateMembershipBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::CreateMembershipBinding( + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateMembershipBinding(request); +} + +StatusOr GkeHubClient::CreateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateMembershipBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::CreateMembershipBinding( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateMembershipBinding(operation); +} + +future> +GkeHubClient::UpdateMembershipBinding( + google::cloud::gkehub::v1::MembershipBinding const& membership_binding, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::UpdateMembershipBindingRequest request; + *request.mutable_membership_binding() = membership_binding; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateMembershipBinding(request); +} + +StatusOr GkeHubClient::UpdateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::MembershipBinding const& membership_binding, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::UpdateMembershipBindingRequest request; + *request.mutable_membership_binding() = membership_binding; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateMembershipBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::UpdateMembershipBinding( + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateMembershipBinding(request); +} + +StatusOr GkeHubClient::UpdateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateMembershipBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::UpdateMembershipBinding( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateMembershipBinding(operation); +} + +future> +GkeHubClient::DeleteMembershipBinding(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::DeleteMembershipBindingRequest request; + request.set_name(name); + return connection_->DeleteMembershipBinding(request); +} + +StatusOr GkeHubClient::DeleteMembershipBinding( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::DeleteMembershipBindingRequest request; + request.set_name(name); + return connection_->DeleteMembershipBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::DeleteMembershipBinding( + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteMembershipBinding(request); +} + +StatusOr GkeHubClient::DeleteMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteMembershipBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::DeleteMembershipBinding( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteMembershipBinding(operation); +} + +StreamRange +GkeHubClient::ListMembershipBindings(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::ListMembershipBindingsRequest request; + request.set_parent(parent); + return connection_->ListMembershipBindings(request); +} + +StreamRange +GkeHubClient::ListMembershipBindings( + google::cloud::gkehub::v1::ListMembershipBindingsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListMembershipBindings(std::move(request)); +} + +StatusOr +GkeHubClient::GetMembershipRBACRoleBinding(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest request; + request.set_name(name); + return connection_->GetMembershipRBACRoleBinding(request); +} + +StatusOr +GkeHubClient::GetMembershipRBACRoleBinding( + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetMembershipRBACRoleBinding(request); +} + +future> +GkeHubClient::CreateMembershipRBACRoleBinding( + std::string const& parent, + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + std::string const& rbacrolebinding_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest request; + request.set_parent(parent); + *request.mutable_rbacrolebinding() = rbacrolebinding; + request.set_rbacrolebinding_id(rbacrolebinding_id); + return connection_->CreateMembershipRBACRoleBinding(request); +} + +StatusOr +GkeHubClient::CreateMembershipRBACRoleBinding( + NoAwaitTag, std::string const& parent, + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + std::string const& rbacrolebinding_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest request; + request.set_parent(parent); + *request.mutable_rbacrolebinding() = rbacrolebinding; + request.set_rbacrolebinding_id(rbacrolebinding_id); + return connection_->CreateMembershipRBACRoleBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::CreateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateMembershipRBACRoleBinding(request); +} + +StatusOr +GkeHubClient::CreateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateMembershipRBACRoleBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::CreateMembershipRBACRoleBinding( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateMembershipRBACRoleBinding(operation); +} + +future> +GkeHubClient::UpdateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest request; + *request.mutable_rbacrolebinding() = rbacrolebinding; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateMembershipRBACRoleBinding(request); +} + +StatusOr +GkeHubClient::UpdateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest request; + *request.mutable_rbacrolebinding() = rbacrolebinding; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateMembershipRBACRoleBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::UpdateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateMembershipRBACRoleBinding(request); +} + +StatusOr +GkeHubClient::UpdateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateMembershipRBACRoleBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::UpdateMembershipRBACRoleBinding( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateMembershipRBACRoleBinding(operation); +} + +future> +GkeHubClient::DeleteMembershipRBACRoleBinding(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest request; + request.set_name(name); + return connection_->DeleteMembershipRBACRoleBinding(request); +} + +StatusOr +GkeHubClient::DeleteMembershipRBACRoleBinding(NoAwaitTag, + std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest request; + request.set_name(name); + return connection_->DeleteMembershipRBACRoleBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::DeleteMembershipRBACRoleBinding( + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteMembershipRBACRoleBinding(request); +} + +StatusOr +GkeHubClient::DeleteMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteMembershipRBACRoleBinding(NoAwaitTag{}, request); +} + +future> +GkeHubClient::DeleteMembershipRBACRoleBinding( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteMembershipRBACRoleBinding(operation); +} + +StreamRange +GkeHubClient::ListMembershipRBACRoleBindings(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest request; + request.set_parent(parent); + return connection_->ListMembershipRBACRoleBindings(request); +} + +StreamRange +GkeHubClient::ListMembershipRBACRoleBindings( + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListMembershipRBACRoleBindings(std::move(request)); +} + +StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> +GkeHubClient::GenerateMembershipRBACRoleBindingYAML( + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GenerateMembershipRBACRoleBindingYAML(request); +} + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkehub_v1 } // namespace cloud diff --git a/google/cloud/gkehub/v1/gke_hub_client.h b/google/cloud/gkehub/v1/gke_hub_client.h index 64fc34e31f235..06b87f0a05e1f 100644 --- a/google/cloud/gkehub/v1/gke_hub_client.h +++ b/google/cloud/gkehub/v1/gke_hub_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -79,7 +79,7 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN /// such a copy when using this class from multiple threads. /// /// [google.cloud.gkehub.v1.Feature]: -/// @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L34} +/// @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L35} /// [google.cloud.gkehub.v1.Membership]: /// @googleapis_reference_link{google/cloud/gkehub/v1/membership.proto#L32} /// @@ -136,7 +136,7 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.ListMembershipsRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L195} + /// [google.cloud.gkehub.v1.ListMembershipsRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L977} /// [google.cloud.gkehub.v1.Membership]: @googleapis_reference_link{google/cloud/gkehub/v1/membership.proto#L32} /// // clang-format on @@ -175,7 +175,7 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.ListMembershipsRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L195} + /// [google.cloud.gkehub.v1.ListMembershipsRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L977} /// [google.cloud.gkehub.v1.Membership]: @googleapis_reference_link{google/cloud/gkehub/v1/membership.proto#L32} /// // clang-format on @@ -183,6 +183,83 @@ class GkeHubClient { google::cloud::gkehub::v1::ListMembershipsRequest request, Options opts = {}); + // clang-format off + /// + /// Lists Memberships bound to a Scope. The response includes relevant + /// Memberships from all regions. + /// + /// @param scope_name Required. Name of the Scope, in the format + /// `projects/*/locations/global/scopes/*`, to which the Memberships are bound. + /// @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.gkehub.v1.Membership], 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.gkehub.v1.ListBoundMembershipsRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1186} + /// [google.cloud.gkehub.v1.Membership]: @googleapis_reference_link{google/cloud/gkehub/v1/membership.proto#L32} + /// + // clang-format on + StreamRange ListBoundMemberships( + std::string const& scope_name, Options opts = {}); + + // clang-format off + /// + /// Lists Memberships bound to a Scope. The response includes relevant + /// Memberships from all regions. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.ListBoundMembershipsRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.Membership], 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.gkehub.v1.ListBoundMembershipsRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1186} + /// [google.cloud.gkehub.v1.Membership]: @googleapis_reference_link{google/cloud/gkehub/v1/membership.proto#L32} + /// + // clang-format on + StreamRange ListBoundMemberships( + google::cloud::gkehub::v1::ListBoundMembershipsRequest request, + Options opts = {}); + // clang-format off /// /// Lists Features in a given project and location. @@ -211,8 +288,8 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L34} - /// [google.cloud.gkehub.v1.ListFeaturesRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L456} + /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L35} + /// [google.cloud.gkehub.v1.ListFeaturesRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1413} /// // clang-format on StreamRange ListFeatures( @@ -250,8 +327,8 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L34} - /// [google.cloud.gkehub.v1.ListFeaturesRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L456} + /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L35} + /// [google.cloud.gkehub.v1.ListFeaturesRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1413} /// // clang-format on StreamRange ListFeatures( @@ -277,7 +354,7 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.GetMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L258} + /// [google.cloud.gkehub.v1.GetMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1174} /// [google.cloud.gkehub.v1.Membership]: @googleapis_reference_link{google/cloud/gkehub/v1/membership.proto#L32} /// // clang-format on @@ -307,7 +384,7 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.GetMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L258} + /// [google.cloud.gkehub.v1.GetMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1174} /// [google.cloud.gkehub.v1.Membership]: @googleapis_reference_link{google/cloud/gkehub/v1/membership.proto#L32} /// // clang-format on @@ -334,8 +411,8 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L34} - /// [google.cloud.gkehub.v1.GetFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L508} + /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L35} + /// [google.cloud.gkehub.v1.GetFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1471} /// // clang-format on StatusOr GetFeature( @@ -364,8 +441,8 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L34} - /// [google.cloud.gkehub.v1.GetFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L508} + /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L35} + /// [google.cloud.gkehub.v1.GetFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1471} /// // clang-format on StatusOr GetFeature( @@ -412,7 +489,7 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.CreateMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L270} + /// [google.cloud.gkehub.v1.CreateMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1227} /// [google.cloud.gkehub.v1.Membership]: @googleapis_reference_link{google/cloud/gkehub/v1/membership.proto#L32} /// // clang-format on @@ -471,7 +548,7 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.CreateMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L270} + /// [google.cloud.gkehub.v1.CreateMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1227} /// [google.cloud.gkehub.v1.Membership]: @googleapis_reference_link{google/cloud/gkehub/v1/membership.proto#L32} /// // clang-format on @@ -535,8 +612,8 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.CreateFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L517} - /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L34} + /// [google.cloud.gkehub.v1.CreateFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1486} + /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L35} /// // clang-format on future> CreateFeature( @@ -590,8 +667,8 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.CreateFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L517} - /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L34} + /// [google.cloud.gkehub.v1.CreateFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1486} + /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L35} /// // clang-format on future> CreateFeature( @@ -656,8 +733,8 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.DeleteMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L311} - /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L613} + /// [google.cloud.gkehub.v1.DeleteMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1268} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} /// // clang-format on future> @@ -711,8 +788,8 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.DeleteMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L311} - /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L613} + /// [google.cloud.gkehub.v1.DeleteMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1268} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} /// // clang-format on future> @@ -775,8 +852,8 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.DeleteFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L547} - /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L613} + /// [google.cloud.gkehub.v1.DeleteFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1516} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} /// // clang-format on future> DeleteFeature( @@ -826,8 +903,8 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.DeleteFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L547} - /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L613} + /// [google.cloud.gkehub.v1.DeleteFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1516} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} /// // clang-format on future> DeleteFeature( @@ -898,7 +975,7 @@ class GkeHubClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.gkehub.v1.Membership]: @googleapis_reference_link{google/cloud/gkehub/v1/membership.proto#L32} - /// [google.cloud.gkehub.v1.UpdateMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L343} + /// [google.cloud.gkehub.v1.UpdateMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1300} /// // clang-format on future> UpdateMembership( @@ -953,7 +1030,7 @@ class GkeHubClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.gkehub.v1.Membership]: @googleapis_reference_link{google/cloud/gkehub/v1/membership.proto#L32} - /// [google.cloud.gkehub.v1.UpdateMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L343} + /// [google.cloud.gkehub.v1.UpdateMembershipRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1300} /// // clang-format on future> UpdateMembership( @@ -1023,8 +1100,8 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L34} - /// [google.cloud.gkehub.v1.UpdateFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L576} + /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L35} + /// [google.cloud.gkehub.v1.UpdateFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1545} /// // clang-format on future> UpdateFeature( @@ -1078,8 +1155,8 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L34} - /// [google.cloud.gkehub.v1.UpdateFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L576} + /// [google.cloud.gkehub.v1.Feature]: @googleapis_reference_link{google/cloud/gkehub/v1/feature.proto#L35} + /// [google.cloud.gkehub.v1.UpdateFeatureRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1545} /// // clang-format on future> UpdateFeature( @@ -1140,8 +1217,8 @@ class GkeHubClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.gkehub.v1.GenerateConnectManifestRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L386} - /// [google.cloud.gkehub.v1.GenerateConnectManifestResponse]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L429} + /// [google.cloud.gkehub.v1.GenerateConnectManifestRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1343} + /// [google.cloud.gkehub.v1.GenerateConnectManifestResponse]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1386} /// // clang-format on StatusOr @@ -1149,6 +1226,3061 @@ class GkeHubClient { google::cloud::gkehub::v1::GenerateConnectManifestRequest const& request, Options opts = {}); + // clang-format off + /// + /// Creates a fleet. + /// + /// @param parent Required. The parent (project and location) where the Fleet will be + /// created. Specified in the format `projects/*/locations/*`. + /// @param fleet Required. The fleet 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.gkehub.v1.Fleet] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.CreateFleetRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1582} + /// [google.cloud.gkehub.v1.Fleet]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L32} + /// + // clang-format on + future> CreateFleet( + std::string const& parent, google::cloud::gkehub::v1::Fleet const& fleet, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateFleet + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateFleet( + NoAwaitTag, std::string const& parent, + google::cloud::gkehub::v1::Fleet const& fleet, Options opts = {}); + + // clang-format off + /// + /// Creates a fleet. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.CreateFleetRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.Fleet] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.CreateFleetRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1582} + /// [google.cloud.gkehub.v1.Fleet]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L32} + /// + // clang-format on + future> CreateFleet( + google::cloud::gkehub::v1::CreateFleetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateFleet + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateFleet( + NoAwaitTag, google::cloud::gkehub::v1::CreateFleetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateFleet + /// + /// 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> CreateFleet( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Returns the details of a fleet. + /// + /// @param name Required. The Fleet resource name in the format + /// `projects/*/locations/*/fleets/*`. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.gkehub.v1.Fleet]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.Fleet]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L32} + /// [google.cloud.gkehub.v1.GetFleetRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1601} + /// + // clang-format on + StatusOr GetFleet(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Returns the details of a fleet. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.GetFleetRequest]. + /// Proto messages are converted to 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.gkehub.v1.Fleet]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.Fleet]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L32} + /// [google.cloud.gkehub.v1.GetFleetRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1601} + /// + // clang-format on + StatusOr GetFleet( + google::cloud::gkehub::v1::GetFleetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates a fleet. + /// + /// @param fleet Required. The Fleet to update. + /// @n + /// The `name` field of the Fleet object identifies which fleet will be + /// updated. + /// @param update_mask Required. The fields to 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.gkehub.v1.Fleet] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.Fleet]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L32} + /// [google.cloud.gkehub.v1.UpdateFleetRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1611} + /// + // clang-format on + future> UpdateFleet( + google::cloud::gkehub::v1::Fleet const& fleet, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateFleet + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateFleet( + NoAwaitTag, google::cloud::gkehub::v1::Fleet const& fleet, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a fleet. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.UpdateFleetRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.Fleet] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.Fleet]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L32} + /// [google.cloud.gkehub.v1.UpdateFleetRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1611} + /// + // clang-format on + future> UpdateFleet( + google::cloud::gkehub::v1::UpdateFleetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateFleet + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateFleet( + NoAwaitTag, google::cloud::gkehub::v1::UpdateFleetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateFleet + /// + /// 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> UpdateFleet( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Removes a Fleet. There must be no memberships remaining in the Fleet. + /// + /// @param name Required. The Fleet resource name in the format + /// `projects/*/locations/*/fleets/*`. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.gkehub.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.gkehub.v1.DeleteFleetRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1624} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} + /// + // clang-format on + future> DeleteFleet( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteFleet + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteFleet(NoAwaitTag, + std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Removes a Fleet. There must be no memberships remaining in the Fleet. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.DeleteFleetRequest]. + /// Proto messages are converted to C++ 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.gkehub.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.gkehub.v1.DeleteFleetRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1624} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} + /// + // clang-format on + future> DeleteFleet( + google::cloud::gkehub::v1::DeleteFleetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteFleet + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteFleet( + NoAwaitTag, google::cloud::gkehub::v1::DeleteFleetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteFleet + /// + /// 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> DeleteFleet( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Returns all fleets within an organization or a project that the caller has + /// access to. + /// + /// @param parent Required. The organization or project to list for Fleets under, in the + /// format `organizations/*/locations/*` or `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.gkehub.v1.Fleet], 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.gkehub.v1.Fleet]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L32} + /// [google.cloud.gkehub.v1.ListFleetsRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1634} + /// + // clang-format on + StreamRange ListFleets( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Returns all fleets within an organization or a project that the caller has + /// access to. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.ListFleetsRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.Fleet], 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.gkehub.v1.Fleet]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L32} + /// [google.cloud.gkehub.v1.ListFleetsRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1634} + /// + // clang-format on + StreamRange ListFleets( + google::cloud::gkehub::v1::ListFleetsRequest request, Options opts = {}); + + // clang-format off + /// + /// Returns the details of a fleet namespace. + /// + /// @param name Required. The Namespace resource name in the format + /// `projects/*/locations/*/scopes/*/namespaces/*`. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.gkehub.v1.Namespace]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.GetScopeNamespaceRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L577} + /// [google.cloud.gkehub.v1.Namespace]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L222} + /// + // clang-format on + StatusOr GetScopeNamespace( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Returns the details of a fleet namespace. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.GetScopeNamespaceRequest]. + /// Proto messages are converted to 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.gkehub.v1.Namespace]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.GetScopeNamespaceRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L577} + /// [google.cloud.gkehub.v1.Namespace]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L222} + /// + // clang-format on + StatusOr GetScopeNamespace( + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a fleet namespace. + /// + /// @param parent Required. The parent (project and location) where the Namespace will be + /// created. Specified in the format `projects/*/locations/*/scopes/*`. + /// @param scope_namespace Required. The fleet namespace to create. + /// @param scope_namespace_id Required. Client chosen ID for the Namespace. `namespace_id` must be a + /// valid RFC 1123 compliant DNS label: + /// @n + /// 1. At most 63 characters in length + /// 2. It must consist of lower case alphanumeric characters or `-` + /// 3. It must start and end with an alphanumeric character + /// @n + /// Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + /// with a maximum length of 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.gkehub.v1.Namespace] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.CreateScopeNamespaceRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L589} + /// [google.cloud.gkehub.v1.Namespace]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L222} + /// + // clang-format on + future> CreateScopeNamespace( + std::string const& parent, + google::cloud::gkehub::v1::Namespace const& scope_namespace, + std::string const& scope_namespace_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateScopeNamespace + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateScopeNamespace( + NoAwaitTag, std::string const& parent, + google::cloud::gkehub::v1::Namespace const& scope_namespace, + std::string const& scope_namespace_id, Options opts = {}); + + // clang-format off + /// + /// Creates a fleet namespace. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.CreateScopeNamespaceRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.Namespace] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.CreateScopeNamespaceRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L589} + /// [google.cloud.gkehub.v1.Namespace]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L222} + /// + // clang-format on + future> CreateScopeNamespace( + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateScopeNamespace + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateScopeNamespace + /// + /// 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> CreateScopeNamespace( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates a fleet namespace. + /// + /// @param scope_namespace Required. A namespace with fields updated. The 'name' field in this + /// namespace is used to identify the resource to update. + /// @param update_mask Required. The fields to 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.gkehub.v1.Namespace] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.Namespace]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L222} + /// [google.cloud.gkehub.v1.UpdateScopeNamespaceRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L615} + /// + // clang-format on + future> UpdateScopeNamespace( + google::cloud::gkehub::v1::Namespace const& scope_namespace, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateScopeNamespace + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateScopeNamespace( + NoAwaitTag, google::cloud::gkehub::v1::Namespace const& scope_namespace, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a fleet namespace. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.UpdateScopeNamespaceRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.Namespace] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.Namespace]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L222} + /// [google.cloud.gkehub.v1.UpdateScopeNamespaceRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L615} + /// + // clang-format on + future> UpdateScopeNamespace( + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateScopeNamespace + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateScopeNamespace + /// + /// 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> UpdateScopeNamespace( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a fleet namespace. + /// + /// @param name Required. The Namespace resource name in the format + /// `projects/*/locations/*/scopes/*/namespaces/*`. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.gkehub.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.gkehub.v1.DeleteScopeNamespaceRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L627} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} + /// + // clang-format on + future> + DeleteScopeNamespace(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteScopeNamespace + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteScopeNamespace( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a fleet namespace. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.DeleteScopeNamespaceRequest]. + /// Proto messages are converted to C++ 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.gkehub.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.gkehub.v1.DeleteScopeNamespaceRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L627} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} + /// + // clang-format on + future> + DeleteScopeNamespace( + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteScopeNamespace + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteScopeNamespace + /// + /// 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> + DeleteScopeNamespace(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists fleet namespaces. + /// + /// @param parent Required. The parent (project and location) where the Features will be + /// listed. Specified in the format `projects/*/locations/*/scopes/*`. + /// @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.gkehub.v1.Namespace], 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.gkehub.v1.ListScopeNamespacesRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L639} + /// [google.cloud.gkehub.v1.Namespace]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L222} + /// + // clang-format on + StreamRange ListScopeNamespaces( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists fleet namespaces. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.ListScopeNamespacesRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.Namespace], 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.gkehub.v1.ListScopeNamespacesRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L639} + /// [google.cloud.gkehub.v1.Namespace]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L222} + /// + // clang-format on + StreamRange ListScopeNamespaces( + google::cloud::gkehub::v1::ListScopeNamespacesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Returns the details of a Scope RBACRoleBinding. + /// + /// @param name Required. The RBACRoleBinding resource name in the format + /// `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.gkehub.v1.RBACRoleBinding]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.GetScopeRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L672} + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// + // clang-format on + StatusOr GetScopeRBACRoleBinding( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Returns the details of a Scope RBACRoleBinding. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.GetScopeRBACRoleBindingRequest]. + /// Proto messages are converted to 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.gkehub.v1.RBACRoleBinding]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.GetScopeRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L672} + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// + // clang-format on + StatusOr GetScopeRBACRoleBinding( + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a Scope RBACRoleBinding. + /// + /// @param parent Required. The parent (project and location) where the RBACRoleBinding will + /// be created. Specified in the format `projects/*/locations/*/scopes/*`. + /// @param rbacrolebinding Required. The rbacrolebindings to create. + /// @param rbacrolebinding_id Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + /// must be a valid RFC 1123 compliant DNS label: + /// @n + /// 1. At most 63 characters in length + /// 2. It must consist of lower case alphanumeric characters or `-` + /// 3. It must start and end with an alphanumeric character + /// @n + /// Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + /// with a maximum length of 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.gkehub.v1.RBACRoleBinding] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.CreateScopeRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L684} + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// + // clang-format on + future> + CreateScopeRBACRoleBinding( + std::string const& parent, + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + std::string const& rbacrolebinding_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateScopeRBACRoleBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateScopeRBACRoleBinding( + NoAwaitTag, std::string const& parent, + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + std::string const& rbacrolebinding_id, Options opts = {}); + + // clang-format off + /// + /// Creates a Scope RBACRoleBinding. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.CreateScopeRBACRoleBindingRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.RBACRoleBinding] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.CreateScopeRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L684} + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// + // clang-format on + future> + CreateScopeRBACRoleBinding( + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateScopeRBACRoleBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateScopeRBACRoleBinding + /// + /// 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> + CreateScopeRBACRoleBinding(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates a Scope RBACRoleBinding. + /// + /// @param rbacrolebinding Required. A rbacrolebinding with fields updated. The 'name' field in this + /// rbacrolebinding is used to identify the resource to update. + /// @param update_mask Required. The fields to 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.gkehub.v1.RBACRoleBinding] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// [google.cloud.gkehub.v1.UpdateScopeRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L710} + /// + // clang-format on + future> + UpdateScopeRBACRoleBinding( + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateScopeRBACRoleBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a Scope RBACRoleBinding. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.UpdateScopeRBACRoleBindingRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.RBACRoleBinding] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// [google.cloud.gkehub.v1.UpdateScopeRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L710} + /// + // clang-format on + future> + UpdateScopeRBACRoleBinding( + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateScopeRBACRoleBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateScopeRBACRoleBinding + /// + /// 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> + UpdateScopeRBACRoleBinding(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes a Scope RBACRoleBinding. + /// + /// @param name Required. The RBACRoleBinding resource name in the format + /// `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.gkehub.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.gkehub.v1.DeleteScopeRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L721} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} + /// + // clang-format on + future> + DeleteScopeRBACRoleBinding(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteScopeRBACRoleBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteScopeRBACRoleBinding( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a Scope RBACRoleBinding. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.DeleteScopeRBACRoleBindingRequest]. + /// Proto messages are converted to C++ 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.gkehub.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.gkehub.v1.DeleteScopeRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L721} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} + /// + // clang-format on + future> + DeleteScopeRBACRoleBinding( + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteScopeRBACRoleBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteScopeRBACRoleBinding + /// + /// 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> + DeleteScopeRBACRoleBinding(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists all Scope RBACRoleBindings. + /// + /// @param parent Required. The parent (project and location) where the Features will be + /// listed. Specified in the format `projects/*/locations/*/scopes/*`. + /// @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.gkehub.v1.RBACRoleBinding], 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.gkehub.v1.ListScopeRBACRoleBindingsRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L733} + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// + // clang-format on + StreamRange + ListScopeRBACRoleBindings(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists all Scope RBACRoleBindings. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.ListScopeRBACRoleBindingsRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.RBACRoleBinding], 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.gkehub.v1.ListScopeRBACRoleBindingsRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L733} + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// + // clang-format on + StreamRange + ListScopeRBACRoleBindings( + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Returns the details of a Scope. + /// + /// @param name Required. The Scope resource name in the format + /// `projects/*/locations/*/scopes/*`. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.gkehub.v1.Scope]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.GetScopeRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L766} + /// [google.cloud.gkehub.v1.Scope]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L402} + /// + // clang-format on + StatusOr GetScope(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Returns the details of a Scope. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.GetScopeRequest]. + /// Proto messages are converted to 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.gkehub.v1.Scope]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.GetScopeRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L766} + /// [google.cloud.gkehub.v1.Scope]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L402} + /// + // clang-format on + StatusOr GetScope( + google::cloud::gkehub::v1::GetScopeRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a Scope. + /// + /// @param parent Required. The parent (project and location) where the Scope will be + /// created. Specified in the format `projects/*/locations/*`. + /// @param scope Required. The Scope to create. + /// @param scope_id Required. Client chosen ID for the Scope. `scope_id` must be a + /// ???? + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.gkehub.v1.Scope] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.CreateScopeRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L776} + /// [google.cloud.gkehub.v1.Scope]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L402} + /// + // clang-format on + future> CreateScope( + std::string const& parent, google::cloud::gkehub::v1::Scope const& scope, + std::string const& scope_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateScope + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateScope( + NoAwaitTag, std::string const& parent, + google::cloud::gkehub::v1::Scope const& scope, + std::string const& scope_id, Options opts = {}); + + // clang-format off + /// + /// Creates a Scope. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.CreateScopeRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.Scope] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.CreateScopeRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L776} + /// [google.cloud.gkehub.v1.Scope]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L402} + /// + // clang-format on + future> CreateScope( + google::cloud::gkehub::v1::CreateScopeRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateScope + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateScope( + NoAwaitTag, google::cloud::gkehub::v1::CreateScopeRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateScope + /// + /// 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> CreateScope( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates a scopes. + /// + /// @param scope Required. A Scope with fields updated. The 'name' field in this + /// namespace is used to identify the resource to update. + /// @param update_mask Required. The fields to 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.gkehub.v1.Scope] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.Scope]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L402} + /// [google.cloud.gkehub.v1.UpdateScopeRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L795} + /// + // clang-format on + future> UpdateScope( + google::cloud::gkehub::v1::Scope const& scope, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateScope + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateScope( + NoAwaitTag, google::cloud::gkehub::v1::Scope const& scope, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a scopes. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.UpdateScopeRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.Scope] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.Scope]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L402} + /// [google.cloud.gkehub.v1.UpdateScopeRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L795} + /// + // clang-format on + future> UpdateScope( + google::cloud::gkehub::v1::UpdateScopeRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateScope + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateScope( + NoAwaitTag, google::cloud::gkehub::v1::UpdateScopeRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateScope + /// + /// 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> UpdateScope( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a Scope. + /// + /// @param name Required. The Scope resource name in the format + /// `projects/*/locations/*/scopes/*`. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.gkehub.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.gkehub.v1.DeleteScopeRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L806} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} + /// + // clang-format on + future> DeleteScope( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteScope + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteScope(NoAwaitTag, + std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Deletes a Scope. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.DeleteScopeRequest]. + /// Proto messages are converted to C++ 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.gkehub.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.gkehub.v1.DeleteScopeRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L806} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} + /// + // clang-format on + future> DeleteScope( + google::cloud::gkehub::v1::DeleteScopeRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteScope + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteScope( + NoAwaitTag, google::cloud::gkehub::v1::DeleteScopeRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteScope + /// + /// 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> DeleteScope( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Lists Scopes. + /// + /// @param parent Required. The parent (project and location) where the Scope will be listed. + /// Specified 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.gkehub.v1.Scope], 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.gkehub.v1.ListScopesRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L816} + /// [google.cloud.gkehub.v1.Scope]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L402} + /// + // clang-format on + StreamRange ListScopes( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Scopes. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.ListScopesRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.Scope], 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.gkehub.v1.ListScopesRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L816} + /// [google.cloud.gkehub.v1.Scope]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L402} + /// + // clang-format on + StreamRange ListScopes( + google::cloud::gkehub::v1::ListScopesRequest request, Options opts = {}); + + // clang-format off + /// + /// Lists permitted Scopes. + /// + /// @param parent Required. The parent (project and location) where the Scope will be listed. + /// Specified 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.gkehub.v1.Scope], 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.gkehub.v1.ListPermittedScopesRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L849} + /// [google.cloud.gkehub.v1.Scope]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L402} + /// + // clang-format on + StreamRange ListPermittedScopes( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists permitted Scopes. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.ListPermittedScopesRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.Scope], 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.gkehub.v1.ListPermittedScopesRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L849} + /// [google.cloud.gkehub.v1.Scope]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L402} + /// + // clang-format on + StreamRange ListPermittedScopes( + google::cloud::gkehub::v1::ListPermittedScopesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Returns the details of a MembershipBinding. + /// + /// @param name Required. The MembershipBinding resource name in the format + /// `projects/*/locations/*/memberships/*/bindings/*`. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.gkehub.v1.MembershipBinding]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.GetMembershipBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L882} + /// [google.cloud.gkehub.v1.MembershipBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L471} + /// + // clang-format on + StatusOr GetMembershipBinding( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Returns the details of a MembershipBinding. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.GetMembershipBindingRequest]. + /// Proto messages are converted to 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.gkehub.v1.MembershipBinding]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.GetMembershipBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L882} + /// [google.cloud.gkehub.v1.MembershipBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L471} + /// + // clang-format on + StatusOr GetMembershipBinding( + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a MembershipBinding. + /// + /// @param parent Required. The parent (project and location) where the MembershipBinding + /// will be created. Specified in the format + /// `projects/*/locations/*/memberships/*`. + /// @param membership_binding Required. The MembershipBinding to create. + /// @param membership_binding_id Required. The ID to use for the MembershipBinding. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.gkehub.v1.MembershipBinding] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.CreateMembershipBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L894} + /// [google.cloud.gkehub.v1.MembershipBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L471} + /// + // clang-format on + future> + CreateMembershipBinding( + std::string const& parent, + google::cloud::gkehub::v1::MembershipBinding const& membership_binding, + std::string const& membership_binding_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateMembershipBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateMembershipBinding( + NoAwaitTag, std::string const& parent, + google::cloud::gkehub::v1::MembershipBinding const& membership_binding, + std::string const& membership_binding_id, Options opts = {}); + + // clang-format off + /// + /// Creates a MembershipBinding. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.CreateMembershipBindingRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.MembershipBinding] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.CreateMembershipBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L894} + /// [google.cloud.gkehub.v1.MembershipBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L471} + /// + // clang-format on + future> + CreateMembershipBinding( + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateMembershipBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateMembershipBinding + /// + /// 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> + CreateMembershipBinding(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates a MembershipBinding. + /// + /// @param membership_binding Required. The MembershipBinding object with fields updated. + /// @param update_mask Required. The fields to 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.gkehub.v1.MembershipBinding] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.MembershipBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L471} + /// [google.cloud.gkehub.v1.UpdateMembershipBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L914} + /// + // clang-format on + future> + UpdateMembershipBinding( + google::cloud::gkehub::v1::MembershipBinding const& membership_binding, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateMembershipBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::MembershipBinding const& membership_binding, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a MembershipBinding. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.UpdateMembershipBindingRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.MembershipBinding] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.MembershipBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L471} + /// [google.cloud.gkehub.v1.UpdateMembershipBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L914} + /// + // clang-format on + future> + UpdateMembershipBinding( + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateMembershipBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateMembershipBinding + /// + /// 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> + UpdateMembershipBinding(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes a MembershipBinding. + /// + /// @param name Required. The MembershipBinding resource name in the format + /// `projects/*/locations/*/memberships/*/bindings/*`. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.gkehub.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.gkehub.v1.DeleteMembershipBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L925} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} + /// + // clang-format on + future> + DeleteMembershipBinding(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteMembershipBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteMembershipBinding( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a MembershipBinding. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.DeleteMembershipBindingRequest]. + /// Proto messages are converted to C++ 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.gkehub.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.gkehub.v1.DeleteMembershipBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L925} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} + /// + // clang-format on + future> + DeleteMembershipBinding( + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteMembershipBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteMembershipBinding + /// + /// 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> + DeleteMembershipBinding(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists MembershipBindings. + /// + /// @param parent Required. The parent Membership for which the MembershipBindings will be + /// listed. Specified in the format `projects/*/locations/*/memberships/*`. + /// @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.gkehub.v1.MembershipBinding], 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.gkehub.v1.ListMembershipBindingsRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L937} + /// [google.cloud.gkehub.v1.MembershipBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L471} + /// + // clang-format on + StreamRange + ListMembershipBindings(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists MembershipBindings. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.ListMembershipBindingsRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.MembershipBinding], 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.gkehub.v1.ListMembershipBindingsRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L937} + /// [google.cloud.gkehub.v1.MembershipBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L471} + /// + // clang-format on + StreamRange + ListMembershipBindings( + google::cloud::gkehub::v1::ListMembershipBindingsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Returns the details of a Membership RBACRoleBinding. + /// + /// @param name Required. The RBACRoleBinding resource name in the format + /// `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.gkehub.v1.RBACRoleBinding]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.GetMembershipRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1026} + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// + // clang-format on + StatusOr + GetMembershipRBACRoleBinding(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Returns the details of a Membership RBACRoleBinding. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.GetMembershipRBACRoleBindingRequest]. + /// Proto messages are converted to 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.gkehub.v1.RBACRoleBinding]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.GetMembershipRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1026} + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// + // clang-format on + StatusOr + GetMembershipRBACRoleBinding( + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// Creates a Membership RBACRoleBinding. + /// + /// @param parent Required. The parent (project and location) where the RBACRoleBinding will + /// be created. Specified in the format `projects/*/locations/*/memberships/*`. + /// @param rbacrolebinding Required. The rbacrolebindings to create. + /// @param rbacrolebinding_id Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + /// must be a valid RFC 1123 compliant DNS label: + /// @n + /// 1. At most 63 characters in length + /// 2. It must consist of lower case alphanumeric characters or `-` + /// 3. It must start and end with an alphanumeric character + /// @n + /// Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + /// with a maximum length of 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.gkehub.v1.RBACRoleBinding] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.CreateMembershipRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1038} + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// + // clang-format on + future> + CreateMembershipRBACRoleBinding( + std::string const& parent, + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + std::string const& rbacrolebinding_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateMembershipRBACRoleBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateMembershipRBACRoleBinding( + NoAwaitTag, std::string const& parent, + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + std::string const& rbacrolebinding_id, Options opts = {}); + + // clang-format off + /// + /// Creates a Membership RBACRoleBinding. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.CreateMembershipRBACRoleBindingRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.RBACRoleBinding] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.CreateMembershipRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1038} + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// + // clang-format on + future> + CreateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateMembershipRBACRoleBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateMembershipRBACRoleBinding + /// + /// 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> + CreateMembershipRBACRoleBinding( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates a Membership RBACRoleBinding. + /// + /// @param rbacrolebinding Required. A rbacrolebinding with fields updated. The 'name' field in this + /// rbacrolebinding is used to identify the resource to update. + /// @param update_mask Required. The fields to 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.gkehub.v1.RBACRoleBinding] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// [google.cloud.gkehub.v1.UpdateMembershipRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1064} + /// + // clang-format on + future> + UpdateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateMembershipRBACRoleBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::RBACRoleBinding const& rbacrolebinding, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a Membership RBACRoleBinding. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.UpdateMembershipRBACRoleBindingRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.RBACRoleBinding] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// [google.cloud.gkehub.v1.UpdateMembershipRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1064} + /// + // clang-format on + future> + UpdateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateMembershipRBACRoleBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateMembershipRBACRoleBinding + /// + /// 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> + UpdateMembershipRBACRoleBinding( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a Membership RBACRoleBinding. + /// + /// @param name Required. The RBACRoleBinding resource name in the format + /// `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.gkehub.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.gkehub.v1.DeleteMembershipRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1075} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} + /// + // clang-format on + future> + DeleteMembershipRBACRoleBinding(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteMembershipRBACRoleBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteMembershipRBACRoleBinding( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a Membership RBACRoleBinding. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.DeleteMembershipRBACRoleBindingRequest]. + /// Proto messages are converted to C++ 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.gkehub.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.gkehub.v1.DeleteMembershipRBACRoleBindingRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1075} + /// [google.cloud.gkehub.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1673} + /// + // clang-format on + future> + DeleteMembershipRBACRoleBinding( + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteMembershipRBACRoleBinding + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteMembershipRBACRoleBinding + /// + /// 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> + DeleteMembershipRBACRoleBinding( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Lists all Membership RBACRoleBindings. + /// + /// @param parent Required. The parent (project and location) where the Features will be + /// listed. Specified in the format `projects/*/locations/*/memberships/*`. + /// @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.gkehub.v1.RBACRoleBinding], 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.gkehub.v1.ListMembershipRBACRoleBindingsRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1087} + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// + // clang-format on + StreamRange + ListMembershipRBACRoleBindings(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists all Membership RBACRoleBindings. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.gkehub.v1.ListMembershipRBACRoleBindingsRequest]. + /// Proto messages are converted to C++ 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.gkehub.v1.RBACRoleBinding], 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.gkehub.v1.ListMembershipRBACRoleBindingsRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1087} + /// [google.cloud.gkehub.v1.RBACRoleBinding]: @googleapis_reference_link{google/cloud/gkehub/v1/fleet.proto#L295} + /// + // clang-format on + StreamRange + ListMembershipRBACRoleBindings( + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Generates a YAML of the RBAC policies for the specified + /// RoleBinding and its associated impersonation 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.gkehub.v1.GenerateMembershipRBACRoleBindingYAMLRequest]. + /// Proto messages are converted to 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.gkehub.v1.GenerateMembershipRBACRoleBindingYAMLResponse]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.gkehub.v1.GenerateMembershipRBACRoleBindingYAMLRequest]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1124} + /// [google.cloud.gkehub.v1.GenerateMembershipRBACRoleBindingYAMLResponse]: @googleapis_reference_link{google/cloud/gkehub/v1/service.proto#L1154} + /// + // clang-format on + StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> + GenerateMembershipRBACRoleBindingYAML( + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request, + Options opts = {}); + private: std::shared_ptr connection_; Options options_; diff --git a/google/cloud/gkehub/v1/gke_hub_connection.cc b/google/cloud/gkehub/v1/gke_hub_connection.cc index fcc6d57e12267..96eb3c9132972 100644 --- a/google/cloud/gkehub/v1/gke_hub_connection.cc +++ b/google/cloud/gkehub/v1/gke_hub_connection.cc @@ -46,6 +46,14 @@ GkeHubConnection::ListMemberships( StreamRange>(); } +StreamRange +GkeHubConnection::ListBoundMemberships( + google::cloud::gkehub::v1:: + ListBoundMembershipsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + StreamRange GkeHubConnection::ListFeatures( google::cloud::gkehub::v1:: ListFeaturesRequest) { // NOLINT(performance-unnecessary-value-param) @@ -195,6 +203,507 @@ GkeHubConnection::GenerateConnectManifest( return Status(StatusCode::kUnimplemented, "not implemented"); } +future> +GkeHubConnection::CreateFleet( + google::cloud::gkehub::v1::CreateFleetRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr GkeHubConnection::CreateFleet( + NoAwaitTag, google::cloud::gkehub::v1::CreateFleetRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::CreateFleet(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr GkeHubConnection::GetFleet( + google::cloud::gkehub::v1::GetFleetRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +GkeHubConnection::UpdateFleet( + google::cloud::gkehub::v1::UpdateFleetRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr GkeHubConnection::UpdateFleet( + NoAwaitTag, google::cloud::gkehub::v1::UpdateFleetRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::UpdateFleet(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::DeleteFleet( + google::cloud::gkehub::v1::DeleteFleetRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr GkeHubConnection::DeleteFleet( + NoAwaitTag, google::cloud::gkehub::v1::DeleteFleetRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::DeleteFleet(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange GkeHubConnection::ListFleets( + google::cloud::gkehub::v1:: + ListFleetsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +GkeHubConnection::GetScopeNamespace( + google::cloud::gkehub::v1::GetScopeNamespaceRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +GkeHubConnection::CreateScopeNamespace( + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr GkeHubConnection::CreateScopeNamespace( + NoAwaitTag, google::cloud::gkehub::v1::CreateScopeNamespaceRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::CreateScopeNamespace(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::UpdateScopeNamespace( + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr GkeHubConnection::UpdateScopeNamespace( + NoAwaitTag, google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::UpdateScopeNamespace(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::DeleteScopeNamespace( + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr GkeHubConnection::DeleteScopeNamespace( + NoAwaitTag, google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::DeleteScopeNamespace(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +GkeHubConnection::ListScopeNamespaces( + google::cloud::gkehub::v1:: + ListScopeNamespacesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +GkeHubConnection::GetScopeRBACRoleBinding( + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +GkeHubConnection::CreateScopeRBACRoleBinding( + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +GkeHubConnection::CreateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::CreateScopeRBACRoleBinding( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::UpdateScopeRBACRoleBinding( + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +GkeHubConnection::UpdateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::UpdateScopeRBACRoleBinding( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::DeleteScopeRBACRoleBinding( + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +GkeHubConnection::DeleteScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::DeleteScopeRBACRoleBinding( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +GkeHubConnection::ListScopeRBACRoleBindings( + google::cloud::gkehub::v1:: + ListScopeRBACRoleBindingsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr GkeHubConnection::GetScope( + google::cloud::gkehub::v1::GetScopeRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +GkeHubConnection::CreateScope( + google::cloud::gkehub::v1::CreateScopeRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr GkeHubConnection::CreateScope( + NoAwaitTag, google::cloud::gkehub::v1::CreateScopeRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::CreateScope(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::UpdateScope( + google::cloud::gkehub::v1::UpdateScopeRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr GkeHubConnection::UpdateScope( + NoAwaitTag, google::cloud::gkehub::v1::UpdateScopeRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::UpdateScope(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::DeleteScope( + google::cloud::gkehub::v1::DeleteScopeRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr GkeHubConnection::DeleteScope( + NoAwaitTag, google::cloud::gkehub::v1::DeleteScopeRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::DeleteScope(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange GkeHubConnection::ListScopes( + google::cloud::gkehub::v1:: + ListScopesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StreamRange +GkeHubConnection::ListPermittedScopes( + google::cloud::gkehub::v1:: + ListPermittedScopesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +GkeHubConnection::GetMembershipBinding( + google::cloud::gkehub::v1::GetMembershipBindingRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +GkeHubConnection::CreateMembershipBinding( + google::cloud::gkehub::v1::CreateMembershipBindingRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +GkeHubConnection::CreateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::CreateMembershipBinding( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::UpdateMembershipBinding( + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +GkeHubConnection::UpdateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::UpdateMembershipBinding( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::DeleteMembershipBinding( + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +GkeHubConnection::DeleteMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::DeleteMembershipBinding( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +GkeHubConnection::ListMembershipBindings( + google::cloud::gkehub::v1:: + ListMembershipBindingsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +GkeHubConnection::GetMembershipRBACRoleBinding( + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +GkeHubConnection::CreateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +GkeHubConnection::CreateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::CreateMembershipRBACRoleBinding( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::UpdateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +GkeHubConnection::UpdateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::UpdateMembershipRBACRoleBinding( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::DeleteMembershipRBACRoleBinding( + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +GkeHubConnection::DeleteMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +GkeHubConnection::DeleteMembershipRBACRoleBinding( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +GkeHubConnection::ListMembershipRBACRoleBindings( + google::cloud::gkehub::v1:: + ListMembershipRBACRoleBindingsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> +GkeHubConnection::GenerateMembershipRBACRoleBindingYAML( + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + std::shared_ptr MakeGkeHubConnection(Options options) { internal::CheckExpectedOptions -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -185,6 +185,10 @@ class GkeHubConnection { virtual StreamRange ListMemberships( google::cloud::gkehub::v1::ListMembershipsRequest request); + virtual StreamRange + ListBoundMemberships( + google::cloud::gkehub::v1::ListBoundMembershipsRequest request); + virtual StreamRange ListFeatures( google::cloud::gkehub::v1::ListFeaturesRequest request); @@ -260,6 +264,262 @@ class GkeHubConnection { virtual StatusOr GenerateConnectManifest( google::cloud::gkehub::v1::GenerateConnectManifestRequest const& request); + + virtual future> CreateFleet( + google::cloud::gkehub::v1::CreateFleetRequest const& request); + + virtual StatusOr CreateFleet( + NoAwaitTag, google::cloud::gkehub::v1::CreateFleetRequest const& request); + + virtual future> CreateFleet( + google::longrunning::Operation const& operation); + + virtual StatusOr GetFleet( + google::cloud::gkehub::v1::GetFleetRequest const& request); + + virtual future> UpdateFleet( + google::cloud::gkehub::v1::UpdateFleetRequest const& request); + + virtual StatusOr UpdateFleet( + NoAwaitTag, google::cloud::gkehub::v1::UpdateFleetRequest const& request); + + virtual future> UpdateFleet( + google::longrunning::Operation const& operation); + + virtual future> + DeleteFleet(google::cloud::gkehub::v1::DeleteFleetRequest const& request); + + virtual StatusOr DeleteFleet( + NoAwaitTag, google::cloud::gkehub::v1::DeleteFleetRequest const& request); + + virtual future> + DeleteFleet(google::longrunning::Operation const& operation); + + virtual StreamRange ListFleets( + google::cloud::gkehub::v1::ListFleetsRequest request); + + virtual StatusOr GetScopeNamespace( + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request); + + virtual future> + CreateScopeNamespace( + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request); + + virtual StatusOr CreateScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request); + + virtual future> + CreateScopeNamespace(google::longrunning::Operation const& operation); + + virtual future> + UpdateScopeNamespace( + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request); + + virtual StatusOr UpdateScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request); + + virtual future> + UpdateScopeNamespace(google::longrunning::Operation const& operation); + + virtual future> + DeleteScopeNamespace( + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request); + + virtual StatusOr DeleteScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request); + + virtual future> + DeleteScopeNamespace(google::longrunning::Operation const& operation); + + virtual StreamRange ListScopeNamespaces( + google::cloud::gkehub::v1::ListScopeNamespacesRequest request); + + virtual StatusOr + GetScopeRBACRoleBinding( + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request); + + virtual future> + CreateScopeRBACRoleBinding( + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request); + + virtual StatusOr CreateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request); + + virtual future> + CreateScopeRBACRoleBinding(google::longrunning::Operation const& operation); + + virtual future> + UpdateScopeRBACRoleBinding( + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request); + + virtual StatusOr UpdateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request); + + virtual future> + UpdateScopeRBACRoleBinding(google::longrunning::Operation const& operation); + + virtual future> + DeleteScopeRBACRoleBinding( + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request); + + virtual StatusOr DeleteScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request); + + virtual future> + DeleteScopeRBACRoleBinding(google::longrunning::Operation const& operation); + + virtual StreamRange + ListScopeRBACRoleBindings( + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest request); + + virtual StatusOr GetScope( + google::cloud::gkehub::v1::GetScopeRequest const& request); + + virtual future> CreateScope( + google::cloud::gkehub::v1::CreateScopeRequest const& request); + + virtual StatusOr CreateScope( + NoAwaitTag, google::cloud::gkehub::v1::CreateScopeRequest const& request); + + virtual future> CreateScope( + google::longrunning::Operation const& operation); + + virtual future> UpdateScope( + google::cloud::gkehub::v1::UpdateScopeRequest const& request); + + virtual StatusOr UpdateScope( + NoAwaitTag, google::cloud::gkehub::v1::UpdateScopeRequest const& request); + + virtual future> UpdateScope( + google::longrunning::Operation const& operation); + + virtual future> + DeleteScope(google::cloud::gkehub::v1::DeleteScopeRequest const& request); + + virtual StatusOr DeleteScope( + NoAwaitTag, google::cloud::gkehub::v1::DeleteScopeRequest const& request); + + virtual future> + DeleteScope(google::longrunning::Operation const& operation); + + virtual StreamRange ListScopes( + google::cloud::gkehub::v1::ListScopesRequest request); + + virtual StreamRange ListPermittedScopes( + google::cloud::gkehub::v1::ListPermittedScopesRequest request); + + virtual StatusOr + GetMembershipBinding( + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request); + + virtual future> + CreateMembershipBinding( + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request); + + virtual StatusOr CreateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request); + + virtual future> + CreateMembershipBinding(google::longrunning::Operation const& operation); + + virtual future> + UpdateMembershipBinding( + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request); + + virtual StatusOr UpdateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request); + + virtual future> + UpdateMembershipBinding(google::longrunning::Operation const& operation); + + virtual future> + DeleteMembershipBinding( + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request); + + virtual StatusOr DeleteMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request); + + virtual future> + DeleteMembershipBinding(google::longrunning::Operation const& operation); + + virtual StreamRange + ListMembershipBindings( + google::cloud::gkehub::v1::ListMembershipBindingsRequest request); + + virtual StatusOr + GetMembershipRBACRoleBinding( + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request); + + virtual future> + CreateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request); + + virtual StatusOr + CreateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request); + + virtual future> + CreateMembershipRBACRoleBinding( + google::longrunning::Operation const& operation); + + virtual future> + UpdateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request); + + virtual StatusOr + UpdateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request); + + virtual future> + UpdateMembershipRBACRoleBinding( + google::longrunning::Operation const& operation); + + virtual future> + DeleteMembershipRBACRoleBinding( + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request); + + virtual StatusOr + DeleteMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request); + + virtual future> + DeleteMembershipRBACRoleBinding( + google::longrunning::Operation const& operation); + + virtual StreamRange + ListMembershipRBACRoleBindings( + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest request); + + virtual StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> + GenerateMembershipRBACRoleBindingYAML( + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request); }; /** diff --git a/google/cloud/gkehub/v1/gke_hub_connection_idempotency_policy.cc b/google/cloud/gkehub/v1/gke_hub_connection_idempotency_policy.cc index 51a24b1d148a6..839d926c3c9f2 100644 --- a/google/cloud/gkehub/v1/gke_hub_connection_idempotency_policy.cc +++ b/google/cloud/gkehub/v1/gke_hub_connection_idempotency_policy.cc @@ -39,6 +39,11 @@ Idempotency GkeHubConnectionIdempotencyPolicy::ListMemberships( return Idempotency::kIdempotent; } +Idempotency GkeHubConnectionIdempotencyPolicy::ListBoundMemberships( + google::cloud::gkehub::v1::ListBoundMembershipsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + Idempotency GkeHubConnectionIdempotencyPolicy::ListFeatures( google::cloud::gkehub::v1::ListFeaturesRequest) { // NOLINT return Idempotency::kIdempotent; @@ -89,6 +94,169 @@ Idempotency GkeHubConnectionIdempotencyPolicy::GenerateConnectManifest( return Idempotency::kIdempotent; } +Idempotency GkeHubConnectionIdempotencyPolicy::CreateFleet( + google::cloud::gkehub::v1::CreateFleetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::GetFleet( + google::cloud::gkehub::v1::GetFleetRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::UpdateFleet( + google::cloud::gkehub::v1::UpdateFleetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::DeleteFleet( + google::cloud::gkehub::v1::DeleteFleetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::ListFleets( + google::cloud::gkehub::v1::ListFleetsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::GetScopeNamespace( + google::cloud::gkehub::v1::GetScopeNamespaceRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::CreateScopeNamespace( + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::UpdateScopeNamespace( + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::DeleteScopeNamespace( + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::ListScopeNamespaces( + google::cloud::gkehub::v1::ListScopeNamespacesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::GetScopeRBACRoleBinding( + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::CreateScopeRBACRoleBinding( + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::UpdateScopeRBACRoleBinding( + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::DeleteScopeRBACRoleBinding( + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::ListScopeRBACRoleBindings( + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::GetScope( + google::cloud::gkehub::v1::GetScopeRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::CreateScope( + google::cloud::gkehub::v1::CreateScopeRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::UpdateScope( + google::cloud::gkehub::v1::UpdateScopeRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::DeleteScope( + google::cloud::gkehub::v1::DeleteScopeRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::ListScopes( + google::cloud::gkehub::v1::ListScopesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::ListPermittedScopes( + google::cloud::gkehub::v1::ListPermittedScopesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::GetMembershipBinding( + google::cloud::gkehub::v1::GetMembershipBindingRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::CreateMembershipBinding( + google::cloud::gkehub::v1::CreateMembershipBindingRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::UpdateMembershipBinding( + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::DeleteMembershipBinding( + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::ListMembershipBindings( + google::cloud::gkehub::v1::ListMembershipBindingsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::GetMembershipRBACRoleBinding( + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::CreateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::UpdateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::DeleteMembershipRBACRoleBinding( + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency GkeHubConnectionIdempotencyPolicy::ListMembershipRBACRoleBindings( + google::cloud::gkehub::v1:: + ListMembershipRBACRoleBindingsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency +GkeHubConnectionIdempotencyPolicy::GenerateMembershipRBACRoleBindingYAML( + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const&) { + return Idempotency::kNonIdempotent; +} + std::unique_ptr MakeDefaultGkeHubConnectionIdempotencyPolicy() { return std::make_unique(); diff --git a/google/cloud/gkehub/v1/gke_hub_connection_idempotency_policy.h b/google/cloud/gkehub/v1/gke_hub_connection_idempotency_policy.h index 52ca8fd282b8b..8376d394d3fc5 100644 --- a/google/cloud/gkehub/v1/gke_hub_connection_idempotency_policy.h +++ b/google/cloud/gkehub/v1/gke_hub_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_V1_GKE_HUB_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_V1_GKE_HUB_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/gkehub/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { @@ -39,6 +39,9 @@ class GkeHubConnectionIdempotencyPolicy { virtual google::cloud::Idempotency ListMemberships( google::cloud::gkehub::v1::ListMembershipsRequest request); + virtual google::cloud::Idempotency ListBoundMemberships( + google::cloud::gkehub::v1::ListBoundMembershipsRequest request); + virtual google::cloud::Idempotency ListFeatures( google::cloud::gkehub::v1::ListFeaturesRequest request); @@ -68,6 +71,110 @@ class GkeHubConnectionIdempotencyPolicy { virtual google::cloud::Idempotency GenerateConnectManifest( google::cloud::gkehub::v1::GenerateConnectManifestRequest const& request); + + virtual google::cloud::Idempotency CreateFleet( + google::cloud::gkehub::v1::CreateFleetRequest const& request); + + virtual google::cloud::Idempotency GetFleet( + google::cloud::gkehub::v1::GetFleetRequest const& request); + + virtual google::cloud::Idempotency UpdateFleet( + google::cloud::gkehub::v1::UpdateFleetRequest const& request); + + virtual google::cloud::Idempotency DeleteFleet( + google::cloud::gkehub::v1::DeleteFleetRequest const& request); + + virtual google::cloud::Idempotency ListFleets( + google::cloud::gkehub::v1::ListFleetsRequest request); + + virtual google::cloud::Idempotency GetScopeNamespace( + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request); + + virtual google::cloud::Idempotency CreateScopeNamespace( + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request); + + virtual google::cloud::Idempotency UpdateScopeNamespace( + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request); + + virtual google::cloud::Idempotency DeleteScopeNamespace( + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request); + + virtual google::cloud::Idempotency ListScopeNamespaces( + google::cloud::gkehub::v1::ListScopeNamespacesRequest request); + + virtual google::cloud::Idempotency GetScopeRBACRoleBinding( + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request); + + virtual google::cloud::Idempotency CreateScopeRBACRoleBinding( + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request); + + virtual google::cloud::Idempotency UpdateScopeRBACRoleBinding( + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request); + + virtual google::cloud::Idempotency DeleteScopeRBACRoleBinding( + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request); + + virtual google::cloud::Idempotency ListScopeRBACRoleBindings( + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest request); + + virtual google::cloud::Idempotency GetScope( + google::cloud::gkehub::v1::GetScopeRequest const& request); + + virtual google::cloud::Idempotency CreateScope( + google::cloud::gkehub::v1::CreateScopeRequest const& request); + + virtual google::cloud::Idempotency UpdateScope( + google::cloud::gkehub::v1::UpdateScopeRequest const& request); + + virtual google::cloud::Idempotency DeleteScope( + google::cloud::gkehub::v1::DeleteScopeRequest const& request); + + virtual google::cloud::Idempotency ListScopes( + google::cloud::gkehub::v1::ListScopesRequest request); + + virtual google::cloud::Idempotency ListPermittedScopes( + google::cloud::gkehub::v1::ListPermittedScopesRequest request); + + virtual google::cloud::Idempotency GetMembershipBinding( + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request); + + virtual google::cloud::Idempotency CreateMembershipBinding( + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request); + + virtual google::cloud::Idempotency UpdateMembershipBinding( + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request); + + virtual google::cloud::Idempotency DeleteMembershipBinding( + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request); + + virtual google::cloud::Idempotency ListMembershipBindings( + google::cloud::gkehub::v1::ListMembershipBindingsRequest request); + + virtual google::cloud::Idempotency GetMembershipRBACRoleBinding( + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request); + + virtual google::cloud::Idempotency CreateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request); + + virtual google::cloud::Idempotency UpdateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request); + + virtual google::cloud::Idempotency DeleteMembershipRBACRoleBinding( + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request); + + virtual google::cloud::Idempotency ListMembershipRBACRoleBindings( + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest request); + + virtual google::cloud::Idempotency GenerateMembershipRBACRoleBindingYAML( + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request); }; std::unique_ptr diff --git a/google/cloud/gkehub/v1/internal/gke_hub_auth_decorator.cc b/google/cloud/gkehub/v1/internal/gke_hub_auth_decorator.cc index 30151da6d361c..78c09341a9d73 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_auth_decorator.cc +++ b/google/cloud/gkehub/v1/internal/gke_hub_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/gkehub/v1/service.proto #include "google/cloud/gkehub/v1/internal/gke_hub_auth_decorator.h" -#include +#include "google/cloud/gkehub/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkehub_v1_internal { @@ -40,6 +43,15 @@ GkeHubAuth::ListMemberships( return child_->ListMemberships(context, options, request); } +StatusOr +GkeHubAuth::ListBoundMemberships( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListBoundMembershipsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListBoundMemberships(context, options, request); +} + StatusOr GkeHubAuth::ListFeatures( grpc::ClientContext& context, Options const& options, @@ -239,6 +251,646 @@ GkeHubAuth::GenerateConnectManifest( return child_->GenerateConnectManifest(context, options, request); } +future> GkeHubAuth::AsyncCreateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateFleetRequest 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->AsyncCreateFleet(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr GkeHubAuth::CreateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateFleet(context, options, request); +} + +StatusOr GkeHubAuth::GetFleet( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetFleetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetFleet(context, options, request); +} + +future> GkeHubAuth::AsyncUpdateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateFleetRequest 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->AsyncUpdateFleet(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr GkeHubAuth::UpdateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateFleet(context, options, request); +} + +future> GkeHubAuth::AsyncDeleteFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteFleetRequest 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->AsyncDeleteFleet(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr GkeHubAuth::DeleteFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteFleet(context, options, request); +} + +StatusOr GkeHubAuth::ListFleets( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListFleetsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListFleets(context, options, request); +} + +StatusOr GkeHubAuth::GetScopeNamespace( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetScopeNamespace(context, options, request); +} + +future> +GkeHubAuth::AsyncCreateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest 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->AsyncCreateScopeNamespace(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr GkeHubAuth::CreateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateScopeNamespace(context, options, request); +} + +future> +GkeHubAuth::AsyncUpdateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest 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->AsyncUpdateScopeNamespace(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr GkeHubAuth::UpdateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateScopeNamespace(context, options, request); +} + +future> +GkeHubAuth::AsyncDeleteScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest 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->AsyncDeleteScopeNamespace(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr GkeHubAuth::DeleteScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteScopeNamespace(context, options, request); +} + +StatusOr +GkeHubAuth::ListScopeNamespaces( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeNamespacesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListScopeNamespaces(context, options, request); +} + +StatusOr +GkeHubAuth::GetScopeRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetScopeRBACRoleBinding(context, options, request); +} + +future> +GkeHubAuth::AsyncCreateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest 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->AsyncCreateScopeRBACRoleBinding( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr GkeHubAuth::CreateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateScopeRBACRoleBinding(context, options, request); +} + +future> +GkeHubAuth::AsyncUpdateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest 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->AsyncUpdateScopeRBACRoleBinding( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr GkeHubAuth::UpdateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateScopeRBACRoleBinding(context, options, request); +} + +future> +GkeHubAuth::AsyncDeleteScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest 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->AsyncDeleteScopeRBACRoleBinding( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr GkeHubAuth::DeleteScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteScopeRBACRoleBinding(context, options, request); +} + +StatusOr +GkeHubAuth::ListScopeRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListScopeRBACRoleBindings(context, options, request); +} + +StatusOr GkeHubAuth::GetScope( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetScope(context, options, request); +} + +future> GkeHubAuth::AsyncCreateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRequest 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->AsyncCreateScope(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr GkeHubAuth::CreateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateScope(context, options, request); +} + +future> GkeHubAuth::AsyncUpdateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRequest 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->AsyncUpdateScope(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr GkeHubAuth::UpdateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateScope(context, options, request); +} + +future> GkeHubAuth::AsyncDeleteScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRequest 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->AsyncDeleteScope(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr GkeHubAuth::DeleteScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteScope(context, options, request); +} + +StatusOr GkeHubAuth::ListScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListScopes(context, options, request); +} + +StatusOr +GkeHubAuth::ListPermittedScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListPermittedScopesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListPermittedScopes(context, options, request); +} + +StatusOr +GkeHubAuth::GetMembershipBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetMembershipBinding(context, options, request); +} + +future> +GkeHubAuth::AsyncCreateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest 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->AsyncCreateMembershipBinding(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr GkeHubAuth::CreateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateMembershipBinding(context, options, request); +} + +future> +GkeHubAuth::AsyncUpdateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest 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->AsyncUpdateMembershipBinding(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr GkeHubAuth::UpdateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateMembershipBinding(context, options, request); +} + +future> +GkeHubAuth::AsyncDeleteMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest 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->AsyncDeleteMembershipBinding(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr GkeHubAuth::DeleteMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteMembershipBinding(context, options, request); +} + +StatusOr +GkeHubAuth::ListMembershipBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipBindingsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListMembershipBindings(context, options, request); +} + +StatusOr +GkeHubAuth::GetMembershipRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetMembershipRBACRoleBinding(context, options, request); +} + +future> +GkeHubAuth::AsyncCreateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest 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->AsyncCreateMembershipRBACRoleBinding( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +GkeHubAuth::CreateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateMembershipRBACRoleBinding(context, options, request); +} + +future> +GkeHubAuth::AsyncUpdateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest 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->AsyncUpdateMembershipRBACRoleBinding( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +GkeHubAuth::UpdateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateMembershipRBACRoleBinding(context, options, request); +} + +future> +GkeHubAuth::AsyncDeleteMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest 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->AsyncDeleteMembershipRBACRoleBinding( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +GkeHubAuth::DeleteMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteMembershipRBACRoleBinding(context, options, request); +} + +StatusOr +GkeHubAuth::ListMembershipRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListMembershipRBACRoleBindings(context, options, request); +} + +StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> +GkeHubAuth::GenerateMembershipRBACRoleBindingYAML( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GenerateMembershipRBACRoleBindingYAML(context, options, + request); +} + future> GkeHubAuth::AsyncGetOperation( google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -278,3 +930,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkehub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkehub/v1/internal/gke_hub_auth_decorator.h b/google/cloud/gkehub/v1/internal/gke_hub_auth_decorator.h index d8c6cee5ed743..95013289020b1 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_auth_decorator.h +++ b/google/cloud/gkehub/v1/internal/gke_hub_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkehub/v1/internal/gke_hub_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 gkehub_v1_internal { @@ -44,6 +47,12 @@ class GkeHubAuth : public GkeHubStub { google::cloud::gkehub::v1::ListMembershipsRequest const& request) override; + StatusOr + ListBoundMemberships( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListBoundMembershipsRequest const& request) + override; + StatusOr ListFeatures( grpc::ClientContext& context, Options const& options, google::cloud::gkehub::v1::ListFeaturesRequest const& request) override; @@ -128,6 +137,290 @@ class GkeHubAuth : public GkeHubStub { google::cloud::gkehub::v1::GenerateConnectManifestRequest const& request) override; + future> AsyncCreateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) override; + + StatusOr CreateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) override; + + StatusOr GetFleet( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetFleetRequest const& request) override; + + future> AsyncUpdateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) override; + + StatusOr UpdateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) override; + + future> AsyncDeleteFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) override; + + StatusOr DeleteFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) override; + + StatusOr ListFleets( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListFleetsRequest const& request) override; + + StatusOr GetScopeNamespace( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) + override; + + future> AsyncCreateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) + override; + + StatusOr CreateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) + override; + + future> AsyncUpdateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) + override; + + StatusOr UpdateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) + override; + + future> AsyncDeleteScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) + override; + + StatusOr DeleteScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) + override; + + StatusOr + ListScopeNamespaces( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeNamespacesRequest const& request) + override; + + StatusOr GetScopeRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request) + override; + + future> + AsyncCreateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) override; + + StatusOr CreateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) override; + + future> + AsyncUpdateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) override; + + StatusOr UpdateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) override; + + future> + AsyncDeleteScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) override; + + StatusOr DeleteScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) override; + + StatusOr + ListScopeRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest const& + request) override; + + StatusOr GetScope( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRequest const& request) override; + + future> AsyncCreateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) override; + + StatusOr CreateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) override; + + future> AsyncUpdateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) override; + + StatusOr UpdateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) override; + + future> AsyncDeleteScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) override; + + StatusOr DeleteScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) override; + + StatusOr ListScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopesRequest const& request) override; + + StatusOr + ListPermittedScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListPermittedScopesRequest const& request) + override; + + StatusOr GetMembershipBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request) + override; + + future> AsyncCreateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) + override; + + StatusOr CreateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) + override; + + future> AsyncUpdateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) + override; + + StatusOr UpdateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) + override; + + future> AsyncDeleteMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) + override; + + StatusOr DeleteMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) + override; + + StatusOr + ListMembershipBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipBindingsRequest const& request) + override; + + StatusOr + GetMembershipRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncCreateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr CreateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncUpdateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr UpdateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncDeleteMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr DeleteMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr + ListMembershipRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest const& + request) override; + + StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> + GenerateMembershipRBACRoleBindingYAML( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) override; + future> AsyncGetOperation( google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -150,4 +443,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_V1_INTERNAL_GKE_HUB_AUTH_DECORATOR_H diff --git a/google/cloud/gkehub/v1/internal/gke_hub_connection_impl.cc b/google/cloud/gkehub/v1/internal/gke_hub_connection_impl.cc index fa737bf02072f..051b83eecceac 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_connection_impl.cc +++ b/google/cloud/gkehub/v1/internal/gke_hub_connection_impl.cc @@ -96,6 +96,41 @@ GkeHubConnectionImpl::ListMemberships( }); } +StreamRange +GkeHubConnectionImpl::ListBoundMemberships( + google::cloud::gkehub::v1::ListBoundMembershipsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListBoundMemberships(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::gkehub::v1::ListBoundMembershipsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListBoundMembershipsRequest const& + request) { + return stub->ListBoundMemberships(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::gkehub::v1::ListBoundMembershipsResponse r) { + std::vector result( + r.memberships().size()); + auto& messages = *r.mutable_memberships(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + StreamRange GkeHubConnectionImpl::ListFeatures( google::cloud::gkehub::v1::ListFeaturesRequest request) { @@ -711,6 +746,2015 @@ GkeHubConnectionImpl::GenerateConnectManifest( *current, request, __func__); } +future> +GkeHubConnectionImpl::CreateFleet( + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateFleet(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::v1::Fleet>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + return stub->AsyncCreateFleet(cq, 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::gkehub::v1::Fleet>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr GkeHubConnectionImpl::CreateFleet( + NoAwaitTag, google::cloud::gkehub::v1::CreateFleetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateFleet(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + return stub_->CreateFleet(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::CreateFleet( + 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 CreateFleet", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::v1::Fleet>( + 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::gkehub::v1::Fleet>, + polling_policy(*current), __func__); +} + +StatusOr GkeHubConnectionImpl::GetFleet( + google::cloud::gkehub::v1::GetFleetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetFleet(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetFleetRequest const& request) { + return stub_->GetFleet(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::UpdateFleet( + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateFleet(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::v1::Fleet>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + return stub->AsyncUpdateFleet(cq, 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::gkehub::v1::Fleet>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr GkeHubConnectionImpl::UpdateFleet( + NoAwaitTag, google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateFleet(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + return stub_->UpdateFleet(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::UpdateFleet( + 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 UpdateFleet", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::v1::Fleet>( + 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::gkehub::v1::Fleet>, + polling_policy(*current), __func__); +} + +future> +GkeHubConnectionImpl::DeleteFleet( + google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteFleet(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::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::gkehub::v1::DeleteFleetRequest const& request) { + return stub->AsyncDeleteFleet(cq, 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::gkehub::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr GkeHubConnectionImpl::DeleteFleet( + NoAwaitTag, google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteFleet(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + return stub_->DeleteFleet(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::DeleteFleet( + 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 DeleteFleet", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::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::gkehub::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange GkeHubConnectionImpl::ListFleets( + google::cloud::gkehub::v1::ListFleetsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListFleets(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::gkehub::v1::ListFleetsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListFleetsRequest const& request) { + return stub->ListFleets(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::gkehub::v1::ListFleetsResponse r) { + std::vector result(r.fleets().size()); + auto& messages = *r.mutable_fleets(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +GkeHubConnectionImpl::GetScopeNamespace( + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetScopeNamespace(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) { + return stub_->GetScopeNamespace(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::CreateScopeNamespace( + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateScopeNamespace(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::v1::Namespace>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& + request) { + return stub->AsyncCreateScopeNamespace(cq, 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::gkehub::v1::Namespace>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +GkeHubConnectionImpl::CreateScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateScopeNamespace(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& + request) { + return stub_->CreateScopeNamespace(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::CreateScopeNamespace( + 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 CreateScopeNamespace", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::v1::Namespace>( + 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::gkehub::v1::Namespace>, + polling_policy(*current), __func__); +} + +future> +GkeHubConnectionImpl::UpdateScopeNamespace( + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateScopeNamespace(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::v1::Namespace>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& + request) { + return stub->AsyncUpdateScopeNamespace(cq, 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::gkehub::v1::Namespace>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +GkeHubConnectionImpl::UpdateScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateScopeNamespace(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& + request) { + return stub_->UpdateScopeNamespace(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::UpdateScopeNamespace( + 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 UpdateScopeNamespace", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::v1::Namespace>( + 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::gkehub::v1::Namespace>, + polling_policy(*current), __func__); +} + +future> +GkeHubConnectionImpl::DeleteScopeNamespace( + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteScopeNamespace(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::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::gkehub::v1::DeleteScopeNamespaceRequest const& + request) { + return stub->AsyncDeleteScopeNamespace(cq, 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::gkehub::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +GkeHubConnectionImpl::DeleteScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteScopeNamespace(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& + request) { + return stub_->DeleteScopeNamespace(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::DeleteScopeNamespace( + 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 DeleteScopeNamespace", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::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::gkehub::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +GkeHubConnectionImpl::ListScopeNamespaces( + google::cloud::gkehub::v1::ListScopeNamespacesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListScopeNamespaces(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::gkehub::v1::ListScopeNamespacesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeNamespacesRequest const& + request) { + return stub->ListScopeNamespaces(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::gkehub::v1::ListScopeNamespacesResponse r) { + std::vector result( + r.scope_namespaces().size()); + auto& messages = *r.mutable_scope_namespaces(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +GkeHubConnectionImpl::GetScopeRBACRoleBinding( + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetScopeRBACRoleBinding(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& + request) { + return stub_->GetScopeRBACRoleBinding(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::CreateScopeRBACRoleBinding( + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateScopeRBACRoleBinding(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::v1::RBACRoleBinding>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + return stub->AsyncCreateScopeRBACRoleBinding( + cq, 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::gkehub::v1::RBACRoleBinding>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +GkeHubConnectionImpl::CreateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateScopeRBACRoleBinding(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + return stub_->CreateScopeRBACRoleBinding(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::CreateScopeRBACRoleBinding( + 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 CreateScopeRBACRoleBinding", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::v1::RBACRoleBinding>( + 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::gkehub::v1::RBACRoleBinding>, + polling_policy(*current), __func__); +} + +future> +GkeHubConnectionImpl::UpdateScopeRBACRoleBinding( + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateScopeRBACRoleBinding(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::v1::RBACRoleBinding>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + return stub->AsyncUpdateScopeRBACRoleBinding( + cq, 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::gkehub::v1::RBACRoleBinding>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +GkeHubConnectionImpl::UpdateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateScopeRBACRoleBinding(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + return stub_->UpdateScopeRBACRoleBinding(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::UpdateScopeRBACRoleBinding( + 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 UpdateScopeRBACRoleBinding", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::v1::RBACRoleBinding>( + 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::gkehub::v1::RBACRoleBinding>, + polling_policy(*current), __func__); +} + +future> +GkeHubConnectionImpl::DeleteScopeRBACRoleBinding( + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteScopeRBACRoleBinding(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::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::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + return stub->AsyncDeleteScopeRBACRoleBinding( + cq, 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::gkehub::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +GkeHubConnectionImpl::DeleteScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteScopeRBACRoleBinding(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + return stub_->DeleteScopeRBACRoleBinding(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::DeleteScopeRBACRoleBinding( + 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 DeleteScopeRBACRoleBinding", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::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::gkehub::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +GkeHubConnectionImpl::ListScopeRBACRoleBindings( + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListScopeRBACRoleBindings(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::gkehub::v1::ListScopeRBACRoleBindingsRequest const& + r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + ListScopeRBACRoleBindingsRequest const& request) { + return stub->ListScopeRBACRoleBindings(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::gkehub::v1::ListScopeRBACRoleBindingsResponse r) { + std::vector result( + r.rbacrolebindings().size()); + auto& messages = *r.mutable_rbacrolebindings(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr GkeHubConnectionImpl::GetScope( + google::cloud::gkehub::v1::GetScopeRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetScope(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRequest const& request) { + return stub_->GetScope(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::CreateScope( + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateScope(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::v1::Scope>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + return stub->AsyncCreateScope(cq, 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::gkehub::v1::Scope>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr GkeHubConnectionImpl::CreateScope( + NoAwaitTag, google::cloud::gkehub::v1::CreateScopeRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateScope(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + return stub_->CreateScope(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::CreateScope( + 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 CreateScope", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::v1::Scope>( + 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::gkehub::v1::Scope>, + polling_policy(*current), __func__); +} + +future> +GkeHubConnectionImpl::UpdateScope( + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateScope(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::v1::Scope>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + return stub->AsyncUpdateScope(cq, 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::gkehub::v1::Scope>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr GkeHubConnectionImpl::UpdateScope( + NoAwaitTag, google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateScope(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + return stub_->UpdateScope(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::UpdateScope( + 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 UpdateScope", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::v1::Scope>( + 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::gkehub::v1::Scope>, + polling_policy(*current), __func__); +} + +future> +GkeHubConnectionImpl::DeleteScope( + google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteScope(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::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::gkehub::v1::DeleteScopeRequest const& request) { + return stub->AsyncDeleteScope(cq, 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::gkehub::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr GkeHubConnectionImpl::DeleteScope( + NoAwaitTag, google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteScope(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + return stub_->DeleteScope(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::DeleteScope( + 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 DeleteScope", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::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::gkehub::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange GkeHubConnectionImpl::ListScopes( + google::cloud::gkehub::v1::ListScopesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListScopes(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::gkehub::v1::ListScopesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopesRequest const& request) { + return stub->ListScopes(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::gkehub::v1::ListScopesResponse r) { + std::vector result(r.scopes().size()); + auto& messages = *r.mutable_scopes(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StreamRange +GkeHubConnectionImpl::ListPermittedScopes( + google::cloud::gkehub::v1::ListPermittedScopesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListPermittedScopes(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::gkehub::v1::ListPermittedScopesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListPermittedScopesRequest const& + request) { + return stub->ListPermittedScopes(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::gkehub::v1::ListPermittedScopesResponse r) { + std::vector result(r.scopes().size()); + auto& messages = *r.mutable_scopes(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +GkeHubConnectionImpl::GetMembershipBinding( + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetMembershipBinding(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipBindingRequest const& + request) { + return stub_->GetMembershipBinding(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::CreateMembershipBinding( + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateMembershipBinding(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::v1::MembershipBinding>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& + request) { + return stub->AsyncCreateMembershipBinding(cq, 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::gkehub::v1::MembershipBinding>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +GkeHubConnectionImpl::CreateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateMembershipBinding(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& + request) { + return stub_->CreateMembershipBinding(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::CreateMembershipBinding( + 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 CreateMembershipBinding", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::v1::MembershipBinding>( + 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::gkehub::v1::MembershipBinding>, + polling_policy(*current), __func__); +} + +future> +GkeHubConnectionImpl::UpdateMembershipBinding( + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateMembershipBinding(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::v1::MembershipBinding>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& + request) { + return stub->AsyncUpdateMembershipBinding(cq, 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::gkehub::v1::MembershipBinding>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +GkeHubConnectionImpl::UpdateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateMembershipBinding(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& + request) { + return stub_->UpdateMembershipBinding(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::UpdateMembershipBinding( + 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 UpdateMembershipBinding", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::v1::MembershipBinding>( + 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::gkehub::v1::MembershipBinding>, + polling_policy(*current), __func__); +} + +future> +GkeHubConnectionImpl::DeleteMembershipBinding( + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteMembershipBinding(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::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::gkehub::v1::DeleteMembershipBindingRequest const& + request) { + return stub->AsyncDeleteMembershipBinding(cq, 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::gkehub::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +GkeHubConnectionImpl::DeleteMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteMembershipBinding(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& + request) { + return stub_->DeleteMembershipBinding(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::DeleteMembershipBinding( + 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 DeleteMembershipBinding", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::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::gkehub::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +GkeHubConnectionImpl::ListMembershipBindings( + google::cloud::gkehub::v1::ListMembershipBindingsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListMembershipBindings(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::gkehub::v1::ListMembershipBindingsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipBindingsRequest const& + request) { + return stub->ListMembershipBindings(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::gkehub::v1::ListMembershipBindingsResponse r) { + std::vector result( + r.membership_bindings().size()); + auto& messages = *r.mutable_membership_bindings(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +GkeHubConnectionImpl::GetMembershipRBACRoleBinding( + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetMembershipRBACRoleBinding(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) { + return stub_->GetMembershipRBACRoleBinding(context, options, request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::CreateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateMembershipRBACRoleBinding( + request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::v1::RBACRoleBinding>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1:: + CreateMembershipRBACRoleBindingRequest const& request) { + return stub->AsyncCreateMembershipRBACRoleBinding( + cq, 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::gkehub::v1::RBACRoleBinding>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +GkeHubConnectionImpl::CreateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateMembershipRBACRoleBinding(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + CreateMembershipRBACRoleBindingRequest const& request) { + return stub_->CreateMembershipRBACRoleBinding(context, options, + request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::CreateMembershipRBACRoleBinding( + 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 CreateMembershipRBACRoleBinding", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::v1::RBACRoleBinding>( + 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::gkehub::v1::RBACRoleBinding>, + polling_policy(*current), __func__); +} + +future> +GkeHubConnectionImpl::UpdateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateMembershipRBACRoleBinding( + request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::v1::RBACRoleBinding>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1:: + UpdateMembershipRBACRoleBindingRequest const& request) { + return stub->AsyncUpdateMembershipRBACRoleBinding( + cq, 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::gkehub::v1::RBACRoleBinding>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +GkeHubConnectionImpl::UpdateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateMembershipRBACRoleBinding(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + UpdateMembershipRBACRoleBindingRequest const& request) { + return stub_->UpdateMembershipRBACRoleBinding(context, options, + request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::UpdateMembershipRBACRoleBinding( + 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 UpdateMembershipRBACRoleBinding", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::v1::RBACRoleBinding>( + 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::gkehub::v1::RBACRoleBinding>, + polling_policy(*current), __func__); +} + +future> +GkeHubConnectionImpl::DeleteMembershipRBACRoleBinding( + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteMembershipRBACRoleBinding( + request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::gkehub::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::gkehub::v1:: + DeleteMembershipRBACRoleBindingRequest const& request) { + return stub->AsyncDeleteMembershipRBACRoleBinding( + cq, 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::gkehub::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +GkeHubConnectionImpl::DeleteMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteMembershipRBACRoleBinding(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + DeleteMembershipRBACRoleBindingRequest const& request) { + return stub_->DeleteMembershipRBACRoleBinding(context, options, + request); + }, + *current, request, __func__); +} + +future> +GkeHubConnectionImpl::DeleteMembershipRBACRoleBinding( + 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 DeleteMembershipRBACRoleBinding", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::gkehub::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::gkehub::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +GkeHubConnectionImpl::ListMembershipRBACRoleBindings( + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListMembershipRBACRoleBindings(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::gkehub::v1:: + ListMembershipRBACRoleBindingsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + ListMembershipRBACRoleBindingsRequest const& request) { + return stub->ListMembershipRBACRoleBindings(context, options, + request); + }, + options, r, function_name); + }, + [](google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsResponse r) { + std::vector result( + r.rbacrolebindings().size()); + auto& messages = *r.mutable_rbacrolebindings(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> +GkeHubConnectionImpl::GenerateMembershipRBACRoleBindingYAML( + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GenerateMembershipRBACRoleBindingYAML( + request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) { + return stub_->GenerateMembershipRBACRoleBindingYAML(context, options, + request); + }, + *current, request, __func__); +} + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkehub_v1_internal } // namespace cloud diff --git a/google/cloud/gkehub/v1/internal/gke_hub_connection_impl.h b/google/cloud/gkehub/v1/internal/gke_hub_connection_impl.h index bcb6f9314c17c..44f55815e461b 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_connection_impl.h +++ b/google/cloud/gkehub/v1/internal/gke_hub_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -53,6 +53,9 @@ class GkeHubConnectionImpl : public gkehub_v1::GkeHubConnection { StreamRange ListMemberships( google::cloud::gkehub::v1::ListMembershipsRequest request) override; + StreamRange ListBoundMemberships( + google::cloud::gkehub::v1::ListBoundMembershipsRequest request) override; + StreamRange ListFeatures( google::cloud::gkehub::v1::ListFeaturesRequest request) override; @@ -133,6 +136,286 @@ class GkeHubConnectionImpl : public gkehub_v1::GkeHubConnection { google::cloud::gkehub::v1::GenerateConnectManifestRequest const& request) override; + future> CreateFleet( + google::cloud::gkehub::v1::CreateFleetRequest const& request) override; + + StatusOr CreateFleet( + NoAwaitTag, + google::cloud::gkehub::v1::CreateFleetRequest const& request) override; + + future> CreateFleet( + google::longrunning::Operation const& operation) override; + + StatusOr GetFleet( + google::cloud::gkehub::v1::GetFleetRequest const& request) override; + + future> UpdateFleet( + google::cloud::gkehub::v1::UpdateFleetRequest const& request) override; + + StatusOr UpdateFleet( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) override; + + future> UpdateFleet( + google::longrunning::Operation const& operation) override; + + future> DeleteFleet( + google::cloud::gkehub::v1::DeleteFleetRequest const& request) override; + + StatusOr DeleteFleet( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) override; + + future> DeleteFleet( + google::longrunning::Operation const& operation) override; + + StreamRange ListFleets( + google::cloud::gkehub::v1::ListFleetsRequest request) override; + + StatusOr GetScopeNamespace( + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) + override; + + future> CreateScopeNamespace( + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) + override; + + StatusOr CreateScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) + override; + + future> CreateScopeNamespace( + google::longrunning::Operation const& operation) override; + + future> UpdateScopeNamespace( + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) + override; + + StatusOr UpdateScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) + override; + + future> UpdateScopeNamespace( + google::longrunning::Operation const& operation) override; + + future> + DeleteScopeNamespace( + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) + override; + + StatusOr DeleteScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) + override; + + future> + DeleteScopeNamespace( + google::longrunning::Operation const& operation) override; + + StreamRange ListScopeNamespaces( + google::cloud::gkehub::v1::ListScopeNamespacesRequest request) override; + + StatusOr GetScopeRBACRoleBinding( + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request) + override; + + future> + CreateScopeRBACRoleBinding( + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) override; + + StatusOr CreateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) override; + + future> + CreateScopeRBACRoleBinding( + google::longrunning::Operation const& operation) override; + + future> + UpdateScopeRBACRoleBinding( + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) override; + + StatusOr UpdateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) override; + + future> + UpdateScopeRBACRoleBinding( + google::longrunning::Operation const& operation) override; + + future> + DeleteScopeRBACRoleBinding( + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) override; + + StatusOr DeleteScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) override; + + future> + DeleteScopeRBACRoleBinding( + google::longrunning::Operation const& operation) override; + + StreamRange + ListScopeRBACRoleBindings( + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest request) + override; + + StatusOr GetScope( + google::cloud::gkehub::v1::GetScopeRequest const& request) override; + + future> CreateScope( + google::cloud::gkehub::v1::CreateScopeRequest const& request) override; + + StatusOr CreateScope( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeRequest const& request) override; + + future> CreateScope( + google::longrunning::Operation const& operation) override; + + future> UpdateScope( + google::cloud::gkehub::v1::UpdateScopeRequest const& request) override; + + StatusOr UpdateScope( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) override; + + future> UpdateScope( + google::longrunning::Operation const& operation) override; + + future> DeleteScope( + google::cloud::gkehub::v1::DeleteScopeRequest const& request) override; + + StatusOr DeleteScope( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) override; + + future> DeleteScope( + google::longrunning::Operation const& operation) override; + + StreamRange ListScopes( + google::cloud::gkehub::v1::ListScopesRequest request) override; + + StreamRange ListPermittedScopes( + google::cloud::gkehub::v1::ListPermittedScopesRequest request) override; + + StatusOr GetMembershipBinding( + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request) + override; + + future> + CreateMembershipBinding( + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) + override; + + StatusOr CreateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) + override; + + future> + CreateMembershipBinding( + google::longrunning::Operation const& operation) override; + + future> + UpdateMembershipBinding( + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) + override; + + StatusOr UpdateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) + override; + + future> + UpdateMembershipBinding( + google::longrunning::Operation const& operation) override; + + future> + DeleteMembershipBinding( + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) + override; + + StatusOr DeleteMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) + override; + + future> + DeleteMembershipBinding( + google::longrunning::Operation const& operation) override; + + StreamRange + ListMembershipBindings( + google::cloud::gkehub::v1::ListMembershipBindingsRequest request) + override; + + StatusOr + GetMembershipRBACRoleBinding( + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) override; + + future> + CreateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr CreateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) override; + + future> + CreateMembershipRBACRoleBinding( + google::longrunning::Operation const& operation) override; + + future> + UpdateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr UpdateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) override; + + future> + UpdateMembershipRBACRoleBinding( + google::longrunning::Operation const& operation) override; + + future> + DeleteMembershipRBACRoleBinding( + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr DeleteMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) override; + + future> + DeleteMembershipRBACRoleBinding( + google::longrunning::Operation const& operation) override; + + StreamRange + ListMembershipRBACRoleBindings( + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest request) + override; + + StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> + GenerateMembershipRBACRoleBindingYAML( + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) override; + private: std::unique_ptr background_; std::shared_ptr stub_; diff --git a/google/cloud/gkehub/v1/internal/gke_hub_logging_decorator.cc b/google/cloud/gkehub/v1/internal/gke_hub_logging_decorator.cc index a5ebda98ce7e4..c6c21a346182d 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_logging_decorator.cc +++ b/google/cloud/gkehub/v1/internal/gke_hub_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/gkehub/v1/service.proto #include "google/cloud/gkehub/v1/internal/gke_hub_logging_decorator.h" +#include "google/cloud/gkehub/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkehub_v1_internal { @@ -47,6 +50,19 @@ GkeHubLogging::ListMemberships( context, options, request, __func__, tracing_options_); } +StatusOr +GkeHubLogging::ListBoundMemberships( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListBoundMembershipsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListBoundMembershipsRequest const& + request) { + return child_->ListBoundMemberships(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr GkeHubLogging::ListFeatures( grpc::ClientContext& context, Options const& options, @@ -274,6 +290,756 @@ GkeHubLogging::GenerateConnectManifest( context, options, request, __func__, tracing_options_); } +future> +GkeHubLogging::AsyncCreateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + return child_->AsyncCreateFleet(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr GkeHubLogging::CreateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + return child_->CreateFleet(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr GkeHubLogging::GetFleet( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetFleetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetFleetRequest const& request) { + return child_->GetFleet(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncUpdateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + return child_->AsyncUpdateFleet(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr GkeHubLogging::UpdateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + return child_->UpdateFleet(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncDeleteFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + return child_->AsyncDeleteFleet(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr GkeHubLogging::DeleteFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + return child_->DeleteFleet(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +GkeHubLogging::ListFleets( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListFleetsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListFleetsRequest const& request) { + return child_->ListFleets(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr GkeHubLogging::GetScopeNamespace( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) { + return child_->GetScopeNamespace(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncCreateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& + request) { + return child_->AsyncCreateScopeNamespace(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr GkeHubLogging::CreateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& + request) { + return child_->CreateScopeNamespace(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncUpdateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& + request) { + return child_->AsyncUpdateScopeNamespace(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr GkeHubLogging::UpdateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& + request) { + return child_->UpdateScopeNamespace(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncDeleteScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& + request) { + return child_->AsyncDeleteScopeNamespace(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr GkeHubLogging::DeleteScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& + request) { + return child_->DeleteScopeNamespace(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +GkeHubLogging::ListScopeNamespaces( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeNamespacesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeNamespacesRequest const& + request) { + return child_->ListScopeNamespaces(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +GkeHubLogging::GetScopeRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& + request) { + return child_->GetScopeRBACRoleBinding(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncCreateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + return child_->AsyncCreateScopeRBACRoleBinding( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +GkeHubLogging::CreateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + return child_->CreateScopeRBACRoleBinding(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncUpdateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + return child_->AsyncUpdateScopeRBACRoleBinding( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +GkeHubLogging::UpdateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + return child_->UpdateScopeRBACRoleBinding(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncDeleteScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + return child_->AsyncDeleteScopeRBACRoleBinding( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +GkeHubLogging::DeleteScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + return child_->DeleteScopeRBACRoleBinding(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +GkeHubLogging::ListScopeRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest const& + request) { + return child_->ListScopeRBACRoleBindings(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr GkeHubLogging::GetScope( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRequest const& request) { + return child_->GetScope(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncCreateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + return child_->AsyncCreateScope(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr GkeHubLogging::CreateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + return child_->CreateScope(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncUpdateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + return child_->AsyncUpdateScope(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr GkeHubLogging::UpdateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + return child_->UpdateScope(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncDeleteScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + return child_->AsyncDeleteScope(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr GkeHubLogging::DeleteScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + return child_->DeleteScope(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +GkeHubLogging::ListScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopesRequest const& request) { + return child_->ListScopes(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +GkeHubLogging::ListPermittedScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListPermittedScopesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListPermittedScopesRequest const& + request) { + return child_->ListPermittedScopes(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +GkeHubLogging::GetMembershipBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipBindingRequest const& + request) { + return child_->GetMembershipBinding(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncCreateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& + request) { + return child_->AsyncCreateMembershipBinding( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr GkeHubLogging::CreateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& + request) { + return child_->CreateMembershipBinding(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncUpdateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& + request) { + return child_->AsyncUpdateMembershipBinding( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr GkeHubLogging::UpdateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& + request) { + return child_->UpdateMembershipBinding(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncDeleteMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& + request) { + return child_->AsyncDeleteMembershipBinding( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr GkeHubLogging::DeleteMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& + request) { + return child_->DeleteMembershipBinding(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +GkeHubLogging::ListMembershipBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipBindingsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipBindingsRequest const& + request) { + return child_->ListMembershipBindings(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +GkeHubLogging::GetMembershipRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) { + return child_->GetMembershipRBACRoleBinding(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncCreateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1:: + CreateMembershipRBACRoleBindingRequest const& request) { + return child_->AsyncCreateMembershipRBACRoleBinding( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +GkeHubLogging::CreateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + CreateMembershipRBACRoleBindingRequest const& request) { + return child_->CreateMembershipRBACRoleBinding(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncUpdateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1:: + UpdateMembershipRBACRoleBindingRequest const& request) { + return child_->AsyncUpdateMembershipRBACRoleBinding( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +GkeHubLogging::UpdateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + UpdateMembershipRBACRoleBindingRequest const& request) { + return child_->UpdateMembershipRBACRoleBinding(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +GkeHubLogging::AsyncDeleteMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1:: + DeleteMembershipRBACRoleBindingRequest const& request) { + return child_->AsyncDeleteMembershipRBACRoleBinding( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +GkeHubLogging::DeleteMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + DeleteMembershipRBACRoleBindingRequest const& request) { + return child_->DeleteMembershipRBACRoleBinding(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +GkeHubLogging::ListMembershipRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + ListMembershipRBACRoleBindingsRequest const& request) { + return child_->ListMembershipRBACRoleBindings(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> +GkeHubLogging::GenerateMembershipRBACRoleBindingYAML( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) { + return child_->GenerateMembershipRBACRoleBindingYAML(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + future> GkeHubLogging::AsyncGetOperation( google::cloud::CompletionQueue& cq, @@ -313,3 +1079,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkehub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkehub/v1/internal/gke_hub_logging_decorator.h b/google/cloud/gkehub/v1/internal/gke_hub_logging_decorator.h index a15a9df983385..de59e119102f5 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_logging_decorator.h +++ b/google/cloud/gkehub/v1/internal/gke_hub_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkehub/v1/internal/gke_hub_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 gkehub_v1_internal { @@ -44,6 +47,12 @@ class GkeHubLogging : public GkeHubStub { google::cloud::gkehub::v1::ListMembershipsRequest const& request) override; + StatusOr + ListBoundMemberships( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListBoundMembershipsRequest const& request) + override; + StatusOr ListFeatures( grpc::ClientContext& context, Options const& options, google::cloud::gkehub::v1::ListFeaturesRequest const& request) override; @@ -128,6 +137,290 @@ class GkeHubLogging : public GkeHubStub { google::cloud::gkehub::v1::GenerateConnectManifestRequest const& request) override; + future> AsyncCreateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) override; + + StatusOr CreateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) override; + + StatusOr GetFleet( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetFleetRequest const& request) override; + + future> AsyncUpdateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) override; + + StatusOr UpdateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) override; + + future> AsyncDeleteFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) override; + + StatusOr DeleteFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) override; + + StatusOr ListFleets( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListFleetsRequest const& request) override; + + StatusOr GetScopeNamespace( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) + override; + + future> AsyncCreateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) + override; + + StatusOr CreateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) + override; + + future> AsyncUpdateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) + override; + + StatusOr UpdateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) + override; + + future> AsyncDeleteScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) + override; + + StatusOr DeleteScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) + override; + + StatusOr + ListScopeNamespaces( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeNamespacesRequest const& request) + override; + + StatusOr GetScopeRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request) + override; + + future> + AsyncCreateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) override; + + StatusOr CreateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) override; + + future> + AsyncUpdateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) override; + + StatusOr UpdateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) override; + + future> + AsyncDeleteScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) override; + + StatusOr DeleteScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) override; + + StatusOr + ListScopeRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest const& + request) override; + + StatusOr GetScope( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRequest const& request) override; + + future> AsyncCreateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) override; + + StatusOr CreateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) override; + + future> AsyncUpdateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) override; + + StatusOr UpdateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) override; + + future> AsyncDeleteScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) override; + + StatusOr DeleteScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) override; + + StatusOr ListScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopesRequest const& request) override; + + StatusOr + ListPermittedScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListPermittedScopesRequest const& request) + override; + + StatusOr GetMembershipBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request) + override; + + future> AsyncCreateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) + override; + + StatusOr CreateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) + override; + + future> AsyncUpdateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) + override; + + StatusOr UpdateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) + override; + + future> AsyncDeleteMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) + override; + + StatusOr DeleteMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) + override; + + StatusOr + ListMembershipBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipBindingsRequest const& request) + override; + + StatusOr + GetMembershipRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncCreateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr CreateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncUpdateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr UpdateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncDeleteMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr DeleteMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr + ListMembershipRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest const& + request) override; + + StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> + GenerateMembershipRBACRoleBindingYAML( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) override; + future> AsyncGetOperation( google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -150,4 +443,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_V1_INTERNAL_GKE_HUB_LOGGING_DECORATOR_H diff --git a/google/cloud/gkehub/v1/internal/gke_hub_metadata_decorator.cc b/google/cloud/gkehub/v1/internal/gke_hub_metadata_decorator.cc index e29fda5f0d754..cac607d90a1f2 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_metadata_decorator.cc +++ b/google/cloud/gkehub/v1/internal/gke_hub_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/gkehub/v1/service.proto #include "google/cloud/gkehub/v1/internal/gke_hub_metadata_decorator.h" +#include "google/cloud/gkehub/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 gkehub_v1_internal { @@ -53,6 +57,16 @@ GkeHubMetadata::ListMemberships( return child_->ListMemberships(context, options, request); } +StatusOr +GkeHubMetadata::ListBoundMemberships( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListBoundMembershipsRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("scope_name=", internal::UrlEncode(request.scope_name()))); + return child_->ListBoundMemberships(context, options, request); +} + StatusOr GkeHubMetadata::ListFeatures( grpc::ClientContext& context, Options const& options, @@ -207,6 +221,537 @@ GkeHubMetadata::GenerateConnectManifest( return child_->GenerateConnectManifest(context, options, request); } +future> +GkeHubMetadata::AsyncCreateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateFleet(cq, std::move(context), std::move(options), + request); +} + +StatusOr GkeHubMetadata::CreateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateFleet(context, options, request); +} + +StatusOr GkeHubMetadata::GetFleet( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetFleetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetFleet(context, options, request); +} + +future> +GkeHubMetadata::AsyncUpdateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + SetMetadata( + *context, *options, + absl::StrCat("fleet.name=", internal::UrlEncode(request.fleet().name()))); + return child_->AsyncUpdateFleet(cq, std::move(context), std::move(options), + request); +} + +StatusOr GkeHubMetadata::UpdateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("fleet.name=", internal::UrlEncode(request.fleet().name()))); + return child_->UpdateFleet(context, options, request); +} + +future> +GkeHubMetadata::AsyncDeleteFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteFleet(cq, std::move(context), std::move(options), + request); +} + +StatusOr GkeHubMetadata::DeleteFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteFleet(context, options, request); +} + +StatusOr +GkeHubMetadata::ListFleets( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListFleetsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListFleets(context, options, request); +} + +StatusOr +GkeHubMetadata::GetScopeNamespace( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetScopeNamespace(context, options, request); +} + +future> +GkeHubMetadata::AsyncCreateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateScopeNamespace(cq, std::move(context), + std::move(options), request); +} + +StatusOr GkeHubMetadata::CreateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateScopeNamespace(context, options, request); +} + +future> +GkeHubMetadata::AsyncUpdateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) { + SetMetadata( + *context, *options, + absl::StrCat("scope_namespace.name=", + internal::UrlEncode(request.scope_namespace().name()))); + return child_->AsyncUpdateScopeNamespace(cq, std::move(context), + std::move(options), request); +} + +StatusOr GkeHubMetadata::UpdateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("scope_namespace.name=", + internal::UrlEncode(request.scope_namespace().name()))); + return child_->UpdateScopeNamespace(context, options, request); +} + +future> +GkeHubMetadata::AsyncDeleteScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteScopeNamespace(cq, std::move(context), + std::move(options), request); +} + +StatusOr GkeHubMetadata::DeleteScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteScopeNamespace(context, options, request); +} + +StatusOr +GkeHubMetadata::ListScopeNamespaces( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeNamespacesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListScopeNamespaces(context, options, request); +} + +StatusOr +GkeHubMetadata::GetScopeRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetScopeRBACRoleBinding(context, options, request); +} + +future> +GkeHubMetadata::AsyncCreateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateScopeRBACRoleBinding(cq, std::move(context), + std::move(options), request); +} + +StatusOr +GkeHubMetadata::CreateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateScopeRBACRoleBinding(context, options, request); +} + +future> +GkeHubMetadata::AsyncUpdateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + SetMetadata( + *context, *options, + absl::StrCat("rbacrolebinding.name=", + internal::UrlEncode(request.rbacrolebinding().name()))); + return child_->AsyncUpdateScopeRBACRoleBinding(cq, std::move(context), + std::move(options), request); +} + +StatusOr +GkeHubMetadata::UpdateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + SetMetadata( + context, options, + absl::StrCat("rbacrolebinding.name=", + internal::UrlEncode(request.rbacrolebinding().name()))); + return child_->UpdateScopeRBACRoleBinding(context, options, request); +} + +future> +GkeHubMetadata::AsyncDeleteScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteScopeRBACRoleBinding(cq, std::move(context), + std::move(options), request); +} + +StatusOr +GkeHubMetadata::DeleteScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteScopeRBACRoleBinding(context, options, request); +} + +StatusOr +GkeHubMetadata::ListScopeRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListScopeRBACRoleBindings(context, options, request); +} + +StatusOr GkeHubMetadata::GetScope( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetScope(context, options, request); +} + +future> +GkeHubMetadata::AsyncCreateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateScope(cq, std::move(context), std::move(options), + request); +} + +StatusOr GkeHubMetadata::CreateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateScope(context, options, request); +} + +future> +GkeHubMetadata::AsyncUpdateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + SetMetadata( + *context, *options, + absl::StrCat("scope.name=", internal::UrlEncode(request.scope().name()))); + return child_->AsyncUpdateScope(cq, std::move(context), std::move(options), + request); +} + +StatusOr GkeHubMetadata::UpdateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("scope.name=", internal::UrlEncode(request.scope().name()))); + return child_->UpdateScope(context, options, request); +} + +future> +GkeHubMetadata::AsyncDeleteScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteScope(cq, std::move(context), std::move(options), + request); +} + +StatusOr GkeHubMetadata::DeleteScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteScope(context, options, request); +} + +StatusOr +GkeHubMetadata::ListScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListScopes(context, options, request); +} + +StatusOr +GkeHubMetadata::ListPermittedScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListPermittedScopesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListPermittedScopes(context, options, request); +} + +StatusOr +GkeHubMetadata::GetMembershipBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetMembershipBinding(context, options, request); +} + +future> +GkeHubMetadata::AsyncCreateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateMembershipBinding(cq, std::move(context), + std::move(options), request); +} + +StatusOr +GkeHubMetadata::CreateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateMembershipBinding(context, options, request); +} + +future> +GkeHubMetadata::AsyncUpdateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) { + SetMetadata( + *context, *options, + absl::StrCat("membership_binding.name=", + internal::UrlEncode(request.membership_binding().name()))); + return child_->AsyncUpdateMembershipBinding(cq, std::move(context), + std::move(options), request); +} + +StatusOr +GkeHubMetadata::UpdateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("membership_binding.name=", + internal::UrlEncode(request.membership_binding().name()))); + return child_->UpdateMembershipBinding(context, options, request); +} + +future> +GkeHubMetadata::AsyncDeleteMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteMembershipBinding(cq, std::move(context), + std::move(options), request); +} + +StatusOr +GkeHubMetadata::DeleteMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteMembershipBinding(context, options, request); +} + +StatusOr +GkeHubMetadata::ListMembershipBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipBindingsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListMembershipBindings(context, options, request); +} + +StatusOr +GkeHubMetadata::GetMembershipRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetMembershipRBACRoleBinding(context, options, request); +} + +future> +GkeHubMetadata::AsyncCreateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateMembershipRBACRoleBinding( + cq, std::move(context), std::move(options), request); +} + +StatusOr +GkeHubMetadata::CreateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateMembershipRBACRoleBinding(context, options, request); +} + +future> +GkeHubMetadata::AsyncUpdateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) { + SetMetadata( + *context, *options, + absl::StrCat("rbacrolebinding.name=", + internal::UrlEncode(request.rbacrolebinding().name()))); + return child_->AsyncUpdateMembershipRBACRoleBinding( + cq, std::move(context), std::move(options), request); +} + +StatusOr +GkeHubMetadata::UpdateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) { + SetMetadata( + context, options, + absl::StrCat("rbacrolebinding.name=", + internal::UrlEncode(request.rbacrolebinding().name()))); + return child_->UpdateMembershipRBACRoleBinding(context, options, request); +} + +future> +GkeHubMetadata::AsyncDeleteMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteMembershipRBACRoleBinding( + cq, std::move(context), std::move(options), request); +} + +StatusOr +GkeHubMetadata::DeleteMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteMembershipRBACRoleBinding(context, options, request); +} + +StatusOr +GkeHubMetadata::ListMembershipRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListMembershipRBACRoleBindings(context, options, request); +} + +StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> +GkeHubMetadata::GenerateMembershipRBACRoleBindingYAML( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->GenerateMembershipRBACRoleBindingYAML(context, options, + request); +} + future> GkeHubMetadata::AsyncGetOperation( google::cloud::CompletionQueue& cq, @@ -247,3 +792,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkehub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkehub/v1/internal/gke_hub_metadata_decorator.h b/google/cloud/gkehub/v1/internal/gke_hub_metadata_decorator.h index 89304ca5e359c..73b51c4777215 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_metadata_decorator.h +++ b/google/cloud/gkehub/v1/internal/gke_hub_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkehub/v1/internal/gke_hub_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 gkehub_v1_internal { @@ -44,6 +47,12 @@ class GkeHubMetadata : public GkeHubStub { google::cloud::gkehub::v1::ListMembershipsRequest const& request) override; + StatusOr + ListBoundMemberships( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListBoundMembershipsRequest const& request) + override; + StatusOr ListFeatures( grpc::ClientContext& context, Options const& options, google::cloud::gkehub::v1::ListFeaturesRequest const& request) override; @@ -128,6 +137,290 @@ class GkeHubMetadata : public GkeHubStub { google::cloud::gkehub::v1::GenerateConnectManifestRequest const& request) override; + future> AsyncCreateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) override; + + StatusOr CreateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) override; + + StatusOr GetFleet( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetFleetRequest const& request) override; + + future> AsyncUpdateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) override; + + StatusOr UpdateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) override; + + future> AsyncDeleteFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) override; + + StatusOr DeleteFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) override; + + StatusOr ListFleets( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListFleetsRequest const& request) override; + + StatusOr GetScopeNamespace( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) + override; + + future> AsyncCreateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) + override; + + StatusOr CreateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) + override; + + future> AsyncUpdateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) + override; + + StatusOr UpdateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) + override; + + future> AsyncDeleteScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) + override; + + StatusOr DeleteScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) + override; + + StatusOr + ListScopeNamespaces( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeNamespacesRequest const& request) + override; + + StatusOr GetScopeRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request) + override; + + future> + AsyncCreateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) override; + + StatusOr CreateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) override; + + future> + AsyncUpdateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) override; + + StatusOr UpdateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) override; + + future> + AsyncDeleteScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) override; + + StatusOr DeleteScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) override; + + StatusOr + ListScopeRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest const& + request) override; + + StatusOr GetScope( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRequest const& request) override; + + future> AsyncCreateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) override; + + StatusOr CreateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) override; + + future> AsyncUpdateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) override; + + StatusOr UpdateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) override; + + future> AsyncDeleteScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) override; + + StatusOr DeleteScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) override; + + StatusOr ListScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopesRequest const& request) override; + + StatusOr + ListPermittedScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListPermittedScopesRequest const& request) + override; + + StatusOr GetMembershipBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request) + override; + + future> AsyncCreateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) + override; + + StatusOr CreateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) + override; + + future> AsyncUpdateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) + override; + + StatusOr UpdateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) + override; + + future> AsyncDeleteMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) + override; + + StatusOr DeleteMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) + override; + + StatusOr + ListMembershipBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipBindingsRequest const& request) + override; + + StatusOr + GetMembershipRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncCreateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr CreateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncUpdateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr UpdateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncDeleteMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr DeleteMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr + ListMembershipRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest const& + request) override; + + StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> + GenerateMembershipRBACRoleBindingYAML( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) override; + future> AsyncGetOperation( google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -155,4 +448,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_V1_INTERNAL_GKE_HUB_METADATA_DECORATOR_H diff --git a/google/cloud/gkehub/v1/internal/gke_hub_option_defaults.cc b/google/cloud/gkehub/v1/internal/gke_hub_option_defaults.cc index be6b818d12e47..d710ccf72a7d3 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_option_defaults.cc +++ b/google/cloud/gkehub/v1/internal/gke_hub_option_defaults.cc @@ -40,7 +40,7 @@ Options GkeHubDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - gkehub_v1::GkeHubLimitedTimeRetryPolicy(std::chrono::minutes(30)) + gkehub_v1::GkeHubLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/gkehub/v1/internal/gke_hub_stub.cc b/google/cloud/gkehub/v1/internal/gke_hub_stub.cc index ba6daca946c4c..2c03cddf5d8eb 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_stub.cc +++ b/google/cloud/gkehub/v1/internal/gke_hub_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/gkehub/v1/service.proto #include "google/cloud/gkehub/v1/internal/gke_hub_stub.h" +#include "google/cloud/gkehub/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkehub_v1_internal { @@ -43,6 +46,18 @@ DefaultGkeHubStub::ListMemberships( return response; } +StatusOr +DefaultGkeHubStub::ListBoundMemberships( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1::ListBoundMembershipsRequest const& request) { + google::cloud::gkehub::v1::ListBoundMembershipsResponse response; + auto status = grpc_stub_->ListBoundMemberships(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultGkeHubStub::ListFeatures( grpc::ClientContext& context, Options const&, @@ -265,6 +280,757 @@ DefaultGkeHubStub::GenerateConnectManifest( return response; } +future> +DefaultGkeHubStub::AsyncCreateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::CreateFleetRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1::CreateFleetRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateFleet(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultGkeHubStub::CreateFleet( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateFleet(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultGkeHubStub::GetFleet( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1::GetFleetRequest const& request) { + google::cloud::gkehub::v1::Fleet response; + auto status = grpc_stub_->GetFleet(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncUpdateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::UpdateFleetRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1::UpdateFleetRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateFleet(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultGkeHubStub::UpdateFleet( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateFleet(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncDeleteFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::DeleteFleetRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1::DeleteFleetRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteFleet(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultGkeHubStub::DeleteFleet( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteFleet(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultGkeHubStub::ListFleets( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1::ListFleetsRequest const& request) { + google::cloud::gkehub::v1::ListFleetsResponse response; + auto status = grpc_stub_->ListFleets(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultGkeHubStub::GetScopeNamespace( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) { + google::cloud::gkehub::v1::Namespace response; + auto status = grpc_stub_->GetScopeNamespace(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncCreateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::CreateScopeNamespaceRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateScopeNamespace(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultGkeHubStub::CreateScopeNamespace( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateScopeNamespace(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncUpdateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateScopeNamespace(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultGkeHubStub::UpdateScopeNamespace( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateScopeNamespace(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncDeleteScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteScopeNamespace(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultGkeHubStub::DeleteScopeNamespace( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteScopeNamespace(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultGkeHubStub::ListScopeNamespaces( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1::ListScopeNamespacesRequest const& request) { + google::cloud::gkehub::v1::ListScopeNamespacesResponse response; + auto status = grpc_stub_->ListScopeNamespaces(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultGkeHubStub::GetScopeRBACRoleBinding( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request) { + google::cloud::gkehub::v1::RBACRoleBinding response; + auto status = + grpc_stub_->GetScopeRBACRoleBinding(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncCreateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateScopeRBACRoleBinding(context, request, + cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultGkeHubStub::CreateScopeRBACRoleBinding( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->CreateScopeRBACRoleBinding(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncUpdateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateScopeRBACRoleBinding(context, request, + cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultGkeHubStub::UpdateScopeRBACRoleBinding( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->UpdateScopeRBACRoleBinding(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncDeleteScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteScopeRBACRoleBinding(context, request, + cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultGkeHubStub::DeleteScopeRBACRoleBinding( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->DeleteScopeRBACRoleBinding(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultGkeHubStub::ListScopeRBACRoleBindings( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest const& + request) { + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsResponse response; + auto status = + grpc_stub_->ListScopeRBACRoleBindings(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultGkeHubStub::GetScope( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1::GetScopeRequest const& request) { + google::cloud::gkehub::v1::Scope response; + auto status = grpc_stub_->GetScope(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncCreateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::CreateScopeRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1::CreateScopeRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateScope(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultGkeHubStub::CreateScope( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateScope(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncUpdateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::UpdateScopeRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1::UpdateScopeRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateScope(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultGkeHubStub::UpdateScope( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateScope(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncDeleteScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::DeleteScopeRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1::DeleteScopeRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteScope(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultGkeHubStub::DeleteScope( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteScope(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultGkeHubStub::ListScopes( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1::ListScopesRequest const& request) { + google::cloud::gkehub::v1::ListScopesResponse response; + auto status = grpc_stub_->ListScopes(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultGkeHubStub::ListPermittedScopes( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1::ListPermittedScopesRequest const& request) { + google::cloud::gkehub::v1::ListPermittedScopesResponse response; + auto status = grpc_stub_->ListPermittedScopes(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultGkeHubStub::GetMembershipBinding( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request) { + google::cloud::gkehub::v1::MembershipBinding response; + auto status = grpc_stub_->GetMembershipBinding(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncCreateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::CreateMembershipBindingRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateMembershipBinding(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultGkeHubStub::CreateMembershipBinding( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->CreateMembershipBinding(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncUpdateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::UpdateMembershipBindingRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateMembershipBinding(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultGkeHubStub::UpdateMembershipBinding( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->UpdateMembershipBinding(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncDeleteMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::DeleteMembershipBindingRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteMembershipBinding(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultGkeHubStub::DeleteMembershipBinding( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->DeleteMembershipBinding(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultGkeHubStub::ListMembershipBindings( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1::ListMembershipBindingsRequest const& request) { + google::cloud::gkehub::v1::ListMembershipBindingsResponse response; + auto status = + grpc_stub_->ListMembershipBindings(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultGkeHubStub::GetMembershipRBACRoleBinding( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) { + google::cloud::gkehub::v1::RBACRoleBinding response; + auto status = + grpc_stub_->GetMembershipRBACRoleBinding(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncCreateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1:: + CreateMembershipRBACRoleBindingRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateMembershipRBACRoleBinding(context, + request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultGkeHubStub::CreateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->CreateMembershipRBACRoleBinding(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncUpdateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1:: + UpdateMembershipRBACRoleBindingRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateMembershipRBACRoleBinding(context, + request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultGkeHubStub::UpdateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->UpdateMembershipRBACRoleBinding(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultGkeHubStub::AsyncDeleteMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::gkehub::v1:: + DeleteMembershipRBACRoleBindingRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteMembershipRBACRoleBinding(context, + request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultGkeHubStub::DeleteMembershipRBACRoleBinding( + grpc::ClientContext& context, Options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->DeleteMembershipRBACRoleBinding(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultGkeHubStub::ListMembershipRBACRoleBindings( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest const& + request) { + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsResponse response; + auto status = + grpc_stub_->ListMembershipRBACRoleBindings(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> +DefaultGkeHubStub::GenerateMembershipRBACRoleBindingYAML( + grpc::ClientContext& context, Options const&, + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) { + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse + response; + auto status = grpc_stub_->GenerateMembershipRBACRoleBindingYAML( + &context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + future> DefaultGkeHubStub::AsyncGetOperation( google::cloud::CompletionQueue& cq, @@ -308,3 +1074,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkehub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkehub/v1/internal/gke_hub_stub.h b/google/cloud/gkehub/v1/internal/gke_hub_stub.h index 99e9e570b8986..c7fe529ca818f 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_stub.h +++ b/google/cloud/gkehub/v1/internal/gke_hub_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_V1_INTERNAL_GKE_HUB_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_V1_INTERNAL_GKE_HUB_STUB_H +#include "google/cloud/gkehub/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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkehub_v1_internal { @@ -43,6 +46,12 @@ class GkeHubStub { grpc::ClientContext& context, Options const& options, google::cloud::gkehub::v1::ListMembershipsRequest const& request) = 0; + virtual StatusOr + ListBoundMemberships( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListBoundMembershipsRequest const& + request) = 0; + virtual StatusOr ListFeatures( grpc::ClientContext& context, Options const& options, @@ -125,6 +134,299 @@ class GkeHubStub { google::cloud::gkehub::v1::GenerateConnectManifestRequest const& request) = 0; + virtual future> AsyncCreateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) = 0; + + virtual StatusOr CreateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) = 0; + + virtual StatusOr GetFleet( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetFleetRequest const& request) = 0; + + virtual future> AsyncUpdateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) = 0; + + virtual StatusOr UpdateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) = 0; + + virtual future> AsyncDeleteFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) = 0; + + virtual StatusOr DeleteFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) = 0; + + virtual StatusOr ListFleets( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListFleetsRequest const& request) = 0; + + virtual StatusOr GetScopeNamespace( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) = 0; + + virtual future> + AsyncCreateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& + request) = 0; + + virtual StatusOr CreateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& + request) = 0; + + virtual future> + AsyncUpdateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& + request) = 0; + + virtual StatusOr UpdateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& + request) = 0; + + virtual future> + AsyncDeleteScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& + request) = 0; + + virtual StatusOr DeleteScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& + request) = 0; + + virtual StatusOr + ListScopeNamespaces( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeNamespacesRequest const& request) = 0; + + virtual StatusOr + GetScopeRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& + request) = 0; + + virtual future> + AsyncCreateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) = 0; + + virtual StatusOr CreateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) = 0; + + virtual future> + AsyncUpdateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) = 0; + + virtual StatusOr UpdateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) = 0; + + virtual future> + AsyncDeleteScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) = 0; + + virtual StatusOr DeleteScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) = 0; + + virtual StatusOr + ListScopeRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest const& + request) = 0; + + virtual StatusOr GetScope( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRequest const& request) = 0; + + virtual future> AsyncCreateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) = 0; + + virtual StatusOr CreateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) = 0; + + virtual future> AsyncUpdateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) = 0; + + virtual StatusOr UpdateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) = 0; + + virtual future> AsyncDeleteScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) = 0; + + virtual StatusOr DeleteScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) = 0; + + virtual StatusOr ListScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopesRequest const& request) = 0; + + virtual StatusOr + ListPermittedScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListPermittedScopesRequest const& request) = 0; + + virtual StatusOr + GetMembershipBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipBindingRequest const& + request) = 0; + + virtual future> + AsyncCreateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& + request) = 0; + + virtual StatusOr CreateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& + request) = 0; + + virtual future> + AsyncUpdateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& + request) = 0; + + virtual StatusOr UpdateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& + request) = 0; + + virtual future> + AsyncDeleteMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& + request) = 0; + + virtual StatusOr DeleteMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& + request) = 0; + + virtual StatusOr + ListMembershipBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipBindingsRequest const& + request) = 0; + + virtual StatusOr + GetMembershipRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) = 0; + + virtual future> + AsyncCreateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) = 0; + + virtual StatusOr + CreateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) = 0; + + virtual future> + AsyncUpdateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) = 0; + + virtual StatusOr + UpdateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) = 0; + + virtual future> + AsyncDeleteMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) = 0; + + virtual StatusOr + DeleteMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) = 0; + + virtual StatusOr< + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsResponse> + ListMembershipRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest const& + request) = 0; + + virtual StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> + GenerateMembershipRBACRoleBindingYAML( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) = 0; + virtual future> AsyncGetOperation( google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -153,6 +455,12 @@ class DefaultGkeHubStub : public GkeHubStub { google::cloud::gkehub::v1::ListMembershipsRequest const& request) override; + StatusOr + ListBoundMemberships( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListBoundMembershipsRequest const& request) + override; + StatusOr ListFeatures( grpc::ClientContext& context, Options const& options, google::cloud::gkehub::v1::ListFeaturesRequest const& request) override; @@ -237,6 +545,290 @@ class DefaultGkeHubStub : public GkeHubStub { google::cloud::gkehub::v1::GenerateConnectManifestRequest const& request) override; + future> AsyncCreateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) override; + + StatusOr CreateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) override; + + StatusOr GetFleet( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetFleetRequest const& request) override; + + future> AsyncUpdateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) override; + + StatusOr UpdateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) override; + + future> AsyncDeleteFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) override; + + StatusOr DeleteFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) override; + + StatusOr ListFleets( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListFleetsRequest const& request) override; + + StatusOr GetScopeNamespace( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) + override; + + future> AsyncCreateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) + override; + + StatusOr CreateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) + override; + + future> AsyncUpdateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) + override; + + StatusOr UpdateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) + override; + + future> AsyncDeleteScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) + override; + + StatusOr DeleteScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) + override; + + StatusOr + ListScopeNamespaces( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeNamespacesRequest const& request) + override; + + StatusOr GetScopeRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request) + override; + + future> + AsyncCreateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) override; + + StatusOr CreateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) override; + + future> + AsyncUpdateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) override; + + StatusOr UpdateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) override; + + future> + AsyncDeleteScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) override; + + StatusOr DeleteScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) override; + + StatusOr + ListScopeRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest const& + request) override; + + StatusOr GetScope( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRequest const& request) override; + + future> AsyncCreateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) override; + + StatusOr CreateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) override; + + future> AsyncUpdateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) override; + + StatusOr UpdateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) override; + + future> AsyncDeleteScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) override; + + StatusOr DeleteScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) override; + + StatusOr ListScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopesRequest const& request) override; + + StatusOr + ListPermittedScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListPermittedScopesRequest const& request) + override; + + StatusOr GetMembershipBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request) + override; + + future> AsyncCreateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) + override; + + StatusOr CreateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) + override; + + future> AsyncUpdateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) + override; + + StatusOr UpdateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) + override; + + future> AsyncDeleteMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) + override; + + StatusOr DeleteMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) + override; + + StatusOr + ListMembershipBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipBindingsRequest const& request) + override; + + StatusOr + GetMembershipRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncCreateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr CreateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncUpdateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr UpdateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncDeleteMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr DeleteMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr + ListMembershipRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest const& + request) override; + + StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> + GenerateMembershipRBACRoleBindingYAML( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) override; + future> AsyncGetOperation( google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -260,4 +852,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_V1_INTERNAL_GKE_HUB_STUB_H diff --git a/google/cloud/gkehub/v1/internal/gke_hub_stub_factory.cc b/google/cloud/gkehub/v1/internal/gke_hub_stub_factory.cc index 7b771eccde711..a1f9c75b11953 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_stub_factory.cc +++ b/google/cloud/gkehub/v1/internal/gke_hub_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/gkehub/v1/internal/gke_hub_metadata_decorator.h" #include "google/cloud/gkehub/v1/internal/gke_hub_stub.h" #include "google/cloud/gkehub/v1/internal/gke_hub_tracing_stub.h" +#include "google/cloud/gkehub/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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkehub_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkehub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkehub/v1/internal/gke_hub_stub_factory.h b/google/cloud/gkehub/v1/internal/gke_hub_stub_factory.h index e71af8512715e..d28491f740218 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_stub_factory.h +++ b/google/cloud/gkehub/v1/internal/gke_hub_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkehub_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_V1_INTERNAL_GKE_HUB_STUB_FACTORY_H diff --git a/google/cloud/gkehub/v1/internal/gke_hub_tracing_connection.cc b/google/cloud/gkehub/v1/internal/gke_hub_tracing_connection.cc index 3bc02d3fb30ee..05670eecd8e90 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_tracing_connection.cc +++ b/google/cloud/gkehub/v1/internal/gke_hub_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace gkehub_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GkeHubTracingConnection::GkeHubTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -44,6 +42,17 @@ GkeHubTracingConnection::ListMemberships( std::move(span), std::move(sr)); } +StreamRange +GkeHubTracingConnection::ListBoundMemberships( + google::cloud::gkehub::v1::ListBoundMembershipsRequest request) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::ListBoundMemberships"); + internal::OTelScope scope(span); + auto sr = child_->ListBoundMemberships(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + StreamRange GkeHubTracingConnection::ListFeatures( google::cloud::gkehub::v1::ListFeaturesRequest request) { @@ -241,15 +250,675 @@ GkeHubTracingConnection::GenerateConnectManifest( return internal::EndSpan(*span, child_->GenerateConnectManifest(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY +future> +GkeHubTracingConnection::CreateFleet( + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::CreateFleet"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateFleet(request)); +} + +StatusOr GkeHubTracingConnection::CreateFleet( + NoAwaitTag, google::cloud::gkehub::v1::CreateFleetRequest const& request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::CreateFleet"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateFleet(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::CreateFleet( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::CreateFleet"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateFleet(operation)); +} + +StatusOr GkeHubTracingConnection::GetFleet( + google::cloud::gkehub::v1::GetFleetRequest const& request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::GetFleet"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetFleet(request)); +} + +future> +GkeHubTracingConnection::UpdateFleet( + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::UpdateFleet"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateFleet(request)); +} + +StatusOr GkeHubTracingConnection::UpdateFleet( + NoAwaitTag, google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::UpdateFleet"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateFleet(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::UpdateFleet( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::UpdateFleet"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateFleet(operation)); +} + +future> +GkeHubTracingConnection::DeleteFleet( + google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::DeleteFleet"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteFleet(request)); +} + +StatusOr GkeHubTracingConnection::DeleteFleet( + NoAwaitTag, google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::DeleteFleet"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteFleet(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::DeleteFleet( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::DeleteFleet"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteFleet(operation)); +} + +StreamRange +GkeHubTracingConnection::ListFleets( + google::cloud::gkehub::v1::ListFleetsRequest request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::ListFleets"); + internal::OTelScope scope(span); + auto sr = child_->ListFleets(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +GkeHubTracingConnection::GetScopeNamespace( + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::GetScopeNamespace"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetScopeNamespace(request)); +} + +future> +GkeHubTracingConnection::CreateScopeNamespace( + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::CreateScopeNamespace"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateScopeNamespace(request)); +} + +StatusOr +GkeHubTracingConnection::CreateScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::CreateScopeNamespace"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateScopeNamespace(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::CreateScopeNamespace( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::CreateScopeNamespace"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateScopeNamespace(operation)); +} + +future> +GkeHubTracingConnection::UpdateScopeNamespace( + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::UpdateScopeNamespace"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateScopeNamespace(request)); +} + +StatusOr +GkeHubTracingConnection::UpdateScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::UpdateScopeNamespace"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateScopeNamespace(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::UpdateScopeNamespace( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::UpdateScopeNamespace"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateScopeNamespace(operation)); +} + +future> +GkeHubTracingConnection::DeleteScopeNamespace( + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::DeleteScopeNamespace"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteScopeNamespace(request)); +} + +StatusOr +GkeHubTracingConnection::DeleteScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::DeleteScopeNamespace"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteScopeNamespace(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::DeleteScopeNamespace( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::DeleteScopeNamespace"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteScopeNamespace(operation)); +} + +StreamRange +GkeHubTracingConnection::ListScopeNamespaces( + google::cloud::gkehub::v1::ListScopeNamespacesRequest request) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::ListScopeNamespaces"); + internal::OTelScope scope(span); + auto sr = child_->ListScopeNamespaces(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +GkeHubTracingConnection::GetScopeRBACRoleBinding( + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::GetScopeRBACRoleBinding"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetScopeRBACRoleBinding(request)); +} + +future> +GkeHubTracingConnection::CreateScopeRBACRoleBinding( + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::CreateScopeRBACRoleBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateScopeRBACRoleBinding(request)); +} + +StatusOr +GkeHubTracingConnection::CreateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::CreateScopeRBACRoleBinding"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->CreateScopeRBACRoleBinding(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::CreateScopeRBACRoleBinding( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::CreateScopeRBACRoleBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateScopeRBACRoleBinding(operation)); +} + +future> +GkeHubTracingConnection::UpdateScopeRBACRoleBinding( + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::UpdateScopeRBACRoleBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateScopeRBACRoleBinding(request)); +} + +StatusOr +GkeHubTracingConnection::UpdateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::UpdateScopeRBACRoleBinding"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->UpdateScopeRBACRoleBinding(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::UpdateScopeRBACRoleBinding( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::UpdateScopeRBACRoleBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateScopeRBACRoleBinding(operation)); +} + +future> +GkeHubTracingConnection::DeleteScopeRBACRoleBinding( + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::DeleteScopeRBACRoleBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteScopeRBACRoleBinding(request)); +} + +StatusOr +GkeHubTracingConnection::DeleteScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::DeleteScopeRBACRoleBinding"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->DeleteScopeRBACRoleBinding(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::DeleteScopeRBACRoleBinding( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::DeleteScopeRBACRoleBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteScopeRBACRoleBinding(operation)); +} + +StreamRange +GkeHubTracingConnection::ListScopeRBACRoleBindings( + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::ListScopeRBACRoleBindings"); + internal::OTelScope scope(span); + auto sr = child_->ListScopeRBACRoleBindings(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::gkehub::v1::RBACRoleBinding>(std::move(span), + std::move(sr)); +} + +StatusOr GkeHubTracingConnection::GetScope( + google::cloud::gkehub::v1::GetScopeRequest const& request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::GetScope"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetScope(request)); +} + +future> +GkeHubTracingConnection::CreateScope( + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::CreateScope"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateScope(request)); +} + +StatusOr GkeHubTracingConnection::CreateScope( + NoAwaitTag, google::cloud::gkehub::v1::CreateScopeRequest const& request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::CreateScope"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateScope(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::CreateScope( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::CreateScope"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateScope(operation)); +} + +future> +GkeHubTracingConnection::UpdateScope( + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::UpdateScope"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateScope(request)); +} + +StatusOr GkeHubTracingConnection::UpdateScope( + NoAwaitTag, google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::UpdateScope"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateScope(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::UpdateScope( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::UpdateScope"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateScope(operation)); +} + +future> +GkeHubTracingConnection::DeleteScope( + google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::DeleteScope"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteScope(request)); +} + +StatusOr GkeHubTracingConnection::DeleteScope( + NoAwaitTag, google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::DeleteScope"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteScope(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::DeleteScope( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::DeleteScope"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteScope(operation)); +} + +StreamRange +GkeHubTracingConnection::ListScopes( + google::cloud::gkehub::v1::ListScopesRequest request) { + auto span = internal::MakeSpan("gkehub_v1::GkeHubConnection::ListScopes"); + internal::OTelScope scope(span); + auto sr = child_->ListScopes(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StreamRange +GkeHubTracingConnection::ListPermittedScopes( + google::cloud::gkehub::v1::ListPermittedScopesRequest request) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::ListPermittedScopes"); + internal::OTelScope scope(span); + auto sr = child_->ListPermittedScopes(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +GkeHubTracingConnection::GetMembershipBinding( + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::GetMembershipBinding"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetMembershipBinding(request)); +} + +future> +GkeHubTracingConnection::CreateMembershipBinding( + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::CreateMembershipBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateMembershipBinding(request)); +} + +StatusOr +GkeHubTracingConnection::CreateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::CreateMembershipBinding"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->CreateMembershipBinding(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::CreateMembershipBinding( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::CreateMembershipBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateMembershipBinding(operation)); +} + +future> +GkeHubTracingConnection::UpdateMembershipBinding( + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::UpdateMembershipBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateMembershipBinding(request)); +} + +StatusOr +GkeHubTracingConnection::UpdateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::UpdateMembershipBinding"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->UpdateMembershipBinding(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::UpdateMembershipBinding( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::UpdateMembershipBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateMembershipBinding(operation)); +} + +future> +GkeHubTracingConnection::DeleteMembershipBinding( + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::DeleteMembershipBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteMembershipBinding(request)); +} + +StatusOr +GkeHubTracingConnection::DeleteMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::DeleteMembershipBinding"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->DeleteMembershipBinding(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::DeleteMembershipBinding( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::DeleteMembershipBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteMembershipBinding(operation)); +} + +StreamRange +GkeHubTracingConnection::ListMembershipBindings( + google::cloud::gkehub::v1::ListMembershipBindingsRequest request) { + auto span = + internal::MakeSpan("gkehub_v1::GkeHubConnection::ListMembershipBindings"); + internal::OTelScope scope(span); + auto sr = child_->ListMembershipBindings(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::gkehub::v1::MembershipBinding>(std::move(span), + std::move(sr)); +} + +StatusOr +GkeHubTracingConnection::GetMembershipRBACRoleBinding( + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::GetMembershipRBACRoleBinding"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, + child_->GetMembershipRBACRoleBinding(request)); +} + +future> +GkeHubTracingConnection::CreateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::CreateMembershipRBACRoleBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateMembershipRBACRoleBinding(request)); +} + +StatusOr +GkeHubTracingConnection::CreateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::CreateMembershipRBACRoleBinding"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->CreateMembershipRBACRoleBinding(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::CreateMembershipRBACRoleBinding( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::CreateMembershipRBACRoleBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateMembershipRBACRoleBinding(operation)); +} + +future> +GkeHubTracingConnection::UpdateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::UpdateMembershipRBACRoleBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateMembershipRBACRoleBinding(request)); +} + +StatusOr +GkeHubTracingConnection::UpdateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::UpdateMembershipRBACRoleBinding"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->UpdateMembershipRBACRoleBinding(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::UpdateMembershipRBACRoleBinding( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::UpdateMembershipRBACRoleBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateMembershipRBACRoleBinding(operation)); +} + +future> +GkeHubTracingConnection::DeleteMembershipRBACRoleBinding( + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::DeleteMembershipRBACRoleBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteMembershipRBACRoleBinding(request)); +} + +StatusOr +GkeHubTracingConnection::DeleteMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::DeleteMembershipRBACRoleBinding"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->DeleteMembershipRBACRoleBinding(NoAwaitTag{}, request)); +} + +future> +GkeHubTracingConnection::DeleteMembershipRBACRoleBinding( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::DeleteMembershipRBACRoleBinding"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteMembershipRBACRoleBinding(operation)); +} + +StreamRange +GkeHubTracingConnection::ListMembershipRBACRoleBindings( + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::ListMembershipRBACRoleBindings"); + internal::OTelScope scope(span); + auto sr = child_->ListMembershipRBACRoleBindings(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::gkehub::v1::RBACRoleBinding>(std::move(span), + std::move(sr)); +} + +StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> +GkeHubTracingConnection::GenerateMembershipRBACRoleBindingYAML( + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) { + auto span = internal::MakeSpan( + "gkehub_v1::GkeHubConnection::GenerateMembershipRBACRoleBindingYAML"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan( + *span, child_->GenerateMembershipRBACRoleBindingYAML(request)); +} std::shared_ptr MakeGkeHubTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/gkehub/v1/internal/gke_hub_tracing_connection.h b/google/cloud/gkehub/v1/internal/gke_hub_tracing_connection.h index f468068931d04..3a10abcb14db8 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_tracing_connection.h +++ b/google/cloud/gkehub/v1/internal/gke_hub_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace gkehub_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GkeHubTracingConnection : public gkehub_v1::GkeHubConnection { public: ~GkeHubTracingConnection() override = default; @@ -42,6 +40,9 @@ class GkeHubTracingConnection : public gkehub_v1::GkeHubConnection { StreamRange ListMemberships( google::cloud::gkehub::v1::ListMembershipsRequest request) override; + StreamRange ListBoundMemberships( + google::cloud::gkehub::v1::ListBoundMembershipsRequest request) override; + StreamRange ListFeatures( google::cloud::gkehub::v1::ListFeaturesRequest request) override; @@ -122,12 +123,290 @@ class GkeHubTracingConnection : public gkehub_v1::GkeHubConnection { google::cloud::gkehub::v1::GenerateConnectManifestRequest const& request) override; + future> CreateFleet( + google::cloud::gkehub::v1::CreateFleetRequest const& request) override; + + StatusOr CreateFleet( + NoAwaitTag, + google::cloud::gkehub::v1::CreateFleetRequest const& request) override; + + future> CreateFleet( + google::longrunning::Operation const& operation) override; + + StatusOr GetFleet( + google::cloud::gkehub::v1::GetFleetRequest const& request) override; + + future> UpdateFleet( + google::cloud::gkehub::v1::UpdateFleetRequest const& request) override; + + StatusOr UpdateFleet( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) override; + + future> UpdateFleet( + google::longrunning::Operation const& operation) override; + + future> DeleteFleet( + google::cloud::gkehub::v1::DeleteFleetRequest const& request) override; + + StatusOr DeleteFleet( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) override; + + future> DeleteFleet( + google::longrunning::Operation const& operation) override; + + StreamRange ListFleets( + google::cloud::gkehub::v1::ListFleetsRequest request) override; + + StatusOr GetScopeNamespace( + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) + override; + + future> CreateScopeNamespace( + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) + override; + + StatusOr CreateScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) + override; + + future> CreateScopeNamespace( + google::longrunning::Operation const& operation) override; + + future> UpdateScopeNamespace( + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) + override; + + StatusOr UpdateScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) + override; + + future> UpdateScopeNamespace( + google::longrunning::Operation const& operation) override; + + future> + DeleteScopeNamespace( + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) + override; + + StatusOr DeleteScopeNamespace( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) + override; + + future> + DeleteScopeNamespace( + google::longrunning::Operation const& operation) override; + + StreamRange ListScopeNamespaces( + google::cloud::gkehub::v1::ListScopeNamespacesRequest request) override; + + StatusOr GetScopeRBACRoleBinding( + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request) + override; + + future> + CreateScopeRBACRoleBinding( + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) override; + + StatusOr CreateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) override; + + future> + CreateScopeRBACRoleBinding( + google::longrunning::Operation const& operation) override; + + future> + UpdateScopeRBACRoleBinding( + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) override; + + StatusOr UpdateScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) override; + + future> + UpdateScopeRBACRoleBinding( + google::longrunning::Operation const& operation) override; + + future> + DeleteScopeRBACRoleBinding( + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) override; + + StatusOr DeleteScopeRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) override; + + future> + DeleteScopeRBACRoleBinding( + google::longrunning::Operation const& operation) override; + + StreamRange + ListScopeRBACRoleBindings( + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest request) + override; + + StatusOr GetScope( + google::cloud::gkehub::v1::GetScopeRequest const& request) override; + + future> CreateScope( + google::cloud::gkehub::v1::CreateScopeRequest const& request) override; + + StatusOr CreateScope( + NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeRequest const& request) override; + + future> CreateScope( + google::longrunning::Operation const& operation) override; + + future> UpdateScope( + google::cloud::gkehub::v1::UpdateScopeRequest const& request) override; + + StatusOr UpdateScope( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) override; + + future> UpdateScope( + google::longrunning::Operation const& operation) override; + + future> DeleteScope( + google::cloud::gkehub::v1::DeleteScopeRequest const& request) override; + + StatusOr DeleteScope( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) override; + + future> DeleteScope( + google::longrunning::Operation const& operation) override; + + StreamRange ListScopes( + google::cloud::gkehub::v1::ListScopesRequest request) override; + + StreamRange ListPermittedScopes( + google::cloud::gkehub::v1::ListPermittedScopesRequest request) override; + + StatusOr GetMembershipBinding( + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request) + override; + + future> + CreateMembershipBinding( + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) + override; + + StatusOr CreateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) + override; + + future> + CreateMembershipBinding( + google::longrunning::Operation const& operation) override; + + future> + UpdateMembershipBinding( + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) + override; + + StatusOr UpdateMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) + override; + + future> + UpdateMembershipBinding( + google::longrunning::Operation const& operation) override; + + future> + DeleteMembershipBinding( + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) + override; + + StatusOr DeleteMembershipBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) + override; + + future> + DeleteMembershipBinding( + google::longrunning::Operation const& operation) override; + + StreamRange + ListMembershipBindings( + google::cloud::gkehub::v1::ListMembershipBindingsRequest request) + override; + + StatusOr + GetMembershipRBACRoleBinding( + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) override; + + future> + CreateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr CreateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) override; + + future> + CreateMembershipRBACRoleBinding( + google::longrunning::Operation const& operation) override; + + future> + UpdateMembershipRBACRoleBinding( + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr UpdateMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) override; + + future> + UpdateMembershipRBACRoleBinding( + google::longrunning::Operation const& operation) override; + + future> + DeleteMembershipRBACRoleBinding( + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr DeleteMembershipRBACRoleBinding( + NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) override; + + future> + DeleteMembershipRBACRoleBinding( + google::longrunning::Operation const& operation) override; + + StreamRange + ListMembershipRBACRoleBindings( + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest request) + override; + + StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> + GenerateMembershipRBACRoleBindingYAML( + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) override; + private: std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/gkehub/v1/internal/gke_hub_tracing_stub.cc b/google/cloud/gkehub/v1/internal/gke_hub_tracing_stub.cc index d146f4ba204b2..18b068d5bc7b4 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_tracing_stub.cc +++ b/google/cloud/gkehub/v1/internal/gke_hub_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkehub_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GkeHubTracingStub::GkeHubTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -43,6 +44,18 @@ GkeHubTracingStub::ListMemberships( child_->ListMemberships(context, options, request)); } +StatusOr +GkeHubTracingStub::ListBoundMemberships( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListBoundMembershipsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "ListBoundMemberships"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListBoundMemberships(context, options, request)); +} + StatusOr GkeHubTracingStub::ListFeatures( grpc::ClientContext& context, Options const& options, @@ -244,6 +257,678 @@ GkeHubTracingStub::GenerateConnectManifest( child_->GenerateConnectManifest(context, options, request)); } +future> +GkeHubTracingStub::AsyncCreateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "CreateFleet"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateFleet(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr GkeHubTracingStub::CreateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "CreateFleet"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateFleet(context, options, request)); +} + +StatusOr GkeHubTracingStub::GetFleet( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetFleetRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "GetFleet"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetFleet(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncUpdateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "UpdateFleet"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateFleet(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr GkeHubTracingStub::UpdateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "UpdateFleet"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateFleet(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncDeleteFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "DeleteFleet"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteFleet(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr GkeHubTracingStub::DeleteFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "DeleteFleet"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteFleet(context, options, request)); +} + +StatusOr +GkeHubTracingStub::ListFleets( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListFleetsRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "ListFleets"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListFleets(context, options, request)); +} + +StatusOr +GkeHubTracingStub::GetScopeNamespace( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "GetScopeNamespace"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->GetScopeNamespace(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncCreateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "CreateScopeNamespace"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateScopeNamespace(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +GkeHubTracingStub::CreateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "CreateScopeNamespace"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->CreateScopeNamespace(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncUpdateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "UpdateScopeNamespace"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateScopeNamespace(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +GkeHubTracingStub::UpdateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "UpdateScopeNamespace"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->UpdateScopeNamespace(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncDeleteScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "DeleteScopeNamespace"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteScopeNamespace(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +GkeHubTracingStub::DeleteScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "DeleteScopeNamespace"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteScopeNamespace(context, options, request)); +} + +StatusOr +GkeHubTracingStub::ListScopeNamespaces( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeNamespacesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "ListScopeNamespaces"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListScopeNamespaces(context, options, request)); +} + +StatusOr +GkeHubTracingStub::GetScopeRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "GetScopeRBACRoleBinding"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->GetScopeRBACRoleBinding(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncCreateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "CreateScopeRBACRoleBinding"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateScopeRBACRoleBinding(cq, context, + std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +GkeHubTracingStub::CreateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "CreateScopeRBACRoleBinding"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->CreateScopeRBACRoleBinding(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncUpdateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "UpdateScopeRBACRoleBinding"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateScopeRBACRoleBinding(cq, context, + std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +GkeHubTracingStub::UpdateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "UpdateScopeRBACRoleBinding"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->UpdateScopeRBACRoleBinding(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncDeleteScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "DeleteScopeRBACRoleBinding"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteScopeRBACRoleBinding(cq, context, + std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +GkeHubTracingStub::DeleteScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "DeleteScopeRBACRoleBinding"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->DeleteScopeRBACRoleBinding(context, options, request)); +} + +StatusOr +GkeHubTracingStub::ListScopeRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "ListScopeRBACRoleBindings"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->ListScopeRBACRoleBindings(context, options, request)); +} + +StatusOr GkeHubTracingStub::GetScope( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "GetScope"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetScope(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncCreateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "CreateScope"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateScope(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr GkeHubTracingStub::CreateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "CreateScope"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateScope(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncUpdateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "UpdateScope"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateScope(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr GkeHubTracingStub::UpdateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "UpdateScope"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateScope(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncDeleteScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "DeleteScope"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteScope(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr GkeHubTracingStub::DeleteScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "DeleteScope"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteScope(context, options, request)); +} + +StatusOr +GkeHubTracingStub::ListScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopesRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", "ListScopes"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListScopes(context, options, request)); +} + +StatusOr +GkeHubTracingStub::ListPermittedScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListPermittedScopesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "ListPermittedScopes"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListPermittedScopes(context, options, request)); +} + +StatusOr +GkeHubTracingStub::GetMembershipBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "GetMembershipBinding"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->GetMembershipBinding(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncCreateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "CreateMembershipBinding"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateMembershipBinding(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +GkeHubTracingStub::CreateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "CreateMembershipBinding"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->CreateMembershipBinding(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncUpdateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "UpdateMembershipBinding"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateMembershipBinding(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +GkeHubTracingStub::UpdateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "UpdateMembershipBinding"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->UpdateMembershipBinding(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncDeleteMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "DeleteMembershipBinding"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteMembershipBinding(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +GkeHubTracingStub::DeleteMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "DeleteMembershipBinding"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->DeleteMembershipBinding(context, options, request)); +} + +StatusOr +GkeHubTracingStub::ListMembershipBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipBindingsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "ListMembershipBindings"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->ListMembershipBindings(context, options, request)); +} + +StatusOr +GkeHubTracingStub::GetMembershipRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "GetMembershipRBACRoleBinding"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->GetMembershipRBACRoleBinding(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncCreateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "CreateMembershipRBACRoleBinding"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateMembershipRBACRoleBinding( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +GkeHubTracingStub::CreateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "CreateMembershipRBACRoleBinding"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->CreateMembershipRBACRoleBinding(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncUpdateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "UpdateMembershipRBACRoleBinding"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateMembershipRBACRoleBinding( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +GkeHubTracingStub::UpdateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "UpdateMembershipRBACRoleBinding"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->UpdateMembershipRBACRoleBinding(context, options, request)); +} + +future> +GkeHubTracingStub::AsyncDeleteMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "DeleteMembershipRBACRoleBinding"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteMembershipRBACRoleBinding( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +GkeHubTracingStub::DeleteMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "DeleteMembershipRBACRoleBinding"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->DeleteMembershipRBACRoleBinding(context, options, request)); +} + +StatusOr +GkeHubTracingStub::ListMembershipRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "ListMembershipRBACRoleBindings"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->ListMembershipRBACRoleBindings(context, options, request)); +} + +StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> +GkeHubTracingStub::GenerateMembershipRBACRoleBindingYAML( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.gkehub.v1.GkeHub", + "GenerateMembershipRBACRoleBindingYAML"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->GenerateMembershipRBACRoleBindingYAML(context, options, request)); +} + future> GkeHubTracingStub::AsyncGetOperation( google::cloud::CompletionQueue& cq, @@ -272,18 +957,14 @@ future GkeHubTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGkeHubTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkehub_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkehub/v1/internal/gke_hub_tracing_stub.h b/google/cloud/gkehub/v1/internal/gke_hub_tracing_stub.h index 3fd23539413a5..6175cdfc0b220 100644 --- a/google/cloud/gkehub/v1/internal/gke_hub_tracing_stub.h +++ b/google/cloud/gkehub/v1/internal/gke_hub_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkehub_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GkeHubTracingStub : public GkeHubStub { public: ~GkeHubTracingStub() override = default; @@ -43,6 +44,12 @@ class GkeHubTracingStub : public GkeHubStub { google::cloud::gkehub::v1::ListMembershipsRequest const& request) override; + StatusOr + ListBoundMemberships( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListBoundMembershipsRequest const& request) + override; + StatusOr ListFeatures( grpc::ClientContext& context, Options const& options, google::cloud::gkehub::v1::ListFeaturesRequest const& request) override; @@ -127,6 +134,290 @@ class GkeHubTracingStub : public GkeHubStub { google::cloud::gkehub::v1::GenerateConnectManifestRequest const& request) override; + future> AsyncCreateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) override; + + StatusOr CreateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateFleetRequest const& request) override; + + StatusOr GetFleet( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetFleetRequest const& request) override; + + future> AsyncUpdateFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) override; + + StatusOr UpdateFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateFleetRequest const& request) override; + + future> AsyncDeleteFleet( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) override; + + StatusOr DeleteFleet( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteFleetRequest const& request) override; + + StatusOr ListFleets( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListFleetsRequest const& request) override; + + StatusOr GetScopeNamespace( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request) + override; + + future> AsyncCreateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) + override; + + StatusOr CreateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request) + override; + + future> AsyncUpdateScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) + override; + + StatusOr UpdateScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request) + override; + + future> AsyncDeleteScopeNamespace( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) + override; + + StatusOr DeleteScopeNamespace( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request) + override; + + StatusOr + ListScopeNamespaces( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeNamespacesRequest const& request) + override; + + StatusOr GetScopeRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& request) + override; + + future> + AsyncCreateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) override; + + StatusOr CreateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request) override; + + future> + AsyncUpdateScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) override; + + StatusOr UpdateScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request) override; + + future> + AsyncDeleteScopeRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) override; + + StatusOr DeleteScopeRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request) override; + + StatusOr + ListScopeRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest const& + request) override; + + StatusOr GetScope( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetScopeRequest const& request) override; + + future> AsyncCreateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) override; + + StatusOr CreateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateScopeRequest const& request) override; + + future> AsyncUpdateScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) override; + + StatusOr UpdateScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateScopeRequest const& request) override; + + future> AsyncDeleteScope( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) override; + + StatusOr DeleteScope( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteScopeRequest const& request) override; + + StatusOr ListScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListScopesRequest const& request) override; + + StatusOr + ListPermittedScopes( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListPermittedScopesRequest const& request) + override; + + StatusOr GetMembershipBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipBindingRequest const& request) + override; + + future> AsyncCreateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) + override; + + StatusOr CreateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& request) + override; + + future> AsyncUpdateMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) + override; + + StatusOr UpdateMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& request) + override; + + future> AsyncDeleteMembershipBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) + override; + + StatusOr DeleteMembershipBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& request) + override; + + StatusOr + ListMembershipBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipBindingsRequest const& request) + override; + + StatusOr + GetMembershipRBACRoleBinding( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncCreateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr CreateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncUpdateMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr UpdateMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request) override; + + future> + AsyncDeleteMembershipRBACRoleBinding( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr DeleteMembershipRBACRoleBinding( + grpc::ClientContext& context, Options options, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request) override; + + StatusOr + ListMembershipRBACRoleBindings( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest const& + request) override; + + StatusOr< + google::cloud::gkehub::v1::GenerateMembershipRBACRoleBindingYAMLResponse> + GenerateMembershipRBACRoleBindingYAML( + grpc::ClientContext& context, Options const& options, + google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request) override; + future> AsyncGetOperation( google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -145,8 +436,6 @@ class GkeHubTracingStub : public GkeHubStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -161,4 +450,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEHUB_V1_INTERNAL_GKE_HUB_TRACING_STUB_H diff --git a/google/cloud/gkehub/v1/mocks/mock_gke_hub_connection.h b/google/cloud/gkehub/v1/mocks/mock_gke_hub_connection.h index e9e2c07e109e3..6cd0ec32fe32b 100644 --- a/google/cloud/gkehub/v1/mocks/mock_gke_hub_connection.h +++ b/google/cloud/gkehub/v1/mocks/mock_gke_hub_connection.h @@ -51,6 +51,11 @@ class MockGkeHubConnection : public gkehub_v1::GkeHubConnection { (google::cloud::gkehub::v1::ListMembershipsRequest request), (override)); + MOCK_METHOD((StreamRange), + ListBoundMemberships, + (google::cloud::gkehub::v1::ListBoundMembershipsRequest request), + (override)); + MOCK_METHOD((StreamRange), ListFeatures, (google::cloud::gkehub::v1::ListFeaturesRequest request), (override)); @@ -295,6 +300,784 @@ class MockGkeHubConnection : public gkehub_v1::GkeHubConnection { (google::cloud::gkehub::v1::GenerateConnectManifestRequest const& request), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateFleet(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, CreateFleet, + (google::cloud::gkehub::v1::CreateFleetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateFleet(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, CreateFleet, + (NoAwaitTag, + google::cloud::gkehub::v1::CreateFleetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateFleet(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, CreateFleet, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD(StatusOr, GetFleet, + (google::cloud::gkehub::v1::GetFleetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateFleet(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, UpdateFleet, + (google::cloud::gkehub::v1::UpdateFleetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateFleet(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, UpdateFleet, + (NoAwaitTag, + google::cloud::gkehub::v1::UpdateFleetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateFleet(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, UpdateFleet, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteFleet(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteFleet, + (google::cloud::gkehub::v1::DeleteFleetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteFleet(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteFleet, + (NoAwaitTag, + google::cloud::gkehub::v1::DeleteFleetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteFleet(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteFleet, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), ListFleets, + (google::cloud::gkehub::v1::ListFleetsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, GetScopeNamespace, + (google::cloud::gkehub::v1::GetScopeNamespaceRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateScopeNamespace(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateScopeNamespace, + (google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateScopeNamespace(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateScopeNamespace, + (NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeNamespaceRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateScopeNamespace(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateScopeNamespace, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateScopeNamespace(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateScopeNamespace, + (google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateScopeNamespace(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateScopeNamespace, + (NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeNamespaceRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateScopeNamespace(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateScopeNamespace, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteScopeNamespace(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteScopeNamespace, + (google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteScopeNamespace(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteScopeNamespace, + (NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeNamespaceRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteScopeNamespace(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteScopeNamespace, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD((StreamRange), + ListScopeNamespaces, + (google::cloud::gkehub::v1::ListScopeNamespacesRequest request), + (override)); + + MOCK_METHOD(StatusOr, + GetScopeRBACRoleBinding, + (google::cloud::gkehub::v1::GetScopeRBACRoleBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateScopeRBACRoleBinding(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateScopeRBACRoleBinding, + (google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateScopeRBACRoleBinding(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateScopeRBACRoleBinding, + (NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeRBACRoleBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateScopeRBACRoleBinding(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateScopeRBACRoleBinding, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateScopeRBACRoleBinding(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateScopeRBACRoleBinding, + (google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateScopeRBACRoleBinding(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateScopeRBACRoleBinding, + (NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeRBACRoleBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateScopeRBACRoleBinding(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateScopeRBACRoleBinding, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteScopeRBACRoleBinding(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteScopeRBACRoleBinding, + (google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteScopeRBACRoleBinding(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteScopeRBACRoleBinding, + (NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeRBACRoleBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteScopeRBACRoleBinding(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteScopeRBACRoleBinding, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD( + (StreamRange), + ListScopeRBACRoleBindings, + (google::cloud::gkehub::v1::ListScopeRBACRoleBindingsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetScope, + (google::cloud::gkehub::v1::GetScopeRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateScope(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, CreateScope, + (google::cloud::gkehub::v1::CreateScopeRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateScope(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, CreateScope, + (NoAwaitTag, + google::cloud::gkehub::v1::CreateScopeRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateScope(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, CreateScope, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateScope(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, UpdateScope, + (google::cloud::gkehub::v1::UpdateScopeRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateScope(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, UpdateScope, + (NoAwaitTag, + google::cloud::gkehub::v1::UpdateScopeRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateScope(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, UpdateScope, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteScope(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteScope, + (google::cloud::gkehub::v1::DeleteScopeRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteScope(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteScope, + (NoAwaitTag, + google::cloud::gkehub::v1::DeleteScopeRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteScope(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteScope, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), ListScopes, + (google::cloud::gkehub::v1::ListScopesRequest request), + (override)); + + MOCK_METHOD((StreamRange), + ListPermittedScopes, + (google::cloud::gkehub::v1::ListPermittedScopesRequest request), + (override)); + + MOCK_METHOD( + StatusOr, + GetMembershipBinding, + (google::cloud::gkehub::v1::GetMembershipBindingRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateMembershipBinding(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateMembershipBinding, + (google::cloud::gkehub::v1::CreateMembershipBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateMembershipBinding(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, CreateMembershipBinding, + (NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateMembershipBinding(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateMembershipBinding, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateMembershipBinding(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateMembershipBinding, + (google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateMembershipBinding(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, UpdateMembershipBinding, + (NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateMembershipBinding(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateMembershipBinding, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteMembershipBinding(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteMembershipBinding, + (google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteMembershipBinding(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteMembershipBinding, + (NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteMembershipBinding(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteMembershipBinding, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD( + (StreamRange), + ListMembershipBindings, + (google::cloud::gkehub::v1::ListMembershipBindingsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, + GetMembershipRBACRoleBinding, + (google::cloud::gkehub::v1::GetMembershipRBACRoleBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateMembershipRBACRoleBinding(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateMembershipRBACRoleBinding, + (google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateMembershipRBACRoleBinding(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateMembershipRBACRoleBinding, + (NoAwaitTag, + google::cloud::gkehub::v1::CreateMembershipRBACRoleBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateMembershipRBACRoleBinding(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateMembershipRBACRoleBinding, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateMembershipRBACRoleBinding(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateMembershipRBACRoleBinding, + (google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateMembershipRBACRoleBinding(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateMembershipRBACRoleBinding, + (NoAwaitTag, + google::cloud::gkehub::v1::UpdateMembershipRBACRoleBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateMembershipRBACRoleBinding(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateMembershipRBACRoleBinding, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteMembershipRBACRoleBinding(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteMembershipRBACRoleBinding, + (google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteMembershipRBACRoleBinding(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteMembershipRBACRoleBinding, + (NoAwaitTag, + google::cloud::gkehub::v1::DeleteMembershipRBACRoleBindingRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteMembershipRBACRoleBinding(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteMembershipRBACRoleBinding, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD((StreamRange), + ListMembershipRBACRoleBindings, + (google::cloud::gkehub::v1::ListMembershipRBACRoleBindingsRequest + request), + (override)); + + MOCK_METHOD(StatusOr, + GenerateMembershipRBACRoleBindingYAML, + (google::cloud::gkehub::v1:: + GenerateMembershipRBACRoleBindingYAMLRequest const& request), + (override)); }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/gkemulticloud/BUILD.bazel b/google/cloud/gkemulticloud/BUILD.bazel index 99f253e0c7805..5a571bc693826 100644 --- a/google/cloud/gkemulticloud/BUILD.bazel +++ b/google/cloud/gkemulticloud/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/gkemulticloud/v1:gkemulticloud_cc_grpc", + "@googleapis//google/cloud/gkemulticloud/v1:gkemulticloud_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/gkemulticloud/quickstart/.bazelrc b/google/cloud/gkemulticloud/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/gkemulticloud/quickstart/.bazelrc +++ b/google/cloud/gkemulticloud/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/gkemulticloud/quickstart/CMakeLists.txt index 73795e1a33029..7624e261771cd 100644 --- a/google/cloud/gkemulticloud/quickstart/CMakeLists.txt +++ b/google/cloud/gkemulticloud/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Anthos Multi-Cloud API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-gkemulticloud-quickstart CXX) find_package(google_cloud_cpp_gkemulticloud REQUIRED) diff --git a/google/cloud/gkemulticloud/quickstart/WORKSPACE.bazel b/google/cloud/gkemulticloud/quickstart/WORKSPACE.bazel index 5153508f5e4ab..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 = "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/gkemulticloud/v1/attached_clusters_client.h b/google/cloud/gkemulticloud/v1/attached_clusters_client.h index afc169b49b55b..396dbcfdcc9fc 100644 --- a/google/cloud/gkemulticloud/v1/attached_clusters_client.h +++ b/google/cloud/gkemulticloud/v1/attached_clusters_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/attached_clusters_connection.h b/google/cloud/gkemulticloud/v1/attached_clusters_connection.h index ca17124d77b07..d788925f48c91 100644 --- a/google/cloud/gkemulticloud/v1/attached_clusters_connection.h +++ b/google/cloud/gkemulticloud/v1/attached_clusters_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_ATTACHED_CLUSTERS_CONNECTION_H #include "google/cloud/gkemulticloud/v1/attached_clusters_connection_idempotency_policy.h" +#include "google/cloud/gkemulticloud/v1/attached_service.pb.h" #include "google/cloud/gkemulticloud/v1/internal/attached_clusters_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/gkemulticloud/v1/attached_clusters_connection_idempotency_policy.h b/google/cloud/gkemulticloud/v1/attached_clusters_connection_idempotency_policy.h index 560d371e2aeef..ee1e5a593e04c 100644 --- a/google/cloud/gkemulticloud/v1/attached_clusters_connection_idempotency_policy.h +++ b/google/cloud/gkemulticloud/v1/attached_clusters_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_ATTACHED_CLUSTERS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_ATTACHED_CLUSTERS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/gkemulticloud/v1/attached_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/gkemulticloud/v1/aws_clusters_client.h b/google/cloud/gkemulticloud/v1/aws_clusters_client.h index 53c66cbadd83c..39abf61efc7ae 100644 --- a/google/cloud/gkemulticloud/v1/aws_clusters_client.h +++ b/google/cloud/gkemulticloud/v1/aws_clusters_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/aws_clusters_connection.h b/google/cloud/gkemulticloud/v1/aws_clusters_connection.h index 8aa2f8ef2a2ba..065801f466420 100644 --- a/google/cloud/gkemulticloud/v1/aws_clusters_connection.h +++ b/google/cloud/gkemulticloud/v1/aws_clusters_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_AWS_CLUSTERS_CONNECTION_H #include "google/cloud/gkemulticloud/v1/aws_clusters_connection_idempotency_policy.h" +#include "google/cloud/gkemulticloud/v1/aws_service.pb.h" #include "google/cloud/gkemulticloud/v1/internal/aws_clusters_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/gkemulticloud/v1/aws_clusters_connection_idempotency_policy.h b/google/cloud/gkemulticloud/v1/aws_clusters_connection_idempotency_policy.h index 078a5c4c5b1f0..1d58d13cc9a3d 100644 --- a/google/cloud/gkemulticloud/v1/aws_clusters_connection_idempotency_policy.h +++ b/google/cloud/gkemulticloud/v1/aws_clusters_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_AWS_CLUSTERS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_AWS_CLUSTERS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/gkemulticloud/v1/aws_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/gkemulticloud/v1/azure_clusters_client.h b/google/cloud/gkemulticloud/v1/azure_clusters_client.h index 8e5852b19683c..7f788c9de0951 100644 --- a/google/cloud/gkemulticloud/v1/azure_clusters_client.h +++ b/google/cloud/gkemulticloud/v1/azure_clusters_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/gkemulticloud/v1/azure_clusters_connection.h b/google/cloud/gkemulticloud/v1/azure_clusters_connection.h index dd0cdb8975a5d..cba4e00dbc475 100644 --- a/google/cloud/gkemulticloud/v1/azure_clusters_connection.h +++ b/google/cloud/gkemulticloud/v1/azure_clusters_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_AZURE_CLUSTERS_CONNECTION_H #include "google/cloud/gkemulticloud/v1/azure_clusters_connection_idempotency_policy.h" +#include "google/cloud/gkemulticloud/v1/azure_service.pb.h" #include "google/cloud/gkemulticloud/v1/internal/azure_clusters_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/gkemulticloud/v1/azure_clusters_connection_idempotency_policy.h b/google/cloud/gkemulticloud/v1/azure_clusters_connection_idempotency_policy.h index 1e2fd0d1371cf..802b407a87053 100644 --- a/google/cloud/gkemulticloud/v1/azure_clusters_connection_idempotency_policy.h +++ b/google/cloud/gkemulticloud/v1/azure_clusters_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_AZURE_CLUSTERS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_AZURE_CLUSTERS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/gkemulticloud/v1/azure_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_auth_decorator.cc b/google/cloud/gkemulticloud/v1/internal/attached_clusters_auth_decorator.cc index 357e70bbeb82f..7bf2f192d5816 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_auth_decorator.cc +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/gkemulticloud/v1/attached_service.proto #include "google/cloud/gkemulticloud/v1/internal/attached_clusters_auth_decorator.h" -#include +#include "google/cloud/gkemulticloud/v1/attached_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -281,3 +284,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_auth_decorator.h b/google/cloud/gkemulticloud/v1/internal/attached_clusters_auth_decorator.h index 5c4a108b325ee..bee71814f1bdf 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_auth_decorator.h +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkemulticloud/v1/internal/attached_clusters_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 gkemulticloud_v1_internal { @@ -158,4 +161,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_ATTACHED_CLUSTERS_AUTH_DECORATOR_H diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_connection_impl.h b/google/cloud/gkemulticloud/v1/internal/attached_clusters_connection_impl.h index 48e5b4e0400d5..e9768d97506dc 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_connection_impl.h +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_logging_decorator.cc b/google/cloud/gkemulticloud/v1/internal/attached_clusters_logging_decorator.cc index f036ace8760f4..07a606d02e6cf 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_logging_decorator.cc +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/gkemulticloud/v1/attached_service.proto #include "google/cloud/gkemulticloud/v1/internal/attached_clusters_logging_decorator.h" +#include "google/cloud/gkemulticloud/v1/attached_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -338,3 +341,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_logging_decorator.h b/google/cloud/gkemulticloud/v1/internal/attached_clusters_logging_decorator.h index 41601b292649b..3c30e20d69621 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_logging_decorator.h +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkemulticloud/v1/internal/attached_clusters_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 gkemulticloud_v1_internal { @@ -158,4 +161,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_ATTACHED_CLUSTERS_LOGGING_DECORATOR_H diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_metadata_decorator.cc b/google/cloud/gkemulticloud/v1/internal/attached_clusters_metadata_decorator.cc index 86feb109333cd..82ca69f8272e6 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_metadata_decorator.cc +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/gkemulticloud/v1/attached_service.proto #include "google/cloud/gkemulticloud/v1/internal/attached_clusters_metadata_decorator.h" +#include "google/cloud/gkemulticloud/v1/attached_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 gkemulticloud_v1_internal { @@ -267,3 +271,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_metadata_decorator.h b/google/cloud/gkemulticloud/v1/internal/attached_clusters_metadata_decorator.h index 4fd89d2e92e84..1d33a77e41ce3 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_metadata_decorator.h +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkemulticloud/v1/internal/attached_clusters_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 gkemulticloud_v1_internal { @@ -164,4 +167,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_ATTACHED_CLUSTERS_METADATA_DECORATOR_H diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_option_defaults.cc b/google/cloud/gkemulticloud/v1/internal/attached_clusters_option_defaults.cc index 36d743d3bf8fb..442843d84f426 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_option_defaults.cc +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/gkemulticloud/v1/internal/attached_clusters_option_defaults.h" #include "google/cloud/gkemulticloud/v1/attached_clusters_connection.h" #include "google/cloud/gkemulticloud/v1/attached_clusters_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options AttachedClustersDefaultOptions(std::string const& location, if (!options.has()) { options.set( gkemulticloud_v1::AttachedClustersLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub.cc b/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub.cc index feb606bddf18e..034eee9b835fd 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub.cc +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/gkemulticloud/v1/attached_service.proto #include "google/cloud/gkemulticloud/v1/internal/attached_clusters_stub.h" +#include "google/cloud/gkemulticloud/v1/attached_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -328,3 +331,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub.h b/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub.h index 6e6315dcf91d9..5958120c04211 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub.h +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_ATTACHED_CLUSTERS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_ATTACHED_CLUSTERS_STUB_H +#include "google/cloud/gkemulticloud/v1/attached_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -285,4 +288,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_ATTACHED_CLUSTERS_STUB_H diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub_factory.cc b/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub_factory.cc index 9c45b6608d7de..dfe4f029d3f6d 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub_factory.cc +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/gkemulticloud/v1/attached_service.proto #include "google/cloud/gkemulticloud/v1/internal/attached_clusters_stub_factory.h" +#include "google/cloud/gkemulticloud/v1/attached_service.grpc.pb.h" #include "google/cloud/gkemulticloud/v1/internal/attached_clusters_auth_decorator.h" #include "google/cloud/gkemulticloud/v1/internal/attached_clusters_logging_decorator.h" #include "google/cloud/gkemulticloud/v1/internal/attached_clusters_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub_factory.h b/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub_factory.h index a147512ebcdcc..b7d4d32b948f2 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub_factory.h +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_ATTACHED_CLUSTERS_STUB_FACTORY_H diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_connection.cc b/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_connection.cc index c66551b2fa4c4..cfcadc58044f1 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_connection.cc +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace gkemulticloud_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AttachedClustersTracingConnection::AttachedClustersTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -259,16 +257,12 @@ Status AttachedClustersTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAttachedClustersTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_connection.h b/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_connection.h index 520e14e599ded..0491b3d771286 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_connection.h +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace gkemulticloud_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AttachedClustersTracingConnection : public gkemulticloud_v1::AttachedClustersConnection { public: @@ -140,8 +138,6 @@ class AttachedClustersTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_stub.cc b/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_stub.cc index eab7411ae8f87..06d1c823f0790 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_stub.cc +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AttachedClustersTracingStub::AttachedClustersTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -303,18 +304,14 @@ future AttachedClustersTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAttachedClustersTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_stub.h b/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_stub.h index 6f3167213db9e..e3d1585037d37 100644 --- a/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_stub.h +++ b/google/cloud/gkemulticloud/v1/internal/attached_clusters_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AttachedClustersTracingStub : public AttachedClustersStub { public: ~AttachedClustersTracingStub() override = default; @@ -154,8 +155,6 @@ class AttachedClustersTracingStub : public AttachedClustersStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -170,4 +169,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_ATTACHED_CLUSTERS_TRACING_STUB_H diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_auth_decorator.cc b/google/cloud/gkemulticloud/v1/internal/aws_clusters_auth_decorator.cc index a0a593e64c6c2..f50ef84f816a6 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_auth_decorator.cc +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/gkemulticloud/v1/aws_service.proto #include "google/cloud/gkemulticloud/v1/internal/aws_clusters_auth_decorator.h" -#include +#include "google/cloud/gkemulticloud/v1/aws_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -388,3 +391,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_auth_decorator.h b/google/cloud/gkemulticloud/v1/internal/aws_clusters_auth_decorator.h index 701d6b13de85d..76d8223b65358 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_auth_decorator.h +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkemulticloud/v1/internal/aws_clusters_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 gkemulticloud_v1_internal { @@ -214,4 +217,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AWS_CLUSTERS_AUTH_DECORATOR_H diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_connection_impl.h b/google/cloud/gkemulticloud/v1/internal/aws_clusters_connection_impl.h index e7af3fa9bec0b..0fb3140f85690 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_connection_impl.h +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_logging_decorator.cc b/google/cloud/gkemulticloud/v1/internal/aws_clusters_logging_decorator.cc index 179a782c9998f..84299b4af9d17 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_logging_decorator.cc +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/gkemulticloud/v1/aws_service.proto #include "google/cloud/gkemulticloud/v1/internal/aws_clusters_logging_decorator.h" +#include "google/cloud/gkemulticloud/v1/aws_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -461,3 +464,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_logging_decorator.h b/google/cloud/gkemulticloud/v1/internal/aws_clusters_logging_decorator.h index bbe9600c70b0a..3117943a9ea21 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_logging_decorator.h +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkemulticloud/v1/internal/aws_clusters_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 gkemulticloud_v1_internal { @@ -214,4 +217,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AWS_CLUSTERS_LOGGING_DECORATOR_H diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_metadata_decorator.cc b/google/cloud/gkemulticloud/v1/internal/aws_clusters_metadata_decorator.cc index 659a7e9088046..9a0ac55962087 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_metadata_decorator.cc +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/gkemulticloud/v1/aws_service.proto #include "google/cloud/gkemulticloud/v1/internal/aws_clusters_metadata_decorator.h" +#include "google/cloud/gkemulticloud/v1/aws_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 gkemulticloud_v1_internal { @@ -355,3 +359,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_metadata_decorator.h b/google/cloud/gkemulticloud/v1/internal/aws_clusters_metadata_decorator.h index 843c075fc3485..5a3eb16d08193 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_metadata_decorator.h +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkemulticloud/v1/internal/aws_clusters_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 gkemulticloud_v1_internal { @@ -219,4 +222,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AWS_CLUSTERS_METADATA_DECORATOR_H diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_option_defaults.cc b/google/cloud/gkemulticloud/v1/internal/aws_clusters_option_defaults.cc index 62a37ed454f6f..f0fab4e335d8b 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_option_defaults.cc +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/gkemulticloud/v1/internal/aws_clusters_option_defaults.h" #include "google/cloud/gkemulticloud/v1/aws_clusters_connection.h" #include "google/cloud/gkemulticloud/v1/aws_clusters_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options AwsClustersDefaultOptions(std::string const& location, if (!options.has()) { options.set( gkemulticloud_v1::AwsClustersLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub.cc b/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub.cc index 4ec0aa0de4e4d..789f49a2a4bc6 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub.cc +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/gkemulticloud/v1/aws_service.proto #include "google/cloud/gkemulticloud/v1/internal/aws_clusters_stub.h" +#include "google/cloud/gkemulticloud/v1/aws_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -454,3 +457,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub.h b/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub.h index b4ab4c5e7fea6..305fd4a984560 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub.h +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AWS_CLUSTERS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AWS_CLUSTERS_STUB_H +#include "google/cloud/gkemulticloud/v1/aws_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -400,4 +403,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AWS_CLUSTERS_STUB_H diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub_factory.cc b/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub_factory.cc index 4bdd085079315..0a38ab4427983 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub_factory.cc +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/gkemulticloud/v1/aws_service.proto #include "google/cloud/gkemulticloud/v1/internal/aws_clusters_stub_factory.h" +#include "google/cloud/gkemulticloud/v1/aws_service.grpc.pb.h" #include "google/cloud/gkemulticloud/v1/internal/aws_clusters_auth_decorator.h" #include "google/cloud/gkemulticloud/v1/internal/aws_clusters_logging_decorator.h" #include "google/cloud/gkemulticloud/v1/internal/aws_clusters_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub_factory.h b/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub_factory.h index 17c7df911fb24..9beb9522e4ea2 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub_factory.h +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AWS_CLUSTERS_STUB_FACTORY_H diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_connection.cc b/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_connection.cc index 28db0f1acfa31..f4c81f693d045 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_connection.cc +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace gkemulticloud_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AwsClustersTracingConnection::AwsClustersTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -374,16 +372,12 @@ Status AwsClustersTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAwsClustersTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_connection.h b/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_connection.h index 3088dd3fdb166..092a587e5bf98 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_connection.h +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace gkemulticloud_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AwsClustersTracingConnection : public gkemulticloud_v1::AwsClustersConnection { public: @@ -189,8 +187,6 @@ class AwsClustersTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_stub.cc b/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_stub.cc index e64946ef4bae2..5fd906ec3fd25 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_stub.cc +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AwsClustersTracingStub::AwsClustersTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -412,18 +413,14 @@ future AwsClustersTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAwsClustersTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_stub.h b/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_stub.h index 47543c32eccd9..1d3b2b59a5541 100644 --- a/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_stub.h +++ b/google/cloud/gkemulticloud/v1/internal/aws_clusters_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AwsClustersTracingStub : public AwsClustersStub { public: ~AwsClustersTracingStub() override = default; @@ -209,8 +210,6 @@ class AwsClustersTracingStub : public AwsClustersStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -225,4 +224,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AWS_CLUSTERS_TRACING_STUB_H diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_auth_decorator.cc b/google/cloud/gkemulticloud/v1/internal/azure_clusters_auth_decorator.cc index 6513c1bf3a639..3b7388a13f9be 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_auth_decorator.cc +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/gkemulticloud/v1/azure_service.proto #include "google/cloud/gkemulticloud/v1/internal/azure_clusters_auth_decorator.h" -#include +#include "google/cloud/gkemulticloud/v1/azure_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -446,3 +449,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_auth_decorator.h b/google/cloud/gkemulticloud/v1/internal/azure_clusters_auth_decorator.h index 40e523e49b80f..527da927d5993 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_auth_decorator.h +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkemulticloud/v1/internal/azure_clusters_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 gkemulticloud_v1_internal { @@ -237,4 +240,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AZURE_CLUSTERS_AUTH_DECORATOR_H diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_connection_impl.h b/google/cloud/gkemulticloud/v1/internal/azure_clusters_connection_impl.h index 54059df5b4e00..8e48200227a28 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_connection_impl.h +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_logging_decorator.cc b/google/cloud/gkemulticloud/v1/internal/azure_clusters_logging_decorator.cc index 38021f53bd782..8561440b92c16 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_logging_decorator.cc +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/gkemulticloud/v1/azure_service.proto #include "google/cloud/gkemulticloud/v1/internal/azure_clusters_logging_decorator.h" +#include "google/cloud/gkemulticloud/v1/azure_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -540,3 +543,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_logging_decorator.h b/google/cloud/gkemulticloud/v1/internal/azure_clusters_logging_decorator.h index c2fa1cedeb190..d84e13da4d08d 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_logging_decorator.h +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkemulticloud/v1/internal/azure_clusters_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 gkemulticloud_v1_internal { @@ -237,4 +240,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AZURE_CLUSTERS_LOGGING_DECORATOR_H diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_metadata_decorator.cc b/google/cloud/gkemulticloud/v1/internal/azure_clusters_metadata_decorator.cc index f1770609da468..13f0b9794022f 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_metadata_decorator.cc +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/gkemulticloud/v1/azure_service.proto #include "google/cloud/gkemulticloud/v1/internal/azure_clusters_metadata_decorator.h" +#include "google/cloud/gkemulticloud/v1/azure_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 gkemulticloud_v1_internal { @@ -415,3 +419,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_metadata_decorator.h b/google/cloud/gkemulticloud/v1/internal/azure_clusters_metadata_decorator.h index 15e846d3299df..c63d3281db843 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_metadata_decorator.h +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/gkemulticloud/v1/internal/azure_clusters_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 gkemulticloud_v1_internal { @@ -242,4 +245,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AZURE_CLUSTERS_METADATA_DECORATOR_H diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_option_defaults.cc b/google/cloud/gkemulticloud/v1/internal/azure_clusters_option_defaults.cc index 3a5b5e0192c51..e3b696927caee 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_option_defaults.cc +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/gkemulticloud/v1/internal/azure_clusters_option_defaults.h" #include "google/cloud/gkemulticloud/v1/azure_clusters_connection.h" #include "google/cloud/gkemulticloud/v1/azure_clusters_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options AzureClustersDefaultOptions(std::string const& location, if (!options.has()) { options.set( gkemulticloud_v1::AzureClustersLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub.cc b/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub.cc index b822947551440..08eccb10dfabc 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub.cc +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/gkemulticloud/v1/azure_service.proto #include "google/cloud/gkemulticloud/v1/internal/azure_clusters_stub.h" +#include "google/cloud/gkemulticloud/v1/azure_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -521,3 +524,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub.h b/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub.h index dcff4271e4239..eeedc539ef855 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub.h +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AZURE_CLUSTERS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AZURE_CLUSTERS_STUB_H +#include "google/cloud/gkemulticloud/v1/azure_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -450,4 +453,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AZURE_CLUSTERS_STUB_H diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub_factory.cc b/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub_factory.cc index 4986128276710..2ab5fafb425c5 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub_factory.cc +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/gkemulticloud/v1/azure_service.proto #include "google/cloud/gkemulticloud/v1/internal/azure_clusters_stub_factory.h" +#include "google/cloud/gkemulticloud/v1/azure_service.grpc.pb.h" #include "google/cloud/gkemulticloud/v1/internal/azure_clusters_auth_decorator.h" #include "google/cloud/gkemulticloud/v1/internal/azure_clusters_logging_decorator.h" #include "google/cloud/gkemulticloud/v1/internal/azure_clusters_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub_factory.h b/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub_factory.h index 7f008886f53e7..42bebb93d3170 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub_factory.h +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AZURE_CLUSTERS_STUB_FACTORY_H diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_connection.cc b/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_connection.cc index 6a238f10a9e51..d010b49d6f929 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_connection.cc +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace gkemulticloud_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AzureClustersTracingConnection::AzureClustersTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -443,16 +441,12 @@ Status AzureClustersTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAzureClustersTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_connection.h b/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_connection.h index cd07b735fa9fd..13e9b4815d941 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_connection.h +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace gkemulticloud_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AzureClustersTracingConnection : public gkemulticloud_v1::AzureClustersConnection { public: @@ -210,8 +208,6 @@ class AzureClustersTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_stub.cc b/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_stub.cc index f438bddcfeba5..cc819d2407929 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_stub.cc +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AzureClustersTracingStub::AzureClustersTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -476,18 +477,14 @@ future AzureClustersTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAzureClustersTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkemulticloud_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_stub.h b/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_stub.h index 7dfd868eef17a..0169dac565392 100644 --- a/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_stub.h +++ b/google/cloud/gkemulticloud/v1/internal/azure_clusters_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkemulticloud_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AzureClustersTracingStub : public AzureClustersStub { public: ~AzureClustersTracingStub() override = default; @@ -232,8 +233,6 @@ class AzureClustersTracingStub : public AzureClustersStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -248,4 +247,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKEMULTICLOUD_V1_INTERNAL_AZURE_CLUSTERS_TRACING_STUB_H diff --git a/google/cloud/gkerecommender/BUILD.bazel b/google/cloud/gkerecommender/BUILD.bazel index eea417d306c8d..421ba61473dfb 100644 --- a/google/cloud/gkerecommender/BUILD.bazel +++ b/google/cloud/gkerecommender/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/gkerecommender/v1:gkerecommender_cc_grpc", + "@googleapis//google/cloud/gkerecommender/v1:gkerecommender_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/gkerecommender/quickstart/CMakeLists.txt b/google/cloud/gkerecommender/quickstart/CMakeLists.txt index 4dde70cf2d145..f55d9527a9a2c 100644 --- a/google/cloud/gkerecommender/quickstart/CMakeLists.txt +++ b/google/cloud/gkerecommender/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the GKE Recommender API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-gkerecommender-quickstart CXX) find_package(google_cloud_cpp_gkerecommender REQUIRED) diff --git a/google/cloud/gkerecommender/quickstart/WORKSPACE.bazel b/google/cloud/gkerecommender/quickstart/WORKSPACE.bazel index cfebba79ce398..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 = "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/gkerecommender/v1/gke_inference_quickstart_connection.h b/google/cloud/gkerecommender/v1/gke_inference_quickstart_connection.h index c163e2055c0e1..d53c8876088ac 100644 --- a/google/cloud/gkerecommender/v1/gke_inference_quickstart_connection.h +++ b/google/cloud/gkerecommender/v1/gke_inference_quickstart_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKERECOMMENDER_V1_GKE_INFERENCE_QUICKSTART_CONNECTION_H #include "google/cloud/gkerecommender/v1/gke_inference_quickstart_connection_idempotency_policy.h" +#include "google/cloud/gkerecommender/v1/gkerecommender.pb.h" #include "google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/gkerecommender/v1/gke_inference_quickstart_connection_idempotency_policy.h b/google/cloud/gkerecommender/v1/gke_inference_quickstart_connection_idempotency_policy.h index 3b2934fce60e0..301ed10d4e799 100644 --- a/google/cloud/gkerecommender/v1/gke_inference_quickstart_connection_idempotency_policy.h +++ b/google/cloud/gkerecommender/v1/gke_inference_quickstart_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKERECOMMENDER_V1_GKE_INFERENCE_QUICKSTART_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKERECOMMENDER_V1_GKE_INFERENCE_QUICKSTART_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/gkerecommender/v1/gkerecommender.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_auth_decorator.cc b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_auth_decorator.cc index eb65d5deaac4e..dcea78cb0af79 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_auth_decorator.cc +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/gkerecommender/v1/gkerecommender.proto #include "google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_auth_decorator.h" -#include +#include "google/cloud/gkerecommender/v1/gkerecommender.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkerecommender_v1_internal { @@ -93,3 +96,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkerecommender_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_auth_decorator.h b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_auth_decorator.h index 29049bbe338ae..7a116e51c1c18 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_auth_decorator.h +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkerecommender_v1_internal { @@ -82,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKERECOMMENDER_V1_INTERNAL_GKE_INFERENCE_QUICKSTART_AUTH_DECORATOR_H diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_logging_decorator.cc b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_logging_decorator.cc index 7fdd24ee7bcb5..06227ad0a573e 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_logging_decorator.cc +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/gkerecommender/v1/gkerecommender.proto #include "google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_logging_decorator.h" +#include "google/cloud/gkerecommender/v1/gkerecommender.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkerecommender_v1_internal { @@ -122,3 +125,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkerecommender_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_logging_decorator.h b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_logging_decorator.h index bb9a3a7e579af..b6f0d55c12e35 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_logging_decorator.h +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkerecommender_v1_internal { @@ -82,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKERECOMMENDER_V1_INTERNAL_GKE_INFERENCE_QUICKSTART_LOGGING_DECORATOR_H diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_metadata_decorator.cc b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_metadata_decorator.cc index e2493751fda7a..e72390181bbc6 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_metadata_decorator.cc +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/gkerecommender/v1/gkerecommender.proto #include "google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_metadata_decorator.h" +#include "google/cloud/gkerecommender/v1/gkerecommender.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 gkerecommender_v1_internal { @@ -113,3 +117,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkerecommender_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_metadata_decorator.h b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_metadata_decorator.h index 75dc9dba73ccf..3762751207d8c 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_metadata_decorator.h +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkerecommender_v1_internal { @@ -88,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKERECOMMENDER_V1_INTERNAL_GKE_INFERENCE_QUICKSTART_METADATA_DECORATOR_H diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_option_defaults.cc b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_option_defaults.cc index 574e8eff44c6c..954ec5c88b44c 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_option_defaults.cc +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_option_defaults.cc @@ -43,7 +43,7 @@ Options GkeInferenceQuickstartDefaultOptions(Options options) { .has()) { options.set( gkerecommender_v1::GkeInferenceQuickstartLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub.cc b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub.cc index 78d41f105910e..7160865b644d5 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub.cc +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/gkerecommender/v1/gkerecommender.proto #include "google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub.h" +#include "google/cloud/gkerecommender/v1/gkerecommender.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkerecommender_v1_internal { @@ -112,3 +115,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkerecommender_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub.h b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub.h index 41ef3fbc37c34..8cd2ca163404a 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub.h +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKERECOMMENDER_V1_INTERNAL_GKE_INFERENCE_QUICKSTART_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKERECOMMENDER_V1_INTERNAL_GKE_INFERENCE_QUICKSTART_STUB_H +#include "google/cloud/gkerecommender/v1/gkerecommender.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkerecommender_v1_internal { @@ -126,4 +129,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKERECOMMENDER_V1_INTERNAL_GKE_INFERENCE_QUICKSTART_STUB_H diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub_factory.cc b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub_factory.cc index 68054fa43f2a1..c250f25d8b12e 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub_factory.cc +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/gkerecommender/v1/gkerecommender.proto #include "google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub_factory.h" +#include "google/cloud/gkerecommender/v1/gkerecommender.grpc.pb.h" #include "google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_auth_decorator.h" #include "google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_logging_decorator.h" #include "google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkerecommender_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkerecommender_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub_factory.h b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub_factory.h index 6abdd95568b12..2888bd18d1202 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub_factory.h +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkerecommender_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKERECOMMENDER_V1_INTERNAL_GKE_INFERENCE_QUICKSTART_STUB_FACTORY_H diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_connection.cc b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_connection.cc index e3d5419e1c47c..139be7908a895 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_connection.cc +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace gkerecommender_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GkeInferenceQuickstartTracingConnection:: GkeInferenceQuickstartTracingConnection( std::shared_ptr @@ -103,17 +101,13 @@ GkeInferenceQuickstartTracingConnection::FetchBenchmarkingData( return internal::EndSpan(*span, child_->FetchBenchmarkingData(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGkeInferenceQuickstartTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_connection.h b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_connection.h index dbcf6bd8b3d75..b4d5fe691c72f 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_connection.h +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace gkerecommender_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GkeInferenceQuickstartTracingConnection : public gkerecommender_v1::GkeInferenceQuickstartConnection { public: @@ -69,8 +67,6 @@ class GkeInferenceQuickstartTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_stub.cc b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_stub.cc index d7da6bbaa16d9..145e6591dc13f 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_stub.cc +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkerecommender_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GkeInferenceQuickstartTracingStub::GkeInferenceQuickstartTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -114,19 +115,15 @@ GkeInferenceQuickstartTracingStub::FetchBenchmarkingData( context, *span, child_->FetchBenchmarkingData(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGkeInferenceQuickstartTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace gkerecommender_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_stub.h b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_stub.h index 08434ac60b6c0..16ceb4bd01e78 100644 --- a/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_stub.h +++ b/google/cloud/gkerecommender/v1/internal/gke_inference_quickstart_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace gkerecommender_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GkeInferenceQuickstartTracingStub : public GkeInferenceQuickstartStub { public: ~GkeInferenceQuickstartTracingStub() override = default; @@ -79,8 +80,6 @@ class GkeInferenceQuickstartTracingStub : public GkeInferenceQuickstartStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -96,4 +95,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKERECOMMENDER_V1_INTERNAL_GKE_INFERENCE_QUICKSTART_TRACING_STUB_H diff --git a/google/cloud/google_cloud_cpp_common.bzl b/google/cloud/google_cloud_cpp_common.bzl index 2201aa030ef8d..421c9c00a4160 100644 --- a/google/cloud/google_cloud_cpp_common.bzl +++ b/google/cloud/google_cloud_cpp_common.bzl @@ -26,9 +26,6 @@ google_cloud_cpp_common_hdrs = [ "future_generic.h", "future_void.h", "idempotency.h", - "internal/absl_str_cat_quiet.h", - "internal/absl_str_join_quiet.h", - "internal/absl_str_replace_quiet.h", "internal/algorithm.h", "internal/api_client_header.h", "internal/attributes.h", @@ -77,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", @@ -104,6 +102,8 @@ google_cloud_cpp_common_hdrs = [ "optional.h", "options.h", "polling_policy.h", + "ports_def.inc", + "ports_undef.inc", "project.h", "retry_policy.h", "rpc_metadata.h", diff --git a/google/cloud/google_cloud_cpp_common.cmake b/google/cloud/google_cloud_cpp_common.cmake index 773857ef720d1..8b3601db39f01 100644 --- a/google/cloud/google_cloud_cpp_common.cmake +++ b/google/cloud/google_cloud_cpp_common.cmake @@ -42,9 +42,6 @@ add_library( future_generic.h future_void.h idempotency.h - internal/absl_str_cat_quiet.h - internal/absl_str_join_quiet.h - internal/absl_str_replace_quiet.h internal/algorithm.h internal/api_client_header.cc internal/api_client_header.h @@ -120,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 @@ -163,6 +161,8 @@ add_library( options.cc options.h polling_policy.h + ports_def.inc + ports_undef.inc project.cc project.h retry_policy.h @@ -202,10 +202,6 @@ if (opentelemetry IN_LIST GOOGLE_CLOUD_CPP_ENABLE) if (opentelemetry-cpp_FOUND) target_link_libraries(google_cloud_cpp_common PUBLIC opentelemetry-cpp::api) - target_compile_definitions( - google_cloud_cpp_common - PUBLIC # Enable OpenTelemetry features in google-cloud-cpp - GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY) set(GOOGLE_CLOUD_CPP_FIND_OPTIONAL_DEPENDENCIES "find_dependency(opentelemetry-cpp)") set(GOOGLE_CLOUD_CPP_OPENTELEMETRY_API "opentelemetry_api") diff --git a/google/cloud/google_cloud_cpp_grpc_utils.bzl b/google/cloud/google_cloud_cpp_grpc_utils.bzl index d54df10510c40..9d4a6ddfc514a 100644 --- a/google/cloud/google_cloud_cpp_grpc_utils.bzl +++ b/google/cloud/google_cloud_cpp_grpc_utils.bzl @@ -24,10 +24,6 @@ google_cloud_cpp_grpc_utils_hdrs = [ "connection_options.h", "grpc_error_delegate.h", "grpc_options.h", - "grpc_utils/async_operation.h", - "grpc_utils/completion_queue.h", - "grpc_utils/grpc_error_delegate.h", - "grpc_utils/version.h", "iam_updater.h", "internal/async_connection_ready.h", "internal/async_long_running_operation.h", diff --git a/google/cloud/google_cloud_cpp_grpc_utils.cmake b/google/cloud/google_cloud_cpp_grpc_utils.cmake index f73a7d81e09b2..47094c6f146ef 100644 --- a/google/cloud/google_cloud_cpp_grpc_utils.cmake +++ b/google/cloud/google_cloud_cpp_grpc_utils.cmake @@ -28,10 +28,6 @@ add_library( grpc_error_delegate.h grpc_options.cc grpc_options.h - grpc_utils/async_operation.h - grpc_utils/completion_queue.h - grpc_utils/grpc_error_delegate.h - grpc_utils/version.h iam_updater.h internal/async_connection_ready.cc internal/async_connection_ready.h @@ -190,9 +186,8 @@ google_cloud_cpp_add_pkgconfig( "absl_time_zone" "absl_variant" "openssl") - # Create and install the CMake configuration files. -configure_file("grpc_utils/config.cmake.in" +configure_file("config-grpc-utils.cmake.in" "google_cloud_cpp_grpc_utils-config.cmake" @ONLY) write_basic_package_version_file( "google_cloud_cpp_grpc_utils-config-version.cmake" 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 fd8187f4f44ec..41926d4906226 100644 --- a/google/cloud/google_cloud_cpp_rest_internal.cmake +++ b/google/cloud/google_cloud_cpp_rest_internal.cmake @@ -14,7 +14,7 @@ # limitations under the License. # ~~~ -include(IncludeNlohmannJson) +find_package(nlohmann_json CONFIG REQUIRED) find_package(CURL REQUIRED) if (NOT WIN32) find_package(OpenSSL REQUIRED) @@ -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/grpc_error_delegate.cc b/google/cloud/grpc_error_delegate.cc index 27816aa7a9f4b..fcda02086e17c 100644 --- a/google/cloud/grpc_error_delegate.cc +++ b/google/cloud/grpc_error_delegate.cc @@ -15,9 +15,9 @@ #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/internal/status_payload_keys.h" #include "absl/types/optional.h" -#include +#include "google/protobuf/any.pb.h" +#include "google/rpc/error_details.pb.h" #include -#include namespace google { namespace cloud { diff --git a/google/cloud/grpc_error_delegate.h b/google/cloud/grpc_error_delegate.h index a2c91ceb2ec87..f1b7151f5c8a9 100644 --- a/google/cloud/grpc_error_delegate.h +++ b/google/cloud/grpc_error_delegate.h @@ -17,7 +17,7 @@ #include "google/cloud/status.h" #include "google/cloud/version.h" -#include +#include "google/rpc/status.pb.h" #include #include diff --git a/google/cloud/grpc_error_delegate_test.cc b/google/cloud/grpc_error_delegate_test.cc index 2a9ac50374800..3c8c80991fa20 100644 --- a/google/cloud/grpc_error_delegate_test.cc +++ b/google/cloud/grpc_error_delegate_test.cc @@ -15,7 +15,7 @@ #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/internal/status_payload_keys.h" #include "google/cloud/internal/time_utils.h" -#include +#include "google/rpc/error_details.pb.h" #include namespace google { diff --git a/google/cloud/grpc_options.cc b/google/cloud/grpc_options.cc index c5f42ed01c0f9..322bf2cc57213 100644 --- a/google/cloud/grpc_options.cc +++ b/google/cloud/grpc_options.cc @@ -14,9 +14,9 @@ #include "google/cloud/grpc_options.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/background_threads_impl.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" namespace google { namespace cloud { diff --git a/google/cloud/grpc_utils/BUILD.bazel b/google/cloud/grpc_utils/BUILD.bazel deleted file mode 100644 index b1e4f6752a3ba..0000000000000 --- a/google/cloud/grpc_utils/BUILD.bazel +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -package(default_visibility = ["//visibility:public"]) - -licenses(["notice"]) # Apache 2.0 - -# TODO(#3932) - remove the backwards compatibility target. -cc_library( - name = "google_cloud_cpp_grpc_utils", - srcs = [], - hdrs = [ - "async_operation.h", - "completion_queue.h", - "grpc_error_delegate.h", - "version.h", - ], - deprecation = ( - "please use //:grpc_utils instead." + - " This target will be removed on or about 2023-01-01. More details at" + - " https://github.com/googleapis/google-cloud-cpp/issues/3932" - ), - tags = ["manual"], - deps = [ - "//:common", - "//:grpc_utils", - ], -) diff --git a/google/cloud/grpc_utils/async_operation.h b/google/cloud/grpc_utils/async_operation.h deleted file mode 100644 index 0ff2e3fbd432a..0000000000000 --- a/google/cloud/grpc_utils/async_operation.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_GRPC_UTILS_ASYNC_OPERATION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GRPC_UTILS_ASYNC_OPERATION_H - -#include "google/cloud/async_operation.h" -#include "google/cloud/version.h" -#warning \ - "We moved the helpers in the google::cloud::grpc_utils namespace to " \ - "`google::cloud`, please use them directly. The aliases to maintain " \ - "backwards compatibility will be removed on or about 2023-01-01. " \ - "More details at " \ - "https://github.com/googleapis/google-cloud-cpp/issues/3932") - -namespace google { -namespace cloud { -namespace grpc_utils { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -/// Use a type alias to maintain API backwards compatibility. -using AsyncOperation = ::google::cloud::AsyncOperation; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace grpc_utils -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GRPC_UTILS_ASYNC_OPERATION_H diff --git a/google/cloud/grpc_utils/completion_queue.h b/google/cloud/grpc_utils/completion_queue.h deleted file mode 100644 index 0871a5e9dc205..0000000000000 --- a/google/cloud/grpc_utils/completion_queue.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_GRPC_UTILS_COMPLETION_QUEUE_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GRPC_UTILS_COMPLETION_QUEUE_H - -#include "google/cloud/completion_queue.h" -#include "google/cloud/version.h" -#warning \ - "We moved the helpers in the google::cloud::grpc_utils namespace to " \ - "`google::cloud`, please use them directly. The aliases to maintain " \ - "backwards compatibility will be removed on or about 2023-01-01. " \ - "More details at " \ - "https://github.com/googleapis/google-cloud-cpp/issues/3932") - -namespace google { -namespace cloud { -namespace grpc_utils { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -/// Use a type alias to maintain API backwards compatibility. -using CompletionQueue = ::google::cloud::CompletionQueue; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace grpc_utils -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GRPC_UTILS_COMPLETION_QUEUE_H diff --git a/google/cloud/grpc_utils/config.cmake.in b/google/cloud/grpc_utils/config.cmake.in deleted file mode 100644 index 64287e9bf6675..0000000000000 --- a/google/cloud/grpc_utils/config.cmake.in +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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(CMakeFindDependencyMacro) -# google_cloud_cpp_googleapis finds both gRPC and Protobuf, no need to load them here. -find_dependency(google_cloud_cpp_googleapis) -find_dependency(google_cloud_cpp_common) -find_dependency(absl) - -include("${CMAKE_CURRENT_LIST_DIR}/grpc_utils-targets.cmake") diff --git a/google/cloud/grpc_utils/grpc_error_delegate.h b/google/cloud/grpc_utils/grpc_error_delegate.h deleted file mode 100644 index 1e7f40d08c220..0000000000000 --- a/google/cloud/grpc_utils/grpc_error_delegate.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_GRPC_UTILS_GRPC_ERROR_DELEGATE_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GRPC_UTILS_GRPC_ERROR_DELEGATE_H - -#include "google/cloud/grpc_error_delegate.h" -#include "google/cloud/version.h" -#warning \ - "We moved the helpers in the google::cloud::grpc_utils namespace to " \ - "`google::cloud`, please use them directly. The aliases to maintain " \ - "backwards compatibility will be removed on or about 2023-01-01. " \ - "More details at " \ - "https://github.com/googleapis/google-cloud-cpp/issues/3932") - -namespace google { -namespace cloud { -namespace grpc_utils { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -using ::google::cloud::MakeStatusFromRpcError; -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace grpc_utils -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GRPC_UTILS_GRPC_ERROR_DELEGATE_H diff --git a/google/cloud/grpc_utils/version.h b/google/cloud/grpc_utils/version.h deleted file mode 100644 index dfce119503478..0000000000000 --- a/google/cloud/grpc_utils/version.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_GRPC_UTILS_VERSION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GRPC_UTILS_VERSION_H - -#include "google/cloud/version.h" -#warning \ - "We moved the helpers in the google::cloud::grpc_utils namespace to " \ - "`google::cloud`, please use them directly. The aliases to maintain " \ - "backwards compatibility will be removed on or about 2023-01-01. " \ - "More details at " \ - "https://github.com/googleapis/google-cloud-cpp/issues/3932") - -namespace google { -namespace cloud { -/** - * Contains all the Cloud C++ gRPC Utilities APIs. - */ -namespace grpc_utils { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -using ::google::cloud::version; -using ::google::cloud::version_major; -using ::google::cloud::version_minor; -using ::google::cloud::version_patch; -using ::google::cloud::version_string; -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -// TODO(#7463) - remove backwards compatibility namespaces -namespace v1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) -} // namespace grpc_utils -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GRPC_UTILS_VERSION_H 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/BUILD.bazel b/google/cloud/iam/BUILD.bazel index 48bd99fa12405..ed04e614cbe5e 100644 --- a/google/cloud/iam/BUILD.bazel +++ b/google/cloud/iam/BUILD.bazel @@ -19,7 +19,6 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "admin/v1/", "credentials/v1/", "v1/", @@ -28,11 +27,11 @@ service_dirs = [ ] googleapis_deps = [ - "@com_google_googleapis//google/iam/admin/v1:admin_cc_grpc", - "@com_google_googleapis//google/iam/credentials/v1:credentials_cc_grpc", - "@com_google_googleapis//google/iam/v1:iam_cc_grpc", - "@com_google_googleapis//google/iam/v2:iam_cc_grpc", - "@com_google_googleapis//google/iam/v3:iam_cc_grpc", + "@googleapis//google/iam/admin/v1:admin_cc_grpc", + "@googleapis//google/iam/credentials/v1:credentials_cc_grpc", + "@googleapis//google/iam/v1:iam_cc_grpc", + "@googleapis//google/iam/v2:iam_cc_grpc", + "@googleapis//google/iam/v3:iam_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/iam/admin/v1/iam_client.h b/google/cloud/iam/admin/v1/iam_client.h index bcdedfe5a3e92..d3c0306f2dbf5 100644 --- a/google/cloud/iam/admin/v1/iam_client.h +++ b/google/cloud/iam/admin/v1/iam_client.h @@ -1650,7 +1650,6 @@ class IAMClient { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_admin_v1 } // namespace cloud } // namespace google diff --git a/google/cloud/iam/admin/v1/iam_connection.h b/google/cloud/iam/admin/v1/iam_connection.h index 3873617ccde5a..72f80251bf024 100644 --- a/google/cloud/iam/admin/v1/iam_connection.h +++ b/google/cloud/iam/admin/v1/iam_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/iam/admin/v1/iam.pb.h" #include namespace google { @@ -295,7 +295,6 @@ class IAMConnection { std::shared_ptr MakeIAMConnection(Options options = {}); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_admin_v1 } // namespace cloud } // namespace google diff --git a/google/cloud/iam/admin/v1/iam_connection_idempotency_policy.h b/google/cloud/iam/admin/v1/iam_connection_idempotency_policy.h index 1d6b9246208b7..2705171f46e52 100644 --- a/google/cloud/iam/admin/v1/iam_connection_idempotency_policy.h +++ b/google/cloud/iam/admin/v1/iam_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/iam/admin/v1/iam.grpc.pb.h" #include namespace google { @@ -125,7 +125,6 @@ std::unique_ptr MakeDefaultIAMConnectionIdempotencyPolicy(); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_admin_v1 } // namespace cloud } // namespace google diff --git a/google/cloud/iam/admin/v1/internal/iam_auth_decorator.cc b/google/cloud/iam/admin/v1/internal/iam_auth_decorator.cc index 7b690d41410c8..17e51bb53cc25 100644 --- a/google/cloud/iam/admin/v1/internal/iam_auth_decorator.cc +++ b/google/cloud/iam/admin/v1/internal/iam_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/iam/admin/v1/iam.proto #include "google/cloud/iam/admin/v1/internal/iam_auth_decorator.h" -#include +#include "google/iam/admin/v1/iam.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_admin_v1_internal { @@ -269,3 +272,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/admin/v1/internal/iam_auth_decorator.h b/google/cloud/iam/admin/v1/internal/iam_auth_decorator.h index 3f50d5529497a..ed9a592ad94cb 100644 --- a/google/cloud/iam/admin/v1/internal/iam_auth_decorator.h +++ b/google/cloud/iam/admin/v1/internal/iam_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_admin_v1_internal { @@ -177,9 +180,10 @@ class IAMAuth : public IAMStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_ADMIN_V1_INTERNAL_IAM_AUTH_DECORATOR_H diff --git a/google/cloud/iam/admin/v1/internal/iam_connection_impl.h b/google/cloud/iam/admin/v1/internal/iam_connection_impl.h index 048326533a4cc..5a84ac7d72c72 100644 --- a/google/cloud/iam/admin/v1/internal/iam_connection_impl.h +++ b/google/cloud/iam/admin/v1/internal/iam_connection_impl.h @@ -155,7 +155,6 @@ class IAMConnectionImpl : public iam_admin_v1::IAMConnection { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google diff --git a/google/cloud/iam/admin/v1/internal/iam_logging_decorator.cc b/google/cloud/iam/admin/v1/internal/iam_logging_decorator.cc index 49e6fdae1fbc2..06e5ee8bd6a96 100644 --- a/google/cloud/iam/admin/v1/internal/iam_logging_decorator.cc +++ b/google/cloud/iam/admin/v1/internal/iam_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/iam/admin/v1/internal/iam_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/iam/admin/v1/iam.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_admin_v1_internal { @@ -376,3 +379,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/admin/v1/internal/iam_logging_decorator.h b/google/cloud/iam/admin/v1/internal/iam_logging_decorator.h index febd5ddcfc571..39debd6b7d2f0 100644 --- a/google/cloud/iam/admin/v1/internal/iam_logging_decorator.h +++ b/google/cloud/iam/admin/v1/internal/iam_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_admin_v1_internal { @@ -176,9 +179,10 @@ class IAMLogging : public IAMStub { }; // IAMLogging GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_ADMIN_V1_INTERNAL_IAM_LOGGING_DECORATOR_H diff --git a/google/cloud/iam/admin/v1/internal/iam_metadata_decorator.cc b/google/cloud/iam/admin/v1/internal/iam_metadata_decorator.cc index f7ab740582eb0..d033788561b9f 100644 --- a/google/cloud/iam/admin/v1/internal/iam_metadata_decorator.cc +++ b/google/cloud/iam/admin/v1/internal/iam_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/iam/admin/v1/internal/iam_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/iam/admin/v1/iam.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_admin_v1_internal { @@ -296,3 +300,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/admin/v1/internal/iam_metadata_decorator.h b/google/cloud/iam/admin/v1/internal/iam_metadata_decorator.h index 722b34678e5df..9d38c61dee7b5 100644 --- a/google/cloud/iam/admin/v1/internal/iam_metadata_decorator.h +++ b/google/cloud/iam/admin/v1/internal/iam_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_admin_v1_internal { @@ -182,9 +185,10 @@ class IAMMetadata : public IAMStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_ADMIN_V1_INTERNAL_IAM_METADATA_DECORATOR_H diff --git a/google/cloud/iam/admin/v1/internal/iam_option_defaults.cc b/google/cloud/iam/admin/v1/internal/iam_option_defaults.cc index 1e6f7626343c2..40dced5245669 100644 --- a/google/cloud/iam/admin/v1/internal/iam_option_defaults.cc +++ b/google/cloud/iam/admin/v1/internal/iam_option_defaults.cc @@ -40,7 +40,7 @@ Options IAMDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - iam_admin_v1::IAMLimitedTimeRetryPolicy(std::chrono::minutes(30)) + iam_admin_v1::IAMLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/iam/admin/v1/internal/iam_option_defaults.h b/google/cloud/iam/admin/v1/internal/iam_option_defaults.h index af91062bca504..4fc915fcd45ae 100644 --- a/google/cloud/iam/admin/v1/internal/iam_option_defaults.h +++ b/google/cloud/iam/admin/v1/internal/iam_option_defaults.h @@ -30,7 +30,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN Options IAMDefaultOptions(Options options); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google diff --git a/google/cloud/iam/admin/v1/internal/iam_stub.cc b/google/cloud/iam/admin/v1/internal/iam_stub.cc index 5105f16d92efd..9eb9ff83cf527 100644 --- a/google/cloud/iam/admin/v1/internal/iam_stub.cc +++ b/google/cloud/iam/admin/v1/internal/iam_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/iam/admin/v1/internal/iam_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/iam/admin/v1/iam.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_admin_v1_internal { @@ -364,3 +367,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/admin/v1/internal/iam_stub.h b/google/cloud/iam/admin/v1/internal/iam_stub.h index 24b97c5f0c9d2..9b29e46712e46 100644 --- a/google/cloud/iam/admin/v1/internal/iam_stub.h +++ b/google/cloud/iam/admin/v1/internal/iam_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/iam/admin/v1/iam.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_admin_v1_internal { @@ -308,9 +311,10 @@ class DefaultIAMStub : public IAMStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_ADMIN_V1_INTERNAL_IAM_STUB_H diff --git a/google/cloud/iam/admin/v1/internal/iam_stub_factory.cc b/google/cloud/iam/admin/v1/internal/iam_stub_factory.cc index cff409db68694..735a38645c738 100644 --- a/google/cloud/iam/admin/v1/internal/iam_stub_factory.cc +++ b/google/cloud/iam/admin/v1/internal/iam_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/iam/admin/v1/iam.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_admin_v1_internal { @@ -67,3 +70,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/admin/v1/internal/iam_stub_factory.h b/google/cloud/iam/admin/v1/internal/iam_stub_factory.h index c9b9ae8d6bc0d..38a1624a3d727 100644 --- a/google/cloud/iam/admin/v1/internal/iam_stub_factory.h +++ b/google/cloud/iam/admin/v1/internal/iam_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_admin_v1_internal { @@ -35,9 +38,10 @@ std::shared_ptr CreateDefaultIAMStub( Options const& options); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_ADMIN_V1_INTERNAL_IAM_STUB_FACTORY_H diff --git a/google/cloud/iam/admin/v1/internal/iam_tracing_connection.cc b/google/cloud/iam/admin/v1/internal/iam_tracing_connection.cc index e165d4236e924..81dee2ed7151a 100644 --- a/google/cloud/iam/admin/v1/internal/iam_tracing_connection.cc +++ b/google/cloud/iam/admin/v1/internal/iam_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace iam_admin_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IAMTracingConnection::IAMTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -270,15 +268,11 @@ IAMTracingConnection::LintPolicy( return internal::EndSpan(*span, child_->LintPolicy(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIAMTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/iam/admin/v1/internal/iam_tracing_connection.h b/google/cloud/iam/admin/v1/internal/iam_tracing_connection.h index 1874a9182e543..90e8d10eb52bb 100644 --- a/google/cloud/iam/admin/v1/internal/iam_tracing_connection.h +++ b/google/cloud/iam/admin/v1/internal/iam_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace iam_admin_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IAMTracingConnection : public iam_admin_v1::IAMConnection { public: ~IAMTracingConnection() override = default; @@ -144,8 +142,6 @@ class IAMTracingConnection : public iam_admin_v1::IAMConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * @@ -156,7 +152,6 @@ std::shared_ptr MakeIAMTracingConnection( std::shared_ptr conn); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google diff --git a/google/cloud/iam/admin/v1/internal/iam_tracing_stub.cc b/google/cloud/iam/admin/v1/internal/iam_tracing_stub.cc index 58d2edf267da8..abca6226482f5 100644 --- a/google/cloud/iam/admin/v1/internal/iam_tracing_stub.cc +++ b/google/cloud/iam/admin/v1/internal/iam_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_admin_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IAMTracingStub::IAMTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -352,17 +353,13 @@ StatusOr IAMTracingStub::LintPolicy( child_->LintPolicy(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIAMTracingStub(std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/admin/v1/internal/iam_tracing_stub.h b/google/cloud/iam/admin/v1/internal/iam_tracing_stub.h index 4139678a37786..f7efa96f07485 100644 --- a/google/cloud/iam/admin/v1/internal/iam_tracing_stub.h +++ b/google/cloud/iam/admin/v1/internal/iam_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_admin_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IAMTracingStub : public IAMStub { public: ~IAMTracingStub() override = default; @@ -177,8 +178,6 @@ class IAMTracingStub : public IAMStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -188,9 +187,10 @@ class IAMTracingStub : public IAMStub { std::shared_ptr MakeIAMTracingStub(std::shared_ptr stub); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_admin_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_ADMIN_V1_INTERNAL_IAM_TRACING_STUB_H diff --git a/google/cloud/iam/credentials/v1/iam_credentials_client.h b/google/cloud/iam/credentials/v1/iam_credentials_client.h index 30faa73be5c64..2b86040f00888 100644 --- a/google/cloud/iam/credentials/v1/iam_credentials_client.h +++ b/google/cloud/iam/credentials/v1/iam_credentials_client.h @@ -25,7 +25,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/protobuf/duration.pb.h" #include #include @@ -401,7 +401,6 @@ class IAMCredentialsClient { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_credentials_v1 } // namespace cloud } // namespace google diff --git a/google/cloud/iam/credentials/v1/iam_credentials_connection.h b/google/cloud/iam/credentials/v1/iam_credentials_connection.h index 130c86a4ba7eb..86551b00c8b60 100644 --- a/google/cloud/iam/credentials/v1/iam_credentials_connection.h +++ b/google/cloud/iam/credentials/v1/iam_credentials_connection.h @@ -26,7 +26,7 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/iam/credentials/v1/iamcredentials.pb.h" #include namespace google { @@ -221,7 +221,6 @@ std::shared_ptr MakeIAMCredentialsConnection( Options options = {}); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_credentials_v1 } // namespace cloud } // namespace google diff --git a/google/cloud/iam/credentials/v1/iam_credentials_connection_idempotency_policy.h b/google/cloud/iam/credentials/v1/iam_credentials_connection_idempotency_policy.h index 0c49f3392aece..0e0d229ac4b32 100644 --- a/google/cloud/iam/credentials/v1/iam_credentials_connection_idempotency_policy.h +++ b/google/cloud/iam/credentials/v1/iam_credentials_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/iam/credentials/v1/iamcredentials.grpc.pb.h" #include namespace google { @@ -54,7 +54,6 @@ std::unique_ptr MakeDefaultIAMCredentialsConnectionIdempotencyPolicy(); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_credentials_v1 } // namespace cloud } // namespace google diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_auth_decorator.cc b/google/cloud/iam/credentials/v1/internal/iam_credentials_auth_decorator.cc index ae89b3945566f..278799d107ce4 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_auth_decorator.cc +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/iam/credentials/v1/iamcredentials.proto #include "google/cloud/iam/credentials/v1/internal/iam_credentials_auth_decorator.h" -#include +#include "google/iam/credentials/v1/iamcredentials.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_credentials_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_auth_decorator.h b/google/cloud/iam/credentials/v1/internal/iam_credentials_auth_decorator.h index b71c8e01b91e6..664cd7aa39beb 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_auth_decorator.h +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_credentials_v1_internal { @@ -63,9 +66,10 @@ class IAMCredentialsAuth : public IAMCredentialsStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_CREDENTIALS_V1_INTERNAL_IAM_CREDENTIALS_AUTH_DECORATOR_H diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_connection_impl.h b/google/cloud/iam/credentials/v1/internal/iam_credentials_connection_impl.h index b5ab2ff0bd4b2..32c7aaa26b7cf 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_connection_impl.h +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_connection_impl.h @@ -70,7 +70,6 @@ class IAMCredentialsConnectionImpl }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_logging_decorator.cc b/google/cloud/iam/credentials/v1/internal/iam_credentials_logging_decorator.cc index 69a0f3bae9abf..e5ea3f7cad43e 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_logging_decorator.cc +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/iam/credentials/v1/internal/iam_credentials_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/iam/credentials/v1/iamcredentials.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_credentials_v1_internal { @@ -89,3 +92,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_logging_decorator.h b/google/cloud/iam/credentials/v1/internal/iam_credentials_logging_decorator.h index 12d7b03a275fd..d6f4674543c35 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_logging_decorator.h +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_credentials_v1_internal { @@ -63,9 +66,10 @@ class IAMCredentialsLogging : public IAMCredentialsStub { }; // IAMCredentialsLogging GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_CREDENTIALS_V1_INTERNAL_IAM_CREDENTIALS_LOGGING_DECORATOR_H diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_metadata_decorator.cc b/google/cloud/iam/credentials/v1/internal/iam_credentials_metadata_decorator.cc index 76ca7e292da99..1aaa71e24d030 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_metadata_decorator.cc +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/iam/credentials/v1/internal/iam_credentials_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/iam/credentials/v1/iamcredentials.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_credentials_v1_internal { @@ -97,3 +101,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_metadata_decorator.h b/google/cloud/iam/credentials/v1/internal/iam_credentials_metadata_decorator.h index 08356fa2d86d2..4a7b996cd4578 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_metadata_decorator.h +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_credentials_v1_internal { @@ -68,9 +71,10 @@ class IAMCredentialsMetadata : public IAMCredentialsStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_CREDENTIALS_V1_INTERNAL_IAM_CREDENTIALS_METADATA_DECORATOR_H diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_option_defaults.cc b/google/cloud/iam/credentials/v1/internal/iam_credentials_option_defaults.cc index d8bde53bb4994..48c9be0898cd5 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_option_defaults.cc +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_option_defaults.cc @@ -42,7 +42,7 @@ Options IAMCredentialsDefaultOptions(Options options) { if (!options.has()) { options.set( iam_credentials_v1::IAMCredentialsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_option_defaults.h b/google/cloud/iam/credentials/v1/internal/iam_credentials_option_defaults.h index 2fed954c9835b..9424d1df4a886 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_option_defaults.h +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_option_defaults.h @@ -30,7 +30,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN Options IAMCredentialsDefaultOptions(Options options); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_stub.cc b/google/cloud/iam/credentials/v1/internal/iam_credentials_stub.cc index 4a11d60880502..2d97730b9ddac 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_stub.cc +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/iam/credentials/v1/internal/iam_credentials_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/iam/credentials/v1/iamcredentials.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_credentials_v1_internal { @@ -82,3 +85,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_stub.h b/google/cloud/iam/credentials/v1/internal/iam_credentials_stub.h index 9635c77561a23..388c17701c74d 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_stub.h +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/iam/credentials/v1/iamcredentials.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_credentials_v1_internal { @@ -88,9 +91,10 @@ class DefaultIAMCredentialsStub : public IAMCredentialsStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_CREDENTIALS_V1_INTERNAL_IAM_CREDENTIALS_STUB_H diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_stub_factory.cc b/google/cloud/iam/credentials/v1/internal/iam_credentials_stub_factory.cc index 8e739a536c58a..622bec8d90e61 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_stub_factory.cc +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/iam/credentials/v1/iamcredentials.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_credentials_v1_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_stub_factory.h b/google/cloud/iam/credentials/v1/internal/iam_credentials_stub_factory.h index b0aff46a54d01..2036bd10771a9 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_stub_factory.h +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_credentials_v1_internal { @@ -35,9 +38,10 @@ std::shared_ptr CreateDefaultIAMCredentialsStub( Options const& options); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_CREDENTIALS_V1_INTERNAL_IAM_CREDENTIALS_STUB_FACTORY_H diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_connection.cc b/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_connection.cc index 893fc849e1dc4..07738af9cf7bd 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_connection.cc +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace iam_credentials_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IAMCredentialsTracingConnection::IAMCredentialsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -68,16 +66,12 @@ IAMCredentialsTracingConnection::SignJwt( return internal::EndSpan(*span, child_->SignJwt(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIAMCredentialsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_connection.h b/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_connection.h index 43a8128ef65ea..06725a0a2269b 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_connection.h +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace iam_credentials_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IAMCredentialsTracingConnection : public iam_credentials_v1::IAMCredentialsConnection { public: @@ -59,8 +57,6 @@ class IAMCredentialsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * @@ -72,7 +68,6 @@ MakeIAMCredentialsTracingConnection( std::shared_ptr conn); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_stub.cc b/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_stub.cc index 58bf22013b352..bb68a4a689701 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_stub.cc +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_credentials_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IAMCredentialsTracingStub::IAMCredentialsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -80,18 +81,14 @@ IAMCredentialsTracingStub::SignJwt( child_->SignJwt(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIAMCredentialsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_stub.h b/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_stub.h index 407510bda9ad9..08a39851062ad 100644 --- a/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_stub.h +++ b/google/cloud/iam/credentials/v1/internal/iam_credentials_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_credentials_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IAMCredentialsTracingStub : public IAMCredentialsStub { public: ~IAMCredentialsTracingStub() override = default; @@ -63,8 +64,6 @@ class IAMCredentialsTracingStub : public IAMCredentialsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -75,9 +74,10 @@ std::shared_ptr MakeIAMCredentialsTracingStub( std::shared_ptr stub); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace iam_credentials_v1_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_CREDENTIALS_V1_INTERNAL_IAM_CREDENTIALS_TRACING_STUB_H diff --git a/google/cloud/iam/iam_client.h b/google/cloud/iam/iam_client.h deleted file mode 100644 index 23d466ef181cf..0000000000000 --- a/google/cloud/iam/iam_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/admin/v1/iam.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CLIENT_H - -#include "google/cloud/iam/admin/v1/iam_client.h" -#include "google/cloud/iam/iam_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in iam_admin_v1 instead of the aliases defined in -/// this namespace. -namespace iam { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iam_admin_v1::IAMClient directly. -using ::google::cloud::iam_admin_v1::IAMClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CLIENT_H diff --git a/google/cloud/iam/iam_connection.h b/google/cloud/iam/iam_connection.h deleted file mode 100644 index 7b9fa24f1d8c1..0000000000000 --- a/google/cloud/iam/iam_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/admin/v1/iam.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CONNECTION_H - -#include "google/cloud/iam/admin/v1/iam_connection.h" -#include "google/cloud/iam/iam_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace iam { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iam_admin_v1::MakeIAMConnection directly. -using ::google::cloud::iam_admin_v1::MakeIAMConnection; - -/// @deprecated Use iam_admin_v1::IAMConnection directly. -using ::google::cloud::iam_admin_v1::IAMConnection; - -/// @deprecated Use iam_admin_v1::IAMLimitedErrorCountRetryPolicy directly. -using ::google::cloud::iam_admin_v1::IAMLimitedErrorCountRetryPolicy; - -/// @deprecated Use iam_admin_v1::IAMLimitedTimeRetryPolicy directly. -using ::google::cloud::iam_admin_v1::IAMLimitedTimeRetryPolicy; - -/// @deprecated Use iam_admin_v1::IAMRetryPolicy directly. -using ::google::cloud::iam_admin_v1::IAMRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CONNECTION_H diff --git a/google/cloud/iam/iam_connection_idempotency_policy.h b/google/cloud/iam/iam_connection_idempotency_policy.h deleted file mode 100644 index b6fac9be2b1a4..0000000000000 --- a/google/cloud/iam/iam_connection_idempotency_policy.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/admin/v1/iam.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/iam/admin/v1/iam_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace iam { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iam_admin_v1::MakeDefaultIAMConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::iam_admin_v1::MakeDefaultIAMConnectionIdempotencyPolicy; - -/// @deprecated Use iam_admin_v1::IAMConnectionIdempotencyPolicy directly. -using ::google::cloud::iam_admin_v1::IAMConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/iam/iam_credentials_client.h b/google/cloud/iam/iam_credentials_client.h deleted file mode 100644 index 58d28aeae891a..0000000000000 --- a/google/cloud/iam/iam_credentials_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/credentials/v1/iamcredentials.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CREDENTIALS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CREDENTIALS_CLIENT_H - -#include "google/cloud/iam/credentials/v1/iam_credentials_client.h" -#include "google/cloud/iam/iam_credentials_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in iam_credentials_v1 instead of the aliases defined in -/// this namespace. -namespace iam { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iam_credentials_v1::IAMCredentialsClient directly. -using ::google::cloud::iam_credentials_v1::IAMCredentialsClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CREDENTIALS_CLIENT_H diff --git a/google/cloud/iam/iam_credentials_connection.h b/google/cloud/iam/iam_credentials_connection.h deleted file mode 100644 index 69c82ac73d1fb..0000000000000 --- a/google/cloud/iam/iam_credentials_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/credentials/v1/iamcredentials.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CREDENTIALS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CREDENTIALS_CONNECTION_H - -#include "google/cloud/iam/credentials/v1/iam_credentials_connection.h" -#include "google/cloud/iam/iam_credentials_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace iam { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iam_credentials_v1::MakeIAMCredentialsConnection directly. -using ::google::cloud::iam_credentials_v1::MakeIAMCredentialsConnection; - -/// @deprecated Use iam_credentials_v1::IAMCredentialsConnection directly. -using ::google::cloud::iam_credentials_v1::IAMCredentialsConnection; - -/// @deprecated Use -/// iam_credentials_v1::IAMCredentialsLimitedErrorCountRetryPolicy directly. -using ::google::cloud::iam_credentials_v1:: - IAMCredentialsLimitedErrorCountRetryPolicy; - -/// @deprecated Use iam_credentials_v1::IAMCredentialsLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::iam_credentials_v1::IAMCredentialsLimitedTimeRetryPolicy; - -/// @deprecated Use iam_credentials_v1::IAMCredentialsRetryPolicy directly. -using ::google::cloud::iam_credentials_v1::IAMCredentialsRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CREDENTIALS_CONNECTION_H diff --git a/google/cloud/iam/iam_credentials_connection_idempotency_policy.h b/google/cloud/iam/iam_credentials_connection_idempotency_policy.h deleted file mode 100644 index 8e2bb6e032b7e..0000000000000 --- a/google/cloud/iam/iam_credentials_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/credentials/v1/iamcredentials.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CREDENTIALS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CREDENTIALS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/iam/credentials/v1/iam_credentials_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace iam { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// iam_credentials_v1::MakeDefaultIAMCredentialsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::iam_credentials_v1:: - MakeDefaultIAMCredentialsConnectionIdempotencyPolicy; - -/// @deprecated Use -/// iam_credentials_v1::IAMCredentialsConnectionIdempotencyPolicy directly. -using ::google::cloud::iam_credentials_v1:: - IAMCredentialsConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CREDENTIALS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/iam/iam_credentials_options.h b/google/cloud/iam/iam_credentials_options.h deleted file mode 100644 index 349212e767b53..0000000000000 --- a/google/cloud/iam/iam_credentials_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/credentials/v1/iamcredentials.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CREDENTIALS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CREDENTIALS_OPTIONS_H - -#include "google/cloud/iam/credentials/v1/iam_credentials_options.h" -#include "google/cloud/iam/iam_credentials_connection.h" -#include "google/cloud/iam/iam_credentials_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace iam { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iam_credentials_v1::IAMCredentialsBackoffPolicyOption -/// directly. -using ::google::cloud::iam_credentials_v1::IAMCredentialsBackoffPolicyOption; - -/// @deprecated Use -/// iam_credentials_v1::IAMCredentialsConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::iam_credentials_v1:: - IAMCredentialsConnectionIdempotencyPolicyOption; - -/// @deprecated Use iam_credentials_v1::IAMCredentialsPolicyOptionList directly. -using ::google::cloud::iam_credentials_v1::IAMCredentialsPolicyOptionList; - -/// @deprecated Use iam_credentials_v1::IAMCredentialsRetryPolicyOption -/// directly. -using ::google::cloud::iam_credentials_v1::IAMCredentialsRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_CREDENTIALS_OPTIONS_H diff --git a/google/cloud/iam/iam_options.h b/google/cloud/iam/iam_options.h deleted file mode 100644 index 62308f44db96c..0000000000000 --- a/google/cloud/iam/iam_options.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/admin/v1/iam.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_OPTIONS_H - -#include "google/cloud/iam/admin/v1/iam_options.h" -#include "google/cloud/iam/iam_connection.h" -#include "google/cloud/iam/iam_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace iam { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iam_admin_v1::IAMBackoffPolicyOption directly. -using ::google::cloud::iam_admin_v1::IAMBackoffPolicyOption; - -/// @deprecated Use iam_admin_v1::IAMConnectionIdempotencyPolicyOption directly. -using ::google::cloud::iam_admin_v1::IAMConnectionIdempotencyPolicyOption; - -/// @deprecated Use iam_admin_v1::IAMPolicyOptionList directly. -using ::google::cloud::iam_admin_v1::IAMPolicyOptionList; - -/// @deprecated Use iam_admin_v1::IAMRetryPolicyOption directly. -using ::google::cloud::iam_admin_v1::IAMRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_OPTIONS_H diff --git a/google/cloud/iam/iam_policy_client.h b/google/cloud/iam/iam_policy_client.h deleted file mode 100644 index 6f0c8d00d998c..0000000000000 --- a/google/cloud/iam/iam_policy_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/v1/iam_policy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_POLICY_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_POLICY_CLIENT_H - -#include "google/cloud/iam/iam_policy_connection.h" -#include "google/cloud/iam/v1/iam_policy_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in iam_v1 instead of the aliases defined in -/// this namespace. -namespace iam { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iam_v1::IAMPolicyClient directly. -using ::google::cloud::iam_v1::IAMPolicyClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_POLICY_CLIENT_H diff --git a/google/cloud/iam/iam_policy_connection.h b/google/cloud/iam/iam_policy_connection.h deleted file mode 100644 index 96c252989d305..0000000000000 --- a/google/cloud/iam/iam_policy_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/v1/iam_policy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_POLICY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_POLICY_CONNECTION_H - -#include "google/cloud/iam/iam_policy_connection_idempotency_policy.h" -#include "google/cloud/iam/v1/iam_policy_connection.h" - -namespace google { -namespace cloud { -namespace iam { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iam_v1::MakeIAMPolicyConnection directly. -using ::google::cloud::iam_v1::MakeIAMPolicyConnection; - -/// @deprecated Use iam_v1::IAMPolicyConnection directly. -using ::google::cloud::iam_v1::IAMPolicyConnection; - -/// @deprecated Use iam_v1::IAMPolicyLimitedErrorCountRetryPolicy directly. -using ::google::cloud::iam_v1::IAMPolicyLimitedErrorCountRetryPolicy; - -/// @deprecated Use iam_v1::IAMPolicyLimitedTimeRetryPolicy directly. -using ::google::cloud::iam_v1::IAMPolicyLimitedTimeRetryPolicy; - -/// @deprecated Use iam_v1::IAMPolicyRetryPolicy directly. -using ::google::cloud::iam_v1::IAMPolicyRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_POLICY_CONNECTION_H diff --git a/google/cloud/iam/iam_policy_connection_idempotency_policy.h b/google/cloud/iam/iam_policy_connection_idempotency_policy.h deleted file mode 100644 index 2b379ec37eea9..0000000000000 --- a/google/cloud/iam/iam_policy_connection_idempotency_policy.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/v1/iam_policy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/iam/v1/iam_policy_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace iam { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iam_v1::MakeDefaultIAMPolicyConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::iam_v1::MakeDefaultIAMPolicyConnectionIdempotencyPolicy; - -/// @deprecated Use iam_v1::IAMPolicyConnectionIdempotencyPolicy directly. -using ::google::cloud::iam_v1::IAMPolicyConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/iam/iam_policy_options.h b/google/cloud/iam/iam_policy_options.h deleted file mode 100644 index d0e82715d2e5e..0000000000000 --- a/google/cloud/iam/iam_policy_options.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/v1/iam_policy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_POLICY_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_POLICY_OPTIONS_H - -#include "google/cloud/iam/iam_policy_connection.h" -#include "google/cloud/iam/iam_policy_connection_idempotency_policy.h" -#include "google/cloud/iam/v1/iam_policy_options.h" - -namespace google { -namespace cloud { -namespace iam { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iam_v1::IAMPolicyBackoffPolicyOption directly. -using ::google::cloud::iam_v1::IAMPolicyBackoffPolicyOption; - -/// @deprecated Use iam_v1::IAMPolicyConnectionIdempotencyPolicyOption directly. -using ::google::cloud::iam_v1::IAMPolicyConnectionIdempotencyPolicyOption; - -/// @deprecated Use iam_v1::IAMPolicyPolicyOptionList directly. -using ::google::cloud::iam_v1::IAMPolicyPolicyOptionList; - -/// @deprecated Use iam_v1::IAMPolicyRetryPolicyOption directly. -using ::google::cloud::iam_v1::IAMPolicyRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_IAM_POLICY_OPTIONS_H diff --git a/google/cloud/iam/mocks/mock_iam_connection.h b/google/cloud/iam/mocks/mock_iam_connection.h deleted file mode 100644 index df785c272b924..0000000000000 --- a/google/cloud/iam/mocks/mock_iam_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/admin/v1/iam.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_MOCKS_MOCK_IAM_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_MOCKS_MOCK_IAM_CONNECTION_H - -#include "google/cloud/iam/admin/v1/mocks/mock_iam_connection.h" -#include "google/cloud/iam/iam_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in iam_admin_v1_mocks instead of the aliases -/// defined in this namespace. -namespace iam_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iam_admin_v1_mocks::MockIAMConnection directly. -using ::google::cloud::iam_admin_v1_mocks::MockIAMConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_MOCKS_MOCK_IAM_CONNECTION_H diff --git a/google/cloud/iam/mocks/mock_iam_credentials_connection.h b/google/cloud/iam/mocks/mock_iam_credentials_connection.h deleted file mode 100644 index 64f3534d55567..0000000000000 --- a/google/cloud/iam/mocks/mock_iam_credentials_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/credentials/v1/iamcredentials.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_MOCKS_MOCK_IAM_CREDENTIALS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_MOCKS_MOCK_IAM_CREDENTIALS_CONNECTION_H - -#include "google/cloud/iam/credentials/v1/mocks/mock_iam_credentials_connection.h" -#include "google/cloud/iam/iam_credentials_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in iam_credentials_v1_mocks instead of the aliases -/// defined in this namespace. -namespace iam_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iam_credentials_v1_mocks::MockIAMCredentialsConnection -/// directly. -using ::google::cloud::iam_credentials_v1_mocks::MockIAMCredentialsConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_MOCKS_MOCK_IAM_CREDENTIALS_CONNECTION_H diff --git a/google/cloud/iam/mocks/mock_iam_policy_connection.h b/google/cloud/iam/mocks/mock_iam_policy_connection.h deleted file mode 100644 index cb6d8120d8548..0000000000000 --- a/google/cloud/iam/mocks/mock_iam_policy_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/iam/v1/iam_policy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_MOCKS_MOCK_IAM_POLICY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_MOCKS_MOCK_IAM_POLICY_CONNECTION_H - -#include "google/cloud/iam/iam_policy_connection.h" -#include "google/cloud/iam/v1/mocks/mock_iam_policy_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in iam_v1_mocks instead of the aliases -/// defined in this namespace. -namespace iam_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iam_v1_mocks::MockIAMPolicyConnection directly. -using ::google::cloud::iam_v1_mocks::MockIAMPolicyConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iam_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_MOCKS_MOCK_IAM_POLICY_CONNECTION_H diff --git a/google/cloud/iam/quickstart/.bazelrc b/google/cloud/iam/quickstart/.bazelrc index f8f4bb3e07a87..1ccef142904e8 100644 --- a/google/cloud/iam/quickstart/.bazelrc +++ b/google/cloud/iam/quickstart/.bazelrc @@ -15,19 +15,12 @@ # 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 +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 - -#Our quickstarts do not yet support bzlmod -build --noenable_bzlmod 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/CMakeLists.txt b/google/cloud/iam/quickstart/CMakeLists.txt index 583ca86facafc..8c2092d92cc0f 100644 --- a/google/cloud/iam/quickstart/CMakeLists.txt +++ b/google/cloud/iam/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # A minimal CMakeList.txt showing how to use the Cloud IAM C++ client library in # CMake-based projects. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-iam-quickstart CXX) find_package(google_cloud_cpp_iam REQUIRED) diff --git a/google/cloud/iam/quickstart/MODULE.bazel b/google/cloud/iam/quickstart/MODULE.bazel new file mode 100644 index 0000000000000..e47bfb6fa8af0 --- /dev/null +++ b/google/cloud/iam/quickstart/MODULE.bazel @@ -0,0 +1,20 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +module( + name = "quickstart", + version = "0.0.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 5950b45ec06bf..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 = "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/iam/quickstart/bazel/BUILD.bazel b/google/cloud/iam/quickstart/bazel/BUILD.bazel new file mode 100644 index 0000000000000..9d3c52804de76 --- /dev/null +++ b/google/cloud/iam/quickstart/bazel/BUILD.bazel @@ -0,0 +1,17 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 v2 + +package(default_visibility = ["//:__subpackages__"]) diff --git a/google/cloud/iam/quickstart/bazel/remove_upb_c_rules.patch b/google/cloud/iam/quickstart/bazel/remove_upb_c_rules.patch new file mode 100644 index 0000000000000..43b077224c29d --- /dev/null +++ b/google/cloud/iam/quickstart/bazel/remove_upb_c_rules.patch @@ -0,0 +1,124 @@ +diff --git google/api/expr/v1alpha1/BUILD.bazel google/api/expr/v1alpha1/BUILD.bazel +index 9bed46809..197e5249c 100644 +--- google/api/expr/v1alpha1/BUILD.bazel ++++ google/api/expr/v1alpha1/BUILD.bazel +@@ -233,32 +233,32 @@ cc_proto_library( + ############################################################################## + # upb + ############################################################################## +-load( +- "@com_google_googleapis_imports//:imports.bzl", +- "upb_c_proto_library", +-) +- +-upb_c_proto_library( +- name = "checked_upb_proto", +- deps = [":checked_proto"], +-) +- +-upb_c_proto_library( +- name = "eval_upb_proto", +- deps = [":eval_proto"], +-) +- +-upb_c_proto_library( +- name = "explain_upb_proto", +- deps = [":explain_proto"], +-) +- +-upb_c_proto_library( +- name = "syntax_upb_proto", +- deps = [":syntax_proto"], +-) +- +-upb_c_proto_library( +- name = "value_upb_proto", +- deps = [":value_proto"], +-) ++#load( ++ #"@com_google_googleapis_imports//:imports.bzl", ++ #"upb_c_proto_library", ++#) ++# ++#upb_c_proto_library( ++ #name = "checked_upb_proto", ++ #deps = [":checked_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "eval_upb_proto", ++ #deps = [":eval_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "explain_upb_proto", ++ #deps = [":explain_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "syntax_upb_proto", ++ #deps = [":syntax_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "value_upb_proto", ++ #deps = [":value_proto"], ++#) +diff --git google/rpc/BUILD.bazel google/rpc/BUILD.bazel +index 31fd6457d..c38f00c46 100644 +--- google/rpc/BUILD.bazel ++++ google/rpc/BUILD.bazel +@@ -11,7 +11,7 @@ load( + "php_proto_library", + "py_gapic_assembly_pkg", + "py_proto_library", +- "upb_c_proto_library", ++ #"upb_c_proto_library", + ) + load("@rules_proto//proto:defs.bzl", "proto_library") + +@@ -104,15 +104,15 @@ cc_proto_library( + deps = [":status_proto"], + ) + +-upb_c_proto_library( +- name = "code_upb_proto", +- deps = [":code_proto"], +-) ++#upb_c_proto_library( ++ #name = "code_upb_proto", ++ #deps = [":code_proto"], ++#) + +-upb_c_proto_library( +- name = "status_upb_proto", +- deps = [":status_proto"], +-) ++#upb_c_proto_library( ++ #name = "status_upb_proto", ++ #deps = [":status_proto"], ++#) + + py_proto_library( + name = "code_py_proto", +diff --git repository_rules.bzl repository_rules.bzl +index 2f87ad682..2ab3bd054 100644 +--- repository_rules.bzl ++++ repository_rules.bzl +@@ -224,11 +224,11 @@ def switched_rules_by_language( + # + # upb + # +- rules["upb_c_proto_library"] = _switch( +- upb, +- "@com_google_protobuf//bazel:upb_c_proto_library.bzl", +- "upb_c_proto_library", +- ) ++ #rules["upb_c_proto_library"] = _switch( ++ # upb, ++ # "@com_google_protobuf//bazel:upb_c_proto_library.bzl", ++ # "upb_c_proto_library", ++ #) + + # + # PHP diff --git a/google/cloud/iam/retry_traits.h b/google/cloud/iam/retry_traits.h deleted file mode 100644 index 963f4491785b5..0000000000000 --- a/google/cloud/iam/retry_traits.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_IAM_RETRY_TRAITS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_RETRY_TRAITS_H - -#include "google/cloud/iam/admin/v1/internal/iam_retry_traits.h" -#include "google/cloud/iam/credentials/v1/internal/iam_credentials_retry_traits.h" -#warning "This header is deprecated, it only provided internal symbols" - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_RETRY_TRAITS_H diff --git a/google/cloud/iam/samples/iam_credentials_samples.cc b/google/cloud/iam/samples/iam_credentials_samples.cc index b56f1b283604b..d6ad38ccb5f3f 100644 --- a/google/cloud/iam/samples/iam_credentials_samples.cc +++ b/google/cloud/iam/samples/iam_credentials_samples.cc @@ -13,9 +13,9 @@ // limitations under the License. #include "google/cloud/iam/credentials/v1/iam_credentials_client.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/testing_util/example_driver.h" +#include "absl/strings/str_cat.h" namespace { diff --git a/google/cloud/iam/samples/iam_samples.cc b/google/cloud/iam/samples/iam_samples.cc index 1d2e19e179c02..893caecca0a9c 100644 --- a/google/cloud/iam/samples/iam_samples.cc +++ b/google/cloud/iam/samples/iam_samples.cc @@ -13,10 +13,10 @@ // limitations under the License. #include "google/cloud/iam/admin/v1/iam_client.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/random.h" #include "google/cloud/testing_util/example_driver.h" +#include "absl/strings/str_cat.h" #include "absl/time/clock.h" #include "absl/time/time.h" #include diff --git a/google/cloud/iam/v1/iam_policy_connection.h b/google/cloud/iam/v1/iam_policy_connection.h index 80a1fca3574c4..05f4cb6d5f835 100644 --- a/google/cloud/iam/v1/iam_policy_connection.h +++ b/google/cloud/iam/v1/iam_policy_connection.h @@ -26,7 +26,7 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/iam/v1/iam_policy.pb.h" #include namespace google { diff --git a/google/cloud/iam/v1/iam_policy_connection_idempotency_policy.h b/google/cloud/iam/v1/iam_policy_connection_idempotency_policy.h index fb699a0001edb..e945d69feb8a8 100644 --- a/google/cloud/iam/v1/iam_policy_connection_idempotency_policy.h +++ b/google/cloud/iam/v1/iam_policy_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" #include namespace google { diff --git a/google/cloud/iam/v1/internal/iam_policy_auth_decorator.cc b/google/cloud/iam/v1/internal/iam_policy_auth_decorator.cc index 132c820ef4348..54502b88735c7 100644 --- a/google/cloud/iam/v1/internal/iam_policy_auth_decorator.cc +++ b/google/cloud/iam/v1/internal/iam_policy_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/iam/v1/iam_policy.proto #include "google/cloud/iam/v1/internal/iam_policy_auth_decorator.h" -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v1_internal { @@ -60,3 +63,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v1/internal/iam_policy_auth_decorator.h b/google/cloud/iam/v1/internal/iam_policy_auth_decorator.h index 322ebc99b922d..f8c7f9bbfd938 100644 --- a/google/cloud/iam/v1/internal/iam_policy_auth_decorator.h +++ b/google/cloud/iam/v1/internal/iam_policy_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v1_internal { @@ -60,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V1_INTERNAL_IAM_POLICY_AUTH_DECORATOR_H diff --git a/google/cloud/iam/v1/internal/iam_policy_logging_decorator.cc b/google/cloud/iam/v1/internal/iam_policy_logging_decorator.cc index 329bb9e72bcf5..bbd5b1d3ceb50 100644 --- a/google/cloud/iam/v1/internal/iam_policy_logging_decorator.cc +++ b/google/cloud/iam/v1/internal/iam_policy_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/iam/v1/internal/iam_policy_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v1/internal/iam_policy_logging_decorator.h b/google/cloud/iam/v1/internal/iam_policy_logging_decorator.h index c3b77a56bbe06..e52dc804dcfba 100644 --- a/google/cloud/iam/v1/internal/iam_policy_logging_decorator.h +++ b/google/cloud/iam/v1/internal/iam_policy_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v1_internal { @@ -60,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V1_INTERNAL_IAM_POLICY_LOGGING_DECORATOR_H diff --git a/google/cloud/iam/v1/internal/iam_policy_metadata_decorator.cc b/google/cloud/iam/v1/internal/iam_policy_metadata_decorator.cc index 298becde94ff8..d3a49292f049b 100644 --- a/google/cloud/iam/v1/internal/iam_policy_metadata_decorator.cc +++ b/google/cloud/iam/v1/internal/iam_policy_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/iam/v1/internal/iam_policy_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/iam/v1/iam_policy.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v1_internal { @@ -89,3 +93,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v1/internal/iam_policy_metadata_decorator.h b/google/cloud/iam/v1/internal/iam_policy_metadata_decorator.h index ed5b417222335..82320aea07f8b 100644 --- a/google/cloud/iam/v1/internal/iam_policy_metadata_decorator.h +++ b/google/cloud/iam/v1/internal/iam_policy_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v1_internal { @@ -65,4 +68,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V1_INTERNAL_IAM_POLICY_METADATA_DECORATOR_H diff --git a/google/cloud/iam/v1/internal/iam_policy_option_defaults.cc b/google/cloud/iam/v1/internal/iam_policy_option_defaults.cc index f9ef336571308..97b3593a18342 100644 --- a/google/cloud/iam/v1/internal/iam_policy_option_defaults.cc +++ b/google/cloud/iam/v1/internal/iam_policy_option_defaults.cc @@ -40,7 +40,7 @@ Options IAMPolicyDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - iam_v1::IAMPolicyLimitedTimeRetryPolicy(std::chrono::minutes(30)) + iam_v1::IAMPolicyLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/iam/v1/internal/iam_policy_stub.cc b/google/cloud/iam/v1/internal/iam_policy_stub.cc index c8dd08d63e973..2341d87bda527 100644 --- a/google/cloud/iam/v1/internal/iam_policy_stub.cc +++ b/google/cloud/iam/v1/internal/iam_policy_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/iam/v1/internal/iam_policy_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v1/internal/iam_policy_stub.h b/google/cloud/iam/v1/internal/iam_policy_stub.h index 84764974b5d0b..9bc43fd7e405e 100644 --- a/google/cloud/iam/v1/internal/iam_policy_stub.h +++ b/google/cloud/iam/v1/internal/iam_policy_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v1_internal { @@ -76,4 +79,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V1_INTERNAL_IAM_POLICY_STUB_H diff --git a/google/cloud/iam/v1/internal/iam_policy_stub_factory.cc b/google/cloud/iam/v1/internal/iam_policy_stub_factory.cc index d8e33dfbb4861..d9f11a285d937 100644 --- a/google/cloud/iam/v1/internal/iam_policy_stub_factory.cc +++ b/google/cloud/iam/v1/internal/iam_policy_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v1_internal { @@ -67,3 +70,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v1/internal/iam_policy_stub_factory.h b/google/cloud/iam/v1/internal/iam_policy_stub_factory.h index 4882001fc4f7f..99232115d3b4b 100644 --- a/google/cloud/iam/v1/internal/iam_policy_stub_factory.h +++ b/google/cloud/iam/v1/internal/iam_policy_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V1_INTERNAL_IAM_POLICY_STUB_FACTORY_H diff --git a/google/cloud/iam/v1/internal/iam_policy_tracing_connection.cc b/google/cloud/iam/v1/internal/iam_policy_tracing_connection.cc index ec90d506736e5..80444fd03ef50 100644 --- a/google/cloud/iam/v1/internal/iam_policy_tracing_connection.cc +++ b/google/cloud/iam/v1/internal/iam_policy_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace iam_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IAMPolicyTracingConnection::IAMPolicyTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -55,15 +53,11 @@ IAMPolicyTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIAMPolicyTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/iam/v1/internal/iam_policy_tracing_connection.h b/google/cloud/iam/v1/internal/iam_policy_tracing_connection.h index 4ee8c9154e52b..0dd3009b0f3ec 100644 --- a/google/cloud/iam/v1/internal/iam_policy_tracing_connection.h +++ b/google/cloud/iam/v1/internal/iam_policy_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace iam_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IAMPolicyTracingConnection : public iam_v1::IAMPolicyConnection { public: ~IAMPolicyTracingConnection() override = default; @@ -52,8 +50,6 @@ class IAMPolicyTracingConnection : public iam_v1::IAMPolicyConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/iam/v1/internal/iam_policy_tracing_stub.cc b/google/cloud/iam/v1/internal/iam_policy_tracing_stub.cc index 6e7c73b747951..827df9ecc59f0 100644 --- a/google/cloud/iam/v1/internal/iam_policy_tracing_stub.cc +++ b/google/cloud/iam/v1/internal/iam_policy_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IAMPolicyTracingStub::IAMPolicyTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -63,18 +64,14 @@ IAMPolicyTracingStub::TestIamPermissions( context, *span, child_->TestIamPermissions(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIAMPolicyTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v1/internal/iam_policy_tracing_stub.h b/google/cloud/iam/v1/internal/iam_policy_tracing_stub.h index 5305c06757ad2..d0b5b47a095e3 100644 --- a/google/cloud/iam/v1/internal/iam_policy_tracing_stub.h +++ b/google/cloud/iam/v1/internal/iam_policy_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IAMPolicyTracingStub : public IAMPolicyStub { public: ~IAMPolicyTracingStub() override = default; @@ -56,8 +57,6 @@ class IAMPolicyTracingStub : public IAMPolicyStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -72,4 +71,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V1_INTERNAL_IAM_POLICY_TRACING_STUB_H diff --git a/google/cloud/iam/v2/internal/policies_auth_decorator.cc b/google/cloud/iam/v2/internal/policies_auth_decorator.cc index af9f6d2f7218c..051ca906fc31a 100644 --- a/google/cloud/iam/v2/internal/policies_auth_decorator.cc +++ b/google/cloud/iam/v2/internal/policies_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/iam/v2/policy.proto #include "google/cloud/iam/v2/internal/policies_auth_decorator.h" -#include +#include "google/iam/v2/policy.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v2_internal { @@ -179,3 +182,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v2/internal/policies_auth_decorator.h b/google/cloud/iam/v2/internal/policies_auth_decorator.h index a17107127e74e..46bf0587f1b5f 100644 --- a/google/cloud/iam/v2/internal/policies_auth_decorator.h +++ b/google/cloud/iam/v2/internal/policies_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/iam/v2/internal/policies_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 iam_v2_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V2_INTERNAL_POLICIES_AUTH_DECORATOR_H diff --git a/google/cloud/iam/v2/internal/policies_connection_impl.h b/google/cloud/iam/v2/internal/policies_connection_impl.h index e8359f1e3cf05..392ac6cb99e37 100644 --- a/google/cloud/iam/v2/internal/policies_connection_impl.h +++ b/google/cloud/iam/v2/internal/policies_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/iam/v2/internal/policies_logging_decorator.cc b/google/cloud/iam/v2/internal/policies_logging_decorator.cc index f2089d6ea058f..dbd1fc338629e 100644 --- a/google/cloud/iam/v2/internal/policies_logging_decorator.cc +++ b/google/cloud/iam/v2/internal/policies_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/iam/v2/internal/policies_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/iam/v2/policy.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v2_internal { @@ -194,3 +197,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v2/internal/policies_logging_decorator.h b/google/cloud/iam/v2/internal/policies_logging_decorator.h index 20aaaee39f299..f450cca2cd3f5 100644 --- a/google/cloud/iam/v2/internal/policies_logging_decorator.h +++ b/google/cloud/iam/v2/internal/policies_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/iam/v2/internal/policies_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 iam_v2_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V2_INTERNAL_POLICIES_LOGGING_DECORATOR_H diff --git a/google/cloud/iam/v2/internal/policies_metadata_decorator.cc b/google/cloud/iam/v2/internal/policies_metadata_decorator.cc index b2e38d4e46d44..9fc80e16dccba 100644 --- a/google/cloud/iam/v2/internal/policies_metadata_decorator.cc +++ b/google/cloud/iam/v2/internal/policies_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/iam/v2/internal/policies_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/iam/v2/policy.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v2_internal { @@ -170,3 +174,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v2/internal/policies_metadata_decorator.h b/google/cloud/iam/v2/internal/policies_metadata_decorator.h index 3144b3f5ddd6b..282d51602ffa7 100644 --- a/google/cloud/iam/v2/internal/policies_metadata_decorator.h +++ b/google/cloud/iam/v2/internal/policies_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/iam/v2/internal/policies_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 iam_v2_internal { @@ -108,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V2_INTERNAL_POLICIES_METADATA_DECORATOR_H diff --git a/google/cloud/iam/v2/internal/policies_option_defaults.cc b/google/cloud/iam/v2/internal/policies_option_defaults.cc index b673c6db3267b..c676aeecfec69 100644 --- a/google/cloud/iam/v2/internal/policies_option_defaults.cc +++ b/google/cloud/iam/v2/internal/policies_option_defaults.cc @@ -40,7 +40,7 @@ Options PoliciesDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - iam_v2::PoliciesLimitedTimeRetryPolicy(std::chrono::minutes(30)) + iam_v2::PoliciesLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/iam/v2/internal/policies_stub.cc b/google/cloud/iam/v2/internal/policies_stub.cc index 868fefa73c4da..90bad90682859 100644 --- a/google/cloud/iam/v2/internal/policies_stub.cc +++ b/google/cloud/iam/v2/internal/policies_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/iam/v2/internal/policies_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/iam/v2/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 iam_v2_internal { @@ -192,3 +195,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v2/internal/policies_stub.h b/google/cloud/iam/v2/internal/policies_stub.h index 2d472fe15ddf5..ed967e6470e95 100644 --- a/google/cloud/iam/v2/internal/policies_stub.h +++ b/google/cloud/iam/v2/internal/policies_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v2/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 iam_v2_internal { @@ -167,4 +170,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V2_INTERNAL_POLICIES_STUB_H diff --git a/google/cloud/iam/v2/internal/policies_stub_factory.cc b/google/cloud/iam/v2/internal/policies_stub_factory.cc index 9c17295d5b073..cfc9fa8c00031 100644 --- a/google/cloud/iam/v2/internal/policies_stub_factory.cc +++ b/google/cloud/iam/v2/internal/policies_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/iam/v2/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 iam_v2_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v2/internal/policies_stub_factory.h b/google/cloud/iam/v2/internal/policies_stub_factory.h index 398b6b3d2fa5f..bc5bb338a6e2c 100644 --- a/google/cloud/iam/v2/internal/policies_stub_factory.h +++ b/google/cloud/iam/v2/internal/policies_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V2_INTERNAL_POLICIES_STUB_FACTORY_H diff --git a/google/cloud/iam/v2/internal/policies_tracing_connection.cc b/google/cloud/iam/v2/internal/policies_tracing_connection.cc index 82c488c45ec00..ef87c14d40bc3 100644 --- a/google/cloud/iam/v2/internal/policies_tracing_connection.cc +++ b/google/cloud/iam/v2/internal/policies_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace iam_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PoliciesTracingConnection::PoliciesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -129,15 +127,11 @@ PoliciesTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePoliciesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/iam/v2/internal/policies_tracing_connection.h b/google/cloud/iam/v2/internal/policies_tracing_connection.h index 8f7c74bd5a0c1..84adf255cdc53 100644 --- a/google/cloud/iam/v2/internal/policies_tracing_connection.h +++ b/google/cloud/iam/v2/internal/policies_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace iam_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PoliciesTracingConnection : public iam_v2::PoliciesConnection { public: ~PoliciesTracingConnection() override = default; @@ -79,8 +77,6 @@ class PoliciesTracingConnection : public iam_v2::PoliciesConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/iam/v2/internal/policies_tracing_stub.cc b/google/cloud/iam/v2/internal/policies_tracing_stub.cc index bfc1c57ce57d8..a21db44803a55 100644 --- a/google/cloud/iam/v2/internal/policies_tracing_stub.cc +++ b/google/cloud/iam/v2/internal/policies_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PoliciesTracingStub::PoliciesTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -159,18 +160,14 @@ future PoliciesTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePoliciesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v2/internal/policies_tracing_stub.h b/google/cloud/iam/v2/internal/policies_tracing_stub.h index 90b49071b1f8d..e7ef9d3afce04 100644 --- a/google/cloud/iam/v2/internal/policies_tracing_stub.h +++ b/google/cloud/iam/v2/internal/policies_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PoliciesTracingStub : public PoliciesStub { public: ~PoliciesTracingStub() override = default; @@ -98,8 +99,6 @@ class PoliciesTracingStub : public PoliciesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -114,4 +113,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V2_INTERNAL_POLICIES_TRACING_STUB_H diff --git a/google/cloud/iam/v2/policies_client.h b/google/cloud/iam/v2/policies_client.h index d536953120891..73a52a72362d9 100644 --- a/google/cloud/iam/v2/policies_client.h +++ b/google/cloud/iam/v2/policies_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/iam/v2/policies_connection.h b/google/cloud/iam/v2/policies_connection.h index fe20aec0e7c99..f01f20979d336 100644 --- a/google/cloud/iam/v2/policies_connection.h +++ b/google/cloud/iam/v2/policies_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v2/policy.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/iam/v2/policies_connection_idempotency_policy.h b/google/cloud/iam/v2/policies_connection_idempotency_policy.h index 611fc49d61c21..e033ae9445c3b 100644 --- a/google/cloud/iam/v2/policies_connection_idempotency_policy.h +++ b/google/cloud/iam/v2/policies_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v2/policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/iam/v3/internal/policy_bindings_auth_decorator.cc b/google/cloud/iam/v3/internal/policy_bindings_auth_decorator.cc index 21f2cf5984a01..6932ad1e223e6 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_auth_decorator.cc +++ b/google/cloud/iam/v3/internal/policy_bindings_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/iam/v3/policy_bindings_service.proto #include "google/cloud/iam/v3/internal/policy_bindings_auth_decorator.h" -#include +#include "google/iam/v3/policy_bindings_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v3_internal { @@ -192,3 +195,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v3/internal/policy_bindings_auth_decorator.h b/google/cloud/iam/v3/internal/policy_bindings_auth_decorator.h index d93b241d9d2f7..f68073f0ce31d 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_auth_decorator.h +++ b/google/cloud/iam/v3/internal/policy_bindings_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/iam/v3/internal/policy_bindings_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 iam_v3_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V3_INTERNAL_POLICY_BINDINGS_AUTH_DECORATOR_H diff --git a/google/cloud/iam/v3/internal/policy_bindings_connection_impl.h b/google/cloud/iam/v3/internal/policy_bindings_connection_impl.h index 6e1d75d0e0506..1dbb6004dcfe4 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_connection_impl.h +++ b/google/cloud/iam/v3/internal/policy_bindings_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/iam/v3/internal/policy_bindings_logging_decorator.cc b/google/cloud/iam/v3/internal/policy_bindings_logging_decorator.cc index 19e38541dba59..86168722d0336 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_logging_decorator.cc +++ b/google/cloud/iam/v3/internal/policy_bindings_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/iam/v3/internal/policy_bindings_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/iam/v3/policy_bindings_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v3_internal { @@ -212,3 +215,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v3/internal/policy_bindings_logging_decorator.h b/google/cloud/iam/v3/internal/policy_bindings_logging_decorator.h index f7d48ec1bd76d..3849f72624af1 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_logging_decorator.h +++ b/google/cloud/iam/v3/internal/policy_bindings_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/iam/v3/internal/policy_bindings_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 iam_v3_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V3_INTERNAL_POLICY_BINDINGS_LOGGING_DECORATOR_H diff --git a/google/cloud/iam/v3/internal/policy_bindings_metadata_decorator.cc b/google/cloud/iam/v3/internal/policy_bindings_metadata_decorator.cc index ec19246c0cf40..7830fc0e30be3 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_metadata_decorator.cc +++ b/google/cloud/iam/v3/internal/policy_bindings_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/iam/v3/internal/policy_bindings_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/iam/v3/policy_bindings_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v3_internal { @@ -186,3 +190,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v3/internal/policy_bindings_metadata_decorator.h b/google/cloud/iam/v3/internal/policy_bindings_metadata_decorator.h index 3ccd82185f4aa..155f1e550cdd7 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_metadata_decorator.h +++ b/google/cloud/iam/v3/internal/policy_bindings_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/iam/v3/internal/policy_bindings_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 iam_v3_internal { @@ -114,4 +117,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V3_INTERNAL_POLICY_BINDINGS_METADATA_DECORATOR_H diff --git a/google/cloud/iam/v3/internal/policy_bindings_option_defaults.cc b/google/cloud/iam/v3/internal/policy_bindings_option_defaults.cc index 67f08d3892321..7630cdf4b3921 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_option_defaults.cc +++ b/google/cloud/iam/v3/internal/policy_bindings_option_defaults.cc @@ -40,7 +40,7 @@ Options PolicyBindingsDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - iam_v3::PolicyBindingsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + iam_v3::PolicyBindingsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/iam/v3/internal/policy_bindings_stub.cc b/google/cloud/iam/v3/internal/policy_bindings_stub.cc index 625aab21a7f23..cab7623b00edc 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_stub.cc +++ b/google/cloud/iam/v3/internal/policy_bindings_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/iam/v3/internal/policy_bindings_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/iam/v3/policy_bindings_service.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 iam_v3_internal { @@ -210,3 +213,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v3/internal/policy_bindings_stub.h b/google/cloud/iam/v3/internal/policy_bindings_stub.h index 8ba9339dd6f54..bd63096c3cdfa 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_stub.h +++ b/google/cloud/iam/v3/internal/policy_bindings_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v3/policy_bindings_service.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 iam_v3_internal { @@ -182,4 +185,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V3_INTERNAL_POLICY_BINDINGS_STUB_H diff --git a/google/cloud/iam/v3/internal/policy_bindings_stub_factory.cc b/google/cloud/iam/v3/internal/policy_bindings_stub_factory.cc index 8a67bad0d46a4..49c987c9bc3c2 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_stub_factory.cc +++ b/google/cloud/iam/v3/internal/policy_bindings_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/iam/v3/policy_bindings_service.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 iam_v3_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v3/internal/policy_bindings_stub_factory.h b/google/cloud/iam/v3/internal/policy_bindings_stub_factory.h index ca261b13e60e2..7c98ccae28a15 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_stub_factory.h +++ b/google/cloud/iam/v3/internal/policy_bindings_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V3_INTERNAL_POLICY_BINDINGS_STUB_FACTORY_H diff --git a/google/cloud/iam/v3/internal/policy_bindings_tracing_connection.cc b/google/cloud/iam/v3/internal/policy_bindings_tracing_connection.cc index f587893f2dee4..d2739fd32c860 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_tracing_connection.cc +++ b/google/cloud/iam/v3/internal/policy_bindings_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace iam_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PolicyBindingsTracingConnection::PolicyBindingsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -163,16 +161,12 @@ PolicyBindingsTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePolicyBindingsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/iam/v3/internal/policy_bindings_tracing_connection.h b/google/cloud/iam/v3/internal/policy_bindings_tracing_connection.h index 8733c0aa3fbd2..3b83b6d1f523d 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_tracing_connection.h +++ b/google/cloud/iam/v3/internal/policy_bindings_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace iam_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PolicyBindingsTracingConnection : public iam_v3::PolicyBindingsConnection { public: @@ -86,8 +84,6 @@ class PolicyBindingsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/iam/v3/internal/policy_bindings_tracing_stub.cc b/google/cloud/iam/v3/internal/policy_bindings_tracing_stub.cc index e0d6e3a47acf8..278c296054f78 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_tracing_stub.cc +++ b/google/cloud/iam/v3/internal/policy_bindings_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PolicyBindingsTracingStub::PolicyBindingsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -190,18 +191,14 @@ future PolicyBindingsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePolicyBindingsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v3/internal/policy_bindings_tracing_stub.h b/google/cloud/iam/v3/internal/policy_bindings_tracing_stub.h index 69d89d0bb9665..c277c309ef10d 100644 --- a/google/cloud/iam/v3/internal/policy_bindings_tracing_stub.h +++ b/google/cloud/iam/v3/internal/policy_bindings_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PolicyBindingsTracingStub : public PolicyBindingsStub { public: ~PolicyBindingsTracingStub() override = default; @@ -104,8 +105,6 @@ class PolicyBindingsTracingStub : public PolicyBindingsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -120,4 +119,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V3_INTERNAL_POLICY_BINDINGS_TRACING_STUB_H diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_auth_decorator.cc b/google/cloud/iam/v3/internal/principal_access_boundary_policies_auth_decorator.cc index 67a5e835c3835..fa43fdfbcc83e 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_auth_decorator.cc +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/iam/v3/principal_access_boundary_policies_service.proto #include "google/cloud/iam/v3/internal/principal_access_boundary_policies_auth_decorator.h" -#include +#include "google/iam/v3/principal_access_boundary_policies_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v3_internal { @@ -204,3 +207,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_auth_decorator.h b/google/cloud/iam/v3/internal/principal_access_boundary_policies_auth_decorator.h index 5afdb6b511a8f..a65defead176b 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_auth_decorator.h +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/iam/v3/internal/principal_access_boundary_policies_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 iam_v3_internal { @@ -123,4 +126,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V3_INTERNAL_PRINCIPAL_ACCESS_BOUNDARY_POLICIES_AUTH_DECORATOR_H diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_connection_impl.h b/google/cloud/iam/v3/internal/principal_access_boundary_policies_connection_impl.h index 10cb8c364979d..ea0a2b6b4d5c8 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_connection_impl.h +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_logging_decorator.cc b/google/cloud/iam/v3/internal/principal_access_boundary_policies_logging_decorator.cc index a58318c46f9aa..e7a4b2bef6259 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_logging_decorator.cc +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/iam/v3/internal/principal_access_boundary_policies_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/iam/v3/principal_access_boundary_policies_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v3_internal { @@ -240,3 +243,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_logging_decorator.h b/google/cloud/iam/v3/internal/principal_access_boundary_policies_logging_decorator.h index 60b42cb6554ba..04bf23f3c649f 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_logging_decorator.h +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/iam/v3/internal/principal_access_boundary_policies_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 iam_v3_internal { @@ -123,4 +126,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V3_INTERNAL_PRINCIPAL_ACCESS_BOUNDARY_POLICIES_LOGGING_DECORATOR_H diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_metadata_decorator.cc b/google/cloud/iam/v3/internal/principal_access_boundary_policies_metadata_decorator.cc index 04383197af513..d6f81141962d2 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_metadata_decorator.cc +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/iam/v3/internal/principal_access_boundary_policies_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/iam/v3/principal_access_boundary_policies_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v3_internal { @@ -203,3 +207,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_metadata_decorator.h b/google/cloud/iam/v3/internal/principal_access_boundary_policies_metadata_decorator.h index f59528c0aa034..8f35897d2ebaf 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_metadata_decorator.h +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/iam/v3/internal/principal_access_boundary_policies_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 iam_v3_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V3_INTERNAL_PRINCIPAL_ACCESS_BOUNDARY_POLICIES_METADATA_DECORATOR_H diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_option_defaults.cc b/google/cloud/iam/v3/internal/principal_access_boundary_policies_option_defaults.cc index c8626c455d1f6..5c5186e19c412 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_option_defaults.cc +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_option_defaults.cc @@ -44,7 +44,7 @@ Options PrincipalAccessBoundaryPoliciesDefaultOptions(Options options) { .has()) { options.set( iam_v3::PrincipalAccessBoundaryPoliciesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub.cc b/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub.cc index 8013ddfe32f1b..c8fe7b7f583e3 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub.cc +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/iam/v3/internal/principal_access_boundary_policies_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/iam/v3/principal_access_boundary_policies_service.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 iam_v3_internal { @@ -237,3 +240,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub.h b/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub.h index e80d4c14de174..2168b9f5a7882 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub.h +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v3/principal_access_boundary_policies_service.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 iam_v3_internal { @@ -214,4 +217,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V3_INTERNAL_PRINCIPAL_ACCESS_BOUNDARY_POLICIES_STUB_H diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub_factory.cc b/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub_factory.cc index 05a8494d50c0d..ecc446440d892 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub_factory.cc +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/iam/v3/principal_access_boundary_policies_service.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 iam_v3_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub_factory.h b/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub_factory.h index 9ba1fe6f41240..f1eba01ffa0a3 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub_factory.h +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v3_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V3_INTERNAL_PRINCIPAL_ACCESS_BOUNDARY_POLICIES_STUB_FACTORY_H diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_connection.cc b/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_connection.cc index 040a2432b9562..e351669c5b600 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_connection.cc +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace iam_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PrincipalAccessBoundaryPoliciesTracingConnection:: PrincipalAccessBoundaryPoliciesTracingConnection( std::shared_ptr @@ -203,17 +201,13 @@ PrincipalAccessBoundaryPoliciesTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePrincipalAccessBoundaryPoliciesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_connection.h b/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_connection.h index d9a17537bebeb..1f12b9164883b 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_connection.h +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace iam_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PrincipalAccessBoundaryPoliciesTracingConnection : public iam_v3::PrincipalAccessBoundaryPoliciesConnection { public: @@ -104,8 +102,6 @@ class PrincipalAccessBoundaryPoliciesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_stub.cc b/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_stub.cc index 5f3501a7b14c1..70054fa65d5ae 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_stub.cc +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PrincipalAccessBoundaryPoliciesTracingStub:: PrincipalAccessBoundaryPoliciesTracingStub( std::shared_ptr child) @@ -217,20 +218,16 @@ future PrincipalAccessBoundaryPoliciesTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePrincipalAccessBoundaryPoliciesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_stub.h b/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_stub.h index 24e3a5edfd9ea..d725cfb3e59d6 100644 --- a/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_stub.h +++ b/google/cloud/iam/v3/internal/principal_access_boundary_policies_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iam_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PrincipalAccessBoundaryPoliciesTracingStub : public PrincipalAccessBoundaryPoliciesStub { public: @@ -119,8 +120,6 @@ class PrincipalAccessBoundaryPoliciesTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -136,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V3_INTERNAL_PRINCIPAL_ACCESS_BOUNDARY_POLICIES_TRACING_STUB_H diff --git a/google/cloud/iam/v3/policy_bindings_client.h b/google/cloud/iam/v3/policy_bindings_client.h index 2db14742ad3e2..a4c0866338d81 100644 --- a/google/cloud/iam/v3/policy_bindings_client.h +++ b/google/cloud/iam/v3/policy_bindings_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/iam/v3/policy_bindings_connection.h b/google/cloud/iam/v3/policy_bindings_connection.h index 6d453c83287bf..680f82f7c4cba 100644 --- a/google/cloud/iam/v3/policy_bindings_connection.h +++ b/google/cloud/iam/v3/policy_bindings_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v3/policy_bindings_service.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/iam/v3/policy_bindings_connection_idempotency_policy.h b/google/cloud/iam/v3/policy_bindings_connection_idempotency_policy.h index 8de979d27948d..d23d802983df7 100644 --- a/google/cloud/iam/v3/policy_bindings_connection_idempotency_policy.h +++ b/google/cloud/iam/v3/policy_bindings_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v3/policy_bindings_service.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/iam/v3/principal_access_boundary_policies_client.h b/google/cloud/iam/v3/principal_access_boundary_policies_client.h index 16e018934b20d..602e1514c685d 100644 --- a/google/cloud/iam/v3/principal_access_boundary_policies_client.h +++ b/google/cloud/iam/v3/principal_access_boundary_policies_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/iam/v3/principal_access_boundary_policies_connection.h b/google/cloud/iam/v3/principal_access_boundary_policies_connection.h index 035298c08ee25..49c7918fdf7be 100644 --- a/google/cloud/iam/v3/principal_access_boundary_policies_connection.h +++ b/google/cloud/iam/v3/principal_access_boundary_policies_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v3/principal_access_boundary_policies_service.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/iam/v3/principal_access_boundary_policies_connection_idempotency_policy.h b/google/cloud/iam/v3/principal_access_boundary_policies_connection_idempotency_policy.h index 729f61e806940..af36a8da9a7a7 100644 --- a/google/cloud/iam/v3/principal_access_boundary_policies_connection_idempotency_policy.h +++ b/google/cloud/iam/v3/principal_access_boundary_policies_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v3/principal_access_boundary_policies_service.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/iam_updater.h b/google/cloud/iam_updater.h index 193e4f43923fd..6914b6c273c8c 100644 --- a/google/cloud/iam_updater.h +++ b/google/cloud/iam_updater.h @@ -17,7 +17,7 @@ #include "google/cloud/version.h" #include "absl/types/optional.h" -#include +#include "google/iam/v1/policy.pb.h" #include namespace google { diff --git a/google/cloud/iap/BUILD.bazel b/google/cloud/iap/BUILD.bazel index ac78a2e546db1..b8d8b7e93fef9 100644 --- a/google/cloud/iap/BUILD.bazel +++ b/google/cloud/iap/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/iap/v1:iap_cc_grpc", + "@googleapis//google/cloud/iap/v1:iap_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/iap/CMakeLists.txt b/google/cloud/iap/CMakeLists.txt index 4d1655d136d76..1e97995697cb1 100644 --- a/google/cloud/iap/CMakeLists.txt +++ b/google/cloud/iap/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(iap "Cloud Identity-Aware Proxy API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(iap_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/iap/identity_aware_proxy_admin_client.h b/google/cloud/iap/identity_aware_proxy_admin_client.h deleted file mode 100644 index 48826510ce14e..0000000000000 --- a/google/cloud/iap/identity_aware_proxy_admin_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/iap/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_ADMIN_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_ADMIN_CLIENT_H - -#include "google/cloud/iap/identity_aware_proxy_admin_connection.h" -#include "google/cloud/iap/v1/identity_aware_proxy_admin_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in iap_v1 instead of the aliases defined in -/// this namespace. -namespace iap { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iap_v1::IdentityAwareProxyAdminServiceClient directly. -using ::google::cloud::iap_v1::IdentityAwareProxyAdminServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iap -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_ADMIN_CLIENT_H diff --git a/google/cloud/iap/identity_aware_proxy_admin_connection.h b/google/cloud/iap/identity_aware_proxy_admin_connection.h deleted file mode 100644 index 02db3605890d8..0000000000000 --- a/google/cloud/iap/identity_aware_proxy_admin_connection.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/iap/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_ADMIN_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_ADMIN_CONNECTION_H - -#include "google/cloud/iap/identity_aware_proxy_admin_connection_idempotency_policy.h" -#include "google/cloud/iap/v1/identity_aware_proxy_admin_connection.h" - -namespace google { -namespace cloud { -namespace iap { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iap_v1::MakeIdentityAwareProxyAdminServiceConnection -/// directly. -using ::google::cloud::iap_v1::MakeIdentityAwareProxyAdminServiceConnection; - -/// @deprecated Use iap_v1::IdentityAwareProxyAdminServiceConnection directly. -using ::google::cloud::iap_v1::IdentityAwareProxyAdminServiceConnection; - -/// @deprecated Use -/// iap_v1::IdentityAwareProxyAdminServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::iap_v1:: - IdentityAwareProxyAdminServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use iap_v1::IdentityAwareProxyAdminServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::iap_v1:: - IdentityAwareProxyAdminServiceLimitedTimeRetryPolicy; - -/// @deprecated Use iap_v1::IdentityAwareProxyAdminServiceRetryPolicy directly. -using ::google::cloud::iap_v1::IdentityAwareProxyAdminServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iap -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_ADMIN_CONNECTION_H diff --git a/google/cloud/iap/identity_aware_proxy_admin_connection_idempotency_policy.h b/google/cloud/iap/identity_aware_proxy_admin_connection_idempotency_policy.h deleted file mode 100644 index 3f912c0b19689..0000000000000 --- a/google/cloud/iap/identity_aware_proxy_admin_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/iap/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/iap/v1/identity_aware_proxy_admin_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace iap { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// iap_v1::MakeDefaultIdentityAwareProxyAdminServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::iap_v1:: - MakeDefaultIdentityAwareProxyAdminServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// iap_v1::IdentityAwareProxyAdminServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::iap_v1:: - IdentityAwareProxyAdminServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iap -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/iap/identity_aware_proxy_admin_options.h b/google/cloud/iap/identity_aware_proxy_admin_options.h deleted file mode 100644 index 004bde51d63ce..0000000000000 --- a/google/cloud/iap/identity_aware_proxy_admin_options.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/iap/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_ADMIN_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_ADMIN_OPTIONS_H - -#include "google/cloud/iap/identity_aware_proxy_admin_connection.h" -#include "google/cloud/iap/identity_aware_proxy_admin_connection_idempotency_policy.h" -#include "google/cloud/iap/v1/identity_aware_proxy_admin_options.h" - -namespace google { -namespace cloud { -namespace iap { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iap_v1::IdentityAwareProxyAdminServiceBackoffPolicyOption -/// directly. -using ::google::cloud::iap_v1:: - IdentityAwareProxyAdminServiceBackoffPolicyOption; - -/// @deprecated Use -/// iap_v1::IdentityAwareProxyAdminServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::iap_v1:: - IdentityAwareProxyAdminServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use iap_v1::IdentityAwareProxyAdminServicePolicyOptionList -/// directly. -using ::google::cloud::iap_v1::IdentityAwareProxyAdminServicePolicyOptionList; - -/// @deprecated Use iap_v1::IdentityAwareProxyAdminServiceRetryPolicyOption -/// directly. -using ::google::cloud::iap_v1::IdentityAwareProxyAdminServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iap -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_ADMIN_OPTIONS_H diff --git a/google/cloud/iap/identity_aware_proxy_o_auth_client.h b/google/cloud/iap/identity_aware_proxy_o_auth_client.h deleted file mode 100644 index 4afb153b76f4f..0000000000000 --- a/google/cloud/iap/identity_aware_proxy_o_auth_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/iap/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_CLIENT_H - -#include "google/cloud/iap/identity_aware_proxy_o_auth_connection.h" -#include "google/cloud/iap/v1/identity_aware_proxy_o_auth_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in iap_v1 instead of the aliases defined in -/// this namespace. -namespace iap { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iap_v1::IdentityAwareProxyOAuthServiceClient directly. -using ::google::cloud::iap_v1::IdentityAwareProxyOAuthServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iap -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_CLIENT_H diff --git a/google/cloud/iap/identity_aware_proxy_o_auth_connection.h b/google/cloud/iap/identity_aware_proxy_o_auth_connection.h deleted file mode 100644 index 784d3421b8550..0000000000000 --- a/google/cloud/iap/identity_aware_proxy_o_auth_connection.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/iap/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_CONNECTION_H - -#include "google/cloud/iap/identity_aware_proxy_o_auth_connection_idempotency_policy.h" -#include "google/cloud/iap/v1/identity_aware_proxy_o_auth_connection.h" - -namespace google { -namespace cloud { -namespace iap { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iap_v1::MakeIdentityAwareProxyOAuthServiceConnection -/// directly. -using ::google::cloud::iap_v1::MakeIdentityAwareProxyOAuthServiceConnection; - -/// @deprecated Use iap_v1::IdentityAwareProxyOAuthServiceConnection directly. -using ::google::cloud::iap_v1::IdentityAwareProxyOAuthServiceConnection; - -/// @deprecated Use -/// iap_v1::IdentityAwareProxyOAuthServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::iap_v1:: - IdentityAwareProxyOAuthServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use iap_v1::IdentityAwareProxyOAuthServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::iap_v1:: - IdentityAwareProxyOAuthServiceLimitedTimeRetryPolicy; - -/// @deprecated Use iap_v1::IdentityAwareProxyOAuthServiceRetryPolicy directly. -using ::google::cloud::iap_v1::IdentityAwareProxyOAuthServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iap -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_CONNECTION_H diff --git a/google/cloud/iap/identity_aware_proxy_o_auth_connection_idempotency_policy.h b/google/cloud/iap/identity_aware_proxy_o_auth_connection_idempotency_policy.h deleted file mode 100644 index ea22c9d76f71a..0000000000000 --- a/google/cloud/iap/identity_aware_proxy_o_auth_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/iap/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/iap/v1/identity_aware_proxy_o_auth_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace iap { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// iap_v1::MakeDefaultIdentityAwareProxyOAuthServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::iap_v1:: - MakeDefaultIdentityAwareProxyOAuthServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// iap_v1::IdentityAwareProxyOAuthServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::iap_v1:: - IdentityAwareProxyOAuthServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iap -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/iap/identity_aware_proxy_o_auth_options.h b/google/cloud/iap/identity_aware_proxy_o_auth_options.h deleted file mode 100644 index fb186efd50ceb..0000000000000 --- a/google/cloud/iap/identity_aware_proxy_o_auth_options.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/iap/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_OPTIONS_H - -#include "google/cloud/iap/identity_aware_proxy_o_auth_connection.h" -#include "google/cloud/iap/identity_aware_proxy_o_auth_connection_idempotency_policy.h" -#include "google/cloud/iap/v1/identity_aware_proxy_o_auth_options.h" - -namespace google { -namespace cloud { -namespace iap { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iap_v1::IdentityAwareProxyOAuthServiceBackoffPolicyOption -/// directly. -using ::google::cloud::iap_v1:: - IdentityAwareProxyOAuthServiceBackoffPolicyOption; - -/// @deprecated Use -/// iap_v1::IdentityAwareProxyOAuthServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::iap_v1:: - IdentityAwareProxyOAuthServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use iap_v1::IdentityAwareProxyOAuthServicePolicyOptionList -/// directly. -using ::google::cloud::iap_v1::IdentityAwareProxyOAuthServicePolicyOptionList; - -/// @deprecated Use iap_v1::IdentityAwareProxyOAuthServiceRetryPolicyOption -/// directly. -using ::google::cloud::iap_v1::IdentityAwareProxyOAuthServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iap -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_IDENTITY_AWARE_PROXY_O_AUTH_OPTIONS_H diff --git a/google/cloud/iap/mocks/mock_identity_aware_proxy_admin_connection.h b/google/cloud/iap/mocks/mock_identity_aware_proxy_admin_connection.h deleted file mode 100644 index c37621478748b..0000000000000 --- a/google/cloud/iap/mocks/mock_identity_aware_proxy_admin_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/iap/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_MOCKS_MOCK_IDENTITY_AWARE_PROXY_ADMIN_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_MOCKS_MOCK_IDENTITY_AWARE_PROXY_ADMIN_CONNECTION_H - -#include "google/cloud/iap/identity_aware_proxy_admin_connection.h" -#include "google/cloud/iap/v1/mocks/mock_identity_aware_proxy_admin_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in iap_v1_mocks instead of the aliases -/// defined in this namespace. -namespace iap_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iap_v1_mocks::MockIdentityAwareProxyAdminServiceConnection -/// directly. -using ::google::cloud::iap_v1_mocks:: - MockIdentityAwareProxyAdminServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iap_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_MOCKS_MOCK_IDENTITY_AWARE_PROXY_ADMIN_CONNECTION_H diff --git a/google/cloud/iap/mocks/mock_identity_aware_proxy_o_auth_connection.h b/google/cloud/iap/mocks/mock_identity_aware_proxy_o_auth_connection.h deleted file mode 100644 index 928b029397cd2..0000000000000 --- a/google/cloud/iap/mocks/mock_identity_aware_proxy_o_auth_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/iap/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_MOCKS_MOCK_IDENTITY_AWARE_PROXY_O_AUTH_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_MOCKS_MOCK_IDENTITY_AWARE_PROXY_O_AUTH_CONNECTION_H - -#include "google/cloud/iap/identity_aware_proxy_o_auth_connection.h" -#include "google/cloud/iap/v1/mocks/mock_identity_aware_proxy_o_auth_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in iap_v1_mocks instead of the aliases -/// defined in this namespace. -namespace iap_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use iap_v1_mocks::MockIdentityAwareProxyOAuthServiceConnection -/// directly. -using ::google::cloud::iap_v1_mocks:: - MockIdentityAwareProxyOAuthServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace iap_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_MOCKS_MOCK_IDENTITY_AWARE_PROXY_O_AUTH_CONNECTION_H diff --git a/google/cloud/iap/quickstart/.bazelrc b/google/cloud/iap/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/iap/quickstart/.bazelrc +++ b/google/cloud/iap/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/iap/quickstart/CMakeLists.txt index 515729b23370c..3ea213c38db3f 100644 --- a/google/cloud/iap/quickstart/CMakeLists.txt +++ b/google/cloud/iap/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Identity-Aware Proxy API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-iap-quickstart CXX) find_package(google_cloud_cpp_iap REQUIRED) diff --git a/google/cloud/iap/quickstart/WORKSPACE.bazel b/google/cloud/iap/quickstart/WORKSPACE.bazel index 0920e2d5067a8..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 = "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/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_admin_connection.h b/google/cloud/iap/v1/identity_aware_proxy_admin_connection.h index effc98a72f5fe..887e2a7baa370 100644 --- a/google/cloud/iap/v1/identity_aware_proxy_admin_connection.h +++ b/google/cloud/iap/v1/identity_aware_proxy_admin_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/iap/v1/identity_aware_proxy_admin_connection_idempotency_policy.h" #include "google/cloud/iap/v1/internal/identity_aware_proxy_admin_retry_traits.h" +#include "google/cloud/iap/v1/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 #include namespace google { diff --git a/google/cloud/iap/v1/identity_aware_proxy_admin_connection_idempotency_policy.h b/google/cloud/iap/v1/identity_aware_proxy_admin_connection_idempotency_policy.h index eefc5f435a78c..40ef30e9352be 100644 --- a/google/cloud/iap/v1/identity_aware_proxy_admin_connection_idempotency_policy.h +++ b/google/cloud/iap/v1/identity_aware_proxy_admin_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_IDENTITY_AWARE_PROXY_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_IDENTITY_AWARE_PROXY_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/iap/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { 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/iap/v1/identity_aware_proxy_o_auth_connection.h b/google/cloud/iap/v1/identity_aware_proxy_o_auth_connection.h index 740202818b9f2..fcef95f83e58f 100644 --- a/google/cloud/iap/v1/identity_aware_proxy_o_auth_connection.h +++ b/google/cloud/iap/v1/identity_aware_proxy_o_auth_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/iap/v1/identity_aware_proxy_o_auth_connection_idempotency_policy.h" #include "google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_retry_traits.h" +#include "google/cloud/iap/v1/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 #include namespace google { diff --git a/google/cloud/iap/v1/identity_aware_proxy_o_auth_connection_idempotency_policy.h b/google/cloud/iap/v1/identity_aware_proxy_o_auth_connection_idempotency_policy.h index ea300eb061f5d..830c8b4f2a888 100644 --- a/google/cloud/iap/v1/identity_aware_proxy_o_auth_connection_idempotency_policy.h +++ b/google/cloud/iap/v1/identity_aware_proxy_o_auth_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_IDENTITY_AWARE_PROXY_O_AUTH_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_IDENTITY_AWARE_PROXY_O_AUTH_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/iap/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_auth_decorator.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_auth_decorator.cc index 175d58ae74818..261e3ddf28d0b 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_auth_decorator.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/iap/v1/service.proto #include "google/cloud/iap/v1/internal/identity_aware_proxy_admin_auth_decorator.h" -#include +#include "google/cloud/iap/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -134,3 +137,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iap_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_auth_decorator.h b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_auth_decorator.h index 243ca2f7d48d9..3dd1acbb27f10 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_auth_decorator.h +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -101,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_ADMIN_AUTH_DECORATOR_H diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_logging_decorator.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_logging_decorator.cc index ebc9718f06f12..90bf5d8a7316b 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_logging_decorator.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/iap/v1/service.proto #include "google/cloud/iap/v1/internal/identity_aware_proxy_admin_logging_decorator.h" +#include "google/cloud/iap/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -178,3 +181,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iap_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_logging_decorator.h b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_logging_decorator.h index 9e44556952fea..69bffe3fac748 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_logging_decorator.h +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -101,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_ADMIN_LOGGING_DECORATOR_H diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_metadata_decorator.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_metadata_decorator.cc index 43e63c023cde6..4540bfe764ccb 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_metadata_decorator.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/iap/v1/service.proto #include "google/cloud/iap/v1/internal/identity_aware_proxy_admin_metadata_decorator.h" +#include "google/cloud/iap/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 iap_v1_internal { @@ -166,3 +170,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iap_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_metadata_decorator.h b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_metadata_decorator.h index 76865f2bf0b52..9e5efddf7d5c4 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_metadata_decorator.h +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -107,4 +110,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_ADMIN_METADATA_DECORATOR_H diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_option_defaults.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_option_defaults.cc index 5934f0aae92b7..40b6f49ece2bb 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_option_defaults.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_option_defaults.cc @@ -43,7 +43,7 @@ Options IdentityAwareProxyAdminServiceDefaultOptions(Options options) { if (!options.has()) { options.set( iap_v1::IdentityAwareProxyAdminServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub.cc index b7c1a4d5fbab5..bdfa03ee55e7f 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/iap/v1/service.proto #include "google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub.h" +#include "google/cloud/iap/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -168,3 +171,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iap_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub.h b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub.h index bc822f47ee6ac..94525522bb506 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub.h +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_ADMIN_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_ADMIN_STUB_H +#include "google/cloud/iap/v1/service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -159,4 +162,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_ADMIN_STUB_H diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub_factory.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub_factory.cc index d67e68bb4598f..998c9742bc20f 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub_factory.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/iap/v1/internal/identity_aware_proxy_admin_metadata_decorator.h" #include "google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub.h" #include "google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_stub.h" +#include "google/cloud/iap/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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iap_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub_factory.h b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub_factory.h index a90c09ae28535..ff99d0fffa92c 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub_factory.h +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_ADMIN_STUB_FACTORY_H diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_connection.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_connection.cc index c945e0cb31aa5..9afa62ac24727 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_connection.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace iap_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IdentityAwareProxyAdminServiceTracingConnection:: IdentityAwareProxyAdminServiceTracingConnection( std::shared_ptr child) @@ -140,17 +138,13 @@ IdentityAwareProxyAdminServiceTracingConnection::UpdateTunnelDestGroup( return internal::EndSpan(*span, child_->UpdateTunnelDestGroup(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIdentityAwareProxyAdminServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_connection.h b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_connection.h index 972cf3064342f..ee4e3c7afad01 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_connection.h +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace iap_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IdentityAwareProxyAdminServiceTracingConnection : public iap_v1::IdentityAwareProxyAdminServiceConnection { public: @@ -83,8 +81,6 @@ class IdentityAwareProxyAdminServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_stub.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_stub.cc index fdb2998f1958a..aa3a40652a75e 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_stub.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IdentityAwareProxyAdminServiceTracingStub:: IdentityAwareProxyAdminServiceTracingStub( std::shared_ptr child) @@ -174,20 +175,16 @@ IdentityAwareProxyAdminServiceTracingStub::UpdateTunnelDestGroup( context, *span, child_->UpdateTunnelDestGroup(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIdentityAwareProxyAdminServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iap_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_stub.h b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_stub.h index 062a9343b643b..a41e525501e2c 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_stub.h +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_admin_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IdentityAwareProxyAdminServiceTracingStub : public IdentityAwareProxyAdminServiceStub { public: @@ -98,8 +99,6 @@ class IdentityAwareProxyAdminServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -115,4 +114,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_ADMIN_TRACING_STUB_H diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_auth_decorator.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_auth_decorator.cc index 126fa9edf501c..712b31bb124b1 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_auth_decorator.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/iap/v1/service.proto #include "google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_auth_decorator.h" -#include +#include "google/cloud/iap/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -110,3 +113,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iap_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_auth_decorator.h b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_auth_decorator.h index 56112ad70f392..35abb9eda4b19 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_auth_decorator.h +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -90,4 +93,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_O_AUTH_AUTH_DECORATOR_H diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_logging_decorator.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_logging_decorator.cc index 8c54b9b90a8c2..79a08ca0e3f5b 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_logging_decorator.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/iap/v1/service.proto #include "google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_logging_decorator.h" +#include "google/cloud/iap/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -148,3 +151,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iap_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_logging_decorator.h b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_logging_decorator.h index 43c77730c95df..bb60bc5b16857 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_logging_decorator.h +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -90,4 +93,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_O_AUTH_LOGGING_DECORATOR_H diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_metadata_decorator.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_metadata_decorator.cc index 699077b7a60b6..9fba0670115e9 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_metadata_decorator.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/iap/v1/service.proto #include "google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_metadata_decorator.h" +#include "google/cloud/iap/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 iap_v1_internal { @@ -136,3 +140,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iap_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_metadata_decorator.h b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_metadata_decorator.h index a61af7727b784..18b3be021e6e9 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_metadata_decorator.h +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -96,4 +99,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_O_AUTH_METADATA_DECORATOR_H diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_option_defaults.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_option_defaults.cc index 509fe4b18b8ac..53a62150966ec 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_option_defaults.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_option_defaults.cc @@ -43,7 +43,7 @@ Options IdentityAwareProxyOAuthServiceDefaultOptions(Options options) { if (!options.has()) { options.set( iap_v1::IdentityAwareProxyOAuthServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub.cc index ad380b20bd646..b21b6042d85e1 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/iap/v1/service.proto #include "google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub.h" +#include "google/cloud/iap/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -140,3 +143,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iap_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub.h b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub.h index 79f15328024e7..d6e8e2597aecc 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub.h +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_O_AUTH_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_O_AUTH_STUB_H +#include "google/cloud/iap/v1/service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -139,4 +142,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_O_AUTH_STUB_H diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub_factory.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub_factory.cc index 101788428ad97..2850ce5ca249a 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub_factory.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_metadata_decorator.h" #include "google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub.h" #include "google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_stub.h" +#include "google/cloud/iap/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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iap_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub_factory.h b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub_factory.h index 97a0a20a48bcd..90d88075d5a0d 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub_factory.h +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_O_AUTH_STUB_FACTORY_H diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_connection.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_connection.cc index a081bbceffd59..94d8e338d6913 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_connection.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace iap_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IdentityAwareProxyOAuthServiceTracingConnection:: IdentityAwareProxyOAuthServiceTracingConnection( std::shared_ptr child) @@ -121,17 +119,13 @@ IdentityAwareProxyOAuthServiceTracingConnection::DeleteIdentityAwareProxyClient( child_->DeleteIdentityAwareProxyClient(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIdentityAwareProxyOAuthServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_connection.h b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_connection.h index e98b9031cacd5..b710686a4acd9 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_connection.h +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace iap_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IdentityAwareProxyOAuthServiceTracingConnection : public iap_v1::IdentityAwareProxyOAuthServiceConnection { public: @@ -77,8 +75,6 @@ class IdentityAwareProxyOAuthServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_stub.cc b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_stub.cc index 72fafa37d8896..ff9243eb0bf04 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_stub.cc +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IdentityAwareProxyOAuthServiceTracingStub:: IdentityAwareProxyOAuthServiceTracingStub( std::shared_ptr child) @@ -143,20 +144,16 @@ IdentityAwareProxyOAuthServiceTracingStub::DeleteIdentityAwareProxyClient( child_->DeleteIdentityAwareProxyClient(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIdentityAwareProxyOAuthServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace iap_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_stub.h b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_stub.h index 0a326dfc7bec8..5f2f46d795788 100644 --- a/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_stub.h +++ b/google/cloud/iap/v1/internal/identity_aware_proxy_o_auth_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace iap_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IdentityAwareProxyOAuthServiceTracingStub : public IdentityAwareProxyOAuthServiceStub { public: @@ -87,8 +88,6 @@ class IdentityAwareProxyOAuthServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -104,4 +103,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAP_V1_INTERNAL_IDENTITY_AWARE_PROXY_O_AUTH_TRACING_STUB_H diff --git a/google/cloud/ids/BUILD.bazel b/google/cloud/ids/BUILD.bazel index 7efeeb7c5919f..a51b24e2fdc45 100644 --- a/google/cloud/ids/BUILD.bazel +++ b/google/cloud/ids/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/ids/v1:ids_cc_grpc", + "@googleapis//google/cloud/ids/v1:ids_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/ids/CMakeLists.txt b/google/cloud/ids/CMakeLists.txt index 5e3df422f96b9..a4c1257eaf7a6 100644 --- a/google/cloud/ids/CMakeLists.txt +++ b/google/cloud/ids/CMakeLists.txt @@ -16,8 +16,7 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library(ids "Cloud IDS API" SERVICE_DIRS "__EMPTY__" - "v1/") +google_cloud_cpp_add_gapic_library(ids "Cloud IDS API" SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(ids_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/ids/ids_client.h b/google/cloud/ids/ids_client.h deleted file mode 100644 index e351ee08b2a9e..0000000000000 --- a/google/cloud/ids/ids_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/ids/v1/ids.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_CLIENT_H - -#include "google/cloud/ids/ids_connection.h" -#include "google/cloud/ids/v1/ids_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in ids_v1 instead of the aliases defined in -/// this namespace. -namespace ids { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use ids_v1::IDSClient directly. -using ::google::cloud::ids_v1::IDSClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace ids -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_CLIENT_H diff --git a/google/cloud/ids/ids_connection.h b/google/cloud/ids/ids_connection.h deleted file mode 100644 index 96d3cc1ff9a5b..0000000000000 --- a/google/cloud/ids/ids_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/ids/v1/ids.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_CONNECTION_H - -#include "google/cloud/ids/ids_connection_idempotency_policy.h" -#include "google/cloud/ids/v1/ids_connection.h" - -namespace google { -namespace cloud { -namespace ids { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use ids_v1::MakeIDSConnection directly. -using ::google::cloud::ids_v1::MakeIDSConnection; - -/// @deprecated Use ids_v1::IDSConnection directly. -using ::google::cloud::ids_v1::IDSConnection; - -/// @deprecated Use ids_v1::IDSLimitedErrorCountRetryPolicy directly. -using ::google::cloud::ids_v1::IDSLimitedErrorCountRetryPolicy; - -/// @deprecated Use ids_v1::IDSLimitedTimeRetryPolicy directly. -using ::google::cloud::ids_v1::IDSLimitedTimeRetryPolicy; - -/// @deprecated Use ids_v1::IDSRetryPolicy directly. -using ::google::cloud::ids_v1::IDSRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace ids -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_CONNECTION_H diff --git a/google/cloud/ids/ids_connection_idempotency_policy.h b/google/cloud/ids/ids_connection_idempotency_policy.h deleted file mode 100644 index 86dc42850632d..0000000000000 --- a/google/cloud/ids/ids_connection_idempotency_policy.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/ids/v1/ids.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/ids/v1/ids_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace ids { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use ids_v1::MakeDefaultIDSConnectionIdempotencyPolicy directly. -using ::google::cloud::ids_v1::MakeDefaultIDSConnectionIdempotencyPolicy; - -/// @deprecated Use ids_v1::IDSConnectionIdempotencyPolicy directly. -using ::google::cloud::ids_v1::IDSConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace ids -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/ids/ids_options.h b/google/cloud/ids/ids_options.h deleted file mode 100644 index b7c81f070b0ea..0000000000000 --- a/google/cloud/ids/ids_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/ids/v1/ids.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_OPTIONS_H - -#include "google/cloud/ids/ids_connection.h" -#include "google/cloud/ids/ids_connection_idempotency_policy.h" -#include "google/cloud/ids/v1/ids_options.h" - -namespace google { -namespace cloud { -namespace ids { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use ids_v1::IDSPollingPolicyOption directly. -using ::google::cloud::ids_v1::IDSPollingPolicyOption; - -/// @deprecated Use ids_v1::IDSBackoffPolicyOption directly. -using ::google::cloud::ids_v1::IDSBackoffPolicyOption; - -/// @deprecated Use ids_v1::IDSConnectionIdempotencyPolicyOption directly. -using ::google::cloud::ids_v1::IDSConnectionIdempotencyPolicyOption; - -/// @deprecated Use ids_v1::IDSPolicyOptionList directly. -using ::google::cloud::ids_v1::IDSPolicyOptionList; - -/// @deprecated Use ids_v1::IDSRetryPolicyOption directly. -using ::google::cloud::ids_v1::IDSRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace ids -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_OPTIONS_H diff --git a/google/cloud/ids/mocks/mock_ids_connection.h b/google/cloud/ids/mocks/mock_ids_connection.h deleted file mode 100644 index a292e01ec5a96..0000000000000 --- a/google/cloud/ids/mocks/mock_ids_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/ids/v1/ids.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_MOCKS_MOCK_IDS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_MOCKS_MOCK_IDS_CONNECTION_H - -#include "google/cloud/ids/ids_connection.h" -#include "google/cloud/ids/v1/mocks/mock_ids_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in ids_v1_mocks instead of the aliases -/// defined in this namespace. -namespace ids_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use ids_v1_mocks::MockIDSConnection directly. -using ::google::cloud::ids_v1_mocks::MockIDSConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace ids_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_MOCKS_MOCK_IDS_CONNECTION_H diff --git a/google/cloud/ids/quickstart/.bazelrc b/google/cloud/ids/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/ids/quickstart/.bazelrc +++ b/google/cloud/ids/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/ids/quickstart/CMakeLists.txt index b43da5f161d15..3d89395c2c5cf 100644 --- a/google/cloud/ids/quickstart/CMakeLists.txt +++ b/google/cloud/ids/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud IDS API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-ids-quickstart CXX) find_package(google_cloud_cpp_ids REQUIRED) diff --git a/google/cloud/ids/quickstart/WORKSPACE.bazel b/google/cloud/ids/quickstart/WORKSPACE.bazel index 3680647d6058d..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 = "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/ids/v1/ids_client.h b/google/cloud/ids/v1/ids_client.h index e2ebce0b66249..492759959b9b0 100644 --- a/google/cloud/ids/v1/ids_client.h +++ b/google/cloud/ids/v1/ids_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/ids/v1/ids_connection.h b/google/cloud/ids/v1/ids_connection.h index aa1e7bd826901..845fb739121d0 100644 --- a/google/cloud/ids/v1/ids_connection.h +++ b/google/cloud/ids/v1/ids_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_V1_IDS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_V1_IDS_CONNECTION_H +#include "google/cloud/ids/v1/ids.pb.h" #include "google/cloud/ids/v1/ids_connection_idempotency_policy.h" #include "google/cloud/ids/v1/internal/ids_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/ids/v1/ids_connection_idempotency_policy.h b/google/cloud/ids/v1/ids_connection_idempotency_policy.h index fa608add2e93d..460ee0798e4a1 100644 --- a/google/cloud/ids/v1/ids_connection_idempotency_policy.h +++ b/google/cloud/ids/v1/ids_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_V1_IDS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_V1_IDS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/ids/v1/ids.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/ids/v1/internal/ids_auth_decorator.cc b/google/cloud/ids/v1/internal/ids_auth_decorator.cc index 09be60a2d0611..9d4ddd21fed48 100644 --- a/google/cloud/ids/v1/internal/ids_auth_decorator.cc +++ b/google/cloud/ids/v1/internal/ids_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/ids/v1/ids.proto #include "google/cloud/ids/v1/internal/ids_auth_decorator.h" -#include +#include "google/cloud/ids/v1/ids.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace ids_v1_internal { @@ -140,3 +143,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace ids_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ids/v1/internal/ids_auth_decorator.h b/google/cloud/ids/v1/internal/ids_auth_decorator.h index 5f31e62baa4d3..8a0fa27b16a72 100644 --- a/google/cloud/ids/v1/internal/ids_auth_decorator.h +++ b/google/cloud/ids/v1/internal/ids_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/ids/v1/internal/ids_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 ids_v1_internal { @@ -89,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_V1_INTERNAL_IDS_AUTH_DECORATOR_H diff --git a/google/cloud/ids/v1/internal/ids_connection_impl.h b/google/cloud/ids/v1/internal/ids_connection_impl.h index db0e866cc5623..70cddf4bbfe41 100644 --- a/google/cloud/ids/v1/internal/ids_connection_impl.h +++ b/google/cloud/ids/v1/internal/ids_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/ids/v1/internal/ids_logging_decorator.cc b/google/cloud/ids/v1/internal/ids_logging_decorator.cc index af4c83396f9c5..568e043130b58 100644 --- a/google/cloud/ids/v1/internal/ids_logging_decorator.cc +++ b/google/cloud/ids/v1/internal/ids_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/ids/v1/ids.proto #include "google/cloud/ids/v1/internal/ids_logging_decorator.h" +#include "google/cloud/ids/v1/ids.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace ids_v1_internal { @@ -154,3 +157,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace ids_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ids/v1/internal/ids_logging_decorator.h b/google/cloud/ids/v1/internal/ids_logging_decorator.h index cb16b40f81280..f2841eca61d20 100644 --- a/google/cloud/ids/v1/internal/ids_logging_decorator.h +++ b/google/cloud/ids/v1/internal/ids_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/ids/v1/internal/ids_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 ids_v1_internal { @@ -88,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_V1_INTERNAL_IDS_LOGGING_DECORATOR_H diff --git a/google/cloud/ids/v1/internal/ids_metadata_decorator.cc b/google/cloud/ids/v1/internal/ids_metadata_decorator.cc index 1ebfc98b7d7db..18a7ca76d7a95 100644 --- a/google/cloud/ids/v1/internal/ids_metadata_decorator.cc +++ b/google/cloud/ids/v1/internal/ids_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/ids/v1/ids.proto #include "google/cloud/ids/v1/internal/ids_metadata_decorator.h" +#include "google/cloud/ids/v1/ids.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 ids_v1_internal { @@ -139,3 +143,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace ids_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ids/v1/internal/ids_metadata_decorator.h b/google/cloud/ids/v1/internal/ids_metadata_decorator.h index f5c95747d705f..14136cefa72be 100644 --- a/google/cloud/ids/v1/internal/ids_metadata_decorator.h +++ b/google/cloud/ids/v1/internal/ids_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/ids/v1/internal/ids_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 ids_v1_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_V1_INTERNAL_IDS_METADATA_DECORATOR_H diff --git a/google/cloud/ids/v1/internal/ids_option_defaults.cc b/google/cloud/ids/v1/internal/ids_option_defaults.cc index 2ecb3c934f8b4..6ddd0eec048db 100644 --- a/google/cloud/ids/v1/internal/ids_option_defaults.cc +++ b/google/cloud/ids/v1/internal/ids_option_defaults.cc @@ -40,7 +40,7 @@ Options IDSDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - ids_v1::IDSLimitedTimeRetryPolicy(std::chrono::minutes(30)).clone()); + ids_v1::IDSLimitedTimeRetryPolicy(std::chrono::minutes(10)).clone()); } if (!options.has()) { options.set( diff --git a/google/cloud/ids/v1/internal/ids_stub.cc b/google/cloud/ids/v1/internal/ids_stub.cc index d46d5cfb5bb1d..c81e012bd4ebb 100644 --- a/google/cloud/ids/v1/internal/ids_stub.cc +++ b/google/cloud/ids/v1/internal/ids_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/ids/v1/ids.proto #include "google/cloud/ids/v1/internal/ids_stub.h" +#include "google/cloud/ids/v1/ids.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace ids_v1_internal { @@ -155,3 +158,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace ids_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ids/v1/internal/ids_stub.h b/google/cloud/ids/v1/internal/ids_stub.h index b40f25e5a66a1..6efb12c1a2290 100644 --- a/google/cloud/ids/v1/internal/ids_stub.h +++ b/google/cloud/ids/v1/internal/ids_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_V1_INTERNAL_IDS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_V1_INTERNAL_IDS_STUB_H +#include "google/cloud/ids/v1/ids.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace ids_v1_internal { @@ -139,4 +142,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_V1_INTERNAL_IDS_STUB_H diff --git a/google/cloud/ids/v1/internal/ids_stub_factory.cc b/google/cloud/ids/v1/internal/ids_stub_factory.cc index 20d54015e4f1a..104af0bd169e5 100644 --- a/google/cloud/ids/v1/internal/ids_stub_factory.cc +++ b/google/cloud/ids/v1/internal/ids_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/ids/v1/ids.proto #include "google/cloud/ids/v1/internal/ids_stub_factory.h" +#include "google/cloud/ids/v1/ids.grpc.pb.h" #include "google/cloud/ids/v1/internal/ids_auth_decorator.h" #include "google/cloud/ids/v1/internal/ids_logging_decorator.h" #include "google/cloud/ids/v1/internal/ids_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace ids_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace ids_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ids/v1/internal/ids_stub_factory.h b/google/cloud/ids/v1/internal/ids_stub_factory.h index 4a16750c4e642..c1c1e6832cb91 100644 --- a/google/cloud/ids/v1/internal/ids_stub_factory.h +++ b/google/cloud/ids/v1/internal/ids_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace ids_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_V1_INTERNAL_IDS_STUB_FACTORY_H diff --git a/google/cloud/ids/v1/internal/ids_tracing_connection.cc b/google/cloud/ids/v1/internal/ids_tracing_connection.cc index 2bae57defe769..316aec04fded7 100644 --- a/google/cloud/ids/v1/internal/ids_tracing_connection.cc +++ b/google/cloud/ids/v1/internal/ids_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace ids_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IDSTracingConnection::IDSTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -98,15 +96,11 @@ IDSTracingConnection::DeleteEndpoint( return internal::EndSpan(std::move(span), child_->DeleteEndpoint(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIDSTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/ids/v1/internal/ids_tracing_connection.h b/google/cloud/ids/v1/internal/ids_tracing_connection.h index 9672699cd80fa..148993e004737 100644 --- a/google/cloud/ids/v1/internal/ids_tracing_connection.h +++ b/google/cloud/ids/v1/internal/ids_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace ids_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IDSTracingConnection : public ids_v1::IDSConnection { public: ~IDSTracingConnection() override = default; @@ -68,8 +66,6 @@ class IDSTracingConnection : public ids_v1::IDSConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/ids/v1/internal/ids_tracing_stub.cc b/google/cloud/ids/v1/internal/ids_tracing_stub.cc index 8f4353b02d34a..c12f5611d4f11 100644 --- a/google/cloud/ids/v1/internal/ids_tracing_stub.cc +++ b/google/cloud/ids/v1/internal/ids_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace ids_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IDSTracingStub::IDSTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -133,17 +134,13 @@ future IDSTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIDSTracingStub(std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace ids_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ids/v1/internal/ids_tracing_stub.h b/google/cloud/ids/v1/internal/ids_tracing_stub.h index 8428c029ca76f..648750aac95e1 100644 --- a/google/cloud/ids/v1/internal/ids_tracing_stub.h +++ b/google/cloud/ids/v1/internal/ids_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace ids_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IDSTracingStub : public IDSStub { public: ~IDSTracingStub() override = default; @@ -84,8 +85,6 @@ class IDSTracingStub : public IDSStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -99,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_V1_INTERNAL_IDS_TRACING_STUB_H diff --git a/google/cloud/internal/absl_str_cat_quiet.h b/google/cloud/internal/absl_str_cat_quiet.h deleted file mode 100644 index a916af000e4a5..0000000000000 --- a/google/cloud/internal/absl_str_cat_quiet.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_ABSL_STR_CAT_QUIET_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ABSL_STR_CAT_QUIET_H - -/** - * @file refactor the code to disable the warnings generated by - * "absl/strings/str_cat.h", include said header and re-enable the warnings. - * - * @see https://github.com/googleapis/google-cloud-cpp/issues/4501 for details - * as to why this is needed. - */ - -// TODO(#4501) - this file can be removed if #include works -#include "google/cloud/internal/diagnostics_push.inc" -#if _MSC_VER -#pragma warning(disable : 4244) -#endif // _MSC_VER -#include "absl/strings/str_cat.h" -// TODO(#4501) - end -#include "google/cloud/internal/diagnostics_pop.inc" - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ABSL_STR_CAT_QUIET_H diff --git a/google/cloud/internal/absl_str_join_quiet.h b/google/cloud/internal/absl_str_join_quiet.h deleted file mode 100644 index 7ea1bef195b2a..0000000000000 --- a/google/cloud/internal/absl_str_join_quiet.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_ABSL_STR_JOIN_QUIET_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ABSL_STR_JOIN_QUIET_H - -/** - * @file refactor the code to disable the warnings generated by - * "absl/strings/str_join.h", include said header and re-enable the warnings. - * - * @see https://github.com/googleapis/google-cloud-cpp/issues/4501 for details - * as to why this is needed. - */ - -// TODO(#4501) - this file can be removed if #include works -#include "google/cloud/internal/diagnostics_push.inc" -#if _MSC_VER -#pragma warning(disable : 4244) -#endif // _MSC_VER -#include "absl/strings/str_join.h" -// TODO(#4501) - end -#include "google/cloud/internal/diagnostics_pop.inc" - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ABSL_STR_JOIN_QUIET_H diff --git a/google/cloud/internal/absl_str_replace_quiet.h b/google/cloud/internal/absl_str_replace_quiet.h deleted file mode 100644 index c47252a03afdf..0000000000000 --- a/google/cloud/internal/absl_str_replace_quiet.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_ABSL_STR_REPLACE_QUIET_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ABSL_STR_REPLACE_QUIET_H - -/** - * @file refactor the code to disable the warnings generated by - * "absl/strings/str_replace.h", include said header and re-enable the - * warnings. - * - * @see https://github.com/googleapis/google-cloud-cpp/issues/4501 for details - * as to why this is needed. - */ - -// TODO(#4501) - this file can be removed if #include works -#include "google/cloud/internal/diagnostics_push.inc" -#if _MSC_VER -#pragma warning(disable : 4244) -#endif // _MSC_VER -#include "absl/strings/str_replace.h" -// TODO(#4501) - end -#include "google/cloud/internal/diagnostics_pop.inc" - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ABSL_STR_REPLACE_QUIET_H diff --git a/google/cloud/internal/api_client_header.cc b/google/cloud/internal/api_client_header.cc index f68fa51865783..d3d482c7a65f2 100644 --- a/google/cloud/internal/api_client_header.cc +++ b/google/cloud/internal/api_client_header.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/internal/api_client_header.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/compiler_info.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/internal/async_connection_ready_test.cc b/google/cloud/internal/async_connection_ready_test.cc index fbf6feca8ba59..6dfe8a528bd26 100644 --- a/google/cloud/internal/async_connection_ready_test.cc +++ b/google/cloud/internal/async_connection_ready_test.cc @@ -100,8 +100,6 @@ TEST(CompletionQueueTest, SuccessfulWaitingForConnection) { cli_thread.join(); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TEST(CompletionQueueTest, PropagateCallContext) { auto span_catcher = testing_util::InstallSpanCatcher(); @@ -137,8 +135,6 @@ TEST(CompletionQueueTest, PropagateCallContext) { t.join(); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace } // namespace internal GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/async_long_running_operation.h b/google/cloud/internal/async_long_running_operation.h index f0b493bfe2ee9..dccd184c51521 100644 --- a/google/cloud/internal/async_long_running_operation.h +++ b/google/cloud/internal/async_long_running_operation.h @@ -25,7 +25,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/version.h" #include "absl/functional/function_ref.h" -#include +#include "google/longrunning/operations.pb.h" #include #include #include diff --git a/google/cloud/internal/async_long_running_operation_test.cc b/google/cloud/internal/async_long_running_operation_test.cc index f4f87d7aaa8ec..98a689a38e44c 100644 --- a/google/cloud/internal/async_long_running_operation_test.cc +++ b/google/cloud/internal/async_long_running_operation_test.cc @@ -19,8 +19,8 @@ #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/mock_completion_queue_impl.h" #include "google/cloud/testing_util/status_matchers.h" -#include -#include +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include #include diff --git a/google/cloud/internal/async_polling_loop.h b/google/cloud/internal/async_polling_loop.h index 69867c6ca93e2..19831cd85eaa5 100644 --- a/google/cloud/internal/async_polling_loop.h +++ b/google/cloud/internal/async_polling_loop.h @@ -21,7 +21,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.pb.h" #include #include #include diff --git a/google/cloud/internal/async_polling_loop_test.cc b/google/cloud/internal/async_polling_loop_test.cc index abb8f22a3e8e9..2ca520c9efb99 100644 --- a/google/cloud/internal/async_polling_loop_test.cc +++ b/google/cloud/internal/async_polling_loop_test.cc @@ -21,7 +21,7 @@ #include "google/cloud/testing_util/mock_completion_queue_impl.h" #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" -#include +#include "google/protobuf/timestamp.pb.h" #include #include @@ -642,7 +642,6 @@ TEST(AsyncPollingLoopTest, ConfigurePollContext) { HasSubstr("operation cancelled")))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::IsActive; using ::google::cloud::testing_util::OTelAttribute; @@ -773,8 +772,6 @@ TEST(AsyncPollingLoopTest, TraceCapturesOperationName) { "gl-cpp.LRO_name", "test-op-name"))))); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace } // namespace internal GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/async_read_write_stream_impl_test.cc b/google/cloud/internal/async_read_write_stream_impl_test.cc index f35ddf4925594..908e85294a8a5 100644 --- a/google/cloud/internal/async_read_write_stream_impl_test.cc +++ b/google/cloud/internal/async_read_write_stream_impl_test.cc @@ -215,8 +215,6 @@ TEST(AsyncReadWriteStreamingRpcTest, Error) { EXPECT_THAT(metadata.trailers, IsEmpty()); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - using ::google::cloud::testing_util::IsActive; TEST(AsyncReadWriteStreamingRpcTest, SpanActiveAcrossAsyncGrpcOperations) { @@ -330,8 +328,6 @@ TEST(AsyncReadWriteStreamingRpcTest, SpanActiveAcrossAsyncGrpcOperations) { (void)finish.get(); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace } // namespace internal GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/async_read_write_stream_logging_test.cc b/google/cloud/internal/async_read_write_stream_logging_test.cc index ded195054fa07..f481505262ef3 100644 --- a/google/cloud/internal/async_read_write_stream_logging_test.cc +++ b/google/cloud/internal/async_read_write_stream_logging_test.cc @@ -19,8 +19,8 @@ #include "google/cloud/testing_util/scoped_log.h" #include "google/cloud/testing_util/status_matchers.h" #include "google/cloud/tracing_options.h" -#include -#include +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include namespace google { diff --git a/google/cloud/internal/async_read_write_stream_tracing.h b/google/cloud/internal/async_read_write_stream_tracing.h index 8d6be0a09541d..707daa4962fc5 100644 --- a/google/cloud/internal/async_read_write_stream_tracing.h +++ b/google/cloud/internal/async_read_write_stream_tracing.h @@ -15,7 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ASYNC_READ_WRITE_STREAM_TRACING_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ASYNC_READ_WRITE_STREAM_TRACING_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/async_read_write_stream_impl.h" #include "google/cloud/internal/grpc_opentelemetry.h" #include "google/cloud/version.h" @@ -132,6 +131,5 @@ class AsyncStreamingReadWriteRpcTracing GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ASYNC_READ_WRITE_STREAM_TRACING_H diff --git a/google/cloud/internal/async_read_write_stream_tracing_test.cc b/google/cloud/internal/async_read_write_stream_tracing_test.cc index 8476e4b649fa4..3ea59eab6990d 100644 --- a/google/cloud/internal/async_read_write_stream_tracing_test.cc +++ b/google/cloud/internal/async_read_write_stream_tracing_test.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/async_read_write_stream_tracing.h" #include "google/cloud/mocks/mock_async_streaming_read_write_rpc.h" #include "google/cloud/internal/make_status.h" @@ -390,4 +389,3 @@ TEST(AsyncStreamingReadWriteRpcTracing, StartedStreamShouldExtractMetadata) { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/async_rest_long_running_operation.h b/google/cloud/internal/async_rest_long_running_operation.h index 8f3b01f9453da..94bac4eb6119f 100644 --- a/google/cloud/internal/async_rest_long_running_operation.h +++ b/google/cloud/internal/async_rest_long_running_operation.h @@ -22,7 +22,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.pb.h" #include #include #include diff --git a/google/cloud/internal/async_rest_long_running_operation_custom_test.cc b/google/cloud/internal/async_rest_long_running_operation_custom_test.cc index 3fd0e2bf3328f..a23543ef657d6 100644 --- a/google/cloud/internal/async_rest_long_running_operation_custom_test.cc +++ b/google/cloud/internal/async_rest_long_running_operation_custom_test.cc @@ -20,8 +20,8 @@ #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/mock_completion_queue_impl.h" #include "google/cloud/testing_util/status_matchers.h" -#include -#include +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include #include diff --git a/google/cloud/internal/async_rest_long_running_operation_test.cc b/google/cloud/internal/async_rest_long_running_operation_test.cc index 6be56145b8661..1a91521dd118c 100644 --- a/google/cloud/internal/async_rest_long_running_operation_test.cc +++ b/google/cloud/internal/async_rest_long_running_operation_test.cc @@ -20,8 +20,8 @@ #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/mock_completion_queue_impl.h" #include "google/cloud/testing_util/status_matchers.h" -#include -#include +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include #include diff --git a/google/cloud/internal/async_rest_polling_loop.cc b/google/cloud/internal/async_rest_polling_loop.cc index 0d9e76a47a928..aa6a35d403b14 100644 --- a/google/cloud/internal/async_rest_polling_loop.cc +++ b/google/cloud/internal/async_rest_polling_loop.cc @@ -19,7 +19,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.pb.h" #include #include diff --git a/google/cloud/internal/async_rest_polling_loop.h b/google/cloud/internal/async_rest_polling_loop.h index b19d95e8aadfd..a4f7cf7377ae3 100644 --- a/google/cloud/internal/async_rest_polling_loop.h +++ b/google/cloud/internal/async_rest_polling_loop.h @@ -25,7 +25,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.pb.h" #include #include #include diff --git a/google/cloud/internal/async_rest_polling_loop_custom.h b/google/cloud/internal/async_rest_polling_loop_custom.h index fca11d85f2baf..2ef337c6d5b7d 100644 --- a/google/cloud/internal/async_rest_polling_loop_custom.h +++ b/google/cloud/internal/async_rest_polling_loop_custom.h @@ -27,7 +27,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.pb.h" #include #include #include diff --git a/google/cloud/internal/async_rest_polling_loop_custom_test.cc b/google/cloud/internal/async_rest_polling_loop_custom_test.cc index 316c4d8492b82..fdecfe0710172 100644 --- a/google/cloud/internal/async_rest_polling_loop_custom_test.cc +++ b/google/cloud/internal/async_rest_polling_loop_custom_test.cc @@ -16,8 +16,8 @@ #include "google/cloud/internal/make_status.h" #include "google/cloud/testing_util/mock_completion_queue_impl.h" #include "google/cloud/testing_util/status_matchers.h" -#include -#include +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include namespace google { diff --git a/google/cloud/internal/async_rest_polling_loop_test.cc b/google/cloud/internal/async_rest_polling_loop_test.cc index 41b99ef54517f..b382b427bf8be 100644 --- a/google/cloud/internal/async_rest_polling_loop_test.cc +++ b/google/cloud/internal/async_rest_polling_loop_test.cc @@ -20,8 +20,8 @@ #include "google/cloud/testing_util/mock_completion_queue_impl.h" #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" -#include -#include +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include namespace google { @@ -588,7 +588,6 @@ TEST(AsyncRestPollingLoopTest, PollThenCancelDuringPoll) { HasSubstr("operation cancelled")))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::IsActive; using ::google::cloud::testing_util::OTelAttribute; @@ -724,8 +723,6 @@ TEST(AsyncRestPollingLoopTest, TraceCapturesOperationName) { "gl-cpp.LRO_name", "test-op-name"))))); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rest_internal diff --git a/google/cloud/internal/async_rest_retry_loop_test.cc b/google/cloud/internal/async_rest_retry_loop_test.cc index 1fa7e50cae506..092daf90b63e6 100644 --- a/google/cloud/internal/async_rest_retry_loop_test.cc +++ b/google/cloud/internal/async_rest_retry_loop_test.cc @@ -559,7 +559,6 @@ TEST_F(AsyncRestRetryLoopCancelTest, ShutdownDuringTimer) { Contains(Pair("gcloud-cpp.retry.function", "test-location"))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::IsActive; using ::google::cloud::testing_util::SpanNamed; @@ -615,8 +614,6 @@ TEST(AsyncRestRetryLoopTest, CallSpanActiveDuringCancel) { (void)actual.get(); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rest_internal diff --git a/google/cloud/internal/async_retry_loop.h b/google/cloud/internal/async_retry_loop.h index 9866947c5b4d3..1d121d05902df 100644 --- a/google/cloud/internal/async_retry_loop.h +++ b/google/cloud/internal/async_retry_loop.h @@ -170,16 +170,23 @@ struct FutureValueType> { * functions. If the value is visible, the retry loop will stop on the next * callback and/or before the next request or timer is issued. */ -template +template < + typename Functor, typename Request, typename RetryPolicyType, + typename ReturnType = google::cloud::internal::invoke_result_t< + Functor, google::cloud::CompletionQueue&, + std::shared_ptr, ImmutableOptions, Request const&>> class AsyncRetryLoopImpl : public std::enable_shared_from_this< AsyncRetryLoopImpl> { public: - AsyncRetryLoopImpl(std::unique_ptr retry_policy, - std::unique_ptr backoff_policy, - Idempotency idempotency, google::cloud::CompletionQueue cq, - Functor&& functor, ImmutableOptions options, - Request request, char const* location) + AsyncRetryLoopImpl( + std::unique_ptr retry_policy, + std::unique_ptr backoff_policy, Idempotency idempotency, + google::cloud::CompletionQueue cq, Functor&& functor, + ImmutableOptions options, Request request, char const* location, + std::function< + bool(typename FutureValueType::value_type const&)> + attempt_predicate = {}) : retry_policy_(std::move(retry_policy)), backoff_policy_(std::move(backoff_policy)), idempotency_(idempotency), @@ -188,11 +195,9 @@ class AsyncRetryLoopImpl functor_(std::forward(functor)), request_(std::move(request)), location_(location), - call_context_(std::move(options)) {} + call_context_(std::move(options)), + attempt_predicate_(std::move(attempt_predicate)) {} - using ReturnType = ::google::cloud::internal::invoke_result_t< - Functor, google::cloud::CompletionQueue&, - std::shared_ptr, ImmutableOptions, Request const&>; using T = typename FutureValueType::value_type; future Start() { @@ -256,8 +261,11 @@ class AsyncRetryLoopImpl } void OnAttempt(T result) { - // A successful attempt, set the value and finish the loop. - if (result.ok()) return SetDone(std::move(result)); + // If the attempt is successful and satisfies the attempt predicate, if + // provided, set the value and finish the loop. + if (result.ok() && (!attempt_predicate_ || attempt_predicate_(result))) { + return SetDone(std::move(result)); + } // Some kind of failure, first verify that it is retryable. last_status_ = GetResultStatus(std::move(result)); auto delay = @@ -325,6 +333,8 @@ class AsyncRetryLoopImpl CallContext call_context_; Status last_status_; promise result_; + std::function::value_type const&)> + attempt_predicate_; // Only the following variables require synchronization, as they coordinate // the work between the retry loop (which would be lock-free) and the cancel @@ -339,17 +349,23 @@ class AsyncRetryLoopImpl /** * Create the right AsyncRetryLoopImpl object and start the retry loop on it. */ -template , - ImmutableOptions, Request const&>::value, - int> = 0> -auto AsyncRetryLoop(std::unique_ptr retry_policy, - std::unique_ptr backoff_policy, - Idempotency idempotency, google::cloud::CompletionQueue cq, - Functor&& functor, ImmutableOptions options, - Request request, char const* location) +template < + typename Functor, typename Request, typename RetryPolicyType, + std::enable_if_t, ImmutableOptions, + Request const&>::value, + int> = 0, + typename ReturnType = google::cloud::internal::invoke_result_t< + Functor, google::cloud::CompletionQueue&, + std::shared_ptr, ImmutableOptions, Request const&>> +auto AsyncRetryLoop( + std::unique_ptr retry_policy, + std::unique_ptr backoff_policy, Idempotency idempotency, + google::cloud::CompletionQueue cq, Functor&& functor, + ImmutableOptions options, Request request, char const* location, + std::function::value_type const&)> + attempt_predicate = {}) -> google::cloud::internal::invoke_result_t< Functor, google::cloud::CompletionQueue&, std::shared_ptr, ImmutableOptions, @@ -358,7 +374,7 @@ auto AsyncRetryLoop(std::unique_ptr retry_policy, std::make_shared>( std::move(retry_policy), std::move(backoff_policy), idempotency, std::move(cq), std::forward(functor), options, - std::move(request), location); + std::move(request), location, std::move(attempt_predicate)); return loop->Start(); } diff --git a/google/cloud/internal/async_retry_loop_test.cc b/google/cloud/internal/async_retry_loop_test.cc index 679c06f5da4e4..98f77b68ff07e 100644 --- a/google/cloud/internal/async_retry_loop_test.cc +++ b/google/cloud/internal/async_retry_loop_test.cc @@ -160,6 +160,32 @@ TEST(AsyncRetryLoopTest, TransientThenSuccess) { EXPECT_EQ(84, *actual); } +TEST(AsyncRetryLoopTest, TransientPredicateThenSuccess) { + AutomaticallyCreatedBackgroundThreads background; + ::testing::MockFunction)> mock_predicate; + EXPECT_CALL(mock_predicate, Call) + .WillOnce([](StatusOr const&) { return false; }) + .WillOnce([](StatusOr const&) { return false; }) + .WillOnce([](StatusOr const&) { return true; }); + + auto pending = AsyncRetryLoop( + TestRetryPolicy(), TestBackoffPolicy(), Idempotency::kIdempotent, + background.cq(), + [&](google::cloud::CompletionQueue&, auto, + ImmutableOptions const& options, int request) { + EXPECT_EQ(options->get(), "TransientPredicateThenSuccess"); + return make_ready_future(StatusOr(2 * request)); + }, + MakeImmutableOptions( + Options{}.set("TransientPredicateThenSuccess")), + 42, "error message", mock_predicate.AsStdFunction()); + + OptionsSpan overlay(Options{}.set("uh-oh")); + StatusOr actual = pending.get(); + ASSERT_THAT(actual.status(), IsOk()); + EXPECT_EQ(84, *actual); +} + TEST(AsyncRetryLoopTest, ReturnJustStatus) { int counter = 0; AutomaticallyCreatedBackgroundThreads background; @@ -604,7 +630,6 @@ TEST_F(AsyncRetryLoopCancelTest, ShutdownDuringTimer) { Contains(Pair("gcloud-cpp.retry.function", "test-location"))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::IsActive; using ::google::cloud::testing_util::SpanNamed; @@ -658,8 +683,6 @@ TEST(AsyncRetryLoopTest, CallSpanActiveDuringCancel) { (void)actual.get(); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace } // namespace internal GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/async_retry_unary_rpc.h b/google/cloud/internal/async_retry_unary_rpc.h index b9f0fa367f317..930ccf4773581 100644 --- a/google/cloud/internal/async_retry_unary_rpc.h +++ b/google/cloud/internal/async_retry_unary_rpc.h @@ -21,7 +21,7 @@ #include "google/cloud/internal/setup_context.h" #include "google/cloud/retry_policy.h" #include "google/cloud/version.h" -#include +#include "google/protobuf/empty.pb.h" #include #include diff --git a/google/cloud/internal/async_retry_unary_rpc_test.cc b/google/cloud/internal/async_retry_unary_rpc_test.cc index dcd6b43af8c66..4c1d6cf21307f 100644 --- a/google/cloud/internal/async_retry_unary_rpc_test.cc +++ b/google/cloud/internal/async_retry_unary_rpc_test.cc @@ -19,8 +19,8 @@ #include "google/cloud/testing_util/fake_completion_queue_impl.h" #include "google/cloud/testing_util/mock_async_response_reader.h" #include "google/cloud/testing_util/status_matchers.h" -#include -#include +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include #include diff --git a/google/cloud/internal/async_streaming_read_rpc_impl_test.cc b/google/cloud/internal/async_streaming_read_rpc_impl_test.cc index 31ec5c6eb3309..e8a1fbfaede47 100644 --- a/google/cloud/internal/async_streaming_read_rpc_impl_test.cc +++ b/google/cloud/internal/async_streaming_read_rpc_impl_test.cc @@ -172,8 +172,6 @@ TEST(AsyncStreamingReadRpcTest, Error) { stream.Finish().get()); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - using ::google::cloud::testing_util::IsActive; TEST(AsyncStreamingReadRpcTest, SpanActiveAcrossAsyncGrpcOperations) { @@ -262,8 +260,6 @@ TEST(AsyncStreamingReadRpcTest, SpanActiveAcrossAsyncGrpcOperations) { (void)finish.get(); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace } // namespace internal GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/async_streaming_read_rpc_logging.h b/google/cloud/internal/async_streaming_read_rpc_logging.h index efc23b67a88d0..112f68dc9d2e0 100644 --- a/google/cloud/internal/async_streaming_read_rpc_logging.h +++ b/google/cloud/internal/async_streaming_read_rpc_logging.h @@ -15,12 +15,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ASYNC_STREAMING_READ_RPC_LOGGING_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ASYNC_STREAMING_READ_RPC_LOGGING_H -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/async_streaming_read_rpc.h" #include "google/cloud/internal/grpc_request_metadata.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" +#include "absl/strings/str_join.h" namespace google { namespace cloud { diff --git a/google/cloud/internal/async_streaming_read_rpc_logging_test.cc b/google/cloud/internal/async_streaming_read_rpc_logging_test.cc index b2b7ec9825be6..55cf6fc41ca98 100644 --- a/google/cloud/internal/async_streaming_read_rpc_logging_test.cc +++ b/google/cloud/internal/async_streaming_read_rpc_logging_test.cc @@ -18,7 +18,7 @@ #include "google/cloud/testing_util/scoped_log.h" #include "google/cloud/testing_util/status_matchers.h" #include "google/cloud/tracing_options.h" -#include +#include "google/protobuf/duration.pb.h" #include namespace google { diff --git a/google/cloud/internal/async_streaming_read_rpc_tracing.h b/google/cloud/internal/async_streaming_read_rpc_tracing.h index 71e77f2d02732..2099531b2754d 100644 --- a/google/cloud/internal/async_streaming_read_rpc_tracing.h +++ b/google/cloud/internal/async_streaming_read_rpc_tracing.h @@ -15,7 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ASYNC_STREAMING_READ_RPC_TRACING_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ASYNC_STREAMING_READ_RPC_TRACING_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/async_streaming_read_rpc.h" #include "google/cloud/internal/grpc_opentelemetry.h" #include "google/cloud/version.h" @@ -108,6 +107,5 @@ class AsyncStreamingReadRpcTracing : public AsyncStreamingReadRpc { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ASYNC_STREAMING_READ_RPC_TRACING_H diff --git a/google/cloud/internal/async_streaming_read_rpc_tracing_test.cc b/google/cloud/internal/async_streaming_read_rpc_tracing_test.cc index 8879d4882af90..52113a5ccb225 100644 --- a/google/cloud/internal/async_streaming_read_rpc_tracing_test.cc +++ b/google/cloud/internal/async_streaming_read_rpc_tracing_test.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/async_streaming_read_rpc_tracing.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/opentelemetry.h" @@ -266,4 +265,3 @@ TEST(AsyncStreamingReadRpcTracing, StartedStreamShouldExtractMetadata) { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/async_streaming_write_rpc_impl_test.cc b/google/cloud/internal/async_streaming_write_rpc_impl_test.cc index 235a2939c22b9..b065dec84d8bf 100644 --- a/google/cloud/internal/async_streaming_write_rpc_impl_test.cc +++ b/google/cloud/internal/async_streaming_write_rpc_impl_test.cc @@ -184,8 +184,6 @@ TEST(AsyncStreamingWriteRpcTest, Error) { stream.Finish().get().status()); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - using ::google::cloud::testing_util::IsActive; TEST(AsyncStreamingWriteRpcTest, SpanActiveAcrossAsyncGrpcOperations) { @@ -287,8 +285,6 @@ TEST(AsyncStreamingWriteRpcTest, SpanActiveAcrossAsyncGrpcOperations) { (void)finish.get(); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace } // namespace internal GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/async_streaming_write_rpc_logging.h b/google/cloud/internal/async_streaming_write_rpc_logging.h index 4f33ec409f460..268ee3224e14b 100644 --- a/google/cloud/internal/async_streaming_write_rpc_logging.h +++ b/google/cloud/internal/async_streaming_write_rpc_logging.h @@ -15,12 +15,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ASYNC_STREAMING_WRITE_RPC_LOGGING_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ASYNC_STREAMING_WRITE_RPC_LOGGING_H -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/async_streaming_write_rpc.h" #include "google/cloud/internal/grpc_request_metadata.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" +#include "absl/strings/str_join.h" namespace google { namespace cloud { diff --git a/google/cloud/internal/async_streaming_write_rpc_logging_test.cc b/google/cloud/internal/async_streaming_write_rpc_logging_test.cc index 2838c0ce1bbba..4097c0dd884d4 100644 --- a/google/cloud/internal/async_streaming_write_rpc_logging_test.cc +++ b/google/cloud/internal/async_streaming_write_rpc_logging_test.cc @@ -18,8 +18,8 @@ #include "google/cloud/testing_util/scoped_log.h" #include "google/cloud/testing_util/status_matchers.h" #include "google/cloud/tracing_options.h" -#include -#include +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include namespace google { diff --git a/google/cloud/internal/async_streaming_write_rpc_tracing.h b/google/cloud/internal/async_streaming_write_rpc_tracing.h index e962f7ac95c41..de64ccc9306e0 100644 --- a/google/cloud/internal/async_streaming_write_rpc_tracing.h +++ b/google/cloud/internal/async_streaming_write_rpc_tracing.h @@ -15,7 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ASYNC_STREAMING_WRITE_RPC_TRACING_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ASYNC_STREAMING_WRITE_RPC_TRACING_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/async_streaming_write_rpc.h" #include "google/cloud/internal/grpc_opentelemetry.h" #include "google/cloud/version.h" @@ -122,6 +121,5 @@ class AsyncStreamingWriteRpcTracing GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ASYNC_STREAMING_WRITE_RPC_TRACING_H diff --git a/google/cloud/internal/async_streaming_write_rpc_tracing_test.cc b/google/cloud/internal/async_streaming_write_rpc_tracing_test.cc index f7906db2982c5..960c0affac56c 100644 --- a/google/cloud/internal/async_streaming_write_rpc_tracing_test.cc +++ b/google/cloud/internal/async_streaming_write_rpc_tracing_test.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/async_streaming_write_rpc_tracing.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/opentelemetry.h" @@ -293,4 +292,3 @@ TEST(AsyncStreamingWriteRpcTracing, StartedStreamShouldExtractMetadata) { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/base64_transforms.cc b/google/cloud/internal/base64_transforms.cc index 3a8d5c52155ef..d7a33201142ff 100644 --- a/google/cloud/internal/base64_transforms.cc +++ b/google/cloud/internal/base64_transforms.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/internal/base64_transforms.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/make_status.h" +#include "absl/strings/str_cat.h" #include namespace google { diff --git a/google/cloud/internal/call_context.h b/google/cloud/internal/call_context.h index eb6575f0aab47..0134614de518e 100644 --- a/google/cloud/internal/call_context.h +++ b/google/cloud/internal/call_context.h @@ -18,11 +18,9 @@ #include "google/cloud/internal/opentelemetry_context.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include #include #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include #include @@ -44,9 +42,7 @@ struct CallContext { CallContext() : CallContext(SaveCurrentOptions()) {} ImmutableOptions options; -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY OTelContext otel_context = CurrentOTelContext(); -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY }; /** @@ -58,13 +54,10 @@ class ScopedCallContext { public: explicit ScopedCallContext(CallContext call_context) : options_span_(std::move(call_context.options)) -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY // clang-format off , scoped_otel_context_(std::move(call_context.otel_context)) // clang-format on -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - { - } + {} // `ScopedCallContext` should not be copied/moved. ScopedCallContext(ScopedCallContext const&) = delete; @@ -78,9 +71,7 @@ class ScopedCallContext { private: OptionsSpan options_span_; -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY ScopedOTelContext scoped_otel_context_; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY }; } // namespace internal diff --git a/google/cloud/internal/call_context_test.cc b/google/cloud/internal/call_context_test.cc index 79e1c2c2c74fb..d05231e8ce817 100644 --- a/google/cloud/internal/call_context_test.cc +++ b/google/cloud/internal/call_context_test.cc @@ -44,7 +44,6 @@ TEST(CallContext, Options) { EXPECT_FALSE(CallContext().options->has()); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::testing::ElementsAre; using ::testing::IsEmpty; @@ -67,8 +66,6 @@ TEST(CallContext, OTel) { EXPECT_THAT(CallContext().otel_context, IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace } // namespace internal GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END 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/credentials_impl.cc b/google/cloud/internal/credentials_impl.cc index e7c1fd2f82a90..f3a4b8ee9e515 100644 --- a/google/cloud/internal/credentials_impl.cc +++ b/google/cloud/internal/credentials_impl.cc @@ -87,9 +87,11 @@ std::vector const& ImpersonateServiceAccountConfig::delegates() return options_.get(); } -ServiceAccountConfig::ServiceAccountConfig(std::string json_object, - Options opts) +ServiceAccountConfig::ServiceAccountConfig( + absl::optional json_object, + absl::optional file_path, Options opts) : json_object_(std::move(json_object)), + file_path_(std::move(file_path)), options_(PopulateAuthOptions(std::move(opts))) {} ExternalAccountConfig::ExternalAccountConfig(std::string json_object, diff --git a/google/cloud/internal/credentials_impl.h b/google/cloud/internal/credentials_impl.h index 94af7f2e40b89..4b7eea36ab21e 100644 --- a/google/cloud/internal/credentials_impl.h +++ b/google/cloud/internal/credentials_impl.h @@ -144,15 +144,23 @@ class ImpersonateServiceAccountConfig : public Credentials { class ServiceAccountConfig : public Credentials { public: - ServiceAccountConfig(std::string json_object, Options opts); - - std::string const& json_object() const { return json_object_; } + // Only one of json_object or file_path should have a value. + // TODO(#15886): Use the C++ type system to make better constructors that + // enforces this comment. + ServiceAccountConfig(absl::optional json_object, + absl::optional file_path, Options opts); + + absl::optional const& json_object() const { + return json_object_; + } + absl::optional const& file_path() const { return file_path_; } Options const& options() const { return options_; } private: void dispatch(CredentialsVisitor& v) const override { v.visit(*this); } - std::string json_object_; + absl::optional json_object_; + absl::optional file_path_; Options options_; }; diff --git a/google/cloud/internal/curl_impl.cc b/google/cloud/internal/curl_impl.cc index a5218bb547b0a..9d897bfe59909 100644 --- a/google/cloud/internal/curl_impl.cc +++ b/google/cloud/internal/curl_impl.cc @@ -15,8 +15,6 @@ #include "google/cloud/internal/curl_impl.h" #include "google/cloud/common_options.h" #include "google/cloud/credentials.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/algorithm.h" #include "google/cloud/internal/curl_options.h" #include "google/cloud/internal/curl_writev.h" @@ -26,6 +24,8 @@ #include "google/cloud/log.h" #include "google/cloud/rest_options.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include "absl/strings/strip.h" #include #include @@ -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 d0abda63df0b9..0a993ff7c2a86 100644 --- a/google/cloud/internal/curl_rest_client.cc +++ b/google/cloud/internal/curl_rest_client.cc @@ -15,8 +15,6 @@ #include "google/cloud/internal/curl_rest_client.h" #include "google/cloud/common_options.h" #include "google/cloud/credentials.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/curl_handle_factory.h" #include "google/cloud/internal/curl_impl.h" #include "google/cloud/internal/curl_options.h" @@ -26,6 +24,8 @@ #include "google/cloud/internal/tracing_rest_client.h" #include "google/cloud/internal/unified_rest_credentials.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include "absl/strings/strip.h" namespace google { @@ -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/curl_wrappers.cc b/google/cloud/internal/curl_wrappers.cc index c886f54725421..ef3bb59e4f066 100644 --- a/google/cloud/internal/curl_wrappers.cc +++ b/google/cloud/internal/curl_wrappers.cc @@ -13,12 +13,12 @@ // limitations under the License. #include "google/cloud/internal/curl_wrappers.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/internal/curl_options.h" #include "google/cloud/internal/throw_delegate.h" #include "google/cloud/log.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_replace.h" #include "absl/strings/str_split.h" #ifndef _WIN32 #include diff --git a/google/cloud/internal/debug_string.h b/google/cloud/internal/debug_string.h index fb4631ada7dbc..3c9f60d0de2b7 100644 --- a/google/cloud/internal/debug_string.h +++ b/google/cloud/internal/debug_string.h @@ -15,9 +15,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_DEBUG_STRING_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_DEBUG_STRING_H -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" +#include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "absl/time/time.h" #include "absl/types/optional.h" diff --git a/google/cloud/internal/debug_string_protobuf.cc b/google/cloud/internal/debug_string_protobuf.cc index 30e6412e6d3a3..e652d2458bbd5 100644 --- a/google/cloud/internal/debug_string_protobuf.cc +++ b/google/cloud/internal/debug_string_protobuf.cc @@ -13,11 +13,11 @@ // limitations under the License. #include "google/cloud/internal/debug_string_protobuf.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" #include "absl/time/time.h" -#include +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include -#include namespace google { namespace cloud { diff --git a/google/cloud/internal/debug_string_protobuf_test.cc b/google/cloud/internal/debug_string_protobuf_test.cc index bc23db2879b78..bb6bfed365c57 100644 --- a/google/cloud/internal/debug_string_protobuf_test.cc +++ b/google/cloud/internal/debug_string_protobuf_test.cc @@ -15,10 +15,10 @@ #include "google/cloud/internal/debug_string_protobuf.h" #include "google/cloud/testing_util/scoped_log.h" #include "google/cloud/tracing_options.h" -#include -#include +#include "google/iam/v1/policy.pb.h" +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include -#include #include namespace google { diff --git a/google/cloud/internal/debug_string_status.cc b/google/cloud/internal/debug_string_status.cc index 4f6655e2862eb..1ef72d76bffa0 100644 --- a/google/cloud/internal/debug_string_status.cc +++ b/google/cloud/internal/debug_string_status.cc @@ -15,9 +15,9 @@ #include "google/cloud/internal/debug_string_status.h" #include "google/cloud/internal/debug_string_protobuf.h" #include "google/cloud/internal/status_payload_keys.h" -#include -#include -#include +#include "google/protobuf/any.pb.h" +#include "google/rpc/error_details.pb.h" +#include "google/rpc/status.pb.h" #include namespace google { diff --git a/google/cloud/internal/debug_string_status_test.cc b/google/cloud/internal/debug_string_status_test.cc index d1f1bec903442..008605e063309 100644 --- a/google/cloud/internal/debug_string_status_test.cc +++ b/google/cloud/internal/debug_string_status_test.cc @@ -15,8 +15,8 @@ #include "google/cloud/internal/debug_string_status.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/tracing_options.h" -#include -#include +#include "google/rpc/error_details.pb.h" +#include "google/rpc/status.pb.h" #include namespace google { diff --git a/google/cloud/internal/error_context.cc b/google/cloud/internal/error_context.cc index 835029c79c3c7..fe937134ae2a2 100644 --- a/google/cloud/internal/error_context.cc +++ b/google/cloud/internal/error_context.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/internal/error_context.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" namespace google { namespace cloud { diff --git a/google/cloud/internal/external_account_source_format.cc b/google/cloud/internal/external_account_source_format.cc index 63b48e9ec0a07..1a65a289d2e3c 100644 --- a/google/cloud/internal/external_account_source_format.cc +++ b/google/cloud/internal/external_account_source_format.cc @@ -13,9 +13,9 @@ // limitations under the License. #include "google/cloud/internal/external_account_source_format.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/json_parsing.h" #include "google/cloud/internal/make_status.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/internal/external_account_token_source_aws.cc b/google/cloud/internal/external_account_token_source_aws.cc index 35f066c1b46c9..e79c10ade182a 100644 --- a/google/cloud/internal/external_account_token_source_aws.cc +++ b/google/cloud/internal/external_account_token_source_aws.cc @@ -13,9 +13,6 @@ // limitations under the License. #include "google/cloud/internal/external_account_token_source_aws.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/internal/external_account_source_format.h" #include "google/cloud/internal/format_time_point.h" #include "google/cloud/internal/getenv.h" @@ -25,6 +22,9 @@ #include "google/cloud/internal/sha256_hmac.h" #include "google/cloud/internal/url_encode.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "absl/strings/str_replace.h" #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" #include diff --git a/google/cloud/internal/extract_long_running_result.h b/google/cloud/internal/extract_long_running_result.h index 8ae14cfc9b5d2..15a269513aff0 100644 --- a/google/cloud/internal/extract_long_running_result.h +++ b/google/cloud/internal/extract_long_running_result.h @@ -18,8 +18,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/version.h" #include "absl/functional/function_ref.h" -#include -#include +#include "google/longrunning/operations.pb.h" +#include "google/protobuf/any.pb.h" #include namespace google { diff --git a/google/cloud/internal/extract_long_running_result_test.cc b/google/cloud/internal/extract_long_running_result_test.cc index 8d99f402d261f..7eb810a85416e 100644 --- a/google/cloud/internal/extract_long_running_result_test.cc +++ b/google/cloud/internal/extract_long_running_result_test.cc @@ -16,7 +16,7 @@ #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/mock_completion_queue_impl.h" #include "google/cloud/testing_util/status_matchers.h" -#include +#include "google/protobuf/timestamp.pb.h" #include namespace google { diff --git a/google/cloud/internal/future_impl.cc b/google/cloud/internal/future_impl.cc index 388a480d23bd7..066318e49e837 100644 --- a/google/cloud/internal/future_impl.cc +++ b/google/cloud/internal/future_impl.cc @@ -17,46 +17,6 @@ #include "google/cloud/terminate_handler.h" #include -// This function is only needed if exceptions are enabled. -#ifdef GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS -// TODO(#14152): Remove libC++ hack -// The `std::future_error::future_error(std::future_errc)` constructor is not -// guaranteed to exist until C++17. Fortunately, stdlibc++, MSVC are forgiving, -// and libc++ is forgiving until version 18.1. -#if GOOGLE_CLOUD_CPP_CPP_VERSION >= 201703L || _LIBCPP_VERSION < 180100 - -namespace { -std::future_error MakeFutureErrorImpl(std::future_errc ec) { - return std::future_error(ec); -} -} // namespace - -#else -// We can probably tolerate this terrible hack (which depends on UB) until we -// require C++17. -namespace { -struct OhTheHorrors {}; -} // namespace - -namespace std { -template <> -class promise { - public: - static auto MakeFutureError(std::future_errc ec) { - return std::future_error(std::make_error_code(ec)); - } -}; -} // namespace std - -namespace { -std::future_error MakeFutureErrorImpl(std::future_errc ec) { - return std::promise::MakeFutureError(ec); -} -} // namespace - -#endif -#endif // GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS - namespace google { namespace cloud { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN @@ -65,7 +25,7 @@ namespace internal { [[noreturn]] void ThrowFutureError(std::future_errc ec, char const* msg) { #ifdef GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS (void)msg; // disable unused argument warning. - throw MakeFutureErrorImpl(ec); + throw std::future_error(ec); #else std::string full_msg = "future_error["; full_msg += std::make_error_code(ec).message(); @@ -87,7 +47,7 @@ namespace internal { std::exception_ptr MakeFutureError(std::future_errc ec) { #ifdef GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS - return std::make_exception_ptr(MakeFutureErrorImpl(ec)); + return std::make_exception_ptr(std::future_error(ec)); #else (void)ec; // We cannot create a valid `std::exception_ptr` in this case. It does not diff --git a/google/cloud/internal/grpc_impersonate_service_account_integration_test.cc b/google/cloud/internal/grpc_impersonate_service_account_integration_test.cc index 684a389ea00d6..7f1518a1e1cee 100644 --- a/google/cloud/internal/grpc_impersonate_service_account_integration_test.cc +++ b/google/cloud/internal/grpc_impersonate_service_account_integration_test.cc @@ -22,7 +22,7 @@ #include "google/cloud/log.h" #include "google/cloud/testing_util/integration_test.h" #include "google/cloud/testing_util/status_matchers.h" -#include +#include "google/bigtable/admin/v2/bigtable_table_admin.grpc.pb.h" #include namespace google { diff --git a/google/cloud/internal/grpc_opentelemetry.cc b/google/cloud/internal/grpc_opentelemetry.cc index 0f9308bbab1b1..34917c46791b2 100644 --- a/google/cloud/internal/grpc_opentelemetry.cc +++ b/google/cloud/internal/grpc_opentelemetry.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/internal/grpc_opentelemetry.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/grpc_metadata_view.h" #include "google/cloud/internal/grpc_request_metadata.h" #include "google/cloud/internal/noexcept_action.h" @@ -21,22 +20,20 @@ #include "google/cloud/log.h" #include "google/cloud/options.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include #include -#include +#include +#include #include #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace google { namespace cloud { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace internal { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - namespace { /** @@ -110,17 +107,17 @@ std::pair MakeAttribute( opentelemetry::nostd::shared_ptr MakeSpanGrpc( opentelemetry::nostd::string_view service, opentelemetry::nostd::string_view method) { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; opentelemetry::trace::StartSpanOptions options; options.kind = opentelemetry::trace::SpanKind::kClient; return internal::MakeSpan( absl::StrCat(absl::string_view{service.data(), service.size()}, "/", absl::string_view{method.data(), method.size()}), - {{sc::kRpcSystem, sc::RpcSystemValues::kGrpc}, - {sc::kRpcService, service}, - {sc::kRpcMethod, method}, + {{sc::rpc::kRpcSystem, sc::rpc::RpcSystemValues::kGrpc}, + {sc::rpc::kRpcService, service}, + {sc::rpc::kRpcMethod, method}, {/*sc::kNetworkTransport=*/"network.transport", - sc::NetTransportValues::kIpTcp}, + sc::network::NetworkTransportValues::kTcp}, {"grpc.version", grpc::Version()}}, options); } @@ -165,7 +162,6 @@ future EndSpan( return EndSpan(*s, std::move(t)); }); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace internal GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/grpc_opentelemetry.h b/google/cloud/internal/grpc_opentelemetry.h index 500e3c67c363f..9ea8bc86a80e2 100644 --- a/google/cloud/internal/grpc_opentelemetry.h +++ b/google/cloud/internal/grpc_opentelemetry.h @@ -22,10 +22,8 @@ #include "google/cloud/options.h" #include "google/cloud/version.h" #include -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include #include @@ -34,8 +32,6 @@ namespace cloud { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace internal { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Make a span, setting attributes related to gRPC. * @@ -112,8 +108,6 @@ future> EndSpan( }); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Returns a traced timer, if OpenTelemetry tracing is enabled. */ @@ -121,14 +115,12 @@ template future> TracedAsyncBackoff( CompletionQueue& cq, Options const& options, std::chrono::duration duration, std::string const& name) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (TracingEnabled(options)) { auto span = MakeSpan(name); OTelScope scope(span); auto timer = cq.MakeRelativeTimer(duration); return EndSpan(std::move(span), std::move(timer)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY (void)options; (void)name; return cq.MakeRelativeTimer(duration); diff --git a/google/cloud/internal/grpc_opentelemetry_test.cc b/google/cloud/internal/grpc_opentelemetry_test.cc index 135ce26dabfef..2ad4667b69d0a 100644 --- a/google/cloud/internal/grpc_opentelemetry_test.cc +++ b/google/cloud/internal/grpc_opentelemetry_test.cc @@ -22,10 +22,9 @@ #include "google/cloud/testing_util/validate_propagator.h" #include #include -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include -#include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY +#include +#include namespace google { namespace cloud { @@ -36,7 +35,6 @@ namespace { using ::testing::ByMove; using ::testing::Return; -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::InstallSpanCatcher; @@ -57,7 +55,7 @@ using ::testing::IsEmpty; using ::testing::Pair; TEST(OpenTelemetry, MakeSpanGrpc) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto span = MakeSpanGrpc("google.cloud.foo.v1.Foo", "GetBar"); @@ -70,14 +68,14 @@ TEST(OpenTelemetry, MakeSpanGrpc) { SpanHasInstrumentationScope(), SpanKindIsClient(), SpanNamed("google.cloud.foo.v1.Foo/GetBar"), SpanHasAttributes( - OTelAttribute(sc::kRpcSystem, - sc::RpcSystemValues::kGrpc), - OTelAttribute(sc::kRpcService, + OTelAttribute(sc::rpc::kRpcSystem, + sc::rpc::RpcSystemValues::kGrpc), + OTelAttribute(sc::rpc::kRpcService, "google.cloud.foo.v1.Foo"), - OTelAttribute(sc::kRpcMethod, "GetBar"), + OTelAttribute(sc::rpc::kRpcMethod, "GetBar"), OTelAttribute( /*sc::kNetworkTransport=*/"network.transport", - sc::NetTransportValues::kIpTcp), + sc::network::NetworkTransportValues::kTcp), OTelAttribute("grpc.version", grpc::Version()))))); } @@ -321,22 +319,6 @@ TEST(OpenTelemetry, TracedAsyncBackoffPreservesContext) { SpanNamed("parent"))); } -#else - -TEST(NoOpenTelemetry, TracedAsyncBackoff) { - auto const duration = std::chrono::nanoseconds(100); - auto mock_cq = std::make_shared(); - EXPECT_CALL(*mock_cq, MakeRelativeTimer(duration)) - .WillOnce(Return(ByMove(make_ready_future( - make_status_or(std::chrono::system_clock::now()))))); - CompletionQueue cq(mock_cq); - - auto f = TracedAsyncBackoff(cq, Options{}, duration, "Async Backoff"); - EXPECT_STATUS_OK(f.get()); -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace } // namespace internal GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/grpc_request_metadata.cc b/google/cloud/internal/grpc_request_metadata.cc index 8cecfd683c287..008877f213a24 100644 --- a/google/cloud/internal/grpc_request_metadata.cc +++ b/google/cloud/internal/grpc_request_metadata.cc @@ -13,9 +13,9 @@ // limitations under the License. #include "google/cloud/internal/grpc_request_metadata.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/grpc_metadata_view.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include namespace google { diff --git a/google/cloud/internal/http_header.cc b/google/cloud/internal/http_header.cc index a1eb507989c36..fbe8820eec808 100644 --- a/google/cloud/internal/http_header.cc +++ b/google/cloud/internal/http_header.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/internal/http_header.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include "absl/strings/strip.h" namespace google { @@ -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 77eb2ce902ddb..6ef260fe38c35 100644 --- a/google/cloud/internal/json_parsing.cc +++ b/google/cloud/internal/json_parsing.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/internal/json_parsing.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/make_status.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { @@ -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/log_wrapper_test.cc b/google/cloud/internal/log_wrapper_test.cc index 281fe1be5be4e..da021d88f6e62 100644 --- a/google/cloud/internal/log_wrapper_test.cc +++ b/google/cloud/internal/log_wrapper_test.cc @@ -18,8 +18,8 @@ #include "google/cloud/testing_util/scoped_log.h" #include "google/cloud/testing_util/status_matchers.h" #include "google/cloud/tracing_options.h" -#include -#include +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include #include #include diff --git a/google/cloud/internal/minimal_iam_credentials_stub.cc b/google/cloud/internal/minimal_iam_credentials_stub.cc index d88ca2e5582d3..265e2711eda9b 100644 --- a/google/cloud/internal/minimal_iam_credentials_stub.cc +++ b/google/cloud/internal/minimal_iam_credentials_stub.cc @@ -24,7 +24,7 @@ #include "google/cloud/internal/trace_propagator.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/internal/url_encode.h" -#include +#include "google/iam/credentials/v1/iamcredentials.grpc.pb.h" namespace google { namespace cloud { @@ -161,7 +161,6 @@ class AsyncAccessTokenGeneratorLogging : public MinimalIamCredentialsStub { TracingOptions tracing_options_; }; -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY class AsyncAccessTokenGeneratorTracing : public MinimalIamCredentialsStub { public: explicit AsyncAccessTokenGeneratorTracing( @@ -197,8 +196,6 @@ class AsyncAccessTokenGeneratorTracing : public MinimalIamCredentialsStub { std::shared_ptr propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace std::shared_ptr DecorateMinimalIamCredentialsStub( @@ -209,11 +206,9 @@ std::shared_ptr DecorateMinimalIamCredentialsStub( impl = std::make_shared( std::move(impl), options.get()); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (TracingEnabled(options)) { impl = std::make_shared(std::move(impl)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return impl; } diff --git a/google/cloud/internal/minimal_iam_credentials_stub.h b/google/cloud/internal/minimal_iam_credentials_stub.h index b126995c74a75..4c92dd9a0d269 100644 --- a/google/cloud/internal/minimal_iam_credentials_stub.h +++ b/google/cloud/internal/minimal_iam_credentials_stub.h @@ -19,7 +19,7 @@ #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#include "google/iam/credentials/v1/iamcredentials.grpc.pb.h" #include namespace google { diff --git a/google/cloud/internal/minimal_iam_credentials_stub_test.cc b/google/cloud/internal/minimal_iam_credentials_stub_test.cc index 953bb03a970e9..1cd3cab0c1638 100644 --- a/google/cloud/internal/minimal_iam_credentials_stub_test.cc +++ b/google/cloud/internal/minimal_iam_credentials_stub_test.cc @@ -25,7 +25,7 @@ #include "google/cloud/testing_util/validate_metadata.h" #include "google/cloud/testing_util/validate_propagator.h" #include "google/cloud/universe_domain_options.h" -#include +#include "google/iam/credentials/v1/iamcredentials.grpc.pb.h" #include namespace google { @@ -219,7 +219,6 @@ TEST_F(MinimalIamCredentialsStubTest, LoggingComponentNames) { } } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::OTelAttribute; @@ -342,7 +341,6 @@ TEST_F(MinimalIamCredentialsStubTest, SignBlobTracing) { OTelAttribute("grpc.peer", _), OTelAttribute("gl-cpp.status_code", kErrorCode))))); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY TEST(MakeMinimalIamCredentialsOptions, Default) { auto o = MakeMinimalIamCredentialsOptions( 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 624cc5216ed00..ac9cb5d2175f5 100644 --- a/google/cloud/internal/oauth2_compute_engine_credentials.cc +++ b/google/cloud/internal/oauth2_compute_engine_credentials.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/internal/oauth2_compute_engine_credentials.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/compute_engine_util.h" #include "google/cloud/internal/curl_options.h" #include "google/cloud/internal/make_status.h" @@ -24,6 +23,7 @@ #include "google/cloud/internal/rest_retry_loop.h" #include "google/cloud/internal/retry_policy_impl.h" #include "google/cloud/universe_domain_options.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_split.h" #include #include @@ -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 dab8ef14b6c55..d9c7042972280 100644 --- a/google/cloud/internal/oauth2_compute_engine_credentials_test.cc +++ b/google/cloud/internal/oauth2_compute_engine_credentials_test.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/internal/oauth2_compute_engine_credentials.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/backoff_policy.h" #include "google/cloud/internal/compute_engine_util.h" #include "google/cloud/internal/make_status.h" @@ -23,6 +22,7 @@ #include "google/cloud/testing_util/mock_rest_response.h" #include "google/cloud/testing_util/status_matchers.h" #include "google/cloud/universe_domain_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -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 42dd2e760328e..4f85f961640f5 100644 --- a/google/cloud/internal/oauth2_credentials.cc +++ b/google/cloud/internal/oauth2_credentials.cc @@ -13,15 +13,33 @@ // limitations under the License. #include "google/cloud/internal/oauth2_credentials.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/oauth2_universe_domain.h" +#include "absl/strings/str_cat.h" namespace google { 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 c50f7f116bfd9..c162b1d398719 100644 --- a/google/cloud/internal/oauth2_external_account_credentials.cc +++ b/google/cloud/internal/oauth2_external_account_credentials.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/internal/oauth2_external_account_credentials.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/external_account_token_source_aws.h" #include "google/cloud/internal/external_account_token_source_file.h" #include "google/cloud/internal/external_account_token_source_url.h" @@ -24,7 +23,9 @@ #include "google/cloud/internal/oauth2_universe_domain.h" #include "google/cloud/internal/parse_rfc3339.h" #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 8a4b415d35b31..9cea2ea5e0d8b 100644 --- a/google/cloud/internal/oauth2_minimal_iam_credentials_rest.cc +++ b/google/cloud/internal/oauth2_minimal_iam_credentials_rest.cc @@ -14,10 +14,9 @@ #include "google/cloud/internal/oauth2_minimal_iam_credentials_rest.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.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" @@ -26,12 +25,23 @@ #include "google/cloud/internal/rest_response.h" #include "google/cloud/log.h" #include "google/cloud/options.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include 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 25f60f96585a2..7a81fe2ad43f2 100644 --- a/google/cloud/internal/oauth2_minimal_iam_credentials_rest_test.cc +++ b/google/cloud/internal/oauth2_minimal_iam_credentials_rest_test.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/internal/oauth2_minimal_iam_credentials_rest.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/http_payload.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/rest_request.h" @@ -23,6 +22,7 @@ #include "google/cloud/testing_util/mock_rest_client.h" #include "google/cloud/testing_util/mock_rest_response.h" #include "google/cloud/testing_util/status_matchers.h" +#include "absl/strings/str_cat.h" #include #include @@ -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 d72e803e1d4d4..9bfb7281eaf69 100644 --- a/google/cloud/internal/oauth2_service_account_credentials.cc +++ b/google/cloud/internal/oauth2_service_account_credentials.cc @@ -13,15 +13,18 @@ // limitations under the License. #include "google/cloud/internal/oauth2_service_account_credentials.h" -#include "google/cloud/internal/absl_str_join_quiet.h" +#include "google/cloud/credentials.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/make_jwt_assertion.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/oauth2_google_credentials.h" #include "google/cloud/internal/oauth2_universe_domain.h" +#include "google/cloud/internal/parse_service_account_p12_file.h" #include "google/cloud/internal/rest_response.h" #include "google/cloud/internal/sign_using_sha256.h" +#include "absl/strings/str_join.h" #include +#include #include namespace google { @@ -130,6 +133,19 @@ StatusOr ParseServiceAccountCredentials( return info; } +void ApplyServiceAccountCredentialsInfoOverrides( + Options const& options, ServiceAccountCredentialsInfo& info) { + if (options.has()) { + auto const& s = options.get(); + std::set scopes{s.begin(), s.end()}; + info.scopes = std::move(scopes); + } + + if (options.has()) { + info.subject = options.get(); + } +} + std::pair AssertionComponentsFromInfo( ServiceAccountCredentialsInfo const& info, std::chrono::system_clock::time_point now) { @@ -240,6 +256,63 @@ StatusOr MakeSelfSignedJWT( info.private_key); } +StatusOr> +CreateServiceAccountCredentialsFromJsonContents( + std::string const& contents, Options const& options, + HttpClientFactory client_factory) { + auto info = ParseServiceAccountCredentials(contents, "memory"); + if (!info) return info.status(); + ApplyServiceAccountCredentialsInfoOverrides(options, *info); + // Verify this is usable before returning it. + auto const tp = std::chrono::system_clock::time_point{}; + auto const components = AssertionComponentsFromInfo(*info, tp); + auto jwt = MakeJWTAssertionNoThrow(components.first, components.second, + info->private_key); + if (!jwt) return jwt.status(); + return StatusOr>( + std::make_shared(*info, options, + std::move(client_factory))); +} + +StatusOr> +CreateServiceAccountCredentialsFromJsonFilePath( + std::string const& path, Options const& options, + HttpClientFactory client_factory) { + std::ifstream is(path); + if (!is.is_open()) { + // We use kUnknown here because we don't know if the file does not exist, or + // if we were unable to open it for some other reason. + return internal::UnknownError("Cannot open credentials file " + path, + GCP_ERROR_INFO()); + } + std::string contents(std::istreambuf_iterator{is}, {}); + return CreateServiceAccountCredentialsFromJsonContents( + std::move(contents), options, std::move(client_factory)); +} + +StatusOr> +CreateServiceAccountCredentialsFromP12FilePath( + std::string const& path, Options const& options, + HttpClientFactory client_factory) { + auto info = ParseServiceAccountP12File(path); + if (!info) return std::move(info).status(); + ApplyServiceAccountCredentialsInfoOverrides(options, *info); + return StatusOr>( + std::make_shared(*info, options, + std::move(client_factory))); +} + +StatusOr> +CreateServiceAccountCredentialsFromFilePath(std::string const& path, + Options const& options, + HttpClientFactory client_factory) { + auto credentials = CreateServiceAccountCredentialsFromJsonFilePath( + path, options, client_factory); + if (credentials) return *credentials; + return CreateServiceAccountCredentialsFromP12FilePath( + path, options, std::move(client_factory)); +} + ServiceAccountCredentials::ServiceAccountCredentials( ServiceAccountCredentialsInfo info, Options options, HttpClientFactory client_factory) @@ -297,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() && @@ -313,7 +396,8 @@ bool ServiceAccountUseOAuth(ServiceAccountCredentialsInfo const& info) { } bool ServiceAccountCredentials::UseOAuth() { - return ServiceAccountUseOAuth(info_); + return options_.has() || + ServiceAccountUseOAuth(info_); } StatusOr ServiceAccountCredentials::GetTokenOAuth( diff --git a/google/cloud/internal/oauth2_service_account_credentials.h b/google/cloud/internal/oauth2_service_account_credentials.h index 20957c579337b..748af3e9903d5 100644 --- a/google/cloud/internal/oauth2_service_account_credentials.h +++ b/google/cloud/internal/oauth2_service_account_credentials.h @@ -24,6 +24,7 @@ #include "absl/types/optional.h" #include #include +#include #include namespace google { @@ -65,6 +66,10 @@ StatusOr ParseServiceAccountCredentials( std::string const& content, std::string const& source, std::string const& default_token_uri = GoogleOAuthRefreshEndpoint()); +/// Applies any overrides contained in `ScopesOption` or `SubjectOption`. +void ApplyServiceAccountCredentialsInfoOverrides( + Options const& options, ServiceAccountCredentialsInfo& info); + /// Parses a refresh response JSON string to create an access token. StatusOr ParseServiceAccountRefreshResponse( rest_internal::RestResponse& response, @@ -127,6 +132,58 @@ StatusOr MakeSelfSignedJWT( ServiceAccountCredentialsInfo const& info, std::chrono::system_clock::time_point tp); +/** + * Creates a ServiceAccountCredentials from a JSON string. + */ +StatusOr> +CreateServiceAccountCredentialsFromJsonContents( + std::string const& contents, Options const& options, + HttpClientFactory client_factory); + +/** + * Creates a ServiceAccountCredentials from a JSON file at the specified path. + */ +StatusOr> +CreateServiceAccountCredentialsFromJsonFilePath( + std::string const& path, Options const& options, + HttpClientFactory client_factory); + +/** + * Creates a ServiceAccountCredentials from a P12 file at the specified path. + */ +StatusOr> +CreateServiceAccountCredentialsFromP12FilePath( + std::string const& path, Options const& options, + HttpClientFactory client_factory); + +/** + * Creates a ServiceAccountCredentials from a file at the specified path. + * + * @note This function automatically detects if the file is a JSON or P12 (aka + * PFX aka PKCS#12) file and tries to load the file as a service account + * credential. We strongly recommend that applications use JSON files for + * service account key files. + * + * These credentials use the cloud-platform OAuth 2.0 scope, defined by + * `GoogleOAuthScopeCloudPlatform()`. To specify alternate scopes, use the + * `google::cloud::ScopesOption`. + */ + +StatusOr> +CreateServiceAccountCredentialsFromFilePath(std::string const& path, + Options const& options, + HttpClientFactory client_factory); + +/** + * Specifying this Option prevents self-signed JWTs from being used. + * + * Some services, namely storage, have more stringent requirements w.r.t. + * self-signed JWTs. + */ +struct DisableSelfSignedJWTOption { + using Type = std::monostate; +}; + /** * Implements service account credentials for REST clients. * @@ -236,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 d9a35e9e69cc6..07531618f20f5 100644 --- a/google/cloud/internal/oauth2_service_account_credentials_test.cc +++ b/google/cloud/internal/oauth2_service_account_credentials_test.cc @@ -13,6 +13,7 @@ // limitations under the License. #include "google/cloud/internal/oauth2_service_account_credentials.h" +#include "google/cloud/credentials.h" #include "google/cloud/internal/base64_transforms.h" #include "google/cloud/internal/oauth2_credential_constants.h" #include "google/cloud/internal/oauth2_universe_domain.h" @@ -55,6 +56,7 @@ using ::testing::Not; using ::testing::Pair; using ::testing::Property; using ::testing::Return; +using ::testing::VariantWith; using MockHttpClientFactory = ::testing::MockFunction( @@ -137,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) { @@ -180,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) { @@ -896,6 +911,61 @@ TEST(ServiceAccountCredentialsTest, ParseServiceAccountRefreshResponse) { EXPECT_EQ(token.token, "access-token-r1"); } +TEST(ServiceAccountCredentialsTest, + ApplyServiceAccountCredentialsInfoOverrides) { + auto info = ParseServiceAccountCredentials(MakeTestContents(), "test"); + ASSERT_STATUS_OK(info); + + auto options = Options{} + .set(std::vector( + {"https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/cloud-platform"})) + .set("my-subject"); + + ApplyServiceAccountCredentialsInfoOverrides(options, *info); + + auto const tp = std::chrono::system_clock::from_time_t(kFixedJwtTimestamp); + auto components = AssertionComponentsFromInfo(*info, tp); + auto assertion = + MakeJWTAssertion(components.first, components.second, info->private_key); + + std::vector actual_tokens = absl::StrSplit(assertion, '.'); + ASSERT_EQ(actual_tokens.size(), 3); + std::vector> decoded(actual_tokens.size()); + std::transform( + actual_tokens.begin(), actual_tokens.end(), decoded.begin(), + [](std::string const& e) { return UrlsafeBase64Decode(e).value(); }); + + // Verify this is a valid key. + auto const signature = + SignUsingSha256(actual_tokens[0] + '.' + actual_tokens[1], kPrivateKey); + ASSERT_STATUS_OK(signature); + EXPECT_EQ(*signature, decoded[2]); + + // Verify the header and payloads are valid. + auto const header = + nlohmann::json::parse(decoded[0].begin(), decoded[0].end()); + auto const expected_header = + nlohmann::json{{"alg", "RS256"}, {"typ", "JWT"}, {"kid", kPrivateKeyId}}; + EXPECT_EQ(header, expected_header); + + auto const payload = nlohmann::json::parse(decoded[1]); + auto const iat = static_cast(kFixedJwtTimestamp); + auto const exp = iat + 3600; + auto const expected_payload = nlohmann::json{ + {"iss", kClientEmail}, + {"scope", + "https://www.googleapis.com/auth/cloud-platform " + "https://www.googleapis.com/auth/userinfo.email"}, + {"aud", kTokenUri}, + {"iat", iat}, + {"exp", exp}, + {"sub", "my-subject"}, + }; + + EXPECT_EQ(payload, expected_payload); +} + } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oauth2_internal diff --git a/google/cloud/internal/opentelemetry.cc b/google/cloud/internal/opentelemetry.cc index fc21f52abae06..04b0593c1fccc 100644 --- a/google/cloud/internal/opentelemetry.cc +++ b/google/cloud/internal/opentelemetry.cc @@ -15,21 +15,17 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/opentelemetry_options.h" #include "google/cloud/options.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include #include #include #include #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace google { namespace cloud { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace internal { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - opentelemetry::nostd::shared_ptr GetTracer( Options const&) { auto provider = opentelemetry::trace::Provider::GetTracerProvider(); @@ -147,26 +143,16 @@ std::string CurrentThreadId() { return std::move(os).str(); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY bool TracingEnabled(Options const& options) { return options.get(); } -#else -bool TracingEnabled(Options const&) { return false; } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY void AddSpanAttribute(Options const& options, std::string const& key, std::string const& value) { if (!TracingEnabled(options)) return; auto span = opentelemetry::trace::Tracer::GetCurrentSpan(); span->SetAttribute(key, value); } -#else -void AddSpanAttribute(Options const&, std::string const&, std::string const&) {} -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace internal GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/opentelemetry.h b/google/cloud/internal/opentelemetry.h index 375da5125e7bd..bd4ffe84ee42f 100644 --- a/google/cloud/internal/opentelemetry.h +++ b/google/cloud/internal/opentelemetry.h @@ -21,25 +21,21 @@ #include "google/cloud/status.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include #include #include #include #include #include -#include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include #include +#include namespace google { namespace cloud { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace internal { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Returns a [tracer] to use for creating [spans]. * @@ -234,8 +230,6 @@ std::string ToString(opentelemetry::trace::SpanId const& span_id); /// Gets the current thread id. std::string CurrentThreadId(); -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - bool TracingEnabled(Options const& options); /// Wraps the sleeper in a span, if tracing is enabled. @@ -244,7 +238,6 @@ std::function)> MakeTracedSleeper( Options const& options, std::function)> sleeper, std::string const& name) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (TracingEnabled(options)) { return [name, sleeper = std::move(sleeper)]( std::chrono::duration d) { @@ -255,7 +248,6 @@ std::function)> MakeTracedSleeper( span->End(); }; } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY (void)options; (void)name; return sleeper; diff --git a/google/cloud/internal/opentelemetry_context.cc b/google/cloud/internal/opentelemetry_context.cc index 9afda7f15cec9..44f15067b78d1 100644 --- a/google/cloud/internal/opentelemetry_context.cc +++ b/google/cloud/internal/opentelemetry_context.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/opentelemetry_context.h" #include @@ -76,4 +75,3 @@ OTelScope::~OTelScope() { DetachOTelContext(context_); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/opentelemetry_context.h b/google/cloud/internal/opentelemetry_context.h index 124715826ed8f..c821a63fc18a9 100644 --- a/google/cloud/internal/opentelemetry_context.h +++ b/google/cloud/internal/opentelemetry_context.h @@ -15,7 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_OPENTELEMETRY_CONTEXT_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_OPENTELEMETRY_CONTEXT_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/version.h" #include #include @@ -125,6 +124,5 @@ class ScopedOTelContext { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_OPENTELEMETRY_CONTEXT_H diff --git a/google/cloud/internal/opentelemetry_context_test.cc b/google/cloud/internal/opentelemetry_context_test.cc index 06c3a206fe541..dea9890cba137 100644 --- a/google/cloud/internal/opentelemetry_context_test.cc +++ b/google/cloud/internal/opentelemetry_context_test.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/opentelemetry_context.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/testing_util/opentelemetry_matchers.h" @@ -177,4 +176,3 @@ TEST_F(OTelContextTest, ThreadLocalStorage) { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/opentelemetry_test.cc b/google/cloud/internal/opentelemetry_test.cc index 0de694de1df4c..96358259d1712 100644 --- a/google/cloud/internal/opentelemetry_test.cc +++ b/google/cloud/internal/opentelemetry_test.cc @@ -18,10 +18,8 @@ #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" #include -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace google { namespace cloud { @@ -32,7 +30,6 @@ namespace { using ms = std::chrono::milliseconds; using ::testing::MockFunction; -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::InstallSpanCatcher; @@ -447,23 +444,6 @@ TEST(OpenTelemetry, AddSpanAttributeDisabled) { Not(SpanHasAttributes(OTelAttribute("key", "value")))))); } -#else - -TEST(NoOpenTelemetry, TracingEnabled) { - EXPECT_FALSE(TracingEnabled(Options{})); -} - -TEST(NoOpenTelemetry, MakeTracedSleeper) { - MockFunction mock_sleeper; - EXPECT_CALL(mock_sleeper, Call(ms(42))); - - auto sleeper = mock_sleeper.AsStdFunction(); - auto result = MakeTracedSleeper(Options{}, sleeper, "Backoff"); - result(ms(42)); -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace } // namespace internal GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/populate_common_options.cc b/google/cloud/internal/populate_common_options.cc index 7cce3be8abeb6..597c22177daef 100644 --- a/google/cloud/internal/populate_common_options.cc +++ b/google/cloud/internal/populate_common_options.cc @@ -15,12 +15,12 @@ #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/common_options.h" #include "google/cloud/credentials.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/service_endpoint.h" #include "google/cloud/internal/user_agent_prefix.h" #include "google/cloud/opentelemetry_options.h" #include "google/cloud/universe_domain_options.h" +#include "absl/strings/str_join.h" #include "absl/strings/str_split.h" namespace google { diff --git a/google/cloud/internal/populate_rest_options.cc b/google/cloud/internal/populate_rest_options.cc index d1492f9853f4a..e7d8a47217792 100644 --- a/google/cloud/internal/populate_rest_options.cc +++ b/google/cloud/internal/populate_rest_options.cc @@ -14,13 +14,13 @@ #include "google/cloud/internal/populate_rest_options.h" #include "google/cloud/credentials.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/credentials_impl.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/rest_options.h" #include "google/cloud/rest_options.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include "absl/strings/strip.h" namespace google { diff --git a/google/cloud/internal/rest_carrier.cc b/google/cloud/internal/rest_carrier.cc index 7b700fe20db3a..719b966c3a50f 100644 --- a/google/cloud/internal/rest_carrier.cc +++ b/google/cloud/internal/rest_carrier.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/internal/rest_carrier.h" #include "google/cloud/internal/noexcept_action.h" #include "google/cloud/internal/rest_context.h" @@ -44,5 +42,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rest_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/rest_carrier.h b/google/cloud/internal/rest_carrier.h index f201ee35960c3..a36e721ac3e94 100644 --- a/google/cloud/internal/rest_carrier.h +++ b/google/cloud/internal/rest_carrier.h @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_CARRIER_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_CARRIER_H @@ -53,5 +51,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace google #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_CARRIER_H - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/rest_carrier_test.cc b/google/cloud/internal/rest_carrier_test.cc index b059cbe6f7027..62661b8402e4b 100644 --- a/google/cloud/internal/rest_carrier_test.cc +++ b/google/cloud/internal/rest_carrier_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/internal/rest_carrier.h" #include @@ -42,5 +40,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rest_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY 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_log_wrapper_test.cc b/google/cloud/internal/rest_log_wrapper_test.cc index 901d9de6b117d..e1e8248bbdd9c 100644 --- a/google/cloud/internal/rest_log_wrapper_test.cc +++ b/google/cloud/internal/rest_log_wrapper_test.cc @@ -16,8 +16,8 @@ #include "google/cloud/internal/rest_context.h" #include "google/cloud/testing_util/scoped_log.h" #include "google/cloud/tracing_options.h" -#include -#include +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include namespace google { diff --git a/google/cloud/internal/rest_opentelemetry.cc b/google/cloud/internal/rest_opentelemetry.cc index c59c1382466db..4d5d1d839b194 100644 --- a/google/cloud/internal/rest_opentelemetry.cc +++ b/google/cloud/internal/rest_opentelemetry.cc @@ -12,18 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/rest_opentelemetry.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/internal/trace_propagator.h" #include "google/cloud/options.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include #include +#include #include -#include #include #include @@ -71,27 +70,27 @@ void InjectTraceContext( opentelemetry::nostd::shared_ptr MakeSpanHttp( RestRequest const& request, opentelemetry::nostd::string_view method) { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; opentelemetry::trace::StartSpanOptions options; options.kind = opentelemetry::trace::SpanKind::kClient; auto span = internal::MakeSpan( absl::StrCat("HTTP/", absl::string_view{method.data(), method.size()}), {{/*sc::kNetworkTransport=*/"network.transport", - sc::NetTransportValues::kIpTcp}, + sc::network::NetworkTransportValues::kTcp}, {/*sc::kHttpRequestMethod=*/"http.request.method", method}, {/*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; } @@ -100,5 +99,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rest_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/rest_opentelemetry.h b/google/cloud/internal/rest_opentelemetry.h index 825e70b602701..16c5e74c71991 100644 --- a/google/cloud/internal/rest_opentelemetry.h +++ b/google/cloud/internal/rest_opentelemetry.h @@ -15,7 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_OPENTELEMETRY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_OPENTELEMETRY_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/rest_request.h" #include "google/cloud/internal/trace_propagator.h" #include "google/cloud/options.h" @@ -61,6 +60,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_OPENTELEMETRY_H diff --git a/google/cloud/internal/rest_opentelemetry_test.cc b/google/cloud/internal/rest_opentelemetry_test.cc index 56aef72e06be1..114a731871a76 100644 --- a/google/cloud/internal/rest_opentelemetry_test.cc +++ b/google/cloud/internal/rest_opentelemetry_test.cc @@ -12,12 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/rest_opentelemetry.h" #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" #include -#include +#include namespace google { namespace cloud { @@ -39,11 +38,11 @@ using ::testing::Gt; using ::testing::Pair; TEST(RestOpentelemetry, MakeSpanHttp) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; 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))); @@ -66,7 +65,7 @@ TEST(RestOpentelemetry, MakeSpanHttp) { SpanHasAttributes( OTelAttribute( /*sc::kNetworkTransport=*/"network.transport", - sc::NetTransportValues::kIpTcp), + sc::network::NetworkTransportValues::kTcp), OTelAttribute( /*sc::kHttpRequestMethod=*/"http.request.method", "GET"), OTelAttribute(/*sc::kUrlFull=*/"url.full", kUrl), @@ -82,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); @@ -101,5 +100,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rest_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY 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 77f1464c44a75..cee621e5f83b5 100644 --- a/google/cloud/internal/rest_request.cc +++ b/google/cloud/internal/rest_request.cc @@ -13,9 +13,9 @@ // limitations under the License. #include "google/cloud/internal/rest_request.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/log.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_replace.h" #include "absl/strings/strip.h" #include @@ -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/rest_retry_loop_test.cc b/google/cloud/internal/rest_retry_loop_test.cc index 79e17cc8dc648..2d98af733e4ee 100644 --- a/google/cloud/internal/rest_retry_loop_test.cc +++ b/google/cloud/internal/rest_retry_loop_test.cc @@ -235,7 +235,6 @@ TEST(RestRetryLoopTest, ExhaustedOnStart) { EXPECT_THAT(metadata, Contains(Pair("gcloud-cpp.retry.function", __func__))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanNamed; @@ -272,8 +271,6 @@ TEST(RestRetryLoopTest, TracingDisabled) { EXPECT_THAT(spans, IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rest_internal diff --git a/google/cloud/internal/rest_set_metadata.cc b/google/cloud/internal/rest_set_metadata.cc index d6adba18ebda8..70dc367242bf0 100644 --- a/google/cloud/internal/rest_set_metadata.cc +++ b/google/cloud/internal/rest_set_metadata.cc @@ -14,10 +14,10 @@ #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/rest_options.h" #include "google/cloud/rest_options.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" namespace google { namespace cloud { diff --git a/google/cloud/internal/rest_stub_helpers_test.cc b/google/cloud/internal/rest_stub_helpers_test.cc index fcf7e5a102fab..caec4dbc1b8c9 100644 --- a/google/cloud/internal/rest_stub_helpers_test.cc +++ b/google/cloud/internal/rest_stub_helpers_test.cc @@ -17,9 +17,9 @@ #include "google/cloud/testing_util/mock_rest_client.h" #include "google/cloud/testing_util/mock_rest_response.h" #include "google/cloud/testing_util/status_matchers.h" -#include -#include -#include +#include "google/longrunning/operations.pb.h" +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include #include #include diff --git a/google/cloud/internal/retry_loop_helpers.cc b/google/cloud/internal/retry_loop_helpers.cc index adbe89acca672..50962dd3341d4 100644 --- a/google/cloud/internal/retry_loop_helpers.cc +++ b/google/cloud/internal/retry_loop_helpers.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/internal/retry_loop_helpers.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/make_status.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/internal/retry_loop_test.cc b/google/cloud/internal/retry_loop_test.cc index 2040bbd5a4fc8..e85341d4f4c1a 100644 --- a/google/cloud/internal/retry_loop_test.cc +++ b/google/cloud/internal/retry_loop_test.cc @@ -276,7 +276,6 @@ TEST(RetryLoopTest, ConfigureContext) { /*request=*/0, "error message"); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanNamed; @@ -313,8 +312,6 @@ TEST(RetryLoopTest, TracingDisabled) { EXPECT_THAT(spans, IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace } // namespace internal GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/routing_matcher.h b/google/cloud/internal/routing_matcher.h index efcea9f8b26f1..b438f6fb87d5d 100644 --- a/google/cloud/internal/routing_matcher.h +++ b/google/cloud/internal/routing_matcher.h @@ -15,9 +15,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ROUTING_MATCHER_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_ROUTING_MATCHER_H -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/version.h" +#include "absl/strings/str_cat.h" #include "absl/types/optional.h" #include #include 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/service_endpoint.cc b/google/cloud/internal/service_endpoint.cc index 29ae05a4dc0a2..0d9e1ea9d5327 100644 --- a/google/cloud/internal/service_endpoint.cc +++ b/google/cloud/internal/service_endpoint.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/internal/service_endpoint.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/universe_domain_options.h" +#include "absl/strings/str_cat.h" #include "absl/strings/strip.h" namespace google { diff --git a/google/cloud/internal/streaming_read_rpc_logging.h b/google/cloud/internal/streaming_read_rpc_logging.h index cb7ff50780b81..8c228e952e406 100644 --- a/google/cloud/internal/streaming_read_rpc_logging.h +++ b/google/cloud/internal/streaming_read_rpc_logging.h @@ -15,13 +15,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_STREAMING_READ_RPC_LOGGING_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_STREAMING_READ_RPC_LOGGING_H -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/grpc_request_metadata.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/internal/streaming_read_rpc.h" #include "google/cloud/status.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" +#include "absl/strings/str_cat.h" #include "absl/types/optional.h" #include #include diff --git a/google/cloud/internal/streaming_read_rpc_logging_test.cc b/google/cloud/internal/streaming_read_rpc_logging_test.cc index 324c599de22e3..c2593db8e855c 100644 --- a/google/cloud/internal/streaming_read_rpc_logging_test.cc +++ b/google/cloud/internal/streaming_read_rpc_logging_test.cc @@ -16,8 +16,8 @@ #include "google/cloud/status.h" #include "google/cloud/testing_util/scoped_log.h" #include "google/cloud/tracing_options.h" -#include "absl/types/optional.h" -#include +#include "absl/types/variant.h" +#include "google/protobuf/duration.pb.h" #include namespace google { diff --git a/google/cloud/internal/streaming_read_rpc_tracing.h b/google/cloud/internal/streaming_read_rpc_tracing.h index 36125b12051c7..71c885920fd71 100644 --- a/google/cloud/internal/streaming_read_rpc_tracing.h +++ b/google/cloud/internal/streaming_read_rpc_tracing.h @@ -15,7 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_STREAMING_READ_RPC_TRACING_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_STREAMING_READ_RPC_TRACING_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/grpc_opentelemetry.h" #include "google/cloud/internal/grpc_request_metadata.h" #include "google/cloud/internal/opentelemetry.h" @@ -77,6 +76,5 @@ class StreamingReadRpcTracing : public StreamingReadRpc { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_STREAMING_READ_RPC_TRACING_H diff --git a/google/cloud/internal/streaming_read_rpc_tracing_test.cc b/google/cloud/internal/streaming_read_rpc_tracing_test.cc index b7f276d42c48b..7f7083adef5ac 100644 --- a/google/cloud/internal/streaming_read_rpc_tracing_test.cc +++ b/google/cloud/internal/streaming_read_rpc_tracing_test.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/streaming_read_rpc_tracing.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/testing_util/opentelemetry_matchers.h" @@ -165,4 +164,3 @@ TEST(StreamingReadRpcTracingTest, SpanEndsOnDestruction) { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/streaming_write_rpc_logging_test.cc b/google/cloud/internal/streaming_write_rpc_logging_test.cc index 93792ea36d335..15ac156aecfc9 100644 --- a/google/cloud/internal/streaming_write_rpc_logging_test.cc +++ b/google/cloud/internal/streaming_write_rpc_logging_test.cc @@ -17,8 +17,8 @@ #include "google/cloud/testing_util/scoped_log.h" #include "google/cloud/testing_util/status_matchers.h" #include "google/cloud/tracing_options.h" -#include -#include +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include namespace google { diff --git a/google/cloud/internal/streaming_write_rpc_tracing.h b/google/cloud/internal/streaming_write_rpc_tracing.h index 695efa7e65620..dc0624e17f77b 100644 --- a/google/cloud/internal/streaming_write_rpc_tracing.h +++ b/google/cloud/internal/streaming_write_rpc_tracing.h @@ -15,7 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_STREAMING_WRITE_RPC_TRACING_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_STREAMING_WRITE_RPC_TRACING_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/grpc_opentelemetry.h" #include "google/cloud/internal/grpc_request_metadata.h" #include "google/cloud/internal/opentelemetry.h" @@ -82,6 +81,5 @@ class StreamingWriteRpcTracing GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_STREAMING_WRITE_RPC_TRACING_H diff --git a/google/cloud/internal/streaming_write_rpc_tracing_test.cc b/google/cloud/internal/streaming_write_rpc_tracing_test.cc index d2d37ae363fb4..29dd467b59df7 100644 --- a/google/cloud/internal/streaming_write_rpc_tracing_test.cc +++ b/google/cloud/internal/streaming_write_rpc_tracing_test.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/streaming_write_rpc_tracing.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/testing_util/opentelemetry_matchers.h" @@ -180,4 +179,3 @@ TEST(StreamingWriteRpcTracingTest, SpanEndsOnDestruction) { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/time_utils.cc b/google/cloud/internal/time_utils.cc index 82ee1637faf8b..998a3664be90d 100644 --- a/google/cloud/internal/time_utils.cc +++ b/google/cloud/internal/time_utils.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "google/cloud/internal/time_utils.h" -#include +#include "google/protobuf/timestamp.pb.h" #include namespace google { diff --git a/google/cloud/internal/time_utils.h b/google/cloud/internal/time_utils.h index 699a007c2938d..4d6b7915a01fc 100644 --- a/google/cloud/internal/time_utils.h +++ b/google/cloud/internal/time_utils.h @@ -17,8 +17,8 @@ #include "google/cloud/version.h" #include "absl/time/time.h" -#include -#include +#include "google/protobuf/duration.pb.h" +#include "google/protobuf/timestamp.pb.h" #include namespace google { diff --git a/google/cloud/internal/trace_propagator.cc b/google/cloud/internal/trace_propagator.cc index 8e46cacc2cce9..3d02d75e6af88 100644 --- a/google/cloud/internal/trace_propagator.cc +++ b/google/cloud/internal/trace_propagator.cc @@ -12,10 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/trace_propagator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "absl/strings/numbers.h" +#include "absl/strings/str_cat.h" #include #include #include @@ -104,5 +103,3 @@ MakePropagator() { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/trace_propagator.h b/google/cloud/internal/trace_propagator.h index 7a70844e83c85..47accb5ec8820 100644 --- a/google/cloud/internal/trace_propagator.h +++ b/google/cloud/internal/trace_propagator.h @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_TRACE_PROPAGATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_TRACE_PROPAGATOR_H @@ -50,5 +48,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace google #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_TRACE_PROPAGATOR_H - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/trace_propagator_test.cc b/google/cloud/internal/trace_propagator_test.cc index 66e4fba1b3c26..c6c9e17b773a5 100644 --- a/google/cloud/internal/trace_propagator_test.cc +++ b/google/cloud/internal/trace_propagator_test.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/trace_propagator.h" #include #include @@ -114,4 +113,3 @@ TEST(CloudTraceContextPropagator, Fields) { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/traced_stream_range.h b/google/cloud/internal/traced_stream_range.h index e31106e6b6bfc..8342febf24c72 100644 --- a/google/cloud/internal/traced_stream_range.h +++ b/google/cloud/internal/traced_stream_range.h @@ -15,7 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_TRACED_STREAM_RANGE_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_TRACED_STREAM_RANGE_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/stream_range.h" #include @@ -81,6 +80,5 @@ StreamRange MakeTracedStreamRange( GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_TRACED_STREAM_RANGE_H diff --git a/google/cloud/internal/traced_stream_range_test.cc b/google/cloud/internal/traced_stream_range_test.cc index aef5efd6e5404..e0dafd3a66a49 100644 --- a/google/cloud/internal/traced_stream_range_test.cc +++ b/google/cloud/internal/traced_stream_range_test.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/traced_stream_range.h" #include "google/cloud/mocks/mock_stream_range.h" #include "google/cloud/internal/make_status.h" @@ -129,4 +128,3 @@ TEST(TracedStreamRange, SpanInactiveWhileIterating) { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/tracing_http_payload.cc b/google/cloud/internal/tracing_http_payload.cc index 6f79d864c34b3..b05219f500fd6 100644 --- a/google/cloud/internal/tracing_http_payload.cc +++ b/google/cloud/internal/tracing_http_payload.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/internal/tracing_http_payload.h" #include "google/cloud/internal/opentelemetry.h" #include @@ -66,5 +64,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rest_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/tracing_http_payload.h b/google/cloud/internal/tracing_http_payload.h index 26af6771ae58b..0b8939ff0ff6c 100644 --- a/google/cloud/internal/tracing_http_payload.h +++ b/google/cloud/internal/tracing_http_payload.h @@ -15,8 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_TRACING_HTTP_PAYLOAD_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_TRACING_HTTP_PAYLOAD_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/internal/http_payload.h" #include #include @@ -48,6 +46,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_TRACING_HTTP_PAYLOAD_H diff --git a/google/cloud/internal/tracing_http_payload_test.cc b/google/cloud/internal/tracing_http_payload_test.cc index d922052a779b1..24c6ad4dbc607 100644 --- a/google/cloud/internal/tracing_http_payload_test.cc +++ b/google/cloud/internal/tracing_http_payload_test.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/tracing_http_payload.h" #include "google/cloud/internal/rest_opentelemetry.h" #include "google/cloud/testing_util/mock_http_payload.h" @@ -20,7 +19,7 @@ #include "google/cloud/testing_util/status_matchers.h" #include #include -#include +#include namespace google { namespace cloud { @@ -66,7 +65,7 @@ auto MakeReadMatcher(std::int64_t buffer_size) { } TEST(TracingHttpPayload, Success) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto impl = MakeMockHttpPayloadSuccess(MockContents()); @@ -86,13 +85,13 @@ TEST(TracingHttpPayload, Success) { SpanKindIsClient(), SpanHasAttributes(OTelAttribute( /*sc::kNetworkTransport=*/"network.transport", - sc::NetTransportValues::kIpTcp)), + sc::network::NetworkTransportValues::kTcp)), SpanHasEvents(MakeReadMatcher(16, 16), MakeReadMatcher(16, 16), MakeReadMatcher(16, 11), MakeReadMatcher(16, 0))))); } TEST(TracingHttpPayload, Failure) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); RestRequest request("https://example.com/ignored"); @@ -120,7 +119,7 @@ TEST(TracingHttpPayload, Failure) { SpanHasAttributes( OTelAttribute( /*sc::kNetworkTransport=*/"network.transport", - sc::NetTransportValues::kIpTcp), + sc::network::NetworkTransportValues::kTcp), OTelAttribute("gl-cpp.status_code", "UNAVAILABLE")), SpanHasEvents(MakeReadMatcher(16, 16), MakeReadMatcher(16))))); } @@ -130,5 +129,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rest_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/tracing_rest_client.cc b/google/cloud/internal/tracing_rest_client.cc index 0badc6ffeb709..0e92b092919e7 100644 --- a/google/cloud/internal/tracing_rest_client.cc +++ b/google/cloud/internal/tracing_rest_client.cc @@ -13,8 +13,6 @@ // limitations under the License. #include "google/cloud/internal/tracing_rest_client.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/internal/rest_opentelemetry.h" #include "google/cloud/internal/trace_propagator.h" @@ -23,6 +21,7 @@ #include "absl/functional/function_ref.h" #include "absl/strings/match.h" #include "absl/strings/numbers.h" +#include "absl/strings/str_cat.h" #include #include @@ -72,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)); @@ -231,22 +231,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rest_internal } // namespace cloud } // namespace google - -#else - -namespace google { -namespace cloud { -namespace rest_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -std::unique_ptr MakeTracingRestClient( - std::unique_ptr client) { - return client; -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace rest_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/tracing_rest_client_test.cc b/google/cloud/internal/tracing_rest_client_test.cc index 00ef20b9beb5c..9e5994bd4dae3 100644 --- a/google/cloud/internal/tracing_rest_client_test.cc +++ b/google/cloud/internal/tracing_rest_client_test.cc @@ -19,11 +19,9 @@ #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" #include -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include +#include #include -#include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace google { namespace cloud { @@ -48,7 +46,6 @@ std::string MockContents() { return "The quick brown fox jumps over the lazy dog"; } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::EventNamed; using ::google::cloud::testing_util::InstallSpanCatcher; using ::google::cloud::testing_util::OTelAttribute; @@ -66,7 +63,7 @@ using ::testing::ResultOf; using ::testing::UnorderedElementsAre; TEST(TracingRestClient, Delete) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto impl = std::make_unique(); @@ -107,7 +104,7 @@ TEST(TracingRestClient, Delete) { SpanHasAttributes( OTelAttribute( /*sc::kNetworkTransport=*/"network.transport", - sc::NetTransportValues::kIpTcp), + sc::network::NetworkTransportValues::kTcp), OTelAttribute( /*sc::kHttpRequestMethod=*/"http.request.method", "DELETE"), @@ -209,7 +206,7 @@ TEST(TracingRestClient, PropagatesTraceContext) { } TEST(TracingRestClient, WithRestContextDetails) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto impl = std::make_unique(); @@ -256,7 +253,7 @@ TEST(TracingRestClient, WithRestContextDetails) { SpanHasAttributes( OTelAttribute( /*sc::kNetworkTransport=*/"network.transport", - sc::NetTransportValues::kIpTcp), + sc::network::NetworkTransportValues::kTcp), OTelAttribute( /*sc::kHttpRequestMethod=*/"http.request.method", "POST"), OTelAttribute(/*sc::kUrlFull=*/"url.full", kUrl), @@ -360,39 +357,6 @@ TEST(TracingRestClient, CachedConnection) { SpanHasEvents(EventNamed("gl-cpp.curl.connected"))))); } -#else - -TEST(TracingRestClient, NoOpenTelemetry) { - auto impl = std::make_unique(); - EXPECT_CALL(*impl, Delete).WillOnce([](RestContext&, RestRequest const&) { - auto response = std::make_unique(); - EXPECT_CALL(*response, StatusCode) - .WillRepeatedly(Return(HttpStatusCode::kOk)); - EXPECT_CALL(*response, Headers).WillRepeatedly(Return(MockHeaders())); - EXPECT_CALL(std::move(*response), ExtractPayload).WillOnce([] { - return MakeMockHttpPayloadSuccess(MockContents()); - }); - return std::unique_ptr(std::move(response)); - }); - - auto constexpr kUrl = "https://storage.googleapis.com/storage/v1/b/my-bucket"; - RestRequest request(kUrl); - request.AddHeader("x-test-header-3", "value3"); - - auto client = MakeTracingRestClient(std::move(impl)); - rest_internal::RestContext context; - auto r = client->Delete(context, request); - ASSERT_STATUS_OK(r); - auto response = *std::move(r); - ASSERT_THAT(response, NotNull()); - EXPECT_THAT(response->StatusCode(), Eq(HttpStatusCode::kOk)); - EXPECT_THAT(response->Headers(), ElementsAreArray(MockHeaders())); - auto contents = ReadAll(std::move(*response).ExtractPayload()); - EXPECT_THAT(contents, IsOkAndHolds(MockContents())); -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rest_internal diff --git a/google/cloud/internal/tracing_rest_response.cc b/google/cloud/internal/tracing_rest_response.cc index 9e00d853cecd5..f1d15cc326694 100644 --- a/google/cloud/internal/tracing_rest_response.cc +++ b/google/cloud/internal/tracing_rest_response.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/internal/tracing_rest_response.h" #include "google/cloud/internal/tracing_http_payload.h" @@ -40,5 +38,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rest_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/tracing_rest_response.h b/google/cloud/internal/tracing_rest_response.h index 21f2bd7d9d5ff..177b23e8ce072 100644 --- a/google/cloud/internal/tracing_rest_response.h +++ b/google/cloud/internal/tracing_rest_response.h @@ -15,8 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_TRACING_REST_RESPONSE_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_TRACING_REST_RESPONSE_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/internal/rest_response.h" #include #include @@ -49,6 +47,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_TRACING_REST_RESPONSE_H diff --git a/google/cloud/internal/tracing_rest_response_test.cc b/google/cloud/internal/tracing_rest_response_test.cc index 722e121ba953d..b2151ee63c732 100644 --- a/google/cloud/internal/tracing_rest_response_test.cc +++ b/google/cloud/internal/tracing_rest_response_test.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/tracing_rest_response.h" #include "google/cloud/internal/rest_opentelemetry.h" #include "google/cloud/testing_util/mock_http_payload.h" @@ -21,7 +20,7 @@ #include "google/cloud/testing_util/status_matchers.h" #include #include -#include +#include namespace google { namespace cloud { @@ -57,7 +56,7 @@ auto MakeReadMatcher(std::int64_t buffer_size, std::int64_t read_size) { } TEST(TracingRestResponseTest, Success) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); RestRequest request("https://example.com/ignored"); @@ -89,7 +88,7 @@ TEST(TracingRestResponseTest, Success) { SpanKindIsClient(), SpanHasAttributes(OTelAttribute( /*sc::kNetworkTransport=*/"network.transport", - sc::NetTransportValues::kIpTcp)), + sc::network::NetworkTransportValues::kTcp)), SpanHasEvents(MakeReadMatcher(kBufferSize, content_size), MakeReadMatcher(kBufferSize, 0))))); } @@ -99,5 +98,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rest_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/internal/unified_grpc_credentials.cc b/google/cloud/internal/unified_grpc_credentials.cc index 36b42821c6fc0..45851cce620a7 100644 --- a/google/cloud/internal/unified_grpc_credentials.cc +++ b/google/cloud/internal/unified_grpc_credentials.cc @@ -115,8 +115,28 @@ std::shared_ptr CreateAuthenticationStrategy( std::move(options)); } void visit(ServiceAccountConfig const& cfg) override { - result = std::make_unique( - cfg.json_object(), std::move(options)); + if (cfg.file_path().has_value()) { + std::ifstream is(*cfg.file_path()); + if (!is.is_open()) { + // We use kUnknown here because we don't know if the file does not + // exist, or if we were unable to open it for some other reason. + result = std::make_unique( + ErrorCredentialsConfig{UnknownError( + "Cannot open credentials file " + *cfg.file_path(), + GCP_ERROR_INFO())}); + } + std::string contents(std::istreambuf_iterator{is}, {}); + result = std::make_unique( + std::move(contents), std::move(options)); + } else if (cfg.json_object().has_value()) { + result = std::make_unique( + *cfg.json_object(), std::move(options)); + } else { + result = std::make_unique( + ErrorCredentialsConfig{InternalError( + "ServiceAccountConfig has neither json_object nor file_path", + GCP_ERROR_INFO())}); + } } void visit(ExternalAccountConfig const& cfg) override { grpc::SslCredentialsOptions ssl_options; diff --git a/google/cloud/internal/unified_rest_credentials.cc b/google/cloud/internal/unified_rest_credentials.cc index 65f1d873e369c..596617c57d7d9 100644 --- a/google/cloud/internal/unified_rest_credentials.cc +++ b/google/cloud/internal/unified_rest_credentials.cc @@ -15,6 +15,7 @@ #include "google/cloud/internal/unified_rest_credentials.h" #include "google/cloud/common_options.h" #include "google/cloud/internal/make_jwt_assertion.h" +#include "google/cloud/internal/make_status.h" #include "google/cloud/internal/oauth2_access_token_credentials.h" #include "google/cloud/internal/oauth2_anonymous_credentials.h" #include "google/cloud/internal/oauth2_api_key_credentials.h" @@ -49,25 +50,6 @@ std::shared_ptr MakeErrorCredentials( return std::make_shared(std::move(status)); } -std::shared_ptr -CreateServiceAccountCredentialsFromJsonContents( - std::string const& contents, Options const& options, - oauth2_internal::HttpClientFactory client_factory) { - auto info = - oauth2_internal::ParseServiceAccountCredentials(contents, "memory"); - if (!info) return MakeErrorCredentials(std::move(info).status()); - - // Verify this is usable before returning it. - auto const tp = std::chrono::system_clock::time_point{}; - auto const components = AssertionComponentsFromInfo(*info, tp); - auto jwt = internal::MakeJWTAssertionNoThrow( - components.first, components.second, info->private_key); - if (!jwt) return MakeErrorCredentials(std::move(jwt).status()); - - return std::make_shared( - *info, options, std::move(client_factory)); -} - } // namespace std::shared_ptr MapCredentials( @@ -99,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()); @@ -115,15 +98,31 @@ 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 { - result = Decorate( - CreateServiceAccountCredentialsFromJsonContents( - cfg.json_object(), cfg.options(), std::move(client_factory_)), - cfg.options()); + StatusOr> creds; + if (cfg.file_path().has_value()) { + creds = oauth2_internal::CreateServiceAccountCredentialsFromFilePath( + *cfg.file_path(), cfg.options(), client_factory_); + } else if (cfg.json_object().has_value()) { + creds = + oauth2_internal::CreateServiceAccountCredentialsFromJsonContents( + *cfg.json_object(), cfg.options(), client_factory_); + } else { + creds = MakeErrorCredentials(internal::InternalError( + "ServiceAccountConfig has neither json_object nor file_path", + GCP_ERROR_INFO())); + } + + if (creds.ok()) { + result = Decorate(*creds, std::move(client_factory_), cfg.options()); + } else { + result = MakeErrorCredentials(std::move(creds).status()); + } } void visit(ExternalAccountConfig const& cfg) override { @@ -134,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 { @@ -146,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 77eaa7ab7c3a8..ab66fa764858d 100644 --- a/google/cloud/internal/unified_rest_credentials_test.cc +++ b/google/cloud/internal/unified_rest_credentials_test.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/internal/unified_rest_credentials.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/credentials_impl.h" #include "google/cloud/internal/filesystem.h" #include "google/cloud/internal/oauth2_google_application_default_credentials_file.h" @@ -25,6 +24,7 @@ #include "google/cloud/testing_util/mock_rest_response.h" #include "google/cloud/testing_util/scoped_environment.h" #include "google/cloud/testing_util/status_matchers.h" +#include "absl/strings/str_cat.h" #include #include #include @@ -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{}); @@ -405,7 +430,7 @@ TEST(UnifiedRestCredentialsTest, ServiceAccount) { EXPECT_CALL(client_factory, Call).Times(0); auto const config = - internal::ServiceAccountConfig(contents.dump(), Options{}); + internal::ServiceAccountConfig(contents.dump(), absl::nullopt, Options{}); auto credentials = MapCredentials(config, client_factory.AsStdFunction()); auto access_token = credentials->GetToken(now); ASSERT_STATUS_OK(access_token); @@ -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/user_agent_prefix.cc b/google/cloud/internal/user_agent_prefix.cc index 5ad2b3949bf7f..f75d7a94c3f36 100644 --- a/google/cloud/internal/user_agent_prefix.cc +++ b/google/cloud/internal/user_agent_prefix.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/internal/user_agent_prefix.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/compiler_info.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/internal/version_info.h b/google/cloud/internal/version_info.h index 480ac76fe17e6..27173b2d238b8 100644 --- a/google/cloud/internal/version_info.h +++ b/google/cloud/internal/version_info.h @@ -16,11 +16,11 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_VERSION_INFO_H // NOLINTNEXTLINE(modernize-macro-to-enum) -#define GOOGLE_CLOUD_CPP_VERSION_MAJOR 2 +#define GOOGLE_CLOUD_CPP_VERSION_MAJOR 3 // NOLINTNEXTLINE(modernize-macro-to-enum) -#define GOOGLE_CLOUD_CPP_VERSION_MINOR 47 +#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/internal/win32/sign_using_sha256.cc b/google/cloud/internal/win32/sign_using_sha256.cc index 3abcfad869cfc..15ecc6e6f9103 100644 --- a/google/cloud/internal/win32/sign_using_sha256.cc +++ b/google/cloud/internal/win32/sign_using_sha256.cc @@ -14,10 +14,10 @@ #ifdef _WIN32 #include "google/cloud/internal/sign_using_sha256.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/sha256_hash.h" #include "google/cloud/internal/win32/win32_helpers.h" +#include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include #include diff --git a/google/cloud/internal/win32/win32_helpers.h b/google/cloud/internal/win32/win32_helpers.h index bd9384e6432b3..f782a1af41ee1 100644 --- a/google/cloud/internal/win32/win32_helpers.h +++ b/google/cloud/internal/win32/win32_helpers.h @@ -16,9 +16,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_WIN32_WIN32_HELPERS_H #ifdef _WIN32 -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/version.h" #include "absl/functional/function_ref.h" +#include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include diff --git a/google/cloud/kms/BUILD.bazel b/google/cloud/kms/BUILD.bazel index fc09b67a3c903..e75162e2fed41 100644 --- a/google/cloud/kms/BUILD.bazel +++ b/google/cloud/kms/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "inventory/v1/", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/kms/inventory/v1:inventory_cc_grpc", - "@com_google_googleapis//google/cloud/kms/v1:kms_cc_grpc", + "@googleapis//google/cloud/kms/inventory/v1:inventory_cc_grpc", + "@googleapis//google/cloud/kms/v1:kms_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/kms/CMakeLists.txt b/google/cloud/kms/CMakeLists.txt index cea5f8e50e69d..d7b9db41b6856 100644 --- a/google/cloud/kms/CMakeLists.txt +++ b/google/cloud/kms/CMakeLists.txt @@ -16,9 +16,8 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library( - kms "Cloud Key Management Service (KMS) API" - SERVICE_DIRS "__EMPTY__" "inventory/v1/" "v1/") +google_cloud_cpp_add_gapic_library(kms "Cloud Key Management Service (KMS) API" + SERVICE_DIRS "inventory/v1/" "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(kms_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/kms/ekm_client.h b/google/cloud/kms/ekm_client.h deleted file mode 100644 index 56faddbd8facb..0000000000000 --- a/google/cloud/kms/ekm_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/kms/v1/ekm_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_EKM_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_EKM_CLIENT_H - -#include "google/cloud/kms/ekm_connection.h" -#include "google/cloud/kms/v1/ekm_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in kms_v1 instead of the aliases defined in -/// this namespace. -namespace kms { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use kms_v1::EkmServiceClient directly. -using ::google::cloud::kms_v1::EkmServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace kms -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_EKM_CLIENT_H diff --git a/google/cloud/kms/ekm_connection.h b/google/cloud/kms/ekm_connection.h deleted file mode 100644 index d6244cc09b5b9..0000000000000 --- a/google/cloud/kms/ekm_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/kms/v1/ekm_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_EKM_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_EKM_CONNECTION_H - -#include "google/cloud/kms/ekm_connection_idempotency_policy.h" -#include "google/cloud/kms/v1/ekm_connection.h" - -namespace google { -namespace cloud { -namespace kms { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use kms_v1::MakeEkmServiceConnection directly. -using ::google::cloud::kms_v1::MakeEkmServiceConnection; - -/// @deprecated Use kms_v1::EkmServiceConnection directly. -using ::google::cloud::kms_v1::EkmServiceConnection; - -/// @deprecated Use kms_v1::EkmServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::kms_v1::EkmServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use kms_v1::EkmServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::kms_v1::EkmServiceLimitedTimeRetryPolicy; - -/// @deprecated Use kms_v1::EkmServiceRetryPolicy directly. -using ::google::cloud::kms_v1::EkmServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace kms -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_EKM_CONNECTION_H diff --git a/google/cloud/kms/ekm_connection_idempotency_policy.h b/google/cloud/kms/ekm_connection_idempotency_policy.h deleted file mode 100644 index cf9eb7f54a97e..0000000000000 --- a/google/cloud/kms/ekm_connection_idempotency_policy.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/kms/v1/ekm_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_EKM_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_EKM_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/kms/v1/ekm_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace kms { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use kms_v1::MakeDefaultEkmServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::kms_v1::MakeDefaultEkmServiceConnectionIdempotencyPolicy; - -/// @deprecated Use kms_v1::EkmServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::kms_v1::EkmServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace kms -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_EKM_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/kms/ekm_options.h b/google/cloud/kms/ekm_options.h deleted file mode 100644 index 1e2062d19d97d..0000000000000 --- a/google/cloud/kms/ekm_options.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/kms/v1/ekm_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_EKM_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_EKM_OPTIONS_H - -#include "google/cloud/kms/ekm_connection.h" -#include "google/cloud/kms/ekm_connection_idempotency_policy.h" -#include "google/cloud/kms/v1/ekm_options.h" - -namespace google { -namespace cloud { -namespace kms { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use kms_v1::EkmServiceBackoffPolicyOption directly. -using ::google::cloud::kms_v1::EkmServiceBackoffPolicyOption; - -/// @deprecated Use kms_v1::EkmServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::kms_v1::EkmServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use kms_v1::EkmServicePolicyOptionList directly. -using ::google::cloud::kms_v1::EkmServicePolicyOptionList; - -/// @deprecated Use kms_v1::EkmServiceRetryPolicyOption directly. -using ::google::cloud::kms_v1::EkmServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace kms -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_EKM_OPTIONS_H diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_auth_decorator.cc b/google/cloud/kms/inventory/v1/internal/key_dashboard_auth_decorator.cc index 01935ee2913c6..9b193302723fd 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_auth_decorator.cc +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/kms/inventory/v1/key_dashboard_service.proto #include "google/cloud/kms/inventory/v1/internal/key_dashboard_auth_decorator.h" -#include +#include "google/cloud/kms/inventory/v1/key_dashboard_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -44,3 +47,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_inventory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_auth_decorator.h b/google/cloud/kms/inventory/v1/internal/key_dashboard_auth_decorator.h index 71c572c3e44ac..0f435ae834744 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_auth_decorator.h +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -53,4 +56,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_DASHBOARD_AUTH_DECORATOR_H diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_logging_decorator.cc b/google/cloud/kms/inventory/v1/internal/key_dashboard_logging_decorator.cc index f2ecc058042eb..8fb01d1e1f753 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_logging_decorator.cc +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/kms/inventory/v1/key_dashboard_service.proto #include "google/cloud/kms/inventory/v1/internal/key_dashboard_logging_decorator.h" +#include "google/cloud/kms/inventory/v1/key_dashboard_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -52,3 +55,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_inventory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_logging_decorator.h b/google/cloud/kms/inventory/v1/internal/key_dashboard_logging_decorator.h index 8f6966071ac0a..83409efb5090c 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_logging_decorator.h +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -53,4 +56,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_DASHBOARD_LOGGING_DECORATOR_H diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_metadata_decorator.cc b/google/cloud/kms/inventory/v1/internal/key_dashboard_metadata_decorator.cc index c2f9552c79459..9f19243b7e9b0 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_metadata_decorator.cc +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/kms/inventory/v1/key_dashboard_service.proto #include "google/cloud/kms/inventory/v1/internal/key_dashboard_metadata_decorator.h" +#include "google/cloud/kms/inventory/v1/key_dashboard_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 kms_inventory_v1_internal { @@ -70,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_inventory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_metadata_decorator.h b/google/cloud/kms/inventory/v1/internal/key_dashboard_metadata_decorator.h index e4cfa65caa673..c42f449f8a415 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_metadata_decorator.h +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -59,4 +62,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_DASHBOARD_METADATA_DECORATOR_H diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_option_defaults.cc b/google/cloud/kms/inventory/v1/internal/key_dashboard_option_defaults.cc index f3bde7cd84024..6b6fac899c9d6 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_option_defaults.cc +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_option_defaults.cc @@ -42,7 +42,7 @@ Options KeyDashboardServiceDefaultOptions(Options options) { if (!options.has()) { options.set( kms_inventory_v1::KeyDashboardServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_stub.cc b/google/cloud/kms/inventory/v1/internal/key_dashboard_stub.cc index acafff5237712..4ca2796b536ce 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_stub.cc +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/kms/inventory/v1/key_dashboard_service.proto #include "google/cloud/kms/inventory/v1/internal/key_dashboard_stub.h" +#include "google/cloud/kms/inventory/v1/key_dashboard_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -46,3 +49,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_inventory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_stub.h b/google/cloud/kms/inventory/v1/internal/key_dashboard_stub.h index 481095ce65c62..f215e2ccc3ec5 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_stub.h +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_DASHBOARD_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_DASHBOARD_STUB_H +#include "google/cloud/kms/inventory/v1/key_dashboard_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -65,4 +68,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_DASHBOARD_STUB_H diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_stub_factory.cc b/google/cloud/kms/inventory/v1/internal/key_dashboard_stub_factory.cc index 59c2bc897e724..da797c7d82fc1 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_stub_factory.cc +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/kms/inventory/v1/internal/key_dashboard_metadata_decorator.h" #include "google/cloud/kms/inventory/v1/internal/key_dashboard_stub.h" #include "google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_stub.h" +#include "google/cloud/kms/inventory/v1/key_dashboard_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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_inventory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_stub_factory.h b/google/cloud/kms/inventory/v1/internal/key_dashboard_stub_factory.h index ce65a31ec6dde..3453916614af6 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_stub_factory.h +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_DASHBOARD_STUB_FACTORY_H diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_connection.cc b/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_connection.cc index 14c5b74e8b42b..1745e777ebc4a 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_connection.cc +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace kms_inventory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - KeyDashboardServiceTracingConnection::KeyDashboardServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -44,17 +42,13 @@ KeyDashboardServiceTracingConnection::ListCryptoKeys( std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeKeyDashboardServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_connection.h b/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_connection.h index 38f943c238a33..a15f777e8ac3e 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_connection.h +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace kms_inventory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class KeyDashboardServiceTracingConnection : public kms_inventory_v1::KeyDashboardServiceConnection { public: @@ -48,8 +46,6 @@ class KeyDashboardServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_stub.cc b/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_stub.cc index 1186cf762a83e..24f5b974b0e14 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_stub.cc +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - KeyDashboardServiceTracingStub::KeyDashboardServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -44,18 +45,14 @@ KeyDashboardServiceTracingStub::ListCryptoKeys( child_->ListCryptoKeys(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeKeyDashboardServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_inventory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_stub.h b/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_stub.h index cc0796e062914..4fc6357e2a37a 100644 --- a/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_stub.h +++ b/google/cloud/kms/inventory/v1/internal/key_dashboard_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class KeyDashboardServiceTracingStub : public KeyDashboardServiceStub { public: ~KeyDashboardServiceTracingStub() override = default; @@ -50,8 +51,6 @@ class KeyDashboardServiceTracingStub : public KeyDashboardServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -66,4 +65,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_DASHBOARD_TRACING_STUB_H diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_auth_decorator.cc b/google/cloud/kms/inventory/v1/internal/key_tracking_auth_decorator.cc index f1c457d99f736..08ce704418189 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_auth_decorator.cc +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/kms/inventory/v1/key_tracking_service.proto #include "google/cloud/kms/inventory/v1/internal/key_tracking_auth_decorator.h" -#include +#include "google/cloud/kms/inventory/v1/key_tracking_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -55,3 +58,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_inventory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_auth_decorator.h b/google/cloud/kms/inventory/v1/internal/key_tracking_auth_decorator.h index 4fc091961c6f4..83dd5bc136867 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_auth_decorator.h +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -60,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_TRACKING_AUTH_DECORATOR_H diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_logging_decorator.cc b/google/cloud/kms/inventory/v1/internal/key_tracking_logging_decorator.cc index 6d079c9304447..423e461ab5622 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_logging_decorator.cc +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/kms/inventory/v1/key_tracking_service.proto #include "google/cloud/kms/inventory/v1/internal/key_tracking_logging_decorator.h" +#include "google/cloud/kms/inventory/v1/key_tracking_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -67,3 +70,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_inventory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_logging_decorator.h b/google/cloud/kms/inventory/v1/internal/key_tracking_logging_decorator.h index 2e3197ddc681f..e39755ef2d9b8 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_logging_decorator.h +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -60,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_TRACKING_LOGGING_DECORATOR_H diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_metadata_decorator.cc b/google/cloud/kms/inventory/v1/internal/key_tracking_metadata_decorator.cc index 6655c7074af12..b06c66db00dc8 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_metadata_decorator.cc +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/kms/inventory/v1/key_tracking_service.proto #include "google/cloud/kms/inventory/v1/internal/key_tracking_metadata_decorator.h" +#include "google/cloud/kms/inventory/v1/key_tracking_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 kms_inventory_v1_internal { @@ -81,3 +85,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_inventory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_metadata_decorator.h b/google/cloud/kms/inventory/v1/internal/key_tracking_metadata_decorator.h index 8970bfc3c092e..167eb7140fa6c 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_metadata_decorator.h +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -66,4 +69,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_TRACKING_METADATA_DECORATOR_H diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_option_defaults.cc b/google/cloud/kms/inventory/v1/internal/key_tracking_option_defaults.cc index 03d2f63571352..941e1273432d3 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_option_defaults.cc +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_option_defaults.cc @@ -42,7 +42,7 @@ Options KeyTrackingServiceDefaultOptions(Options options) { if (!options.has()) { options.set( kms_inventory_v1::KeyTrackingServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_stub.cc b/google/cloud/kms/inventory/v1/internal/key_tracking_stub.cc index 29477a209425c..7e9fdc668deaf 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_stub.cc +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/kms/inventory/v1/key_tracking_service.proto #include "google/cloud/kms/inventory/v1/internal/key_tracking_stub.h" +#include "google/cloud/kms/inventory/v1/key_tracking_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -62,3 +65,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_inventory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_stub.h b/google/cloud/kms/inventory/v1/internal/key_tracking_stub.h index b643d2b4bf6c4..74a8fdf1dc785 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_stub.h +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_TRACKING_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_TRACKING_STUB_H +#include "google/cloud/kms/inventory/v1/key_tracking_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -80,4 +83,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_TRACKING_STUB_H diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_stub_factory.cc b/google/cloud/kms/inventory/v1/internal/key_tracking_stub_factory.cc index 3c984d41c880b..fde2ed4024ea6 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_stub_factory.cc +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/kms/inventory/v1/internal/key_tracking_metadata_decorator.h" #include "google/cloud/kms/inventory/v1/internal/key_tracking_stub.h" #include "google/cloud/kms/inventory/v1/internal/key_tracking_tracing_stub.h" +#include "google/cloud/kms/inventory/v1/key_tracking_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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_inventory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_stub_factory.h b/google/cloud/kms/inventory/v1/internal/key_tracking_stub_factory.h index 433a288342bb4..4d57551d51836 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_stub_factory.h +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_TRACKING_STUB_FACTORY_H diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_connection.cc b/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_connection.cc index 31a35e20f7402..1c2654a149ffe 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_connection.cc +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace kms_inventory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - KeyTrackingServiceTracingConnection::KeyTrackingServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -59,17 +57,13 @@ KeyTrackingServiceTracingConnection::SearchProtectedResources( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeKeyTrackingServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_connection.h b/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_connection.h index cfbd2f896bd2f..10aa83f7ab2dc 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_connection.h +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace kms_inventory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class KeyTrackingServiceTracingConnection : public kms_inventory_v1::KeyTrackingServiceConnection { public: @@ -54,8 +52,6 @@ class KeyTrackingServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_stub.cc b/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_stub.cc index 687e5fab6a4c3..9fd70dd43fe22 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_stub.cc +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - KeyTrackingServiceTracingStub::KeyTrackingServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -62,18 +63,14 @@ KeyTrackingServiceTracingStub::SearchProtectedResources( child_->SearchProtectedResources(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeKeyTrackingServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_inventory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_stub.h b/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_stub.h index 6e02b8144f26e..9d32744bf67f9 100644 --- a/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_stub.h +++ b/google/cloud/kms/inventory/v1/internal/key_tracking_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_inventory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class KeyTrackingServiceTracingStub : public KeyTrackingServiceStub { public: ~KeyTrackingServiceTracingStub() override = default; @@ -57,8 +58,6 @@ class KeyTrackingServiceTracingStub : public KeyTrackingServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -73,4 +72,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_INTERNAL_KEY_TRACKING_TRACING_STUB_H diff --git a/google/cloud/kms/inventory/v1/key_dashboard_client.h b/google/cloud/kms/inventory/v1/key_dashboard_client.h index 5b95c519ad040..7e2b9dadba301 100644 --- a/google/cloud/kms/inventory/v1/key_dashboard_client.h +++ b/google/cloud/kms/inventory/v1/key_dashboard_client.h @@ -117,7 +117,7 @@ class KeyDashboardServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.inventory.v1.ListCryptoKeysRequest]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_dashboard_service.proto#L52} + /// [google.cloud.kms.inventory.v1.ListCryptoKeysRequest]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_dashboard_service.proto#L51} /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} /// // clang-format on @@ -158,7 +158,7 @@ class KeyDashboardServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.inventory.v1.ListCryptoKeysRequest]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_dashboard_service.proto#L52} + /// [google.cloud.kms.inventory.v1.ListCryptoKeysRequest]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_dashboard_service.proto#L51} /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} /// // clang-format on diff --git a/google/cloud/kms/inventory/v1/key_dashboard_connection.h b/google/cloud/kms/inventory/v1/key_dashboard_connection.h index 3c7f1f238cfc9..d0316ff853704 100644 --- a/google/cloud/kms/inventory/v1/key_dashboard_connection.h +++ b/google/cloud/kms/inventory/v1/key_dashboard_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/kms/inventory/v1/internal/key_dashboard_retry_traits.h" #include "google/cloud/kms/inventory/v1/key_dashboard_connection_idempotency_policy.h" +#include "google/cloud/kms/inventory/v1/key_dashboard_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 #include namespace google { diff --git a/google/cloud/kms/inventory/v1/key_dashboard_connection_idempotency_policy.h b/google/cloud/kms/inventory/v1/key_dashboard_connection_idempotency_policy.h index f6d1f740b383a..96276552fbc8d 100644 --- a/google/cloud/kms/inventory/v1/key_dashboard_connection_idempotency_policy.h +++ b/google/cloud/kms/inventory/v1/key_dashboard_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_KEY_DASHBOARD_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_KEY_DASHBOARD_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/kms/inventory/v1/key_dashboard_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/kms/inventory/v1/key_tracking_client.h b/google/cloud/kms/inventory/v1/key_tracking_client.h index 00211940cff30..471a3912c7122 100644 --- a/google/cloud/kms/inventory/v1/key_tracking_client.h +++ b/google/cloud/kms/inventory/v1/key_tracking_client.h @@ -92,10 +92,16 @@ class KeyTrackingServiceClient { // clang-format off /// /// Returns aggregate information about the resources protected by the given - /// Cloud KMS [CryptoKey][google.cloud.kms.v1.CryptoKey]. Only resources within - /// the same Cloud organization as the key will be returned. The project that - /// holds the key must be part of an organization in order for this call to - /// succeed. + /// Cloud KMS [CryptoKey][google.cloud.kms.v1.CryptoKey]. By default, + /// summary of resources within the same Cloud organization as the key will be + /// returned, which requires the KMS organization service account to be + /// configured(refer + /// https://docs.cloud.google.com/kms/docs/view-key-usage#required-roles). + /// If the KMS organization service account is not configured or key's project + /// is not part of an organization, set + /// [fallback_scope][google.cloud.kms.inventory.v1.GetProtectedResourcesSummaryRequest.fallback_scope] + /// to `FALLBACK_SCOPE_PROJECT` to retrieve a summary of protected resources + /// within the key's project. /// /// @param name Required. The resource name of the /// [CryptoKey][google.cloud.kms.v1.CryptoKey]. @@ -112,8 +118,9 @@ class KeyTrackingServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.inventory.v1.GetProtectedResourcesSummaryRequest]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L66} - /// [google.cloud.kms.inventory.v1.ProtectedResourcesSummary]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L79} + /// [google.cloud.kms.inventory.v1.GetProtectedResourcesSummaryRequest]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L80} + /// [google.cloud.kms.inventory.v1.GetProtectedResourcesSummaryRequest.fallback_scope]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L92} + /// [google.cloud.kms.inventory.v1.ProtectedResourcesSummary]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L97} /// // clang-format on StatusOr @@ -122,10 +129,16 @@ class KeyTrackingServiceClient { // clang-format off /// /// Returns aggregate information about the resources protected by the given - /// Cloud KMS [CryptoKey][google.cloud.kms.v1.CryptoKey]. Only resources within - /// the same Cloud organization as the key will be returned. The project that - /// holds the key must be part of an organization in order for this call to - /// succeed. + /// Cloud KMS [CryptoKey][google.cloud.kms.v1.CryptoKey]. By default, + /// summary of resources within the same Cloud organization as the key will be + /// returned, which requires the KMS organization service account to be + /// configured(refer + /// https://docs.cloud.google.com/kms/docs/view-key-usage#required-roles). + /// If the KMS organization service account is not configured or key's project + /// is not part of an organization, set + /// [fallback_scope][google.cloud.kms.inventory.v1.GetProtectedResourcesSummaryRequest.fallback_scope] + /// to `FALLBACK_SCOPE_PROJECT` to retrieve a summary of protected resources + /// within the key's project. /// /// @param request Unary RPCs, such as the one wrapped by this /// function, receive a single `request` proto message which includes all @@ -146,8 +159,9 @@ class KeyTrackingServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.inventory.v1.GetProtectedResourcesSummaryRequest]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L66} - /// [google.cloud.kms.inventory.v1.ProtectedResourcesSummary]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L79} + /// [google.cloud.kms.inventory.v1.GetProtectedResourcesSummaryRequest]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L80} + /// [google.cloud.kms.inventory.v1.GetProtectedResourcesSummaryRequest.fallback_scope]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L92} + /// [google.cloud.kms.inventory.v1.ProtectedResourcesSummary]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L97} /// // clang-format on StatusOr @@ -159,10 +173,17 @@ class KeyTrackingServiceClient { // clang-format off /// /// Returns metadata about the resources protected by the given Cloud KMS - /// [CryptoKey][google.cloud.kms.v1.CryptoKey] in the given Cloud organization. + /// [CryptoKey][google.cloud.kms.v1.CryptoKey] in the given Cloud + /// organization/project. /// - /// @param scope Required. Resource name of the organization. - /// Example: organizations/123 + /// @param scope Required. A scope can be an organization or a project. Resources protected + /// by the crypto key in provided scope will be returned. + /// @n + /// The following values are allowed: + /// @n + /// * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/12345678") + /// * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + /// * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") /// @param crypto_key Required. The resource name of the /// [CryptoKey][google.cloud.kms.v1.CryptoKey]. /// @param opts Optional. Override the class-level options, such as retry and @@ -187,8 +208,8 @@ class KeyTrackingServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.inventory.v1.ProtectedResource]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L172} - /// [google.cloud.kms.inventory.v1.SearchProtectedResourcesRequest]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L111} + /// [google.cloud.kms.inventory.v1.ProtectedResource]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L202} + /// [google.cloud.kms.inventory.v1.SearchProtectedResourcesRequest]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L135} /// // clang-format on StreamRange @@ -198,7 +219,8 @@ class KeyTrackingServiceClient { // clang-format off /// /// Returns metadata about the resources protected by the given Cloud KMS - /// [CryptoKey][google.cloud.kms.v1.CryptoKey] in the given Cloud organization. + /// [CryptoKey][google.cloud.kms.v1.CryptoKey] in the given Cloud + /// organization/project. /// /// @param request Unary RPCs, such as the one wrapped by this /// function, receive a single `request` proto message which includes all @@ -228,8 +250,8 @@ class KeyTrackingServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.inventory.v1.ProtectedResource]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L172} - /// [google.cloud.kms.inventory.v1.SearchProtectedResourcesRequest]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L111} + /// [google.cloud.kms.inventory.v1.ProtectedResource]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L202} + /// [google.cloud.kms.inventory.v1.SearchProtectedResourcesRequest]: @googleapis_reference_link{google/cloud/kms/inventory/v1/key_tracking_service.proto#L135} /// // clang-format on StreamRange diff --git a/google/cloud/kms/inventory/v1/key_tracking_connection.h b/google/cloud/kms/inventory/v1/key_tracking_connection.h index d0664312a00c3..e636ac8428d67 100644 --- a/google/cloud/kms/inventory/v1/key_tracking_connection.h +++ b/google/cloud/kms/inventory/v1/key_tracking_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/kms/inventory/v1/internal/key_tracking_retry_traits.h" #include "google/cloud/kms/inventory/v1/key_tracking_connection_idempotency_policy.h" +#include "google/cloud/kms/inventory/v1/key_tracking_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 #include namespace google { diff --git a/google/cloud/kms/inventory/v1/key_tracking_connection_idempotency_policy.h b/google/cloud/kms/inventory/v1/key_tracking_connection_idempotency_policy.h index 30740a4b2aba0..96b4d1223c143 100644 --- a/google/cloud/kms/inventory/v1/key_tracking_connection_idempotency_policy.h +++ b/google/cloud/kms/inventory/v1/key_tracking_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_KEY_TRACKING_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_INVENTORY_V1_KEY_TRACKING_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/kms/inventory/v1/key_tracking_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/kms/key_management_client.h b/google/cloud/kms/key_management_client.h deleted file mode 100644 index 82b71278498be..0000000000000 --- a/google/cloud/kms/key_management_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/kms/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_KEY_MANAGEMENT_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_KEY_MANAGEMENT_CLIENT_H - -#include "google/cloud/kms/key_management_connection.h" -#include "google/cloud/kms/v1/key_management_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in kms_v1 instead of the aliases defined in -/// this namespace. -namespace kms { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use kms_v1::KeyManagementServiceClient directly. -using ::google::cloud::kms_v1::KeyManagementServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace kms -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_KEY_MANAGEMENT_CLIENT_H diff --git a/google/cloud/kms/key_management_connection.h b/google/cloud/kms/key_management_connection.h deleted file mode 100644 index 8e392c0818f2d..0000000000000 --- a/google/cloud/kms/key_management_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/kms/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_KEY_MANAGEMENT_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_KEY_MANAGEMENT_CONNECTION_H - -#include "google/cloud/kms/key_management_connection_idempotency_policy.h" -#include "google/cloud/kms/v1/key_management_connection.h" - -namespace google { -namespace cloud { -namespace kms { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use kms_v1::MakeKeyManagementServiceConnection directly. -using ::google::cloud::kms_v1::MakeKeyManagementServiceConnection; - -/// @deprecated Use kms_v1::KeyManagementServiceConnection directly. -using ::google::cloud::kms_v1::KeyManagementServiceConnection; - -/// @deprecated Use kms_v1::KeyManagementServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::kms_v1::KeyManagementServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use kms_v1::KeyManagementServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::kms_v1::KeyManagementServiceLimitedTimeRetryPolicy; - -/// @deprecated Use kms_v1::KeyManagementServiceRetryPolicy directly. -using ::google::cloud::kms_v1::KeyManagementServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace kms -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_KEY_MANAGEMENT_CONNECTION_H diff --git a/google/cloud/kms/key_management_connection_idempotency_policy.h b/google/cloud/kms/key_management_connection_idempotency_policy.h deleted file mode 100644 index 76a66df55e3c7..0000000000000 --- a/google/cloud/kms/key_management_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/kms/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_KEY_MANAGEMENT_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_KEY_MANAGEMENT_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/kms/v1/key_management_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace kms { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// kms_v1::MakeDefaultKeyManagementServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::kms_v1:: - MakeDefaultKeyManagementServiceConnectionIdempotencyPolicy; - -/// @deprecated Use kms_v1::KeyManagementServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::kms_v1::KeyManagementServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace kms -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_KEY_MANAGEMENT_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/kms/key_management_options.h b/google/cloud/kms/key_management_options.h deleted file mode 100644 index 6c0a7bbbd500c..0000000000000 --- a/google/cloud/kms/key_management_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/kms/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_KEY_MANAGEMENT_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_KEY_MANAGEMENT_OPTIONS_H - -#include "google/cloud/kms/key_management_connection.h" -#include "google/cloud/kms/key_management_connection_idempotency_policy.h" -#include "google/cloud/kms/v1/key_management_options.h" - -namespace google { -namespace cloud { -namespace kms { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use kms_v1::KeyManagementServiceBackoffPolicyOption directly. -using ::google::cloud::kms_v1::KeyManagementServiceBackoffPolicyOption; - -/// @deprecated Use -/// kms_v1::KeyManagementServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::kms_v1:: - KeyManagementServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use kms_v1::KeyManagementServicePolicyOptionList directly. -using ::google::cloud::kms_v1::KeyManagementServicePolicyOptionList; - -/// @deprecated Use kms_v1::KeyManagementServiceRetryPolicyOption directly. -using ::google::cloud::kms_v1::KeyManagementServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace kms -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_KEY_MANAGEMENT_OPTIONS_H diff --git a/google/cloud/kms/mocks/mock_ekm_connection.h b/google/cloud/kms/mocks/mock_ekm_connection.h deleted file mode 100644 index 092aec1c2c071..0000000000000 --- a/google/cloud/kms/mocks/mock_ekm_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/kms/v1/ekm_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_MOCKS_MOCK_EKM_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_MOCKS_MOCK_EKM_CONNECTION_H - -#include "google/cloud/kms/ekm_connection.h" -#include "google/cloud/kms/v1/mocks/mock_ekm_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in kms_v1_mocks instead of the aliases -/// defined in this namespace. -namespace kms_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use kms_v1_mocks::MockEkmServiceConnection directly. -using ::google::cloud::kms_v1_mocks::MockEkmServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace kms_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_MOCKS_MOCK_EKM_CONNECTION_H diff --git a/google/cloud/kms/mocks/mock_key_management_connection.h b/google/cloud/kms/mocks/mock_key_management_connection.h deleted file mode 100644 index d9ebb4b3fc861..0000000000000 --- a/google/cloud/kms/mocks/mock_key_management_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/kms/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_MOCKS_MOCK_KEY_MANAGEMENT_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_MOCKS_MOCK_KEY_MANAGEMENT_CONNECTION_H - -#include "google/cloud/kms/key_management_connection.h" -#include "google/cloud/kms/v1/mocks/mock_key_management_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in kms_v1_mocks instead of the aliases -/// defined in this namespace. -namespace kms_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use kms_v1_mocks::MockKeyManagementServiceConnection directly. -using ::google::cloud::kms_v1_mocks::MockKeyManagementServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace kms_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_MOCKS_MOCK_KEY_MANAGEMENT_CONNECTION_H diff --git a/google/cloud/kms/quickstart/.bazelrc b/google/cloud/kms/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/kms/quickstart/.bazelrc +++ b/google/cloud/kms/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/kms/quickstart/CMakeLists.txt index 3c29b2d24cbbb..c2cca2b625454 100644 --- a/google/cloud/kms/quickstart/CMakeLists.txt +++ b/google/cloud/kms/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Key Management Service (KMS) API C++ # client library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-kms-quickstart CXX) find_package(google_cloud_cpp_kms REQUIRED) diff --git a/google/cloud/kms/quickstart/WORKSPACE.bazel b/google/cloud/kms/quickstart/WORKSPACE.bazel index 4bd3431bf075c..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 = "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/kms/v1/autokey_admin_client.h b/google/cloud/kms/v1/autokey_admin_client.h index 54c2fd38a40dd..ea144a70609f5 100644 --- a/google/cloud/kms/v1/autokey_admin_client.h +++ b/google/cloud/kms/v1/autokey_admin_client.h @@ -36,13 +36,15 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN /// /// Provides interfaces for managing [Cloud KMS -/// Autokey](https://cloud.google.com/kms/help/autokey) folder-level -/// configurations. A configuration is inherited by all descendent projects. A -/// configuration at one folder overrides any other configurations in its -/// ancestry. Setting a configuration on a folder is a prerequisite for Cloud -/// KMS Autokey, so that users working in a descendant project can request -/// provisioned [CryptoKeys][google.cloud.kms.v1.CryptoKey], ready for Customer -/// Managed Encryption Key (CMEK) use, on-demand. +/// Autokey](https://cloud.google.com/kms/help/autokey) folder-level or +/// project-level configurations. A configuration is inherited by all descendent +/// folders and projects. A configuration at a folder or project overrides any +/// other configurations in its ancestry. Setting a configuration on a folder is +/// a prerequisite for Cloud KMS Autokey, so that users working in a descendant +/// project can request provisioned [CryptoKeys][google.cloud.kms.v1.CryptoKey], +/// ready for Customer Managed Encryption Key (CMEK) use, on-demand when using +/// the dedicated key project mode. This is not required when using the +/// delegated key management mode for same-project keys. /// /// @par Equality /// @@ -95,8 +97,8 @@ class AutokeyAdminClient { // clang-format off /// - /// Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a - /// folder. The caller must have both `cloudkms.autokeyConfigs.update` + /// Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a folder + /// or a project. The caller must have both `cloudkms.autokeyConfigs.update` /// permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` /// permission on the provided key project. A /// [KeyHandle][google.cloud.kms.v1.KeyHandle] creation in the folder's @@ -121,8 +123,8 @@ class AutokeyAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.AutokeyConfig]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L106} - /// [google.cloud.kms.v1.UpdateAutokeyConfigRequest]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L80} + /// [google.cloud.kms.v1.AutokeyConfig]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L114} + /// [google.cloud.kms.v1.UpdateAutokeyConfigRequest]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L87} /// // clang-format on StatusOr UpdateAutokeyConfig( @@ -131,8 +133,8 @@ class AutokeyAdminClient { // clang-format off /// - /// Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a - /// folder. The caller must have both `cloudkms.autokeyConfigs.update` + /// Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a folder + /// or a project. The caller must have both `cloudkms.autokeyConfigs.update` /// permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` /// permission on the provided key project. A /// [KeyHandle][google.cloud.kms.v1.KeyHandle] creation in the folder's @@ -158,8 +160,8 @@ class AutokeyAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.AutokeyConfig]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L106} - /// [google.cloud.kms.v1.UpdateAutokeyConfigRequest]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L80} + /// [google.cloud.kms.v1.AutokeyConfig]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L114} + /// [google.cloud.kms.v1.UpdateAutokeyConfigRequest]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L87} /// // clang-format on StatusOr UpdateAutokeyConfig( @@ -168,11 +170,12 @@ class AutokeyAdminClient { // clang-format off /// - /// Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a - /// folder. + /// Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a folder + /// or project. /// /// @param name Required. Name of the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] - /// resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + /// resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig` or + /// `projects/{PROJECT_NUMBER}/autokeyConfig`. /// @param opts Optional. Override the class-level options, such as retry and /// backoff policies. /// @return the result of the RPC. The response message type @@ -186,8 +189,8 @@ class AutokeyAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.AutokeyConfig]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L106} - /// [google.cloud.kms.v1.GetAutokeyConfigRequest]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L94} + /// [google.cloud.kms.v1.AutokeyConfig]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L114} + /// [google.cloud.kms.v1.GetAutokeyConfigRequest]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L101} /// // clang-format on StatusOr GetAutokeyConfig( @@ -195,8 +198,8 @@ class AutokeyAdminClient { // clang-format off /// - /// Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a - /// folder. + /// Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a folder + /// or project. /// /// @param request Unary RPCs, such as the one wrapped by this /// function, receive a single `request` proto message which includes all @@ -217,8 +220,8 @@ class AutokeyAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.AutokeyConfig]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L106} - /// [google.cloud.kms.v1.GetAutokeyConfigRequest]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L94} + /// [google.cloud.kms.v1.AutokeyConfig]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L114} + /// [google.cloud.kms.v1.GetAutokeyConfigRequest]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L101} /// // clang-format on StatusOr GetAutokeyConfig( @@ -245,8 +248,8 @@ class AutokeyAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.ShowEffectiveAutokeyConfigRequest]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L160} - /// [google.cloud.kms.v1.ShowEffectiveAutokeyConfigResponse]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L174} + /// [google.cloud.kms.v1.ShowEffectiveAutokeyConfigRequest]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L210} + /// [google.cloud.kms.v1.ShowEffectiveAutokeyConfigResponse]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L224} /// // clang-format on StatusOr @@ -275,8 +278,8 @@ class AutokeyAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.ShowEffectiveAutokeyConfigRequest]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L160} - /// [google.cloud.kms.v1.ShowEffectiveAutokeyConfigResponse]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L174} + /// [google.cloud.kms.v1.ShowEffectiveAutokeyConfigRequest]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L210} + /// [google.cloud.kms.v1.ShowEffectiveAutokeyConfigResponse]: @googleapis_reference_link{google/cloud/kms/v1/autokey_admin.proto#L224} /// // clang-format on StatusOr diff --git a/google/cloud/kms/v1/autokey_admin_connection.h b/google/cloud/kms/v1/autokey_admin_connection.h index 8e92ac0316139..eee0d5ac57026 100644 --- a/google/cloud/kms/v1/autokey_admin_connection.h +++ b/google/cloud/kms/v1/autokey_admin_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_AUTOKEY_ADMIN_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_AUTOKEY_ADMIN_CONNECTION_H +#include "google/cloud/kms/v1/autokey_admin.pb.h" #include "google/cloud/kms/v1/autokey_admin_connection_idempotency_policy.h" #include "google/cloud/kms/v1/internal/autokey_admin_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/kms/v1/autokey_admin_connection_idempotency_policy.h b/google/cloud/kms/v1/autokey_admin_connection_idempotency_policy.h index 774d82141df41..b91e80b504aab 100644 --- a/google/cloud/kms/v1/autokey_admin_connection_idempotency_policy.h +++ b/google/cloud/kms/v1/autokey_admin_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_AUTOKEY_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_AUTOKEY_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/kms/v1/autokey_admin.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/kms/v1/autokey_client.h b/google/cloud/kms/v1/autokey_client.h index 808a68d651b09..d38333a982ece 100644 --- a/google/cloud/kms/v1/autokey_client.h +++ b/google/cloud/kms/v1/autokey_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/kms/v1/autokey_connection.h b/google/cloud/kms/v1/autokey_connection.h index e8c7cd4ec0a95..fc1492973ef4a 100644 --- a/google/cloud/kms/v1/autokey_connection.h +++ b/google/cloud/kms/v1/autokey_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_AUTOKEY_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_AUTOKEY_CONNECTION_H +#include "google/cloud/kms/v1/autokey.pb.h" #include "google/cloud/kms/v1/autokey_connection_idempotency_policy.h" #include "google/cloud/kms/v1/internal/autokey_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/kms/v1/autokey_connection_idempotency_policy.h b/google/cloud/kms/v1/autokey_connection_idempotency_policy.h index 108add172e4f0..ccddfc14ac069 100644 --- a/google/cloud/kms/v1/autokey_connection_idempotency_policy.h +++ b/google/cloud/kms/v1/autokey_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_AUTOKEY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_AUTOKEY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/kms/v1/autokey.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/kms/v1/ekm_connection.h b/google/cloud/kms/v1/ekm_connection.h index 92535d4663749..138ed40f977b5 100644 --- a/google/cloud/kms/v1/ekm_connection.h +++ b/google/cloud/kms/v1/ekm_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_EKM_CONNECTION_H #include "google/cloud/kms/v1/ekm_connection_idempotency_policy.h" +#include "google/cloud/kms/v1/ekm_service.pb.h" #include "google/cloud/kms/v1/internal/ekm_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/kms/v1/ekm_connection_idempotency_policy.h b/google/cloud/kms/v1/ekm_connection_idempotency_policy.h index 537cb2d02ae6a..ef9279645aae0 100644 --- a/google/cloud/kms/v1/ekm_connection_idempotency_policy.h +++ b/google/cloud/kms/v1/ekm_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_EKM_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_EKM_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/kms/v1/ekm_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/kms/v1/internal/autokey_admin_auth_decorator.cc b/google/cloud/kms/v1/internal/autokey_admin_auth_decorator.cc index e3e60c08619e9..478ddba6fb954 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_auth_decorator.cc +++ b/google/cloud/kms/v1/internal/autokey_admin_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/kms/v1/autokey_admin.proto #include "google/cloud/kms/v1/internal/autokey_admin_auth_decorator.h" -#include +#include "google/cloud/kms/v1/autokey_admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -112,3 +115,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/autokey_admin_auth_decorator.h b/google/cloud/kms/v1/internal/autokey_admin_auth_decorator.h index 1f25b3c20c2b9..be868d365b80d 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_auth_decorator.h +++ b/google/cloud/kms/v1/internal/autokey_admin_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -87,4 +90,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_ADMIN_AUTH_DECORATOR_H diff --git a/google/cloud/kms/v1/internal/autokey_admin_logging_decorator.cc b/google/cloud/kms/v1/internal/autokey_admin_logging_decorator.cc index 7de8149529332..9f00ac1b88d83 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_logging_decorator.cc +++ b/google/cloud/kms/v1/internal/autokey_admin_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/kms/v1/autokey_admin.proto #include "google/cloud/kms/v1/internal/autokey_admin_logging_decorator.h" +#include "google/cloud/kms/v1/autokey_admin.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -145,3 +148,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/autokey_admin_logging_decorator.h b/google/cloud/kms/v1/internal/autokey_admin_logging_decorator.h index 7f6d97aa7d8ea..270766d3687b7 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_logging_decorator.h +++ b/google/cloud/kms/v1/internal/autokey_admin_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -87,4 +90,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_ADMIN_LOGGING_DECORATOR_H diff --git a/google/cloud/kms/v1/internal/autokey_admin_metadata_decorator.cc b/google/cloud/kms/v1/internal/autokey_admin_metadata_decorator.cc index 7228b2bbdac5b..d5cf0a767345d 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_metadata_decorator.cc +++ b/google/cloud/kms/v1/internal/autokey_admin_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/kms/v1/autokey_admin.proto #include "google/cloud/kms/v1/internal/autokey_admin_metadata_decorator.h" +#include "google/cloud/kms/v1/autokey_admin.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 kms_v1_internal { @@ -143,3 +147,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/autokey_admin_metadata_decorator.h b/google/cloud/kms/v1/internal/autokey_admin_metadata_decorator.h index ebed32e4827ac..6c92880d7c855 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_metadata_decorator.h +++ b/google/cloud/kms/v1/internal/autokey_admin_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -92,4 +95,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_ADMIN_METADATA_DECORATOR_H diff --git a/google/cloud/kms/v1/internal/autokey_admin_option_defaults.cc b/google/cloud/kms/v1/internal/autokey_admin_option_defaults.cc index 37170cbac5e40..53be9f9724901 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_option_defaults.cc +++ b/google/cloud/kms/v1/internal/autokey_admin_option_defaults.cc @@ -40,7 +40,7 @@ Options AutokeyAdminDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - kms_v1::AutokeyAdminLimitedTimeRetryPolicy(std::chrono::minutes(30)) + kms_v1::AutokeyAdminLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/kms/v1/internal/autokey_admin_stub.cc b/google/cloud/kms/v1/internal/autokey_admin_stub.cc index 4acd378b6659c..4d81bef01deaf 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_stub.cc +++ b/google/cloud/kms/v1/internal/autokey_admin_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/kms/v1/autokey_admin.proto #include "google/cloud/kms/v1/internal/autokey_admin_stub.h" +#include "google/cloud/kms/v1/autokey_admin.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -141,3 +144,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/autokey_admin_stub.h b/google/cloud/kms/v1/internal/autokey_admin_stub.h index f66b56cc700bb..ec0db3bcd37a7 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_stub.h +++ b/google/cloud/kms/v1/internal/autokey_admin_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_ADMIN_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_ADMIN_STUB_H +#include "google/cloud/kms/v1/autokey_admin.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 -#include -#include -#include +#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 kms_v1_internal { @@ -148,4 +151,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_ADMIN_STUB_H diff --git a/google/cloud/kms/v1/internal/autokey_admin_stub_factory.cc b/google/cloud/kms/v1/internal/autokey_admin_stub_factory.cc index 2ff210eb74523..32d412838776e 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_stub_factory.cc +++ b/google/cloud/kms/v1/internal/autokey_admin_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/kms/v1/autokey_admin.proto #include "google/cloud/kms/v1/internal/autokey_admin_stub_factory.h" +#include "google/cloud/kms/v1/autokey_admin.grpc.pb.h" #include "google/cloud/kms/v1/internal/autokey_admin_auth_decorator.h" #include "google/cloud/kms/v1/internal/autokey_admin_logging_decorator.h" #include "google/cloud/kms/v1/internal/autokey_admin_metadata_decorator.h" #include "google/cloud/kms/v1/internal/autokey_admin_stub.h" #include "google/cloud/kms/v1/internal/autokey_admin_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 -#include -#include -#include +#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 kms_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/autokey_admin_stub_factory.h b/google/cloud/kms/v1/internal/autokey_admin_stub_factory.h index e5108ef50f8fd..f7222acdfb18f 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_stub_factory.h +++ b/google/cloud/kms/v1/internal/autokey_admin_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_ADMIN_STUB_FACTORY_H diff --git a/google/cloud/kms/v1/internal/autokey_admin_tracing_connection.cc b/google/cloud/kms/v1/internal/autokey_admin_tracing_connection.cc index 7f85c345c603c..d399c668ae2af 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_tracing_connection.cc +++ b/google/cloud/kms/v1/internal/autokey_admin_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AutokeyAdminTracingConnection::AutokeyAdminTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -113,16 +111,12 @@ AutokeyAdminTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAutokeyAdminTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/kms/v1/internal/autokey_admin_tracing_connection.h b/google/cloud/kms/v1/internal/autokey_admin_tracing_connection.h index d8e98bc777852..fee18ef0a5fc6 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_tracing_connection.h +++ b/google/cloud/kms/v1/internal/autokey_admin_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AutokeyAdminTracingConnection : public kms_v1::AutokeyAdminConnection { public: ~AutokeyAdminTracingConnection() override = default; @@ -73,8 +71,6 @@ class AutokeyAdminTracingConnection : public kms_v1::AutokeyAdminConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/kms/v1/internal/autokey_admin_tracing_stub.cc b/google/cloud/kms/v1/internal/autokey_admin_tracing_stub.cc index 274dd92d29004..293ec9f875efc 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_tracing_stub.cc +++ b/google/cloud/kms/v1/internal/autokey_admin_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AutokeyAdminTracingStub::AutokeyAdminTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -138,18 +139,14 @@ StatusOr AutokeyAdminTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAutokeyAdminTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/autokey_admin_tracing_stub.h b/google/cloud/kms/v1/internal/autokey_admin_tracing_stub.h index 07afb0fc6b378..e8f76cc129b36 100644 --- a/google/cloud/kms/v1/internal/autokey_admin_tracing_stub.h +++ b/google/cloud/kms/v1/internal/autokey_admin_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AutokeyAdminTracingStub : public AutokeyAdminStub { public: ~AutokeyAdminTracingStub() override = default; @@ -83,8 +84,6 @@ class AutokeyAdminTracingStub : public AutokeyAdminStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -99,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_ADMIN_TRACING_STUB_H diff --git a/google/cloud/kms/v1/internal/autokey_auth_decorator.cc b/google/cloud/kms/v1/internal/autokey_auth_decorator.cc index c90277179f0f2..5c05f65bea9a8 100644 --- a/google/cloud/kms/v1/internal/autokey_auth_decorator.cc +++ b/google/cloud/kms/v1/internal/autokey_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/kms/v1/autokey.proto #include "google/cloud/kms/v1/internal/autokey_auth_decorator.h" -#include +#include "google/cloud/kms/v1/autokey.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -165,3 +168,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/autokey_auth_decorator.h b/google/cloud/kms/v1/internal/autokey_auth_decorator.h index 0ef61b1b85f86..de76ad5bdc52f 100644 --- a/google/cloud/kms/v1/internal/autokey_auth_decorator.h +++ b/google/cloud/kms/v1/internal/autokey_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/kms/v1/internal/autokey_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 kms_v1_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_AUTH_DECORATOR_H diff --git a/google/cloud/kms/v1/internal/autokey_connection_impl.h b/google/cloud/kms/v1/internal/autokey_connection_impl.h index 9bba3ccd0919d..6d63f84d00e74 100644 --- a/google/cloud/kms/v1/internal/autokey_connection_impl.h +++ b/google/cloud/kms/v1/internal/autokey_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/kms/v1/internal/autokey_logging_decorator.cc b/google/cloud/kms/v1/internal/autokey_logging_decorator.cc index a5d03d0369c65..9f07efbace6a3 100644 --- a/google/cloud/kms/v1/internal/autokey_logging_decorator.cc +++ b/google/cloud/kms/v1/internal/autokey_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/kms/v1/autokey.proto #include "google/cloud/kms/v1/internal/autokey_logging_decorator.h" +#include "google/cloud/kms/v1/autokey.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -194,3 +197,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/autokey_logging_decorator.h b/google/cloud/kms/v1/internal/autokey_logging_decorator.h index 756005fe77bde..d69b273207662 100644 --- a/google/cloud/kms/v1/internal/autokey_logging_decorator.h +++ b/google/cloud/kms/v1/internal/autokey_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/kms/v1/internal/autokey_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 kms_v1_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_LOGGING_DECORATOR_H diff --git a/google/cloud/kms/v1/internal/autokey_metadata_decorator.cc b/google/cloud/kms/v1/internal/autokey_metadata_decorator.cc index e57cd9ee68356..496a4f19a5023 100644 --- a/google/cloud/kms/v1/internal/autokey_metadata_decorator.cc +++ b/google/cloud/kms/v1/internal/autokey_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/kms/v1/autokey.proto #include "google/cloud/kms/v1/internal/autokey_metadata_decorator.h" +#include "google/cloud/kms/v1/autokey.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 kms_v1_internal { @@ -174,3 +178,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/autokey_metadata_decorator.h b/google/cloud/kms/v1/internal/autokey_metadata_decorator.h index 0841c01f94c79..8ca9159423a14 100644 --- a/google/cloud/kms/v1/internal/autokey_metadata_decorator.h +++ b/google/cloud/kms/v1/internal/autokey_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/kms/v1/internal/autokey_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 kms_v1_internal { @@ -108,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_METADATA_DECORATOR_H diff --git a/google/cloud/kms/v1/internal/autokey_option_defaults.cc b/google/cloud/kms/v1/internal/autokey_option_defaults.cc index 669228e138cf3..49bde715ef3e3 100644 --- a/google/cloud/kms/v1/internal/autokey_option_defaults.cc +++ b/google/cloud/kms/v1/internal/autokey_option_defaults.cc @@ -40,7 +40,7 @@ Options AutokeyDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - kms_v1::AutokeyLimitedTimeRetryPolicy(std::chrono::minutes(30)) + kms_v1::AutokeyLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/kms/v1/internal/autokey_stub.cc b/google/cloud/kms/v1/internal/autokey_stub.cc index 3d56f0a7ce334..65e01abb2f99a 100644 --- a/google/cloud/kms/v1/internal/autokey_stub.cc +++ b/google/cloud/kms/v1/internal/autokey_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/kms/v1/autokey.proto #include "google/cloud/kms/v1/internal/autokey_stub.h" +#include "google/cloud/kms/v1/autokey.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -195,3 +198,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/autokey_stub.h b/google/cloud/kms/v1/internal/autokey_stub.h index 1835f5888a667..21f58ab0fde47 100644 --- a/google/cloud/kms/v1/internal/autokey_stub.h +++ b/google/cloud/kms/v1/internal/autokey_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_STUB_H +#include "google/cloud/kms/v1/autokey.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 -#include -#include -#include +#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 kms_v1_internal { @@ -180,4 +183,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_STUB_H diff --git a/google/cloud/kms/v1/internal/autokey_stub_factory.cc b/google/cloud/kms/v1/internal/autokey_stub_factory.cc index 910d17cc626da..fcf7869df850c 100644 --- a/google/cloud/kms/v1/internal/autokey_stub_factory.cc +++ b/google/cloud/kms/v1/internal/autokey_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/kms/v1/autokey.proto #include "google/cloud/kms/v1/internal/autokey_stub_factory.h" +#include "google/cloud/kms/v1/autokey.grpc.pb.h" #include "google/cloud/kms/v1/internal/autokey_auth_decorator.h" #include "google/cloud/kms/v1/internal/autokey_logging_decorator.h" #include "google/cloud/kms/v1/internal/autokey_metadata_decorator.h" #include "google/cloud/kms/v1/internal/autokey_stub.h" #include "google/cloud/kms/v1/internal/autokey_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 -#include -#include -#include +#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 kms_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/autokey_stub_factory.h b/google/cloud/kms/v1/internal/autokey_stub_factory.h index 9862f99f892b6..e9f0552dc6a6a 100644 --- a/google/cloud/kms/v1/internal/autokey_stub_factory.h +++ b/google/cloud/kms/v1/internal/autokey_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_STUB_FACTORY_H diff --git a/google/cloud/kms/v1/internal/autokey_tracing_connection.cc b/google/cloud/kms/v1/internal/autokey_tracing_connection.cc index 3226801aa85c2..c8e800941b953 100644 --- a/google/cloud/kms/v1/internal/autokey_tracing_connection.cc +++ b/google/cloud/kms/v1/internal/autokey_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AutokeyTracingConnection::AutokeyTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -124,15 +122,11 @@ StatusOr AutokeyTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAutokeyTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/kms/v1/internal/autokey_tracing_connection.h b/google/cloud/kms/v1/internal/autokey_tracing_connection.h index e5b53d0e38bc0..52f838ed0cce5 100644 --- a/google/cloud/kms/v1/internal/autokey_tracing_connection.h +++ b/google/cloud/kms/v1/internal/autokey_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AutokeyTracingConnection : public kms_v1::AutokeyConnection { public: ~AutokeyTracingConnection() override = default; @@ -77,8 +75,6 @@ class AutokeyTracingConnection : public kms_v1::AutokeyConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/kms/v1/internal/autokey_tracing_stub.cc b/google/cloud/kms/v1/internal/autokey_tracing_stub.cc index b06fccc5b9492..eaf62146b4ff2 100644 --- a/google/cloud/kms/v1/internal/autokey_tracing_stub.cc +++ b/google/cloud/kms/v1/internal/autokey_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AutokeyTracingStub::AutokeyTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -176,18 +177,14 @@ future AutokeyTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAutokeyTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/autokey_tracing_stub.h b/google/cloud/kms/v1/internal/autokey_tracing_stub.h index 8dff65aa5e343..31d3261f060f0 100644 --- a/google/cloud/kms/v1/internal/autokey_tracing_stub.h +++ b/google/cloud/kms/v1/internal/autokey_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AutokeyTracingStub : public AutokeyStub { public: ~AutokeyTracingStub() override = default; @@ -98,8 +99,6 @@ class AutokeyTracingStub : public AutokeyStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -114,4 +113,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_AUTOKEY_TRACING_STUB_H diff --git a/google/cloud/kms/v1/internal/ekm_auth_decorator.cc b/google/cloud/kms/v1/internal/ekm_auth_decorator.cc index d938658d47e21..dece1623b93b6 100644 --- a/google/cloud/kms/v1/internal/ekm_auth_decorator.cc +++ b/google/cloud/kms/v1/internal/ekm_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/kms/v1/ekm_service.proto #include "google/cloud/kms/v1/internal/ekm_auth_decorator.h" -#include +#include "google/cloud/kms/v1/ekm_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -146,3 +149,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/ekm_auth_decorator.h b/google/cloud/kms/v1/internal/ekm_auth_decorator.h index b2b46fbc4eb03..5ec174fcfd02e 100644 --- a/google/cloud/kms/v1/internal/ekm_auth_decorator.h +++ b/google/cloud/kms/v1/internal/ekm_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_EKM_AUTH_DECORATOR_H diff --git a/google/cloud/kms/v1/internal/ekm_logging_decorator.cc b/google/cloud/kms/v1/internal/ekm_logging_decorator.cc index 43b35baad20ac..505b86bc70c56 100644 --- a/google/cloud/kms/v1/internal/ekm_logging_decorator.cc +++ b/google/cloud/kms/v1/internal/ekm_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/kms/v1/ekm_service.proto #include "google/cloud/kms/v1/internal/ekm_logging_decorator.h" +#include "google/cloud/kms/v1/ekm_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -191,3 +194,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/ekm_logging_decorator.h b/google/cloud/kms/v1/internal/ekm_logging_decorator.h index 6bb2dade995f9..4492dbae26cd2 100644 --- a/google/cloud/kms/v1/internal/ekm_logging_decorator.h +++ b/google/cloud/kms/v1/internal/ekm_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_EKM_LOGGING_DECORATOR_H diff --git a/google/cloud/kms/v1/internal/ekm_metadata_decorator.cc b/google/cloud/kms/v1/internal/ekm_metadata_decorator.cc index 1816c2a1091f2..5de8d3d7add9e 100644 --- a/google/cloud/kms/v1/internal/ekm_metadata_decorator.cc +++ b/google/cloud/kms/v1/internal/ekm_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/kms/v1/ekm_service.proto #include "google/cloud/kms/v1/internal/ekm_metadata_decorator.h" +#include "google/cloud/kms/v1/ekm_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 kms_v1_internal { @@ -178,3 +182,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/ekm_metadata_decorator.h b/google/cloud/kms/v1/internal/ekm_metadata_decorator.h index 7960f7f782e43..b642a4eb416ee 100644 --- a/google/cloud/kms/v1/internal/ekm_metadata_decorator.h +++ b/google/cloud/kms/v1/internal/ekm_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_EKM_METADATA_DECORATOR_H diff --git a/google/cloud/kms/v1/internal/ekm_option_defaults.cc b/google/cloud/kms/v1/internal/ekm_option_defaults.cc index b4a3c3e4cd1b8..ea89c5a764565 100644 --- a/google/cloud/kms/v1/internal/ekm_option_defaults.cc +++ b/google/cloud/kms/v1/internal/ekm_option_defaults.cc @@ -40,7 +40,7 @@ Options EkmServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - kms_v1::EkmServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + kms_v1::EkmServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/kms/v1/internal/ekm_stub.cc b/google/cloud/kms/v1/internal/ekm_stub.cc index 1d887b62d66a5..506dd2dff783b 100644 --- a/google/cloud/kms/v1/internal/ekm_stub.cc +++ b/google/cloud/kms/v1/internal/ekm_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/kms/v1/ekm_service.proto #include "google/cloud/kms/v1/internal/ekm_stub.h" +#include "google/cloud/kms/v1/ekm_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -186,3 +189,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/ekm_stub.h b/google/cloud/kms/v1/internal/ekm_stub.h index 77a341dac70e0..6e80a2d1e64ba 100644 --- a/google/cloud/kms/v1/internal/ekm_stub.h +++ b/google/cloud/kms/v1/internal/ekm_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_EKM_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_EKM_STUB_H +#include "google/cloud/kms/v1/ekm_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 -#include -#include -#include +#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 kms_v1_internal { @@ -180,4 +183,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_EKM_STUB_H diff --git a/google/cloud/kms/v1/internal/ekm_stub_factory.cc b/google/cloud/kms/v1/internal/ekm_stub_factory.cc index 3ec23155be229..676c36316121c 100644 --- a/google/cloud/kms/v1/internal/ekm_stub_factory.cc +++ b/google/cloud/kms/v1/internal/ekm_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/kms/v1/ekm_service.proto #include "google/cloud/kms/v1/internal/ekm_stub_factory.h" +#include "google/cloud/kms/v1/ekm_service.grpc.pb.h" #include "google/cloud/kms/v1/internal/ekm_auth_decorator.h" #include "google/cloud/kms/v1/internal/ekm_logging_decorator.h" #include "google/cloud/kms/v1/internal/ekm_metadata_decorator.h" #include "google/cloud/kms/v1/internal/ekm_stub.h" #include "google/cloud/kms/v1/internal/ekm_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 -#include -#include -#include +#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 kms_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/ekm_stub_factory.h b/google/cloud/kms/v1/internal/ekm_stub_factory.h index 3d4e0dfb7abcd..eb67e72819e19 100644 --- a/google/cloud/kms/v1/internal/ekm_stub_factory.h +++ b/google/cloud/kms/v1/internal/ekm_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_EKM_STUB_FACTORY_H diff --git a/google/cloud/kms/v1/internal/ekm_tracing_connection.cc b/google/cloud/kms/v1/internal/ekm_tracing_connection.cc index 086e949b03ce3..7e741378d017a 100644 --- a/google/cloud/kms/v1/internal/ekm_tracing_connection.cc +++ b/google/cloud/kms/v1/internal/ekm_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EkmServiceTracingConnection::EkmServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -146,15 +144,11 @@ EkmServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEkmServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/kms/v1/internal/ekm_tracing_connection.h b/google/cloud/kms/v1/internal/ekm_tracing_connection.h index 62d761d8fc37f..5c45cd0384553 100644 --- a/google/cloud/kms/v1/internal/ekm_tracing_connection.h +++ b/google/cloud/kms/v1/internal/ekm_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EkmServiceTracingConnection : public kms_v1::EkmServiceConnection { public: ~EkmServiceTracingConnection() override = default; @@ -85,8 +83,6 @@ class EkmServiceTracingConnection : public kms_v1::EkmServiceConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/kms/v1/internal/ekm_tracing_stub.cc b/google/cloud/kms/v1/internal/ekm_tracing_stub.cc index 61421ad64ff3c..02663eda8e3da 100644 --- a/google/cloud/kms/v1/internal/ekm_tracing_stub.cc +++ b/google/cloud/kms/v1/internal/ekm_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EkmServiceTracingStub::EkmServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -183,18 +184,14 @@ StatusOr EkmServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEkmServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/ekm_tracing_stub.h b/google/cloud/kms/v1/internal/ekm_tracing_stub.h index 69ed85e476074..8e7531072da15 100644 --- a/google/cloud/kms/v1/internal/ekm_tracing_stub.h +++ b/google/cloud/kms/v1/internal/ekm_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EkmServiceTracingStub : public EkmServiceStub { public: ~EkmServiceTracingStub() override = default; @@ -100,8 +101,6 @@ class EkmServiceTracingStub : public EkmServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -116,4 +115,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_EKM_TRACING_STUB_H diff --git a/google/cloud/kms/v1/internal/key_management_auth_decorator.cc b/google/cloud/kms/v1/internal/key_management_auth_decorator.cc index cdbc5dff588fa..e00a761fad5a0 100644 --- a/google/cloud/kms/v1/internal/key_management_auth_decorator.cc +++ b/google/cloud/kms/v1/internal/key_management_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/kms/v1/service.proto #include "google/cloud/kms/v1/internal/key_management_auth_decorator.h" -#include +#include "google/cloud/kms/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -67,6 +70,15 @@ KeyManagementServiceAuth::ListImportJobs( return child_->ListImportJobs(context, options, request); } +StatusOr +KeyManagementServiceAuth::ListRetiredResources( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::ListRetiredResourcesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListRetiredResources(context, options, request); +} + StatusOr KeyManagementServiceAuth::GetKeyRing( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::GetKeyRingRequest const& request) { @@ -111,6 +123,15 @@ KeyManagementServiceAuth::GetImportJob( return child_->GetImportJob(context, options, request); } +StatusOr +KeyManagementServiceAuth::GetRetiredResource( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::GetRetiredResourceRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetRetiredResource(context, options, request); +} + StatusOr KeyManagementServiceAuth::CreateKeyRing( grpc::ClientContext& context, Options const& options, @@ -138,6 +159,64 @@ KeyManagementServiceAuth::CreateCryptoKeyVersion( return child_->CreateCryptoKeyVersion(context, options, request); } +future> +KeyManagementServiceAuth::AsyncDeleteCryptoKey( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyRequest 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->AsyncDeleteCryptoKey(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +KeyManagementServiceAuth::DeleteCryptoKey( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteCryptoKey(context, options, request); +} + +future> +KeyManagementServiceAuth::AsyncDeleteCryptoKeyVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest 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->AsyncDeleteCryptoKeyVersion(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +KeyManagementServiceAuth::DeleteCryptoKeyVersion( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteCryptoKeyVersion(context, options, request); +} + StatusOr KeyManagementServiceAuth::ImportCryptoKeyVersion( grpc::ClientContext& context, Options const& options, @@ -343,7 +422,45 @@ StatusOr KeyManagementServiceAuth::GetOperation( return child_->GetOperation(context, options, request); } +future> +KeyManagementServiceAuth::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 KeyManagementServiceAuth::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 kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/key_management_auth_decorator.h b/google/cloud/kms/v1/internal/key_management_auth_decorator.h index a2161f078f249..8f31d31a829a4 100644 --- a/google/cloud/kms/v1/internal/key_management_auth_decorator.h +++ b/google/cloud/kms/v1/internal/key_management_auth_decorator.h @@ -22,10 +22,14 @@ #include "google/cloud/kms/v1/internal/key_management_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 kms_v1_internal { @@ -56,6 +60,12 @@ class KeyManagementServiceAuth : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::ListImportJobsRequest const& request) override; + StatusOr + ListRetiredResources( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::ListRetiredResourcesRequest const& request) + override; + StatusOr GetKeyRing( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::GetKeyRingRequest const& request) override; @@ -77,6 +87,11 @@ class KeyManagementServiceAuth : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::GetImportJobRequest const& request) override; + StatusOr GetRetiredResource( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::GetRetiredResourceRequest const& request) + override; + StatusOr CreateKeyRing( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::CreateKeyRingRequest const& request) override; @@ -90,6 +105,28 @@ class KeyManagementServiceAuth : public KeyManagementServiceStub { google::cloud::kms::v1::CreateCryptoKeyVersionRequest const& request) override; + future> AsyncDeleteCryptoKey( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) override; + + StatusOr DeleteCryptoKey( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) override; + + future> AsyncDeleteCryptoKeyVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) + override; + + StatusOr DeleteCryptoKeyVersion( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) + override; + StatusOr ImportCryptoKeyVersion( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::ImportCryptoKeyVersionRequest const& request) @@ -188,6 +225,18 @@ class KeyManagementServiceAuth : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::longrunning::GetOperationRequest 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_; @@ -198,4 +247,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_KEY_MANAGEMENT_AUTH_DECORATOR_H diff --git a/google/cloud/kms/v1/internal/key_management_connection_impl.cc b/google/cloud/kms/v1/internal/key_management_connection_impl.cc index d343865be2b92..c47d22c7096d7 100644 --- a/google/cloud/kms/v1/internal/key_management_connection_impl.cc +++ b/google/cloud/kms/v1/internal/key_management_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 @@ -49,6 +50,11 @@ idempotency_policy(Options const& options) { ->clone(); } +std::unique_ptr polling_policy(Options const& options) { + return options.get() + ->clone(); +} + } // namespace KeyManagementServiceConnectionImpl::KeyManagementServiceConnectionImpl( @@ -196,6 +202,41 @@ KeyManagementServiceConnectionImpl::ListImportJobs( }); } +StreamRange +KeyManagementServiceConnectionImpl::ListRetiredResources( + google::cloud::kms::v1::ListRetiredResourcesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListRetiredResources(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::kms::v1::ListRetiredResourcesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::ListRetiredResourcesRequest const& + request) { + return stub->ListRetiredResources(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::kms::v1::ListRetiredResourcesResponse r) { + std::vector result( + r.retired_resources().size()); + auto& messages = *r.mutable_retired_resources(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + StatusOr KeyManagementServiceConnectionImpl::GetKeyRing( google::cloud::kms::v1::GetKeyRingRequest const& request) { @@ -267,6 +308,20 @@ KeyManagementServiceConnectionImpl::GetImportJob( *current, request, __func__); } +StatusOr +KeyManagementServiceConnectionImpl::GetRetiredResource( + google::cloud::kms::v1::GetRetiredResourceRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetRetiredResource(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::GetRetiredResourceRequest const& request) { + return stub_->GetRetiredResource(context, options, request); + }, + *current, request, __func__); +} + StatusOr KeyManagementServiceConnectionImpl::CreateKeyRing( google::cloud::kms::v1::CreateKeyRingRequest const& request) { @@ -310,6 +365,190 @@ KeyManagementServiceConnectionImpl::CreateCryptoKeyVersion( *current, request, __func__); } +future> +KeyManagementServiceConnectionImpl::DeleteCryptoKey( + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteCryptoKey(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::kms::v1::DeleteCryptoKeyMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + return stub->AsyncDeleteCryptoKey(cq, 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::kms::v1::DeleteCryptoKeyMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +KeyManagementServiceConnectionImpl::DeleteCryptoKey( + NoAwaitTag, google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteCryptoKey(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + return stub_->DeleteCryptoKey(context, options, request); + }, + *current, request, __func__); +} + +future> +KeyManagementServiceConnectionImpl::DeleteCryptoKey( + 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 DeleteCryptoKey", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::kms::v1::DeleteCryptoKeyMetadata>( + 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::kms::v1::DeleteCryptoKeyMetadata>, + polling_policy(*current), __func__); +} + +future> +KeyManagementServiceConnectionImpl::DeleteCryptoKeyVersion( + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteCryptoKeyVersion(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::kms::v1::DeleteCryptoKeyVersionMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& + request) { + return stub->AsyncDeleteCryptoKeyVersion(cq, 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::kms::v1::DeleteCryptoKeyVersionMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +KeyManagementServiceConnectionImpl::DeleteCryptoKeyVersion( + NoAwaitTag, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteCryptoKeyVersion(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& + request) { + return stub_->DeleteCryptoKeyVersion(context, options, request); + }, + *current, request, __func__); +} + +future> +KeyManagementServiceConnectionImpl::DeleteCryptoKeyVersion( + 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 DeleteCryptoKeyVersion", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::kms::v1::DeleteCryptoKeyVersionMetadata>( + 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::kms::v1::DeleteCryptoKeyVersionMetadata>, + polling_policy(*current), __func__); +} + StatusOr KeyManagementServiceConnectionImpl::ImportCryptoKeyVersion( google::cloud::kms::v1::ImportCryptoKeyVersionRequest const& request) { diff --git a/google/cloud/kms/v1/internal/key_management_connection_impl.h b/google/cloud/kms/v1/internal/key_management_connection_impl.h index f540d02965b5e..277d0aa35f966 100644 --- a/google/cloud/kms/v1/internal/key_management_connection_impl.h +++ b/google/cloud/kms/v1/internal/key_management_connection_impl.h @@ -26,10 +26,13 @@ #include "google/cloud/kms/v1/key_management_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 { @@ -61,6 +64,9 @@ class KeyManagementServiceConnectionImpl StreamRange ListImportJobs( google::cloud::kms::v1::ListImportJobsRequest request) override; + StreamRange ListRetiredResources( + google::cloud::kms::v1::ListRetiredResourcesRequest request) override; + StatusOr GetKeyRing( google::cloud::kms::v1::GetKeyRingRequest const& request) override; @@ -77,6 +83,10 @@ class KeyManagementServiceConnectionImpl StatusOr GetImportJob( google::cloud::kms::v1::GetImportJobRequest const& request) override; + StatusOr GetRetiredResource( + google::cloud::kms::v1::GetRetiredResourceRequest const& request) + override; + StatusOr CreateKeyRing( google::cloud::kms::v1::CreateKeyRingRequest const& request) override; @@ -87,6 +97,31 @@ class KeyManagementServiceConnectionImpl google::cloud::kms::v1::CreateCryptoKeyVersionRequest const& request) override; + future> + DeleteCryptoKey( + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) override; + + StatusOr DeleteCryptoKey( + NoAwaitTag, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) override; + + future> + DeleteCryptoKey(google::longrunning::Operation const& operation) override; + + future> + DeleteCryptoKeyVersion( + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) + override; + + StatusOr DeleteCryptoKeyVersion( + NoAwaitTag, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) + override; + + future> + DeleteCryptoKeyVersion( + google::longrunning::Operation const& operation) override; + StatusOr ImportCryptoKeyVersion( google::cloud::kms::v1::ImportCryptoKeyVersionRequest const& request) override; diff --git a/google/cloud/kms/v1/internal/key_management_logging_decorator.cc b/google/cloud/kms/v1/internal/key_management_logging_decorator.cc index 6a814ab374e46..ebe258da55d9c 100644 --- a/google/cloud/kms/v1/internal/key_management_logging_decorator.cc +++ b/google/cloud/kms/v1/internal/key_management_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/kms/v1/service.proto #include "google/cloud/kms/v1/internal/key_management_logging_decorator.h" +#include "google/cloud/kms/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -84,6 +87,19 @@ KeyManagementServiceLogging::ListImportJobs( context, options, request, __func__, tracing_options_); } +StatusOr +KeyManagementServiceLogging::ListRetiredResources( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::ListRetiredResourcesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::ListRetiredResourcesRequest const& request) { + return child_->ListRetiredResources(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr KeyManagementServiceLogging::GetKeyRing( grpc::ClientContext& context, Options const& options, @@ -145,6 +161,18 @@ KeyManagementServiceLogging::GetImportJob( context, options, request, __func__, tracing_options_); } +StatusOr +KeyManagementServiceLogging::GetRetiredResource( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::GetRetiredResourceRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::GetRetiredResourceRequest const& request) { + return child_->GetRetiredResource(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr KeyManagementServiceLogging::CreateKeyRing( grpc::ClientContext& context, Options const& options, @@ -182,6 +210,68 @@ KeyManagementServiceLogging::CreateCryptoKeyVersion( context, options, request, __func__, tracing_options_); } +future> +KeyManagementServiceLogging::AsyncDeleteCryptoKey( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + return child_->AsyncDeleteCryptoKey(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +KeyManagementServiceLogging::DeleteCryptoKey( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + return child_->DeleteCryptoKey(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +KeyManagementServiceLogging::AsyncDeleteCryptoKeyVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& + request) { + return child_->AsyncDeleteCryptoKeyVersion(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +KeyManagementServiceLogging::DeleteCryptoKeyVersion( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& + request) { + return child_->DeleteCryptoKeyVersion(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr KeyManagementServiceLogging::ImportCryptoKeyVersion( grpc::ClientContext& context, Options const& options, @@ -463,7 +553,44 @@ KeyManagementServiceLogging::GetOperation( context, options, request, __func__, tracing_options_); } +future> +KeyManagementServiceLogging::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 KeyManagementServiceLogging::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 kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/key_management_logging_decorator.h b/google/cloud/kms/v1/internal/key_management_logging_decorator.h index faa68abc23b76..f0c70c638eb45 100644 --- a/google/cloud/kms/v1/internal/key_management_logging_decorator.h +++ b/google/cloud/kms/v1/internal/key_management_logging_decorator.h @@ -22,10 +22,14 @@ #include "google/cloud/kms/v1/internal/key_management_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 kms_v1_internal { @@ -56,6 +60,12 @@ class KeyManagementServiceLogging : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::ListImportJobsRequest const& request) override; + StatusOr + ListRetiredResources( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::ListRetiredResourcesRequest const& request) + override; + StatusOr GetKeyRing( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::GetKeyRingRequest const& request) override; @@ -77,6 +87,11 @@ class KeyManagementServiceLogging : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::GetImportJobRequest const& request) override; + StatusOr GetRetiredResource( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::GetRetiredResourceRequest const& request) + override; + StatusOr CreateKeyRing( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::CreateKeyRingRequest const& request) override; @@ -90,6 +105,28 @@ class KeyManagementServiceLogging : public KeyManagementServiceStub { google::cloud::kms::v1::CreateCryptoKeyVersionRequest const& request) override; + future> AsyncDeleteCryptoKey( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) override; + + StatusOr DeleteCryptoKey( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) override; + + future> AsyncDeleteCryptoKeyVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) + override; + + StatusOr DeleteCryptoKeyVersion( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) + override; + StatusOr ImportCryptoKeyVersion( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::ImportCryptoKeyVersionRequest const& request) @@ -188,6 +225,18 @@ class KeyManagementServiceLogging : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::longrunning::GetOperationRequest 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_; @@ -198,4 +247,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_KEY_MANAGEMENT_LOGGING_DECORATOR_H diff --git a/google/cloud/kms/v1/internal/key_management_metadata_decorator.cc b/google/cloud/kms/v1/internal/key_management_metadata_decorator.cc index 2e44f20f04df2..abb6185125c6c 100644 --- a/google/cloud/kms/v1/internal/key_management_metadata_decorator.cc +++ b/google/cloud/kms/v1/internal/key_management_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/kms/v1/service.proto #include "google/cloud/kms/v1/internal/key_management_metadata_decorator.h" +#include "google/cloud/kms/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 kms_v1_internal { @@ -80,6 +84,15 @@ KeyManagementServiceMetadata::ListImportJobs( return child_->ListImportJobs(context, options, request); } +StatusOr +KeyManagementServiceMetadata::ListRetiredResources( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::ListRetiredResourcesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListRetiredResources(context, options, request); +} + StatusOr KeyManagementServiceMetadata::GetKeyRing( grpc::ClientContext& context, Options const& options, @@ -125,6 +138,15 @@ KeyManagementServiceMetadata::GetImportJob( return child_->GetImportJob(context, options, request); } +StatusOr +KeyManagementServiceMetadata::GetRetiredResource( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::GetRetiredResourceRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetRetiredResource(context, options, request); +} + StatusOr KeyManagementServiceMetadata::CreateKeyRing( grpc::ClientContext& context, Options const& options, @@ -152,6 +174,48 @@ KeyManagementServiceMetadata::CreateCryptoKeyVersion( return child_->CreateCryptoKeyVersion(context, options, request); } +future> +KeyManagementServiceMetadata::AsyncDeleteCryptoKey( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteCryptoKey(cq, std::move(context), + std::move(options), request); +} + +StatusOr +KeyManagementServiceMetadata::DeleteCryptoKey( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteCryptoKey(context, options, request); +} + +future> +KeyManagementServiceMetadata::AsyncDeleteCryptoKeyVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteCryptoKeyVersion(cq, std::move(context), + std::move(options), request); +} + +StatusOr +KeyManagementServiceMetadata::DeleteCryptoKeyVersion( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteCryptoKeyVersion(context, options, request); +} + StatusOr KeyManagementServiceMetadata::ImportCryptoKeyVersion( grpc::ClientContext& context, Options const& options, @@ -365,6 +429,29 @@ KeyManagementServiceMetadata::GetOperation( return child_->GetOperation(context, options, request); } +future> +KeyManagementServiceMetadata::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 KeyManagementServiceMetadata::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 KeyManagementServiceMetadata::SetMetadata( grpc::ClientContext& context, Options const& options, std::string const& request_params) { @@ -382,3 +469,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/key_management_metadata_decorator.h b/google/cloud/kms/v1/internal/key_management_metadata_decorator.h index 8db9c1c6a3d0d..18aa6950c33d1 100644 --- a/google/cloud/kms/v1/internal/key_management_metadata_decorator.h +++ b/google/cloud/kms/v1/internal/key_management_metadata_decorator.h @@ -22,10 +22,14 @@ #include "google/cloud/kms/v1/internal/key_management_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 kms_v1_internal { @@ -57,6 +61,12 @@ class KeyManagementServiceMetadata : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::ListImportJobsRequest const& request) override; + StatusOr + ListRetiredResources( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::ListRetiredResourcesRequest const& request) + override; + StatusOr GetKeyRing( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::GetKeyRingRequest const& request) override; @@ -78,6 +88,11 @@ class KeyManagementServiceMetadata : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::GetImportJobRequest const& request) override; + StatusOr GetRetiredResource( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::GetRetiredResourceRequest const& request) + override; + StatusOr CreateKeyRing( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::CreateKeyRingRequest const& request) override; @@ -91,6 +106,28 @@ class KeyManagementServiceMetadata : public KeyManagementServiceStub { google::cloud::kms::v1::CreateCryptoKeyVersionRequest const& request) override; + future> AsyncDeleteCryptoKey( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) override; + + StatusOr DeleteCryptoKey( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) override; + + future> AsyncDeleteCryptoKeyVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) + override; + + StatusOr DeleteCryptoKeyVersion( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) + override; + StatusOr ImportCryptoKeyVersion( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::ImportCryptoKeyVersionRequest const& request) @@ -189,6 +226,18 @@ class KeyManagementServiceMetadata : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::longrunning::GetOperationRequest 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); @@ -204,4 +253,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_KEY_MANAGEMENT_METADATA_DECORATOR_H diff --git a/google/cloud/kms/v1/internal/key_management_option_defaults.cc b/google/cloud/kms/v1/internal/key_management_option_defaults.cc index 1e7e12cff6fb1..4b166b6804510 100644 --- a/google/cloud/kms/v1/internal/key_management_option_defaults.cc +++ b/google/cloud/kms/v1/internal/key_management_option_defaults.cc @@ -42,7 +42,7 @@ Options KeyManagementServiceDefaultOptions(Options options) { if (!options.has()) { options.set( kms_v1::KeyManagementServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { @@ -52,6 +52,18 @@ Options KeyManagementServiceDefaultOptions(Options options) { std::chrono::minutes(5), kBackoffScaling, kBackoffScaling) .clone()); } + if (!options.has()) { + options.set( + GenericPollingPolicy< + kms_v1::KeyManagementServiceRetryPolicyOption::Type, + kms_v1::KeyManagementServiceBackoffPolicyOption::Type>( + options.get() + ->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } if (!options.has< kms_v1::KeyManagementServiceConnectionIdempotencyPolicyOption>()) { options.set( diff --git a/google/cloud/kms/v1/internal/key_management_stub.cc b/google/cloud/kms/v1/internal/key_management_stub.cc index c9db9fdbd7318..f33d3ba985070 100644 --- a/google/cloud/kms/v1/internal/key_management_stub.cc +++ b/google/cloud/kms/v1/internal/key_management_stub.cc @@ -17,12 +17,16 @@ // source: google/cloud/kms/v1/service.proto #include "google/cloud/kms/v1/internal/key_management_stub.h" +#include "google/cloud/kms/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -78,6 +82,18 @@ DefaultKeyManagementServiceStub::ListImportJobs( return response; } +StatusOr +DefaultKeyManagementServiceStub::ListRetiredResources( + grpc::ClientContext& context, Options const&, + google::cloud::kms::v1::ListRetiredResourcesRequest const& request) { + google::cloud::kms::v1::ListRetiredResourcesResponse response; + auto status = grpc_stub_->ListRetiredResources(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultKeyManagementServiceStub::GetKeyRing( grpc::ClientContext& context, Options const&, @@ -138,6 +154,18 @@ DefaultKeyManagementServiceStub::GetImportJob( return response; } +StatusOr +DefaultKeyManagementServiceStub::GetRetiredResource( + grpc::ClientContext& context, Options const&, + google::cloud::kms::v1::GetRetiredResourceRequest const& request) { + google::cloud::kms::v1::RetiredResource response; + auto status = grpc_stub_->GetRetiredResource(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultKeyManagementServiceStub::CreateKeyRing( grpc::ClientContext& context, Options const&, @@ -175,6 +203,68 @@ DefaultKeyManagementServiceStub::CreateCryptoKeyVersion( return response; } +future> +DefaultKeyManagementServiceStub::AsyncDeleteCryptoKey( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::kms::v1::DeleteCryptoKeyRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteCryptoKey(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultKeyManagementServiceStub::DeleteCryptoKey( + grpc::ClientContext& context, Options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteCryptoKey(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultKeyManagementServiceStub::AsyncDeleteCryptoKeyVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteCryptoKeyVersion(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultKeyManagementServiceStub::DeleteCryptoKeyVersion( + grpc::ClientContext& context, Options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->DeleteCryptoKeyVersion(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultKeyManagementServiceStub::ImportCryptoKeyVersion( grpc::ClientContext& context, Options const&, @@ -456,7 +546,48 @@ DefaultKeyManagementServiceStub::GetOperation( return response; } +future> +DefaultKeyManagementServiceStub::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 DefaultKeyManagementServiceStub::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 kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/key_management_stub.h b/google/cloud/kms/v1/internal/key_management_stub.h index 0bf8b1bb03f0b..e609f9cafac7f 100644 --- a/google/cloud/kms/v1/internal/key_management_stub.h +++ b/google/cloud/kms/v1/internal/key_management_stub.h @@ -19,16 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_KEY_MANAGEMENT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_KEY_MANAGEMENT_STUB_H +#include "google/cloud/kms/v1/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 -#include -#include -#include +#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 kms_v1_internal { @@ -57,6 +62,11 @@ class KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::ListImportJobsRequest const& request) = 0; + virtual StatusOr + ListRetiredResources( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::ListRetiredResourcesRequest const& request) = 0; + virtual StatusOr GetKeyRing( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::GetKeyRingRequest const& request) = 0; @@ -78,6 +88,10 @@ class KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::GetImportJobRequest const& request) = 0; + virtual StatusOr GetRetiredResource( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::GetRetiredResourceRequest const& request) = 0; + virtual StatusOr CreateKeyRing( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::CreateKeyRingRequest const& request) = 0; @@ -91,6 +105,27 @@ class KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::CreateCryptoKeyVersionRequest const& request) = 0; + virtual future> AsyncDeleteCryptoKey( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) = 0; + + virtual StatusOr DeleteCryptoKey( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) = 0; + + virtual future> + AsyncDeleteCryptoKeyVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) = 0; + + virtual StatusOr DeleteCryptoKeyVersion( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) = 0; + virtual StatusOr ImportCryptoKeyVersion( grpc::ClientContext& context, Options const& options, @@ -195,23 +230,35 @@ class KeyManagementServiceStub { virtual StatusOr GetOperation( grpc::ClientContext& context, Options const& options, google::longrunning::GetOperationRequest 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 DefaultKeyManagementServiceStub : public KeyManagementServiceStub { public: - explicit DefaultKeyManagementServiceStub( + DefaultKeyManagementServiceStub( std::unique_ptr< google::cloud::kms::v1::KeyManagementService::StubInterface> grpc_stub, - std::unique_ptr - operations_stub, std::unique_ptr iampolicy_stub, std::unique_ptr - locations_stub) + locations_stub, + std::unique_ptr + operations_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)) {} + locations_stub_(std::move(locations_stub)), + operations_stub_(std::move(operations_stub)) {} StatusOr ListKeyRings( grpc::ClientContext& context, Options const& options, @@ -231,6 +278,12 @@ class DefaultKeyManagementServiceStub : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::ListImportJobsRequest const& request) override; + StatusOr + ListRetiredResources( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::ListRetiredResourcesRequest const& request) + override; + StatusOr GetKeyRing( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::GetKeyRingRequest const& request) override; @@ -252,6 +305,11 @@ class DefaultKeyManagementServiceStub : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::GetImportJobRequest const& request) override; + StatusOr GetRetiredResource( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::GetRetiredResourceRequest const& request) + override; + StatusOr CreateKeyRing( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::CreateKeyRingRequest const& request) override; @@ -265,6 +323,28 @@ class DefaultKeyManagementServiceStub : public KeyManagementServiceStub { google::cloud::kms::v1::CreateCryptoKeyVersionRequest const& request) override; + future> AsyncDeleteCryptoKey( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) override; + + StatusOr DeleteCryptoKey( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) override; + + future> AsyncDeleteCryptoKeyVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) + override; + + StatusOr DeleteCryptoKeyVersion( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) + override; + StatusOr ImportCryptoKeyVersion( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::ImportCryptoKeyVersionRequest const& request) @@ -363,14 +443,26 @@ class DefaultKeyManagementServiceStub : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::longrunning::GetOperationRequest 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 - operations_stub_; std::unique_ptr iampolicy_stub_; std::unique_ptr locations_stub_; + std::unique_ptr + operations_stub_; }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END @@ -378,4 +470,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_KEY_MANAGEMENT_STUB_H diff --git a/google/cloud/kms/v1/internal/key_management_stub_factory.cc b/google/cloud/kms/v1/internal/key_management_stub_factory.cc index a83adfd1774de..67a06e50aa941 100644 --- a/google/cloud/kms/v1/internal/key_management_stub_factory.cc +++ b/google/cloud/kms/v1/internal/key_management_stub_factory.cc @@ -22,19 +22,22 @@ #include "google/cloud/kms/v1/internal/key_management_metadata_decorator.h" #include "google/cloud/kms/v1/internal/key_management_stub.h" #include "google/cloud/kms/v1/internal/key_management_tracing_stub.h" +#include "google/cloud/kms/v1/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 -#include -#include -#include +#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 kms_v1_internal { @@ -47,15 +50,14 @@ std::shared_ptr CreateDefaultKeyManagementServiceStub( internal::MakeChannelArguments(options)); auto service_grpc_stub = google::cloud::kms::v1::KeyManagementService::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_iampolicy_stub), std::move(service_locations_stub)); + 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), @@ -79,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/key_management_stub_factory.h b/google/cloud/kms/v1/internal/key_management_stub_factory.h index 25eba2677959d..ec91f021e7084 100644 --- a/google/cloud/kms/v1/internal/key_management_stub_factory.h +++ b/google/cloud/kms/v1/internal/key_management_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_KEY_MANAGEMENT_STUB_FACTORY_H diff --git a/google/cloud/kms/v1/internal/key_management_tracing_connection.cc b/google/cloud/kms/v1/internal/key_management_tracing_connection.cc index 6ae03e76d4868..10b86de704541 100644 --- a/google/cloud/kms/v1/internal/key_management_tracing_connection.cc +++ b/google/cloud/kms/v1/internal/key_management_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - KeyManagementServiceTracingConnection::KeyManagementServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -77,6 +75,17 @@ KeyManagementServiceTracingConnection::ListImportJobs( std::move(span), std::move(sr)); } +StreamRange +KeyManagementServiceTracingConnection::ListRetiredResources( + google::cloud::kms::v1::ListRetiredResourcesRequest request) { + auto span = internal::MakeSpan( + "kms_v1::KeyManagementServiceConnection::ListRetiredResources"); + internal::OTelScope scope(span); + auto sr = child_->ListRetiredResources(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::kms::v1::RetiredResource>(std::move(span), std::move(sr)); +} + StatusOr KeyManagementServiceTracingConnection::GetKeyRing( google::cloud::kms::v1::GetKeyRingRequest const& request) { @@ -122,6 +131,15 @@ KeyManagementServiceTracingConnection::GetImportJob( return internal::EndSpan(*span, child_->GetImportJob(request)); } +StatusOr +KeyManagementServiceTracingConnection::GetRetiredResource( + google::cloud::kms::v1::GetRetiredResourceRequest const& request) { + auto span = internal::MakeSpan( + "kms_v1::KeyManagementServiceConnection::GetRetiredResource"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetRetiredResource(request)); +} + StatusOr KeyManagementServiceTracingConnection::CreateKeyRing( google::cloud::kms::v1::CreateKeyRingRequest const& request) { @@ -149,6 +167,65 @@ KeyManagementServiceTracingConnection::CreateCryptoKeyVersion( return internal::EndSpan(*span, child_->CreateCryptoKeyVersion(request)); } +future> +KeyManagementServiceTracingConnection::DeleteCryptoKey( + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + auto span = internal::MakeSpan( + "kms_v1::KeyManagementServiceConnection::DeleteCryptoKey"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteCryptoKey(request)); +} + +StatusOr +KeyManagementServiceTracingConnection::DeleteCryptoKey( + NoAwaitTag, google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + auto span = internal::MakeSpan( + "kms_v1::KeyManagementServiceConnection::DeleteCryptoKey"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteCryptoKey(NoAwaitTag{}, request)); +} + +future> +KeyManagementServiceTracingConnection::DeleteCryptoKey( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "kms_v1::KeyManagementServiceConnection::DeleteCryptoKey"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteCryptoKey(operation)); +} + +future> +KeyManagementServiceTracingConnection::DeleteCryptoKeyVersion( + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) { + auto span = internal::MakeSpan( + "kms_v1::KeyManagementServiceConnection::DeleteCryptoKeyVersion"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteCryptoKeyVersion(request)); +} + +StatusOr +KeyManagementServiceTracingConnection::DeleteCryptoKeyVersion( + NoAwaitTag, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) { + auto span = internal::MakeSpan( + "kms_v1::KeyManagementServiceConnection::DeleteCryptoKeyVersion"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->DeleteCryptoKeyVersion(NoAwaitTag{}, request)); +} + +future> +KeyManagementServiceTracingConnection::DeleteCryptoKeyVersion( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "kms_v1::KeyManagementServiceConnection::DeleteCryptoKeyVersion"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteCryptoKeyVersion(operation)); +} + StatusOr KeyManagementServiceTracingConnection::ImportCryptoKeyVersion( google::cloud::kms::v1::ImportCryptoKeyVersionRequest const& request) { @@ -360,17 +437,13 @@ KeyManagementServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeKeyManagementServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/kms/v1/internal/key_management_tracing_connection.h b/google/cloud/kms/v1/internal/key_management_tracing_connection.h index 43ebaafa498f9..cf2e377953f7b 100644 --- a/google/cloud/kms/v1/internal/key_management_tracing_connection.h +++ b/google/cloud/kms/v1/internal/key_management_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class KeyManagementServiceTracingConnection : public kms_v1::KeyManagementServiceConnection { public: @@ -52,6 +50,9 @@ class KeyManagementServiceTracingConnection StreamRange ListImportJobs( google::cloud::kms::v1::ListImportJobsRequest request) override; + StreamRange ListRetiredResources( + google::cloud::kms::v1::ListRetiredResourcesRequest request) override; + StatusOr GetKeyRing( google::cloud::kms::v1::GetKeyRingRequest const& request) override; @@ -68,6 +69,10 @@ class KeyManagementServiceTracingConnection StatusOr GetImportJob( google::cloud::kms::v1::GetImportJobRequest const& request) override; + StatusOr GetRetiredResource( + google::cloud::kms::v1::GetRetiredResourceRequest const& request) + override; + StatusOr CreateKeyRing( google::cloud::kms::v1::CreateKeyRingRequest const& request) override; @@ -78,6 +83,31 @@ class KeyManagementServiceTracingConnection google::cloud::kms::v1::CreateCryptoKeyVersionRequest const& request) override; + future> + DeleteCryptoKey( + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) override; + + StatusOr DeleteCryptoKey( + NoAwaitTag, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) override; + + future> + DeleteCryptoKey(google::longrunning::Operation const& operation) override; + + future> + DeleteCryptoKeyVersion( + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) + override; + + StatusOr DeleteCryptoKeyVersion( + NoAwaitTag, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) + override; + + future> + DeleteCryptoKeyVersion( + google::longrunning::Operation const& operation) override; + StatusOr ImportCryptoKeyVersion( google::cloud::kms::v1::ImportCryptoKeyVersionRequest const& request) override; @@ -157,8 +187,6 @@ class KeyManagementServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/kms/v1/internal/key_management_tracing_stub.cc b/google/cloud/kms/v1/internal/key_management_tracing_stub.cc index 1a76008c92ddf..9821ffd486d2b 100644 --- a/google/cloud/kms/v1/internal/key_management_tracing_stub.cc +++ b/google/cloud/kms/v1/internal/key_management_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - KeyManagementServiceTracingStub::KeyManagementServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -80,6 +81,18 @@ KeyManagementServiceTracingStub::ListImportJobs( child_->ListImportJobs(context, options, request)); } +StatusOr +KeyManagementServiceTracingStub::ListRetiredResources( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::ListRetiredResourcesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.kms.v1.KeyManagementService", + "ListRetiredResources"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListRetiredResources(context, options, request)); +} + StatusOr KeyManagementServiceTracingStub::GetKeyRing( grpc::ClientContext& context, Options const& options, @@ -140,6 +153,18 @@ KeyManagementServiceTracingStub::GetImportJob( child_->GetImportJob(context, options, request)); } +StatusOr +KeyManagementServiceTracingStub::GetRetiredResource( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::GetRetiredResourceRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.kms.v1.KeyManagementService", + "GetRetiredResource"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->GetRetiredResource(context, options, request)); +} + StatusOr KeyManagementServiceTracingStub::CreateKeyRing( grpc::ClientContext& context, Options const& options, @@ -177,6 +202,61 @@ KeyManagementServiceTracingStub::CreateCryptoKeyVersion( child_->CreateCryptoKeyVersion(context, options, request)); } +future> +KeyManagementServiceTracingStub::AsyncDeleteCryptoKey( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.kms.v1.KeyManagementService", + "DeleteCryptoKey"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteCryptoKey(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +KeyManagementServiceTracingStub::DeleteCryptoKey( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.kms.v1.KeyManagementService", + "DeleteCryptoKey"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteCryptoKey(context, options, request)); +} + +future> +KeyManagementServiceTracingStub::AsyncDeleteCryptoKeyVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.kms.v1.KeyManagementService", + "DeleteCryptoKeyVersion"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteCryptoKeyVersion(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +KeyManagementServiceTracingStub::DeleteCryptoKeyVersion( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.kms.v1.KeyManagementService", + "DeleteCryptoKeyVersion"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->DeleteCryptoKeyVersion(context, options, request)); +} + StatusOr KeyManagementServiceTracingStub::ImportCryptoKeyVersion( grpc::ClientContext& context, Options const& options, @@ -457,18 +537,42 @@ KeyManagementServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY +future> +KeyManagementServiceTracingStub::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 KeyManagementServiceTracingStub::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 MakeKeyManagementServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace kms_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/kms/v1/internal/key_management_tracing_stub.h b/google/cloud/kms/v1/internal/key_management_tracing_stub.h index 23d9df3e20855..373bd11a4af17 100644 --- a/google/cloud/kms/v1/internal/key_management_tracing_stub.h +++ b/google/cloud/kms/v1/internal/key_management_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace kms_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class KeyManagementServiceTracingStub : public KeyManagementServiceStub { public: ~KeyManagementServiceTracingStub() override = default; @@ -57,6 +58,12 @@ class KeyManagementServiceTracingStub : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::ListImportJobsRequest const& request) override; + StatusOr + ListRetiredResources( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::ListRetiredResourcesRequest const& request) + override; + StatusOr GetKeyRing( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::GetKeyRingRequest const& request) override; @@ -78,6 +85,11 @@ class KeyManagementServiceTracingStub : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::GetImportJobRequest const& request) override; + StatusOr GetRetiredResource( + grpc::ClientContext& context, Options const& options, + google::cloud::kms::v1::GetRetiredResourceRequest const& request) + override; + StatusOr CreateKeyRing( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::CreateKeyRingRequest const& request) override; @@ -91,6 +103,28 @@ class KeyManagementServiceTracingStub : public KeyManagementServiceStub { google::cloud::kms::v1::CreateCryptoKeyVersionRequest const& request) override; + future> AsyncDeleteCryptoKey( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) override; + + StatusOr DeleteCryptoKey( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request) override; + + future> AsyncDeleteCryptoKeyVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) + override; + + StatusOr DeleteCryptoKeyVersion( + grpc::ClientContext& context, Options options, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request) + override; + StatusOr ImportCryptoKeyVersion( grpc::ClientContext& context, Options const& options, google::cloud::kms::v1::ImportCryptoKeyVersionRequest const& request) @@ -189,14 +223,24 @@ class KeyManagementServiceTracingStub : public KeyManagementServiceStub { grpc::ClientContext& context, Options const& options, google::longrunning::GetOperationRequest const& request) override; + future> AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) override; + + future AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) override; + private: std::shared_ptr child_; std::shared_ptr propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -211,4 +255,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_INTERNAL_KEY_MANAGEMENT_TRACING_STUB_H diff --git a/google/cloud/kms/v1/key_management_client.cc b/google/cloud/kms/v1/key_management_client.cc index 9953665cfd552..2228b8b690aa2 100644 --- a/google/cloud/kms/v1/key_management_client.cc +++ b/google/cloud/kms/v1/key_management_client.cc @@ -97,6 +97,22 @@ KeyManagementServiceClient::ListImportJobs( return connection_->ListImportJobs(std::move(request)); } +StreamRange +KeyManagementServiceClient::ListRetiredResources(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::kms::v1::ListRetiredResourcesRequest request; + request.set_parent(parent); + return connection_->ListRetiredResources(request); +} + +StreamRange +KeyManagementServiceClient::ListRetiredResources( + google::cloud::kms::v1::ListRetiredResourcesRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListRetiredResources(std::move(request)); +} + StatusOr KeyManagementServiceClient::GetKeyRing(std::string const& name, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); @@ -177,6 +193,23 @@ KeyManagementServiceClient::GetImportJob( return connection_->GetImportJob(request); } +StatusOr +KeyManagementServiceClient::GetRetiredResource(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::kms::v1::GetRetiredResourceRequest request; + request.set_name(name); + return connection_->GetRetiredResource(request); +} + +StatusOr +KeyManagementServiceClient::GetRetiredResource( + google::cloud::kms::v1::GetRetiredResourceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetRetiredResource(request); +} + StatusOr KeyManagementServiceClient::CreateKeyRing( std::string const& parent, std::string const& key_ring_id, @@ -236,6 +269,90 @@ KeyManagementServiceClient::CreateCryptoKeyVersion( return connection_->CreateCryptoKeyVersion(request); } +future> +KeyManagementServiceClient::DeleteCryptoKey(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::kms::v1::DeleteCryptoKeyRequest request; + request.set_name(name); + return connection_->DeleteCryptoKey(request); +} + +StatusOr +KeyManagementServiceClient::DeleteCryptoKey(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::kms::v1::DeleteCryptoKeyRequest request; + request.set_name(name); + return connection_->DeleteCryptoKey(NoAwaitTag{}, request); +} + +future> +KeyManagementServiceClient::DeleteCryptoKey( + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCryptoKey(request); +} + +StatusOr +KeyManagementServiceClient::DeleteCryptoKey( + NoAwaitTag, google::cloud::kms::v1::DeleteCryptoKeyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCryptoKey(NoAwaitTag{}, request); +} + +future> +KeyManagementServiceClient::DeleteCryptoKey( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCryptoKey(operation); +} + +future> +KeyManagementServiceClient::DeleteCryptoKeyVersion(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest request; + request.set_name(name); + return connection_->DeleteCryptoKeyVersion(request); +} + +StatusOr +KeyManagementServiceClient::DeleteCryptoKeyVersion(NoAwaitTag, + std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest request; + request.set_name(name); + return connection_->DeleteCryptoKeyVersion(NoAwaitTag{}, request); +} + +future> +KeyManagementServiceClient::DeleteCryptoKeyVersion( + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCryptoKeyVersion(request); +} + +StatusOr +KeyManagementServiceClient::DeleteCryptoKeyVersion( + NoAwaitTag, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCryptoKeyVersion(NoAwaitTag{}, request); +} + +future> +KeyManagementServiceClient::DeleteCryptoKeyVersion( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCryptoKeyVersion(operation); +} + StatusOr KeyManagementServiceClient::ImportCryptoKeyVersion( google::cloud::kms::v1::ImportCryptoKeyVersionRequest const& request, diff --git a/google/cloud/kms/v1/key_management_client.h b/google/cloud/kms/v1/key_management_client.h index b7547388af63f..2fb5853ed924e 100644 --- a/google/cloud/kms/v1/key_management_client.h +++ b/google/cloud/kms/v1/key_management_client.h @@ -21,10 +21,12 @@ #include "google/cloud/kms/v1/key_management_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 @@ -76,7 +78,7 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN /// [google.cloud.kms.v1.CryptoKeyVersion]: /// @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} /// [google.cloud.kms.v1.ImportJob]: -/// @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L841} +/// @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L868} /// [google.cloud.kms.v1.KeyRing]: /// @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L36} /// @@ -138,7 +140,7 @@ class KeyManagementServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.KeyRing]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L36} - /// [google.cloud.kms.v1.ListKeyRingsRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L420} + /// [google.cloud.kms.v1.ListKeyRingsRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L484} /// // clang-format on StreamRange ListKeyRings( @@ -177,7 +179,7 @@ class KeyManagementServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.KeyRing]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L36} - /// [google.cloud.kms.v1.ListKeyRingsRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L420} + /// [google.cloud.kms.v1.ListKeyRingsRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L484} /// // clang-format on StreamRange ListKeyRings( @@ -213,7 +215,7 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} /// [google.cloud.kms.v1.KeyRing]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L36} - /// [google.cloud.kms.v1.ListCryptoKeysRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L459} + /// [google.cloud.kms.v1.ListCryptoKeysRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L523} /// // clang-format on StreamRange ListCryptoKeys( @@ -252,7 +254,7 @@ class KeyManagementServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} - /// [google.cloud.kms.v1.ListCryptoKeysRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L459} + /// [google.cloud.kms.v1.ListCryptoKeysRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L523} /// // clang-format on StreamRange ListCryptoKeys( @@ -289,7 +291,7 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.ListCryptoKeyVersionsRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L500} + /// [google.cloud.kms.v1.ListCryptoKeyVersionsRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L564} /// // clang-format on StreamRange ListCryptoKeyVersions( @@ -328,7 +330,7 @@ class KeyManagementServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.ListCryptoKeyVersionsRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L500} + /// [google.cloud.kms.v1.ListCryptoKeyVersionsRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L564} /// // clang-format on StreamRange ListCryptoKeyVersions( @@ -363,9 +365,9 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.ImportJob]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L841} + /// [google.cloud.kms.v1.ImportJob]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L868} /// [google.cloud.kms.v1.KeyRing]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L36} - /// [google.cloud.kms.v1.ListImportJobsRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L542} + /// [google.cloud.kms.v1.ListImportJobsRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L606} /// // clang-format on StreamRange ListImportJobs( @@ -403,13 +405,95 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.ImportJob]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L841} - /// [google.cloud.kms.v1.ListImportJobsRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L542} + /// [google.cloud.kms.v1.ImportJob]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L868} + /// [google.cloud.kms.v1.ListImportJobsRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L606} /// // clang-format on StreamRange ListImportJobs( google::cloud::kms::v1::ListImportJobsRequest request, Options opts = {}); + // clang-format off + /// + /// Lists the [RetiredResources][google.cloud.kms.v1.RetiredResource] which are + /// the records of deleted [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + /// RetiredResources prevent the reuse of these resource names after deletion. + /// + /// @param parent Required. The project-specific location holding the + /// [RetiredResources][google.cloud.kms.v1.RetiredResource], 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.kms.v1.RetiredResource], 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.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} + /// [google.cloud.kms.v1.ListRetiredResourcesRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L644} + /// [google.cloud.kms.v1.RetiredResource]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1073} + /// + // clang-format on + StreamRange ListRetiredResources( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists the [RetiredResources][google.cloud.kms.v1.RetiredResource] which are + /// the records of deleted [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + /// RetiredResources prevent the reuse of these resource names after deletion. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.kms.v1.ListRetiredResourcesRequest]. + /// Proto messages are converted to C++ 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.kms.v1.RetiredResource], 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.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} + /// [google.cloud.kms.v1.ListRetiredResourcesRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L644} + /// [google.cloud.kms.v1.RetiredResource]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1073} + /// + // clang-format on + StreamRange ListRetiredResources( + google::cloud::kms::v1::ListRetiredResourcesRequest request, + Options opts = {}); + // clang-format off /// /// Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. @@ -429,7 +513,7 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.GetKeyRingRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L661} + /// [google.cloud.kms.v1.GetKeyRingRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L769} /// [google.cloud.kms.v1.KeyRing]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L36} /// [google.cloud.kms.v1.KeyRing.name]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L45} /// @@ -460,7 +544,7 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.GetKeyRingRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L661} + /// [google.cloud.kms.v1.GetKeyRingRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L769} /// [google.cloud.kms.v1.KeyRing]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L36} /// // clang-format on @@ -493,7 +577,7 @@ class KeyManagementServiceClient { /// [google.cloud.kms.v1.CryptoKey.name]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L114} /// [google.cloud.kms.v1.CryptoKey.primary]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L129} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.GetCryptoKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L674} + /// [google.cloud.kms.v1.GetCryptoKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L782} /// // clang-format on StatusOr GetCryptoKey( @@ -527,7 +611,7 @@ class KeyManagementServiceClient { /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} /// [google.cloud.kms.v1.CryptoKey.primary]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L129} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.GetCryptoKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L674} + /// [google.cloud.kms.v1.GetCryptoKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L782} /// // clang-format on StatusOr GetCryptoKey( @@ -555,8 +639,8 @@ class KeyManagementServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.CryptoKeyVersion.name]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L594} - /// [google.cloud.kms.v1.GetCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L687} + /// [google.cloud.kms.v1.CryptoKeyVersion.name]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L621} + /// [google.cloud.kms.v1.GetCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L795} /// // clang-format on StatusOr GetCryptoKeyVersion( @@ -587,7 +671,7 @@ class KeyManagementServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.GetCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L687} + /// [google.cloud.kms.v1.GetCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L795} /// // clang-format on StatusOr GetCryptoKeyVersion( @@ -622,9 +706,9 @@ class KeyManagementServiceClient { /// [google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L84} /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.CryptoKeyVersion.name]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L594} - /// [google.cloud.kms.v1.GetPublicKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L700} - /// [google.cloud.kms.v1.PublicKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L716} + /// [google.cloud.kms.v1.CryptoKeyVersion.name]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L621} + /// [google.cloud.kms.v1.GetPublicKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L808} + /// [google.cloud.kms.v1.PublicKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L743} /// // clang-format on StatusOr GetPublicKey( @@ -662,8 +746,8 @@ class KeyManagementServiceClient { /// [google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L84} /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.GetPublicKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L700} - /// [google.cloud.kms.v1.PublicKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L716} + /// [google.cloud.kms.v1.GetPublicKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L808} + /// [google.cloud.kms.v1.PublicKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L743} /// // clang-format on StatusOr GetPublicKey( @@ -689,9 +773,9 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.GetImportJobRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L723} - /// [google.cloud.kms.v1.ImportJob]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L841} - /// [google.cloud.kms.v1.ImportJob.name]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L937} + /// [google.cloud.kms.v1.GetImportJobRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L831} + /// [google.cloud.kms.v1.ImportJob]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L868} + /// [google.cloud.kms.v1.ImportJob.name]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L964} /// // clang-format on StatusOr GetImportJob( @@ -720,14 +804,78 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.GetImportJobRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L723} - /// [google.cloud.kms.v1.ImportJob]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L841} + /// [google.cloud.kms.v1.GetImportJobRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L831} + /// [google.cloud.kms.v1.ImportJob]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L868} /// // clang-format on StatusOr GetImportJob( google::cloud::kms::v1::GetImportJobRequest const& request, Options opts = {}); + // clang-format off + /// + /// Retrieves a specific [RetiredResource][google.cloud.kms.v1.RetiredResource] + /// resource, which represents the record of a deleted + /// [CryptoKey][google.cloud.kms.v1.CryptoKey]. + /// + /// @param name Required. The [name][google.cloud.kms.v1.RetiredResource.name] of the + /// [RetiredResource][google.cloud.kms.v1.RetiredResource] to get. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.kms.v1.RetiredResource]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} + /// [google.cloud.kms.v1.GetRetiredResourceRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L844} + /// [google.cloud.kms.v1.RetiredResource]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1073} + /// [google.cloud.kms.v1.RetiredResource.name]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1084} + /// + // clang-format on + StatusOr GetRetiredResource( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Retrieves a specific [RetiredResource][google.cloud.kms.v1.RetiredResource] + /// resource, which represents the record of a deleted + /// [CryptoKey][google.cloud.kms.v1.CryptoKey]. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.kms.v1.GetRetiredResourceRequest]. + /// Proto messages are converted to 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.kms.v1.RetiredResource]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} + /// [google.cloud.kms.v1.GetRetiredResourceRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L844} + /// [google.cloud.kms.v1.RetiredResource]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1073} + /// + // clang-format on + StatusOr GetRetiredResource( + google::cloud::kms::v1::GetRetiredResourceRequest const& request, + Options opts = {}); + // clang-format off /// /// Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and @@ -753,7 +901,7 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.CreateKeyRingRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L736} + /// [google.cloud.kms.v1.CreateKeyRingRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L857} /// [google.cloud.kms.v1.KeyRing]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L36} /// // clang-format on @@ -785,7 +933,7 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.CreateKeyRingRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L736} + /// [google.cloud.kms.v1.CreateKeyRingRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L857} /// [google.cloud.kms.v1.KeyRing]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L36} /// // clang-format on @@ -821,7 +969,7 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.CreateCryptoKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L758} + /// [google.cloud.kms.v1.CreateCryptoKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L879} /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} /// [google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L253} @@ -861,7 +1009,7 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.CreateCryptoKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L758} + /// [google.cloud.kms.v1.CreateCryptoKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L879} /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} /// [google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L253} @@ -899,12 +1047,12 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.CreateCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L789} + /// [google.cloud.kms.v1.CreateCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L910} /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} /// [google.cloud.kms.v1.CryptoKey.name]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L114} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L516} - /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L598} + /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L543} + /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L625} /// // clang-format on StatusOr CreateCryptoKeyVersion( @@ -940,17 +1088,287 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.CreateCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L789} + /// [google.cloud.kms.v1.CreateCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L910} /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L516} - /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L598} + /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L543} + /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L625} /// // clang-format on StatusOr CreateCryptoKeyVersion( google::cloud::kms::v1::CreateCryptoKeyVersionRequest const& request, Options opts = {}); + // clang-format off + /// + /// Permanently deletes the given [CryptoKey][google.cloud.kms.v1.CryptoKey]. + /// All child [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] must + /// have been previously deleted using + /// [KeyManagementService.DeleteCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]. + /// The specified crypto key will be immediately and permanently deleted upon + /// calling this method. This action cannot be undone. + /// + /// @param name Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + /// [CryptoKey][google.cloud.kms.v1.CryptoKey] 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.kms.v1.DeleteCryptoKeyMetadata] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} + /// [google.cloud.kms.v1.CryptoKey.name]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L114} + /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} + /// [google.cloud.kms.v1.DeleteCryptoKeyMetadata]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2366} + /// [google.cloud.kms.v1.DeleteCryptoKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L929} + /// [google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L225} + /// + // clang-format on + future> + DeleteCryptoKey(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCryptoKey + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteCryptoKey( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Permanently deletes the given [CryptoKey][google.cloud.kms.v1.CryptoKey]. + /// All child [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] must + /// have been previously deleted using + /// [KeyManagementService.DeleteCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]. + /// The specified crypto key will be immediately and permanently deleted upon + /// calling this method. This action cannot be undone. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.kms.v1.DeleteCryptoKeyRequest]. + /// Proto messages are converted to C++ 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.kms.v1.DeleteCryptoKeyMetadata] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} + /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} + /// [google.cloud.kms.v1.DeleteCryptoKeyMetadata]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2366} + /// [google.cloud.kms.v1.DeleteCryptoKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L929} + /// [google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L225} + /// + // clang-format on + future> + DeleteCryptoKey(google::cloud::kms::v1::DeleteCryptoKeyRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCryptoKey + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteCryptoKey( + NoAwaitTag, google::cloud::kms::v1::DeleteCryptoKeyRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCryptoKey + /// + /// 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> + DeleteCryptoKey(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Permanently deletes the given + /// [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only possible if + /// the version has not been previously imported and if its + /// [state][google.cloud.kms.v1.CryptoKeyVersion.state] is one of + /// [DESTROYED][CryptoKeyVersionState.DESTROYED], + /// [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or + /// [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. + /// Successfully imported + /// [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] cannot be deleted + /// at this time. The specified version will be immediately and permanently + /// deleted upon calling this method. This action cannot be undone. + /// + /// @param name Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + /// [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] 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.kms.v1.DeleteCryptoKeyVersionMetadata] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} + /// [google.cloud.kms.v1.CryptoKeyVersion.name]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L621} + /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L625} + /// [google.cloud.kms.v1.DeleteCryptoKeyVersionMetadata]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2382} + /// [google.cloud.kms.v1.DeleteCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L942} + /// + // clang-format on + future> + DeleteCryptoKeyVersion(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCryptoKeyVersion + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteCryptoKeyVersion( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Permanently deletes the given + /// [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only possible if + /// the version has not been previously imported and if its + /// [state][google.cloud.kms.v1.CryptoKeyVersion.state] is one of + /// [DESTROYED][CryptoKeyVersionState.DESTROYED], + /// [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or + /// [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. + /// Successfully imported + /// [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] cannot be deleted + /// at this time. The specified version will be immediately and permanently + /// deleted upon calling this method. This action cannot be undone. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.kms.v1.DeleteCryptoKeyVersionRequest]. + /// Proto messages are converted to C++ 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.kms.v1.DeleteCryptoKeyVersionMetadata] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} + /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L625} + /// [google.cloud.kms.v1.DeleteCryptoKeyVersionMetadata]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2382} + /// [google.cloud.kms.v1.DeleteCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L942} + /// + // clang-format on + future> + DeleteCryptoKeyVersion( + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCryptoKeyVersion + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteCryptoKeyVersion( + NoAwaitTag, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCryptoKeyVersion + /// + /// 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> + DeleteCryptoKeyVersion(google::longrunning::Operation const& operation, + Options opts = {}); + // clang-format off /// /// Import wrapped key material into a @@ -983,7 +1401,7 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.ImportCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L808} + /// [google.cloud.kms.v1.ImportCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L955} /// // clang-format on StatusOr ImportCryptoKeyVersion( @@ -1018,9 +1436,9 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.CreateImportJobRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L918} - /// [google.cloud.kms.v1.ImportJob]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L841} - /// [google.cloud.kms.v1.ImportJob.import_method]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L941} + /// [google.cloud.kms.v1.CreateImportJobRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1065} + /// [google.cloud.kms.v1.ImportJob]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L868} + /// [google.cloud.kms.v1.ImportJob.import_method]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L968} /// [google.cloud.kms.v1.KeyRing]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L36} /// [google.cloud.kms.v1.KeyRing.name]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L45} /// @@ -1056,9 +1474,9 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.CreateImportJobRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L918} - /// [google.cloud.kms.v1.ImportJob]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L841} - /// [google.cloud.kms.v1.ImportJob.import_method]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L941} + /// [google.cloud.kms.v1.CreateImportJobRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1065} + /// [google.cloud.kms.v1.ImportJob]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L868} + /// [google.cloud.kms.v1.ImportJob.import_method]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L968} /// [google.cloud.kms.v1.KeyRing]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L36} /// // clang-format on @@ -1086,7 +1504,7 @@ class KeyManagementServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} - /// [google.cloud.kms.v1.UpdateCryptoKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L940} + /// [google.cloud.kms.v1.UpdateCryptoKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1087} /// // clang-format on StatusOr UpdateCryptoKey( @@ -1117,7 +1535,7 @@ class KeyManagementServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} - /// [google.cloud.kms.v1.UpdateCryptoKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L940} + /// [google.cloud.kms.v1.UpdateCryptoKeyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1087} /// // clang-format on StatusOr UpdateCryptoKey( @@ -1156,12 +1574,12 @@ class KeyManagementServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L522} - /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L516} - /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L598} - /// [google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L268} - /// [google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L286} - /// [google.cloud.kms.v1.UpdateCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L951} + /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L549} + /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L543} + /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L625} + /// [google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L332} + /// [google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L350} + /// [google.cloud.kms.v1.UpdateCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1098} /// // clang-format on StatusOr UpdateCryptoKeyVersion( @@ -1203,12 +1621,12 @@ class KeyManagementServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L522} - /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L516} - /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L598} - /// [google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L268} - /// [google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L286} - /// [google.cloud.kms.v1.UpdateCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L951} + /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L549} + /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L543} + /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L625} + /// [google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L332} + /// [google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L350} + /// [google.cloud.kms.v1.UpdateCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1098} /// // clang-format on StatusOr UpdateCryptoKeyVersion( @@ -1244,8 +1662,8 @@ class KeyManagementServiceClient { /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} /// [google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L77} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.KeyManagementService.Encrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L299} - /// [google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L964} + /// [google.cloud.kms.v1.KeyManagementService.Encrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L363} + /// [google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1111} /// // clang-format on StatusOr UpdateCryptoKeyPrimaryVersion( @@ -1282,8 +1700,8 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} /// [google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L77} - /// [google.cloud.kms.v1.KeyManagementService.Encrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L299} - /// [google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L964} + /// [google.cloud.kms.v1.KeyManagementService.Encrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L363} + /// [google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1111} /// // clang-format on StatusOr UpdateCryptoKeyPrimaryVersion( @@ -1332,12 +1750,12 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L195} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L531} - /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L539} - /// [google.cloud.kms.v1.CryptoKeyVersion.destroy_time]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L637} - /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L598} - /// [google.cloud.kms.v1.DestroyCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L981} - /// [google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L286} + /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L558} + /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L566} + /// [google.cloud.kms.v1.CryptoKeyVersion.destroy_time]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L664} + /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L625} + /// [google.cloud.kms.v1.DestroyCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1128} + /// [google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L350} /// // clang-format on StatusOr DestroyCryptoKeyVersion( @@ -1388,12 +1806,12 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L195} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L531} - /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L539} - /// [google.cloud.kms.v1.CryptoKeyVersion.destroy_time]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L637} - /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L598} - /// [google.cloud.kms.v1.DestroyCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L981} - /// [google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L286} + /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L558} + /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L566} + /// [google.cloud.kms.v1.CryptoKeyVersion.destroy_time]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L664} + /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L625} + /// [google.cloud.kms.v1.DestroyCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1128} + /// [google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L350} /// // clang-format on StatusOr DestroyCryptoKeyVersion( @@ -1428,11 +1846,11 @@ class KeyManagementServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L539} - /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L522} - /// [google.cloud.kms.v1.CryptoKeyVersion.destroy_time]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L637} - /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L598} - /// [google.cloud.kms.v1.RestoreCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L994} + /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L566} + /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L549} + /// [google.cloud.kms.v1.CryptoKeyVersion.destroy_time]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L664} + /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L625} + /// [google.cloud.kms.v1.RestoreCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1141} /// // clang-format on StatusOr RestoreCryptoKeyVersion( @@ -1470,11 +1888,11 @@ class KeyManagementServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L539} - /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L522} - /// [google.cloud.kms.v1.CryptoKeyVersion.destroy_time]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L637} - /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L598} - /// [google.cloud.kms.v1.RestoreCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L994} + /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L566} + /// [google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L549} + /// [google.cloud.kms.v1.CryptoKeyVersion.destroy_time]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L664} + /// [google.cloud.kms.v1.CryptoKeyVersion.state]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L625} + /// [google.cloud.kms.v1.RestoreCryptoKeyVersionRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1141} /// // clang-format on StatusOr RestoreCryptoKeyVersion( @@ -1525,13 +1943,13 @@ class KeyManagementServiceClient { /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} /// [google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L241} - /// [google.cloud.kms.v1.EncryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1007} - /// [google.cloud.kms.v1.EncryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1620} - /// [google.cloud.kms.v1.KeyManagementService.Decrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L311} - /// [google.cloud.kms.v1.ProtectionLevel.EXTERNAL]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1057} - /// [google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1060} - /// [google.cloud.kms.v1.ProtectionLevel.HSM]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1054} - /// [google.cloud.kms.v1.ProtectionLevel.SOFTWARE]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1051} + /// [google.cloud.kms.v1.EncryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1154} + /// [google.cloud.kms.v1.EncryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1767} + /// [google.cloud.kms.v1.KeyManagementService.Decrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L375} + /// [google.cloud.kms.v1.ProtectionLevel.EXTERNAL]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1117} + /// [google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1120} + /// [google.cloud.kms.v1.ProtectionLevel.HSM]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1114} + /// [google.cloud.kms.v1.ProtectionLevel.SOFTWARE]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1111} /// // clang-format on StatusOr Encrypt( @@ -1565,9 +1983,9 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L77} /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} - /// [google.cloud.kms.v1.EncryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1007} - /// [google.cloud.kms.v1.EncryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1620} - /// [google.cloud.kms.v1.KeyManagementService.Decrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L311} + /// [google.cloud.kms.v1.EncryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1154} + /// [google.cloud.kms.v1.EncryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1767} + /// [google.cloud.kms.v1.KeyManagementService.Decrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L375} /// // clang-format on StatusOr Encrypt( @@ -1601,10 +2019,10 @@ class KeyManagementServiceClient { /// [google.cloud.kms.v1.CryptoKey]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L59} /// [google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L77} /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} - /// [google.cloud.kms.v1.DecryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1096} - /// [google.cloud.kms.v1.DecryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1685} - /// [google.cloud.kms.v1.EncryptResponse.ciphertext]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1628} - /// [google.cloud.kms.v1.KeyManagementService.Encrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L299} + /// [google.cloud.kms.v1.DecryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1243} + /// [google.cloud.kms.v1.DecryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1832} + /// [google.cloud.kms.v1.EncryptResponse.ciphertext]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1775} + /// [google.cloud.kms.v1.KeyManagementService.Encrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L363} /// // clang-format on StatusOr Decrypt( @@ -1639,9 +2057,9 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L77} /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} - /// [google.cloud.kms.v1.DecryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1096} - /// [google.cloud.kms.v1.DecryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1685} - /// [google.cloud.kms.v1.KeyManagementService.Encrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L299} + /// [google.cloud.kms.v1.DecryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1243} + /// [google.cloud.kms.v1.DecryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1832} + /// [google.cloud.kms.v1.KeyManagementService.Encrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L363} /// // clang-format on StatusOr Decrypt( @@ -1677,10 +2095,10 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L98} /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} - /// [google.cloud.kms.v1.KeyManagementService.Decrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L311} - /// [google.cloud.kms.v1.KeyManagementService.Encrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L299} - /// [google.cloud.kms.v1.RawEncryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1163} - /// [google.cloud.kms.v1.RawEncryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1720} + /// [google.cloud.kms.v1.KeyManagementService.Decrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L375} + /// [google.cloud.kms.v1.KeyManagementService.Encrypt]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L363} + /// [google.cloud.kms.v1.RawEncryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1310} + /// [google.cloud.kms.v1.RawEncryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1867} /// // clang-format on StatusOr RawEncrypt( @@ -1715,8 +2133,8 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L98} /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} - /// [google.cloud.kms.v1.RawDecryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1263} - /// [google.cloud.kms.v1.RawDecryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1819} + /// [google.cloud.kms.v1.RawDecryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1410} + /// [google.cloud.kms.v1.RawDecryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1966} /// // clang-format on StatusOr RawDecrypt( @@ -1754,13 +2172,13 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.AsymmetricSignRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1346} - /// [google.cloud.kms.v1.AsymmetricSignRequest.data]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1392} - /// [google.cloud.kms.v1.AsymmetricSignResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1893} + /// [google.cloud.kms.v1.AsymmetricSignRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1493} + /// [google.cloud.kms.v1.AsymmetricSignRequest.data]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1539} + /// [google.cloud.kms.v1.AsymmetricSignResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2040} /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.CryptoKeyVersion.algorithm]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L610} - /// [google.cloud.kms.v1.KeyManagementService.GetPublicKey]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L119} + /// [google.cloud.kms.v1.CryptoKeyVersion.algorithm]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L637} + /// [google.cloud.kms.v1.KeyManagementService.GetPublicKey]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L132} /// // clang-format on StatusOr AsymmetricSign( @@ -1794,11 +2212,11 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.AsymmetricSignRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1346} - /// [google.cloud.kms.v1.AsymmetricSignResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1893} + /// [google.cloud.kms.v1.AsymmetricSignRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1493} + /// [google.cloud.kms.v1.AsymmetricSignResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2040} /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.KeyManagementService.GetPublicKey]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L119} + /// [google.cloud.kms.v1.KeyManagementService.GetPublicKey]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L132} /// // clang-format on StatusOr AsymmetricSign( @@ -1832,11 +2250,11 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.AsymmetricDecryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1419} - /// [google.cloud.kms.v1.AsymmetricDecryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1956} + /// [google.cloud.kms.v1.AsymmetricDecryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1566} + /// [google.cloud.kms.v1.AsymmetricDecryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2103} /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.KeyManagementService.GetPublicKey]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L119} + /// [google.cloud.kms.v1.KeyManagementService.GetPublicKey]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L132} /// // clang-format on StatusOr AsymmetricDecrypt( @@ -1870,11 +2288,11 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.AsymmetricDecryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1419} - /// [google.cloud.kms.v1.AsymmetricDecryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1956} + /// [google.cloud.kms.v1.AsymmetricDecryptRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1566} + /// [google.cloud.kms.v1.AsymmetricDecryptResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2103} /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.KeyManagementService.GetPublicKey]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L119} + /// [google.cloud.kms.v1.KeyManagementService.GetPublicKey]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L132} /// // clang-format on StatusOr AsymmetricDecrypt( @@ -1907,8 +2325,8 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.MacSignRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1460} - /// [google.cloud.kms.v1.MacSignResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1999} + /// [google.cloud.kms.v1.MacSignRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1607} + /// [google.cloud.kms.v1.MacSignResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2146} /// // clang-format on StatusOr MacSign( @@ -1941,8 +2359,8 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.MacSignRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1460} - /// [google.cloud.kms.v1.MacSignResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1999} + /// [google.cloud.kms.v1.MacSignRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1607} + /// [google.cloud.kms.v1.MacSignResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2146} /// // clang-format on StatusOr MacSign( @@ -1977,9 +2395,9 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.MacSignRequest.data]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1473} - /// [google.cloud.kms.v1.MacVerifyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1498} - /// [google.cloud.kms.v1.MacVerifyResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2046} + /// [google.cloud.kms.v1.MacSignRequest.data]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1620} + /// [google.cloud.kms.v1.MacVerifyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1645} + /// [google.cloud.kms.v1.MacVerifyResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2193} /// // clang-format on StatusOr MacVerify( @@ -2014,8 +2432,8 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.MacVerifyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1498} - /// [google.cloud.kms.v1.MacVerifyResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2046} + /// [google.cloud.kms.v1.MacVerifyRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1645} + /// [google.cloud.kms.v1.MacVerifyResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2193} /// // clang-format on StatusOr MacVerify( @@ -2051,9 +2469,9 @@ class KeyManagementServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.kms.v1.CryptoKey.purpose]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L133} /// [google.cloud.kms.v1.CryptoKeyVersion]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L314} - /// [google.cloud.kms.v1.DecapsulateRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1561} - /// [google.cloud.kms.v1.DecapsulateResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2105} - /// [google.cloud.kms.v1.KeyManagementService.GetPublicKey]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L119} + /// [google.cloud.kms.v1.DecapsulateRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1708} + /// [google.cloud.kms.v1.DecapsulateResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2252} + /// [google.cloud.kms.v1.KeyManagementService.GetPublicKey]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L132} /// // clang-format on StatusOr Decapsulate( @@ -2086,10 +2504,10 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.GenerateRandomBytesRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1602} - /// [google.cloud.kms.v1.GenerateRandomBytesResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2159} - /// [google.cloud.kms.v1.ProtectionLevel]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1046} - /// [google.cloud.kms.v1.ProtectionLevel.HSM]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1054} + /// [google.cloud.kms.v1.GenerateRandomBytesRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1749} + /// [google.cloud.kms.v1.GenerateRandomBytesResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2306} + /// [google.cloud.kms.v1.ProtectionLevel]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1106} + /// [google.cloud.kms.v1.ProtectionLevel.HSM]: @googleapis_reference_link{google/cloud/kms/v1/resources.proto#L1114} /// // clang-format on StatusOr @@ -2121,8 +2539,8 @@ class KeyManagementServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.kms.v1.GenerateRandomBytesRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1602} - /// [google.cloud.kms.v1.GenerateRandomBytesResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2159} + /// [google.cloud.kms.v1.GenerateRandomBytesRequest]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L1749} + /// [google.cloud.kms.v1.GenerateRandomBytesResponse]: @googleapis_reference_link{google/cloud/kms/v1/service.proto#L2306} /// // clang-format on StatusOr diff --git a/google/cloud/kms/v1/key_management_connection.cc b/google/cloud/kms/v1/key_management_connection.cc index 36f8aeaf0593b..970998a4ca3aa 100644 --- a/google/cloud/kms/v1/key_management_connection.cc +++ b/google/cloud/kms/v1/key_management_connection.cc @@ -70,6 +70,14 @@ KeyManagementServiceConnection::ListImportJobs( StreamRange>(); } +StreamRange +KeyManagementServiceConnection::ListRetiredResources( + google::cloud::kms::v1:: + ListRetiredResourcesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + StatusOr KeyManagementServiceConnection::GetKeyRing( google::cloud::kms::v1::GetKeyRingRequest const&) { @@ -100,6 +108,12 @@ KeyManagementServiceConnection::GetImportJob( return Status(StatusCode::kUnimplemented, "not implemented"); } +StatusOr +KeyManagementServiceConnection::GetRetiredResource( + google::cloud::kms::v1::GetRetiredResourceRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + StatusOr KeyManagementServiceConnection::CreateKeyRing( google::cloud::kms::v1::CreateKeyRingRequest const&) { @@ -118,6 +132,52 @@ KeyManagementServiceConnection::CreateCryptoKeyVersion( return Status(StatusCode::kUnimplemented, "not implemented"); } +future> +KeyManagementServiceConnection::DeleteCryptoKey( + google::cloud::kms::v1::DeleteCryptoKeyRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +KeyManagementServiceConnection::DeleteCryptoKey( + NoAwaitTag, google::cloud::kms::v1::DeleteCryptoKeyRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +KeyManagementServiceConnection::DeleteCryptoKey( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +KeyManagementServiceConnection::DeleteCryptoKeyVersion( + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +KeyManagementServiceConnection::DeleteCryptoKeyVersion( + NoAwaitTag, google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +KeyManagementServiceConnection::DeleteCryptoKeyVersion( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + StatusOr KeyManagementServiceConnection::ImportCryptoKeyVersion( google::cloud::kms::v1::ImportCryptoKeyVersionRequest const&) { diff --git a/google/cloud/kms/v1/key_management_connection.h b/google/cloud/kms/v1/key_management_connection.h index 536ceae13ff0a..a817d5a8b01a7 100644 --- a/google/cloud/kms/v1/key_management_connection.h +++ b/google/cloud/kms/v1/key_management_connection.h @@ -21,13 +21,17 @@ #include "google/cloud/kms/v1/internal/key_management_retry_traits.h" #include "google/cloud/kms/v1/key_management_connection_idempotency_policy.h" +#include "google/cloud/kms/v1/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 +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -199,6 +203,10 @@ class KeyManagementServiceConnection { virtual StreamRange ListImportJobs( google::cloud::kms::v1::ListImportJobsRequest request); + virtual StreamRange + ListRetiredResources( + google::cloud::kms::v1::ListRetiredResourcesRequest request); + virtual StatusOr GetKeyRing( google::cloud::kms::v1::GetKeyRingRequest const& request); @@ -215,6 +223,9 @@ class KeyManagementServiceConnection { virtual StatusOr GetImportJob( google::cloud::kms::v1::GetImportJobRequest const& request); + virtual StatusOr GetRetiredResource( + google::cloud::kms::v1::GetRetiredResourceRequest const& request); + virtual StatusOr CreateKeyRing( google::cloud::kms::v1::CreateKeyRingRequest const& request); @@ -225,6 +236,30 @@ class KeyManagementServiceConnection { CreateCryptoKeyVersion( google::cloud::kms::v1::CreateCryptoKeyVersionRequest const& request); + virtual future> + DeleteCryptoKey( + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request); + + virtual StatusOr DeleteCryptoKey( + NoAwaitTag, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request); + + virtual future> + DeleteCryptoKey(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteCryptoKeyVersion( + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request); + + virtual StatusOr DeleteCryptoKeyVersion( + NoAwaitTag, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request); + + virtual future< + StatusOr> + DeleteCryptoKeyVersion(google::longrunning::Operation const& operation); + virtual StatusOr ImportCryptoKeyVersion( google::cloud::kms::v1::ImportCryptoKeyVersionRequest const& request); diff --git a/google/cloud/kms/v1/key_management_connection_idempotency_policy.cc b/google/cloud/kms/v1/key_management_connection_idempotency_policy.cc index 7ab95645dce16..4e0c2f02a05a7 100644 --- a/google/cloud/kms/v1/key_management_connection_idempotency_policy.cc +++ b/google/cloud/kms/v1/key_management_connection_idempotency_policy.cc @@ -56,6 +56,12 @@ Idempotency KeyManagementServiceConnectionIdempotencyPolicy::ListImportJobs( return Idempotency::kIdempotent; } +Idempotency +KeyManagementServiceConnectionIdempotencyPolicy::ListRetiredResources( + google::cloud::kms::v1::ListRetiredResourcesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + Idempotency KeyManagementServiceConnectionIdempotencyPolicy::GetKeyRing( google::cloud::kms::v1::GetKeyRingRequest const&) { return Idempotency::kIdempotent; @@ -82,6 +88,11 @@ Idempotency KeyManagementServiceConnectionIdempotencyPolicy::GetImportJob( return Idempotency::kIdempotent; } +Idempotency KeyManagementServiceConnectionIdempotencyPolicy::GetRetiredResource( + google::cloud::kms::v1::GetRetiredResourceRequest const&) { + return Idempotency::kIdempotent; +} + Idempotency KeyManagementServiceConnectionIdempotencyPolicy::CreateKeyRing( google::cloud::kms::v1::CreateKeyRingRequest const&) { return Idempotency::kNonIdempotent; @@ -98,6 +109,17 @@ KeyManagementServiceConnectionIdempotencyPolicy::CreateCryptoKeyVersion( return Idempotency::kNonIdempotent; } +Idempotency KeyManagementServiceConnectionIdempotencyPolicy::DeleteCryptoKey( + google::cloud::kms::v1::DeleteCryptoKeyRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +KeyManagementServiceConnectionIdempotencyPolicy::DeleteCryptoKeyVersion( + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const&) { + return Idempotency::kNonIdempotent; +} + Idempotency KeyManagementServiceConnectionIdempotencyPolicy::ImportCryptoKeyVersion( google::cloud::kms::v1::ImportCryptoKeyVersionRequest const&) { diff --git a/google/cloud/kms/v1/key_management_connection_idempotency_policy.h b/google/cloud/kms/v1/key_management_connection_idempotency_policy.h index a57f3e171bb03..2920e35495985 100644 --- a/google/cloud/kms/v1/key_management_connection_idempotency_policy.h +++ b/google/cloud/kms/v1/key_management_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_KEY_MANAGEMENT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_KMS_V1_KEY_MANAGEMENT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/kms/v1/service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -52,6 +52,9 @@ class KeyManagementServiceConnectionIdempotencyPolicy { virtual google::cloud::Idempotency ListImportJobs( google::cloud::kms::v1::ListImportJobsRequest request); + virtual google::cloud::Idempotency ListRetiredResources( + google::cloud::kms::v1::ListRetiredResourcesRequest request); + virtual google::cloud::Idempotency GetKeyRing( google::cloud::kms::v1::GetKeyRingRequest const& request); @@ -67,6 +70,9 @@ class KeyManagementServiceConnectionIdempotencyPolicy { virtual google::cloud::Idempotency GetImportJob( google::cloud::kms::v1::GetImportJobRequest const& request); + virtual google::cloud::Idempotency GetRetiredResource( + google::cloud::kms::v1::GetRetiredResourceRequest const& request); + virtual google::cloud::Idempotency CreateKeyRing( google::cloud::kms::v1::CreateKeyRingRequest const& request); @@ -76,6 +82,12 @@ class KeyManagementServiceConnectionIdempotencyPolicy { virtual google::cloud::Idempotency CreateCryptoKeyVersion( google::cloud::kms::v1::CreateCryptoKeyVersionRequest const& request); + virtual google::cloud::Idempotency DeleteCryptoKey( + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request); + + virtual google::cloud::Idempotency DeleteCryptoKeyVersion( + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request); + virtual google::cloud::Idempotency ImportCryptoKeyVersion( google::cloud::kms::v1::ImportCryptoKeyVersionRequest const& request); diff --git a/google/cloud/kms/v1/key_management_options.h b/google/cloud/kms/v1/key_management_options.h index b7c9288de3627..8f6fb91a97dbf 100644 --- a/google/cloud/kms/v1/key_management_options.h +++ b/google/cloud/kms/v1/key_management_options.h @@ -58,6 +58,16 @@ struct KeyManagementServiceConnectionIdempotencyPolicyOption { using Type = std::shared_ptr; }; +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-kms-options + */ +struct KeyManagementServicePollingPolicyOption { + using Type = std::shared_ptr; +}; + /** * The options applicable to KeyManagementService. * @@ -66,6 +76,7 @@ struct KeyManagementServiceConnectionIdempotencyPolicyOption { using KeyManagementServicePolicyOptionList = OptionList; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/kms/v1/mocks/mock_key_management_connection.h b/google/cloud/kms/v1/mocks/mock_key_management_connection.h index 9d940bb005458..284012b64972b 100644 --- a/google/cloud/kms/v1/mocks/mock_key_management_connection.h +++ b/google/cloud/kms/v1/mocks/mock_key_management_connection.h @@ -64,6 +64,11 @@ class MockKeyManagementServiceConnection (google::cloud::kms::v1::ListImportJobsRequest request), (override)); + MOCK_METHOD((StreamRange), + ListRetiredResources, + (google::cloud::kms::v1::ListRetiredResourcesRequest request), + (override)); + MOCK_METHOD(StatusOr, GetKeyRing, (google::cloud::kms::v1::GetKeyRingRequest const& request), (override)); @@ -85,6 +90,11 @@ class MockKeyManagementServiceConnection (google::cloud::kms::v1::GetImportJobRequest const& request), (override)); + MOCK_METHOD( + StatusOr, GetRetiredResource, + (google::cloud::kms::v1::GetRetiredResourceRequest const& request), + (override)); + MOCK_METHOD(StatusOr, CreateKeyRing, (google::cloud::kms::v1::CreateKeyRingRequest const& request), (override)); @@ -99,6 +109,83 @@ class MockKeyManagementServiceConnection (google::cloud::kms::v1::CreateCryptoKeyVersionRequest const& request), (override)); + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteCryptoKey(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteCryptoKey, + (google::cloud::kms::v1::DeleteCryptoKeyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteCryptoKey(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteCryptoKey, + (NoAwaitTag, + google::cloud::kms::v1::DeleteCryptoKeyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteCryptoKey(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteCryptoKey, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteCryptoKeyVersion(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteCryptoKeyVersion, + (google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteCryptoKeyVersion(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteCryptoKeyVersion, + (NoAwaitTag, + google::cloud::kms::v1::DeleteCryptoKeyVersionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteCryptoKeyVersion(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteCryptoKeyVersion, (google::longrunning::Operation const& operation), + (override)); + MOCK_METHOD( StatusOr, ImportCryptoKeyVersion, diff --git a/google/cloud/kms/v1/samples/key_management_client_samples.cc b/google/cloud/kms/v1/samples/key_management_client_samples.cc index add6739d22b4b..aa9aa2b7b363f 100644 --- a/google/cloud/kms/v1/samples/key_management_client_samples.cc +++ b/google/cloud/kms/v1/samples/key_management_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: kms_v1::KeyManagementServiceClient +// lro-marker: true // clang-format on namespace { @@ -126,6 +128,46 @@ 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::kms_v1::KeyManagementServiceRetryPolicyOption:: + Type, + google::cloud::kms_v1:: + KeyManagementServiceBackoffPolicyOption::Type>( + google::cloud::kms_v1:: + KeyManagementServiceLimitedTimeRetryPolicy( + /*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::kms_v1::MakeKeyManagementServiceConnection(options); + + // c1 and c2 share the same polling policies. + auto c1 = google::cloud::kms_v1::KeyManagementServiceClient(connection); + auto c2 = google::cloud::kms_v1::KeyManagementServiceClient(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 "}; @@ -160,6 +202,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}); @@ -173,6 +218,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/language/BUILD.bazel b/google/cloud/language/BUILD.bazel index 659d3c44c475d..db0bc85f2a398 100644 --- a/google/cloud/language/BUILD.bazel +++ b/google/cloud/language/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/language/v1:language_cc_grpc", - "@com_google_googleapis//google/cloud/language/v2:language_cc_grpc", + "@googleapis//google/cloud/language/v1:language_cc_grpc", + "@googleapis//google/cloud/language/v2:language_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/language/CMakeLists.txt b/google/cloud/language/CMakeLists.txt index 7911539230d1c..a199360edfc53 100644 --- a/google/cloud/language/CMakeLists.txt +++ b/google/cloud/language/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(language "Cloud Natural Language API" - SERVICE_DIRS "__EMPTY__" "v1/" "v2/") + SERVICE_DIRS "v1/" "v2/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(language_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/language/language_client.h b/google/cloud/language/language_client.h deleted file mode 100644 index 7659d231f38aa..0000000000000 --- a/google/cloud/language/language_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/language/v1/language_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_LANGUAGE_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_LANGUAGE_CLIENT_H - -#include "google/cloud/language/language_connection.h" -#include "google/cloud/language/v1/language_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in language_v1 instead of the aliases defined in -/// this namespace. -namespace language { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use language_v1::LanguageServiceClient directly. -using ::google::cloud::language_v1::LanguageServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace language -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_LANGUAGE_CLIENT_H diff --git a/google/cloud/language/language_connection.h b/google/cloud/language/language_connection.h deleted file mode 100644 index 25e0235472509..0000000000000 --- a/google/cloud/language/language_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/language/v1/language_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_LANGUAGE_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_LANGUAGE_CONNECTION_H - -#include "google/cloud/language/language_connection_idempotency_policy.h" -#include "google/cloud/language/v1/language_connection.h" - -namespace google { -namespace cloud { -namespace language { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use language_v1::MakeLanguageServiceConnection directly. -using ::google::cloud::language_v1::MakeLanguageServiceConnection; - -/// @deprecated Use language_v1::LanguageServiceConnection directly. -using ::google::cloud::language_v1::LanguageServiceConnection; - -/// @deprecated Use language_v1::LanguageServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::language_v1::LanguageServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use language_v1::LanguageServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::language_v1::LanguageServiceLimitedTimeRetryPolicy; - -/// @deprecated Use language_v1::LanguageServiceRetryPolicy directly. -using ::google::cloud::language_v1::LanguageServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace language -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_LANGUAGE_CONNECTION_H diff --git a/google/cloud/language/language_connection_idempotency_policy.h b/google/cloud/language/language_connection_idempotency_policy.h deleted file mode 100644 index 9df748f4f034b..0000000000000 --- a/google/cloud/language/language_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/language/v1/language_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_LANGUAGE_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_LANGUAGE_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/language/v1/language_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace language { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// language_v1::MakeDefaultLanguageServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::language_v1:: - MakeDefaultLanguageServiceConnectionIdempotencyPolicy; - -/// @deprecated Use language_v1::LanguageServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::language_v1::LanguageServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace language -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_LANGUAGE_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/language/language_options.h b/google/cloud/language/language_options.h deleted file mode 100644 index 21d7791187151..0000000000000 --- a/google/cloud/language/language_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/language/v1/language_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_LANGUAGE_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_LANGUAGE_OPTIONS_H - -#include "google/cloud/language/language_connection.h" -#include "google/cloud/language/language_connection_idempotency_policy.h" -#include "google/cloud/language/v1/language_options.h" - -namespace google { -namespace cloud { -namespace language { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use language_v1::LanguageServiceBackoffPolicyOption directly. -using ::google::cloud::language_v1::LanguageServiceBackoffPolicyOption; - -/// @deprecated Use -/// language_v1::LanguageServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::language_v1:: - LanguageServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use language_v1::LanguageServicePolicyOptionList directly. -using ::google::cloud::language_v1::LanguageServicePolicyOptionList; - -/// @deprecated Use language_v1::LanguageServiceRetryPolicyOption directly. -using ::google::cloud::language_v1::LanguageServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace language -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_LANGUAGE_OPTIONS_H diff --git a/google/cloud/language/mocks/mock_language_connection.h b/google/cloud/language/mocks/mock_language_connection.h deleted file mode 100644 index 04ffef268396c..0000000000000 --- a/google/cloud/language/mocks/mock_language_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/language/v1/language_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_MOCKS_MOCK_LANGUAGE_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_MOCKS_MOCK_LANGUAGE_CONNECTION_H - -#include "google/cloud/language/language_connection.h" -#include "google/cloud/language/v1/mocks/mock_language_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in language_v1_mocks instead of the aliases -/// defined in this namespace. -namespace language_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use language_v1_mocks::MockLanguageServiceConnection directly. -using ::google::cloud::language_v1_mocks::MockLanguageServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace language_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_MOCKS_MOCK_LANGUAGE_CONNECTION_H diff --git a/google/cloud/language/quickstart/.bazelrc b/google/cloud/language/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/language/quickstart/.bazelrc +++ b/google/cloud/language/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/language/quickstart/CMakeLists.txt index a1ea995dccf4c..0055f8bfdddfc 100644 --- a/google/cloud/language/quickstart/CMakeLists.txt +++ b/google/cloud/language/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Natural Language API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-language-quickstart CXX) find_package(google_cloud_cpp_language REQUIRED) diff --git a/google/cloud/language/quickstart/WORKSPACE.bazel b/google/cloud/language/quickstart/WORKSPACE.bazel index 152a47edd54a3..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 = "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/language/v1/internal/language_auth_decorator.cc b/google/cloud/language/v1/internal/language_auth_decorator.cc index 1640d48c13d85..7699cfc32756c 100644 --- a/google/cloud/language/v1/internal/language_auth_decorator.cc +++ b/google/cloud/language/v1/internal/language_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/language/v1/language_service.proto #include "google/cloud/language/v1/internal/language_auth_decorator.h" -#include +#include "google/cloud/language/v1/language_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v1_internal { @@ -98,3 +101,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace language_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/language/v1/internal/language_auth_decorator.h b/google/cloud/language/v1/internal/language_auth_decorator.h index 2d611384e213a..8418510a3a99d 100644 --- a/google/cloud/language/v1/internal/language_auth_decorator.h +++ b/google/cloud/language/v1/internal/language_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v1_internal { @@ -81,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V1_INTERNAL_LANGUAGE_AUTH_DECORATOR_H diff --git a/google/cloud/language/v1/internal/language_logging_decorator.cc b/google/cloud/language/v1/internal/language_logging_decorator.cc index ed02374013466..ccb950b5131b8 100644 --- a/google/cloud/language/v1/internal/language_logging_decorator.cc +++ b/google/cloud/language/v1/internal/language_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/language/v1/language_service.proto #include "google/cloud/language/v1/internal/language_logging_decorator.h" +#include "google/cloud/language/v1/language_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v1_internal { @@ -126,3 +129,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace language_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/language/v1/internal/language_logging_decorator.h b/google/cloud/language/v1/internal/language_logging_decorator.h index 5013194d257f2..1163c41f47aba 100644 --- a/google/cloud/language/v1/internal/language_logging_decorator.h +++ b/google/cloud/language/v1/internal/language_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v1_internal { @@ -81,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V1_INTERNAL_LANGUAGE_LOGGING_DECORATOR_H diff --git a/google/cloud/language/v1/internal/language_metadata_decorator.cc b/google/cloud/language/v1/internal/language_metadata_decorator.cc index a6479a5ff7e50..e2a3f3e0db7f8 100644 --- a/google/cloud/language/v1/internal/language_metadata_decorator.cc +++ b/google/cloud/language/v1/internal/language_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/language/v1/language_service.proto #include "google/cloud/language/v1/internal/language_metadata_decorator.h" +#include "google/cloud/language/v1/language_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 language_v1_internal { @@ -117,3 +121,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace language_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/language/v1/internal/language_metadata_decorator.h b/google/cloud/language/v1/internal/language_metadata_decorator.h index b9b824155987b..9590ee44891d9 100644 --- a/google/cloud/language/v1/internal/language_metadata_decorator.h +++ b/google/cloud/language/v1/internal/language_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v1_internal { @@ -87,4 +90,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V1_INTERNAL_LANGUAGE_METADATA_DECORATOR_H diff --git a/google/cloud/language/v1/internal/language_option_defaults.cc b/google/cloud/language/v1/internal/language_option_defaults.cc index d957930d89d04..924a385382973 100644 --- a/google/cloud/language/v1/internal/language_option_defaults.cc +++ b/google/cloud/language/v1/internal/language_option_defaults.cc @@ -41,7 +41,7 @@ Options LanguageServiceDefaultOptions(Options options) { if (!options.has()) { options.set( language_v1::LanguageServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/language/v1/internal/language_stub.cc b/google/cloud/language/v1/internal/language_stub.cc index 089fa92baa873..8a210ceb44f85 100644 --- a/google/cloud/language/v1/internal/language_stub.cc +++ b/google/cloud/language/v1/internal/language_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/language/v1/language_service.proto #include "google/cloud/language/v1/internal/language_stub.h" +#include "google/cloud/language/v1/language_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v1_internal { @@ -119,3 +122,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace language_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/language/v1/internal/language_stub.h b/google/cloud/language/v1/internal/language_stub.h index 80233571e80e6..a634405e40a11 100644 --- a/google/cloud/language/v1/internal/language_stub.h +++ b/google/cloud/language/v1/internal/language_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V1_INTERNAL_LANGUAGE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V1_INTERNAL_LANGUAGE_STUB_H +#include "google/cloud/language/v1/language_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v1_internal { @@ -123,4 +126,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V1_INTERNAL_LANGUAGE_STUB_H diff --git a/google/cloud/language/v1/internal/language_stub_factory.cc b/google/cloud/language/v1/internal/language_stub_factory.cc index 8a042e56e72d2..a6a4c0c3853e7 100644 --- a/google/cloud/language/v1/internal/language_stub_factory.cc +++ b/google/cloud/language/v1/internal/language_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/language/v1/internal/language_metadata_decorator.h" #include "google/cloud/language/v1/internal/language_stub.h" #include "google/cloud/language/v1/internal/language_tracing_stub.h" +#include "google/cloud/language/v1/language_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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace language_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/language/v1/internal/language_stub_factory.h b/google/cloud/language/v1/internal/language_stub_factory.h index 78f3fde78bf7e..1454a6ad62b26 100644 --- a/google/cloud/language/v1/internal/language_stub_factory.h +++ b/google/cloud/language/v1/internal/language_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V1_INTERNAL_LANGUAGE_STUB_FACTORY_H diff --git a/google/cloud/language/v1/internal/language_tracing_connection.cc b/google/cloud/language/v1/internal/language_tracing_connection.cc index c2a5b3e41be88..db827462f081e 100644 --- a/google/cloud/language/v1/internal/language_tracing_connection.cc +++ b/google/cloud/language/v1/internal/language_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace language_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LanguageServiceTracingConnection::LanguageServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -95,16 +93,12 @@ LanguageServiceTracingConnection::AnnotateText( return internal::EndSpan(*span, child_->AnnotateText(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLanguageServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/language/v1/internal/language_tracing_connection.h b/google/cloud/language/v1/internal/language_tracing_connection.h index eb522a54fae84..690a433d6cfd1 100644 --- a/google/cloud/language/v1/internal/language_tracing_connection.h +++ b/google/cloud/language/v1/internal/language_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace language_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LanguageServiceTracingConnection : public language_v1::LanguageServiceConnection { public: @@ -70,8 +68,6 @@ class LanguageServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/language/v1/internal/language_tracing_stub.cc b/google/cloud/language/v1/internal/language_tracing_stub.cc index a0eed84c18f7a..2bcce3edb3e46 100644 --- a/google/cloud/language/v1/internal/language_tracing_stub.cc +++ b/google/cloud/language/v1/internal/language_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LanguageServiceTracingStub::LanguageServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -117,18 +118,14 @@ LanguageServiceTracingStub::AnnotateText( child_->AnnotateText(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLanguageServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace language_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/language/v1/internal/language_tracing_stub.h b/google/cloud/language/v1/internal/language_tracing_stub.h index 6f283c7450465..fea6305be978b 100644 --- a/google/cloud/language/v1/internal/language_tracing_stub.h +++ b/google/cloud/language/v1/internal/language_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LanguageServiceTracingStub : public LanguageServiceStub { public: ~LanguageServiceTracingStub() override = default; @@ -78,8 +79,6 @@ class LanguageServiceTracingStub : public LanguageServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -94,4 +93,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V1_INTERNAL_LANGUAGE_TRACING_STUB_H diff --git a/google/cloud/language/v1/language_connection.h b/google/cloud/language/v1/language_connection.h index 6fc6e325de570..ba815af74d3c9 100644 --- a/google/cloud/language/v1/language_connection.h +++ b/google/cloud/language/v1/language_connection.h @@ -21,12 +21,12 @@ #include "google/cloud/language/v1/internal/language_retry_traits.h" #include "google/cloud/language/v1/language_connection_idempotency_policy.h" +#include "google/cloud/language/v1/language_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/version.h" -#include #include namespace google { diff --git a/google/cloud/language/v1/language_connection_idempotency_policy.h b/google/cloud/language/v1/language_connection_idempotency_policy.h index bede577372ebd..f9db8b64bf98a 100644 --- a/google/cloud/language/v1/language_connection_idempotency_policy.h +++ b/google/cloud/language/v1/language_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V1_LANGUAGE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V1_LANGUAGE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/language/v1/language_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/language/v2/internal/language_auth_decorator.cc b/google/cloud/language/v2/internal/language_auth_decorator.cc index 5dd51ffe50e77..0cccf697f847f 100644 --- a/google/cloud/language/v2/internal/language_auth_decorator.cc +++ b/google/cloud/language/v2/internal/language_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/language/v2/language_service.proto #include "google/cloud/language/v2/internal/language_auth_decorator.h" -#include +#include "google/cloud/language/v2/language_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v2_internal { @@ -80,3 +83,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace language_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/language/v2/internal/language_auth_decorator.h b/google/cloud/language/v2/internal/language_auth_decorator.h index 50fb28cd2e463..5f3b8d96b1132 100644 --- a/google/cloud/language/v2/internal/language_auth_decorator.h +++ b/google/cloud/language/v2/internal/language_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v2_internal { @@ -70,4 +73,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V2_INTERNAL_LANGUAGE_AUTH_DECORATOR_H diff --git a/google/cloud/language/v2/internal/language_logging_decorator.cc b/google/cloud/language/v2/internal/language_logging_decorator.cc index 45560f0a6f0e9..a3ceebbf32a21 100644 --- a/google/cloud/language/v2/internal/language_logging_decorator.cc +++ b/google/cloud/language/v2/internal/language_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/language/v2/language_service.proto #include "google/cloud/language/v2/internal/language_logging_decorator.h" +#include "google/cloud/language/v2/language_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v2_internal { @@ -101,3 +104,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace language_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/language/v2/internal/language_logging_decorator.h b/google/cloud/language/v2/internal/language_logging_decorator.h index c3313fd5e0478..04a1f4c0c79d0 100644 --- a/google/cloud/language/v2/internal/language_logging_decorator.h +++ b/google/cloud/language/v2/internal/language_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v2_internal { @@ -70,4 +73,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V2_INTERNAL_LANGUAGE_LOGGING_DECORATOR_H diff --git a/google/cloud/language/v2/internal/language_metadata_decorator.cc b/google/cloud/language/v2/internal/language_metadata_decorator.cc index ba4ddd223001b..9a4b06c61a31a 100644 --- a/google/cloud/language/v2/internal/language_metadata_decorator.cc +++ b/google/cloud/language/v2/internal/language_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/language/v2/language_service.proto #include "google/cloud/language/v2/internal/language_metadata_decorator.h" +#include "google/cloud/language/v2/language_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 language_v2_internal { @@ -101,3 +105,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace language_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/language/v2/internal/language_metadata_decorator.h b/google/cloud/language/v2/internal/language_metadata_decorator.h index e8117cb92543c..e2214cd004514 100644 --- a/google/cloud/language/v2/internal/language_metadata_decorator.h +++ b/google/cloud/language/v2/internal/language_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v2_internal { @@ -76,4 +79,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V2_INTERNAL_LANGUAGE_METADATA_DECORATOR_H diff --git a/google/cloud/language/v2/internal/language_option_defaults.cc b/google/cloud/language/v2/internal/language_option_defaults.cc index 3f9c3b3cc450a..a98aa644ec210 100644 --- a/google/cloud/language/v2/internal/language_option_defaults.cc +++ b/google/cloud/language/v2/internal/language_option_defaults.cc @@ -41,7 +41,7 @@ Options LanguageServiceDefaultOptions(Options options) { if (!options.has()) { options.set( language_v2::LanguageServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/language/v2/internal/language_stub.cc b/google/cloud/language/v2/internal/language_stub.cc index e722cba911948..69f4648c47a6a 100644 --- a/google/cloud/language/v2/internal/language_stub.cc +++ b/google/cloud/language/v2/internal/language_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/language/v2/language_service.proto #include "google/cloud/language/v2/internal/language_stub.h" +#include "google/cloud/language/v2/language_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v2_internal { @@ -94,3 +97,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace language_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/language/v2/internal/language_stub.h b/google/cloud/language/v2/internal/language_stub.h index c0654619be3d6..91777f8214efc 100644 --- a/google/cloud/language/v2/internal/language_stub.h +++ b/google/cloud/language/v2/internal/language_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V2_INTERNAL_LANGUAGE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V2_INTERNAL_LANGUAGE_STUB_H +#include "google/cloud/language/v2/language_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v2_internal { @@ -101,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V2_INTERNAL_LANGUAGE_STUB_H diff --git a/google/cloud/language/v2/internal/language_stub_factory.cc b/google/cloud/language/v2/internal/language_stub_factory.cc index e9bba27e23b75..4d7b56e000556 100644 --- a/google/cloud/language/v2/internal/language_stub_factory.cc +++ b/google/cloud/language/v2/internal/language_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/language/v2/internal/language_metadata_decorator.h" #include "google/cloud/language/v2/internal/language_stub.h" #include "google/cloud/language/v2/internal/language_tracing_stub.h" +#include "google/cloud/language/v2/language_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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v2_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace language_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/language/v2/internal/language_stub_factory.h b/google/cloud/language/v2/internal/language_stub_factory.h index 263f04b7cca85..23a1c755906d3 100644 --- a/google/cloud/language/v2/internal/language_stub_factory.h +++ b/google/cloud/language/v2/internal/language_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V2_INTERNAL_LANGUAGE_STUB_FACTORY_H diff --git a/google/cloud/language/v2/internal/language_tracing_connection.cc b/google/cloud/language/v2/internal/language_tracing_connection.cc index a30c1c31cc787..1296b54f1e894 100644 --- a/google/cloud/language/v2/internal/language_tracing_connection.cc +++ b/google/cloud/language/v2/internal/language_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace language_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LanguageServiceTracingConnection::LanguageServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -77,16 +75,12 @@ LanguageServiceTracingConnection::AnnotateText( return internal::EndSpan(*span, child_->AnnotateText(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLanguageServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/language/v2/internal/language_tracing_connection.h b/google/cloud/language/v2/internal/language_tracing_connection.h index 9d79e2d43f7db..8f994b93a6864 100644 --- a/google/cloud/language/v2/internal/language_tracing_connection.h +++ b/google/cloud/language/v2/internal/language_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace language_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LanguageServiceTracingConnection : public language_v2::LanguageServiceConnection { public: @@ -61,8 +59,6 @@ class LanguageServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/language/v2/internal/language_tracing_stub.cc b/google/cloud/language/v2/internal/language_tracing_stub.cc index 8b9981b5231b5..ee79ffc93732e 100644 --- a/google/cloud/language/v2/internal/language_tracing_stub.cc +++ b/google/cloud/language/v2/internal/language_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LanguageServiceTracingStub::LanguageServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -92,18 +93,14 @@ LanguageServiceTracingStub::AnnotateText( child_->AnnotateText(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLanguageServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace language_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/language/v2/internal/language_tracing_stub.h b/google/cloud/language/v2/internal/language_tracing_stub.h index 0109a98f90df6..5342d489aedfa 100644 --- a/google/cloud/language/v2/internal/language_tracing_stub.h +++ b/google/cloud/language/v2/internal/language_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace language_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LanguageServiceTracingStub : public LanguageServiceStub { public: ~LanguageServiceTracingStub() override = default; @@ -67,8 +68,6 @@ class LanguageServiceTracingStub : public LanguageServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -83,4 +82,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V2_INTERNAL_LANGUAGE_TRACING_STUB_H diff --git a/google/cloud/language/v2/language_connection.h b/google/cloud/language/v2/language_connection.h index 0d3a1a236e54b..389158f80853c 100644 --- a/google/cloud/language/v2/language_connection.h +++ b/google/cloud/language/v2/language_connection.h @@ -21,12 +21,12 @@ #include "google/cloud/language/v2/internal/language_retry_traits.h" #include "google/cloud/language/v2/language_connection_idempotency_policy.h" +#include "google/cloud/language/v2/language_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/version.h" -#include #include namespace google { diff --git a/google/cloud/language/v2/language_connection_idempotency_policy.h b/google/cloud/language/v2/language_connection_idempotency_policy.h index 0d2ab150ed96c..15a79d094f4d0 100644 --- a/google/cloud/language/v2/language_connection_idempotency_policy.h +++ b/google/cloud/language/v2/language_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V2_LANGUAGE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LANGUAGE_V2_LANGUAGE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/language/v2/language_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/licensemanager/BUILD.bazel b/google/cloud/licensemanager/BUILD.bazel index 0f37940349329..40105a46ae331 100644 --- a/google/cloud/licensemanager/BUILD.bazel +++ b/google/cloud/licensemanager/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/licensemanager/v1:licensemanager_cc_grpc", + "@googleapis//google/cloud/licensemanager/v1:licensemanager_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/licensemanager/quickstart/CMakeLists.txt b/google/cloud/licensemanager/quickstart/CMakeLists.txt index a842b149d5dee..a70e1ca00775a 100644 --- a/google/cloud/licensemanager/quickstart/CMakeLists.txt +++ b/google/cloud/licensemanager/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the License Manager API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-licensemanager-quickstart CXX) find_package(google_cloud_cpp_licensemanager REQUIRED) diff --git a/google/cloud/licensemanager/quickstart/WORKSPACE.bazel b/google/cloud/licensemanager/quickstart/WORKSPACE.bazel index 31ed85f966ee2..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 = "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/licensemanager/v1/internal/license_manager_auth_decorator.cc b/google/cloud/licensemanager/v1/internal/license_manager_auth_decorator.cc index f71588fe3987c..3205389851e32 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_auth_decorator.cc +++ b/google/cloud/licensemanager/v1/internal/license_manager_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/licensemanager/v1/licensemanager.proto #include "google/cloud/licensemanager/v1/internal/license_manager_auth_decorator.h" -#include +#include "google/cloud/licensemanager/v1/licensemanager.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace licensemanager_v1_internal { @@ -351,3 +354,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace licensemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/licensemanager/v1/internal/license_manager_auth_decorator.h b/google/cloud/licensemanager/v1/internal/license_manager_auth_decorator.h index 7d3bc9dc392ea..8dd25beccd3f6 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_auth_decorator.h +++ b/google/cloud/licensemanager/v1/internal/license_manager_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/licensemanager/v1/internal/license_manager_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 licensemanager_v1_internal { @@ -188,4 +191,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LICENSEMANAGER_V1_INTERNAL_LICENSE_MANAGER_AUTH_DECORATOR_H diff --git a/google/cloud/licensemanager/v1/internal/license_manager_connection_impl.h b/google/cloud/licensemanager/v1/internal/license_manager_connection_impl.h index d1ba9ddc81152..0ab444319e85f 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_connection_impl.h +++ b/google/cloud/licensemanager/v1/internal/license_manager_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/licensemanager/v1/internal/license_manager_logging_decorator.cc b/google/cloud/licensemanager/v1/internal/license_manager_logging_decorator.cc index 733e6d27317cd..fcd5f18106696 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_logging_decorator.cc +++ b/google/cloud/licensemanager/v1/internal/license_manager_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/licensemanager/v1/licensemanager.proto #include "google/cloud/licensemanager/v1/internal/license_manager_logging_decorator.h" +#include "google/cloud/licensemanager/v1/licensemanager.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace licensemanager_v1_internal { @@ -426,3 +429,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace licensemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/licensemanager/v1/internal/license_manager_logging_decorator.h b/google/cloud/licensemanager/v1/internal/license_manager_logging_decorator.h index 2e74aca799234..a37080d84e2c7 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_logging_decorator.h +++ b/google/cloud/licensemanager/v1/internal/license_manager_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/licensemanager/v1/internal/license_manager_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 licensemanager_v1_internal { @@ -188,4 +191,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LICENSEMANAGER_V1_INTERNAL_LICENSE_MANAGER_LOGGING_DECORATOR_H diff --git a/google/cloud/licensemanager/v1/internal/license_manager_metadata_decorator.cc b/google/cloud/licensemanager/v1/internal/license_manager_metadata_decorator.cc index 43e3f444fd677..7120e34a3c9e5 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_metadata_decorator.cc +++ b/google/cloud/licensemanager/v1/internal/license_manager_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/licensemanager/v1/licensemanager.proto #include "google/cloud/licensemanager/v1/internal/license_manager_metadata_decorator.h" +#include "google/cloud/licensemanager/v1/licensemanager.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 licensemanager_v1_internal { @@ -328,3 +332,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace licensemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/licensemanager/v1/internal/license_manager_metadata_decorator.h b/google/cloud/licensemanager/v1/internal/license_manager_metadata_decorator.h index a1779c4eac38a..e5c3275181000 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_metadata_decorator.h +++ b/google/cloud/licensemanager/v1/internal/license_manager_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/licensemanager/v1/internal/license_manager_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 licensemanager_v1_internal { @@ -193,4 +196,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LICENSEMANAGER_V1_INTERNAL_LICENSE_MANAGER_METADATA_DECORATOR_H diff --git a/google/cloud/licensemanager/v1/internal/license_manager_option_defaults.cc b/google/cloud/licensemanager/v1/internal/license_manager_option_defaults.cc index fe9003b6f64d4..009c816982fd8 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_option_defaults.cc +++ b/google/cloud/licensemanager/v1/internal/license_manager_option_defaults.cc @@ -42,7 +42,7 @@ Options LicenseManagerDefaultOptions(Options options) { if (!options.has()) { options.set( licensemanager_v1::LicenseManagerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/licensemanager/v1/internal/license_manager_stub.cc b/google/cloud/licensemanager/v1/internal/license_manager_stub.cc index 9e5a3841c92ff..1bdf39ee9126d 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_stub.cc +++ b/google/cloud/licensemanager/v1/internal/license_manager_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/licensemanager/v1/licensemanager.proto #include "google/cloud/licensemanager/v1/internal/license_manager_stub.h" +#include "google/cloud/licensemanager/v1/licensemanager.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace licensemanager_v1_internal { @@ -415,3 +418,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace licensemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/licensemanager/v1/internal/license_manager_stub.h b/google/cloud/licensemanager/v1/internal/license_manager_stub.h index a1cd8f07b3277..41c9116eff1ed 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_stub.h +++ b/google/cloud/licensemanager/v1/internal/license_manager_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LICENSEMANAGER_V1_INTERNAL_LICENSE_MANAGER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LICENSEMANAGER_V1_INTERNAL_LICENSE_MANAGER_STUB_H +#include "google/cloud/licensemanager/v1/licensemanager.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace licensemanager_v1_internal { @@ -353,4 +356,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LICENSEMANAGER_V1_INTERNAL_LICENSE_MANAGER_STUB_H diff --git a/google/cloud/licensemanager/v1/internal/license_manager_stub_factory.cc b/google/cloud/licensemanager/v1/internal/license_manager_stub_factory.cc index f6bb2abff4011..7280d3dda9882 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_stub_factory.cc +++ b/google/cloud/licensemanager/v1/internal/license_manager_stub_factory.cc @@ -22,18 +22,21 @@ #include "google/cloud/licensemanager/v1/internal/license_manager_metadata_decorator.h" #include "google/cloud/licensemanager/v1/internal/license_manager_stub.h" #include "google/cloud/licensemanager/v1/internal/license_manager_tracing_stub.h" +#include "google/cloud/licensemanager/v1/licensemanager.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace licensemanager_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace licensemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/licensemanager/v1/internal/license_manager_stub_factory.h b/google/cloud/licensemanager/v1/internal/license_manager_stub_factory.h index f576fa03de059..bb0ab5078da45 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_stub_factory.h +++ b/google/cloud/licensemanager/v1/internal/license_manager_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace licensemanager_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LICENSEMANAGER_V1_INTERNAL_LICENSE_MANAGER_STUB_FACTORY_H diff --git a/google/cloud/licensemanager/v1/internal/license_manager_tracing_connection.cc b/google/cloud/licensemanager/v1/internal/license_manager_tracing_connection.cc index 4509c8cd2df1e..9ed3ca035d799 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_tracing_connection.cc +++ b/google/cloud/licensemanager/v1/internal/license_manager_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace licensemanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LicenseManagerTracingConnection::LicenseManagerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -341,16 +339,12 @@ Status LicenseManagerTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLicenseManagerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/licensemanager/v1/internal/license_manager_tracing_connection.h b/google/cloud/licensemanager/v1/internal/license_manager_tracing_connection.h index f1795d3457518..bc691bc1e4760 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_tracing_connection.h +++ b/google/cloud/licensemanager/v1/internal/license_manager_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace licensemanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LicenseManagerTracingConnection : public licensemanager_v1::LicenseManagerConnection { public: @@ -162,8 +160,6 @@ class LicenseManagerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/licensemanager/v1/internal/license_manager_tracing_stub.cc b/google/cloud/licensemanager/v1/internal/license_manager_tracing_stub.cc index 949cdab31f318..39d64ac07e2dc 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_tracing_stub.cc +++ b/google/cloud/licensemanager/v1/internal/license_manager_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace licensemanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LicenseManagerTracingStub::LicenseManagerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -382,18 +383,14 @@ future LicenseManagerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLicenseManagerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace licensemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/licensemanager/v1/internal/license_manager_tracing_stub.h b/google/cloud/licensemanager/v1/internal/license_manager_tracing_stub.h index a71808ceb4c29..9f0194f152687 100644 --- a/google/cloud/licensemanager/v1/internal/license_manager_tracing_stub.h +++ b/google/cloud/licensemanager/v1/internal/license_manager_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace licensemanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LicenseManagerTracingStub : public LicenseManagerStub { public: ~LicenseManagerTracingStub() override = default; @@ -183,8 +184,6 @@ class LicenseManagerTracingStub : public LicenseManagerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -199,4 +198,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LICENSEMANAGER_V1_INTERNAL_LICENSE_MANAGER_TRACING_STUB_H diff --git a/google/cloud/licensemanager/v1/license_manager_client.h b/google/cloud/licensemanager/v1/license_manager_client.h index c9472aeab9b4b..a526896164afc 100644 --- a/google/cloud/licensemanager/v1/license_manager_client.h +++ b/google/cloud/licensemanager/v1/license_manager_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/licensemanager/v1/license_manager_connection.h b/google/cloud/licensemanager/v1/license_manager_connection.h index 7954f4e929e83..87ab3a971c8f1 100644 --- a/google/cloud/licensemanager/v1/license_manager_connection.h +++ b/google/cloud/licensemanager/v1/license_manager_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/licensemanager/v1/internal/license_manager_retry_traits.h" #include "google/cloud/licensemanager/v1/license_manager_connection_idempotency_policy.h" +#include "google/cloud/licensemanager/v1/licensemanager.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/licensemanager/v1/license_manager_connection_idempotency_policy.h b/google/cloud/licensemanager/v1/license_manager_connection_idempotency_policy.h index 19e8f5de55d3e..eef3d669f35f4 100644 --- a/google/cloud/licensemanager/v1/license_manager_connection_idempotency_policy.h +++ b/google/cloud/licensemanager/v1/license_manager_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LICENSEMANAGER_V1_LICENSE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LICENSEMANAGER_V1_LICENSE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/licensemanager/v1/licensemanager.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/logging/BUILD.bazel b/google/cloud/logging/BUILD.bazel index 3430666e9a458..c9784acb0deda 100644 --- a/google/cloud/logging/BUILD.bazel +++ b/google/cloud/logging/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/logging/v2:logging_cc_grpc", + "@googleapis//google/logging/v2:logging_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/logging/CMakeLists.txt b/google/cloud/logging/CMakeLists.txt index 4ed26c3c0913d..4e94122416f4e 100644 --- a/google/cloud/logging/CMakeLists.txt +++ b/google/cloud/logging/CMakeLists.txt @@ -18,7 +18,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( logging "Cloud Logging API" - SERVICE_DIRS "__EMPTY__" "v2/" + SERVICE_DIRS "v2/" SHARED_PROTO_DEPS "logging_type" BACKWARDS_COMPAT_PROTO_TARGETS "logging_type_type_protos") diff --git a/google/cloud/logging/integration_tests/BUILD.bazel b/google/cloud/logging/integration_tests/BUILD.bazel index f402f2a7b4433..e2ad738fb83c3 100644 --- a/google/cloud/logging/integration_tests/BUILD.bazel +++ b/google/cloud/logging/integration_tests/BUILD.bazel @@ -30,6 +30,6 @@ licenses(["notice"]) # Apache 2.0 "//:logging", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in logging_client_integration_tests] diff --git a/google/cloud/logging/logging_service_v2_client.h b/google/cloud/logging/logging_service_v2_client.h deleted file mode 100644 index 4a63038a2079b..0000000000000 --- a/google/cloud/logging/logging_service_v2_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/logging/v2/logging.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_LOGGING_SERVICE_V2_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_LOGGING_SERVICE_V2_CLIENT_H - -#include "google/cloud/logging/logging_service_v2_connection.h" -#include "google/cloud/logging/v2/logging_service_v2_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in logging_v2 instead of the aliases defined in -/// this namespace. -namespace logging { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use logging_v2::LoggingServiceV2Client directly. -using ::google::cloud::logging_v2::LoggingServiceV2Client; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace logging -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_LOGGING_SERVICE_V2_CLIENT_H diff --git a/google/cloud/logging/logging_service_v2_connection.h b/google/cloud/logging/logging_service_v2_connection.h deleted file mode 100644 index 6e8c6328372f9..0000000000000 --- a/google/cloud/logging/logging_service_v2_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/logging/v2/logging.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_LOGGING_SERVICE_V2_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_LOGGING_SERVICE_V2_CONNECTION_H - -#include "google/cloud/logging/logging_service_v2_connection_idempotency_policy.h" -#include "google/cloud/logging/v2/logging_service_v2_connection.h" - -namespace google { -namespace cloud { -namespace logging { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use logging_v2::MakeLoggingServiceV2Connection directly. -using ::google::cloud::logging_v2::MakeLoggingServiceV2Connection; - -/// @deprecated Use logging_v2::LoggingServiceV2Connection directly. -using ::google::cloud::logging_v2::LoggingServiceV2Connection; - -/// @deprecated Use logging_v2::LoggingServiceV2LimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::logging_v2::LoggingServiceV2LimitedErrorCountRetryPolicy; - -/// @deprecated Use logging_v2::LoggingServiceV2LimitedTimeRetryPolicy directly. -using ::google::cloud::logging_v2::LoggingServiceV2LimitedTimeRetryPolicy; - -/// @deprecated Use logging_v2::LoggingServiceV2RetryPolicy directly. -using ::google::cloud::logging_v2::LoggingServiceV2RetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace logging -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_LOGGING_SERVICE_V2_CONNECTION_H diff --git a/google/cloud/logging/logging_service_v2_connection_idempotency_policy.h b/google/cloud/logging/logging_service_v2_connection_idempotency_policy.h deleted file mode 100644 index bf6becb4dfe59..0000000000000 --- a/google/cloud/logging/logging_service_v2_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/logging/v2/logging.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_LOGGING_SERVICE_V2_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_LOGGING_SERVICE_V2_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/logging/v2/logging_service_v2_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace logging { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// logging_v2::MakeDefaultLoggingServiceV2ConnectionIdempotencyPolicy directly. -using ::google::cloud::logging_v2:: - MakeDefaultLoggingServiceV2ConnectionIdempotencyPolicy; - -/// @deprecated Use logging_v2::LoggingServiceV2ConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::logging_v2::LoggingServiceV2ConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace logging -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_LOGGING_SERVICE_V2_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/logging/logging_service_v2_options.h b/google/cloud/logging/logging_service_v2_options.h deleted file mode 100644 index 4da2887298b94..0000000000000 --- a/google/cloud/logging/logging_service_v2_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/logging/v2/logging.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_LOGGING_SERVICE_V2_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_LOGGING_SERVICE_V2_OPTIONS_H - -#include "google/cloud/logging/logging_service_v2_connection.h" -#include "google/cloud/logging/logging_service_v2_connection_idempotency_policy.h" -#include "google/cloud/logging/v2/logging_service_v2_options.h" - -namespace google { -namespace cloud { -namespace logging { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use logging_v2::LoggingServiceV2BackoffPolicyOption directly. -using ::google::cloud::logging_v2::LoggingServiceV2BackoffPolicyOption; - -/// @deprecated Use -/// logging_v2::LoggingServiceV2ConnectionIdempotencyPolicyOption directly. -using ::google::cloud::logging_v2:: - LoggingServiceV2ConnectionIdempotencyPolicyOption; - -/// @deprecated Use logging_v2::LoggingServiceV2PolicyOptionList directly. -using ::google::cloud::logging_v2::LoggingServiceV2PolicyOptionList; - -/// @deprecated Use logging_v2::LoggingServiceV2RetryPolicyOption directly. -using ::google::cloud::logging_v2::LoggingServiceV2RetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace logging -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_LOGGING_SERVICE_V2_OPTIONS_H diff --git a/google/cloud/logging/mocks/mock_logging_service_v2_connection.h b/google/cloud/logging/mocks/mock_logging_service_v2_connection.h deleted file mode 100644 index 0db00ce132177..0000000000000 --- a/google/cloud/logging/mocks/mock_logging_service_v2_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/logging/v2/logging.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_MOCKS_MOCK_LOGGING_SERVICE_V2_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_MOCKS_MOCK_LOGGING_SERVICE_V2_CONNECTION_H - -#include "google/cloud/logging/logging_service_v2_connection.h" -#include "google/cloud/logging/v2/mocks/mock_logging_service_v2_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in logging_v2_mocks instead of the aliases -/// defined in this namespace. -namespace logging_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use logging_v2_mocks::MockLoggingServiceV2Connection directly. -using ::google::cloud::logging_v2_mocks::MockLoggingServiceV2Connection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace logging_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_MOCKS_MOCK_LOGGING_SERVICE_V2_CONNECTION_H diff --git a/google/cloud/logging/quickstart/.bazelrc b/google/cloud/logging/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/logging/quickstart/.bazelrc +++ b/google/cloud/logging/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/logging/quickstart/CMakeLists.txt index 143d362b67fd7..e57dd2e3f12e6 100644 --- a/google/cloud/logging/quickstart/CMakeLists.txt +++ b/google/cloud/logging/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Logging API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-logging-quickstart CXX) find_package(google_cloud_cpp_logging REQUIRED) diff --git a/google/cloud/logging/quickstart/WORKSPACE.bazel b/google/cloud/logging/quickstart/WORKSPACE.bazel index 0dc13f835f30b..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 = "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/logging/v2/config_service_v2_client.h b/google/cloud/logging/v2/config_service_v2_client.h index ddc15f3af74c4..e70480951ab09 100644 --- a/google/cloud/logging/v2/config_service_v2_client.h +++ b/google/cloud/logging/v2/config_service_v2_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -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/config_service_v2_connection.h b/google/cloud/logging/v2/config_service_v2_connection.h index c1fe0ee900387..284cbc8638ea9 100644 --- a/google/cloud/logging/v2/config_service_v2_connection.h +++ b/google/cloud/logging/v2/config_service_v2_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/logging/v2/logging_config.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/logging/v2/config_service_v2_connection_idempotency_policy.h b/google/cloud/logging/v2/config_service_v2_connection_idempotency_policy.h index b086d4515e0e4..f1c579a41fe41 100644 --- a/google/cloud/logging/v2/config_service_v2_connection_idempotency_policy.h +++ b/google/cloud/logging/v2/config_service_v2_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/logging/v2/logging_config.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/logging/v2/internal/config_service_v2_auth_decorator.cc b/google/cloud/logging/v2/internal/config_service_v2_auth_decorator.cc index a41e88d6074c6..b515c32ca1702 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_auth_decorator.cc +++ b/google/cloud/logging/v2/internal/config_service_v2_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/logging/v2/logging_config.proto #include "google/cloud/logging/v2/internal/config_service_v2_auth_decorator.h" -#include +#include "google/logging/v2/logging_config.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -458,3 +461,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/config_service_v2_auth_decorator.h b/google/cloud/logging/v2/internal/config_service_v2_auth_decorator.h index 7a85cecc1b771..b59a3e75b2298 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_auth_decorator.h +++ b/google/cloud/logging/v2/internal/config_service_v2_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/logging/v2/internal/config_service_v2_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 logging_v2_internal { @@ -231,4 +234,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_CONFIG_SERVICE_V2_AUTH_DECORATOR_H diff --git a/google/cloud/logging/v2/internal/config_service_v2_connection_impl.h b/google/cloud/logging/v2/internal/config_service_v2_connection_impl.h index cb37fa6f2df49..f838a8e64d104 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_connection_impl.h +++ b/google/cloud/logging/v2/internal/config_service_v2_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/logging/v2/internal/config_service_v2_logging_decorator.cc b/google/cloud/logging/v2/internal/config_service_v2_logging_decorator.cc index 9ba22e8c2e832..06c07c7364aaf 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_logging_decorator.cc +++ b/google/cloud/logging/v2/internal/config_service_v2_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/logging/v2/internal/config_service_v2_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/logging/v2/logging_config.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -562,3 +565,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/config_service_v2_logging_decorator.h b/google/cloud/logging/v2/internal/config_service_v2_logging_decorator.h index fa97296a8b1f7..0f038b32e66fd 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_logging_decorator.h +++ b/google/cloud/logging/v2/internal/config_service_v2_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/logging/v2/internal/config_service_v2_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 logging_v2_internal { @@ -231,4 +234,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_CONFIG_SERVICE_V2_LOGGING_DECORATOR_H diff --git a/google/cloud/logging/v2/internal/config_service_v2_metadata_decorator.cc b/google/cloud/logging/v2/internal/config_service_v2_metadata_decorator.cc index d66580a221538..d3577f6bc84c2 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_metadata_decorator.cc +++ b/google/cloud/logging/v2/internal/config_service_v2_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/logging/v2/internal/config_service_v2_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/logging/v2/logging_config.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -439,3 +443,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/config_service_v2_metadata_decorator.h b/google/cloud/logging/v2/internal/config_service_v2_metadata_decorator.h index c059e753f9542..b574a3f46785b 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_metadata_decorator.h +++ b/google/cloud/logging/v2/internal/config_service_v2_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/logging/v2/internal/config_service_v2_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 logging_v2_internal { @@ -237,4 +240,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_CONFIG_SERVICE_V2_METADATA_DECORATOR_H diff --git a/google/cloud/logging/v2/internal/config_service_v2_option_defaults.cc b/google/cloud/logging/v2/internal/config_service_v2_option_defaults.cc index a234803c9c55f..8b762fe6342bf 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_option_defaults.cc +++ b/google/cloud/logging/v2/internal/config_service_v2_option_defaults.cc @@ -41,7 +41,7 @@ Options ConfigServiceV2DefaultOptions(Options options) { if (!options.has()) { options.set( logging_v2::ConfigServiceV2LimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/logging/v2/internal/config_service_v2_stub.cc b/google/cloud/logging/v2/internal/config_service_v2_stub.cc index dd297b2acadf0..dc9ac389e50c5 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_stub.cc +++ b/google/cloud/logging/v2/internal/config_service_v2_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/logging/v2/internal/config_service_v2_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/logging/v2/logging_config.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 logging_v2_internal { @@ -562,3 +565,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/config_service_v2_stub.h b/google/cloud/logging/v2/internal/config_service_v2_stub.h index 764a24ac65353..2740ca03d9e74 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_stub.h +++ b/google/cloud/logging/v2/internal/config_service_v2_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/logging/v2/logging_config.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 logging_v2_internal { @@ -427,4 +430,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_CONFIG_SERVICE_V2_STUB_H diff --git a/google/cloud/logging/v2/internal/config_service_v2_stub_factory.cc b/google/cloud/logging/v2/internal/config_service_v2_stub_factory.cc index e7a98036aeef6..5198624ed6562 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_stub_factory.cc +++ b/google/cloud/logging/v2/internal/config_service_v2_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/logging/v2/logging_config.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 logging_v2_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/config_service_v2_stub_factory.h b/google/cloud/logging/v2/internal/config_service_v2_stub_factory.h index 9a1e8cf555b48..84324e8d2130d 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_stub_factory.h +++ b/google/cloud/logging/v2/internal/config_service_v2_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_CONFIG_SERVICE_V2_STUB_FACTORY_H diff --git a/google/cloud/logging/v2/internal/config_service_v2_tracing_connection.cc b/google/cloud/logging/v2/internal/config_service_v2_tracing_connection.cc index 298d5c120bce2..d4799098d89af 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_tracing_connection.cc +++ b/google/cloud/logging/v2/internal/config_service_v2_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace logging_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConfigServiceV2TracingConnection::ConfigServiceV2TracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -448,16 +446,12 @@ Status ConfigServiceV2TracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConfigServiceV2TracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/logging/v2/internal/config_service_v2_tracing_connection.h b/google/cloud/logging/v2/internal/config_service_v2_tracing_connection.h index c672bdfa5bf8e..5ade530f88dd1 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_tracing_connection.h +++ b/google/cloud/logging/v2/internal/config_service_v2_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace logging_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConfigServiceV2TracingConnection : public logging_v2::ConfigServiceV2Connection { public: @@ -184,8 +182,6 @@ class ConfigServiceV2TracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/logging/v2/internal/config_service_v2_tracing_stub.cc b/google/cloud/logging/v2/internal/config_service_v2_tracing_stub.cc index 9fc459e9e7392..90b3b12eb469b 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_tracing_stub.cc +++ b/google/cloud/logging/v2/internal/config_service_v2_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ConfigServiceV2TracingStub::ConfigServiceV2TracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -536,18 +537,14 @@ future ConfigServiceV2TracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeConfigServiceV2TracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/config_service_v2_tracing_stub.h b/google/cloud/logging/v2/internal/config_service_v2_tracing_stub.h index 6bc90c54f9c39..6cfde095235a1 100644 --- a/google/cloud/logging/v2/internal/config_service_v2_tracing_stub.h +++ b/google/cloud/logging/v2/internal/config_service_v2_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ConfigServiceV2TracingStub : public ConfigServiceV2Stub { public: ~ConfigServiceV2TracingStub() override = default; @@ -227,8 +228,6 @@ class ConfigServiceV2TracingStub : public ConfigServiceV2Stub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -243,4 +242,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_CONFIG_SERVICE_V2_TRACING_STUB_H diff --git a/google/cloud/logging/v2/internal/logging_service_v2_auth_decorator.cc b/google/cloud/logging/v2/internal/logging_service_v2_auth_decorator.cc index abbc49fe4ddaa..13e6225fb4afc 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_auth_decorator.cc +++ b/google/cloud/logging/v2/internal/logging_service_v2_auth_decorator.cc @@ -18,10 +18,13 @@ #include "google/cloud/logging/v2/internal/logging_service_v2_auth_decorator.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include +#include "google/logging/v2/logging.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -145,3 +148,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/logging_service_v2_auth_decorator.h b/google/cloud/logging/v2/internal/logging_service_v2_auth_decorator.h index c1488f0497b3b..3987ce9ca2c92 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_auth_decorator.h +++ b/google/cloud/logging/v2/internal/logging_service_v2_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_LOGGING_SERVICE_V2_AUTH_DECORATOR_H diff --git a/google/cloud/logging/v2/internal/logging_service_v2_logging_decorator.cc b/google/cloud/logging/v2/internal/logging_service_v2_logging_decorator.cc index 1f5cc12be4e5d..6f1ec7838ab40 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_logging_decorator.cc +++ b/google/cloud/logging/v2/internal/logging_service_v2_logging_decorator.cc @@ -20,12 +20,15 @@ #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 "google/logging/v2/logging.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -179,3 +182,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/logging_service_v2_logging_decorator.h b/google/cloud/logging/v2/internal/logging_service_v2_logging_decorator.h index c529e5c02c145..71f40c3b41ff5 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_logging_decorator.h +++ b/google/cloud/logging/v2/internal/logging_service_v2_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -98,4 +101,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_LOGGING_SERVICE_V2_LOGGING_DECORATOR_H diff --git a/google/cloud/logging/v2/internal/logging_service_v2_metadata_decorator.cc b/google/cloud/logging/v2/internal/logging_service_v2_metadata_decorator.cc index 9ed90374b7e04..e251baf18a728 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_metadata_decorator.cc +++ b/google/cloud/logging/v2/internal/logging_service_v2_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/logging/v2/internal/logging_service_v2_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/logging/v2/logging.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -152,3 +156,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/logging_service_v2_metadata_decorator.h b/google/cloud/logging/v2/internal/logging_service_v2_metadata_decorator.h index 2de1d3a3f1f6d..3cbd27e819aab 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_metadata_decorator.h +++ b/google/cloud/logging/v2/internal/logging_service_v2_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_LOGGING_SERVICE_V2_METADATA_DECORATOR_H diff --git a/google/cloud/logging/v2/internal/logging_service_v2_option_defaults.cc b/google/cloud/logging/v2/internal/logging_service_v2_option_defaults.cc index 3aee543b34a4b..c4408006c6ada 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_option_defaults.cc +++ b/google/cloud/logging/v2/internal/logging_service_v2_option_defaults.cc @@ -42,7 +42,7 @@ Options LoggingServiceV2DefaultOptions(Options options) { if (!options.has()) { options.set( logging_v2::LoggingServiceV2LimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/logging/v2/internal/logging_service_v2_stub.cc b/google/cloud/logging/v2/internal/logging_service_v2_stub.cc index 7ea868867b99b..75be03eea7e73 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_stub.cc +++ b/google/cloud/logging/v2/internal/logging_service_v2_stub.cc @@ -20,10 +20,13 @@ #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 "google/logging/v2/logging.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -166,3 +169,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/logging_service_v2_stub.h b/google/cloud/logging/v2/internal/logging_service_v2_stub.h index aeed66150c347..10501713bf6ca 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_stub.h +++ b/google/cloud/logging/v2/internal/logging_service_v2_stub.h @@ -25,11 +25,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/logging/v2/logging.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 logging_v2_internal { @@ -161,4 +164,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_LOGGING_SERVICE_V2_STUB_H diff --git a/google/cloud/logging/v2/internal/logging_service_v2_stub_factory.cc b/google/cloud/logging/v2/internal/logging_service_v2_stub_factory.cc index 43364800dfddd..5577d04b5d67e 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_stub_factory.cc +++ b/google/cloud/logging/v2/internal/logging_service_v2_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/logging/v2/logging.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 logging_v2_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/logging_service_v2_stub_factory.h b/google/cloud/logging/v2/internal/logging_service_v2_stub_factory.h index 1ba74a1b49450..5145dbadcc87d 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_stub_factory.h +++ b/google/cloud/logging/v2/internal/logging_service_v2_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_LOGGING_SERVICE_V2_STUB_FACTORY_H diff --git a/google/cloud/logging/v2/internal/logging_service_v2_tracing_connection.cc b/google/cloud/logging/v2/internal/logging_service_v2_tracing_connection.cc index 2ac32c950c02c..3aaf90ff3a924 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_tracing_connection.cc +++ b/google/cloud/logging/v2/internal/logging_service_v2_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace logging_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LoggingServiceV2TracingConnection::LoggingServiceV2TracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -128,16 +126,12 @@ LoggingServiceV2TracingConnection::AsyncWriteLogEntries( child_->AsyncWriteLogEntries(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLoggingServiceV2TracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/logging/v2/internal/logging_service_v2_tracing_connection.h b/google/cloud/logging/v2/internal/logging_service_v2_tracing_connection.h index 158d11145d710..11f1362fcb9ed 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_tracing_connection.h +++ b/google/cloud/logging/v2/internal/logging_service_v2_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace logging_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LoggingServiceV2TracingConnection : public logging_v2::LoggingServiceV2Connection { public: @@ -79,8 +77,6 @@ class LoggingServiceV2TracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/logging/v2/internal/logging_service_v2_tracing_stub.cc b/google/cloud/logging/v2/internal/logging_service_v2_tracing_stub.cc index 2d1dbc5fa74a7..2b37308a3d285 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_tracing_stub.cc +++ b/google/cloud/logging/v2/internal/logging_service_v2_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LoggingServiceV2TracingStub::LoggingServiceV2TracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -161,18 +162,14 @@ LoggingServiceV2TracingStub::AsyncWriteLogEntries( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLoggingServiceV2TracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/logging_service_v2_tracing_stub.h b/google/cloud/logging/v2/internal/logging_service_v2_tracing_stub.h index a78f4509ccf2e..0a5350ac93b76 100644 --- a/google/cloud/logging/v2/internal/logging_service_v2_tracing_stub.h +++ b/google/cloud/logging/v2/internal/logging_service_v2_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LoggingServiceV2TracingStub : public LoggingServiceV2Stub { public: ~LoggingServiceV2TracingStub() override = default; @@ -94,8 +95,6 @@ class LoggingServiceV2TracingStub : public LoggingServiceV2Stub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -110,4 +109,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_LOGGING_SERVICE_V2_TRACING_STUB_H diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_auth_decorator.cc b/google/cloud/logging/v2/internal/metrics_service_v2_auth_decorator.cc index a2285a44ba552..262b190f69b10 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_auth_decorator.cc +++ b/google/cloud/logging/v2/internal/metrics_service_v2_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/logging/v2/logging_metrics.proto #include "google/cloud/logging/v2/internal/metrics_service_v2_auth_decorator.h" -#include +#include "google/logging/v2/logging_metrics.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -101,3 +104,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_auth_decorator.h b/google/cloud/logging/v2/internal/metrics_service_v2_auth_decorator.h index c0344058c7f7c..208ad6a25db28 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_auth_decorator.h +++ b/google/cloud/logging/v2/internal/metrics_service_v2_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -80,4 +83,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_METRICS_SERVICE_V2_AUTH_DECORATOR_H diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_logging_decorator.cc b/google/cloud/logging/v2/internal/metrics_service_v2_logging_decorator.cc index fb01c578b44b3..e6b57eac03a41 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_logging_decorator.cc +++ b/google/cloud/logging/v2/internal/metrics_service_v2_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/logging/v2/internal/metrics_service_v2_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/logging/v2/logging_metrics.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -131,3 +134,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_logging_decorator.h b/google/cloud/logging/v2/internal/metrics_service_v2_logging_decorator.h index 14662679fcad4..2ee9c9685a2a4 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_logging_decorator.h +++ b/google/cloud/logging/v2/internal/metrics_service_v2_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -80,4 +83,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_METRICS_SERVICE_V2_LOGGING_DECORATOR_H diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_metadata_decorator.cc b/google/cloud/logging/v2/internal/metrics_service_v2_metadata_decorator.cc index c49a2082e5c1f..77bd57211aa39 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_metadata_decorator.cc +++ b/google/cloud/logging/v2/internal/metrics_service_v2_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/logging/v2/internal/metrics_service_v2_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/logging/v2/logging_metrics.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -132,3 +136,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_metadata_decorator.h b/google/cloud/logging/v2/internal/metrics_service_v2_metadata_decorator.h index 7e6f87c7622ac..6607ae1976cc0 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_metadata_decorator.h +++ b/google/cloud/logging/v2/internal/metrics_service_v2_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -86,4 +89,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_METRICS_SERVICE_V2_METADATA_DECORATOR_H diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_option_defaults.cc b/google/cloud/logging/v2/internal/metrics_service_v2_option_defaults.cc index 48bc324840201..b7822f0b3a9af 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_option_defaults.cc +++ b/google/cloud/logging/v2/internal/metrics_service_v2_option_defaults.cc @@ -42,7 +42,7 @@ Options MetricsServiceV2DefaultOptions(Options options) { if (!options.has()) { options.set( logging_v2::MetricsServiceV2LimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_stub.cc b/google/cloud/logging/v2/internal/metrics_service_v2_stub.cc index 1d60a7f5e4685..388f3d60fb5cb 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_stub.cc +++ b/google/cloud/logging/v2/internal/metrics_service_v2_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/logging/v2/internal/metrics_service_v2_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/logging/v2/logging_metrics.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -128,3 +131,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_stub.h b/google/cloud/logging/v2/internal/metrics_service_v2_stub.h index 3f7f8db3688b1..fa5b88c333391 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_stub.h +++ b/google/cloud/logging/v2/internal/metrics_service_v2_stub.h @@ -22,11 +22,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/logging/v2/logging_metrics.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 logging_v2_internal { @@ -123,4 +126,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_METRICS_SERVICE_V2_STUB_H diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_stub_factory.cc b/google/cloud/logging/v2/internal/metrics_service_v2_stub_factory.cc index 9c366cae1ec71..68e0dcc799797 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_stub_factory.cc +++ b/google/cloud/logging/v2/internal/metrics_service_v2_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/logging/v2/logging_metrics.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 logging_v2_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_stub_factory.h b/google/cloud/logging/v2/internal/metrics_service_v2_stub_factory.h index 3064bab39deb2..f1ad409924ec1 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_stub_factory.h +++ b/google/cloud/logging/v2/internal/metrics_service_v2_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_METRICS_SERVICE_V2_STUB_FACTORY_H diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_tracing_connection.cc b/google/cloud/logging/v2/internal/metrics_service_v2_tracing_connection.cc index 824108069b52c..a17b5932d2215 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_tracing_connection.cc +++ b/google/cloud/logging/v2/internal/metrics_service_v2_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace logging_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MetricsServiceV2TracingConnection::MetricsServiceV2TracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -107,16 +105,12 @@ Status MetricsServiceV2TracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMetricsServiceV2TracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_tracing_connection.h b/google/cloud/logging/v2/internal/metrics_service_v2_tracing_connection.h index 393bd76128f6a..013d7594ae6ea 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_tracing_connection.h +++ b/google/cloud/logging/v2/internal/metrics_service_v2_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace logging_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MetricsServiceV2TracingConnection : public logging_v2::MetricsServiceV2Connection { public: @@ -68,8 +66,6 @@ class MetricsServiceV2TracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_tracing_stub.cc b/google/cloud/logging/v2/internal/metrics_service_v2_tracing_stub.cc index 1210a27aefaf9..aa3473b1f3b49 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_tracing_stub.cc +++ b/google/cloud/logging/v2/internal/metrics_service_v2_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MetricsServiceV2TracingStub::MetricsServiceV2TracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -126,18 +127,14 @@ Status MetricsServiceV2TracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMetricsServiceV2TracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace logging_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/logging/v2/internal/metrics_service_v2_tracing_stub.h b/google/cloud/logging/v2/internal/metrics_service_v2_tracing_stub.h index 9cc346d9a8f3f..6d226cf0c3da9 100644 --- a/google/cloud/logging/v2/internal/metrics_service_v2_tracing_stub.h +++ b/google/cloud/logging/v2/internal/metrics_service_v2_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace logging_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MetricsServiceV2TracingStub : public MetricsServiceV2Stub { public: ~MetricsServiceV2TracingStub() override = default; @@ -77,8 +78,6 @@ class MetricsServiceV2TracingStub : public MetricsServiceV2Stub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -93,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LOGGING_V2_INTERNAL_METRICS_SERVICE_V2_TRACING_STUB_H 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/logging_service_v2_connection.h b/google/cloud/logging/v2/logging_service_v2_connection.h index c87e8f144f52d..f42ce05571bb7 100644 --- a/google/cloud/logging/v2/logging_service_v2_connection.h +++ b/google/cloud/logging/v2/logging_service_v2_connection.h @@ -29,7 +29,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/logging/v2/logging.pb.h" #include namespace google { diff --git a/google/cloud/logging/v2/logging_service_v2_connection_idempotency_policy.h b/google/cloud/logging/v2/logging_service_v2_connection_idempotency_policy.h index b6ca281f9cb0f..acfb75c352876 100644 --- a/google/cloud/logging/v2/logging_service_v2_connection_idempotency_policy.h +++ b/google/cloud/logging/v2/logging_service_v2_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/logging/v2/logging.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/logging/v2/metrics_service_v2_connection.h b/google/cloud/logging/v2/metrics_service_v2_connection.h index cf8fdeaf9104c..ccf12201265b9 100644 --- a/google/cloud/logging/v2/metrics_service_v2_connection.h +++ b/google/cloud/logging/v2/metrics_service_v2_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/logging/v2/logging_metrics.pb.h" #include namespace google { diff --git a/google/cloud/logging/v2/metrics_service_v2_connection_idempotency_policy.h b/google/cloud/logging/v2/metrics_service_v2_connection_idempotency_policy.h index fbbc39fcfcd2c..0c784182d6ee7 100644 --- a/google/cloud/logging/v2/metrics_service_v2_connection_idempotency_policy.h +++ b/google/cloud/logging/v2/metrics_service_v2_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/logging/v2/logging_metrics.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/lustre/BUILD.bazel b/google/cloud/lustre/BUILD.bazel index eaf8d50b64934..e2c66201775f8 100644 --- a/google/cloud/lustre/BUILD.bazel +++ b/google/cloud/lustre/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/lustre/v1:lustre_cc_grpc", + "@googleapis//google/cloud/lustre/v1:lustre_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/lustre/quickstart/CMakeLists.txt b/google/cloud/lustre/quickstart/CMakeLists.txt index cd066fc248da3..a1c6355a191f1 100644 --- a/google/cloud/lustre/quickstart/CMakeLists.txt +++ b/google/cloud/lustre/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Google Cloud Managed Lustre API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-lustre-quickstart CXX) find_package(google_cloud_cpp_lustre REQUIRED) diff --git a/google/cloud/lustre/quickstart/WORKSPACE.bazel b/google/cloud/lustre/quickstart/WORKSPACE.bazel index 2423063efb236..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 = "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/lustre/v1/internal/lustre_auth_decorator.cc b/google/cloud/lustre/v1/internal/lustre_auth_decorator.cc index 6066c6830402f..7b5d4d6a72b4d 100644 --- a/google/cloud/lustre/v1/internal/lustre_auth_decorator.cc +++ b/google/cloud/lustre/v1/internal/lustre_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/lustre/v1/lustre.proto #include "google/cloud/lustre/v1/internal/lustre_auth_decorator.h" -#include +#include "google/cloud/lustre/v1/lustre.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace lustre_v1_internal { @@ -275,3 +278,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace lustre_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/lustre/v1/internal/lustre_auth_decorator.h b/google/cloud/lustre/v1/internal/lustre_auth_decorator.h index 225546e11d252..90dde89d259bb 100644 --- a/google/cloud/lustre/v1/internal/lustre_auth_decorator.h +++ b/google/cloud/lustre/v1/internal/lustre_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/lustre/v1/internal/lustre_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 lustre_v1_internal { @@ -143,4 +146,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LUSTRE_V1_INTERNAL_LUSTRE_AUTH_DECORATOR_H diff --git a/google/cloud/lustre/v1/internal/lustre_connection_impl.h b/google/cloud/lustre/v1/internal/lustre_connection_impl.h index b37647d31ec30..5a13e247515b1 100644 --- a/google/cloud/lustre/v1/internal/lustre_connection_impl.h +++ b/google/cloud/lustre/v1/internal/lustre_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/lustre/v1/internal/lustre_logging_decorator.cc b/google/cloud/lustre/v1/internal/lustre_logging_decorator.cc index a2ad275095445..92afed5fc3440 100644 --- a/google/cloud/lustre/v1/internal/lustre_logging_decorator.cc +++ b/google/cloud/lustre/v1/internal/lustre_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/lustre/v1/lustre.proto #include "google/cloud/lustre/v1/internal/lustre_logging_decorator.h" +#include "google/cloud/lustre/v1/lustre.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace lustre_v1_internal { @@ -308,3 +311,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace lustre_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/lustre/v1/internal/lustre_logging_decorator.h b/google/cloud/lustre/v1/internal/lustre_logging_decorator.h index 36e666c4f0007..c796ea8f65c56 100644 --- a/google/cloud/lustre/v1/internal/lustre_logging_decorator.h +++ b/google/cloud/lustre/v1/internal/lustre_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/lustre/v1/internal/lustre_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 lustre_v1_internal { @@ -143,4 +146,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LUSTRE_V1_INTERNAL_LUSTRE_LOGGING_DECORATOR_H diff --git a/google/cloud/lustre/v1/internal/lustre_metadata_decorator.cc b/google/cloud/lustre/v1/internal/lustre_metadata_decorator.cc index 5750105bf4e84..781b2c48736fd 100644 --- a/google/cloud/lustre/v1/internal/lustre_metadata_decorator.cc +++ b/google/cloud/lustre/v1/internal/lustre_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/lustre/v1/lustre.proto #include "google/cloud/lustre/v1/internal/lustre_metadata_decorator.h" +#include "google/cloud/lustre/v1/lustre.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 lustre_v1_internal { @@ -253,3 +257,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace lustre_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/lustre/v1/internal/lustre_metadata_decorator.h b/google/cloud/lustre/v1/internal/lustre_metadata_decorator.h index ded7c40fba5c6..fa9d89fb62fa2 100644 --- a/google/cloud/lustre/v1/internal/lustre_metadata_decorator.h +++ b/google/cloud/lustre/v1/internal/lustre_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/lustre/v1/internal/lustre_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 lustre_v1_internal { @@ -148,4 +151,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LUSTRE_V1_INTERNAL_LUSTRE_METADATA_DECORATOR_H diff --git a/google/cloud/lustre/v1/internal/lustre_option_defaults.cc b/google/cloud/lustre/v1/internal/lustre_option_defaults.cc index 3be3b3e43ff68..5aed7ae7158e0 100644 --- a/google/cloud/lustre/v1/internal/lustre_option_defaults.cc +++ b/google/cloud/lustre/v1/internal/lustre_option_defaults.cc @@ -40,7 +40,7 @@ Options LustreDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - lustre_v1::LustreLimitedTimeRetryPolicy(std::chrono::minutes(30)) + lustre_v1::LustreLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/lustre/v1/internal/lustre_stub.cc b/google/cloud/lustre/v1/internal/lustre_stub.cc index 2e8f2aa4ca993..046a5b23c11c0 100644 --- a/google/cloud/lustre/v1/internal/lustre_stub.cc +++ b/google/cloud/lustre/v1/internal/lustre_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/lustre/v1/lustre.proto #include "google/cloud/lustre/v1/internal/lustre_stub.h" +#include "google/cloud/lustre/v1/lustre.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace lustre_v1_internal { @@ -310,3 +313,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace lustre_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/lustre/v1/internal/lustre_stub.h b/google/cloud/lustre/v1/internal/lustre_stub.h index ca1ad14e6387c..614fd9dd87bbb 100644 --- a/google/cloud/lustre/v1/internal/lustre_stub.h +++ b/google/cloud/lustre/v1/internal/lustre_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LUSTRE_V1_INTERNAL_LUSTRE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LUSTRE_V1_INTERNAL_LUSTRE_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/lustre/v1/lustre.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace lustre_v1_internal { @@ -256,4 +259,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LUSTRE_V1_INTERNAL_LUSTRE_STUB_H diff --git a/google/cloud/lustre/v1/internal/lustre_stub_factory.cc b/google/cloud/lustre/v1/internal/lustre_stub_factory.cc index b4fc934c8745a..f2d3a5723379b 100644 --- a/google/cloud/lustre/v1/internal/lustre_stub_factory.cc +++ b/google/cloud/lustre/v1/internal/lustre_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/lustre/v1/lustre.proto #include "google/cloud/lustre/v1/internal/lustre_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/lustre/v1/internal/lustre_auth_decorator.h" #include "google/cloud/lustre/v1/internal/lustre_logging_decorator.h" #include "google/cloud/lustre/v1/internal/lustre_metadata_decorator.h" #include "google/cloud/lustre/v1/internal/lustre_stub.h" #include "google/cloud/lustre/v1/internal/lustre_tracing_stub.h" +#include "google/cloud/lustre/v1/lustre.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace lustre_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace lustre_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/lustre/v1/internal/lustre_stub_factory.h b/google/cloud/lustre/v1/internal/lustre_stub_factory.h index 17ebe161e024d..4da3f0f21d261 100644 --- a/google/cloud/lustre/v1/internal/lustre_stub_factory.h +++ b/google/cloud/lustre/v1/internal/lustre_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace lustre_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LUSTRE_V1_INTERNAL_LUSTRE_STUB_FACTORY_H diff --git a/google/cloud/lustre/v1/internal/lustre_tracing_connection.cc b/google/cloud/lustre/v1/internal/lustre_tracing_connection.cc index 28ec107c7b880..b5189320f0b18 100644 --- a/google/cloud/lustre/v1/internal/lustre_tracing_connection.cc +++ b/google/cloud/lustre/v1/internal/lustre_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace lustre_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LustreTracingConnection::LustreTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -226,15 +224,11 @@ Status LustreTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLustreTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/lustre/v1/internal/lustre_tracing_connection.h b/google/cloud/lustre/v1/internal/lustre_tracing_connection.h index dffb73fb1c79e..c06649f88bc2b 100644 --- a/google/cloud/lustre/v1/internal/lustre_tracing_connection.h +++ b/google/cloud/lustre/v1/internal/lustre_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace lustre_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LustreTracingConnection : public lustre_v1::LustreConnection { public: ~LustreTracingConnection() override = default; @@ -117,8 +115,6 @@ class LustreTracingConnection : public lustre_v1::LustreConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/lustre/v1/internal/lustre_tracing_stub.cc b/google/cloud/lustre/v1/internal/lustre_tracing_stub.cc index 79f3fe2d5db91..a85da907f661b 100644 --- a/google/cloud/lustre/v1/internal/lustre_tracing_stub.cc +++ b/google/cloud/lustre/v1/internal/lustre_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace lustre_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LustreTracingStub::LustreTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -278,18 +279,14 @@ future LustreTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLustreTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace lustre_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/lustre/v1/internal/lustre_tracing_stub.h b/google/cloud/lustre/v1/internal/lustre_tracing_stub.h index 173089ceb8f9b..4a11b1802d1cd 100644 --- a/google/cloud/lustre/v1/internal/lustre_tracing_stub.h +++ b/google/cloud/lustre/v1/internal/lustre_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace lustre_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LustreTracingStub : public LustreStub { public: ~LustreTracingStub() override = default; @@ -138,8 +139,6 @@ class LustreTracingStub : public LustreStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -154,4 +153,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LUSTRE_V1_INTERNAL_LUSTRE_TRACING_STUB_H diff --git a/google/cloud/lustre/v1/lustre_client.h b/google/cloud/lustre/v1/lustre_client.h index f50155155ddbe..213553864c400 100644 --- a/google/cloud/lustre/v1/lustre_client.h +++ b/google/cloud/lustre/v1/lustre_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/lustre/v1/lustre_connection.h b/google/cloud/lustre/v1/lustre_connection.h index 5c88579e23196..2df5eda3b63b3 100644 --- a/google/cloud/lustre/v1/lustre_connection.h +++ b/google/cloud/lustre/v1/lustre_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LUSTRE_V1_LUSTRE_CONNECTION_H #include "google/cloud/lustre/v1/internal/lustre_retry_traits.h" +#include "google/cloud/lustre/v1/lustre.pb.h" #include "google/cloud/lustre/v1/lustre_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/lustre/v1/lustre_connection_idempotency_policy.h b/google/cloud/lustre/v1/lustre_connection_idempotency_policy.h index 004a6ee2245da..5f5cdd4033b28 100644 --- a/google/cloud/lustre/v1/lustre_connection_idempotency_policy.h +++ b/google/cloud/lustre/v1/lustre_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LUSTRE_V1_LUSTRE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_LUSTRE_V1_LUSTRE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/lustre/v1/lustre.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/maintenance/BUILD.bazel b/google/cloud/maintenance/BUILD.bazel index cf5798ac153c8..ef39f3aafc06b 100644 --- a/google/cloud/maintenance/BUILD.bazel +++ b/google/cloud/maintenance/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["api/v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/maintenance/api/v1:api_cc_grpc", + "@googleapis//google/cloud/maintenance/api/v1:api_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_auth_decorator.cc b/google/cloud/maintenance/api/v1/internal/maintenance_auth_decorator.cc index 12c849222bbb8..b69af40037177 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_auth_decorator.cc +++ b/google/cloud/maintenance/api/v1/internal/maintenance_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/maintenance/api/v1/maintenance_service.proto #include "google/cloud/maintenance/api/v1/internal/maintenance_auth_decorator.h" -#include +#include "google/cloud/maintenance/api/v1/maintenance_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace maintenance_api_v1_internal { @@ -82,3 +85,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace maintenance_api_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_auth_decorator.h b/google/cloud/maintenance/api/v1/internal/maintenance_auth_decorator.h index b1da373d72353..101f2bb0ee4a9 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_auth_decorator.h +++ b/google/cloud/maintenance/api/v1/internal/maintenance_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace maintenance_api_v1_internal { @@ -75,4 +78,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MAINTENANCE_API_V1_INTERNAL_MAINTENANCE_AUTH_DECORATOR_H diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_logging_decorator.cc b/google/cloud/maintenance/api/v1/internal/maintenance_logging_decorator.cc index ba682f875d899..862b809146fe2 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_logging_decorator.cc +++ b/google/cloud/maintenance/api/v1/internal/maintenance_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/maintenance/api/v1/maintenance_service.proto #include "google/cloud/maintenance/api/v1/internal/maintenance_logging_decorator.h" +#include "google/cloud/maintenance/api/v1/maintenance_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace maintenance_api_v1_internal { @@ -104,3 +107,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace maintenance_api_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_logging_decorator.h b/google/cloud/maintenance/api/v1/internal/maintenance_logging_decorator.h index 2db95aa4b94c4..f117cc79ffc98 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_logging_decorator.h +++ b/google/cloud/maintenance/api/v1/internal/maintenance_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace maintenance_api_v1_internal { @@ -75,4 +78,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MAINTENANCE_API_V1_INTERNAL_MAINTENANCE_LOGGING_DECORATOR_H diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_metadata_decorator.cc b/google/cloud/maintenance/api/v1/internal/maintenance_metadata_decorator.cc index ba0b8f4d8eb75..d65e1c2379b33 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_metadata_decorator.cc +++ b/google/cloud/maintenance/api/v1/internal/maintenance_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/maintenance/api/v1/maintenance_service.proto #include "google/cloud/maintenance/api/v1/internal/maintenance_metadata_decorator.h" +#include "google/cloud/maintenance/api/v1/maintenance_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 maintenance_api_v1_internal { @@ -108,3 +112,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace maintenance_api_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_metadata_decorator.h b/google/cloud/maintenance/api/v1/internal/maintenance_metadata_decorator.h index 17162f959da96..3b1c7e206c852 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_metadata_decorator.h +++ b/google/cloud/maintenance/api/v1/internal/maintenance_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace maintenance_api_v1_internal { @@ -80,4 +83,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MAINTENANCE_API_V1_INTERNAL_MAINTENANCE_METADATA_DECORATOR_H diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_option_defaults.cc b/google/cloud/maintenance/api/v1/internal/maintenance_option_defaults.cc index 2d206f3117bc7..80b87820e3d62 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_option_defaults.cc +++ b/google/cloud/maintenance/api/v1/internal/maintenance_option_defaults.cc @@ -41,7 +41,7 @@ Options MaintenanceDefaultOptions(Options options) { if (!options.has()) { options.set( maintenance_api_v1::MaintenanceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_stub.cc b/google/cloud/maintenance/api/v1/internal/maintenance_stub.cc index 6dac7ea723488..2daa739cae1b3 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_stub.cc +++ b/google/cloud/maintenance/api/v1/internal/maintenance_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/maintenance/api/v1/maintenance_service.proto #include "google/cloud/maintenance/api/v1/internal/maintenance_stub.h" +#include "google/cloud/maintenance/api/v1/maintenance_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace maintenance_api_v1_internal { @@ -99,3 +102,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace maintenance_api_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_stub.h b/google/cloud/maintenance/api/v1/internal/maintenance_stub.h index 3ba6c401bd892..432b5d4a8c83a 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_stub.h +++ b/google/cloud/maintenance/api/v1/internal/maintenance_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MAINTENANCE_API_V1_INTERNAL_MAINTENANCE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MAINTENANCE_API_V1_INTERNAL_MAINTENANCE_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/maintenance/api/v1/maintenance_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace maintenance_api_v1_internal { @@ -117,4 +120,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MAINTENANCE_API_V1_INTERNAL_MAINTENANCE_STUB_H diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_stub_factory.cc b/google/cloud/maintenance/api/v1/internal/maintenance_stub_factory.cc index 5ddce7b471d14..d64b29fd6c1fb 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_stub_factory.cc +++ b/google/cloud/maintenance/api/v1/internal/maintenance_stub_factory.cc @@ -17,22 +17,25 @@ // source: google/cloud/maintenance/api/v1/maintenance_service.proto #include "google/cloud/maintenance/api/v1/internal/maintenance_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/maintenance/api/v1/internal/maintenance_auth_decorator.h" #include "google/cloud/maintenance/api/v1/internal/maintenance_logging_decorator.h" #include "google/cloud/maintenance/api/v1/internal/maintenance_metadata_decorator.h" #include "google/cloud/maintenance/api/v1/internal/maintenance_stub.h" #include "google/cloud/maintenance/api/v1/internal/maintenance_tracing_stub.h" +#include "google/cloud/maintenance/api/v1/maintenance_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 -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace maintenance_api_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace maintenance_api_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_stub_factory.h b/google/cloud/maintenance/api/v1/internal/maintenance_stub_factory.h index 25816146c90a4..6396ffdfd4ddd 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_stub_factory.h +++ b/google/cloud/maintenance/api/v1/internal/maintenance_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace maintenance_api_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MAINTENANCE_API_V1_INTERNAL_MAINTENANCE_STUB_FACTORY_H diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_tracing_connection.cc b/google/cloud/maintenance/api/v1/internal/maintenance_tracing_connection.cc index abd4fe5f63e5b..2ea2a41e6ccf0 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_tracing_connection.cc +++ b/google/cloud/maintenance/api/v1/internal/maintenance_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace maintenance_api_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MaintenanceTracingConnection::MaintenanceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -88,16 +86,12 @@ MaintenanceTracingConnection::GetLocation( return internal::EndSpan(*span, child_->GetLocation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMaintenanceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_tracing_connection.h b/google/cloud/maintenance/api/v1/internal/maintenance_tracing_connection.h index ec06d8212fdf8..1c9a3a7a76270 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_tracing_connection.h +++ b/google/cloud/maintenance/api/v1/internal/maintenance_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace maintenance_api_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MaintenanceTracingConnection : public maintenance_api_v1::MaintenanceConnection { public: @@ -65,8 +63,6 @@ class MaintenanceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_tracing_stub.cc b/google/cloud/maintenance/api/v1/internal/maintenance_tracing_stub.cc index cd8bf45a94bd4..68406995b2991 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_tracing_stub.cc +++ b/google/cloud/maintenance/api/v1/internal/maintenance_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace maintenance_api_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MaintenanceTracingStub::MaintenanceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -97,18 +98,14 @@ StatusOr MaintenanceTracingStub::GetLocation( child_->GetLocation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMaintenanceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace maintenance_api_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/maintenance/api/v1/internal/maintenance_tracing_stub.h b/google/cloud/maintenance/api/v1/internal/maintenance_tracing_stub.h index f4d9ffbe7653d..3dd2aad54a586 100644 --- a/google/cloud/maintenance/api/v1/internal/maintenance_tracing_stub.h +++ b/google/cloud/maintenance/api/v1/internal/maintenance_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace maintenance_api_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MaintenanceTracingStub : public MaintenanceStub { public: ~MaintenanceTracingStub() override = default; @@ -71,8 +72,6 @@ class MaintenanceTracingStub : public MaintenanceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -87,4 +86,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MAINTENANCE_API_V1_INTERNAL_MAINTENANCE_TRACING_STUB_H diff --git a/google/cloud/maintenance/api/v1/maintenance_connection.h b/google/cloud/maintenance/api/v1/maintenance_connection.h index 05a6787fcccd9..d0c62a79e43e8 100644 --- a/google/cloud/maintenance/api/v1/maintenance_connection.h +++ b/google/cloud/maintenance/api/v1/maintenance_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/maintenance/api/v1/internal/maintenance_retry_traits.h" #include "google/cloud/maintenance/api/v1/maintenance_connection_idempotency_policy.h" +#include "google/cloud/maintenance/api/v1/maintenance_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 #include namespace google { diff --git a/google/cloud/maintenance/api/v1/maintenance_connection_idempotency_policy.h b/google/cloud/maintenance/api/v1/maintenance_connection_idempotency_policy.h index 64fd90f857127..190167af2f2c6 100644 --- a/google/cloud/maintenance/api/v1/maintenance_connection_idempotency_policy.h +++ b/google/cloud/maintenance/api/v1/maintenance_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MAINTENANCE_API_V1_MAINTENANCE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MAINTENANCE_API_V1_MAINTENANCE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/maintenance/api/v1/maintenance_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/maintenance/quickstart/CMakeLists.txt b/google/cloud/maintenance/quickstart/CMakeLists.txt index a1e751ba97a3b..61a2bf08c3d40 100644 --- a/google/cloud/maintenance/quickstart/CMakeLists.txt +++ b/google/cloud/maintenance/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Maintenance API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-maintenance-quickstart CXX) find_package(google_cloud_cpp_maintenance REQUIRED) diff --git a/google/cloud/maintenance/quickstart/WORKSPACE.bazel b/google/cloud/maintenance/quickstart/WORKSPACE.bazel index 498f58f67abd5..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 = "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/managedidentities/BUILD.bazel b/google/cloud/managedidentities/BUILD.bazel index f2c84e9344b89..950c20635600e 100644 --- a/google/cloud/managedidentities/BUILD.bazel +++ b/google/cloud/managedidentities/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/managedidentities/v1:managedidentities_cc_grpc", + "@googleapis//google/cloud/managedidentities/v1:managedidentities_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/managedidentities/CMakeLists.txt b/google/cloud/managedidentities/CMakeLists.txt index 5d2cdc2e1c187..c15aca14518a5 100644 --- a/google/cloud/managedidentities/CMakeLists.txt +++ b/google/cloud/managedidentities/CMakeLists.txt @@ -18,7 +18,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( managedidentities "Managed Service for Microsoft Active Directory API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(managedidentities_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/managedidentities/managed_identities_client.h b/google/cloud/managedidentities/managed_identities_client.h deleted file mode 100644 index a755ff28f2ec9..0000000000000 --- a/google/cloud/managedidentities/managed_identities_client.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/managedidentities/v1/managed_identities_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MANAGED_IDENTITIES_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MANAGED_IDENTITIES_CLIENT_H - -#include "google/cloud/managedidentities/managed_identities_connection.h" -#include "google/cloud/managedidentities/v1/managed_identities_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in managedidentities_v1 instead of the aliases defined in -/// this namespace. -namespace managedidentities { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use managedidentities_v1::ManagedIdentitiesServiceClient -/// directly. -using ::google::cloud::managedidentities_v1::ManagedIdentitiesServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace managedidentities -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MANAGED_IDENTITIES_CLIENT_H diff --git a/google/cloud/managedidentities/managed_identities_connection.h b/google/cloud/managedidentities/managed_identities_connection.h deleted file mode 100644 index 2eaa141623afa..0000000000000 --- a/google/cloud/managedidentities/managed_identities_connection.h +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/managedidentities/v1/managed_identities_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MANAGED_IDENTITIES_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MANAGED_IDENTITIES_CONNECTION_H - -#include "google/cloud/managedidentities/managed_identities_connection_idempotency_policy.h" -#include "google/cloud/managedidentities/v1/managed_identities_connection.h" - -namespace google { -namespace cloud { -namespace managedidentities { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use managedidentities_v1::MakeManagedIdentitiesServiceConnection -/// directly. -using ::google::cloud::managedidentities_v1:: - MakeManagedIdentitiesServiceConnection; - -/// @deprecated Use managedidentities_v1::ManagedIdentitiesServiceConnection -/// directly. -using ::google::cloud::managedidentities_v1::ManagedIdentitiesServiceConnection; - -/// @deprecated Use -/// managedidentities_v1::ManagedIdentitiesServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::managedidentities_v1:: - ManagedIdentitiesServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// managedidentities_v1::ManagedIdentitiesServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::managedidentities_v1:: - ManagedIdentitiesServiceLimitedTimeRetryPolicy; - -/// @deprecated Use managedidentities_v1::ManagedIdentitiesServiceRetryPolicy -/// directly. -using ::google::cloud::managedidentities_v1:: - ManagedIdentitiesServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace managedidentities -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MANAGED_IDENTITIES_CONNECTION_H diff --git a/google/cloud/managedidentities/managed_identities_connection_idempotency_policy.h b/google/cloud/managedidentities/managed_identities_connection_idempotency_policy.h deleted file mode 100644 index f5bd8ac9977d5..0000000000000 --- a/google/cloud/managedidentities/managed_identities_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/managedidentities/v1/managed_identities_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MANAGED_IDENTITIES_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MANAGED_IDENTITIES_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/managedidentities/v1/managed_identities_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace managedidentities { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// managedidentities_v1::MakeDefaultManagedIdentitiesServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::managedidentities_v1:: - MakeDefaultManagedIdentitiesServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// managedidentities_v1::ManagedIdentitiesServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::managedidentities_v1:: - ManagedIdentitiesServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace managedidentities -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MANAGED_IDENTITIES_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/managedidentities/managed_identities_options.h b/google/cloud/managedidentities/managed_identities_options.h deleted file mode 100644 index 52a9874d016b1..0000000000000 --- a/google/cloud/managedidentities/managed_identities_options.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/managedidentities/v1/managed_identities_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MANAGED_IDENTITIES_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MANAGED_IDENTITIES_OPTIONS_H - -#include "google/cloud/managedidentities/managed_identities_connection.h" -#include "google/cloud/managedidentities/managed_identities_connection_idempotency_policy.h" -#include "google/cloud/managedidentities/v1/managed_identities_options.h" - -namespace google { -namespace cloud { -namespace managedidentities { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// managedidentities_v1::ManagedIdentitiesServicePollingPolicyOption directly. -using ::google::cloud::managedidentities_v1:: - ManagedIdentitiesServicePollingPolicyOption; - -/// @deprecated Use -/// managedidentities_v1::ManagedIdentitiesServiceBackoffPolicyOption directly. -using ::google::cloud::managedidentities_v1:: - ManagedIdentitiesServiceBackoffPolicyOption; - -/// @deprecated Use -/// managedidentities_v1::ManagedIdentitiesServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::managedidentities_v1:: - ManagedIdentitiesServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use -/// managedidentities_v1::ManagedIdentitiesServicePolicyOptionList directly. -using ::google::cloud::managedidentities_v1:: - ManagedIdentitiesServicePolicyOptionList; - -/// @deprecated Use -/// managedidentities_v1::ManagedIdentitiesServiceRetryPolicyOption directly. -using ::google::cloud::managedidentities_v1:: - ManagedIdentitiesServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace managedidentities -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MANAGED_IDENTITIES_OPTIONS_H diff --git a/google/cloud/managedidentities/mocks/mock_managed_identities_connection.h b/google/cloud/managedidentities/mocks/mock_managed_identities_connection.h deleted file mode 100644 index 067518b2eb13d..0000000000000 --- a/google/cloud/managedidentities/mocks/mock_managed_identities_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/managedidentities/v1/managed_identities_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MOCKS_MOCK_MANAGED_IDENTITIES_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MOCKS_MOCK_MANAGED_IDENTITIES_CONNECTION_H - -#include "google/cloud/managedidentities/managed_identities_connection.h" -#include "google/cloud/managedidentities/v1/mocks/mock_managed_identities_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in managedidentities_v1_mocks instead of the aliases -/// defined in this namespace. -namespace managedidentities_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// managedidentities_v1_mocks::MockManagedIdentitiesServiceConnection directly. -using ::google::cloud::managedidentities_v1_mocks:: - MockManagedIdentitiesServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace managedidentities_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_MOCKS_MOCK_MANAGED_IDENTITIES_CONNECTION_H diff --git a/google/cloud/managedidentities/quickstart/.bazelrc b/google/cloud/managedidentities/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/managedidentities/quickstart/.bazelrc +++ b/google/cloud/managedidentities/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/managedidentities/quickstart/CMakeLists.txt index fc6b408158a57..1266dcbed0d44 100644 --- a/google/cloud/managedidentities/quickstart/CMakeLists.txt +++ b/google/cloud/managedidentities/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Managed Service for Microsoft Active Directory # API C++ client library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-managedidentities-quickstart CXX) find_package(google_cloud_cpp_managedidentities REQUIRED) diff --git a/google/cloud/managedidentities/quickstart/WORKSPACE.bazel b/google/cloud/managedidentities/quickstart/WORKSPACE.bazel index 19f5eae6b8e95..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 = "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/managedidentities/v1/internal/managed_identities_auth_decorator.cc b/google/cloud/managedidentities/v1/internal/managed_identities_auth_decorator.cc index 815944687727a..e70eba5346204 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_auth_decorator.cc +++ b/google/cloud/managedidentities/v1/internal/managed_identities_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/managedidentities/v1/managed_identities_service.proto #include "google/cloud/managedidentities/v1/internal/managed_identities_auth_decorator.h" -#include +#include "google/cloud/managedidentities/v1/managed_identities_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedidentities_v1_internal { @@ -306,3 +309,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedidentities_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedidentities/v1/internal/managed_identities_auth_decorator.h b/google/cloud/managedidentities/v1/internal/managed_identities_auth_decorator.h index a46235eefca6d..f73c605453221 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_auth_decorator.h +++ b/google/cloud/managedidentities/v1/internal/managed_identities_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/managedidentities/v1/internal/managed_identities_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 managedidentities_v1_internal { @@ -161,4 +164,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_V1_INTERNAL_MANAGED_IDENTITIES_AUTH_DECORATOR_H diff --git a/google/cloud/managedidentities/v1/internal/managed_identities_connection_impl.h b/google/cloud/managedidentities/v1/internal/managed_identities_connection_impl.h index f2b2e1fdf5edd..a6de2e870072d 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_connection_impl.h +++ b/google/cloud/managedidentities/v1/internal/managed_identities_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/managedidentities/v1/internal/managed_identities_logging_decorator.cc b/google/cloud/managedidentities/v1/internal/managed_identities_logging_decorator.cc index 58fee0ea35e51..4b5feef429c56 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_logging_decorator.cc +++ b/google/cloud/managedidentities/v1/internal/managed_identities_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/managedidentities/v1/managed_identities_service.proto #include "google/cloud/managedidentities/v1/internal/managed_identities_logging_decorator.h" +#include "google/cloud/managedidentities/v1/managed_identities_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedidentities_v1_internal { @@ -345,3 +348,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedidentities_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedidentities/v1/internal/managed_identities_logging_decorator.h b/google/cloud/managedidentities/v1/internal/managed_identities_logging_decorator.h index 1641678ae7bf8..4792cd8071afe 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_logging_decorator.h +++ b/google/cloud/managedidentities/v1/internal/managed_identities_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/managedidentities/v1/internal/managed_identities_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 managedidentities_v1_internal { @@ -161,4 +164,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_V1_INTERNAL_MANAGED_IDENTITIES_LOGGING_DECORATOR_H diff --git a/google/cloud/managedidentities/v1/internal/managed_identities_metadata_decorator.cc b/google/cloud/managedidentities/v1/internal/managed_identities_metadata_decorator.cc index 238fdb013fa43..76bd429a07ef4 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_metadata_decorator.cc +++ b/google/cloud/managedidentities/v1/internal/managed_identities_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/managedidentities/v1/managed_identities_service.proto #include "google/cloud/managedidentities/v1/internal/managed_identities_metadata_decorator.h" +#include "google/cloud/managedidentities/v1/managed_identities_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 managedidentities_v1_internal { @@ -265,3 +269,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedidentities_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedidentities/v1/internal/managed_identities_metadata_decorator.h b/google/cloud/managedidentities/v1/internal/managed_identities_metadata_decorator.h index ec0423f1bc0d7..84b7aa14e1aba 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_metadata_decorator.h +++ b/google/cloud/managedidentities/v1/internal/managed_identities_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/managedidentities/v1/internal/managed_identities_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 managedidentities_v1_internal { @@ -167,4 +170,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_V1_INTERNAL_MANAGED_IDENTITIES_METADATA_DECORATOR_H diff --git a/google/cloud/managedidentities/v1/internal/managed_identities_option_defaults.cc b/google/cloud/managedidentities/v1/internal/managed_identities_option_defaults.cc index 3c12eb6d22edf..de3a4f0948199 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_option_defaults.cc +++ b/google/cloud/managedidentities/v1/internal/managed_identities_option_defaults.cc @@ -45,7 +45,7 @@ Options ManagedIdentitiesServiceDefaultOptions(Options options) { options.set< managedidentities_v1::ManagedIdentitiesServiceRetryPolicyOption>( managedidentities_v1::ManagedIdentitiesServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedidentities_v1_internal { @@ -334,3 +337,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedidentities_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedidentities/v1/internal/managed_identities_stub.h b/google/cloud/managedidentities/v1/internal/managed_identities_stub.h index bc9058c5242ff..38c4ed3eebc56 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_stub.h +++ b/google/cloud/managedidentities/v1/internal/managed_identities_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_V1_INTERNAL_MANAGED_IDENTITIES_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_V1_INTERNAL_MANAGED_IDENTITIES_STUB_H +#include "google/cloud/managedidentities/v1/managed_identities_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedidentities_v1_internal { @@ -291,4 +294,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_V1_INTERNAL_MANAGED_IDENTITIES_STUB_H diff --git a/google/cloud/managedidentities/v1/internal/managed_identities_stub_factory.cc b/google/cloud/managedidentities/v1/internal/managed_identities_stub_factory.cc index 2137964e2deff..058b6d454e473 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_stub_factory.cc +++ b/google/cloud/managedidentities/v1/internal/managed_identities_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/managedidentities/v1/internal/managed_identities_metadata_decorator.h" #include "google/cloud/managedidentities/v1/internal/managed_identities_stub.h" #include "google/cloud/managedidentities/v1/internal/managed_identities_tracing_stub.h" +#include "google/cloud/managedidentities/v1/managed_identities_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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedidentities_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedidentities_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedidentities/v1/internal/managed_identities_stub_factory.h b/google/cloud/managedidentities/v1/internal/managed_identities_stub_factory.h index b0f9c1d313ea2..feb5b3017598b 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_stub_factory.h +++ b/google/cloud/managedidentities/v1/internal/managed_identities_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedidentities_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_V1_INTERNAL_MANAGED_IDENTITIES_STUB_FACTORY_H diff --git a/google/cloud/managedidentities/v1/internal/managed_identities_tracing_connection.cc b/google/cloud/managedidentities/v1/internal/managed_identities_tracing_connection.cc index aa7bbaeb7ced9..21e72c0b11a0b 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_tracing_connection.cc +++ b/google/cloud/managedidentities/v1/internal/managed_identities_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace managedidentities_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ManagedIdentitiesServiceTracingConnection:: ManagedIdentitiesServiceTracingConnection( std::shared_ptr< @@ -282,18 +280,14 @@ ManagedIdentitiesServiceTracingConnection::ValidateTrust( return internal::EndSpan(std::move(span), child_->ValidateTrust(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeManagedIdentitiesServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/managedidentities/v1/internal/managed_identities_tracing_connection.h b/google/cloud/managedidentities/v1/internal/managed_identities_tracing_connection.h index 1b6143ae2ca09..53fc68353a504 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_tracing_connection.h +++ b/google/cloud/managedidentities/v1/internal/managed_identities_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace managedidentities_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ManagedIdentitiesServiceTracingConnection : public managedidentities_v1::ManagedIdentitiesServiceConnection { public: @@ -145,8 +143,6 @@ class ManagedIdentitiesServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/managedidentities/v1/internal/managed_identities_tracing_stub.cc b/google/cloud/managedidentities/v1/internal/managed_identities_tracing_stub.cc index ca5c27dada3ac..816f654e288d7 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_tracing_stub.cc +++ b/google/cloud/managedidentities/v1/internal/managed_identities_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedidentities_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ManagedIdentitiesServiceTracingStub::ManagedIdentitiesServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -303,19 +304,15 @@ future ManagedIdentitiesServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeManagedIdentitiesServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedidentities_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedidentities/v1/internal/managed_identities_tracing_stub.h b/google/cloud/managedidentities/v1/internal/managed_identities_tracing_stub.h index cc6b5a471095e..e7a476bb9601e 100644 --- a/google/cloud/managedidentities/v1/internal/managed_identities_tracing_stub.h +++ b/google/cloud/managedidentities/v1/internal/managed_identities_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedidentities_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ManagedIdentitiesServiceTracingStub : public ManagedIdentitiesServiceStub { public: @@ -158,8 +159,6 @@ class ManagedIdentitiesServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -175,4 +174,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_V1_INTERNAL_MANAGED_IDENTITIES_TRACING_STUB_H diff --git a/google/cloud/managedidentities/v1/managed_identities_client.h b/google/cloud/managedidentities/v1/managed_identities_client.h index 61b3075222917..38545ebca34c2 100644 --- a/google/cloud/managedidentities/v1/managed_identities_client.h +++ b/google/cloud/managedidentities/v1/managed_identities_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/managedidentities/v1/managed_identities_connection.h b/google/cloud/managedidentities/v1/managed_identities_connection.h index 5ea208286f079..eac36f1f034a0 100644 --- a/google/cloud/managedidentities/v1/managed_identities_connection.h +++ b/google/cloud/managedidentities/v1/managed_identities_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/managedidentities/v1/internal/managed_identities_retry_traits.h" #include "google/cloud/managedidentities/v1/managed_identities_connection_idempotency_policy.h" +#include "google/cloud/managedidentities/v1/managed_identities_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/managedidentities/v1/managed_identities_connection_idempotency_policy.h b/google/cloud/managedidentities/v1/managed_identities_connection_idempotency_policy.h index c1d45ab9302f9..69bafdd660b39 100644 --- a/google/cloud/managedidentities/v1/managed_identities_connection_idempotency_policy.h +++ b/google/cloud/managedidentities/v1/managed_identities_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_V1_MANAGED_IDENTITIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDIDENTITIES_V1_MANAGED_IDENTITIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/managedidentities/v1/managed_identities_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/managedkafka/BUILD.bazel b/google/cloud/managedkafka/BUILD.bazel index eceb9c4cbc999..80b1c6487c0d4 100644 --- a/google/cloud/managedkafka/BUILD.bazel +++ b/google/cloud/managedkafka/BUILD.bazel @@ -24,8 +24,8 @@ service_dirs = [ ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/managedkafka/v1:managedkafka_cc_grpc", - "@com_google_googleapis//google/cloud/managedkafka/schemaregistry/v1:schemaregistry_cc_grpc", + "@googleapis//google/cloud/managedkafka/v1:managedkafka_cc_grpc", + "@googleapis//google/cloud/managedkafka/schemaregistry/v1:schemaregistry_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/managedkafka/quickstart/.bazelrc b/google/cloud/managedkafka/quickstart/.bazelrc index 15d5c055db074..343e7f623d628 100644 --- a/google/cloud/managedkafka/quickstart/.bazelrc +++ b/google/cloud/managedkafka/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/managedkafka/quickstart/CMakeLists.txt index f3c75a7474e69..6a80ec93a10cd 100644 --- a/google/cloud/managedkafka/quickstart/CMakeLists.txt +++ b/google/cloud/managedkafka/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Managed Service for Apache Kafka API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-managedkafka-quickstart CXX) find_package(google_cloud_cpp_managedkafka REQUIRED) diff --git a/google/cloud/managedkafka/quickstart/WORKSPACE.bazel b/google/cloud/managedkafka/quickstart/WORKSPACE.bazel index 59c301726b2c8..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 = "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/managedkafka/schemaregistry/v1/internal/managed_schema_registry_auth_decorator.cc b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_auth_decorator.cc index 991ed02ec53c6..7ab8383cf4578 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_auth_decorator.cc +++ b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/managedkafka/schemaregistry/v1/schema_registry.proto #include "google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_auth_decorator.h" -#include +#include "google/cloud/managedkafka/schemaregistry/v1/schema_registry.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_schemaregistry_v1_internal { @@ -349,3 +352,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedkafka_schemaregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_auth_decorator.h b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_auth_decorator.h index 63f302df5be9b..caf3bbcff78fe 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_auth_decorator.h +++ b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_schemaregistry_v1_internal { @@ -211,4 +214,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_SCHEMAREGISTRY_V1_INTERNAL_MANAGED_SCHEMA_REGISTRY_AUTH_DECORATOR_H diff --git a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_logging_decorator.cc b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_logging_decorator.cc index 179463e086ebd..4bb65273fa660 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_logging_decorator.cc +++ b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/managedkafka/schemaregistry/v1/schema_registry.proto #include "google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_logging_decorator.h" +#include "google/cloud/managedkafka/schemaregistry/v1/schema_registry.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_schemaregistry_v1_internal { @@ -481,3 +484,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedkafka_schemaregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_logging_decorator.h b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_logging_decorator.h index eb3bb87d198e2..944a9a92972a6 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_logging_decorator.h +++ b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_schemaregistry_v1_internal { @@ -211,4 +214,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_SCHEMAREGISTRY_V1_INTERNAL_MANAGED_SCHEMA_REGISTRY_LOGGING_DECORATOR_H diff --git a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_metadata_decorator.cc b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_metadata_decorator.cc index 2ac281045db61..d8e31aed39bd0 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_metadata_decorator.cc +++ b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/managedkafka/schemaregistry/v1/schema_registry.proto #include "google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_metadata_decorator.h" +#include "google/cloud/managedkafka/schemaregistry/v1/schema_registry.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 managedkafka_schemaregistry_v1_internal { @@ -377,3 +381,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedkafka_schemaregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_metadata_decorator.h b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_metadata_decorator.h index cec490e242ce2..684c4be4fbc99 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_metadata_decorator.h +++ b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_schemaregistry_v1_internal { @@ -217,4 +220,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_SCHEMAREGISTRY_V1_INTERNAL_MANAGED_SCHEMA_REGISTRY_METADATA_DECORATOR_H diff --git a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_option_defaults.cc b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_option_defaults.cc index cd443abaf9f6e..691dcaa397300 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_option_defaults.cc +++ b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_option_defaults.cc @@ -45,7 +45,7 @@ Options ManagedSchemaRegistryDefaultOptions(Options options) { managedkafka_schemaregistry_v1::ManagedSchemaRegistryRetryPolicyOption>( managedkafka_schemaregistry_v1:: ManagedSchemaRegistryLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_schemaregistry_v1_internal { @@ -454,3 +457,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedkafka_schemaregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_stub.h b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_stub.h index 5bad438a7c9f6..d10a50eaf8d70 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_stub.h +++ b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_stub.h @@ -19,15 +19,18 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_SCHEMAREGISTRY_V1_INTERNAL_MANAGED_SCHEMA_REGISTRY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_SCHEMAREGISTRY_V1_INTERNAL_MANAGED_SCHEMA_REGISTRY_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/managedkafka/schemaregistry/v1/schema_registry.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_schemaregistry_v1_internal { @@ -403,4 +406,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_SCHEMAREGISTRY_V1_INTERNAL_MANAGED_SCHEMA_REGISTRY_STUB_H diff --git a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_stub_factory.cc b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_stub_factory.cc index 4550c34774fbf..83f19274a1a36 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_stub_factory.cc +++ b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/managedkafka/schemaregistry/v1/schema_registry.proto #include "google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_auth_decorator.h" #include "google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_logging_decorator.h" #include "google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_metadata_decorator.h" #include "google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_stub.h" #include "google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_stub.h" +#include "google/cloud/managedkafka/schemaregistry/v1/schema_registry.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_schemaregistry_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedkafka_schemaregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_stub_factory.h b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_stub_factory.h index 55d08dc8affdf..83277feeddbd7 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_stub_factory.h +++ b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_schemaregistry_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_SCHEMAREGISTRY_V1_INTERNAL_MANAGED_SCHEMA_REGISTRY_STUB_FACTORY_H diff --git a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_connection.cc b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_connection.cc index 3b12bc8f308b2..48ce5e8cc5ac7 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_connection.cc +++ b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace managedkafka_schemaregistry_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ManagedSchemaRegistryTracingConnection::ManagedSchemaRegistryTracingConnection( std::shared_ptr< managedkafka_schemaregistry_v1::ManagedSchemaRegistryConnection> @@ -395,19 +393,15 @@ Status ManagedSchemaRegistryTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeManagedSchemaRegistryTracingConnection( std::shared_ptr< managedkafka_schemaregistry_v1::ManagedSchemaRegistryConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_connection.h b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_connection.h index 5ba2cc1d3907c..71baa9f5567e8 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_connection.h +++ b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace managedkafka_schemaregistry_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ManagedSchemaRegistryTracingConnection : public managedkafka_schemaregistry_v1::ManagedSchemaRegistryConnection { public: @@ -178,8 +176,6 @@ class ManagedSchemaRegistryTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_stub.cc b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_stub.cc index 774119d645d08..d13ea09cb3f05 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_stub.cc +++ b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_schemaregistry_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ManagedSchemaRegistryTracingStub::ManagedSchemaRegistryTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -482,18 +483,14 @@ Status ManagedSchemaRegistryTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeManagedSchemaRegistryTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedkafka_schemaregistry_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_stub.h b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_stub.h index 73b930b89f1c9..fe28d9e63bb96 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_stub.h +++ b/google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_schemaregistry_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ManagedSchemaRegistryTracingStub : public ManagedSchemaRegistryStub { public: ~ManagedSchemaRegistryTracingStub() override = default; @@ -208,8 +209,6 @@ class ManagedSchemaRegistryTracingStub : public ManagedSchemaRegistryStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -224,4 +223,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_SCHEMAREGISTRY_V1_INTERNAL_MANAGED_SCHEMA_REGISTRY_TRACING_STUB_H 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/schemaregistry/v1/managed_schema_registry_connection.h b/google/cloud/managedkafka/schemaregistry/v1/managed_schema_registry_connection.h index acdf9070692e2..4cb2eb6b0e8cc 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/managed_schema_registry_connection.h +++ b/google/cloud/managedkafka/schemaregistry/v1/managed_schema_registry_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/managedkafka/schemaregistry/v1/internal/managed_schema_registry_retry_traits.h" #include "google/cloud/managedkafka/schemaregistry/v1/managed_schema_registry_connection_idempotency_policy.h" +#include "google/cloud/managedkafka/schemaregistry/v1/schema_registry.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 #include namespace google { diff --git a/google/cloud/managedkafka/schemaregistry/v1/managed_schema_registry_connection_idempotency_policy.h b/google/cloud/managedkafka/schemaregistry/v1/managed_schema_registry_connection_idempotency_policy.h index 1ec4dcdfc7cdf..6cf04b1411228 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/managed_schema_registry_connection_idempotency_policy.h +++ b/google/cloud/managedkafka/schemaregistry/v1/managed_schema_registry_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_SCHEMAREGISTRY_V1_MANAGED_SCHEMA_REGISTRY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_SCHEMAREGISTRY_V1_MANAGED_SCHEMA_REGISTRY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/managedkafka/schemaregistry/v1/schema_registry.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_auth_decorator.cc b/google/cloud/managedkafka/v1/internal/managed_kafka_auth_decorator.cc index 82ce3c96faa5f..5e2a41aee43c2 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_auth_decorator.cc +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/managedkafka/v1/managed_kafka.proto #include "google/cloud/managedkafka/v1/internal/managed_kafka_auth_decorator.h" -#include +#include "google/cloud/managedkafka/v1/managed_kafka.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_v1_internal { @@ -359,3 +362,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedkafka_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_auth_decorator.h b/google/cloud/managedkafka/v1/internal/managed_kafka_auth_decorator.h index 86d1f24c91f31..8a653cd83513d 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_auth_decorator.h +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/managedkafka/v1/internal/managed_kafka_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 managedkafka_v1_internal { @@ -207,4 +210,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_V1_INTERNAL_MANAGED_KAFKA_AUTH_DECORATOR_H diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_connection_impl.h b/google/cloud/managedkafka/v1/internal/managed_kafka_connection_impl.h index 098e36eb2f311..308618d70d139 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_connection_impl.h +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_logging_decorator.cc b/google/cloud/managedkafka/v1/internal/managed_kafka_logging_decorator.cc index 9a2e6c0d243ff..6b5537bf721a6 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_logging_decorator.cc +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/managedkafka/v1/managed_kafka.proto #include "google/cloud/managedkafka/v1/internal/managed_kafka_logging_decorator.h" +#include "google/cloud/managedkafka/v1/managed_kafka.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_v1_internal { @@ -458,3 +461,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedkafka_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_logging_decorator.h b/google/cloud/managedkafka/v1/internal/managed_kafka_logging_decorator.h index 7717f0f2d60f6..a5e2447b3a33a 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_logging_decorator.h +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/managedkafka/v1/internal/managed_kafka_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 managedkafka_v1_internal { @@ -207,4 +210,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_V1_INTERNAL_MANAGED_KAFKA_LOGGING_DECORATOR_H diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_metadata_decorator.cc b/google/cloud/managedkafka/v1/internal/managed_kafka_metadata_decorator.cc index bdc06e5562674..9aae0819924a4 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_metadata_decorator.cc +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/managedkafka/v1/managed_kafka.proto #include "google/cloud/managedkafka/v1/internal/managed_kafka_metadata_decorator.h" +#include "google/cloud/managedkafka/v1/managed_kafka.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 managedkafka_v1_internal { @@ -357,3 +361,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedkafka_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_metadata_decorator.h b/google/cloud/managedkafka/v1/internal/managed_kafka_metadata_decorator.h index a2f04524f9b3a..a933e32a252a5 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_metadata_decorator.h +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/managedkafka/v1/internal/managed_kafka_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 managedkafka_v1_internal { @@ -212,4 +215,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_V1_INTERNAL_MANAGED_KAFKA_METADATA_DECORATOR_H diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_option_defaults.cc b/google/cloud/managedkafka/v1/internal/managed_kafka_option_defaults.cc index ea4bf56fca16f..37e5833f3d4bf 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_option_defaults.cc +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_option_defaults.cc @@ -42,7 +42,7 @@ Options ManagedKafkaDefaultOptions(Options options) { if (!options.has()) { options.set( managedkafka_v1::ManagedKafkaLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_stub.cc b/google/cloud/managedkafka/v1/internal/managed_kafka_stub.cc index fb1eedf366ffa..12b644f9566ab 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_stub.cc +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/managedkafka/v1/managed_kafka.proto #include "google/cloud/managedkafka/v1/internal/managed_kafka_stub.h" +#include "google/cloud/managedkafka/v1/managed_kafka.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_v1_internal { @@ -447,3 +450,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedkafka_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_stub.h b/google/cloud/managedkafka/v1/internal/managed_kafka_stub.h index c2dd4fdb803da..87dba1e9312f7 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_stub.h +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_V1_INTERNAL_MANAGED_KAFKA_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_V1_INTERNAL_MANAGED_KAFKA_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/managedkafka/v1/managed_kafka.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_v1_internal { @@ -376,4 +379,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_V1_INTERNAL_MANAGED_KAFKA_STUB_H diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_stub_factory.cc b/google/cloud/managedkafka/v1/internal/managed_kafka_stub_factory.cc index bd7033102a8e9..2d9e363a101a0 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_stub_factory.cc +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/managedkafka/v1/managed_kafka.proto #include "google/cloud/managedkafka/v1/internal/managed_kafka_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/managedkafka/v1/internal/managed_kafka_auth_decorator.h" #include "google/cloud/managedkafka/v1/internal/managed_kafka_logging_decorator.h" #include "google/cloud/managedkafka/v1/internal/managed_kafka_metadata_decorator.h" #include "google/cloud/managedkafka/v1/internal/managed_kafka_stub.h" #include "google/cloud/managedkafka/v1/internal/managed_kafka_tracing_stub.h" +#include "google/cloud/managedkafka/v1/managed_kafka.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedkafka_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_stub_factory.h b/google/cloud/managedkafka/v1/internal/managed_kafka_stub_factory.h index 52025ea5e8d01..4ac1f308f9e0e 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_stub_factory.h +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_V1_INTERNAL_MANAGED_KAFKA_STUB_FACTORY_H diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_connection.cc b/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_connection.cc index c7c642124a45f..8b69d00e95ef8 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_connection.cc +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace managedkafka_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ManagedKafkaTracingConnection::ManagedKafkaTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -343,16 +341,12 @@ Status ManagedKafkaTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeManagedKafkaTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_connection.h b/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_connection.h index da1319aa883c3..420ab9a31e45c 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_connection.h +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace managedkafka_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ManagedKafkaTracingConnection : public managedkafka_v1::ManagedKafkaConnection { public: @@ -163,8 +161,6 @@ class ManagedKafkaTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_stub.cc b/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_stub.cc index 9df21a51b5377..69b25bd2b6304 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_stub.cc +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ManagedKafkaTracingStub::ManagedKafkaTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -418,18 +419,14 @@ future ManagedKafkaTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeManagedKafkaTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace managedkafka_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_stub.h b/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_stub.h index 1a3e8eb31d843..77c9902c2a0d1 100644 --- a/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_stub.h +++ b/google/cloud/managedkafka/v1/internal/managed_kafka_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace managedkafka_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ManagedKafkaTracingStub : public ManagedKafkaStub { public: ~ManagedKafkaTracingStub() override = default; @@ -202,8 +203,6 @@ class ManagedKafkaTracingStub : public ManagedKafkaStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -218,4 +217,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_V1_INTERNAL_MANAGED_KAFKA_TRACING_STUB_H diff --git a/google/cloud/managedkafka/v1/managed_kafka_client.h b/google/cloud/managedkafka/v1/managed_kafka_client.h index 60991360280dd..0e7fc3b7bd492 100644 --- a/google/cloud/managedkafka/v1/managed_kafka_client.h +++ b/google/cloud/managedkafka/v1/managed_kafka_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/managedkafka/v1/managed_kafka_connection.h b/google/cloud/managedkafka/v1/managed_kafka_connection.h index 142f735ffa416..1ced1e2a070e8 100644 --- a/google/cloud/managedkafka/v1/managed_kafka_connection.h +++ b/google/cloud/managedkafka/v1/managed_kafka_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_V1_MANAGED_KAFKA_CONNECTION_H #include "google/cloud/managedkafka/v1/internal/managed_kafka_retry_traits.h" +#include "google/cloud/managedkafka/v1/managed_kafka.pb.h" #include "google/cloud/managedkafka/v1/managed_kafka_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/managedkafka/v1/managed_kafka_connection_idempotency_policy.h b/google/cloud/managedkafka/v1/managed_kafka_connection_idempotency_policy.h index 89ec93e610f7a..2662b271ca0af 100644 --- a/google/cloud/managedkafka/v1/managed_kafka_connection_idempotency_policy.h +++ b/google/cloud/managedkafka/v1/managed_kafka_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_V1_MANAGED_KAFKA_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MANAGEDKAFKA_V1_MANAGED_KAFKA_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/managedkafka/v1/managed_kafka.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/memcache/BUILD.bazel b/google/cloud/memcache/BUILD.bazel index de82ac26cddf5..95f8992d458c4 100644 --- a/google/cloud/memcache/BUILD.bazel +++ b/google/cloud/memcache/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/memcache/v1:memcache_cc_grpc", + "@googleapis//google/cloud/memcache/v1:memcache_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/memcache/CMakeLists.txt b/google/cloud/memcache/CMakeLists.txt index 3b379b93b6f30..8bec4ce9305af 100644 --- a/google/cloud/memcache/CMakeLists.txt +++ b/google/cloud/memcache/CMakeLists.txt @@ -17,8 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( - memcache "Cloud Memorystore for Memcached API" SERVICE_DIRS "__EMPTY__" - "v1/") + memcache "Cloud Memorystore for Memcached API" SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(memcache_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/memcache/cloud_memcache_client.h b/google/cloud/memcache/cloud_memcache_client.h deleted file mode 100644 index 228b05b549d2e..0000000000000 --- a/google/cloud/memcache/cloud_memcache_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/memcache/v1/cloud_memcache.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_CLOUD_MEMCACHE_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_CLOUD_MEMCACHE_CLIENT_H - -#include "google/cloud/memcache/cloud_memcache_connection.h" -#include "google/cloud/memcache/v1/cloud_memcache_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in memcache_v1 instead of the aliases defined in -/// this namespace. -namespace memcache { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use memcache_v1::CloudMemcacheClient directly. -using ::google::cloud::memcache_v1::CloudMemcacheClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace memcache -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_CLOUD_MEMCACHE_CLIENT_H diff --git a/google/cloud/memcache/cloud_memcache_connection.h b/google/cloud/memcache/cloud_memcache_connection.h deleted file mode 100644 index f3c0708c5d05c..0000000000000 --- a/google/cloud/memcache/cloud_memcache_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/memcache/v1/cloud_memcache.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_CLOUD_MEMCACHE_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_CLOUD_MEMCACHE_CONNECTION_H - -#include "google/cloud/memcache/cloud_memcache_connection_idempotency_policy.h" -#include "google/cloud/memcache/v1/cloud_memcache_connection.h" - -namespace google { -namespace cloud { -namespace memcache { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use memcache_v1::MakeCloudMemcacheConnection directly. -using ::google::cloud::memcache_v1::MakeCloudMemcacheConnection; - -/// @deprecated Use memcache_v1::CloudMemcacheConnection directly. -using ::google::cloud::memcache_v1::CloudMemcacheConnection; - -/// @deprecated Use memcache_v1::CloudMemcacheLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::memcache_v1::CloudMemcacheLimitedErrorCountRetryPolicy; - -/// @deprecated Use memcache_v1::CloudMemcacheLimitedTimeRetryPolicy directly. -using ::google::cloud::memcache_v1::CloudMemcacheLimitedTimeRetryPolicy; - -/// @deprecated Use memcache_v1::CloudMemcacheRetryPolicy directly. -using ::google::cloud::memcache_v1::CloudMemcacheRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace memcache -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_CLOUD_MEMCACHE_CONNECTION_H diff --git a/google/cloud/memcache/cloud_memcache_connection_idempotency_policy.h b/google/cloud/memcache/cloud_memcache_connection_idempotency_policy.h deleted file mode 100644 index 7f1b603a89c4c..0000000000000 --- a/google/cloud/memcache/cloud_memcache_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/memcache/v1/cloud_memcache.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_CLOUD_MEMCACHE_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_CLOUD_MEMCACHE_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/memcache/v1/cloud_memcache_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace memcache { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// memcache_v1::MakeDefaultCloudMemcacheConnectionIdempotencyPolicy directly. -using ::google::cloud::memcache_v1:: - MakeDefaultCloudMemcacheConnectionIdempotencyPolicy; - -/// @deprecated Use memcache_v1::CloudMemcacheConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::memcache_v1::CloudMemcacheConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace memcache -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_CLOUD_MEMCACHE_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/memcache/cloud_memcache_options.h b/google/cloud/memcache/cloud_memcache_options.h deleted file mode 100644 index 12b9a77399c70..0000000000000 --- a/google/cloud/memcache/cloud_memcache_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/memcache/v1/cloud_memcache.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_CLOUD_MEMCACHE_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_CLOUD_MEMCACHE_OPTIONS_H - -#include "google/cloud/memcache/cloud_memcache_connection.h" -#include "google/cloud/memcache/cloud_memcache_connection_idempotency_policy.h" -#include "google/cloud/memcache/v1/cloud_memcache_options.h" - -namespace google { -namespace cloud { -namespace memcache { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use memcache_v1::CloudMemcachePollingPolicyOption directly. -using ::google::cloud::memcache_v1::CloudMemcachePollingPolicyOption; - -/// @deprecated Use memcache_v1::CloudMemcacheBackoffPolicyOption directly. -using ::google::cloud::memcache_v1::CloudMemcacheBackoffPolicyOption; - -/// @deprecated Use memcache_v1::CloudMemcacheConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::memcache_v1:: - CloudMemcacheConnectionIdempotencyPolicyOption; - -/// @deprecated Use memcache_v1::CloudMemcachePolicyOptionList directly. -using ::google::cloud::memcache_v1::CloudMemcachePolicyOptionList; - -/// @deprecated Use memcache_v1::CloudMemcacheRetryPolicyOption directly. -using ::google::cloud::memcache_v1::CloudMemcacheRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace memcache -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_CLOUD_MEMCACHE_OPTIONS_H diff --git a/google/cloud/memcache/mocks/mock_cloud_memcache_connection.h b/google/cloud/memcache/mocks/mock_cloud_memcache_connection.h deleted file mode 100644 index 45dec651cbd0f..0000000000000 --- a/google/cloud/memcache/mocks/mock_cloud_memcache_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/memcache/v1/cloud_memcache.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_MOCKS_MOCK_CLOUD_MEMCACHE_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_MOCKS_MOCK_CLOUD_MEMCACHE_CONNECTION_H - -#include "google/cloud/memcache/cloud_memcache_connection.h" -#include "google/cloud/memcache/v1/mocks/mock_cloud_memcache_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in memcache_v1_mocks instead of the aliases -/// defined in this namespace. -namespace memcache_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use memcache_v1_mocks::MockCloudMemcacheConnection directly. -using ::google::cloud::memcache_v1_mocks::MockCloudMemcacheConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace memcache_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_MOCKS_MOCK_CLOUD_MEMCACHE_CONNECTION_H diff --git a/google/cloud/memcache/quickstart/.bazelrc b/google/cloud/memcache/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/memcache/quickstart/.bazelrc +++ b/google/cloud/memcache/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/memcache/quickstart/CMakeLists.txt index 619d15e8b8b33..27f283b724516 100644 --- a/google/cloud/memcache/quickstart/CMakeLists.txt +++ b/google/cloud/memcache/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Memorystore for Memcached API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-memcache-quickstart CXX) find_package(google_cloud_cpp_memcache REQUIRED) diff --git a/google/cloud/memcache/quickstart/WORKSPACE.bazel b/google/cloud/memcache/quickstart/WORKSPACE.bazel index f5bdd00038aa3..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 = "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/memcache/v1/cloud_memcache_client.h b/google/cloud/memcache/v1/cloud_memcache_client.h index a076622936609..9eaa528f2cdd3 100644 --- a/google/cloud/memcache/v1/cloud_memcache_client.h +++ b/google/cloud/memcache/v1/cloud_memcache_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/memcache/v1/cloud_memcache_connection.h b/google/cloud/memcache/v1/cloud_memcache_connection.h index 79f42842c44c5..fefdbacce9904 100644 --- a/google/cloud/memcache/v1/cloud_memcache_connection.h +++ b/google/cloud/memcache/v1/cloud_memcache_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_V1_CLOUD_MEMCACHE_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_V1_CLOUD_MEMCACHE_CONNECTION_H +#include "google/cloud/memcache/v1/cloud_memcache.pb.h" #include "google/cloud/memcache/v1/cloud_memcache_connection_idempotency_policy.h" #include "google/cloud/memcache/v1/internal/cloud_memcache_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/memcache/v1/cloud_memcache_connection_idempotency_policy.h b/google/cloud/memcache/v1/cloud_memcache_connection_idempotency_policy.h index e60afc8229530..4cb0a8856fb26 100644 --- a/google/cloud/memcache/v1/cloud_memcache_connection_idempotency_policy.h +++ b/google/cloud/memcache/v1/cloud_memcache_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_V1_CLOUD_MEMCACHE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_V1_CLOUD_MEMCACHE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/memcache/v1/cloud_memcache.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_auth_decorator.cc b/google/cloud/memcache/v1/internal/cloud_memcache_auth_decorator.cc index 527ea70dd58e2..dce156c217318 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_auth_decorator.cc +++ b/google/cloud/memcache/v1/internal/cloud_memcache_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/memcache/v1/cloud_memcache.proto #include "google/cloud/memcache/v1/internal/cloud_memcache_auth_decorator.h" -#include +#include "google/cloud/memcache/v1/cloud_memcache.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memcache_v1_internal { @@ -307,3 +310,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace memcache_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_auth_decorator.h b/google/cloud/memcache/v1/internal/cloud_memcache_auth_decorator.h index a4b4c6422844f..814d36c8e7aaf 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_auth_decorator.h +++ b/google/cloud/memcache/v1/internal/cloud_memcache_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/memcache/v1/internal/cloud_memcache_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 memcache_v1_internal { @@ -166,4 +169,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_V1_INTERNAL_CLOUD_MEMCACHE_AUTH_DECORATOR_H diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_connection_impl.h b/google/cloud/memcache/v1/internal/cloud_memcache_connection_impl.h index 1f398abf38889..b45baf9a60ad5 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_connection_impl.h +++ b/google/cloud/memcache/v1/internal/cloud_memcache_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_logging_decorator.cc b/google/cloud/memcache/v1/internal/cloud_memcache_logging_decorator.cc index 89c14660837fd..583a74739c6ca 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_logging_decorator.cc +++ b/google/cloud/memcache/v1/internal/cloud_memcache_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/memcache/v1/cloud_memcache.proto #include "google/cloud/memcache/v1/internal/cloud_memcache_logging_decorator.h" +#include "google/cloud/memcache/v1/cloud_memcache.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memcache_v1_internal { @@ -353,3 +356,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace memcache_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_logging_decorator.h b/google/cloud/memcache/v1/internal/cloud_memcache_logging_decorator.h index b63518362e26c..0a871b5743de2 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_logging_decorator.h +++ b/google/cloud/memcache/v1/internal/cloud_memcache_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/memcache/v1/internal/cloud_memcache_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 memcache_v1_internal { @@ -166,4 +169,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_V1_INTERNAL_CLOUD_MEMCACHE_LOGGING_DECORATOR_H diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_metadata_decorator.cc b/google/cloud/memcache/v1/internal/cloud_memcache_metadata_decorator.cc index 0cc34713c2b88..28414fc8f9726 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_metadata_decorator.cc +++ b/google/cloud/memcache/v1/internal/cloud_memcache_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/memcache/v1/cloud_memcache.proto #include "google/cloud/memcache/v1/internal/cloud_memcache_metadata_decorator.h" +#include "google/cloud/memcache/v1/cloud_memcache.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 memcache_v1_internal { @@ -278,3 +282,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace memcache_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_metadata_decorator.h b/google/cloud/memcache/v1/internal/cloud_memcache_metadata_decorator.h index 38a0e3ac1b1ff..b7252fdfd72be 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_metadata_decorator.h +++ b/google/cloud/memcache/v1/internal/cloud_memcache_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/memcache/v1/internal/cloud_memcache_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 memcache_v1_internal { @@ -171,4 +174,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_V1_INTERNAL_CLOUD_MEMCACHE_METADATA_DECORATOR_H diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_option_defaults.cc b/google/cloud/memcache/v1/internal/cloud_memcache_option_defaults.cc index 6844a5656c3cc..ed0cdf4f100d5 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_option_defaults.cc +++ b/google/cloud/memcache/v1/internal/cloud_memcache_option_defaults.cc @@ -41,7 +41,7 @@ Options CloudMemcacheDefaultOptions(Options options) { if (!options.has()) { options.set( memcache_v1::CloudMemcacheLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_stub.cc b/google/cloud/memcache/v1/internal/cloud_memcache_stub.cc index 38c0a8f6848e6..c2e1826ccebfd 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_stub.cc +++ b/google/cloud/memcache/v1/internal/cloud_memcache_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/memcache/v1/cloud_memcache.proto #include "google/cloud/memcache/v1/internal/cloud_memcache_stub.h" +#include "google/cloud/memcache/v1/cloud_memcache.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memcache_v1_internal { @@ -349,3 +352,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace memcache_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_stub.h b/google/cloud/memcache/v1/internal/cloud_memcache_stub.h index 07373332c0a18..7c9b95370cbe1 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_stub.h +++ b/google/cloud/memcache/v1/internal/cloud_memcache_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_V1_INTERNAL_CLOUD_MEMCACHE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_V1_INTERNAL_CLOUD_MEMCACHE_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/memcache/v1/cloud_memcache.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memcache_v1_internal { @@ -294,4 +297,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_V1_INTERNAL_CLOUD_MEMCACHE_STUB_H diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_stub_factory.cc b/google/cloud/memcache/v1/internal/cloud_memcache_stub_factory.cc index d6a4881ef1946..88b78aea0adcb 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_stub_factory.cc +++ b/google/cloud/memcache/v1/internal/cloud_memcache_stub_factory.cc @@ -17,6 +17,8 @@ // source: google/cloud/memcache/v1/cloud_memcache.proto #include "google/cloud/memcache/v1/internal/cloud_memcache_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/memcache/v1/cloud_memcache.grpc.pb.h" #include "google/cloud/memcache/v1/internal/cloud_memcache_auth_decorator.h" #include "google/cloud/memcache/v1/internal/cloud_memcache_logging_decorator.h" #include "google/cloud/memcache/v1/internal/cloud_memcache_metadata_decorator.h" @@ -28,12 +30,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memcache_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace memcache_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_stub_factory.h b/google/cloud/memcache/v1/internal/cloud_memcache_stub_factory.h index 9402312affa64..7e40c496570ff 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_stub_factory.h +++ b/google/cloud/memcache/v1/internal/cloud_memcache_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memcache_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_V1_INTERNAL_CLOUD_MEMCACHE_STUB_FACTORY_H diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_tracing_connection.cc b/google/cloud/memcache/v1/internal/cloud_memcache_tracing_connection.cc index bd21eb7ef1b13..cac0172f220c8 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_tracing_connection.cc +++ b/google/cloud/memcache/v1/internal/cloud_memcache_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace memcache_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudMemcacheTracingConnection::CloudMemcacheTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -286,16 +284,12 @@ Status CloudMemcacheTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudMemcacheTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_tracing_connection.h b/google/cloud/memcache/v1/internal/cloud_memcache_tracing_connection.h index a77734d587f09..801932f73c17a 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_tracing_connection.h +++ b/google/cloud/memcache/v1/internal/cloud_memcache_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace memcache_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudMemcacheTracingConnection : public memcache_v1::CloudMemcacheConnection { public: @@ -140,8 +138,6 @@ class CloudMemcacheTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_tracing_stub.cc b/google/cloud/memcache/v1/internal/cloud_memcache_tracing_stub.cc index 7f01af79327b7..1b0b2615c08ea 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_tracing_stub.cc +++ b/google/cloud/memcache/v1/internal/cloud_memcache_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memcache_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudMemcacheTracingStub::CloudMemcacheTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -315,18 +316,14 @@ future CloudMemcacheTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudMemcacheTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace memcache_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/memcache/v1/internal/cloud_memcache_tracing_stub.h b/google/cloud/memcache/v1/internal/cloud_memcache_tracing_stub.h index 02884eb8f59af..971a3e210627a 100644 --- a/google/cloud/memcache/v1/internal/cloud_memcache_tracing_stub.h +++ b/google/cloud/memcache/v1/internal/cloud_memcache_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memcache_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudMemcacheTracingStub : public CloudMemcacheStub { public: ~CloudMemcacheTracingStub() override = default; @@ -161,8 +162,6 @@ class CloudMemcacheTracingStub : public CloudMemcacheStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -177,4 +176,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMCACHE_V1_INTERNAL_CLOUD_MEMCACHE_TRACING_STUB_H diff --git a/google/cloud/memorystore/BUILD.bazel b/google/cloud/memorystore/BUILD.bazel index 06cb560083b62..4474b6ffd6b3a 100644 --- a/google/cloud/memorystore/BUILD.bazel +++ b/google/cloud/memorystore/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/memorystore/v1:memorystore_cc_grpc", + "@googleapis//google/cloud/memorystore/v1:memorystore_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/memorystore/quickstart/CMakeLists.txt b/google/cloud/memorystore/quickstart/CMakeLists.txt index 14fb6a10b4fda..00cf99edc112d 100644 --- a/google/cloud/memorystore/quickstart/CMakeLists.txt +++ b/google/cloud/memorystore/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Memorystore API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-memorystore-quickstart CXX) find_package(google_cloud_cpp_memorystore REQUIRED) diff --git a/google/cloud/memorystore/quickstart/WORKSPACE.bazel b/google/cloud/memorystore/quickstart/WORKSPACE.bazel index 0f477027fcc6a..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 = "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/memorystore/v1/internal/memorystore_auth_decorator.cc b/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.cc index 8a6c3007f5e9e..fe2f0aa2e5f7a 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/memorystore/v1/memorystore.proto #include "google/cloud/memorystore/v1/internal/memorystore_auth_decorator.h" -#include +#include "google/cloud/memorystore/v1/memorystore.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memorystore_v1_internal { @@ -142,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, @@ -382,3 +396,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace memorystore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.h b/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.h index 3a7291774b8d2..37a98749da4ee 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.h +++ b/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/memorystore/v1/internal/memorystore_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 memorystore_v1_internal { @@ -91,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, @@ -206,4 +215,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMORYSTORE_V1_INTERNAL_MEMORYSTORE_AUTH_DECORATOR_H 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 4a0c5ee66ccc4..26214e1a38a5e 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_connection_impl.h +++ b/google/cloud/memorystore/v1/internal/memorystore_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 37ee8010eb6b2..b077c80817691 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_logging_decorator.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/memorystore/v1/memorystore.proto #include "google/cloud/memorystore/v1/internal/memorystore_logging_decorator.h" +#include "google/cloud/memorystore/v1/memorystore.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memorystore_v1_internal { @@ -169,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, @@ -454,3 +472,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace memorystore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/memorystore/v1/internal/memorystore_logging_decorator.h b/google/cloud/memorystore/v1/internal/memorystore_logging_decorator.h index 26174c0da7a15..dc09744ccbbf4 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_logging_decorator.h +++ b/google/cloud/memorystore/v1/internal/memorystore_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/memorystore/v1/internal/memorystore_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 memorystore_v1_internal { @@ -91,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, @@ -206,4 +215,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMORYSTORE_V1_INTERNAL_MEMORYSTORE_LOGGING_DECORATOR_H diff --git a/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.cc b/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.cc index d28e989435abe..23971741b0056 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/memorystore/v1/memorystore.proto #include "google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.h" +#include "google/cloud/memorystore/v1/memorystore.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 memorystore_v1_internal { @@ -134,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, @@ -343,3 +358,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace memorystore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.h b/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.h index 04242b0d31600..7794480678efa 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.h +++ b/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/memorystore/v1/internal/memorystore_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 memorystore_v1_internal { @@ -91,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, @@ -211,4 +220,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMORYSTORE_V1_INTERNAL_MEMORYSTORE_METADATA_DECORATOR_H diff --git a/google/cloud/memorystore/v1/internal/memorystore_option_defaults.cc b/google/cloud/memorystore/v1/internal/memorystore_option_defaults.cc index 731989f485a91..2dd06af447102 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_option_defaults.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_option_defaults.cc @@ -41,7 +41,7 @@ Options MemorystoreDefaultOptions(Options options) { if (!options.has()) { options.set( memorystore_v1::MemorystoreLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/memorystore/v1/internal/memorystore_stub.cc b/google/cloud/memorystore/v1/internal/memorystore_stub.cc index 3ed9a7e92dfaa..014d26d0bb042 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_stub.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/memorystore/v1/memorystore.proto #include "google/cloud/memorystore/v1/internal/memorystore_stub.h" +#include "google/cloud/memorystore/v1/memorystore.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memorystore_v1_internal { @@ -159,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, @@ -440,3 +457,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace memorystore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/memorystore/v1/internal/memorystore_stub.h b/google/cloud/memorystore/v1/internal/memorystore_stub.h index aa10cd69cf01b..b8b095a656a77 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_stub.h +++ b/google/cloud/memorystore/v1/internal/memorystore_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMORYSTORE_V1_INTERNAL_MEMORYSTORE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMORYSTORE_V1_INTERNAL_MEMORYSTORE_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/memorystore/v1/memorystore.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memorystore_v1_internal { @@ -84,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, @@ -253,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, @@ -372,4 +388,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMORYSTORE_V1_INTERNAL_MEMORYSTORE_STUB_H diff --git a/google/cloud/memorystore/v1/internal/memorystore_stub_factory.cc b/google/cloud/memorystore/v1/internal/memorystore_stub_factory.cc index dca058f0c892a..a89d5ae6c8ebb 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_stub_factory.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/memorystore/v1/memorystore.proto #include "google/cloud/memorystore/v1/internal/memorystore_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/memorystore/v1/internal/memorystore_auth_decorator.h" #include "google/cloud/memorystore/v1/internal/memorystore_logging_decorator.h" #include "google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.h" #include "google/cloud/memorystore/v1/internal/memorystore_stub.h" #include "google/cloud/memorystore/v1/internal/memorystore_tracing_stub.h" +#include "google/cloud/memorystore/v1/memorystore.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memorystore_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace memorystore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/memorystore/v1/internal/memorystore_stub_factory.h b/google/cloud/memorystore/v1/internal/memorystore_stub_factory.h index db7da861d5f00..7a8bfc5f3ba1a 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_stub_factory.h +++ b/google/cloud/memorystore/v1/internal/memorystore_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memorystore_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMORYSTORE_V1_INTERNAL_MEMORYSTORE_STUB_FACTORY_H diff --git a/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.cc b/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.cc index b06b77efe6d90..639f90b41b70f 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace memorystore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MemorystoreTracingConnection::MemorystoreTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -150,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& @@ -365,16 +375,12 @@ Status MemorystoreTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMemorystoreTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.h b/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.h index aaa8abfe069ef..6786e90483a9a 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.h +++ b/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace memorystore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MemorystoreTracingConnection : public memorystore_v1::MemorystoreConnection { public: @@ -88,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& @@ -176,8 +179,6 @@ class MemorystoreTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.cc b/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.cc index 87045ce21fd40..71331e84f4204 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memorystore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MemorystoreTracingStub::MemorystoreTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -148,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, @@ -398,18 +413,14 @@ future MemorystoreTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMemorystoreTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace memorystore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.h b/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.h index ac516054425e5..421b06db25f84 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.h +++ b/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace memorystore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MemorystoreTracingStub : public MemorystoreStub { public: ~MemorystoreTracingStub() override = default; @@ -90,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, @@ -201,8 +208,6 @@ class MemorystoreTracingStub : public MemorystoreStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -217,4 +222,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMORYSTORE_V1_INTERNAL_MEMORYSTORE_TRACING_STUB_H 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 6e3fbd6372db5..0c00cf16c5d2f 100644 --- a/google/cloud/memorystore/v1/memorystore_client.h +++ b/google/cloud/memorystore/v1/memorystore_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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 f7b5b9a106777..82ed665dd7f87 100644 --- a/google/cloud/memorystore/v1/memorystore_connection.h +++ b/google/cloud/memorystore/v1/memorystore_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMORYSTORE_V1_MEMORYSTORE_CONNECTION_H #include "google/cloud/memorystore/v1/internal/memorystore_retry_traits.h" +#include "google/cloud/memorystore/v1/memorystore.pb.h" #include "google/cloud/memorystore/v1/memorystore_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 fea0d32e11117..6d4ffc65da39c 100644 --- a/google/cloud/memorystore/v1/memorystore_connection_idempotency_policy.h +++ b/google/cloud/memorystore/v1/memorystore_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMORYSTORE_V1_MEMORYSTORE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MEMORYSTORE_V1_MEMORYSTORE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/memorystore/v1/memorystore.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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/BUILD.bazel b/google/cloud/metastore/BUILD.bazel index a6dd7643bb1a4..68644492fe9ac 100644 --- a/google/cloud/metastore/BUILD.bazel +++ b/google/cloud/metastore/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/metastore/v1:metastore_cc_grpc", + "@googleapis//google/cloud/metastore/v1:metastore_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/metastore/quickstart/.bazelrc b/google/cloud/metastore/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/metastore/quickstart/.bazelrc +++ b/google/cloud/metastore/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/metastore/quickstart/CMakeLists.txt index dc5662380ab90..64199d20800fb 100644 --- a/google/cloud/metastore/quickstart/CMakeLists.txt +++ b/google/cloud/metastore/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Dataproc Metastore API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-metastore-quickstart CXX) find_package(google_cloud_cpp_metastore REQUIRED) diff --git a/google/cloud/metastore/quickstart/WORKSPACE.bazel b/google/cloud/metastore/quickstart/WORKSPACE.bazel index f883f9be70f30..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 = "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/metastore/v1/dataproc_metastore_client.h b/google/cloud/metastore/v1/dataproc_metastore_client.h index 9bf83004f273b..2fa8fd8910a8a 100644 --- a/google/cloud/metastore/v1/dataproc_metastore_client.h +++ b/google/cloud/metastore/v1/dataproc_metastore_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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_connection.h b/google/cloud/metastore/v1/dataproc_metastore_connection.h index 11892b59d0351..a106e2d05c989 100644 --- a/google/cloud/metastore/v1/dataproc_metastore_connection.h +++ b/google/cloud/metastore/v1/dataproc_metastore_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/metastore/v1/dataproc_metastore_connection_idempotency_policy.h" #include "google/cloud/metastore/v1/internal/dataproc_metastore_retry_traits.h" +#include "google/cloud/metastore/v1/metastore.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/metastore/v1/dataproc_metastore_connection_idempotency_policy.h b/google/cloud/metastore/v1/dataproc_metastore_connection_idempotency_policy.h index b4efe3e332a94..13b86763af619 100644 --- a/google/cloud/metastore/v1/dataproc_metastore_connection_idempotency_policy.h +++ b/google/cloud/metastore/v1/dataproc_metastore_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_DATAPROC_METASTORE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_DATAPROC_METASTORE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/metastore/v1/metastore.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/metastore/v1/dataproc_metastore_federation_client.h b/google/cloud/metastore/v1/dataproc_metastore_federation_client.h index deb4faee66c42..d5fff171a3d4f 100644 --- a/google/cloud/metastore/v1/dataproc_metastore_federation_client.h +++ b/google/cloud/metastore/v1/dataproc_metastore_federation_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/metastore/v1/dataproc_metastore_federation_connection.h b/google/cloud/metastore/v1/dataproc_metastore_federation_connection.h index 5e8540dad5e9b..23dfcea318e42 100644 --- a/google/cloud/metastore/v1/dataproc_metastore_federation_connection.h +++ b/google/cloud/metastore/v1/dataproc_metastore_federation_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/metastore/v1/dataproc_metastore_federation_connection_idempotency_policy.h" #include "google/cloud/metastore/v1/internal/dataproc_metastore_federation_retry_traits.h" +#include "google/cloud/metastore/v1/metastore_federation.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/metastore/v1/dataproc_metastore_federation_connection_idempotency_policy.h b/google/cloud/metastore/v1/dataproc_metastore_federation_connection_idempotency_policy.h index 434d64d90a4d3..0b2952b42f5f4 100644 --- a/google/cloud/metastore/v1/dataproc_metastore_federation_connection_idempotency_policy.h +++ b/google/cloud/metastore/v1/dataproc_metastore_federation_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_DATAPROC_METASTORE_FEDERATION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_DATAPROC_METASTORE_FEDERATION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/metastore/v1/metastore_federation.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_auth_decorator.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_auth_decorator.cc index 772731a108094..a00aac90bfe08 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_auth_decorator.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/metastore/v1/metastore.proto #include "google/cloud/metastore/v1/internal/dataproc_metastore_auth_decorator.h" -#include +#include "google/cloud/metastore/v1/metastore.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace metastore_v1_internal { @@ -541,3 +544,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace metastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_auth_decorator.h b/google/cloud/metastore/v1/internal/dataproc_metastore_auth_decorator.h index d7135ad88735e..3f084d582f279 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_auth_decorator.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/metastore/v1/internal/dataproc_metastore_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 metastore_v1_internal { @@ -270,4 +273,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_AUTH_DECORATOR_H diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_connection_impl.h b/google/cloud/metastore/v1/internal/dataproc_metastore_connection_impl.h index 1f327a778fa5e..6b2792d0769b0 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_connection_impl.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_auth_decorator.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_auth_decorator.cc index 25b3d0d56a65b..f5e06e31a9849 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_auth_decorator.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/metastore/v1/metastore_federation.proto #include "google/cloud/metastore/v1/internal/dataproc_metastore_federation_auth_decorator.h" -#include +#include "google/cloud/metastore/v1/metastore_federation.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace metastore_v1_internal { @@ -253,3 +256,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace metastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_auth_decorator.h b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_auth_decorator.h index f1503af5067bd..322b52160af9a 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_auth_decorator.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 metastore_v1_internal { @@ -143,4 +146,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_FEDERATION_AUTH_DECORATOR_H diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_connection_impl.h b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_connection_impl.h index ec3fe203131d3..ff97c633f5a12 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_connection_impl.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_logging_decorator.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_logging_decorator.cc index c8cc96e8cdfed..7cfe376294574 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_logging_decorator.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/metastore/v1/metastore_federation.proto #include "google/cloud/metastore/v1/internal/dataproc_metastore_federation_logging_decorator.h" +#include "google/cloud/metastore/v1/metastore_federation.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace metastore_v1_internal { @@ -302,3 +305,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace metastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_logging_decorator.h b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_logging_decorator.h index 69d5defcd7109..33d044fb4e708 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_logging_decorator.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 metastore_v1_internal { @@ -144,4 +147,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_FEDERATION_LOGGING_DECORATOR_H diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_metadata_decorator.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_metadata_decorator.cc index f8820a4c6f03f..0ccfc7215efb3 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_metadata_decorator.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/metastore/v1/metastore_federation.proto #include "google/cloud/metastore/v1/internal/dataproc_metastore_federation_metadata_decorator.h" +#include "google/cloud/metastore/v1/metastore_federation.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 metastore_v1_internal { @@ -249,3 +253,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace metastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_metadata_decorator.h b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_metadata_decorator.h index 92f2612eb0fcf..fed536acf70d9 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_metadata_decorator.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 metastore_v1_internal { @@ -150,4 +153,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_FEDERATION_METADATA_DECORATOR_H diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_option_defaults.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_option_defaults.cc index 84ee98d3932be..291650f05cfb0 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_option_defaults.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_option_defaults.cc @@ -44,7 +44,7 @@ Options DataprocMetastoreFederationDefaultOptions(Options options) { .has()) { options.set( metastore_v1::DataprocMetastoreFederationLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub.cc index b5a806633829b..dca9169b0f4ee 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/metastore/v1/metastore_federation.proto #include "google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub.h" +#include "google/cloud/metastore/v1/metastore_federation.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace metastore_v1_internal { @@ -298,3 +301,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace metastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub.h b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub.h index fdf3ffc47578b..c30f26c82eeda 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_FEDERATION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_FEDERATION_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/metastore/v1/metastore_federation.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 -#include -#include -#include +#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 metastore_v1_internal { @@ -260,4 +263,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_FEDERATION_STUB_H diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub_factory.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub_factory.cc index 96314fb95d78c..d5274f985864b 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub_factory.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/metastore/v1/metastore_federation.proto #include "google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/metastore/v1/internal/dataproc_metastore_federation_auth_decorator.h" #include "google/cloud/metastore/v1/internal/dataproc_metastore_federation_logging_decorator.h" #include "google/cloud/metastore/v1/internal/dataproc_metastore_federation_metadata_decorator.h" #include "google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub.h" #include "google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_stub.h" +#include "google/cloud/metastore/v1/metastore_federation.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 -#include -#include -#include +#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 metastore_v1_internal { @@ -80,3 +83,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace metastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub_factory.h b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub_factory.h index 45cf6a6c835fb..dac0499759e76 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub_factory.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace metastore_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_FEDERATION_STUB_FACTORY_H diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_connection.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_connection.cc index e75ddd7ff3e40..6f9fab332d696 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_connection.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace metastore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataprocMetastoreFederationTracingConnection:: DataprocMetastoreFederationTracingConnection( std::shared_ptr @@ -229,17 +227,13 @@ Status DataprocMetastoreFederationTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataprocMetastoreFederationTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_connection.h b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_connection.h index e12254d0ff9c8..83a0bb6d6ac79 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_connection.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace metastore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataprocMetastoreFederationTracingConnection : public metastore_v1::DataprocMetastoreFederationConnection { public: @@ -115,8 +113,6 @@ class DataprocMetastoreFederationTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_stub.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_stub.cc index 762771da8360c..7f8b537fe53e8 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_stub.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace metastore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataprocMetastoreFederationTracingStub::DataprocMetastoreFederationTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -282,20 +283,16 @@ future DataprocMetastoreFederationTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataprocMetastoreFederationTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace metastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_stub.h b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_stub.h index 986a10423809b..9c9e841409900 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_stub.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_federation_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace metastore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataprocMetastoreFederationTracingStub : public DataprocMetastoreFederationStub { public: @@ -140,8 +141,6 @@ class DataprocMetastoreFederationTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -157,4 +156,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_FEDERATION_TRACING_STUB_H diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_logging_decorator.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_logging_decorator.cc index 3dee1bd4433df..5795a0d70def1 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_logging_decorator.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/metastore/v1/metastore.proto #include "google/cloud/metastore/v1/internal/dataproc_metastore_logging_decorator.h" +#include "google/cloud/metastore/v1/metastore.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace metastore_v1_internal { @@ -631,3 +634,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace metastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_logging_decorator.h b/google/cloud/metastore/v1/internal/dataproc_metastore_logging_decorator.h index e4b3f8b67d3e8..b658c7d080e78 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_logging_decorator.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/metastore/v1/internal/dataproc_metastore_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 metastore_v1_internal { @@ -270,4 +273,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_LOGGING_DECORATOR_H diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_metadata_decorator.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_metadata_decorator.cc index ca74827d760b1..2555afdd98c0b 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_metadata_decorator.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/metastore/v1/metastore.proto #include "google/cloud/metastore/v1/internal/dataproc_metastore_metadata_decorator.h" +#include "google/cloud/metastore/v1/metastore.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 metastore_v1_internal { @@ -478,3 +482,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace metastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_metadata_decorator.h b/google/cloud/metastore/v1/internal/dataproc_metastore_metadata_decorator.h index f3eb9576a037d..b9958e326cf3f 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_metadata_decorator.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/metastore/v1/internal/dataproc_metastore_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 metastore_v1_internal { @@ -276,4 +279,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_METADATA_DECORATOR_H diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_option_defaults.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_option_defaults.cc index d0bca25f6ce93..fefc0e9c069e1 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_option_defaults.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_option_defaults.cc @@ -42,7 +42,7 @@ Options DataprocMetastoreDefaultOptions(Options options) { if (!options.has()) { options.set( metastore_v1::DataprocMetastoreLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_stub.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_stub.cc index 790c5e870066b..59807a10669bc 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_stub.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/metastore/v1/metastore.proto #include "google/cloud/metastore/v1/internal/dataproc_metastore_stub.h" +#include "google/cloud/metastore/v1/metastore.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace metastore_v1_internal { @@ -619,3 +622,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace metastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_stub.h b/google/cloud/metastore/v1/internal/dataproc_metastore_stub.h index 1a64c7e358547..42cb5a57c2bb8 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_stub.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/metastore/v1/metastore.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 -#include -#include -#include +#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 metastore_v1_internal { @@ -507,4 +510,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_STUB_H diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_stub_factory.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_stub_factory.cc index 0d936b90275a0..58af72b4f3e73 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_stub_factory.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/metastore/v1/metastore.proto #include "google/cloud/metastore/v1/internal/dataproc_metastore_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/metastore/v1/internal/dataproc_metastore_auth_decorator.h" #include "google/cloud/metastore/v1/internal/dataproc_metastore_logging_decorator.h" #include "google/cloud/metastore/v1/internal/dataproc_metastore_metadata_decorator.h" #include "google/cloud/metastore/v1/internal/dataproc_metastore_stub.h" #include "google/cloud/metastore/v1/internal/dataproc_metastore_tracing_stub.h" +#include "google/cloud/metastore/v1/metastore.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 -#include -#include -#include +#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 metastore_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace metastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_stub_factory.h b/google/cloud/metastore/v1/internal/dataproc_metastore_stub_factory.h index 7402353e46b8a..bb8ceab5ed3a5 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_stub_factory.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace metastore_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_STUB_FACTORY_H diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_connection.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_connection.cc index 497259ee3a3a4..3b1d22e2bfd24 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_connection.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace metastore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataprocMetastoreTracingConnection::DataprocMetastoreTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -534,17 +532,13 @@ Status DataprocMetastoreTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataprocMetastoreTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_connection.h b/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_connection.h index 546e51ca3e786..3a004e58dc2d5 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_connection.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace metastore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataprocMetastoreTracingConnection : public metastore_v1::DataprocMetastoreConnection { public: @@ -244,8 +242,6 @@ class DataprocMetastoreTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_stub.cc b/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_stub.cc index e0421e4023397..9491c5c2c2e2c 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_stub.cc +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace metastore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataprocMetastoreTracingStub::DataprocMetastoreTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -559,18 +560,14 @@ future DataprocMetastoreTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataprocMetastoreTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace metastore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_stub.h b/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_stub.h index 3c6b2e2f6c2c2..2b1286ee08f16 100644 --- a/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_stub.h +++ b/google/cloud/metastore/v1/internal/dataproc_metastore_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace metastore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataprocMetastoreTracingStub : public DataprocMetastoreStub { public: ~DataprocMetastoreTracingStub() override = default; @@ -266,8 +267,6 @@ class DataprocMetastoreTracingStub : public DataprocMetastoreStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -282,4 +281,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_METASTORE_V1_INTERNAL_DATAPROC_METASTORE_TRACING_STUB_H diff --git a/google/cloud/migrationcenter/BUILD.bazel b/google/cloud/migrationcenter/BUILD.bazel index ad51f70663581..3184649afdb6f 100644 --- a/google/cloud/migrationcenter/BUILD.bazel +++ b/google/cloud/migrationcenter/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/migrationcenter/v1:migrationcenter_cc_grpc", + "@googleapis//google/cloud/migrationcenter/v1:migrationcenter_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/migrationcenter/quickstart/.bazelrc b/google/cloud/migrationcenter/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/migrationcenter/quickstart/.bazelrc +++ b/google/cloud/migrationcenter/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/migrationcenter/quickstart/CMakeLists.txt index 6c3e26be5d8fb..7ce7231c0d687 100644 --- a/google/cloud/migrationcenter/quickstart/CMakeLists.txt +++ b/google/cloud/migrationcenter/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Migration Center API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-migrationcenter-quickstart CXX) find_package(google_cloud_cpp_migrationcenter REQUIRED) diff --git a/google/cloud/migrationcenter/quickstart/WORKSPACE.bazel b/google/cloud/migrationcenter/quickstart/WORKSPACE.bazel index f32fa4e067260..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 = "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/migrationcenter/v1/internal/migration_center_auth_decorator.cc b/google/cloud/migrationcenter/v1/internal/migration_center_auth_decorator.cc index 137565f94659a..e9b0d081d8a3e 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_auth_decorator.cc +++ b/google/cloud/migrationcenter/v1/internal/migration_center_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/migrationcenter/v1/migrationcenter.proto #include "google/cloud/migrationcenter/v1/internal/migration_center_auth_decorator.h" -#include +#include "google/cloud/migrationcenter/v1/migrationcenter.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace migrationcenter_v1_internal { @@ -1025,3 +1028,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace migrationcenter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_auth_decorator.h b/google/cloud/migrationcenter/v1/internal/migration_center_auth_decorator.h index da65393253175..1896604343a68 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_auth_decorator.h +++ b/google/cloud/migrationcenter/v1/internal/migration_center_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/migrationcenter/v1/internal/migration_center_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 migrationcenter_v1_internal { @@ -495,4 +498,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MIGRATIONCENTER_V1_INTERNAL_MIGRATION_CENTER_AUTH_DECORATOR_H diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_connection_impl.h b/google/cloud/migrationcenter/v1/internal/migration_center_connection_impl.h index b95a719b5b5a2..158e70e84fc81 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_connection_impl.h +++ b/google/cloud/migrationcenter/v1/internal/migration_center_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_logging_decorator.cc b/google/cloud/migrationcenter/v1/internal/migration_center_logging_decorator.cc index 75ae1b230858d..a3622dac42ced 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_logging_decorator.cc +++ b/google/cloud/migrationcenter/v1/internal/migration_center_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/migrationcenter/v1/migrationcenter.proto #include "google/cloud/migrationcenter/v1/internal/migration_center_logging_decorator.h" +#include "google/cloud/migrationcenter/v1/migrationcenter.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace migrationcenter_v1_internal { @@ -1236,3 +1239,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace migrationcenter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_logging_decorator.h b/google/cloud/migrationcenter/v1/internal/migration_center_logging_decorator.h index b51a77d24aa57..ef3841016846b 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_logging_decorator.h +++ b/google/cloud/migrationcenter/v1/internal/migration_center_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/migrationcenter/v1/internal/migration_center_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 migrationcenter_v1_internal { @@ -495,4 +498,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MIGRATIONCENTER_V1_INTERNAL_MIGRATION_CENTER_LOGGING_DECORATOR_H diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_metadata_decorator.cc b/google/cloud/migrationcenter/v1/internal/migration_center_metadata_decorator.cc index 370a4ce90d543..9059aa2436926 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_metadata_decorator.cc +++ b/google/cloud/migrationcenter/v1/internal/migration_center_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/migrationcenter/v1/migrationcenter.proto #include "google/cloud/migrationcenter/v1/internal/migration_center_metadata_decorator.h" +#include "google/cloud/migrationcenter/v1/migrationcenter.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 migrationcenter_v1_internal { @@ -874,3 +878,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace migrationcenter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_metadata_decorator.h b/google/cloud/migrationcenter/v1/internal/migration_center_metadata_decorator.h index 34e1eeb088265..bece69edc6bd9 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_metadata_decorator.h +++ b/google/cloud/migrationcenter/v1/internal/migration_center_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/migrationcenter/v1/internal/migration_center_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 migrationcenter_v1_internal { @@ -501,4 +504,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MIGRATIONCENTER_V1_INTERNAL_MIGRATION_CENTER_METADATA_DECORATOR_H diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_option_defaults.cc b/google/cloud/migrationcenter/v1/internal/migration_center_option_defaults.cc index 582af7c4d3da4..86f608bb2eb06 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_option_defaults.cc +++ b/google/cloud/migrationcenter/v1/internal/migration_center_option_defaults.cc @@ -42,7 +42,7 @@ Options MigrationCenterDefaultOptions(Options options) { if (!options.has()) { options.set( migrationcenter_v1::MigrationCenterLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_stub.cc b/google/cloud/migrationcenter/v1/internal/migration_center_stub.cc index 74a34cd8ae463..5f4fd33d71599 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_stub.cc +++ b/google/cloud/migrationcenter/v1/internal/migration_center_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/migrationcenter/v1/migrationcenter.proto #include "google/cloud/migrationcenter/v1/internal/migration_center_stub.h" +#include "google/cloud/migrationcenter/v1/migrationcenter.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace migrationcenter_v1_internal { @@ -1191,3 +1194,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace migrationcenter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_stub.h b/google/cloud/migrationcenter/v1/internal/migration_center_stub.h index b6ca527489260..678fdf56871cf 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_stub.h +++ b/google/cloud/migrationcenter/v1/internal/migration_center_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MIGRATIONCENTER_V1_INTERNAL_MIGRATION_CENTER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MIGRATIONCENTER_V1_INTERNAL_MIGRATION_CENTER_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/migrationcenter/v1/migrationcenter.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace migrationcenter_v1_internal { @@ -976,4 +979,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MIGRATIONCENTER_V1_INTERNAL_MIGRATION_CENTER_STUB_H diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_stub_factory.cc b/google/cloud/migrationcenter/v1/internal/migration_center_stub_factory.cc index 413a3ab5cff32..59bd9141ca3ca 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_stub_factory.cc +++ b/google/cloud/migrationcenter/v1/internal/migration_center_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/migrationcenter/v1/migrationcenter.proto #include "google/cloud/migrationcenter/v1/internal/migration_center_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/migrationcenter/v1/internal/migration_center_auth_decorator.h" #include "google/cloud/migrationcenter/v1/internal/migration_center_logging_decorator.h" #include "google/cloud/migrationcenter/v1/internal/migration_center_metadata_decorator.h" #include "google/cloud/migrationcenter/v1/internal/migration_center_stub.h" #include "google/cloud/migrationcenter/v1/internal/migration_center_tracing_stub.h" +#include "google/cloud/migrationcenter/v1/migrationcenter.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace migrationcenter_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace migrationcenter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_stub_factory.h b/google/cloud/migrationcenter/v1/internal/migration_center_stub_factory.h index 6b7c6b009fc1f..9452547c2dbd3 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_stub_factory.h +++ b/google/cloud/migrationcenter/v1/internal/migration_center_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace migrationcenter_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MIGRATIONCENTER_V1_INTERNAL_MIGRATION_CENTER_STUB_FACTORY_H diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_tracing_connection.cc b/google/cloud/migrationcenter/v1/internal/migration_center_tracing_connection.cc index faae7dfc21e82..9b38d22ac52e7 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_tracing_connection.cc +++ b/google/cloud/migrationcenter/v1/internal/migration_center_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace migrationcenter_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MigrationCenterTracingConnection::MigrationCenterTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -1041,16 +1039,12 @@ Status MigrationCenterTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMigrationCenterTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_tracing_connection.h b/google/cloud/migrationcenter/v1/internal/migration_center_tracing_connection.h index 38abdf782971d..2fa0468d1cf90 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_tracing_connection.h +++ b/google/cloud/migrationcenter/v1/internal/migration_center_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace migrationcenter_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MigrationCenterTracingConnection : public migrationcenter_v1::MigrationCenterConnection { public: @@ -455,8 +453,6 @@ class MigrationCenterTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_tracing_stub.cc b/google/cloud/migrationcenter/v1/internal/migration_center_tracing_stub.cc index 26397676502a6..6c2f6cd1dbf43 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_tracing_stub.cc +++ b/google/cloud/migrationcenter/v1/internal/migration_center_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace migrationcenter_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MigrationCenterTracingStub::MigrationCenterTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -1076,18 +1077,14 @@ future MigrationCenterTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMigrationCenterTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace migrationcenter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/migrationcenter/v1/internal/migration_center_tracing_stub.h b/google/cloud/migrationcenter/v1/internal/migration_center_tracing_stub.h index 21822ba25a5b7..19905d8efc122 100644 --- a/google/cloud/migrationcenter/v1/internal/migration_center_tracing_stub.h +++ b/google/cloud/migrationcenter/v1/internal/migration_center_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace migrationcenter_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MigrationCenterTracingStub : public MigrationCenterStub { public: ~MigrationCenterTracingStub() override = default; @@ -491,8 +492,6 @@ class MigrationCenterTracingStub : public MigrationCenterStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -507,4 +506,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MIGRATIONCENTER_V1_INTERNAL_MIGRATION_CENTER_TRACING_STUB_H diff --git a/google/cloud/migrationcenter/v1/migration_center_client.h b/google/cloud/migrationcenter/v1/migration_center_client.h index 9c1e5d4575321..12570633c81d0 100644 --- a/google/cloud/migrationcenter/v1/migration_center_client.h +++ b/google/cloud/migrationcenter/v1/migration_center_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/migrationcenter/v1/migration_center_connection.h b/google/cloud/migrationcenter/v1/migration_center_connection.h index c3a72e09354bb..4d2d86707d6bc 100644 --- a/google/cloud/migrationcenter/v1/migration_center_connection.h +++ b/google/cloud/migrationcenter/v1/migration_center_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/migrationcenter/v1/internal/migration_center_retry_traits.h" #include "google/cloud/migrationcenter/v1/migration_center_connection_idempotency_policy.h" +#include "google/cloud/migrationcenter/v1/migrationcenter.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/migrationcenter/v1/migration_center_connection_idempotency_policy.h b/google/cloud/migrationcenter/v1/migration_center_connection_idempotency_policy.h index af1b8725a3875..ee728ca0a2f22 100644 --- a/google/cloud/migrationcenter/v1/migration_center_connection_idempotency_policy.h +++ b/google/cloud/migrationcenter/v1/migration_center_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MIGRATIONCENTER_V1_MIGRATION_CENTER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MIGRATIONCENTER_V1_MIGRATION_CENTER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/migrationcenter/v1/migrationcenter.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/BUILD.bazel b/google/cloud/monitoring/BUILD.bazel index e6558817758bd..0aa3b290aac76 100644 --- a/google/cloud/monitoring/BUILD.bazel +++ b/google/cloud/monitoring/BUILD.bazel @@ -19,16 +19,15 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "dashboard/v1/", "metricsscope/v1/", "v3/", ] googleapis_deps = [ - "@com_google_googleapis//google/monitoring/dashboard/v1:dashboard_cc_grpc", - "@com_google_googleapis//google/monitoring/metricsscope/v1:metricsscope_cc_grpc", - "@com_google_googleapis//google/monitoring/v3:monitoring_cc_grpc", + "@googleapis//google/monitoring/dashboard/v1:dashboard_cc_grpc", + "@googleapis//google/monitoring/metricsscope/v1:metricsscope_cc_grpc", + "@googleapis//google/monitoring/v3:monitoring_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/monitoring/CMakeLists.txt b/google/cloud/monitoring/CMakeLists.txt index 85f3112f92a85..ad37c05c43c3d 100644 --- a/google/cloud/monitoring/CMakeLists.txt +++ b/google/cloud/monitoring/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( - monitoring "Cloud Monitoring API" SERVICE_DIRS "__EMPTY__" "dashboard/v1/" + monitoring "Cloud Monitoring API" SERVICE_DIRS "dashboard/v1/" "metricsscope/v1/" "v3/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) diff --git a/google/cloud/monitoring/alert_policy_client.h b/google/cloud/monitoring/alert_policy_client.h deleted file mode 100644 index 5bc4cc7b700f0..0000000000000 --- a/google/cloud/monitoring/alert_policy_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/alert_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_ALERT_POLICY_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_ALERT_POLICY_CLIENT_H - -#include "google/cloud/monitoring/alert_policy_connection.h" -#include "google/cloud/monitoring/v3/alert_policy_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_v3 instead of the aliases defined in -/// this namespace. -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::AlertPolicyServiceClient directly. -using ::google::cloud::monitoring_v3::AlertPolicyServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_ALERT_POLICY_CLIENT_H diff --git a/google/cloud/monitoring/alert_policy_connection.h b/google/cloud/monitoring/alert_policy_connection.h deleted file mode 100644 index 80bfafd7a945a..0000000000000 --- a/google/cloud/monitoring/alert_policy_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/alert_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_ALERT_POLICY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_ALERT_POLICY_CONNECTION_H - -#include "google/cloud/monitoring/alert_policy_connection_idempotency_policy.h" -#include "google/cloud/monitoring/v3/alert_policy_connection.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::MakeAlertPolicyServiceConnection directly. -using ::google::cloud::monitoring_v3::MakeAlertPolicyServiceConnection; - -/// @deprecated Use monitoring_v3::AlertPolicyServiceConnection directly. -using ::google::cloud::monitoring_v3::AlertPolicyServiceConnection; - -/// @deprecated Use -/// monitoring_v3::AlertPolicyServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::monitoring_v3:: - AlertPolicyServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use monitoring_v3::AlertPolicyServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::monitoring_v3::AlertPolicyServiceLimitedTimeRetryPolicy; - -/// @deprecated Use monitoring_v3::AlertPolicyServiceRetryPolicy directly. -using ::google::cloud::monitoring_v3::AlertPolicyServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_ALERT_POLICY_CONNECTION_H diff --git a/google/cloud/monitoring/alert_policy_connection_idempotency_policy.h b/google/cloud/monitoring/alert_policy_connection_idempotency_policy.h deleted file mode 100644 index 988923b2d98d4..0000000000000 --- a/google/cloud/monitoring/alert_policy_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/alert_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_ALERT_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_ALERT_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/monitoring/v3/alert_policy_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// monitoring_v3::MakeDefaultAlertPolicyServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::monitoring_v3:: - MakeDefaultAlertPolicyServiceConnectionIdempotencyPolicy; - -/// @deprecated Use monitoring_v3::AlertPolicyServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::monitoring_v3:: - AlertPolicyServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_ALERT_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/monitoring/alert_policy_options.h b/google/cloud/monitoring/alert_policy_options.h deleted file mode 100644 index 011cb8d43c404..0000000000000 --- a/google/cloud/monitoring/alert_policy_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/alert_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_ALERT_POLICY_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_ALERT_POLICY_OPTIONS_H - -#include "google/cloud/monitoring/alert_policy_connection.h" -#include "google/cloud/monitoring/alert_policy_connection_idempotency_policy.h" -#include "google/cloud/monitoring/v3/alert_policy_options.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::AlertPolicyServiceBackoffPolicyOption -/// directly. -using ::google::cloud::monitoring_v3::AlertPolicyServiceBackoffPolicyOption; - -/// @deprecated Use -/// monitoring_v3::AlertPolicyServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::monitoring_v3:: - AlertPolicyServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use monitoring_v3::AlertPolicyServicePolicyOptionList directly. -using ::google::cloud::monitoring_v3::AlertPolicyServicePolicyOptionList; - -/// @deprecated Use monitoring_v3::AlertPolicyServiceRetryPolicyOption directly. -using ::google::cloud::monitoring_v3::AlertPolicyServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_ALERT_POLICY_OPTIONS_H diff --git a/google/cloud/monitoring/dashboard/v1/dashboards_connection.h b/google/cloud/monitoring/dashboard/v1/dashboards_connection.h index 1ab7a10561569..08e3ab8351d39 100644 --- a/google/cloud/monitoring/dashboard/v1/dashboards_connection.h +++ b/google/cloud/monitoring/dashboard/v1/dashboards_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/dashboard/v1/dashboards_service.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/dashboard/v1/dashboards_connection_idempotency_policy.h b/google/cloud/monitoring/dashboard/v1/dashboards_connection_idempotency_policy.h index 236076bab218b..68c8342a60c37 100644 --- a/google/cloud/monitoring/dashboard/v1/dashboards_connection_idempotency_policy.h +++ b/google/cloud/monitoring/dashboard/v1/dashboards_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/dashboard/v1/dashboards_service.grpc.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_auth_decorator.cc b/google/cloud/monitoring/dashboard/v1/internal/dashboards_auth_decorator.cc index 6e8b45107741a..baeb99812dd2e 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_auth_decorator.cc +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/monitoring/dashboard/v1/dashboards_service.proto #include "google/cloud/monitoring/dashboard/v1/internal/dashboards_auth_decorator.h" -#include +#include "google/monitoring/dashboard/v1/dashboards_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_dashboard_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_dashboard_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_auth_decorator.h b/google/cloud/monitoring/dashboard/v1/internal/dashboards_auth_decorator.h index 1aee27316e71d..4eeb38e0a2717 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_auth_decorator.h +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_dashboard_v1_internal { @@ -73,4 +76,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARD_V1_INTERNAL_DASHBOARDS_AUTH_DECORATOR_H diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_logging_decorator.cc b/google/cloud/monitoring/dashboard/v1/internal/dashboards_logging_decorator.cc index b681e3d9586a9..d283d645e2233 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_logging_decorator.cc +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/monitoring/dashboard/v1/internal/dashboards_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/dashboard/v1/dashboards_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_dashboard_v1_internal { @@ -103,3 +106,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_dashboard_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_logging_decorator.h b/google/cloud/monitoring/dashboard/v1/internal/dashboards_logging_decorator.h index e22a53aa217cd..4b09fc78a0329 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_logging_decorator.h +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_dashboard_v1_internal { @@ -73,4 +76,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARD_V1_INTERNAL_DASHBOARDS_LOGGING_DECORATOR_H diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_metadata_decorator.cc b/google/cloud/monitoring/dashboard/v1/internal/dashboards_metadata_decorator.cc index 796d3b0b0e2fa..7dab2e180eb8b 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_metadata_decorator.cc +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/monitoring/dashboard/v1/internal/dashboards_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/monitoring/dashboard/v1/dashboards_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_dashboard_v1_internal { @@ -106,3 +110,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_dashboard_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_metadata_decorator.h b/google/cloud/monitoring/dashboard/v1/internal/dashboards_metadata_decorator.h index 2766da0b32e53..a217167786e9f 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_metadata_decorator.h +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_dashboard_v1_internal { @@ -79,4 +82,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARD_V1_INTERNAL_DASHBOARDS_METADATA_DECORATOR_H diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_option_defaults.cc b/google/cloud/monitoring/dashboard/v1/internal/dashboards_option_defaults.cc index cf5689b3297a4..bf5c0ec3f0e3a 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_option_defaults.cc +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_option_defaults.cc @@ -43,7 +43,7 @@ Options DashboardsServiceDefaultOptions(Options options) { monitoring_dashboard_v1::DashboardsServiceRetryPolicyOption>()) { options.set( monitoring_dashboard_v1::DashboardsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub.cc b/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub.cc index 38b4a457dedf2..93cf45601a933 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub.cc +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/monitoring/dashboard/v1/internal/dashboards_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/dashboard/v1/dashboards_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_dashboard_v1_internal { @@ -93,3 +96,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_dashboard_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub.h b/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub.h index 5f46cbc42e32f..98e88e625bb24 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub.h +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/dashboard/v1/dashboards_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_dashboard_v1_internal { @@ -107,4 +110,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARD_V1_INTERNAL_DASHBOARDS_STUB_H diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub_factory.cc b/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub_factory.cc index 86b27275b6470..d681e9afd956b 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub_factory.cc +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/monitoring/dashboard/v1/dashboards_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_dashboard_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_dashboard_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub_factory.h b/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub_factory.h index ecdded4064970..5ecd55ea37724 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub_factory.h +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_dashboard_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARD_V1_INTERNAL_DASHBOARDS_STUB_FACTORY_H diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_connection.cc b/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_connection.cc index 88854b32f8317..d7beb23d767a9 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_connection.cc +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace monitoring_dashboard_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DashboardsServiceTracingConnection::DashboardsServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -80,18 +78,14 @@ DashboardsServiceTracingConnection::UpdateDashboard( return internal::EndSpan(*span, child_->UpdateDashboard(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDashboardsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_connection.h b/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_connection.h index 37b4642a5c5ca..ddd9a7a7532c9 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_connection.h +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace monitoring_dashboard_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DashboardsServiceTracingConnection : public monitoring_dashboard_v1::DashboardsServiceConnection { public: @@ -65,8 +63,6 @@ class DashboardsServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_stub.cc b/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_stub.cc index f4eb644e592ea..99588bcd6a1b4 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_stub.cc +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_dashboard_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DashboardsServiceTracingStub::DashboardsServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -91,18 +92,14 @@ DashboardsServiceTracingStub::UpdateDashboard( child_->UpdateDashboard(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDashboardsServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_dashboard_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_stub.h b/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_stub.h index b1c1691a71a68..f2c4c2238d9b6 100644 --- a/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_stub.h +++ b/google/cloud/monitoring/dashboard/v1/internal/dashboards_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_dashboard_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DashboardsServiceTracingStub : public DashboardsServiceStub { public: ~DashboardsServiceTracingStub() override = default; @@ -70,8 +71,6 @@ class DashboardsServiceTracingStub : public DashboardsServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -86,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARD_V1_INTERNAL_DASHBOARDS_TRACING_STUB_H diff --git a/google/cloud/monitoring/dashboards_client.h b/google/cloud/monitoring/dashboards_client.h deleted file mode 100644 index c79d27a3c36b3..0000000000000 --- a/google/cloud/monitoring/dashboards_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/dashboard/v1/dashboards_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARDS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARDS_CLIENT_H - -#include "google/cloud/monitoring/dashboard/v1/dashboards_client.h" -#include "google/cloud/monitoring/dashboards_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_dashboard_v1 instead of the aliases defined -/// in this namespace. -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_dashboard_v1::DashboardsServiceClient directly. -using ::google::cloud::monitoring_dashboard_v1::DashboardsServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARDS_CLIENT_H diff --git a/google/cloud/monitoring/dashboards_connection.h b/google/cloud/monitoring/dashboards_connection.h deleted file mode 100644 index 10a03bc195942..0000000000000 --- a/google/cloud/monitoring/dashboards_connection.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/dashboard/v1/dashboards_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARDS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARDS_CONNECTION_H - -#include "google/cloud/monitoring/dashboard/v1/dashboards_connection.h" -#include "google/cloud/monitoring/dashboards_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_dashboard_v1::MakeDashboardsServiceConnection -/// directly. -using ::google::cloud::monitoring_dashboard_v1::MakeDashboardsServiceConnection; - -/// @deprecated Use monitoring_dashboard_v1::DashboardsServiceConnection -/// directly. -using ::google::cloud::monitoring_dashboard_v1::DashboardsServiceConnection; - -/// @deprecated Use -/// monitoring_dashboard_v1::DashboardsServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::monitoring_dashboard_v1:: - DashboardsServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// monitoring_dashboard_v1::DashboardsServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::monitoring_dashboard_v1:: - DashboardsServiceLimitedTimeRetryPolicy; - -/// @deprecated Use monitoring_dashboard_v1::DashboardsServiceRetryPolicy -/// directly. -using ::google::cloud::monitoring_dashboard_v1::DashboardsServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARDS_CONNECTION_H diff --git a/google/cloud/monitoring/dashboards_connection_idempotency_policy.h b/google/cloud/monitoring/dashboards_connection_idempotency_policy.h deleted file mode 100644 index d7db9219e013e..0000000000000 --- a/google/cloud/monitoring/dashboards_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/dashboard/v1/dashboards_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARDS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARDS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/monitoring/dashboard/v1/dashboards_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// monitoring_dashboard_v1::MakeDefaultDashboardsServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::monitoring_dashboard_v1:: - MakeDefaultDashboardsServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// monitoring_dashboard_v1::DashboardsServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::monitoring_dashboard_v1:: - DashboardsServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARDS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/monitoring/dashboards_options.h b/google/cloud/monitoring/dashboards_options.h deleted file mode 100644 index d47f5a9ff89e8..0000000000000 --- a/google/cloud/monitoring/dashboards_options.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/dashboard/v1/dashboards_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARDS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARDS_OPTIONS_H - -#include "google/cloud/monitoring/dashboard/v1/dashboards_options.h" -#include "google/cloud/monitoring/dashboards_connection.h" -#include "google/cloud/monitoring/dashboards_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// monitoring_dashboard_v1::DashboardsServiceBackoffPolicyOption directly. -using ::google::cloud::monitoring_dashboard_v1:: - DashboardsServiceBackoffPolicyOption; - -/// @deprecated Use -/// monitoring_dashboard_v1::DashboardsServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::monitoring_dashboard_v1:: - DashboardsServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use monitoring_dashboard_v1::DashboardsServicePolicyOptionList -/// directly. -using ::google::cloud::monitoring_dashboard_v1:: - DashboardsServicePolicyOptionList; - -/// @deprecated Use monitoring_dashboard_v1::DashboardsServiceRetryPolicyOption -/// directly. -using ::google::cloud::monitoring_dashboard_v1:: - DashboardsServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_DASHBOARDS_OPTIONS_H diff --git a/google/cloud/monitoring/group_client.h b/google/cloud/monitoring/group_client.h deleted file mode 100644 index b9e326b868dfa..0000000000000 --- a/google/cloud/monitoring/group_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/group_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_GROUP_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_GROUP_CLIENT_H - -#include "google/cloud/monitoring/group_connection.h" -#include "google/cloud/monitoring/v3/group_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_v3 instead of the aliases defined in -/// this namespace. -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::GroupServiceClient directly. -using ::google::cloud::monitoring_v3::GroupServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_GROUP_CLIENT_H diff --git a/google/cloud/monitoring/group_connection.h b/google/cloud/monitoring/group_connection.h deleted file mode 100644 index 0745db4e7668b..0000000000000 --- a/google/cloud/monitoring/group_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/group_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_GROUP_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_GROUP_CONNECTION_H - -#include "google/cloud/monitoring/group_connection_idempotency_policy.h" -#include "google/cloud/monitoring/v3/group_connection.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::MakeGroupServiceConnection directly. -using ::google::cloud::monitoring_v3::MakeGroupServiceConnection; - -/// @deprecated Use monitoring_v3::GroupServiceConnection directly. -using ::google::cloud::monitoring_v3::GroupServiceConnection; - -/// @deprecated Use monitoring_v3::GroupServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::monitoring_v3::GroupServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use monitoring_v3::GroupServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::monitoring_v3::GroupServiceLimitedTimeRetryPolicy; - -/// @deprecated Use monitoring_v3::GroupServiceRetryPolicy directly. -using ::google::cloud::monitoring_v3::GroupServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_GROUP_CONNECTION_H diff --git a/google/cloud/monitoring/group_connection_idempotency_policy.h b/google/cloud/monitoring/group_connection_idempotency_policy.h deleted file mode 100644 index 1c200addfa27c..0000000000000 --- a/google/cloud/monitoring/group_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/group_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_GROUP_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_GROUP_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/monitoring/v3/group_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// monitoring_v3::MakeDefaultGroupServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::monitoring_v3:: - MakeDefaultGroupServiceConnectionIdempotencyPolicy; - -/// @deprecated Use monitoring_v3::GroupServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::monitoring_v3::GroupServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_GROUP_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/monitoring/group_options.h b/google/cloud/monitoring/group_options.h deleted file mode 100644 index 01c2543d8a0d4..0000000000000 --- a/google/cloud/monitoring/group_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/group_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_GROUP_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_GROUP_OPTIONS_H - -#include "google/cloud/monitoring/group_connection.h" -#include "google/cloud/monitoring/group_connection_idempotency_policy.h" -#include "google/cloud/monitoring/v3/group_options.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::GroupServiceBackoffPolicyOption directly. -using ::google::cloud::monitoring_v3::GroupServiceBackoffPolicyOption; - -/// @deprecated Use monitoring_v3::GroupServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::monitoring_v3:: - GroupServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use monitoring_v3::GroupServicePolicyOptionList directly. -using ::google::cloud::monitoring_v3::GroupServicePolicyOptionList; - -/// @deprecated Use monitoring_v3::GroupServiceRetryPolicyOption directly. -using ::google::cloud::monitoring_v3::GroupServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_GROUP_OPTIONS_H diff --git a/google/cloud/monitoring/metric_client.h b/google/cloud/monitoring/metric_client.h deleted file mode 100644 index 4217c27f0d372..0000000000000 --- a/google/cloud/monitoring/metric_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/metric_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRIC_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRIC_CLIENT_H - -#include "google/cloud/monitoring/metric_connection.h" -#include "google/cloud/monitoring/v3/metric_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_v3 instead of the aliases defined in -/// this namespace. -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::MetricServiceClient directly. -using ::google::cloud::monitoring_v3::MetricServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRIC_CLIENT_H diff --git a/google/cloud/monitoring/metric_connection.h b/google/cloud/monitoring/metric_connection.h deleted file mode 100644 index 09afb1905be9a..0000000000000 --- a/google/cloud/monitoring/metric_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/metric_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRIC_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRIC_CONNECTION_H - -#include "google/cloud/monitoring/metric_connection_idempotency_policy.h" -#include "google/cloud/monitoring/v3/metric_connection.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::MakeMetricServiceConnection directly. -using ::google::cloud::monitoring_v3::MakeMetricServiceConnection; - -/// @deprecated Use monitoring_v3::MetricServiceConnection directly. -using ::google::cloud::monitoring_v3::MetricServiceConnection; - -/// @deprecated Use monitoring_v3::MetricServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::monitoring_v3::MetricServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use monitoring_v3::MetricServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::monitoring_v3::MetricServiceLimitedTimeRetryPolicy; - -/// @deprecated Use monitoring_v3::MetricServiceRetryPolicy directly. -using ::google::cloud::monitoring_v3::MetricServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRIC_CONNECTION_H diff --git a/google/cloud/monitoring/metric_connection_idempotency_policy.h b/google/cloud/monitoring/metric_connection_idempotency_policy.h deleted file mode 100644 index 9c8d6664ad981..0000000000000 --- a/google/cloud/monitoring/metric_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/metric_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRIC_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRIC_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/monitoring/v3/metric_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// monitoring_v3::MakeDefaultMetricServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::monitoring_v3:: - MakeDefaultMetricServiceConnectionIdempotencyPolicy; - -/// @deprecated Use monitoring_v3::MetricServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::monitoring_v3::MetricServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRIC_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/monitoring/metric_options.h b/google/cloud/monitoring/metric_options.h deleted file mode 100644 index 8931e36cf17d8..0000000000000 --- a/google/cloud/monitoring/metric_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/metric_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRIC_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRIC_OPTIONS_H - -#include "google/cloud/monitoring/metric_connection.h" -#include "google/cloud/monitoring/metric_connection_idempotency_policy.h" -#include "google/cloud/monitoring/v3/metric_options.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::MetricServiceBackoffPolicyOption directly. -using ::google::cloud::monitoring_v3::MetricServiceBackoffPolicyOption; - -/// @deprecated Use -/// monitoring_v3::MetricServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::monitoring_v3:: - MetricServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use monitoring_v3::MetricServicePolicyOptionList directly. -using ::google::cloud::monitoring_v3::MetricServicePolicyOptionList; - -/// @deprecated Use monitoring_v3::MetricServiceRetryPolicyOption directly. -using ::google::cloud::monitoring_v3::MetricServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRIC_OPTIONS_H diff --git a/google/cloud/monitoring/metrics_scopes_client.h b/google/cloud/monitoring/metrics_scopes_client.h deleted file mode 100644 index 06bb7e1890b00..0000000000000 --- a/google/cloud/monitoring/metrics_scopes_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/metricsscope/v1/metrics_scopes.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICS_SCOPES_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICS_SCOPES_CLIENT_H - -#include "google/cloud/monitoring/metrics_scopes_connection.h" -#include "google/cloud/monitoring/metricsscope/v1/metrics_scopes_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_metricsscope_v1 instead of the aliases -/// defined in this namespace. -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_metricsscope_v1::MetricsScopesClient directly. -using ::google::cloud::monitoring_metricsscope_v1::MetricsScopesClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICS_SCOPES_CLIENT_H diff --git a/google/cloud/monitoring/metrics_scopes_connection.h b/google/cloud/monitoring/metrics_scopes_connection.h deleted file mode 100644 index 59c4aa67c17b8..0000000000000 --- a/google/cloud/monitoring/metrics_scopes_connection.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/metricsscope/v1/metrics_scopes.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICS_SCOPES_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICS_SCOPES_CONNECTION_H - -#include "google/cloud/monitoring/metrics_scopes_connection_idempotency_policy.h" -#include "google/cloud/monitoring/metricsscope/v1/metrics_scopes_connection.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_metricsscope_v1::MakeMetricsScopesConnection -/// directly. -using ::google::cloud::monitoring_metricsscope_v1::MakeMetricsScopesConnection; - -/// @deprecated Use monitoring_metricsscope_v1::MetricsScopesConnection -/// directly. -using ::google::cloud::monitoring_metricsscope_v1::MetricsScopesConnection; - -/// @deprecated Use -/// monitoring_metricsscope_v1::MetricsScopesLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::monitoring_metricsscope_v1:: - MetricsScopesLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// monitoring_metricsscope_v1::MetricsScopesLimitedTimeRetryPolicy directly. -using ::google::cloud::monitoring_metricsscope_v1:: - MetricsScopesLimitedTimeRetryPolicy; - -/// @deprecated Use monitoring_metricsscope_v1::MetricsScopesRetryPolicy -/// directly. -using ::google::cloud::monitoring_metricsscope_v1::MetricsScopesRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICS_SCOPES_CONNECTION_H diff --git a/google/cloud/monitoring/metrics_scopes_connection_idempotency_policy.h b/google/cloud/monitoring/metrics_scopes_connection_idempotency_policy.h deleted file mode 100644 index 6dc2c5954b5c9..0000000000000 --- a/google/cloud/monitoring/metrics_scopes_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/metricsscope/v1/metrics_scopes.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICS_SCOPES_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICS_SCOPES_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/monitoring/metricsscope/v1/metrics_scopes_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// monitoring_metricsscope_v1::MakeDefaultMetricsScopesConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::monitoring_metricsscope_v1:: - MakeDefaultMetricsScopesConnectionIdempotencyPolicy; - -/// @deprecated Use -/// monitoring_metricsscope_v1::MetricsScopesConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::monitoring_metricsscope_v1:: - MetricsScopesConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICS_SCOPES_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/monitoring/metrics_scopes_options.h b/google/cloud/monitoring/metrics_scopes_options.h deleted file mode 100644 index 07936ae6e59cb..0000000000000 --- a/google/cloud/monitoring/metrics_scopes_options.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/metricsscope/v1/metrics_scopes.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICS_SCOPES_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICS_SCOPES_OPTIONS_H - -#include "google/cloud/monitoring/metrics_scopes_connection.h" -#include "google/cloud/monitoring/metrics_scopes_connection_idempotency_policy.h" -#include "google/cloud/monitoring/metricsscope/v1/metrics_scopes_options.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_metricsscope_v1::MetricsScopesPollingPolicyOption -/// directly. -using ::google::cloud::monitoring_metricsscope_v1:: - MetricsScopesPollingPolicyOption; - -/// @deprecated Use monitoring_metricsscope_v1::MetricsScopesBackoffPolicyOption -/// directly. -using ::google::cloud::monitoring_metricsscope_v1:: - MetricsScopesBackoffPolicyOption; - -/// @deprecated Use -/// monitoring_metricsscope_v1::MetricsScopesConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::monitoring_metricsscope_v1:: - MetricsScopesConnectionIdempotencyPolicyOption; - -/// @deprecated Use monitoring_metricsscope_v1::MetricsScopesPolicyOptionList -/// directly. -using ::google::cloud::monitoring_metricsscope_v1:: - MetricsScopesPolicyOptionList; - -/// @deprecated Use monitoring_metricsscope_v1::MetricsScopesRetryPolicyOption -/// directly. -using ::google::cloud::monitoring_metricsscope_v1:: - MetricsScopesRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICS_SCOPES_OPTIONS_H diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_auth_decorator.cc b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_auth_decorator.cc index 58efda0fc5df8..46bdb9e5aba38 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_auth_decorator.cc +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/monitoring/metricsscope/v1/metrics_scopes.proto #include "google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_auth_decorator.h" -#include +#include "google/monitoring/metricsscope/v1/metrics_scopes.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_metricsscope_v1_internal { @@ -154,3 +157,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_metricsscope_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_auth_decorator.h b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_auth_decorator.h index c56398d7eff01..be14fd1339de1 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_auth_decorator.h +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 monitoring_metricsscope_v1_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICSSCOPE_V1_INTERNAL_METRICS_SCOPES_AUTH_DECORATOR_H diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_connection_impl.h b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_connection_impl.h index 5dd3278b9bd15..8a4cbc0faeab2 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_connection_impl.h +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_connection_impl.h @@ -31,7 +31,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_logging_decorator.cc b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_logging_decorator.cc index 46d52d2d0700e..65faa919c99d2 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_logging_decorator.cc +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/metricsscope/v1/metrics_scopes.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_metricsscope_v1_internal { @@ -172,3 +175,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_metricsscope_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_logging_decorator.h b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_logging_decorator.h index 50804394f6e19..d12af5b0c12e8 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_logging_decorator.h +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 monitoring_metricsscope_v1_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICSSCOPE_V1_INTERNAL_METRICS_SCOPES_LOGGING_DECORATOR_H diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_metadata_decorator.cc b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_metadata_decorator.cc index adbae1e40720a..e358bcfa8a6ab 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_metadata_decorator.cc +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/monitoring/metricsscope/v1/metrics_scopes.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_metricsscope_v1_internal { @@ -150,3 +154,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_metricsscope_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_metadata_decorator.h b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_metadata_decorator.h index 1d0508a18ecdc..6255ff79f6347 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_metadata_decorator.h +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 monitoring_metricsscope_v1_internal { @@ -102,4 +105,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICSSCOPE_V1_INTERNAL_METRICS_SCOPES_METADATA_DECORATOR_H diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_option_defaults.cc b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_option_defaults.cc index b1f2d7829e743..893b7e0bc203a 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_option_defaults.cc +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_option_defaults.cc @@ -42,7 +42,7 @@ Options MetricsScopesDefaultOptions(Options options) { .has()) { options.set( monitoring_metricsscope_v1::MetricsScopesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub.cc b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub.cc index d9a6ec489bd0b..e981721b1919d 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub.cc +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/monitoring/metricsscope/v1/metrics_scopes.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_metricsscope_v1_internal { @@ -171,3 +174,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_metricsscope_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub.h b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub.h index a13f45f01d62f..e823692dd1c4d 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub.h +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/monitoring/metricsscope/v1/metrics_scopes.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_metricsscope_v1_internal { @@ -162,4 +165,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICSSCOPE_V1_INTERNAL_METRICS_SCOPES_STUB_H diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub_factory.cc b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub_factory.cc index abe17046f95a3..5dd540fd20393 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub_factory.cc +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/monitoring/metricsscope/v1/metrics_scopes.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_metricsscope_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_metricsscope_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub_factory.h b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub_factory.h index 9c799edddec0a..f997dd6850225 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub_factory.h +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_metricsscope_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICSSCOPE_V1_INTERNAL_METRICS_SCOPES_STUB_FACTORY_H diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_connection.cc b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_connection.cc index c9db4d3cbbb9b..120cf578ba0b4 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_connection.cc +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace monitoring_metricsscope_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MetricsScopesTracingConnection::MetricsScopesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -127,16 +125,12 @@ MetricsScopesTracingConnection::DeleteMonitoredProject( child_->DeleteMonitoredProject(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMetricsScopesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_connection.h b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_connection.h index aa67eec6ae105..3f8def50f4cba 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_connection.h +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace monitoring_metricsscope_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MetricsScopesTracingConnection : public monitoring_metricsscope_v1::MetricsScopesConnection { public: @@ -83,8 +81,6 @@ class MetricsScopesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_stub.cc b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_stub.cc index 16cd4237cdd8a..647e520aaea71 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_stub.cc +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_metricsscope_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MetricsScopesTracingStub::MetricsScopesTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -153,18 +154,14 @@ future MetricsScopesTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMetricsScopesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_metricsscope_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_stub.h b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_stub.h index af5f0eab4fe6d..781db3e2c2f90 100644 --- a/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_stub.h +++ b/google/cloud/monitoring/metricsscope/v1/internal/metrics_scopes_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_metricsscope_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MetricsScopesTracingStub : public MetricsScopesStub { public: ~MetricsScopesTracingStub() override = default; @@ -92,8 +93,6 @@ class MetricsScopesTracingStub : public MetricsScopesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -108,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_METRICSSCOPE_V1_INTERNAL_METRICS_SCOPES_TRACING_STUB_H diff --git a/google/cloud/monitoring/metricsscope/v1/metrics_scopes_client.h b/google/cloud/monitoring/metricsscope/v1/metrics_scopes_client.h index b52ddad0890b1..c2c688e2ca933 100644 --- a/google/cloud/monitoring/metricsscope/v1/metrics_scopes_client.h +++ b/google/cloud/monitoring/metricsscope/v1/metrics_scopes_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/monitoring/metricsscope/v1/metrics_scopes_connection.h b/google/cloud/monitoring/metricsscope/v1/metrics_scopes_connection.h index a15d5a5921570..ea1a97db4c9ac 100644 --- a/google/cloud/monitoring/metricsscope/v1/metrics_scopes_connection.h +++ b/google/cloud/monitoring/metricsscope/v1/metrics_scopes_connection.h @@ -29,8 +29,8 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/monitoring/metricsscope/v1/metrics_scopes.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/metricsscope/v1/metrics_scopes_connection_idempotency_policy.h b/google/cloud/monitoring/metricsscope/v1/metrics_scopes_connection_idempotency_policy.h index af83e3ed2b977..8e91748771b50 100644 --- a/google/cloud/monitoring/metricsscope/v1/metrics_scopes_connection_idempotency_policy.h +++ b/google/cloud/monitoring/metricsscope/v1/metrics_scopes_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/metricsscope/v1/metrics_scopes.grpc.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/mocks/mock_alert_policy_connection.h b/google/cloud/monitoring/mocks/mock_alert_policy_connection.h deleted file mode 100644 index a12a35ca1844e..0000000000000 --- a/google/cloud/monitoring/mocks/mock_alert_policy_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/alert_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_ALERT_POLICY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_ALERT_POLICY_CONNECTION_H - -#include "google/cloud/monitoring/alert_policy_connection.h" -#include "google/cloud/monitoring/v3/mocks/mock_alert_policy_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_v3_mocks instead of the aliases -/// defined in this namespace. -namespace monitoring_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3_mocks::MockAlertPolicyServiceConnection -/// directly. -using ::google::cloud::monitoring_v3_mocks::MockAlertPolicyServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_ALERT_POLICY_CONNECTION_H diff --git a/google/cloud/monitoring/mocks/mock_dashboards_connection.h b/google/cloud/monitoring/mocks/mock_dashboards_connection.h deleted file mode 100644 index f189034518b4d..0000000000000 --- a/google/cloud/monitoring/mocks/mock_dashboards_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/dashboard/v1/dashboards_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_DASHBOARDS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_DASHBOARDS_CONNECTION_H - -#include "google/cloud/monitoring/dashboard/v1/mocks/mock_dashboards_connection.h" -#include "google/cloud/monitoring/dashboards_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_dashboard_v1_mocks instead of the aliases -/// defined in this namespace. -namespace monitoring_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// monitoring_dashboard_v1_mocks::MockDashboardsServiceConnection directly. -using ::google::cloud::monitoring_dashboard_v1_mocks:: - MockDashboardsServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_DASHBOARDS_CONNECTION_H diff --git a/google/cloud/monitoring/mocks/mock_group_connection.h b/google/cloud/monitoring/mocks/mock_group_connection.h deleted file mode 100644 index 70095b1974f81..0000000000000 --- a/google/cloud/monitoring/mocks/mock_group_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/group_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_GROUP_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_GROUP_CONNECTION_H - -#include "google/cloud/monitoring/group_connection.h" -#include "google/cloud/monitoring/v3/mocks/mock_group_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_v3_mocks instead of the aliases -/// defined in this namespace. -namespace monitoring_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3_mocks::MockGroupServiceConnection directly. -using ::google::cloud::monitoring_v3_mocks::MockGroupServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_GROUP_CONNECTION_H diff --git a/google/cloud/monitoring/mocks/mock_metric_connection.h b/google/cloud/monitoring/mocks/mock_metric_connection.h deleted file mode 100644 index ea9d87ab549e1..0000000000000 --- a/google/cloud/monitoring/mocks/mock_metric_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/metric_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_METRIC_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_METRIC_CONNECTION_H - -#include "google/cloud/monitoring/metric_connection.h" -#include "google/cloud/monitoring/v3/mocks/mock_metric_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_v3_mocks instead of the aliases -/// defined in this namespace. -namespace monitoring_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3_mocks::MockMetricServiceConnection directly. -using ::google::cloud::monitoring_v3_mocks::MockMetricServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_METRIC_CONNECTION_H diff --git a/google/cloud/monitoring/mocks/mock_metrics_scopes_connection.h b/google/cloud/monitoring/mocks/mock_metrics_scopes_connection.h deleted file mode 100644 index 9bd7bf4120393..0000000000000 --- a/google/cloud/monitoring/mocks/mock_metrics_scopes_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/metricsscope/v1/metrics_scopes.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_METRICS_SCOPES_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_METRICS_SCOPES_CONNECTION_H - -#include "google/cloud/monitoring/metrics_scopes_connection.h" -#include "google/cloud/monitoring/metricsscope/v1/mocks/mock_metrics_scopes_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_metricsscope_v1_mocks instead of the aliases -/// defined in this namespace. -namespace monitoring_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// monitoring_metricsscope_v1_mocks::MockMetricsScopesConnection directly. -using ::google::cloud::monitoring_metricsscope_v1_mocks:: - MockMetricsScopesConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_METRICS_SCOPES_CONNECTION_H diff --git a/google/cloud/monitoring/mocks/mock_notification_channel_connection.h b/google/cloud/monitoring/mocks/mock_notification_channel_connection.h deleted file mode 100644 index 0e89780c9f939..0000000000000 --- a/google/cloud/monitoring/mocks/mock_notification_channel_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/notification_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_NOTIFICATION_CHANNEL_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_NOTIFICATION_CHANNEL_CONNECTION_H - -#include "google/cloud/monitoring/notification_channel_connection.h" -#include "google/cloud/monitoring/v3/mocks/mock_notification_channel_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_v3_mocks instead of the aliases -/// defined in this namespace. -namespace monitoring_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// monitoring_v3_mocks::MockNotificationChannelServiceConnection directly. -using ::google::cloud::monitoring_v3_mocks:: - MockNotificationChannelServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_NOTIFICATION_CHANNEL_CONNECTION_H diff --git a/google/cloud/monitoring/mocks/mock_query_connection.h b/google/cloud/monitoring/mocks/mock_query_connection.h deleted file mode 100644 index 55d353fa95d1f..0000000000000 --- a/google/cloud/monitoring/mocks/mock_query_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/query_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_QUERY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_QUERY_CONNECTION_H - -#include "google/cloud/monitoring/query_connection.h" -#include "google/cloud/monitoring/v3/mocks/mock_query_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_v3_mocks instead of the aliases -/// defined in this namespace. -namespace monitoring_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3_mocks::MockQueryServiceConnection directly. -using ::google::cloud::monitoring_v3_mocks::MockQueryServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_QUERY_CONNECTION_H diff --git a/google/cloud/monitoring/mocks/mock_service_monitoring_connection.h b/google/cloud/monitoring/mocks/mock_service_monitoring_connection.h deleted file mode 100644 index 3bb25eb55321b..0000000000000 --- a/google/cloud/monitoring/mocks/mock_service_monitoring_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/service_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_SERVICE_MONITORING_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_SERVICE_MONITORING_CONNECTION_H - -#include "google/cloud/monitoring/service_monitoring_connection.h" -#include "google/cloud/monitoring/v3/mocks/mock_service_monitoring_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_v3_mocks instead of the aliases -/// defined in this namespace. -namespace monitoring_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3_mocks::MockServiceMonitoringServiceConnection -/// directly. -using ::google::cloud::monitoring_v3_mocks:: - MockServiceMonitoringServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_SERVICE_MONITORING_CONNECTION_H diff --git a/google/cloud/monitoring/mocks/mock_uptime_check_connection.h b/google/cloud/monitoring/mocks/mock_uptime_check_connection.h deleted file mode 100644 index bacad030a968a..0000000000000 --- a/google/cloud/monitoring/mocks/mock_uptime_check_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/uptime_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_UPTIME_CHECK_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_UPTIME_CHECK_CONNECTION_H - -#include "google/cloud/monitoring/uptime_check_connection.h" -#include "google/cloud/monitoring/v3/mocks/mock_uptime_check_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_v3_mocks instead of the aliases -/// defined in this namespace. -namespace monitoring_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3_mocks::MockUptimeCheckServiceConnection -/// directly. -using ::google::cloud::monitoring_v3_mocks::MockUptimeCheckServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_MOCKS_MOCK_UPTIME_CHECK_CONNECTION_H diff --git a/google/cloud/monitoring/notification_channel_client.h b/google/cloud/monitoring/notification_channel_client.h deleted file mode 100644 index 10bb972cf9748..0000000000000 --- a/google/cloud/monitoring/notification_channel_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/notification_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_NOTIFICATION_CHANNEL_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_NOTIFICATION_CHANNEL_CLIENT_H - -#include "google/cloud/monitoring/notification_channel_connection.h" -#include "google/cloud/monitoring/v3/notification_channel_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_v3 instead of the aliases defined in -/// this namespace. -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::NotificationChannelServiceClient directly. -using ::google::cloud::monitoring_v3::NotificationChannelServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_NOTIFICATION_CHANNEL_CLIENT_H diff --git a/google/cloud/monitoring/notification_channel_connection.h b/google/cloud/monitoring/notification_channel_connection.h deleted file mode 100644 index 7342a37707a0e..0000000000000 --- a/google/cloud/monitoring/notification_channel_connection.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/notification_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_NOTIFICATION_CHANNEL_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_NOTIFICATION_CHANNEL_CONNECTION_H - -#include "google/cloud/monitoring/notification_channel_connection_idempotency_policy.h" -#include "google/cloud/monitoring/v3/notification_channel_connection.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::MakeNotificationChannelServiceConnection -/// directly. -using ::google::cloud::monitoring_v3::MakeNotificationChannelServiceConnection; - -/// @deprecated Use monitoring_v3::NotificationChannelServiceConnection -/// directly. -using ::google::cloud::monitoring_v3::NotificationChannelServiceConnection; - -/// @deprecated Use -/// monitoring_v3::NotificationChannelServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::monitoring_v3:: - NotificationChannelServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// monitoring_v3::NotificationChannelServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::monitoring_v3:: - NotificationChannelServiceLimitedTimeRetryPolicy; - -/// @deprecated Use monitoring_v3::NotificationChannelServiceRetryPolicy -/// directly. -using ::google::cloud::monitoring_v3::NotificationChannelServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_NOTIFICATION_CHANNEL_CONNECTION_H diff --git a/google/cloud/monitoring/notification_channel_connection_idempotency_policy.h b/google/cloud/monitoring/notification_channel_connection_idempotency_policy.h deleted file mode 100644 index ed43ac0c213fb..0000000000000 --- a/google/cloud/monitoring/notification_channel_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/notification_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_NOTIFICATION_CHANNEL_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_NOTIFICATION_CHANNEL_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/monitoring/v3/notification_channel_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// monitoring_v3::MakeDefaultNotificationChannelServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::monitoring_v3:: - MakeDefaultNotificationChannelServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// monitoring_v3::NotificationChannelServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::monitoring_v3:: - NotificationChannelServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_NOTIFICATION_CHANNEL_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/monitoring/notification_channel_options.h b/google/cloud/monitoring/notification_channel_options.h deleted file mode 100644 index 93659b17a03a5..0000000000000 --- a/google/cloud/monitoring/notification_channel_options.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/notification_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_NOTIFICATION_CHANNEL_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_NOTIFICATION_CHANNEL_OPTIONS_H - -#include "google/cloud/monitoring/notification_channel_connection.h" -#include "google/cloud/monitoring/notification_channel_connection_idempotency_policy.h" -#include "google/cloud/monitoring/v3/notification_channel_options.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::NotificationChannelServiceBackoffPolicyOption -/// directly. -using ::google::cloud::monitoring_v3:: - NotificationChannelServiceBackoffPolicyOption; - -/// @deprecated Use -/// monitoring_v3::NotificationChannelServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::monitoring_v3:: - NotificationChannelServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use monitoring_v3::NotificationChannelServicePolicyOptionList -/// directly. -using ::google::cloud::monitoring_v3:: - NotificationChannelServicePolicyOptionList; - -/// @deprecated Use monitoring_v3::NotificationChannelServiceRetryPolicyOption -/// directly. -using ::google::cloud::monitoring_v3:: - NotificationChannelServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_NOTIFICATION_CHANNEL_OPTIONS_H diff --git a/google/cloud/monitoring/query_client.h b/google/cloud/monitoring/query_client.h deleted file mode 100644 index ad5c84801a048..0000000000000 --- a/google/cloud/monitoring/query_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/query_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_QUERY_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_QUERY_CLIENT_H - -#include "google/cloud/monitoring/query_connection.h" -#include "google/cloud/monitoring/v3/query_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_v3 instead of the aliases defined in -/// this namespace. -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::QueryServiceClient directly. -using ::google::cloud::monitoring_v3::QueryServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_QUERY_CLIENT_H diff --git a/google/cloud/monitoring/query_connection.h b/google/cloud/monitoring/query_connection.h deleted file mode 100644 index 30edf28300eb3..0000000000000 --- a/google/cloud/monitoring/query_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/query_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_QUERY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_QUERY_CONNECTION_H - -#include "google/cloud/monitoring/query_connection_idempotency_policy.h" -#include "google/cloud/monitoring/v3/query_connection.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::MakeQueryServiceConnection directly. -using ::google::cloud::monitoring_v3::MakeQueryServiceConnection; - -/// @deprecated Use monitoring_v3::QueryServiceConnection directly. -using ::google::cloud::monitoring_v3::QueryServiceConnection; - -/// @deprecated Use monitoring_v3::QueryServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::monitoring_v3::QueryServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use monitoring_v3::QueryServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::monitoring_v3::QueryServiceLimitedTimeRetryPolicy; - -/// @deprecated Use monitoring_v3::QueryServiceRetryPolicy directly. -using ::google::cloud::monitoring_v3::QueryServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_QUERY_CONNECTION_H diff --git a/google/cloud/monitoring/query_connection_idempotency_policy.h b/google/cloud/monitoring/query_connection_idempotency_policy.h deleted file mode 100644 index 34464b5f07c64..0000000000000 --- a/google/cloud/monitoring/query_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/query_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_QUERY_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_QUERY_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/monitoring/v3/query_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// monitoring_v3::MakeDefaultQueryServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::monitoring_v3:: - MakeDefaultQueryServiceConnectionIdempotencyPolicy; - -/// @deprecated Use monitoring_v3::QueryServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::monitoring_v3::QueryServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_QUERY_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/monitoring/query_options.h b/google/cloud/monitoring/query_options.h deleted file mode 100644 index 0e4039d535d98..0000000000000 --- a/google/cloud/monitoring/query_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/query_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_QUERY_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_QUERY_OPTIONS_H - -#include "google/cloud/monitoring/query_connection.h" -#include "google/cloud/monitoring/query_connection_idempotency_policy.h" -#include "google/cloud/monitoring/v3/query_options.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::QueryServiceBackoffPolicyOption directly. -using ::google::cloud::monitoring_v3::QueryServiceBackoffPolicyOption; - -/// @deprecated Use monitoring_v3::QueryServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::monitoring_v3:: - QueryServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use monitoring_v3::QueryServicePolicyOptionList directly. -using ::google::cloud::monitoring_v3::QueryServicePolicyOptionList; - -/// @deprecated Use monitoring_v3::QueryServiceRetryPolicyOption directly. -using ::google::cloud::monitoring_v3::QueryServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_QUERY_OPTIONS_H diff --git a/google/cloud/monitoring/quickstart/.bazelrc b/google/cloud/monitoring/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/monitoring/quickstart/.bazelrc +++ b/google/cloud/monitoring/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/monitoring/quickstart/CMakeLists.txt index 3628c7d13f8a0..75213700abdf7 100644 --- a/google/cloud/monitoring/quickstart/CMakeLists.txt +++ b/google/cloud/monitoring/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Monitoring API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-monitoring-quickstart CXX) find_package(google_cloud_cpp_monitoring REQUIRED) diff --git a/google/cloud/monitoring/quickstart/WORKSPACE.bazel b/google/cloud/monitoring/quickstart/WORKSPACE.bazel index b243d1ac79e08..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 = "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/monitoring/service_monitoring_client.h b/google/cloud/monitoring/service_monitoring_client.h deleted file mode 100644 index 483fd0e0f1661..0000000000000 --- a/google/cloud/monitoring/service_monitoring_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/service_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_SERVICE_MONITORING_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_SERVICE_MONITORING_CLIENT_H - -#include "google/cloud/monitoring/service_monitoring_connection.h" -#include "google/cloud/monitoring/v3/service_monitoring_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_v3 instead of the aliases defined in -/// this namespace. -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::ServiceMonitoringServiceClient directly. -using ::google::cloud::monitoring_v3::ServiceMonitoringServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_SERVICE_MONITORING_CLIENT_H diff --git a/google/cloud/monitoring/service_monitoring_connection.h b/google/cloud/monitoring/service_monitoring_connection.h deleted file mode 100644 index 0687d4fc765c9..0000000000000 --- a/google/cloud/monitoring/service_monitoring_connection.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/service_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_SERVICE_MONITORING_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_SERVICE_MONITORING_CONNECTION_H - -#include "google/cloud/monitoring/service_monitoring_connection_idempotency_policy.h" -#include "google/cloud/monitoring/v3/service_monitoring_connection.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::MakeServiceMonitoringServiceConnection -/// directly. -using ::google::cloud::monitoring_v3::MakeServiceMonitoringServiceConnection; - -/// @deprecated Use monitoring_v3::ServiceMonitoringServiceConnection directly. -using ::google::cloud::monitoring_v3::ServiceMonitoringServiceConnection; - -/// @deprecated Use -/// monitoring_v3::ServiceMonitoringServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::monitoring_v3:: - ServiceMonitoringServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// monitoring_v3::ServiceMonitoringServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::monitoring_v3:: - ServiceMonitoringServiceLimitedTimeRetryPolicy; - -/// @deprecated Use monitoring_v3::ServiceMonitoringServiceRetryPolicy directly. -using ::google::cloud::monitoring_v3::ServiceMonitoringServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_SERVICE_MONITORING_CONNECTION_H diff --git a/google/cloud/monitoring/service_monitoring_connection_idempotency_policy.h b/google/cloud/monitoring/service_monitoring_connection_idempotency_policy.h deleted file mode 100644 index a58aa159edb1a..0000000000000 --- a/google/cloud/monitoring/service_monitoring_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/service_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_SERVICE_MONITORING_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_SERVICE_MONITORING_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/monitoring/v3/service_monitoring_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// monitoring_v3::MakeDefaultServiceMonitoringServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::monitoring_v3:: - MakeDefaultServiceMonitoringServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// monitoring_v3::ServiceMonitoringServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::monitoring_v3:: - ServiceMonitoringServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_SERVICE_MONITORING_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/monitoring/service_monitoring_options.h b/google/cloud/monitoring/service_monitoring_options.h deleted file mode 100644 index 8bc13aa670702..0000000000000 --- a/google/cloud/monitoring/service_monitoring_options.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/service_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_SERVICE_MONITORING_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_SERVICE_MONITORING_OPTIONS_H - -#include "google/cloud/monitoring/service_monitoring_connection.h" -#include "google/cloud/monitoring/service_monitoring_connection_idempotency_policy.h" -#include "google/cloud/monitoring/v3/service_monitoring_options.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::ServiceMonitoringServiceBackoffPolicyOption -/// directly. -using ::google::cloud::monitoring_v3:: - ServiceMonitoringServiceBackoffPolicyOption; - -/// @deprecated Use -/// monitoring_v3::ServiceMonitoringServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::monitoring_v3:: - ServiceMonitoringServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use monitoring_v3::ServiceMonitoringServicePolicyOptionList -/// directly. -using ::google::cloud::monitoring_v3::ServiceMonitoringServicePolicyOptionList; - -/// @deprecated Use monitoring_v3::ServiceMonitoringServiceRetryPolicyOption -/// directly. -using ::google::cloud::monitoring_v3::ServiceMonitoringServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_SERVICE_MONITORING_OPTIONS_H diff --git a/google/cloud/monitoring/uptime_check_client.h b/google/cloud/monitoring/uptime_check_client.h deleted file mode 100644 index 80ac18bee1404..0000000000000 --- a/google/cloud/monitoring/uptime_check_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/uptime_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_UPTIME_CHECK_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_UPTIME_CHECK_CLIENT_H - -#include "google/cloud/monitoring/uptime_check_connection.h" -#include "google/cloud/monitoring/v3/uptime_check_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in monitoring_v3 instead of the aliases defined in -/// this namespace. -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::UptimeCheckServiceClient directly. -using ::google::cloud::monitoring_v3::UptimeCheckServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_UPTIME_CHECK_CLIENT_H diff --git a/google/cloud/monitoring/uptime_check_connection.h b/google/cloud/monitoring/uptime_check_connection.h deleted file mode 100644 index 3b7e7326b6e71..0000000000000 --- a/google/cloud/monitoring/uptime_check_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/uptime_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_UPTIME_CHECK_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_UPTIME_CHECK_CONNECTION_H - -#include "google/cloud/monitoring/uptime_check_connection_idempotency_policy.h" -#include "google/cloud/monitoring/v3/uptime_check_connection.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::MakeUptimeCheckServiceConnection directly. -using ::google::cloud::monitoring_v3::MakeUptimeCheckServiceConnection; - -/// @deprecated Use monitoring_v3::UptimeCheckServiceConnection directly. -using ::google::cloud::monitoring_v3::UptimeCheckServiceConnection; - -/// @deprecated Use -/// monitoring_v3::UptimeCheckServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::monitoring_v3:: - UptimeCheckServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use monitoring_v3::UptimeCheckServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::monitoring_v3::UptimeCheckServiceLimitedTimeRetryPolicy; - -/// @deprecated Use monitoring_v3::UptimeCheckServiceRetryPolicy directly. -using ::google::cloud::monitoring_v3::UptimeCheckServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_UPTIME_CHECK_CONNECTION_H diff --git a/google/cloud/monitoring/uptime_check_connection_idempotency_policy.h b/google/cloud/monitoring/uptime_check_connection_idempotency_policy.h deleted file mode 100644 index a0a23b1297e14..0000000000000 --- a/google/cloud/monitoring/uptime_check_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/uptime_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_UPTIME_CHECK_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_UPTIME_CHECK_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/monitoring/v3/uptime_check_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// monitoring_v3::MakeDefaultUptimeCheckServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::monitoring_v3:: - MakeDefaultUptimeCheckServiceConnectionIdempotencyPolicy; - -/// @deprecated Use monitoring_v3::UptimeCheckServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::monitoring_v3:: - UptimeCheckServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_UPTIME_CHECK_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/monitoring/uptime_check_options.h b/google/cloud/monitoring/uptime_check_options.h deleted file mode 100644 index 2cd0bfab6507c..0000000000000 --- a/google/cloud/monitoring/uptime_check_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/monitoring/v3/uptime_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_UPTIME_CHECK_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_UPTIME_CHECK_OPTIONS_H - -#include "google/cloud/monitoring/uptime_check_connection.h" -#include "google/cloud/monitoring/uptime_check_connection_idempotency_policy.h" -#include "google/cloud/monitoring/v3/uptime_check_options.h" - -namespace google { -namespace cloud { -namespace monitoring { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use monitoring_v3::UptimeCheckServiceBackoffPolicyOption -/// directly. -using ::google::cloud::monitoring_v3::UptimeCheckServiceBackoffPolicyOption; - -/// @deprecated Use -/// monitoring_v3::UptimeCheckServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::monitoring_v3:: - UptimeCheckServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use monitoring_v3::UptimeCheckServicePolicyOptionList directly. -using ::google::cloud::monitoring_v3::UptimeCheckServicePolicyOptionList; - -/// @deprecated Use monitoring_v3::UptimeCheckServiceRetryPolicyOption directly. -using ::google::cloud::monitoring_v3::UptimeCheckServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace monitoring -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_UPTIME_CHECK_OPTIONS_H diff --git a/google/cloud/monitoring/v3/alert_policy_connection.h b/google/cloud/monitoring/v3/alert_policy_connection.h index ba46c0c9557fc..7d2bed051c265 100644 --- a/google/cloud/monitoring/v3/alert_policy_connection.h +++ b/google/cloud/monitoring/v3/alert_policy_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/alert_service.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/alert_policy_connection_idempotency_policy.h b/google/cloud/monitoring/v3/alert_policy_connection_idempotency_policy.h index 3ff3391db3277..e7af4627ffb03 100644 --- a/google/cloud/monitoring/v3/alert_policy_connection_idempotency_policy.h +++ b/google/cloud/monitoring/v3/alert_policy_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/alert_service.grpc.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/group_connection.h b/google/cloud/monitoring/v3/group_connection.h index 970c92b73daea..e52371f6656d5 100644 --- a/google/cloud/monitoring/v3/group_connection.h +++ b/google/cloud/monitoring/v3/group_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/group_service.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/group_connection_idempotency_policy.h b/google/cloud/monitoring/v3/group_connection_idempotency_policy.h index ab318d3db53c4..c79ef43f5a0df 100644 --- a/google/cloud/monitoring/v3/group_connection_idempotency_policy.h +++ b/google/cloud/monitoring/v3/group_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/group_service.grpc.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/internal/alert_policy_auth_decorator.cc b/google/cloud/monitoring/v3/internal/alert_policy_auth_decorator.cc index 744f9277029d1..689796e5437c5 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_auth_decorator.cc +++ b/google/cloud/monitoring/v3/internal/alert_policy_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/monitoring/v3/alert_service.proto #include "google/cloud/monitoring/v3/internal/alert_policy_auth_decorator.h" -#include +#include "google/monitoring/v3/alert_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/alert_policy_auth_decorator.h b/google/cloud/monitoring/v3/internal/alert_policy_auth_decorator.h index 2667a653c20b5..dd037d31467a8 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_auth_decorator.h +++ b/google/cloud/monitoring/v3/internal/alert_policy_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -68,4 +71,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_ALERT_POLICY_AUTH_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/alert_policy_logging_decorator.cc b/google/cloud/monitoring/v3/internal/alert_policy_logging_decorator.cc index 5dca3b1b83cf2..878e70e234889 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_logging_decorator.cc +++ b/google/cloud/monitoring/v3/internal/alert_policy_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/monitoring/v3/internal/alert_policy_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/alert_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -98,3 +101,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/alert_policy_logging_decorator.h b/google/cloud/monitoring/v3/internal/alert_policy_logging_decorator.h index 192991c917229..88f79cc88ede8 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_logging_decorator.h +++ b/google/cloud/monitoring/v3/internal/alert_policy_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -68,4 +71,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_ALERT_POLICY_LOGGING_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/alert_policy_metadata_decorator.cc b/google/cloud/monitoring/v3/internal/alert_policy_metadata_decorator.cc index 103e46adf0270..b89e3bb2188a9 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_metadata_decorator.cc +++ b/google/cloud/monitoring/v3/internal/alert_policy_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/monitoring/v3/internal/alert_policy_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/monitoring/v3/alert_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -106,3 +110,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/alert_policy_metadata_decorator.h b/google/cloud/monitoring/v3/internal/alert_policy_metadata_decorator.h index 47382db27536d..0165995d63762 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_metadata_decorator.h +++ b/google/cloud/monitoring/v3/internal/alert_policy_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -74,4 +77,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_ALERT_POLICY_METADATA_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/alert_policy_option_defaults.cc b/google/cloud/monitoring/v3/internal/alert_policy_option_defaults.cc index f60def1f503a7..bdfcdf82fc2e1 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_option_defaults.cc +++ b/google/cloud/monitoring/v3/internal/alert_policy_option_defaults.cc @@ -42,7 +42,7 @@ Options AlertPolicyServiceDefaultOptions(Options options) { if (!options.has()) { options.set( monitoring_v3::AlertPolicyServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/monitoring/v3/internal/alert_policy_stub.cc b/google/cloud/monitoring/v3/internal/alert_policy_stub.cc index d1e4549ac5403..4d07feb94d4ef 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_stub.cc +++ b/google/cloud/monitoring/v3/internal/alert_policy_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/monitoring/v3/internal/alert_policy_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/alert_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -93,3 +96,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/alert_policy_stub.h b/google/cloud/monitoring/v3/internal/alert_policy_stub.h index 0c2d44a88bbc9..4cdff19eb04fc 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_stub.h +++ b/google/cloud/monitoring/v3/internal/alert_policy_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/alert_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_ALERT_POLICY_STUB_H diff --git a/google/cloud/monitoring/v3/internal/alert_policy_stub_factory.cc b/google/cloud/monitoring/v3/internal/alert_policy_stub_factory.cc index 23c81623130bd..dfc96a0a959b6 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_stub_factory.cc +++ b/google/cloud/monitoring/v3/internal/alert_policy_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/monitoring/v3/alert_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/alert_policy_stub_factory.h b/google/cloud/monitoring/v3/internal/alert_policy_stub_factory.h index 1c8928d8b1ada..b9c96202e8ea7 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_stub_factory.h +++ b/google/cloud/monitoring/v3/internal/alert_policy_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_ALERT_POLICY_STUB_FACTORY_H diff --git a/google/cloud/monitoring/v3/internal/alert_policy_tracing_connection.cc b/google/cloud/monitoring/v3/internal/alert_policy_tracing_connection.cc index 3a4741a2e7cbe..794c3568f2786 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_tracing_connection.cc +++ b/google/cloud/monitoring/v3/internal/alert_policy_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AlertPolicyServiceTracingConnection::AlertPolicyServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -79,17 +77,13 @@ AlertPolicyServiceTracingConnection::UpdateAlertPolicy( return internal::EndSpan(*span, child_->UpdateAlertPolicy(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAlertPolicyServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/monitoring/v3/internal/alert_policy_tracing_connection.h b/google/cloud/monitoring/v3/internal/alert_policy_tracing_connection.h index 59ea0de728f8c..b9746c3fa5ca9 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_tracing_connection.h +++ b/google/cloud/monitoring/v3/internal/alert_policy_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AlertPolicyServiceTracingConnection : public monitoring_v3::AlertPolicyServiceConnection { public: @@ -59,8 +57,6 @@ class AlertPolicyServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/monitoring/v3/internal/alert_policy_tracing_stub.cc b/google/cloud/monitoring/v3/internal/alert_policy_tracing_stub.cc index afcf3658f45d4..f0084cb32fa25 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_tracing_stub.cc +++ b/google/cloud/monitoring/v3/internal/alert_policy_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AlertPolicyServiceTracingStub::AlertPolicyServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -91,18 +92,14 @@ AlertPolicyServiceTracingStub::UpdateAlertPolicy( context, *span, child_->UpdateAlertPolicy(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAlertPolicyServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/alert_policy_tracing_stub.h b/google/cloud/monitoring/v3/internal/alert_policy_tracing_stub.h index a9fa878e405c4..8e1fd124621d3 100644 --- a/google/cloud/monitoring/v3/internal/alert_policy_tracing_stub.h +++ b/google/cloud/monitoring/v3/internal/alert_policy_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AlertPolicyServiceTracingStub : public AlertPolicyServiceStub { public: ~AlertPolicyServiceTracingStub() override = default; @@ -65,8 +66,6 @@ class AlertPolicyServiceTracingStub : public AlertPolicyServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -81,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_ALERT_POLICY_TRACING_STUB_H diff --git a/google/cloud/monitoring/v3/internal/group_auth_decorator.cc b/google/cloud/monitoring/v3/internal/group_auth_decorator.cc index b864ecb94d7b3..5ce7afdd000af 100644 --- a/google/cloud/monitoring/v3/internal/group_auth_decorator.cc +++ b/google/cloud/monitoring/v3/internal/group_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/monitoring/v3/group_service.proto #include "google/cloud/monitoring/v3/internal/group_auth_decorator.h" -#include +#include "google/monitoring/v3/group_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -85,3 +88,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/group_auth_decorator.h b/google/cloud/monitoring/v3/internal/group_auth_decorator.h index 1e2bf23b6255f..f50a6a641ef8c 100644 --- a/google/cloud/monitoring/v3/internal/group_auth_decorator.h +++ b/google/cloud/monitoring/v3/internal/group_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -72,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_GROUP_AUTH_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/group_logging_decorator.cc b/google/cloud/monitoring/v3/internal/group_logging_decorator.cc index 5538379be5d7d..b2795b405d10c 100644 --- a/google/cloud/monitoring/v3/internal/group_logging_decorator.cc +++ b/google/cloud/monitoring/v3/internal/group_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/monitoring/v3/internal/group_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/group_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -107,3 +110,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/group_logging_decorator.h b/google/cloud/monitoring/v3/internal/group_logging_decorator.h index d6590f8574858..9de2816822ce2 100644 --- a/google/cloud/monitoring/v3/internal/group_logging_decorator.h +++ b/google/cloud/monitoring/v3/internal/group_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -72,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_GROUP_LOGGING_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/group_metadata_decorator.cc b/google/cloud/monitoring/v3/internal/group_metadata_decorator.cc index 6b006748fc4a2..5dc8b9fbefd6e 100644 --- a/google/cloud/monitoring/v3/internal/group_metadata_decorator.cc +++ b/google/cloud/monitoring/v3/internal/group_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/monitoring/v3/internal/group_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/monitoring/v3/group_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -112,3 +116,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/group_metadata_decorator.h b/google/cloud/monitoring/v3/internal/group_metadata_decorator.h index cdb78aad5e920..b89a791b05f35 100644 --- a/google/cloud/monitoring/v3/internal/group_metadata_decorator.h +++ b/google/cloud/monitoring/v3/internal/group_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -77,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_GROUP_METADATA_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/group_option_defaults.cc b/google/cloud/monitoring/v3/internal/group_option_defaults.cc index a4511a993328a..cc741f4947c35 100644 --- a/google/cloud/monitoring/v3/internal/group_option_defaults.cc +++ b/google/cloud/monitoring/v3/internal/group_option_defaults.cc @@ -41,7 +41,7 @@ Options GroupServiceDefaultOptions(Options options) { if (!options.has()) { options.set( monitoring_v3::GroupServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/monitoring/v3/internal/group_stub.cc b/google/cloud/monitoring/v3/internal/group_stub.cc index 795ea16b9795e..87c76b2774a4c 100644 --- a/google/cloud/monitoring/v3/internal/group_stub.cc +++ b/google/cloud/monitoring/v3/internal/group_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/monitoring/v3/internal/group_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/group_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -102,3 +105,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/group_stub.h b/google/cloud/monitoring/v3/internal/group_stub.h index 2967b6c047c5e..1f84de14d5c5f 100644 --- a/google/cloud/monitoring/v3/internal/group_stub.h +++ b/google/cloud/monitoring/v3/internal/group_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/group_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -102,4 +105,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_GROUP_STUB_H diff --git a/google/cloud/monitoring/v3/internal/group_stub_factory.cc b/google/cloud/monitoring/v3/internal/group_stub_factory.cc index 221e9b59f7a36..de4f45aa59fc2 100644 --- a/google/cloud/monitoring/v3/internal/group_stub_factory.cc +++ b/google/cloud/monitoring/v3/internal/group_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/monitoring/v3/group_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/group_stub_factory.h b/google/cloud/monitoring/v3/internal/group_stub_factory.h index 3889278071424..c8f1188f37b01 100644 --- a/google/cloud/monitoring/v3/internal/group_stub_factory.h +++ b/google/cloud/monitoring/v3/internal/group_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_GROUP_STUB_FACTORY_H diff --git a/google/cloud/monitoring/v3/internal/group_tracing_connection.cc b/google/cloud/monitoring/v3/internal/group_tracing_connection.cc index d88eb0f01a426..bd90ee9a321b4 100644 --- a/google/cloud/monitoring/v3/internal/group_tracing_connection.cc +++ b/google/cloud/monitoring/v3/internal/group_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GroupServiceTracingConnection::GroupServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -89,16 +87,12 @@ GroupServiceTracingConnection::ListGroupMembers( std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGroupServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/monitoring/v3/internal/group_tracing_connection.h b/google/cloud/monitoring/v3/internal/group_tracing_connection.h index d3baeb706c985..685c783c79c25 100644 --- a/google/cloud/monitoring/v3/internal/group_tracing_connection.h +++ b/google/cloud/monitoring/v3/internal/group_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GroupServiceTracingConnection : public monitoring_v3::GroupServiceConnection { public: @@ -62,8 +60,6 @@ class GroupServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/monitoring/v3/internal/group_tracing_stub.cc b/google/cloud/monitoring/v3/internal/group_tracing_stub.cc index d97f2aafa00f4..f7ed8355e7a17 100644 --- a/google/cloud/monitoring/v3/internal/group_tracing_stub.cc +++ b/google/cloud/monitoring/v3/internal/group_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GroupServiceTracingStub::GroupServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -100,18 +101,14 @@ GroupServiceTracingStub::ListGroupMembers( child_->ListGroupMembers(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeGroupServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/group_tracing_stub.h b/google/cloud/monitoring/v3/internal/group_tracing_stub.h index bacacbb3c7176..0a4f6aec04c4d 100644 --- a/google/cloud/monitoring/v3/internal/group_tracing_stub.h +++ b/google/cloud/monitoring/v3/internal/group_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class GroupServiceTracingStub : public GroupServiceStub { public: ~GroupServiceTracingStub() override = default; @@ -68,8 +69,6 @@ class GroupServiceTracingStub : public GroupServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -84,4 +83,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_GROUP_TRACING_STUB_H diff --git a/google/cloud/monitoring/v3/internal/metric_auth_decorator.cc b/google/cloud/monitoring/v3/internal/metric_auth_decorator.cc index d922c6d4bf279..567085466d955 100644 --- a/google/cloud/monitoring/v3/internal/metric_auth_decorator.cc +++ b/google/cloud/monitoring/v3/internal/metric_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/monitoring/v3/metric_service.proto #include "google/cloud/monitoring/v3/internal/metric_auth_decorator.h" -#include +#include "google/monitoring/v3/metric_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -130,3 +133,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/metric_auth_decorator.h b/google/cloud/monitoring/v3/internal/metric_auth_decorator.h index 7fd27632b94b4..9ef0a3793adbc 100644 --- a/google/cloud/monitoring/v3/internal/metric_auth_decorator.h +++ b/google/cloud/monitoring/v3/internal/metric_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_METRIC_AUTH_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/metric_logging_decorator.cc b/google/cloud/monitoring/v3/internal/metric_logging_decorator.cc index 4a46659aacace..b019dd64f6b87 100644 --- a/google/cloud/monitoring/v3/internal/metric_logging_decorator.cc +++ b/google/cloud/monitoring/v3/internal/metric_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/monitoring/v3/internal/metric_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/metric_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -173,3 +176,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/metric_logging_decorator.h b/google/cloud/monitoring/v3/internal/metric_logging_decorator.h index b6d6adea84d29..b05ae43a52fb9 100644 --- a/google/cloud/monitoring/v3/internal/metric_logging_decorator.h +++ b/google/cloud/monitoring/v3/internal/metric_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_METRIC_LOGGING_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/metric_metadata_decorator.cc b/google/cloud/monitoring/v3/internal/metric_metadata_decorator.cc index b6de4a382c956..531c207d74aa4 100644 --- a/google/cloud/monitoring/v3/internal/metric_metadata_decorator.cc +++ b/google/cloud/monitoring/v3/internal/metric_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/monitoring/v3/internal/metric_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/monitoring/v3/metric_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -152,3 +156,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/metric_metadata_decorator.h b/google/cloud/monitoring/v3/internal/metric_metadata_decorator.h index 2f4bc7a080ba6..c08f82620b1a2 100644 --- a/google/cloud/monitoring/v3/internal/metric_metadata_decorator.h +++ b/google/cloud/monitoring/v3/internal/metric_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_METRIC_METADATA_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/metric_option_defaults.cc b/google/cloud/monitoring/v3/internal/metric_option_defaults.cc index dab900b3ab539..c5ca48f215b4c 100644 --- a/google/cloud/monitoring/v3/internal/metric_option_defaults.cc +++ b/google/cloud/monitoring/v3/internal/metric_option_defaults.cc @@ -41,7 +41,7 @@ Options MetricServiceDefaultOptions(Options options) { if (!options.has()) { options.set( monitoring_v3::MetricServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/monitoring/v3/internal/metric_stub.cc b/google/cloud/monitoring/v3/internal/metric_stub.cc index a8f39bda788dd..cafd927c8181c 100644 --- a/google/cloud/monitoring/v3/internal/metric_stub.cc +++ b/google/cloud/monitoring/v3/internal/metric_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/monitoring/v3/internal/metric_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/metric_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -168,3 +171,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/metric_stub.h b/google/cloud/monitoring/v3/internal/metric_stub.h index 5ac060bd3abd9..b8e37bb4c615a 100644 --- a/google/cloud/monitoring/v3/internal/metric_stub.h +++ b/google/cloud/monitoring/v3/internal/metric_stub.h @@ -24,10 +24,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/metric_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -155,4 +158,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_METRIC_STUB_H diff --git a/google/cloud/monitoring/v3/internal/metric_stub_factory.cc b/google/cloud/monitoring/v3/internal/metric_stub_factory.cc index 487d308ac4d7f..f952e4f480844 100644 --- a/google/cloud/monitoring/v3/internal/metric_stub_factory.cc +++ b/google/cloud/monitoring/v3/internal/metric_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/monitoring/v3/metric_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/metric_stub_factory.h b/google/cloud/monitoring/v3/internal/metric_stub_factory.h index 49cafe2bec81f..5ef0ccb07f2c2 100644 --- a/google/cloud/monitoring/v3/internal/metric_stub_factory.h +++ b/google/cloud/monitoring/v3/internal/metric_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_METRIC_STUB_FACTORY_H diff --git a/google/cloud/monitoring/v3/internal/metric_tracing_connection.cc b/google/cloud/monitoring/v3/internal/metric_tracing_connection.cc index 569f793d45661..2448a9601b7c8 100644 --- a/google/cloud/monitoring/v3/internal/metric_tracing_connection.cc +++ b/google/cloud/monitoring/v3/internal/metric_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MetricServiceTracingConnection::MetricServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -129,16 +127,12 @@ future MetricServiceTracingConnection::AsyncCreateTimeSeries( child_->AsyncCreateTimeSeries(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMetricServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/monitoring/v3/internal/metric_tracing_connection.h b/google/cloud/monitoring/v3/internal/metric_tracing_connection.h index 39e75cee00d14..b75cd3f07c033 100644 --- a/google/cloud/monitoring/v3/internal/metric_tracing_connection.h +++ b/google/cloud/monitoring/v3/internal/metric_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MetricServiceTracingConnection : public monitoring_v3::MetricServiceConnection { public: @@ -81,8 +79,6 @@ class MetricServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/monitoring/v3/internal/metric_tracing_stub.cc b/google/cloud/monitoring/v3/internal/metric_tracing_stub.cc index 8af526e1c8ae5..001a8d4f07d88 100644 --- a/google/cloud/monitoring/v3/internal/metric_tracing_stub.cc +++ b/google/cloud/monitoring/v3/internal/metric_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - MetricServiceTracingStub::MetricServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -158,18 +159,14 @@ future MetricServiceTracingStub::AsyncCreateTimeSeries( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeMetricServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/metric_tracing_stub.h b/google/cloud/monitoring/v3/internal/metric_tracing_stub.h index 991bdcdc2add4..926721b03364c 100644 --- a/google/cloud/monitoring/v3/internal/metric_tracing_stub.h +++ b/google/cloud/monitoring/v3/internal/metric_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class MetricServiceTracingStub : public MetricServiceStub { public: ~MetricServiceTracingStub() override = default; @@ -95,8 +96,6 @@ class MetricServiceTracingStub : public MetricServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -111,4 +110,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_METRIC_TRACING_STUB_H diff --git a/google/cloud/monitoring/v3/internal/notification_channel_auth_decorator.cc b/google/cloud/monitoring/v3/internal/notification_channel_auth_decorator.cc index 240ae37737a47..1f27de67fce99 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_auth_decorator.cc +++ b/google/cloud/monitoring/v3/internal/notification_channel_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/monitoring/v3/notification_service.proto #include "google/cloud/monitoring/v3/internal/notification_channel_auth_decorator.h" -#include +#include "google/monitoring/v3/notification_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -129,3 +132,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/notification_channel_auth_decorator.h b/google/cloud/monitoring/v3/internal/notification_channel_auth_decorator.h index 60bae86109ef1..b9b0b45ce3664 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_auth_decorator.h +++ b/google/cloud/monitoring/v3/internal/notification_channel_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -108,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_NOTIFICATION_CHANNEL_AUTH_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/notification_channel_logging_decorator.cc b/google/cloud/monitoring/v3/internal/notification_channel_logging_decorator.cc index f14cc0a10c3cc..84393471af16f 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_logging_decorator.cc +++ b/google/cloud/monitoring/v3/internal/notification_channel_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/monitoring/v3/internal/notification_channel_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/notification_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -178,3 +181,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/notification_channel_logging_decorator.h b/google/cloud/monitoring/v3/internal/notification_channel_logging_decorator.h index f6b0ce97ca165..370a821e11ce7 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_logging_decorator.h +++ b/google/cloud/monitoring/v3/internal/notification_channel_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_NOTIFICATION_CHANNEL_LOGGING_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/notification_channel_metadata_decorator.cc b/google/cloud/monitoring/v3/internal/notification_channel_metadata_decorator.cc index fc4dc0d49225c..59f524930cdda 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_metadata_decorator.cc +++ b/google/cloud/monitoring/v3/internal/notification_channel_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/monitoring/v3/internal/notification_channel_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/monitoring/v3/notification_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -158,3 +162,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/notification_channel_metadata_decorator.h b/google/cloud/monitoring/v3/internal/notification_channel_metadata_decorator.h index 46cc3649aca1d..4e23bff7c100d 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_metadata_decorator.h +++ b/google/cloud/monitoring/v3/internal/notification_channel_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -115,4 +118,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_NOTIFICATION_CHANNEL_METADATA_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/notification_channel_option_defaults.cc b/google/cloud/monitoring/v3/internal/notification_channel_option_defaults.cc index 7e9ed458404af..937cfaf523362 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_option_defaults.cc +++ b/google/cloud/monitoring/v3/internal/notification_channel_option_defaults.cc @@ -44,7 +44,7 @@ Options NotificationChannelServiceDefaultOptions(Options options) { .has()) { options.set( monitoring_v3::NotificationChannelServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/monitoring/v3/internal/notification_channel_stub.cc b/google/cloud/monitoring/v3/internal/notification_channel_stub.cc index 4ce21e7acb74e..cb81b3ce079b8 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_stub.cc +++ b/google/cloud/monitoring/v3/internal/notification_channel_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/monitoring/v3/internal/notification_channel_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/notification_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -168,3 +171,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/notification_channel_stub.h b/google/cloud/monitoring/v3/internal/notification_channel_stub.h index c836e0201878e..9cdfba7ed0bfb 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_stub.h +++ b/google/cloud/monitoring/v3/internal/notification_channel_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/notification_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -175,4 +178,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_NOTIFICATION_CHANNEL_STUB_H diff --git a/google/cloud/monitoring/v3/internal/notification_channel_stub_factory.cc b/google/cloud/monitoring/v3/internal/notification_channel_stub_factory.cc index 5195812c8e503..8f2ec62121903 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_stub_factory.cc +++ b/google/cloud/monitoring/v3/internal/notification_channel_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/monitoring/v3/notification_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/notification_channel_stub_factory.h b/google/cloud/monitoring/v3/internal/notification_channel_stub_factory.h index bf0da4dc4f7a9..c30f012bccd46 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_stub_factory.h +++ b/google/cloud/monitoring/v3/internal/notification_channel_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_NOTIFICATION_CHANNEL_STUB_FACTORY_H diff --git a/google/cloud/monitoring/v3/internal/notification_channel_tracing_connection.cc b/google/cloud/monitoring/v3/internal/notification_channel_tracing_connection.cc index 2e4fe58f9e73e..6dbeb93c29624 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_tracing_connection.cc +++ b/google/cloud/monitoring/v3/internal/notification_channel_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NotificationChannelServiceTracingConnection:: NotificationChannelServiceTracingConnection( std::shared_ptr @@ -147,17 +145,13 @@ NotificationChannelServiceTracingConnection::VerifyNotificationChannel( return internal::EndSpan(*span, child_->VerifyNotificationChannel(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNotificationChannelServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/monitoring/v3/internal/notification_channel_tracing_connection.h b/google/cloud/monitoring/v3/internal/notification_channel_tracing_connection.h index fc3ef89fa1762..dae69bb37d052 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_tracing_connection.h +++ b/google/cloud/monitoring/v3/internal/notification_channel_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NotificationChannelServiceTracingConnection : public monitoring_v3::NotificationChannelServiceConnection { public: @@ -94,8 +92,6 @@ class NotificationChannelServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/monitoring/v3/internal/notification_channel_tracing_stub.cc b/google/cloud/monitoring/v3/internal/notification_channel_tracing_stub.cc index da5ff9b9dbd91..a629acaff4af9 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_tracing_stub.cc +++ b/google/cloud/monitoring/v3/internal/notification_channel_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NotificationChannelServiceTracingStub::NotificationChannelServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -175,20 +176,16 @@ NotificationChannelServiceTracingStub::VerifyNotificationChannel( child_->VerifyNotificationChannel(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNotificationChannelServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/notification_channel_tracing_stub.h b/google/cloud/monitoring/v3/internal/notification_channel_tracing_stub.h index d5239c38bd0ef..c1b95f9353f2d 100644 --- a/google/cloud/monitoring/v3/internal/notification_channel_tracing_stub.h +++ b/google/cloud/monitoring/v3/internal/notification_channel_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NotificationChannelServiceTracingStub : public NotificationChannelServiceStub { public: @@ -106,8 +107,6 @@ class NotificationChannelServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -123,4 +122,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_NOTIFICATION_CHANNEL_TRACING_STUB_H diff --git a/google/cloud/monitoring/v3/internal/query_auth_decorator.cc b/google/cloud/monitoring/v3/internal/query_auth_decorator.cc index 3fae0d6977e10..6b9ebe2f2453a 100644 --- a/google/cloud/monitoring/v3/internal/query_auth_decorator.cc +++ b/google/cloud/monitoring/v3/internal/query_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/monitoring/v3/query_service.proto #include "google/cloud/monitoring/v3/internal/query_auth_decorator.h" -#include +#include "google/monitoring/v3/query_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -44,3 +47,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/query_auth_decorator.h b/google/cloud/monitoring/v3/internal/query_auth_decorator.h index f73e333d6abbc..a964cca8d4664 100644 --- a/google/cloud/monitoring/v3/internal/query_auth_decorator.h +++ b/google/cloud/monitoring/v3/internal/query_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -52,4 +55,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_QUERY_AUTH_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/query_logging_decorator.cc b/google/cloud/monitoring/v3/internal/query_logging_decorator.cc index c0c5559b88449..e04f00cf25671 100644 --- a/google/cloud/monitoring/v3/internal/query_logging_decorator.cc +++ b/google/cloud/monitoring/v3/internal/query_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/monitoring/v3/internal/query_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/query_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -51,3 +54,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/query_logging_decorator.h b/google/cloud/monitoring/v3/internal/query_logging_decorator.h index a4a983888206b..acbfc109d5b89 100644 --- a/google/cloud/monitoring/v3/internal/query_logging_decorator.h +++ b/google/cloud/monitoring/v3/internal/query_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -52,4 +55,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_QUERY_LOGGING_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/query_metadata_decorator.cc b/google/cloud/monitoring/v3/internal/query_metadata_decorator.cc index a138ab5cca3bf..a44a4bfb048c1 100644 --- a/google/cloud/monitoring/v3/internal/query_metadata_decorator.cc +++ b/google/cloud/monitoring/v3/internal/query_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/monitoring/v3/internal/query_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/monitoring/v3/query_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -70,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/query_metadata_decorator.h b/google/cloud/monitoring/v3/internal/query_metadata_decorator.h index e13bdf0740b0b..3131a42dc3a7a 100644 --- a/google/cloud/monitoring/v3/internal/query_metadata_decorator.h +++ b/google/cloud/monitoring/v3/internal/query_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -57,4 +60,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_QUERY_METADATA_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/query_option_defaults.cc b/google/cloud/monitoring/v3/internal/query_option_defaults.cc index dd348300455e6..07a6573a10f02 100644 --- a/google/cloud/monitoring/v3/internal/query_option_defaults.cc +++ b/google/cloud/monitoring/v3/internal/query_option_defaults.cc @@ -41,7 +41,7 @@ Options QueryServiceDefaultOptions(Options options) { if (!options.has()) { options.set( monitoring_v3::QueryServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/monitoring/v3/internal/query_stub.cc b/google/cloud/monitoring/v3/internal/query_stub.cc index 5b79953b71a52..bd781f7a0addc 100644 --- a/google/cloud/monitoring/v3/internal/query_stub.cc +++ b/google/cloud/monitoring/v3/internal/query_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/monitoring/v3/internal/query_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/query_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -46,3 +49,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/query_stub.h b/google/cloud/monitoring/v3/internal/query_stub.h index 916cd270e34e4..4ef1a5f7c053e 100644 --- a/google/cloud/monitoring/v3/internal/query_stub.h +++ b/google/cloud/monitoring/v3/internal/query_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/query_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -62,4 +65,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_QUERY_STUB_H diff --git a/google/cloud/monitoring/v3/internal/query_stub_factory.cc b/google/cloud/monitoring/v3/internal/query_stub_factory.cc index b0cdfa5504a31..f0daf06c97655 100644 --- a/google/cloud/monitoring/v3/internal/query_stub_factory.cc +++ b/google/cloud/monitoring/v3/internal/query_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/monitoring/v3/query_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/query_stub_factory.h b/google/cloud/monitoring/v3/internal/query_stub_factory.h index 4de088f84c581..013e309e9e293 100644 --- a/google/cloud/monitoring/v3/internal/query_stub_factory.h +++ b/google/cloud/monitoring/v3/internal/query_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_QUERY_STUB_FACTORY_H diff --git a/google/cloud/monitoring/v3/internal/query_tracing_connection.cc b/google/cloud/monitoring/v3/internal/query_tracing_connection.cc index be4fc8e890d8a..44f2491d01649 100644 --- a/google/cloud/monitoring/v3/internal/query_tracing_connection.cc +++ b/google/cloud/monitoring/v3/internal/query_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - QueryServiceTracingConnection::QueryServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -44,16 +42,12 @@ QueryServiceTracingConnection::QueryTimeSeries( google::monitoring::v3::TimeSeriesData>(std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeQueryServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/monitoring/v3/internal/query_tracing_connection.h b/google/cloud/monitoring/v3/internal/query_tracing_connection.h index c3a4899de8b23..5cb28c1745dd2 100644 --- a/google/cloud/monitoring/v3/internal/query_tracing_connection.h +++ b/google/cloud/monitoring/v3/internal/query_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class QueryServiceTracingConnection : public monitoring_v3::QueryServiceConnection { public: @@ -47,8 +45,6 @@ class QueryServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/monitoring/v3/internal/query_tracing_stub.cc b/google/cloud/monitoring/v3/internal/query_tracing_stub.cc index bf636a9037d77..ee69ec671b90f 100644 --- a/google/cloud/monitoring/v3/internal/query_tracing_stub.cc +++ b/google/cloud/monitoring/v3/internal/query_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - QueryServiceTracingStub::QueryServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -44,18 +45,14 @@ QueryServiceTracingStub::QueryTimeSeries( child_->QueryTimeSeries(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeQueryServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/query_tracing_stub.h b/google/cloud/monitoring/v3/internal/query_tracing_stub.h index c977cc28e3a97..92192d90291d9 100644 --- a/google/cloud/monitoring/v3/internal/query_tracing_stub.h +++ b/google/cloud/monitoring/v3/internal/query_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class QueryServiceTracingStub : public QueryServiceStub { public: ~QueryServiceTracingStub() override = default; @@ -48,8 +49,6 @@ class QueryServiceTracingStub : public QueryServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -64,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_QUERY_TRACING_STUB_H diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_auth_decorator.cc b/google/cloud/monitoring/v3/internal/service_monitoring_auth_decorator.cc index e36b004f1d502..0917c5d3c879f 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_auth_decorator.cc +++ b/google/cloud/monitoring/v3/internal/service_monitoring_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/monitoring/v3/service_service.proto #include "google/cloud/monitoring/v3/internal/service_monitoring_auth_decorator.h" -#include +#include "google/monitoring/v3/service_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -123,3 +126,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_auth_decorator.h b/google/cloud/monitoring/v3/internal/service_monitoring_auth_decorator.h index afbe5a347f838..83967a29fe00c 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_auth_decorator.h +++ b/google/cloud/monitoring/v3/internal/service_monitoring_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_SERVICE_MONITORING_AUTH_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_logging_decorator.cc b/google/cloud/monitoring/v3/internal/service_monitoring_logging_decorator.cc index adbb84e9fa711..7b4d9da2e2d40 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_logging_decorator.cc +++ b/google/cloud/monitoring/v3/internal/service_monitoring_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/monitoring/v3/internal/service_monitoring_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/service_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -162,3 +165,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_logging_decorator.h b/google/cloud/monitoring/v3/internal/service_monitoring_logging_decorator.h index 6347d27d52eb5..13843a07569bd 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_logging_decorator.h +++ b/google/cloud/monitoring/v3/internal/service_monitoring_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_SERVICE_MONITORING_LOGGING_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_metadata_decorator.cc b/google/cloud/monitoring/v3/internal/service_monitoring_metadata_decorator.cc index 8407c7d126921..55dc63e42e4b2 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_metadata_decorator.cc +++ b/google/cloud/monitoring/v3/internal/service_monitoring_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/monitoring/v3/internal/service_monitoring_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/monitoring/v3/service_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -152,3 +156,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_metadata_decorator.h b/google/cloud/monitoring/v3/internal/service_monitoring_metadata_decorator.h index 169294d40fb95..397fa7cfb04b4 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_metadata_decorator.h +++ b/google/cloud/monitoring/v3/internal/service_monitoring_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_SERVICE_MONITORING_METADATA_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_option_defaults.cc b/google/cloud/monitoring/v3/internal/service_monitoring_option_defaults.cc index 560229cc414bb..6d08b3a4ed7be 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_option_defaults.cc +++ b/google/cloud/monitoring/v3/internal/service_monitoring_option_defaults.cc @@ -44,7 +44,7 @@ Options ServiceMonitoringServiceDefaultOptions(Options options) { .has()) { options.set( monitoring_v3::ServiceMonitoringServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_stub.cc b/google/cloud/monitoring/v3/internal/service_monitoring_stub.cc index b9b0c2bbcce89..288263e591a34 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_stub.cc +++ b/google/cloud/monitoring/v3/internal/service_monitoring_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/monitoring/v3/internal/service_monitoring_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/service_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -157,3 +160,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_stub.h b/google/cloud/monitoring/v3/internal/service_monitoring_stub.h index bdbc31c43c9bb..df87cdeb3b5ed 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_stub.h +++ b/google/cloud/monitoring/v3/internal/service_monitoring_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/service_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -154,4 +157,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_SERVICE_MONITORING_STUB_H diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_stub_factory.cc b/google/cloud/monitoring/v3/internal/service_monitoring_stub_factory.cc index 42e8903cd7dd6..36cc340493df8 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_stub_factory.cc +++ b/google/cloud/monitoring/v3/internal/service_monitoring_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/monitoring/v3/service_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_stub_factory.h b/google/cloud/monitoring/v3/internal/service_monitoring_stub_factory.h index 284fef6ece51a..5484ec0b9d666 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_stub_factory.h +++ b/google/cloud/monitoring/v3/internal/service_monitoring_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_SERVICE_MONITORING_STUB_FACTORY_H diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_tracing_connection.cc b/google/cloud/monitoring/v3/internal/service_monitoring_tracing_connection.cc index 1fdfc82e9fcdd..8d535d4857cb1 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_tracing_connection.cc +++ b/google/cloud/monitoring/v3/internal/service_monitoring_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServiceMonitoringServiceTracingConnection:: ServiceMonitoringServiceTracingConnection( std::shared_ptr @@ -133,17 +131,13 @@ Status ServiceMonitoringServiceTracingConnection::DeleteServiceLevelObjective( return internal::EndSpan(*span, child_->DeleteServiceLevelObjective(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServiceMonitoringServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_tracing_connection.h b/google/cloud/monitoring/v3/internal/service_monitoring_tracing_connection.h index 2c63e67d40208..be6eb380d6467 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_tracing_connection.h +++ b/google/cloud/monitoring/v3/internal/service_monitoring_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServiceMonitoringServiceTracingConnection : public monitoring_v3::ServiceMonitoringServiceConnection { public: @@ -83,8 +81,6 @@ class ServiceMonitoringServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_tracing_stub.cc b/google/cloud/monitoring/v3/internal/service_monitoring_tracing_stub.cc index 9d83816be0f7f..9dcfeb1855ab7 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_tracing_stub.cc +++ b/google/cloud/monitoring/v3/internal/service_monitoring_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServiceMonitoringServiceTracingStub::ServiceMonitoringServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -160,19 +161,15 @@ Status ServiceMonitoringServiceTracingStub::DeleteServiceLevelObjective( child_->DeleteServiceLevelObjective(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServiceMonitoringServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/service_monitoring_tracing_stub.h b/google/cloud/monitoring/v3/internal/service_monitoring_tracing_stub.h index a62708a7008db..f7ba8bd3cbb6c 100644 --- a/google/cloud/monitoring/v3/internal/service_monitoring_tracing_stub.h +++ b/google/cloud/monitoring/v3/internal/service_monitoring_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServiceMonitoringServiceTracingStub : public ServiceMonitoringServiceStub { public: @@ -95,8 +96,6 @@ class ServiceMonitoringServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -112,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_SERVICE_MONITORING_TRACING_STUB_H diff --git a/google/cloud/monitoring/v3/internal/snooze_auth_decorator.cc b/google/cloud/monitoring/v3/internal/snooze_auth_decorator.cc index be84ea6351224..392691167d67f 100644 --- a/google/cloud/monitoring/v3/internal/snooze_auth_decorator.cc +++ b/google/cloud/monitoring/v3/internal/snooze_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/monitoring/v3/snooze_service.proto #include "google/cloud/monitoring/v3/internal/snooze_auth_decorator.h" -#include +#include "google/monitoring/v3/snooze_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/snooze_auth_decorator.h b/google/cloud/monitoring/v3/internal/snooze_auth_decorator.h index 7e74a456cc9ca..25329d722f943 100644 --- a/google/cloud/monitoring/v3/internal/snooze_auth_decorator.h +++ b/google/cloud/monitoring/v3/internal/snooze_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -64,4 +67,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_SNOOZE_AUTH_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/snooze_logging_decorator.cc b/google/cloud/monitoring/v3/internal/snooze_logging_decorator.cc index e30fa434cce58..003b7661f409b 100644 --- a/google/cloud/monitoring/v3/internal/snooze_logging_decorator.cc +++ b/google/cloud/monitoring/v3/internal/snooze_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/monitoring/v3/internal/snooze_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/snooze_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -84,3 +87,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/snooze_logging_decorator.h b/google/cloud/monitoring/v3/internal/snooze_logging_decorator.h index 78feb01fcdafe..9c94c4eb56619 100644 --- a/google/cloud/monitoring/v3/internal/snooze_logging_decorator.h +++ b/google/cloud/monitoring/v3/internal/snooze_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -64,4 +67,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_SNOOZE_LOGGING_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/snooze_metadata_decorator.cc b/google/cloud/monitoring/v3/internal/snooze_metadata_decorator.cc index 6d26652d33ad2..62731529dd55c 100644 --- a/google/cloud/monitoring/v3/internal/snooze_metadata_decorator.cc +++ b/google/cloud/monitoring/v3/internal/snooze_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/monitoring/v3/internal/snooze_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/monitoring/v3/snooze_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -95,3 +99,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/snooze_metadata_decorator.h b/google/cloud/monitoring/v3/internal/snooze_metadata_decorator.h index f856388df442a..432835ef67f3d 100644 --- a/google/cloud/monitoring/v3/internal/snooze_metadata_decorator.h +++ b/google/cloud/monitoring/v3/internal/snooze_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -69,4 +72,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_SNOOZE_METADATA_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/snooze_option_defaults.cc b/google/cloud/monitoring/v3/internal/snooze_option_defaults.cc index 98ef2a3a8c4f0..70cf558d7f8fd 100644 --- a/google/cloud/monitoring/v3/internal/snooze_option_defaults.cc +++ b/google/cloud/monitoring/v3/internal/snooze_option_defaults.cc @@ -41,7 +41,7 @@ Options SnoozeServiceDefaultOptions(Options options) { if (!options.has()) { options.set( monitoring_v3::SnoozeServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/monitoring/v3/internal/snooze_stub.cc b/google/cloud/monitoring/v3/internal/snooze_stub.cc index 847f622acefbb..f25fe99107447 100644 --- a/google/cloud/monitoring/v3/internal/snooze_stub.cc +++ b/google/cloud/monitoring/v3/internal/snooze_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/monitoring/v3/internal/snooze_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/snooze_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/snooze_stub.h b/google/cloud/monitoring/v3/internal/snooze_stub.h index b2ff6727c9b31..7d1150a6afd8d 100644 --- a/google/cloud/monitoring/v3/internal/snooze_stub.h +++ b/google/cloud/monitoring/v3/internal/snooze_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/snooze_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -85,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_SNOOZE_STUB_H diff --git a/google/cloud/monitoring/v3/internal/snooze_stub_factory.cc b/google/cloud/monitoring/v3/internal/snooze_stub_factory.cc index a9c76d5a24adc..bccd9954abfa2 100644 --- a/google/cloud/monitoring/v3/internal/snooze_stub_factory.cc +++ b/google/cloud/monitoring/v3/internal/snooze_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/monitoring/v3/snooze_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/snooze_stub_factory.h b/google/cloud/monitoring/v3/internal/snooze_stub_factory.h index e5431fb762b5d..7861990359580 100644 --- a/google/cloud/monitoring/v3/internal/snooze_stub_factory.h +++ b/google/cloud/monitoring/v3/internal/snooze_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_SNOOZE_STUB_FACTORY_H diff --git a/google/cloud/monitoring/v3/internal/snooze_tracing_connection.cc b/google/cloud/monitoring/v3/internal/snooze_tracing_connection.cc index d34f9f1e25606..0ce1af7ca0235 100644 --- a/google/cloud/monitoring/v3/internal/snooze_tracing_connection.cc +++ b/google/cloud/monitoring/v3/internal/snooze_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SnoozeServiceTracingConnection::SnoozeServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -71,16 +69,12 @@ SnoozeServiceTracingConnection::UpdateSnooze( return internal::EndSpan(*span, child_->UpdateSnooze(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSnoozeServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/monitoring/v3/internal/snooze_tracing_connection.h b/google/cloud/monitoring/v3/internal/snooze_tracing_connection.h index f63a4a3e50f57..2cdbef406d59a 100644 --- a/google/cloud/monitoring/v3/internal/snooze_tracing_connection.h +++ b/google/cloud/monitoring/v3/internal/snooze_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SnoozeServiceTracingConnection : public monitoring_v3::SnoozeServiceConnection { public: @@ -56,8 +54,6 @@ class SnoozeServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/monitoring/v3/internal/snooze_tracing_stub.cc b/google/cloud/monitoring/v3/internal/snooze_tracing_stub.cc index 0b8b6b32a9018..995b1f60caecc 100644 --- a/google/cloud/monitoring/v3/internal/snooze_tracing_stub.cc +++ b/google/cloud/monitoring/v3/internal/snooze_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SnoozeServiceTracingStub::SnoozeServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -77,18 +78,14 @@ StatusOr SnoozeServiceTracingStub::UpdateSnooze( child_->UpdateSnooze(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSnoozeServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/snooze_tracing_stub.h b/google/cloud/monitoring/v3/internal/snooze_tracing_stub.h index 275e8dd37b947..c33440c57decc 100644 --- a/google/cloud/monitoring/v3/internal/snooze_tracing_stub.h +++ b/google/cloud/monitoring/v3/internal/snooze_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SnoozeServiceTracingStub : public SnoozeServiceStub { public: ~SnoozeServiceTracingStub() override = default; @@ -60,8 +61,6 @@ class SnoozeServiceTracingStub : public SnoozeServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -76,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_SNOOZE_TRACING_STUB_H diff --git a/google/cloud/monitoring/v3/internal/uptime_check_auth_decorator.cc b/google/cloud/monitoring/v3/internal/uptime_check_auth_decorator.cc index 5dd45d7963274..b81055396c12c 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_auth_decorator.cc +++ b/google/cloud/monitoring/v3/internal/uptime_check_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/monitoring/v3/uptime_service.proto #include "google/cloud/monitoring/v3/internal/uptime_check_auth_decorator.h" -#include +#include "google/monitoring/v3/uptime_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -88,3 +91,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/uptime_check_auth_decorator.h b/google/cloud/monitoring/v3/internal/uptime_check_auth_decorator.h index d01021345b958..a2f58015f13ec 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_auth_decorator.h +++ b/google/cloud/monitoring/v3/internal/uptime_check_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -79,4 +82,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_UPTIME_CHECK_AUTH_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/uptime_check_logging_decorator.cc b/google/cloud/monitoring/v3/internal/uptime_check_logging_decorator.cc index 0babcdb818fba..39b72d82e8b22 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_logging_decorator.cc +++ b/google/cloud/monitoring/v3/internal/uptime_check_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/monitoring/v3/internal/uptime_check_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/uptime_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -115,3 +118,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/uptime_check_logging_decorator.h b/google/cloud/monitoring/v3/internal/uptime_check_logging_decorator.h index a08ffbeb694ae..5df3fd7b71bce 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_logging_decorator.h +++ b/google/cloud/monitoring/v3/internal/uptime_check_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -79,4 +82,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_UPTIME_CHECK_LOGGING_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/uptime_check_metadata_decorator.cc b/google/cloud/monitoring/v3/internal/uptime_check_metadata_decorator.cc index aa0aaad8b901b..a902bc7a6ef33 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_metadata_decorator.cc +++ b/google/cloud/monitoring/v3/internal/uptime_check_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/monitoring/v3/internal/uptime_check_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/monitoring/v3/uptime_service.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -115,3 +119,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/uptime_check_metadata_decorator.h b/google/cloud/monitoring/v3/internal/uptime_check_metadata_decorator.h index 9a0330305f3a2..edb227ec9ffba 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_metadata_decorator.h +++ b/google/cloud/monitoring/v3/internal/uptime_check_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -85,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_UPTIME_CHECK_METADATA_DECORATOR_H diff --git a/google/cloud/monitoring/v3/internal/uptime_check_option_defaults.cc b/google/cloud/monitoring/v3/internal/uptime_check_option_defaults.cc index f683011b6d3e2..88f68e1276f77 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_option_defaults.cc +++ b/google/cloud/monitoring/v3/internal/uptime_check_option_defaults.cc @@ -42,7 +42,7 @@ Options UptimeCheckServiceDefaultOptions(Options options) { if (!options.has()) { options.set( monitoring_v3::UptimeCheckServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/monitoring/v3/internal/uptime_check_stub.cc b/google/cloud/monitoring/v3/internal/uptime_check_stub.cc index 9ebdbcf599298..e428ce1bdd446 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_stub.cc +++ b/google/cloud/monitoring/v3/internal/uptime_check_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/monitoring/v3/internal/uptime_check_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/monitoring/v3/uptime_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -109,3 +112,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/uptime_check_stub.h b/google/cloud/monitoring/v3/internal/uptime_check_stub.h index 75c43250fdbcb..6a05760016482 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_stub.h +++ b/google/cloud/monitoring/v3/internal/uptime_check_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/uptime_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -116,4 +119,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_UPTIME_CHECK_STUB_H diff --git a/google/cloud/monitoring/v3/internal/uptime_check_stub_factory.cc b/google/cloud/monitoring/v3/internal/uptime_check_stub_factory.cc index 87366269ebfcd..6b4c873a21d9b 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_stub_factory.cc +++ b/google/cloud/monitoring/v3/internal/uptime_check_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/monitoring/v3/uptime_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/uptime_check_stub_factory.h b/google/cloud/monitoring/v3/internal/uptime_check_stub_factory.h index 8a81dbc4dc366..80031297f130b 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_stub_factory.h +++ b/google/cloud/monitoring/v3/internal/uptime_check_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_UPTIME_CHECK_STUB_FACTORY_H diff --git a/google/cloud/monitoring/v3/internal/uptime_check_tracing_connection.cc b/google/cloud/monitoring/v3/internal/uptime_check_tracing_connection.cc index 9135e3336ce88..e061a378cf3e6 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_tracing_connection.cc +++ b/google/cloud/monitoring/v3/internal/uptime_check_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - UptimeCheckServiceTracingConnection::UptimeCheckServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -91,17 +89,13 @@ UptimeCheckServiceTracingConnection::ListUptimeCheckIps( std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeUptimeCheckServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/monitoring/v3/internal/uptime_check_tracing_connection.h b/google/cloud/monitoring/v3/internal/uptime_check_tracing_connection.h index f462e47dbf0c5..47165f2211243 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_tracing_connection.h +++ b/google/cloud/monitoring/v3/internal/uptime_check_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class UptimeCheckServiceTracingConnection : public monitoring_v3::UptimeCheckServiceConnection { public: @@ -66,8 +64,6 @@ class UptimeCheckServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/monitoring/v3/internal/uptime_check_tracing_stub.cc b/google/cloud/monitoring/v3/internal/uptime_check_tracing_stub.cc index bd0fc8358cb9f..22bcbf518318c 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_tracing_stub.cc +++ b/google/cloud/monitoring/v3/internal/uptime_check_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - UptimeCheckServiceTracingStub::UptimeCheckServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -107,18 +108,14 @@ UptimeCheckServiceTracingStub::ListUptimeCheckIps( context, *span, child_->ListUptimeCheckIps(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeUptimeCheckServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace monitoring_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/monitoring/v3/internal/uptime_check_tracing_stub.h b/google/cloud/monitoring/v3/internal/uptime_check_tracing_stub.h index e5fbec21be3d6..d813aaecbe563 100644 --- a/google/cloud/monitoring/v3/internal/uptime_check_tracing_stub.h +++ b/google/cloud/monitoring/v3/internal/uptime_check_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace monitoring_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class UptimeCheckServiceTracingStub : public UptimeCheckServiceStub { public: ~UptimeCheckServiceTracingStub() override = default; @@ -76,8 +77,6 @@ class UptimeCheckServiceTracingStub : public UptimeCheckServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -92,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_MONITORING_V3_INTERNAL_UPTIME_CHECK_TRACING_STUB_H diff --git a/google/cloud/monitoring/v3/metric_connection.h b/google/cloud/monitoring/v3/metric_connection.h index 8842e0a37abf7..2bec797bf2745 100644 --- a/google/cloud/monitoring/v3/metric_connection.h +++ b/google/cloud/monitoring/v3/metric_connection.h @@ -28,7 +28,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/metric_service.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/metric_connection_idempotency_policy.h b/google/cloud/monitoring/v3/metric_connection_idempotency_policy.h index e1d6d5d6dfb84..80176db57ab87 100644 --- a/google/cloud/monitoring/v3/metric_connection_idempotency_policy.h +++ b/google/cloud/monitoring/v3/metric_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/metric_service.grpc.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/notification_channel_connection.h b/google/cloud/monitoring/v3/notification_channel_connection.h index 121d40016f60c..b9bda3f8e3a0d 100644 --- a/google/cloud/monitoring/v3/notification_channel_connection.h +++ b/google/cloud/monitoring/v3/notification_channel_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/notification_service.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/notification_channel_connection_idempotency_policy.h b/google/cloud/monitoring/v3/notification_channel_connection_idempotency_policy.h index b3d0c2fa6b92e..4dd1c90db1115 100644 --- a/google/cloud/monitoring/v3/notification_channel_connection_idempotency_policy.h +++ b/google/cloud/monitoring/v3/notification_channel_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/notification_service.grpc.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/query_connection.h b/google/cloud/monitoring/v3/query_connection.h index 104d50b77b132..8eed2998d8023 100644 --- a/google/cloud/monitoring/v3/query_connection.h +++ b/google/cloud/monitoring/v3/query_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/query_service.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/query_connection_idempotency_policy.h b/google/cloud/monitoring/v3/query_connection_idempotency_policy.h index 0d480646cd5a5..03384dd2ef14c 100644 --- a/google/cloud/monitoring/v3/query_connection_idempotency_policy.h +++ b/google/cloud/monitoring/v3/query_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/query_service.grpc.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/service_monitoring_connection.h b/google/cloud/monitoring/v3/service_monitoring_connection.h index e35d14c50e859..a77ae5b34aa22 100644 --- a/google/cloud/monitoring/v3/service_monitoring_connection.h +++ b/google/cloud/monitoring/v3/service_monitoring_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/service_service.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/service_monitoring_connection_idempotency_policy.h b/google/cloud/monitoring/v3/service_monitoring_connection_idempotency_policy.h index cfbf41a37e2ed..9c8a3b4b74853 100644 --- a/google/cloud/monitoring/v3/service_monitoring_connection_idempotency_policy.h +++ b/google/cloud/monitoring/v3/service_monitoring_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/service_service.grpc.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/snooze_connection.h b/google/cloud/monitoring/v3/snooze_connection.h index 3d785cd7afc4d..75c1b39eccfbe 100644 --- a/google/cloud/monitoring/v3/snooze_connection.h +++ b/google/cloud/monitoring/v3/snooze_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/snooze_service.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/snooze_connection_idempotency_policy.h b/google/cloud/monitoring/v3/snooze_connection_idempotency_policy.h index 0acdf7829c643..114e19f5dc41d 100644 --- a/google/cloud/monitoring/v3/snooze_connection_idempotency_policy.h +++ b/google/cloud/monitoring/v3/snooze_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/snooze_service.grpc.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/uptime_check_connection.h b/google/cloud/monitoring/v3/uptime_check_connection.h index e423daa52ab6c..1f9e5adca3617 100644 --- a/google/cloud/monitoring/v3/uptime_check_connection.h +++ b/google/cloud/monitoring/v3/uptime_check_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/uptime_service.pb.h" #include namespace google { diff --git a/google/cloud/monitoring/v3/uptime_check_connection_idempotency_policy.h b/google/cloud/monitoring/v3/uptime_check_connection_idempotency_policy.h index 6ab43a7d000d0..d3ab7df224981 100644 --- a/google/cloud/monitoring/v3/uptime_check_connection_idempotency_policy.h +++ b/google/cloud/monitoring/v3/uptime_check_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/monitoring/v3/uptime_service.grpc.pb.h" #include namespace google { diff --git a/google/cloud/netapp/BUILD.bazel b/google/cloud/netapp/BUILD.bazel index a56322706ac90..43f51cf274ec1 100644 --- a/google/cloud/netapp/BUILD.bazel +++ b/google/cloud/netapp/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/netapp/v1:netapp_cc_grpc", + "@googleapis//google/cloud/netapp/v1:netapp_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/netapp/quickstart/.bazelrc b/google/cloud/netapp/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/netapp/quickstart/.bazelrc +++ b/google/cloud/netapp/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/netapp/quickstart/CMakeLists.txt index 1dab8e37d7622..46fbd6cb13c4d 100644 --- a/google/cloud/netapp/quickstart/CMakeLists.txt +++ b/google/cloud/netapp/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the NetApp API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-netapp-quickstart CXX) find_package(google_cloud_cpp_netapp REQUIRED) diff --git a/google/cloud/netapp/quickstart/WORKSPACE.bazel b/google/cloud/netapp/quickstart/WORKSPACE.bazel index 0bed8b2f548bc..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 = "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/netapp/v1/internal/net_app_auth_decorator.cc b/google/cloud/netapp/v1/internal/net_app_auth_decorator.cc index 4b59be50845a7..e9220d25847fc 100644 --- a/google/cloud/netapp/v1/internal/net_app_auth_decorator.cc +++ b/google/cloud/netapp/v1/internal/net_app_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/netapp/v1/cloud_netapp_service.proto #include "google/cloud/netapp/v1/internal/net_app_auth_decorator.h" -#include +#include "google/cloud/netapp/v1/cloud_netapp_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace netapp_v1_internal { @@ -313,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, @@ -1428,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, @@ -1517,3 +1584,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace netapp_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" 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 09872b5bf035e..1acc0c58472b7 100644 --- a/google/cloud/netapp/v1/internal/net_app_auth_decorator.h +++ b/google/cloud/netapp/v1/internal/net_app_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/netapp/v1/internal/net_app_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 netapp_v1_internal { @@ -157,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; @@ -636,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; @@ -682,4 +717,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETAPP_V1_INTERNAL_NET_APP_AUTH_DECORATOR_H 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 10f3d9d619f3c..230266c557a78 100644 --- a/google/cloud/netapp/v1/internal/net_app_connection_impl.h +++ b/google/cloud/netapp/v1/internal/net_app_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 0f7128980b513..cfca2d2dd7f98 100644 --- a/google/cloud/netapp/v1/internal/net_app_logging_decorator.cc +++ b/google/cloud/netapp/v1/internal/net_app_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/netapp/v1/cloud_netapp_service.proto #include "google/cloud/netapp/v1/internal/net_app_logging_decorator.h" +#include "google/cloud/netapp/v1/cloud_netapp_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace netapp_v1_internal { @@ -354,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, @@ -1603,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, @@ -1710,3 +1795,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace netapp_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" 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 e1be042868735..cab1e6415e106 100644 --- a/google/cloud/netapp/v1/internal/net_app_logging_decorator.h +++ b/google/cloud/netapp/v1/internal/net_app_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/netapp/v1/internal/net_app_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 netapp_v1_internal { @@ -157,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; @@ -636,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; @@ -682,4 +717,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETAPP_V1_INTERNAL_NET_APP_LOGGING_DECORATOR_H 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 75bb686750a38..96ae9e0c90e8f 100644 --- a/google/cloud/netapp/v1/internal/net_app_metadata_decorator.cc +++ b/google/cloud/netapp/v1/internal/net_app_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/netapp/v1/cloud_netapp_service.proto #include "google/cloud/netapp/v1/internal/net_app_metadata_decorator.h" +#include "google/cloud/netapp/v1/cloud_netapp_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 netapp_v1_internal { @@ -264,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, @@ -1133,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, @@ -1223,3 +1287,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace netapp_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" 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 8dca383ccd1f5..5c604c8763e8b 100644 --- a/google/cloud/netapp/v1/internal/net_app_metadata_decorator.h +++ b/google/cloud/netapp/v1/internal/net_app_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/netapp/v1/internal/net_app_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 netapp_v1_internal { @@ -157,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; @@ -636,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; @@ -687,4 +722,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETAPP_V1_INTERNAL_NET_APP_METADATA_DECORATOR_H diff --git a/google/cloud/netapp/v1/internal/net_app_option_defaults.cc b/google/cloud/netapp/v1/internal/net_app_option_defaults.cc index 83d72b8ad642d..d9428143ce890 100644 --- a/google/cloud/netapp/v1/internal/net_app_option_defaults.cc +++ b/google/cloud/netapp/v1/internal/net_app_option_defaults.cc @@ -40,7 +40,7 @@ Options NetAppDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - netapp_v1::NetAppLimitedTimeRetryPolicy(std::chrono::minutes(30)) + netapp_v1::NetAppLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/netapp/v1/internal/net_app_stub.cc b/google/cloud/netapp/v1/internal/net_app_stub.cc index 4293517635446..70d8ca278c7b8 100644 --- a/google/cloud/netapp/v1/internal/net_app_stub.cc +++ b/google/cloud/netapp/v1/internal/net_app_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/netapp/v1/cloud_netapp_service.proto #include "google/cloud/netapp/v1/internal/net_app_stub.h" +#include "google/cloud/netapp/v1/cloud_netapp_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace netapp_v1_internal { @@ -345,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&, @@ -1571,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&, @@ -1682,3 +1765,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace netapp_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/netapp/v1/internal/net_app_stub.h b/google/cloud/netapp/v1/internal/net_app_stub.h index a4243be3e8420..44adb315e76af 100644 --- a/google/cloud/netapp/v1/internal/net_app_stub.h +++ b/google/cloud/netapp/v1/internal/net_app_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETAPP_V1_INTERNAL_NET_APP_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETAPP_V1_INTERNAL_NET_APP_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/netapp/v1/cloud_netapp_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace netapp_v1_internal { @@ -155,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, @@ -606,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, @@ -775,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; @@ -1254,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; @@ -1303,4 +1371,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETAPP_V1_INTERNAL_NET_APP_STUB_H diff --git a/google/cloud/netapp/v1/internal/net_app_stub_factory.cc b/google/cloud/netapp/v1/internal/net_app_stub_factory.cc index 5286c3fb763b6..c2bad9dabe0ef 100644 --- a/google/cloud/netapp/v1/internal/net_app_stub_factory.cc +++ b/google/cloud/netapp/v1/internal/net_app_stub_factory.cc @@ -17,6 +17,8 @@ // source: google/cloud/netapp/v1/cloud_netapp_service.proto #include "google/cloud/netapp/v1/internal/net_app_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/netapp/v1/cloud_netapp_service.grpc.pb.h" #include "google/cloud/netapp/v1/internal/net_app_auth_decorator.h" #include "google/cloud/netapp/v1/internal/net_app_logging_decorator.h" #include "google/cloud/netapp/v1/internal/net_app_metadata_decorator.h" @@ -28,12 +30,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace netapp_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace netapp_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/netapp/v1/internal/net_app_stub_factory.h b/google/cloud/netapp/v1/internal/net_app_stub_factory.h index 58aa50ac79fe8..2e609c5658052 100644 --- a/google/cloud/netapp/v1/internal/net_app_stub_factory.h +++ b/google/cloud/netapp/v1/internal/net_app_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace netapp_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETAPP_V1_INTERNAL_NET_APP_STUB_FACTORY_H 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 5235463971cb7..f059db549ae4e 100644 --- a/google/cloud/netapp/v1/internal/net_app_tracing_connection.cc +++ b/google/cloud/netapp/v1/internal/net_app_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace netapp_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NetAppTracingConnection::NetAppTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -313,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) { @@ -1472,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) { @@ -1523,15 +1588,11 @@ Status NetAppTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNetAppTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } 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 83a3b66450419..4f7ae30e4b849 100644 --- a/google/cloud/netapp/v1/internal/net_app_tracing_connection.h +++ b/google/cloud/netapp/v1/internal/net_app_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace netapp_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NetAppTracingConnection : public netapp_v1::NetAppConnection { public: ~NetAppTracingConnection() override = default; @@ -155,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; @@ -617,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; @@ -639,8 +665,6 @@ class NetAppTracingConnection : public netapp_v1::NetAppConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * 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 d0ec17e559190..649bfaf2b9d5e 100644 --- a/google/cloud/netapp/v1/internal/net_app_tracing_stub.cc +++ b/google/cloud/netapp/v1/internal/net_app_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace netapp_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NetAppTracingStub::NetAppTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -312,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, @@ -1423,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, @@ -1519,18 +1596,14 @@ future NetAppTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNetAppTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace netapp_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" 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 3e093da1648e4..a670a9df3ea52 100644 --- a/google/cloud/netapp/v1/internal/net_app_tracing_stub.h +++ b/google/cloud/netapp/v1/internal/net_app_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace netapp_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NetAppTracingStub : public NetAppStub { public: ~NetAppTracingStub() override = default; @@ -156,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; @@ -635,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; @@ -677,8 +710,6 @@ class NetAppTracingStub : public NetAppStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -693,4 +724,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETAPP_V1_INTERNAL_NET_APP_TRACING_STUB_H 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 ec3be83157b28..e1e3f514c0652 100644 --- a/google/cloud/netapp/v1/net_app_client.h +++ b/google/cloud/netapp/v1/net_app_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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 6b8b94903daf3..ad1343f7b6844 100644 --- a/google/cloud/netapp/v1/net_app_connection.h +++ b/google/cloud/netapp/v1/net_app_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETAPP_V1_NET_APP_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETAPP_V1_NET_APP_CONNECTION_H +#include "google/cloud/netapp/v1/cloud_netapp_service.pb.h" #include "google/cloud/netapp/v1/internal/net_app_retry_traits.h" #include "google/cloud/netapp/v1/net_app_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 12d1d4fc584b5..8dd32b905e791 100644 --- a/google/cloud/netapp/v1/net_app_connection_idempotency_policy.h +++ b/google/cloud/netapp/v1/net_app_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETAPP_V1_NET_APP_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETAPP_V1_NET_APP_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/netapp/v1/cloud_netapp_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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/BUILD.bazel b/google/cloud/networkconnectivity/BUILD.bazel index b00c4d9762a5d..2c5e0932cf876 100644 --- a/google/cloud/networkconnectivity/BUILD.bazel +++ b/google/cloud/networkconnectivity/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/networkconnectivity/v1:networkconnectivity_cc_grpc", + "@googleapis//google/cloud/networkconnectivity/v1:networkconnectivity_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/networkconnectivity/CMakeLists.txt b/google/cloud/networkconnectivity/CMakeLists.txt index 27b71c2ca8640..025c214fc5804 100644 --- a/google/cloud/networkconnectivity/CMakeLists.txt +++ b/google/cloud/networkconnectivity/CMakeLists.txt @@ -17,8 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( - networkconnectivity "Network Connectivity API" SERVICE_DIRS "__EMPTY__" - "v1/") + networkconnectivity "Network Connectivity API" SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(networkconnectivity_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/networkconnectivity/hub_client.h b/google/cloud/networkconnectivity/hub_client.h deleted file mode 100644 index 93325fc71ddf2..0000000000000 --- a/google/cloud/networkconnectivity/hub_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/networkconnectivity/v1/hub.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_HUB_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_HUB_CLIENT_H - -#include "google/cloud/networkconnectivity/hub_connection.h" -#include "google/cloud/networkconnectivity/v1/hub_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in networkconnectivity_v1 instead of the aliases defined -/// in this namespace. -namespace networkconnectivity { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use networkconnectivity_v1::HubServiceClient directly. -using ::google::cloud::networkconnectivity_v1::HubServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace networkconnectivity -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_HUB_CLIENT_H diff --git a/google/cloud/networkconnectivity/hub_connection.h b/google/cloud/networkconnectivity/hub_connection.h deleted file mode 100644 index ae1b4a9c0d504..0000000000000 --- a/google/cloud/networkconnectivity/hub_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/networkconnectivity/v1/hub.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_HUB_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_HUB_CONNECTION_H - -#include "google/cloud/networkconnectivity/hub_connection_idempotency_policy.h" -#include "google/cloud/networkconnectivity/v1/hub_connection.h" - -namespace google { -namespace cloud { -namespace networkconnectivity { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use networkconnectivity_v1::MakeHubServiceConnection directly. -using ::google::cloud::networkconnectivity_v1::MakeHubServiceConnection; - -/// @deprecated Use networkconnectivity_v1::HubServiceConnection directly. -using ::google::cloud::networkconnectivity_v1::HubServiceConnection; - -/// @deprecated Use -/// networkconnectivity_v1::HubServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::networkconnectivity_v1:: - HubServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use networkconnectivity_v1::HubServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::networkconnectivity_v1::HubServiceLimitedTimeRetryPolicy; - -/// @deprecated Use networkconnectivity_v1::HubServiceRetryPolicy directly. -using ::google::cloud::networkconnectivity_v1::HubServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace networkconnectivity -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_HUB_CONNECTION_H diff --git a/google/cloud/networkconnectivity/hub_connection_idempotency_policy.h b/google/cloud/networkconnectivity/hub_connection_idempotency_policy.h deleted file mode 100644 index 6acb7f3f82dde..0000000000000 --- a/google/cloud/networkconnectivity/hub_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/networkconnectivity/v1/hub.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_HUB_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_HUB_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/networkconnectivity/v1/hub_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace networkconnectivity { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// networkconnectivity_v1::MakeDefaultHubServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::networkconnectivity_v1:: - MakeDefaultHubServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// networkconnectivity_v1::HubServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::networkconnectivity_v1:: - HubServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace networkconnectivity -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_HUB_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/networkconnectivity/hub_options.h b/google/cloud/networkconnectivity/hub_options.h deleted file mode 100644 index 28fc557125867..0000000000000 --- a/google/cloud/networkconnectivity/hub_options.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/networkconnectivity/v1/hub.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_HUB_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_HUB_OPTIONS_H - -#include "google/cloud/networkconnectivity/hub_connection.h" -#include "google/cloud/networkconnectivity/hub_connection_idempotency_policy.h" -#include "google/cloud/networkconnectivity/v1/hub_options.h" - -namespace google { -namespace cloud { -namespace networkconnectivity { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use networkconnectivity_v1::HubServicePollingPolicyOption -/// directly. -using ::google::cloud::networkconnectivity_v1::HubServicePollingPolicyOption; - -/// @deprecated Use networkconnectivity_v1::HubServiceBackoffPolicyOption -/// directly. -using ::google::cloud::networkconnectivity_v1::HubServiceBackoffPolicyOption; - -/// @deprecated Use -/// networkconnectivity_v1::HubServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::networkconnectivity_v1:: - HubServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use networkconnectivity_v1::HubServicePolicyOptionList directly. -using ::google::cloud::networkconnectivity_v1::HubServicePolicyOptionList; - -/// @deprecated Use networkconnectivity_v1::HubServiceRetryPolicyOption -/// directly. -using ::google::cloud::networkconnectivity_v1::HubServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace networkconnectivity -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_HUB_OPTIONS_H diff --git a/google/cloud/networkconnectivity/mocks/mock_hub_connection.h b/google/cloud/networkconnectivity/mocks/mock_hub_connection.h deleted file mode 100644 index c4375b4e8c9e4..0000000000000 --- a/google/cloud/networkconnectivity/mocks/mock_hub_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/networkconnectivity/v1/hub.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_MOCKS_MOCK_HUB_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_MOCKS_MOCK_HUB_CONNECTION_H - -#include "google/cloud/networkconnectivity/hub_connection.h" -#include "google/cloud/networkconnectivity/v1/mocks/mock_hub_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in networkconnectivity_v1_mocks instead of the aliases -/// defined in this namespace. -namespace networkconnectivity_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use networkconnectivity_v1_mocks::MockHubServiceConnection -/// directly. -using ::google::cloud::networkconnectivity_v1_mocks::MockHubServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace networkconnectivity_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_MOCKS_MOCK_HUB_CONNECTION_H diff --git a/google/cloud/networkconnectivity/quickstart/.bazelrc b/google/cloud/networkconnectivity/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/networkconnectivity/quickstart/.bazelrc +++ b/google/cloud/networkconnectivity/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/networkconnectivity/quickstart/CMakeLists.txt index 19f9e5e8d3dd5..ee06fee9fb9f8 100644 --- a/google/cloud/networkconnectivity/quickstart/CMakeLists.txt +++ b/google/cloud/networkconnectivity/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Network Connectivity API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-networkconnectivity-quickstart CXX) find_package(google_cloud_cpp_networkconnectivity REQUIRED) diff --git a/google/cloud/networkconnectivity/quickstart/WORKSPACE.bazel b/google/cloud/networkconnectivity/quickstart/WORKSPACE.bazel index 533056a104ad2..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 = "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/networkconnectivity/v1/data_transfer_client.h b/google/cloud/networkconnectivity/v1/data_transfer_client.h index 1270d886dd554..fa251bcf01833 100644 --- a/google/cloud/networkconnectivity/v1/data_transfer_client.h +++ b/google/cloud/networkconnectivity/v1/data_transfer_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/data_transfer_connection.h b/google/cloud/networkconnectivity/v1/data_transfer_connection.h index 4a234ea5cf626..b40dd527764b1 100644 --- a/google/cloud/networkconnectivity/v1/data_transfer_connection.h +++ b/google/cloud/networkconnectivity/v1/data_transfer_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_DATA_TRANSFER_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_DATA_TRANSFER_CONNECTION_H +#include "google/cloud/networkconnectivity/v1/data_transfer.pb.h" #include "google/cloud/networkconnectivity/v1/data_transfer_connection_idempotency_policy.h" #include "google/cloud/networkconnectivity/v1/internal/data_transfer_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkconnectivity/v1/data_transfer_connection_idempotency_policy.h b/google/cloud/networkconnectivity/v1/data_transfer_connection_idempotency_policy.h index 93ee8dc589edf..5c82cb33337da 100644 --- a/google/cloud/networkconnectivity/v1/data_transfer_connection_idempotency_policy.h +++ b/google/cloud/networkconnectivity/v1/data_transfer_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_DATA_TRANSFER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_DATA_TRANSFER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkconnectivity/v1/data_transfer.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkconnectivity/v1/hub_client.h b/google/cloud/networkconnectivity/v1/hub_client.h index c9eea6a58e232..e351c65f21b5b 100644 --- a/google/cloud/networkconnectivity/v1/hub_client.h +++ b/google/cloud/networkconnectivity/v1/hub_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/hub_connection.h b/google/cloud/networkconnectivity/v1/hub_connection.h index d7e41f2e09191..23727b9fd84a8 100644 --- a/google/cloud/networkconnectivity/v1/hub_connection.h +++ b/google/cloud/networkconnectivity/v1/hub_connection.h @@ -19,6 +19,8 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_HUB_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_HUB_CONNECTION_H +#include "google/cloud/networkconnectivity/v1/common.pb.h" +#include "google/cloud/networkconnectivity/v1/hub.pb.h" #include "google/cloud/networkconnectivity/v1/hub_connection_idempotency_policy.h" #include "google/cloud/networkconnectivity/v1/internal/hub_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,9 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkconnectivity/v1/hub_connection_idempotency_policy.h b/google/cloud/networkconnectivity/v1/hub_connection_idempotency_policy.h index 81ec5aecfdf65..fe8a2a8db2cb8 100644 --- a/google/cloud/networkconnectivity/v1/hub_connection_idempotency_policy.h +++ b/google/cloud/networkconnectivity/v1/hub_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_HUB_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_HUB_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkconnectivity/v1/hub.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_auth_decorator.cc b/google/cloud/networkconnectivity/v1/internal/data_transfer_auth_decorator.cc index abbb1281d3cca..42de8b43562b1 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_auth_decorator.cc +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/networkconnectivity/v1/data_transfer.proto #include "google/cloud/networkconnectivity/v1/internal/data_transfer_auth_decorator.h" -#include +#include "google/cloud/networkconnectivity/v1/data_transfer.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { @@ -398,3 +401,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_auth_decorator.h b/google/cloud/networkconnectivity/v1/internal/data_transfer_auth_decorator.h index db94b0bc72caf..274b598bcd1fd 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_auth_decorator.h +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkconnectivity/v1/internal/data_transfer_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 networkconnectivity_v1_internal { @@ -212,4 +215,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_DATA_TRANSFER_AUTH_DECORATOR_H diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_connection_impl.h b/google/cloud/networkconnectivity/v1/internal/data_transfer_connection_impl.h index 499c6afe3f2d0..663ae7a966023 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_connection_impl.h +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_logging_decorator.cc b/google/cloud/networkconnectivity/v1/internal/data_transfer_logging_decorator.cc index fbb408449389d..0e5a864b548a9 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_logging_decorator.cc +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/networkconnectivity/v1/data_transfer.proto #include "google/cloud/networkconnectivity/v1/internal/data_transfer_logging_decorator.h" +#include "google/cloud/networkconnectivity/v1/data_transfer.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { @@ -480,3 +483,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_logging_decorator.h b/google/cloud/networkconnectivity/v1/internal/data_transfer_logging_decorator.h index bfe46c7599054..e95566fbbfd97 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_logging_decorator.h +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkconnectivity/v1/internal/data_transfer_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 networkconnectivity_v1_internal { @@ -212,4 +215,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_DATA_TRANSFER_LOGGING_DECORATOR_H diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_metadata_decorator.cc b/google/cloud/networkconnectivity/v1/internal/data_transfer_metadata_decorator.cc index f57ac01552b29..d4b48d06f7cf3 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_metadata_decorator.cc +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/networkconnectivity/v1/data_transfer.proto #include "google/cloud/networkconnectivity/v1/internal/data_transfer_metadata_decorator.h" +#include "google/cloud/networkconnectivity/v1/data_transfer.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 networkconnectivity_v1_internal { @@ -375,3 +379,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_metadata_decorator.h b/google/cloud/networkconnectivity/v1/internal/data_transfer_metadata_decorator.h index 5e3636806de9c..ed21d6d0314e8 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_metadata_decorator.h +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkconnectivity/v1/internal/data_transfer_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 networkconnectivity_v1_internal { @@ -218,4 +221,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_DATA_TRANSFER_METADATA_DECORATOR_H diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_option_defaults.cc b/google/cloud/networkconnectivity/v1/internal/data_transfer_option_defaults.cc index a4190d1d66ac5..aec5247c007c0 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_option_defaults.cc +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_option_defaults.cc @@ -43,7 +43,7 @@ Options DataTransferServiceDefaultOptions(Options options) { networkconnectivity_v1::DataTransferServiceRetryPolicyOption>()) { options.set( networkconnectivity_v1::DataTransferServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_stub.cc b/google/cloud/networkconnectivity/v1/internal/data_transfer_stub.cc index 77a924cfe5816..9c7321af61d96 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_stub.cc +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/networkconnectivity/v1/data_transfer.proto #include "google/cloud/networkconnectivity/v1/internal/data_transfer_stub.h" +#include "google/cloud/networkconnectivity/v1/data_transfer.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { @@ -474,3 +477,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_stub.h b/google/cloud/networkconnectivity/v1/internal/data_transfer_stub.h index 9a6e348631bfe..c5e0a1b0d41bc 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_stub.h +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_DATA_TRANSFER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_DATA_TRANSFER_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkconnectivity/v1/data_transfer.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 -#include -#include -#include +#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 networkconnectivity_v1_internal { @@ -409,4 +412,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_DATA_TRANSFER_STUB_H diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_stub_factory.cc b/google/cloud/networkconnectivity/v1/internal/data_transfer_stub_factory.cc index df0662acb3553..7f56355e25215 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_stub_factory.cc +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_stub_factory.cc @@ -17,6 +17,8 @@ // source: google/cloud/networkconnectivity/v1/data_transfer.proto #include "google/cloud/networkconnectivity/v1/internal/data_transfer_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkconnectivity/v1/data_transfer.grpc.pb.h" #include "google/cloud/networkconnectivity/v1/internal/data_transfer_auth_decorator.h" #include "google/cloud/networkconnectivity/v1/internal/data_transfer_logging_decorator.h" #include "google/cloud/networkconnectivity/v1/internal/data_transfer_metadata_decorator.h" @@ -28,13 +30,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include -#include +#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 networkconnectivity_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_stub_factory.h b/google/cloud/networkconnectivity/v1/internal/data_transfer_stub_factory.h index 2eb0f809f6df2..5ec25e1b7c0cf 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_stub_factory.h +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_DATA_TRANSFER_STUB_FACTORY_H diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_connection.cc b/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_connection.cc index e69910edf2185..2822dc939614b 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_connection.cc +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace networkconnectivity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataTransferServiceTracingConnection::DataTransferServiceTracingConnection( std::shared_ptr child) @@ -413,18 +411,14 @@ Status DataTransferServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataTransferServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_connection.h b/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_connection.h index 3a5e358607309..635693f9ec620 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_connection.h +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace networkconnectivity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataTransferServiceTracingConnection : public networkconnectivity_v1::DataTransferServiceConnection { public: @@ -190,8 +188,6 @@ class DataTransferServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_stub.cc b/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_stub.cc index 8b0ca8c8972cf..81c7169ce2ad4 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_stub.cc +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DataTransferServiceTracingStub::DataTransferServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -452,18 +453,14 @@ future DataTransferServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDataTransferServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_stub.h b/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_stub.h index 09e5803a4f951..ec43848b6e157 100644 --- a/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_stub.h +++ b/google/cloud/networkconnectivity/v1/internal/data_transfer_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DataTransferServiceTracingStub : public DataTransferServiceStub { public: ~DataTransferServiceTracingStub() override = default; @@ -208,8 +209,6 @@ class DataTransferServiceTracingStub : public DataTransferServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -224,4 +223,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_DATA_TRANSFER_TRACING_STUB_H diff --git a/google/cloud/networkconnectivity/v1/internal/hub_auth_decorator.cc b/google/cloud/networkconnectivity/v1/internal/hub_auth_decorator.cc index 2c35b8a5c8261..62a72d093ec0f 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_auth_decorator.cc +++ b/google/cloud/networkconnectivity/v1/internal/hub_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/networkconnectivity/v1/hub.proto #include "google/cloud/networkconnectivity/v1/internal/hub_auth_decorator.h" -#include +#include "google/cloud/networkconnectivity/v1/hub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { @@ -570,3 +573,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/hub_auth_decorator.h b/google/cloud/networkconnectivity/v1/internal/hub_auth_decorator.h index c376f1e4a78cd..0019c8883a6b0 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_auth_decorator.h +++ b/google/cloud/networkconnectivity/v1/internal/hub_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkconnectivity/v1/internal/hub_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 networkconnectivity_v1_internal { @@ -292,4 +295,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_HUB_AUTH_DECORATOR_H diff --git a/google/cloud/networkconnectivity/v1/internal/hub_connection_impl.h b/google/cloud/networkconnectivity/v1/internal/hub_connection_impl.h index 77dc5995d29a6..29ac095fb28f2 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_connection_impl.h +++ b/google/cloud/networkconnectivity/v1/internal/hub_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkconnectivity/v1/internal/hub_logging_decorator.cc b/google/cloud/networkconnectivity/v1/internal/hub_logging_decorator.cc index 1e9c9b5553bfb..69790fcdb8f82 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_logging_decorator.cc +++ b/google/cloud/networkconnectivity/v1/internal/hub_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/networkconnectivity/v1/hub.proto #include "google/cloud/networkconnectivity/v1/internal/hub_logging_decorator.h" +#include "google/cloud/networkconnectivity/v1/hub.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { @@ -688,3 +691,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/hub_logging_decorator.h b/google/cloud/networkconnectivity/v1/internal/hub_logging_decorator.h index 9c431a6c8c757..643ca0377a626 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_logging_decorator.h +++ b/google/cloud/networkconnectivity/v1/internal/hub_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkconnectivity/v1/internal/hub_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 networkconnectivity_v1_internal { @@ -292,4 +295,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_HUB_LOGGING_DECORATOR_H diff --git a/google/cloud/networkconnectivity/v1/internal/hub_metadata_decorator.cc b/google/cloud/networkconnectivity/v1/internal/hub_metadata_decorator.cc index 323a2c521c188..98ce12c966ba8 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_metadata_decorator.cc +++ b/google/cloud/networkconnectivity/v1/internal/hub_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/networkconnectivity/v1/hub.proto #include "google/cloud/networkconnectivity/v1/internal/hub_metadata_decorator.h" +#include "google/cloud/networkconnectivity/v1/hub.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 networkconnectivity_v1_internal { @@ -508,3 +512,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/hub_metadata_decorator.h b/google/cloud/networkconnectivity/v1/internal/hub_metadata_decorator.h index 590f48688d782..d84fbedd76a04 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_metadata_decorator.h +++ b/google/cloud/networkconnectivity/v1/internal/hub_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkconnectivity/v1/internal/hub_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 networkconnectivity_v1_internal { @@ -297,4 +300,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_HUB_METADATA_DECORATOR_H diff --git a/google/cloud/networkconnectivity/v1/internal/hub_option_defaults.cc b/google/cloud/networkconnectivity/v1/internal/hub_option_defaults.cc index 6e3e3de295804..acb28b7b2ced4 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_option_defaults.cc +++ b/google/cloud/networkconnectivity/v1/internal/hub_option_defaults.cc @@ -42,7 +42,7 @@ Options HubServiceDefaultOptions(Options options) { if (!options.has()) { options.set( networkconnectivity_v1::HubServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/networkconnectivity/v1/internal/hub_stub.cc b/google/cloud/networkconnectivity/v1/internal/hub_stub.cc index 1378d7322c437..b5190f383a706 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_stub.cc +++ b/google/cloud/networkconnectivity/v1/internal/hub_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/networkconnectivity/v1/hub.proto #include "google/cloud/networkconnectivity/v1/internal/hub_stub.h" +#include "google/cloud/networkconnectivity/v1/hub.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { @@ -667,3 +670,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/hub_stub.h b/google/cloud/networkconnectivity/v1/internal/hub_stub.h index 7872c0997f77a..f939f5d102800 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_stub.h +++ b/google/cloud/networkconnectivity/v1/internal/hub_stub.h @@ -19,19 +19,22 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_HUB_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_HUB_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkconnectivity/v1/common.pb.h" +#include "google/cloud/networkconnectivity/v1/hub.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 -#include -#include -#include -#include +#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 networkconnectivity_v1_internal { @@ -567,4 +570,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_HUB_STUB_H diff --git a/google/cloud/networkconnectivity/v1/internal/hub_stub_factory.cc b/google/cloud/networkconnectivity/v1/internal/hub_stub_factory.cc index f7c3f9c3e51de..fd74d2bff8ab2 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_stub_factory.cc +++ b/google/cloud/networkconnectivity/v1/internal/hub_stub_factory.cc @@ -17,6 +17,8 @@ // source: google/cloud/networkconnectivity/v1/hub.proto #include "google/cloud/networkconnectivity/v1/internal/hub_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkconnectivity/v1/hub.grpc.pb.h" #include "google/cloud/networkconnectivity/v1/internal/hub_auth_decorator.h" #include "google/cloud/networkconnectivity/v1/internal/hub_logging_decorator.h" #include "google/cloud/networkconnectivity/v1/internal/hub_metadata_decorator.h" @@ -28,13 +30,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include -#include +#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 networkconnectivity_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/hub_stub_factory.h b/google/cloud/networkconnectivity/v1/internal/hub_stub_factory.h index 0a0fd3c68a395..3a1d24fba1c74 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_stub_factory.h +++ b/google/cloud/networkconnectivity/v1/internal/hub_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_HUB_STUB_FACTORY_H diff --git a/google/cloud/networkconnectivity/v1/internal/hub_tracing_connection.cc b/google/cloud/networkconnectivity/v1/internal/hub_tracing_connection.cc index 3f922be22eabd..4f695d4f9dae5 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_tracing_connection.cc +++ b/google/cloud/networkconnectivity/v1/internal/hub_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace networkconnectivity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - HubServiceTracingConnection::HubServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -567,16 +565,12 @@ Status HubServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeHubServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/networkconnectivity/v1/internal/hub_tracing_connection.h b/google/cloud/networkconnectivity/v1/internal/hub_tracing_connection.h index 55d2bdd477e24..16bbd9ee289b6 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_tracing_connection.h +++ b/google/cloud/networkconnectivity/v1/internal/hub_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace networkconnectivity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class HubServiceTracingConnection : public networkconnectivity_v1::HubServiceConnection { public: @@ -262,8 +260,6 @@ class HubServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/networkconnectivity/v1/internal/hub_tracing_stub.cc b/google/cloud/networkconnectivity/v1/internal/hub_tracing_stub.cc index ecdb5518996f3..fea85c869f310 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_tracing_stub.cc +++ b/google/cloud/networkconnectivity/v1/internal/hub_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - HubServiceTracingStub::HubServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -599,18 +600,14 @@ future HubServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeHubServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/hub_tracing_stub.h b/google/cloud/networkconnectivity/v1/internal/hub_tracing_stub.h index 4397ecf410b94..f04f25daa63eb 100644 --- a/google/cloud/networkconnectivity/v1/internal/hub_tracing_stub.h +++ b/google/cloud/networkconnectivity/v1/internal/hub_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class HubServiceTracingStub : public HubServiceStub { public: ~HubServiceTracingStub() override = default; @@ -287,8 +288,6 @@ class HubServiceTracingStub : public HubServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -303,4 +302,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_HUB_TRACING_STUB_H diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_auth_decorator.cc b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_auth_decorator.cc index bb76fd4b15b24..7a25b3ce23569 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_auth_decorator.cc +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/networkconnectivity/v1/policy_based_routing.proto #include "google/cloud/networkconnectivity/v1/internal/policy_based_routing_auth_decorator.h" -#include +#include "google/cloud/networkconnectivity/v1/policy_based_routing.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { @@ -230,3 +233,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_auth_decorator.h b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_auth_decorator.h index 2af808c611b29..9d6cda136a95f 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_auth_decorator.h +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 networkconnectivity_v1_internal { @@ -134,4 +137,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_POLICY_BASED_ROUTING_AUTH_DECORATOR_H diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_connection_impl.h b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_connection_impl.h index c1d69e610659f..cd04ca7928724 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_connection_impl.h +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_logging_decorator.cc b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_logging_decorator.cc index e6625c18565ec..6ca9551c8964c 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_logging_decorator.cc +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/networkconnectivity/v1/policy_based_routing.proto #include "google/cloud/networkconnectivity/v1/internal/policy_based_routing_logging_decorator.h" +#include "google/cloud/networkconnectivity/v1/policy_based_routing.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { @@ -276,3 +279,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_logging_decorator.h b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_logging_decorator.h index b313a50cb88f4..2aee08bc9b08c 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_logging_decorator.h +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 networkconnectivity_v1_internal { @@ -134,4 +137,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_POLICY_BASED_ROUTING_LOGGING_DECORATOR_H diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_metadata_decorator.cc b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_metadata_decorator.cc index 0d02f27b12003..65737193cd49a 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_metadata_decorator.cc +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/networkconnectivity/v1/policy_based_routing.proto #include "google/cloud/networkconnectivity/v1/internal/policy_based_routing_metadata_decorator.h" +#include "google/cloud/networkconnectivity/v1/policy_based_routing.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 networkconnectivity_v1_internal { @@ -232,3 +236,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_metadata_decorator.h b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_metadata_decorator.h index 593fcda6f43ab..1a5bd3e8d6cdf 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_metadata_decorator.h +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 networkconnectivity_v1_internal { @@ -140,4 +143,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_POLICY_BASED_ROUTING_METADATA_DECORATOR_H diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_option_defaults.cc b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_option_defaults.cc index 04cad48840f33..50c12a32509b2 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_option_defaults.cc +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_option_defaults.cc @@ -45,7 +45,7 @@ Options PolicyBasedRoutingServiceDefaultOptions(Options options) { options.set< networkconnectivity_v1::PolicyBasedRoutingServiceRetryPolicyOption>( networkconnectivity_v1::PolicyBasedRoutingServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { @@ -276,3 +279,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub.h b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub.h index 9fbe2bc1cf724..07ab3d27e6a01 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub.h +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_POLICY_BASED_ROUTING_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_POLICY_BASED_ROUTING_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkconnectivity/v1/policy_based_routing.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 -#include -#include -#include +#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 networkconnectivity_v1_internal { @@ -247,4 +250,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_POLICY_BASED_ROUTING_STUB_H diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub_factory.cc b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub_factory.cc index 122fea418d456..48f8917ceaaeb 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub_factory.cc +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/networkconnectivity/v1/policy_based_routing.proto #include "google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/networkconnectivity/v1/internal/policy_based_routing_auth_decorator.h" #include "google/cloud/networkconnectivity/v1/internal/policy_based_routing_logging_decorator.h" #include "google/cloud/networkconnectivity/v1/internal/policy_based_routing_metadata_decorator.h" #include "google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub.h" #include "google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_stub.h" +#include "google/cloud/networkconnectivity/v1/policy_based_routing.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 -#include -#include -#include +#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 networkconnectivity_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub_factory.h b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub_factory.h index 53656b081c77d..a6ab6a4f6678a 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub_factory.h +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_POLICY_BASED_ROUTING_STUB_FACTORY_H diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_connection.cc b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_connection.cc index ed95b8e45951c..48ef5a5d05c06 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_connection.cc +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace networkconnectivity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PolicyBasedRoutingServiceTracingConnection:: PolicyBasedRoutingServiceTracingConnection( std::shared_ptr< @@ -225,18 +223,14 @@ Status PolicyBasedRoutingServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePolicyBasedRoutingServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_connection.h b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_connection.h index 224fd7fdb3637..2dae46a381f3c 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_connection.h +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace networkconnectivity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PolicyBasedRoutingServiceTracingConnection : public networkconnectivity_v1::PolicyBasedRoutingServiceConnection { public: @@ -110,8 +108,6 @@ class PolicyBasedRoutingServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_stub.cc b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_stub.cc index b3c9d1de51693..ba654aed859b7 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_stub.cc +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PolicyBasedRoutingServiceTracingStub::PolicyBasedRoutingServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -267,20 +268,16 @@ future PolicyBasedRoutingServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePolicyBasedRoutingServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkconnectivity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_stub.h b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_stub.h index 19830dda88364..8b72f6e818247 100644 --- a/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_stub.h +++ b/google/cloud/networkconnectivity/v1/internal/policy_based_routing_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkconnectivity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PolicyBasedRoutingServiceTracingStub : public PolicyBasedRoutingServiceStub { public: @@ -131,8 +132,6 @@ class PolicyBasedRoutingServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -148,4 +147,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_INTERNAL_POLICY_BASED_ROUTING_TRACING_STUB_H diff --git a/google/cloud/networkconnectivity/v1/policy_based_routing_client.h b/google/cloud/networkconnectivity/v1/policy_based_routing_client.h index a8a38330b317b..eadf2da02cc35 100644 --- a/google/cloud/networkconnectivity/v1/policy_based_routing_client.h +++ b/google/cloud/networkconnectivity/v1/policy_based_routing_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/networkconnectivity/v1/policy_based_routing_connection.h b/google/cloud/networkconnectivity/v1/policy_based_routing_connection.h index 4761b8e3dabf2..b707159e70b42 100644 --- a/google/cloud/networkconnectivity/v1/policy_based_routing_connection.h +++ b/google/cloud/networkconnectivity/v1/policy_based_routing_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_POLICY_BASED_ROUTING_CONNECTION_H #include "google/cloud/networkconnectivity/v1/internal/policy_based_routing_retry_traits.h" +#include "google/cloud/networkconnectivity/v1/policy_based_routing.pb.h" #include "google/cloud/networkconnectivity/v1/policy_based_routing_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkconnectivity/v1/policy_based_routing_connection_idempotency_policy.h b/google/cloud/networkconnectivity/v1/policy_based_routing_connection_idempotency_policy.h index 84c2e96a78e5f..56b490b83ff6d 100644 --- a/google/cloud/networkconnectivity/v1/policy_based_routing_connection_idempotency_policy.h +++ b/google/cloud/networkconnectivity/v1/policy_based_routing_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_POLICY_BASED_ROUTING_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKCONNECTIVITY_V1_POLICY_BASED_ROUTING_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkconnectivity/v1/policy_based_routing.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkmanagement/BUILD.bazel b/google/cloud/networkmanagement/BUILD.bazel index 7b8790a4bc567..0a9996080fe66 100644 --- a/google/cloud/networkmanagement/BUILD.bazel +++ b/google/cloud/networkmanagement/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/networkmanagement/v1:networkmanagement_cc_grpc", + "@googleapis//google/cloud/networkmanagement/v1:networkmanagement_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/networkmanagement/CMakeLists.txt b/google/cloud/networkmanagement/CMakeLists.txt index 16d513b0fc47b..90b9c8a1e2d81 100644 --- a/google/cloud/networkmanagement/CMakeLists.txt +++ b/google/cloud/networkmanagement/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(networkmanagement "Network Management API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(networkmanagement_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/networkmanagement/mocks/mock_reachability_connection.h b/google/cloud/networkmanagement/mocks/mock_reachability_connection.h deleted file mode 100644 index b277c8b3d6d11..0000000000000 --- a/google/cloud/networkmanagement/mocks/mock_reachability_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/networkmanagement/v1/reachability.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_MOCKS_MOCK_REACHABILITY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_MOCKS_MOCK_REACHABILITY_CONNECTION_H - -#include "google/cloud/networkmanagement/reachability_connection.h" -#include "google/cloud/networkmanagement/v1/mocks/mock_reachability_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in networkmanagement_v1_mocks instead of the aliases -/// defined in this namespace. -namespace networkmanagement_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// networkmanagement_v1_mocks::MockReachabilityServiceConnection directly. -using ::google::cloud::networkmanagement_v1_mocks:: - MockReachabilityServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace networkmanagement_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_MOCKS_MOCK_REACHABILITY_CONNECTION_H diff --git a/google/cloud/networkmanagement/quickstart/.bazelrc b/google/cloud/networkmanagement/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/networkmanagement/quickstart/.bazelrc +++ b/google/cloud/networkmanagement/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/networkmanagement/quickstart/CMakeLists.txt index 854e7b6dc0a44..517cad6e1efd6 100644 --- a/google/cloud/networkmanagement/quickstart/CMakeLists.txt +++ b/google/cloud/networkmanagement/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Network Management API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-networkmanagement-quickstart CXX) find_package(google_cloud_cpp_networkmanagement REQUIRED) diff --git a/google/cloud/networkmanagement/quickstart/WORKSPACE.bazel b/google/cloud/networkmanagement/quickstart/WORKSPACE.bazel index c10b724896b77..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 = "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/networkmanagement/reachability_client.h b/google/cloud/networkmanagement/reachability_client.h deleted file mode 100644 index d0056562fe6a2..0000000000000 --- a/google/cloud/networkmanagement/reachability_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/networkmanagement/v1/reachability.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_REACHABILITY_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_REACHABILITY_CLIENT_H - -#include "google/cloud/networkmanagement/reachability_connection.h" -#include "google/cloud/networkmanagement/v1/reachability_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in networkmanagement_v1 instead of the aliases defined in -/// this namespace. -namespace networkmanagement { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use networkmanagement_v1::ReachabilityServiceClient directly. -using ::google::cloud::networkmanagement_v1::ReachabilityServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace networkmanagement -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_REACHABILITY_CLIENT_H diff --git a/google/cloud/networkmanagement/reachability_connection.h b/google/cloud/networkmanagement/reachability_connection.h deleted file mode 100644 index d38f49ab346c4..0000000000000 --- a/google/cloud/networkmanagement/reachability_connection.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/networkmanagement/v1/reachability.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_REACHABILITY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_REACHABILITY_CONNECTION_H - -#include "google/cloud/networkmanagement/reachability_connection_idempotency_policy.h" -#include "google/cloud/networkmanagement/v1/reachability_connection.h" - -namespace google { -namespace cloud { -namespace networkmanagement { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use networkmanagement_v1::MakeReachabilityServiceConnection -/// directly. -using ::google::cloud::networkmanagement_v1::MakeReachabilityServiceConnection; - -/// @deprecated Use networkmanagement_v1::ReachabilityServiceConnection -/// directly. -using ::google::cloud::networkmanagement_v1::ReachabilityServiceConnection; - -/// @deprecated Use -/// networkmanagement_v1::ReachabilityServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::networkmanagement_v1:: - ReachabilityServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// networkmanagement_v1::ReachabilityServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::networkmanagement_v1:: - ReachabilityServiceLimitedTimeRetryPolicy; - -/// @deprecated Use networkmanagement_v1::ReachabilityServiceRetryPolicy -/// directly. -using ::google::cloud::networkmanagement_v1::ReachabilityServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace networkmanagement -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_REACHABILITY_CONNECTION_H diff --git a/google/cloud/networkmanagement/reachability_connection_idempotency_policy.h b/google/cloud/networkmanagement/reachability_connection_idempotency_policy.h deleted file mode 100644 index da62b6810e34e..0000000000000 --- a/google/cloud/networkmanagement/reachability_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/networkmanagement/v1/reachability.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_REACHABILITY_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_REACHABILITY_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/networkmanagement/v1/reachability_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace networkmanagement { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// networkmanagement_v1::MakeDefaultReachabilityServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::networkmanagement_v1:: - MakeDefaultReachabilityServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// networkmanagement_v1::ReachabilityServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::networkmanagement_v1:: - ReachabilityServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace networkmanagement -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_REACHABILITY_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/networkmanagement/reachability_options.h b/google/cloud/networkmanagement/reachability_options.h deleted file mode 100644 index d772fb1bdfb6b..0000000000000 --- a/google/cloud/networkmanagement/reachability_options.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/networkmanagement/v1/reachability.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_REACHABILITY_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_REACHABILITY_OPTIONS_H - -#include "google/cloud/networkmanagement/reachability_connection.h" -#include "google/cloud/networkmanagement/reachability_connection_idempotency_policy.h" -#include "google/cloud/networkmanagement/v1/reachability_options.h" - -namespace google { -namespace cloud { -namespace networkmanagement { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use networkmanagement_v1::ReachabilityServicePollingPolicyOption -/// directly. -using ::google::cloud::networkmanagement_v1:: - ReachabilityServicePollingPolicyOption; - -/// @deprecated Use networkmanagement_v1::ReachabilityServiceBackoffPolicyOption -/// directly. -using ::google::cloud::networkmanagement_v1:: - ReachabilityServiceBackoffPolicyOption; - -/// @deprecated Use -/// networkmanagement_v1::ReachabilityServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::networkmanagement_v1:: - ReachabilityServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use networkmanagement_v1::ReachabilityServicePolicyOptionList -/// directly. -using ::google::cloud::networkmanagement_v1:: - ReachabilityServicePolicyOptionList; - -/// @deprecated Use networkmanagement_v1::ReachabilityServiceRetryPolicyOption -/// directly. -using ::google::cloud::networkmanagement_v1:: - ReachabilityServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace networkmanagement -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_REACHABILITY_OPTIONS_H diff --git a/google/cloud/networkmanagement/v1/internal/reachability_auth_decorator.cc b/google/cloud/networkmanagement/v1/internal/reachability_auth_decorator.cc index 435592b760fd4..6ba94ccb6dec8 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_auth_decorator.cc +++ b/google/cloud/networkmanagement/v1/internal/reachability_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/networkmanagement/v1/reachability.proto #include "google/cloud/networkmanagement/v1/internal/reachability_auth_decorator.h" -#include +#include "google/cloud/networkmanagement/v1/reachability.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkmanagement_v1_internal { @@ -291,3 +294,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkmanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkmanagement/v1/internal/reachability_auth_decorator.h b/google/cloud/networkmanagement/v1/internal/reachability_auth_decorator.h index 1a41e6a8ef605..0026d1fb44516 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_auth_decorator.h +++ b/google/cloud/networkmanagement/v1/internal/reachability_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkmanagement/v1/internal/reachability_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 networkmanagement_v1_internal { @@ -157,4 +160,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_V1_INTERNAL_REACHABILITY_AUTH_DECORATOR_H diff --git a/google/cloud/networkmanagement/v1/internal/reachability_connection_impl.h b/google/cloud/networkmanagement/v1/internal/reachability_connection_impl.h index a2082e24c26a9..321d077b01755 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_connection_impl.h +++ b/google/cloud/networkmanagement/v1/internal/reachability_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkmanagement/v1/internal/reachability_logging_decorator.cc b/google/cloud/networkmanagement/v1/internal/reachability_logging_decorator.cc index 544009fdfefa6..77e62ae2b66da 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_logging_decorator.cc +++ b/google/cloud/networkmanagement/v1/internal/reachability_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/networkmanagement/v1/reachability.proto #include "google/cloud/networkmanagement/v1/internal/reachability_logging_decorator.h" +#include "google/cloud/networkmanagement/v1/reachability.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkmanagement_v1_internal { @@ -342,3 +345,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkmanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkmanagement/v1/internal/reachability_logging_decorator.h b/google/cloud/networkmanagement/v1/internal/reachability_logging_decorator.h index 97239bd386be4..3e5d9fb3e9d38 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_logging_decorator.h +++ b/google/cloud/networkmanagement/v1/internal/reachability_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkmanagement/v1/internal/reachability_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 networkmanagement_v1_internal { @@ -157,4 +160,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_V1_INTERNAL_REACHABILITY_LOGGING_DECORATOR_H diff --git a/google/cloud/networkmanagement/v1/internal/reachability_metadata_decorator.cc b/google/cloud/networkmanagement/v1/internal/reachability_metadata_decorator.cc index 595951f7ded16..81021c02d7473 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_metadata_decorator.cc +++ b/google/cloud/networkmanagement/v1/internal/reachability_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/networkmanagement/v1/reachability.proto #include "google/cloud/networkmanagement/v1/internal/reachability_metadata_decorator.h" +#include "google/cloud/networkmanagement/v1/reachability.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 networkmanagement_v1_internal { @@ -278,3 +282,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkmanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkmanagement/v1/internal/reachability_metadata_decorator.h b/google/cloud/networkmanagement/v1/internal/reachability_metadata_decorator.h index b4217c8d8c416..164ba62ea98af 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_metadata_decorator.h +++ b/google/cloud/networkmanagement/v1/internal/reachability_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkmanagement/v1/internal/reachability_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 networkmanagement_v1_internal { @@ -163,4 +166,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_V1_INTERNAL_REACHABILITY_METADATA_DECORATOR_H diff --git a/google/cloud/networkmanagement/v1/internal/reachability_option_defaults.cc b/google/cloud/networkmanagement/v1/internal/reachability_option_defaults.cc index 6faf559cc24b4..ef0974d557a91 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_option_defaults.cc +++ b/google/cloud/networkmanagement/v1/internal/reachability_option_defaults.cc @@ -43,7 +43,7 @@ Options ReachabilityServiceDefaultOptions(Options options) { .has()) { options.set( networkmanagement_v1::ReachabilityServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/networkmanagement/v1/internal/reachability_stub.cc b/google/cloud/networkmanagement/v1/internal/reachability_stub.cc index 6bfbeda436194..63112cb34a8ec 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_stub.cc +++ b/google/cloud/networkmanagement/v1/internal/reachability_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/networkmanagement/v1/reachability.proto #include "google/cloud/networkmanagement/v1/internal/reachability_stub.h" +#include "google/cloud/networkmanagement/v1/reachability.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkmanagement_v1_internal { @@ -340,3 +343,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkmanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkmanagement/v1/internal/reachability_stub.h b/google/cloud/networkmanagement/v1/internal/reachability_stub.h index 5f29667c5290e..47147c3e8418f 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_stub.h +++ b/google/cloud/networkmanagement/v1/internal/reachability_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_V1_INTERNAL_REACHABILITY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_V1_INTERNAL_REACHABILITY_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkmanagement/v1/reachability.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 -#include -#include -#include +#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 networkmanagement_v1_internal { @@ -296,4 +299,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_V1_INTERNAL_REACHABILITY_STUB_H diff --git a/google/cloud/networkmanagement/v1/internal/reachability_stub_factory.cc b/google/cloud/networkmanagement/v1/internal/reachability_stub_factory.cc index 554f5998fb9b7..ee3b9f6133f0f 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_stub_factory.cc +++ b/google/cloud/networkmanagement/v1/internal/reachability_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/networkmanagement/v1/reachability.proto #include "google/cloud/networkmanagement/v1/internal/reachability_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/networkmanagement/v1/internal/reachability_auth_decorator.h" #include "google/cloud/networkmanagement/v1/internal/reachability_logging_decorator.h" #include "google/cloud/networkmanagement/v1/internal/reachability_metadata_decorator.h" #include "google/cloud/networkmanagement/v1/internal/reachability_stub.h" #include "google/cloud/networkmanagement/v1/internal/reachability_tracing_stub.h" +#include "google/cloud/networkmanagement/v1/reachability.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 -#include -#include -#include +#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 networkmanagement_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkmanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkmanagement/v1/internal/reachability_stub_factory.h b/google/cloud/networkmanagement/v1/internal/reachability_stub_factory.h index addf67e95d43d..b60c5ab1cdf6c 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_stub_factory.h +++ b/google/cloud/networkmanagement/v1/internal/reachability_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkmanagement_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_V1_INTERNAL_REACHABILITY_STUB_FACTORY_H diff --git a/google/cloud/networkmanagement/v1/internal/reachability_tracing_connection.cc b/google/cloud/networkmanagement/v1/internal/reachability_tracing_connection.cc index 45cb400869c6e..10f4cbe86eae3 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_tracing_connection.cc +++ b/google/cloud/networkmanagement/v1/internal/reachability_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace networkmanagement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ReachabilityServiceTracingConnection::ReachabilityServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -286,17 +284,13 @@ Status ReachabilityServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeReachabilityServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/networkmanagement/v1/internal/reachability_tracing_connection.h b/google/cloud/networkmanagement/v1/internal/reachability_tracing_connection.h index 29e88e06d44d6..bfe6c6680d1c4 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_tracing_connection.h +++ b/google/cloud/networkmanagement/v1/internal/reachability_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace networkmanagement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ReachabilityServiceTracingConnection : public networkmanagement_v1::ReachabilityServiceConnection { public: @@ -138,8 +136,6 @@ class ReachabilityServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/networkmanagement/v1/internal/reachability_tracing_stub.cc b/google/cloud/networkmanagement/v1/internal/reachability_tracing_stub.cc index 5d90d5f708bb7..81f2e1d97841d 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_tracing_stub.cc +++ b/google/cloud/networkmanagement/v1/internal/reachability_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkmanagement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ReachabilityServiceTracingStub::ReachabilityServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -323,18 +324,14 @@ future ReachabilityServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeReachabilityServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkmanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkmanagement/v1/internal/reachability_tracing_stub.h b/google/cloud/networkmanagement/v1/internal/reachability_tracing_stub.h index 72a4b5a56dd8c..d17701b44a52f 100644 --- a/google/cloud/networkmanagement/v1/internal/reachability_tracing_stub.h +++ b/google/cloud/networkmanagement/v1/internal/reachability_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkmanagement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ReachabilityServiceTracingStub : public ReachabilityServiceStub { public: ~ReachabilityServiceTracingStub() override = default; @@ -153,8 +154,6 @@ class ReachabilityServiceTracingStub : public ReachabilityServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -169,4 +168,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_V1_INTERNAL_REACHABILITY_TRACING_STUB_H diff --git a/google/cloud/networkmanagement/v1/reachability_client.h b/google/cloud/networkmanagement/v1/reachability_client.h index 4fe67211099f0..d8d1b165ffd11 100644 --- a/google/cloud/networkmanagement/v1/reachability_client.h +++ b/google/cloud/networkmanagement/v1/reachability_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/networkmanagement/v1/reachability_connection.h b/google/cloud/networkmanagement/v1/reachability_connection.h index 507c71dec956f..83e0308f4c252 100644 --- a/google/cloud/networkmanagement/v1/reachability_connection.h +++ b/google/cloud/networkmanagement/v1/reachability_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_V1_REACHABILITY_CONNECTION_H #include "google/cloud/networkmanagement/v1/internal/reachability_retry_traits.h" +#include "google/cloud/networkmanagement/v1/reachability.pb.h" #include "google/cloud/networkmanagement/v1/reachability_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkmanagement/v1/reachability_connection_idempotency_policy.h b/google/cloud/networkmanagement/v1/reachability_connection_idempotency_policy.h index 2d95b71e7df01..7541979cdf712 100644 --- a/google/cloud/networkmanagement/v1/reachability_connection_idempotency_policy.h +++ b/google/cloud/networkmanagement/v1/reachability_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_V1_REACHABILITY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKMANAGEMENT_V1_REACHABILITY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkmanagement/v1/reachability.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networksecurity/BUILD.bazel b/google/cloud/networksecurity/BUILD.bazel index a77fe0a8536f6..79f6dc3906290 100644 --- a/google/cloud/networksecurity/BUILD.bazel +++ b/google/cloud/networksecurity/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/networksecurity/v1:networksecurity_cc_grpc", + "@googleapis//google/cloud/networksecurity/v1:networksecurity_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/networksecurity/quickstart/.bazelrc b/google/cloud/networksecurity/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/networksecurity/quickstart/.bazelrc +++ b/google/cloud/networksecurity/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/networksecurity/quickstart/CMakeLists.txt index 4ee5eedcef096..f1bf85e3080dc 100644 --- a/google/cloud/networksecurity/quickstart/CMakeLists.txt +++ b/google/cloud/networksecurity/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Network Security API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-networksecurity-quickstart CXX) find_package(google_cloud_cpp_networksecurity REQUIRED) diff --git a/google/cloud/networksecurity/quickstart/WORKSPACE.bazel b/google/cloud/networksecurity/quickstart/WORKSPACE.bazel index 2247dcdc20bd0..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 = "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/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 ed6424b93edb9..33b6823226e63 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_auth_decorator.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/networksecurity/v1/network_security.proto #include "google/cloud/networksecurity/v1/internal/network_security_auth_decorator.h" -#include +#include "google/cloud/networksecurity/v1/network_security.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networksecurity_v1_internal { @@ -144,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, @@ -370,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, @@ -485,3 +1154,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networksecurity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" 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 22d5f9d3bf803..c240c1e0089b3 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_auth_decorator.h +++ b/google/cloud/networksecurity/v1/internal/network_security_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networksecurity/v1/internal/network_security_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 networksecurity_v1_internal { @@ -91,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, @@ -187,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; @@ -245,4 +549,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSECURITY_V1_INTERNAL_NETWORK_SECURITY_AUTH_DECORATOR_H 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 9cf54949b88a9..995488c74b26a 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_connection_impl.h +++ b/google/cloud/networksecurity/v1/internal/network_security_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 748a21c1ba4ed..d6deb0e050fad 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_logging_decorator.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/networksecurity/v1/network_security.proto #include "google/cloud/networksecurity/v1/internal/network_security_logging_decorator.h" +#include "google/cloud/networksecurity/v1/network_security.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networksecurity_v1_internal { @@ -165,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, @@ -427,144 +566,790 @@ NetworkSecurityLogging::DeleteClientTlsPolicy( context, options, request, __func__, tracing_options_); } -StatusOr -NetworkSecurityLogging::ListLocations( +StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse> +NetworkSecurityLogging::ListGatewaySecurityPolicies( grpc::ClientContext& context, Options const& options, - google::cloud::location::ListLocationsRequest const& request) { + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest 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); + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& request) { + return child_->ListGatewaySecurityPolicies(context, options, request); }, context, options, request, __func__, tracing_options_); } -StatusOr NetworkSecurityLogging::GetLocation( +StatusOr +NetworkSecurityLogging::GetGatewaySecurityPolicy( grpc::ClientContext& context, Options const& options, - google::cloud::location::GetLocationRequest const& request) { + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest 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); + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRequest const& request) { + return child_->GetGatewaySecurityPolicy(context, options, request); }, context, options, request, __func__, tracing_options_); } -StatusOr NetworkSecurityLogging::SetIamPolicy( - grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) { +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](grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) { - return child_->SetIamPolicy(context, options, request); + [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); }, - context, options, request, __func__, tracing_options_); + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); } -StatusOr NetworkSecurityLogging::GetIamPolicy( - grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) { +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::iam::v1::GetIamPolicyRequest const& request) { - return child_->GetIamPolicy(context, options, request); + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + return child_->CreateGatewaySecurityPolicy(context, options, request); }, context, options, request, __func__, tracing_options_); } -StatusOr -NetworkSecurityLogging::TestIamPermissions( - grpc::ClientContext& context, Options const& options, - google::iam::v1::TestIamPermissionsRequest const& request) { +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::iam::v1::TestIamPermissionsRequest const& request) { - return child_->TestIamPermissions(context, options, request); + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + return child_->UpdateGatewaySecurityPolicy(context, options, request); }, context, options, request, __func__, tracing_options_); } -StatusOr -NetworkSecurityLogging::ListOperations( - grpc::ClientContext& context, Options const& options, - google::longrunning::ListOperationsRequest const& request) { +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::longrunning::ListOperationsRequest const& request) { - return child_->ListOperations(context, options, request); + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + return child_->DeleteGatewaySecurityPolicy(context, options, request); }, context, options, request, __func__, tracing_options_); } -StatusOr NetworkSecurityLogging::GetOperation( +StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesResponse> +NetworkSecurityLogging::ListGatewaySecurityPolicyRules( grpc::ClientContext& context, Options const& options, - google::longrunning::GetOperationRequest const& request) { + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest 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); + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& request) { + return child_->ListGatewaySecurityPolicyRules(context, options, + request); }, context, options, request, __func__, tracing_options_); } -Status NetworkSecurityLogging::DeleteOperation( +StatusOr +NetworkSecurityLogging::GetGatewaySecurityPolicyRule( grpc::ClientContext& context, Options const& options, - google::longrunning::DeleteOperationRequest const& request) { + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest 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); + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) { + return child_->GetGatewaySecurityPolicyRule(context, options, request); }, context, options, request, __func__, tracing_options_); } -Status NetworkSecurityLogging::CancelOperation( - grpc::ClientContext& context, Options const& options, - google::longrunning::CancelOperationRequest const& request) { +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::longrunning::CancelOperationRequest const& request) { - return child_->CancelOperation(context, options, request); + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + return child_->CreateGatewaySecurityPolicyRule(context, options, + request); }, context, options, request, __func__, tracing_options_); } future> -NetworkSecurityLogging::AsyncGetOperation( +NetworkSecurityLogging::AsyncUpdateGatewaySecurityPolicyRule( google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, - google::longrunning::GetOperationRequest const& request) { + 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::longrunning::GetOperationRequest const& request) { - return child_->AsyncGetOperation(cq, std::move(context), - std::move(options), request); + 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_); } -future NetworkSecurityLogging::AsyncCancelOperation( +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::longrunning::CancelOperationRequest const& request) { + 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::longrunning::CancelOperationRequest const& request) { - return child_->AsyncCancelOperation(cq, std::move(context), - std::move(options), request); + 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_); } -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace networksecurity_v1_internal -} // namespace cloud -} // namespace google +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, + 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 NetworkSecurityLogging::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 NetworkSecurityLogging::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 NetworkSecurityLogging::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 +NetworkSecurityLogging::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 +NetworkSecurityLogging::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 NetworkSecurityLogging::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 NetworkSecurityLogging::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 NetworkSecurityLogging::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> +NetworkSecurityLogging::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 NetworkSecurityLogging::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 networksecurity_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" 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 e27bb17138f65..497bc0928dcfe 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_logging_decorator.h +++ b/google/cloud/networksecurity/v1/internal/network_security_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networksecurity/v1/internal/network_security_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 networksecurity_v1_internal { @@ -91,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, @@ -187,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; @@ -245,4 +549,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSECURITY_V1_INTERNAL_NETWORK_SECURITY_LOGGING_DECORATOR_H 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 c17532b8f4ec1..3b786c767bed3 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_metadata_decorator.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/networksecurity/v1/network_security.proto #include "google/cloud/networksecurity/v1/internal/network_security_metadata_decorator.h" +#include "google/cloud/networksecurity/v1/network_security.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 networksecurity_v1_internal { @@ -137,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, @@ -323,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, @@ -442,3 +993,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networksecurity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" 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 21e5f0afe2e04..4d3200e5780f4 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_metadata_decorator.h +++ b/google/cloud/networksecurity/v1/internal/network_security_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networksecurity/v1/internal/network_security_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 networksecurity_v1_internal { @@ -92,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, @@ -188,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; @@ -251,4 +555,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSECURITY_V1_INTERNAL_NETWORK_SECURITY_METADATA_DECORATOR_H diff --git a/google/cloud/networksecurity/v1/internal/network_security_option_defaults.cc b/google/cloud/networksecurity/v1/internal/network_security_option_defaults.cc index f2f0b38770ec4..7434686a029d3 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_option_defaults.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_option_defaults.cc @@ -42,7 +42,7 @@ Options NetworkSecurityDefaultOptions(Options options) { if (!options.has()) { options.set( networksecurity_v1::NetworkSecurityLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/networksecurity/v1/internal/network_security_stub.cc b/google/cloud/networksecurity/v1/internal/network_security_stub.cc index 77555bdf82f59..4359ba5e3327d 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_stub.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/networksecurity/v1/network_security.proto #include "google/cloud/networksecurity/v1/internal/network_security_stub.h" +#include "google/cloud/networksecurity/v1/network_security.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networksecurity_v1_internal { @@ -162,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&, @@ -412,151 +553,795 @@ DefaultNetworkSecurityStub::DeleteClientTlsPolicy( return response; } -StatusOr -DefaultNetworkSecurityStub::ListLocations( +StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse> +DefaultNetworkSecurityStub::ListGatewaySecurityPolicies( grpc::ClientContext& context, Options const&, - google::cloud::location::ListLocationsRequest const& request) { - google::cloud::location::ListLocationsResponse response; - auto status = locations_stub_->ListLocations(&context, request, &response); + 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::GetLocation( +StatusOr +DefaultNetworkSecurityStub::GetGatewaySecurityPolicy( grpc::ClientContext& context, Options const&, - google::cloud::location::GetLocationRequest const& request) { - google::cloud::location::Location response; - auto status = locations_stub_->GetLocation(&context, request, &response); + 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; } -StatusOr DefaultNetworkSecurityStub::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); +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; } -StatusOr DefaultNetworkSecurityStub::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); +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; } -StatusOr -DefaultNetworkSecurityStub::TestIamPermissions( - grpc::ClientContext& context, Options const&, - google::iam::v1::TestIamPermissionsRequest const& request) { - google::iam::v1::TestIamPermissionsResponse 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 = - iampolicy_stub_->TestIamPermissions(&context, request, &response); + grpc_stub_->DeleteGatewaySecurityPolicy(&context, request, &response); if (!status.ok()) { return google::cloud::MakeStatusFromRpcError(status); } return response; } -StatusOr -DefaultNetworkSecurityStub::ListOperations( +StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesResponse> +DefaultNetworkSecurityStub::ListGatewaySecurityPolicyRules( grpc::ClientContext& context, Options const&, - google::longrunning::ListOperationsRequest const& request) { - google::longrunning::ListOperationsResponse response; - auto status = operations_stub_->ListOperations(&context, request, &response); + 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::GetOperation( +StatusOr +DefaultNetworkSecurityStub::GetGatewaySecurityPolicyRule( grpc::ClientContext& context, Options const&, - google::longrunning::GetOperationRequest const& request) { - google::longrunning::Operation response; - auto status = operations_stub_->GetOperation(&context, request, &response); + 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; } -Status DefaultNetworkSecurityStub::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(); +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)); } -Status DefaultNetworkSecurityStub::CancelOperation( - grpc::ClientContext& context, Options const&, - google::longrunning::CancelOperationRequest const& request) { - google::protobuf::Empty response; - auto status = operations_stub_->CancelOperation(&context, request, &response); +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 google::cloud::Status(); + return response; } future> -DefaultNetworkSecurityStub::AsyncGetOperation( +DefaultNetworkSecurityStub::AsyncUpdateGatewaySecurityPolicyRule( 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, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request, grpc::CompletionQueue* cq) { - return operations_stub_->AsyncGetOperation(context, request, cq); + return grpc_stub_->AsyncUpdateGatewaySecurityPolicyRule(context, + request, cq); }, request, std::move(context)); } -future DefaultNetworkSecurityStub::AsyncCancelOperation( +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, - // 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::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)); } -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace networksecurity_v1_internal +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&, + 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 +DefaultNetworkSecurityStub::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 DefaultNetworkSecurityStub::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 DefaultNetworkSecurityStub::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 +DefaultNetworkSecurityStub::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 +DefaultNetworkSecurityStub::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 +DefaultNetworkSecurityStub::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 DefaultNetworkSecurityStub::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 DefaultNetworkSecurityStub::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> +DefaultNetworkSecurityStub::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 DefaultNetworkSecurityStub::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 networksecurity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networksecurity/v1/internal/network_security_stub.h b/google/cloud/networksecurity/v1/internal/network_security_stub.h index a958f1110d9c0..8dc5d327d1ac7 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_stub.h +++ b/google/cloud/networksecurity/v1/internal/network_security_stub.h @@ -19,19 +19,22 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSECURITY_V1_INTERNAL_NETWORK_SECURITY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSECURITY_V1_INTERNAL_NETWORK_SECURITY_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networksecurity/v1/common.pb.h" +#include "google/cloud/networksecurity/v1/network_security.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 -#include -#include -#include -#include +#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 networksecurity_v1_internal { @@ -93,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( @@ -197,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, @@ -316,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, @@ -412,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; @@ -476,4 +1093,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSECURITY_V1_INTERNAL_NETWORK_SECURITY_STUB_H diff --git a/google/cloud/networksecurity/v1/internal/network_security_stub_factory.cc b/google/cloud/networksecurity/v1/internal/network_security_stub_factory.cc index 8e42fca7d8861..e8e86b4ca13f8 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_stub_factory.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/networksecurity/v1/network_security.proto #include "google/cloud/networksecurity/v1/internal/network_security_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/networksecurity/v1/internal/network_security_auth_decorator.h" #include "google/cloud/networksecurity/v1/internal/network_security_logging_decorator.h" #include "google/cloud/networksecurity/v1/internal/network_security_metadata_decorator.h" #include "google/cloud/networksecurity/v1/internal/network_security_stub.h" #include "google/cloud/networksecurity/v1/internal/network_security_tracing_stub.h" +#include "google/cloud/networksecurity/v1/network_security.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 -#include -#include -#include +#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 networksecurity_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networksecurity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networksecurity/v1/internal/network_security_stub_factory.h b/google/cloud/networksecurity/v1/internal/network_security_stub_factory.h index 5c358fe27616b..c3a06fc8cef47 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_stub_factory.h +++ b/google/cloud/networksecurity/v1/internal/network_security_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networksecurity_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSECURITY_V1_INTERNAL_NETWORK_SECURITY_STUB_FACTORY_H 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 83c2a4edda198..04606c8401673 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_tracing_connection.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace networksecurity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NetworkSecurityTracingConnection::NetworkSecurityTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -165,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) { @@ -407,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) { @@ -490,16 +1238,12 @@ Status NetworkSecurityTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNetworkSecurityTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } 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 b85cbf92baa11..9b0e3231304d4 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_tracing_connection.h +++ b/google/cloud/networksecurity/v1/internal/network_security_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace networksecurity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NetworkSecurityTracingConnection : public networksecurity_v1::NetworkSecurityConnection { public: @@ -89,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) @@ -193,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; @@ -224,8 +525,6 @@ class NetworkSecurityTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * 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 c84aa0ec60150..aa8986c08bb25 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_tracing_stub.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networksecurity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NetworkSecurityTracingStub::NetworkSecurityTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -158,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, @@ -398,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, @@ -530,18 +1252,14 @@ future NetworkSecurityTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNetworkSecurityTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networksecurity_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" 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 1a466ecbbf119..9c3190e856257 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_tracing_stub.h +++ b/google/cloud/networksecurity/v1/internal/network_security_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networksecurity_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NetworkSecurityTracingStub : public NetworkSecurityStub { public: ~NetworkSecurityTracingStub() override = default; @@ -91,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, @@ -187,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; @@ -241,8 +543,6 @@ class NetworkSecurityTracingStub : public NetworkSecurityStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -257,4 +557,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSECURITY_V1_INTERNAL_NETWORK_SECURITY_TRACING_STUB_H 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 63967dfc8aecc..9d664202b0404 100644 --- a/google/cloud/networksecurity/v1/network_security_client.h +++ b/google/cloud/networksecurity/v1/network_security_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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 313568bfd717a..c5d6fcc94628d 100644 --- a/google/cloud/networksecurity/v1/network_security_connection.h +++ b/google/cloud/networksecurity/v1/network_security_connection.h @@ -19,7 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSECURITY_V1_NETWORK_SECURITY_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSECURITY_V1_NETWORK_SECURITY_CONNECTION_H +#include "google/cloud/networksecurity/v1/common.pb.h" #include "google/cloud/networksecurity/v1/internal/network_security_retry_traits.h" +#include "google/cloud/networksecurity/v1/network_security.pb.h" #include "google/cloud/networksecurity/v1/network_security_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,9 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 e9693649b51fc..42269e017be39 100644 --- a/google/cloud/networksecurity/v1/network_security_connection_idempotency_policy.h +++ b/google/cloud/networksecurity/v1/network_security_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSECURITY_V1_NETWORK_SECURITY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSECURITY_V1_NETWORK_SECURITY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networksecurity/v1/network_security.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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/BUILD.bazel b/google/cloud/networkservices/BUILD.bazel index 1f4c5e7f1660b..4580fd4893a7b 100644 --- a/google/cloud/networkservices/BUILD.bazel +++ b/google/cloud/networkservices/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/networkservices/v1:networkservices_cc_grpc", + "@googleapis//google/cloud/networkservices/v1:networkservices_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/networkservices/quickstart/.bazelrc b/google/cloud/networkservices/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/networkservices/quickstart/.bazelrc +++ b/google/cloud/networkservices/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/networkservices/quickstart/CMakeLists.txt index b7eec171bcdb4..8fb1e1adb091f 100644 --- a/google/cloud/networkservices/quickstart/CMakeLists.txt +++ b/google/cloud/networkservices/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Network Services API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-networkservices-quickstart CXX) find_package(google_cloud_cpp_networkservices REQUIRED) diff --git a/google/cloud/networkservices/quickstart/WORKSPACE.bazel b/google/cloud/networkservices/quickstart/WORKSPACE.bazel index e3b14042f5aec..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 = "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/networkservices/v1/dep_client.h b/google/cloud/networkservices/v1/dep_client.h index dbe51a7a76116..7793ff6bc0db9 100644 --- a/google/cloud/networkservices/v1/dep_client.h +++ b/google/cloud/networkservices/v1/dep_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/dep_connection.h b/google/cloud/networkservices/v1/dep_connection.h index 041a35523c553..4879e6d7dfeff 100644 --- a/google/cloud/networkservices/v1/dep_connection.h +++ b/google/cloud/networkservices/v1/dep_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_DEP_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_DEP_CONNECTION_H +#include "google/cloud/networkservices/v1/dep.pb.h" #include "google/cloud/networkservices/v1/dep_connection_idempotency_policy.h" #include "google/cloud/networkservices/v1/internal/dep_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkservices/v1/dep_connection_idempotency_policy.h b/google/cloud/networkservices/v1/dep_connection_idempotency_policy.h index 874fc7614c79e..be352f7959754 100644 --- a/google/cloud/networkservices/v1/dep_connection_idempotency_policy.h +++ b/google/cloud/networkservices/v1/dep_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_DEP_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_DEP_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkservices/v1/dep.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkservices/v1/internal/dep_auth_decorator.cc b/google/cloud/networkservices/v1/internal/dep_auth_decorator.cc index 3c2d66d6970f4..2f00fd264198c 100644 --- a/google/cloud/networkservices/v1/internal/dep_auth_decorator.cc +++ b/google/cloud/networkservices/v1/internal/dep_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/networkservices/v1/dep.proto #include "google/cloud/networkservices/v1/internal/dep_auth_decorator.h" -#include +#include "google/cloud/networkservices/v1/dep.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkservices_v1_internal { @@ -589,3 +592,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkservices/v1/internal/dep_auth_decorator.h b/google/cloud/networkservices/v1/internal/dep_auth_decorator.h index 80b2d502aa5f2..9a50ca948048b 100644 --- a/google/cloud/networkservices/v1/internal/dep_auth_decorator.h +++ b/google/cloud/networkservices/v1/internal/dep_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkservices/v1/internal/dep_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 networkservices_v1_internal { @@ -292,4 +295,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_DEP_AUTH_DECORATOR_H diff --git a/google/cloud/networkservices/v1/internal/dep_connection_impl.h b/google/cloud/networkservices/v1/internal/dep_connection_impl.h index 44e3d4b03191a..3f275af2aad41 100644 --- a/google/cloud/networkservices/v1/internal/dep_connection_impl.h +++ b/google/cloud/networkservices/v1/internal/dep_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkservices/v1/internal/dep_logging_decorator.cc b/google/cloud/networkservices/v1/internal/dep_logging_decorator.cc index 26dd6fb5f819b..96590b3135c0f 100644 --- a/google/cloud/networkservices/v1/internal/dep_logging_decorator.cc +++ b/google/cloud/networkservices/v1/internal/dep_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/networkservices/v1/dep.proto #include "google/cloud/networkservices/v1/internal/dep_logging_decorator.h" +#include "google/cloud/networkservices/v1/dep.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkservices_v1_internal { @@ -706,3 +709,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkservices/v1/internal/dep_logging_decorator.h b/google/cloud/networkservices/v1/internal/dep_logging_decorator.h index fccc49fe45c59..6c7541b00dfb3 100644 --- a/google/cloud/networkservices/v1/internal/dep_logging_decorator.h +++ b/google/cloud/networkservices/v1/internal/dep_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkservices/v1/internal/dep_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 networkservices_v1_internal { @@ -292,4 +295,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_DEP_LOGGING_DECORATOR_H diff --git a/google/cloud/networkservices/v1/internal/dep_metadata_decorator.cc b/google/cloud/networkservices/v1/internal/dep_metadata_decorator.cc index ec4c164397b52..379733d2e2a90 100644 --- a/google/cloud/networkservices/v1/internal/dep_metadata_decorator.cc +++ b/google/cloud/networkservices/v1/internal/dep_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/networkservices/v1/dep.proto #include "google/cloud/networkservices/v1/internal/dep_metadata_decorator.h" +#include "google/cloud/networkservices/v1/dep.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 networkservices_v1_internal { @@ -534,3 +538,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkservices/v1/internal/dep_metadata_decorator.h b/google/cloud/networkservices/v1/internal/dep_metadata_decorator.h index 4f51d57722ae8..77e92a1794cd6 100644 --- a/google/cloud/networkservices/v1/internal/dep_metadata_decorator.h +++ b/google/cloud/networkservices/v1/internal/dep_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkservices/v1/internal/dep_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 networkservices_v1_internal { @@ -297,4 +300,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_DEP_METADATA_DECORATOR_H diff --git a/google/cloud/networkservices/v1/internal/dep_option_defaults.cc b/google/cloud/networkservices/v1/internal/dep_option_defaults.cc index de7dfc229b17f..e780243fcec52 100644 --- a/google/cloud/networkservices/v1/internal/dep_option_defaults.cc +++ b/google/cloud/networkservices/v1/internal/dep_option_defaults.cc @@ -42,7 +42,7 @@ Options DepServiceDefaultOptions(Options options) { if (!options.has()) { options.set( networkservices_v1::DepServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/networkservices/v1/internal/dep_stub.cc b/google/cloud/networkservices/v1/internal/dep_stub.cc index 9e0a16c1fa041..b5fc5b82315ee 100644 --- a/google/cloud/networkservices/v1/internal/dep_stub.cc +++ b/google/cloud/networkservices/v1/internal/dep_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/networkservices/v1/dep.proto #include "google/cloud/networkservices/v1/internal/dep_stub.h" +#include "google/cloud/networkservices/v1/dep.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkservices_v1_internal { @@ -687,3 +690,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkservices/v1/internal/dep_stub.h b/google/cloud/networkservices/v1/internal/dep_stub.h index 9c3a7cbaf7cb8..45ed9475ecff4 100644 --- a/google/cloud/networkservices/v1/internal/dep_stub.h +++ b/google/cloud/networkservices/v1/internal/dep_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_DEP_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_DEP_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkservices/v1/dep.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 -#include -#include -#include +#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 networkservices_v1_internal { @@ -573,4 +576,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_DEP_STUB_H diff --git a/google/cloud/networkservices/v1/internal/dep_stub_factory.cc b/google/cloud/networkservices/v1/internal/dep_stub_factory.cc index 4e919a379e61e..f2d13c4590bac 100644 --- a/google/cloud/networkservices/v1/internal/dep_stub_factory.cc +++ b/google/cloud/networkservices/v1/internal/dep_stub_factory.cc @@ -17,6 +17,8 @@ // source: google/cloud/networkservices/v1/dep.proto #include "google/cloud/networkservices/v1/internal/dep_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkservices/v1/dep.grpc.pb.h" #include "google/cloud/networkservices/v1/internal/dep_auth_decorator.h" #include "google/cloud/networkservices/v1/internal/dep_logging_decorator.h" #include "google/cloud/networkservices/v1/internal/dep_metadata_decorator.h" @@ -28,13 +30,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include -#include +#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 networkservices_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkservices/v1/internal/dep_stub_factory.h b/google/cloud/networkservices/v1/internal/dep_stub_factory.h index 53deb383f7bac..dade960c038b7 100644 --- a/google/cloud/networkservices/v1/internal/dep_stub_factory.h +++ b/google/cloud/networkservices/v1/internal/dep_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkservices_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_DEP_STUB_FACTORY_H diff --git a/google/cloud/networkservices/v1/internal/dep_tracing_connection.cc b/google/cloud/networkservices/v1/internal/dep_tracing_connection.cc index d71f217e7e508..ccbc0a6754596 100644 --- a/google/cloud/networkservices/v1/internal/dep_tracing_connection.cc +++ b/google/cloud/networkservices/v1/internal/dep_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace networkservices_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DepServiceTracingConnection::DepServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -599,16 +597,12 @@ Status DepServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDepServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/networkservices/v1/internal/dep_tracing_connection.h b/google/cloud/networkservices/v1/internal/dep_tracing_connection.h index 973c59e85987e..35b6877d3e336 100644 --- a/google/cloud/networkservices/v1/internal/dep_tracing_connection.h +++ b/google/cloud/networkservices/v1/internal/dep_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace networkservices_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DepServiceTracingConnection : public networkservices_v1::DepServiceConnection { public: @@ -279,8 +277,6 @@ class DepServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/networkservices/v1/internal/dep_tracing_stub.cc b/google/cloud/networkservices/v1/internal/dep_tracing_stub.cc index 5d166bfdbdd8f..bf3c5daf6c259 100644 --- a/google/cloud/networkservices/v1/internal/dep_tracing_stub.cc +++ b/google/cloud/networkservices/v1/internal/dep_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkservices_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DepServiceTracingStub::DepServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -621,18 +622,14 @@ future DepServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDepServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkservices/v1/internal/dep_tracing_stub.h b/google/cloud/networkservices/v1/internal/dep_tracing_stub.h index 95c5f89163794..409d0663843ae 100644 --- a/google/cloud/networkservices/v1/internal/dep_tracing_stub.h +++ b/google/cloud/networkservices/v1/internal/dep_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkservices_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DepServiceTracingStub : public DepServiceStub { public: ~DepServiceTracingStub() override = default; @@ -287,8 +288,6 @@ class DepServiceTracingStub : public DepServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -303,4 +302,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_DEP_TRACING_STUB_H diff --git a/google/cloud/networkservices/v1/internal/network_services_auth_decorator.cc b/google/cloud/networkservices/v1/internal/network_services_auth_decorator.cc index 751e69c52c6af..adf72e03d4b7e 100644 --- a/google/cloud/networkservices/v1/internal/network_services_auth_decorator.cc +++ b/google/cloud/networkservices/v1/internal/network_services_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/networkservices/v1/network_services.proto #include "google/cloud/networkservices/v1/internal/network_services_auth_decorator.h" -#include +#include "google/cloud/networkservices/v1/network_services.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkservices_v1_internal { @@ -1326,3 +1329,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkservices/v1/internal/network_services_auth_decorator.h b/google/cloud/networkservices/v1/internal/network_services_auth_decorator.h index 4ed9ae4349311..72ab08d0d1f40 100644 --- a/google/cloud/networkservices/v1/internal/network_services_auth_decorator.h +++ b/google/cloud/networkservices/v1/internal/network_services_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkservices/v1/internal/network_services_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 networkservices_v1_internal { @@ -625,4 +628,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_NETWORK_SERVICES_AUTH_DECORATOR_H diff --git a/google/cloud/networkservices/v1/internal/network_services_connection_impl.h b/google/cloud/networkservices/v1/internal/network_services_connection_impl.h index 80d4275c2034f..12cb4f5755802 100644 --- a/google/cloud/networkservices/v1/internal/network_services_connection_impl.h +++ b/google/cloud/networkservices/v1/internal/network_services_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkservices/v1/internal/network_services_logging_decorator.cc b/google/cloud/networkservices/v1/internal/network_services_logging_decorator.cc index 2f2a7abbc095c..e0f687afda43d 100644 --- a/google/cloud/networkservices/v1/internal/network_services_logging_decorator.cc +++ b/google/cloud/networkservices/v1/internal/network_services_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/networkservices/v1/network_services.proto #include "google/cloud/networkservices/v1/internal/network_services_logging_decorator.h" +#include "google/cloud/networkservices/v1/network_services.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkservices_v1_internal { @@ -1584,3 +1587,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkservices/v1/internal/network_services_logging_decorator.h b/google/cloud/networkservices/v1/internal/network_services_logging_decorator.h index 7563a8b1ea79d..cf843315c9061 100644 --- a/google/cloud/networkservices/v1/internal/network_services_logging_decorator.h +++ b/google/cloud/networkservices/v1/internal/network_services_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkservices/v1/internal/network_services_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 networkservices_v1_internal { @@ -625,4 +628,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_NETWORK_SERVICES_LOGGING_DECORATOR_H diff --git a/google/cloud/networkservices/v1/internal/network_services_metadata_decorator.cc b/google/cloud/networkservices/v1/internal/network_services_metadata_decorator.cc index 22c06f9ed7755..372a570ca3ac9 100644 --- a/google/cloud/networkservices/v1/internal/network_services_metadata_decorator.cc +++ b/google/cloud/networkservices/v1/internal/network_services_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/networkservices/v1/network_services.proto #include "google/cloud/networkservices/v1/internal/network_services_metadata_decorator.h" +#include "google/cloud/networkservices/v1/network_services.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 networkservices_v1_internal { @@ -1129,3 +1133,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkservices/v1/internal/network_services_metadata_decorator.h b/google/cloud/networkservices/v1/internal/network_services_metadata_decorator.h index 819cbce73ef98..f078ac7104d55 100644 --- a/google/cloud/networkservices/v1/internal/network_services_metadata_decorator.h +++ b/google/cloud/networkservices/v1/internal/network_services_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/networkservices/v1/internal/network_services_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 networkservices_v1_internal { @@ -631,4 +634,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_NETWORK_SERVICES_METADATA_DECORATOR_H diff --git a/google/cloud/networkservices/v1/internal/network_services_option_defaults.cc b/google/cloud/networkservices/v1/internal/network_services_option_defaults.cc index 532e4bc6c0538..d4e95150a6978 100644 --- a/google/cloud/networkservices/v1/internal/network_services_option_defaults.cc +++ b/google/cloud/networkservices/v1/internal/network_services_option_defaults.cc @@ -42,7 +42,7 @@ Options NetworkServicesDefaultOptions(Options options) { if (!options.has()) { options.set( networkservices_v1::NetworkServicesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/networkservices/v1/internal/network_services_stub.cc b/google/cloud/networkservices/v1/internal/network_services_stub.cc index 962b18476aace..8a5d980bb5e4f 100644 --- a/google/cloud/networkservices/v1/internal/network_services_stub.cc +++ b/google/cloud/networkservices/v1/internal/network_services_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/networkservices/v1/network_services.proto #include "google/cloud/networkservices/v1/internal/network_services_stub.h" +#include "google/cloud/networkservices/v1/network_services.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkservices_v1_internal { @@ -1529,3 +1532,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkservices/v1/internal/network_services_stub.h b/google/cloud/networkservices/v1/internal/network_services_stub.h index 2cb715a2e50c1..1771e19b4d4e1 100644 --- a/google/cloud/networkservices/v1/internal/network_services_stub.h +++ b/google/cloud/networkservices/v1/internal/network_services_stub.h @@ -19,19 +19,22 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_NETWORK_SERVICES_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_NETWORK_SERVICES_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkservices/v1/extensibility.pb.h" +#include "google/cloud/networkservices/v1/network_services.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 -#include -#include -#include -#include +#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 networkservices_v1_internal { @@ -1241,4 +1244,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_NETWORK_SERVICES_STUB_H diff --git a/google/cloud/networkservices/v1/internal/network_services_stub_factory.cc b/google/cloud/networkservices/v1/internal/network_services_stub_factory.cc index 900f9828b73cd..d79f6e22028cf 100644 --- a/google/cloud/networkservices/v1/internal/network_services_stub_factory.cc +++ b/google/cloud/networkservices/v1/internal/network_services_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/networkservices/v1/network_services.proto #include "google/cloud/networkservices/v1/internal/network_services_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/networkservices/v1/internal/network_services_auth_decorator.h" #include "google/cloud/networkservices/v1/internal/network_services_logging_decorator.h" #include "google/cloud/networkservices/v1/internal/network_services_metadata_decorator.h" #include "google/cloud/networkservices/v1/internal/network_services_stub.h" #include "google/cloud/networkservices/v1/internal/network_services_tracing_stub.h" +#include "google/cloud/networkservices/v1/network_services.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 -#include -#include -#include +#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 networkservices_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkservices/v1/internal/network_services_stub_factory.h b/google/cloud/networkservices/v1/internal/network_services_stub_factory.h index 4720410910b5e..d0b3884131a37 100644 --- a/google/cloud/networkservices/v1/internal/network_services_stub_factory.h +++ b/google/cloud/networkservices/v1/internal/network_services_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkservices_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_NETWORK_SERVICES_STUB_FACTORY_H diff --git a/google/cloud/networkservices/v1/internal/network_services_tracing_connection.cc b/google/cloud/networkservices/v1/internal/network_services_tracing_connection.cc index 3fd726763d814..407039150b77e 100644 --- a/google/cloud/networkservices/v1/internal/network_services_tracing_connection.cc +++ b/google/cloud/networkservices/v1/internal/network_services_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace networkservices_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NetworkServicesTracingConnection::NetworkServicesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -1369,16 +1367,12 @@ Status NetworkServicesTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNetworkServicesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/networkservices/v1/internal/network_services_tracing_connection.h b/google/cloud/networkservices/v1/internal/network_services_tracing_connection.h index dfc8f9c8ddc1d..53732106c02b3 100644 --- a/google/cloud/networkservices/v1/internal/network_services_tracing_connection.h +++ b/google/cloud/networkservices/v1/internal/network_services_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace networkservices_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NetworkServicesTracingConnection : public networkservices_v1::NetworkServicesConnection { public: @@ -601,8 +599,6 @@ class NetworkServicesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/networkservices/v1/internal/network_services_tracing_stub.cc b/google/cloud/networkservices/v1/internal/network_services_tracing_stub.cc index 9e22688f6a023..a543dbe16e423 100644 --- a/google/cloud/networkservices/v1/internal/network_services_tracing_stub.cc +++ b/google/cloud/networkservices/v1/internal/network_services_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkservices_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NetworkServicesTracingStub::NetworkServicesTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -1401,18 +1402,14 @@ future NetworkServicesTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNetworkServicesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace networkservices_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/networkservices/v1/internal/network_services_tracing_stub.h b/google/cloud/networkservices/v1/internal/network_services_tracing_stub.h index c7ceb1a7381a7..714288acd7a5e 100644 --- a/google/cloud/networkservices/v1/internal/network_services_tracing_stub.h +++ b/google/cloud/networkservices/v1/internal/network_services_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace networkservices_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NetworkServicesTracingStub : public NetworkServicesStub { public: ~NetworkServicesTracingStub() override = default; @@ -621,8 +622,6 @@ class NetworkServicesTracingStub : public NetworkServicesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -637,4 +636,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_INTERNAL_NETWORK_SERVICES_TRACING_STUB_H diff --git a/google/cloud/networkservices/v1/network_services_client.h b/google/cloud/networkservices/v1/network_services_client.h index 53a082a54bbe5..caae8d00d2d06 100644 --- a/google/cloud/networkservices/v1/network_services_client.h +++ b/google/cloud/networkservices/v1/network_services_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/networkservices/v1/network_services_connection.h b/google/cloud/networkservices/v1/network_services_connection.h index e96b8e26416c6..d682bafcd26a0 100644 --- a/google/cloud/networkservices/v1/network_services_connection.h +++ b/google/cloud/networkservices/v1/network_services_connection.h @@ -19,7 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_NETWORK_SERVICES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_NETWORK_SERVICES_CONNECTION_H +#include "google/cloud/networkservices/v1/extensibility.pb.h" #include "google/cloud/networkservices/v1/internal/network_services_retry_traits.h" +#include "google/cloud/networkservices/v1/network_services.pb.h" #include "google/cloud/networkservices/v1/network_services_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,9 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/networkservices/v1/network_services_connection_idempotency_policy.h b/google/cloud/networkservices/v1/network_services_connection_idempotency_policy.h index b2adcea8b8b9c..4e107d6f6c282 100644 --- a/google/cloud/networkservices/v1/network_services_connection_idempotency_policy.h +++ b/google/cloud/networkservices/v1/network_services_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_NETWORK_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NETWORKSERVICES_V1_NETWORK_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/networkservices/v1/network_services.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/notebooks/BUILD.bazel b/google/cloud/notebooks/BUILD.bazel index a7ca423cce1f4..7febd682d260b 100644 --- a/google/cloud/notebooks/BUILD.bazel +++ b/google/cloud/notebooks/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/notebooks/v1:notebooks_cc_grpc", - "@com_google_googleapis//google/cloud/notebooks/v2:notebooks_cc_grpc", + "@googleapis//google/cloud/notebooks/v1:notebooks_cc_grpc", + "@googleapis//google/cloud/notebooks/v2:notebooks_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/notebooks/CMakeLists.txt b/google/cloud/notebooks/CMakeLists.txt index f657aaf5f65c2..eb47354bdc5bc 100644 --- a/google/cloud/notebooks/CMakeLists.txt +++ b/google/cloud/notebooks/CMakeLists.txt @@ -16,8 +16,8 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library(notebooks "Notebooks API" - SERVICE_DIRS "__EMPTY__" "v1/" "v2/") +google_cloud_cpp_add_gapic_library(notebooks "Notebooks API" SERVICE_DIRS "v1/" + "v2/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(notebooks_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/notebooks/managed_notebook_client.h b/google/cloud/notebooks/managed_notebook_client.h deleted file mode 100644 index bbddc64b0cd9e..0000000000000 --- a/google/cloud/notebooks/managed_notebook_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/notebooks/v1/managed_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_CLIENT_H - -#include "google/cloud/notebooks/managed_notebook_connection.h" -#include "google/cloud/notebooks/v1/managed_notebook_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in notebooks_v1 instead of the aliases defined in -/// this namespace. -namespace notebooks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use notebooks_v1::ManagedNotebookServiceClient directly. -using ::google::cloud::notebooks_v1::ManagedNotebookServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace notebooks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_CLIENT_H diff --git a/google/cloud/notebooks/managed_notebook_connection.h b/google/cloud/notebooks/managed_notebook_connection.h deleted file mode 100644 index c38d788004627..0000000000000 --- a/google/cloud/notebooks/managed_notebook_connection.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/notebooks/v1/managed_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_CONNECTION_H - -#include "google/cloud/notebooks/managed_notebook_connection_idempotency_policy.h" -#include "google/cloud/notebooks/v1/managed_notebook_connection.h" - -namespace google { -namespace cloud { -namespace notebooks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use notebooks_v1::MakeManagedNotebookServiceConnection directly. -using ::google::cloud::notebooks_v1::MakeManagedNotebookServiceConnection; - -/// @deprecated Use notebooks_v1::ManagedNotebookServiceConnection directly. -using ::google::cloud::notebooks_v1::ManagedNotebookServiceConnection; - -/// @deprecated Use -/// notebooks_v1::ManagedNotebookServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::notebooks_v1:: - ManagedNotebookServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use notebooks_v1::ManagedNotebookServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::notebooks_v1:: - ManagedNotebookServiceLimitedTimeRetryPolicy; - -/// @deprecated Use notebooks_v1::ManagedNotebookServiceRetryPolicy directly. -using ::google::cloud::notebooks_v1::ManagedNotebookServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace notebooks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_CONNECTION_H diff --git a/google/cloud/notebooks/managed_notebook_connection_idempotency_policy.h b/google/cloud/notebooks/managed_notebook_connection_idempotency_policy.h deleted file mode 100644 index 55618141907e9..0000000000000 --- a/google/cloud/notebooks/managed_notebook_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/notebooks/v1/managed_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/notebooks/v1/managed_notebook_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace notebooks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// notebooks_v1::MakeDefaultManagedNotebookServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::notebooks_v1:: - MakeDefaultManagedNotebookServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// notebooks_v1::ManagedNotebookServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::notebooks_v1:: - ManagedNotebookServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace notebooks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/notebooks/managed_notebook_options.h b/google/cloud/notebooks/managed_notebook_options.h deleted file mode 100644 index 5acd37f6df28f..0000000000000 --- a/google/cloud/notebooks/managed_notebook_options.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/notebooks/v1/managed_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_OPTIONS_H - -#include "google/cloud/notebooks/managed_notebook_connection.h" -#include "google/cloud/notebooks/managed_notebook_connection_idempotency_policy.h" -#include "google/cloud/notebooks/v1/managed_notebook_options.h" - -namespace google { -namespace cloud { -namespace notebooks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use notebooks_v1::ManagedNotebookServicePollingPolicyOption -/// directly. -using ::google::cloud::notebooks_v1::ManagedNotebookServicePollingPolicyOption; - -/// @deprecated Use notebooks_v1::ManagedNotebookServiceBackoffPolicyOption -/// directly. -using ::google::cloud::notebooks_v1::ManagedNotebookServiceBackoffPolicyOption; - -/// @deprecated Use -/// notebooks_v1::ManagedNotebookServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::notebooks_v1:: - ManagedNotebookServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use notebooks_v1::ManagedNotebookServicePolicyOptionList -/// directly. -using ::google::cloud::notebooks_v1::ManagedNotebookServicePolicyOptionList; - -/// @deprecated Use notebooks_v1::ManagedNotebookServiceRetryPolicyOption -/// directly. -using ::google::cloud::notebooks_v1::ManagedNotebookServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace notebooks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_OPTIONS_H diff --git a/google/cloud/notebooks/mocks/mock_managed_notebook_connection.h b/google/cloud/notebooks/mocks/mock_managed_notebook_connection.h deleted file mode 100644 index 552aa0075c970..0000000000000 --- a/google/cloud/notebooks/mocks/mock_managed_notebook_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/notebooks/v1/managed_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MOCKS_MOCK_MANAGED_NOTEBOOK_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MOCKS_MOCK_MANAGED_NOTEBOOK_CONNECTION_H - -#include "google/cloud/notebooks/managed_notebook_connection.h" -#include "google/cloud/notebooks/v1/mocks/mock_managed_notebook_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in notebooks_v1_mocks instead of the aliases -/// defined in this namespace. -namespace notebooks_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use notebooks_v1_mocks::MockManagedNotebookServiceConnection -/// directly. -using ::google::cloud::notebooks_v1_mocks::MockManagedNotebookServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace notebooks_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MOCKS_MOCK_MANAGED_NOTEBOOK_CONNECTION_H diff --git a/google/cloud/notebooks/mocks/mock_notebook_connection.h b/google/cloud/notebooks/mocks/mock_notebook_connection.h deleted file mode 100644 index fad3765db1981..0000000000000 --- a/google/cloud/notebooks/mocks/mock_notebook_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/notebooks/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MOCKS_MOCK_NOTEBOOK_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MOCKS_MOCK_NOTEBOOK_CONNECTION_H - -#include "google/cloud/notebooks/notebook_connection.h" -#include "google/cloud/notebooks/v1/mocks/mock_notebook_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in notebooks_v1_mocks instead of the aliases -/// defined in this namespace. -namespace notebooks_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use notebooks_v1_mocks::MockNotebookServiceConnection directly. -using ::google::cloud::notebooks_v1_mocks::MockNotebookServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace notebooks_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MOCKS_MOCK_NOTEBOOK_CONNECTION_H diff --git a/google/cloud/notebooks/notebook_client.h b/google/cloud/notebooks/notebook_client.h deleted file mode 100644 index 920b20f87f608..0000000000000 --- a/google/cloud/notebooks/notebook_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/notebooks/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_NOTEBOOK_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_NOTEBOOK_CLIENT_H - -#include "google/cloud/notebooks/notebook_connection.h" -#include "google/cloud/notebooks/v1/notebook_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in notebooks_v1 instead of the aliases defined in -/// this namespace. -namespace notebooks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use notebooks_v1::NotebookServiceClient directly. -using ::google::cloud::notebooks_v1::NotebookServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace notebooks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_NOTEBOOK_CLIENT_H diff --git a/google/cloud/notebooks/notebook_connection.h b/google/cloud/notebooks/notebook_connection.h deleted file mode 100644 index d3ea3c268ae79..0000000000000 --- a/google/cloud/notebooks/notebook_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/notebooks/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_NOTEBOOK_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_NOTEBOOK_CONNECTION_H - -#include "google/cloud/notebooks/notebook_connection_idempotency_policy.h" -#include "google/cloud/notebooks/v1/notebook_connection.h" - -namespace google { -namespace cloud { -namespace notebooks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use notebooks_v1::MakeNotebookServiceConnection directly. -using ::google::cloud::notebooks_v1::MakeNotebookServiceConnection; - -/// @deprecated Use notebooks_v1::NotebookServiceConnection directly. -using ::google::cloud::notebooks_v1::NotebookServiceConnection; - -/// @deprecated Use notebooks_v1::NotebookServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::notebooks_v1:: - NotebookServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use notebooks_v1::NotebookServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::notebooks_v1::NotebookServiceLimitedTimeRetryPolicy; - -/// @deprecated Use notebooks_v1::NotebookServiceRetryPolicy directly. -using ::google::cloud::notebooks_v1::NotebookServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace notebooks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_NOTEBOOK_CONNECTION_H diff --git a/google/cloud/notebooks/notebook_connection_idempotency_policy.h b/google/cloud/notebooks/notebook_connection_idempotency_policy.h deleted file mode 100644 index 116f0c2654765..0000000000000 --- a/google/cloud/notebooks/notebook_connection_idempotency_policy.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/notebooks/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_NOTEBOOK_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_NOTEBOOK_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/notebooks/v1/notebook_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace notebooks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// notebooks_v1::MakeDefaultNotebookServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::notebooks_v1:: - MakeDefaultNotebookServiceConnectionIdempotencyPolicy; - -/// @deprecated Use notebooks_v1::NotebookServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::notebooks_v1::NotebookServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace notebooks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_NOTEBOOK_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/notebooks/notebook_options.h b/google/cloud/notebooks/notebook_options.h deleted file mode 100644 index 8e736eddcd4e4..0000000000000 --- a/google/cloud/notebooks/notebook_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/notebooks/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_NOTEBOOK_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_NOTEBOOK_OPTIONS_H - -#include "google/cloud/notebooks/notebook_connection.h" -#include "google/cloud/notebooks/notebook_connection_idempotency_policy.h" -#include "google/cloud/notebooks/v1/notebook_options.h" - -namespace google { -namespace cloud { -namespace notebooks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use notebooks_v1::NotebookServicePollingPolicyOption directly. -using ::google::cloud::notebooks_v1::NotebookServicePollingPolicyOption; - -/// @deprecated Use notebooks_v1::NotebookServiceBackoffPolicyOption directly. -using ::google::cloud::notebooks_v1::NotebookServiceBackoffPolicyOption; - -/// @deprecated Use -/// notebooks_v1::NotebookServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::notebooks_v1:: - NotebookServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use notebooks_v1::NotebookServicePolicyOptionList directly. -using ::google::cloud::notebooks_v1::NotebookServicePolicyOptionList; - -/// @deprecated Use notebooks_v1::NotebookServiceRetryPolicyOption directly. -using ::google::cloud::notebooks_v1::NotebookServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace notebooks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_NOTEBOOK_OPTIONS_H diff --git a/google/cloud/notebooks/quickstart/.bazelrc b/google/cloud/notebooks/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/notebooks/quickstart/.bazelrc +++ b/google/cloud/notebooks/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/notebooks/quickstart/CMakeLists.txt index 5df74636721ff..558ce73793a6c 100644 --- a/google/cloud/notebooks/quickstart/CMakeLists.txt +++ b/google/cloud/notebooks/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Notebooks API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-notebooks-quickstart CXX) find_package(google_cloud_cpp_notebooks REQUIRED) diff --git a/google/cloud/notebooks/quickstart/WORKSPACE.bazel b/google/cloud/notebooks/quickstart/WORKSPACE.bazel index 1630bd5fb82ce..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 = "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/notebooks/v1/internal/managed_notebook_auth_decorator.cc b/google/cloud/notebooks/v1/internal/managed_notebook_auth_decorator.cc index 0085878d73413..6bdb1629feccf 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_auth_decorator.cc +++ b/google/cloud/notebooks/v1/internal/managed_notebook_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/notebooks/v1/managed_service.proto #include "google/cloud/notebooks/v1/internal/managed_notebook_auth_decorator.h" -#include +#include "google/cloud/notebooks/v1/managed_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v1_internal { @@ -466,3 +469,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_auth_decorator.h b/google/cloud/notebooks/v1/internal/managed_notebook_auth_decorator.h index 583354fc681bf..638a200f2151d 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_auth_decorator.h +++ b/google/cloud/notebooks/v1/internal/managed_notebook_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/notebooks/v1/internal/managed_notebook_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 notebooks_v1_internal { @@ -230,4 +233,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_MANAGED_NOTEBOOK_AUTH_DECORATOR_H diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_connection_impl.h b/google/cloud/notebooks/v1/internal/managed_notebook_connection_impl.h index c73f99ea8e637..a7def763692c7 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_connection_impl.h +++ b/google/cloud/notebooks/v1/internal/managed_notebook_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_logging_decorator.cc b/google/cloud/notebooks/v1/internal/managed_notebook_logging_decorator.cc index f593ff2b8f30e..bbebfdfa699d6 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_logging_decorator.cc +++ b/google/cloud/notebooks/v1/internal/managed_notebook_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/notebooks/v1/managed_service.proto #include "google/cloud/notebooks/v1/internal/managed_notebook_logging_decorator.h" +#include "google/cloud/notebooks/v1/managed_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v1_internal { @@ -530,3 +533,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_logging_decorator.h b/google/cloud/notebooks/v1/internal/managed_notebook_logging_decorator.h index e9d9b8fbdf5ff..4b1cd0726ad25 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_logging_decorator.h +++ b/google/cloud/notebooks/v1/internal/managed_notebook_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/notebooks/v1/internal/managed_notebook_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 notebooks_v1_internal { @@ -230,4 +233,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_MANAGED_NOTEBOOK_LOGGING_DECORATOR_H diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_metadata_decorator.cc b/google/cloud/notebooks/v1/internal/managed_notebook_metadata_decorator.cc index bc370e7e72951..2cbbadb407413 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_metadata_decorator.cc +++ b/google/cloud/notebooks/v1/internal/managed_notebook_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/notebooks/v1/managed_service.proto #include "google/cloud/notebooks/v1/internal/managed_notebook_metadata_decorator.h" +#include "google/cloud/notebooks/v1/managed_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 notebooks_v1_internal { @@ -404,3 +408,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_metadata_decorator.h b/google/cloud/notebooks/v1/internal/managed_notebook_metadata_decorator.h index 70a0172f75fd3..a4fc5583fe4fd 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_metadata_decorator.h +++ b/google/cloud/notebooks/v1/internal/managed_notebook_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/notebooks/v1/internal/managed_notebook_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 notebooks_v1_internal { @@ -236,4 +239,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_MANAGED_NOTEBOOK_METADATA_DECORATOR_H diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_option_defaults.cc b/google/cloud/notebooks/v1/internal/managed_notebook_option_defaults.cc index 5bd94b3cd73e3..4da89aeb95011 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_option_defaults.cc +++ b/google/cloud/notebooks/v1/internal/managed_notebook_option_defaults.cc @@ -42,7 +42,7 @@ Options ManagedNotebookServiceDefaultOptions(Options options) { if (!options.has()) { options.set( notebooks_v1::ManagedNotebookServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_stub.cc b/google/cloud/notebooks/v1/internal/managed_notebook_stub.cc index e473ecbc92f22..ecbe862cf698f 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_stub.cc +++ b/google/cloud/notebooks/v1/internal/managed_notebook_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/notebooks/v1/managed_service.proto #include "google/cloud/notebooks/v1/internal/managed_notebook_stub.h" +#include "google/cloud/notebooks/v1/managed_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v1_internal { @@ -521,3 +524,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_stub.h b/google/cloud/notebooks/v1/internal/managed_notebook_stub.h index a98bcc7f14043..6b9effa7b8c42 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_stub.h +++ b/google/cloud/notebooks/v1/internal/managed_notebook_stub.h @@ -19,19 +19,22 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_MANAGED_NOTEBOOK_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_MANAGED_NOTEBOOK_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/notebooks/v1/managed_service.grpc.pb.h" +#include "google/cloud/notebooks/v1/service.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 -#include -#include -#include -#include +#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 notebooks_v1_internal { @@ -424,4 +427,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_MANAGED_NOTEBOOK_STUB_H diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_stub_factory.cc b/google/cloud/notebooks/v1/internal/managed_notebook_stub_factory.cc index 1c0604fc72f8d..5108bc011af4a 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_stub_factory.cc +++ b/google/cloud/notebooks/v1/internal/managed_notebook_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/notebooks/v1/managed_service.proto #include "google/cloud/notebooks/v1/internal/managed_notebook_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/notebooks/v1/internal/managed_notebook_auth_decorator.h" #include "google/cloud/notebooks/v1/internal/managed_notebook_logging_decorator.h" #include "google/cloud/notebooks/v1/internal/managed_notebook_metadata_decorator.h" #include "google/cloud/notebooks/v1/internal/managed_notebook_stub.h" #include "google/cloud/notebooks/v1/internal/managed_notebook_tracing_stub.h" +#include "google/cloud/notebooks/v1/managed_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 -#include -#include -#include +#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 notebooks_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_stub_factory.h b/google/cloud/notebooks/v1/internal/managed_notebook_stub_factory.h index 78148a72bf6be..51a0f7132872c 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_stub_factory.h +++ b/google/cloud/notebooks/v1/internal/managed_notebook_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_MANAGED_NOTEBOOK_STUB_FACTORY_H diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_tracing_connection.cc b/google/cloud/notebooks/v1/internal/managed_notebook_tracing_connection.cc index de9314c009ea6..bda7f084bbe1b 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_tracing_connection.cc +++ b/google/cloud/notebooks/v1/internal/managed_notebook_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace notebooks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ManagedNotebookServiceTracingConnection:: ManagedNotebookServiceTracingConnection( std::shared_ptr child) @@ -433,17 +431,13 @@ Status ManagedNotebookServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeManagedNotebookServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_tracing_connection.h b/google/cloud/notebooks/v1/internal/managed_notebook_tracing_connection.h index 3d4a1d88e0f52..288e73b1b49be 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_tracing_connection.h +++ b/google/cloud/notebooks/v1/internal/managed_notebook_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace notebooks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ManagedNotebookServiceTracingConnection : public notebooks_v1::ManagedNotebookServiceConnection { public: @@ -200,8 +198,6 @@ class ManagedNotebookServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_tracing_stub.cc b/google/cloud/notebooks/v1/internal/managed_notebook_tracing_stub.cc index 0145be708ecd5..07445d3c8a25d 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_tracing_stub.cc +++ b/google/cloud/notebooks/v1/internal/managed_notebook_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ManagedNotebookServiceTracingStub::ManagedNotebookServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -468,19 +469,15 @@ future ManagedNotebookServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeManagedNotebookServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v1/internal/managed_notebook_tracing_stub.h b/google/cloud/notebooks/v1/internal/managed_notebook_tracing_stub.h index d267092bb351d..1c65a40401b04 100644 --- a/google/cloud/notebooks/v1/internal/managed_notebook_tracing_stub.h +++ b/google/cloud/notebooks/v1/internal/managed_notebook_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ManagedNotebookServiceTracingStub : public ManagedNotebookServiceStub { public: ~ManagedNotebookServiceTracingStub() override = default; @@ -226,8 +227,6 @@ class ManagedNotebookServiceTracingStub : public ManagedNotebookServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -243,4 +242,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_MANAGED_NOTEBOOK_TRACING_STUB_H diff --git a/google/cloud/notebooks/v1/internal/notebook_auth_decorator.cc b/google/cloud/notebooks/v1/internal/notebook_auth_decorator.cc index f2217ffa394bf..e7c8a60473dc0 100644 --- a/google/cloud/notebooks/v1/internal/notebook_auth_decorator.cc +++ b/google/cloud/notebooks/v1/internal/notebook_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/notebooks/v1/service.proto #include "google/cloud/notebooks/v1/internal/notebook_auth_decorator.h" -#include +#include "google/cloud/notebooks/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v1_internal { @@ -904,3 +907,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v1/internal/notebook_auth_decorator.h b/google/cloud/notebooks/v1/internal/notebook_auth_decorator.h index 77d438e9ac3c2..c9d7d6bdf34d3 100644 --- a/google/cloud/notebooks/v1/internal/notebook_auth_decorator.h +++ b/google/cloud/notebooks/v1/internal/notebook_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/notebooks/v1/internal/notebook_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 notebooks_v1_internal { @@ -430,4 +433,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_NOTEBOOK_AUTH_DECORATOR_H diff --git a/google/cloud/notebooks/v1/internal/notebook_connection_impl.h b/google/cloud/notebooks/v1/internal/notebook_connection_impl.h index 724dae3ee8ca7..b0b7ce72e629d 100644 --- a/google/cloud/notebooks/v1/internal/notebook_connection_impl.h +++ b/google/cloud/notebooks/v1/internal/notebook_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/notebooks/v1/internal/notebook_logging_decorator.cc b/google/cloud/notebooks/v1/internal/notebook_logging_decorator.cc index 3d04ce2cc28bb..d962af55bac35 100644 --- a/google/cloud/notebooks/v1/internal/notebook_logging_decorator.cc +++ b/google/cloud/notebooks/v1/internal/notebook_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/notebooks/v1/service.proto #include "google/cloud/notebooks/v1/internal/notebook_logging_decorator.h" +#include "google/cloud/notebooks/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v1_internal { @@ -1052,3 +1055,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v1/internal/notebook_logging_decorator.h b/google/cloud/notebooks/v1/internal/notebook_logging_decorator.h index 56b4043a53428..8d372ee5d94ae 100644 --- a/google/cloud/notebooks/v1/internal/notebook_logging_decorator.h +++ b/google/cloud/notebooks/v1/internal/notebook_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/notebooks/v1/internal/notebook_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 notebooks_v1_internal { @@ -430,4 +433,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_NOTEBOOK_LOGGING_DECORATOR_H diff --git a/google/cloud/notebooks/v1/internal/notebook_metadata_decorator.cc b/google/cloud/notebooks/v1/internal/notebook_metadata_decorator.cc index 774de3c20653f..3dcc384785edc 100644 --- a/google/cloud/notebooks/v1/internal/notebook_metadata_decorator.cc +++ b/google/cloud/notebooks/v1/internal/notebook_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/notebooks/v1/service.proto #include "google/cloud/notebooks/v1/internal/notebook_metadata_decorator.h" +#include "google/cloud/notebooks/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 notebooks_v1_internal { @@ -752,3 +756,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v1/internal/notebook_metadata_decorator.h b/google/cloud/notebooks/v1/internal/notebook_metadata_decorator.h index 2c8df58bd0ebb..e25f71e2ec3a2 100644 --- a/google/cloud/notebooks/v1/internal/notebook_metadata_decorator.h +++ b/google/cloud/notebooks/v1/internal/notebook_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/notebooks/v1/internal/notebook_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 notebooks_v1_internal { @@ -436,4 +439,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_NOTEBOOK_METADATA_DECORATOR_H diff --git a/google/cloud/notebooks/v1/internal/notebook_option_defaults.cc b/google/cloud/notebooks/v1/internal/notebook_option_defaults.cc index 8bb55f4830433..07bf04a8d6625 100644 --- a/google/cloud/notebooks/v1/internal/notebook_option_defaults.cc +++ b/google/cloud/notebooks/v1/internal/notebook_option_defaults.cc @@ -42,7 +42,7 @@ Options NotebookServiceDefaultOptions(Options options) { if (!options.has()) { options.set( notebooks_v1::NotebookServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/notebooks/v1/internal/notebook_stub.cc b/google/cloud/notebooks/v1/internal/notebook_stub.cc index eb80157d20d38..060a6be72d131 100644 --- a/google/cloud/notebooks/v1/internal/notebook_stub.cc +++ b/google/cloud/notebooks/v1/internal/notebook_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/notebooks/v1/service.proto #include "google/cloud/notebooks/v1/internal/notebook_stub.h" +#include "google/cloud/notebooks/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v1_internal { @@ -1032,3 +1035,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v1/internal/notebook_stub.h b/google/cloud/notebooks/v1/internal/notebook_stub.h index da6aa06364115..e5d970a27661f 100644 --- a/google/cloud/notebooks/v1/internal/notebook_stub.h +++ b/google/cloud/notebooks/v1/internal/notebook_stub.h @@ -19,19 +19,22 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_NOTEBOOK_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_NOTEBOOK_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/notebooks/v1/service.grpc.pb.h" +#include "google/cloud/notebooks/v1/service.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 -#include -#include -#include -#include +#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 notebooks_v1_internal { @@ -819,4 +822,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_NOTEBOOK_STUB_H diff --git a/google/cloud/notebooks/v1/internal/notebook_stub_factory.cc b/google/cloud/notebooks/v1/internal/notebook_stub_factory.cc index 03e413caae60e..a6b4df01a913b 100644 --- a/google/cloud/notebooks/v1/internal/notebook_stub_factory.cc +++ b/google/cloud/notebooks/v1/internal/notebook_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/notebooks/v1/service.proto #include "google/cloud/notebooks/v1/internal/notebook_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/notebooks/v1/internal/notebook_auth_decorator.h" #include "google/cloud/notebooks/v1/internal/notebook_logging_decorator.h" #include "google/cloud/notebooks/v1/internal/notebook_metadata_decorator.h" #include "google/cloud/notebooks/v1/internal/notebook_stub.h" #include "google/cloud/notebooks/v1/internal/notebook_tracing_stub.h" +#include "google/cloud/notebooks/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 -#include -#include -#include +#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 notebooks_v1_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v1/internal/notebook_stub_factory.h b/google/cloud/notebooks/v1/internal/notebook_stub_factory.h index b1d366a473994..9274306f5ef72 100644 --- a/google/cloud/notebooks/v1/internal/notebook_stub_factory.h +++ b/google/cloud/notebooks/v1/internal/notebook_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_NOTEBOOK_STUB_FACTORY_H diff --git a/google/cloud/notebooks/v1/internal/notebook_tracing_connection.cc b/google/cloud/notebooks/v1/internal/notebook_tracing_connection.cc index c9dfcafa248fa..5e9d483df5897 100644 --- a/google/cloud/notebooks/v1/internal/notebook_tracing_connection.cc +++ b/google/cloud/notebooks/v1/internal/notebook_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace notebooks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NotebookServiceTracingConnection::NotebookServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -915,16 +913,12 @@ Status NotebookServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNotebookServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/notebooks/v1/internal/notebook_tracing_connection.h b/google/cloud/notebooks/v1/internal/notebook_tracing_connection.h index f37f037a2a6a0..6c46b2914ccae 100644 --- a/google/cloud/notebooks/v1/internal/notebook_tracing_connection.h +++ b/google/cloud/notebooks/v1/internal/notebook_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace notebooks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NotebookServiceTracingConnection : public notebooks_v1::NotebookServiceConnection { public: @@ -397,8 +395,6 @@ class NotebookServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/notebooks/v1/internal/notebook_tracing_stub.cc b/google/cloud/notebooks/v1/internal/notebook_tracing_stub.cc index f4e68db60c46a..e8a49d45d161c 100644 --- a/google/cloud/notebooks/v1/internal/notebook_tracing_stub.cc +++ b/google/cloud/notebooks/v1/internal/notebook_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NotebookServiceTracingStub::NotebookServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -931,18 +932,14 @@ future NotebookServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNotebookServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v1/internal/notebook_tracing_stub.h b/google/cloud/notebooks/v1/internal/notebook_tracing_stub.h index e4e85e9e22d89..67b91614c33f0 100644 --- a/google/cloud/notebooks/v1/internal/notebook_tracing_stub.h +++ b/google/cloud/notebooks/v1/internal/notebook_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NotebookServiceTracingStub : public NotebookServiceStub { public: ~NotebookServiceTracingStub() override = default; @@ -426,8 +427,6 @@ class NotebookServiceTracingStub : public NotebookServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -442,4 +441,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_INTERNAL_NOTEBOOK_TRACING_STUB_H diff --git a/google/cloud/notebooks/v1/managed_notebook_client.h b/google/cloud/notebooks/v1/managed_notebook_client.h index d99436ba1d942..c8516bbd45c77 100644 --- a/google/cloud/notebooks/v1/managed_notebook_client.h +++ b/google/cloud/notebooks/v1/managed_notebook_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/managed_notebook_connection.h b/google/cloud/notebooks/v1/managed_notebook_connection.h index e792b6bc98885..9880e9028bb8e 100644 --- a/google/cloud/notebooks/v1/managed_notebook_connection.h +++ b/google/cloud/notebooks/v1/managed_notebook_connection.h @@ -21,6 +21,8 @@ #include "google/cloud/notebooks/v1/internal/managed_notebook_retry_traits.h" #include "google/cloud/notebooks/v1/managed_notebook_connection_idempotency_policy.h" +#include "google/cloud/notebooks/v1/managed_service.pb.h" +#include "google/cloud/notebooks/v1/service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,9 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/notebooks/v1/managed_notebook_connection_idempotency_policy.h b/google/cloud/notebooks/v1/managed_notebook_connection_idempotency_policy.h index 814c370d2a44c..f86f4b4141b2e 100644 --- a/google/cloud/notebooks/v1/managed_notebook_connection_idempotency_policy.h +++ b/google/cloud/notebooks/v1/managed_notebook_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_MANAGED_NOTEBOOK_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_MANAGED_NOTEBOOK_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/notebooks/v1/managed_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/notebooks/v1/notebook_client.h b/google/cloud/notebooks/v1/notebook_client.h index 1a99a48313fd5..88bd4c7b3b8d4 100644 --- a/google/cloud/notebooks/v1/notebook_client.h +++ b/google/cloud/notebooks/v1/notebook_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/v1/notebook_connection.h b/google/cloud/notebooks/v1/notebook_connection.h index 2af16793a5c7a..ef2f230794f1e 100644 --- a/google/cloud/notebooks/v1/notebook_connection.h +++ b/google/cloud/notebooks/v1/notebook_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/notebooks/v1/internal/notebook_retry_traits.h" #include "google/cloud/notebooks/v1/notebook_connection_idempotency_policy.h" +#include "google/cloud/notebooks/v1/service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/notebooks/v1/notebook_connection_idempotency_policy.h b/google/cloud/notebooks/v1/notebook_connection_idempotency_policy.h index 0b6c2d38e4078..8e315025d4950 100644 --- a/google/cloud/notebooks/v1/notebook_connection_idempotency_policy.h +++ b/google/cloud/notebooks/v1/notebook_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_NOTEBOOK_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V1_NOTEBOOK_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/notebooks/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/notebooks/v2/internal/notebook_auth_decorator.cc b/google/cloud/notebooks/v2/internal/notebook_auth_decorator.cc index d427e48a6290a..f4658c21b1dd6 100644 --- a/google/cloud/notebooks/v2/internal/notebook_auth_decorator.cc +++ b/google/cloud/notebooks/v2/internal/notebook_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/notebooks/v2/service.proto #include "google/cloud/notebooks/v2/internal/notebook_auth_decorator.h" -#include +#include "google/cloud/notebooks/v2/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v2_internal { @@ -426,3 +429,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v2/internal/notebook_auth_decorator.h b/google/cloud/notebooks/v2/internal/notebook_auth_decorator.h index 93172b35dcf72..4557fe713f147 100644 --- a/google/cloud/notebooks/v2/internal/notebook_auth_decorator.h +++ b/google/cloud/notebooks/v2/internal/notebook_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/notebooks/v2/internal/notebook_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 notebooks_v2_internal { @@ -220,4 +223,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V2_INTERNAL_NOTEBOOK_AUTH_DECORATOR_H diff --git a/google/cloud/notebooks/v2/internal/notebook_connection_impl.h b/google/cloud/notebooks/v2/internal/notebook_connection_impl.h index 01c855a3dd52a..0fc80c6648ab1 100644 --- a/google/cloud/notebooks/v2/internal/notebook_connection_impl.h +++ b/google/cloud/notebooks/v2/internal/notebook_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/notebooks/v2/internal/notebook_logging_decorator.cc b/google/cloud/notebooks/v2/internal/notebook_logging_decorator.cc index 4a8aa38a0f015..f166b1a42e921 100644 --- a/google/cloud/notebooks/v2/internal/notebook_logging_decorator.cc +++ b/google/cloud/notebooks/v2/internal/notebook_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/notebooks/v2/service.proto #include "google/cloud/notebooks/v2/internal/notebook_logging_decorator.h" +#include "google/cloud/notebooks/v2/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v2_internal { @@ -496,3 +499,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v2/internal/notebook_logging_decorator.h b/google/cloud/notebooks/v2/internal/notebook_logging_decorator.h index fbb9c01dcb892..4b44ca97aa9e2 100644 --- a/google/cloud/notebooks/v2/internal/notebook_logging_decorator.h +++ b/google/cloud/notebooks/v2/internal/notebook_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/notebooks/v2/internal/notebook_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 notebooks_v2_internal { @@ -220,4 +223,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V2_INTERNAL_NOTEBOOK_LOGGING_DECORATOR_H diff --git a/google/cloud/notebooks/v2/internal/notebook_metadata_decorator.cc b/google/cloud/notebooks/v2/internal/notebook_metadata_decorator.cc index 6c40195db01a4..78bc1087485f3 100644 --- a/google/cloud/notebooks/v2/internal/notebook_metadata_decorator.cc +++ b/google/cloud/notebooks/v2/internal/notebook_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/notebooks/v2/service.proto #include "google/cloud/notebooks/v2/internal/notebook_metadata_decorator.h" +#include "google/cloud/notebooks/v2/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 notebooks_v2_internal { @@ -380,3 +384,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v2/internal/notebook_metadata_decorator.h b/google/cloud/notebooks/v2/internal/notebook_metadata_decorator.h index 9390f99263324..ae62fb5a8b3a3 100644 --- a/google/cloud/notebooks/v2/internal/notebook_metadata_decorator.h +++ b/google/cloud/notebooks/v2/internal/notebook_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/notebooks/v2/internal/notebook_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 notebooks_v2_internal { @@ -226,4 +229,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V2_INTERNAL_NOTEBOOK_METADATA_DECORATOR_H diff --git a/google/cloud/notebooks/v2/internal/notebook_option_defaults.cc b/google/cloud/notebooks/v2/internal/notebook_option_defaults.cc index e95b4663c0dfc..be1b9a06b294f 100644 --- a/google/cloud/notebooks/v2/internal/notebook_option_defaults.cc +++ b/google/cloud/notebooks/v2/internal/notebook_option_defaults.cc @@ -42,7 +42,7 @@ Options NotebookServiceDefaultOptions(Options options) { if (!options.has()) { options.set( notebooks_v2::NotebookServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/notebooks/v2/internal/notebook_stub.cc b/google/cloud/notebooks/v2/internal/notebook_stub.cc index 28e67e0ae555d..c86d22f6307bc 100644 --- a/google/cloud/notebooks/v2/internal/notebook_stub.cc +++ b/google/cloud/notebooks/v2/internal/notebook_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/notebooks/v2/service.proto #include "google/cloud/notebooks/v2/internal/notebook_stub.h" +#include "google/cloud/notebooks/v2/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v2_internal { @@ -490,3 +493,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v2/internal/notebook_stub.h b/google/cloud/notebooks/v2/internal/notebook_stub.h index 704d2a52c1684..c6a5d0c48bb7c 100644 --- a/google/cloud/notebooks/v2/internal/notebook_stub.h +++ b/google/cloud/notebooks/v2/internal/notebook_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V2_INTERNAL_NOTEBOOK_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V2_INTERNAL_NOTEBOOK_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/notebooks/v2/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 -#include -#include -#include +#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 notebooks_v2_internal { @@ -401,4 +404,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V2_INTERNAL_NOTEBOOK_STUB_H diff --git a/google/cloud/notebooks/v2/internal/notebook_stub_factory.cc b/google/cloud/notebooks/v2/internal/notebook_stub_factory.cc index 27da3d3f19bd1..bb3cb1872d19a 100644 --- a/google/cloud/notebooks/v2/internal/notebook_stub_factory.cc +++ b/google/cloud/notebooks/v2/internal/notebook_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/notebooks/v2/service.proto #include "google/cloud/notebooks/v2/internal/notebook_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/notebooks/v2/internal/notebook_auth_decorator.h" #include "google/cloud/notebooks/v2/internal/notebook_logging_decorator.h" #include "google/cloud/notebooks/v2/internal/notebook_metadata_decorator.h" #include "google/cloud/notebooks/v2/internal/notebook_stub.h" #include "google/cloud/notebooks/v2/internal/notebook_tracing_stub.h" +#include "google/cloud/notebooks/v2/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 -#include -#include -#include +#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 notebooks_v2_internal { @@ -78,3 +81,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v2/internal/notebook_stub_factory.h b/google/cloud/notebooks/v2/internal/notebook_stub_factory.h index c82ebb2d1b0e6..8301e9137bef0 100644 --- a/google/cloud/notebooks/v2/internal/notebook_stub_factory.h +++ b/google/cloud/notebooks/v2/internal/notebook_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V2_INTERNAL_NOTEBOOK_STUB_FACTORY_H diff --git a/google/cloud/notebooks/v2/internal/notebook_tracing_connection.cc b/google/cloud/notebooks/v2/internal/notebook_tracing_connection.cc index a8dd89301de3e..e82a62d77714e 100644 --- a/google/cloud/notebooks/v2/internal/notebook_tracing_connection.cc +++ b/google/cloud/notebooks/v2/internal/notebook_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace notebooks_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NotebookServiceTracingConnection::NotebookServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -406,16 +404,12 @@ Status NotebookServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNotebookServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/notebooks/v2/internal/notebook_tracing_connection.h b/google/cloud/notebooks/v2/internal/notebook_tracing_connection.h index 731b10c943177..1627dae0cb8c6 100644 --- a/google/cloud/notebooks/v2/internal/notebook_tracing_connection.h +++ b/google/cloud/notebooks/v2/internal/notebook_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace notebooks_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NotebookServiceTracingConnection : public notebooks_v2::NotebookServiceConnection { public: @@ -190,8 +188,6 @@ class NotebookServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/notebooks/v2/internal/notebook_tracing_stub.cc b/google/cloud/notebooks/v2/internal/notebook_tracing_stub.cc index ccd2d9466602c..7bac272a18bea 100644 --- a/google/cloud/notebooks/v2/internal/notebook_tracing_stub.cc +++ b/google/cloud/notebooks/v2/internal/notebook_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - NotebookServiceTracingStub::NotebookServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -443,18 +444,14 @@ future NotebookServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeNotebookServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace notebooks_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/notebooks/v2/internal/notebook_tracing_stub.h b/google/cloud/notebooks/v2/internal/notebook_tracing_stub.h index 983cb55e315fc..a147c4ae324c5 100644 --- a/google/cloud/notebooks/v2/internal/notebook_tracing_stub.h +++ b/google/cloud/notebooks/v2/internal/notebook_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace notebooks_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class NotebookServiceTracingStub : public NotebookServiceStub { public: ~NotebookServiceTracingStub() override = default; @@ -216,8 +217,6 @@ class NotebookServiceTracingStub : public NotebookServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -232,4 +231,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V2_INTERNAL_NOTEBOOK_TRACING_STUB_H diff --git a/google/cloud/notebooks/v2/notebook_client.h b/google/cloud/notebooks/v2/notebook_client.h index f2bee21d195be..51be272f492a0 100644 --- a/google/cloud/notebooks/v2/notebook_client.h +++ b/google/cloud/notebooks/v2/notebook_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/notebooks/v2/notebook_connection.h b/google/cloud/notebooks/v2/notebook_connection.h index 92cd6bb84383f..33a411f49d9ec 100644 --- a/google/cloud/notebooks/v2/notebook_connection.h +++ b/google/cloud/notebooks/v2/notebook_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/notebooks/v2/internal/notebook_retry_traits.h" #include "google/cloud/notebooks/v2/notebook_connection_idempotency_policy.h" +#include "google/cloud/notebooks/v2/service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/notebooks/v2/notebook_connection_idempotency_policy.h b/google/cloud/notebooks/v2/notebook_connection_idempotency_policy.h index 74754bd4ab416..0e8d467507c49 100644 --- a/google/cloud/notebooks/v2/notebook_connection_idempotency_policy.h +++ b/google/cloud/notebooks/v2/notebook_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V2_NOTEBOOK_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_V2_NOTEBOOK_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/notebooks/v2/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/oauth2/BUILD.bazel b/google/cloud/oauth2/BUILD.bazel index 9c183403236b5..b5b3f4d2d7c19 100644 --- a/google/cloud/oauth2/BUILD.bazel +++ b/google/cloud/oauth2/BUILD.bazel @@ -43,6 +43,6 @@ cc_library( ":google_cloud_cpp_oauth2", "//google/cloud/testing_util:google_cloud_cpp_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_rest_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in google_cloud_cpp_oauth2_unit_tests] 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/CMakeLists.txt b/google/cloud/oauth2/quickstart/CMakeLists.txt index 1966e8f434298..ba89f75dee204 100644 --- a/google/cloud/oauth2/quickstart/CMakeLists.txt +++ b/google/cloud/oauth2/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the OAuth2 Access Token Generation library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-oauth2-quickstart CXX) find_package(google_cloud_cpp_oauth2 REQUIRED) diff --git a/google/cloud/oauth2/quickstart/WORKSPACE.bazel b/google/cloud/oauth2/quickstart/WORKSPACE.bazel index 630c897dd6e25..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 = "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/opentelemetry/BUILD.bazel b/google/cloud/opentelemetry/BUILD.bazel index c47262a611ebd..08065ff265602 100644 --- a/google/cloud/opentelemetry/BUILD.bazel +++ b/google/cloud/opentelemetry/BUILD.bazel @@ -34,8 +34,8 @@ cc_library( "//:monitoring", "//:trace", "//google/cloud:google_cloud_cpp_rest_internal", - "@io_opentelemetry_cpp//sdk/src/metrics", - "@io_opentelemetry_cpp//sdk/src/trace", + "@opentelemetry-cpp//sdk/src/metrics", + "@opentelemetry-cpp//sdk/src/trace", ], ) diff --git a/google/cloud/opentelemetry/integration_tests/BUILD.bazel b/google/cloud/opentelemetry/integration_tests/BUILD.bazel index ab46542ae62dd..592eff7d7dfac 100644 --- a/google/cloud/opentelemetry/integration_tests/BUILD.bazel +++ b/google/cloud/opentelemetry/integration_tests/BUILD.bazel @@ -27,6 +27,6 @@ licenses(["notice"]) # Apache 2.0 "//:opentelemetry", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in opentelemetry_integration_tests] diff --git a/google/cloud/opentelemetry/integration_tests/configure_basic_tracing_integration_test.cc b/google/cloud/opentelemetry/integration_tests/configure_basic_tracing_integration_test.cc index ba8a8e9e8167e..63cecebcaba3a 100644 --- a/google/cloud/opentelemetry/integration_tests/configure_basic_tracing_integration_test.cc +++ b/google/cloud/opentelemetry/integration_tests/configure_basic_tracing_integration_test.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/opentelemetry/configure_basic_tracing.h" #include "google/cloud/trace/v1/trace_client.h" #include "google/cloud/internal/getenv.h" @@ -160,4 +159,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace otel } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/opentelemetry/integration_tests/monitoring_exporter_integration_test.cc b/google/cloud/opentelemetry/integration_tests/monitoring_exporter_integration_test.cc index 8c93dbd9fdc2d..e962f31f48b25 100644 --- a/google/cloud/opentelemetry/integration_tests/monitoring_exporter_integration_test.cc +++ b/google/cloud/opentelemetry/integration_tests/monitoring_exporter_integration_test.cc @@ -28,7 +28,7 @@ #include #include #include -#include +#include namespace google { namespace cloud { @@ -40,7 +40,7 @@ using ::testing::IsEmpty; using ::testing::Not; namespace metrics_api = ::opentelemetry::metrics; namespace metrics_sdk = ::opentelemetry::sdk::metrics; -namespace sc = opentelemetry::sdk::resource::SemanticConventions; +namespace sc = opentelemetry::semconv; auto constexpr kJobName = "monitoring_exporter_integration_test"; auto constexpr kMeterName = @@ -59,9 +59,9 @@ void InstallExporter(std::unique_ptr exporter, // attributes which will map to a `generic_task`, which seems apt for this // workflow. auto resource = opentelemetry::sdk::resource::Resource::Create( - {{sc::kServiceNamespace, "gl-cpp"}, - {sc::kServiceName, kJobName}, - {sc::kServiceInstanceId, task_id}}); + {{sc::service::kServiceNamespace, "gl-cpp"}, + {sc::service::kServiceName, kJobName}, + {sc::service::kServiceInstanceId, task_id}}); // Initialize and set the global MeterProvider metrics_sdk::PeriodicExportingMetricReaderOptions options; diff --git a/google/cloud/opentelemetry/internal/monitored_resource.cc b/google/cloud/opentelemetry/internal/monitored_resource.cc index 24c0c08e514c7..3e5c09c822c5a 100644 --- a/google/cloud/opentelemetry/internal/monitored_resource.cc +++ b/google/cloud/opentelemetry/internal/monitored_resource.cc @@ -13,17 +13,22 @@ // limitations under the License. #include "google/cloud/opentelemetry/internal/monitored_resource.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/version.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include "absl/types/optional.h" #include "absl/types/variant.h" #include #include -#include +#include +#include +#include +#include +#include #include #include #include +#include namespace google { namespace cloud { @@ -31,7 +36,7 @@ namespace otel_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { -namespace sc = opentelemetry::sdk::resource::SemanticConventions; +namespace sc = opentelemetry::semconv; struct AsStringVisitor { template @@ -86,22 +91,23 @@ class MonitoredResourceProvider { }; MonitoredResourceProvider GceInstance() { - return MonitoredResourceProvider("gce_instance", - { - {"zone", {{sc::kCloudAvailabilityZone}}}, - {"instance_id", {{sc::kHostId}}}, - }); + return MonitoredResourceProvider( + "gce_instance", { + {"zone", {{sc::cloud::kCloudAvailabilityZone}}}, + {"instance_id", {{sc::host::kHostId}}}, + }); } MonitoredResourceProvider K8sContainer() { return MonitoredResourceProvider( "k8s_container", { - {"location", {{sc::kCloudAvailabilityZone, sc::kCloudRegion}}}, - {"cluster_name", {{sc::kK8sClusterName}}}, - {"namespace_name", {{sc::kK8sNamespaceName}}}, - {"pod_name", {{sc::kK8sPodName}}}, - {"container_name", {{sc::kK8sContainerName}}}, + {"location", + {{sc::cloud::kCloudAvailabilityZone, sc::cloud::kCloudRegion}}}, + {"cluster_name", {{sc::k8s::kK8sClusterName}}}, + {"namespace_name", {{sc::k8s::kK8sNamespaceName}}}, + {"pod_name", {{sc::k8s::kK8sPodName}}}, + {"container_name", {{sc::k8s::kK8sContainerName}}}, }); } @@ -109,10 +115,11 @@ MonitoredResourceProvider K8sPod() { return MonitoredResourceProvider( "k8s_pod", { - {"location", {{sc::kCloudAvailabilityZone, sc::kCloudRegion}}}, - {"cluster_name", {{sc::kK8sClusterName}}}, - {"namespace_name", {{sc::kK8sNamespaceName}}}, - {"pod_name", {{sc::kK8sPodName}}}, + {"location", + {{sc::cloud::kCloudAvailabilityZone, sc::cloud::kCloudRegion}}}, + {"cluster_name", {{sc::k8s::kK8sClusterName}}}, + {"namespace_name", {{sc::k8s::kK8sNamespaceName}}}, + {"pod_name", {{sc::k8s::kK8sPodName}}}, }); } @@ -120,9 +127,10 @@ MonitoredResourceProvider K8sNode() { return MonitoredResourceProvider( "k8s_node", { - {"location", {{sc::kCloudAvailabilityZone, sc::kCloudRegion}}}, - {"cluster_name", {{sc::kK8sClusterName}}}, - {"node_name", {{sc::kK8sNodeName}}}, + {"location", + {{sc::cloud::kCloudAvailabilityZone, sc::cloud::kCloudRegion}}}, + {"cluster_name", {{sc::k8s::kK8sClusterName}}}, + {"node_name", {{sc::k8s::kK8sNodeName}}}, }); } @@ -130,8 +138,9 @@ MonitoredResourceProvider K8sCluster() { return MonitoredResourceProvider( "k8s_cluster", { - {"location", {{sc::kCloudAvailabilityZone, sc::kCloudRegion}}}, - {"cluster_name", {{sc::kK8sClusterName}}}, + {"location", + {{sc::cloud::kCloudAvailabilityZone, sc::cloud::kCloudRegion}}}, + {"cluster_name", {{sc::k8s::kK8sClusterName}}}, }); } @@ -139,10 +148,11 @@ MonitoredResourceProvider GaeInstance() { return MonitoredResourceProvider( "gae_instance", { - {"location", {{sc::kCloudAvailabilityZone, sc::kCloudRegion}}}, - {"module_id", {{sc::kFaasName}}}, - {"version_id", {{sc::kFaasVersion}}}, - {"instance_id", {{sc::kFaasInstance}}}, + {"location", + {{sc::cloud::kCloudAvailabilityZone, sc::cloud::kCloudRegion}}}, + {"module_id", {{sc::faas::kFaasName}}}, + {"version_id", {{sc::faas::kFaasVersion}}}, + {"instance_id", {{sc::faas::kFaasInstance}}}, }); } @@ -150,9 +160,10 @@ MonitoredResourceProvider AwsEc2Instance() { return MonitoredResourceProvider( "aws_ec2_instance", { - {"instance_id", {{sc::kHostId}}}, - {"region", {{sc::kCloudAvailabilityZone, sc::kCloudRegion}}}, - {"aws_account", {{sc::kCloudAccountId}}}, + {"instance_id", {{sc::host::kHostId}}}, + {"region", + {{sc::cloud::kCloudAvailabilityZone, sc::cloud::kCloudRegion}}}, + {"aws_account", {{sc::cloud::kCloudAccountId}}}, }); } @@ -161,10 +172,12 @@ MonitoredResourceProvider GenericTask() { "generic_task", { {"location", - {{sc::kCloudAvailabilityZone, sc::kCloudRegion}, "global"}}, - {"namespace", {{sc::kServiceNamespace}}}, - {"job", {{sc::kServiceName, sc::kFaasName}}}, - {"task_id", {{sc::kServiceInstanceId, sc::kFaasInstance}}}, + {{sc::cloud::kCloudAvailabilityZone, sc::cloud::kCloudRegion}, + "global"}}, + {"namespace", {{sc::service::kServiceNamespace}}}, + {"job", {{sc::service::kServiceName, sc::faas::kFaasName}}}, + {"task_id", + {{sc::service::kServiceInstanceId, sc::faas::kFaasInstance}}}, }); } @@ -173,9 +186,10 @@ MonitoredResourceProvider GenericNode() { "generic_node", { {"location", - {{sc::kCloudAvailabilityZone, sc::kCloudRegion}, "global"}}, - {"namespace", {{sc::kServiceNamespace}}}, - {"node_id", {{sc::kHostId, sc::kHostName}}}, + {{sc::cloud::kCloudAvailabilityZone, sc::cloud::kCloudRegion}, + "global"}}, + {"namespace", {{sc::service::kServiceNamespace}}}, + {"node_id", {{sc::host::kHostId, sc::host::kHostName}}}, }); } @@ -185,20 +199,20 @@ MonitoredResourceProvider GenericNode() { MonitoredResourceProvider MakeProvider( opentelemetry::sdk::resource::ResourceAttributes const& attributes) { std::string platform; - auto p = attributes.find(sc::kCloudPlatform); + auto p = attributes.find(sc::cloud::kCloudPlatform); if (p != attributes.end()) platform = AsString(p->second); if (platform == "gcp_compute_engine") { return GceInstance(); } if (platform == "gcp_kubernetes_engine") { - if (attributes.find(sc::kK8sContainerName) != attributes.end()) { + if (attributes.find(sc::k8s::kK8sContainerName) != attributes.end()) { return K8sContainer(); } - if (attributes.find(sc::kK8sPodName) != attributes.end()) { + if (attributes.find(sc::k8s::kK8sPodName) != attributes.end()) { return K8sPod(); } - if (attributes.find(sc::kK8sNodeName) != attributes.end()) { + if (attributes.find(sc::k8s::kK8sNodeName) != attributes.end()) { return K8sNode(); } return K8sCluster(); @@ -209,10 +223,10 @@ MonitoredResourceProvider MakeProvider( if (platform == "aws_ec2") { return AwsEc2Instance(); } - if ((attributes.find(sc::kServiceName) != attributes.end() && - attributes.find(sc::kServiceInstanceId) != attributes.end()) || - (attributes.find(sc::kFaasName) != attributes.end() && - attributes.find(sc::kFaasInstance) != attributes.end())) { + if ((attributes.find(sc::service::kServiceName) != attributes.end() && + attributes.find(sc::service::kServiceInstanceId) != attributes.end()) || + (attributes.find(sc::faas::kFaasName) != attributes.end() && + attributes.find(sc::faas::kFaasInstance) != attributes.end())) { return GenericTask(); } return GenericNode(); @@ -222,7 +236,7 @@ MonitoredResourceProvider MakeProvider( std::string AsString( opentelemetry::sdk::common::OwnedAttributeValue const& attribute) { - return absl::visit(AsStringVisitor{}, attribute); + return std::visit(AsStringVisitor{}, attribute); } MonitoredResource ToMonitoredResource( diff --git a/google/cloud/opentelemetry/internal/monitored_resource_test.cc b/google/cloud/opentelemetry/internal/monitored_resource_test.cc index 217e43cf90426..b1e02253a3a27 100644 --- a/google/cloud/opentelemetry/internal/monitored_resource_test.cc +++ b/google/cloud/opentelemetry/internal/monitored_resource_test.cc @@ -16,14 +16,18 @@ #include "google/cloud/version.h" #include "absl/types/optional.h" #include -#include +#include +#include +#include +#include +#include namespace google { namespace cloud { namespace otel_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { -namespace sc = opentelemetry::sdk::resource::SemanticConventions; +namespace sc = opentelemetry::semconv; using ::testing::Pair; using ::testing::UnorderedElementsAre; @@ -69,9 +73,9 @@ TEST(AsString, VectorsAreJoined) { TEST(MonitoredResource, GceInstance) { auto attributes = opentelemetry::sdk::resource::ResourceAttributes{ - {sc::kCloudPlatform, "gcp_compute_engine"}, - {sc::kHostId, "1020304050607080900"}, - {sc::kCloudAvailabilityZone, "us-central1-a"}, + {sc::cloud::kCloudPlatform, "gcp_compute_engine"}, + {sc::host::kHostId, "1020304050607080900"}, + {sc::cloud::kCloudAvailabilityZone, "us-central1-a"}, }; auto mr = ToMonitoredResource(attributes); @@ -94,14 +98,14 @@ TEST(MonitoredResource, K8sContainer) { }; for (auto const& test : tests) { auto attributes = opentelemetry::sdk::resource::ResourceAttributes{ - {sc::kCloudPlatform, "gcp_kubernetes_engine"}, - {sc::kK8sClusterName, "test-cluster"}, - {sc::kK8sNamespaceName, "test-namespace"}, - {sc::kK8sPodName, "test-pod"}, - {sc::kK8sContainerName, "test-container"}, + {sc::cloud::kCloudPlatform, "gcp_kubernetes_engine"}, + {sc::k8s::kK8sClusterName, "test-cluster"}, + {sc::k8s::kK8sNamespaceName, "test-namespace"}, + {sc::k8s::kK8sPodName, "test-pod"}, + {sc::k8s::kK8sContainerName, "test-container"}, }; - if (test.zone) attributes[sc::kCloudAvailabilityZone] = *test.zone; - if (test.region) attributes[sc::kCloudRegion] = *test.region; + if (test.zone) attributes[sc::cloud::kCloudAvailabilityZone] = *test.zone; + if (test.region) attributes[sc::cloud::kCloudRegion] = *test.region; auto mr = ToMonitoredResource(attributes); EXPECT_EQ(mr.type, "k8s_container"); @@ -127,13 +131,13 @@ TEST(MonitoredResource, K8sPod) { }; for (auto const& test : tests) { auto attributes = opentelemetry::sdk::resource::ResourceAttributes{ - {sc::kCloudPlatform, "gcp_kubernetes_engine"}, - {sc::kK8sClusterName, "test-cluster"}, - {sc::kK8sNamespaceName, "test-namespace"}, - {sc::kK8sPodName, "test-pod"}, + {sc::cloud::kCloudPlatform, "gcp_kubernetes_engine"}, + {sc::k8s::kK8sClusterName, "test-cluster"}, + {sc::k8s::kK8sNamespaceName, "test-namespace"}, + {sc::k8s::kK8sPodName, "test-pod"}, }; - if (test.zone) attributes[sc::kCloudAvailabilityZone] = *test.zone; - if (test.region) attributes[sc::kCloudRegion] = *test.region; + if (test.zone) attributes[sc::cloud::kCloudAvailabilityZone] = *test.zone; + if (test.region) attributes[sc::cloud::kCloudRegion] = *test.region; auto mr = ToMonitoredResource(attributes); EXPECT_EQ(mr.type, "k8s_pod"); @@ -158,12 +162,12 @@ TEST(MonitoredResource, K8sNode) { }; for (auto const& test : tests) { auto attributes = opentelemetry::sdk::resource::ResourceAttributes{ - {sc::kCloudPlatform, "gcp_kubernetes_engine"}, - {sc::kK8sClusterName, "test-cluster"}, - {sc::kK8sNodeName, "test-node"}, + {sc::cloud::kCloudPlatform, "gcp_kubernetes_engine"}, + {sc::k8s::kK8sClusterName, "test-cluster"}, + {sc::k8s::kK8sNodeName, "test-node"}, }; - if (test.zone) attributes[sc::kCloudAvailabilityZone] = *test.zone; - if (test.region) attributes[sc::kCloudRegion] = *test.region; + if (test.zone) attributes[sc::cloud::kCloudAvailabilityZone] = *test.zone; + if (test.region) attributes[sc::cloud::kCloudRegion] = *test.region; auto mr = ToMonitoredResource(attributes); EXPECT_EQ(mr.type, "k8s_node"); @@ -187,11 +191,11 @@ TEST(MonitoredResource, K8sCluster) { }; for (auto const& test : tests) { auto attributes = opentelemetry::sdk::resource::ResourceAttributes{ - {sc::kCloudPlatform, "gcp_kubernetes_engine"}, - {sc::kK8sClusterName, "test-cluster"}, + {sc::cloud::kCloudPlatform, "gcp_kubernetes_engine"}, + {sc::k8s::kK8sClusterName, "test-cluster"}, }; - if (test.zone) attributes[sc::kCloudAvailabilityZone] = *test.zone; - if (test.region) attributes[sc::kCloudRegion] = *test.region; + if (test.zone) attributes[sc::cloud::kCloudAvailabilityZone] = *test.zone; + if (test.region) attributes[sc::cloud::kCloudRegion] = *test.region; auto mr = ToMonitoredResource(attributes); EXPECT_EQ(mr.type, "k8s_cluster"); @@ -214,13 +218,13 @@ TEST(MonitoredResource, GaeInstance) { }; for (auto const& test : tests) { auto attributes = opentelemetry::sdk::resource::ResourceAttributes{ - {sc::kCloudPlatform, "gcp_app_engine"}, - {sc::kFaasName, "test-module"}, - {sc::kFaasVersion, "test-version"}, - {sc::kFaasInstance, "test-instance"}, + {sc::cloud::kCloudPlatform, "gcp_app_engine"}, + {sc::faas::kFaasName, "test-module"}, + {sc::faas::kFaasVersion, "test-version"}, + {sc::faas::kFaasInstance, "test-instance"}, }; - if (test.zone) attributes[sc::kCloudAvailabilityZone] = *test.zone; - if (test.region) attributes[sc::kCloudRegion] = *test.region; + if (test.zone) attributes[sc::cloud::kCloudAvailabilityZone] = *test.zone; + if (test.region) attributes[sc::cloud::kCloudRegion] = *test.region; auto mr = ToMonitoredResource(attributes); EXPECT_EQ(mr.type, "gae_instance"); @@ -245,12 +249,12 @@ TEST(MonitoredResource, AwsEc2Instance) { }; for (auto const& test : tests) { auto attributes = opentelemetry::sdk::resource::ResourceAttributes{ - {sc::kCloudPlatform, "aws_ec2"}, - {sc::kHostId, "test-instance"}, - {sc::kCloudAccountId, "test-account"}, + {sc::cloud::kCloudPlatform, "aws_ec2"}, + {sc::host::kHostId, "test-instance"}, + {sc::cloud::kCloudAccountId, "test-account"}, }; - if (test.zone) attributes[sc::kCloudAvailabilityZone] = *test.zone; - if (test.region) attributes[sc::kCloudRegion] = *test.region; + if (test.zone) attributes[sc::cloud::kCloudAvailabilityZone] = *test.zone; + if (test.region) attributes[sc::cloud::kCloudRegion] = *test.region; auto mr = ToMonitoredResource(attributes); EXPECT_EQ(mr.type, "aws_ec2_instance"); @@ -275,11 +279,11 @@ TEST(MonitoredResource, GenericTaskFaas) { }; for (auto const& test : tests) { auto attributes = opentelemetry::sdk::resource::ResourceAttributes{ - {sc::kFaasName, "faas-name"}, - {sc::kFaasInstance, "faas-instance"}, + {sc::faas::kFaasName, "faas-name"}, + {sc::faas::kFaasInstance, "faas-instance"}, }; - if (test.zone) attributes[sc::kCloudAvailabilityZone] = *test.zone; - if (test.region) attributes[sc::kCloudRegion] = *test.region; + if (test.zone) attributes[sc::cloud::kCloudAvailabilityZone] = *test.zone; + if (test.region) attributes[sc::cloud::kCloudRegion] = *test.region; auto mr = ToMonitoredResource(attributes); EXPECT_EQ(mr.type, "generic_task"); @@ -305,12 +309,12 @@ TEST(MonitoredResource, GenericTaskService) { }; for (auto const& test : tests) { auto attributes = opentelemetry::sdk::resource::ResourceAttributes{ - {sc::kServiceNamespace, "test-namespace"}, - {sc::kServiceName, "test-name"}, - {sc::kServiceInstanceId, "test-instance"}, + {sc::service::kServiceNamespace, "test-namespace"}, + {sc::service::kServiceName, "test-name"}, + {sc::service::kServiceInstanceId, "test-instance"}, }; - if (test.zone) attributes[sc::kCloudAvailabilityZone] = *test.zone; - if (test.region) attributes[sc::kCloudRegion] = *test.region; + if (test.zone) attributes[sc::cloud::kCloudAvailabilityZone] = *test.zone; + if (test.region) attributes[sc::cloud::kCloudRegion] = *test.region; auto mr = ToMonitoredResource(attributes); EXPECT_EQ(mr.type, "generic_task"); @@ -336,11 +340,11 @@ TEST(MonitoredResource, GenericNode) { }; for (auto const& test : location_tests) { auto attributes = opentelemetry::sdk::resource::ResourceAttributes{ - {sc::kServiceNamespace, "test-namespace"}, - {sc::kHostId, "test-instance"}, + {sc::service::kServiceNamespace, "test-namespace"}, + {sc::host::kHostId, "test-instance"}, }; - if (test.zone) attributes[sc::kCloudAvailabilityZone] = *test.zone; - if (test.region) attributes[sc::kCloudRegion] = *test.region; + if (test.zone) attributes[sc::cloud::kCloudAvailabilityZone] = *test.zone; + if (test.region) attributes[sc::cloud::kCloudRegion] = *test.region; auto mr = ToMonitoredResource(attributes); EXPECT_EQ(mr.type, "generic_node"); @@ -360,12 +364,12 @@ TEST(MonitoredResource, GenericNode) { }; for (auto const& test : node_id_tests) { auto attributes = opentelemetry::sdk::resource::ResourceAttributes{ - {sc::kCloudAvailabilityZone, "us-central1-a"}, - {sc::kCloudRegion, "us-central1"}, - {sc::kServiceNamespace, "test-namespace"}, - {sc::kHostName, "test-name"}, + {sc::cloud::kCloudAvailabilityZone, "us-central1-a"}, + {sc::cloud::kCloudRegion, "us-central1"}, + {sc::service::kServiceNamespace, "test-namespace"}, + {sc::host::kHostName, "test-name"}, }; - if (test.host_id) attributes[sc::kHostId] = *test.host_id; + if (test.host_id) attributes[sc::host::kHostId] = *test.host_id; auto mr = ToMonitoredResource(attributes); EXPECT_EQ(mr.type, "generic_node"); diff --git a/google/cloud/opentelemetry/internal/monitoring_exporter.cc b/google/cloud/opentelemetry/internal/monitoring_exporter.cc index 48dd990fd87c5..6761b3554cd11 100644 --- a/google/cloud/opentelemetry/internal/monitoring_exporter.cc +++ b/google/cloud/opentelemetry/internal/monitoring_exporter.cc @@ -15,10 +15,10 @@ #include "google/cloud/opentelemetry/internal/monitoring_exporter.h" #include "google/cloud/monitoring/v3/metric_connection.h" #include "google/cloud/opentelemetry/internal/time_series.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/noexcept_action.h" #include "google/cloud/log.h" #include "google/cloud/project.h" +#include "absl/strings/str_cat.h" #include namespace google { diff --git a/google/cloud/opentelemetry/internal/monitoring_exporter_test.cc b/google/cloud/opentelemetry/internal/monitoring_exporter_test.cc index 7602f35539626..f3e495bc5d0a2 100644 --- a/google/cloud/opentelemetry/internal/monitoring_exporter_test.cc +++ b/google/cloud/opentelemetry/internal/monitoring_exporter_test.cc @@ -20,6 +20,7 @@ #include #include #include +#include namespace google { namespace cloud { @@ -134,15 +135,14 @@ TEST(MonitoringExporter, ExportSuccess) { auto& labels = *resource.mutable_labels(); auto const& attributes = pda.attributes.GetAttributes(); labels["project_id"] = - absl::get(attributes.find("project_id")->second); + std::get(attributes.find("project_id")->second); labels["instance"] = - absl::get(attributes.find("instance")->second); + std::get(attributes.find("instance")->second); labels["cluster"] = - absl::get(attributes.find("cluster")->second); + std::get(attributes.find("cluster")->second); labels["table"] = - absl::get(attributes.find("table")->second); - labels["zone"] = - absl::get(attributes.find("zone")->second); + std::get(attributes.find("table")->second); + labels["zone"] = std::get(attributes.find("zone")->second); return std::make_pair(labels["project_id"], resource); }; diff --git a/google/cloud/opentelemetry/internal/recordable.cc b/google/cloud/opentelemetry/internal/recordable.cc index ca2623dc03c70..89ed90d866ed9 100644 --- a/google/cloud/opentelemetry/internal/recordable.cc +++ b/google/cloud/opentelemetry/internal/recordable.cc @@ -14,11 +14,12 @@ #include "google/cloud/opentelemetry/internal/recordable.h" #include "google/cloud/opentelemetry/internal/monitored_resource.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/noexcept_action.h" #include "google/cloud/internal/time_utils.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include "absl/time/time.h" +#include "absl/types/variant.h" #include #include @@ -207,7 +208,7 @@ void AddAttributeImpl( std::size_t limit) { auto* proto = ProtoOrDrop(attributes, key, limit); if (proto) { - absl::visit(AttributeVisitor{*proto}, value); + std::visit(AttributeVisitor{*proto}, value); } else { attributes.set_dropped_attributes_count( attributes.dropped_attributes_count() + 1); diff --git a/google/cloud/opentelemetry/internal/recordable.h b/google/cloud/opentelemetry/internal/recordable.h index 578a9d6fc9729..de3bd557eb460 100644 --- a/google/cloud/opentelemetry/internal/recordable.h +++ b/google/cloud/opentelemetry/internal/recordable.h @@ -17,8 +17,8 @@ #include "google/cloud/project.h" #include "google/cloud/version.h" -#include -#include +#include "google/devtools/cloudtrace/v2/trace.pb.h" +#include "google/devtools/cloudtrace/v2/tracing.pb.h" #include #include #include diff --git a/google/cloud/opentelemetry/internal/recordable_test.cc b/google/cloud/opentelemetry/internal/recordable_test.cc index 0d2ea0e91db9b..2622891fb8b7a 100644 --- a/google/cloud/opentelemetry/internal/recordable_test.cc +++ b/google/cloud/opentelemetry/internal/recordable_test.cc @@ -20,7 +20,8 @@ #include #include #include -#include +#include +#include namespace google { namespace cloud { @@ -28,7 +29,7 @@ namespace otel_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { -namespace sc = opentelemetry::sdk::resource::SemanticConventions; +namespace sc = opentelemetry::semconv; namespace v2 = ::google::devtools::cloudtrace::v2; using ::testing::_; using ::testing::AllOf; @@ -674,10 +675,10 @@ TEST(Recordable, SetAttributeRespectsLimit) { TEST(Recordable, SetResourceMapsMonitoredResources) { auto resource = opentelemetry::sdk::resource::Resource::Create({ - {sc::kCloudProvider, "gcp"}, - {sc::kCloudPlatform, "gcp_compute_engine"}, - {sc::kHostId, "1020304050607080900"}, - {sc::kCloudAvailabilityZone, "us-central1-a"}, + {sc::cloud::kCloudProvider, "gcp"}, + {sc::cloud::kCloudPlatform, "gcp_compute_engine"}, + {sc::host::kHostId, "1020304050607080900"}, + {sc::cloud::kCloudAvailabilityZone, "us-central1-a"}, }); auto rec = Recordable(Project(kProjectId), TestGenerator()); diff --git a/google/cloud/opentelemetry/internal/resource_detector_impl.cc b/google/cloud/opentelemetry/internal/resource_detector_impl.cc index 99e03ba08c4dd..6209cff02dacb 100644 --- a/google/cloud/opentelemetry/internal/resource_detector_impl.cc +++ b/google/cloud/opentelemetry/internal/resource_detector_impl.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/opentelemetry/internal/resource_detector_impl.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/compute_engine_util.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/make_status.h" @@ -21,9 +20,14 @@ #include "google/cloud/log.h" #include "absl/strings/ascii.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include #include -#include +#include +#include +#include +#include +#include namespace google { namespace cloud { @@ -31,7 +35,7 @@ namespace otel_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { -namespace sc = opentelemetry::sdk::resource::SemanticConventions; +namespace sc = opentelemetry::semconv; // The metadata server returns fully qualified names. (e.g. a zone may be // "projects/p/zones/us-central1-a"). Return the IDs only. @@ -84,8 +88,9 @@ class Parser { // environment variables into resource attributes. This populates the // `attributes_` member. void ProcessMetadataAndEnv() { - SetAttribute(sc::kCloudProvider, "gcp"); - SetAttribute(sc::kCloudAccountId, Metadata({"project", "projectId"})); + SetAttribute(sc::cloud::kCloudProvider, "gcp"); + SetAttribute(sc::cloud::kCloudAccountId, + Metadata({"project", "projectId"})); if (internal::GetEnv("KUBERNETES_SERVICE_HOST")) return Gke(); if (internal::GetEnv("FUNCTION_TARGET")) return CloudFunctions(); @@ -95,10 +100,10 @@ class Parser { } void Gke() { - SetAttribute(sc::kCloudPlatform, "gcp_kubernetes_engine"); - SetAttribute(sc::kK8sClusterName, + SetAttribute(sc::cloud::kCloudPlatform, "gcp_kubernetes_engine"); + SetAttribute(sc::k8s::kK8sClusterName, Metadata({"instance", "attributes", "cluster-name"})); - SetAttribute(sc::kHostId, Metadata({"instance", "id"})); + SetAttribute(sc::host::kHostId, Metadata({"instance", "id"})); auto cluster_location = Tail(Metadata({"instance", "attributes", "cluster-location"})); @@ -106,48 +111,49 @@ class Parser { auto hyphen_count = std::count(cluster_location.begin(), cluster_location.end(), '-'); if (hyphen_count == 1) { - SetAttribute(sc::kCloudRegion, cluster_location); + SetAttribute(sc::cloud::kCloudRegion, cluster_location); } else if (hyphen_count == 2) { - SetAttribute(sc::kCloudAvailabilityZone, cluster_location); + SetAttribute(sc::cloud::kCloudAvailabilityZone, cluster_location); } } void CloudFunctions() { - SetAttribute(sc::kCloudPlatform, "gcp_cloud_functions"); - SetEnvAttribute(sc::kFaasName, "K_SERVICE"); - SetEnvAttribute(sc::kFaasVersion, "K_REVISION"); - SetAttribute(sc::kFaasInstance, Metadata({"instance", "id"})); + SetAttribute(sc::cloud::kCloudPlatform, "gcp_cloud_functions"); + SetEnvAttribute(sc::faas::kFaasName, "K_SERVICE"); + SetEnvAttribute(sc::faas::kFaasVersion, "K_REVISION"); + SetAttribute(sc::faas::kFaasInstance, Metadata({"instance", "id"})); } void CloudRun() { - SetAttribute(sc::kCloudPlatform, "gcp_cloud_run"); - SetEnvAttribute(sc::kFaasName, "K_SERVICE"); - SetEnvAttribute(sc::kFaasVersion, "K_REVISION"); - SetAttribute(sc::kFaasInstance, Metadata({"instance", "id"})); + SetAttribute(sc::cloud::kCloudPlatform, "gcp_cloud_run"); + SetEnvAttribute(sc::faas::kFaasName, "K_SERVICE"); + SetEnvAttribute(sc::faas::kFaasVersion, "K_REVISION"); + SetAttribute(sc::faas::kFaasInstance, Metadata({"instance", "id"})); } void Gae() { - SetAttribute(sc::kCloudPlatform, "gcp_app_engine"); - SetEnvAttribute(sc::kFaasName, "GAE_SERVICE"); - SetEnvAttribute(sc::kFaasVersion, "GAE_VERSION"); - SetEnvAttribute(sc::kFaasInstance, "GAE_INSTANCE"); + SetAttribute(sc::cloud::kCloudPlatform, "gcp_app_engine"); + SetEnvAttribute(sc::faas::kFaasName, "GAE_SERVICE"); + SetEnvAttribute(sc::faas::kFaasVersion, "GAE_VERSION"); + SetEnvAttribute(sc::faas::kFaasInstance, "GAE_INSTANCE"); auto zone = Tail(Metadata({"instance", "zone"})); - SetAttribute(sc::kCloudAvailabilityZone, zone); + SetAttribute(sc::cloud::kCloudAvailabilityZone, zone); auto const pos = zone.rfind('-'); - SetAttribute(sc::kCloudRegion, zone.substr(0, pos)); + SetAttribute(sc::cloud::kCloudRegion, zone.substr(0, pos)); } void Gce() { - SetAttribute(sc::kCloudPlatform, "gcp_compute_engine"); - SetAttribute(sc::kHostType, Tail(Metadata({"instance", "machineType"}))); - SetAttribute(sc::kHostId, Metadata({"instance", "id"})); - SetAttribute(sc::kHostName, Metadata({"instance", "name"})); + SetAttribute(sc::cloud::kCloudPlatform, "gcp_compute_engine"); + SetAttribute(sc::host::kHostType, + Tail(Metadata({"instance", "machineType"}))); + SetAttribute(sc::host::kHostId, Metadata({"instance", "id"})); + SetAttribute(sc::host::kHostName, Metadata({"instance", "name"})); auto zone = Tail(Metadata({"instance", "zone"})); - SetAttribute(sc::kCloudAvailabilityZone, zone); + SetAttribute(sc::cloud::kCloudAvailabilityZone, zone); auto const pos = zone.rfind('-'); - SetAttribute(sc::kCloudRegion, zone.substr(0, pos)); + SetAttribute(sc::cloud::kCloudRegion, zone.substr(0, pos)); } std::string Metadata(std::deque keys) { diff --git a/google/cloud/opentelemetry/internal/resource_detector_impl_test.cc b/google/cloud/opentelemetry/internal/resource_detector_impl_test.cc index bb790c5726305..4c73a5c98404f 100644 --- a/google/cloud/opentelemetry/internal/resource_detector_impl_test.cc +++ b/google/cloud/opentelemetry/internal/resource_detector_impl_test.cc @@ -12,9 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/opentelemetry/internal/resource_detector_impl.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/compute_engine_util.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/testing_util/mock_http_payload.h" @@ -24,8 +22,13 @@ #include "google/cloud/testing_util/scoped_environment.h" #include "google/cloud/testing_util/scoped_log.h" #include "google/cloud/version.h" +#include "absl/strings/str_cat.h" #include -#include +#include +#include +#include +#include +#include namespace google { namespace cloud { @@ -33,7 +36,7 @@ namespace otel { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { -namespace sc = opentelemetry::sdk::resource::SemanticConventions; +namespace sc = opentelemetry::semconv; using ::google::cloud::testing_util::MakeMockHttpPayloadSuccess; using ::google::cloud::testing_util::MockHttpPayload; using ::google::cloud::testing_util::MockRestClient; @@ -118,9 +121,8 @@ TEST(ResourceDetector, RetriesTransientConnectionError) { auto resource = detector->Detect(); auto const& attributes = resource.GetAttributes(); - EXPECT_THAT( - attributes, - Not(Contains(OTelAttribute(sc::kCloudProvider, "gcp")))); + EXPECT_THAT(attributes, Not(Contains(OTelAttribute( + sc::cloud::kCloudProvider, "gcp")))); EXPECT_THAT( log.ExtractLines(), @@ -142,9 +144,8 @@ TEST(ResourceDetector, PermanentConnectionError) { auto resource = detector->Detect(); auto const& attributes = resource.GetAttributes(); - EXPECT_THAT( - attributes, - Not(Contains(OTelAttribute(sc::kCloudProvider, "gcp")))); + EXPECT_THAT(attributes, Not(Contains(OTelAttribute( + sc::cloud::kCloudProvider, "gcp")))); EXPECT_THAT(log.ExtractLines(), Contains(AllOf(HasSubstr("Could not query the metadata server"), @@ -172,9 +173,8 @@ TEST(ResourceDetector, HttpError) { auto resource = detector->Detect(); auto const& attributes = resource.GetAttributes(); - EXPECT_THAT( - attributes, - Not(Contains(OTelAttribute(sc::kCloudProvider, "gcp")))); + EXPECT_THAT(attributes, Not(Contains(OTelAttribute( + sc::cloud::kCloudProvider, "gcp")))); EXPECT_THAT(log.ExtractLines(), Contains(AllOf(HasSubstr("Could not query the metadata server"), @@ -209,9 +209,8 @@ TEST(ResourceDetector, ValidatesHeaders) { auto resource = detector->Detect(); auto const& attributes = resource.GetAttributes(); - EXPECT_THAT( - attributes, - Not(Contains(OTelAttribute(sc::kCloudProvider, "gcp")))); + EXPECT_THAT(attributes, Not(Contains(OTelAttribute( + sc::cloud::kCloudProvider, "gcp")))); EXPECT_THAT( log.ExtractLines(), @@ -246,9 +245,8 @@ TEST(ResourceDetector, PayloadReadError) { auto resource = detector->Detect(); auto const& attributes = resource.GetAttributes(); - EXPECT_THAT( - attributes, - Not(Contains(OTelAttribute(sc::kCloudProvider, "gcp")))); + EXPECT_THAT(attributes, Not(Contains(OTelAttribute( + sc::cloud::kCloudProvider, "gcp")))); EXPECT_THAT(log.ExtractLines(), Contains(AllOf(HasSubstr("Could not query the metadata server"), @@ -304,13 +302,14 @@ TEST(ResourceDetector, GkeRegion) { EXPECT_THAT( attributes, IsSupersetOf({ - OTelAttribute(sc::kCloudProvider, "gcp"), - OTelAttribute(sc::kCloudAccountId, "test-project"), - OTelAttribute(sc::kCloudPlatform, + OTelAttribute(sc::cloud::kCloudProvider, "gcp"), + OTelAttribute(sc::cloud::kCloudAccountId, + "test-project"), + OTelAttribute(sc::cloud::kCloudPlatform, "gcp_kubernetes_engine"), - OTelAttribute(sc::kK8sClusterName, "test-cluster"), - OTelAttribute(sc::kHostId, "1020304050607080900"), - OTelAttribute(sc::kCloudRegion, "us-central1"), + OTelAttribute(sc::k8s::kK8sClusterName, "test-cluster"), + OTelAttribute(sc::host::kHostId, "1020304050607080900"), + OTelAttribute(sc::cloud::kCloudRegion, "us-central1"), })); } @@ -336,13 +335,14 @@ TEST(ResourceDetector, GkeZone) { EXPECT_THAT( attributes, IsSupersetOf({ - OTelAttribute(sc::kCloudProvider, "gcp"), - OTelAttribute(sc::kCloudAccountId, "test-project"), - OTelAttribute(sc::kCloudPlatform, + OTelAttribute(sc::cloud::kCloudProvider, "gcp"), + OTelAttribute(sc::cloud::kCloudAccountId, + "test-project"), + OTelAttribute(sc::cloud::kCloudPlatform, "gcp_kubernetes_engine"), - OTelAttribute(sc::kK8sClusterName, "test-cluster"), - OTelAttribute(sc::kHostId, "1020304050607080900"), - OTelAttribute(sc::kCloudAvailabilityZone, + OTelAttribute(sc::k8s::kK8sClusterName, "test-cluster"), + OTelAttribute(sc::host::kHostId, "1020304050607080900"), + OTelAttribute(sc::cloud::kCloudAvailabilityZone, "us-central1-a"), })); } @@ -368,12 +368,15 @@ TEST(ResourceDetector, CloudFunctions) { EXPECT_THAT( attributes, IsSupersetOf({ - OTelAttribute(sc::kCloudProvider, "gcp"), - OTelAttribute(sc::kCloudAccountId, "test-project"), - OTelAttribute(sc::kCloudPlatform, "gcp_cloud_functions"), - OTelAttribute(sc::kFaasName, "test-service"), - OTelAttribute(sc::kFaasVersion, "test-version"), - OTelAttribute(sc::kFaasInstance, "1020304050607080900"), + OTelAttribute(sc::cloud::kCloudProvider, "gcp"), + OTelAttribute(sc::cloud::kCloudAccountId, + "test-project"), + OTelAttribute(sc::cloud::kCloudPlatform, + "gcp_cloud_functions"), + OTelAttribute(sc::faas::kFaasName, "test-service"), + OTelAttribute(sc::faas::kFaasVersion, "test-version"), + OTelAttribute(sc::faas::kFaasInstance, + "1020304050607080900"), })); } @@ -399,12 +402,15 @@ TEST(ResourceDetector, CloudRun) { EXPECT_THAT( attributes, IsSupersetOf({ - OTelAttribute(sc::kCloudProvider, "gcp"), - OTelAttribute(sc::kCloudAccountId, "test-project"), - OTelAttribute(sc::kCloudPlatform, "gcp_cloud_run"), - OTelAttribute(sc::kFaasName, "test-service"), - OTelAttribute(sc::kFaasVersion, "test-version"), - OTelAttribute(sc::kFaasInstance, "1020304050607080900"), + OTelAttribute(sc::cloud::kCloudProvider, "gcp"), + OTelAttribute(sc::cloud::kCloudAccountId, + "test-project"), + OTelAttribute(sc::cloud::kCloudPlatform, + "gcp_cloud_run"), + OTelAttribute(sc::faas::kFaasName, "test-service"), + OTelAttribute(sc::faas::kFaasVersion, "test-version"), + OTelAttribute(sc::faas::kFaasInstance, + "1020304050607080900"), })); } @@ -431,15 +437,17 @@ TEST(ResourceDetector, Gae) { EXPECT_THAT( attributes, IsSupersetOf({ - OTelAttribute(sc::kCloudProvider, "gcp"), - OTelAttribute(sc::kCloudAccountId, "test-project"), - OTelAttribute(sc::kCloudPlatform, "gcp_app_engine"), - OTelAttribute(sc::kFaasName, "test-service"), - OTelAttribute(sc::kFaasVersion, "test-version"), - OTelAttribute(sc::kFaasInstance, "test-instance"), - OTelAttribute(sc::kCloudAvailabilityZone, + OTelAttribute(sc::cloud::kCloudProvider, "gcp"), + OTelAttribute(sc::cloud::kCloudAccountId, + "test-project"), + OTelAttribute(sc::cloud::kCloudPlatform, + "gcp_app_engine"), + OTelAttribute(sc::faas::kFaasName, "test-service"), + OTelAttribute(sc::faas::kFaasVersion, "test-version"), + OTelAttribute(sc::faas::kFaasInstance, "test-instance"), + OTelAttribute(sc::cloud::kCloudAvailabilityZone, "us-central1-a"), - OTelAttribute(sc::kCloudRegion, "us-central1"), + OTelAttribute(sc::cloud::kCloudRegion, "us-central1"), })); } @@ -467,15 +475,17 @@ TEST(ResourceDetector, Gce) { EXPECT_THAT( attributes, IsSupersetOf({ - OTelAttribute(sc::kCloudProvider, "gcp"), - OTelAttribute(sc::kCloudAccountId, "test-project"), - OTelAttribute(sc::kCloudPlatform, "gcp_compute_engine"), - OTelAttribute(sc::kHostType, "c2d-standard-16"), - OTelAttribute(sc::kHostId, "1020304050607080900"), - OTelAttribute(sc::kHostName, "test-instance"), - OTelAttribute(sc::kCloudAvailabilityZone, + OTelAttribute(sc::cloud::kCloudProvider, "gcp"), + OTelAttribute(sc::cloud::kCloudAccountId, + "test-project"), + OTelAttribute(sc::cloud::kCloudPlatform, + "gcp_compute_engine"), + OTelAttribute(sc::host::kHostType, "c2d-standard-16"), + OTelAttribute(sc::host::kHostId, "1020304050607080900"), + OTelAttribute(sc::host::kHostName, "test-instance"), + OTelAttribute(sc::cloud::kCloudAvailabilityZone, "us-central1-a"), - OTelAttribute(sc::kCloudRegion, "us-central1"), + OTelAttribute(sc::cloud::kCloudRegion, "us-central1"), })); } @@ -507,4 +517,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace otel } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/opentelemetry/internal/time_series.cc b/google/cloud/opentelemetry/internal/time_series.cc index effd72a807b3d..b5077c3f6dc94 100644 --- a/google/cloud/opentelemetry/internal/time_series.cc +++ b/google/cloud/opentelemetry/internal/time_series.cc @@ -14,14 +14,15 @@ #include "google/cloud/opentelemetry/internal/time_series.h" #include "google/cloud/opentelemetry/internal/monitored_resource.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/internal/time_utils.h" #include "google/cloud/log.h" +#include "absl/strings/str_replace.h" #include #include #include -#include +#include #include +#include namespace google { namespace cloud { @@ -29,7 +30,7 @@ namespace otel_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { -namespace sc = opentelemetry::sdk::resource::SemanticConventions; +namespace sc = opentelemetry::semconv; google::protobuf::Timestamp ToProtoTimestamp( opentelemetry::common::SystemTimestamp ts) { @@ -40,10 +41,10 @@ google::protobuf::Timestamp ToProtoTimestamp( google::monitoring::v3::TypedValue ToValue( opentelemetry::sdk::metrics::ValueType value) { google::monitoring::v3::TypedValue proto; - if (absl::holds_alternative(value)) { - proto.set_double_value(absl::get(value)); + if (std::holds_alternative(value)) { + proto.set_double_value(std::get(value)); } else { - proto.set_int64_value(absl::get(value)); + proto.set_int64_value(std::get(value)); } return proto; } @@ -62,9 +63,9 @@ google::api::MetricDescriptor::ValueType ToValueType( } double AsDouble(opentelemetry::sdk::metrics::ValueType const& v) { - return absl::holds_alternative(v) - ? absl::get(v) - : static_cast(absl::get(v)); + return std::holds_alternative(v) + ? std::get(v) + : static_cast(std::get(v)); } std::vector ToRequestsHelper( @@ -112,12 +113,21 @@ void ToTimeSeriesHelper( opentelemetry::sdk::metrics::HistogramPointData const& point) { return ToTimeSeries(metric_data, point); } +#if OPENTELEMETRY_VERSION_MAJOR > 1 || \ + (OPENTELEMETRY_VERSION_MAJOR == 1 && OPENTELEMETRY_VERSION_MINOR >= 21) + absl::optional operator()( + opentelemetry::sdk::metrics:: + Base2ExponentialHistogramPointData const&) { + // TODO(#xxxxx): Add support for exponential histograms. + return absl::nullopt; + } +#endif absl::optional operator()( opentelemetry::sdk::metrics::DropPointData const&) { return absl::nullopt; } }; - auto ts = absl::visit(Visitor{metric_data}, pda.point_data); + auto ts = std::visit(Visitor{metric_data}, pda.point_data); if (!ts) continue; ts->set_unit(metric_data.instrument_descriptor.unit_); ts_collector_fn(metric_data, pda, *std::move(ts)); @@ -164,9 +174,9 @@ google::api::Metric ToMetric( // service processes on a single GCE VM. auto const& ra = resource->GetAttributes().GetAttributes(); for (std::string key : { - sc::kServiceName, - sc::kServiceNamespace, - sc::kServiceInstanceId, + sc::service::kServiceName, + sc::service::kServiceNamespace, + sc::service::kServiceInstanceId, }) { auto it = ra.find(std::move(key)); if (it != ra.end()) add_label(labels, it->first, it->second); diff --git a/google/cloud/opentelemetry/internal/time_series.h b/google/cloud/opentelemetry/internal/time_series.h index 6dc40b375b8a1..92c21bc2969ad 100644 --- a/google/cloud/opentelemetry/internal/time_series.h +++ b/google/cloud/opentelemetry/internal/time_series.h @@ -18,9 +18,9 @@ #include "google/cloud/opentelemetry/internal/monitoring_exporter.h" #include "google/cloud/version.h" #include "absl/types/optional.h" -#include -#include -#include +#include "google/api/metric.pb.h" +#include "google/api/monitored_resource.pb.h" +#include "google/monitoring/v3/metric_service.pb.h" #include #include #include diff --git a/google/cloud/opentelemetry/internal/time_series_test.cc b/google/cloud/opentelemetry/internal/time_series_test.cc index c436ea715466c..ef2df414ec630 100644 --- a/google/cloud/opentelemetry/internal/time_series_test.cc +++ b/google/cloud/opentelemetry/internal/time_series_test.cc @@ -23,7 +23,9 @@ #include #include #include -#include +#include +#include +#include #include #include @@ -33,7 +35,7 @@ namespace otel_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { -namespace sc = opentelemetry::sdk::resource::SemanticConventions; +namespace sc = opentelemetry::semconv; using ::google::cloud::testing_util::IsProtoEqual; using ::google::protobuf::TextFormat; @@ -137,10 +139,10 @@ auto Interval(std::chrono::system_clock::time_point start, auto TestResource() { return opentelemetry::sdk::resource::Resource::Create({ - {sc::kCloudProvider, "gcp"}, - {sc::kCloudPlatform, "gcp_compute_engine"}, - {sc::kHostId, "1020304050607080900"}, - {sc::kCloudAvailabilityZone, "us-central1-a"}, + {sc::cloud::kCloudProvider, "gcp"}, + {sc::cloud::kCloudPlatform, "gcp_compute_engine"}, + {sc::host::kHostId, "1020304050607080900"}, + {sc::cloud::kCloudAvailabilityZone, "us-central1-a"}, }); } @@ -284,9 +286,9 @@ TEST(ToMetric, IncludesServiceLabelsFromResource) { opentelemetry::sdk::resource::ResourceAttributes resource_attributes = { {"unused", "unused"}, - {sc::kServiceName, "test-name"}, - {sc::kServiceNamespace, "test-namespace"}, - {sc::kServiceInstanceId, "test-instance"}, + {sc::service::kServiceName, "test-name"}, + {sc::service::kServiceNamespace, "test-namespace"}, + {sc::service::kServiceInstanceId, "test-instance"}, }; auto resource = opentelemetry::sdk::resource::Resource::Create(resource_attributes); @@ -310,9 +312,9 @@ TEST(ToMetric, PointAttributesOverServiceResourceAttributes) { }; opentelemetry::sdk::resource::ResourceAttributes resource_attributes = { - {sc::kServiceName, "resource-name"}, - {sc::kServiceNamespace, "resource-namespace"}, - {sc::kServiceInstanceId, "resource-instance"}, + {sc::service::kServiceName, "resource-name"}, + {sc::service::kServiceNamespace, "resource-namespace"}, + {sc::service::kServiceInstanceId, "resource-instance"}, }; auto resource = opentelemetry::sdk::resource::Resource::Create(resource_attributes); @@ -333,17 +335,17 @@ TEST(ToMetric, ResourceFilter) { {"service_name", "point-name"}, {"service_namespace", "point-namespace"}, {"service_instance_id", "point-instance"}, - {sc::kServiceName, "resource-name"}, - {sc::kServiceNamespace, "resource-namespace"}, - {sc::kServiceInstanceId, "resource-instance"}, + {sc::service::kServiceName, "resource-name"}, + {sc::service::kServiceNamespace, "resource-namespace"}, + {sc::service::kServiceInstanceId, "resource-instance"}, }; auto resource = opentelemetry::sdk::resource::Resource::Create({}); auto resource_filter_fn = [resource_labels = std::set{ - sc::kServiceName, sc::kServiceNamespace, - sc::kServiceInstanceId}](std::string const& l) { + sc::service::kServiceName, sc::service::kServiceNamespace, + sc::service::kServiceInstanceId}](std::string const& l) { return internal::Contains(resource_labels, l); }; diff --git a/google/cloud/opentelemetry/quickstart/.bazelrc b/google/cloud/opentelemetry/quickstart/.bazelrc index 0a6d8b05a5f4f..c8de5504a2d7d 100644 --- a/google/cloud/opentelemetry/quickstart/.bazelrc +++ b/google/cloud/opentelemetry/quickstart/.bazelrc @@ -15,33 +15,17 @@ # 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 +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 -# Enable OpenTelemetry tracing instrumentation for google-cloud-cpp. -build --@google_cloud_cpp//:enable_opentelemetry - -# OpenTelemetry versions < v1.16.0 are not compatible with Abseil -# out-of-the-box. If you are using a version of OpenTelemetry < v1.16.0, -# uncomment the following configuration: -# -# ``` -# build --@io_opentelemetry_cpp//api:with_abseil -# ``` -# -# Note that the flag is not required for OpenTelemetry versions >= v1.16.0. In -# fact, the flag may be removed in future versions of OpenTelemetry. - #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/opentelemetry/quickstart/CMakeLists.txt index 9e6d861fe40c7..940a37947e94c 100644 --- a/google/cloud/opentelemetry/quickstart/CMakeLists.txt +++ b/google/cloud/opentelemetry/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # A minimal CMakeList.txt showing how to enable OpenTelemetry tracing for Google # Cloud C++ client libraries in CMake-based projects. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-opentelemetry-quickstart CXX) find_package(google_cloud_cpp_storage REQUIRED) diff --git a/google/cloud/opentelemetry/quickstart/README.md b/google/cloud/opentelemetry/quickstart/README.md index 673e63e41ca12..564bb6dc468dd 100644 --- a/google/cloud/opentelemetry/quickstart/README.md +++ b/google/cloud/opentelemetry/quickstart/README.md @@ -42,12 +42,11 @@ observability into their operation at runtime. To enable tracing, OpenTelemetry provides full [install instructions][opentelemetry-cpp-install]. We will highlight the important points. -### Compatibility with Abseil +### Standard Template Library (STL) types -OpenTelemetry vendors-in Abseil types, defining them in `namespace absl`. The -Google Cloud client libraries depends on Abseil, which also defines these types -in the same namespace. In order to avoid ambiguous symbols, we must set certain -flags when compiling `opentelemetry-cpp`. +OpenTelemetry provides implementations for some STL types via several sources: +Abseil, its own `nostd` implementation, and the STL bundled with your compiler. +The `google-cloud-cpp` libraries require using the STL implementation. ## Using with Bazel @@ -117,7 +116,7 @@ To enable these features, add the following to your CMake configuration command: #### Details -We must supply the `-DWITH_ABSEIL=ON` flag when compiling `opentelemetry-cpp` +We must supply the `-DWITH_STL=CXX17` flag when compiling `opentelemetry-cpp` for compatibility with Abseil. We must also ensure that the `-DCMAKE_CXX_STANDARD` used to compile @@ -126,8 +125,9 @@ We must also ensure that the `-DCMAKE_CXX_STANDARD` used to compile OpenTelemetry defaults the language standard if it is not explicitly set. So it is good practice to explicitly set the language standard. -While OpenTelemetry supports C++>=11, `google-cloud-cpp` requires C++>=14. So -you can use `-DCMAKE_CXX_STANDARD=14`, `-DCMAKE_CXX_STANDARD=17`, or higher. +While OpenTelemetry supports C++>=11, `google-cloud-cpp` requires C++>=17. So +you can use `-DCMAKE_CXX_STANDARD=17`, or higher, just make sure it matches the +standard value in the `-DWITH_STL=CXXnn` flag. ### Package Managers diff --git a/google/cloud/opentelemetry/quickstart/WORKSPACE.bazel b/google/cloud/opentelemetry/quickstart/WORKSPACE.bazel index 8701234c0eab1..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 = "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/opentelemetry/trace_exporter_test.cc b/google/cloud/opentelemetry/trace_exporter_test.cc index 08802fb19f0f8..bc8cdf8695227 100644 --- a/google/cloud/opentelemetry/trace_exporter_test.cc +++ b/google/cloud/opentelemetry/trace_exporter_test.cc @@ -116,7 +116,6 @@ TEST(TraceExporter, LogsOnError) { HasSubstr("UNAVAILABLE"), HasSubstr("try again later")))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::InstallSpanCatcher; using ::google::cloud::testing_util::ScopedEnvironment; using ::testing::IsEmpty; @@ -140,7 +139,6 @@ TEST(TraceExporter, NoInfiniteExportLoop14611) { // Verify that no spans were created. EXPECT_THAT(span_catcher->GetSpans(), IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/optimization/BUILD.bazel b/google/cloud/optimization/BUILD.bazel index 6b91e836fc28e..1b0d2304b6300 100644 --- a/google/cloud/optimization/BUILD.bazel +++ b/google/cloud/optimization/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/optimization/v1:optimization_cc_grpc", + "@googleapis//google/cloud/optimization/v1:optimization_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/optimization/CMakeLists.txt b/google/cloud/optimization/CMakeLists.txt index 8e312ebdc7708..c8212ae6fd0dd 100644 --- a/google/cloud/optimization/CMakeLists.txt +++ b/google/cloud/optimization/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(optimization "Cloud Optimization API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(optimization_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/optimization/fleet_routing_client.h b/google/cloud/optimization/fleet_routing_client.h deleted file mode 100644 index ca9c5042e3dd5..0000000000000 --- a/google/cloud/optimization/fleet_routing_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/optimization/v1/fleet_routing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_FLEET_ROUTING_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_FLEET_ROUTING_CLIENT_H - -#include "google/cloud/optimization/fleet_routing_connection.h" -#include "google/cloud/optimization/v1/fleet_routing_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in optimization_v1 instead of the aliases defined in -/// this namespace. -namespace optimization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use optimization_v1::FleetRoutingClient directly. -using ::google::cloud::optimization_v1::FleetRoutingClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace optimization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_FLEET_ROUTING_CLIENT_H diff --git a/google/cloud/optimization/fleet_routing_connection.h b/google/cloud/optimization/fleet_routing_connection.h deleted file mode 100644 index 22648844eafc3..0000000000000 --- a/google/cloud/optimization/fleet_routing_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/optimization/v1/fleet_routing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_FLEET_ROUTING_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_FLEET_ROUTING_CONNECTION_H - -#include "google/cloud/optimization/fleet_routing_connection_idempotency_policy.h" -#include "google/cloud/optimization/v1/fleet_routing_connection.h" - -namespace google { -namespace cloud { -namespace optimization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use optimization_v1::MakeFleetRoutingConnection directly. -using ::google::cloud::optimization_v1::MakeFleetRoutingConnection; - -/// @deprecated Use optimization_v1::FleetRoutingConnection directly. -using ::google::cloud::optimization_v1::FleetRoutingConnection; - -/// @deprecated Use optimization_v1::FleetRoutingLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::optimization_v1:: - FleetRoutingLimitedErrorCountRetryPolicy; - -/// @deprecated Use optimization_v1::FleetRoutingLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::optimization_v1::FleetRoutingLimitedTimeRetryPolicy; - -/// @deprecated Use optimization_v1::FleetRoutingRetryPolicy directly. -using ::google::cloud::optimization_v1::FleetRoutingRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace optimization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_FLEET_ROUTING_CONNECTION_H diff --git a/google/cloud/optimization/fleet_routing_connection_idempotency_policy.h b/google/cloud/optimization/fleet_routing_connection_idempotency_policy.h deleted file mode 100644 index e9c1a1c16fcae..0000000000000 --- a/google/cloud/optimization/fleet_routing_connection_idempotency_policy.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/optimization/v1/fleet_routing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_FLEET_ROUTING_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_FLEET_ROUTING_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/optimization/v1/fleet_routing_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace optimization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// optimization_v1::MakeDefaultFleetRoutingConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::optimization_v1:: - MakeDefaultFleetRoutingConnectionIdempotencyPolicy; - -/// @deprecated Use optimization_v1::FleetRoutingConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::optimization_v1::FleetRoutingConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace optimization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_FLEET_ROUTING_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/optimization/fleet_routing_options.h b/google/cloud/optimization/fleet_routing_options.h deleted file mode 100644 index c57e5706232bc..0000000000000 --- a/google/cloud/optimization/fleet_routing_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/optimization/v1/fleet_routing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_FLEET_ROUTING_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_FLEET_ROUTING_OPTIONS_H - -#include "google/cloud/optimization/fleet_routing_connection.h" -#include "google/cloud/optimization/fleet_routing_connection_idempotency_policy.h" -#include "google/cloud/optimization/v1/fleet_routing_options.h" - -namespace google { -namespace cloud { -namespace optimization { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use optimization_v1::FleetRoutingPollingPolicyOption directly. -using ::google::cloud::optimization_v1::FleetRoutingPollingPolicyOption; - -/// @deprecated Use optimization_v1::FleetRoutingBackoffPolicyOption directly. -using ::google::cloud::optimization_v1::FleetRoutingBackoffPolicyOption; - -/// @deprecated Use -/// optimization_v1::FleetRoutingConnectionIdempotencyPolicyOption directly. -using ::google::cloud::optimization_v1:: - FleetRoutingConnectionIdempotencyPolicyOption; - -/// @deprecated Use optimization_v1::FleetRoutingPolicyOptionList directly. -using ::google::cloud::optimization_v1::FleetRoutingPolicyOptionList; - -/// @deprecated Use optimization_v1::FleetRoutingRetryPolicyOption directly. -using ::google::cloud::optimization_v1::FleetRoutingRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace optimization -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_FLEET_ROUTING_OPTIONS_H diff --git a/google/cloud/optimization/mocks/mock_fleet_routing_connection.h b/google/cloud/optimization/mocks/mock_fleet_routing_connection.h deleted file mode 100644 index 7fb7014de7369..0000000000000 --- a/google/cloud/optimization/mocks/mock_fleet_routing_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/optimization/v1/fleet_routing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_MOCKS_MOCK_FLEET_ROUTING_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_MOCKS_MOCK_FLEET_ROUTING_CONNECTION_H - -#include "google/cloud/optimization/fleet_routing_connection.h" -#include "google/cloud/optimization/v1/mocks/mock_fleet_routing_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in optimization_v1_mocks instead of the aliases -/// defined in this namespace. -namespace optimization_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use optimization_v1_mocks::MockFleetRoutingConnection directly. -using ::google::cloud::optimization_v1_mocks::MockFleetRoutingConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace optimization_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_MOCKS_MOCK_FLEET_ROUTING_CONNECTION_H diff --git a/google/cloud/optimization/quickstart/.bazelrc b/google/cloud/optimization/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/optimization/quickstart/.bazelrc +++ b/google/cloud/optimization/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/optimization/quickstart/CMakeLists.txt index 0585b27bd44d2..abe47a385b92b 100644 --- a/google/cloud/optimization/quickstart/CMakeLists.txt +++ b/google/cloud/optimization/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Optimization API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-optimization-quickstart CXX) find_package(google_cloud_cpp_optimization REQUIRED) diff --git a/google/cloud/optimization/quickstart/WORKSPACE.bazel b/google/cloud/optimization/quickstart/WORKSPACE.bazel index 902e4ac84c95a..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 = "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/optimization/v1/fleet_routing_client.h b/google/cloud/optimization/v1/fleet_routing_client.h index b374e6fe177df..9fc8dbe636252 100644 --- a/google/cloud/optimization/v1/fleet_routing_client.h +++ b/google/cloud/optimization/v1/fleet_routing_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/optimization/v1/fleet_routing_connection.h b/google/cloud/optimization/v1/fleet_routing_connection.h index 9dd07af27bbb5..8c00cd1218900 100644 --- a/google/cloud/optimization/v1/fleet_routing_connection.h +++ b/google/cloud/optimization/v1/fleet_routing_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_V1_FLEET_ROUTING_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_V1_FLEET_ROUTING_CONNECTION_H +#include "google/cloud/optimization/v1/fleet_routing.pb.h" #include "google/cloud/optimization/v1/fleet_routing_connection_idempotency_policy.h" #include "google/cloud/optimization/v1/internal/fleet_routing_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -29,8 +30,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/optimization/v1/fleet_routing_connection_idempotency_policy.h b/google/cloud/optimization/v1/fleet_routing_connection_idempotency_policy.h index c9c74a6f95cb6..194d8e40e2632 100644 --- a/google/cloud/optimization/v1/fleet_routing_connection_idempotency_policy.h +++ b/google/cloud/optimization/v1/fleet_routing_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_V1_FLEET_ROUTING_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_V1_FLEET_ROUTING_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/optimization/v1/fleet_routing.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/optimization/v1/internal/fleet_routing_auth_decorator.cc b/google/cloud/optimization/v1/internal/fleet_routing_auth_decorator.cc index 70aa6517a53ce..187f1610c8714 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_auth_decorator.cc +++ b/google/cloud/optimization/v1/internal/fleet_routing_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/optimization/v1/fleet_routing.proto #include "google/cloud/optimization/v1/internal/fleet_routing_auth_decorator.h" -#include +#include "google/cloud/optimization/v1/fleet_routing.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace optimization_v1_internal { @@ -116,3 +119,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace optimization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/optimization/v1/internal/fleet_routing_auth_decorator.h b/google/cloud/optimization/v1/internal/fleet_routing_auth_decorator.h index ceca64c42b3ee..49177581dbd84 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_auth_decorator.h +++ b/google/cloud/optimization/v1/internal/fleet_routing_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/optimization/v1/internal/fleet_routing_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 optimization_v1_internal { @@ -82,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_V1_INTERNAL_FLEET_ROUTING_AUTH_DECORATOR_H diff --git a/google/cloud/optimization/v1/internal/fleet_routing_connection_impl.h b/google/cloud/optimization/v1/internal/fleet_routing_connection_impl.h index 78d761dfb76d4..6ac00c51b9683 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_connection_impl.h +++ b/google/cloud/optimization/v1/internal/fleet_routing_connection_impl.h @@ -31,7 +31,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/optimization/v1/internal/fleet_routing_logging_decorator.cc b/google/cloud/optimization/v1/internal/fleet_routing_logging_decorator.cc index 5f191dbd6189b..e99ef53135a5e 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_logging_decorator.cc +++ b/google/cloud/optimization/v1/internal/fleet_routing_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/optimization/v1/fleet_routing.proto #include "google/cloud/optimization/v1/internal/fleet_routing_logging_decorator.h" +#include "google/cloud/optimization/v1/fleet_routing.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace optimization_v1_internal { @@ -130,3 +133,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace optimization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/optimization/v1/internal/fleet_routing_logging_decorator.h b/google/cloud/optimization/v1/internal/fleet_routing_logging_decorator.h index 8b4858fbebb2b..d49e1f1088b1c 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_logging_decorator.h +++ b/google/cloud/optimization/v1/internal/fleet_routing_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/optimization/v1/internal/fleet_routing_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 optimization_v1_internal { @@ -82,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_V1_INTERNAL_FLEET_ROUTING_LOGGING_DECORATOR_H diff --git a/google/cloud/optimization/v1/internal/fleet_routing_metadata_decorator.cc b/google/cloud/optimization/v1/internal/fleet_routing_metadata_decorator.cc index a4d8d4a19562a..71027e43cbcc6 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_metadata_decorator.cc +++ b/google/cloud/optimization/v1/internal/fleet_routing_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/optimization/v1/fleet_routing.proto #include "google/cloud/optimization/v1/internal/fleet_routing_metadata_decorator.h" +#include "google/cloud/optimization/v1/fleet_routing.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 optimization_v1_internal { @@ -122,3 +126,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace optimization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/optimization/v1/internal/fleet_routing_metadata_decorator.h b/google/cloud/optimization/v1/internal/fleet_routing_metadata_decorator.h index e44f246dc6288..4c6e78992408f 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_metadata_decorator.h +++ b/google/cloud/optimization/v1/internal/fleet_routing_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/optimization/v1/internal/fleet_routing_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 optimization_v1_internal { @@ -87,4 +90,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_V1_INTERNAL_FLEET_ROUTING_METADATA_DECORATOR_H diff --git a/google/cloud/optimization/v1/internal/fleet_routing_option_defaults.cc b/google/cloud/optimization/v1/internal/fleet_routing_option_defaults.cc index 5a174086b8f3b..6bcc5a95455a9 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_option_defaults.cc +++ b/google/cloud/optimization/v1/internal/fleet_routing_option_defaults.cc @@ -42,7 +42,7 @@ Options FleetRoutingDefaultOptions(Options options) { if (!options.has()) { options.set( optimization_v1::FleetRoutingLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/optimization/v1/internal/fleet_routing_stub.cc b/google/cloud/optimization/v1/internal/fleet_routing_stub.cc index 3bfd0d174006e..9759bed2ec710 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_stub.cc +++ b/google/cloud/optimization/v1/internal/fleet_routing_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/optimization/v1/fleet_routing.proto #include "google/cloud/optimization/v1/internal/fleet_routing_stub.h" +#include "google/cloud/optimization/v1/fleet_routing.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace optimization_v1_internal { @@ -128,3 +131,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace optimization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/optimization/v1/internal/fleet_routing_stub.h b/google/cloud/optimization/v1/internal/fleet_routing_stub.h index d0971aa7b2a11..d00ac8cc462f6 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_stub.h +++ b/google/cloud/optimization/v1/internal/fleet_routing_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_V1_INTERNAL_FLEET_ROUTING_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_V1_INTERNAL_FLEET_ROUTING_STUB_H +#include "google/cloud/optimization/v1/fleet_routing.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace optimization_v1_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_V1_INTERNAL_FLEET_ROUTING_STUB_H diff --git a/google/cloud/optimization/v1/internal/fleet_routing_stub_factory.cc b/google/cloud/optimization/v1/internal/fleet_routing_stub_factory.cc index cbe797b6aae3f..b4aecefd54498 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_stub_factory.cc +++ b/google/cloud/optimization/v1/internal/fleet_routing_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/optimization/v1/fleet_routing.proto #include "google/cloud/optimization/v1/internal/fleet_routing_stub_factory.h" +#include "google/cloud/optimization/v1/fleet_routing.grpc.pb.h" #include "google/cloud/optimization/v1/internal/fleet_routing_auth_decorator.h" #include "google/cloud/optimization/v1/internal/fleet_routing_logging_decorator.h" #include "google/cloud/optimization/v1/internal/fleet_routing_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace optimization_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace optimization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/optimization/v1/internal/fleet_routing_stub_factory.h b/google/cloud/optimization/v1/internal/fleet_routing_stub_factory.h index 1e66415f061a9..eaf94a4a0ddcf 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_stub_factory.h +++ b/google/cloud/optimization/v1/internal/fleet_routing_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace optimization_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_V1_INTERNAL_FLEET_ROUTING_STUB_FACTORY_H diff --git a/google/cloud/optimization/v1/internal/fleet_routing_tracing_connection.cc b/google/cloud/optimization/v1/internal/fleet_routing_tracing_connection.cc index 431f8a34b7678..b7c690f185d7b 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_tracing_connection.cc +++ b/google/cloud/optimization/v1/internal/fleet_routing_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace optimization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FleetRoutingTracingConnection::FleetRoutingTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -81,16 +79,12 @@ FleetRoutingTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFleetRoutingTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/optimization/v1/internal/fleet_routing_tracing_connection.h b/google/cloud/optimization/v1/internal/fleet_routing_tracing_connection.h index da337f4e74fbe..6ddd8154a1492 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_tracing_connection.h +++ b/google/cloud/optimization/v1/internal/fleet_routing_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace optimization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FleetRoutingTracingConnection : public optimization_v1::FleetRoutingConnection { public: @@ -64,8 +62,6 @@ class FleetRoutingTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/optimization/v1/internal/fleet_routing_tracing_stub.cc b/google/cloud/optimization/v1/internal/fleet_routing_tracing_stub.cc index ae3dfca5e7822..64ce83b050521 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_tracing_stub.cc +++ b/google/cloud/optimization/v1/internal/fleet_routing_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace optimization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FleetRoutingTracingStub::FleetRoutingTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -110,18 +111,14 @@ future FleetRoutingTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFleetRoutingTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace optimization_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/optimization/v1/internal/fleet_routing_tracing_stub.h b/google/cloud/optimization/v1/internal/fleet_routing_tracing_stub.h index 56d673ff901e9..db141ed9c8841 100644 --- a/google/cloud/optimization/v1/internal/fleet_routing_tracing_stub.h +++ b/google/cloud/optimization/v1/internal/fleet_routing_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace optimization_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FleetRoutingTracingStub : public FleetRoutingStub { public: ~FleetRoutingTracingStub() override = default; @@ -77,8 +78,6 @@ class FleetRoutingTracingStub : public FleetRoutingStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -93,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIMIZATION_V1_INTERNAL_FLEET_ROUTING_TRACING_STUB_H diff --git a/google/cloud/oracledatabase/BUILD.bazel b/google/cloud/oracledatabase/BUILD.bazel index 22323896ca295..96503ba64daee 100644 --- a/google/cloud/oracledatabase/BUILD.bazel +++ b/google/cloud/oracledatabase/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/oracledatabase/v1:oracledatabase_cc_grpc", + "@googleapis//google/cloud/oracledatabase/v1:oracledatabase_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/oracledatabase/quickstart/CMakeLists.txt b/google/cloud/oracledatabase/quickstart/CMakeLists.txt index c4aea0eb0e45a..317d9a15c461e 100644 --- a/google/cloud/oracledatabase/quickstart/CMakeLists.txt +++ b/google/cloud/oracledatabase/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Oracle Database@Google Cloud API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-oracledatabase-quickstart CXX) find_package(google_cloud_cpp_oracledatabase REQUIRED) diff --git a/google/cloud/oracledatabase/quickstart/WORKSPACE.bazel b/google/cloud/oracledatabase/quickstart/WORKSPACE.bazel index b33146958f675..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 = "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/oracledatabase/v1/internal/oracle_database_auth_decorator.cc b/google/cloud/oracledatabase/v1/internal/oracle_database_auth_decorator.cc index 56cb5d2227334..ccf62851e29fb 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_auth_decorator.cc +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/oracledatabase/v1/oracledatabase.proto #include "google/cloud/oracledatabase/v1/internal/oracle_database_auth_decorator.h" -#include +#include "google/cloud/oracledatabase/v1/oracledatabase.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oracledatabase_v1_internal { @@ -1200,3 +1203,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oracledatabase_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_auth_decorator.h b/google/cloud/oracledatabase/v1/internal/oracle_database_auth_decorator.h index 27c02e2708185..667caa9b5e5b6 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_auth_decorator.h +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/oracledatabase/v1/internal/oracle_database_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 oracledatabase_v1_internal { @@ -588,4 +591,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORACLEDATABASE_V1_INTERNAL_ORACLE_DATABASE_AUTH_DECORATOR_H diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_connection_impl.h b/google/cloud/oracledatabase/v1/internal/oracle_database_connection_impl.h index 3b68553918a17..6bef3c2a44add 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_connection_impl.h +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_logging_decorator.cc b/google/cloud/oracledatabase/v1/internal/oracle_database_logging_decorator.cc index 00023bafb8fef..e0e8773e33548 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_logging_decorator.cc +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/oracledatabase/v1/oracledatabase.proto #include "google/cloud/oracledatabase/v1/internal/oracle_database_logging_decorator.h" +#include "google/cloud/oracledatabase/v1/oracledatabase.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oracledatabase_v1_internal { @@ -1451,3 +1454,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oracledatabase_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_logging_decorator.h b/google/cloud/oracledatabase/v1/internal/oracle_database_logging_decorator.h index 5f771f08ff92f..113084eb278a8 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_logging_decorator.h +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/oracledatabase/v1/internal/oracle_database_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 oracledatabase_v1_internal { @@ -588,4 +591,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORACLEDATABASE_V1_INTERNAL_ORACLE_DATABASE_LOGGING_DECORATOR_H diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_metadata_decorator.cc b/google/cloud/oracledatabase/v1/internal/oracle_database_metadata_decorator.cc index 88035ed2f61ec..0028d9f645f4f 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_metadata_decorator.cc +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/oracledatabase/v1/oracledatabase.proto #include "google/cloud/oracledatabase/v1/internal/oracle_database_metadata_decorator.h" +#include "google/cloud/oracledatabase/v1/oracledatabase.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 oracledatabase_v1_internal { @@ -1025,3 +1029,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oracledatabase_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_metadata_decorator.h b/google/cloud/oracledatabase/v1/internal/oracle_database_metadata_decorator.h index d472a6ace871b..0601accbfef7c 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_metadata_decorator.h +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/oracledatabase/v1/internal/oracle_database_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 oracledatabase_v1_internal { @@ -593,4 +596,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORACLEDATABASE_V1_INTERNAL_ORACLE_DATABASE_METADATA_DECORATOR_H diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_option_defaults.cc b/google/cloud/oracledatabase/v1/internal/oracle_database_option_defaults.cc index dbbd014b788fc..3145c0eec04bc 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_option_defaults.cc +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_option_defaults.cc @@ -42,7 +42,7 @@ Options OracleDatabaseDefaultOptions(Options options) { if (!options.has()) { options.set( oracledatabase_v1::OracleDatabaseLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_stub.cc b/google/cloud/oracledatabase/v1/internal/oracle_database_stub.cc index 77844450513d2..95faa0d46f13a 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_stub.cc +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/oracledatabase/v1/oracledatabase.proto #include "google/cloud/oracledatabase/v1/internal/oracle_database_stub.h" +#include "google/cloud/oracledatabase/v1/oracledatabase.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oracledatabase_v1_internal { @@ -1423,3 +1426,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oracledatabase_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_stub.h b/google/cloud/oracledatabase/v1/internal/oracle_database_stub.h index d5073e12fae2e..33c10fcf39b5e 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_stub.h +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORACLEDATABASE_V1_INTERNAL_ORACLE_DATABASE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORACLEDATABASE_V1_INTERNAL_ORACLE_DATABASE_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/oracledatabase/v1/oracledatabase.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oracledatabase_v1_internal { @@ -1168,4 +1171,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORACLEDATABASE_V1_INTERNAL_ORACLE_DATABASE_STUB_H diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_stub_factory.cc b/google/cloud/oracledatabase/v1/internal/oracle_database_stub_factory.cc index c70f13b9909b9..09049c62f19bd 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_stub_factory.cc +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/oracledatabase/v1/oracledatabase.proto #include "google/cloud/oracledatabase/v1/internal/oracle_database_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/oracledatabase/v1/internal/oracle_database_auth_decorator.h" #include "google/cloud/oracledatabase/v1/internal/oracle_database_logging_decorator.h" #include "google/cloud/oracledatabase/v1/internal/oracle_database_metadata_decorator.h" #include "google/cloud/oracledatabase/v1/internal/oracle_database_stub.h" #include "google/cloud/oracledatabase/v1/internal/oracle_database_tracing_stub.h" +#include "google/cloud/oracledatabase/v1/oracledatabase.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oracledatabase_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oracledatabase_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_stub_factory.h b/google/cloud/oracledatabase/v1/internal/oracle_database_stub_factory.h index 814e6cf8bb1f4..7021b905387b1 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_stub_factory.h +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oracledatabase_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORACLEDATABASE_V1_INTERNAL_ORACLE_DATABASE_STUB_FACTORY_H diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_connection.cc b/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_connection.cc index a88649d174aad..d5fcbd9ce827a 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_connection.cc +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace oracledatabase_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - OracleDatabaseTracingConnection::OracleDatabaseTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -1294,16 +1292,12 @@ Status OracleDatabaseTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeOracleDatabaseTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_connection.h b/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_connection.h index 71da61c6338eb..f4a44c88b0daf 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_connection.h +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace oracledatabase_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class OracleDatabaseTracingConnection : public oracledatabase_v1::OracleDatabaseConnection { public: @@ -552,8 +550,6 @@ class OracleDatabaseTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_stub.cc b/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_stub.cc index dcf9a1bb8162d..f893efcaee236 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_stub.cc +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oracledatabase_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - OracleDatabaseTracingStub::OracleDatabaseTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -1330,18 +1331,14 @@ future OracleDatabaseTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeOracleDatabaseTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oracledatabase_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_stub.h b/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_stub.h index c4c7afa12b9a9..992c65b4b5d52 100644 --- a/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_stub.h +++ b/google/cloud/oracledatabase/v1/internal/oracle_database_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oracledatabase_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class OracleDatabaseTracingStub : public OracleDatabaseStub { public: ~OracleDatabaseTracingStub() override = default; @@ -583,8 +584,6 @@ class OracleDatabaseTracingStub : public OracleDatabaseStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -599,4 +598,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORACLEDATABASE_V1_INTERNAL_ORACLE_DATABASE_TRACING_STUB_H diff --git a/google/cloud/oracledatabase/v1/oracle_database_client.h b/google/cloud/oracledatabase/v1/oracle_database_client.h index 3ce0e8f5dd506..e6a39861a4f7c 100644 --- a/google/cloud/oracledatabase/v1/oracle_database_client.h +++ b/google/cloud/oracledatabase/v1/oracle_database_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/oracledatabase/v1/oracle_database_connection.h b/google/cloud/oracledatabase/v1/oracle_database_connection.h index 470de8cf9c3aa..ba03b59bbe068 100644 --- a/google/cloud/oracledatabase/v1/oracle_database_connection.h +++ b/google/cloud/oracledatabase/v1/oracle_database_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/oracledatabase/v1/internal/oracle_database_retry_traits.h" #include "google/cloud/oracledatabase/v1/oracle_database_connection_idempotency_policy.h" +#include "google/cloud/oracledatabase/v1/oracledatabase.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/oracledatabase/v1/oracle_database_connection_idempotency_policy.h b/google/cloud/oracledatabase/v1/oracle_database_connection_idempotency_policy.h index 3c38a367d2bdd..a696d8c00200c 100644 --- a/google/cloud/oracledatabase/v1/oracle_database_connection_idempotency_policy.h +++ b/google/cloud/oracledatabase/v1/oracle_database_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORACLEDATABASE_V1_ORACLE_DATABASE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORACLEDATABASE_V1_ORACLE_DATABASE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/oracledatabase/v1/oracledatabase.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/orgpolicy/BUILD.bazel b/google/cloud/orgpolicy/BUILD.bazel index 79d31c5db38c9..fec89ac3d3e0e 100644 --- a/google/cloud/orgpolicy/BUILD.bazel +++ b/google/cloud/orgpolicy/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/orgpolicy/v2:orgpolicy_cc_grpc", + "@googleapis//google/cloud/orgpolicy/v2:orgpolicy_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/orgpolicy/CMakeLists.txt b/google/cloud/orgpolicy/CMakeLists.txt index 5e05ffac807f2..170d71c53a863 100644 --- a/google/cloud/orgpolicy/CMakeLists.txt +++ b/google/cloud/orgpolicy/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(orgpolicy "Organization Policy API" - SERVICE_DIRS "__EMPTY__" "v2/") + SERVICE_DIRS "v2/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(orgpolicy_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/orgpolicy/mocks/mock_org_policy_connection.h b/google/cloud/orgpolicy/mocks/mock_org_policy_connection.h deleted file mode 100644 index 3db3988f946b9..0000000000000 --- a/google/cloud/orgpolicy/mocks/mock_org_policy_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orgpolicy/v2/orgpolicy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_MOCKS_MOCK_ORG_POLICY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_MOCKS_MOCK_ORG_POLICY_CONNECTION_H - -#include "google/cloud/orgpolicy/org_policy_connection.h" -#include "google/cloud/orgpolicy/v2/mocks/mock_org_policy_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in orgpolicy_v2_mocks instead of the aliases -/// defined in this namespace. -namespace orgpolicy_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use orgpolicy_v2_mocks::MockOrgPolicyConnection directly. -using ::google::cloud::orgpolicy_v2_mocks::MockOrgPolicyConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace orgpolicy_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_MOCKS_MOCK_ORG_POLICY_CONNECTION_H diff --git a/google/cloud/orgpolicy/org_policy_client.h b/google/cloud/orgpolicy/org_policy_client.h deleted file mode 100644 index 0fd05a8b2bba6..0000000000000 --- a/google/cloud/orgpolicy/org_policy_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orgpolicy/v2/orgpolicy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_ORG_POLICY_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_ORG_POLICY_CLIENT_H - -#include "google/cloud/orgpolicy/org_policy_connection.h" -#include "google/cloud/orgpolicy/v2/org_policy_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in orgpolicy_v2 instead of the aliases defined in -/// this namespace. -namespace orgpolicy { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use orgpolicy_v2::OrgPolicyClient directly. -using ::google::cloud::orgpolicy_v2::OrgPolicyClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace orgpolicy -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_ORG_POLICY_CLIENT_H diff --git a/google/cloud/orgpolicy/org_policy_connection.h b/google/cloud/orgpolicy/org_policy_connection.h deleted file mode 100644 index d44f5fb92354b..0000000000000 --- a/google/cloud/orgpolicy/org_policy_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orgpolicy/v2/orgpolicy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_ORG_POLICY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_ORG_POLICY_CONNECTION_H - -#include "google/cloud/orgpolicy/org_policy_connection_idempotency_policy.h" -#include "google/cloud/orgpolicy/v2/org_policy_connection.h" - -namespace google { -namespace cloud { -namespace orgpolicy { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use orgpolicy_v2::MakeOrgPolicyConnection directly. -using ::google::cloud::orgpolicy_v2::MakeOrgPolicyConnection; - -/// @deprecated Use orgpolicy_v2::OrgPolicyConnection directly. -using ::google::cloud::orgpolicy_v2::OrgPolicyConnection; - -/// @deprecated Use orgpolicy_v2::OrgPolicyLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::orgpolicy_v2::OrgPolicyLimitedErrorCountRetryPolicy; - -/// @deprecated Use orgpolicy_v2::OrgPolicyLimitedTimeRetryPolicy directly. -using ::google::cloud::orgpolicy_v2::OrgPolicyLimitedTimeRetryPolicy; - -/// @deprecated Use orgpolicy_v2::OrgPolicyRetryPolicy directly. -using ::google::cloud::orgpolicy_v2::OrgPolicyRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace orgpolicy -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_ORG_POLICY_CONNECTION_H diff --git a/google/cloud/orgpolicy/org_policy_connection_idempotency_policy.h b/google/cloud/orgpolicy/org_policy_connection_idempotency_policy.h deleted file mode 100644 index 34bfda72eef23..0000000000000 --- a/google/cloud/orgpolicy/org_policy_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orgpolicy/v2/orgpolicy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_ORG_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_ORG_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/orgpolicy/v2/org_policy_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace orgpolicy { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// orgpolicy_v2::MakeDefaultOrgPolicyConnectionIdempotencyPolicy directly. -using ::google::cloud::orgpolicy_v2:: - MakeDefaultOrgPolicyConnectionIdempotencyPolicy; - -/// @deprecated Use orgpolicy_v2::OrgPolicyConnectionIdempotencyPolicy directly. -using ::google::cloud::orgpolicy_v2::OrgPolicyConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace orgpolicy -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_ORG_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/orgpolicy/org_policy_options.h b/google/cloud/orgpolicy/org_policy_options.h deleted file mode 100644 index b70d98abd5aea..0000000000000 --- a/google/cloud/orgpolicy/org_policy_options.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/orgpolicy/v2/orgpolicy.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_ORG_POLICY_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_ORG_POLICY_OPTIONS_H - -#include "google/cloud/orgpolicy/org_policy_connection.h" -#include "google/cloud/orgpolicy/org_policy_connection_idempotency_policy.h" -#include "google/cloud/orgpolicy/v2/org_policy_options.h" - -namespace google { -namespace cloud { -namespace orgpolicy { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use orgpolicy_v2::OrgPolicyBackoffPolicyOption directly. -using ::google::cloud::orgpolicy_v2::OrgPolicyBackoffPolicyOption; - -/// @deprecated Use orgpolicy_v2::OrgPolicyConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::orgpolicy_v2::OrgPolicyConnectionIdempotencyPolicyOption; - -/// @deprecated Use orgpolicy_v2::OrgPolicyPolicyOptionList directly. -using ::google::cloud::orgpolicy_v2::OrgPolicyPolicyOptionList; - -/// @deprecated Use orgpolicy_v2::OrgPolicyRetryPolicyOption directly. -using ::google::cloud::orgpolicy_v2::OrgPolicyRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace orgpolicy -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_ORG_POLICY_OPTIONS_H diff --git a/google/cloud/orgpolicy/quickstart/.bazelrc b/google/cloud/orgpolicy/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/orgpolicy/quickstart/.bazelrc +++ b/google/cloud/orgpolicy/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/orgpolicy/quickstart/CMakeLists.txt index 8c66fc1ee18b9..6c1b0ce6e560c 100644 --- a/google/cloud/orgpolicy/quickstart/CMakeLists.txt +++ b/google/cloud/orgpolicy/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Organization Policy API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-orgpolicy-quickstart CXX) find_package(google_cloud_cpp_orgpolicy REQUIRED) diff --git a/google/cloud/orgpolicy/quickstart/WORKSPACE.bazel b/google/cloud/orgpolicy/quickstart/WORKSPACE.bazel index c6f76b4467e26..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 = "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/orgpolicy/v2/internal/org_policy_auth_decorator.cc b/google/cloud/orgpolicy/v2/internal/org_policy_auth_decorator.cc index 2a6d572c9932e..631ad86d0c588 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_auth_decorator.cc +++ b/google/cloud/orgpolicy/v2/internal/org_policy_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/orgpolicy/v2/orgpolicy.proto #include "google/cloud/orgpolicy/v2/internal/org_policy_auth_decorator.h" -#include +#include "google/cloud/orgpolicy/v2/orgpolicy.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace orgpolicy_v2_internal { @@ -141,3 +144,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace orgpolicy_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/orgpolicy/v2/internal/org_policy_auth_decorator.h b/google/cloud/orgpolicy/v2/internal/org_policy_auth_decorator.h index bcde853b168c6..43f16a513e7fc 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_auth_decorator.h +++ b/google/cloud/orgpolicy/v2/internal/org_policy_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace orgpolicy_v2_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_V2_INTERNAL_ORG_POLICY_AUTH_DECORATOR_H diff --git a/google/cloud/orgpolicy/v2/internal/org_policy_logging_decorator.cc b/google/cloud/orgpolicy/v2/internal/org_policy_logging_decorator.cc index 54d3226c166c6..ab2668fa21d93 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_logging_decorator.cc +++ b/google/cloud/orgpolicy/v2/internal/org_policy_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/orgpolicy/v2/orgpolicy.proto #include "google/cloud/orgpolicy/v2/internal/org_policy_logging_decorator.h" +#include "google/cloud/orgpolicy/v2/orgpolicy.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace orgpolicy_v2_internal { @@ -188,3 +191,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace orgpolicy_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/orgpolicy/v2/internal/org_policy_logging_decorator.h b/google/cloud/orgpolicy/v2/internal/org_policy_logging_decorator.h index c2c20c4708680..9d2c6ebbc2b63 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_logging_decorator.h +++ b/google/cloud/orgpolicy/v2/internal/org_policy_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace orgpolicy_v2_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_V2_INTERNAL_ORG_POLICY_LOGGING_DECORATOR_H diff --git a/google/cloud/orgpolicy/v2/internal/org_policy_metadata_decorator.cc b/google/cloud/orgpolicy/v2/internal/org_policy_metadata_decorator.cc index e8a5330dc76f2..70335c5c08ad1 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_metadata_decorator.cc +++ b/google/cloud/orgpolicy/v2/internal/org_policy_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/orgpolicy/v2/orgpolicy.proto #include "google/cloud/orgpolicy/v2/internal/org_policy_metadata_decorator.h" +#include "google/cloud/orgpolicy/v2/orgpolicy.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 orgpolicy_v2_internal { @@ -170,3 +174,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace orgpolicy_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/orgpolicy/v2/internal/org_policy_metadata_decorator.h b/google/cloud/orgpolicy/v2/internal/org_policy_metadata_decorator.h index 04c4db82e7480..36b113cd6fcdc 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_metadata_decorator.h +++ b/google/cloud/orgpolicy/v2/internal/org_policy_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace orgpolicy_v2_internal { @@ -114,4 +117,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_V2_INTERNAL_ORG_POLICY_METADATA_DECORATOR_H diff --git a/google/cloud/orgpolicy/v2/internal/org_policy_option_defaults.cc b/google/cloud/orgpolicy/v2/internal/org_policy_option_defaults.cc index e6b6769159964..68109676f5a2b 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_option_defaults.cc +++ b/google/cloud/orgpolicy/v2/internal/org_policy_option_defaults.cc @@ -40,7 +40,7 @@ Options OrgPolicyDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - orgpolicy_v2::OrgPolicyLimitedTimeRetryPolicy(std::chrono::minutes(30)) + orgpolicy_v2::OrgPolicyLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/orgpolicy/v2/internal/org_policy_stub.cc b/google/cloud/orgpolicy/v2/internal/org_policy_stub.cc index 1a91af573ca15..2ac2d7e08cf56 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_stub.cc +++ b/google/cloud/orgpolicy/v2/internal/org_policy_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/orgpolicy/v2/orgpolicy.proto #include "google/cloud/orgpolicy/v2/internal/org_policy_stub.h" +#include "google/cloud/orgpolicy/v2/orgpolicy.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace orgpolicy_v2_internal { @@ -181,3 +184,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace orgpolicy_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/orgpolicy/v2/internal/org_policy_stub.h b/google/cloud/orgpolicy/v2/internal/org_policy_stub.h index c089d85dcf08e..7cb927c8f955d 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_stub.h +++ b/google/cloud/orgpolicy/v2/internal/org_policy_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_V2_INTERNAL_ORG_POLICY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_V2_INTERNAL_ORG_POLICY_STUB_H +#include "google/cloud/orgpolicy/v2/orgpolicy.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace orgpolicy_v2_internal { @@ -174,4 +177,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_V2_INTERNAL_ORG_POLICY_STUB_H diff --git a/google/cloud/orgpolicy/v2/internal/org_policy_stub_factory.cc b/google/cloud/orgpolicy/v2/internal/org_policy_stub_factory.cc index be2ec41e8327b..bd665f5fe7b00 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_stub_factory.cc +++ b/google/cloud/orgpolicy/v2/internal/org_policy_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/orgpolicy/v2/internal/org_policy_metadata_decorator.h" #include "google/cloud/orgpolicy/v2/internal/org_policy_stub.h" #include "google/cloud/orgpolicy/v2/internal/org_policy_tracing_stub.h" +#include "google/cloud/orgpolicy/v2/orgpolicy.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace orgpolicy_v2_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace orgpolicy_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/orgpolicy/v2/internal/org_policy_stub_factory.h b/google/cloud/orgpolicy/v2/internal/org_policy_stub_factory.h index 875017f87f385..609098f968ba4 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_stub_factory.h +++ b/google/cloud/orgpolicy/v2/internal/org_policy_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace orgpolicy_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_V2_INTERNAL_ORG_POLICY_STUB_FACTORY_H diff --git a/google/cloud/orgpolicy/v2/internal/org_policy_tracing_connection.cc b/google/cloud/orgpolicy/v2/internal/org_policy_tracing_connection.cc index e41a671d65162..d80ddd7530205 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_tracing_connection.cc +++ b/google/cloud/orgpolicy/v2/internal/org_policy_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace orgpolicy_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - OrgPolicyTracingConnection::OrgPolicyTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -149,16 +147,12 @@ Status OrgPolicyTracingConnection::DeleteCustomConstraint( return internal::EndSpan(*span, child_->DeleteCustomConstraint(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeOrgPolicyTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/orgpolicy/v2/internal/org_policy_tracing_connection.h b/google/cloud/orgpolicy/v2/internal/org_policy_tracing_connection.h index 196b4ae011c9a..7f1a7a81deb62 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_tracing_connection.h +++ b/google/cloud/orgpolicy/v2/internal/org_policy_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace orgpolicy_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class OrgPolicyTracingConnection : public orgpolicy_v2::OrgPolicyConnection { public: ~OrgPolicyTracingConnection() override = default; @@ -90,8 +88,6 @@ class OrgPolicyTracingConnection : public orgpolicy_v2::OrgPolicyConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/orgpolicy/v2/internal/org_policy_tracing_stub.cc b/google/cloud/orgpolicy/v2/internal/org_policy_tracing_stub.cc index 9bf09d7ea2887..7242575ef2d38 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_tracing_stub.cc +++ b/google/cloud/orgpolicy/v2/internal/org_policy_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace orgpolicy_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - OrgPolicyTracingStub::OrgPolicyTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -178,18 +179,14 @@ Status OrgPolicyTracingStub::DeleteCustomConstraint( child_->DeleteCustomConstraint(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeOrgPolicyTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace orgpolicy_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/orgpolicy/v2/internal/org_policy_tracing_stub.h b/google/cloud/orgpolicy/v2/internal/org_policy_tracing_stub.h index 245dd5e51c597..d7e8604d490aa 100644 --- a/google/cloud/orgpolicy/v2/internal/org_policy_tracing_stub.h +++ b/google/cloud/orgpolicy/v2/internal/org_policy_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace orgpolicy_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class OrgPolicyTracingStub : public OrgPolicyStub { public: ~OrgPolicyTracingStub() override = default; @@ -105,8 +106,6 @@ class OrgPolicyTracingStub : public OrgPolicyStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -121,4 +120,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_V2_INTERNAL_ORG_POLICY_TRACING_STUB_H diff --git a/google/cloud/orgpolicy/v2/org_policy_connection.h b/google/cloud/orgpolicy/v2/org_policy_connection.h index f6c52021ad106..906d72edea586 100644 --- a/google/cloud/orgpolicy/v2/org_policy_connection.h +++ b/google/cloud/orgpolicy/v2/org_policy_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/orgpolicy/v2/internal/org_policy_retry_traits.h" #include "google/cloud/orgpolicy/v2/org_policy_connection_idempotency_policy.h" +#include "google/cloud/orgpolicy/v2/orgpolicy.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 #include namespace google { diff --git a/google/cloud/orgpolicy/v2/org_policy_connection_idempotency_policy.h b/google/cloud/orgpolicy/v2/org_policy_connection_idempotency_policy.h index 779e65c4bd0ae..2c9ece91ee114 100644 --- a/google/cloud/orgpolicy/v2/org_policy_connection_idempotency_policy.h +++ b/google/cloud/orgpolicy/v2/org_policy_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_V2_ORG_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_ORGPOLICY_V2_ORG_POLICY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/orgpolicy/v2/orgpolicy.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/osconfig/BUILD.bazel b/google/cloud/osconfig/BUILD.bazel index 7e119ffd8ccf2..44e1d5b1d60c9 100644 --- a/google/cloud/osconfig/BUILD.bazel +++ b/google/cloud/osconfig/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "agentendpoint/v1/", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/osconfig/agentendpoint/v1:agentendpoint_cc_grpc", - "@com_google_googleapis//google/cloud/osconfig/v1:osconfig_cc_grpc", + "@googleapis//google/cloud/osconfig/agentendpoint/v1:agentendpoint_cc_grpc", + "@googleapis//google/cloud/osconfig/v1:osconfig_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/osconfig/CMakeLists.txt b/google/cloud/osconfig/CMakeLists.txt index 6f11a155a5114..b5a7ec0f9cfd6 100644 --- a/google/cloud/osconfig/CMakeLists.txt +++ b/google/cloud/osconfig/CMakeLists.txt @@ -16,8 +16,8 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library( - osconfig "OS Config API" SERVICE_DIRS "__EMPTY__" "agentendpoint/v1/" "v1/") +google_cloud_cpp_add_gapic_library(osconfig "OS Config API" + SERVICE_DIRS "agentendpoint/v1/" "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(osconfig_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/osconfig/agent_endpoint_client.h b/google/cloud/osconfig/agent_endpoint_client.h deleted file mode 100644 index efd8033172aa9..0000000000000 --- a/google/cloud/osconfig/agent_endpoint_client.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/osconfig/agentendpoint/v1/agentendpoint.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENT_ENDPOINT_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENT_ENDPOINT_CLIENT_H - -#include "google/cloud/osconfig/agent_endpoint_connection.h" -#include "google/cloud/osconfig/agentendpoint/v1/agent_endpoint_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in osconfig_agentendpoint_v1 instead of the aliases -/// defined in this namespace. -namespace osconfig { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use osconfig_agentendpoint_v1::AgentEndpointServiceClient -/// directly. -using ::google::cloud::osconfig_agentendpoint_v1::AgentEndpointServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace osconfig -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENT_ENDPOINT_CLIENT_H diff --git a/google/cloud/osconfig/agent_endpoint_connection.h b/google/cloud/osconfig/agent_endpoint_connection.h deleted file mode 100644 index 94183d88a7a80..0000000000000 --- a/google/cloud/osconfig/agent_endpoint_connection.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/osconfig/agentendpoint/v1/agentendpoint.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENT_ENDPOINT_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENT_ENDPOINT_CONNECTION_H - -#include "google/cloud/osconfig/agent_endpoint_connection_idempotency_policy.h" -#include "google/cloud/osconfig/agentendpoint/v1/agent_endpoint_connection.h" - -namespace google { -namespace cloud { -namespace osconfig { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// osconfig_agentendpoint_v1::MakeAgentEndpointServiceConnection directly. -using ::google::cloud::osconfig_agentendpoint_v1:: - MakeAgentEndpointServiceConnection; - -/// @deprecated Use osconfig_agentendpoint_v1::AgentEndpointServiceConnection -/// directly. -using ::google::cloud::osconfig_agentendpoint_v1:: - AgentEndpointServiceConnection; - -/// @deprecated Use -/// osconfig_agentendpoint_v1::AgentEndpointServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::osconfig_agentendpoint_v1:: - AgentEndpointServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// osconfig_agentendpoint_v1::AgentEndpointServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::osconfig_agentendpoint_v1:: - AgentEndpointServiceLimitedTimeRetryPolicy; - -/// @deprecated Use osconfig_agentendpoint_v1::AgentEndpointServiceRetryPolicy -/// directly. -using ::google::cloud::osconfig_agentendpoint_v1:: - AgentEndpointServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace osconfig -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENT_ENDPOINT_CONNECTION_H diff --git a/google/cloud/osconfig/agent_endpoint_connection_idempotency_policy.h b/google/cloud/osconfig/agent_endpoint_connection_idempotency_policy.h deleted file mode 100644 index 7f3d0d4292b29..0000000000000 --- a/google/cloud/osconfig/agent_endpoint_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/osconfig/agentendpoint/v1/agentendpoint.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENT_ENDPOINT_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENT_ENDPOINT_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/osconfig/agentendpoint/v1/agent_endpoint_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace osconfig { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// osconfig_agentendpoint_v1::MakeDefaultAgentEndpointServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::osconfig_agentendpoint_v1:: - MakeDefaultAgentEndpointServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// osconfig_agentendpoint_v1::AgentEndpointServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::osconfig_agentendpoint_v1:: - AgentEndpointServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace osconfig -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENT_ENDPOINT_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/osconfig/agent_endpoint_options.h b/google/cloud/osconfig/agent_endpoint_options.h deleted file mode 100644 index 042ac65af658c..0000000000000 --- a/google/cloud/osconfig/agent_endpoint_options.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/osconfig/agentendpoint/v1/agentendpoint.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENT_ENDPOINT_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENT_ENDPOINT_OPTIONS_H - -#include "google/cloud/osconfig/agent_endpoint_connection.h" -#include "google/cloud/osconfig/agent_endpoint_connection_idempotency_policy.h" -#include "google/cloud/osconfig/agentendpoint/v1/agent_endpoint_options.h" - -namespace google { -namespace cloud { -namespace osconfig { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// osconfig_agentendpoint_v1::AgentEndpointServiceBackoffPolicyOption directly. -using ::google::cloud::osconfig_agentendpoint_v1:: - AgentEndpointServiceBackoffPolicyOption; - -/// @deprecated Use -/// osconfig_agentendpoint_v1::AgentEndpointServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::osconfig_agentendpoint_v1:: - AgentEndpointServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use -/// osconfig_agentendpoint_v1::AgentEndpointServicePolicyOptionList directly. -using ::google::cloud::osconfig_agentendpoint_v1:: - AgentEndpointServicePolicyOptionList; - -/// @deprecated Use -/// osconfig_agentendpoint_v1::AgentEndpointServiceRetryPolicyOption directly. -using ::google::cloud::osconfig_agentendpoint_v1:: - AgentEndpointServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace osconfig -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENT_ENDPOINT_OPTIONS_H diff --git a/google/cloud/osconfig/agentendpoint/v1/agent_endpoint_connection.h b/google/cloud/osconfig/agentendpoint/v1/agent_endpoint_connection.h index 64758060fb928..d1c5b01409ae2 100644 --- a/google/cloud/osconfig/agentendpoint/v1/agent_endpoint_connection.h +++ b/google/cloud/osconfig/agentendpoint/v1/agent_endpoint_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENTENDPOINT_V1_AGENT_ENDPOINT_CONNECTION_H #include "google/cloud/osconfig/agentendpoint/v1/agent_endpoint_connection_idempotency_policy.h" +#include "google/cloud/osconfig/agentendpoint/v1/agentendpoint.pb.h" #include "google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/osconfig/agentendpoint/v1/agent_endpoint_connection_idempotency_policy.h b/google/cloud/osconfig/agentendpoint/v1/agent_endpoint_connection_idempotency_policy.h index 69abae576454d..b99cd9ae59555 100644 --- a/google/cloud/osconfig/agentendpoint/v1/agent_endpoint_connection_idempotency_policy.h +++ b/google/cloud/osconfig/agentendpoint/v1/agent_endpoint_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENTENDPOINT_V1_AGENT_ENDPOINT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENTENDPOINT_V1_AGENT_ENDPOINT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/osconfig/agentendpoint/v1/agentendpoint.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_auth_decorator.cc b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_auth_decorator.cc index 363c78071b381..6535e5bea9547 100644 --- a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_auth_decorator.cc +++ b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/osconfig/agentendpoint/v1/agentendpoint.proto #include "google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_auth_decorator.h" -#include +#include "google/cloud/osconfig/agentendpoint/v1/agentendpoint.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_agentendpoint_v1_internal { @@ -110,3 +113,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_agentendpoint_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_auth_decorator.h b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_auth_decorator.h index 5f7b985f53541..993c39db53306 100644 --- a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_auth_decorator.h +++ b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_agentendpoint_v1_internal { @@ -92,4 +95,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENTENDPOINT_V1_INTERNAL_AGENT_ENDPOINT_AUTH_DECORATOR_H diff --git a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_logging_decorator.cc b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_logging_decorator.cc index 922a67a3fe113..65061366f9c70 100644 --- a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_logging_decorator.cc +++ b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/osconfig/agentendpoint/v1/agentendpoint.proto #include "google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_logging_decorator.h" +#include "google/cloud/osconfig/agentendpoint/v1/agentendpoint.grpc.pb.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_agentendpoint_v1_internal { @@ -156,3 +159,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_agentendpoint_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_logging_decorator.h b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_logging_decorator.h index 2209bad320d2e..377aedd11d803 100644 --- a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_logging_decorator.h +++ b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_agentendpoint_v1_internal { @@ -93,4 +96,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENTENDPOINT_V1_INTERNAL_AGENT_ENDPOINT_LOGGING_DECORATOR_H diff --git a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_metadata_decorator.cc b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_metadata_decorator.cc index c1fcb75bf37d2..da0502e564261 100644 --- a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_metadata_decorator.cc +++ b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/osconfig/agentendpoint/v1/agentendpoint.proto #include "google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_metadata_decorator.h" +#include "google/cloud/osconfig/agentendpoint/v1/agentendpoint.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 osconfig_agentendpoint_v1_internal { @@ -126,3 +130,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_agentendpoint_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_metadata_decorator.h b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_metadata_decorator.h index e22253e9df5b6..e8afee306353e 100644 --- a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_metadata_decorator.h +++ b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_agentendpoint_v1_internal { @@ -98,4 +101,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENTENDPOINT_V1_INTERNAL_AGENT_ENDPOINT_METADATA_DECORATOR_H diff --git a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_option_defaults.cc b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_option_defaults.cc index fed7bc39cedbb..4712075a30879 100644 --- a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_option_defaults.cc +++ b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_option_defaults.cc @@ -44,7 +44,7 @@ Options AgentEndpointServiceDefaultOptions(Options options) { options.set< osconfig_agentendpoint_v1::AgentEndpointServiceRetryPolicyOption>( osconfig_agentendpoint_v1::AgentEndpointServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_agentendpoint_v1_internal { @@ -129,3 +132,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_agentendpoint_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_stub.h b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_stub.h index 607ff10293311..36e0f2697c1c7 100644 --- a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_stub.h +++ b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENTENDPOINT_V1_INTERNAL_AGENT_ENDPOINT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENTENDPOINT_V1_INTERNAL_AGENT_ENDPOINT_STUB_H +#include "google/cloud/osconfig/agentendpoint/v1/agentendpoint.grpc.pb.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_agentendpoint_v1_internal { @@ -147,4 +150,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENTENDPOINT_V1_INTERNAL_AGENT_ENDPOINT_STUB_H diff --git a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_stub_factory.cc b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_stub_factory.cc index 6774affbd4e41..fb613c8f7b61d 100644 --- a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_stub_factory.cc +++ b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/osconfig/agentendpoint/v1/agentendpoint.proto #include "google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_stub_factory.h" +#include "google/cloud/osconfig/agentendpoint/v1/agentendpoint.grpc.pb.h" #include "google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_auth_decorator.h" #include "google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_logging_decorator.h" #include "google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_agentendpoint_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_agentendpoint_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_stub_factory.h b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_stub_factory.h index f7841e9100efb..ede06caada14b 100644 --- a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_stub_factory.h +++ b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_agentendpoint_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENTENDPOINT_V1_INTERNAL_AGENT_ENDPOINT_STUB_FACTORY_H diff --git a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_connection.cc b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_connection.cc index e437ec7361f65..36b92253d2b9b 100644 --- a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_connection.cc +++ b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace osconfig_agentendpoint_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AgentEndpointServiceTracingConnection::AgentEndpointServiceTracingConnection( std::shared_ptr child) @@ -114,18 +112,14 @@ AgentEndpointServiceTracingConnection::ReportVmInventory( return internal::EndSpan(*span, child_->ReportVmInventory(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAgentEndpointServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_connection.h b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_connection.h index 10de8ec774555..2fc1eede57045 100644 --- a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_connection.h +++ b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace osconfig_agentendpoint_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AgentEndpointServiceTracingConnection : public osconfig_agentendpoint_v1::AgentEndpointServiceConnection { public: @@ -82,8 +80,6 @@ class AgentEndpointServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_stub.cc b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_stub.cc index 2841bfb00a6df..2d312841ad98c 100644 --- a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_stub.cc +++ b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_agentendpoint_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AgentEndpointServiceTracingStub::AgentEndpointServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -136,18 +137,14 @@ AgentEndpointServiceTracingStub::ReportVmInventory( context, *span, child_->ReportVmInventory(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAgentEndpointServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_agentendpoint_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_stub.h b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_stub.h index edb2a02461bd4..dda29bce331f5 100644 --- a/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_stub.h +++ b/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_agentendpoint_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AgentEndpointServiceTracingStub : public AgentEndpointServiceStub { public: ~AgentEndpointServiceTracingStub() override = default; @@ -89,8 +90,6 @@ class AgentEndpointServiceTracingStub : public AgentEndpointServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -105,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_AGENTENDPOINT_V1_INTERNAL_AGENT_ENDPOINT_TRACING_STUB_H diff --git a/google/cloud/osconfig/mocks/mock_agent_endpoint_connection.h b/google/cloud/osconfig/mocks/mock_agent_endpoint_connection.h deleted file mode 100644 index 5857d67310593..0000000000000 --- a/google/cloud/osconfig/mocks/mock_agent_endpoint_connection.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/osconfig/agentendpoint/v1/agentendpoint.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_MOCKS_MOCK_AGENT_ENDPOINT_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_MOCKS_MOCK_AGENT_ENDPOINT_CONNECTION_H - -#include "google/cloud/osconfig/agent_endpoint_connection.h" -#include "google/cloud/osconfig/agentendpoint/v1/mocks/mock_agent_endpoint_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in osconfig_agentendpoint_v1_mocks instead of the aliases -/// defined in this namespace. -namespace osconfig_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// osconfig_agentendpoint_v1_mocks::MockAgentEndpointServiceConnection -/// directly. -using ::google::cloud::osconfig_agentendpoint_v1_mocks:: - MockAgentEndpointServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace osconfig_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_MOCKS_MOCK_AGENT_ENDPOINT_CONNECTION_H diff --git a/google/cloud/osconfig/mocks/mock_os_config_connection.h b/google/cloud/osconfig/mocks/mock_os_config_connection.h deleted file mode 100644 index 787a20b03dde5..0000000000000 --- a/google/cloud/osconfig/mocks/mock_os_config_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/osconfig/v1/osconfig_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_MOCKS_MOCK_OS_CONFIG_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_MOCKS_MOCK_OS_CONFIG_CONNECTION_H - -#include "google/cloud/osconfig/os_config_connection.h" -#include "google/cloud/osconfig/v1/mocks/mock_os_config_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in osconfig_v1_mocks instead of the aliases -/// defined in this namespace. -namespace osconfig_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use osconfig_v1_mocks::MockOsConfigServiceConnection directly. -using ::google::cloud::osconfig_v1_mocks::MockOsConfigServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace osconfig_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_MOCKS_MOCK_OS_CONFIG_CONNECTION_H diff --git a/google/cloud/osconfig/os_config_client.h b/google/cloud/osconfig/os_config_client.h deleted file mode 100644 index 1ed7ff8388434..0000000000000 --- a/google/cloud/osconfig/os_config_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/osconfig/v1/osconfig_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_OS_CONFIG_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_OS_CONFIG_CLIENT_H - -#include "google/cloud/osconfig/os_config_connection.h" -#include "google/cloud/osconfig/v1/os_config_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in osconfig_v1 instead of the aliases defined in -/// this namespace. -namespace osconfig { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use osconfig_v1::OsConfigServiceClient directly. -using ::google::cloud::osconfig_v1::OsConfigServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace osconfig -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_OS_CONFIG_CLIENT_H diff --git a/google/cloud/osconfig/os_config_connection.h b/google/cloud/osconfig/os_config_connection.h deleted file mode 100644 index 54ed6627f74e3..0000000000000 --- a/google/cloud/osconfig/os_config_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/osconfig/v1/osconfig_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_OS_CONFIG_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_OS_CONFIG_CONNECTION_H - -#include "google/cloud/osconfig/os_config_connection_idempotency_policy.h" -#include "google/cloud/osconfig/v1/os_config_connection.h" - -namespace google { -namespace cloud { -namespace osconfig { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use osconfig_v1::MakeOsConfigServiceConnection directly. -using ::google::cloud::osconfig_v1::MakeOsConfigServiceConnection; - -/// @deprecated Use osconfig_v1::OsConfigServiceConnection directly. -using ::google::cloud::osconfig_v1::OsConfigServiceConnection; - -/// @deprecated Use osconfig_v1::OsConfigServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::osconfig_v1::OsConfigServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use osconfig_v1::OsConfigServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::osconfig_v1::OsConfigServiceLimitedTimeRetryPolicy; - -/// @deprecated Use osconfig_v1::OsConfigServiceRetryPolicy directly. -using ::google::cloud::osconfig_v1::OsConfigServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace osconfig -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_OS_CONFIG_CONNECTION_H diff --git a/google/cloud/osconfig/os_config_connection_idempotency_policy.h b/google/cloud/osconfig/os_config_connection_idempotency_policy.h deleted file mode 100644 index 00addb807efc9..0000000000000 --- a/google/cloud/osconfig/os_config_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/osconfig/v1/osconfig_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_OS_CONFIG_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_OS_CONFIG_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/osconfig/v1/os_config_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace osconfig { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// osconfig_v1::MakeDefaultOsConfigServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::osconfig_v1:: - MakeDefaultOsConfigServiceConnectionIdempotencyPolicy; - -/// @deprecated Use osconfig_v1::OsConfigServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::osconfig_v1::OsConfigServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace osconfig -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_OS_CONFIG_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/osconfig/os_config_options.h b/google/cloud/osconfig/os_config_options.h deleted file mode 100644 index 1365ea86fdbf5..0000000000000 --- a/google/cloud/osconfig/os_config_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/osconfig/v1/osconfig_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_OS_CONFIG_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_OS_CONFIG_OPTIONS_H - -#include "google/cloud/osconfig/os_config_connection.h" -#include "google/cloud/osconfig/os_config_connection_idempotency_policy.h" -#include "google/cloud/osconfig/v1/os_config_options.h" - -namespace google { -namespace cloud { -namespace osconfig { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use osconfig_v1::OsConfigServiceBackoffPolicyOption directly. -using ::google::cloud::osconfig_v1::OsConfigServiceBackoffPolicyOption; - -/// @deprecated Use -/// osconfig_v1::OsConfigServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::osconfig_v1:: - OsConfigServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use osconfig_v1::OsConfigServicePolicyOptionList directly. -using ::google::cloud::osconfig_v1::OsConfigServicePolicyOptionList; - -/// @deprecated Use osconfig_v1::OsConfigServiceRetryPolicyOption directly. -using ::google::cloud::osconfig_v1::OsConfigServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace osconfig -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_OS_CONFIG_OPTIONS_H diff --git a/google/cloud/osconfig/quickstart/.bazelrc b/google/cloud/osconfig/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/osconfig/quickstart/.bazelrc +++ b/google/cloud/osconfig/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/osconfig/quickstart/CMakeLists.txt index 773d2255a851a..00fbef0c3a5f8 100644 --- a/google/cloud/osconfig/quickstart/CMakeLists.txt +++ b/google/cloud/osconfig/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the OS Config API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-osconfig-quickstart CXX) find_package(google_cloud_cpp_osconfig REQUIRED) diff --git a/google/cloud/osconfig/quickstart/WORKSPACE.bazel b/google/cloud/osconfig/quickstart/WORKSPACE.bazel index e11ace3d63a5b..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 = "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/osconfig/v1/internal/os_config_auth_decorator.cc b/google/cloud/osconfig/v1/internal/os_config_auth_decorator.cc index c53f5d84a5e07..4b042457d9d99 100644 --- a/google/cloud/osconfig/v1/internal/os_config_auth_decorator.cc +++ b/google/cloud/osconfig/v1/internal/os_config_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/osconfig/v1/osconfig_service.proto #include "google/cloud/osconfig/v1/internal/os_config_auth_decorator.h" -#include +#include "google/cloud/osconfig/v1/osconfig_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -143,3 +146,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/v1/internal/os_config_auth_decorator.h b/google/cloud/osconfig/v1/internal/os_config_auth_decorator.h index cdd87f63a5e72..ddae441a76311 100644 --- a/google/cloud/osconfig/v1/internal/os_config_auth_decorator.h +++ b/google/cloud/osconfig/v1/internal/os_config_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_AUTH_DECORATOR_H diff --git a/google/cloud/osconfig/v1/internal/os_config_logging_decorator.cc b/google/cloud/osconfig/v1/internal/os_config_logging_decorator.cc index 422bbd77dd0bc..3a15ca687032c 100644 --- a/google/cloud/osconfig/v1/internal/os_config_logging_decorator.cc +++ b/google/cloud/osconfig/v1/internal/os_config_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/osconfig/v1/osconfig_service.proto #include "google/cloud/osconfig/v1/internal/os_config_logging_decorator.h" +#include "google/cloud/osconfig/v1/osconfig_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -194,3 +197,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/v1/internal/os_config_logging_decorator.h b/google/cloud/osconfig/v1/internal/os_config_logging_decorator.h index c9dbe5f501afa..89e9fe7c5fecf 100644 --- a/google/cloud/osconfig/v1/internal/os_config_logging_decorator.h +++ b/google/cloud/osconfig/v1/internal/os_config_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_LOGGING_DECORATOR_H diff --git a/google/cloud/osconfig/v1/internal/os_config_metadata_decorator.cc b/google/cloud/osconfig/v1/internal/os_config_metadata_decorator.cc index 10a01e4680942..c29d257df3231 100644 --- a/google/cloud/osconfig/v1/internal/os_config_metadata_decorator.cc +++ b/google/cloud/osconfig/v1/internal/os_config_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/osconfig/v1/osconfig_service.proto #include "google/cloud/osconfig/v1/internal/os_config_metadata_decorator.h" +#include "google/cloud/osconfig/v1/osconfig_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 osconfig_v1_internal { @@ -171,3 +175,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/v1/internal/os_config_metadata_decorator.h b/google/cloud/osconfig/v1/internal/os_config_metadata_decorator.h index 1257212edec18..3b462c565ba79 100644 --- a/google/cloud/osconfig/v1/internal/os_config_metadata_decorator.h +++ b/google/cloud/osconfig/v1/internal/os_config_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -115,4 +118,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_METADATA_DECORATOR_H diff --git a/google/cloud/osconfig/v1/internal/os_config_option_defaults.cc b/google/cloud/osconfig/v1/internal/os_config_option_defaults.cc index de6905962bb55..9956120ec14d6 100644 --- a/google/cloud/osconfig/v1/internal/os_config_option_defaults.cc +++ b/google/cloud/osconfig/v1/internal/os_config_option_defaults.cc @@ -42,7 +42,7 @@ Options OsConfigServiceDefaultOptions(Options options) { if (!options.has()) { options.set( osconfig_v1::OsConfigServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/osconfig/v1/internal/os_config_stub.cc b/google/cloud/osconfig/v1/internal/os_config_stub.cc index 47a65a6cfe55a..e0b02460e065a 100644 --- a/google/cloud/osconfig/v1/internal/os_config_stub.cc +++ b/google/cloud/osconfig/v1/internal/os_config_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/osconfig/v1/osconfig_service.proto #include "google/cloud/osconfig/v1/internal/os_config_stub.h" +#include "google/cloud/osconfig/v1/osconfig_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -179,3 +182,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/v1/internal/os_config_stub.h b/google/cloud/osconfig/v1/internal/os_config_stub.h index 6a647b2b8e24d..6beec98404cfa 100644 --- a/google/cloud/osconfig/v1/internal/os_config_stub.h +++ b/google/cloud/osconfig/v1/internal/os_config_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_STUB_H +#include "google/cloud/osconfig/v1/osconfig_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -180,4 +183,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_STUB_H diff --git a/google/cloud/osconfig/v1/internal/os_config_stub_factory.cc b/google/cloud/osconfig/v1/internal/os_config_stub_factory.cc index 496336f622488..89dff21b6bd21 100644 --- a/google/cloud/osconfig/v1/internal/os_config_stub_factory.cc +++ b/google/cloud/osconfig/v1/internal/os_config_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/osconfig/v1/internal/os_config_metadata_decorator.h" #include "google/cloud/osconfig/v1/internal/os_config_stub.h" #include "google/cloud/osconfig/v1/internal/os_config_tracing_stub.h" +#include "google/cloud/osconfig/v1/osconfig_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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/v1/internal/os_config_stub_factory.h b/google/cloud/osconfig/v1/internal/os_config_stub_factory.h index 5a43d802f48d7..dd1b02afd90e1 100644 --- a/google/cloud/osconfig/v1/internal/os_config_stub_factory.h +++ b/google/cloud/osconfig/v1/internal/os_config_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_STUB_FACTORY_H diff --git a/google/cloud/osconfig/v1/internal/os_config_tracing_connection.cc b/google/cloud/osconfig/v1/internal/os_config_tracing_connection.cc index 168ea2e62d9ff..4e31ef7667433 100644 --- a/google/cloud/osconfig/v1/internal/os_config_tracing_connection.cc +++ b/google/cloud/osconfig/v1/internal/os_config_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace osconfig_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - OsConfigServiceTracingConnection::OsConfigServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -148,16 +146,12 @@ OsConfigServiceTracingConnection::ResumePatchDeployment( return internal::EndSpan(*span, child_->ResumePatchDeployment(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeOsConfigServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/osconfig/v1/internal/os_config_tracing_connection.h b/google/cloud/osconfig/v1/internal/os_config_tracing_connection.h index 61353e6599ad2..33b4630405a29 100644 --- a/google/cloud/osconfig/v1/internal/os_config_tracing_connection.h +++ b/google/cloud/osconfig/v1/internal/os_config_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace osconfig_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class OsConfigServiceTracingConnection : public osconfig_v1::OsConfigServiceConnection { public: @@ -91,8 +89,6 @@ class OsConfigServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/osconfig/v1/internal/os_config_tracing_stub.cc b/google/cloud/osconfig/v1/internal/os_config_tracing_stub.cc index 0b870ca4dd953..14f2c82512641 100644 --- a/google/cloud/osconfig/v1/internal/os_config_tracing_stub.cc +++ b/google/cloud/osconfig/v1/internal/os_config_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - OsConfigServiceTracingStub::OsConfigServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -177,18 +178,14 @@ OsConfigServiceTracingStub::ResumePatchDeployment( context, *span, child_->ResumePatchDeployment(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeOsConfigServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/v1/internal/os_config_tracing_stub.h b/google/cloud/osconfig/v1/internal/os_config_tracing_stub.h index 245030ad4e253..034442f8b56fe 100644 --- a/google/cloud/osconfig/v1/internal/os_config_tracing_stub.h +++ b/google/cloud/osconfig/v1/internal/os_config_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class OsConfigServiceTracingStub : public OsConfigServiceStub { public: ~OsConfigServiceTracingStub() override = default; @@ -106,8 +107,6 @@ class OsConfigServiceTracingStub : public OsConfigServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -122,4 +121,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_TRACING_STUB_H diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_auth_decorator.cc b/google/cloud/osconfig/v1/internal/os_config_zonal_auth_decorator.cc index a6e2755ce6942..ad3068af6e9c6 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_auth_decorator.cc +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/osconfig/v1/osconfig_zonal_service.proto #include "google/cloud/osconfig/v1/internal/os_config_zonal_auth_decorator.h" -#include +#include "google/cloud/osconfig/v1/osconfig_zonal_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -250,3 +253,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_auth_decorator.h b/google/cloud/osconfig/v1/internal/os_config_zonal_auth_decorator.h index c7f35361bbd70..ef21308b58726 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_auth_decorator.h +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/osconfig/v1/internal/os_config_zonal_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 osconfig_v1_internal { @@ -151,4 +154,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_ZONAL_AUTH_DECORATOR_H diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_connection_impl.h b/google/cloud/osconfig/v1/internal/os_config_zonal_connection_impl.h index 0f545c10f1407..117173c5e5a8d 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_connection_impl.h +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_logging_decorator.cc b/google/cloud/osconfig/v1/internal/os_config_zonal_logging_decorator.cc index 175cb361bf851..8ce605b17045d 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_logging_decorator.cc +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/osconfig/v1/osconfig_zonal_service.proto #include "google/cloud/osconfig/v1/internal/os_config_zonal_logging_decorator.h" +#include "google/cloud/osconfig/v1/osconfig_zonal_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -299,3 +302,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_logging_decorator.h b/google/cloud/osconfig/v1/internal/os_config_zonal_logging_decorator.h index df2f17014f766..6022eae7dacc4 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_logging_decorator.h +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/osconfig/v1/internal/os_config_zonal_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 osconfig_v1_internal { @@ -151,4 +154,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_ZONAL_LOGGING_DECORATOR_H diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_metadata_decorator.cc b/google/cloud/osconfig/v1/internal/os_config_zonal_metadata_decorator.cc index 55ac47115b738..6642c11c3c424 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_metadata_decorator.cc +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/osconfig/v1/osconfig_zonal_service.proto #include "google/cloud/osconfig/v1/internal/os_config_zonal_metadata_decorator.h" +#include "google/cloud/osconfig/v1/osconfig_zonal_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 osconfig_v1_internal { @@ -243,3 +247,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_metadata_decorator.h b/google/cloud/osconfig/v1/internal/os_config_zonal_metadata_decorator.h index b2bf948eb6462..a347a59c0b09d 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_metadata_decorator.h +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/osconfig/v1/internal/os_config_zonal_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 osconfig_v1_internal { @@ -157,4 +160,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_ZONAL_METADATA_DECORATOR_H diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_option_defaults.cc b/google/cloud/osconfig/v1/internal/os_config_zonal_option_defaults.cc index 815dde277ba8f..292262712f3ea 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_option_defaults.cc +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_option_defaults.cc @@ -42,7 +42,7 @@ Options OsConfigZonalServiceDefaultOptions(Options options) { if (!options.has()) { options.set( osconfig_v1::OsConfigZonalServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_stub.cc b/google/cloud/osconfig/v1/internal/os_config_zonal_stub.cc index 741676222f571..b2dc378c99c3f 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_stub.cc +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/osconfig/v1/osconfig_zonal_service.proto #include "google/cloud/osconfig/v1/internal/os_config_zonal_stub.h" +#include "google/cloud/osconfig/v1/osconfig_zonal_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -295,3 +298,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_stub.h b/google/cloud/osconfig/v1/internal/os_config_zonal_stub.h index 66f2c896423dd..9822c4e76b426 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_stub.h +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_ZONAL_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_ZONAL_STUB_H +#include "google/cloud/osconfig/v1/osconfig_zonal_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -270,4 +273,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_ZONAL_STUB_H diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_stub_factory.cc b/google/cloud/osconfig/v1/internal/os_config_zonal_stub_factory.cc index b677224d56a6c..9d9710a7278b0 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_stub_factory.cc +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/osconfig/v1/internal/os_config_zonal_metadata_decorator.h" #include "google/cloud/osconfig/v1/internal/os_config_zonal_stub.h" #include "google/cloud/osconfig/v1/internal/os_config_zonal_tracing_stub.h" +#include "google/cloud/osconfig/v1/osconfig_zonal_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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_stub_factory.h b/google/cloud/osconfig/v1/internal/os_config_zonal_stub_factory.h index 5a276fbe9e9df..4c7197225a31a 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_stub_factory.h +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_ZONAL_STUB_FACTORY_H diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_connection.cc b/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_connection.cc index aacb9fba014b2..660cfcdc5384c 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_connection.cc +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace osconfig_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - OsConfigZonalServiceTracingConnection::OsConfigZonalServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -234,17 +232,13 @@ OsConfigZonalServiceTracingConnection::ListVulnerabilityReports( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeOsConfigZonalServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_connection.h b/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_connection.h index e4d7227fee80e..3552204efe11a 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_connection.h +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace osconfig_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class OsConfigZonalServiceTracingConnection : public osconfig_v1::OsConfigZonalServiceConnection { public: @@ -129,8 +127,6 @@ class OsConfigZonalServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_stub.cc b/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_stub.cc index 2e764a524414d..2eae4bafbdd9f 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_stub.cc +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - OsConfigZonalServiceTracingStub::OsConfigZonalServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -281,18 +282,14 @@ future OsConfigZonalServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeOsConfigZonalServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_stub.h b/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_stub.h index 2b5eb2f306c25..962c84d436c15 100644 --- a/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_stub.h +++ b/google/cloud/osconfig/v1/internal/os_config_zonal_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace osconfig_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class OsConfigZonalServiceTracingStub : public OsConfigZonalServiceStub { public: ~OsConfigZonalServiceTracingStub() override = default; @@ -147,8 +148,6 @@ class OsConfigZonalServiceTracingStub : public OsConfigZonalServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -163,4 +162,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_INTERNAL_OS_CONFIG_ZONAL_TRACING_STUB_H diff --git a/google/cloud/osconfig/v1/os_config_connection.h b/google/cloud/osconfig/v1/os_config_connection.h index ad2751fbed287..125bd6f56b135 100644 --- a/google/cloud/osconfig/v1/os_config_connection.h +++ b/google/cloud/osconfig/v1/os_config_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/osconfig/v1/internal/os_config_retry_traits.h" #include "google/cloud/osconfig/v1/os_config_connection_idempotency_policy.h" +#include "google/cloud/osconfig/v1/osconfig_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 #include namespace google { diff --git a/google/cloud/osconfig/v1/os_config_connection_idempotency_policy.h b/google/cloud/osconfig/v1/os_config_connection_idempotency_policy.h index d05042bf3a0e7..89a538214b01e 100644 --- a/google/cloud/osconfig/v1/os_config_connection_idempotency_policy.h +++ b/google/cloud/osconfig/v1/os_config_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_OS_CONFIG_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_OS_CONFIG_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/osconfig/v1/osconfig_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/osconfig/v1/os_config_zonal_client.h b/google/cloud/osconfig/v1/os_config_zonal_client.h index f19baca9cd1fc..f4e91c0c693e2 100644 --- a/google/cloud/osconfig/v1/os_config_zonal_client.h +++ b/google/cloud/osconfig/v1/os_config_zonal_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/osconfig/v1/os_config_zonal_connection.h b/google/cloud/osconfig/v1/os_config_zonal_connection.h index 90915160aa392..0b584de775804 100644 --- a/google/cloud/osconfig/v1/os_config_zonal_connection.h +++ b/google/cloud/osconfig/v1/os_config_zonal_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/osconfig/v1/internal/os_config_zonal_retry_traits.h" #include "google/cloud/osconfig/v1/os_config_zonal_connection_idempotency_policy.h" +#include "google/cloud/osconfig/v1/osconfig_zonal_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/osconfig/v1/os_config_zonal_connection_idempotency_policy.h b/google/cloud/osconfig/v1/os_config_zonal_connection_idempotency_policy.h index 512e3df51bd68..f9bb1aedcc737 100644 --- a/google/cloud/osconfig/v1/os_config_zonal_connection_idempotency_policy.h +++ b/google/cloud/osconfig/v1/os_config_zonal_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_OS_CONFIG_ZONAL_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSCONFIG_V1_OS_CONFIG_ZONAL_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/osconfig/v1/osconfig_zonal_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/oslogin/BUILD.bazel b/google/cloud/oslogin/BUILD.bazel index cc1dca8a5510e..85f9ea1baa849 100644 --- a/google/cloud/oslogin/BUILD.bazel +++ b/google/cloud/oslogin/BUILD.bazel @@ -19,13 +19,12 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/oslogin/common:common_cc_grpc", - "@com_google_googleapis//google/cloud/oslogin/v1:oslogin_cc_grpc", + "@googleapis//google/cloud/oslogin/common:common_cc_grpc", + "@googleapis//google/cloud/oslogin/v1:oslogin_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/oslogin/CMakeLists.txt b/google/cloud/oslogin/CMakeLists.txt index db13a3013d920..1271d1d6b602f 100644 --- a/google/cloud/oslogin/CMakeLists.txt +++ b/google/cloud/oslogin/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(oslogin "Cloud OS Login API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(oslogin_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/oslogin/mocks/mock_os_login_connection.h b/google/cloud/oslogin/mocks/mock_os_login_connection.h deleted file mode 100644 index 6af7e32cb08aa..0000000000000 --- a/google/cloud/oslogin/mocks/mock_os_login_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/oslogin/v1/oslogin.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_MOCKS_MOCK_OS_LOGIN_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_MOCKS_MOCK_OS_LOGIN_CONNECTION_H - -#include "google/cloud/oslogin/os_login_connection.h" -#include "google/cloud/oslogin/v1/mocks/mock_os_login_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in oslogin_v1_mocks instead of the aliases -/// defined in this namespace. -namespace oslogin_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use oslogin_v1_mocks::MockOsLoginServiceConnection directly. -using ::google::cloud::oslogin_v1_mocks::MockOsLoginServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace oslogin_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_MOCKS_MOCK_OS_LOGIN_CONNECTION_H diff --git a/google/cloud/oslogin/os_login_client.h b/google/cloud/oslogin/os_login_client.h deleted file mode 100644 index 604e9435cfe0d..0000000000000 --- a/google/cloud/oslogin/os_login_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/oslogin/v1/oslogin.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_OS_LOGIN_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_OS_LOGIN_CLIENT_H - -#include "google/cloud/oslogin/os_login_connection.h" -#include "google/cloud/oslogin/v1/os_login_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in oslogin_v1 instead of the aliases defined in -/// this namespace. -namespace oslogin { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use oslogin_v1::OsLoginServiceClient directly. -using ::google::cloud::oslogin_v1::OsLoginServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace oslogin -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_OS_LOGIN_CLIENT_H diff --git a/google/cloud/oslogin/os_login_connection.h b/google/cloud/oslogin/os_login_connection.h deleted file mode 100644 index 3f3357e521978..0000000000000 --- a/google/cloud/oslogin/os_login_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/oslogin/v1/oslogin.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_OS_LOGIN_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_OS_LOGIN_CONNECTION_H - -#include "google/cloud/oslogin/os_login_connection_idempotency_policy.h" -#include "google/cloud/oslogin/v1/os_login_connection.h" - -namespace google { -namespace cloud { -namespace oslogin { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use oslogin_v1::MakeOsLoginServiceConnection directly. -using ::google::cloud::oslogin_v1::MakeOsLoginServiceConnection; - -/// @deprecated Use oslogin_v1::OsLoginServiceConnection directly. -using ::google::cloud::oslogin_v1::OsLoginServiceConnection; - -/// @deprecated Use oslogin_v1::OsLoginServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::oslogin_v1::OsLoginServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use oslogin_v1::OsLoginServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::oslogin_v1::OsLoginServiceLimitedTimeRetryPolicy; - -/// @deprecated Use oslogin_v1::OsLoginServiceRetryPolicy directly. -using ::google::cloud::oslogin_v1::OsLoginServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace oslogin -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_OS_LOGIN_CONNECTION_H diff --git a/google/cloud/oslogin/os_login_connection_idempotency_policy.h b/google/cloud/oslogin/os_login_connection_idempotency_policy.h deleted file mode 100644 index b7da81804504d..0000000000000 --- a/google/cloud/oslogin/os_login_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/oslogin/v1/oslogin.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_OS_LOGIN_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_OS_LOGIN_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/oslogin/v1/os_login_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace oslogin { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// oslogin_v1::MakeDefaultOsLoginServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::oslogin_v1:: - MakeDefaultOsLoginServiceConnectionIdempotencyPolicy; - -/// @deprecated Use oslogin_v1::OsLoginServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::oslogin_v1::OsLoginServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace oslogin -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_OS_LOGIN_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/oslogin/os_login_options.h b/google/cloud/oslogin/os_login_options.h deleted file mode 100644 index 011618f74761a..0000000000000 --- a/google/cloud/oslogin/os_login_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/oslogin/v1/oslogin.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_OS_LOGIN_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_OS_LOGIN_OPTIONS_H - -#include "google/cloud/oslogin/os_login_connection.h" -#include "google/cloud/oslogin/os_login_connection_idempotency_policy.h" -#include "google/cloud/oslogin/v1/os_login_options.h" - -namespace google { -namespace cloud { -namespace oslogin { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use oslogin_v1::OsLoginServiceBackoffPolicyOption directly. -using ::google::cloud::oslogin_v1::OsLoginServiceBackoffPolicyOption; - -/// @deprecated Use oslogin_v1::OsLoginServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::oslogin_v1:: - OsLoginServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use oslogin_v1::OsLoginServicePolicyOptionList directly. -using ::google::cloud::oslogin_v1::OsLoginServicePolicyOptionList; - -/// @deprecated Use oslogin_v1::OsLoginServiceRetryPolicyOption directly. -using ::google::cloud::oslogin_v1::OsLoginServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace oslogin -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_OS_LOGIN_OPTIONS_H diff --git a/google/cloud/oslogin/quickstart/.bazelrc b/google/cloud/oslogin/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/oslogin/quickstart/.bazelrc +++ b/google/cloud/oslogin/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/oslogin/quickstart/CMakeLists.txt index faaba3935be1d..3fa40fdb32093 100644 --- a/google/cloud/oslogin/quickstart/CMakeLists.txt +++ b/google/cloud/oslogin/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud OS Login API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-oslogin-quickstart CXX) find_package(google_cloud_cpp_oslogin REQUIRED) diff --git a/google/cloud/oslogin/quickstart/WORKSPACE.bazel b/google/cloud/oslogin/quickstart/WORKSPACE.bazel index fa94df1b5985e..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 = "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/oslogin/v1/internal/os_login_auth_decorator.cc b/google/cloud/oslogin/v1/internal/os_login_auth_decorator.cc index ab58fe59be4eb..6cc53f891d104 100644 --- a/google/cloud/oslogin/v1/internal/os_login_auth_decorator.cc +++ b/google/cloud/oslogin/v1/internal/os_login_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/oslogin/v1/oslogin.proto #include "google/cloud/oslogin/v1/internal/os_login_auth_decorator.h" -#include +#include "google/cloud/oslogin/v1/oslogin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oslogin_v1_internal { @@ -96,3 +99,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oslogin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/oslogin/v1/internal/os_login_auth_decorator.h b/google/cloud/oslogin/v1/internal/os_login_auth_decorator.h index 31c5bb453deb5..bdef10314d963 100644 --- a/google/cloud/oslogin/v1/internal/os_login_auth_decorator.h +++ b/google/cloud/oslogin/v1/internal/os_login_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oslogin_v1_internal { @@ -84,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_V1_INTERNAL_OS_LOGIN_AUTH_DECORATOR_H diff --git a/google/cloud/oslogin/v1/internal/os_login_logging_decorator.cc b/google/cloud/oslogin/v1/internal/os_login_logging_decorator.cc index d3ea1dc61ac08..28bf74e4a3cfe 100644 --- a/google/cloud/oslogin/v1/internal/os_login_logging_decorator.cc +++ b/google/cloud/oslogin/v1/internal/os_login_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/oslogin/v1/oslogin.proto #include "google/cloud/oslogin/v1/internal/os_login_logging_decorator.h" +#include "google/cloud/oslogin/v1/oslogin.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oslogin_v1_internal { @@ -128,3 +131,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oslogin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/oslogin/v1/internal/os_login_logging_decorator.h b/google/cloud/oslogin/v1/internal/os_login_logging_decorator.h index ba9b6cb5ed56f..7d5b0ce47a7a0 100644 --- a/google/cloud/oslogin/v1/internal/os_login_logging_decorator.h +++ b/google/cloud/oslogin/v1/internal/os_login_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oslogin_v1_internal { @@ -84,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_V1_INTERNAL_OS_LOGIN_LOGGING_DECORATOR_H diff --git a/google/cloud/oslogin/v1/internal/os_login_metadata_decorator.cc b/google/cloud/oslogin/v1/internal/os_login_metadata_decorator.cc index 998260d1029d8..280fc74bd2d02 100644 --- a/google/cloud/oslogin/v1/internal/os_login_metadata_decorator.cc +++ b/google/cloud/oslogin/v1/internal/os_login_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/oslogin/v1/oslogin.proto #include "google/cloud/oslogin/v1/internal/os_login_metadata_decorator.h" +#include "google/cloud/oslogin/v1/oslogin.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 oslogin_v1_internal { @@ -122,3 +126,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oslogin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/oslogin/v1/internal/os_login_metadata_decorator.h b/google/cloud/oslogin/v1/internal/os_login_metadata_decorator.h index c893d59d0e73a..2c3b3f58f9313 100644 --- a/google/cloud/oslogin/v1/internal/os_login_metadata_decorator.h +++ b/google/cloud/oslogin/v1/internal/os_login_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oslogin_v1_internal { @@ -89,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_V1_INTERNAL_OS_LOGIN_METADATA_DECORATOR_H diff --git a/google/cloud/oslogin/v1/internal/os_login_option_defaults.cc b/google/cloud/oslogin/v1/internal/os_login_option_defaults.cc index 020b785ca5cd1..bd5b90bdbb97b 100644 --- a/google/cloud/oslogin/v1/internal/os_login_option_defaults.cc +++ b/google/cloud/oslogin/v1/internal/os_login_option_defaults.cc @@ -41,7 +41,7 @@ Options OsLoginServiceDefaultOptions(Options options) { if (!options.has()) { options.set( oslogin_v1::OsLoginServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/oslogin/v1/internal/os_login_stub.cc b/google/cloud/oslogin/v1/internal/os_login_stub.cc index 1194a94c4b69c..874d378956d5d 100644 --- a/google/cloud/oslogin/v1/internal/os_login_stub.cc +++ b/google/cloud/oslogin/v1/internal/os_login_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/oslogin/v1/oslogin.proto #include "google/cloud/oslogin/v1/internal/os_login_stub.h" +#include "google/cloud/oslogin/v1/oslogin.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oslogin_v1_internal { @@ -116,3 +119,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oslogin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/oslogin/v1/internal/os_login_stub.h b/google/cloud/oslogin/v1/internal/os_login_stub.h index 23f4ca11fdf99..f1478aa69b224 100644 --- a/google/cloud/oslogin/v1/internal/os_login_stub.h +++ b/google/cloud/oslogin/v1/internal/os_login_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_V1_INTERNAL_OS_LOGIN_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_V1_INTERNAL_OS_LOGIN_STUB_H +#include "google/cloud/oslogin/v1/oslogin.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oslogin_v1_internal { @@ -121,4 +124,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_V1_INTERNAL_OS_LOGIN_STUB_H diff --git a/google/cloud/oslogin/v1/internal/os_login_stub_factory.cc b/google/cloud/oslogin/v1/internal/os_login_stub_factory.cc index e1f81e9449447..f0af26f540ebd 100644 --- a/google/cloud/oslogin/v1/internal/os_login_stub_factory.cc +++ b/google/cloud/oslogin/v1/internal/os_login_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/oslogin/v1/internal/os_login_metadata_decorator.h" #include "google/cloud/oslogin/v1/internal/os_login_stub.h" #include "google/cloud/oslogin/v1/internal/os_login_tracing_stub.h" +#include "google/cloud/oslogin/v1/oslogin.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oslogin_v1_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oslogin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/oslogin/v1/internal/os_login_stub_factory.h b/google/cloud/oslogin/v1/internal/os_login_stub_factory.h index c2382cd054e31..3e9490164cd16 100644 --- a/google/cloud/oslogin/v1/internal/os_login_stub_factory.h +++ b/google/cloud/oslogin/v1/internal/os_login_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oslogin_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_V1_INTERNAL_OS_LOGIN_STUB_FACTORY_H diff --git a/google/cloud/oslogin/v1/internal/os_login_tracing_connection.cc b/google/cloud/oslogin/v1/internal/os_login_tracing_connection.cc index 5112fd95a19d8..896a3c23ea27c 100644 --- a/google/cloud/oslogin/v1/internal/os_login_tracing_connection.cc +++ b/google/cloud/oslogin/v1/internal/os_login_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace oslogin_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - OsLoginServiceTracingConnection::OsLoginServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -93,16 +91,12 @@ OsLoginServiceTracingConnection::UpdateSshPublicKey( return internal::EndSpan(*span, child_->UpdateSshPublicKey(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeOsLoginServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/oslogin/v1/internal/os_login_tracing_connection.h b/google/cloud/oslogin/v1/internal/os_login_tracing_connection.h index 27662d7a60bc7..e42043fa968ef 100644 --- a/google/cloud/oslogin/v1/internal/os_login_tracing_connection.h +++ b/google/cloud/oslogin/v1/internal/os_login_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace oslogin_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class OsLoginServiceTracingConnection : public oslogin_v1::OsLoginServiceConnection { public: @@ -73,8 +71,6 @@ class OsLoginServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/oslogin/v1/internal/os_login_tracing_stub.cc b/google/cloud/oslogin/v1/internal/os_login_tracing_stub.cc index 30a432b67bc6f..0e5110f27b6c8 100644 --- a/google/cloud/oslogin/v1/internal/os_login_tracing_stub.cc +++ b/google/cloud/oslogin/v1/internal/os_login_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oslogin_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - OsLoginServiceTracingStub::OsLoginServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -114,18 +115,14 @@ OsLoginServiceTracingStub::UpdateSshPublicKey( context, *span, child_->UpdateSshPublicKey(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeOsLoginServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oslogin_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/oslogin/v1/internal/os_login_tracing_stub.h b/google/cloud/oslogin/v1/internal/os_login_tracing_stub.h index 7078dec71949f..82e603c2439a0 100644 --- a/google/cloud/oslogin/v1/internal/os_login_tracing_stub.h +++ b/google/cloud/oslogin/v1/internal/os_login_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace oslogin_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class OsLoginServiceTracingStub : public OsLoginServiceStub { public: ~OsLoginServiceTracingStub() override = default; @@ -80,8 +81,6 @@ class OsLoginServiceTracingStub : public OsLoginServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -96,4 +95,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_V1_INTERNAL_OS_LOGIN_TRACING_STUB_H diff --git a/google/cloud/oslogin/v1/os_login_connection.h b/google/cloud/oslogin/v1/os_login_connection.h index daa53d7d945a3..f9553b921489d 100644 --- a/google/cloud/oslogin/v1/os_login_connection.h +++ b/google/cloud/oslogin/v1/os_login_connection.h @@ -21,12 +21,12 @@ #include "google/cloud/oslogin/v1/internal/os_login_retry_traits.h" #include "google/cloud/oslogin/v1/os_login_connection_idempotency_policy.h" +#include "google/cloud/oslogin/v1/oslogin.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/version.h" -#include #include namespace google { diff --git a/google/cloud/oslogin/v1/os_login_connection_idempotency_policy.h b/google/cloud/oslogin/v1/os_login_connection_idempotency_policy.h index 07687e3b18615..e30dadeb5bafe 100644 --- a/google/cloud/oslogin/v1/os_login_connection_idempotency_policy.h +++ b/google/cloud/oslogin/v1/os_login_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_V1_OS_LOGIN_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OSLOGIN_V1_OS_LOGIN_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/oslogin/v1/oslogin.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/parallelstore/BUILD.bazel b/google/cloud/parallelstore/BUILD.bazel index 37007330e0294..38a1dd851820c 100644 --- a/google/cloud/parallelstore/BUILD.bazel +++ b/google/cloud/parallelstore/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/parallelstore/v1:parallelstore_cc_grpc", + "@googleapis//google/cloud/parallelstore/v1:parallelstore_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/parallelstore/quickstart/.bazelrc b/google/cloud/parallelstore/quickstart/.bazelrc index e676fbffccb52..d313ebed860ce 100644 --- a/google/cloud/parallelstore/quickstart/.bazelrc +++ b/google/cloud/parallelstore/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 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/CMakeLists.txt b/google/cloud/parallelstore/quickstart/CMakeLists.txt index 5ee2f7c319a69..aa9ebf812dde7 100644 --- a/google/cloud/parallelstore/quickstart/CMakeLists.txt +++ b/google/cloud/parallelstore/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Parallelstore API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-parallelstore-quickstart CXX) find_package(google_cloud_cpp_parallelstore REQUIRED) diff --git a/google/cloud/parallelstore/quickstart/WORKSPACE.bazel b/google/cloud/parallelstore/quickstart/WORKSPACE.bazel index 57af79036804e..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 = "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/parallelstore/v1/internal/parallelstore_auth_decorator.cc b/google/cloud/parallelstore/v1/internal/parallelstore_auth_decorator.cc index 10323642e0723..bba61f6e7256a 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_auth_decorator.cc +++ b/google/cloud/parallelstore/v1/internal/parallelstore_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/parallelstore/v1/parallelstore.proto #include "google/cloud/parallelstore/v1/internal/parallelstore_auth_decorator.h" -#include +#include "google/cloud/parallelstore/v1/parallelstore.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parallelstore_v1_internal { @@ -279,3 +282,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace parallelstore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_auth_decorator.h b/google/cloud/parallelstore/v1/internal/parallelstore_auth_decorator.h index 5362f8241c4b4..3b4342145f5aa 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_auth_decorator.h +++ b/google/cloud/parallelstore/v1/internal/parallelstore_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/parallelstore/v1/internal/parallelstore_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 parallelstore_v1_internal { @@ -155,4 +158,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARALLELSTORE_V1_INTERNAL_PARALLELSTORE_AUTH_DECORATOR_H diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_connection_impl.h b/google/cloud/parallelstore/v1/internal/parallelstore_connection_impl.h index 67df74ce9b456..f463a6b73622e 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_connection_impl.h +++ b/google/cloud/parallelstore/v1/internal/parallelstore_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_logging_decorator.cc b/google/cloud/parallelstore/v1/internal/parallelstore_logging_decorator.cc index 396c455d71842..f8b7ef0851e9f 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_logging_decorator.cc +++ b/google/cloud/parallelstore/v1/internal/parallelstore_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/parallelstore/v1/parallelstore.proto #include "google/cloud/parallelstore/v1/internal/parallelstore_logging_decorator.h" +#include "google/cloud/parallelstore/v1/parallelstore.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parallelstore_v1_internal { @@ -323,3 +326,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace parallelstore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_logging_decorator.h b/google/cloud/parallelstore/v1/internal/parallelstore_logging_decorator.h index c4c0be22ea79f..83f3672997f71 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_logging_decorator.h +++ b/google/cloud/parallelstore/v1/internal/parallelstore_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/parallelstore/v1/internal/parallelstore_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 parallelstore_v1_internal { @@ -155,4 +158,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARALLELSTORE_V1_INTERNAL_PARALLELSTORE_LOGGING_DECORATOR_H diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_metadata_decorator.cc b/google/cloud/parallelstore/v1/internal/parallelstore_metadata_decorator.cc index c24cd8f183469..64de65ddbaaa7 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_metadata_decorator.cc +++ b/google/cloud/parallelstore/v1/internal/parallelstore_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/parallelstore/v1/parallelstore.proto #include "google/cloud/parallelstore/v1/internal/parallelstore_metadata_decorator.h" +#include "google/cloud/parallelstore/v1/parallelstore.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 parallelstore_v1_internal { @@ -254,3 +258,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace parallelstore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_metadata_decorator.h b/google/cloud/parallelstore/v1/internal/parallelstore_metadata_decorator.h index 054af407012ac..e59b4c3d13e80 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_metadata_decorator.h +++ b/google/cloud/parallelstore/v1/internal/parallelstore_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/parallelstore/v1/internal/parallelstore_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 parallelstore_v1_internal { @@ -160,4 +163,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARALLELSTORE_V1_INTERNAL_PARALLELSTORE_METADATA_DECORATOR_H diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_option_defaults.cc b/google/cloud/parallelstore/v1/internal/parallelstore_option_defaults.cc index da7e6e1d05bb7..a0bacffffad03 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_option_defaults.cc +++ b/google/cloud/parallelstore/v1/internal/parallelstore_option_defaults.cc @@ -42,7 +42,7 @@ Options ParallelstoreDefaultOptions(Options options) { if (!options.has()) { options.set( parallelstore_v1::ParallelstoreLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_stub.cc b/google/cloud/parallelstore/v1/internal/parallelstore_stub.cc index 25fa1b96592bb..7f3a462256e34 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_stub.cc +++ b/google/cloud/parallelstore/v1/internal/parallelstore_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/parallelstore/v1/parallelstore.proto #include "google/cloud/parallelstore/v1/internal/parallelstore_stub.h" +#include "google/cloud/parallelstore/v1/parallelstore.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parallelstore_v1_internal { @@ -318,3 +321,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace parallelstore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_stub.h b/google/cloud/parallelstore/v1/internal/parallelstore_stub.h index 9a2c1b963d810..2d9a68eb1c001 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_stub.h +++ b/google/cloud/parallelstore/v1/internal/parallelstore_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARALLELSTORE_V1_INTERNAL_PARALLELSTORE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARALLELSTORE_V1_INTERNAL_PARALLELSTORE_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/parallelstore/v1/parallelstore.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parallelstore_v1_internal { @@ -277,4 +280,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARALLELSTORE_V1_INTERNAL_PARALLELSTORE_STUB_H diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_stub_factory.cc b/google/cloud/parallelstore/v1/internal/parallelstore_stub_factory.cc index bbbd5d900fa7b..549fdbc3dae7e 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_stub_factory.cc +++ b/google/cloud/parallelstore/v1/internal/parallelstore_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/parallelstore/v1/parallelstore.proto #include "google/cloud/parallelstore/v1/internal/parallelstore_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/parallelstore/v1/internal/parallelstore_auth_decorator.h" #include "google/cloud/parallelstore/v1/internal/parallelstore_logging_decorator.h" #include "google/cloud/parallelstore/v1/internal/parallelstore_metadata_decorator.h" #include "google/cloud/parallelstore/v1/internal/parallelstore_stub.h" #include "google/cloud/parallelstore/v1/internal/parallelstore_tracing_stub.h" +#include "google/cloud/parallelstore/v1/parallelstore.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parallelstore_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace parallelstore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_stub_factory.h b/google/cloud/parallelstore/v1/internal/parallelstore_stub_factory.h index 1592ac83c20f5..34a58f0870806 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_stub_factory.h +++ b/google/cloud/parallelstore/v1/internal/parallelstore_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parallelstore_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARALLELSTORE_V1_INTERNAL_PARALLELSTORE_STUB_FACTORY_H diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_tracing_connection.cc b/google/cloud/parallelstore/v1/internal/parallelstore_tracing_connection.cc index cdbbb7ab50c45..88eb156a80be4 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_tracing_connection.cc +++ b/google/cloud/parallelstore/v1/internal/parallelstore_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace parallelstore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ParallelstoreTracingConnection::ParallelstoreTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -253,16 +251,12 @@ Status ParallelstoreTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeParallelstoreTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_tracing_connection.h b/google/cloud/parallelstore/v1/internal/parallelstore_tracing_connection.h index 8411ae6926808..7dec9301f92ef 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_tracing_connection.h +++ b/google/cloud/parallelstore/v1/internal/parallelstore_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace parallelstore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ParallelstoreTracingConnection : public parallelstore_v1::ParallelstoreConnection { public: @@ -129,8 +127,6 @@ class ParallelstoreTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_tracing_stub.cc b/google/cloud/parallelstore/v1/internal/parallelstore_tracing_stub.cc index e8d5fb98533eb..8bdd8daedbdf5 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_tracing_stub.cc +++ b/google/cloud/parallelstore/v1/internal/parallelstore_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parallelstore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ParallelstoreTracingStub::ParallelstoreTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -284,18 +285,14 @@ future ParallelstoreTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeParallelstoreTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace parallelstore_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/parallelstore/v1/internal/parallelstore_tracing_stub.h b/google/cloud/parallelstore/v1/internal/parallelstore_tracing_stub.h index f47cc865e2ceb..1078293ff1a89 100644 --- a/google/cloud/parallelstore/v1/internal/parallelstore_tracing_stub.h +++ b/google/cloud/parallelstore/v1/internal/parallelstore_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parallelstore_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ParallelstoreTracingStub : public ParallelstoreStub { public: ~ParallelstoreTracingStub() override = default; @@ -150,8 +151,6 @@ class ParallelstoreTracingStub : public ParallelstoreStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -166,4 +165,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARALLELSTORE_V1_INTERNAL_PARALLELSTORE_TRACING_STUB_H diff --git a/google/cloud/parallelstore/v1/parallelstore_client.h b/google/cloud/parallelstore/v1/parallelstore_client.h index d1a3d50b0ada5..22147b3260706 100644 --- a/google/cloud/parallelstore/v1/parallelstore_client.h +++ b/google/cloud/parallelstore/v1/parallelstore_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/parallelstore/v1/parallelstore_connection.h b/google/cloud/parallelstore/v1/parallelstore_connection.h index d6b0e08010e8e..952e66758afb9 100644 --- a/google/cloud/parallelstore/v1/parallelstore_connection.h +++ b/google/cloud/parallelstore/v1/parallelstore_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARALLELSTORE_V1_PARALLELSTORE_CONNECTION_H #include "google/cloud/parallelstore/v1/internal/parallelstore_retry_traits.h" +#include "google/cloud/parallelstore/v1/parallelstore.pb.h" #include "google/cloud/parallelstore/v1/parallelstore_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/parallelstore/v1/parallelstore_connection_idempotency_policy.h b/google/cloud/parallelstore/v1/parallelstore_connection_idempotency_policy.h index a65d6359719e9..9dfa77e3d7cea 100644 --- a/google/cloud/parallelstore/v1/parallelstore_connection_idempotency_policy.h +++ b/google/cloud/parallelstore/v1/parallelstore_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARALLELSTORE_V1_PARALLELSTORE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARALLELSTORE_V1_PARALLELSTORE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/parallelstore/v1/parallelstore.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/parametermanager/BUILD.bazel b/google/cloud/parametermanager/BUILD.bazel index 9d7ceed43bcca..18441f6fabc0a 100644 --- a/google/cloud/parametermanager/BUILD.bazel +++ b/google/cloud/parametermanager/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/parametermanager/v1:parametermanager_cc_grpc", + "@googleapis//google/cloud/parametermanager/v1:parametermanager_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/parametermanager/quickstart/.bazelrc b/google/cloud/parametermanager/quickstart/.bazelrc index 8431873b6fcba..e8b43211481f4 100644 --- a/google/cloud/parametermanager/quickstart/.bazelrc +++ b/google/cloud/parametermanager/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 diff --git a/google/cloud/parametermanager/quickstart/CMakeLists.txt b/google/cloud/parametermanager/quickstart/CMakeLists.txt index 510116d640aac..6719a7c42af2f 100644 --- a/google/cloud/parametermanager/quickstart/CMakeLists.txt +++ b/google/cloud/parametermanager/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Parameter Manager API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-parametermanager-quickstart CXX) find_package(google_cloud_cpp_parametermanager REQUIRED) diff --git a/google/cloud/parametermanager/quickstart/WORKSPACE.bazel b/google/cloud/parametermanager/quickstart/WORKSPACE.bazel index b96d6d3678be8..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 = "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/parametermanager/v1/internal/parameter_manager_auth_decorator.cc b/google/cloud/parametermanager/v1/internal/parameter_manager_auth_decorator.cc index dc0527ce846db..b81e2c83fbdf2 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_auth_decorator.cc +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/parametermanager/v1/service.proto #include "google/cloud/parametermanager/v1/internal/parameter_manager_auth_decorator.h" -#include +#include "google/cloud/parametermanager/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parametermanager_v1_internal { @@ -158,3 +161,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace parametermanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/parametermanager/v1/internal/parameter_manager_auth_decorator.h b/google/cloud/parametermanager/v1/internal/parameter_manager_auth_decorator.h index 441069c5f612c..b9736c8d1e4e8 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_auth_decorator.h +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parametermanager_v1_internal { @@ -117,4 +120,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARAMETERMANAGER_V1_INTERNAL_PARAMETER_MANAGER_AUTH_DECORATOR_H diff --git a/google/cloud/parametermanager/v1/internal/parameter_manager_logging_decorator.cc b/google/cloud/parametermanager/v1/internal/parameter_manager_logging_decorator.cc index 693219406dbf6..72b24f28ba409 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_logging_decorator.cc +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/parametermanager/v1/service.proto #include "google/cloud/parametermanager/v1/internal/parameter_manager_logging_decorator.h" +#include "google/cloud/parametermanager/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parametermanager_v1_internal { @@ -214,3 +217,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace parametermanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/parametermanager/v1/internal/parameter_manager_logging_decorator.h b/google/cloud/parametermanager/v1/internal/parameter_manager_logging_decorator.h index fc430f54f9b70..62288a1cbe9ae 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_logging_decorator.h +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parametermanager_v1_internal { @@ -117,4 +120,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARAMETERMANAGER_V1_INTERNAL_PARAMETER_MANAGER_LOGGING_DECORATOR_H diff --git a/google/cloud/parametermanager/v1/internal/parameter_manager_metadata_decorator.cc b/google/cloud/parametermanager/v1/internal/parameter_manager_metadata_decorator.cc index e692cd69ef901..ffa9b74e81818 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_metadata_decorator.cc +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/parametermanager/v1/service.proto #include "google/cloud/parametermanager/v1/internal/parameter_manager_metadata_decorator.h" +#include "google/cloud/parametermanager/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 parametermanager_v1_internal { @@ -188,3 +192,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace parametermanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/parametermanager/v1/internal/parameter_manager_metadata_decorator.h b/google/cloud/parametermanager/v1/internal/parameter_manager_metadata_decorator.h index 061c3f89506e5..15e0da47aa35f 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_metadata_decorator.h +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parametermanager_v1_internal { @@ -123,4 +126,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARAMETERMANAGER_V1_INTERNAL_PARAMETER_MANAGER_METADATA_DECORATOR_H diff --git a/google/cloud/parametermanager/v1/internal/parameter_manager_option_defaults.cc b/google/cloud/parametermanager/v1/internal/parameter_manager_option_defaults.cc index 2be579289d972..410fe68f77d4a 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_option_defaults.cc +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_option_defaults.cc @@ -42,7 +42,7 @@ Options ParameterManagerDefaultOptions(Options options) { if (!options.has()) { options.set( parametermanager_v1::ParameterManagerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/parametermanager/v1/internal/parameter_manager_stub.cc b/google/cloud/parametermanager/v1/internal/parameter_manager_stub.cc index 517240ddaffda..599aa973e7ac7 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_stub.cc +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/parametermanager/v1/service.proto #include "google/cloud/parametermanager/v1/internal/parameter_manager_stub.h" +#include "google/cloud/parametermanager/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parametermanager_v1_internal { @@ -201,3 +204,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace parametermanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/parametermanager/v1/internal/parameter_manager_stub.h b/google/cloud/parametermanager/v1/internal/parameter_manager_stub.h index a649edc156d27..23463a7cb2f64 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_stub.h +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARAMETERMANAGER_V1_INTERNAL_PARAMETER_MANAGER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARAMETERMANAGER_V1_INTERNAL_PARAMETER_MANAGER_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/parametermanager/v1/service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parametermanager_v1_internal { @@ -204,4 +207,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARAMETERMANAGER_V1_INTERNAL_PARAMETER_MANAGER_STUB_H diff --git a/google/cloud/parametermanager/v1/internal/parameter_manager_stub_factory.cc b/google/cloud/parametermanager/v1/internal/parameter_manager_stub_factory.cc index 755efeffb1543..bcb1c14d03b57 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_stub_factory.cc +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_stub_factory.cc @@ -17,22 +17,25 @@ // source: google/cloud/parametermanager/v1/service.proto #include "google/cloud/parametermanager/v1/internal/parameter_manager_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/parametermanager/v1/internal/parameter_manager_auth_decorator.h" #include "google/cloud/parametermanager/v1/internal/parameter_manager_logging_decorator.h" #include "google/cloud/parametermanager/v1/internal/parameter_manager_metadata_decorator.h" #include "google/cloud/parametermanager/v1/internal/parameter_manager_stub.h" #include "google/cloud/parametermanager/v1/internal/parameter_manager_tracing_stub.h" +#include "google/cloud/parametermanager/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 -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parametermanager_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace parametermanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/parametermanager/v1/internal/parameter_manager_stub_factory.h b/google/cloud/parametermanager/v1/internal/parameter_manager_stub_factory.h index 970425dcfd89d..1e2f392abb933 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_stub_factory.h +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parametermanager_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARAMETERMANAGER_V1_INTERNAL_PARAMETER_MANAGER_STUB_FACTORY_H diff --git a/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_connection.cc b/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_connection.cc index aaf5316a6703b..6b269ed460d97 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_connection.cc +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace parametermanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ParameterManagerTracingConnection::ParameterManagerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -168,16 +166,12 @@ ParameterManagerTracingConnection::GetLocation( return internal::EndSpan(*span, child_->GetLocation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeParameterManagerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_connection.h b/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_connection.h index ed341077689ea..a7ecdbbcf7aed 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_connection.h +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace parametermanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ParameterManagerTracingConnection : public parametermanager_v1::ParameterManagerConnection { public: @@ -99,8 +97,6 @@ class ParameterManagerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_stub.cc b/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_stub.cc index 9cc6a577be3ae..895034f12c554 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_stub.cc +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parametermanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ParameterManagerTracingStub::ParameterManagerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -205,18 +206,14 @@ ParameterManagerTracingStub::GetLocation( child_->GetLocation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeParameterManagerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace parametermanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_stub.h b/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_stub.h index 99f4709dbeae8..8036b8518ca7c 100644 --- a/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_stub.h +++ b/google/cloud/parametermanager/v1/internal/parameter_manager_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace parametermanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ParameterManagerTracingStub : public ParameterManagerStub { public: ~ParameterManagerTracingStub() override = default; @@ -114,8 +115,6 @@ class ParameterManagerTracingStub : public ParameterManagerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -130,4 +129,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARAMETERMANAGER_V1_INTERNAL_PARAMETER_MANAGER_TRACING_STUB_H diff --git a/google/cloud/parametermanager/v1/parameter_manager_connection.h b/google/cloud/parametermanager/v1/parameter_manager_connection.h index 49ca203b80986..482ce6079e204 100644 --- a/google/cloud/parametermanager/v1/parameter_manager_connection.h +++ b/google/cloud/parametermanager/v1/parameter_manager_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/parametermanager/v1/internal/parameter_manager_retry_traits.h" #include "google/cloud/parametermanager/v1/parameter_manager_connection_idempotency_policy.h" +#include "google/cloud/parametermanager/v1/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 #include namespace google { diff --git a/google/cloud/parametermanager/v1/parameter_manager_connection_idempotency_policy.h b/google/cloud/parametermanager/v1/parameter_manager_connection_idempotency_policy.h index 1d72f5be232cb..eeb0582057fb4 100644 --- a/google/cloud/parametermanager/v1/parameter_manager_connection_idempotency_policy.h +++ b/google/cloud/parametermanager/v1/parameter_manager_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARAMETERMANAGER_V1_PARAMETER_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PARAMETERMANAGER_V1_PARAMETER_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/parametermanager/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/policysimulator/BUILD.bazel b/google/cloud/policysimulator/BUILD.bazel index 1b54c1f505536..24b50c86b785a 100644 --- a/google/cloud/policysimulator/BUILD.bazel +++ b/google/cloud/policysimulator/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/policysimulator/v1:policysimulator_cc_grpc", + "@googleapis//google/cloud/policysimulator/v1:policysimulator_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/policysimulator/quickstart/.bazelrc b/google/cloud/policysimulator/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/policysimulator/quickstart/.bazelrc +++ b/google/cloud/policysimulator/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/policysimulator/quickstart/CMakeLists.txt index a37d931843af3..e40a33e23ed7a 100644 --- a/google/cloud/policysimulator/quickstart/CMakeLists.txt +++ b/google/cloud/policysimulator/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Policy Simulator API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-policysimulator-quickstart CXX) find_package(google_cloud_cpp_policysimulator REQUIRED) diff --git a/google/cloud/policysimulator/quickstart/WORKSPACE.bazel b/google/cloud/policysimulator/quickstart/WORKSPACE.bazel index be87ed16fffd2..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 = "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/policysimulator/v1/internal/simulator_auth_decorator.cc b/google/cloud/policysimulator/v1/internal/simulator_auth_decorator.cc index 2f71825d7b270..e4cdecc9fdbe6 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_auth_decorator.cc +++ b/google/cloud/policysimulator/v1/internal/simulator_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/policysimulator/v1/simulator.proto #include "google/cloud/policysimulator/v1/internal/simulator_auth_decorator.h" -#include +#include "google/cloud/policysimulator/v1/simulator.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policysimulator_v1_internal { @@ -134,3 +137,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policysimulator_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policysimulator/v1/internal/simulator_auth_decorator.h b/google/cloud/policysimulator/v1/internal/simulator_auth_decorator.h index 78140ff2e06e1..0d86ee9f2a5c5 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_auth_decorator.h +++ b/google/cloud/policysimulator/v1/internal/simulator_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/policysimulator/v1/internal/simulator_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 policysimulator_v1_internal { @@ -92,4 +95,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYSIMULATOR_V1_INTERNAL_SIMULATOR_AUTH_DECORATOR_H diff --git a/google/cloud/policysimulator/v1/internal/simulator_connection_impl.h b/google/cloud/policysimulator/v1/internal/simulator_connection_impl.h index e0cd6f2675958..4d8107f16ccee 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_connection_impl.h +++ b/google/cloud/policysimulator/v1/internal/simulator_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/policysimulator/v1/internal/simulator_logging_decorator.cc b/google/cloud/policysimulator/v1/internal/simulator_logging_decorator.cc index 9ce155f886bff..0a91c549f985b 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_logging_decorator.cc +++ b/google/cloud/policysimulator/v1/internal/simulator_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/policysimulator/v1/simulator.proto #include "google/cloud/policysimulator/v1/internal/simulator_logging_decorator.h" +#include "google/cloud/policysimulator/v1/simulator.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policysimulator_v1_internal { @@ -155,3 +158,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policysimulator_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policysimulator/v1/internal/simulator_logging_decorator.h b/google/cloud/policysimulator/v1/internal/simulator_logging_decorator.h index b0494a41d0994..eec40eba22687 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_logging_decorator.h +++ b/google/cloud/policysimulator/v1/internal/simulator_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/policysimulator/v1/internal/simulator_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 policysimulator_v1_internal { @@ -92,4 +95,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYSIMULATOR_V1_INTERNAL_SIMULATOR_LOGGING_DECORATOR_H diff --git a/google/cloud/policysimulator/v1/internal/simulator_metadata_decorator.cc b/google/cloud/policysimulator/v1/internal/simulator_metadata_decorator.cc index ff2ca6740160e..f9ba4bf78a215 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_metadata_decorator.cc +++ b/google/cloud/policysimulator/v1/internal/simulator_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/policysimulator/v1/simulator.proto #include "google/cloud/policysimulator/v1/internal/simulator_metadata_decorator.h" +#include "google/cloud/policysimulator/v1/simulator.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 policysimulator_v1_internal { @@ -140,3 +144,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policysimulator_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policysimulator/v1/internal/simulator_metadata_decorator.h b/google/cloud/policysimulator/v1/internal/simulator_metadata_decorator.h index 46115f514bdee..3ef393f898f0b 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_metadata_decorator.h +++ b/google/cloud/policysimulator/v1/internal/simulator_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/policysimulator/v1/internal/simulator_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 policysimulator_v1_internal { @@ -97,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYSIMULATOR_V1_INTERNAL_SIMULATOR_METADATA_DECORATOR_H diff --git a/google/cloud/policysimulator/v1/internal/simulator_option_defaults.cc b/google/cloud/policysimulator/v1/internal/simulator_option_defaults.cc index 85a5880443c2a..359413c004680 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_option_defaults.cc +++ b/google/cloud/policysimulator/v1/internal/simulator_option_defaults.cc @@ -41,7 +41,7 @@ Options SimulatorDefaultOptions(Options options) { if (!options.has()) { options.set( policysimulator_v1::SimulatorLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/policysimulator/v1/internal/simulator_stub.cc b/google/cloud/policysimulator/v1/internal/simulator_stub.cc index fee7824a6dad2..2b6ce8aabdfc0 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_stub.cc +++ b/google/cloud/policysimulator/v1/internal/simulator_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/policysimulator/v1/simulator.proto #include "google/cloud/policysimulator/v1/internal/simulator_stub.h" +#include "google/cloud/policysimulator/v1/simulator.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policysimulator_v1_internal { @@ -152,3 +155,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policysimulator_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policysimulator/v1/internal/simulator_stub.h b/google/cloud/policysimulator/v1/internal/simulator_stub.h index 347ddd18739f3..081c82521ca58 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_stub.h +++ b/google/cloud/policysimulator/v1/internal/simulator_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYSIMULATOR_V1_INTERNAL_SIMULATOR_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYSIMULATOR_V1_INTERNAL_SIMULATOR_STUB_H +#include "google/cloud/policysimulator/v1/simulator.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policysimulator_v1_internal { @@ -148,4 +151,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYSIMULATOR_V1_INTERNAL_SIMULATOR_STUB_H diff --git a/google/cloud/policysimulator/v1/internal/simulator_stub_factory.cc b/google/cloud/policysimulator/v1/internal/simulator_stub_factory.cc index dedaa069c5f4a..65c9632633784 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_stub_factory.cc +++ b/google/cloud/policysimulator/v1/internal/simulator_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/policysimulator/v1/internal/simulator_metadata_decorator.h" #include "google/cloud/policysimulator/v1/internal/simulator_stub.h" #include "google/cloud/policysimulator/v1/internal/simulator_tracing_stub.h" +#include "google/cloud/policysimulator/v1/simulator.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policysimulator_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policysimulator_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policysimulator/v1/internal/simulator_stub_factory.h b/google/cloud/policysimulator/v1/internal/simulator_stub_factory.h index 79e81c93d96b9..4c320fd1ae229 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_stub_factory.h +++ b/google/cloud/policysimulator/v1/internal/simulator_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policysimulator_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYSIMULATOR_V1_INTERNAL_SIMULATOR_STUB_FACTORY_H diff --git a/google/cloud/policysimulator/v1/internal/simulator_tracing_connection.cc b/google/cloud/policysimulator/v1/internal/simulator_tracing_connection.cc index 60306974a00dc..3d863635b2239 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_tracing_connection.cc +++ b/google/cloud/policysimulator/v1/internal/simulator_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace policysimulator_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SimulatorTracingConnection::SimulatorTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -102,16 +100,12 @@ SimulatorTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSimulatorTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/policysimulator/v1/internal/simulator_tracing_connection.h b/google/cloud/policysimulator/v1/internal/simulator_tracing_connection.h index fa0fcc14beb4b..cc71ddf87faa4 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_tracing_connection.h +++ b/google/cloud/policysimulator/v1/internal/simulator_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace policysimulator_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SimulatorTracingConnection : public policysimulator_v1::SimulatorConnection { public: @@ -70,8 +68,6 @@ class SimulatorTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/policysimulator/v1/internal/simulator_tracing_stub.cc b/google/cloud/policysimulator/v1/internal/simulator_tracing_stub.cc index 32437b26ba3fb..98e03b9b6bc10 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_tracing_stub.cc +++ b/google/cloud/policysimulator/v1/internal/simulator_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policysimulator_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SimulatorTracingStub::SimulatorTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -132,18 +133,14 @@ future SimulatorTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSimulatorTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policysimulator_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policysimulator/v1/internal/simulator_tracing_stub.h b/google/cloud/policysimulator/v1/internal/simulator_tracing_stub.h index c7ad1d2f86019..eb45f17486741 100644 --- a/google/cloud/policysimulator/v1/internal/simulator_tracing_stub.h +++ b/google/cloud/policysimulator/v1/internal/simulator_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policysimulator_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SimulatorTracingStub : public SimulatorStub { public: ~SimulatorTracingStub() override = default; @@ -87,8 +88,6 @@ class SimulatorTracingStub : public SimulatorStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -103,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYSIMULATOR_V1_INTERNAL_SIMULATOR_TRACING_STUB_H diff --git a/google/cloud/policysimulator/v1/simulator_client.h b/google/cloud/policysimulator/v1/simulator_client.h index f20e4302a9b07..146de6d4b3e8d 100644 --- a/google/cloud/policysimulator/v1/simulator_client.h +++ b/google/cloud/policysimulator/v1/simulator_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/policysimulator/v1/simulator_connection.h b/google/cloud/policysimulator/v1/simulator_connection.h index 33e8cb81d4f89..ce7be600c9ea4 100644 --- a/google/cloud/policysimulator/v1/simulator_connection.h +++ b/google/cloud/policysimulator/v1/simulator_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYSIMULATOR_V1_SIMULATOR_CONNECTION_H #include "google/cloud/policysimulator/v1/internal/simulator_retry_traits.h" +#include "google/cloud/policysimulator/v1/simulator.pb.h" #include "google/cloud/policysimulator/v1/simulator_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/policysimulator/v1/simulator_connection_idempotency_policy.h b/google/cloud/policysimulator/v1/simulator_connection_idempotency_policy.h index f67b9e67f5310..982a63e21f2b5 100644 --- a/google/cloud/policysimulator/v1/simulator_connection_idempotency_policy.h +++ b/google/cloud/policysimulator/v1/simulator_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYSIMULATOR_V1_SIMULATOR_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYSIMULATOR_V1_SIMULATOR_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/policysimulator/v1/simulator.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/policytroubleshooter/BUILD.bazel b/google/cloud/policytroubleshooter/BUILD.bazel index f316abc26b8a7..2d917b74a37ec 100644 --- a/google/cloud/policytroubleshooter/BUILD.bazel +++ b/google/cloud/policytroubleshooter/BUILD.bazel @@ -19,15 +19,14 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", "iam/v3/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/policytroubleshooter/iam/v3:iam_cc_grpc", - "@com_google_googleapis//google/cloud/policytroubleshooter/v1:policytroubleshooter_cc_grpc", - "@com_google_googleapis//google/iam/v2:iam_cc_grpc", + "@googleapis//google/cloud/policytroubleshooter/iam/v3:iam_cc_grpc", + "@googleapis//google/cloud/policytroubleshooter/v1:policytroubleshooter_cc_grpc", + "@googleapis//google/iam/v2:iam_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/policytroubleshooter/CMakeLists.txt b/google/cloud/policytroubleshooter/CMakeLists.txt index ed9c631ed7d2a..9dbbff484491e 100644 --- a/google/cloud/policytroubleshooter/CMakeLists.txt +++ b/google/cloud/policytroubleshooter/CMakeLists.txt @@ -18,7 +18,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( policytroubleshooter "Policy Troubleshooter API" - SERVICE_DIRS "__EMPTY__" "v1/" "iam/v3/" + SERVICE_DIRS "v1/" "iam/v3/" SHARED_PROTO_DEPS "iam_v2") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) diff --git a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_auth_decorator.cc b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_auth_decorator.cc index 294f70b52df6e..2171e554e0df1 100644 --- a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_auth_decorator.cc +++ b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/policytroubleshooter/iam/v3/troubleshooter.proto #include "google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_auth_decorator.h" -#include +#include "google/cloud/policytroubleshooter/iam/v3/troubleshooter.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_iam_v3_internal { @@ -46,3 +49,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policytroubleshooter_iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_auth_decorator.h b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_auth_decorator.h index 8b97b1235ae3e..b83a1cdbcc0b8 100644 --- a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_auth_decorator.h +++ b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_iam_v3_internal { @@ -55,4 +58,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_V3_INTERNAL_POLICY_TROUBLESHOOTER_AUTH_DECORATOR_H diff --git a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_logging_decorator.cc b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_logging_decorator.cc index 9aeb907ba963d..83c51a120f342 100644 --- a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_logging_decorator.cc +++ b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/policytroubleshooter/iam/v3/troubleshooter.proto #include "google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_logging_decorator.h" +#include "google/cloud/policytroubleshooter/iam/v3/troubleshooter.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_iam_v3_internal { @@ -54,3 +57,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policytroubleshooter_iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_logging_decorator.h b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_logging_decorator.h index 235240cc7205a..c465f5d8af703 100644 --- a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_logging_decorator.h +++ b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_iam_v3_internal { @@ -55,4 +58,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_V3_INTERNAL_POLICY_TROUBLESHOOTER_LOGGING_DECORATOR_H diff --git a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_metadata_decorator.cc b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_metadata_decorator.cc index 6729abc655d99..d92e865033105 100644 --- a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_metadata_decorator.cc +++ b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/policytroubleshooter/iam/v3/troubleshooter.proto #include "google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_metadata_decorator.h" +#include "google/cloud/policytroubleshooter/iam/v3/troubleshooter.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 policytroubleshooter_iam_v3_internal { @@ -71,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policytroubleshooter_iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_metadata_decorator.h b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_metadata_decorator.h index ddfa050053edc..c52479912c1df 100644 --- a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_metadata_decorator.h +++ b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_iam_v3_internal { @@ -61,4 +64,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_V3_INTERNAL_POLICY_TROUBLESHOOTER_METADATA_DECORATOR_H diff --git a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_option_defaults.cc b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_option_defaults.cc index 7322579c1a44a..5292e334ecd70 100644 --- a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_option_defaults.cc +++ b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_option_defaults.cc @@ -44,7 +44,7 @@ Options PolicyTroubleshooterDefaultOptions(Options options) { options.set< policytroubleshooter_iam_v3::PolicyTroubleshooterRetryPolicyOption>( policytroubleshooter_iam_v3::PolicyTroubleshooterLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_iam_v3_internal { @@ -49,3 +52,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policytroubleshooter_iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_stub.h b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_stub.h index 2e4eb0707c959..fbcab61f7d5a0 100644 --- a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_stub.h +++ b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_V3_INTERNAL_POLICY_TROUBLESHOOTER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_V3_INTERNAL_POLICY_TROUBLESHOOTER_STUB_H +#include "google/cloud/policytroubleshooter/iam/v3/troubleshooter.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_iam_v3_internal { @@ -68,4 +71,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_V3_INTERNAL_POLICY_TROUBLESHOOTER_STUB_H diff --git a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_stub_factory.cc b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_stub_factory.cc index 46625b8766682..a6fe458093041 100644 --- a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_stub_factory.cc +++ b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_metadata_decorator.h" #include "google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_stub.h" #include "google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_stub.h" +#include "google/cloud/policytroubleshooter/iam/v3/troubleshooter.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_iam_v3_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policytroubleshooter_iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_stub_factory.h b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_stub_factory.h index 5bc300d24a207..fa19f5a17bd65 100644 --- a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_stub_factory.h +++ b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_iam_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_V3_INTERNAL_POLICY_TROUBLESHOOTER_STUB_FACTORY_H diff --git a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_connection.cc b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_connection.cc index 33dcb96ae29ad..4247ba3a24084 100644 --- a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_connection.cc +++ b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace policytroubleshooter_iam_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PolicyTroubleshooterTracingConnection::PolicyTroubleshooterTracingConnection( std::shared_ptr child) @@ -45,18 +43,14 @@ PolicyTroubleshooterTracingConnection::TroubleshootIamPolicy( return internal::EndSpan(*span, child_->TroubleshootIamPolicy(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePolicyTroubleshooterTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_connection.h b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_connection.h index 6331a33018e7f..199e13bc5feb6 100644 --- a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_connection.h +++ b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace policytroubleshooter_iam_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PolicyTroubleshooterTracingConnection : public policytroubleshooter_iam_v3::PolicyTroubleshooterConnection { public: @@ -53,8 +51,6 @@ class PolicyTroubleshooterTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_stub.cc b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_stub.cc index 73b037ce1df3b..e7eac9647e7ea 100644 --- a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_stub.cc +++ b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_iam_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PolicyTroubleshooterTracingStub::PolicyTroubleshooterTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -47,18 +48,14 @@ PolicyTroubleshooterTracingStub::TroubleshootIamPolicy( context, *span, child_->TroubleshootIamPolicy(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePolicyTroubleshooterTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policytroubleshooter_iam_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_stub.h b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_stub.h index c86d3fb30ba3a..47c52a8f4a3d2 100644 --- a/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_stub.h +++ b/google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_iam_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PolicyTroubleshooterTracingStub : public PolicyTroubleshooterStub { public: ~PolicyTroubleshooterTracingStub() override = default; @@ -52,8 +53,6 @@ class PolicyTroubleshooterTracingStub : public PolicyTroubleshooterStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -68,4 +67,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_V3_INTERNAL_POLICY_TROUBLESHOOTER_TRACING_STUB_H diff --git a/google/cloud/policytroubleshooter/iam/v3/policy_troubleshooter_connection.h b/google/cloud/policytroubleshooter/iam/v3/policy_troubleshooter_connection.h index c5ca4b7587b9e..a4a9f01733b9b 100644 --- a/google/cloud/policytroubleshooter/iam/v3/policy_troubleshooter_connection.h +++ b/google/cloud/policytroubleshooter/iam/v3/policy_troubleshooter_connection.h @@ -21,12 +21,12 @@ #include "google/cloud/policytroubleshooter/iam/v3/internal/policy_troubleshooter_retry_traits.h" #include "google/cloud/policytroubleshooter/iam/v3/policy_troubleshooter_connection_idempotency_policy.h" +#include "google/cloud/policytroubleshooter/iam/v3/troubleshooter.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/version.h" -#include #include namespace google { diff --git a/google/cloud/policytroubleshooter/iam/v3/policy_troubleshooter_connection_idempotency_policy.h b/google/cloud/policytroubleshooter/iam/v3/policy_troubleshooter_connection_idempotency_policy.h index b62bc86a8d860..4615b06bce50f 100644 --- a/google/cloud/policytroubleshooter/iam/v3/policy_troubleshooter_connection_idempotency_policy.h +++ b/google/cloud/policytroubleshooter/iam/v3/policy_troubleshooter_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_V3_POLICY_TROUBLESHOOTER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_V3_POLICY_TROUBLESHOOTER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/policytroubleshooter/iam/v3/troubleshooter.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/policytroubleshooter/iam_checker_client.h b/google/cloud/policytroubleshooter/iam_checker_client.h deleted file mode 100644 index c6379cd9c0604..0000000000000 --- a/google/cloud/policytroubleshooter/iam_checker_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/policytroubleshooter/v1/checker.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_CHECKER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_CHECKER_CLIENT_H - -#include "google/cloud/policytroubleshooter/iam_checker_connection.h" -#include "google/cloud/policytroubleshooter/v1/iam_checker_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in policytroubleshooter_v1 instead of the aliases defined -/// in this namespace. -namespace policytroubleshooter { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use policytroubleshooter_v1::IamCheckerClient directly. -using ::google::cloud::policytroubleshooter_v1::IamCheckerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace policytroubleshooter -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_CHECKER_CLIENT_H diff --git a/google/cloud/policytroubleshooter/iam_checker_connection.h b/google/cloud/policytroubleshooter/iam_checker_connection.h deleted file mode 100644 index 558f4d53aa5ac..0000000000000 --- a/google/cloud/policytroubleshooter/iam_checker_connection.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/policytroubleshooter/v1/checker.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_CHECKER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_CHECKER_CONNECTION_H - -#include "google/cloud/policytroubleshooter/iam_checker_connection_idempotency_policy.h" -#include "google/cloud/policytroubleshooter/v1/iam_checker_connection.h" - -namespace google { -namespace cloud { -namespace policytroubleshooter { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use policytroubleshooter_v1::MakeIamCheckerConnection directly. -using ::google::cloud::policytroubleshooter_v1::MakeIamCheckerConnection; - -/// @deprecated Use policytroubleshooter_v1::IamCheckerConnection directly. -using ::google::cloud::policytroubleshooter_v1::IamCheckerConnection; - -/// @deprecated Use -/// policytroubleshooter_v1::IamCheckerLimitedErrorCountRetryPolicy directly. -using ::google::cloud::policytroubleshooter_v1:: - IamCheckerLimitedErrorCountRetryPolicy; - -/// @deprecated Use policytroubleshooter_v1::IamCheckerLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::policytroubleshooter_v1:: - IamCheckerLimitedTimeRetryPolicy; - -/// @deprecated Use policytroubleshooter_v1::IamCheckerRetryPolicy directly. -using ::google::cloud::policytroubleshooter_v1::IamCheckerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace policytroubleshooter -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_CHECKER_CONNECTION_H diff --git a/google/cloud/policytroubleshooter/iam_checker_connection_idempotency_policy.h b/google/cloud/policytroubleshooter/iam_checker_connection_idempotency_policy.h deleted file mode 100644 index 3441af2bc8e15..0000000000000 --- a/google/cloud/policytroubleshooter/iam_checker_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/policytroubleshooter/v1/checker.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_CHECKER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_CHECKER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/policytroubleshooter/v1/iam_checker_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace policytroubleshooter { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// policytroubleshooter_v1::MakeDefaultIamCheckerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::policytroubleshooter_v1:: - MakeDefaultIamCheckerConnectionIdempotencyPolicy; - -/// @deprecated Use -/// policytroubleshooter_v1::IamCheckerConnectionIdempotencyPolicy directly. -using ::google::cloud::policytroubleshooter_v1:: - IamCheckerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace policytroubleshooter -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_CHECKER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/policytroubleshooter/iam_checker_options.h b/google/cloud/policytroubleshooter/iam_checker_options.h deleted file mode 100644 index 19fc3ffe9d17d..0000000000000 --- a/google/cloud/policytroubleshooter/iam_checker_options.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/policytroubleshooter/v1/checker.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_CHECKER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_CHECKER_OPTIONS_H - -#include "google/cloud/policytroubleshooter/iam_checker_connection.h" -#include "google/cloud/policytroubleshooter/iam_checker_connection_idempotency_policy.h" -#include "google/cloud/policytroubleshooter/v1/iam_checker_options.h" - -namespace google { -namespace cloud { -namespace policytroubleshooter { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use policytroubleshooter_v1::IamCheckerBackoffPolicyOption -/// directly. -using ::google::cloud::policytroubleshooter_v1::IamCheckerBackoffPolicyOption; - -/// @deprecated Use -/// policytroubleshooter_v1::IamCheckerConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::policytroubleshooter_v1:: - IamCheckerConnectionIdempotencyPolicyOption; - -/// @deprecated Use policytroubleshooter_v1::IamCheckerPolicyOptionList -/// directly. -using ::google::cloud::policytroubleshooter_v1::IamCheckerPolicyOptionList; - -/// @deprecated Use policytroubleshooter_v1::IamCheckerRetryPolicyOption -/// directly. -using ::google::cloud::policytroubleshooter_v1::IamCheckerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace policytroubleshooter -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_IAM_CHECKER_OPTIONS_H diff --git a/google/cloud/policytroubleshooter/mocks/mock_iam_checker_connection.h b/google/cloud/policytroubleshooter/mocks/mock_iam_checker_connection.h deleted file mode 100644 index 01ac202de777a..0000000000000 --- a/google/cloud/policytroubleshooter/mocks/mock_iam_checker_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/policytroubleshooter/v1/checker.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_MOCKS_MOCK_IAM_CHECKER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_MOCKS_MOCK_IAM_CHECKER_CONNECTION_H - -#include "google/cloud/policytroubleshooter/iam_checker_connection.h" -#include "google/cloud/policytroubleshooter/v1/mocks/mock_iam_checker_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in policytroubleshooter_v1_mocks instead of the aliases -/// defined in this namespace. -namespace policytroubleshooter_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use policytroubleshooter_v1_mocks::MockIamCheckerConnection -/// directly. -using ::google::cloud::policytroubleshooter_v1_mocks::MockIamCheckerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace policytroubleshooter_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_MOCKS_MOCK_IAM_CHECKER_CONNECTION_H diff --git a/google/cloud/policytroubleshooter/quickstart/.bazelrc b/google/cloud/policytroubleshooter/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/policytroubleshooter/quickstart/.bazelrc +++ b/google/cloud/policytroubleshooter/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/policytroubleshooter/quickstart/CMakeLists.txt index 322b6b34d551c..eede43be58dc4 100644 --- a/google/cloud/policytroubleshooter/quickstart/CMakeLists.txt +++ b/google/cloud/policytroubleshooter/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Policy Troubleshooter API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-policytroubleshooter-quickstart CXX) find_package(google_cloud_cpp_policytroubleshooter REQUIRED) diff --git a/google/cloud/policytroubleshooter/quickstart/WORKSPACE.bazel b/google/cloud/policytroubleshooter/quickstart/WORKSPACE.bazel index a00d48e42d92a..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 = "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/policytroubleshooter/v1/iam_checker_connection.h b/google/cloud/policytroubleshooter/v1/iam_checker_connection.h index f51ebef4c44cd..20ccddf080947 100644 --- a/google/cloud/policytroubleshooter/v1/iam_checker_connection.h +++ b/google/cloud/policytroubleshooter/v1/iam_checker_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_V1_IAM_CHECKER_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_V1_IAM_CHECKER_CONNECTION_H +#include "google/cloud/policytroubleshooter/v1/checker.pb.h" #include "google/cloud/policytroubleshooter/v1/iam_checker_connection_idempotency_policy.h" #include "google/cloud/policytroubleshooter/v1/internal/iam_checker_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/policytroubleshooter/v1/iam_checker_connection_idempotency_policy.h b/google/cloud/policytroubleshooter/v1/iam_checker_connection_idempotency_policy.h index cc7c82da4f8c6..a38d823260669 100644 --- a/google/cloud/policytroubleshooter/v1/iam_checker_connection_idempotency_policy.h +++ b/google/cloud/policytroubleshooter/v1/iam_checker_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_V1_IAM_CHECKER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_V1_IAM_CHECKER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/policytroubleshooter/v1/checker.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_auth_decorator.cc b/google/cloud/policytroubleshooter/v1/internal/iam_checker_auth_decorator.cc index 4f444a2196c79..f7537cfed1d28 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_auth_decorator.cc +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/policytroubleshooter/v1/checker.proto #include "google/cloud/policytroubleshooter/v1/internal/iam_checker_auth_decorator.h" -#include +#include "google/cloud/policytroubleshooter/v1/checker.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_v1_internal { @@ -45,3 +48,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policytroubleshooter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_auth_decorator.h b/google/cloud/policytroubleshooter/v1/internal/iam_checker_auth_decorator.h index 3004ff8fd9fb0..17657d9e83450 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_auth_decorator.h +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_v1_internal { @@ -55,4 +58,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_V1_INTERNAL_IAM_CHECKER_AUTH_DECORATOR_H diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_logging_decorator.cc b/google/cloud/policytroubleshooter/v1/internal/iam_checker_logging_decorator.cc index b5fd21d1b919d..e7697016d8f89 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_logging_decorator.cc +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/policytroubleshooter/v1/checker.proto #include "google/cloud/policytroubleshooter/v1/internal/iam_checker_logging_decorator.h" +#include "google/cloud/policytroubleshooter/v1/checker.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_v1_internal { @@ -53,3 +56,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policytroubleshooter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_logging_decorator.h b/google/cloud/policytroubleshooter/v1/internal/iam_checker_logging_decorator.h index de240f090fe79..9600d0d3b9e8e 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_logging_decorator.h +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_v1_internal { @@ -55,4 +58,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_V1_INTERNAL_IAM_CHECKER_LOGGING_DECORATOR_H diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_metadata_decorator.cc b/google/cloud/policytroubleshooter/v1/internal/iam_checker_metadata_decorator.cc index 5fa93dcfc1f47..b295308fd6eb5 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_metadata_decorator.cc +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/policytroubleshooter/v1/checker.proto #include "google/cloud/policytroubleshooter/v1/internal/iam_checker_metadata_decorator.h" +#include "google/cloud/policytroubleshooter/v1/checker.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 policytroubleshooter_v1_internal { @@ -70,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policytroubleshooter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_metadata_decorator.h b/google/cloud/policytroubleshooter/v1/internal/iam_checker_metadata_decorator.h index 093435eb5e221..54bcd7f405258 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_metadata_decorator.h +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_v1_internal { @@ -60,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_V1_INTERNAL_IAM_CHECKER_METADATA_DECORATOR_H diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_option_defaults.cc b/google/cloud/policytroubleshooter/v1/internal/iam_checker_option_defaults.cc index a2a9738671338..6d301d991a6ee 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_option_defaults.cc +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_option_defaults.cc @@ -42,7 +42,7 @@ Options IamCheckerDefaultOptions(Options options) { if (!options.has()) { options.set( policytroubleshooter_v1::IamCheckerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub.cc b/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub.cc index a53b9ecc7492e..d2bbe43d6e75a 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub.cc +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/policytroubleshooter/v1/checker.proto #include "google/cloud/policytroubleshooter/v1/internal/iam_checker_stub.h" +#include "google/cloud/policytroubleshooter/v1/checker.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_v1_internal { @@ -48,3 +51,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policytroubleshooter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub.h b/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub.h index d756713f69cf7..3adf446e698c7 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub.h +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_V1_INTERNAL_IAM_CHECKER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_V1_INTERNAL_IAM_CHECKER_STUB_H +#include "google/cloud/policytroubleshooter/v1/checker.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_v1_internal { @@ -68,4 +71,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_V1_INTERNAL_IAM_CHECKER_STUB_H diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub_factory.cc b/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub_factory.cc index ec9c584fc1b1e..35121684af206 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub_factory.cc +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/policytroubleshooter/v1/checker.proto #include "google/cloud/policytroubleshooter/v1/internal/iam_checker_stub_factory.h" +#include "google/cloud/policytroubleshooter/v1/checker.grpc.pb.h" #include "google/cloud/policytroubleshooter/v1/internal/iam_checker_auth_decorator.h" #include "google/cloud/policytroubleshooter/v1/internal/iam_checker_logging_decorator.h" #include "google/cloud/policytroubleshooter/v1/internal/iam_checker_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policytroubleshooter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub_factory.h b/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub_factory.h index 2cf71bbb317a2..2b39c6f93620b 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub_factory.h +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_V1_INTERNAL_IAM_CHECKER_STUB_FACTORY_H diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_connection.cc b/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_connection.cc index f53c75b2215fa..78b08e51f5c70 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_connection.cc +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace policytroubleshooter_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IamCheckerTracingConnection::IamCheckerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -42,16 +40,12 @@ IamCheckerTracingConnection::TroubleshootIamPolicy( return internal::EndSpan(*span, child_->TroubleshootIamPolicy(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIamCheckerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_connection.h b/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_connection.h index 4bd2ba64d6052..fe05beaafa089 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_connection.h +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace policytroubleshooter_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IamCheckerTracingConnection : public policytroubleshooter_v1::IamCheckerConnection { public: @@ -50,8 +48,6 @@ class IamCheckerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_stub.cc b/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_stub.cc index d52de3772f264..48e979fd3cd90 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_stub.cc +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - IamCheckerTracingStub::IamCheckerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -46,18 +47,14 @@ IamCheckerTracingStub::TroubleshootIamPolicy( context, *span, child_->TroubleshootIamPolicy(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeIamCheckerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace policytroubleshooter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_stub.h b/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_stub.h index 704cdd5a10450..d6fa9f171a513 100644 --- a/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_stub.h +++ b/google/cloud/policytroubleshooter/v1/internal/iam_checker_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace policytroubleshooter_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class IamCheckerTracingStub : public IamCheckerStub { public: ~IamCheckerTracingStub() override = default; @@ -51,8 +52,6 @@ class IamCheckerTracingStub : public IamCheckerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -67,4 +66,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_POLICYTROUBLESHOOTER_V1_INTERNAL_IAM_CHECKER_TRACING_STUB_H diff --git a/google/cloud/ports_def.inc b/google/cloud/ports_def.inc new file mode 100644 index 0000000000000..95f864fadcc6e --- /dev/null +++ b/google/cloud/ports_def.inc @@ -0,0 +1,134 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Protect Code from unwanted/inconvienet macros +// +// You must follow this pattern when #including port_def.inc in a header file: +// +// #include "other_header.h" +// #include "message.h" +// etc. +// +// #include "port_def.inc" // MUST be last header included +// +// Definitions for this header. +// +// #include "port_undef.inc" //At end of file +// +// This is a textual header with no include guard, because we want to +// detect/prohibit anytime it is #included twice without a corresponding +// #undef. + +#ifdef GOOGLE_CLOUD_CPP_PORT_ +#error "port_def.inc included multiple times" +#endif +#define GOOGLE_CLOUD_CPP_PORT_ + + +// Windows declares several inconvenient macro names. We #undef them and then +// restore them in port_undef.inc. +#ifdef _WIN32 +#pragma push_macro("CompareString") +#undef CompareString +#pragma push_macro("CREATE_NEW") +#undef CREATE_NEW +#pragma push_macro("DELETE") +#undef DELETE +#pragma push_macro("DOUBLE_CLICK") +#undef DOUBLE_CLICK +#pragma push_macro("ERROR") +#undef ERROR +#pragma push_macro("ERROR_BUSY") +#undef ERROR_BUSY +#pragma push_macro("ERROR_INSTALL_FAILED") +#undef ERROR_INSTALL_FAILED +#pragma push_macro("ERROR_NOT_FOUND") +#undef ERROR_NOT_FOUND +#pragma push_macro("ERROR_RETRY") +#undef ERROR_RETRY +#pragma push_macro("ERROR_TIMEOUT") +#undef ERROR_TIMEOUT +#pragma push_macro("GetClassName") +#undef GetClassName +#pragma push_macro("GetCurrentTime") +#undef GetCurrentTime +#pragma push_macro("GetMessage") +#undef GetMessage +#pragma push_macro("GetObject") +#undef GetObject +#pragma push_macro("IGNORE") +#undef IGNORE +#pragma push_macro("IN") +#undef IN +#pragma push_macro("INPUT_KEYBOARD") +#undef INPUT_KEYBOARD +#pragma push_macro("NO_ERROR") +#undef NO_ERROR +#pragma push_macro("OUT") +#undef OUT +#pragma push_macro("OPTIONAL") +#undef OPTIONAL +#pragma push_macro("min") +#undef min +#pragma push_macro("max") +#undef max +#pragma push_macro("NEAR") +#undef NEAR +#pragma push_macro("NO_DATA") +#undef NO_DATA +#pragma push_macro("REASON_UNKNOWN") +#undef REASON_UNKNOWN +#pragma push_macro("SERVICE_DISABLED") +#undef SERVICE_DISABLED +#pragma push_macro("SERVICE_STOP") +#undef SERVICE_STOP +#pragma push_macro("SEVERITY_ERROR") +#undef SEVERITY_ERROR +#pragma push_macro("STATUS_PENDING") +#undef STATUS_PENDING +#pragma push_macro("STRICT") +#undef STRICT +#pragma push_macro("timezone") +#undef timezone +#pragma push_macro("TRUE") +#undef TRUE +#pragma push_macro("FALSE") +#undef FALSE +#pragma push_macro("UNICODE") +#undef UNICODE +#endif // _WIN32 + +#ifdef __APPLE__ +// Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs. +#pragma push_macro("TRUE") +#undef TRUE +#pragma push_macro("FALSE") +#undef FALSE +// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. +#pragma push_macro("UID_MAX") +#undef UID_MAX +#pragma push_macro("GID_MAX") +#undef GID_MAX +// TYPE_BOOL is defined in the MacOS's ConditionalMacros.h. +#pragma push_macro("TYPE_BOOL") +#undef TYPE_BOOL +#endif // __APPLE__ + +#if defined(ANDROID) || defined(__ANDROID__) +// Inconvenient macro names from usr/include/limits.h in some Android NDKs. +#pragma push_macro("UID_MAX") +#undef UID_MAX +#pragma push_macro("GID_MAX") +#undef GID_MAX +#endif // defined(ANDROID) || defined(__ANDROID__) diff --git a/google/cloud/ports_undef.inc b/google/cloud/ports_undef.inc new file mode 100644 index 0000000000000..2bbe11b62dc41 --- /dev/null +++ b/google/cloud/ports_undef.inc @@ -0,0 +1,72 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// #undefs all macros defined in port_def.inc. See comments in port_def.inc +// for more info. + + +#ifndef GOOGLE_CLOUD_CPP_PORT_ +#error "port_undef.inc must be included after port_def.inc" +#endif +#undef GOOGLE_CLOUD_CPP_PORT_ + +#ifdef _WIN32 +#pragma pop_macro("CompareString") +#pragma pop_macro("CREATE_NEW") +#pragma pop_macro("DELETE") +#pragma pop_macro("DOUBLE_CLICK") +#pragma pop_macro("ERROR") +#pragma pop_macro("ERROR_BUSY") +#pragma pop_macro("ERROR_INSTALL_FAILED") +#pragma pop_macro("ERROR_NOT_FOUND") +#pragma pop_macro("ERROR_RETRY") +#pragma pop_macro("ERROR_TIMEOUT") +#pragma pop_macro("GetClassName") +#pragma pop_macro("GetCurrentTime") +#pragma pop_macro("GetMessage") +#pragma pop_macro("GetObject") +#pragma pop_macro("IGNORE") +#pragma pop_macro("IN") +#pragma pop_macro("INPUT_KEYBOARD") +#pragma pop_macro("NO_ERROR") +#pragma pop_macro("OUT") +#pragma pop_macro("OPTIONAL") +#pragma pop_macro("min") +#pragma pop_macro("max") +#pragma pop_macro("NEAR") +#pragma pop_macro("NO_DATA") +#pragma pop_macro("REASON_UNKNOWN") +#pragma pop_macro("SERVICE_DISABLED") +#pragma pop_macro("SERVICE_STOP") +#pragma pop_macro("SEVERITY_ERROR") +#pragma pop_macro("STRICT") +#pragma pop_macro("STATUS_PENDING") +#pragma pop_macro("timezone") +#pragma pop_macro("TRUE") +#pragma pop_macro("FALSE") +#pragma pop_macro("UNICODE") +#endif + +#ifdef __APPLE__ +#pragma pop_macro("TRUE") +#pragma pop_macro("FALSE") +#pragma pop_macro("UID_MAX") +#pragma pop_macro("GID_MAX") +#pragma pop_macro("TYPE_BOOL") +#endif // __APPLE__ + +#if defined(ANDROID) || defined(__ANDROID__) +#pragma pop_macro("UID_MAX") +#pragma pop_macro("GID_MAX") +#endif // defined(ANDROID) || defined(__ANDROID__) diff --git a/google/cloud/privateca/BUILD.bazel b/google/cloud/privateca/BUILD.bazel index 29cee95745b6e..3d4b326a2b0d6 100644 --- a/google/cloud/privateca/BUILD.bazel +++ b/google/cloud/privateca/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/security/privateca/v1:privateca_cc_grpc", + "@googleapis//google/cloud/security/privateca/v1:privateca_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/privateca/CMakeLists.txt b/google/cloud/privateca/CMakeLists.txt index baf9739bc4be7..9ee045b49ed69 100644 --- a/google/cloud/privateca/CMakeLists.txt +++ b/google/cloud/privateca/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(privateca "Certificate Authority API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(privateca_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/privateca/certificate_authority_client.h b/google/cloud/privateca/certificate_authority_client.h deleted file mode 100644 index 36517ae3ee350..0000000000000 --- a/google/cloud/privateca/certificate_authority_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/security/privateca/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_CERTIFICATE_AUTHORITY_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_CERTIFICATE_AUTHORITY_CLIENT_H - -#include "google/cloud/privateca/certificate_authority_connection.h" -#include "google/cloud/privateca/v1/certificate_authority_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in privateca_v1 instead of the aliases defined in -/// this namespace. -namespace privateca { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use privateca_v1::CertificateAuthorityServiceClient directly. -using ::google::cloud::privateca_v1::CertificateAuthorityServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace privateca -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_CERTIFICATE_AUTHORITY_CLIENT_H diff --git a/google/cloud/privateca/certificate_authority_connection.h b/google/cloud/privateca/certificate_authority_connection.h deleted file mode 100644 index a22893840c7a1..0000000000000 --- a/google/cloud/privateca/certificate_authority_connection.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/security/privateca/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_CERTIFICATE_AUTHORITY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_CERTIFICATE_AUTHORITY_CONNECTION_H - -#include "google/cloud/privateca/certificate_authority_connection_idempotency_policy.h" -#include "google/cloud/privateca/v1/certificate_authority_connection.h" - -namespace google { -namespace cloud { -namespace privateca { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use privateca_v1::MakeCertificateAuthorityServiceConnection -/// directly. -using ::google::cloud::privateca_v1::MakeCertificateAuthorityServiceConnection; - -/// @deprecated Use privateca_v1::CertificateAuthorityServiceConnection -/// directly. -using ::google::cloud::privateca_v1::CertificateAuthorityServiceConnection; - -/// @deprecated Use -/// privateca_v1::CertificateAuthorityServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::privateca_v1:: - CertificateAuthorityServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// privateca_v1::CertificateAuthorityServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::privateca_v1:: - CertificateAuthorityServiceLimitedTimeRetryPolicy; - -/// @deprecated Use privateca_v1::CertificateAuthorityServiceRetryPolicy -/// directly. -using ::google::cloud::privateca_v1::CertificateAuthorityServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace privateca -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_CERTIFICATE_AUTHORITY_CONNECTION_H diff --git a/google/cloud/privateca/certificate_authority_connection_idempotency_policy.h b/google/cloud/privateca/certificate_authority_connection_idempotency_policy.h deleted file mode 100644 index 656a527afb375..0000000000000 --- a/google/cloud/privateca/certificate_authority_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/security/privateca/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_CERTIFICATE_AUTHORITY_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_CERTIFICATE_AUTHORITY_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/privateca/v1/certificate_authority_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace privateca { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// privateca_v1::MakeDefaultCertificateAuthorityServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::privateca_v1:: - MakeDefaultCertificateAuthorityServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// privateca_v1::CertificateAuthorityServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::privateca_v1:: - CertificateAuthorityServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace privateca -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_CERTIFICATE_AUTHORITY_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/privateca/certificate_authority_options.h b/google/cloud/privateca/certificate_authority_options.h deleted file mode 100644 index 8d5231bf40444..0000000000000 --- a/google/cloud/privateca/certificate_authority_options.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/security/privateca/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_CERTIFICATE_AUTHORITY_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_CERTIFICATE_AUTHORITY_OPTIONS_H - -#include "google/cloud/privateca/certificate_authority_connection.h" -#include "google/cloud/privateca/certificate_authority_connection_idempotency_policy.h" -#include "google/cloud/privateca/v1/certificate_authority_options.h" - -namespace google { -namespace cloud { -namespace privateca { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use privateca_v1::CertificateAuthorityServicePollingPolicyOption -/// directly. -using ::google::cloud::privateca_v1:: - CertificateAuthorityServicePollingPolicyOption; - -/// @deprecated Use privateca_v1::CertificateAuthorityServiceBackoffPolicyOption -/// directly. -using ::google::cloud::privateca_v1:: - CertificateAuthorityServiceBackoffPolicyOption; - -/// @deprecated Use -/// privateca_v1::CertificateAuthorityServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::privateca_v1:: - CertificateAuthorityServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use privateca_v1::CertificateAuthorityServicePolicyOptionList -/// directly. -using ::google::cloud::privateca_v1:: - CertificateAuthorityServicePolicyOptionList; - -/// @deprecated Use privateca_v1::CertificateAuthorityServiceRetryPolicyOption -/// directly. -using ::google::cloud::privateca_v1:: - CertificateAuthorityServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace privateca -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_CERTIFICATE_AUTHORITY_OPTIONS_H diff --git a/google/cloud/privateca/mocks/mock_certificate_authority_connection.h b/google/cloud/privateca/mocks/mock_certificate_authority_connection.h deleted file mode 100644 index bd949536be573..0000000000000 --- a/google/cloud/privateca/mocks/mock_certificate_authority_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/security/privateca/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_MOCKS_MOCK_CERTIFICATE_AUTHORITY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_MOCKS_MOCK_CERTIFICATE_AUTHORITY_CONNECTION_H - -#include "google/cloud/privateca/certificate_authority_connection.h" -#include "google/cloud/privateca/v1/mocks/mock_certificate_authority_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in privateca_v1_mocks instead of the aliases -/// defined in this namespace. -namespace privateca_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// privateca_v1_mocks::MockCertificateAuthorityServiceConnection directly. -using ::google::cloud::privateca_v1_mocks:: - MockCertificateAuthorityServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace privateca_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_MOCKS_MOCK_CERTIFICATE_AUTHORITY_CONNECTION_H diff --git a/google/cloud/privateca/quickstart/.bazelrc b/google/cloud/privateca/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/privateca/quickstart/.bazelrc +++ b/google/cloud/privateca/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/privateca/quickstart/CMakeLists.txt index c7c5f32a9ad44..9ddfb6803b742 100644 --- a/google/cloud/privateca/quickstart/CMakeLists.txt +++ b/google/cloud/privateca/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Certificate Authority API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-privateca-quickstart CXX) find_package(google_cloud_cpp_privateca REQUIRED) diff --git a/google/cloud/privateca/quickstart/WORKSPACE.bazel b/google/cloud/privateca/quickstart/WORKSPACE.bazel index 947a734df025e..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 = "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/privateca/v1/certificate_authority_client.h b/google/cloud/privateca/v1/certificate_authority_client.h index 929061c81a0e3..bf7c1f67f41c4 100644 --- a/google/cloud/privateca/v1/certificate_authority_client.h +++ b/google/cloud/privateca/v1/certificate_authority_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/privateca/v1/certificate_authority_connection.h b/google/cloud/privateca/v1/certificate_authority_connection.h index 1a2c5cfa80b3e..af19ef51006ca 100644 --- a/google/cloud/privateca/v1/certificate_authority_connection.h +++ b/google/cloud/privateca/v1/certificate_authority_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/privateca/v1/certificate_authority_connection_idempotency_policy.h" #include "google/cloud/privateca/v1/internal/certificate_authority_retry_traits.h" +#include "google/cloud/security/privateca/v1/service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/privateca/v1/certificate_authority_connection_idempotency_policy.h b/google/cloud/privateca/v1/certificate_authority_connection_idempotency_policy.h index 3a04c0021de40..5fadcc300ca2b 100644 --- a/google/cloud/privateca/v1/certificate_authority_connection_idempotency_policy.h +++ b/google/cloud/privateca/v1/certificate_authority_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_V1_CERTIFICATE_AUTHORITY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_V1_CERTIFICATE_AUTHORITY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/security/privateca/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/privateca/v1/internal/certificate_authority_auth_decorator.cc b/google/cloud/privateca/v1/internal/certificate_authority_auth_decorator.cc index fe25633cd3c02..53a57618955a7 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_auth_decorator.cc +++ b/google/cloud/privateca/v1/internal/certificate_authority_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/security/privateca/v1/service.proto #include "google/cloud/privateca/v1/internal/certificate_authority_auth_decorator.h" -#include +#include "google/cloud/security/privateca/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace privateca_v1_internal { @@ -734,3 +737,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace privateca_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/privateca/v1/internal/certificate_authority_auth_decorator.h b/google/cloud/privateca/v1/internal/certificate_authority_auth_decorator.h index cd7dad2153119..07b065ce5aa31 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_auth_decorator.h +++ b/google/cloud/privateca/v1/internal/certificate_authority_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/privateca/v1/internal/certificate_authority_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 privateca_v1_internal { @@ -367,4 +370,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_V1_INTERNAL_CERTIFICATE_AUTHORITY_AUTH_DECORATOR_H diff --git a/google/cloud/privateca/v1/internal/certificate_authority_connection_impl.h b/google/cloud/privateca/v1/internal/certificate_authority_connection_impl.h index 9a6cc20097414..8396c0de3a0c6 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_connection_impl.h +++ b/google/cloud/privateca/v1/internal/certificate_authority_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/privateca/v1/internal/certificate_authority_logging_decorator.cc b/google/cloud/privateca/v1/internal/certificate_authority_logging_decorator.cc index f0cb3dd30b154..002980f9e8b0c 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_logging_decorator.cc +++ b/google/cloud/privateca/v1/internal/certificate_authority_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/security/privateca/v1/service.proto #include "google/cloud/privateca/v1/internal/certificate_authority_logging_decorator.h" +#include "google/cloud/security/privateca/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace privateca_v1_internal { @@ -872,3 +875,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace privateca_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/privateca/v1/internal/certificate_authority_logging_decorator.h b/google/cloud/privateca/v1/internal/certificate_authority_logging_decorator.h index 48c040ecd60b4..7905632424ce5 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_logging_decorator.h +++ b/google/cloud/privateca/v1/internal/certificate_authority_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/privateca/v1/internal/certificate_authority_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 privateca_v1_internal { @@ -368,4 +371,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_V1_INTERNAL_CERTIFICATE_AUTHORITY_LOGGING_DECORATOR_H diff --git a/google/cloud/privateca/v1/internal/certificate_authority_metadata_decorator.cc b/google/cloud/privateca/v1/internal/certificate_authority_metadata_decorator.cc index 0c48c924d077d..f10bb41b10dc8 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_metadata_decorator.cc +++ b/google/cloud/privateca/v1/internal/certificate_authority_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/security/privateca/v1/service.proto #include "google/cloud/privateca/v1/internal/certificate_authority_metadata_decorator.h" +#include "google/cloud/security/privateca/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 privateca_v1_internal { @@ -655,3 +659,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace privateca_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/privateca/v1/internal/certificate_authority_metadata_decorator.h b/google/cloud/privateca/v1/internal/certificate_authority_metadata_decorator.h index 9610e87e8c6ec..c4dd13d6fe3ac 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_metadata_decorator.h +++ b/google/cloud/privateca/v1/internal/certificate_authority_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/privateca/v1/internal/certificate_authority_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 privateca_v1_internal { @@ -374,4 +377,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_V1_INTERNAL_CERTIFICATE_AUTHORITY_METADATA_DECORATOR_H diff --git a/google/cloud/privateca/v1/internal/certificate_authority_option_defaults.cc b/google/cloud/privateca/v1/internal/certificate_authority_option_defaults.cc index 652a472e52ead..a4d4aeec2dc6b 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_option_defaults.cc +++ b/google/cloud/privateca/v1/internal/certificate_authority_option_defaults.cc @@ -44,7 +44,7 @@ Options CertificateAuthorityServiceDefaultOptions(Options options) { .has()) { options.set( privateca_v1::CertificateAuthorityServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/privateca/v1/internal/certificate_authority_stub.cc b/google/cloud/privateca/v1/internal/certificate_authority_stub.cc index 031ecf7f19179..99bea054c59df 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_stub.cc +++ b/google/cloud/privateca/v1/internal/certificate_authority_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/security/privateca/v1/service.proto #include "google/cloud/privateca/v1/internal/certificate_authority_stub.h" +#include "google/cloud/security/privateca/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace privateca_v1_internal { @@ -870,3 +873,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace privateca_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/privateca/v1/internal/certificate_authority_stub.h b/google/cloud/privateca/v1/internal/certificate_authority_stub.h index 0534b8d544347..ff8cc515bd649 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_stub.h +++ b/google/cloud/privateca/v1/internal/certificate_authority_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_V1_INTERNAL_CERTIFICATE_AUTHORITY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_V1_INTERNAL_CERTIFICATE_AUTHORITY_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/security/privateca/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 -#include -#include -#include +#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 privateca_v1_internal { @@ -715,4 +718,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_V1_INTERNAL_CERTIFICATE_AUTHORITY_STUB_H diff --git a/google/cloud/privateca/v1/internal/certificate_authority_stub_factory.cc b/google/cloud/privateca/v1/internal/certificate_authority_stub_factory.cc index fa19f151038ef..979fa0686e906 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_stub_factory.cc +++ b/google/cloud/privateca/v1/internal/certificate_authority_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/security/privateca/v1/service.proto #include "google/cloud/privateca/v1/internal/certificate_authority_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/privateca/v1/internal/certificate_authority_auth_decorator.h" #include "google/cloud/privateca/v1/internal/certificate_authority_logging_decorator.h" #include "google/cloud/privateca/v1/internal/certificate_authority_metadata_decorator.h" #include "google/cloud/privateca/v1/internal/certificate_authority_stub.h" #include "google/cloud/privateca/v1/internal/certificate_authority_tracing_stub.h" +#include "google/cloud/security/privateca/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 -#include -#include -#include +#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 privateca_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace privateca_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/privateca/v1/internal/certificate_authority_stub_factory.h b/google/cloud/privateca/v1/internal/certificate_authority_stub_factory.h index 23f83c7a732a0..1eca1b11f3c7c 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_stub_factory.h +++ b/google/cloud/privateca/v1/internal/certificate_authority_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace privateca_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_V1_INTERNAL_CERTIFICATE_AUTHORITY_STUB_FACTORY_H diff --git a/google/cloud/privateca/v1/internal/certificate_authority_tracing_connection.cc b/google/cloud/privateca/v1/internal/certificate_authority_tracing_connection.cc index 789e9777ba9ef..9b861ce343796 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_tracing_connection.cc +++ b/google/cloud/privateca/v1/internal/certificate_authority_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace privateca_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CertificateAuthorityServiceTracingConnection:: CertificateAuthorityServiceTracingConnection( std::shared_ptr @@ -768,17 +766,13 @@ Status CertificateAuthorityServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCertificateAuthorityServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/privateca/v1/internal/certificate_authority_tracing_connection.h b/google/cloud/privateca/v1/internal/certificate_authority_tracing_connection.h index c8f798031b3b6..28f66f044d494 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_tracing_connection.h +++ b/google/cloud/privateca/v1/internal/certificate_authority_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace privateca_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CertificateAuthorityServiceTracingConnection : public privateca_v1::CertificateAuthorityServiceConnection { public: @@ -335,8 +333,6 @@ class CertificateAuthorityServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/privateca/v1/internal/certificate_authority_tracing_stub.cc b/google/cloud/privateca/v1/internal/certificate_authority_tracing_stub.cc index f49dc0d4d4675..7634f269381c8 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_tracing_stub.cc +++ b/google/cloud/privateca/v1/internal/certificate_authority_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace privateca_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CertificateAuthorityServiceTracingStub::CertificateAuthorityServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -836,20 +837,16 @@ future CertificateAuthorityServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCertificateAuthorityServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace privateca_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/privateca/v1/internal/certificate_authority_tracing_stub.h b/google/cloud/privateca/v1/internal/certificate_authority_tracing_stub.h index c2479ca20be69..57b9fa082648c 100644 --- a/google/cloud/privateca/v1/internal/certificate_authority_tracing_stub.h +++ b/google/cloud/privateca/v1/internal/certificate_authority_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace privateca_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CertificateAuthorityServiceTracingStub : public CertificateAuthorityServiceStub { public: @@ -364,8 +365,6 @@ class CertificateAuthorityServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -381,4 +380,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVATECA_V1_INTERNAL_CERTIFICATE_AUTHORITY_TRACING_STUB_H diff --git a/google/cloud/privilegedaccessmanager/BUILD.bazel b/google/cloud/privilegedaccessmanager/BUILD.bazel index 1ffb42a150823..7365bc58b1b46 100644 --- a/google/cloud/privilegedaccessmanager/BUILD.bazel +++ b/google/cloud/privilegedaccessmanager/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/privilegedaccessmanager/v1:privilegedaccessmanager_cc_grpc", + "@googleapis//google/cloud/privilegedaccessmanager/v1:privilegedaccessmanager_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/privilegedaccessmanager/quickstart/.bazelrc b/google/cloud/privilegedaccessmanager/quickstart/.bazelrc index 15d5c055db074..343e7f623d628 100644 --- a/google/cloud/privilegedaccessmanager/quickstart/.bazelrc +++ b/google/cloud/privilegedaccessmanager/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/privilegedaccessmanager/quickstart/CMakeLists.txt index e91d013cd24fd..2f5341ac9f9e2 100644 --- a/google/cloud/privilegedaccessmanager/quickstart/CMakeLists.txt +++ b/google/cloud/privilegedaccessmanager/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Privileged Access Manager API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-privilegedaccessmanager-quickstart CXX) find_package(google_cloud_cpp_privilegedaccessmanager REQUIRED) diff --git a/google/cloud/privilegedaccessmanager/quickstart/WORKSPACE.bazel b/google/cloud/privilegedaccessmanager/quickstart/WORKSPACE.bazel index 2c0bb9f566a46..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 = "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/privilegedaccessmanager/v1/internal/privileged_access_manager_auth_decorator.cc b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_auth_decorator.cc index d1a5a189b06e7..ebc3e77f3c503 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_auth_decorator.cc +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.proto #include "google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_auth_decorator.h" -#include +#include "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace privilegedaccessmanager_v1_internal { @@ -340,3 +343,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace privilegedaccessmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_auth_decorator.h b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_auth_decorator.h index d2dfa06d860a4..825adabea0998 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_auth_decorator.h +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 privilegedaccessmanager_v1_internal { @@ -186,4 +189,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVILEGEDACCESSMANAGER_V1_INTERNAL_PRIVILEGED_ACCESS_MANAGER_AUTH_DECORATOR_H diff --git a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_connection_impl.h b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_connection_impl.h index 957b820ee3cc1..2150324da044f 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_connection_impl.h +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_logging_decorator.cc b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_logging_decorator.cc index cc6ea775e3e64..31b55c3d9032d 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_logging_decorator.cc +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.proto #include "google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_logging_decorator.h" +#include "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace privilegedaccessmanager_v1_internal { @@ -416,3 +419,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace privilegedaccessmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_logging_decorator.h b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_logging_decorator.h index 9f2bac0bb432d..0b8720e3998a1 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_logging_decorator.h +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 privilegedaccessmanager_v1_internal { @@ -186,4 +189,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVILEGEDACCESSMANAGER_V1_INTERNAL_PRIVILEGED_ACCESS_MANAGER_LOGGING_DECORATOR_H diff --git a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_metadata_decorator.cc b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_metadata_decorator.cc index 833e70f44c21a..5f8d201e40bd5 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_metadata_decorator.cc +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.proto #include "google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_metadata_decorator.h" +#include "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 privilegedaccessmanager_v1_internal { @@ -323,3 +327,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace privilegedaccessmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_metadata_decorator.h b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_metadata_decorator.h index 2b1cfaf0bee83..7eaa3989b73da 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_metadata_decorator.h +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 privilegedaccessmanager_v1_internal { @@ -192,4 +195,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVILEGEDACCESSMANAGER_V1_INTERNAL_PRIVILEGED_ACCESS_MANAGER_METADATA_DECORATOR_H diff --git a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_option_defaults.cc b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_option_defaults.cc index 149de337f45fb..22085b42b664a 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_option_defaults.cc +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_option_defaults.cc @@ -45,7 +45,7 @@ Options PrivilegedAccessManagerDefaultOptions(Options options) { privilegedaccessmanager_v1::PrivilegedAccessManagerRetryPolicyOption>( privilegedaccessmanager_v1:: PrivilegedAccessManagerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace privilegedaccessmanager_v1_internal { @@ -399,3 +402,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace privilegedaccessmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub.h b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub.h index e55f83bbec289..e02cf6f08326d 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub.h +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVILEGEDACCESSMANAGER_V1_INTERNAL_PRIVILEGED_ACCESS_MANAGER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVILEGEDACCESSMANAGER_V1_INTERNAL_PRIVILEGED_ACCESS_MANAGER_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace privilegedaccessmanager_v1_internal { @@ -348,4 +351,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVILEGEDACCESSMANAGER_V1_INTERNAL_PRIVILEGED_ACCESS_MANAGER_STUB_H diff --git a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub_factory.cc b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub_factory.cc index d91388269d307..a2522f945bf9f 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub_factory.cc +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.proto #include "google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_auth_decorator.h" #include "google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_logging_decorator.h" #include "google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_metadata_decorator.h" #include "google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub.h" #include "google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_stub.h" +#include "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace privilegedaccessmanager_v1_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace privilegedaccessmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub_factory.h b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub_factory.h index adc878f81de92..762293f45ce03 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub_factory.h +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace privilegedaccessmanager_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVILEGEDACCESSMANAGER_V1_INTERNAL_PRIVILEGED_ACCESS_MANAGER_STUB_FACTORY_H diff --git a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_connection.cc b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_connection.cc index 380bda1a82332..eb646dabf3b43 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_connection.cc +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace privilegedaccessmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PrivilegedAccessManagerTracingConnection:: PrivilegedAccessManagerTracingConnection( std::shared_ptr< @@ -348,19 +346,15 @@ Status PrivilegedAccessManagerTracingConnection::DeleteOperation( return internal::EndSpan(*span, child_->DeleteOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePrivilegedAccessManagerTracingConnection( std::shared_ptr< privilegedaccessmanager_v1::PrivilegedAccessManagerConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_connection.h b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_connection.h index 7ada0382aee46..d646fadeef0fd 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_connection.h +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace privilegedaccessmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PrivilegedAccessManagerTracingConnection : public privilegedaccessmanager_v1::PrivilegedAccessManagerConnection { public: @@ -153,8 +151,6 @@ class PrivilegedAccessManagerTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_stub.cc b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_stub.cc index 5e55b66fcb6d2..a20d9daffa721 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_stub.cc +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace privilegedaccessmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PrivilegedAccessManagerTracingStub::PrivilegedAccessManagerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -388,19 +389,15 @@ future PrivilegedAccessManagerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePrivilegedAccessManagerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace privilegedaccessmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_stub.h b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_stub.h index 5dae464e45898..96954f1170019 100644 --- a/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_stub.h +++ b/google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace privilegedaccessmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PrivilegedAccessManagerTracingStub : public PrivilegedAccessManagerStub { public: ~PrivilegedAccessManagerTracingStub() override = default; @@ -182,8 +183,6 @@ class PrivilegedAccessManagerTracingStub : public PrivilegedAccessManagerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -199,4 +198,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVILEGEDACCESSMANAGER_V1_INTERNAL_PRIVILEGED_ACCESS_MANAGER_TRACING_STUB_H diff --git a/google/cloud/privilegedaccessmanager/v1/privileged_access_manager_client.h b/google/cloud/privilegedaccessmanager/v1/privileged_access_manager_client.h index c673e86ffd07c..e4ee8797618dd 100644 --- a/google/cloud/privilegedaccessmanager/v1/privileged_access_manager_client.h +++ b/google/cloud/privilegedaccessmanager/v1/privileged_access_manager_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/privilegedaccessmanager/v1/privileged_access_manager_connection.h b/google/cloud/privilegedaccessmanager/v1/privileged_access_manager_connection.h index cfe6186289f05..6ee60a56f0056 100644 --- a/google/cloud/privilegedaccessmanager/v1/privileged_access_manager_connection.h +++ b/google/cloud/privilegedaccessmanager/v1/privileged_access_manager_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/privilegedaccessmanager/v1/internal/privileged_access_manager_retry_traits.h" #include "google/cloud/privilegedaccessmanager/v1/privileged_access_manager_connection_idempotency_policy.h" +#include "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/privilegedaccessmanager/v1/privileged_access_manager_connection_idempotency_policy.h b/google/cloud/privilegedaccessmanager/v1/privileged_access_manager_connection_idempotency_policy.h index b660bb80371ca..fdc39dc336632 100644 --- a/google/cloud/privilegedaccessmanager/v1/privileged_access_manager_connection_idempotency_policy.h +++ b/google/cloud/privilegedaccessmanager/v1/privileged_access_manager_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVILEGEDACCESSMANAGER_V1_PRIVILEGED_ACCESS_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PRIVILEGEDACCESSMANAGER_V1_PRIVILEGED_ACCESS_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/profiler/BUILD.bazel b/google/cloud/profiler/BUILD.bazel index 119caf92bff1f..71088d661fe0f 100644 --- a/google/cloud/profiler/BUILD.bazel +++ b/google/cloud/profiler/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/devtools/cloudprofiler/v2:cloudprofiler_cc_grpc", + "@googleapis//google/devtools/cloudprofiler/v2:cloudprofiler_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/profiler/CMakeLists.txt b/google/cloud/profiler/CMakeLists.txt index 8e952846b266b..d425d36ec276a 100644 --- a/google/cloud/profiler/CMakeLists.txt +++ b/google/cloud/profiler/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(profiler "Cloud Profiler API" - SERVICE_DIRS "__EMPTY__" "v2/") + SERVICE_DIRS "v2/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(profiler_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/profiler/mocks/mock_profiler_connection.h b/google/cloud/profiler/mocks/mock_profiler_connection.h deleted file mode 100644 index 9155164ac420e..0000000000000 --- a/google/cloud/profiler/mocks/mock_profiler_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudprofiler/v2/profiler.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_MOCKS_MOCK_PROFILER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_MOCKS_MOCK_PROFILER_CONNECTION_H - -#include "google/cloud/profiler/profiler_connection.h" -#include "google/cloud/profiler/v2/mocks/mock_profiler_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in profiler_v2_mocks instead of the aliases -/// defined in this namespace. -namespace profiler_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use profiler_v2_mocks::MockProfilerServiceConnection directly. -using ::google::cloud::profiler_v2_mocks::MockProfilerServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace profiler_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_MOCKS_MOCK_PROFILER_CONNECTION_H diff --git a/google/cloud/profiler/profiler_client.h b/google/cloud/profiler/profiler_client.h deleted file mode 100644 index abc6582abf525..0000000000000 --- a/google/cloud/profiler/profiler_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudprofiler/v2/profiler.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_PROFILER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_PROFILER_CLIENT_H - -#include "google/cloud/profiler/profiler_connection.h" -#include "google/cloud/profiler/v2/profiler_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in profiler_v2 instead of the aliases defined in -/// this namespace. -namespace profiler { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use profiler_v2::ProfilerServiceClient directly. -using ::google::cloud::profiler_v2::ProfilerServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace profiler -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_PROFILER_CLIENT_H diff --git a/google/cloud/profiler/profiler_connection.h b/google/cloud/profiler/profiler_connection.h deleted file mode 100644 index 33e3f33aa4849..0000000000000 --- a/google/cloud/profiler/profiler_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudprofiler/v2/profiler.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_PROFILER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_PROFILER_CONNECTION_H - -#include "google/cloud/profiler/profiler_connection_idempotency_policy.h" -#include "google/cloud/profiler/v2/profiler_connection.h" - -namespace google { -namespace cloud { -namespace profiler { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use profiler_v2::MakeProfilerServiceConnection directly. -using ::google::cloud::profiler_v2::MakeProfilerServiceConnection; - -/// @deprecated Use profiler_v2::ProfilerServiceConnection directly. -using ::google::cloud::profiler_v2::ProfilerServiceConnection; - -/// @deprecated Use profiler_v2::ProfilerServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::profiler_v2::ProfilerServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use profiler_v2::ProfilerServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::profiler_v2::ProfilerServiceLimitedTimeRetryPolicy; - -/// @deprecated Use profiler_v2::ProfilerServiceRetryPolicy directly. -using ::google::cloud::profiler_v2::ProfilerServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace profiler -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_PROFILER_CONNECTION_H diff --git a/google/cloud/profiler/profiler_connection_idempotency_policy.h b/google/cloud/profiler/profiler_connection_idempotency_policy.h deleted file mode 100644 index 78967fe8d4a6f..0000000000000 --- a/google/cloud/profiler/profiler_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudprofiler/v2/profiler.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_PROFILER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_PROFILER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/profiler/v2/profiler_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace profiler { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// profiler_v2::MakeDefaultProfilerServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::profiler_v2:: - MakeDefaultProfilerServiceConnectionIdempotencyPolicy; - -/// @deprecated Use profiler_v2::ProfilerServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::profiler_v2::ProfilerServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace profiler -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_PROFILER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/profiler/profiler_options.h b/google/cloud/profiler/profiler_options.h deleted file mode 100644 index 3982968ccfae6..0000000000000 --- a/google/cloud/profiler/profiler_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudprofiler/v2/profiler.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_PROFILER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_PROFILER_OPTIONS_H - -#include "google/cloud/profiler/profiler_connection.h" -#include "google/cloud/profiler/profiler_connection_idempotency_policy.h" -#include "google/cloud/profiler/v2/profiler_options.h" - -namespace google { -namespace cloud { -namespace profiler { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use profiler_v2::ProfilerServiceBackoffPolicyOption directly. -using ::google::cloud::profiler_v2::ProfilerServiceBackoffPolicyOption; - -/// @deprecated Use -/// profiler_v2::ProfilerServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::profiler_v2:: - ProfilerServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use profiler_v2::ProfilerServicePolicyOptionList directly. -using ::google::cloud::profiler_v2::ProfilerServicePolicyOptionList; - -/// @deprecated Use profiler_v2::ProfilerServiceRetryPolicyOption directly. -using ::google::cloud::profiler_v2::ProfilerServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace profiler -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_PROFILER_OPTIONS_H diff --git a/google/cloud/profiler/quickstart/.bazelrc b/google/cloud/profiler/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/profiler/quickstart/.bazelrc +++ b/google/cloud/profiler/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/profiler/quickstart/CMakeLists.txt index 049e6cc1bf984..cc74d2c53593c 100644 --- a/google/cloud/profiler/quickstart/CMakeLists.txt +++ b/google/cloud/profiler/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Profiler API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-profiler-quickstart CXX) find_package(google_cloud_cpp_profiler REQUIRED) diff --git a/google/cloud/profiler/quickstart/WORKSPACE.bazel b/google/cloud/profiler/quickstart/WORKSPACE.bazel index 7c271b3654346..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 = "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/profiler/v2/export_connection.h b/google/cloud/profiler/v2/export_connection.h index aa81ec7c35a7d..930d1f7e2fa30 100644 --- a/google/cloud/profiler/v2/export_connection.h +++ b/google/cloud/profiler/v2/export_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/devtools/cloudprofiler/v2/profiler.pb.h" #include namespace google { diff --git a/google/cloud/profiler/v2/export_connection_idempotency_policy.h b/google/cloud/profiler/v2/export_connection_idempotency_policy.h index 48ee6b7590bb1..69b451070b4b5 100644 --- a/google/cloud/profiler/v2/export_connection_idempotency_policy.h +++ b/google/cloud/profiler/v2/export_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/devtools/cloudprofiler/v2/profiler.grpc.pb.h" #include namespace google { diff --git a/google/cloud/profiler/v2/internal/export_auth_decorator.cc b/google/cloud/profiler/v2/internal/export_auth_decorator.cc index a1465e9a237f0..72429f2a416bb 100644 --- a/google/cloud/profiler/v2/internal/export_auth_decorator.cc +++ b/google/cloud/profiler/v2/internal/export_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/devtools/cloudprofiler/v2/profiler.proto #include "google/cloud/profiler/v2/internal/export_auth_decorator.h" -#include +#include "google/devtools/cloudprofiler/v2/profiler.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -44,3 +47,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace profiler_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/profiler/v2/internal/export_auth_decorator.h b/google/cloud/profiler/v2/internal/export_auth_decorator.h index c6fa1db9eeda7..96f1d080b02a9 100644 --- a/google/cloud/profiler/v2/internal/export_auth_decorator.h +++ b/google/cloud/profiler/v2/internal/export_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -53,4 +56,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_V2_INTERNAL_EXPORT_AUTH_DECORATOR_H diff --git a/google/cloud/profiler/v2/internal/export_logging_decorator.cc b/google/cloud/profiler/v2/internal/export_logging_decorator.cc index 4808c9227811d..92a7559482f37 100644 --- a/google/cloud/profiler/v2/internal/export_logging_decorator.cc +++ b/google/cloud/profiler/v2/internal/export_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/profiler/v2/internal/export_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/devtools/cloudprofiler/v2/profiler.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -52,3 +55,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace profiler_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/profiler/v2/internal/export_logging_decorator.h b/google/cloud/profiler/v2/internal/export_logging_decorator.h index a441984ae488d..a4a5c075e542b 100644 --- a/google/cloud/profiler/v2/internal/export_logging_decorator.h +++ b/google/cloud/profiler/v2/internal/export_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -53,4 +56,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_V2_INTERNAL_EXPORT_LOGGING_DECORATOR_H diff --git a/google/cloud/profiler/v2/internal/export_metadata_decorator.cc b/google/cloud/profiler/v2/internal/export_metadata_decorator.cc index 7dae9d3a09406..e8d31066d2b12 100644 --- a/google/cloud/profiler/v2/internal/export_metadata_decorator.cc +++ b/google/cloud/profiler/v2/internal/export_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/profiler/v2/internal/export_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/devtools/cloudprofiler/v2/profiler.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -70,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace profiler_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/profiler/v2/internal/export_metadata_decorator.h b/google/cloud/profiler/v2/internal/export_metadata_decorator.h index 5037abc24b4fe..2a646b21c1c81 100644 --- a/google/cloud/profiler/v2/internal/export_metadata_decorator.h +++ b/google/cloud/profiler/v2/internal/export_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -58,4 +61,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_V2_INTERNAL_EXPORT_METADATA_DECORATOR_H diff --git a/google/cloud/profiler/v2/internal/export_option_defaults.cc b/google/cloud/profiler/v2/internal/export_option_defaults.cc index 4aadb8c2eb267..fefa2cbc80b74 100644 --- a/google/cloud/profiler/v2/internal/export_option_defaults.cc +++ b/google/cloud/profiler/v2/internal/export_option_defaults.cc @@ -42,7 +42,7 @@ Options ExportServiceDefaultOptions(Options options) { if (!options.has()) { options.set( profiler_v2::ExportServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/profiler/v2/internal/export_stub.cc b/google/cloud/profiler/v2/internal/export_stub.cc index 724684790e81f..9ee42ff2aa83d 100644 --- a/google/cloud/profiler/v2/internal/export_stub.cc +++ b/google/cloud/profiler/v2/internal/export_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/profiler/v2/internal/export_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/devtools/cloudprofiler/v2/profiler.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -46,3 +49,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace profiler_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/profiler/v2/internal/export_stub.h b/google/cloud/profiler/v2/internal/export_stub.h index 89b858f46e05a..cb1fc774d25a0 100644 --- a/google/cloud/profiler/v2/internal/export_stub.h +++ b/google/cloud/profiler/v2/internal/export_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/devtools/cloudprofiler/v2/profiler.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -65,4 +68,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_V2_INTERNAL_EXPORT_STUB_H diff --git a/google/cloud/profiler/v2/internal/export_stub_factory.cc b/google/cloud/profiler/v2/internal/export_stub_factory.cc index e7f2c71e7cc09..e08dd3c4ae0fa 100644 --- a/google/cloud/profiler/v2/internal/export_stub_factory.cc +++ b/google/cloud/profiler/v2/internal/export_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/devtools/cloudprofiler/v2/profiler.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace profiler_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/profiler/v2/internal/export_stub_factory.h b/google/cloud/profiler/v2/internal/export_stub_factory.h index 27184a7595d3c..25ad9568653b5 100644 --- a/google/cloud/profiler/v2/internal/export_stub_factory.h +++ b/google/cloud/profiler/v2/internal/export_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_V2_INTERNAL_EXPORT_STUB_FACTORY_H diff --git a/google/cloud/profiler/v2/internal/export_tracing_connection.cc b/google/cloud/profiler/v2/internal/export_tracing_connection.cc index 65fc2ebaa49bd..56222497df3d2 100644 --- a/google/cloud/profiler/v2/internal/export_tracing_connection.cc +++ b/google/cloud/profiler/v2/internal/export_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace profiler_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ExportServiceTracingConnection::ExportServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -45,16 +43,12 @@ ExportServiceTracingConnection::ListProfiles( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeExportServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/profiler/v2/internal/export_tracing_connection.h b/google/cloud/profiler/v2/internal/export_tracing_connection.h index af7212699f4af..c292d0c71c36b 100644 --- a/google/cloud/profiler/v2/internal/export_tracing_connection.h +++ b/google/cloud/profiler/v2/internal/export_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace profiler_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ExportServiceTracingConnection : public profiler_v2::ExportServiceConnection { public: @@ -48,8 +46,6 @@ class ExportServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/profiler/v2/internal/export_tracing_stub.cc b/google/cloud/profiler/v2/internal/export_tracing_stub.cc index d1edbe0c2118c..dbaa6436e27a3 100644 --- a/google/cloud/profiler/v2/internal/export_tracing_stub.cc +++ b/google/cloud/profiler/v2/internal/export_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ExportServiceTracingStub::ExportServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -44,18 +45,14 @@ ExportServiceTracingStub::ListProfiles( child_->ListProfiles(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeExportServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace profiler_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/profiler/v2/internal/export_tracing_stub.h b/google/cloud/profiler/v2/internal/export_tracing_stub.h index 59792230f938f..823ccf44ebf1a 100644 --- a/google/cloud/profiler/v2/internal/export_tracing_stub.h +++ b/google/cloud/profiler/v2/internal/export_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ExportServiceTracingStub : public ExportServiceStub { public: ~ExportServiceTracingStub() override = default; @@ -49,8 +50,6 @@ class ExportServiceTracingStub : public ExportServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -65,4 +64,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_V2_INTERNAL_EXPORT_TRACING_STUB_H diff --git a/google/cloud/profiler/v2/internal/profiler_auth_decorator.cc b/google/cloud/profiler/v2/internal/profiler_auth_decorator.cc index 1d6eea2504051..2973db9ca7527 100644 --- a/google/cloud/profiler/v2/internal/profiler_auth_decorator.cc +++ b/google/cloud/profiler/v2/internal/profiler_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/devtools/cloudprofiler/v2/profiler.proto #include "google/cloud/profiler/v2/internal/profiler_auth_decorator.h" -#include +#include "google/devtools/cloudprofiler/v2/profiler.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -63,3 +66,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace profiler_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/profiler/v2/internal/profiler_auth_decorator.h b/google/cloud/profiler/v2/internal/profiler_auth_decorator.h index e3a4d38f63f1b..31d0bd932fea3 100644 --- a/google/cloud/profiler/v2/internal/profiler_auth_decorator.h +++ b/google/cloud/profiler/v2/internal/profiler_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -63,4 +66,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_V2_INTERNAL_PROFILER_AUTH_DECORATOR_H diff --git a/google/cloud/profiler/v2/internal/profiler_logging_decorator.cc b/google/cloud/profiler/v2/internal/profiler_logging_decorator.cc index 5569df508c192..823789aeb2b38 100644 --- a/google/cloud/profiler/v2/internal/profiler_logging_decorator.cc +++ b/google/cloud/profiler/v2/internal/profiler_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/profiler/v2/internal/profiler_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/devtools/cloudprofiler/v2/profiler.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace profiler_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/profiler/v2/internal/profiler_logging_decorator.h b/google/cloud/profiler/v2/internal/profiler_logging_decorator.h index 78a09a7c8b07d..688e6c3ef68fe 100644 --- a/google/cloud/profiler/v2/internal/profiler_logging_decorator.h +++ b/google/cloud/profiler/v2/internal/profiler_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -63,4 +66,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_V2_INTERNAL_PROFILER_LOGGING_DECORATOR_H diff --git a/google/cloud/profiler/v2/internal/profiler_metadata_decorator.cc b/google/cloud/profiler/v2/internal/profiler_metadata_decorator.cc index 87df10a9c56b0..0abcac7f5d21e 100644 --- a/google/cloud/profiler/v2/internal/profiler_metadata_decorator.cc +++ b/google/cloud/profiler/v2/internal/profiler_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/profiler/v2/internal/profiler_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/devtools/cloudprofiler/v2/profiler.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -90,3 +94,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace profiler_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/profiler/v2/internal/profiler_metadata_decorator.h b/google/cloud/profiler/v2/internal/profiler_metadata_decorator.h index b248983a527a3..67fcd276a9179 100644 --- a/google/cloud/profiler/v2/internal/profiler_metadata_decorator.h +++ b/google/cloud/profiler/v2/internal/profiler_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -69,4 +72,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_V2_INTERNAL_PROFILER_METADATA_DECORATOR_H diff --git a/google/cloud/profiler/v2/internal/profiler_option_defaults.cc b/google/cloud/profiler/v2/internal/profiler_option_defaults.cc index 0a3e96d644a5b..cc40dd33cec5a 100644 --- a/google/cloud/profiler/v2/internal/profiler_option_defaults.cc +++ b/google/cloud/profiler/v2/internal/profiler_option_defaults.cc @@ -42,7 +42,7 @@ Options ProfilerServiceDefaultOptions(Options options) { if (!options.has()) { options.set( profiler_v2::ProfilerServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/profiler/v2/internal/profiler_stub.cc b/google/cloud/profiler/v2/internal/profiler_stub.cc index 77ca3dc904e79..7ccba53410b93 100644 --- a/google/cloud/profiler/v2/internal/profiler_stub.cc +++ b/google/cloud/profiler/v2/internal/profiler_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/profiler/v2/internal/profiler_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/devtools/cloudprofiler/v2/profiler.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace profiler_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/profiler/v2/internal/profiler_stub.h b/google/cloud/profiler/v2/internal/profiler_stub.h index f60c004e5b1a6..1509559e5d231 100644 --- a/google/cloud/profiler/v2/internal/profiler_stub.h +++ b/google/cloud/profiler/v2/internal/profiler_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/devtools/cloudprofiler/v2/profiler.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -86,4 +89,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_V2_INTERNAL_PROFILER_STUB_H diff --git a/google/cloud/profiler/v2/internal/profiler_stub_factory.cc b/google/cloud/profiler/v2/internal/profiler_stub_factory.cc index 08542ec358b07..0d58f7909ce3d 100644 --- a/google/cloud/profiler/v2/internal/profiler_stub_factory.cc +++ b/google/cloud/profiler/v2/internal/profiler_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/devtools/cloudprofiler/v2/profiler.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace profiler_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/profiler/v2/internal/profiler_stub_factory.h b/google/cloud/profiler/v2/internal/profiler_stub_factory.h index d4edfbf0f2db7..94142521908ab 100644 --- a/google/cloud/profiler/v2/internal/profiler_stub_factory.h +++ b/google/cloud/profiler/v2/internal/profiler_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_V2_INTERNAL_PROFILER_STUB_FACTORY_H diff --git a/google/cloud/profiler/v2/internal/profiler_tracing_connection.cc b/google/cloud/profiler/v2/internal/profiler_tracing_connection.cc index 90430a5973c22..e42f85d51ad67 100644 --- a/google/cloud/profiler/v2/internal/profiler_tracing_connection.cc +++ b/google/cloud/profiler/v2/internal/profiler_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace profiler_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ProfilerServiceTracingConnection::ProfilerServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -60,16 +58,12 @@ ProfilerServiceTracingConnection::UpdateProfile( return internal::EndSpan(*span, child_->UpdateProfile(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeProfilerServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/profiler/v2/internal/profiler_tracing_connection.h b/google/cloud/profiler/v2/internal/profiler_tracing_connection.h index 189d70e0359e9..e013b577b88b8 100644 --- a/google/cloud/profiler/v2/internal/profiler_tracing_connection.h +++ b/google/cloud/profiler/v2/internal/profiler_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace profiler_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ProfilerServiceTracingConnection : public profiler_v2::ProfilerServiceConnection { public: @@ -56,8 +54,6 @@ class ProfilerServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/profiler/v2/internal/profiler_tracing_stub.cc b/google/cloud/profiler/v2/internal/profiler_tracing_stub.cc index 1aadc0b02880b..92a7a0d83434d 100644 --- a/google/cloud/profiler/v2/internal/profiler_tracing_stub.cc +++ b/google/cloud/profiler/v2/internal/profiler_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ProfilerServiceTracingStub::ProfilerServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -70,18 +71,14 @@ ProfilerServiceTracingStub::UpdateProfile( child_->UpdateProfile(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeProfilerServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace profiler_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/profiler/v2/internal/profiler_tracing_stub.h b/google/cloud/profiler/v2/internal/profiler_tracing_stub.h index c74f7bfa965a2..af578db037816 100644 --- a/google/cloud/profiler/v2/internal/profiler_tracing_stub.h +++ b/google/cloud/profiler/v2/internal/profiler_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace profiler_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ProfilerServiceTracingStub : public ProfilerServiceStub { public: ~ProfilerServiceTracingStub() override = default; @@ -60,8 +61,6 @@ class ProfilerServiceTracingStub : public ProfilerServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -76,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PROFILER_V2_INTERNAL_PROFILER_TRACING_STUB_H diff --git a/google/cloud/profiler/v2/profiler_connection.h b/google/cloud/profiler/v2/profiler_connection.h index 9b4402c3a95c4..3ff353e3a391a 100644 --- a/google/cloud/profiler/v2/profiler_connection.h +++ b/google/cloud/profiler/v2/profiler_connection.h @@ -26,7 +26,7 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/devtools/cloudprofiler/v2/profiler.pb.h" #include namespace google { diff --git a/google/cloud/profiler/v2/profiler_connection_idempotency_policy.h b/google/cloud/profiler/v2/profiler_connection_idempotency_policy.h index 475fc5436916d..ccd85154a77e1 100644 --- a/google/cloud/profiler/v2/profiler_connection_idempotency_policy.h +++ b/google/cloud/profiler/v2/profiler_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/devtools/cloudprofiler/v2/profiler.grpc.pb.h" #include namespace google { diff --git a/google/cloud/publicca/BUILD.bazel b/google/cloud/publicca/BUILD.bazel index 32479ebc68d17..2a3337344d785 100644 --- a/google/cloud/publicca/BUILD.bazel +++ b/google/cloud/publicca/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/security/publicca/v1:publicca_cc_grpc", + "@googleapis//google/cloud/security/publicca/v1:publicca_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/publicca/quickstart/.bazelrc b/google/cloud/publicca/quickstart/.bazelrc index 15d5c055db074..343e7f623d628 100644 --- a/google/cloud/publicca/quickstart/.bazelrc +++ b/google/cloud/publicca/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/publicca/quickstart/CMakeLists.txt index 7679a9ffdcf82..332158795383f 100644 --- a/google/cloud/publicca/quickstart/CMakeLists.txt +++ b/google/cloud/publicca/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Public Certificate Authority API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-publicca-quickstart CXX) find_package(google_cloud_cpp_publicca REQUIRED) diff --git a/google/cloud/publicca/quickstart/WORKSPACE.bazel b/google/cloud/publicca/quickstart/WORKSPACE.bazel index bcd3c3eba41b0..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 = "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/publicca/v1/internal/public_certificate_authority_auth_decorator.cc b/google/cloud/publicca/v1/internal/public_certificate_authority_auth_decorator.cc index 3893a17114a49..eaa835eabfa31 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_auth_decorator.cc +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/security/publicca/v1/service.proto #include "google/cloud/publicca/v1/internal/public_certificate_authority_auth_decorator.h" -#include +#include "google/cloud/security/publicca/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace publicca_v1_internal { @@ -45,3 +48,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace publicca_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/publicca/v1/internal/public_certificate_authority_auth_decorator.h b/google/cloud/publicca/v1/internal/public_certificate_authority_auth_decorator.h index 604f634ab7757..daa25ed5bac8a 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_auth_decorator.h +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace publicca_v1_internal { @@ -55,4 +58,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBLICCA_V1_INTERNAL_PUBLIC_CERTIFICATE_AUTHORITY_AUTH_DECORATOR_H diff --git a/google/cloud/publicca/v1/internal/public_certificate_authority_logging_decorator.cc b/google/cloud/publicca/v1/internal/public_certificate_authority_logging_decorator.cc index 50379e7db35b7..abba1b1fbcad9 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_logging_decorator.cc +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/security/publicca/v1/service.proto #include "google/cloud/publicca/v1/internal/public_certificate_authority_logging_decorator.h" +#include "google/cloud/security/publicca/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace publicca_v1_internal { @@ -54,3 +57,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace publicca_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/publicca/v1/internal/public_certificate_authority_logging_decorator.h b/google/cloud/publicca/v1/internal/public_certificate_authority_logging_decorator.h index 80345064d2d5a..0a59280375184 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_logging_decorator.h +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace publicca_v1_internal { @@ -55,4 +58,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBLICCA_V1_INTERNAL_PUBLIC_CERTIFICATE_AUTHORITY_LOGGING_DECORATOR_H diff --git a/google/cloud/publicca/v1/internal/public_certificate_authority_metadata_decorator.cc b/google/cloud/publicca/v1/internal/public_certificate_authority_metadata_decorator.cc index 89697b2676186..009a125491174 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_metadata_decorator.cc +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/security/publicca/v1/service.proto #include "google/cloud/publicca/v1/internal/public_certificate_authority_metadata_decorator.h" +#include "google/cloud/security/publicca/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 publicca_v1_internal { @@ -72,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace publicca_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/publicca/v1/internal/public_certificate_authority_metadata_decorator.h b/google/cloud/publicca/v1/internal/public_certificate_authority_metadata_decorator.h index 296240daa5e93..f45f26ed5fcbb 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_metadata_decorator.h +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace publicca_v1_internal { @@ -61,4 +64,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBLICCA_V1_INTERNAL_PUBLIC_CERTIFICATE_AUTHORITY_METADATA_DECORATOR_H diff --git a/google/cloud/publicca/v1/internal/public_certificate_authority_option_defaults.cc b/google/cloud/publicca/v1/internal/public_certificate_authority_option_defaults.cc index 81fd453b13e50..e4e5103de3839 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_option_defaults.cc +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_option_defaults.cc @@ -45,7 +45,7 @@ Options PublicCertificateAuthorityServiceDefaultOptions(Options options) { options.set< publicca_v1::PublicCertificateAuthorityServiceRetryPolicyOption>( publicca_v1::PublicCertificateAuthorityServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/publicca/v1/internal/public_certificate_authority_stub.cc b/google/cloud/publicca/v1/internal/public_certificate_authority_stub.cc index 9253c976428bf..8868fc4b88cce 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_stub.cc +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/security/publicca/v1/service.proto #include "google/cloud/publicca/v1/internal/public_certificate_authority_stub.h" +#include "google/cloud/security/publicca/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace publicca_v1_internal { @@ -49,3 +52,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace publicca_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/publicca/v1/internal/public_certificate_authority_stub.h b/google/cloud/publicca/v1/internal/public_certificate_authority_stub.h index ca54dba2bec1e..70b6b422645d7 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_stub.h +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBLICCA_V1_INTERNAL_PUBLIC_CERTIFICATE_AUTHORITY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBLICCA_V1_INTERNAL_PUBLIC_CERTIFICATE_AUTHORITY_STUB_H +#include "google/cloud/security/publicca/v1/service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace publicca_v1_internal { @@ -68,4 +71,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBLICCA_V1_INTERNAL_PUBLIC_CERTIFICATE_AUTHORITY_STUB_H diff --git a/google/cloud/publicca/v1/internal/public_certificate_authority_stub_factory.cc b/google/cloud/publicca/v1/internal/public_certificate_authority_stub_factory.cc index b9787a1075d39..62d9c57809490 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_stub_factory.cc +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/publicca/v1/internal/public_certificate_authority_metadata_decorator.h" #include "google/cloud/publicca/v1/internal/public_certificate_authority_stub.h" #include "google/cloud/publicca/v1/internal/public_certificate_authority_tracing_stub.h" +#include "google/cloud/security/publicca/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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace publicca_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace publicca_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/publicca/v1/internal/public_certificate_authority_stub_factory.h b/google/cloud/publicca/v1/internal/public_certificate_authority_stub_factory.h index 445d6bbe54cbb..cd683a84ed96c 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_stub_factory.h +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace publicca_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBLICCA_V1_INTERNAL_PUBLIC_CERTIFICATE_AUTHORITY_STUB_FACTORY_H diff --git a/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_connection.cc b/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_connection.cc index 690d612870fda..4e896887ff389 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_connection.cc +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace publicca_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PublicCertificateAuthorityServiceTracingConnection:: PublicCertificateAuthorityServiceTracingConnection( std::shared_ptr< @@ -46,18 +44,14 @@ PublicCertificateAuthorityServiceTracingConnection::CreateExternalAccountKey( return internal::EndSpan(*span, child_->CreateExternalAccountKey(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePublicCertificateAuthorityServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_connection.h b/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_connection.h index 7b90b3caa72f4..f764a9d5ddc59 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_connection.h +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace publicca_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PublicCertificateAuthorityServiceTracingConnection : public publicca_v1::PublicCertificateAuthorityServiceConnection { public: @@ -51,8 +49,6 @@ class PublicCertificateAuthorityServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_stub.cc b/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_stub.cc index f12cb0f124f7f..e1594c9614371 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_stub.cc +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace publicca_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PublicCertificateAuthorityServiceTracingStub:: PublicCertificateAuthorityServiceTracingStub( std::shared_ptr child) @@ -48,20 +49,16 @@ PublicCertificateAuthorityServiceTracingStub::CreateExternalAccountKey( child_->CreateExternalAccountKey(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePublicCertificateAuthorityServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace publicca_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_stub.h b/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_stub.h index 5a9f442b8e5e9..4216647ec1699 100644 --- a/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_stub.h +++ b/google/cloud/publicca/v1/internal/public_certificate_authority_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace publicca_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PublicCertificateAuthorityServiceTracingStub : public PublicCertificateAuthorityServiceStub { public: @@ -52,8 +53,6 @@ class PublicCertificateAuthorityServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -69,4 +68,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBLICCA_V1_INTERNAL_PUBLIC_CERTIFICATE_AUTHORITY_TRACING_STUB_H diff --git a/google/cloud/publicca/v1/public_certificate_authority_connection.h b/google/cloud/publicca/v1/public_certificate_authority_connection.h index eb46074793e50..80d53de84d8b5 100644 --- a/google/cloud/publicca/v1/public_certificate_authority_connection.h +++ b/google/cloud/publicca/v1/public_certificate_authority_connection.h @@ -21,12 +21,12 @@ #include "google/cloud/publicca/v1/internal/public_certificate_authority_retry_traits.h" #include "google/cloud/publicca/v1/public_certificate_authority_connection_idempotency_policy.h" +#include "google/cloud/security/publicca/v1/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/version.h" -#include #include namespace google { diff --git a/google/cloud/publicca/v1/public_certificate_authority_connection_idempotency_policy.h b/google/cloud/publicca/v1/public_certificate_authority_connection_idempotency_policy.h index 93f9a8d51878f..12682b8db6af9 100644 --- a/google/cloud/publicca/v1/public_certificate_authority_connection_idempotency_policy.h +++ b/google/cloud/publicca/v1/public_certificate_authority_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBLICCA_V1_PUBLIC_CERTIFICATE_AUTHORITY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBLICCA_V1_PUBLIC_CERTIFICATE_AUTHORITY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/security/publicca/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/pubsub/BUILD.bazel b/google/cloud/pubsub/BUILD.bazel index 59bc8b0f07d40..8580d58724238 100644 --- a/google/cloud/pubsub/BUILD.bazel +++ b/google/cloud/pubsub/BUILD.bazel @@ -38,9 +38,9 @@ cc_library( deps = [ "//:common", "//:grpc_utils", - "@com_google_googleapis//google/pubsub/v1:pubsub_cc_grpc", + "@googleapis//google/pubsub/v1:pubsub_cc_grpc", # Do not sort: grpc++ must come last - "@com_github_grpc_grpc//:grpc++", + "@grpc//:grpc++", ], ) @@ -56,20 +56,18 @@ cc_library( ":google_cloud_cpp_pubsub", "//:common", "//:grpc_utils", - "@com_google_googletest//:gtest", + "@googletest//:gtest", ], ) -# TODO(#3701): Delete this target after 2023-04-01. cc_library( name = "pubsub_client_testing", testonly = True, - deprecation = """ - This target is deprecated and will be removed on or after 2023-04-01. More - info: https://github.com/googleapis/google-cloud-cpp/issues/3701 - """, tags = ["manual"], - visibility = ["//visibility:public"], + visibility = [ + ":__subpackages__", + "//:__pkg__", + ], deps = [":pubsub_client_testing_private"], ) @@ -90,7 +88,7 @@ cc_library( ], deps = [ ":google_cloud_cpp_pubsub", - "@com_google_googletest//:gtest", + "@googletest//:gtest", ], ) @@ -104,7 +102,7 @@ cc_library( "//:common", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_absl//absl/strings:str_format", - "@com_google_googletest//:gtest_main", + "@abseil-cpp//absl/strings:str_format", + "@googletest//:gtest_main", ], ) for test in pubsub_client_unit_tests] diff --git a/google/cloud/pubsub/CMakeLists.txt b/google/cloud/pubsub/CMakeLists.txt index 3e96e604e9419..7c22acd4dae22 100644 --- a/google/cloud/pubsub/CMakeLists.txt +++ b/google/cloud/pubsub/CMakeLists.txt @@ -243,8 +243,6 @@ add_library( publisher.h publisher_connection.cc publisher_connection.h - publisher_options.cc - publisher_options.h pull_ack_handler.cc pull_ack_handler.h pull_response.h @@ -266,8 +264,6 @@ add_library( subscriber.h subscriber_connection.cc subscriber_connection.h - subscriber_options.cc - subscriber_options.h subscription.cc subscription.h subscription_admin_client.cc @@ -494,14 +490,12 @@ function (google_cloud_cpp_pubsub_client_define_tests) message_test.cc options_test.cc publisher_connection_test.cc - publisher_options_test.cc publisher_test.cc pull_ack_handler_test.cc schema_test.cc snapshot_builder_test.cc snapshot_test.cc subscriber_connection_test.cc - subscriber_options_test.cc subscriber_test.cc subscription_admin_client_test.cc subscription_admin_connection_test.cc diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_auth_decorator.cc b/google/cloud/pubsub/admin/internal/subscription_admin_auth_decorator.cc index 184344bbff929..c0a04d52b6c87 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_auth_decorator.cc +++ b/google/cloud/pubsub/admin/internal/subscription_admin_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/pubsub/v1/pubsub.proto #include "google/cloud/pubsub/admin/internal/subscription_admin_auth_decorator.h" -#include +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -161,3 +164,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_auth_decorator.h b/google/cloud/pubsub/admin/internal/subscription_admin_auth_decorator.h index 9ab07cfdd9390..ab164b6b2d3e7 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_auth_decorator.h +++ b/google/cloud/pubsub/admin/internal/subscription_admin_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -108,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_ADMIN_INTERNAL_SUBSCRIPTION_ADMIN_AUTH_DECORATOR_H diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_logging_decorator.cc b/google/cloud/pubsub/admin/internal/subscription_admin_logging_decorator.cc index 72e778d09d05f..0ff0d50c58f7c 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_logging_decorator.cc +++ b/google/cloud/pubsub/admin/internal/subscription_admin_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/pubsub/admin/internal/subscription_admin_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -210,3 +213,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_logging_decorator.h b/google/cloud/pubsub/admin/internal/subscription_admin_logging_decorator.h index 426315708980f..44bab886d42eb 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_logging_decorator.h +++ b/google/cloud/pubsub/admin/internal/subscription_admin_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -108,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_ADMIN_INTERNAL_SUBSCRIPTION_ADMIN_LOGGING_DECORATOR_H diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_metadata_decorator.cc b/google/cloud/pubsub/admin/internal/subscription_admin_metadata_decorator.cc index fd6e0ee727023..266b453f09e99 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_metadata_decorator.cc +++ b/google/cloud/pubsub/admin/internal/subscription_admin_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/pubsub/admin/internal/subscription_admin_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -200,3 +204,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_metadata_decorator.h b/google/cloud/pubsub/admin/internal/subscription_admin_metadata_decorator.h index 7c5b5f925cc43..9dfda90fed12b 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_metadata_decorator.h +++ b/google/cloud/pubsub/admin/internal/subscription_admin_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -114,4 +117,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_ADMIN_INTERNAL_SUBSCRIPTION_ADMIN_METADATA_DECORATOR_H diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_option_defaults.cc b/google/cloud/pubsub/admin/internal/subscription_admin_option_defaults.cc index 034e446212932..5b05a5c16de78 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_option_defaults.cc +++ b/google/cloud/pubsub/admin/internal/subscription_admin_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/pubsub/admin/internal/subscription_admin_option_defaults.h" #include "google/cloud/pubsub/admin/subscription_admin_connection.h" #include "google/cloud/pubsub/admin/subscription_admin_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -46,7 +46,7 @@ Options SubscriptionAdminDefaultOptions(std::string const& location, if (!options.has()) { options.set( pubsub_admin::SubscriptionAdminLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_stub.cc b/google/cloud/pubsub/admin/internal/subscription_admin_stub.cc index ba709c67c220b..499395cd0e11e 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_stub.cc +++ b/google/cloud/pubsub/admin/internal/subscription_admin_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/pubsub/admin/internal/subscription_admin_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -209,3 +212,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_stub.h b/google/cloud/pubsub/admin/internal/subscription_admin_stub.h index 1be96564ed9c7..4b8bca6ed56fe 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_stub.h +++ b/google/cloud/pubsub/admin/internal/subscription_admin_stub.h @@ -22,11 +22,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -177,4 +180,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_ADMIN_INTERNAL_SUBSCRIPTION_ADMIN_STUB_H diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_stub_factory.cc b/google/cloud/pubsub/admin/internal/subscription_admin_stub_factory.cc index 2a7d85d22a410..77ecdde662a4e 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_stub_factory.cc +++ b/google/cloud/pubsub/admin/internal/subscription_admin_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_stub_factory.h b/google/cloud/pubsub/admin/internal/subscription_admin_stub_factory.h index 7e5ee3c600cd6..a61e7fa1da1a4 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_stub_factory.h +++ b/google/cloud/pubsub/admin/internal/subscription_admin_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_ADMIN_INTERNAL_SUBSCRIPTION_ADMIN_STUB_FACTORY_H diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_tracing_connection.cc b/google/cloud/pubsub/admin/internal/subscription_admin_tracing_connection.cc index 208bbd7040924..28ca763f1406e 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_tracing_connection.cc +++ b/google/cloud/pubsub/admin/internal/subscription_admin_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace pubsub_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SubscriptionAdminTracingConnection::SubscriptionAdminTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -169,17 +167,13 @@ SubscriptionAdminTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSubscriptionAdminTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_tracing_connection.h b/google/cloud/pubsub/admin/internal/subscription_admin_tracing_connection.h index 0fd9bb8bc6631..93de1fbfb2ee6 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_tracing_connection.h +++ b/google/cloud/pubsub/admin/internal/subscription_admin_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace pubsub_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SubscriptionAdminTracingConnection : public pubsub_admin::SubscriptionAdminConnection { public: @@ -89,8 +87,6 @@ class SubscriptionAdminTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_tracing_stub.cc b/google/cloud/pubsub/admin/internal/subscription_admin_tracing_stub.cc index fbd7ae20f5a31..82d0029b135f4 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_tracing_stub.cc +++ b/google/cloud/pubsub/admin/internal/subscription_admin_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SubscriptionAdminTracingStub::SubscriptionAdminTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -205,18 +206,14 @@ SubscriptionAdminTracingStub::TestIamPermissions( context, *span, child_->TestIamPermissions(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSubscriptionAdminTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/admin/internal/subscription_admin_tracing_stub.h b/google/cloud/pubsub/admin/internal/subscription_admin_tracing_stub.h index 146a6a68e9b6b..5426dbcad0a87 100644 --- a/google/cloud/pubsub/admin/internal/subscription_admin_tracing_stub.h +++ b/google/cloud/pubsub/admin/internal/subscription_admin_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SubscriptionAdminTracingStub : public SubscriptionAdminStub { public: ~SubscriptionAdminTracingStub() override = default; @@ -105,8 +106,6 @@ class SubscriptionAdminTracingStub : public SubscriptionAdminStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -121,4 +120,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_ADMIN_INTERNAL_SUBSCRIPTION_ADMIN_TRACING_STUB_H diff --git a/google/cloud/pubsub/admin/internal/topic_admin_auth_decorator.cc b/google/cloud/pubsub/admin/internal/topic_admin_auth_decorator.cc index 56ba11efcc87e..9cadbc0b01b1a 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_auth_decorator.cc +++ b/google/cloud/pubsub/admin/internal/topic_admin_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/pubsub/v1/pubsub.proto #include "google/cloud/pubsub/admin/internal/topic_admin_auth_decorator.h" -#include +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -127,3 +130,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/admin/internal/topic_admin_auth_decorator.h b/google/cloud/pubsub/admin/internal/topic_admin_auth_decorator.h index 6b9aa1d26c043..cd5fecf334398 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_auth_decorator.h +++ b/google/cloud/pubsub/admin/internal/topic_admin_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_ADMIN_INTERNAL_TOPIC_ADMIN_AUTH_DECORATOR_H diff --git a/google/cloud/pubsub/admin/internal/topic_admin_logging_decorator.cc b/google/cloud/pubsub/admin/internal/topic_admin_logging_decorator.cc index 15e61c2bf2a4a..577975ad96c49 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_logging_decorator.cc +++ b/google/cloud/pubsub/admin/internal/topic_admin_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/pubsub/admin/internal/topic_admin_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -164,3 +167,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/admin/internal/topic_admin_logging_decorator.h b/google/cloud/pubsub/admin/internal/topic_admin_logging_decorator.h index ef08e5ed57c92..f24c628bc5505 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_logging_decorator.h +++ b/google/cloud/pubsub/admin/internal/topic_admin_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_ADMIN_INTERNAL_TOPIC_ADMIN_LOGGING_DECORATOR_H diff --git a/google/cloud/pubsub/admin/internal/topic_admin_metadata_decorator.cc b/google/cloud/pubsub/admin/internal/topic_admin_metadata_decorator.cc index 703979521b35c..e9e2963f65fa0 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_metadata_decorator.cc +++ b/google/cloud/pubsub/admin/internal/topic_admin_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/pubsub/admin/internal/topic_admin_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -158,3 +162,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/admin/internal/topic_admin_metadata_decorator.h b/google/cloud/pubsub/admin/internal/topic_admin_metadata_decorator.h index 882dbed43d5b8..673adda1e6370 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_metadata_decorator.h +++ b/google/cloud/pubsub/admin/internal/topic_admin_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_ADMIN_INTERNAL_TOPIC_ADMIN_METADATA_DECORATOR_H diff --git a/google/cloud/pubsub/admin/internal/topic_admin_option_defaults.cc b/google/cloud/pubsub/admin/internal/topic_admin_option_defaults.cc index 050e68ca73853..ba572d6290872 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_option_defaults.cc +++ b/google/cloud/pubsub/admin/internal/topic_admin_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/pubsub/admin/internal/topic_admin_option_defaults.h" #include "google/cloud/pubsub/admin/topic_admin_connection.h" #include "google/cloud/pubsub/admin/topic_admin_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -44,7 +44,7 @@ Options TopicAdminDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - pubsub_admin::TopicAdminLimitedTimeRetryPolicy(std::chrono::minutes(30)) + pubsub_admin::TopicAdminLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/pubsub/admin/internal/topic_admin_stub.cc b/google/cloud/pubsub/admin/internal/topic_admin_stub.cc index 7ea8f1dc71c84..7bf6cdca745fd 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_stub.cc +++ b/google/cloud/pubsub/admin/internal/topic_admin_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/pubsub/admin/internal/topic_admin_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -162,3 +165,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/admin/internal/topic_admin_stub.h b/google/cloud/pubsub/admin/internal/topic_admin_stub.h index 6ba2e4031baab..bd27195b150e6 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_stub.h +++ b/google/cloud/pubsub/admin/internal/topic_admin_stub.h @@ -22,11 +22,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -149,4 +152,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_ADMIN_INTERNAL_TOPIC_ADMIN_STUB_H diff --git a/google/cloud/pubsub/admin/internal/topic_admin_stub_factory.cc b/google/cloud/pubsub/admin/internal/topic_admin_stub_factory.cc index 4d005f6edcecb..2ece82f2a6ae4 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_stub_factory.cc +++ b/google/cloud/pubsub/admin/internal/topic_admin_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/admin/internal/topic_admin_stub_factory.h b/google/cloud/pubsub/admin/internal/topic_admin_stub_factory.h index c9a30538782c0..93555c7021ee2 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_stub_factory.h +++ b/google/cloud/pubsub/admin/internal/topic_admin_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_ADMIN_INTERNAL_TOPIC_ADMIN_STUB_FACTORY_H diff --git a/google/cloud/pubsub/admin/internal/topic_admin_tracing_connection.cc b/google/cloud/pubsub/admin/internal/topic_admin_tracing_connection.cc index fb18f165597a6..e18f9659af0ae 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_tracing_connection.cc +++ b/google/cloud/pubsub/admin/internal/topic_admin_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace pubsub_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TopicAdminTracingConnection::TopicAdminTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -129,16 +127,12 @@ TopicAdminTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTopicAdminTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/pubsub/admin/internal/topic_admin_tracing_connection.h b/google/cloud/pubsub/admin/internal/topic_admin_tracing_connection.h index 4ddd86cb69b66..65cdc4f852eaf 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_tracing_connection.h +++ b/google/cloud/pubsub/admin/internal/topic_admin_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace pubsub_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TopicAdminTracingConnection : public pubsub_admin::TopicAdminConnection { public: ~TopicAdminTracingConnection() override = default; @@ -76,8 +74,6 @@ class TopicAdminTracingConnection : public pubsub_admin::TopicAdminConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/pubsub/admin/internal/topic_admin_tracing_stub.cc b/google/cloud/pubsub/admin/internal/topic_admin_tracing_stub.cc index 0bfd00a1850e5..4730cb3e91710 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_tracing_stub.cc +++ b/google/cloud/pubsub/admin/internal/topic_admin_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TopicAdminTracingStub::TopicAdminTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -158,18 +159,14 @@ TopicAdminTracingStub::TestIamPermissions( context, *span, child_->TestIamPermissions(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTopicAdminTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/admin/internal/topic_admin_tracing_stub.h b/google/cloud/pubsub/admin/internal/topic_admin_tracing_stub.h index 6828e27c6e41d..583ad07e7a2c7 100644 --- a/google/cloud/pubsub/admin/internal/topic_admin_tracing_stub.h +++ b/google/cloud/pubsub/admin/internal/topic_admin_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TopicAdminTracingStub : public TopicAdminStub { public: ~TopicAdminTracingStub() override = default; @@ -90,8 +91,6 @@ class TopicAdminTracingStub : public TopicAdminStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -106,4 +105,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_ADMIN_INTERNAL_TOPIC_ADMIN_TRACING_STUB_H 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/admin/subscription_admin_connection.h b/google/cloud/pubsub/admin/subscription_admin_connection.h index e6d67032eff6d..dbbad7e66ba28 100644 --- a/google/cloud/pubsub/admin/subscription_admin_connection.h +++ b/google/cloud/pubsub/admin/subscription_admin_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" #include #include diff --git a/google/cloud/pubsub/admin/subscription_admin_connection_idempotency_policy.h b/google/cloud/pubsub/admin/subscription_admin_connection_idempotency_policy.h index d722d63b00fab..473c519767e0c 100644 --- a/google/cloud/pubsub/admin/subscription_admin_connection_idempotency_policy.h +++ b/google/cloud/pubsub/admin/subscription_admin_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include namespace google { diff --git a/google/cloud/pubsub/admin/topic_admin_connection.h b/google/cloud/pubsub/admin/topic_admin_connection.h index 81836bc33efd1..c9bacf524be05 100644 --- a/google/cloud/pubsub/admin/topic_admin_connection.h +++ b/google/cloud/pubsub/admin/topic_admin_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" #include #include diff --git a/google/cloud/pubsub/admin/topic_admin_connection_idempotency_policy.h b/google/cloud/pubsub/admin/topic_admin_connection_idempotency_policy.h index 33ef2aecc27d8..d2c9e2ef9aad3 100644 --- a/google/cloud/pubsub/admin/topic_admin_connection_idempotency_policy.h +++ b/google/cloud/pubsub/admin/topic_admin_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include namespace google { diff --git a/google/cloud/pubsub/benchmarks/BUILD.bazel b/google/cloud/pubsub/benchmarks/BUILD.bazel index 64fe4dfaa70cc..520850ae67ec0 100644 --- a/google/cloud/pubsub/benchmarks/BUILD.bazel +++ b/google/cloud/pubsub/benchmarks/BUILD.bazel @@ -30,9 +30,9 @@ licenses(["notice"]) # Apache 2.0 "//:pubsub", "//google/cloud/pubsub:pubsub_client_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_absl//absl/base", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/strings:cord", - "@com_google_absl//absl/strings:str_format", + "@abseil-cpp//absl/base", + "@abseil-cpp//absl/strings", + "@abseil-cpp//absl/strings:cord", + "@abseil-cpp//absl/strings:str_format", ], ) for program in pubsub_client_benchmark_programs] diff --git a/google/cloud/pubsub/benchmarks/throughput.cc b/google/cloud/pubsub/benchmarks/throughput.cc index a2e4454f91899..86b5a4a1293f9 100644 --- a/google/cloud/pubsub/benchmarks/throughput.cc +++ b/google/cloud/pubsub/benchmarks/throughput.cc @@ -14,6 +14,7 @@ #include "google/cloud/pubsub/admin/subscription_admin_client.h" #include "google/cloud/pubsub/admin/topic_admin_client.h" +#include "google/cloud/pubsub/options.h" #include "google/cloud/pubsub/publisher.h" #include "google/cloud/pubsub/subscriber.h" #include "google/cloud/pubsub/testing/random_names.h" diff --git a/google/cloud/pubsub/blocking_publisher.h b/google/cloud/pubsub/blocking_publisher.h index aa316e360428b..271749412407e 100644 --- a/google/cloud/pubsub/blocking_publisher.h +++ b/google/cloud/pubsub/blocking_publisher.h @@ -16,7 +16,6 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_BLOCKING_PUBLISHER_H #include "google/cloud/pubsub/blocking_publisher_connection.h" -#include "google/cloud/pubsub/publisher_options.h" #include "google/cloud/pubsub/version.h" #include diff --git a/google/cloud/pubsub/blocking_publisher_connection.h b/google/cloud/pubsub/blocking_publisher_connection.h index 6839e25eb764b..9728f61b1bed7 100644 --- a/google/cloud/pubsub/blocking_publisher_connection.h +++ b/google/cloud/pubsub/blocking_publisher_connection.h @@ -19,7 +19,6 @@ #include "google/cloud/pubsub/connection_options.h" #include "google/cloud/pubsub/internal/publisher_stub.h" #include "google/cloud/pubsub/message.h" -#include "google/cloud/pubsub/publisher_options.h" #include "google/cloud/pubsub/retry_policy.h" #include "google/cloud/pubsub/topic.h" #include "google/cloud/pubsub/version.h" diff --git a/google/cloud/pubsub/google_cloud_cpp_pubsub.bzl b/google/cloud/pubsub/google_cloud_cpp_pubsub.bzl index a5584fd30270b..4f9dfc3718890 100644 --- a/google/cloud/pubsub/google_cloud_cpp_pubsub.bzl +++ b/google/cloud/pubsub/google_cloud_cpp_pubsub.bzl @@ -129,7 +129,6 @@ google_cloud_cpp_pubsub_hdrs = [ "options.h", "publisher.h", "publisher_connection.h", - "publisher_options.h", "pull_ack_handler.h", "pull_response.h", "retry_policy.h", @@ -142,7 +141,6 @@ google_cloud_cpp_pubsub_hdrs = [ "snapshot_builder.h", "subscriber.h", "subscriber_connection.h", - "subscriber_options.h", "subscription.h", "subscription_admin_client.h", "subscription_admin_connection.h", @@ -248,7 +246,6 @@ google_cloud_cpp_pubsub_srcs = [ "message.cc", "options.cc", "publisher_connection.cc", - "publisher_options.cc", "pull_ack_handler.cc", "schema.cc", "schema_client.cc", @@ -258,7 +255,6 @@ google_cloud_cpp_pubsub_srcs = [ "snapshot_builder.cc", "subscriber.cc", "subscriber_connection.cc", - "subscriber_options.cc", "subscription.cc", "subscription_admin_client.cc", "subscription_admin_connection.cc", diff --git a/google/cloud/pubsub/integration_tests/BUILD.bazel b/google/cloud/pubsub/integration_tests/BUILD.bazel index cfbc7503aa0ce..06abad4ebc691 100644 --- a/google/cloud/pubsub/integration_tests/BUILD.bazel +++ b/google/cloud/pubsub/integration_tests/BUILD.bazel @@ -31,6 +31,6 @@ licenses(["notice"]) # Apache 2.0 "//google/cloud/pubsub:pubsub_client_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in pubsub_client_integration_tests] diff --git a/google/cloud/pubsub/integration_tests/blocking_publisher_integration_test.cc b/google/cloud/pubsub/integration_tests/blocking_publisher_integration_test.cc index 8b35712edec5b..750011f6b5513 100644 --- a/google/cloud/pubsub/integration_tests/blocking_publisher_integration_test.cc +++ b/google/cloud/pubsub/integration_tests/blocking_publisher_integration_test.cc @@ -71,7 +71,6 @@ TEST_F(BlockingPublisherIntegrationTest, Basic) { ASSERT_STATUS_OK(publish); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; @@ -90,7 +89,6 @@ TEST_F(BlockingPublisherIntegrationTest, TracingDisabled) { publisher.Publish(topic_, MessageBuilder().SetData("test data").Build()); ASSERT_STATUS_OK(publish); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/pubsub/integration_tests/subscriber_integration_test.cc b/google/cloud/pubsub/integration_tests/subscriber_integration_test.cc index 5af7f78aea29a..97f38d4c1c7c8 100644 --- a/google/cloud/pubsub/integration_tests/subscriber_integration_test.cc +++ b/google/cloud/pubsub/integration_tests/subscriber_integration_test.cc @@ -21,6 +21,7 @@ #include "google/cloud/pubsub/internal/noop_message_callback.h" #include "google/cloud/pubsub/internal/streaming_subscription_batch_source.h" #include "google/cloud/pubsub/internal/subscriber_stub_factory.h" +#include "google/cloud/pubsub/options.h" #include "google/cloud/pubsub/publisher.h" #include "google/cloud/pubsub/subscriber.h" #include "google/cloud/pubsub/subscription.h" @@ -56,7 +57,6 @@ using ::google::cloud::testing_util::StatusIs; using ::testing::AnyOf; using ::testing::ElementsAreArray; using ::testing::IsEmpty; -using ::testing::NotNull; class SubscriberIntegrationTest : public ::google::cloud::testing_util::IntegrationTest { @@ -633,14 +633,6 @@ TEST_F(SubscriberIntegrationTest, TracingDisabledBlockingPull) { EXPECT_THAT(ids, IsEmpty()); } -/// @test Verify the backwards compatibility `v1` namespace still exists. -TEST_F(SubscriberIntegrationTest, BackwardsCompatibility) { - auto connection = ::google::cloud::pubsub::v1::MakeSubscriberConnection( - subscription_, Options{}); - EXPECT_THAT(connection, NotNull()); - ASSERT_NO_FATAL_FAILURE(Subscriber(std::move(connection))); -} - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub diff --git a/google/cloud/pubsub/integration_tests/subscription_admin_integration_test.cc b/google/cloud/pubsub/integration_tests/subscription_admin_integration_test.cc index 62cf591fa7b3f..79ec5e68ea2ba 100644 --- a/google/cloud/pubsub/integration_tests/subscription_admin_integration_test.cc +++ b/google/cloud/pubsub/integration_tests/subscription_admin_integration_test.cc @@ -44,7 +44,6 @@ using ::google::cloud::testing_util::StatusIs; using ::testing::AnyOf; using ::testing::Contains; using ::testing::Not; -using ::testing::NotNull; bool UsingEmulator() { return google::cloud::internal::GetEnv("PUBSUB_EMULATOR_HOST").has_value(); @@ -326,15 +325,6 @@ TEST_F(SubscriptionAdminIntegrationTest, SeekFailureSnapshot) { ASSERT_FALSE(response.ok()); } -/// @test Verify the backwards compatibility `v1` namespace still exists. -TEST_F(SubscriptionAdminIntegrationTest, BackwardsCompatibility) { - auto connection = - ::google::cloud::pubsub::v1::MakeSubscriptionAdminConnection( - MakeTestOptions()); - EXPECT_THAT(connection, NotNull()); - ASSERT_NO_FATAL_FAILURE(SubscriptionAdminClient(std::move(connection))); -} - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub diff --git a/google/cloud/pubsub/integration_tests/topic_admin_integration_test.cc b/google/cloud/pubsub/integration_tests/topic_admin_integration_test.cc index 4163baf68a486..2f5ed4f84b667 100644 --- a/google/cloud/pubsub/integration_tests/topic_admin_integration_test.cc +++ b/google/cloud/pubsub/integration_tests/topic_admin_integration_test.cc @@ -42,7 +42,6 @@ using ::testing::AnyOf; using ::testing::Contains; using ::testing::IsEmpty; using ::testing::Not; -using ::testing::NotNull; bool UsingEmulator() { return google::cloud::internal::GetEnv("PUBSUB_EMULATOR_HOST").has_value(); @@ -177,14 +176,6 @@ TEST_F(TopicAdminIntegrationTest, ListTopicSnapshotsFailure) { EXPECT_FALSE(*i); } -/// @test Verify the backwards compatibility `v1` namespace still exists. -TEST_F(TopicAdminIntegrationTest, BackwardsCompatibility) { - auto connection = - ::google::cloud::pubsub::v1::MakeTopicAdminConnection(MakeTestOptions()); - EXPECT_THAT(connection, NotNull()); - ASSERT_NO_FATAL_FAILURE(TopicAdminClient(std::move(connection))); -} - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub diff --git a/google/cloud/pubsub/internal/batch_callback.h b/google/cloud/pubsub/internal/batch_callback.h index c750ae5e29dfd..c415b5a91e12f 100644 --- a/google/cloud/pubsub/internal/batch_callback.h +++ b/google/cloud/pubsub/internal/batch_callback.h @@ -19,7 +19,7 @@ #include "google/cloud/pubsub/internal/span.h" #include "google/cloud/pubsub/version.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" #include namespace google { diff --git a/google/cloud/pubsub/internal/batch_callback_wrapper.h b/google/cloud/pubsub/internal/batch_callback_wrapper.h index 437057f7227e9..f316850a1a144 100644 --- a/google/cloud/pubsub/internal/batch_callback_wrapper.h +++ b/google/cloud/pubsub/internal/batch_callback_wrapper.h @@ -19,7 +19,7 @@ #include "google/cloud/pubsub/internal/message_callback.h" #include "google/cloud/pubsub/version.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/pubsub/internal/batch_sink.h b/google/cloud/pubsub/internal/batch_sink.h index 0dc7f8a010eb4..47ea6faf12e8e 100644 --- a/google/cloud/pubsub/internal/batch_sink.h +++ b/google/cloud/pubsub/internal/batch_sink.h @@ -20,7 +20,7 @@ #include "google/cloud/completion_queue.h" #include "google/cloud/future.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" #include namespace google { diff --git a/google/cloud/pubsub/internal/batching_publisher_connection.cc b/google/cloud/pubsub/internal/batching_publisher_connection.cc index d208510c26d18..23c5cf89d4f0c 100644 --- a/google/cloud/pubsub/internal/batching_publisher_connection.cc +++ b/google/cloud/pubsub/internal/batching_publisher_connection.cc @@ -13,6 +13,7 @@ // limitations under the License. #include "google/cloud/pubsub/internal/batching_publisher_connection.h" +#include "google/cloud/pubsub/options.h" #include "google/cloud/internal/make_status.h" namespace google { diff --git a/google/cloud/pubsub/internal/batching_publisher_connection_test.cc b/google/cloud/pubsub/internal/batching_publisher_connection_test.cc index 5ada6c6d3f479..4ad871083cc53 100644 --- a/google/cloud/pubsub/internal/batching_publisher_connection_test.cc +++ b/google/cloud/pubsub/internal/batching_publisher_connection_test.cc @@ -14,6 +14,7 @@ #include "google/cloud/pubsub/internal/batching_publisher_connection.h" #include "google/cloud/pubsub/internal/defaults.h" +#include "google/cloud/pubsub/options.h" #include "google/cloud/pubsub/testing/mock_batch_sink.h" #include "google/cloud/future.h" #include "google/cloud/internal/random.h" diff --git a/google/cloud/pubsub/internal/batching_publisher_tracing_connection.cc b/google/cloud/pubsub/internal/batching_publisher_tracing_connection.cc index b947776f699e8..eb2f14eb39ba3 100644 --- a/google/cloud/pubsub/internal/batching_publisher_tracing_connection.cc +++ b/google/cloud/pubsub/internal/batching_publisher_tracing_connection.cc @@ -15,16 +15,13 @@ #include "google/cloud/pubsub/internal/batching_publisher_tracing_connection.h" #include "google/cloud/pubsub/publisher_connection.h" #include "google/cloud/internal/opentelemetry.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY -#include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY +#include namespace google { namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace { class BatchingPublisherTracingConnection : public pubsub::PublisherConnection { @@ -36,10 +33,11 @@ class BatchingPublisherTracingConnection : public pubsub::PublisherConnection { ~BatchingPublisherTracingConnection() override = default; future> Publish(PublishParams p) override { - namespace sc = opentelemetry::trace::SemanticConventions; - auto span = internal::MakeSpan( - "publisher batching", - {{sc::kCodeFunction, "pubsub::BatchingPublisherConnection::Publish"}}); + namespace sc = opentelemetry::semconv; + auto span = + internal::MakeSpan("publisher batching", + {{sc::code::kCodeFunctionName, + "pubsub::BatchingPublisherConnection::Publish"}}); auto result = child_->Publish(std::move(p)); internal::EndSpan(*span); return result; @@ -72,16 +70,6 @@ MakeBatchingPublisherTracingConnection( std::move(connection)); } -#else // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::shared_ptr -MakeBatchingPublisherTracingConnection( - std::shared_ptr connection) { - return connection; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud diff --git a/google/cloud/pubsub/internal/batching_publisher_tracing_connection_test.cc b/google/cloud/pubsub/internal/batching_publisher_tracing_connection_test.cc index 5705d858de404..9e5159a35829b 100644 --- a/google/cloud/pubsub/internal/batching_publisher_tracing_connection_test.cc +++ b/google/cloud/pubsub/internal/batching_publisher_tracing_connection_test.cc @@ -22,7 +22,7 @@ #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" #include -#include +#include namespace google { namespace cloud { @@ -45,7 +45,7 @@ using ::testing::ElementsAre; using ::testing::SizeIs; TEST(BatchingPublisherTracingConnectionTest, PublishSpan) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_shared(); EXPECT_CALL(*mock, Publish) @@ -72,7 +72,7 @@ TEST(BatchingPublisherTracingConnectionTest, PublishSpan) { SpanWithStatus(opentelemetry::trace::StatusCode::kOk), SpanHasAttributes( OTelAttribute( - sc::kCodeFunction, + sc::code::kCodeFunctionName, "pubsub::BatchingPublisherConnection::Publish"), OTelAttribute("gl-cpp.status_code", "OK"))))); } diff --git a/google/cloud/pubsub/internal/blocking_publisher_connection_impl.cc b/google/cloud/pubsub/internal/blocking_publisher_connection_impl.cc index 14fe9000abb79..e63ad7ab44f81 100644 --- a/google/cloud/pubsub/internal/blocking_publisher_connection_impl.cc +++ b/google/cloud/pubsub/internal/blocking_publisher_connection_impl.cc @@ -14,6 +14,7 @@ #include "google/cloud/pubsub/internal/blocking_publisher_connection_impl.h" #include "google/cloud/pubsub/internal/publisher_stub_factory.h" +#include "google/cloud/pubsub/options.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/retry_loop.h" diff --git a/google/cloud/pubsub/internal/blocking_publisher_tracing_connection.cc b/google/cloud/pubsub/internal/blocking_publisher_tracing_connection.cc index 603d98b58776b..ef3e98e115654 100644 --- a/google/cloud/pubsub/internal/blocking_publisher_tracing_connection.cc +++ b/google/cloud/pubsub/internal/blocking_publisher_tracing_connection.cc @@ -13,39 +13,39 @@ // limitations under the License. #include "google/cloud/pubsub/internal/blocking_publisher_tracing_connection.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/pubsub/message.h" #include "google/cloud/pubsub/topic.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/status_or.h" #include +#include +#include #include -#include #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace google { namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace { opentelemetry::nostd::shared_ptr StartPublishSpan( pubsub::Topic const& topic, pubsub::Message const& m) { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; opentelemetry::trace::StartSpanOptions options; options.kind = opentelemetry::trace::SpanKind::kProducer; auto span = internal::MakeSpan( topic.topic_id() + " create", - {{sc::kMessagingSystem, "gcp_pubsub"}, - {sc::kMessagingDestinationName, topic.topic_id()}, + {{sc::messaging::kMessagingSystem, "gcp_pubsub"}, + {sc::messaging::kMessagingDestinationName, topic.topic_id()}, {"gcp.project_id", topic.project_id()}, - {/*sc::kMessagingOperationType=*/"messaging.operation.type", "create"}, - {/*sc::kMessagingMessageEnvelopeSize=*/"messaging.message.envelope.size", + {/*sc::messaging::kMessagingOperationType=*/"messaging.operation.type", + "create"}, + {/*sc::messaging::kMessagingMessageEnvelopeSize=*/"messaging.message." + "envelope.size", static_cast(MessageSize(m))}, - {sc::kCodeFunction, "pubsub::BlockingPublisher::Publish"}}, + {sc::code::kCodeFunctionName, "pubsub::BlockingPublisher::Publish"}}, options); if (!m.ordering_key().empty()) { span->SetAttribute("messaging.gcp_pubsub.message.ordering_key", @@ -92,16 +92,6 @@ MakeBlockingPublisherTracingConnection( std::move(connection)); } -#else // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::shared_ptr -MakeBlockingPublisherTracingConnection( - std::shared_ptr connection) { - return connection; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud diff --git a/google/cloud/pubsub/internal/blocking_publisher_tracing_connection_test.cc b/google/cloud/pubsub/internal/blocking_publisher_tracing_connection_test.cc index ce29cb4022765..62eafd27b7528 100644 --- a/google/cloud/pubsub/internal/blocking_publisher_tracing_connection_test.cc +++ b/google/cloud/pubsub/internal/blocking_publisher_tracing_connection_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/blocking_publisher_tracing_connection.h" #include "google/cloud/pubsub/blocking_publisher_connection.h" #include "google/cloud/pubsub/message.h" @@ -25,7 +23,8 @@ #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" #include -#include +#include +#include namespace google { namespace cloud { @@ -53,7 +52,7 @@ using ::testing::ElementsAre; using ::testing::Not; TEST(BlockingPublisherTracingConnectionTest, PublishSpanOnSuccess) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_shared(); EXPECT_CALL(*mock, Publish) @@ -79,24 +78,27 @@ TEST(BlockingPublisherTracingConnectionTest, PublishSpanOnSuccess) { SpanNamed("test-topic create"), SpanWithStatus(opentelemetry::trace::StatusCode::kOk), SpanHasAttributes( - OTelAttribute(sc::kMessagingSystem, "gcp_pubsub"), - OTelAttribute(sc::kMessagingDestinationName, - "test-topic"), + OTelAttribute(sc::messaging::kMessagingSystem, + "gcp_pubsub"), + OTelAttribute( + sc::messaging::kMessagingDestinationName, "test-topic"), OTelAttribute("gcp.project_id", "test-project"), OTelAttribute( "messaging.gcp_pubsub.message.ordering_key", "ordering-key-0"), OTelAttribute("gl-cpp.status_code", "OK"), - OTelAttribute(/*sc::kMessagingMessageEnvelopeSize=*/ - "messaging.message.envelope.size", - 45), + OTelAttribute< + std:: + int64_t>(/*sc::messaging::kMessagingMessageEnvelopeSize=*/ + "messaging.message.envelope.size", 45), OTelAttribute("messaging.message_id", "test-id-0"), OTelAttribute( - sc::kCodeFunction, "pubsub::BlockingPublisher::Publish"))))); + sc::code::kCodeFunctionName, + "pubsub::BlockingPublisher::Publish"))))); } TEST(BlockingPublisherTracingConnectionTest, PublishSpanOnError) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_shared(); EXPECT_CALL(*mock, Publish) @@ -122,17 +124,19 @@ TEST(BlockingPublisherTracingConnectionTest, PublishSpanOnError) { SpanNamed("test-topic create"), SpanWithStatus(opentelemetry::trace::StatusCode::kError), SpanHasAttributes( - OTelAttribute(sc::kMessagingSystem, "gcp_pubsub"), - OTelAttribute(sc::kMessagingDestinationName, - "test-topic"), + OTelAttribute(sc::messaging::kMessagingSystem, + "gcp_pubsub"), + OTelAttribute( + sc::messaging::kMessagingDestinationName, "test-topic"), OTelAttribute("gcp.project_id", "test-project"), OTelAttribute( "messaging.gcp_pubsub.message.ordering_key", "ordering-key-0"), OTelAttribute("gl-cpp.status_code", kErrorCode), - OTelAttribute(/*sc::kMessagingMessageEnvelopeSize=*/ - "messaging.message.envelope.size", - 45))))); + OTelAttribute< + std:: + int64_t>(/*sc::messaging::kMessagingMessageEnvelopeSize=*/ + "messaging.message.envelope.size", 45))))); } TEST(BlockingPublisherTracingConnectionTest, PublishSpanOmitsOrderingKey) { @@ -187,5 +191,3 @@ TEST(MakeBlockingPublisherTracingConnectionTest, CreateTracingConnection) { } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/internal/default_batch_callback.h b/google/cloud/pubsub/internal/default_batch_callback.h index 4b387a0973f72..eb3a330ff9fc4 100644 --- a/google/cloud/pubsub/internal/default_batch_callback.h +++ b/google/cloud/pubsub/internal/default_batch_callback.h @@ -18,7 +18,7 @@ #include "google/cloud/pubsub/internal/batch_callback.h" #include "google/cloud/pubsub/version.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/pubsub/internal/default_message_callback.h b/google/cloud/pubsub/internal/default_message_callback.h index 3d44f5928d374..11c35f6fdfd76 100644 --- a/google/cloud/pubsub/internal/default_message_callback.h +++ b/google/cloud/pubsub/internal/default_message_callback.h @@ -17,7 +17,7 @@ #include "google/cloud/pubsub/internal/message_callback.h" #include "google/cloud/pubsub/version.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/pubsub/internal/default_pull_ack_handler.cc b/google/cloud/pubsub/internal/default_pull_ack_handler.cc index 2185d67b5f4e8..1654de0cfbb42 100644 --- a/google/cloud/pubsub/internal/default_pull_ack_handler.cc +++ b/google/cloud/pubsub/internal/default_pull_ack_handler.cc @@ -18,7 +18,7 @@ #include "google/cloud/pubsub/options.h" #include "google/cloud/internal/async_retry_loop.h" #include "google/cloud/internal/make_status.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" #include namespace google { diff --git a/google/cloud/pubsub/internal/defaults.cc b/google/cloud/pubsub/internal/defaults.cc index b342a55af3d51..0c6af51632562 100644 --- a/google/cloud/pubsub/internal/defaults.cc +++ b/google/cloud/pubsub/internal/defaults.cc @@ -17,13 +17,13 @@ #include "google/cloud/common_options.h" #include "google/cloud/connection_options.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" #include "google/cloud/internal/user_agent_prefix.h" #include "google/cloud/options.h" #include "absl/strings/numbers.h" +#include "absl/strings/str_cat.h" #include #include #include diff --git a/google/cloud/pubsub/internal/extend_leases_with_retry.cc b/google/cloud/pubsub/internal/extend_leases_with_retry.cc index 94d12aab022a2..0caa2dbaf47a8 100644 --- a/google/cloud/pubsub/internal/extend_leases_with_retry.cc +++ b/google/cloud/pubsub/internal/extend_leases_with_retry.cc @@ -185,8 +185,6 @@ class ExtendLeasesHandle int attempts_ = 0; }; -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TracingLeaseManagement : public LeaseManagement { public: TracingLeaseManagement(std::shared_ptr child, @@ -221,15 +219,6 @@ std::shared_ptr MakeTracingLeaseManagement( std::move(batch_callback)); } -#else // #ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::shared_ptr MakeTracingLeaseManagement( - std::shared_ptr impl, std::shared_ptr) { - return impl; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace future ExtendLeasesWithRetry( diff --git a/google/cloud/pubsub/internal/extend_leases_with_retry.h b/google/cloud/pubsub/internal/extend_leases_with_retry.h index 1140cc5d3f58a..a89eaba22130f 100644 --- a/google/cloud/pubsub/internal/extend_leases_with_retry.h +++ b/google/cloud/pubsub/internal/extend_leases_with_retry.h @@ -22,7 +22,7 @@ #include "google/cloud/future.h" #include "google/cloud/status.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/pubsub/internal/extend_leases_with_retry_test.cc b/google/cloud/pubsub/internal/extend_leases_with_retry_test.cc index 3d06e67ee356b..d5fbd92ea69b3 100644 --- a/google/cloud/pubsub/internal/extend_leases_with_retry_test.cc +++ b/google/cloud/pubsub/internal/extend_leases_with_retry_test.cc @@ -190,8 +190,6 @@ TEST(ExtendLeasesWithRetry, FailureTooManyTransients) { EXPECT_THAT(log_lines, Contains(HasSubstr("ack_id=test-003"))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TEST(ExtendLeasesWithRetry, SuccessWithOtelEnabled) { auto mock = std::make_shared(); auto mock_cq = std::make_shared(); @@ -231,8 +229,6 @@ TEST(ExtendLeasesWithRetry, SuccessWithOtelEnabled) { EXPECT_STATUS_OK(result.get()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud diff --git a/google/cloud/pubsub/internal/flow_controlled_publisher_connection.h b/google/cloud/pubsub/internal/flow_controlled_publisher_connection.h index c3f7387f95c74..4a1638df07aad 100644 --- a/google/cloud/pubsub/internal/flow_controlled_publisher_connection.h +++ b/google/cloud/pubsub/internal/flow_controlled_publisher_connection.h @@ -15,6 +15,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_FLOW_CONTROLLED_PUBLISHER_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_FLOW_CONTROLLED_PUBLISHER_CONNECTION_H +#include "google/cloud/pubsub/options.h" #include "google/cloud/pubsub/publisher_connection.h" #include "google/cloud/pubsub/version.h" #include diff --git a/google/cloud/pubsub/internal/flow_controlled_publisher_tracing_connection.cc b/google/cloud/pubsub/internal/flow_controlled_publisher_tracing_connection.cc index 2c70c8d1dc975..c60bde49a69ad 100644 --- a/google/cloud/pubsub/internal/flow_controlled_publisher_tracing_connection.cc +++ b/google/cloud/pubsub/internal/flow_controlled_publisher_tracing_connection.cc @@ -14,19 +14,15 @@ #include "google/cloud/pubsub/internal/flow_controlled_publisher_tracing_connection.h" #include "google/cloud/pubsub/publisher_connection.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/opentelemetry.h" +#include #include -#include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace google { namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - namespace { class FlowControlledPublisherTracingConnection : public pubsub::PublisherConnection { @@ -38,10 +34,10 @@ class FlowControlledPublisherTracingConnection ~FlowControlledPublisherTracingConnection() override = default; future> Publish(PublishParams p) override { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span = internal::MakeSpan( "publisher flow control", - {{sc::kCodeFunction, + {{sc::code::kCodeFunctionName, "pubsub::FlowControlledPublisherConnection::Publish"}}); auto result = child_->Publish(std::move(p)); internal::EndSpan(*span); @@ -75,16 +71,6 @@ MakeFlowControlledPublisherTracingConnection( std::move(connection)); } -#else // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::shared_ptr -MakeFlowControlledPublisherTracingConnection( - std::shared_ptr connection) { - return connection; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud diff --git a/google/cloud/pubsub/internal/flow_controlled_publisher_tracing_connection_test.cc b/google/cloud/pubsub/internal/flow_controlled_publisher_tracing_connection_test.cc index cb6b8942c7426..c9c55d415c516 100644 --- a/google/cloud/pubsub/internal/flow_controlled_publisher_tracing_connection_test.cc +++ b/google/cloud/pubsub/internal/flow_controlled_publisher_tracing_connection_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/flow_controlled_publisher_tracing_connection.h" #include "google/cloud/pubsub/mocks/mock_publisher_connection.h" #include "google/cloud/pubsub/publisher_connection.h" @@ -22,7 +20,7 @@ #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" #include -#include +#include namespace google { namespace cloud { @@ -47,7 +45,7 @@ using ::testing::ElementsAre; using ::testing::SizeIs; TEST(FlowControlledPublisherTracingConnectionTest, PublishSpan) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_shared(); EXPECT_CALL(*mock, Publish) @@ -75,7 +73,7 @@ TEST(FlowControlledPublisherTracingConnectionTest, PublishSpan) { SpanWithStatus(opentelemetry::trace::StatusCode::kOk), SpanHasAttributes( OTelAttribute( - sc::kCodeFunction, + sc::code::kCodeFunctionName, "pubsub::FlowControlledPublisherConnection::Publish"), OTelAttribute("gl-cpp.status_code", "OK"))))); } @@ -139,5 +137,3 @@ TEST(MakeFlowControlledPublisherTracingConnectionTest, } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/internal/message_callback.h b/google/cloud/pubsub/internal/message_callback.h index b595683383c32..bdf0cbbe0bfee 100644 --- a/google/cloud/pubsub/internal/message_callback.h +++ b/google/cloud/pubsub/internal/message_callback.h @@ -19,7 +19,7 @@ #include "google/cloud/pubsub/internal/span.h" #include "google/cloud/pubsub/message.h" #include "google/cloud/pubsub/version.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" #include namespace google { diff --git a/google/cloud/pubsub/internal/message_carrier.cc b/google/cloud/pubsub/internal/message_carrier.cc index 74e6e7b226231..e0ba47c069309 100644 --- a/google/cloud/pubsub/internal/message_carrier.cc +++ b/google/cloud/pubsub/internal/message_carrier.cc @@ -12,13 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/message_carrier.h" #include "google/cloud/pubsub/message.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/noexcept_action.h" #include "google/cloud/internal/opentelemetry.h" +#include "absl/strings/str_cat.h" #include namespace google { @@ -52,5 +50,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/internal/message_carrier.h b/google/cloud/pubsub/internal/message_carrier.h index 9e8e9d48d4423..f48744484ad24 100644 --- a/google/cloud/pubsub/internal/message_carrier.h +++ b/google/cloud/pubsub/internal/message_carrier.h @@ -15,8 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_MESSAGE_CARRIER_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_MESSAGE_CARRIER_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/message.h" #include "google/cloud/version.h" #include @@ -60,6 +58,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_MESSAGE_CARRIER_H diff --git a/google/cloud/pubsub/internal/message_carrier_test.cc b/google/cloud/pubsub/internal/message_carrier_test.cc index 621e0f11df190..d212013d047d7 100644 --- a/google/cloud/pubsub/internal/message_carrier_test.cc +++ b/google/cloud/pubsub/internal/message_carrier_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/message_carrier.h" #include "google/cloud/pubsub/message.h" #include @@ -71,5 +69,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/internal/message_propagator.cc b/google/cloud/pubsub/internal/message_propagator.cc index d433d8301bf28..2b032a4c455f5 100644 --- a/google/cloud/pubsub/internal/message_propagator.cc +++ b/google/cloud/pubsub/internal/message_propagator.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/message_propagator.h" #include "google/cloud/pubsub/internal/message_carrier.h" #include "google/cloud/pubsub/message.h" @@ -45,5 +43,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/internal/message_propagator.h b/google/cloud/pubsub/internal/message_propagator.h index a04176c5fed0b..1bbd10c71574c 100644 --- a/google/cloud/pubsub/internal/message_propagator.h +++ b/google/cloud/pubsub/internal/message_propagator.h @@ -15,8 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_MESSAGE_PROPAGATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_MESSAGE_PROPAGATOR_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/message_carrier.h" #include "google/cloud/pubsub/message.h" #include @@ -48,6 +46,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_MESSAGE_PROPAGATOR_H diff --git a/google/cloud/pubsub/internal/message_propagator_test.cc b/google/cloud/pubsub/internal/message_propagator_test.cc index d948369b02a50..f9584343eb575 100644 --- a/google/cloud/pubsub/internal/message_propagator_test.cc +++ b/google/cloud/pubsub/internal/message_propagator_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/message_propagator.h" #include "google/cloud/pubsub/internal/message_carrier.h" #include "google/cloud/pubsub/message.h" @@ -77,5 +75,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/internal/publisher_auth_decorator.cc b/google/cloud/pubsub/internal/publisher_auth_decorator.cc index d38f7de840f73..cfe180c5c5cc3 100644 --- a/google/cloud/pubsub/internal/publisher_auth_decorator.cc +++ b/google/cloud/pubsub/internal/publisher_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/pubsub/v1/pubsub.proto #include "google/cloud/pubsub/internal/publisher_auth_decorator.h" -#include +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -155,3 +158,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/publisher_auth_decorator.h b/google/cloud/pubsub/internal/publisher_auth_decorator.h index 2f81f5fef921a..36453b10473e8 100644 --- a/google/cloud/pubsub/internal/publisher_auth_decorator.h +++ b/google/cloud/pubsub/internal/publisher_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_PUBLISHER_AUTH_DECORATOR_H diff --git a/google/cloud/pubsub/internal/publisher_logging_decorator.cc b/google/cloud/pubsub/internal/publisher_logging_decorator.cc index 441eb3e7072f2..682ad92786252 100644 --- a/google/cloud/pubsub/internal/publisher_logging_decorator.cc +++ b/google/cloud/pubsub/internal/publisher_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/pubsub/internal/publisher_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -193,3 +196,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/publisher_logging_decorator.h b/google/cloud/pubsub/internal/publisher_logging_decorator.h index 7f5028d399ebd..963b4e590d3ee 100644 --- a/google/cloud/pubsub/internal/publisher_logging_decorator.h +++ b/google/cloud/pubsub/internal/publisher_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -104,4 +107,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_PUBLISHER_LOGGING_DECORATOR_H diff --git a/google/cloud/pubsub/internal/publisher_metadata_decorator.cc b/google/cloud/pubsub/internal/publisher_metadata_decorator.cc index 2eb9e3771b152..dc4331b875f5c 100644 --- a/google/cloud/pubsub/internal/publisher_metadata_decorator.cc +++ b/google/cloud/pubsub/internal/publisher_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/pubsub/internal/publisher_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -178,3 +182,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/publisher_metadata_decorator.h b/google/cloud/pubsub/internal/publisher_metadata_decorator.h index 1a6c724c4f3b9..d0ffab4ff284b 100644 --- a/google/cloud/pubsub/internal/publisher_metadata_decorator.h +++ b/google/cloud/pubsub/internal/publisher_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_PUBLISHER_METADATA_DECORATOR_H diff --git a/google/cloud/pubsub/internal/publisher_round_robin_decorator.cc b/google/cloud/pubsub/internal/publisher_round_robin_decorator.cc index d23db6750ebb3..aa645cf530eab 100644 --- a/google/cloud/pubsub/internal/publisher_round_robin_decorator.cc +++ b/google/cloud/pubsub/internal/publisher_round_robin_decorator.cc @@ -21,6 +21,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -129,3 +132,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/publisher_round_robin_decorator.h b/google/cloud/pubsub/internal/publisher_round_robin_decorator.h index c11cbe985b7f6..6d15671a44d49 100644 --- a/google/cloud/pubsub/internal/publisher_round_robin_decorator.h +++ b/google/cloud/pubsub/internal/publisher_round_robin_decorator.h @@ -25,6 +25,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -105,4 +108,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_PUBLISHER_ROUND_ROBIN_DECORATOR_H diff --git a/google/cloud/pubsub/internal/publisher_stub.cc b/google/cloud/pubsub/internal/publisher_stub.cc index 8b6401ee66bdd..9f05a9f2bd9be 100644 --- a/google/cloud/pubsub/internal/publisher_stub.cc +++ b/google/cloud/pubsub/internal/publisher_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/pubsub/internal/publisher_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -191,3 +194,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/publisher_stub.h b/google/cloud/pubsub/internal/publisher_stub.h index 0345b4472e658..9da049a6d562c 100644 --- a/google/cloud/pubsub/internal/publisher_stub.h +++ b/google/cloud/pubsub/internal/publisher_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -171,4 +174,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_PUBLISHER_STUB_H diff --git a/google/cloud/pubsub/internal/publisher_stub_factory.cc b/google/cloud/pubsub/internal/publisher_stub_factory.cc index eb6c9d5cd7b7c..32ade81bd0324 100644 --- a/google/cloud/pubsub/internal/publisher_stub_factory.cc +++ b/google/cloud/pubsub/internal/publisher_stub_factory.cc @@ -25,8 +25,8 @@ #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/pubsub/v1/pubsub.grpc.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/pubsub/internal/publisher_stub_factory_test.cc b/google/cloud/pubsub/internal/publisher_stub_factory_test.cc index 3619fb4da450b..3c6eb462cbba9 100644 --- a/google/cloud/pubsub/internal/publisher_stub_factory_test.cc +++ b/google/cloud/pubsub/internal/publisher_stub_factory_test.cc @@ -205,7 +205,6 @@ TEST_F(PublisherStubFactory, Logging) { EXPECT_THAT(log.ExtractLines(), Contains(HasSubstr("CreateTopic"))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanNamed; @@ -284,7 +283,6 @@ TEST_F(PublisherStubFactory, TracingDisabled) { EXPECT_THAT(span_catcher->GetSpans(), IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY // The following tests are for all the rpcs on the stub. TEST_F(PublisherStubFactory, CreateTopic) { diff --git a/google/cloud/pubsub/internal/publisher_tracing_connection.cc b/google/cloud/pubsub/internal/publisher_tracing_connection.cc index d0156ec3c2a68..e64ecddca409f 100644 --- a/google/cloud/pubsub/internal/publisher_tracing_connection.cc +++ b/google/cloud/pubsub/internal/publisher_tracing_connection.cc @@ -13,49 +13,49 @@ // limitations under the License. #include "google/cloud/pubsub/internal/publisher_tracing_connection.h" +#include "google/cloud/pubsub/internal/message_propagator.h" #include "google/cloud/pubsub/message.h" #include "google/cloud/pubsub/publisher_connection.h" #include "google/cloud/future.h" -#include "google/cloud/status.h" -#include "google/cloud/version.h" -#include -#include -#include -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY -#include "google/cloud/pubsub/internal/message_propagator.h" #include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/status.h" #include "google/cloud/status_or.h" +#include "google/cloud/version.h" #include #include +#include +#include #include #include -#include #include #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY +#include +#include +#include namespace google { namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace { opentelemetry::nostd::shared_ptr StartPublishSpan( pubsub::Topic const& topic, pubsub::Message const& m) { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; opentelemetry::trace::StartSpanOptions options; options.kind = opentelemetry::trace::SpanKind::kProducer; auto span = internal::MakeSpan( topic.topic_id() + " create", - {{sc::kMessagingSystem, "gcp_pubsub"}, - {sc::kMessagingDestinationName, topic.topic_id()}, + {{sc::messaging::kMessagingSystem, "gcp_pubsub"}, + {sc::messaging::kMessagingDestinationName, topic.topic_id()}, {"gcp.project_id", topic.project_id()}, - {/*sc::kMessagingOperationType=*/"messaging.operation.type", "create"}, - {/*sc::kMessagingMessageEnvelopeSize=*/"messaging.message.envelope.size", + {/*sc::messaging::kMessagingOperationType=*/"messaging.operation.type", + "create"}, + {/*sc::messaging::kMessagingMessageEnvelopeSize=*/"messaging.message." + "envelope.size", static_cast(MessageSize(m))}, - {sc::kCodeFunction, "pubsub::PublisherConnection::Publish"}}, + {sc::code::kCodeFunctionName, "pubsub::PublisherConnection::Publish"}}, options); if (!m.ordering_key().empty()) { span->SetAttribute("messaging.gcp_pubsub.message.ordering_key", @@ -67,10 +67,11 @@ opentelemetry::nostd::shared_ptr StartPublishSpan( future> EndPublishSpan( opentelemetry::nostd::shared_ptr span, future> f) { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; return f.then([span = std::move(span)](auto fut) { auto message_id = fut.get(); - if (message_id) span->SetAttribute(sc::kMessagingMessageId, *message_id); + if (message_id) + span->SetAttribute(sc::messaging::kMessagingMessageId, *message_id); return internal::EndSpan(*span, std::move(message_id)); }); } @@ -128,16 +129,6 @@ std::shared_ptr MakePublisherTracingConnection( std::move(connection)); } -#else // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::shared_ptr MakePublisherTracingConnection( - pubsub::Topic, // NOLINT(performance-unnecessary-value-param) - std::shared_ptr connection) { - return connection; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud diff --git a/google/cloud/pubsub/internal/publisher_tracing_connection_test.cc b/google/cloud/pubsub/internal/publisher_tracing_connection_test.cc index e5ef264bbc191..a86ffe4313c42 100644 --- a/google/cloud/pubsub/internal/publisher_tracing_connection_test.cc +++ b/google/cloud/pubsub/internal/publisher_tracing_connection_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/publisher_tracing_connection.h" #include "google/cloud/pubsub/message.h" #include "google/cloud/pubsub/mocks/mock_publisher_connection.h" @@ -26,7 +24,8 @@ #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" #include -#include +#include +#include namespace google { namespace cloud { @@ -58,7 +57,7 @@ using ::testing::Pair; using ::testing::StartsWith; TEST(PublisherTracingConnectionTest, PublishSpanOnSuccess) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_shared(); EXPECT_CALL(*mock, Publish) @@ -84,28 +83,31 @@ TEST(PublisherTracingConnectionTest, PublishSpanOnSuccess) { SpanNamed("test-topic create"), SpanWithStatus(opentelemetry::trace::StatusCode::kOk), SpanHasAttributes( - OTelAttribute(sc::kMessagingSystem, "gcp_pubsub"), - OTelAttribute(sc::kMessagingDestinationName, - "test-topic"), + OTelAttribute(sc::messaging::kMessagingSystem, + "gcp_pubsub"), + OTelAttribute( + sc::messaging::kMessagingDestinationName, "test-topic"), OTelAttribute("gcp.project_id", "test-project"), OTelAttribute( "messaging.gcp_pubsub.message.ordering_key", "ordering-key-0"), OTelAttribute("gl-cpp.status_code", "OK"), - OTelAttribute(/*sc::kMessagingMessageEnvelopeSize=*/ - "messaging.message.envelope.size", - 45), + OTelAttribute< + std:: + int64_t>(/*sc::messaging::kMessagingMessageEnvelopeSize=*/ + "messaging.message.envelope.size", 45), OTelAttribute( - /*sc::kMessagingOperationType=*/"messaging.operation.type", - "create"), - OTelAttribute(sc::kMessagingMessageId, "test-id-0"), + /*sc::messaging::kMessagingOperationType=*/ + "messaging.operation.type", "create"), + OTelAttribute(sc::messaging::kMessagingMessageId, + "test-id-0"), OTelAttribute( - sc::kCodeFunction, + sc::code::kCodeFunctionName, "pubsub::PublisherConnection::Publish"))))); } TEST(PublisherTracingConnectionTest, PublishSpanOnError) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_shared(); EXPECT_CALL(*mock, Publish) @@ -132,20 +134,22 @@ TEST(PublisherTracingConnectionTest, PublishSpanOnError) { SpanNamed("test-topic create"), SpanWithStatus(opentelemetry::trace::StatusCode::kError), SpanHasAttributes( - OTelAttribute(sc::kMessagingSystem, "gcp_pubsub"), - OTelAttribute(sc::kMessagingDestinationName, - "test-topic"), + OTelAttribute(sc::messaging::kMessagingSystem, + "gcp_pubsub"), + OTelAttribute( + sc::messaging::kMessagingDestinationName, "test-topic"), OTelAttribute("gcp.project_id", "test-project"), OTelAttribute( "messaging.gcp_pubsub.message.ordering_key", "ordering-key-0"), OTelAttribute( - /*sc::kMessagingOperationType=*/"messaging.operation.type", - "create"), + /*sc::messaging::kMessagingOperationType=*/ + "messaging.operation.type", "create"), OTelAttribute("gl-cpp.status_code", kErrorCode), - OTelAttribute(/*sc::kMessagingMessageEnvelopeSize=*/ - "messaging.message.envelope.size", - 45))))); + OTelAttribute< + std:: + int64_t>(/*sc::messaging::kMessagingMessageEnvelopeSize=*/ + "messaging.message.envelope.size", 45))))); } TEST(PublisherTracingConnectionTest, PublishInjectsTraceContext) { @@ -251,5 +255,3 @@ TEST(MakePublisherTracingConnectionTest, CreateTracingConnection) { } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/internal/publisher_tracing_stub.cc b/google/cloud/pubsub/internal/publisher_tracing_stub.cc index 6c9790e0a7048..0c1c2468cf334 100644 --- a/google/cloud/pubsub/internal/publisher_tracing_stub.cc +++ b/google/cloud/pubsub/internal/publisher_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PublisherTracingStub::PublisherTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -180,18 +181,14 @@ PublisherTracingStub::AsyncPublish( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePublisherTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/publisher_tracing_stub.h b/google/cloud/pubsub/internal/publisher_tracing_stub.h index 9423dee21cc8d..92bd433f5b579 100644 --- a/google/cloud/pubsub/internal/publisher_tracing_stub.h +++ b/google/cloud/pubsub/internal/publisher_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PublisherTracingStub : public PublisherStub { public: ~PublisherTracingStub() override = default; @@ -100,8 +101,6 @@ class PublisherTracingStub : public PublisherStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -116,4 +115,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_PUBLISHER_TRACING_STUB_H diff --git a/google/cloud/pubsub/internal/pull_ack_handler_factory_test.cc b/google/cloud/pubsub/internal/pull_ack_handler_factory_test.cc index 1116d12b78e99..0d5aa2a3c0467 100644 --- a/google/cloud/pubsub/internal/pull_ack_handler_factory_test.cc +++ b/google/cloud/pubsub/internal/pull_ack_handler_factory_test.cc @@ -93,7 +93,6 @@ TEST(PullAckHandlerTest, AckSimple) { pending.first.set_value(false); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanHasInstrumentationScope; @@ -177,8 +176,6 @@ TEST(PullAckHandlerTest, TracingDisabled) { EXPECT_THAT(span_catcher->GetSpans(), IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal diff --git a/google/cloud/pubsub/internal/pull_lease_manager_factory_test.cc b/google/cloud/pubsub/internal/pull_lease_manager_factory_test.cc index 49d8797c620e1..112b6cf13b088 100644 --- a/google/cloud/pubsub/internal/pull_lease_manager_factory_test.cc +++ b/google/cloud/pubsub/internal/pull_lease_manager_factory_test.cc @@ -89,7 +89,6 @@ TEST(DefaultPullLeaseManager, ExtendLeaseDeadlineSimple) { EXPECT_STATUS_OK(status.get()); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanHasInstrumentationScope; @@ -168,8 +167,6 @@ TEST(DefaultPullLeaseManager, TracingDisabled) { EXPECT_THAT(span_catcher->GetSpans(), IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal diff --git a/google/cloud/pubsub/internal/schema_auth_decorator.cc b/google/cloud/pubsub/internal/schema_auth_decorator.cc index 2e17b6289d56f..0aad3f16c5d52 100644 --- a/google/cloud/pubsub/internal/schema_auth_decorator.cc +++ b/google/cloud/pubsub/internal/schema_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/pubsub/v1/schema.proto #include "google/cloud/pubsub/internal/schema_auth_decorator.h" -#include +#include "google/pubsub/v1/schema.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -144,3 +147,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/schema_auth_decorator.h b/google/cloud/pubsub/internal/schema_auth_decorator.h index e1255b8ab4794..b1dffe1b025f5 100644 --- a/google/cloud/pubsub/internal/schema_auth_decorator.h +++ b/google/cloud/pubsub/internal/schema_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -100,4 +103,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SCHEMA_AUTH_DECORATOR_H diff --git a/google/cloud/pubsub/internal/schema_logging_decorator.cc b/google/cloud/pubsub/internal/schema_logging_decorator.cc index 83da27a9d0e2a..6bab287897dee 100644 --- a/google/cloud/pubsub/internal/schema_logging_decorator.cc +++ b/google/cloud/pubsub/internal/schema_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/pubsub/internal/schema_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/schema.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -187,3 +190,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/schema_logging_decorator.h b/google/cloud/pubsub/internal/schema_logging_decorator.h index 88309acd8a1c6..0c889372b6348 100644 --- a/google/cloud/pubsub/internal/schema_logging_decorator.h +++ b/google/cloud/pubsub/internal/schema_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -100,4 +103,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SCHEMA_LOGGING_DECORATOR_H diff --git a/google/cloud/pubsub/internal/schema_metadata_decorator.cc b/google/cloud/pubsub/internal/schema_metadata_decorator.cc index 92a4d78dad6da..2905e41d8972b 100644 --- a/google/cloud/pubsub/internal/schema_metadata_decorator.cc +++ b/google/cloud/pubsub/internal/schema_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/pubsub/internal/schema_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/pubsub/v1/schema.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -174,3 +178,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/schema_metadata_decorator.h b/google/cloud/pubsub/internal/schema_metadata_decorator.h index 795f7e5ccdfe4..c574ec775a099 100644 --- a/google/cloud/pubsub/internal/schema_metadata_decorator.h +++ b/google/cloud/pubsub/internal/schema_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -105,4 +108,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SCHEMA_METADATA_DECORATOR_H diff --git a/google/cloud/pubsub/internal/schema_option_defaults.cc b/google/cloud/pubsub/internal/schema_option_defaults.cc index 97f419bda1d51..be80b618a2efa 100644 --- a/google/cloud/pubsub/internal/schema_option_defaults.cc +++ b/google/cloud/pubsub/internal/schema_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/pubsub/internal/schema_option_defaults.h" #include "google/cloud/pubsub/schema_connection.h" #include "google/cloud/pubsub/schema_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options SchemaServiceDefaultOptions(std::string const& location, options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - pubsub::SchemaServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + pubsub::SchemaServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/pubsub/internal/schema_stub.cc b/google/cloud/pubsub/internal/schema_stub.cc index 39fb5f991eed5..cc724bccb9e8b 100644 --- a/google/cloud/pubsub/internal/schema_stub.cc +++ b/google/cloud/pubsub/internal/schema_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/pubsub/internal/schema_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/schema.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -184,3 +187,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/schema_stub.h b/google/cloud/pubsub/internal/schema_stub.h index 1e67e671655fe..4fb0a24bf7f0a 100644 --- a/google/cloud/pubsub/internal/schema_stub.h +++ b/google/cloud/pubsub/internal/schema_stub.h @@ -22,11 +22,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/pubsub/v1/schema.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -162,4 +165,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SCHEMA_STUB_H diff --git a/google/cloud/pubsub/internal/schema_stub_factory.cc b/google/cloud/pubsub/internal/schema_stub_factory.cc index 1cb81f0e3fe16..ed223f6e1f539 100644 --- a/google/cloud/pubsub/internal/schema_stub_factory.cc +++ b/google/cloud/pubsub/internal/schema_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/pubsub/v1/schema.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/schema_stub_factory.h b/google/cloud/pubsub/internal/schema_stub_factory.h index dd84c706dcaca..21d3137a53a40 100644 --- a/google/cloud/pubsub/internal/schema_stub_factory.h +++ b/google/cloud/pubsub/internal/schema_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SCHEMA_STUB_FACTORY_H diff --git a/google/cloud/pubsub/internal/schema_tracing_connection.cc b/google/cloud/pubsub/internal/schema_tracing_connection.cc index 798355ca8a6dc..3d8152963a4a8 100644 --- a/google/cloud/pubsub/internal/schema_tracing_connection.cc +++ b/google/cloud/pubsub/internal/schema_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SchemaServiceTracingConnection::SchemaServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -149,16 +147,12 @@ SchemaServiceTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSchemaServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/pubsub/internal/schema_tracing_connection.h b/google/cloud/pubsub/internal/schema_tracing_connection.h index ca2e5ef987a8b..2d7121a7bd2f3 100644 --- a/google/cloud/pubsub/internal/schema_tracing_connection.h +++ b/google/cloud/pubsub/internal/schema_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SchemaServiceTracingConnection : public pubsub::SchemaServiceConnection { public: ~SchemaServiceTracingConnection() override = default; @@ -82,8 +80,6 @@ class SchemaServiceTracingConnection : public pubsub::SchemaServiceConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/pubsub/internal/schema_tracing_stub.cc b/google/cloud/pubsub/internal/schema_tracing_stub.cc index 1594242ac3273..08127248be59b 100644 --- a/google/cloud/pubsub/internal/schema_tracing_stub.cc +++ b/google/cloud/pubsub/internal/schema_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SchemaServiceTracingStub::SchemaServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -181,18 +182,14 @@ SchemaServiceTracingStub::TestIamPermissions( context, *span, child_->TestIamPermissions(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSchemaServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/schema_tracing_stub.h b/google/cloud/pubsub/internal/schema_tracing_stub.h index ee9f863191947..cdeb7ed8a3dba 100644 --- a/google/cloud/pubsub/internal/schema_tracing_stub.h +++ b/google/cloud/pubsub/internal/schema_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SchemaServiceTracingStub : public SchemaServiceStub { public: ~SchemaServiceTracingStub() override = default; @@ -96,8 +97,6 @@ class SchemaServiceTracingStub : public SchemaServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -112,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SCHEMA_TRACING_STUB_H diff --git a/google/cloud/pubsub/internal/session_shutdown_manager.cc b/google/cloud/pubsub/internal/session_shutdown_manager.cc index 8c89ea5501131..e3a2359c01a74 100644 --- a/google/cloud/pubsub/internal/session_shutdown_manager.cc +++ b/google/cloud/pubsub/internal/session_shutdown_manager.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/pubsub/internal/session_shutdown_manager.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/log.h" +#include "absl/strings/str_join.h" namespace google { namespace cloud { diff --git a/google/cloud/pubsub/internal/span.h b/google/cloud/pubsub/internal/span.h index c32e925117d8c..9ff2298df6a7e 100644 --- a/google/cloud/pubsub/internal/span.h +++ b/google/cloud/pubsub/internal/span.h @@ -16,9 +16,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SPAN_H #include "google/cloud/pubsub/version.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include namespace google { @@ -28,12 +26,10 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN /** * Span class stores an OpenTelemetery span which can only be accessed by code - * compiled with GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY. + * compiled with Opentelemetry. */ struct Span { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY opentelemetry::nostd::shared_ptr span; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/pubsub/internal/streaming_subscription_batch_source.cc b/google/cloud/pubsub/internal/streaming_subscription_batch_source.cc index c8a7af9f4230e..22009d1feaaec 100644 --- a/google/cloud/pubsub/internal/streaming_subscription_batch_source.cc +++ b/google/cloud/pubsub/internal/streaming_subscription_batch_source.cc @@ -15,6 +15,7 @@ #include "google/cloud/pubsub/internal/streaming_subscription_batch_source.h" #include "google/cloud/pubsub/internal/exactly_once_policies.h" #include "google/cloud/pubsub/internal/extend_leases_with_retry.h" +#include "google/cloud/pubsub/options.h" #include "google/cloud/internal/async_retry_loop.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/url_encode.h" diff --git a/google/cloud/pubsub/internal/streaming_subscription_batch_source.h b/google/cloud/pubsub/internal/streaming_subscription_batch_source.h index f55568e4cd19e..e78b21c0d99ea 100644 --- a/google/cloud/pubsub/internal/streaming_subscription_batch_source.h +++ b/google/cloud/pubsub/internal/streaming_subscription_batch_source.h @@ -21,12 +21,11 @@ #include "google/cloud/pubsub/internal/subscriber_stub.h" #include "google/cloud/pubsub/internal/subscription_batch_source.h" #include "google/cloud/pubsub/retry_policy.h" -#include "google/cloud/pubsub/subscriber_options.h" #include "google/cloud/pubsub/version.h" #include "google/cloud/future.h" #include "google/cloud/status.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" #include #include #include diff --git a/google/cloud/pubsub/internal/streaming_subscription_batch_source_test.cc b/google/cloud/pubsub/internal/streaming_subscription_batch_source_test.cc index b081ffd51f972..7ef2ddd51cec5 100644 --- a/google/cloud/pubsub/internal/streaming_subscription_batch_source_test.cc +++ b/google/cloud/pubsub/internal/streaming_subscription_batch_source_test.cc @@ -14,6 +14,7 @@ #include "google/cloud/pubsub/internal/streaming_subscription_batch_source.h" #include "google/cloud/pubsub/internal/defaults.h" +#include "google/cloud/pubsub/options.h" #include "google/cloud/pubsub/subscription.h" #include "google/cloud/pubsub/testing/mock_batch_callback.h" #include "google/cloud/pubsub/testing/mock_subscriber_stub.h" diff --git a/google/cloud/pubsub/internal/subscriber_auth_decorator.cc b/google/cloud/pubsub/internal/subscriber_auth_decorator.cc index d9c0b49ad1347..d99f5a73efc72 100644 --- a/google/cloud/pubsub/internal/subscriber_auth_decorator.cc +++ b/google/cloud/pubsub/internal/subscriber_auth_decorator.cc @@ -18,10 +18,13 @@ #include "google/cloud/pubsub/internal/subscriber_auth_decorator.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -218,3 +221,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/subscriber_auth_decorator.h b/google/cloud/pubsub/internal/subscriber_auth_decorator.h index dd5e7ae8fc029..a1617b552b589 100644 --- a/google/cloud/pubsub/internal/subscriber_auth_decorator.h +++ b/google/cloud/pubsub/internal/subscriber_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -132,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SUBSCRIBER_AUTH_DECORATOR_H diff --git a/google/cloud/pubsub/internal/subscriber_connection_impl_test.cc b/google/cloud/pubsub/internal/subscriber_connection_impl_test.cc index c1bb150744f63..3bc3149a611eb 100644 --- a/google/cloud/pubsub/internal/subscriber_connection_impl_test.cc +++ b/google/cloud/pubsub/internal/subscriber_connection_impl_test.cc @@ -16,6 +16,7 @@ #include "google/cloud/pubsub/ack_handler.h" #include "google/cloud/pubsub/exactly_once_ack_handler.h" #include "google/cloud/pubsub/internal/defaults.h" +#include "google/cloud/pubsub/options.h" #include "google/cloud/pubsub/testing/fake_streaming_pull.h" #include "google/cloud/pubsub/testing/mock_subscriber_stub.h" #include "google/cloud/pubsub/testing/test_retry_policies.h" diff --git a/google/cloud/pubsub/internal/subscriber_logging_decorator.cc b/google/cloud/pubsub/internal/subscriber_logging_decorator.cc index 8fddcaa502212..88488437a206d 100644 --- a/google/cloud/pubsub/internal/subscriber_logging_decorator.cc +++ b/google/cloud/pubsub/internal/subscriber_logging_decorator.cc @@ -20,12 +20,15 @@ #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 "google/pubsub/v1/pubsub.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -280,3 +283,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/subscriber_logging_decorator.h b/google/cloud/pubsub/internal/subscriber_logging_decorator.h index 84ebbf3b0cdc9..1f2b1bf7bc1cb 100644 --- a/google/cloud/pubsub/internal/subscriber_logging_decorator.h +++ b/google/cloud/pubsub/internal/subscriber_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -133,4 +136,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SUBSCRIBER_LOGGING_DECORATOR_H diff --git a/google/cloud/pubsub/internal/subscriber_metadata_decorator.cc b/google/cloud/pubsub/internal/subscriber_metadata_decorator.cc index 3b73e6f47a358..d71711dd647f2 100644 --- a/google/cloud/pubsub/internal/subscriber_metadata_decorator.cc +++ b/google/cloud/pubsub/internal/subscriber_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/pubsub/internal/subscriber_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -241,3 +245,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/subscriber_metadata_decorator.h b/google/cloud/pubsub/internal/subscriber_metadata_decorator.h index 038aece8772d9..ad20863c9ceeb 100644 --- a/google/cloud/pubsub/internal/subscriber_metadata_decorator.h +++ b/google/cloud/pubsub/internal/subscriber_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -137,4 +140,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SUBSCRIBER_METADATA_DECORATOR_H diff --git a/google/cloud/pubsub/internal/subscriber_round_robin_decorator.cc b/google/cloud/pubsub/internal/subscriber_round_robin_decorator.cc index f37db6725ee94..7a17b1a5da683 100644 --- a/google/cloud/pubsub/internal/subscriber_round_robin_decorator.cc +++ b/google/cloud/pubsub/internal/subscriber_round_robin_decorator.cc @@ -21,6 +21,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -173,3 +176,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/subscriber_round_robin_decorator.h b/google/cloud/pubsub/internal/subscriber_round_robin_decorator.h index e8388130a75a0..4daeb6ad39869 100644 --- a/google/cloud/pubsub/internal/subscriber_round_robin_decorator.h +++ b/google/cloud/pubsub/internal/subscriber_round_robin_decorator.h @@ -25,6 +25,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -133,4 +136,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SUBSCRIBER_ROUND_ROBIN_DECORATOR_H diff --git a/google/cloud/pubsub/internal/subscriber_stub.cc b/google/cloud/pubsub/internal/subscriber_stub.cc index 5f59d6a634817..3fe454f614370 100644 --- a/google/cloud/pubsub/internal/subscriber_stub.cc +++ b/google/cloud/pubsub/internal/subscriber_stub.cc @@ -20,10 +20,13 @@ #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 "google/pubsub/v1/pubsub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -275,3 +278,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/subscriber_stub.h b/google/cloud/pubsub/internal/subscriber_stub.h index 0da1146a79dd5..7e4a0ca7cf913 100644 --- a/google/cloud/pubsub/internal/subscriber_stub.h +++ b/google/cloud/pubsub/internal/subscriber_stub.h @@ -25,11 +25,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/pubsub/v1/pubsub.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { @@ -227,4 +230,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SUBSCRIBER_STUB_H diff --git a/google/cloud/pubsub/internal/subscriber_stub_factory.cc b/google/cloud/pubsub/internal/subscriber_stub_factory.cc index 1d068a884b5fd..fe1661eadd139 100644 --- a/google/cloud/pubsub/internal/subscriber_stub_factory.cc +++ b/google/cloud/pubsub/internal/subscriber_stub_factory.cc @@ -25,8 +25,8 @@ #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/pubsub/v1/pubsub.grpc.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/pubsub/internal/subscriber_stub_factory_test.cc b/google/cloud/pubsub/internal/subscriber_stub_factory_test.cc index 9b0b62ca719d7..e29af3adbc8e5 100644 --- a/google/cloud/pubsub/internal/subscriber_stub_factory_test.cc +++ b/google/cloud/pubsub/internal/subscriber_stub_factory_test.cc @@ -206,7 +206,6 @@ TEST_F(SubscriberStubFactory, Logging) { EXPECT_THAT(log.ExtractLines(), Contains(HasSubstr("CreateSubscription"))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanNamed; @@ -286,7 +285,6 @@ TEST_F(SubscriberStubFactory, TracingDisabled) { EXPECT_THAT(span_catcher->GetSpans(), IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/pubsub/internal/subscriber_tracing_connection.cc b/google/cloud/pubsub/internal/subscriber_tracing_connection.cc index dfb9e592d7b8c..5b9e0b193ce48 100644 --- a/google/cloud/pubsub/internal/subscriber_tracing_connection.cc +++ b/google/cloud/pubsub/internal/subscriber_tracing_connection.cc @@ -17,35 +17,34 @@ #include "google/cloud/pubsub/options.h" #include "google/cloud/grpc_options.h" #include "google/cloud/internal/opentelemetry.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include +#include +#include #include -#include #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace google { namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - namespace { opentelemetry::nostd::shared_ptr StartPullSpan() { auto const& current = internal::CurrentOptions(); auto const& subscription = current.get(); - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; opentelemetry::trace::StartSpanOptions options; options.kind = opentelemetry::trace::SpanKind::kConsumer; auto span = internal::MakeSpan( subscription.subscription_id() + " receive", - {{sc::kMessagingSystem, "gcp_pubsub"}, - {/*sc::kMessagingOperationType=*/"messaging.operation.type", "receive"}, - {sc::kCodeFunction, "pubsub::SubscriberConnection::Pull"}, + {{sc::messaging::kMessagingSystem, "gcp_pubsub"}, + {/*sc::messaging::kMessagingOperationType=*/"messaging.operation.type", + "receive"}, + {sc::code::kCodeFunctionName, "pubsub::SubscriberConnection::Pull"}, {"gcp.project_id", subscription.project_id()}, - {sc::kMessagingDestinationName, subscription.subscription_id()}}, + {sc::messaging::kMessagingDestinationName, + subscription.subscription_id()}}, options); return span; } @@ -56,16 +55,18 @@ StatusOr EndPullSpan( opentelemetry::context::propagation::TextMapPropagator> const& propagator, StatusOr response) { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; if (response.ok()) { auto message = response.value().message; - span->SetAttribute(sc::kMessagingMessageId, message.message_id()); + span->SetAttribute(sc::messaging::kMessagingMessageId, + message.message_id()); if (!message.ordering_key().empty()) { span->SetAttribute("messaging.gcp_pubsub.message.ordering_key", message.ordering_key()); } span->SetAttribute( - /*sc::kMessagingMessageEnvelopeSize=*/"messaging.message.envelope.size", + /*sc::messaging::kMessagingMessageEnvelopeSize=*/ + "messaging.message.envelope.size", static_cast(MessageSize(message))); auto current = opentelemetry::context::RuntimeContext::GetCurrent(); @@ -128,15 +129,6 @@ std::shared_ptr MakeSubscriberTracingConnection( return std::make_shared(std::move(connection)); } -#else // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::shared_ptr MakeSubscriberTracingConnection( - std::shared_ptr connection) { - return connection; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud diff --git a/google/cloud/pubsub/internal/subscriber_tracing_connection_test.cc b/google/cloud/pubsub/internal/subscriber_tracing_connection_test.cc index e4766d3667435..360eca50dce33 100644 --- a/google/cloud/pubsub/internal/subscriber_tracing_connection_test.cc +++ b/google/cloud/pubsub/internal/subscriber_tracing_connection_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/subscriber_tracing_connection.h" #include "google/cloud/pubsub/ack_handler.h" #include "google/cloud/pubsub/exactly_once_ack_handler.h" @@ -22,6 +20,7 @@ #include "google/cloud/pubsub/mocks/mock_exactly_once_ack_handler.h" #include "google/cloud/pubsub/mocks/mock_pull_ack_handler.h" #include "google/cloud/pubsub/mocks/mock_subscriber_connection.h" +#include "google/cloud/pubsub/options.h" #include "google/cloud/pubsub/pull_ack_handler.h" #include "google/cloud/pubsub/subscriber_connection.h" #include "google/cloud/internal/make_status.h" @@ -32,8 +31,9 @@ #include "google/cloud/testing_util/status_matchers.h" #include #include +#include +#include #include -#include namespace google { namespace cloud { @@ -127,7 +127,7 @@ TEST(SubscriberTracingConnectionTest, PullOnError) { } TEST(SubscriberTracingConnectionTest, PullAttributes) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_shared(); EXPECT_CALL(*mock, options); @@ -143,25 +143,24 @@ TEST(SubscriberTracingConnectionTest, PullAttributes) { auto response = connection->Pull(); EXPECT_STATUS_OK(response); auto spans = span_catcher->GetSpans(); + EXPECT_THAT(spans, Contains(AllOf( + SpanNamed("test-subscription receive"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingSystem, "gcp_pubsub"))))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("test-subscription receive"), SpanHasAttributes(OTelAttribute( - sc::kMessagingSystem, "gcp_pubsub"))))); + sc::code::kCodeFunctionName, + "pubsub::SubscriberConnection::Pull"))))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("test-subscription receive"), SpanHasAttributes(OTelAttribute( - sc::kCodeFunction, - "pubsub::SubscriberConnection::Pull"))))); - EXPECT_THAT( - spans, Contains(AllOf( - SpanNamed("test-subscription receive"), - SpanHasAttributes(OTelAttribute( - /*sc::kMessagingOperationType=*/"messaging.operation.type", - "receive"))))); + /*sc::messaging::kMessagingOperationType=*/ + "messaging.operation.type", "receive"))))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("test-subscription receive"), SpanHasAttributes(OTelAttribute( - sc::kMessagingDestinationName, + sc::messaging::kMessagingDestinationName, TestSubscription().subscription_id()))))); EXPECT_THAT( spans, @@ -171,12 +170,12 @@ TEST(SubscriberTracingConnectionTest, PullAttributes) { EXPECT_THAT(spans, Contains(AllOf(SpanNamed("test-subscription receive"), SpanHasAttributes(OTelAttribute( - sc::kMessagingMessageId, _))))); - EXPECT_THAT(spans, - Contains(AllOf(SpanNamed("test-subscription receive"), - SpanHasAttributes(OTelAttribute( - /*sc::kMessagingMessageEnvelopeSize=*/ - "messaging.message.envelope.size", 108))))); + sc::messaging::kMessagingMessageId, _))))); + EXPECT_THAT(spans, Contains(AllOf( + SpanNamed("test-subscription receive"), + SpanHasAttributes(OTelAttribute( + /*sc::messaging::kMessagingMessageEnvelopeSize=*/ + "messaging.message.envelope.size", 108))))); } TEST(SubscriberTracingConnectionTest, PullSetsOrderingKeyAttributeIfExists) { @@ -346,5 +345,3 @@ TEST(SubscriberTracingConnectionTest, options) { } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/internal/subscriber_tracing_stub.cc b/google/cloud/pubsub/internal/subscriber_tracing_stub.cc index d7aeab4ac18c8..0bb546bdaea78 100644 --- a/google/cloud/pubsub/internal/subscriber_tracing_stub.cc +++ b/google/cloud/pubsub/internal/subscriber_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SubscriberTracingStub::SubscriberTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -257,18 +258,14 @@ future SubscriberTracingStub::AsyncAcknowledge( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSubscriberTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsub/internal/subscriber_tracing_stub.h b/google/cloud/pubsub/internal/subscriber_tracing_stub.h index c5ba84e088eff..fdd306d176bac 100644 --- a/google/cloud/pubsub/internal/subscriber_tracing_stub.h +++ b/google/cloud/pubsub/internal/subscriber_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SubscriberTracingStub : public SubscriberStub { public: ~SubscriberTracingStub() override = default; @@ -128,8 +129,6 @@ class SubscriberTracingStub : public SubscriberStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -144,4 +143,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SUBSCRIBER_TRACING_STUB_H diff --git a/google/cloud/pubsub/internal/subscription_batch_source.h b/google/cloud/pubsub/internal/subscription_batch_source.h index 31acd8bdbc836..d088d28d8b869 100644 --- a/google/cloud/pubsub/internal/subscription_batch_source.h +++ b/google/cloud/pubsub/internal/subscription_batch_source.h @@ -20,7 +20,7 @@ #include "google/cloud/future.h" #include "google/cloud/status.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" #include #include #include diff --git a/google/cloud/pubsub/internal/subscription_message_queue.h b/google/cloud/pubsub/internal/subscription_message_queue.h index bf0e76609d136..a98da1ba085f3 100644 --- a/google/cloud/pubsub/internal/subscription_message_queue.h +++ b/google/cloud/pubsub/internal/subscription_message_queue.h @@ -22,7 +22,7 @@ #include "google/cloud/future.h" #include "google/cloud/internal/random.h" #include "google/cloud/status.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" #include #include #include diff --git a/google/cloud/pubsub/internal/subscription_message_source.h b/google/cloud/pubsub/internal/subscription_message_source.h index 4c8112c6a0079..15245a0199741 100644 --- a/google/cloud/pubsub/internal/subscription_message_source.h +++ b/google/cloud/pubsub/internal/subscription_message_source.h @@ -19,7 +19,7 @@ #include "google/cloud/pubsub/version.h" #include "google/cloud/future.h" #include "google/cloud/status.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" #include #include diff --git a/google/cloud/pubsub/internal/subscription_session.cc b/google/cloud/pubsub/internal/subscription_session.cc index 3e7c0d6f324e3..1b9f7c7118406 100644 --- a/google/cloud/pubsub/internal/subscription_session.cc +++ b/google/cloud/pubsub/internal/subscription_session.cc @@ -24,6 +24,7 @@ #include "google/cloud/pubsub/internal/subscription_lease_management.h" #include "google/cloud/pubsub/internal/subscription_message_queue.h" #include "google/cloud/pubsub/internal/tracing_message_callback.h" +#include "google/cloud/pubsub/options.h" #include "google/cloud/log.h" #include "google/cloud/opentelemetry_options.h" diff --git a/google/cloud/pubsub/internal/subscription_session_test.cc b/google/cloud/pubsub/internal/subscription_session_test.cc index 25ed8030d26d9..f8ce1dde883c7 100644 --- a/google/cloud/pubsub/internal/subscription_session_test.cc +++ b/google/cloud/pubsub/internal/subscription_session_test.cc @@ -17,6 +17,7 @@ #include "google/cloud/pubsub/application_callback.h" #include "google/cloud/pubsub/exactly_once_ack_handler.h" #include "google/cloud/pubsub/internal/defaults.h" +#include "google/cloud/pubsub/options.h" #include "google/cloud/pubsub/subscriber_connection.h" #include "google/cloud/pubsub/testing/fake_streaming_pull.h" #include "google/cloud/pubsub/testing/mock_subscriber_stub.h" @@ -28,13 +29,11 @@ #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/scoped_log.h" #include "google/cloud/testing_util/status_matchers.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY +#include #include +#include #include #include -#include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY -#include #include #include #include @@ -203,8 +202,6 @@ TEST(SubscriptionSessionTest, ScheduleCallbacks) { ScheduleCallbacks(/*ack_count=*/100, /*enable_open_telemetry=*/false); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - using ::google::cloud::testing_util::InstallSpanCatcher; using ::google::cloud::testing_util::OTelAttribute; using ::google::cloud::testing_util::SpanHasAttributes; @@ -218,7 +215,7 @@ using ::testing::SizeIs; /// @test Verify callbacks are scheduled in the background threads with Open /// Telemetry enabled. TEST(SubscriptionSessionTest, ScheduleCallbacksWithOtelEnabled) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto constexpr kAckCount = 100; ScheduleCallbacks(kAckCount, /*enable_open_telemetry=*/true); @@ -227,15 +224,13 @@ TEST(SubscriptionSessionTest, ScheduleCallbacksWithOtelEnabled) { // There should be a process and ack span for each message. EXPECT_THAT(spans, SizeIs(Ge(static_cast(2 * kAckCount)))); // Verify there is at least one process span. - EXPECT_THAT( - spans, Contains(AllOf(SpanHasInstrumentationScope(), SpanKindIsInternal(), - SpanNamed("test-subscription process"), - SpanHasAttributes(OTelAttribute( - sc::kMessagingSystem, "gcp_pubsub"))))); + EXPECT_THAT(spans, Contains(AllOf( + SpanHasInstrumentationScope(), SpanKindIsInternal(), + SpanNamed("test-subscription process"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingSystem, "gcp_pubsub"))))); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /// @test Verify callbacks are scheduled in the background threads. TEST(SubscriptionSessionTest, ScheduleCallbacksExactlyOnce) { auto mock = std::make_shared(); diff --git a/google/cloud/pubsub/internal/tracing_batch_callback.cc b/google/cloud/pubsub/internal/tracing_batch_callback.cc index f97e06070c39f..8196fcc6fea00 100644 --- a/google/cloud/pubsub/internal/tracing_batch_callback.cc +++ b/google/cloud/pubsub/internal/tracing_batch_callback.cc @@ -17,21 +17,17 @@ #include "google/cloud/pubsub/subscription.h" #include "google/cloud/pubsub/version.h" #include "google/cloud/internal/opentelemetry.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY -#include +#include "google/pubsub/v1/pubsub.pb.h" #include +#include #include -#include #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace google { namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - namespace { opentelemetry::nostd::shared_ptr StartSubscribeSpan( @@ -41,7 +37,7 @@ opentelemetry::nostd::shared_ptr StartSubscribeSpan( opentelemetry::context::propagation::TextMapPropagator> const& propagator, bool exactly_once_delivery_enabled) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; opentelemetry::trace::StartSpanOptions options; options.kind = opentelemetry::trace::SpanKind::kConsumer; auto m = pubsub_internal::FromProto(message.message()); @@ -54,14 +50,16 @@ opentelemetry::nostd::shared_ptr StartSubscribeSpan( auto span = internal::MakeSpan( subscription.subscription_id() + " subscribe", - {{sc::kMessagingSystem, "gcp_pubsub"}, - {/*sc::kMessagingOperationType=*/"messaging.operation.type", + {{sc::messaging::kMessagingSystem, "gcp_pubsub"}, + {/*sc::messaging::kMessagingOperationType=*/"messaging.operation.type", "subscribe"}, {"gcp.project_id", subscription.project_id()}, - {sc::kMessagingDestinationName, subscription.subscription_id()}, - {sc::kMessagingMessageId, m.message_id()}, - {/*sc::kMessagingMessageEnvelopeSize=*/"messaging.message.envelope." - "size", + {sc::messaging::kMessagingDestinationName, + subscription.subscription_id()}, + {sc::messaging::kMessagingMessageId, m.message_id()}, + {/*sc::messaging::kMessagingMessageEnvelopeSize=*/"messaging.message." + "envelope." + "size", static_cast(MessageSize(m))}, {"messaging.gcp_pubsub.message.ack_id", message.ack_id()}, {"messaging.gcp_pubsub.subscription.exactly_once_delivery", @@ -136,7 +134,7 @@ class TracingBatchCallback : public BatchCallback { } void StartConcurrencyControl(std::string const& ack_id) override { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; std::lock_guard lk(mu_); auto it = spans_by_ack_id_.find(ack_id); if (it == spans_by_ack_id_.end()) return; @@ -144,9 +142,9 @@ class TracingBatchCallback : public BatchCallback { if (!subscribe_span) return; opentelemetry::trace::StartSpanOptions options; options.parent = subscribe_span->GetContext(); - it->second.concurrency_control_span = - internal::MakeSpan("subscriber concurrency control", - {{sc::kMessagingSystem, "gcp_pubsub"}}, options); + it->second.concurrency_control_span = internal::MakeSpan( + "subscriber concurrency control", + {{sc::messaging::kMessagingSystem, "gcp_pubsub"}}, options); } void EndConcurrencyControl(std::string const& ack_id) override { @@ -162,7 +160,7 @@ class TracingBatchCallback : public BatchCallback { } void StartScheduler(std::string const& ack_id) override { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; std::lock_guard lk(mu_); auto spans = spans_by_ack_id_.find(ack_id); if (spans == spans_by_ack_id_.end()) return; @@ -170,9 +168,9 @@ class TracingBatchCallback : public BatchCallback { if (!subscribe_span) return; opentelemetry::trace::StartSpanOptions options; options.parent = subscribe_span->GetContext(); - spans->second.scheduler_span = - internal::MakeSpan("subscriber scheduler", - {{sc::kMessagingSystem, "gcp_pubsub"}}, options); + spans->second.scheduler_span = internal::MakeSpan( + "subscriber scheduler", + {{sc::messaging::kMessagingSystem, "gcp_pubsub"}}, options); } void EndScheduler(std::string const& ack_id) override { @@ -185,7 +183,7 @@ class TracingBatchCallback : public BatchCallback { Span StartModackSpan( google::pubsub::v1::ModifyAckDeadlineRequest const& request) override { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; using Attributes = std::vector>; @@ -207,13 +205,15 @@ class TracingBatchCallback : public BatchCallback { options.kind = opentelemetry::trace::SpanKind::kClient; auto span = internal::MakeSpan( subscription_.subscription_id() + " modack", - {{sc::kMessagingSystem, "gcp_pubsub"}, - {/*sc::kMessagingOperationType=*/"messaging.operation.type", "extend"}, - {sc::kMessagingBatchMessageCount, + {{sc::messaging::kMessagingSystem, "gcp_pubsub"}, + {/*sc::messaging::kMessagingOperationType=*/"messaging.operation.type", + "extend"}, + {sc::messaging::kMessagingBatchMessageCount, static_cast(request.ack_ids().size())}, {"messaging.gcp_pubsub.message.ack_deadline_seconds", static_cast(request.ack_deadline_seconds())}, - {sc::kMessagingDestinationName, subscription_.subscription_id()}, + {sc::messaging::kMessagingDestinationName, + subscription_.subscription_id()}, {"gcp.project_id", subscription_.project_id()}}, std::move(links), options); @@ -294,16 +294,6 @@ std::shared_ptr MakeTracingBatchCallback( subscription); } -#else // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::shared_ptr MakeTracingBatchCallback( - std::shared_ptr batch_callback, - pubsub::Subscription const&) { - return batch_callback; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud diff --git a/google/cloud/pubsub/internal/tracing_batch_callback_test.cc b/google/cloud/pubsub/internal/tracing_batch_callback_test.cc index 92ecacb68167e..36034f7f5ca44 100644 --- a/google/cloud/pubsub/internal/tracing_batch_callback_test.cc +++ b/google/cloud/pubsub/internal/tracing_batch_callback_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/tracing_batch_callback.h" #include "google/cloud/pubsub/internal/message_propagator.h" #include "google/cloud/pubsub/message.h" @@ -28,9 +26,9 @@ #include "google/cloud/testing_util/status_matchers.h" #include #include +#include #include #include -#include namespace google { namespace cloud { @@ -135,7 +133,7 @@ TEST(TracingBatchCallback, VerifySpanIsSetInUserCallback) { } TEST(TracingBatchCallback, StartAndEndModackSpanForOneMessage) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_shared(); EXPECT_CALL(*mock, callback).Times(1); @@ -157,21 +155,23 @@ TEST(TracingBatchCallback, StartAndEndModackSpanForOneMessage) { SpanHasInstrumentationScope(), SpanKindIsClient(), SpanNamed("test-sub modack"), SpanHasAttributes( - OTelAttribute(sc::kMessagingSystem, "gcp_pubsub"), + OTelAttribute(sc::messaging::kMessagingSystem, + "gcp_pubsub"), OTelAttribute("gcp.project_id", "test-project"), OTelAttribute( - /*sc::kMessagingOperationType=*/"messaging.operation.type", - "extend"), - OTelAttribute(sc::kMessagingBatchMessageCount, 1), + /*sc::messaging::kMessagingOperationType=*/ + "messaging.operation.type", "extend"), + OTelAttribute(sc::messaging::kMessagingBatchMessageCount, + 1), OTelAttribute( "messaging.gcp_pubsub.message.ack_deadline_seconds", 10), - OTelAttribute(sc::kMessagingDestinationName, - "test-sub")), + OTelAttribute( + sc::messaging::kMessagingDestinationName, "test-sub")), SpanLinksSizeIs(1)))); } TEST(TracingBatchCallback, StartAndEndModackSpanForMultipleMessages) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_shared(); EXPECT_CALL(*mock, callback).Times(1); @@ -195,16 +195,18 @@ TEST(TracingBatchCallback, StartAndEndModackSpanForMultipleMessages) { SpanHasInstrumentationScope(), SpanKindIsClient(), SpanNamed("test-sub modack"), SpanHasAttributes( - OTelAttribute(sc::kMessagingSystem, "gcp_pubsub"), + OTelAttribute(sc::messaging::kMessagingSystem, + "gcp_pubsub"), OTelAttribute("gcp.project_id", "test-project"), OTelAttribute( - /*sc::kMessagingOperationType=*/"messaging.operation.type", - "extend"), - OTelAttribute(sc::kMessagingBatchMessageCount, 2), + /*sc::messaging::kMessagingOperationType=*/ + "messaging.operation.type", "extend"), + OTelAttribute(sc::messaging::kMessagingBatchMessageCount, + 2), OTelAttribute( "messaging.gcp_pubsub.message.ack_deadline_seconds", 10), - OTelAttribute(sc::kMessagingDestinationName, - "test-sub")), + OTelAttribute( + sc::messaging::kMessagingDestinationName, "test-sub")), SpanLinksSizeIs(2)))); } @@ -233,7 +235,7 @@ TEST(TracingBatchCallback, VerifyModackSpansAreEndedInDestructor) { } TEST(TracingBatchCallback, SubscribeAttributes) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_shared(); EXPECT_CALL(*mock, callback).Times(1); @@ -248,17 +250,19 @@ TEST(TracingBatchCallback, SubscribeAttributes) { Contains(AllOf( SpanNamed("test-sub subscribe"), SpanHasAttributes( - OTelAttribute(sc::kMessagingSystem, "gcp_pubsub"), + OTelAttribute(sc::messaging::kMessagingSystem, + "gcp_pubsub"), OTelAttribute("gcp.project_id", "test-project"), OTelAttribute( - /*sc::kMessagingOperationType=*/"messaging.operation.type", - "subscribe"), - OTelAttribute(sc::kMessagingMessageId, "id-0"), + /*sc::messaging::kMessagingOperationType=*/ + "messaging.operation.type", "subscribe"), + OTelAttribute(sc::messaging::kMessagingMessageId, + "id-0"), OTelAttribute("messaging.gcp_pubsub.message.ack_id", "ack-id-0"), OTelAttribute("messaging.message.envelope.size", 101), - OTelAttribute(sc::kMessagingDestinationName, - "test-sub"))))); + OTelAttribute( + sc::messaging::kMessagingDestinationName, "test-sub"))))); } TEST(TracingBatchCallback, SubscribeAttributesForOrderingKey) { @@ -331,7 +335,7 @@ TEST(TracingBatchCallback, SubscribeAttributesForExactlyOnce) { } TEST(TracingBatchCallback, StartAndEndConcurrencyControlSpan) { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_shared(); EXPECT_CALL(*mock, callback).Times(1); @@ -343,15 +347,15 @@ TEST(TracingBatchCallback, StartAndEndConcurrencyControlSpan) { batch_callback->AckEnd("ack-id-0"); auto spans = span_catcher->GetSpans(); - EXPECT_THAT( - spans, Contains(AllOf(SpanHasInstrumentationScope(), SpanKindIsInternal(), - SpanNamed("subscriber concurrency control"), - SpanHasAttributes(OTelAttribute( - sc::kMessagingSystem, "gcp_pubsub"))))); + EXPECT_THAT(spans, Contains(AllOf( + SpanHasInstrumentationScope(), SpanKindIsInternal(), + SpanNamed("subscriber concurrency control"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingSystem, "gcp_pubsub"))))); } TEST(TracingBatchCallback, StartAndEndSchedulerSpan) { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_shared(); EXPECT_CALL(*mock, callback).Times(1); @@ -363,11 +367,11 @@ TEST(TracingBatchCallback, StartAndEndSchedulerSpan) { batch_callback->AckEnd("ack-id-0"); auto spans = span_catcher->GetSpans(); - EXPECT_THAT( - spans, Contains(AllOf(SpanHasInstrumentationScope(), SpanKindIsInternal(), - SpanNamed("subscriber scheduler"), - SpanHasAttributes(OTelAttribute( - sc::kMessagingSystem, "gcp_pubsub"))))); + EXPECT_THAT(spans, Contains(AllOf( + SpanHasInstrumentationScope(), SpanKindIsInternal(), + SpanNamed("subscriber scheduler"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingSystem, "gcp_pubsub"))))); } TEST(TracingBatchCallback, VerifyDestructorEndsAllSpans) { @@ -518,5 +522,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/internal/tracing_batch_sink.cc b/google/cloud/pubsub/internal/tracing_batch_sink.cc index a4782985e09d1..962f628cfe7d4 100644 --- a/google/cloud/pubsub/internal/tracing_batch_sink.cc +++ b/google/cloud/pubsub/internal/tracing_batch_sink.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/pubsub/internal/tracing_batch_sink.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/pubsub/internal/publisher_stub.h" #include "google/cloud/pubsub/internal/tracing_helpers.h" #include "google/cloud/pubsub/options.h" @@ -21,20 +20,19 @@ #include "google/cloud/future.h" #include "google/cloud/internal/opentelemetry.h" #include +#include +#include +#include #include -#include #include #include #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace google { namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - namespace { using Spans = std::vector>; @@ -60,23 +58,23 @@ auto MakeLinks(Spans::const_iterator begin, Spans::const_iterator end) { auto MakeParent(Links const& links, Spans const& message_spans, pubsub::Topic const& topic, std::string const& endpoint) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto options = RootStartSpanOptions(); options.kind = opentelemetry::trace::SpanKind::kClient; - auto batch_sink_parent = - internal::MakeSpan(topic.topic_id() + " publish", - /*attributes=*/ - {{sc::kMessagingBatchMessageCount, - static_cast(message_spans.size())}, - {sc::kCodeFunction, "BatchSink::AsyncPublish"}, - {/*sc::kMessagingOperationType=*/ - "messaging.operation.type", "publish"}, - {sc::kThreadId, internal::CurrentThreadId()}, - {sc::kMessagingSystem, "gcp_pubsub"}, - {/*sc::kServerAddress=*/"server.address", endpoint}, - {"gcp.project_id", topic.project_id()}, - {sc::kMessagingDestinationName, topic.topic_id()}}, - /*links*/ std::move(links), options); + auto batch_sink_parent = internal::MakeSpan( + topic.topic_id() + " publish", + /*attributes=*/ + {{sc::messaging::kMessagingBatchMessageCount, + static_cast(message_spans.size())}, + {sc::code::kCodeFunctionName, "BatchSink::AsyncPublish"}, + {/*sc::messaging::kMessagingOperationType=*/ + "messaging.operation.type", "publish"}, + {sc::thread::kThreadId, internal::CurrentThreadId()}, + {sc::messaging::kMessagingSystem, "gcp_pubsub"}, + {/*sc::kServerAddress=*/"server.address", endpoint}, + {"gcp.project_id", topic.project_id()}, + {sc::messaging::kMessagingDestinationName, topic.topic_id()}}, + /*links*/ std::move(links), options); auto context = batch_sink_parent->GetContext(); auto trace_id = internal::ToString(context.trace_id()); @@ -211,15 +209,6 @@ std::shared_ptr MakeTracingBatchSink( std::move(topic), std::move(batch_sink), std::move(opts)); } -#else // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::shared_ptr MakeTracingBatchSink( - pubsub::Topic, std::shared_ptr batch_sink, Options) { - return batch_sink; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud diff --git a/google/cloud/pubsub/internal/tracing_batch_sink_test.cc b/google/cloud/pubsub/internal/tracing_batch_sink_test.cc index 80c56e6d506a2..f7641c9cd0c3d 100644 --- a/google/cloud/pubsub/internal/tracing_batch_sink_test.cc +++ b/google/cloud/pubsub/internal/tracing_batch_sink_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/tracing_batch_sink.h" #include "google/cloud/pubsub/message.h" #include "google/cloud/pubsub/options.h" @@ -25,7 +23,9 @@ #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" #include -#include +#include +#include +#include namespace google { namespace cloud { @@ -149,7 +149,7 @@ TEST(TracingBatchSink, AddMessageAddsEvent) { } TEST(TracingBatchSink, AsyncPublish) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto message_span = MakeSpan("test span"); auto mock = std::make_unique(); @@ -169,17 +169,17 @@ TEST(TracingBatchSink, AsyncPublish) { EXPECT_THAT(response, IsOk()); auto spans = span_catcher->GetSpans(); - EXPECT_THAT(spans, - Contains(AllOf(SpanHasInstrumentationScope(), SpanKindIsClient(), - SpanNamed("test-topic publish"), - SpanHasAttributes(OTelAttribute( - sc::kMessagingBatchMessageCount, 1)), - SpanHasLinks(AllOf(LinkHasSpanContext( - message_span->GetContext())))))); + EXPECT_THAT( + spans, Contains(AllOf(SpanHasInstrumentationScope(), SpanKindIsClient(), + SpanNamed("test-topic publish"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingBatchMessageCount, 1)), + SpanHasLinks(AllOf(LinkHasSpanContext( + message_span->GetContext())))))); } TEST(TracingBatchSink, PublishSpanHasAttributes) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto message_span = MakeSpan("test span"); auto mock = std::make_unique(); @@ -200,21 +200,21 @@ TEST(TracingBatchSink, PublishSpanHasAttributes) { EXPECT_THAT(spans, Contains(AllOf(SpanNamed("test-topic publish"), SpanHasAttributes(OTelAttribute( - sc::kThreadId, _))))); - EXPECT_THAT(spans, Contains(AllOf( - SpanNamed("test-topic publish"), - SpanHasAttributes(OTelAttribute( - sc::kCodeFunction, "BatchSink::AsyncPublish"))))); - EXPECT_THAT( - spans, Contains(AllOf( - SpanNamed("test-topic publish"), - SpanHasAttributes(OTelAttribute( - /*sc::kMessagingOperationType=*/"messaging.operation.type", - "publish"))))); + sc::thread::kThreadId, _))))); + EXPECT_THAT(spans, + Contains(AllOf(SpanNamed("test-topic publish"), + SpanHasAttributes(OTelAttribute( + sc::code::kCodeFunctionName, + "BatchSink::AsyncPublish"))))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("test-topic publish"), SpanHasAttributes(OTelAttribute( - sc::kMessagingSystem, "gcp_pubsub"))))); + /*sc::messaging::kMessagingOperationType=*/ + "messaging.operation.type", "publish"))))); + EXPECT_THAT(spans, Contains(AllOf( + SpanNamed("test-topic publish"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingSystem, "gcp_pubsub"))))); EXPECT_THAT( spans, Contains(AllOf(SpanNamed("test-topic publish"), SpanHasAttributes(OTelAttribute( @@ -223,11 +223,11 @@ TEST(TracingBatchSink, PublishSpanHasAttributes) { Contains(AllOf(SpanNamed("test-topic publish"), SpanHasAttributes(OTelAttribute( "server.address", kDefaultEndpoint))))); - EXPECT_THAT( - spans, Contains(AllOf( - SpanNamed("test-topic publish"), - SpanHasAttributes(OTelAttribute( - sc::kMessagingDestinationName, TestTopic().topic_id()))))); + EXPECT_THAT(spans, + Contains(AllOf(SpanNamed("test-topic publish"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingDestinationName, + TestTopic().topic_id()))))); } #if OPENTELEMETRY_VERSION_MAJOR >= 2 || \ @@ -257,7 +257,7 @@ TEST(TracingBatchSink, PublishSpanIsRoot) { #endif TEST(TracingBatchSink, AsyncPublishOnlyIncludeSampledLink) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; // Create span before the span catcher so it is not sampled. auto unsampled_span = MakeSpan("test skipped span"); auto span_catcher = InstallSpanCatcher(); @@ -277,17 +277,17 @@ TEST(TracingBatchSink, AsyncPublishOnlyIncludeSampledLink) { EXPECT_THAT(response, IsOk()); auto spans = span_catcher->GetSpans(); - EXPECT_THAT(spans, - Contains(AllOf(SpanHasInstrumentationScope(), SpanKindIsClient(), - SpanNamed("test-topic publish"), - SpanHasAttributes(OTelAttribute( - sc::kMessagingBatchMessageCount, 2)), - SpanLinksAre(AllOf(LinkHasSpanContext( - message_span->GetContext())))))); + EXPECT_THAT( + spans, Contains(AllOf(SpanHasInstrumentationScope(), SpanKindIsClient(), + SpanNamed("test-topic publish"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingBatchMessageCount, 2)), + SpanLinksAre(AllOf(LinkHasSpanContext( + message_span->GetContext())))))); } TEST(TracingBatchSink, AsyncPublishSmallBatch) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto message_span1 = MakeSpan("test span 1"); auto message_span2 = MakeSpan("test span 2"); @@ -310,14 +310,14 @@ TEST(TracingBatchSink, AsyncPublishSmallBatch) { Contains(AllOf( SpanHasInstrumentationScope(), SpanKindIsClient(), SpanNamed("test-topic publish"), - SpanHasAttributes( - OTelAttribute(sc::kMessagingBatchMessageCount, 2)), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingBatchMessageCount, 2)), SpanHasLinks(LinkHasSpanContext(message_span1->GetContext()), LinkHasSpanContext(message_span2->GetContext()))))); } TEST(TracingBatchSink, AsyncPublishBatchWithOtelLimit) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto mock = std::make_unique(); EXPECT_CALL(*mock, AddMessage(_)).Times(kDefaultMaxLinks); EXPECT_CALL(*mock, AsyncPublish) @@ -332,17 +332,17 @@ TEST(TracingBatchSink, AsyncPublishBatchWithOtelLimit) { EXPECT_THAT(response, IsOk()); auto spans = span_catcher->GetSpans(); - EXPECT_THAT( - spans, - Contains(AllOf(SpanHasInstrumentationScope(), SpanKindIsClient(), - SpanNamed("test-topic publish"), - SpanHasAttributes(OTelAttribute( - sc::kMessagingBatchMessageCount, kDefaultMaxLinks)), - SpanLinksSizeIs(kDefaultMaxLinks)))); + EXPECT_THAT(spans, + Contains(AllOf(SpanHasInstrumentationScope(), SpanKindIsClient(), + SpanNamed("test-topic publish"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingBatchMessageCount, + kDefaultMaxLinks)), + SpanLinksSizeIs(kDefaultMaxLinks)))); } TEST(TracingBatchSink, AsyncPublishLargeBatch) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto const batch_size = kDefaultMaxLinks + 1; auto mock = std::make_shared(); EXPECT_CALL(*mock, AddMessage(_)).Times(batch_size); @@ -359,10 +359,11 @@ TEST(TracingBatchSink, AsyncPublishLargeBatch) { EXPECT_THAT(response, IsOk()); auto spans = span_catcher->GetSpans(); - EXPECT_THAT(spans, Contains(AllOf( - SpanNamed("test-topic publish"), - SpanHasAttributes(OTelAttribute( - sc::kMessagingBatchMessageCount, batch_size))))); + EXPECT_THAT(spans, + Contains(AllOf(SpanNamed("test-topic publish"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingBatchMessageCount, + batch_size))))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("publish #0"), SpanKindIsClient(), SpanLinksSizeIs(kDefaultMaxLinks)))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("publish #1"), SpanKindIsClient(), @@ -370,7 +371,7 @@ TEST(TracingBatchSink, AsyncPublishLargeBatch) { } TEST(TracingBatchSink, AsyncPublishBatchWithCustomLimit) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto constexpr kMaxLinks = 5; auto constexpr kBatchSize = 6; auto mock = std::make_unique(); @@ -390,11 +391,12 @@ TEST(TracingBatchSink, AsyncPublishBatchWithCustomLimit) { EXPECT_THAT(response, IsOk()); auto spans = span_catcher->GetSpans(); - EXPECT_THAT(spans, Contains(AllOf( - SpanHasInstrumentationScope(), SpanKindIsClient(), - SpanNamed("test-topic publish"), - SpanHasAttributes(OTelAttribute( - sc::kMessagingBatchMessageCount, kBatchSize))))); + EXPECT_THAT(spans, + Contains(AllOf(SpanHasInstrumentationScope(), SpanKindIsClient(), + SpanNamed("test-topic publish"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingBatchMessageCount, + kBatchSize))))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("publish #0"), SpanKindIsClient(), SpanLinksSizeIs(kMaxLinks)))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("publish #1"), SpanKindIsClient(), @@ -455,7 +457,7 @@ TEST(TracingBatchSink, AsyncPublishAddsEventForMultipleMessages) { } TEST(TracingBatchSink, Scope) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto message_span = MakeSpan("test span"); auto mock = std::make_unique(); @@ -483,13 +485,13 @@ TEST(TracingBatchSink, Scope) { EXPECT_THAT(response, IsOk()); auto spans = span_catcher->GetSpans(); - EXPECT_THAT(spans, - Contains(AllOf(SpanHasInstrumentationScope(), SpanKindIsClient(), - SpanNamed("test-topic publish"), - SpanHasAttributes(OTelAttribute( - sc::kMessagingBatchMessageCount, 1)), - SpanHasLinks(AllOf(LinkHasSpanContext( - message_span->GetContext())))))); + EXPECT_THAT( + spans, Contains(AllOf(SpanHasInstrumentationScope(), SpanKindIsClient(), + SpanNamed("test-topic publish"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingBatchMessageCount, 1)), + SpanHasLinks(AllOf(LinkHasSpanContext( + message_span->GetContext())))))); } TEST(TracingBatchSink, ResumePublish) { @@ -564,5 +566,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/internal/tracing_exactly_once_ack_handler.cc b/google/cloud/pubsub/internal/tracing_exactly_once_ack_handler.cc index 26071c91811c9..9f5b0d4f75d93 100644 --- a/google/cloud/pubsub/internal/tracing_exactly_once_ack_handler.cc +++ b/google/cloud/pubsub/internal/tracing_exactly_once_ack_handler.cc @@ -18,12 +18,11 @@ #include "google/cloud/pubsub/version.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/status.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include +#include +#include #include -#include #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include #include #include @@ -33,8 +32,6 @@ namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - namespace { class TracingExactlyOnceAckHandler @@ -61,21 +58,21 @@ class TracingExactlyOnceAckHandler links.emplace_back( std::make_pair(subscribe_span_->GetContext(), Attributes{})); } - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; opentelemetry::trace::StartSpanOptions options = RootStartSpanOptions(); options.kind = opentelemetry::trace::SpanKind::kInternal; auto sub = subscription(); auto span = internal::MakeSpan( sub.subscription_id() + " ack", - {{sc::kCodeFunction, "pubsub::AckHandler::ack"}, - {sc::kMessagingSystem, "gcp_pubsub"}, + {{sc::code::kCodeFunctionName, "pubsub::AckHandler::ack"}, + {sc::messaging::kMessagingSystem, "gcp_pubsub"}, {"messaging.gcp_pubsub.message.ack_id", ack_id()}, {"messaging.gcp_pubsub.subscription.template", sub.FullName()}, {"gcp.project_id", sub.project_id()}, - {sc::kMessagingDestinationName, sub.subscription_id()}, + {sc::messaging::kMessagingDestinationName, sub.subscription_id()}, {"messaging.gcp_pubsub.message.delivery_attempt", static_cast(delivery_attempt())}, - {/*sc::kMessagingOperationType=*/"messaging.operation.type", + {/*sc::messaging::kMessagingOperationType=*/"messaging.operation.type", "settle"}}, std::move(links), options); auto scope = internal::OTelScope(span); @@ -91,21 +88,21 @@ class TracingExactlyOnceAckHandler links.emplace_back( std::make_pair(subscribe_span_->GetContext(), Attributes{})); } - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; opentelemetry::trace::StartSpanOptions options = RootStartSpanOptions(); options.kind = opentelemetry::trace::SpanKind::kInternal; auto sub = subscription(); auto span = internal::MakeSpan( sub.subscription_id() + " nack", - {{sc::kCodeFunction, "pubsub::AckHandler::nack"}, - {sc::kMessagingSystem, "gcp_pubsub"}, + {{sc::code::kCodeFunctionName, "pubsub::AckHandler::nack"}, + {sc::messaging::kMessagingSystem, "gcp_pubsub"}, {"messaging.gcp_pubsub.message.ack_id", ack_id()}, {"messaging.gcp_pubsub.subscription.template", sub.FullName()}, {"gcp.project_id", sub.project_id()}, - {sc::kMessagingDestinationName, sub.subscription_id()}, + {sc::messaging::kMessagingDestinationName, sub.subscription_id()}, {"messaging.gcp_pubsub.message.delivery_attempt", static_cast(delivery_attempt())}, - {/*sc::kMessagingOperationType=*/"messaging.operation.type", + {/*sc::messaging::kMessagingOperationType=*/"messaging.operation.type", "settle"}}, std::move(links), options); @@ -138,15 +135,6 @@ MakeTracingExactlyOnceAckHandler( span.span); } -#else // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::unique_ptr -MakeTracingExactlyOnceAckHandler( - std::unique_ptr handler, Span const&) { - return handler; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud diff --git a/google/cloud/pubsub/internal/tracing_exactly_once_ack_handler_test.cc b/google/cloud/pubsub/internal/tracing_exactly_once_ack_handler_test.cc index 402bfc831f77e..8deaff80d2216 100644 --- a/google/cloud/pubsub/internal/tracing_exactly_once_ack_handler_test.cc +++ b/google/cloud/pubsub/internal/tracing_exactly_once_ack_handler_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/tracing_exactly_once_ack_handler.h" #include "google/cloud/pubsub/subscription.h" #include "google/cloud/pubsub/testing/mock_exactly_once_ack_handler_impl.h" @@ -22,7 +20,8 @@ #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" #include -#include +#include +#include namespace google { namespace cloud { @@ -147,7 +146,7 @@ TEST(TracingExactlyOnceAckHandlerTest, AckError) { } TEST(TracingAckHandlerTest, AckAttributes) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_unique(); EXPECT_CALL(*mock, ack()) @@ -162,17 +161,19 @@ TEST(TracingAckHandlerTest, AckAttributes) { ElementsAre(AllOf( SpanNamed("test-subscription ack"), SpanHasAttributes( - OTelAttribute(sc::kMessagingSystem, "gcp_pubsub"), + OTelAttribute(sc::messaging::kMessagingSystem, + "gcp_pubsub"), OTelAttribute("gcp.project_id", "test-project"), OTelAttribute( - /*sc::kMessagingOperationType=*/"messaging.operation.type", - "settle"), - OTelAttribute(sc::kCodeFunction, + /*sc::messaging::kMessagingOperationType=*/ + "messaging.operation.type", "settle"), + OTelAttribute(sc::code::kCodeFunctionName, "pubsub::AckHandler::ack"), OTelAttribute( "messaging.gcp_pubsub.message.delivery_attempt", 42), - OTelAttribute(sc::kMessagingDestinationName, - "test-subscription"))))); + OTelAttribute( + sc::messaging::kMessagingDestinationName, + "test-subscription"))))); } TEST(TracingExactlyOnceAckHandlerTest, NackSuccess) { @@ -255,7 +256,7 @@ TEST(TracingExactlyOnceAckHandlerTest, NackSuccessWithNoSubscribeSpan) { } TEST(TracingAckHandlerTest, NackAttributes) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_unique(); EXPECT_CALL(*mock, nack()) @@ -270,17 +271,19 @@ TEST(TracingAckHandlerTest, NackAttributes) { ElementsAre(AllOf( SpanNamed("test-subscription nack"), SpanHasAttributes( - OTelAttribute(sc::kMessagingSystem, "gcp_pubsub"), + OTelAttribute(sc::messaging::kMessagingSystem, + "gcp_pubsub"), OTelAttribute("gcp.project_id", "test-project"), OTelAttribute( - /*sc::kMessagingOperationType=*/"messaging.operation.type", - "settle"), - OTelAttribute(sc::kCodeFunction, + /*sc::messaging::kMessagingOperationType=*/ + "messaging.operation.type", "settle"), + OTelAttribute(sc::code::kCodeFunctionName, "pubsub::AckHandler::nack"), OTelAttribute( "messaging.gcp_pubsub.message.delivery_attempt", 42), - OTelAttribute(sc::kMessagingDestinationName, - "test-subscription"))))); + OTelAttribute( + sc::messaging::kMessagingDestinationName, + "test-subscription"))))); } TEST(TracingAckHandlerTest, DeliveryAttempt) { @@ -312,5 +315,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/internal/tracing_helpers.cc b/google/cloud/pubsub/internal/tracing_helpers.cc index a03bab767f426..ead3529441452 100644 --- a/google/cloud/pubsub/internal/tracing_helpers.cc +++ b/google/cloud/pubsub/internal/tracing_helpers.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/tracing_helpers.h" #include "google/cloud/pubsub/version.h" #include "google/cloud/internal/opentelemetry.h" @@ -70,5 +68,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/internal/tracing_helpers.h b/google/cloud/pubsub/internal/tracing_helpers.h index 0e867ff4359d7..eaee01ab1143c 100644 --- a/google/cloud/pubsub/internal/tracing_helpers.h +++ b/google/cloud/pubsub/internal/tracing_helpers.h @@ -15,8 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_TRACING_HELPERS_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_TRACING_HELPERS_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/pull_ack_handler.h" #include "google/cloud/pubsub/version.h" #include @@ -53,6 +51,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_TRACING_HELPERS_H diff --git a/google/cloud/pubsub/internal/tracing_helpers_test.cc b/google/cloud/pubsub/internal/tracing_helpers_test.cc index 018e0e0c7cc9c..57bed72c2e48c 100644 --- a/google/cloud/pubsub/internal/tracing_helpers_test.cc +++ b/google/cloud/pubsub/internal/tracing_helpers_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/tracing_helpers.h" #include "google/cloud/pubsub/options.h" #include "google/cloud/internal/opentelemetry.h" @@ -185,5 +183,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/internal/tracing_message_callback.cc b/google/cloud/pubsub/internal/tracing_message_callback.cc index 18eb90315671b..663cecf0b0dfa 100644 --- a/google/cloud/pubsub/internal/tracing_message_callback.cc +++ b/google/cloud/pubsub/internal/tracing_message_callback.cc @@ -18,18 +18,14 @@ #include "google/cloud/pubsub/subscription.h" #include "google/cloud/pubsub/version.h" #include "google/cloud/internal/opentelemetry.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY -#include +#include #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace google { namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - namespace { class TracingMessageCallback : public MessageCallback { @@ -43,14 +39,14 @@ class TracingMessageCallback : public MessageCallback { ~TracingMessageCallback() override = default; void user_callback(MessageAndHandler m) override { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; opentelemetry::trace::StartSpanOptions options; if (m.subscribe_span.span) { options.parent = m.subscribe_span.span->GetContext(); } - auto span = - internal::MakeSpan(subscription_id_ + " process", - {{sc::kMessagingSystem, "gcp_pubsub"}}, options); + auto span = internal::MakeSpan( + subscription_id_ + " process", + {{sc::messaging::kMessagingSystem, "gcp_pubsub"}}, options); m.ack_handler = MakeTracingExactlyOnceAckHandler(std::move(m.ack_handler), m.subscribe_span); child_->user_callback(std::move(m)); @@ -70,15 +66,6 @@ std::shared_ptr MakeTracingMessageCallback( opts); } -#else // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::shared_ptr MakeTracingMessageCallback( - std::shared_ptr message_callback, Options const&) { - return message_callback; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud diff --git a/google/cloud/pubsub/internal/tracing_message_callback_test.cc b/google/cloud/pubsub/internal/tracing_message_callback_test.cc index b1455afbc2e21..d2154d94171ed 100644 --- a/google/cloud/pubsub/internal/tracing_message_callback_test.cc +++ b/google/cloud/pubsub/internal/tracing_message_callback_test.cc @@ -24,13 +24,11 @@ #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY +#include #include +#include #include #include -#include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY -#include namespace google { namespace cloud { @@ -38,7 +36,6 @@ namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::InstallSpanCatcher; using ::google::cloud::testing_util::OTelAttribute; using ::google::cloud::testing_util::SpanHasAttributes; @@ -63,7 +60,7 @@ std::shared_ptr MakeTestMessageCallback( } TEST(TracingMessageCallback, UserCallback) { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_shared(); EXPECT_CALL(*mock, user_callback).Times(1); @@ -83,12 +80,12 @@ TEST(TracingMessageCallback, UserCallback) { spans, Contains(AllOf(SpanHasInstrumentationScope(), SpanKindIsInternal(), SpanNamed("test-sub process"), SpanHasAttributes(OTelAttribute( - sc::kMessagingSystem, "gcp_pubsub")), + sc::messaging::kMessagingSystem, "gcp_pubsub")), SpanWithParent(span)))); } TEST(TracingMessageCallback, AddTracingAckHandler) { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock_handler = std::make_unique(); @@ -125,35 +122,11 @@ TEST(TracingMessageCallback, AddTracingAckHandler) { AllOf(SpanHasInstrumentationScope(), SpanKindIsInternal(), SpanNamed("test-sub process"), SpanHasAttributes(OTelAttribute( - sc::kMessagingSystem, "gcp_pubsub")), + sc::messaging::kMessagingSystem, "gcp_pubsub")), SpanWithParent(span)), SpanNamed("test-sub ack"))); } -#else // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -using ::testing::IsNull; -using ::testing::Not; - -TEST(TracingMessageCallback, - VerifyMessageCallbackIsNotNullWhenOTelIsNotCompiled) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, user_callback).Times(1); - auto message_callback = MakeTracingMessageCallback( - std::move(mock), Options{}.set( - pubsub::Subscription("test-project", "test-sub"))); - - EXPECT_THAT(message_callback, Not(IsNull())); - - message_callback->user_callback(MessageCallback::MessageAndHandler{ - pubsub::MessageBuilder().Build(), - std::make_unique(), - "ack-id", - {}}); -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal diff --git a/google/cloud/pubsub/internal/tracing_pull_ack_handler.cc b/google/cloud/pubsub/internal/tracing_pull_ack_handler.cc index ec174057ff4d5..3e4720c5564c1 100644 --- a/google/cloud/pubsub/internal/tracing_pull_ack_handler.cc +++ b/google/cloud/pubsub/internal/tracing_pull_ack_handler.cc @@ -17,12 +17,11 @@ #include "google/cloud/pubsub/version.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/status.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include +#include +#include #include -#include #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include #include #include @@ -32,8 +31,6 @@ namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TracingPullAckHandler : public pubsub::PullAckHandler::Impl { public: explicit TracingPullAckHandler( @@ -48,27 +45,28 @@ class TracingPullAckHandler : public pubsub::PullAckHandler::Impl { TracingAttributes MakeSharedAttributes( std::string const& ack_id, pubsub::Subscription const& subscription) { - namespace sc = opentelemetry::trace::SemanticConventions; - return TracingAttributes{ - {sc::kMessagingSystem, "gcp_pubsub"}, - {"messaging.gcp_pubsub.message.ack_id", ack_id}, - {"messaging.gcp_pubsub.message.delivery_attempt", - child_->delivery_attempt()}, - {"gcp.project_id", subscription.project_id()}, - {sc::kMessagingDestinationName, subscription.subscription_id()}}; + namespace sc = opentelemetry::semconv; + return TracingAttributes{{sc::messaging::kMessagingSystem, "gcp_pubsub"}, + {"messaging.gcp_pubsub.message.ack_id", ack_id}, + {"messaging.gcp_pubsub.message.delivery_attempt", + child_->delivery_attempt()}, + {"gcp.project_id", subscription.project_id()}, + {sc::messaging::kMessagingDestinationName, + subscription.subscription_id()}}; } future ack() override { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; opentelemetry::trace::StartSpanOptions options; options.kind = opentelemetry::trace::SpanKind::kClient; auto const ack_id = child_->ack_id(); auto const subscription = child_->subscription(); TracingAttributes attributes = MakeSharedAttributes(ack_id, subscription); - attributes.emplace_back( - std::make_pair(sc::kCodeFunction, "pubsub::PullAckHandler::ack")); + attributes.emplace_back(std::make_pair(sc::code::kCodeFunctionName, + "pubsub::PullAckHandler::ack")); attributes.emplace_back(std::make_pair( - /*sc::kMessagingOperationType=*/"messaging.operation.type", "ack")); + /*sc::messaging::kMessagingOperationType=*/"messaging.operation.type", + "ack")); auto span = internal::MakeSpan(subscription.subscription_id() + " ack", attributes, CreateLinks(consumer_span_context_), options); @@ -85,16 +83,17 @@ class TracingPullAckHandler : public pubsub::PullAckHandler::Impl { } future nack() override { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; opentelemetry::trace::StartSpanOptions options; options.kind = opentelemetry::trace::SpanKind::kClient; auto const ack_id = child_->ack_id(); auto const subscription = child_->subscription(); TracingAttributes attributes = MakeSharedAttributes(ack_id, subscription); - attributes.emplace_back( - std::make_pair(sc::kCodeFunction, "pubsub::PullAckHandler::nack")); + attributes.emplace_back(std::make_pair(sc::code::kCodeFunctionName, + "pubsub::PullAckHandler::nack")); attributes.emplace_back(std::make_pair( - /*sc::kMessagingOperationType=*/"messaging.operation.type", "nack")); + /*sc::messaging::kMessagingOperationType=*/"messaging.operation.type", + "nack")); auto span = internal::MakeSpan(subscription.subscription_id() + " nack", attributes, CreateLinks(consumer_span_context_), options); @@ -131,15 +130,6 @@ std::unique_ptr MakeTracingPullAckHandler( return std::make_unique(std::move(handler)); } -#else // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::unique_ptr MakeTracingPullAckHandler( - std::unique_ptr handler) { - return handler; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud diff --git a/google/cloud/pubsub/internal/tracing_pull_ack_handler_test.cc b/google/cloud/pubsub/internal/tracing_pull_ack_handler_test.cc index 52a485588bab2..4b613566f222a 100644 --- a/google/cloud/pubsub/internal/tracing_pull_ack_handler_test.cc +++ b/google/cloud/pubsub/internal/tracing_pull_ack_handler_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/tracing_pull_ack_handler.h" #include "google/cloud/pubsub/mocks/mock_pull_ack_handler.h" #include "google/cloud/pubsub/subscription.h" @@ -22,7 +20,8 @@ #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" #include -#include +#include +#include namespace google { namespace cloud { @@ -94,7 +93,7 @@ TEST(TracingAckHandlerTest, AckError) { } TEST(TracingAckHandlerTest, AckAttributes) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_unique(); EXPECT_CALL(*mock, ack()) @@ -104,35 +103,34 @@ TEST(TracingAckHandlerTest, AckAttributes) { EXPECT_THAT(std::move(handler->ack()).get(), StatusIs(StatusCode::kOk)); auto spans = span_catcher->GetSpans(); + EXPECT_THAT(spans, Contains(AllOf( + SpanNamed("test-subscription ack"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingSystem, "gcp_pubsub"))))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("test-subscription ack"), SpanHasAttributes(OTelAttribute( - sc::kMessagingSystem, "gcp_pubsub"))))); + "gcp.project_id", "test-project"))))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("test-subscription ack"), SpanHasAttributes(OTelAttribute( - "gcp.project_id", "test-project"))))); - EXPECT_THAT( - spans, Contains(AllOf( - SpanNamed("test-subscription ack"), - SpanHasAttributes(OTelAttribute( - /*sc::kMessagingOperationType=*/"messaging.operation.type", - "ack"))))); - EXPECT_THAT( - spans, - Contains(AllOf(SpanNamed("test-subscription ack"), - SpanHasAttributes(OTelAttribute( - sc::kCodeFunction, "pubsub::PullAckHandler::ack"))))); + /*sc::messaging::kMessagingOperationType=*/ + "messaging.operation.type", "ack"))))); + EXPECT_THAT(spans, + Contains(AllOf(SpanNamed("test-subscription ack"), + SpanHasAttributes(OTelAttribute( + sc::code::kCodeFunctionName, + "pubsub::PullAckHandler::ack"))))); EXPECT_THAT(spans, Contains(AllOf( SpanNamed("test-subscription ack"), SpanHasAttributes(OTelAttribute( "messaging.gcp_pubsub.message.delivery_attempt", 42))))); EXPECT_THAT(spans, - Contains(AllOf( - SpanNamed("test-subscription ack"), - SpanHasAttributes(OTelAttribute( - sc::kMessagingDestinationName, "test-subscription"))))); + Contains(AllOf(SpanNamed("test-subscription ack"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingDestinationName, + "test-subscription"))))); } TEST(TracingAckHandlerTest, NackSuccess) { @@ -170,7 +168,7 @@ TEST(TracingAckHandlerTest, NackError) { } TEST(TracingAckHandlerTest, NackAttributes) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_unique(); EXPECT_CALL(*mock, nack()) @@ -180,35 +178,34 @@ TEST(TracingAckHandlerTest, NackAttributes) { EXPECT_THAT(std::move(handler->nack()).get(), StatusIs(StatusCode::kOk)); auto spans = span_catcher->GetSpans(); + EXPECT_THAT(spans, Contains(AllOf( + SpanNamed("test-subscription nack"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingSystem, "gcp_pubsub"))))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("test-subscription nack"), SpanHasAttributes(OTelAttribute( - sc::kMessagingSystem, "gcp_pubsub"))))); - EXPECT_THAT( - spans, Contains(AllOf( - SpanNamed("test-subscription nack"), - SpanHasAttributes(OTelAttribute( - /*sc::kMessagingOperationType=*/"messaging.operation.type", - "nack"))))); + /*sc::messaging::kMessagingOperationType=*/ + "messaging.operation.type", "nack"))))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("test-subscription nack"), SpanHasAttributes(OTelAttribute( "gcp.project_id", "test-project"))))); - EXPECT_THAT( - spans, - Contains(AllOf(SpanNamed("test-subscription nack"), - SpanHasAttributes(OTelAttribute( - sc::kCodeFunction, "pubsub::PullAckHandler::nack"))))); + EXPECT_THAT(spans, + Contains(AllOf(SpanNamed("test-subscription nack"), + SpanHasAttributes(OTelAttribute( + sc::code::kCodeFunctionName, + "pubsub::PullAckHandler::nack"))))); EXPECT_THAT(spans, Contains(AllOf( SpanNamed("test-subscription nack"), SpanHasAttributes(OTelAttribute( "messaging.gcp_pubsub.message.delivery_attempt", 42))))); EXPECT_THAT(spans, - Contains(AllOf( - SpanNamed("test-subscription nack"), - SpanHasAttributes(OTelAttribute( - sc::kMessagingDestinationName, "test-subscription"))))); + Contains(AllOf(SpanNamed("test-subscription nack"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingDestinationName, + "test-subscription"))))); } TEST(TracingAckHandlerTest, DeliveryAttemptNoSpans) { @@ -314,5 +311,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/internal/tracing_pull_lease_manager.cc b/google/cloud/pubsub/internal/tracing_pull_lease_manager.cc index bfe610b4e92f9..b9b39ac47d59d 100644 --- a/google/cloud/pubsub/internal/tracing_pull_lease_manager.cc +++ b/google/cloud/pubsub/internal/tracing_pull_lease_manager.cc @@ -19,10 +19,9 @@ #include "google/cloud/internal/async_retry_loop.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/status.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY -#include +#include +#include #include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include #include @@ -31,8 +30,6 @@ namespace cloud { namespace pubsub_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TracingPullLeaseManagerImpl : public PullLeaseManagerImpl { public: explicit TracingPullLeaseManagerImpl( @@ -51,20 +48,22 @@ class TracingPullLeaseManagerImpl : public PullLeaseManagerImpl { std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::pubsub::v1::ModifyAckDeadlineRequest const& request) override { - namespace sc = opentelemetry::trace::SemanticConventions; + namespace sc = opentelemetry::semconv; opentelemetry::trace::StartSpanOptions start_span_options = RootStartSpanOptions(); start_span_options.kind = opentelemetry::trace::SpanKind::kClient; auto span = internal::MakeSpan( subscription_.subscription_id() + " modack", - {{sc::kMessagingSystem, "gcp_pubsub"}, - {/*sc::kMessagingOperationType=*/"messaging.operation.type", "modack"}, - {sc::kCodeFunction, "pubsub::PullLeaseManager::ExtendLease"}, + {{sc::messaging::kMessagingSystem, "gcp_pubsub"}, + {/*sc::messaging::kMessagingOperationType=*/"messaging.operation.type", + "modack"}, + {sc::code::kCodeFunctionName, "pubsub::PullLeaseManager::ExtendLease"}, {"messaging.gcp_pubsub.message.ack_id", ack_id_}, {"messaging.gcp_pubsub.message.ack_deadline_seconds", static_cast(request.ack_deadline_seconds())}, {"gcp.project_id", subscription_.project_id()}, - {sc::kMessagingDestinationName, subscription_.subscription_id()}}, + {sc::messaging::kMessagingDestinationName, + subscription_.subscription_id()}}, CreateLinks(consumer_span_context_), start_span_options); auto scope = internal::OTelScope(span); MaybeAddLinkAttributes(*span, consumer_span_context_, "receive"); @@ -91,16 +90,6 @@ std::shared_ptr MakeTracingPullLeaseManagerImpl( std::move(manager), std::move(ack_id), std::move(subscription)); } -#else // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::shared_ptr MakeTracingPullLeaseManagerImpl( - std::shared_ptr manager, std::string, - pubsub::Subscription) { - return manager; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud diff --git a/google/cloud/pubsub/internal/tracing_pull_lease_manager_test.cc b/google/cloud/pubsub/internal/tracing_pull_lease_manager_test.cc index 2fd5da3302ade..aee9b815276c9 100644 --- a/google/cloud/pubsub/internal/tracing_pull_lease_manager_test.cc +++ b/google/cloud/pubsub/internal/tracing_pull_lease_manager_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/pubsub/internal/tracing_pull_lease_manager.h" #include "google/cloud/pubsub/subscription.h" #include "google/cloud/pubsub/testing/mock_pull_lease_manager.h" @@ -25,7 +23,8 @@ #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" #include -#include +#include +#include namespace google { namespace cloud { @@ -146,7 +145,7 @@ TEST(TracingPullLeaseManagerImplTest, AsyncModifyAckDeadlineError) { } TEST(TracingPullLeaseManagerImplTest, AsyncModifyAckDeadlineAttributes) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_shared(); EXPECT_CALL(*mock, AsyncModifyAckDeadline(_, _, _, _, _)) @@ -168,20 +167,19 @@ TEST(TracingPullLeaseManagerImplTest, AsyncModifyAckDeadlineAttributes) { EXPECT_STATUS_OK(status.get()); auto spans = span_catcher->GetSpans(); + EXPECT_THAT(spans, Contains(AllOf( + SpanNamed("test-subscription modack"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingSystem, "gcp_pubsub"))))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("test-subscription modack"), SpanHasAttributes(OTelAttribute( - sc::kMessagingSystem, "gcp_pubsub"))))); - EXPECT_THAT( - spans, Contains(AllOf( - SpanNamed("test-subscription modack"), - SpanHasAttributes(OTelAttribute( - /*sc::kMessagingOperationType=*/"messaging.operation.type", - "modack"))))); + /*sc::messaging::kMessagingOperationType=*/ + "messaging.operation.type", "modack"))))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("test-subscription modack"), SpanHasAttributes(OTelAttribute( - sc::kCodeFunction, + sc::code::kCodeFunctionName, "pubsub::PullLeaseManager::ExtendLease"))))); EXPECT_THAT( spans, @@ -195,10 +193,10 @@ TEST(TracingPullLeaseManagerImplTest, AsyncModifyAckDeadlineAttributes) { SpanHasAttributes(OTelAttribute( "messaging.gcp_pubsub.message.ack_id", "test-ack-id"))))); EXPECT_THAT(spans, - Contains(AllOf( - SpanNamed("test-subscription modack"), - SpanHasAttributes(OTelAttribute( - sc::kMessagingDestinationName, "test-subscription"))))); + Contains(AllOf(SpanNamed("test-subscription modack"), + SpanHasAttributes(OTelAttribute( + sc::messaging::kMessagingDestinationName, + "test-subscription"))))); EXPECT_THAT(spans, Contains(AllOf(SpanNamed("test-subscription modack"), SpanHasAttributes(OTelAttribute( @@ -281,5 +279,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/pubsub/message.h b/google/cloud/pubsub/message.h index 51c0571e0ece9..e002e3b995e1f 100644 --- a/google/cloud/pubsub/message.h +++ b/google/cloud/pubsub/message.h @@ -17,7 +17,7 @@ #include "google/cloud/pubsub/version.h" #include "absl/strings/string_view.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" #include #include #include diff --git a/google/cloud/pubsub/publisher.h b/google/cloud/pubsub/publisher.h index 4b28d1bbca823..24fb75f9584ce 100644 --- a/google/cloud/pubsub/publisher.h +++ b/google/cloud/pubsub/publisher.h @@ -17,7 +17,6 @@ #include "google/cloud/pubsub/connection_options.h" #include "google/cloud/pubsub/publisher_connection.h" -#include "google/cloud/pubsub/publisher_options.h" #include "google/cloud/pubsub/version.h" #include @@ -185,13 +184,6 @@ class Publisher { connection_->ResumePublish({std::move(ordering_key)}); } - /// @deprecated Use `Publisher(connection)` and provide any configuration - /// options when initializing the @p connection object. - GOOGLE_CLOUD_CPP_DEPRECATED("use `Publisher(connection)` instead") - explicit Publisher(std::shared_ptr connection, - PublisherOptions const& /* options*/) - : Publisher(std::move(connection)) {} - private: std::shared_ptr connection_; }; diff --git a/google/cloud/pubsub/publisher_connection.cc b/google/cloud/pubsub/publisher_connection.cc index b4522f8a0f6eb..8e87fb415dcff 100644 --- a/google/cloud/pubsub/publisher_connection.cc +++ b/google/cloud/pubsub/publisher_connection.cc @@ -132,18 +132,6 @@ std::shared_ptr MakePublisherConnection(Topic topic, return MakePublisherConnection("", std::move(topic), std::move(opts)); } -std::shared_ptr MakePublisherConnection( - Topic topic, PublisherOptions options, ConnectionOptions connection_options, - std::unique_ptr retry_policy, - std::unique_ptr backoff_policy) { - auto opts = internal::MergeOptions( - pubsub_internal::MakeOptions(std::move(options)), - internal::MakeOptions(std::move(connection_options))); - if (retry_policy) opts.set(retry_policy->clone()); - if (backoff_policy) opts.set(backoff_policy->clone()); - return MakePublisherConnection(std::move(topic), std::move(opts)); -} - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub diff --git a/google/cloud/pubsub/publisher_connection.h b/google/cloud/pubsub/publisher_connection.h index eba98d738bffd..e4642059addb9 100644 --- a/google/cloud/pubsub/publisher_connection.h +++ b/google/cloud/pubsub/publisher_connection.h @@ -19,7 +19,6 @@ #include "google/cloud/pubsub/connection_options.h" #include "google/cloud/pubsub/internal/publisher_stub.h" #include "google/cloud/pubsub/message.h" -#include "google/cloud/pubsub/publisher_options.h" #include "google/cloud/pubsub/retry_policy.h" #include "google/cloud/pubsub/topic.h" #include "google/cloud/pubsub/version.h" @@ -132,45 +131,6 @@ std::shared_ptr MakePublisherConnection( std::shared_ptr MakePublisherConnection(Topic topic, Options opts = {}); -/** - * Creates a new `PublisherConnection` object to work with `Publisher`. - * - * The `PublisherConnection` class is not intended for direct use in - * applications, it is provided for applications wanting to mock the - * `Publisher` behavior in their tests. - * - * @par Performance - * Creating a new `PublisherConnection` is relatively expensive. This typically - * initiate connections to the service, and therefore these objects should be - * shared and reused when possible. Note that gRPC reuses existing OS resources - * (sockets) whenever possible, so applications may experience better - * performance on the second (and subsequent) calls to this function with the - * identical values for @p options. However, this behavior is not guaranteed - * and applications should not rely on it. - * - * @see `PublisherConnection` - * - * @param topic the Cloud Pub/Sub topic used by the returned - * `PublisherConnection`. - * @param options configure the batching policy and other parameters in the - * returned connection. - * @param connection_options (optional) general configuration for this - * connection, this type is also used to configure `pubsub::Subscriber`. - * @param retry_policy (optional) configure the retry loop. - * @param backoff_policy (optional) configure the backoff period between - * retries. - * - * @deprecated Please use the `MakePublisherConnection` method which accepts - * `google::cloud::Options` instead. - */ -GOOGLE_CLOUD_CPP_DEPRECATED( - "use the overload consuming google::cloud::Options instead") -std::shared_ptr MakePublisherConnection( - Topic topic, PublisherOptions options, - ConnectionOptions connection_options = {}, - std::unique_ptr retry_policy = {}, - std::unique_ptr backoff_policy = {}); - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub diff --git a/google/cloud/pubsub/publisher_connection_test.cc b/google/cloud/pubsub/publisher_connection_test.cc index 0d6ab900ed5a5..bcccf0574fa6c 100644 --- a/google/cloud/pubsub/publisher_connection_test.cc +++ b/google/cloud/pubsub/publisher_connection_test.cc @@ -340,7 +340,6 @@ TEST(PublisherConnectionTest, HandleTransientEnabledRetry) { EXPECT_EQ("test-message-id-0", *response); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::InstallSpanCatcher; @@ -402,7 +401,6 @@ TEST(MakePublisherConnectionTest, TracingDisabled) { EXPECT_THAT(span_catcher->GetSpans(), IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/pubsub/publisher_options.cc b/google/cloud/pubsub/publisher_options.cc deleted file mode 100644 index 6367cd7399e28..0000000000000 --- a/google/cloud/pubsub/publisher_options.cc +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/pubsub/publisher_options.h" -#include "google/cloud/pubsub/internal/defaults.h" - -namespace google { -namespace cloud { -namespace pubsub { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -PublisherOptions::PublisherOptions() { - opts_ = pubsub_internal::DefaultPublisherOptionsOnly(Options{}); -} - -PublisherOptions::PublisherOptions(Options opts) { - internal::CheckExpectedOptions(opts, __func__); - opts_ = pubsub_internal::DefaultPublisherOptionsOnly(std::move(opts)); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace pubsub -} // namespace cloud -} // namespace google diff --git a/google/cloud/pubsub/publisher_options.h b/google/cloud/pubsub/publisher_options.h deleted file mode 100644 index 82cd625829a97..0000000000000 --- a/google/cloud/pubsub/publisher_options.h +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_PUBSUB_PUBLISHER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_PUBLISHER_OPTIONS_H - -#include "google/cloud/pubsub/options.h" -#include "google/cloud/pubsub/version.h" -#include "google/cloud/options.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace pubsub { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -class PublisherOptions; -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace pubsub - -namespace pubsub_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -Options MakeOptions(pubsub::PublisherOptions); -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace pubsub_internal - -namespace pubsub { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * Configuration options for a `Publisher`. - * - * These are largely used to control the batching configuration for a publisher. - * By default a publishers flushes a batch as soon as any of these conditions - * are met: - * - 10ms after the first message is put in the batch, - * - when the batch contains 100 messages or more, - * - when the batch contains 1MiB of data or more. - * - * Applications developers should consult the Cloud Pub/Sub - * [pricing page][pubsub-pricing-link] when selecting a batching configuration. - * - * @deprecated We recommend you use `google::cloud::Options` and pass the - * options to `MakePublisherConnection()`. - * - * @par Example - * @snippet samples.cc publisher-options - * - * [pubsub-pricing-link]: https://cloud.google.com/pubsub/pricing - */ -class PublisherOptions { - public: - /// @deprecated Use `google::cloud::Options{}` instead. - GOOGLE_CLOUD_CPP_DEPRECATED("use `google::cloud::Options{}` instead") - PublisherOptions(); - - /** - * Initialize the publisher options. - * - * Expected options are any of the types in the `PublisherOptionList` - * - * @note Unrecognized options will be ignored. To debug issues with options - * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment and - * unexpected options will be logged. - * - * @param opts configuration options - * - * @deprecated Use `google::cloud::Options{}` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED("use `google::cloud::Options{}` instead") - explicit PublisherOptions(Options opts); - - /** - * @name Publisher batch control - * - * It is more efficient (in terms of client CPU and client network usage) to - * send multiple messages in a single "batch" to the service. The following - * configuration options can be used to improve throughput: sending larger - * batches reduces CPU and network overhead. Note that batches are subject - * to [quota limits]. - * - * [quota limits]: https://cloud.google.com/pubsub/quotas#resource_limits - */ - ///@{ - /// @deprecated Use `google::cloud::Options{}` and `MaxHoldTimeOption` - /// instead. - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `MaxHoldTimeOption` instead") - std::chrono::microseconds maximum_hold_time() const { - return opts_.get(); - } - - /** - * Sets the maximum hold time for the messages. - * - * @note While this function accepts durations in arbitrary precision, the - * implementation depends on the granularity of your OS timers. It is - * possible that messages are held for slightly longer times than the - * value set here. - * - * @note The first message in a batch starts the hold time counter. New - * messages do not extend the life of the batch. For example, if you have - * set the holding time to 10 milliseconds, start a batch with message 1, - * and publish a second message 5 milliseconds later, the second message - * will be flushed approximately 5 milliseconds after it is published. - * - * @deprecated Use `google::cloud::Options{}` and `MaxHoldTimeOption` instead. - */ - template - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `MaxHoldTimeOption` instead") - PublisherOptions& set_maximum_hold_time( - std::chrono::duration v) { - opts_.set( - std::chrono::duration_cast(v)); - return *this; - } - - /// @deprecated Use `google::cloud::Options{}` and `MaxBatchMessagesOption` - /// instead. - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `MaxBatchMessagesOption` instead") - std::size_t maximum_batch_message_count() const { - return opts_.get(); - } - - /** - * Set the maximum number of messages in a batch. - * - * @note Application developers should keep in mind that Cloud Pub/Sub - * sets [limits][pubsub-quota-link] on the size of a batch (1,000 messages) - * The library makes no attempt to validate the value provided in this - * function. - * - * [pubsub-quota-link]: https://cloud.google.com/pubsub/quotas#resource_limits - * - * @deprecated Use `google::cloud::Options{}` and `MaxBatchMessagesOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `MaxBatchMessagesOption` instead") - PublisherOptions& set_maximum_batch_message_count(std::size_t v) { - opts_.set(v); - return *this; - } - - /// @deprecated Use `google::cloud::Options{}` and `MaxBatchBytesOption` - /// instead. - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `MaxBatchBytesOption` instead") - std::size_t maximum_batch_bytes() const { - return opts_.get(); - } - - /** - * Set the maximum size for the messages in a batch. - * - * @note Application developers should keep in mind that Cloud Pub/Sub - * sets [limits][pubsub-quota-link] on the size of a batch (10MB). The - * library makes no attempt to validate the value provided in this - * function. - * - * [pubsub-quota-link]: https://cloud.google.com/pubsub/quotas#resource_limits - * - * @deprecated Use `google::cloud::Options{}` and `MaxBatchBytesOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `MaxBatchBytesOption` instead") - PublisherOptions& set_maximum_batch_bytes(std::size_t v) { - opts_.set(v); - return *this; - } - ///@} - - /** - * @name Publisher message ordering. - * - * To guarantee messages are received by the service in the same order that - * the application gives them to a publisher, the client library needs to wait - * until a batch of messages is successfully delivered before sending the next - * batch, otherwise batches may arrive out of order as there is no guarantee - * the same channel or network path is used for each batch. - * - * For applications that do not care about message ordering, this can limit - * the throughput. Therefore, the behavior is disabled by default. - */ - ///@{ - - /** - * Return `true` if message ordering is enabled. - * - * @deprecated Use `google::cloud::Options{}` and `MessageOrderingOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `MessageOrderingOption` instead") - bool message_ordering() const { return opts_.get(); } - - /** - * Enable message ordering. - * - * @deprecated Use `google::cloud::Options{}` and `MessageOrderingOption` - * instead. - * - * @see the documentation for the `Publisher` class for details. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `MessageOrderingOption` instead") - PublisherOptions& enable_message_ordering() { - opts_.set(true); - return *this; - } - - /** - * Disable message ordering. - * - * @deprecated Use `google::cloud::Options{}` and `MessageOrderingOption` - * instead. - * - * @see the documentation for the `Publisher` class for details. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `MessageOrderingOption` instead") - PublisherOptions& disable_message_ordering() { - opts_.set(false); - return *this; - } - ///@} - - /** - * @name Publisher flow control. - * - * After a publisher flushes a batch of messages the batch is (obviously) not - * received immediately by the service. While the batch remains pending it - * potentially consumes memory resources in the client (and/or the service). - * - * Some applications may have constraints on the number of bytes and/or - * messages they can tolerate in this pending state, and may prefer to block - * or reject messages. - */ - ///@{ - - /** - * Flow control based on pending bytes. - * - * @deprecated Use `google::cloud::Options{}` and `MaxPendingBytesOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `MaxPendingBytesOption` instead") - PublisherOptions& set_maximum_pending_bytes(std::size_t v) { - opts_.set(v); - return *this; - } - - /** - * Flow control based on pending messages. - * - * @deprecated Use `google::cloud::Options{}` and `MaxPendingMessagesOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `MaxPendingMessagesOption` instead") - PublisherOptions& set_maximum_pending_messages(std::size_t v) { - opts_.set(v); - return *this; - } - - /// @deprecated Use `google::cloud::Options{}` and `MaxPendingBytesOption` - /// instead. - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `MaxPendingBytesOption` instead") - std::size_t maximum_pending_bytes() const { - return opts_.get(); - } - - /// @deprecated Use `google::cloud::Options{}` and `MaxPendingMessagesOption` - /// instead. - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `MaxPendingMessagesOption` instead") - std::size_t maximum_pending_messages() const { - return opts_.get(); - } - - /** - * The current action for a full publisher. - * - * @deprecated Use `google::cloud::Options{}` and `FullPublisherActionOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `FullPublisherActionOption` instead") - bool full_publisher_ignored() const { - return opts_.get() == - FullPublisherAction::kIgnored; - } - - /** - * The current action for a full publisher. - * - * @deprecated Use `google::cloud::Options{}` and `FullPublisherActionOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `FullPublisherActionOption` instead") - bool full_publisher_rejects() const { - return opts_.get() == - FullPublisherAction::kRejects; - } - - /** - * The current action for a full publisher. - * - * @deprecated Use `google::cloud::Options{}` and `FullPublisherActionOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `FullPublisherActionOption` instead") - bool full_publisher_blocks() const { - return opts_.get() == - FullPublisherAction::kBlocks; - } - - /** - * Ignore full publishers, continue as usual - * - * @deprecated Use `google::cloud::Options{}` and `FullPublisherActionOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `FullPublisherActionOption` instead") - PublisherOptions& set_full_publisher_ignored() { - opts_.set(FullPublisherAction::kIgnored); - return *this; - } - - /** - * Configure the publisher to reject new messages when full. - * - * @deprecated Use `google::cloud::Options{}` and `FullPublisherActionOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `FullPublisherActionOption` instead") - PublisherOptions& set_full_publisher_rejects() { - opts_.set(FullPublisherAction::kRejects); - return *this; - } - - /** - * Configure the publisher to block the caller when full. - * - * @deprecated Use `google::cloud::Options{}` and `FullPublisherActionOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options{}` and `FullPublisherActionOption` instead") - PublisherOptions& set_full_publisher_blocks() { - opts_.set(FullPublisherAction::kBlocks); - return *this; - } - ///@} - - private: - friend Options pubsub_internal::MakeOptions(PublisherOptions); - Options opts_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace pubsub - -namespace pubsub_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -inline Options MakeOptions(pubsub::PublisherOptions o) { - return std::move(o.opts_); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace pubsub_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_PUBLISHER_OPTIONS_H diff --git a/google/cloud/pubsub/publisher_options_test.cc b/google/cloud/pubsub/publisher_options_test.cc deleted file mode 100644 index 7f265fba23189..0000000000000 --- a/google/cloud/pubsub/publisher_options_test.cc +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/pubsub/publisher_options.h" -#include "google/cloud/grpc_options.h" -#include "google/cloud/testing_util/scoped_log.h" -// This file contains the tests for deprecated functions, we need to disable -// the warnings -#include "google/cloud/internal/disable_deprecation_warnings.inc" -#include - -namespace google { -namespace cloud { -namespace pubsub { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -using ::testing::Contains; -using ::testing::HasSubstr; - -TEST(PublisherOptions, Setters) { - auto const b0 = PublisherOptions{}; - EXPECT_NE(0, b0.maximum_hold_time().count()); - EXPECT_FALSE(b0.message_ordering()); - - auto const b = PublisherOptions{} - .set_maximum_hold_time(std::chrono::seconds(12)) - .set_maximum_batch_bytes(123) - .set_maximum_batch_message_count(10) - .enable_message_ordering(); - EXPECT_EQ(10, b.maximum_batch_message_count()); - EXPECT_EQ(123, b.maximum_batch_bytes()); - auto const expected = std::chrono::duration_cast( - std::chrono::seconds(12)); - EXPECT_EQ(expected, b.maximum_hold_time()); - EXPECT_TRUE(b.message_ordering()); - - auto const b1 = - PublisherOptions{}.enable_message_ordering().disable_message_ordering(); - EXPECT_FALSE(b1.message_ordering()); -} - -TEST(PublisherOptions, MaximumPendingBytes) { - auto const b0 = PublisherOptions{}; - EXPECT_NE(0, b0.maximum_pending_bytes()); - - auto const b1 = PublisherOptions{}.set_maximum_pending_bytes(10000000); - EXPECT_EQ(10000000, b1.maximum_pending_bytes()); - - auto const b2 = PublisherOptions{}.set_maximum_pending_bytes(0); - EXPECT_EQ(0, b2.maximum_pending_bytes()); -} - -TEST(PublisherOptions, MaximumPendingMessages) { - auto const b0 = PublisherOptions{}; - EXPECT_NE(0, b0.maximum_pending_messages()); - - auto const b1 = PublisherOptions{}.set_maximum_pending_messages(1000); - EXPECT_EQ(1000, b1.maximum_pending_messages()); - - auto const b2 = PublisherOptions{}.set_maximum_pending_messages(0); - EXPECT_EQ(0, b2.maximum_pending_messages()); -} - -TEST(PublisherOptions, FullPublisherAction) { - auto const b0 = PublisherOptions{}; - EXPECT_FALSE(b0.full_publisher_ignored()); - EXPECT_FALSE(b0.full_publisher_rejects()); - EXPECT_TRUE(b0.full_publisher_blocks()); - - EXPECT_TRUE( - PublisherOptions{}.set_full_publisher_ignored().full_publisher_ignored()); - EXPECT_TRUE( - PublisherOptions{}.set_full_publisher_rejects().full_publisher_rejects()); - EXPECT_TRUE( - PublisherOptions{}.set_full_publisher_blocks().full_publisher_blocks()); -} - -TEST(PublisherOptions, OptionsConstructor) { - auto const b = PublisherOptions( - Options{} - .set(std::chrono::seconds(12)) - .set(10) - .set(123) - .set(4) - .set(444) - .set(true) - .set(FullPublisherAction::kRejects)); - - auto const expected = std::chrono::duration_cast( - std::chrono::seconds(12)); - EXPECT_EQ(expected, b.maximum_hold_time()); - EXPECT_EQ(10, b.maximum_batch_message_count()); - EXPECT_EQ(123, b.maximum_batch_bytes()); - EXPECT_EQ(4, b.maximum_pending_messages()); - EXPECT_EQ(444, b.maximum_pending_bytes()); - EXPECT_TRUE(b.message_ordering()); - EXPECT_TRUE(b.full_publisher_rejects()); -} - -TEST(PublisherOptions, ExpectedOptionsCheck) { - struct NonOption { - using Type = bool; - }; - - testing_util::ScopedLog log; - auto b = PublisherOptions(Options{}.set(true)); - EXPECT_THAT(log.ExtractLines(), Contains(HasSubstr("Unexpected option"))); -} - -TEST(PublisherOptions, MakeOptions) { - auto b = PublisherOptions{} - .set_maximum_hold_time(std::chrono::seconds(12)) - .set_maximum_batch_message_count(10) - .set_maximum_batch_bytes(123) - .set_maximum_pending_messages(4) - .set_maximum_pending_bytes(444) - .enable_message_ordering(); - - auto opts = pubsub_internal::MakeOptions(std::move(b)); - EXPECT_EQ(std::chrono::seconds(12), opts.get()); - EXPECT_EQ(10, opts.get()); - EXPECT_EQ(123, opts.get()); - EXPECT_EQ(4, opts.get()); - EXPECT_EQ(444, opts.get()); - EXPECT_TRUE(opts.get()); - - auto ignored = PublisherOptions{}.set_full_publisher_ignored(); - opts = pubsub_internal::MakeOptions(std::move(ignored)); - EXPECT_EQ(FullPublisherAction::kIgnored, - opts.get()); - - auto rejects = PublisherOptions{}.set_full_publisher_rejects(); - opts = pubsub_internal::MakeOptions(std::move(rejects)); - EXPECT_EQ(FullPublisherAction::kRejects, - opts.get()); - - auto blocks = PublisherOptions{}.set_full_publisher_blocks(); - opts = pubsub_internal::MakeOptions(std::move(blocks)); - EXPECT_EQ(FullPublisherAction::kBlocks, - opts.get()); - - // Ensure that we are not setting any extra options - EXPECT_FALSE(opts.has()); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace pubsub -} // namespace cloud -} // namespace google diff --git a/google/cloud/pubsub/pubsub_client_unit_tests.bzl b/google/cloud/pubsub/pubsub_client_unit_tests.bzl index 8600831abc83a..abcb99d897e0e 100644 --- a/google/cloud/pubsub/pubsub_client_unit_tests.bzl +++ b/google/cloud/pubsub/pubsub_client_unit_tests.bzl @@ -61,14 +61,12 @@ pubsub_client_unit_tests = [ "message_test.cc", "options_test.cc", "publisher_connection_test.cc", - "publisher_options_test.cc", "publisher_test.cc", "pull_ack_handler_test.cc", "schema_test.cc", "snapshot_builder_test.cc", "snapshot_test.cc", "subscriber_connection_test.cc", - "subscriber_options_test.cc", "subscriber_test.cc", "subscription_admin_client_test.cc", "subscription_admin_connection_test.cc", diff --git a/google/cloud/pubsub/quickstart/.bazelrc b/google/cloud/pubsub/quickstart/.bazelrc index f8f4bb3e07a87..1ccef142904e8 100644 --- a/google/cloud/pubsub/quickstart/.bazelrc +++ b/google/cloud/pubsub/quickstart/.bazelrc @@ -15,19 +15,12 @@ # 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 +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 - -#Our quickstarts do not yet support bzlmod -build --noenable_bzlmod 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/CMakeLists.txt b/google/cloud/pubsub/quickstart/CMakeLists.txt index d56defe95d8ac..1c19460093539 100644 --- a/google/cloud/pubsub/quickstart/CMakeLists.txt +++ b/google/cloud/pubsub/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # A minimal CMakeList.txt showing how to use the Cloud Pub/Sub C++ client # library in CMake-based projects. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-pubsub-quickstart CXX) find_package(google_cloud_cpp_pubsub REQUIRED) diff --git a/google/cloud/pubsub/quickstart/MODULE.bazel b/google/cloud/pubsub/quickstart/MODULE.bazel new file mode 100644 index 0000000000000..e47bfb6fa8af0 --- /dev/null +++ b/google/cloud/pubsub/quickstart/MODULE.bazel @@ -0,0 +1,20 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +module( + name = "quickstart", + version = "0.0.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 fb01399a6e456..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 = "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/pubsub/quickstart/bazel/BUILD.bazel b/google/cloud/pubsub/quickstart/bazel/BUILD.bazel new file mode 100644 index 0000000000000..9d3c52804de76 --- /dev/null +++ b/google/cloud/pubsub/quickstart/bazel/BUILD.bazel @@ -0,0 +1,17 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 v2 + +package(default_visibility = ["//:__subpackages__"]) diff --git a/google/cloud/pubsub/quickstart/bazel/remove_upb_c_rules.patch b/google/cloud/pubsub/quickstart/bazel/remove_upb_c_rules.patch new file mode 100644 index 0000000000000..43b077224c29d --- /dev/null +++ b/google/cloud/pubsub/quickstart/bazel/remove_upb_c_rules.patch @@ -0,0 +1,124 @@ +diff --git google/api/expr/v1alpha1/BUILD.bazel google/api/expr/v1alpha1/BUILD.bazel +index 9bed46809..197e5249c 100644 +--- google/api/expr/v1alpha1/BUILD.bazel ++++ google/api/expr/v1alpha1/BUILD.bazel +@@ -233,32 +233,32 @@ cc_proto_library( + ############################################################################## + # upb + ############################################################################## +-load( +- "@com_google_googleapis_imports//:imports.bzl", +- "upb_c_proto_library", +-) +- +-upb_c_proto_library( +- name = "checked_upb_proto", +- deps = [":checked_proto"], +-) +- +-upb_c_proto_library( +- name = "eval_upb_proto", +- deps = [":eval_proto"], +-) +- +-upb_c_proto_library( +- name = "explain_upb_proto", +- deps = [":explain_proto"], +-) +- +-upb_c_proto_library( +- name = "syntax_upb_proto", +- deps = [":syntax_proto"], +-) +- +-upb_c_proto_library( +- name = "value_upb_proto", +- deps = [":value_proto"], +-) ++#load( ++ #"@com_google_googleapis_imports//:imports.bzl", ++ #"upb_c_proto_library", ++#) ++# ++#upb_c_proto_library( ++ #name = "checked_upb_proto", ++ #deps = [":checked_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "eval_upb_proto", ++ #deps = [":eval_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "explain_upb_proto", ++ #deps = [":explain_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "syntax_upb_proto", ++ #deps = [":syntax_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "value_upb_proto", ++ #deps = [":value_proto"], ++#) +diff --git google/rpc/BUILD.bazel google/rpc/BUILD.bazel +index 31fd6457d..c38f00c46 100644 +--- google/rpc/BUILD.bazel ++++ google/rpc/BUILD.bazel +@@ -11,7 +11,7 @@ load( + "php_proto_library", + "py_gapic_assembly_pkg", + "py_proto_library", +- "upb_c_proto_library", ++ #"upb_c_proto_library", + ) + load("@rules_proto//proto:defs.bzl", "proto_library") + +@@ -104,15 +104,15 @@ cc_proto_library( + deps = [":status_proto"], + ) + +-upb_c_proto_library( +- name = "code_upb_proto", +- deps = [":code_proto"], +-) ++#upb_c_proto_library( ++ #name = "code_upb_proto", ++ #deps = [":code_proto"], ++#) + +-upb_c_proto_library( +- name = "status_upb_proto", +- deps = [":status_proto"], +-) ++#upb_c_proto_library( ++ #name = "status_upb_proto", ++ #deps = [":status_proto"], ++#) + + py_proto_library( + name = "code_py_proto", +diff --git repository_rules.bzl repository_rules.bzl +index 2f87ad682..2ab3bd054 100644 +--- repository_rules.bzl ++++ repository_rules.bzl +@@ -224,11 +224,11 @@ def switched_rules_by_language( + # + # upb + # +- rules["upb_c_proto_library"] = _switch( +- upb, +- "@com_google_protobuf//bazel:upb_c_proto_library.bzl", +- "upb_c_proto_library", +- ) ++ #rules["upb_c_proto_library"] = _switch( ++ # upb, ++ # "@com_google_protobuf//bazel:upb_c_proto_library.bzl", ++ # "upb_c_proto_library", ++ #) + + # + # PHP diff --git a/google/cloud/pubsub/samples/BUILD.bazel b/google/cloud/pubsub/samples/BUILD.bazel index 7586994429215..e7c3be6bb688e 100644 --- a/google/cloud/pubsub/samples/BUILD.bazel +++ b/google/cloud/pubsub/samples/BUILD.bazel @@ -14,6 +14,8 @@ """Examples for the Cloud Pub/Sub C++ client library.""" +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") load(":pubsub_client_integration_samples.bzl", "pubsub_client_integration_samples") load(":pubsub_client_unit_samples.bzl", "pubsub_client_unit_samples") load(":pubsub_samples_common.bzl", "pubsub_samples_common_hdrs", "pubsub_samples_common_srcs") @@ -45,7 +47,7 @@ cc_library( "//:common", "//:pubsub", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in pubsub_samples_unit_tests] @@ -89,6 +91,6 @@ cc_proto_library( "//:pubsub", "//:pubsub_mocks", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in pubsub_client_unit_samples] diff --git a/google/cloud/pubsub/samples/blocking_samples.cc b/google/cloud/pubsub/samples/blocking_samples.cc index 597cccae7e3fa..6598c110774aa 100644 --- a/google/cloud/pubsub/samples/blocking_samples.cc +++ b/google/cloud/pubsub/samples/blocking_samples.cc @@ -14,6 +14,7 @@ #include "google/cloud/pubsub/admin/topic_admin_client.h" #include "google/cloud/pubsub/blocking_publisher.h" +#include "google/cloud/pubsub/options.h" #include "google/cloud/pubsub/samples/pubsub_samples_common.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/random.h" diff --git a/google/cloud/pubsub/samples/iam_samples.cc b/google/cloud/pubsub/samples/iam_samples.cc index 7f2f302813583..d51f5db13323d 100644 --- a/google/cloud/pubsub/samples/iam_samples.cc +++ b/google/cloud/pubsub/samples/iam_samples.cc @@ -12,9 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "google/cloud/iam/iam_policy_client.h" +#include "google/cloud/iam/v1/iam_policy_client.h" #include "google/cloud/pubsub/admin/subscription_admin_client.h" #include "google/cloud/pubsub/admin/topic_admin_client.h" +#include "google/cloud/pubsub/options.h" #include "google/cloud/pubsub/samples/pubsub_samples_common.h" #include "google/cloud/pubsub/subscription_builder.h" #include "google/cloud/internal/getenv.h" @@ -27,7 +28,7 @@ namespace { void GetTopicPolicy(std::vector const& argv) { // [START pubsub_get_topic_policy] - namespace iam = google::cloud::iam; + namespace iam = google::cloud::iam_v1; namespace pubsub = google::cloud::pubsub; [](std::string project_id, std::string topic_id) { auto const topic = @@ -48,7 +49,7 @@ void GetTopicPolicy(std::vector const& argv) { void SetTopicPolicy(std::vector const& argv) { // [START pubsub_set_topic_policy] - namespace iam = google::cloud::iam; + namespace iam = google::cloud::iam_v1; namespace pubsub = google::cloud::pubsub; using google::cloud::StatusCode; [](std::string project_id, std::string topic_id) { @@ -87,7 +88,7 @@ void SetTopicPolicy(std::vector const& argv) { void TestTopicPermissions(std::vector const& argv) { // [START pubsub_test_topic_permissions] - namespace iam = google::cloud::iam; + namespace iam = google::cloud::iam_v1; namespace pubsub = google::cloud::pubsub; [](std::string project_id, std::string topic_id) { auto const topic = @@ -113,7 +114,7 @@ void TestTopicPermissions(std::vector const& argv) { void GetSubscriptionPolicy(std::vector const& argv) { // [START pubsub_get_subscription_policy] - namespace iam = google::cloud::iam; + namespace iam = google::cloud::iam_v1; namespace pubsub = google::cloud::pubsub; [](std::string project_id, std::string subscription_id) { auto const subscription = @@ -134,7 +135,7 @@ void GetSubscriptionPolicy(std::vector const& argv) { void SetSubscriptionPolicy(std::vector const& argv) { // [START pubsub_set_subscription_policy] - namespace iam = google::cloud::iam; + namespace iam = google::cloud::iam_v1; namespace pubsub = google::cloud::pubsub; using google::cloud::StatusCode; [](std::string project_id, std::string subscription_id) { @@ -173,7 +174,7 @@ void SetSubscriptionPolicy(std::vector const& argv) { void TestSubscriptionPermissions(std::vector const& argv) { // [START pubsub_test_subscription_permissions] - namespace iam = google::cloud::iam; + namespace iam = google::cloud::iam_v1; namespace pubsub = google::cloud::pubsub; [](std::string project_id, std::string subscription_id) { auto const subscription = diff --git a/google/cloud/pubsub/samples/samples.cc b/google/cloud/pubsub/samples/samples.cc index 6b934ff630cc7..a71b29fd4b510 100644 --- a/google/cloud/pubsub/samples/samples.cc +++ b/google/cloud/pubsub/samples/samples.cc @@ -14,7 +14,9 @@ #include "google/cloud/pubsub/admin/subscription_admin_client.h" #include "google/cloud/pubsub/admin/topic_admin_client.h" +#include "google/cloud/pubsub/options.h" #include "google/cloud/pubsub/samples/pubsub_samples_common.h" +#include "google/cloud/pubsub/samples/testdata/schema.pb.h" #include "google/cloud/pubsub/schema.h" #include "google/cloud/pubsub/schema_client.h" #include "google/cloud/pubsub/subscriber.h" @@ -24,7 +26,6 @@ #include "google/cloud/project.h" #include "google/cloud/status.h" #include "google/cloud/testing_util/example_driver.h" -#include #include #include #include diff --git a/google/cloud/pubsub/samples/topic_admin_samples.cc b/google/cloud/pubsub/samples/topic_admin_samples.cc index 9ffd2b58c22c4..05c1ba7414927 100644 --- a/google/cloud/pubsub/samples/topic_admin_samples.cc +++ b/google/cloud/pubsub/samples/topic_admin_samples.cc @@ -23,7 +23,7 @@ #include "google/cloud/project.h" #include "google/cloud/testing_util/example_driver.h" #include "absl/strings/match.h" -#include +#include "google/protobuf/timestamp.pb.h" #include #include diff --git a/google/cloud/pubsub/schema_connection.h b/google/cloud/pubsub/schema_connection.h index 2e47406a0d49c..50bb541b42aa4 100644 --- a/google/cloud/pubsub/schema_connection.h +++ b/google/cloud/pubsub/schema_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/pubsub/v1/schema.pb.h" #include #include diff --git a/google/cloud/pubsub/schema_connection_idempotency_policy.h b/google/cloud/pubsub/schema_connection_idempotency_policy.h index d1b046d2b7acc..c94e4bcaa7c66 100644 --- a/google/cloud/pubsub/schema_connection_idempotency_policy.h +++ b/google/cloud/pubsub/schema_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/pubsub/v1/schema.grpc.pb.h" #include namespace google { diff --git a/google/cloud/pubsub/snapshot_builder.h b/google/cloud/pubsub/snapshot_builder.h index 58d89a36fcf34..5f7ef806212ec 100644 --- a/google/cloud/pubsub/snapshot_builder.h +++ b/google/cloud/pubsub/snapshot_builder.h @@ -19,8 +19,8 @@ #include "google/cloud/pubsub/subscription.h" #include "google/cloud/pubsub/version.h" #include "google/cloud/internal/time_utils.h" +#include "google/pubsub/v1/pubsub.pb.h" #include -#include #include #include diff --git a/google/cloud/pubsub/subscriber_connection.cc b/google/cloud/pubsub/subscriber_connection.cc index d542d35d57c5b..adec01bccc3ca 100644 --- a/google/cloud/pubsub/subscriber_connection.cc +++ b/google/cloud/pubsub/subscriber_connection.cc @@ -101,19 +101,6 @@ std::shared_ptr MakeSubscriberConnection( return MakeSubscriberConnection("", std::move(subscription), std::move(opts)); } -std::shared_ptr MakeSubscriberConnection( - Subscription subscription, SubscriberOptions options, - ConnectionOptions connection_options, - std::unique_ptr retry_policy, - std::unique_ptr backoff_policy) { - auto opts = internal::MergeOptions( - pubsub_internal::MakeOptions(std::move(options)), - internal::MakeOptions(std::move(connection_options))); - if (retry_policy) opts.set(retry_policy->clone()); - if (backoff_policy) opts.set(backoff_policy->clone()); - return MakeSubscriberConnection(std::move(subscription), std::move(opts)); -} - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub diff --git a/google/cloud/pubsub/subscriber_connection.h b/google/cloud/pubsub/subscriber_connection.h index febc729e7d77f..2a47071ee7f50 100644 --- a/google/cloud/pubsub/subscriber_connection.h +++ b/google/cloud/pubsub/subscriber_connection.h @@ -22,7 +22,6 @@ #include "google/cloud/pubsub/message.h" #include "google/cloud/pubsub/pull_response.h" #include "google/cloud/pubsub/retry_policy.h" -#include "google/cloud/pubsub/subscriber_options.h" #include "google/cloud/pubsub/subscription.h" #include "google/cloud/pubsub/version.h" #include "google/cloud/internal/non_constructible.h" @@ -144,49 +143,6 @@ std::shared_ptr MakeSubscriberConnection( std::shared_ptr MakeSubscriberConnection( Subscription subscription, Options opts = {}); -/** - * Creates a new `SubscriberConnection` object to work with `Subscriber`. - * - * The `SubscriberConnection` class is not intended for direct use in - * applications, it is provided for applications wanting to mock the - * `Subscriber` behavior in their tests. - * - * @par Performance - * Creating a new `SubscriberConnection` is relatively expensive. This typically - * initiates connections to the service, and therefore these objects should be - * shared and reused when possible. Note that gRPC reuses existing OS resources - * (sockets) whenever possible, so applications may experience better - * performance on the second (and subsequent) calls to this function with the - * identical values for @p options. However, this behavior is not guaranteed - * and applications should not rely on it. - * - * @see `SubscriberConnection` - * - * @par Changing Retry Parameters Example - * @snippet samples.cc subscriber-retry-settings - * - * @param subscription the Cloud Pub/Sub subscription used by the returned - * connection. - * @param options configure the flow control and other parameters in the - * returned connection. - * @param connection_options (optional) general configuration for this - * connection, this type is also used to configure `pubsub::Publisher`. - * @param retry_policy control for how long (or how many times) are retryable - * RPCs attempted. - * @param backoff_policy controls the backoff behavior between retry attempts, - * typically some form of exponential backoff with jitter. - * - * @deprecated Please use the `MakeSubscriberConnection` function which accepts - * `google::cloud::Options` instead. - */ -GOOGLE_CLOUD_CPP_DEPRECATED( - "use the overload consuming google::cloud::Options instead") -std::shared_ptr MakeSubscriberConnection( - Subscription subscription, SubscriberOptions options, - ConnectionOptions connection_options = {}, - std::unique_ptr retry_policy = {}, - std::unique_ptr backoff_policy = {}); - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub diff --git a/google/cloud/pubsub/subscriber_connection_test.cc b/google/cloud/pubsub/subscriber_connection_test.cc index 299e2afa72504..364b4a5431b77 100644 --- a/google/cloud/pubsub/subscriber_connection_test.cc +++ b/google/cloud/pubsub/subscriber_connection_test.cc @@ -164,7 +164,6 @@ TEST(SubscriberConnectionTest, MakeSubscriberConnectionSetupsMetadata) { ASSERT_STATUS_OK(response.get()); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::InstallSpanCatcher; @@ -271,8 +270,6 @@ TEST(MakeSubscriberConnectionTest, TracingDisabledForUnaryPull) { EXPECT_THAT(spans, IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsub diff --git a/google/cloud/pubsub/subscriber_options.cc b/google/cloud/pubsub/subscriber_options.cc deleted file mode 100644 index 099fcb4ef4555..0000000000000 --- a/google/cloud/pubsub/subscriber_options.cc +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/pubsub/subscriber_options.h" -#include "google/cloud/pubsub/internal/defaults.h" -#include - -namespace google { -namespace cloud { -namespace pubsub { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -using seconds = std::chrono::seconds; - -// Cannot delegate on `SubscriberOptions(Options)` as it is deprecated. -SubscriberOptions::SubscriberOptions() { - opts_ = pubsub_internal::DefaultSubscriberOptionsOnly(Options{}); -} - -SubscriberOptions::SubscriberOptions(Options opts) { - internal::CheckExpectedOptions(opts, __func__); - opts_ = pubsub_internal::DefaultSubscriberOptionsOnly(std::move(opts)); -} - -SubscriberOptions& SubscriberOptions::set_max_deadline_extension( - seconds extension) { - opts_.set( - (std::max)((std::min)(extension, seconds(600)), seconds(10))); - return *this; -} - -SubscriberOptions& SubscriberOptions::set_max_outstanding_messages( - std::int64_t message_count) { - opts_.set( - (std::max)(0, message_count)); - return *this; -} - -SubscriberOptions& SubscriberOptions::set_max_outstanding_bytes( - std::int64_t bytes) { - opts_.set((std::max)(0, bytes)); - return *this; -} - -SubscriberOptions& SubscriberOptions::set_max_concurrency(std::size_t v) { - opts_.set(v == 0 ? pubsub_internal::DefaultThreadCount() - : v); - return *this; -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace pubsub -} // namespace cloud -} // namespace google diff --git a/google/cloud/pubsub/subscriber_options.h b/google/cloud/pubsub/subscriber_options.h deleted file mode 100644 index 3251eb35a8015..0000000000000 --- a/google/cloud/pubsub/subscriber_options.h +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_PUBSUB_SUBSCRIBER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_SUBSCRIBER_OPTIONS_H - -#include "google/cloud/pubsub/options.h" -#include "google/cloud/pubsub/version.h" -#include "google/cloud/options.h" -#include -#include - -namespace google { -namespace cloud { -namespace pubsub { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -class SubscriberOptions; -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace pubsub - -namespace pubsub_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -Options MakeOptions(pubsub::SubscriberOptions); -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace pubsub_internal - -namespace pubsub { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * Configure how a `Subscriber` handles incoming messages. - * - * There are two main algorithms controlled by this function: the dispatching of - * application callbacks, and requesting more data from the service. - * - * @par Callback Concurrency Control - * @parblock - * The subscription configuration determines the upper limit (set - * `set_concurrency_watermarks()`) how many callbacks are *scheduled* at a time. - * As long as this limit is not reached the library will continue to schedule - * callbacks, once the limit is reached the library will wait until the number - * of executing callbacks goes below the low watermark. - * - * A callback is "executing" until the `AckHandler::ack()` or - * `AckHandler::nack()` function is called on the associated `AckHandler`. - * Applications can use this to move long-running computations out of the - * library internal thread pool. - * - * Note that callbacks are "scheduled", but they may not immediately execute. - * For example, callbacks may be sequenced if the concurrency control parameters - * are higher than the number of I/O threads configured in the - * `SubscriberConnection`. - * - * The default value for the concurrency high watermarks is set to the value - * returned by `std::thread::hardware_concurrency()` (or 4 if your standard - * library returns `0` for this parameter). - * @endparblock - * - * @par Message Flow Control - * @parblock - * The subscription will request more messages from the service as long as - * both the outstanding message count (see `set_message_count_watermarks()`) - * and the number of bytes in the outstanding messages (see - * `set_message_size_watermarks()`) are below the high watermarks for these - * values. - * - * Once either of the high watermarks are breached the library will wait until - * **both** the values are below their low watermarks before requesting more - * messages from the service. - * - * In this algorithm a message is outstanding until the `AckHandler::ack()` or - * `AckHandler::nack()` function is called on the associated `AckHandler`. Note - * that if the concurrency control algorithm has not scheduled a callback this - * can also put back pressure on the flow control algorithm. - * @endparblock - * - * @deprecated We recommend you use `google::cloud::Options` and pass any - * subscriber options to `MakeSubscriberConnection()`. - * - * @par Example: setting the concurrency control parameters - * @snippet samples.cc subscriber-concurrency - * - * @par Example: setting the flow control parameters - * @snippet samples.cc subscriber-flow-control - */ -class SubscriberOptions { - public: - /** - * Initialize the subscriber options with default values. - * - * @deprecated Use `google::cloud::Options` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED("Use `google::cloud::Options` instead") - SubscriberOptions(); - - /** - * Initialize the subscriber options. - * - * Expected options are any of the types in the `SubscriberOptionList` - * - * @note Unrecognized options will be ignored. To debug issues with options - * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment and - * unexpected options will be logged. - * - * @param opts configuration options - * - * @deprecated Use `google::cloud::Options` instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED("Use `google::cloud::Options` instead") - explicit SubscriberOptions(Options opts); - - /** - * The maximum deadline for each incoming message. - * - * Configure how long does the application have to respond (ACK or NACK) an - * incoming message. Note that this might be longer, or shorter, than the - * deadline configured in the server-side subscription. - * - * The value `0` is reserved to leave the deadline unmodified and just use the - * server-side configuration. - * - * @note The deadline applies to each message as it is delivered to the - * application, thus, if the library receives a batch of N messages their - * deadline for all the messages is extended repeatedly. Only once the - * message is delivered to a callback does the deadline become immutable. - * - * @deprecated Use `google::cloud::Options` and `MaxDeadlineTimeOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` and `MaxDeadlineTimeOption` instead") - std::chrono::seconds max_deadline_time() const { - return opts_.get(); - } - - /** - * Set the maximum deadline for incoming messages. - * - * @deprecated Use `google::cloud::Options` and `MaxDeadlineTimeOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` and `MaxDeadlineTimeOption` instead") - SubscriberOptions& set_max_deadline_time(std::chrono::seconds d) { - opts_.set(d); - return *this; - } - - /** - * Set the maximum time by which the deadline for each incoming message is - * extended. - * - * The Cloud Pub/Sub C++ client library will extend the deadline by at most - * this amount, while waiting for an ack or nack. The default extension is 10 - * minutes. An application may wish to reduce this extension so that the - * Pub/Sub service will resend a message sooner when it does not hear back - * from a Subscriber. - * - * The value is clamped between 10 seconds and 10 minutes. - * - * @param extension the maximum time that the deadline can be extended by, - * measured in seconds. - * - * @deprecated Use `google::cloud::Options` and `MaxDeadlineExtensionOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` and `MaxDeadlineExtensionOption` instead") - SubscriberOptions& set_max_deadline_extension(std::chrono::seconds extension); - - /// @deprecated Use `google::cloud::Options` and `MaxDeadlineExtensionOption` - /// instead. - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` and `MaxDeadlineExtensionOption` instead") - std::chrono::seconds max_deadline_extension() const { - return opts_.get(); - } - - /** - * Set the maximum number of outstanding messages per streaming pull. - * - * The Cloud Pub/Sub C++ client library uses streaming pull requests to - * receive messages from the service. The service will stop delivering - * messages if @p message_count or more messages have not been acknowledged - * nor rejected. - * - * @par Example - * @snippet samples.cc subscriber-flow-control - * - * @param message_count the maximum number of messages outstanding, use 0 or - * negative numbers to make the message count unlimited. - * - * @deprecated Use `google::cloud::Options` and `MaxOutstandingMessagesOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` and `MaxOutstandingMessagesOption` instead") - SubscriberOptions& set_max_outstanding_messages(std::int64_t message_count); - - /// @deprecated Use `google::cloud::Options` and - /// `MaxOutstandingMessagesOption` instead. - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` and `MaxOutstandingMessagesOption` instead") - std::int64_t max_outstanding_messages() const { - return opts_.get(); - } - - /** - * Set the maximum number of outstanding bytes per streaming pull. - * - * The Cloud Pub/Sub C++ client library uses streaming pull requests to - * receive messages from the service. The service will stop delivering - * messages if @p bytes or more worth of messages have not been - * acknowledged nor rejected. - * - * @par Example - * @snippet samples.cc subscriber-flow-control - * - * @param bytes the maximum number of bytes outstanding, use 0 or negative - * numbers to make the number of bytes unlimited. - * - * @deprecated Use `google::cloud::Options` and `MaxOutstandingBytesOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` and `MaxOutstandingBytesOption` instead") - SubscriberOptions& set_max_outstanding_bytes(std::int64_t bytes); - - /// @deprecated Use `google::cloud::Options` and `MaxOutstandingBytesOption` - /// instead. - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` and `MaxOutstandingBytesOption` instead") - std::int64_t max_outstanding_bytes() const { - return opts_.get(); - } - - /** - * Set the maximum callback concurrency. - * - * The Cloud Pub/Sub C++ client library will schedule parallel callbacks as - * long as the number of outstanding callbacks is less than this maximum. - * - * Note that this controls the number of callbacks *scheduled*, not the number - * of callbacks actually executing at a time. The application needs to create - * (or configure) the background threads pool with enough parallelism to - * execute more than one callback at a time. - * - * Some applications may want to share a thread pool across many - * subscriptions, the additional level of control (scheduled vs. running - * callbacks) allows applications, for example, to ensure that at most `K` - * threads in the pool are used by any given subscription. - * - * @par Example - * @snippet samples.cc subscriber-concurrency - * - * @param v the new value, 0 resets to the default - * - * @deprecated Use `google::cloud::Options` and `MaxConcurrencyOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` and `MaxConcurrencyOption` instead") - SubscriberOptions& set_max_concurrency(std::size_t v); - - /** - * Maximum number of callbacks scheduled by the library at a time. - * - * @deprecated Use `google::cloud::Options` and `MaxConcurrencyOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` and `MaxConcurrencyOption` instead") - std::size_t max_concurrency() const { - return opts_.get(); - } - - /** - * Control how often the session polls for automatic shutdowns. - * - * Applications can shutdown a session by calling `.cancel()` on the returned - * `future`. In addition, applications can fire & forget a session, - * which is only shutdown once the completion queue servicing the session - * shuts down. In this latter case the session polls periodically to detect - * if the CQ has shutdown. This controls how often this polling happens. - * - * @deprecated Use `google::cloud::Options` and `ShutdownPollingPeriodOption` - * instead. - */ - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` and `ShutdownPollingPeriodOption` instead") - SubscriberOptions& set_shutdown_polling_period(std::chrono::milliseconds v) { - opts_.set(v); - return *this; - } - - /// @deprecated Use `google::cloud::Options` and `ShutdownPollingPeriodOption` - /// instead. - GOOGLE_CLOUD_CPP_DEPRECATED( - "use `google::cloud::Options` and `ShutdownPollingPeriodOption` instead") - std::chrono::milliseconds shutdown_polling_period() const { - return opts_.get(); - } - - private: - friend Options pubsub_internal::MakeOptions(SubscriberOptions); - Options opts_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace pubsub - -namespace pubsub_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -inline Options MakeOptions(pubsub::SubscriberOptions o) { - return std::move(o.opts_); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace pubsub_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_SUBSCRIBER_OPTIONS_H diff --git a/google/cloud/pubsub/subscriber_options_test.cc b/google/cloud/pubsub/subscriber_options_test.cc deleted file mode 100644 index 6fe4065c62b80..0000000000000 --- a/google/cloud/pubsub/subscriber_options_test.cc +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/pubsub/subscriber_options.h" -#include "google/cloud/pubsub/options.h" -#include "google/cloud/grpc_options.h" -#include "google/cloud/testing_util/scoped_log.h" -// This file contains the tests for deprecated functions, we need to disable -// the warnings -#include "google/cloud/internal/disable_deprecation_warnings.inc" -#include -#include - -namespace google { -namespace cloud { -namespace pubsub { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -using std::chrono::seconds; -using ::testing::Contains; -using ::testing::HasSubstr; - -TEST(SubscriberOptionsTest, Default) { - SubscriberOptions const options{}; - EXPECT_EQ(seconds(600), options.max_deadline_extension()); - EXPECT_LT(0, options.max_outstanding_messages()); - EXPECT_LT(0, options.max_outstanding_bytes()); - EXPECT_LT(0, options.max_concurrency()); -} - -TEST(SubscriberOptionsTest, SetDeadlineExtension) { - auto options = SubscriberOptions{}.set_max_deadline_extension(seconds(60)); - EXPECT_EQ(seconds(60), options.max_deadline_extension()); - - options.set_max_deadline_extension(seconds(5)); - EXPECT_EQ(seconds(10), options.max_deadline_extension()); - - options.set_max_deadline_extension(seconds(1000)); - EXPECT_EQ(seconds(600), options.max_deadline_extension()); -} - -TEST(SubscriberOptionsTest, SetMessageCount) { - auto options = SubscriberOptions{}.set_max_outstanding_messages(16); - EXPECT_EQ(16, options.max_outstanding_messages()); - - options.set_max_outstanding_messages(-7); - EXPECT_EQ(0, options.max_outstanding_messages()); -} - -TEST(SubscriberOptionsTest, SetBytes) { - auto options = SubscriberOptions{}.set_max_outstanding_bytes(16 * 1024); - EXPECT_EQ(16 * 1024, options.max_outstanding_bytes()); - - options.set_max_outstanding_bytes(-7); - EXPECT_EQ(0, options.max_outstanding_bytes()); -} - -TEST(SubscriberOptionsTest, SetConcurrency) { - auto options = SubscriberOptions{}.set_max_concurrency(16); - EXPECT_EQ(16, options.max_concurrency()); - - // 0 resets to default - options.set_max_concurrency(0); - EXPECT_EQ(SubscriberOptions{}.max_concurrency(), options.max_concurrency()); -} - -TEST(SubscriberOptionsTest, OptionsConstructor) { - auto const options = - SubscriberOptions(Options{} - .set(seconds(2)) - .set(seconds(30)) - .set(4) - .set(5) - .set(6)); - - EXPECT_EQ(seconds(2), options.max_deadline_time()); - EXPECT_EQ(seconds(30), options.max_deadline_extension()); - EXPECT_EQ(4, options.max_outstanding_messages()); - EXPECT_EQ(5, options.max_outstanding_bytes()); - EXPECT_EQ(6, options.max_concurrency()); -} - -TEST(SubscriberOptionsTest, ExpectedOptionsCheck) { - struct NonOption { - using Type = bool; - }; - - testing_util::ScopedLog log; - auto options = SubscriberOptions(Options{}.set(true)); - EXPECT_THAT(log.ExtractLines(), Contains(HasSubstr("Unexpected option"))); -} - -TEST(SubscriberOptionsTest, MakeOptions) { - auto options = SubscriberOptions{} - .set_max_deadline_time(seconds(2)) - .set_max_deadline_extension(seconds(30)) - .set_max_outstanding_messages(4) - .set_max_outstanding_bytes(5) - .set_max_concurrency(6); - - auto opts = pubsub_internal::MakeOptions(std::move(options)); - EXPECT_EQ(seconds(2), opts.get()); - EXPECT_EQ(seconds(30), opts.get()); - EXPECT_EQ(4, opts.get()); - EXPECT_EQ(5, opts.get()); - EXPECT_EQ(6, opts.get()); - - // Ensure that we are not setting any extra options - EXPECT_FALSE(opts.has()); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace pubsub -} // namespace cloud -} // namespace google diff --git a/google/cloud/pubsub/subscription_admin_connection.h b/google/cloud/pubsub/subscription_admin_connection.h index cecb6d0d307b5..9db060f8ad607 100644 --- a/google/cloud/pubsub/subscription_admin_connection.h +++ b/google/cloud/pubsub/subscription_admin_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/internal/non_constructible.h" #include "google/cloud/internal/pagination_range.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" #include #include #include diff --git a/google/cloud/pubsub/subscription_builder.h b/google/cloud/pubsub/subscription_builder.h index 94d0372ac6a98..02f770fc352e9 100644 --- a/google/cloud/pubsub/subscription_builder.h +++ b/google/cloud/pubsub/subscription_builder.h @@ -19,8 +19,8 @@ #include "google/cloud/pubsub/topic.h" #include "google/cloud/pubsub/version.h" #include "google/cloud/internal/time_utils.h" +#include "google/pubsub/v1/pubsub.pb.h" #include -#include #include #include #include diff --git a/google/cloud/pubsub/topic_admin_connection.h b/google/cloud/pubsub/topic_admin_connection.h index 66eb32ed45cf5..8af93f5a57276 100644 --- a/google/cloud/pubsub/topic_admin_connection.h +++ b/google/cloud/pubsub/topic_admin_connection.h @@ -25,7 +25,7 @@ #include "google/cloud/internal/non_constructible.h" #include "google/cloud/internal/pagination_range.h" #include "google/cloud/status_or.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" #include #include diff --git a/google/cloud/pubsub/topic_builder.h b/google/cloud/pubsub/topic_builder.h index 3012b2bfd8d84..f84301cb05c08 100644 --- a/google/cloud/pubsub/topic_builder.h +++ b/google/cloud/pubsub/topic_builder.h @@ -19,7 +19,7 @@ #include "google/cloud/pubsub/topic.h" #include "google/cloud/pubsub/version.h" #include "google/cloud/internal/time_utils.h" -#include +#include "google/pubsub/v1/pubsub.pb.h" #include #include diff --git a/google/cloud/pubsub/version.h b/google/cloud/pubsub/version.h index e4eba43ee4fbb..a4c42144a5cd2 100644 --- a/google/cloud/pubsub/version.h +++ b/google/cloud/pubsub/version.h @@ -42,8 +42,6 @@ namespace cloud { namespace pubsub { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -// TODO(#7463) - remove backwards compatibility namespaces -namespace v1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace pubsub } // namespace cloud } // namespace google diff --git a/google/cloud/pubsublite/BUILD.bazel b/google/cloud/pubsublite/BUILD.bazel index c94f5eba9a76c..256629c9ba31f 100644 --- a/google/cloud/pubsublite/BUILD.bazel +++ b/google/cloud/pubsublite/BUILD.bazel @@ -36,7 +36,7 @@ cc_library( "//:common", "//:grpc_utils", "//:pubsub", - "@com_google_googleapis//google/cloud/pubsublite/v1:pubsublite_cc_grpc", + "@googleapis//google/cloud/pubsublite/v1:pubsublite_cc_grpc", ], ) @@ -54,7 +54,7 @@ cc_library( visibility = ["//:__pkg__"], deps = [ ":google_cloud_cpp_pubsublite", - "@com_google_googletest//:gtest", + "@googletest//:gtest", ], ) @@ -85,8 +85,8 @@ cc_library( "//:mocks", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_absl//absl/memory", - "@com_google_googletest//:gtest_main", + "@abseil-cpp//absl/memory", + "@googletest//:gtest_main", ], ) for test in pubsublite_unit_tests diff --git a/google/cloud/pubsublite/admin_client.h b/google/cloud/pubsublite/admin_client.h index 793efd20a1cc7..389a7cd26b566 100644 --- a/google/cloud/pubsublite/admin_client.h +++ b/google/cloud/pubsublite/admin_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -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/admin_connection.h b/google/cloud/pubsublite/admin_connection.h index fc6f2368329b8..e2a2d6ec19768 100644 --- a/google/cloud/pubsublite/admin_connection.h +++ b/google/cloud/pubsublite/admin_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/pubsublite/admin_connection_idempotency_policy.h" #include "google/cloud/pubsublite/internal/admin_retry_traits.h" +#include "google/cloud/pubsublite/v1/admin.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/pubsublite/admin_connection_idempotency_policy.h b/google/cloud/pubsublite/admin_connection_idempotency_policy.h index 1c1e89bdd0564..3c500a0416785 100644 --- a/google/cloud/pubsublite/admin_connection_idempotency_policy.h +++ b/google/cloud/pubsublite/admin_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_ADMIN_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/pubsublite/v1/admin.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/pubsublite/integration_tests/BUILD.bazel b/google/cloud/pubsublite/integration_tests/BUILD.bazel index dafc0b4bd8e8e..90d18e5b529c3 100644 --- a/google/cloud/pubsublite/integration_tests/BUILD.bazel +++ b/google/cloud/pubsublite/integration_tests/BUILD.bazel @@ -31,6 +31,6 @@ licenses(["notice"]) # Apache 2.0 "//google/cloud/pubsublite:pubsublite_testing", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in pubsublite_client_integration_tests] diff --git a/google/cloud/pubsublite/integration_tests/publisher_integration_test.cc b/google/cloud/pubsublite/integration_tests/publisher_integration_test.cc index b7450a01e4749..6aa02c03a0ad8 100644 --- a/google/cloud/pubsublite/integration_tests/publisher_integration_test.cc +++ b/google/cloud/pubsublite/integration_tests/publisher_integration_test.cc @@ -17,13 +17,13 @@ #include "google/cloud/pubsublite/endpoint.h" #include "google/cloud/pubsublite/options.h" #include "google/cloud/pubsublite/publisher_connection.h" +#include "google/cloud/pubsublite/v1/admin.pb.h" #include "google/cloud/internal/format_time_point.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/random.h" #include "google/cloud/testing_util/integration_test.h" #include "google/cloud/testing_util/status_matchers.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/pubsublite/internal/admin_auth_decorator.cc b/google/cloud/pubsublite/internal/admin_auth_decorator.cc index ac1cfcca47f98..44373c04ca9f5 100644 --- a/google/cloud/pubsublite/internal/admin_auth_decorator.cc +++ b/google/cloud/pubsublite/internal/admin_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/pubsublite/v1/admin.proto #include "google/cloud/pubsublite/internal/admin_auth_decorator.h" -#include +#include "google/cloud/pubsublite/v1/admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -311,3 +314,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/admin_auth_decorator.h b/google/cloud/pubsublite/internal/admin_auth_decorator.h index 9ec68596912e8..b67901f53be7d 100644 --- a/google/cloud/pubsublite/internal/admin_auth_decorator.h +++ b/google/cloud/pubsublite/internal/admin_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/pubsublite/internal/admin_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 pubsublite_internal { @@ -187,4 +190,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_ADMIN_AUTH_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/admin_connection_impl.h b/google/cloud/pubsublite/internal/admin_connection_impl.h index 657c951058693..4a7962a3551b6 100644 --- a/google/cloud/pubsublite/internal/admin_connection_impl.h +++ b/google/cloud/pubsublite/internal/admin_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/pubsublite/internal/admin_logging_decorator.cc b/google/cloud/pubsublite/internal/admin_logging_decorator.cc index 1cfe537c72f08..dfc622c6c6e66 100644 --- a/google/cloud/pubsublite/internal/admin_logging_decorator.cc +++ b/google/cloud/pubsublite/internal/admin_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/pubsublite/v1/admin.proto #include "google/cloud/pubsublite/internal/admin_logging_decorator.h" +#include "google/cloud/pubsublite/v1/admin.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -394,3 +397,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/admin_logging_decorator.h b/google/cloud/pubsublite/internal/admin_logging_decorator.h index aac919b33114e..e46e8ece08a42 100644 --- a/google/cloud/pubsublite/internal/admin_logging_decorator.h +++ b/google/cloud/pubsublite/internal/admin_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/pubsublite/internal/admin_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 pubsublite_internal { @@ -187,4 +190,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_ADMIN_LOGGING_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/admin_metadata_decorator.cc b/google/cloud/pubsublite/internal/admin_metadata_decorator.cc index c7ec2eb47bfb8..d6e98981f572e 100644 --- a/google/cloud/pubsublite/internal/admin_metadata_decorator.cc +++ b/google/cloud/pubsublite/internal/admin_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/pubsublite/v1/admin.proto #include "google/cloud/pubsublite/internal/admin_metadata_decorator.h" +#include "google/cloud/pubsublite/v1/admin.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 pubsublite_internal { @@ -312,3 +316,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/admin_metadata_decorator.h b/google/cloud/pubsublite/internal/admin_metadata_decorator.h index c965d959351b6..5f5f72a8d93e5 100644 --- a/google/cloud/pubsublite/internal/admin_metadata_decorator.h +++ b/google/cloud/pubsublite/internal/admin_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/pubsublite/internal/admin_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 pubsublite_internal { @@ -192,4 +195,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_ADMIN_METADATA_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/admin_option_defaults.cc b/google/cloud/pubsublite/internal/admin_option_defaults.cc index 51331b505754b..4839f67db3f36 100644 --- a/google/cloud/pubsublite/internal/admin_option_defaults.cc +++ b/google/cloud/pubsublite/internal/admin_option_defaults.cc @@ -40,7 +40,7 @@ Options AdminServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - pubsublite::AdminServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + pubsublite::AdminServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/pubsublite/internal/admin_stub.cc b/google/cloud/pubsublite/internal/admin_stub.cc index f7b4708f0e75a..796f9d05ac698 100644 --- a/google/cloud/pubsublite/internal/admin_stub.cc +++ b/google/cloud/pubsublite/internal/admin_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/pubsublite/v1/admin.proto #include "google/cloud/pubsublite/internal/admin_stub.h" +#include "google/cloud/pubsublite/v1/admin.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -386,3 +389,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/admin_stub.h b/google/cloud/pubsublite/internal/admin_stub.h index ffeeb74b5ace6..ebaabab8c099b 100644 --- a/google/cloud/pubsublite/internal/admin_stub.h +++ b/google/cloud/pubsublite/internal/admin_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_ADMIN_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_ADMIN_STUB_H +#include "google/cloud/pubsublite/v1/admin.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -342,4 +345,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_ADMIN_STUB_H diff --git a/google/cloud/pubsublite/internal/admin_stub_factory.cc b/google/cloud/pubsublite/internal/admin_stub_factory.cc index 00a3ff41c4620..c4d9fb26185e7 100644 --- a/google/cloud/pubsublite/internal/admin_stub_factory.cc +++ b/google/cloud/pubsublite/internal/admin_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/pubsublite/internal/admin_metadata_decorator.h" #include "google/cloud/pubsublite/internal/admin_stub.h" #include "google/cloud/pubsublite/internal/admin_tracing_stub.h" +#include "google/cloud/pubsublite/v1/admin.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/admin_stub_factory.h b/google/cloud/pubsublite/internal/admin_stub_factory.h index be32558c7f6fe..47b5a42b06255 100644 --- a/google/cloud/pubsublite/internal/admin_stub_factory.h +++ b/google/cloud/pubsublite/internal/admin_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_ADMIN_STUB_FACTORY_H diff --git a/google/cloud/pubsublite/internal/admin_tracing_connection.cc b/google/cloud/pubsublite/internal/admin_tracing_connection.cc index 4f134e1539bb7..64dae6780c3e0 100644 --- a/google/cloud/pubsublite/internal/admin_tracing_connection.cc +++ b/google/cloud/pubsublite/internal/admin_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AdminServiceTracingConnection::AdminServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -278,16 +276,12 @@ AdminServiceTracingConnection::AsyncGetTopicPartitions( child_->AsyncGetTopicPartitions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAdminServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/pubsublite/internal/admin_tracing_connection.h b/google/cloud/pubsublite/internal/admin_tracing_connection.h index a459352486601..e12790bacd5bb 100644 --- a/google/cloud/pubsublite/internal/admin_tracing_connection.h +++ b/google/cloud/pubsublite/internal/admin_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AdminServiceTracingConnection : public pubsublite::AdminServiceConnection { public: @@ -140,8 +138,6 @@ class AdminServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/pubsublite/internal/admin_tracing_stub.cc b/google/cloud/pubsublite/internal/admin_tracing_stub.cc index 2c551ef2ac81a..a59c7cefe9393 100644 --- a/google/cloud/pubsublite/internal/admin_tracing_stub.cc +++ b/google/cloud/pubsublite/internal/admin_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AdminServiceTracingStub::AdminServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -363,18 +364,14 @@ future AdminServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAdminServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/admin_tracing_stub.h b/google/cloud/pubsublite/internal/admin_tracing_stub.h index 8aff23408ae07..5a605a152fc0e 100644 --- a/google/cloud/pubsublite/internal/admin_tracing_stub.h +++ b/google/cloud/pubsublite/internal/admin_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AdminServiceTracingStub : public AdminServiceStub { public: ~AdminServiceTracingStub() override = default; @@ -182,8 +183,6 @@ class AdminServiceTracingStub : public AdminServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -198,4 +197,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_ADMIN_TRACING_STUB_H diff --git a/google/cloud/pubsublite/internal/cloud_zone.h b/google/cloud/pubsublite/internal/cloud_zone.h index 1c068d263d5fd..f22f38dcebe8d 100644 --- a/google/cloud/pubsublite/internal/cloud_zone.h +++ b/google/cloud/pubsublite/internal/cloud_zone.h @@ -16,9 +16,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_CLOUD_ZONE_H #include "google/cloud/pubsublite/internal/cloud_region.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_split.h" #include diff --git a/google/cloud/pubsublite/internal/cursor_auth_decorator.cc b/google/cloud/pubsublite/internal/cursor_auth_decorator.cc index 07730996513a1..d6f60bf41ab2f 100644 --- a/google/cloud/pubsublite/internal/cursor_auth_decorator.cc +++ b/google/cloud/pubsublite/internal/cursor_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/pubsublite/v1/cursor.proto #include "google/cloud/pubsublite/internal/cursor_auth_decorator.h" +#include "google/cloud/pubsublite/v1/cursor.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -106,3 +109,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/cursor_auth_decorator.h b/google/cloud/pubsublite/internal/cursor_auth_decorator.h index 5cff54556b4a3..2380308371db5 100644 --- a/google/cloud/pubsublite/internal/cursor_auth_decorator.h +++ b/google/cloud/pubsublite/internal/cursor_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -83,4 +86,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_CURSOR_AUTH_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/cursor_logging_decorator.cc b/google/cloud/pubsublite/internal/cursor_logging_decorator.cc index 4ffd50926baea..574c5592d7ad3 100644 --- a/google/cloud/pubsublite/internal/cursor_logging_decorator.cc +++ b/google/cloud/pubsublite/internal/cursor_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/pubsublite/v1/cursor.proto #include "google/cloud/pubsublite/internal/cursor_logging_decorator.h" +#include "google/cloud/pubsublite/v1/cursor.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -136,3 +139,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/cursor_logging_decorator.h b/google/cloud/pubsublite/internal/cursor_logging_decorator.h index 4ebedde431595..2ac2aab45034f 100644 --- a/google/cloud/pubsublite/internal/cursor_logging_decorator.h +++ b/google/cloud/pubsublite/internal/cursor_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -84,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_CURSOR_LOGGING_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/cursor_metadata_decorator.cc b/google/cloud/pubsublite/internal/cursor_metadata_decorator.cc index ff59399a219c5..b3fe60c77343f 100644 --- a/google/cloud/pubsublite/internal/cursor_metadata_decorator.cc +++ b/google/cloud/pubsublite/internal/cursor_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/pubsublite/v1/cursor.proto #include "google/cloud/pubsublite/internal/cursor_metadata_decorator.h" +#include "google/cloud/pubsublite/v1/cursor.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 pubsublite_internal { @@ -125,3 +129,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/cursor_metadata_decorator.h b/google/cloud/pubsublite/internal/cursor_metadata_decorator.h index 9247425a64c96..26d5965d8e4c4 100644 --- a/google/cloud/pubsublite/internal/cursor_metadata_decorator.h +++ b/google/cloud/pubsublite/internal/cursor_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -88,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_CURSOR_METADATA_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/cursor_stub.cc b/google/cloud/pubsublite/internal/cursor_stub.cc index 61e5792f44a7e..cf8e1e165a042 100644 --- a/google/cloud/pubsublite/internal/cursor_stub.cc +++ b/google/cloud/pubsublite/internal/cursor_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/pubsublite/v1/cursor.proto #include "google/cloud/pubsublite/internal/cursor_stub.h" +#include "google/cloud/pubsublite/v1/cursor.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -120,3 +123,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/cursor_stub.h b/google/cloud/pubsublite/internal/cursor_stub.h index e917aeb838370..2919d6c093e20 100644 --- a/google/cloud/pubsublite/internal/cursor_stub.h +++ b/google/cloud/pubsublite/internal/cursor_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_CURSOR_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_CURSOR_STUB_H +#include "google/cloud/pubsublite/v1/cursor.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -132,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_CURSOR_STUB_H diff --git a/google/cloud/pubsublite/internal/cursor_stub_factory.cc b/google/cloud/pubsublite/internal/cursor_stub_factory.cc index e0203c6e2fb7e..30ffa6d71ed3e 100644 --- a/google/cloud/pubsublite/internal/cursor_stub_factory.cc +++ b/google/cloud/pubsublite/internal/cursor_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/pubsublite/internal/cursor_metadata_decorator.h" #include "google/cloud/pubsublite/internal/cursor_stub.h" #include "google/cloud/pubsublite/internal/cursor_tracing_stub.h" +#include "google/cloud/pubsublite/v1/cursor.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/cursor_stub_factory.h b/google/cloud/pubsublite/internal/cursor_stub_factory.h index e2e262256130c..7831e0519560a 100644 --- a/google/cloud/pubsublite/internal/cursor_stub_factory.h +++ b/google/cloud/pubsublite/internal/cursor_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_CURSOR_STUB_FACTORY_H diff --git a/google/cloud/pubsublite/internal/cursor_tracing_stub.cc b/google/cloud/pubsublite/internal/cursor_tracing_stub.cc index 76d86726bdaee..bf1e2c3568479 100644 --- a/google/cloud/pubsublite/internal/cursor_tracing_stub.cc +++ b/google/cloud/pubsublite/internal/cursor_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CursorServiceTracingStub::CursorServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -120,18 +121,14 @@ Status CursorServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCursorServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/cursor_tracing_stub.h b/google/cloud/pubsublite/internal/cursor_tracing_stub.h index bb3862e6e28bf..fda258f1d67bc 100644 --- a/google/cloud/pubsublite/internal/cursor_tracing_stub.h +++ b/google/cloud/pubsublite/internal/cursor_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CursorServiceTracingStub : public CursorServiceStub { public: ~CursorServiceTracingStub() override = default; @@ -79,8 +80,6 @@ class CursorServiceTracingStub : public CursorServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -95,4 +94,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_CURSOR_TRACING_STUB_H diff --git a/google/cloud/pubsublite/internal/default_publish_message_transformer.h b/google/cloud/pubsublite/internal/default_publish_message_transformer.h index 9c2dc86a02868..22cf7424ff4f4 100644 --- a/google/cloud/pubsublite/internal/default_publish_message_transformer.h +++ b/google/cloud/pubsublite/internal/default_publish_message_transformer.h @@ -16,9 +16,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_DEFAULT_PUBLISH_MESSAGE_TRANSFORMER_H #include "google/cloud/pubsub/message.h" +#include "google/cloud/pubsublite/v1/common.pb.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include namespace google { namespace cloud { diff --git a/google/cloud/pubsublite/internal/default_publish_message_transformer_test.cc b/google/cloud/pubsublite/internal/default_publish_message_transformer_test.cc index 3416f9b67ef67..3587f52c0f840 100644 --- a/google/cloud/pubsublite/internal/default_publish_message_transformer_test.cc +++ b/google/cloud/pubsublite/internal/default_publish_message_transformer_test.cc @@ -16,7 +16,7 @@ #include "google/cloud/internal/base64_transforms.h" #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/status_matchers.h" -#include +#include "google/protobuf/timestamp.pb.h" #include namespace google { diff --git a/google/cloud/pubsublite/internal/location.h b/google/cloud/pubsublite/internal/location.h index ce2f331cf6779..0e47c86857982 100644 --- a/google/cloud/pubsublite/internal/location.h +++ b/google/cloud/pubsublite/internal/location.h @@ -17,9 +17,9 @@ #include "google/cloud/pubsublite/internal/cloud_region.h" #include "google/cloud/pubsublite/internal/cloud_zone.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" +#include "absl/strings/str_cat.h" #include "absl/types/variant.h" #include diff --git a/google/cloud/pubsublite/internal/multipartition_publisher.h b/google/cloud/pubsublite/internal/multipartition_publisher.h index ae9992a303ba7..ee19840dbc317 100644 --- a/google/cloud/pubsublite/internal/multipartition_publisher.h +++ b/google/cloud/pubsublite/internal/multipartition_publisher.h @@ -22,8 +22,8 @@ #include "google/cloud/pubsublite/internal/service_composite.h" #include "google/cloud/pubsublite/message_metadata.h" #include "google/cloud/pubsublite/topic.h" -#include -#include +#include "google/cloud/pubsublite/v1/admin.pb.h" +#include "google/cloud/pubsublite/v1/publisher.pb.h" #include #include #include diff --git a/google/cloud/pubsublite/internal/partition_assignment_auth_decorator.cc b/google/cloud/pubsublite/internal/partition_assignment_auth_decorator.cc index c4e4998701735..abc2490d049f7 100644 --- a/google/cloud/pubsublite/internal/partition_assignment_auth_decorator.cc +++ b/google/cloud/pubsublite/internal/partition_assignment_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/pubsublite/v1/subscriber.proto #include "google/cloud/pubsublite/internal/partition_assignment_auth_decorator.h" +#include "google/cloud/pubsublite/v1/subscriber.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -89,3 +92,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/partition_assignment_auth_decorator.h b/google/cloud/pubsublite/internal/partition_assignment_auth_decorator.h index abdd1f1e02301..d767b17e651f3 100644 --- a/google/cloud/pubsublite/internal/partition_assignment_auth_decorator.h +++ b/google/cloud/pubsublite/internal/partition_assignment_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -72,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PARTITION_ASSIGNMENT_AUTH_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/partition_assignment_logging_decorator.cc b/google/cloud/pubsublite/internal/partition_assignment_logging_decorator.cc index c5e9c077969cd..f24c03a8de8fb 100644 --- a/google/cloud/pubsublite/internal/partition_assignment_logging_decorator.cc +++ b/google/cloud/pubsublite/internal/partition_assignment_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/pubsublite/v1/subscriber.proto #include "google/cloud/pubsublite/internal/partition_assignment_logging_decorator.h" +#include "google/cloud/pubsublite/v1/subscriber.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -111,3 +114,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/partition_assignment_logging_decorator.h b/google/cloud/pubsublite/internal/partition_assignment_logging_decorator.h index e05793b6f5998..5fa2eb670ce32 100644 --- a/google/cloud/pubsublite/internal/partition_assignment_logging_decorator.h +++ b/google/cloud/pubsublite/internal/partition_assignment_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -74,4 +77,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PARTITION_ASSIGNMENT_LOGGING_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/partition_assignment_metadata_decorator.cc b/google/cloud/pubsublite/internal/partition_assignment_metadata_decorator.cc index c294407a4e0c4..0a8c3160e1af4 100644 --- a/google/cloud/pubsublite/internal/partition_assignment_metadata_decorator.cc +++ b/google/cloud/pubsublite/internal/partition_assignment_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/pubsublite/v1/subscriber.proto #include "google/cloud/pubsublite/internal/partition_assignment_metadata_decorator.h" +#include "google/cloud/pubsublite/v1/subscriber.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 pubsublite_internal { @@ -107,3 +111,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/partition_assignment_metadata_decorator.h b/google/cloud/pubsublite/internal/partition_assignment_metadata_decorator.h index d0e109fcac5b4..0719a0737225c 100644 --- a/google/cloud/pubsublite/internal/partition_assignment_metadata_decorator.h +++ b/google/cloud/pubsublite/internal/partition_assignment_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -79,4 +82,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PARTITION_ASSIGNMENT_METADATA_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/partition_assignment_stub.cc b/google/cloud/pubsublite/internal/partition_assignment_stub.cc index f35092434bb0b..8b3e218f3ce54 100644 --- a/google/cloud/pubsublite/internal/partition_assignment_stub.cc +++ b/google/cloud/pubsublite/internal/partition_assignment_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/pubsublite/v1/subscriber.proto #include "google/cloud/pubsublite/internal/partition_assignment_stub.h" +#include "google/cloud/pubsublite/v1/subscriber.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -97,3 +100,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/partition_assignment_stub.h b/google/cloud/pubsublite/internal/partition_assignment_stub.h index a5e9327a32d3a..23c307874dccf 100644 --- a/google/cloud/pubsublite/internal/partition_assignment_stub.h +++ b/google/cloud/pubsublite/internal/partition_assignment_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PARTITION_ASSIGNMENT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PARTITION_ASSIGNMENT_STUB_H +#include "google/cloud/pubsublite/v1/subscriber.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -111,4 +114,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PARTITION_ASSIGNMENT_STUB_H diff --git a/google/cloud/pubsublite/internal/partition_assignment_stub_factory.cc b/google/cloud/pubsublite/internal/partition_assignment_stub_factory.cc index aa0daac40d0de..55dd2c2f917e3 100644 --- a/google/cloud/pubsublite/internal/partition_assignment_stub_factory.cc +++ b/google/cloud/pubsublite/internal/partition_assignment_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/pubsublite/internal/partition_assignment_metadata_decorator.h" #include "google/cloud/pubsublite/internal/partition_assignment_stub.h" #include "google/cloud/pubsublite/internal/partition_assignment_tracing_stub.h" +#include "google/cloud/pubsublite/v1/subscriber.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/partition_assignment_stub_factory.h b/google/cloud/pubsublite/internal/partition_assignment_stub_factory.h index e62e438436b40..a9406a54868af 100644 --- a/google/cloud/pubsublite/internal/partition_assignment_stub_factory.h +++ b/google/cloud/pubsublite/internal/partition_assignment_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PARTITION_ASSIGNMENT_STUB_FACTORY_H diff --git a/google/cloud/pubsublite/internal/partition_assignment_tracing_stub.cc b/google/cloud/pubsublite/internal/partition_assignment_tracing_stub.cc index 6990d7b07d0c6..47e8e581d0768 100644 --- a/google/cloud/pubsublite/internal/partition_assignment_tracing_stub.cc +++ b/google/cloud/pubsublite/internal/partition_assignment_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PartitionAssignmentServiceTracingStub::PartitionAssignmentServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -100,20 +101,16 @@ Status PartitionAssignmentServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePartitionAssignmentServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/partition_assignment_tracing_stub.h b/google/cloud/pubsublite/internal/partition_assignment_tracing_stub.h index b2a2984c1d6fd..552c1ad86200a 100644 --- a/google/cloud/pubsublite/internal/partition_assignment_tracing_stub.h +++ b/google/cloud/pubsublite/internal/partition_assignment_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PartitionAssignmentServiceTracingStub : public PartitionAssignmentServiceStub { public: @@ -70,8 +71,6 @@ class PartitionAssignmentServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -87,4 +86,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PARTITION_ASSIGNMENT_TRACING_STUB_H diff --git a/google/cloud/pubsublite/internal/partition_publisher.cc b/google/cloud/pubsublite/internal/partition_publisher.cc index 663a99a19812d..c16fda3bc7d37 100644 --- a/google/cloud/pubsublite/internal/partition_publisher.cc +++ b/google/cloud/pubsublite/internal/partition_publisher.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/pubsublite/internal/partition_publisher.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/make_status.h" +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/pubsublite/internal/partition_publisher.h b/google/cloud/pubsublite/internal/partition_publisher.h index 961caf0eb53d9..cbdc0c1988578 100644 --- a/google/cloud/pubsublite/internal/partition_publisher.h +++ b/google/cloud/pubsublite/internal/partition_publisher.h @@ -20,8 +20,8 @@ #include "google/cloud/pubsublite/internal/publisher.h" #include "google/cloud/pubsublite/internal/resumable_async_streaming_read_write_rpc.h" #include "google/cloud/pubsublite/internal/service_composite.h" +#include "google/cloud/pubsublite/v1/publisher.pb.h" #include "absl/functional/function_ref.h" -#include #include #include diff --git a/google/cloud/pubsublite/internal/partition_publisher_test.cc b/google/cloud/pubsublite/internal/partition_publisher_test.cc index 691c37dbe17e8..faec1fc9444d1 100644 --- a/google/cloud/pubsublite/internal/partition_publisher_test.cc +++ b/google/cloud/pubsublite/internal/partition_publisher_test.cc @@ -17,11 +17,11 @@ #include "google/cloud/pubsublite/testing/mock_alarm_registry.h" #include "google/cloud/pubsublite/testing/mock_resumable_async_reader_writer_stream.h" #include "google/cloud/future.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/status_or.h" #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/status_matchers.h" #include "absl/memory/memory.h" +#include "absl/strings/str_cat.h" #include #include #include diff --git a/google/cloud/pubsublite/internal/publisher.h b/google/cloud/pubsublite/internal/publisher.h index d6989258d6672..d8e5055bf4b9e 100644 --- a/google/cloud/pubsublite/internal/publisher.h +++ b/google/cloud/pubsublite/internal/publisher.h @@ -16,9 +16,9 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PUBLISHER_H #include "google/cloud/pubsublite/internal/service.h" +#include "google/cloud/pubsublite/v1/common.pb.h" #include "google/cloud/future.h" #include "google/cloud/status_or.h" -#include namespace google { namespace cloud { diff --git a/google/cloud/pubsublite/internal/publisher_auth_decorator.cc b/google/cloud/pubsublite/internal/publisher_auth_decorator.cc index 676c6d6586fa1..0da6cc6ed7979 100644 --- a/google/cloud/pubsublite/internal/publisher_auth_decorator.cc +++ b/google/cloud/pubsublite/internal/publisher_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/pubsublite/v1/publisher.proto #include "google/cloud/pubsublite/internal/publisher_auth_decorator.h" +#include "google/cloud/pubsublite/v1/publisher.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -88,3 +91,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/publisher_auth_decorator.h b/google/cloud/pubsublite/internal/publisher_auth_decorator.h index 12101d22d7d5b..1781ffc58cbb9 100644 --- a/google/cloud/pubsublite/internal/publisher_auth_decorator.h +++ b/google/cloud/pubsublite/internal/publisher_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -71,4 +74,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PUBLISHER_AUTH_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/publisher_logging_decorator.cc b/google/cloud/pubsublite/internal/publisher_logging_decorator.cc index c87bb9e441abb..861bf6f483a37 100644 --- a/google/cloud/pubsublite/internal/publisher_logging_decorator.cc +++ b/google/cloud/pubsublite/internal/publisher_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/pubsublite/v1/publisher.proto #include "google/cloud/pubsublite/internal/publisher_logging_decorator.h" +#include "google/cloud/pubsublite/v1/publisher.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -110,3 +113,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/publisher_logging_decorator.h b/google/cloud/pubsublite/internal/publisher_logging_decorator.h index 4b7f074871f28..6d417bf68c087 100644 --- a/google/cloud/pubsublite/internal/publisher_logging_decorator.h +++ b/google/cloud/pubsublite/internal/publisher_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -72,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PUBLISHER_LOGGING_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/publisher_metadata_decorator.cc b/google/cloud/pubsublite/internal/publisher_metadata_decorator.cc index 90ff8c424f1d8..e00e5e8f7fdd9 100644 --- a/google/cloud/pubsublite/internal/publisher_metadata_decorator.cc +++ b/google/cloud/pubsublite/internal/publisher_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/pubsublite/v1/publisher.proto #include "google/cloud/pubsublite/internal/publisher_metadata_decorator.h" +#include "google/cloud/pubsublite/v1/publisher.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 pubsublite_internal { @@ -105,3 +109,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/publisher_metadata_decorator.h b/google/cloud/pubsublite/internal/publisher_metadata_decorator.h index 9880f423289ce..2ca1f977c561b 100644 --- a/google/cloud/pubsublite/internal/publisher_metadata_decorator.h +++ b/google/cloud/pubsublite/internal/publisher_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -77,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PUBLISHER_METADATA_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/publisher_stub.cc b/google/cloud/pubsublite/internal/publisher_stub.cc index 3c4b92a94286c..844c0ec2b8131 100644 --- a/google/cloud/pubsublite/internal/publisher_stub.cc +++ b/google/cloud/pubsublite/internal/publisher_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/pubsublite/v1/publisher.proto #include "google/cloud/pubsublite/internal/publisher_stub.h" +#include "google/cloud/pubsublite/v1/publisher.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -97,3 +100,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/publisher_stub.h b/google/cloud/pubsublite/internal/publisher_stub.h index a97b85cf74ef6..0a9594c9b591c 100644 --- a/google/cloud/pubsublite/internal/publisher_stub.h +++ b/google/cloud/pubsublite/internal/publisher_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PUBLISHER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PUBLISHER_STUB_H +#include "google/cloud/pubsublite/v1/publisher.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PUBLISHER_STUB_H diff --git a/google/cloud/pubsublite/internal/publisher_stub_factory.cc b/google/cloud/pubsublite/internal/publisher_stub_factory.cc index 8b3b80bcac587..2238cbab5a953 100644 --- a/google/cloud/pubsublite/internal/publisher_stub_factory.cc +++ b/google/cloud/pubsublite/internal/publisher_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/pubsublite/internal/publisher_metadata_decorator.h" #include "google/cloud/pubsublite/internal/publisher_stub.h" #include "google/cloud/pubsublite/internal/publisher_tracing_stub.h" +#include "google/cloud/pubsublite/v1/publisher.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/publisher_stub_factory.h b/google/cloud/pubsublite/internal/publisher_stub_factory.h index c678874d81318..e66aacc042d2a 100644 --- a/google/cloud/pubsublite/internal/publisher_stub_factory.h +++ b/google/cloud/pubsublite/internal/publisher_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PUBLISHER_STUB_FACTORY_H diff --git a/google/cloud/pubsublite/internal/publisher_tracing_stub.cc b/google/cloud/pubsublite/internal/publisher_tracing_stub.cc index 808ccb1705e24..41bcfe783c504 100644 --- a/google/cloud/pubsublite/internal/publisher_tracing_stub.cc +++ b/google/cloud/pubsublite/internal/publisher_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PublisherServiceTracingStub::PublisherServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -96,18 +97,14 @@ Status PublisherServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePublisherServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/publisher_tracing_stub.h b/google/cloud/pubsublite/internal/publisher_tracing_stub.h index 3785fc968a446..23e6234f21d2e 100644 --- a/google/cloud/pubsublite/internal/publisher_tracing_stub.h +++ b/google/cloud/pubsublite/internal/publisher_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PublisherServiceTracingStub : public PublisherServiceStub { public: ~PublisherServiceTracingStub() override = default; @@ -68,8 +69,6 @@ class PublisherServiceTracingStub : public PublisherServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -84,4 +83,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_PUBLISHER_TRACING_STUB_H diff --git a/google/cloud/pubsublite/internal/stream_factory.h b/google/cloud/pubsublite/internal/stream_factory.h index 8d0e7802dd867..56a2be40472c9 100644 --- a/google/cloud/pubsublite/internal/stream_factory.h +++ b/google/cloud/pubsublite/internal/stream_factory.h @@ -19,11 +19,11 @@ #include "google/cloud/pubsublite/internal/partition_assignment_stub.h" #include "google/cloud/pubsublite/internal/publisher_stub.h" #include "google/cloud/pubsublite/internal/subscriber_stub.h" +#include "google/cloud/pubsublite/v1/cursor.grpc.pb.h" +#include "google/cloud/pubsublite/v1/publisher.grpc.pb.h" +#include "google/cloud/pubsublite/v1/subscriber.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_impl.h" #include "google/cloud/version.h" -#include -#include -#include #include namespace google { diff --git a/google/cloud/pubsublite/internal/subscriber_auth_decorator.cc b/google/cloud/pubsublite/internal/subscriber_auth_decorator.cc index 52eba69d9ce42..dae06a8cdf297 100644 --- a/google/cloud/pubsublite/internal/subscriber_auth_decorator.cc +++ b/google/cloud/pubsublite/internal/subscriber_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/pubsublite/v1/subscriber.proto #include "google/cloud/pubsublite/internal/subscriber_auth_decorator.h" +#include "google/cloud/pubsublite/v1/subscriber.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -88,3 +91,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/subscriber_auth_decorator.h b/google/cloud/pubsublite/internal/subscriber_auth_decorator.h index 2a1d1183bce3f..78a15cf58080e 100644 --- a/google/cloud/pubsublite/internal/subscriber_auth_decorator.h +++ b/google/cloud/pubsublite/internal/subscriber_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -71,4 +74,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_SUBSCRIBER_AUTH_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/subscriber_logging_decorator.cc b/google/cloud/pubsublite/internal/subscriber_logging_decorator.cc index 136675dfd4695..e6e190a36025f 100644 --- a/google/cloud/pubsublite/internal/subscriber_logging_decorator.cc +++ b/google/cloud/pubsublite/internal/subscriber_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/pubsublite/v1/subscriber.proto #include "google/cloud/pubsublite/internal/subscriber_logging_decorator.h" +#include "google/cloud/pubsublite/v1/subscriber.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -110,3 +113,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/subscriber_logging_decorator.h b/google/cloud/pubsublite/internal/subscriber_logging_decorator.h index 2c866c3959a1e..d3b2f96ed4c0d 100644 --- a/google/cloud/pubsublite/internal/subscriber_logging_decorator.h +++ b/google/cloud/pubsublite/internal/subscriber_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -72,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_SUBSCRIBER_LOGGING_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/subscriber_metadata_decorator.cc b/google/cloud/pubsublite/internal/subscriber_metadata_decorator.cc index b7638ba07bb4b..474336aac0684 100644 --- a/google/cloud/pubsublite/internal/subscriber_metadata_decorator.cc +++ b/google/cloud/pubsublite/internal/subscriber_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/pubsublite/v1/subscriber.proto #include "google/cloud/pubsublite/internal/subscriber_metadata_decorator.h" +#include "google/cloud/pubsublite/v1/subscriber.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 pubsublite_internal { @@ -106,3 +110,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/subscriber_metadata_decorator.h b/google/cloud/pubsublite/internal/subscriber_metadata_decorator.h index 8bcfd49d23468..0728f8c6f5e73 100644 --- a/google/cloud/pubsublite/internal/subscriber_metadata_decorator.h +++ b/google/cloud/pubsublite/internal/subscriber_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -77,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_SUBSCRIBER_METADATA_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/subscriber_stub.cc b/google/cloud/pubsublite/internal/subscriber_stub.cc index 685c133b0deb9..9d0584fe7ffe6 100644 --- a/google/cloud/pubsublite/internal/subscriber_stub.cc +++ b/google/cloud/pubsublite/internal/subscriber_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/pubsublite/v1/subscriber.proto #include "google/cloud/pubsublite/internal/subscriber_stub.h" +#include "google/cloud/pubsublite/v1/subscriber.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -97,3 +100,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/subscriber_stub.h b/google/cloud/pubsublite/internal/subscriber_stub.h index eda8cb45b74e9..7b963115a1e88 100644 --- a/google/cloud/pubsublite/internal/subscriber_stub.h +++ b/google/cloud/pubsublite/internal/subscriber_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_SUBSCRIBER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_SUBSCRIBER_STUB_H +#include "google/cloud/pubsublite/v1/subscriber.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_SUBSCRIBER_STUB_H diff --git a/google/cloud/pubsublite/internal/subscriber_stub_factory.cc b/google/cloud/pubsublite/internal/subscriber_stub_factory.cc index bfc79126ca7f6..c0252795e7d6a 100644 --- a/google/cloud/pubsublite/internal/subscriber_stub_factory.cc +++ b/google/cloud/pubsublite/internal/subscriber_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/pubsublite/internal/subscriber_metadata_decorator.h" #include "google/cloud/pubsublite/internal/subscriber_stub.h" #include "google/cloud/pubsublite/internal/subscriber_tracing_stub.h" +#include "google/cloud/pubsublite/v1/subscriber.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/subscriber_stub_factory.h b/google/cloud/pubsublite/internal/subscriber_stub_factory.h index d03321711314b..1b809965eb81a 100644 --- a/google/cloud/pubsublite/internal/subscriber_stub_factory.h +++ b/google/cloud/pubsublite/internal/subscriber_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_SUBSCRIBER_STUB_FACTORY_H diff --git a/google/cloud/pubsublite/internal/subscriber_tracing_stub.cc b/google/cloud/pubsublite/internal/subscriber_tracing_stub.cc index 3d4822a3ea8c7..7a1de786cf43f 100644 --- a/google/cloud/pubsublite/internal/subscriber_tracing_stub.cc +++ b/google/cloud/pubsublite/internal/subscriber_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SubscriberServiceTracingStub::SubscriberServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -96,18 +97,14 @@ Status SubscriberServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSubscriberServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/subscriber_tracing_stub.h b/google/cloud/pubsublite/internal/subscriber_tracing_stub.h index 3f9b7c90fb203..9ebd277574329 100644 --- a/google/cloud/pubsublite/internal/subscriber_tracing_stub.h +++ b/google/cloud/pubsublite/internal/subscriber_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SubscriberServiceTracingStub : public SubscriberServiceStub { public: ~SubscriberServiceTracingStub() override = default; @@ -68,8 +69,6 @@ class SubscriberServiceTracingStub : public SubscriberServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -84,4 +83,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_SUBSCRIBER_TRACING_STUB_H diff --git a/google/cloud/pubsublite/internal/topic_stats_auth_decorator.cc b/google/cloud/pubsublite/internal/topic_stats_auth_decorator.cc index 84176ab705675..add459ecee6f4 100644 --- a/google/cloud/pubsublite/internal/topic_stats_auth_decorator.cc +++ b/google/cloud/pubsublite/internal/topic_stats_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/pubsublite/v1/topic_stats.proto #include "google/cloud/pubsublite/internal/topic_stats_auth_decorator.h" -#include +#include "google/cloud/pubsublite/v1/topic_stats.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -95,3 +98,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/topic_stats_auth_decorator.h b/google/cloud/pubsublite/internal/topic_stats_auth_decorator.h index 8eb92fdfce90a..e5f34e2b9cf79 100644 --- a/google/cloud/pubsublite/internal/topic_stats_auth_decorator.h +++ b/google/cloud/pubsublite/internal/topic_stats_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -82,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_TOPIC_STATS_AUTH_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/topic_stats_logging_decorator.cc b/google/cloud/pubsublite/internal/topic_stats_logging_decorator.cc index 8c5ffffaa7897..4dcbaad1ed6b3 100644 --- a/google/cloud/pubsublite/internal/topic_stats_logging_decorator.cc +++ b/google/cloud/pubsublite/internal/topic_stats_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/pubsublite/v1/topic_stats.proto #include "google/cloud/pubsublite/internal/topic_stats_logging_decorator.h" +#include "google/cloud/pubsublite/v1/topic_stats.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -123,3 +126,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/topic_stats_logging_decorator.h b/google/cloud/pubsublite/internal/topic_stats_logging_decorator.h index a435c7d5620c8..2ff76ca08c3f9 100644 --- a/google/cloud/pubsublite/internal/topic_stats_logging_decorator.h +++ b/google/cloud/pubsublite/internal/topic_stats_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -82,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_TOPIC_STATS_LOGGING_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/topic_stats_metadata_decorator.cc b/google/cloud/pubsublite/internal/topic_stats_metadata_decorator.cc index d5888c35d0966..761ee363097e9 100644 --- a/google/cloud/pubsublite/internal/topic_stats_metadata_decorator.cc +++ b/google/cloud/pubsublite/internal/topic_stats_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/pubsublite/v1/topic_stats.proto #include "google/cloud/pubsublite/internal/topic_stats_metadata_decorator.h" +#include "google/cloud/pubsublite/v1/topic_stats.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 pubsublite_internal { @@ -122,3 +126,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/topic_stats_metadata_decorator.h b/google/cloud/pubsublite/internal/topic_stats_metadata_decorator.h index c552e0529dda3..e3375d285e3ae 100644 --- a/google/cloud/pubsublite/internal/topic_stats_metadata_decorator.h +++ b/google/cloud/pubsublite/internal/topic_stats_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -88,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_TOPIC_STATS_METADATA_DECORATOR_H diff --git a/google/cloud/pubsublite/internal/topic_stats_option_defaults.cc b/google/cloud/pubsublite/internal/topic_stats_option_defaults.cc index 83e2dd9aac377..8324e110725c5 100644 --- a/google/cloud/pubsublite/internal/topic_stats_option_defaults.cc +++ b/google/cloud/pubsublite/internal/topic_stats_option_defaults.cc @@ -42,7 +42,7 @@ Options TopicStatsServiceDefaultOptions(Options options) { if (!options.has()) { options.set( pubsublite::TopicStatsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/pubsublite/internal/topic_stats_stub.cc b/google/cloud/pubsublite/internal/topic_stats_stub.cc index 35926bb67f968..536054bdb372a 100644 --- a/google/cloud/pubsublite/internal/topic_stats_stub.cc +++ b/google/cloud/pubsublite/internal/topic_stats_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/pubsublite/v1/topic_stats.proto #include "google/cloud/pubsublite/internal/topic_stats_stub.h" +#include "google/cloud/pubsublite/v1/topic_stats.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -116,3 +119,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/topic_stats_stub.h b/google/cloud/pubsublite/internal/topic_stats_stub.h index 0e396f2685937..185353cf56e03 100644 --- a/google/cloud/pubsublite/internal/topic_stats_stub.h +++ b/google/cloud/pubsublite/internal/topic_stats_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_TOPIC_STATS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_TOPIC_STATS_STUB_H +#include "google/cloud/pubsublite/v1/topic_stats.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_TOPIC_STATS_STUB_H diff --git a/google/cloud/pubsublite/internal/topic_stats_stub_factory.cc b/google/cloud/pubsublite/internal/topic_stats_stub_factory.cc index e2da9d34ed65c..1d58f5c994624 100644 --- a/google/cloud/pubsublite/internal/topic_stats_stub_factory.cc +++ b/google/cloud/pubsublite/internal/topic_stats_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/pubsublite/internal/topic_stats_metadata_decorator.h" #include "google/cloud/pubsublite/internal/topic_stats_stub.h" #include "google/cloud/pubsublite/internal/topic_stats_tracing_stub.h" +#include "google/cloud/pubsublite/v1/topic_stats.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/topic_stats_stub_factory.h b/google/cloud/pubsublite/internal/topic_stats_stub_factory.h index 36e6d40b4cbaa..428f502b70bf9 100644 --- a/google/cloud/pubsublite/internal/topic_stats_stub_factory.h +++ b/google/cloud/pubsublite/internal/topic_stats_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_TOPIC_STATS_STUB_FACTORY_H diff --git a/google/cloud/pubsublite/internal/topic_stats_tracing_connection.cc b/google/cloud/pubsublite/internal/topic_stats_tracing_connection.cc index 4bd64200e74df..66e72284cf5bd 100644 --- a/google/cloud/pubsublite/internal/topic_stats_tracing_connection.cc +++ b/google/cloud/pubsublite/internal/topic_stats_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TopicStatsServiceTracingConnection::TopicStatsServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -96,17 +94,13 @@ Status TopicStatsServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTopicStatsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/pubsublite/internal/topic_stats_tracing_connection.h b/google/cloud/pubsublite/internal/topic_stats_tracing_connection.h index e204b8f78c2ca..18e3764d58f54 100644 --- a/google/cloud/pubsublite/internal/topic_stats_tracing_connection.h +++ b/google/cloud/pubsublite/internal/topic_stats_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TopicStatsServiceTracingConnection : public pubsublite::TopicStatsServiceConnection { public: @@ -71,8 +69,6 @@ class TopicStatsServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/pubsublite/internal/topic_stats_tracing_stub.cc b/google/cloud/pubsublite/internal/topic_stats_tracing_stub.cc index 1d626905e8dd5..f1babc8234d65 100644 --- a/google/cloud/pubsublite/internal/topic_stats_tracing_stub.cc +++ b/google/cloud/pubsublite/internal/topic_stats_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TopicStatsServiceTracingStub::TopicStatsServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -114,18 +115,14 @@ Status TopicStatsServiceTracingStub::CancelOperation( child_->CancelOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTopicStatsServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace pubsublite_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/pubsublite/internal/topic_stats_tracing_stub.h b/google/cloud/pubsublite/internal/topic_stats_tracing_stub.h index cb3ddda33bbea..ee551d1cd6164 100644 --- a/google/cloud/pubsublite/internal/topic_stats_tracing_stub.h +++ b/google/cloud/pubsublite/internal/topic_stats_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace pubsublite_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TopicStatsServiceTracingStub : public TopicStatsServiceStub { public: ~TopicStatsServiceTracingStub() override = default; @@ -79,8 +80,6 @@ class TopicStatsServiceTracingStub : public TopicStatsServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -95,4 +94,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_INTERNAL_TOPIC_STATS_TRACING_STUB_H diff --git a/google/cloud/pubsublite/message_metadata.h b/google/cloud/pubsublite/message_metadata.h index 526a7e8f1b403..0b0a99b96112e 100644 --- a/google/cloud/pubsublite/message_metadata.h +++ b/google/cloud/pubsublite/message_metadata.h @@ -15,12 +15,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_MESSAGE_METADATA_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_MESSAGE_METADATA_H -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "google/cloud/pubsublite/v1/publisher.pb.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" #include "absl/strings/numbers.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_split.h" -#include #include namespace google { diff --git a/google/cloud/pubsublite/options.h b/google/cloud/pubsublite/options.h index 174313fcabf4a..ead105c593564 100644 --- a/google/cloud/pubsublite/options.h +++ b/google/cloud/pubsublite/options.h @@ -17,9 +17,9 @@ #include "google/cloud/pubsub/message.h" #include "google/cloud/pubsublite/internal/resumable_async_streaming_read_write_rpc.h" +#include "google/cloud/pubsublite/v1/common.pb.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/pubsublite/publisher_connection.cc b/google/cloud/pubsublite/publisher_connection.cc index d4fc765793959..6fe5b990d977a 100644 --- a/google/cloud/pubsublite/publisher_connection.cc +++ b/google/cloud/pubsublite/publisher_connection.cc @@ -31,7 +31,7 @@ #include "google/cloud/internal/base64_transforms.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/unified_grpc_credentials.h" -#include +#include "google/protobuf/struct.pb.h" #include namespace google { diff --git a/google/cloud/pubsublite/quickstart/.bazelrc b/google/cloud/pubsublite/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/pubsublite/quickstart/.bazelrc +++ b/google/cloud/pubsublite/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/pubsublite/quickstart/CMakeLists.txt index 07f706541a18d..81eebb6df8089 100644 --- a/google/cloud/pubsublite/quickstart/CMakeLists.txt +++ b/google/cloud/pubsublite/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Pub/Sub Lite API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-pubsublite-quickstart CXX) find_package(google_cloud_cpp_pubsublite REQUIRED) diff --git a/google/cloud/pubsublite/quickstart/WORKSPACE.bazel b/google/cloud/pubsublite/quickstart/WORKSPACE.bazel index 0dce2ca80ebf9..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 = "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/pubsublite/topic.h b/google/cloud/pubsublite/topic.h index 987be85888520..c62a637620f68 100644 --- a/google/cloud/pubsublite/topic.h +++ b/google/cloud/pubsublite/topic.h @@ -15,9 +15,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_TOPIC_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_TOPIC_H -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/location.h" #include "google/cloud/version.h" +#include "absl/strings/str_cat.h" #include namespace google { 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/pubsublite/topic_stats_connection.h b/google/cloud/pubsublite/topic_stats_connection.h index f2fe7dcdae23f..91992be2ca4fa 100644 --- a/google/cloud/pubsublite/topic_stats_connection.h +++ b/google/cloud/pubsublite/topic_stats_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/pubsublite/internal/topic_stats_retry_traits.h" #include "google/cloud/pubsublite/topic_stats_connection_idempotency_policy.h" +#include "google/cloud/pubsublite/v1/topic_stats.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 #include namespace google { diff --git a/google/cloud/pubsublite/topic_stats_connection_idempotency_policy.h b/google/cloud/pubsublite/topic_stats_connection_idempotency_policy.h index cf2a6c85c662d..7e7a0e07686d4 100644 --- a/google/cloud/pubsublite/topic_stats_connection_idempotency_policy.h +++ b/google/cloud/pubsublite/topic_stats_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_TOPIC_STATS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUBLITE_TOPIC_STATS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/pubsublite/v1/topic_stats.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/pubsublite/topic_test.cc b/google/cloud/pubsublite/topic_test.cc index 1145dbab55c71..7d129236ab266 100644 --- a/google/cloud/pubsublite/topic_test.cc +++ b/google/cloud/pubsublite/topic_test.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/pubsublite/topic.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/testing_util/status_matchers.h" +#include "absl/strings/str_join.h" #include #include diff --git a/google/cloud/rapidmigrationassessment/BUILD.bazel b/google/cloud/rapidmigrationassessment/BUILD.bazel index 272cc97984cae..957245706d7a2 100644 --- a/google/cloud/rapidmigrationassessment/BUILD.bazel +++ b/google/cloud/rapidmigrationassessment/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/rapidmigrationassessment/v1:rapidmigrationassessment_cc_grpc", + "@googleapis//google/cloud/rapidmigrationassessment/v1:rapidmigrationassessment_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/rapidmigrationassessment/quickstart/.bazelrc b/google/cloud/rapidmigrationassessment/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/rapidmigrationassessment/quickstart/.bazelrc +++ b/google/cloud/rapidmigrationassessment/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/rapidmigrationassessment/quickstart/CMakeLists.txt index 659e315b5c70c..985e2e1f836e6 100644 --- a/google/cloud/rapidmigrationassessment/quickstart/CMakeLists.txt +++ b/google/cloud/rapidmigrationassessment/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Rapid Migration Assessment API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-rapidmigrationassessment-quickstart CXX) find_package(google_cloud_cpp_rapidmigrationassessment REQUIRED) diff --git a/google/cloud/rapidmigrationassessment/quickstart/WORKSPACE.bazel b/google/cloud/rapidmigrationassessment/quickstart/WORKSPACE.bazel index f9afaa5ac43b3..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 = "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/rapidmigrationassessment/v1/internal/rapid_migration_assessment_auth_decorator.cc b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_auth_decorator.cc index 4f42d6be52276..61785580b09e8 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_auth_decorator.cc +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_auth_decorator.cc @@ -18,10 +18,13 @@ // google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto #include "google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_auth_decorator.h" -#include +#include "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace rapidmigrationassessment_v1_internal { @@ -371,3 +374,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rapidmigrationassessment_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_auth_decorator.h b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_auth_decorator.h index 7f21f099e3aef..864d684ca6df5 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_auth_decorator.h +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_auth_decorator.h @@ -23,11 +23,14 @@ #include "google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 rapidmigrationassessment_v1_internal { @@ -187,4 +190,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RAPIDMIGRATIONASSESSMENT_V1_INTERNAL_RAPID_MIGRATION_ASSESSMENT_AUTH_DECORATOR_H diff --git a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_connection_impl.h b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_connection_impl.h index 93b4aac53ccfa..e4ec852208cc5 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_connection_impl.h +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_connection_impl.h @@ -33,7 +33,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_logging_decorator.cc b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_logging_decorator.cc index 79dd5d13f9f6a..1e0609dd83357 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_logging_decorator.cc +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_logging_decorator.cc @@ -18,14 +18,17 @@ // google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto #include "google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_logging_decorator.h" +#include "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace rapidmigrationassessment_v1_internal { @@ -425,3 +428,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rapidmigrationassessment_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_logging_decorator.h b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_logging_decorator.h index 2c0fc153d3fc9..d683b97fd8044 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_logging_decorator.h +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_logging_decorator.h @@ -23,11 +23,14 @@ #include "google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 rapidmigrationassessment_v1_internal { @@ -187,4 +190,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RAPIDMIGRATIONASSESSMENT_V1_INTERNAL_RAPID_MIGRATION_ASSESSMENT_LOGGING_DECORATOR_H diff --git a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_metadata_decorator.cc b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_metadata_decorator.cc index b80e56b1a0561..dfb545ca5ea45 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_metadata_decorator.cc +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_metadata_decorator.cc @@ -18,17 +18,21 @@ // google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto #include "google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_metadata_decorator.h" +#include "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 rapidmigrationassessment_v1_internal { @@ -330,3 +334,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rapidmigrationassessment_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_metadata_decorator.h b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_metadata_decorator.h index a03d74f2e46c4..1f7e5c1602ac6 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_metadata_decorator.h +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_metadata_decorator.h @@ -23,11 +23,14 @@ #include "google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 rapidmigrationassessment_v1_internal { @@ -193,4 +196,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RAPIDMIGRATIONASSESSMENT_V1_INTERNAL_RAPID_MIGRATION_ASSESSMENT_METADATA_DECORATOR_H diff --git a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_option_defaults.cc b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_option_defaults.cc index dfad9a7fef4a6..edd5c2502b64c 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_option_defaults.cc +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_option_defaults.cc @@ -47,7 +47,7 @@ Options RapidMigrationAssessmentDefaultOptions(Options options) { rapidmigrationassessment_v1::RapidMigrationAssessmentRetryPolicyOption>( rapidmigrationassessment_v1:: RapidMigrationAssessmentLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace rapidmigrationassessment_v1_internal { @@ -415,3 +418,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rapidmigrationassessment_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub.h b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub.h index 63908d1d969a7..7bc9dfd97e5c0 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub.h +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub.h @@ -20,17 +20,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RAPIDMIGRATIONASSESSMENT_V1_INTERNAL_RAPID_MIGRATION_ASSESSMENT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RAPIDMIGRATIONASSESSMENT_V1_INTERNAL_RAPID_MIGRATION_ASSESSMENT_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace rapidmigrationassessment_v1_internal { @@ -348,4 +351,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RAPIDMIGRATIONASSESSMENT_V1_INTERNAL_RAPID_MIGRATION_ASSESSMENT_STUB_H diff --git a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub_factory.cc b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub_factory.cc index 414e9038db512..ecddd76acbdf0 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub_factory.cc +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub_factory.cc @@ -18,23 +18,26 @@ // google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto #include "google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_auth_decorator.h" #include "google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_logging_decorator.h" #include "google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_metadata_decorator.h" #include "google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub.h" #include "google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_stub.h" +#include "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace rapidmigrationassessment_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rapidmigrationassessment_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub_factory.h b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub_factory.h index 553cf1405d351..15c15a310971b 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub_factory.h +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_stub_factory.h @@ -26,6 +26,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace rapidmigrationassessment_v1_internal { @@ -41,4 +44,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RAPIDMIGRATIONASSESSMENT_V1_INTERNAL_RAPID_MIGRATION_ASSESSMENT_STUB_FACTORY_H diff --git a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_connection.cc b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_connection.cc index c440ff1686cfd..76445eea4871f 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_connection.cc +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace rapidmigrationassessment_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RapidMigrationAssessmentTracingConnection:: RapidMigrationAssessmentTracingConnection( std::shared_ptr< @@ -375,19 +373,15 @@ Status RapidMigrationAssessmentTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRapidMigrationAssessmentTracingConnection( std::shared_ptr< rapidmigrationassessment_v1::RapidMigrationAssessmentConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_connection.h b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_connection.h index d8814e5fc6b91..f3336c284a1c6 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_connection.h +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace rapidmigrationassessment_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RapidMigrationAssessmentTracingConnection : public rapidmigrationassessment_v1::RapidMigrationAssessmentConnection { public: @@ -168,8 +166,6 @@ class RapidMigrationAssessmentTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_stub.cc b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_stub.cc index 6ff09400c296d..552ec510a6af2 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_stub.cc +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace rapidmigrationassessment_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RapidMigrationAssessmentTracingStub::RapidMigrationAssessmentTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -396,19 +397,15 @@ future RapidMigrationAssessmentTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRapidMigrationAssessmentTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rapidmigrationassessment_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_stub.h b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_stub.h index 299040b0b5459..ae513bdb45642 100644 --- a/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_stub.h +++ b/google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_tracing_stub.h @@ -26,13 +26,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace rapidmigrationassessment_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RapidMigrationAssessmentTracingStub : public RapidMigrationAssessmentStub { public: @@ -184,8 +185,6 @@ class RapidMigrationAssessmentTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -201,4 +200,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RAPIDMIGRATIONASSESSMENT_V1_INTERNAL_RAPID_MIGRATION_ASSESSMENT_TRACING_STUB_H diff --git a/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_client.h b/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_client.h index c54ab940e8e4a..2b7741b4271e9 100644 --- a/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_client.h +++ b/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_client.h @@ -27,7 +27,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/rapidmigrationassessment/v1/rapid_migration_assessment_connection.h b/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_connection.h index 64b1ce9a55302..f52a188c066a9 100644 --- a/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_connection.h +++ b/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_connection.h @@ -22,6 +22,7 @@ #include "google/cloud/rapidmigrationassessment/v1/internal/rapid_migration_assessment_retry_traits.h" #include "google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_connection_idempotency_policy.h" +#include "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -31,8 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_connection_idempotency_policy.h b/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_connection_idempotency_policy.h index 72ab20f636621..d26a50efae62e 100644 --- a/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_connection_idempotency_policy.h +++ b/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_connection_idempotency_policy.h @@ -20,11 +20,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RAPIDMIGRATIONASSESSMENT_V1_RAPID_MIGRATION_ASSESSMENT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RAPIDMIGRATIONASSESSMENT_V1_RAPID_MIGRATION_ASSESSMENT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/recaptchaenterprise/BUILD.bazel b/google/cloud/recaptchaenterprise/BUILD.bazel index 913d928a06f8c..e9a02ffd98313 100644 --- a/google/cloud/recaptchaenterprise/BUILD.bazel +++ b/google/cloud/recaptchaenterprise/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/recaptchaenterprise/v1:recaptchaenterprise_cc_grpc", + "@googleapis//google/cloud/recaptchaenterprise/v1:recaptchaenterprise_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/recaptchaenterprise/quickstart/.bazelrc b/google/cloud/recaptchaenterprise/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/recaptchaenterprise/quickstart/.bazelrc +++ b/google/cloud/recaptchaenterprise/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/recaptchaenterprise/quickstart/CMakeLists.txt index 56a117d21dd96..4f3f51d2db33a 100644 --- a/google/cloud/recaptchaenterprise/quickstart/CMakeLists.txt +++ b/google/cloud/recaptchaenterprise/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the reCAPTCHA Enterprise API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-recaptchaenterprise-quickstart CXX) find_package(google_cloud_cpp_recaptchaenterprise REQUIRED) diff --git a/google/cloud/recaptchaenterprise/quickstart/WORKSPACE.bazel b/google/cloud/recaptchaenterprise/quickstart/WORKSPACE.bazel index 4c75f56be1a10..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 = "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/recaptchaenterprise/v1/internal/recaptcha_enterprise_auth_decorator.cc b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_auth_decorator.cc index 63e830e3fc26f..75394389139af 100644 --- a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_auth_decorator.cc +++ b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto #include "google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_auth_decorator.h" -#include +#include "google/cloud/recaptchaenterprise/v1/recaptchaenterprise.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recaptchaenterprise_v1_internal { @@ -252,3 +255,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace recaptchaenterprise_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_auth_decorator.h b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_auth_decorator.h index 0477f6c4012af..c8a515a9fab5d 100644 --- a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_auth_decorator.h +++ b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recaptchaenterprise_v1_internal { @@ -176,4 +179,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECAPTCHAENTERPRISE_V1_INTERNAL_RECAPTCHA_ENTERPRISE_AUTH_DECORATOR_H diff --git a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_logging_decorator.cc b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_logging_decorator.cc index 4bf9e962be7b5..e3e92c2b2b949 100644 --- a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_logging_decorator.cc +++ b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto #include "google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_logging_decorator.h" +#include "google/cloud/recaptchaenterprise/v1/recaptchaenterprise.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recaptchaenterprise_v1_internal { @@ -346,3 +349,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace recaptchaenterprise_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_logging_decorator.h b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_logging_decorator.h index 934bcb7bfb592..135524f6a7250 100644 --- a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_logging_decorator.h +++ b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recaptchaenterprise_v1_internal { @@ -177,4 +180,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECAPTCHAENTERPRISE_V1_INTERNAL_RECAPTCHA_ENTERPRISE_LOGGING_DECORATOR_H diff --git a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_metadata_decorator.cc b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_metadata_decorator.cc index 3c7f691db11df..8e8cb22334fd7 100644 --- a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_metadata_decorator.cc +++ b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto #include "google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_metadata_decorator.h" +#include "google/cloud/recaptchaenterprise/v1/recaptchaenterprise.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 recaptchaenterprise_v1_internal { @@ -281,3 +285,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace recaptchaenterprise_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_metadata_decorator.h b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_metadata_decorator.h index 420ca2c10ad24..ae493ec624719 100644 --- a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_metadata_decorator.h +++ b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recaptchaenterprise_v1_internal { @@ -183,4 +186,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECAPTCHAENTERPRISE_V1_INTERNAL_RECAPTCHA_ENTERPRISE_METADATA_DECORATOR_H diff --git a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_option_defaults.cc b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_option_defaults.cc index 3902370c097d2..3aa71882f7619 100644 --- a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_option_defaults.cc +++ b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_option_defaults.cc @@ -46,7 +46,7 @@ Options RecaptchaEnterpriseServiceDefaultOptions(Options options) { recaptchaenterprise_v1::RecaptchaEnterpriseServiceRetryPolicyOption>( recaptchaenterprise_v1:: RecaptchaEnterpriseServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recaptchaenterprise_v1_internal { @@ -326,3 +329,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace recaptchaenterprise_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_stub.h b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_stub.h index 1c4372c315a56..18530c4940d0d 100644 --- a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_stub.h +++ b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECAPTCHAENTERPRISE_V1_INTERNAL_RECAPTCHA_ENTERPRISE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECAPTCHAENTERPRISE_V1_INTERNAL_RECAPTCHA_ENTERPRISE_STUB_H +#include "google/cloud/recaptchaenterprise/v1/recaptchaenterprise.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recaptchaenterprise_v1_internal { @@ -317,4 +320,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECAPTCHAENTERPRISE_V1_INTERNAL_RECAPTCHA_ENTERPRISE_STUB_H diff --git a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_stub_factory.cc b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_stub_factory.cc index 7d63fc5a4de36..e8f3a4e3b977d 100644 --- a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_stub_factory.cc +++ b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_metadata_decorator.h" #include "google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_stub.h" #include "google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_stub.h" +#include "google/cloud/recaptchaenterprise/v1/recaptchaenterprise.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recaptchaenterprise_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace recaptchaenterprise_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_stub_factory.h b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_stub_factory.h index a8a0bf2b920d3..7a7dbca4b4ad3 100644 --- a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_stub_factory.h +++ b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recaptchaenterprise_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECAPTCHAENTERPRISE_V1_INTERNAL_RECAPTCHA_ENTERPRISE_STUB_FACTORY_H diff --git a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_connection.cc b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_connection.cc index 737ed0ce1083b..8820f8b4c0067 100644 --- a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_connection.cc +++ b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace recaptchaenterprise_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RecaptchaEnterpriseServiceTracingConnection:: RecaptchaEnterpriseServiceTracingConnection( std::shared_ptr< @@ -289,19 +287,15 @@ RecaptchaEnterpriseServiceTracingConnection:: std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRecaptchaEnterpriseServiceTracingConnection( std::shared_ptr< recaptchaenterprise_v1::RecaptchaEnterpriseServiceConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_connection.h b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_connection.h index 5a14bea9087b9..a566a317cd4f4 100644 --- a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_connection.h +++ b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace recaptchaenterprise_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RecaptchaEnterpriseServiceTracingConnection : public recaptchaenterprise_v1::RecaptchaEnterpriseServiceConnection { public: @@ -150,8 +148,6 @@ class RecaptchaEnterpriseServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_stub.cc b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_stub.cc index ebb1c69b7aa56..5b06b89a3b34b 100644 --- a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_stub.cc +++ b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recaptchaenterprise_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RecaptchaEnterpriseServiceTracingStub::RecaptchaEnterpriseServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -341,20 +342,16 @@ RecaptchaEnterpriseServiceTracingStub::SearchRelatedAccountGroupMemberships( child_->SearchRelatedAccountGroupMemberships(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRecaptchaEnterpriseServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace recaptchaenterprise_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_stub.h b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_stub.h index 4e8b94fc4c68d..e87cb7bf31cc1 100644 --- a/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_stub.h +++ b/google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recaptchaenterprise_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RecaptchaEnterpriseServiceTracingStub : public RecaptchaEnterpriseServiceStub { public: @@ -174,8 +175,6 @@ class RecaptchaEnterpriseServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -191,4 +190,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECAPTCHAENTERPRISE_V1_INTERNAL_RECAPTCHA_ENTERPRISE_TRACING_STUB_H diff --git a/google/cloud/recaptchaenterprise/v1/recaptcha_enterprise_connection.h b/google/cloud/recaptchaenterprise/v1/recaptcha_enterprise_connection.h index 2847ae208c0bc..3cd32509dbe25 100644 --- a/google/cloud/recaptchaenterprise/v1/recaptcha_enterprise_connection.h +++ b/google/cloud/recaptchaenterprise/v1/recaptcha_enterprise_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/recaptchaenterprise/v1/internal/recaptcha_enterprise_retry_traits.h" #include "google/cloud/recaptchaenterprise/v1/recaptcha_enterprise_connection_idempotency_policy.h" +#include "google/cloud/recaptchaenterprise/v1/recaptchaenterprise.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 #include namespace google { diff --git a/google/cloud/recaptchaenterprise/v1/recaptcha_enterprise_connection_idempotency_policy.h b/google/cloud/recaptchaenterprise/v1/recaptcha_enterprise_connection_idempotency_policy.h index 4fd43427dedd7..e9dad23ea3381 100644 --- a/google/cloud/recaptchaenterprise/v1/recaptcha_enterprise_connection_idempotency_policy.h +++ b/google/cloud/recaptchaenterprise/v1/recaptcha_enterprise_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECAPTCHAENTERPRISE_V1_RECAPTCHA_ENTERPRISE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECAPTCHAENTERPRISE_V1_RECAPTCHA_ENTERPRISE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/recaptchaenterprise/v1/recaptchaenterprise.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/recommender/BUILD.bazel b/google/cloud/recommender/BUILD.bazel index 8abd72b3da11f..5c80f93fb9350 100644 --- a/google/cloud/recommender/BUILD.bazel +++ b/google/cloud/recommender/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/recommender/v1:recommender_cc_grpc", + "@googleapis//google/cloud/recommender/v1:recommender_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/recommender/CMakeLists.txt b/google/cloud/recommender/CMakeLists.txt index f8bec848d0913..13fe488e6c3cc 100644 --- a/google/cloud/recommender/CMakeLists.txt +++ b/google/cloud/recommender/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(recommender "Recommender API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(recommender_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/recommender/mocks/mock_recommender_connection.h b/google/cloud/recommender/mocks/mock_recommender_connection.h deleted file mode 100644 index 8d409093d516f..0000000000000 --- a/google/cloud/recommender/mocks/mock_recommender_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/recommender/v1/recommender_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_MOCKS_MOCK_RECOMMENDER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_MOCKS_MOCK_RECOMMENDER_CONNECTION_H - -#include "google/cloud/recommender/recommender_connection.h" -#include "google/cloud/recommender/v1/mocks/mock_recommender_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in recommender_v1_mocks instead of the aliases -/// defined in this namespace. -namespace recommender_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use recommender_v1_mocks::MockRecommenderConnection directly. -using ::google::cloud::recommender_v1_mocks::MockRecommenderConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace recommender_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_MOCKS_MOCK_RECOMMENDER_CONNECTION_H diff --git a/google/cloud/recommender/quickstart/.bazelrc b/google/cloud/recommender/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/recommender/quickstart/.bazelrc +++ b/google/cloud/recommender/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/recommender/quickstart/CMakeLists.txt index 861e20a09f079..2e7a4053ebe29 100644 --- a/google/cloud/recommender/quickstart/CMakeLists.txt +++ b/google/cloud/recommender/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Recommender API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-recommender-quickstart CXX) find_package(google_cloud_cpp_recommender REQUIRED) diff --git a/google/cloud/recommender/quickstart/WORKSPACE.bazel b/google/cloud/recommender/quickstart/WORKSPACE.bazel index 7c5a9e73812ae..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 = "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/recommender/recommender_client.h b/google/cloud/recommender/recommender_client.h deleted file mode 100644 index 99c254bfac3b4..0000000000000 --- a/google/cloud/recommender/recommender_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/recommender/v1/recommender_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_RECOMMENDER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_RECOMMENDER_CLIENT_H - -#include "google/cloud/recommender/recommender_connection.h" -#include "google/cloud/recommender/v1/recommender_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in recommender_v1 instead of the aliases defined in -/// this namespace. -namespace recommender { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use recommender_v1::RecommenderClient directly. -using ::google::cloud::recommender_v1::RecommenderClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace recommender -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_RECOMMENDER_CLIENT_H diff --git a/google/cloud/recommender/recommender_connection.h b/google/cloud/recommender/recommender_connection.h deleted file mode 100644 index dd941ccd11ecd..0000000000000 --- a/google/cloud/recommender/recommender_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/recommender/v1/recommender_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_RECOMMENDER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_RECOMMENDER_CONNECTION_H - -#include "google/cloud/recommender/recommender_connection_idempotency_policy.h" -#include "google/cloud/recommender/v1/recommender_connection.h" - -namespace google { -namespace cloud { -namespace recommender { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use recommender_v1::MakeRecommenderConnection directly. -using ::google::cloud::recommender_v1::MakeRecommenderConnection; - -/// @deprecated Use recommender_v1::RecommenderConnection directly. -using ::google::cloud::recommender_v1::RecommenderConnection; - -/// @deprecated Use recommender_v1::RecommenderLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::recommender_v1::RecommenderLimitedErrorCountRetryPolicy; - -/// @deprecated Use recommender_v1::RecommenderLimitedTimeRetryPolicy directly. -using ::google::cloud::recommender_v1::RecommenderLimitedTimeRetryPolicy; - -/// @deprecated Use recommender_v1::RecommenderRetryPolicy directly. -using ::google::cloud::recommender_v1::RecommenderRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace recommender -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_RECOMMENDER_CONNECTION_H diff --git a/google/cloud/recommender/recommender_connection_idempotency_policy.h b/google/cloud/recommender/recommender_connection_idempotency_policy.h deleted file mode 100644 index 53a4dbaa38e0a..0000000000000 --- a/google/cloud/recommender/recommender_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/recommender/v1/recommender_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_RECOMMENDER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_RECOMMENDER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/recommender/v1/recommender_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace recommender { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// recommender_v1::MakeDefaultRecommenderConnectionIdempotencyPolicy directly. -using ::google::cloud::recommender_v1:: - MakeDefaultRecommenderConnectionIdempotencyPolicy; - -/// @deprecated Use recommender_v1::RecommenderConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::recommender_v1::RecommenderConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace recommender -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_RECOMMENDER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/recommender/recommender_options.h b/google/cloud/recommender/recommender_options.h deleted file mode 100644 index 5571cb440fb7c..0000000000000 --- a/google/cloud/recommender/recommender_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/recommender/v1/recommender_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_RECOMMENDER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_RECOMMENDER_OPTIONS_H - -#include "google/cloud/recommender/recommender_connection.h" -#include "google/cloud/recommender/recommender_connection_idempotency_policy.h" -#include "google/cloud/recommender/v1/recommender_options.h" - -namespace google { -namespace cloud { -namespace recommender { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use recommender_v1::RecommenderBackoffPolicyOption directly. -using ::google::cloud::recommender_v1::RecommenderBackoffPolicyOption; - -/// @deprecated Use recommender_v1::RecommenderConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::recommender_v1:: - RecommenderConnectionIdempotencyPolicyOption; - -/// @deprecated Use recommender_v1::RecommenderPolicyOptionList directly. -using ::google::cloud::recommender_v1::RecommenderPolicyOptionList; - -/// @deprecated Use recommender_v1::RecommenderRetryPolicyOption directly. -using ::google::cloud::recommender_v1::RecommenderRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace recommender -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_RECOMMENDER_OPTIONS_H diff --git a/google/cloud/recommender/v1/internal/recommender_auth_decorator.cc b/google/cloud/recommender/v1/internal/recommender_auth_decorator.cc index 691f5f1a6c5b0..a62a9d64836a0 100644 --- a/google/cloud/recommender/v1/internal/recommender_auth_decorator.cc +++ b/google/cloud/recommender/v1/internal/recommender_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/recommender/v1/recommender_service.proto #include "google/cloud/recommender/v1/internal/recommender_auth_decorator.h" -#include +#include "google/cloud/recommender/v1/recommender_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recommender_v1_internal { @@ -159,3 +162,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace recommender_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/recommender/v1/internal/recommender_auth_decorator.h b/google/cloud/recommender/v1/internal/recommender_auth_decorator.h index 2a0306a68c46c..274b9dfeb2ad0 100644 --- a/google/cloud/recommender/v1/internal/recommender_auth_decorator.h +++ b/google/cloud/recommender/v1/internal/recommender_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recommender_v1_internal { @@ -122,4 +125,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_V1_INTERNAL_RECOMMENDER_AUTH_DECORATOR_H diff --git a/google/cloud/recommender/v1/internal/recommender_logging_decorator.cc b/google/cloud/recommender/v1/internal/recommender_logging_decorator.cc index d30c7cc5351d4..ea82ee814a3bb 100644 --- a/google/cloud/recommender/v1/internal/recommender_logging_decorator.cc +++ b/google/cloud/recommender/v1/internal/recommender_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/recommender/v1/recommender_service.proto #include "google/cloud/recommender/v1/internal/recommender_logging_decorator.h" +#include "google/cloud/recommender/v1/recommender_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recommender_v1_internal { @@ -218,3 +221,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace recommender_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/recommender/v1/internal/recommender_logging_decorator.h b/google/cloud/recommender/v1/internal/recommender_logging_decorator.h index 8b5c98ae43a69..541a81698efe2 100644 --- a/google/cloud/recommender/v1/internal/recommender_logging_decorator.h +++ b/google/cloud/recommender/v1/internal/recommender_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recommender_v1_internal { @@ -122,4 +125,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_V1_INTERNAL_RECOMMENDER_LOGGING_DECORATOR_H diff --git a/google/cloud/recommender/v1/internal/recommender_metadata_decorator.cc b/google/cloud/recommender/v1/internal/recommender_metadata_decorator.cc index 48831f129438a..609732dd5c36e 100644 --- a/google/cloud/recommender/v1/internal/recommender_metadata_decorator.cc +++ b/google/cloud/recommender/v1/internal/recommender_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/recommender/v1/recommender_service.proto #include "google/cloud/recommender/v1/internal/recommender_metadata_decorator.h" +#include "google/cloud/recommender/v1/recommender_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 recommender_v1_internal { @@ -190,3 +194,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace recommender_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/recommender/v1/internal/recommender_metadata_decorator.h b/google/cloud/recommender/v1/internal/recommender_metadata_decorator.h index 1248a1ec94009..7927d26cce37a 100644 --- a/google/cloud/recommender/v1/internal/recommender_metadata_decorator.h +++ b/google/cloud/recommender/v1/internal/recommender_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recommender_v1_internal { @@ -127,4 +130,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_V1_INTERNAL_RECOMMENDER_METADATA_DECORATOR_H diff --git a/google/cloud/recommender/v1/internal/recommender_option_defaults.cc b/google/cloud/recommender/v1/internal/recommender_option_defaults.cc index eede439b91ca6..54501fcaab612 100644 --- a/google/cloud/recommender/v1/internal/recommender_option_defaults.cc +++ b/google/cloud/recommender/v1/internal/recommender_option_defaults.cc @@ -41,7 +41,7 @@ Options RecommenderDefaultOptions(Options options) { if (!options.has()) { options.set( recommender_v1::RecommenderLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/recommender/v1/internal/recommender_stub.cc b/google/cloud/recommender/v1/internal/recommender_stub.cc index 8a3ed50ce41d6..402d43079a939 100644 --- a/google/cloud/recommender/v1/internal/recommender_stub.cc +++ b/google/cloud/recommender/v1/internal/recommender_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/recommender/v1/recommender_service.proto #include "google/cloud/recommender/v1/internal/recommender_stub.h" +#include "google/cloud/recommender/v1/recommender_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recommender_v1_internal { @@ -204,3 +207,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace recommender_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/recommender/v1/internal/recommender_stub.h b/google/cloud/recommender/v1/internal/recommender_stub.h index 38bc4cd3aec88..064cb4a806fd1 100644 --- a/google/cloud/recommender/v1/internal/recommender_stub.h +++ b/google/cloud/recommender/v1/internal/recommender_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_V1_INTERNAL_RECOMMENDER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_V1_INTERNAL_RECOMMENDER_STUB_H +#include "google/cloud/recommender/v1/recommender_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recommender_v1_internal { @@ -202,4 +205,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_V1_INTERNAL_RECOMMENDER_STUB_H diff --git a/google/cloud/recommender/v1/internal/recommender_stub_factory.cc b/google/cloud/recommender/v1/internal/recommender_stub_factory.cc index 6f7dd489b59c3..cc3e3f6493963 100644 --- a/google/cloud/recommender/v1/internal/recommender_stub_factory.cc +++ b/google/cloud/recommender/v1/internal/recommender_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/recommender/v1/internal/recommender_metadata_decorator.h" #include "google/cloud/recommender/v1/internal/recommender_stub.h" #include "google/cloud/recommender/v1/internal/recommender_tracing_stub.h" +#include "google/cloud/recommender/v1/recommender_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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recommender_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace recommender_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/recommender/v1/internal/recommender_stub_factory.h b/google/cloud/recommender/v1/internal/recommender_stub_factory.h index 44837cf793c27..e3be9466604af 100644 --- a/google/cloud/recommender/v1/internal/recommender_stub_factory.h +++ b/google/cloud/recommender/v1/internal/recommender_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recommender_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_V1_INTERNAL_RECOMMENDER_STUB_FACTORY_H diff --git a/google/cloud/recommender/v1/internal/recommender_tracing_connection.cc b/google/cloud/recommender/v1/internal/recommender_tracing_connection.cc index 1b1b67aab9e04..07d1d6448a6b1 100644 --- a/google/cloud/recommender/v1/internal/recommender_tracing_connection.cc +++ b/google/cloud/recommender/v1/internal/recommender_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace recommender_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RecommenderTracingConnection::RecommenderTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -163,16 +161,12 @@ RecommenderTracingConnection::UpdateInsightTypeConfig( return internal::EndSpan(*span, child_->UpdateInsightTypeConfig(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRecommenderTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/recommender/v1/internal/recommender_tracing_connection.h b/google/cloud/recommender/v1/internal/recommender_tracing_connection.h index e8c4842d2efca..2e8abf3900032 100644 --- a/google/cloud/recommender/v1/internal/recommender_tracing_connection.h +++ b/google/cloud/recommender/v1/internal/recommender_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace recommender_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RecommenderTracingConnection : public recommender_v1::RecommenderConnection { public: @@ -103,8 +101,6 @@ class RecommenderTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/recommender/v1/internal/recommender_tracing_stub.cc b/google/cloud/recommender/v1/internal/recommender_tracing_stub.cc index b399c0762e0f1..062518cc181ca 100644 --- a/google/cloud/recommender/v1/internal/recommender_tracing_stub.cc +++ b/google/cloud/recommender/v1/internal/recommender_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recommender_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RecommenderTracingStub::RecommenderTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -202,18 +203,14 @@ RecommenderTracingStub::UpdateInsightTypeConfig( child_->UpdateInsightTypeConfig(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRecommenderTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace recommender_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/recommender/v1/internal/recommender_tracing_stub.h b/google/cloud/recommender/v1/internal/recommender_tracing_stub.h index 45257c0855979..bd9b801a25bac 100644 --- a/google/cloud/recommender/v1/internal/recommender_tracing_stub.h +++ b/google/cloud/recommender/v1/internal/recommender_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace recommender_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RecommenderTracingStub : public RecommenderStub { public: ~RecommenderTracingStub() override = default; @@ -118,8 +119,6 @@ class RecommenderTracingStub : public RecommenderStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -134,4 +133,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_V1_INTERNAL_RECOMMENDER_TRACING_STUB_H diff --git a/google/cloud/recommender/v1/recommender_connection.h b/google/cloud/recommender/v1/recommender_connection.h index 8a3e6ebc06497..18c24b905bdb5 100644 --- a/google/cloud/recommender/v1/recommender_connection.h +++ b/google/cloud/recommender/v1/recommender_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/recommender/v1/internal/recommender_retry_traits.h" #include "google/cloud/recommender/v1/recommender_connection_idempotency_policy.h" +#include "google/cloud/recommender/v1/recommender_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 #include namespace google { diff --git a/google/cloud/recommender/v1/recommender_connection_idempotency_policy.h b/google/cloud/recommender/v1/recommender_connection_idempotency_policy.h index c968fae20bee5..26397a7f1df2b 100644 --- a/google/cloud/recommender/v1/recommender_connection_idempotency_policy.h +++ b/google/cloud/recommender/v1/recommender_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_V1_RECOMMENDER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RECOMMENDER_V1_RECOMMENDER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/recommender/v1/recommender_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/redis/BUILD.bazel b/google/cloud/redis/BUILD.bazel index 7072c4ab75382..a544642374509 100644 --- a/google/cloud/redis/BUILD.bazel +++ b/google/cloud/redis/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", "cluster/v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/redis/cluster/v1:cluster_cc_grpc", - "@com_google_googleapis//google/cloud/redis/v1:redis_cc_grpc", + "@googleapis//google/cloud/redis/cluster/v1:cluster_cc_grpc", + "@googleapis//google/cloud/redis/v1:redis_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/redis/CMakeLists.txt b/google/cloud/redis/CMakeLists.txt index 3cd59d7a73a3a..e3eb251c39b97 100644 --- a/google/cloud/redis/CMakeLists.txt +++ b/google/cloud/redis/CMakeLists.txt @@ -17,8 +17,8 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( - redis "Google Cloud Memorystore for Redis API" - SERVICE_DIRS "__EMPTY__" "v1/" "cluster/v1/") + redis "Google Cloud Memorystore for Redis API" SERVICE_DIRS "v1/" + "cluster/v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(redis_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/redis/cloud_redis_client.h b/google/cloud/redis/cloud_redis_client.h deleted file mode 100644 index b6ea589535b4c..0000000000000 --- a/google/cloud/redis/cloud_redis_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/redis/v1/cloud_redis.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLOUD_REDIS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLOUD_REDIS_CLIENT_H - -#include "google/cloud/redis/cloud_redis_connection.h" -#include "google/cloud/redis/v1/cloud_redis_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in redis_v1 instead of the aliases defined in -/// this namespace. -namespace redis { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use redis_v1::CloudRedisClient directly. -using ::google::cloud::redis_v1::CloudRedisClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace redis -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLOUD_REDIS_CLIENT_H diff --git a/google/cloud/redis/cloud_redis_connection.h b/google/cloud/redis/cloud_redis_connection.h deleted file mode 100644 index df36b16d700af..0000000000000 --- a/google/cloud/redis/cloud_redis_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/redis/v1/cloud_redis.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLOUD_REDIS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLOUD_REDIS_CONNECTION_H - -#include "google/cloud/redis/cloud_redis_connection_idempotency_policy.h" -#include "google/cloud/redis/v1/cloud_redis_connection.h" - -namespace google { -namespace cloud { -namespace redis { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use redis_v1::MakeCloudRedisConnection directly. -using ::google::cloud::redis_v1::MakeCloudRedisConnection; - -/// @deprecated Use redis_v1::CloudRedisConnection directly. -using ::google::cloud::redis_v1::CloudRedisConnection; - -/// @deprecated Use redis_v1::CloudRedisLimitedErrorCountRetryPolicy directly. -using ::google::cloud::redis_v1::CloudRedisLimitedErrorCountRetryPolicy; - -/// @deprecated Use redis_v1::CloudRedisLimitedTimeRetryPolicy directly. -using ::google::cloud::redis_v1::CloudRedisLimitedTimeRetryPolicy; - -/// @deprecated Use redis_v1::CloudRedisRetryPolicy directly. -using ::google::cloud::redis_v1::CloudRedisRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace redis -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLOUD_REDIS_CONNECTION_H diff --git a/google/cloud/redis/cloud_redis_connection_idempotency_policy.h b/google/cloud/redis/cloud_redis_connection_idempotency_policy.h deleted file mode 100644 index ccc7f92766991..0000000000000 --- a/google/cloud/redis/cloud_redis_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/redis/v1/cloud_redis.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLOUD_REDIS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLOUD_REDIS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/redis/v1/cloud_redis_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace redis { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use redis_v1::MakeDefaultCloudRedisConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::redis_v1:: - MakeDefaultCloudRedisConnectionIdempotencyPolicy; - -/// @deprecated Use redis_v1::CloudRedisConnectionIdempotencyPolicy directly. -using ::google::cloud::redis_v1::CloudRedisConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace redis -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLOUD_REDIS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/redis/cloud_redis_options.h b/google/cloud/redis/cloud_redis_options.h deleted file mode 100644 index 30cf04d4f8068..0000000000000 --- a/google/cloud/redis/cloud_redis_options.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/redis/v1/cloud_redis.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLOUD_REDIS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLOUD_REDIS_OPTIONS_H - -#include "google/cloud/redis/cloud_redis_connection.h" -#include "google/cloud/redis/cloud_redis_connection_idempotency_policy.h" -#include "google/cloud/redis/v1/cloud_redis_options.h" - -namespace google { -namespace cloud { -namespace redis { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use redis_v1::CloudRedisPollingPolicyOption directly. -using ::google::cloud::redis_v1::CloudRedisPollingPolicyOption; - -/// @deprecated Use redis_v1::CloudRedisBackoffPolicyOption directly. -using ::google::cloud::redis_v1::CloudRedisBackoffPolicyOption; - -/// @deprecated Use redis_v1::CloudRedisConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::redis_v1::CloudRedisConnectionIdempotencyPolicyOption; - -/// @deprecated Use redis_v1::CloudRedisPolicyOptionList directly. -using ::google::cloud::redis_v1::CloudRedisPolicyOptionList; - -/// @deprecated Use redis_v1::CloudRedisRetryPolicyOption directly. -using ::google::cloud::redis_v1::CloudRedisRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace redis -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLOUD_REDIS_OPTIONS_H 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 632eec528eabb..5a46966d9b90e 100644 --- a/google/cloud/redis/cluster/v1/cloud_redis_cluster_client.h +++ b/google/cloud/redis/cluster/v1/cloud_redis_cluster_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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 11533e03a9a66..f4148d9b64d9d 100644 --- a/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection.h +++ b/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLUSTER_V1_CLOUD_REDIS_CLUSTER_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLUSTER_V1_CLOUD_REDIS_CLUSTER_CONNECTION_H +#include "google/cloud/redis/cluster/v1/cloud_redis_cluster.pb.h" #include "google/cloud/redis/cluster/v1/cloud_redis_cluster_connection_idempotency_policy.h" #include "google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 3b16a188a5015..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 @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLUSTER_V1_CLOUD_REDIS_CLUSTER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLUSTER_V1_CLOUD_REDIS_CLUSTER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/redis/cluster/v1/cloud_redis_cluster.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 3861b6bdd3b0a..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 @@ -17,10 +17,13 @@ // source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto #include "google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_auth_decorator.h" -#include +#include "google/cloud/redis/cluster/v1/cloud_redis_cluster.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_cluster_v1_internal { @@ -143,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, @@ -386,3 +400,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace redis_cluster_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" 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 5b1f74efd0b1a..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 @@ -22,11 +22,14 @@ #include "google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 redis_cluster_v1_internal { @@ -91,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, @@ -208,4 +218,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLUSTER_V1_INTERNAL_CLOUD_REDIS_CLUSTER_AUTH_DECORATOR_H 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 9a438acf107b7..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 @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -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 510ea041cd51d..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 @@ -17,14 +17,17 @@ // source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto #include "google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_logging_decorator.h" +#include "google/cloud/redis/cluster/v1/cloud_redis_cluster.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_cluster_v1_internal { @@ -172,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, @@ -464,3 +482,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace redis_cluster_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" 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 acd18fd2200fa..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 @@ -22,11 +22,14 @@ #include "google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 redis_cluster_v1_internal { @@ -91,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, @@ -208,4 +218,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLUSTER_V1_INTERNAL_CLOUD_REDIS_CLUSTER_LOGGING_DECORATOR_H 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 3109d519e7340..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 @@ -17,17 +17,21 @@ // source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto #include "google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_metadata_decorator.h" +#include "google/cloud/redis/cluster/v1/cloud_redis_cluster.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 redis_cluster_v1_internal { @@ -137,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, @@ -353,3 +368,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace redis_cluster_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" 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 2340d58a77a6b..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 @@ -22,11 +22,14 @@ #include "google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 redis_cluster_v1_internal { @@ -92,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, @@ -214,4 +224,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLUSTER_V1_INTERNAL_CLOUD_REDIS_CLUSTER_METADATA_DECORATOR_H diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_option_defaults.cc b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_option_defaults.cc index d819c0f7f03e4..e41757e1ee232 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_option_defaults.cc +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_option_defaults.cc @@ -41,7 +41,7 @@ Options CloudRedisClusterDefaultOptions(Options options) { if (!options.has()) { options.set( redis_cluster_v1::CloudRedisClusterLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { 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 b3eda3b74c849..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 @@ -17,13 +17,16 @@ // source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto #include "google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub.h" +#include "google/cloud/redis/cluster/v1/cloud_redis_cluster.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_cluster_v1_internal { @@ -162,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, @@ -453,3 +471,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace redis_cluster_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" 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 7f9e224259c06..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 @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLUSTER_V1_INTERNAL_CLOUD_REDIS_CLUSTER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLUSTER_V1_INTERNAL_CLOUD_REDIS_CLUSTER_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/redis/cluster/v1/cloud_redis_cluster.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_cluster_v1_internal { @@ -90,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, @@ -265,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, @@ -387,4 +404,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLUSTER_V1_INTERNAL_CLOUD_REDIS_CLUSTER_STUB_H diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub_factory.cc b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub_factory.cc index 462dd914a7ff4..eb492697b6082 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub_factory.cc +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub_factory.cc @@ -17,6 +17,8 @@ // source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto #include "google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/redis/cluster/v1/cloud_redis_cluster.grpc.pb.h" #include "google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_auth_decorator.h" #include "google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_logging_decorator.h" #include "google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_metadata_decorator.h" @@ -28,12 +30,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_cluster_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace redis_cluster_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub_factory.h b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub_factory.h index c095adfe6eb27..695ff8df20857 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub_factory.h +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_cluster_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLUSTER_V1_INTERNAL_CLOUD_REDIS_CLUSTER_STUB_FACTORY_H 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 10fc381c6d126..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 @@ -27,8 +27,6 @@ namespace cloud { namespace redis_cluster_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudRedisClusterTracingConnection::CloudRedisClusterTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -150,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:: @@ -368,17 +378,13 @@ Status CloudRedisClusterTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudRedisClusterTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } 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 b0b3c0936fd1f..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 @@ -28,8 +28,6 @@ namespace cloud { namespace redis_cluster_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudRedisClusterTracingConnection : public redis_cluster_v1::CloudRedisClusterConnection { public: @@ -88,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:: @@ -177,8 +181,6 @@ class CloudRedisClusterTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * 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 d68ce5d4a0bf9..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 @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_cluster_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudRedisClusterTracingStub::CloudRedisClusterTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -149,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, @@ -408,18 +424,14 @@ future CloudRedisClusterTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudRedisClusterTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace redis_cluster_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" 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 f2a9c059b17a0..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 @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_cluster_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudRedisClusterTracingStub : public CloudRedisClusterStub { public: ~CloudRedisClusterTracingStub() override = default; @@ -91,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, @@ -204,8 +212,6 @@ class CloudRedisClusterTracingStub : public CloudRedisClusterStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -220,4 +226,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_CLUSTER_V1_INTERNAL_CLOUD_REDIS_CLUSTER_TRACING_STUB_H 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/mocks/mock_cloud_redis_connection.h b/google/cloud/redis/mocks/mock_cloud_redis_connection.h deleted file mode 100644 index 688841304e377..0000000000000 --- a/google/cloud/redis/mocks/mock_cloud_redis_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/redis/v1/cloud_redis.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_MOCKS_MOCK_CLOUD_REDIS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_MOCKS_MOCK_CLOUD_REDIS_CONNECTION_H - -#include "google/cloud/redis/cloud_redis_connection.h" -#include "google/cloud/redis/v1/mocks/mock_cloud_redis_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in redis_v1_mocks instead of the aliases -/// defined in this namespace. -namespace redis_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use redis_v1_mocks::MockCloudRedisConnection directly. -using ::google::cloud::redis_v1_mocks::MockCloudRedisConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace redis_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_MOCKS_MOCK_CLOUD_REDIS_CONNECTION_H diff --git a/google/cloud/redis/quickstart/.bazelrc b/google/cloud/redis/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/redis/quickstart/.bazelrc +++ b/google/cloud/redis/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/redis/quickstart/CMakeLists.txt index 552a9da3138dc..c90374512b5de 100644 --- a/google/cloud/redis/quickstart/CMakeLists.txt +++ b/google/cloud/redis/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Google Cloud Memorystore for Redis API C++ # client library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-redis-quickstart CXX) find_package(google_cloud_cpp_redis REQUIRED) diff --git a/google/cloud/redis/quickstart/WORKSPACE.bazel b/google/cloud/redis/quickstart/WORKSPACE.bazel index 5a2799047fede..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 = "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/redis/v1/cloud_redis_client.h b/google/cloud/redis/v1/cloud_redis_client.h index 7776fed61becf..973a8ec9040cd 100644 --- a/google/cloud/redis/v1/cloud_redis_client.h +++ b/google/cloud/redis/v1/cloud_redis_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/redis/v1/cloud_redis_connection.h b/google/cloud/redis/v1/cloud_redis_connection.h index 676915799b9d6..00bd5da0e4353 100644 --- a/google/cloud/redis/v1/cloud_redis_connection.h +++ b/google/cloud/redis/v1/cloud_redis_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_V1_CLOUD_REDIS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_V1_CLOUD_REDIS_CONNECTION_H +#include "google/cloud/redis/v1/cloud_redis.pb.h" #include "google/cloud/redis/v1/cloud_redis_connection_idempotency_policy.h" #include "google/cloud/redis/v1/internal/cloud_redis_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/redis/v1/cloud_redis_connection_idempotency_policy.h b/google/cloud/redis/v1/cloud_redis_connection_idempotency_policy.h index 3ac71638a3160..6233f32329048 100644 --- a/google/cloud/redis/v1/cloud_redis_connection_idempotency_policy.h +++ b/google/cloud/redis/v1/cloud_redis_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_V1_CLOUD_REDIS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_V1_CLOUD_REDIS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/redis/v1/cloud_redis.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/redis/v1/internal/cloud_redis_auth_decorator.cc b/google/cloud/redis/v1/internal/cloud_redis_auth_decorator.cc index 6602bd179613d..b72a76c27964a 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_auth_decorator.cc +++ b/google/cloud/redis/v1/internal/cloud_redis_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/redis/v1/cloud_redis.proto #include "google/cloud/redis/v1/internal/cloud_redis_auth_decorator.h" -#include +#include "google/cloud/redis/v1/cloud_redis.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_v1_internal { @@ -371,3 +374,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace redis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/redis/v1/internal/cloud_redis_auth_decorator.h b/google/cloud/redis/v1/internal/cloud_redis_auth_decorator.h index 5c43a28fee550..95b3303c4b1fd 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_auth_decorator.h +++ b/google/cloud/redis/v1/internal/cloud_redis_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/redis/v1/internal/cloud_redis_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 redis_v1_internal { @@ -182,4 +185,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_V1_INTERNAL_CLOUD_REDIS_AUTH_DECORATOR_H diff --git a/google/cloud/redis/v1/internal/cloud_redis_connection_impl.h b/google/cloud/redis/v1/internal/cloud_redis_connection_impl.h index 9e56f167972e9..94b9fe7cedbfc 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_connection_impl.h +++ b/google/cloud/redis/v1/internal/cloud_redis_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/redis/v1/internal/cloud_redis_logging_decorator.cc b/google/cloud/redis/v1/internal/cloud_redis_logging_decorator.cc index 191af4d971bf6..5515d975cba45 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_logging_decorator.cc +++ b/google/cloud/redis/v1/internal/cloud_redis_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/redis/v1/cloud_redis.proto #include "google/cloud/redis/v1/internal/cloud_redis_logging_decorator.h" +#include "google/cloud/redis/v1/cloud_redis.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_v1_internal { @@ -413,3 +416,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace redis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/redis/v1/internal/cloud_redis_logging_decorator.h b/google/cloud/redis/v1/internal/cloud_redis_logging_decorator.h index a7aac7138cd17..1aa0470934787 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_logging_decorator.h +++ b/google/cloud/redis/v1/internal/cloud_redis_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/redis/v1/internal/cloud_redis_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 redis_v1_internal { @@ -182,4 +185,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_V1_INTERNAL_CLOUD_REDIS_LOGGING_DECORATOR_H diff --git a/google/cloud/redis/v1/internal/cloud_redis_metadata_decorator.cc b/google/cloud/redis/v1/internal/cloud_redis_metadata_decorator.cc index 2a3ac2c4778c4..4ad1a5890c729 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_metadata_decorator.cc +++ b/google/cloud/redis/v1/internal/cloud_redis_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/redis/v1/cloud_redis.proto #include "google/cloud/redis/v1/internal/cloud_redis_metadata_decorator.h" +#include "google/cloud/redis/v1/cloud_redis.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 redis_v1_internal { @@ -323,3 +327,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace redis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/redis/v1/internal/cloud_redis_metadata_decorator.h b/google/cloud/redis/v1/internal/cloud_redis_metadata_decorator.h index 7efd524661b56..7d5fa4ddac449 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_metadata_decorator.h +++ b/google/cloud/redis/v1/internal/cloud_redis_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/redis/v1/internal/cloud_redis_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 redis_v1_internal { @@ -187,4 +190,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_V1_INTERNAL_CLOUD_REDIS_METADATA_DECORATOR_H diff --git a/google/cloud/redis/v1/internal/cloud_redis_option_defaults.cc b/google/cloud/redis/v1/internal/cloud_redis_option_defaults.cc index 69813adcd9080..874cde1fcc492 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_option_defaults.cc +++ b/google/cloud/redis/v1/internal/cloud_redis_option_defaults.cc @@ -40,7 +40,7 @@ Options CloudRedisDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - redis_v1::CloudRedisLimitedTimeRetryPolicy(std::chrono::minutes(30)) + redis_v1::CloudRedisLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/redis/v1/internal/cloud_redis_stub.cc b/google/cloud/redis/v1/internal/cloud_redis_stub.cc index 39cac7c9226d4..10c879fa2088e 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_stub.cc +++ b/google/cloud/redis/v1/internal/cloud_redis_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/redis/v1/cloud_redis.proto #include "google/cloud/redis/v1/internal/cloud_redis_stub.h" +#include "google/cloud/redis/v1/cloud_redis.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_v1_internal { @@ -412,3 +415,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace redis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/redis/v1/internal/cloud_redis_stub.h b/google/cloud/redis/v1/internal/cloud_redis_stub.h index 4351f890bc08a..903df4a1beb74 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_stub.h +++ b/google/cloud/redis/v1/internal/cloud_redis_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_V1_INTERNAL_CLOUD_REDIS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_V1_INTERNAL_CLOUD_REDIS_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/redis/v1/cloud_redis.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_v1_internal { @@ -336,4 +339,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_V1_INTERNAL_CLOUD_REDIS_STUB_H diff --git a/google/cloud/redis/v1/internal/cloud_redis_stub_factory.cc b/google/cloud/redis/v1/internal/cloud_redis_stub_factory.cc index 8bce0fd9b72c3..b95602111cddf 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_stub_factory.cc +++ b/google/cloud/redis/v1/internal/cloud_redis_stub_factory.cc @@ -17,6 +17,8 @@ // source: google/cloud/redis/v1/cloud_redis.proto #include "google/cloud/redis/v1/internal/cloud_redis_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/redis/v1/cloud_redis.grpc.pb.h" #include "google/cloud/redis/v1/internal/cloud_redis_auth_decorator.h" #include "google/cloud/redis/v1/internal/cloud_redis_logging_decorator.h" #include "google/cloud/redis/v1/internal/cloud_redis_metadata_decorator.h" @@ -28,12 +30,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace redis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/redis/v1/internal/cloud_redis_stub_factory.h b/google/cloud/redis/v1/internal/cloud_redis_stub_factory.h index e11f1ce9ccb22..d723e8ead50fa 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_stub_factory.h +++ b/google/cloud/redis/v1/internal/cloud_redis_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_V1_INTERNAL_CLOUD_REDIS_STUB_FACTORY_H diff --git a/google/cloud/redis/v1/internal/cloud_redis_tracing_connection.cc b/google/cloud/redis/v1/internal/cloud_redis_tracing_connection.cc index 4c5a16635d081..398d188948992 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_tracing_connection.cc +++ b/google/cloud/redis/v1/internal/cloud_redis_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace redis_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudRedisTracingConnection::CloudRedisTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -351,15 +349,11 @@ Status CloudRedisTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudRedisTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/redis/v1/internal/cloud_redis_tracing_connection.h b/google/cloud/redis/v1/internal/cloud_redis_tracing_connection.h index 8270f67fda3db..c3262cc94fb9c 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_tracing_connection.h +++ b/google/cloud/redis/v1/internal/cloud_redis_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace redis_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudRedisTracingConnection : public redis_v1::CloudRedisConnection { public: ~CloudRedisTracingConnection() override = default; @@ -155,8 +153,6 @@ class CloudRedisTracingConnection : public redis_v1::CloudRedisConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/redis/v1/internal/cloud_redis_tracing_stub.cc b/google/cloud/redis/v1/internal/cloud_redis_tracing_stub.cc index 5eebe7d14adae..eb48433b1d0d1 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_tracing_stub.cc +++ b/google/cloud/redis/v1/internal/cloud_redis_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudRedisTracingStub::CloudRedisTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -373,18 +374,14 @@ future CloudRedisTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudRedisTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace redis_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/redis/v1/internal/cloud_redis_tracing_stub.h b/google/cloud/redis/v1/internal/cloud_redis_tracing_stub.h index c964996da585c..c04873242e7a6 100644 --- a/google/cloud/redis/v1/internal/cloud_redis_tracing_stub.h +++ b/google/cloud/redis/v1/internal/cloud_redis_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace redis_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudRedisTracingStub : public CloudRedisStub { public: ~CloudRedisTracingStub() override = default; @@ -177,8 +178,6 @@ class CloudRedisTracingStub : public CloudRedisStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -193,4 +192,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_REDIS_V1_INTERNAL_CLOUD_REDIS_TRACING_STUB_H diff --git a/google/cloud/resourcemanager/BUILD.bazel b/google/cloud/resourcemanager/BUILD.bazel index 34610e2590d23..f3ce3b6ccc9d8 100644 --- a/google/cloud/resourcemanager/BUILD.bazel +++ b/google/cloud/resourcemanager/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v3/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/resourcemanager/v3:resourcemanager_cc_grpc", + "@googleapis//google/cloud/resourcemanager/v3:resourcemanager_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/resourcemanager/CMakeLists.txt b/google/cloud/resourcemanager/CMakeLists.txt index eaaf21b473bf7..03a87c65fdd0e 100644 --- a/google/cloud/resourcemanager/CMakeLists.txt +++ b/google/cloud/resourcemanager/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(resourcemanager "Cloud Resource Manager API" - SERVICE_DIRS "__EMPTY__" "v3/") + SERVICE_DIRS "v3/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(resourcemanager_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/resourcemanager/folders_client.h b/google/cloud/resourcemanager/folders_client.h deleted file mode 100644 index e691d806b44db..0000000000000 --- a/google/cloud/resourcemanager/folders_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/folders.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_FOLDERS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_FOLDERS_CLIENT_H - -#include "google/cloud/resourcemanager/folders_connection.h" -#include "google/cloud/resourcemanager/v3/folders_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in resourcemanager_v3 instead of the aliases defined in -/// this namespace. -namespace resourcemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use resourcemanager_v3::FoldersClient directly. -using ::google::cloud::resourcemanager_v3::FoldersClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_FOLDERS_CLIENT_H diff --git a/google/cloud/resourcemanager/folders_connection.h b/google/cloud/resourcemanager/folders_connection.h deleted file mode 100644 index 1686625c5f061..0000000000000 --- a/google/cloud/resourcemanager/folders_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/folders.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_FOLDERS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_FOLDERS_CONNECTION_H - -#include "google/cloud/resourcemanager/folders_connection_idempotency_policy.h" -#include "google/cloud/resourcemanager/v3/folders_connection.h" - -namespace google { -namespace cloud { -namespace resourcemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use resourcemanager_v3::MakeFoldersConnection directly. -using ::google::cloud::resourcemanager_v3::MakeFoldersConnection; - -/// @deprecated Use resourcemanager_v3::FoldersConnection directly. -using ::google::cloud::resourcemanager_v3::FoldersConnection; - -/// @deprecated Use resourcemanager_v3::FoldersLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::resourcemanager_v3::FoldersLimitedErrorCountRetryPolicy; - -/// @deprecated Use resourcemanager_v3::FoldersLimitedTimeRetryPolicy directly. -using ::google::cloud::resourcemanager_v3::FoldersLimitedTimeRetryPolicy; - -/// @deprecated Use resourcemanager_v3::FoldersRetryPolicy directly. -using ::google::cloud::resourcemanager_v3::FoldersRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_FOLDERS_CONNECTION_H diff --git a/google/cloud/resourcemanager/folders_connection_idempotency_policy.h b/google/cloud/resourcemanager/folders_connection_idempotency_policy.h deleted file mode 100644 index 7beb79d7f43cb..0000000000000 --- a/google/cloud/resourcemanager/folders_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/folders.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_FOLDERS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_FOLDERS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/resourcemanager/v3/folders_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace resourcemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// resourcemanager_v3::MakeDefaultFoldersConnectionIdempotencyPolicy directly. -using ::google::cloud::resourcemanager_v3:: - MakeDefaultFoldersConnectionIdempotencyPolicy; - -/// @deprecated Use resourcemanager_v3::FoldersConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::resourcemanager_v3::FoldersConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_FOLDERS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/resourcemanager/folders_options.h b/google/cloud/resourcemanager/folders_options.h deleted file mode 100644 index 70b9a48a3f20e..0000000000000 --- a/google/cloud/resourcemanager/folders_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/folders.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_FOLDERS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_FOLDERS_OPTIONS_H - -#include "google/cloud/resourcemanager/folders_connection.h" -#include "google/cloud/resourcemanager/folders_connection_idempotency_policy.h" -#include "google/cloud/resourcemanager/v3/folders_options.h" - -namespace google { -namespace cloud { -namespace resourcemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use resourcemanager_v3::FoldersPollingPolicyOption directly. -using ::google::cloud::resourcemanager_v3::FoldersPollingPolicyOption; - -/// @deprecated Use resourcemanager_v3::FoldersBackoffPolicyOption directly. -using ::google::cloud::resourcemanager_v3::FoldersBackoffPolicyOption; - -/// @deprecated Use resourcemanager_v3::FoldersConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::resourcemanager_v3:: - FoldersConnectionIdempotencyPolicyOption; - -/// @deprecated Use resourcemanager_v3::FoldersPolicyOptionList directly. -using ::google::cloud::resourcemanager_v3::FoldersPolicyOptionList; - -/// @deprecated Use resourcemanager_v3::FoldersRetryPolicyOption directly. -using ::google::cloud::resourcemanager_v3::FoldersRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_FOLDERS_OPTIONS_H diff --git a/google/cloud/resourcemanager/mocks/mock_folders_connection.h b/google/cloud/resourcemanager/mocks/mock_folders_connection.h deleted file mode 100644 index 0dc421cf90e86..0000000000000 --- a/google/cloud/resourcemanager/mocks/mock_folders_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/folders.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_MOCKS_MOCK_FOLDERS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_MOCKS_MOCK_FOLDERS_CONNECTION_H - -#include "google/cloud/resourcemanager/folders_connection.h" -#include "google/cloud/resourcemanager/v3/mocks/mock_folders_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in resourcemanager_v3_mocks instead of the aliases -/// defined in this namespace. -namespace resourcemanager_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use resourcemanager_v3_mocks::MockFoldersConnection directly. -using ::google::cloud::resourcemanager_v3_mocks::MockFoldersConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_MOCKS_MOCK_FOLDERS_CONNECTION_H diff --git a/google/cloud/resourcemanager/mocks/mock_organizations_connection.h b/google/cloud/resourcemanager/mocks/mock_organizations_connection.h deleted file mode 100644 index 04c0cc8420d7f..0000000000000 --- a/google/cloud/resourcemanager/mocks/mock_organizations_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/organizations.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_MOCKS_MOCK_ORGANIZATIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_MOCKS_MOCK_ORGANIZATIONS_CONNECTION_H - -#include "google/cloud/resourcemanager/organizations_connection.h" -#include "google/cloud/resourcemanager/v3/mocks/mock_organizations_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in resourcemanager_v3_mocks instead of the aliases -/// defined in this namespace. -namespace resourcemanager_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use resourcemanager_v3_mocks::MockOrganizationsConnection -/// directly. -using ::google::cloud::resourcemanager_v3_mocks::MockOrganizationsConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_MOCKS_MOCK_ORGANIZATIONS_CONNECTION_H diff --git a/google/cloud/resourcemanager/mocks/mock_projects_connection.h b/google/cloud/resourcemanager/mocks/mock_projects_connection.h deleted file mode 100644 index ea4c93c44cb9d..0000000000000 --- a/google/cloud/resourcemanager/mocks/mock_projects_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/projects.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_MOCKS_MOCK_PROJECTS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_MOCKS_MOCK_PROJECTS_CONNECTION_H - -#include "google/cloud/resourcemanager/projects_connection.h" -#include "google/cloud/resourcemanager/v3/mocks/mock_projects_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in resourcemanager_v3_mocks instead of the aliases -/// defined in this namespace. -namespace resourcemanager_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use resourcemanager_v3_mocks::MockProjectsConnection directly. -using ::google::cloud::resourcemanager_v3_mocks::MockProjectsConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_MOCKS_MOCK_PROJECTS_CONNECTION_H diff --git a/google/cloud/resourcemanager/organizations_client.h b/google/cloud/resourcemanager/organizations_client.h deleted file mode 100644 index 570f1f03cd7bd..0000000000000 --- a/google/cloud/resourcemanager/organizations_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/organizations.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_ORGANIZATIONS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_ORGANIZATIONS_CLIENT_H - -#include "google/cloud/resourcemanager/organizations_connection.h" -#include "google/cloud/resourcemanager/v3/organizations_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in resourcemanager_v3 instead of the aliases defined in -/// this namespace. -namespace resourcemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use resourcemanager_v3::OrganizationsClient directly. -using ::google::cloud::resourcemanager_v3::OrganizationsClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_ORGANIZATIONS_CLIENT_H diff --git a/google/cloud/resourcemanager/organizations_connection.h b/google/cloud/resourcemanager/organizations_connection.h deleted file mode 100644 index 04eb118e55070..0000000000000 --- a/google/cloud/resourcemanager/organizations_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/organizations.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_ORGANIZATIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_ORGANIZATIONS_CONNECTION_H - -#include "google/cloud/resourcemanager/organizations_connection_idempotency_policy.h" -#include "google/cloud/resourcemanager/v3/organizations_connection.h" - -namespace google { -namespace cloud { -namespace resourcemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use resourcemanager_v3::MakeOrganizationsConnection directly. -using ::google::cloud::resourcemanager_v3::MakeOrganizationsConnection; - -/// @deprecated Use resourcemanager_v3::OrganizationsConnection directly. -using ::google::cloud::resourcemanager_v3::OrganizationsConnection; - -/// @deprecated Use -/// resourcemanager_v3::OrganizationsLimitedErrorCountRetryPolicy directly. -using ::google::cloud::resourcemanager_v3:: - OrganizationsLimitedErrorCountRetryPolicy; - -/// @deprecated Use resourcemanager_v3::OrganizationsLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::resourcemanager_v3::OrganizationsLimitedTimeRetryPolicy; - -/// @deprecated Use resourcemanager_v3::OrganizationsRetryPolicy directly. -using ::google::cloud::resourcemanager_v3::OrganizationsRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_ORGANIZATIONS_CONNECTION_H diff --git a/google/cloud/resourcemanager/organizations_connection_idempotency_policy.h b/google/cloud/resourcemanager/organizations_connection_idempotency_policy.h deleted file mode 100644 index 8b9b8ec04aac5..0000000000000 --- a/google/cloud/resourcemanager/organizations_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/organizations.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_ORGANIZATIONS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_ORGANIZATIONS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/resourcemanager/v3/organizations_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace resourcemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// resourcemanager_v3::MakeDefaultOrganizationsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::resourcemanager_v3:: - MakeDefaultOrganizationsConnectionIdempotencyPolicy; - -/// @deprecated Use resourcemanager_v3::OrganizationsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::resourcemanager_v3:: - OrganizationsConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_ORGANIZATIONS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/resourcemanager/organizations_options.h b/google/cloud/resourcemanager/organizations_options.h deleted file mode 100644 index 4b36973f2a7ad..0000000000000 --- a/google/cloud/resourcemanager/organizations_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/organizations.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_ORGANIZATIONS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_ORGANIZATIONS_OPTIONS_H - -#include "google/cloud/resourcemanager/organizations_connection.h" -#include "google/cloud/resourcemanager/organizations_connection_idempotency_policy.h" -#include "google/cloud/resourcemanager/v3/organizations_options.h" - -namespace google { -namespace cloud { -namespace resourcemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use resourcemanager_v3::OrganizationsBackoffPolicyOption -/// directly. -using ::google::cloud::resourcemanager_v3::OrganizationsBackoffPolicyOption; - -/// @deprecated Use -/// resourcemanager_v3::OrganizationsConnectionIdempotencyPolicyOption directly. -using ::google::cloud::resourcemanager_v3:: - OrganizationsConnectionIdempotencyPolicyOption; - -/// @deprecated Use resourcemanager_v3::OrganizationsPolicyOptionList directly. -using ::google::cloud::resourcemanager_v3::OrganizationsPolicyOptionList; - -/// @deprecated Use resourcemanager_v3::OrganizationsRetryPolicyOption directly. -using ::google::cloud::resourcemanager_v3::OrganizationsRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_ORGANIZATIONS_OPTIONS_H diff --git a/google/cloud/resourcemanager/projects_client.h b/google/cloud/resourcemanager/projects_client.h deleted file mode 100644 index 386963ae508d8..0000000000000 --- a/google/cloud/resourcemanager/projects_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/projects.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_PROJECTS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_PROJECTS_CLIENT_H - -#include "google/cloud/resourcemanager/projects_connection.h" -#include "google/cloud/resourcemanager/v3/projects_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in resourcemanager_v3 instead of the aliases defined in -/// this namespace. -namespace resourcemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use resourcemanager_v3::ProjectsClient directly. -using ::google::cloud::resourcemanager_v3::ProjectsClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_PROJECTS_CLIENT_H diff --git a/google/cloud/resourcemanager/projects_connection.h b/google/cloud/resourcemanager/projects_connection.h deleted file mode 100644 index 6fe6d7926e88d..0000000000000 --- a/google/cloud/resourcemanager/projects_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/projects.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_PROJECTS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_PROJECTS_CONNECTION_H - -#include "google/cloud/resourcemanager/projects_connection_idempotency_policy.h" -#include "google/cloud/resourcemanager/v3/projects_connection.h" - -namespace google { -namespace cloud { -namespace resourcemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use resourcemanager_v3::MakeProjectsConnection directly. -using ::google::cloud::resourcemanager_v3::MakeProjectsConnection; - -/// @deprecated Use resourcemanager_v3::ProjectsConnection directly. -using ::google::cloud::resourcemanager_v3::ProjectsConnection; - -/// @deprecated Use resourcemanager_v3::ProjectsLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::resourcemanager_v3::ProjectsLimitedErrorCountRetryPolicy; - -/// @deprecated Use resourcemanager_v3::ProjectsLimitedTimeRetryPolicy directly. -using ::google::cloud::resourcemanager_v3::ProjectsLimitedTimeRetryPolicy; - -/// @deprecated Use resourcemanager_v3::ProjectsRetryPolicy directly. -using ::google::cloud::resourcemanager_v3::ProjectsRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_PROJECTS_CONNECTION_H diff --git a/google/cloud/resourcemanager/projects_connection_idempotency_policy.h b/google/cloud/resourcemanager/projects_connection_idempotency_policy.h deleted file mode 100644 index 5b9af7e5e0405..0000000000000 --- a/google/cloud/resourcemanager/projects_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/projects.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_PROJECTS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_PROJECTS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/resourcemanager/v3/projects_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace resourcemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// resourcemanager_v3::MakeDefaultProjectsConnectionIdempotencyPolicy directly. -using ::google::cloud::resourcemanager_v3:: - MakeDefaultProjectsConnectionIdempotencyPolicy; - -/// @deprecated Use resourcemanager_v3::ProjectsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::resourcemanager_v3::ProjectsConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_PROJECTS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/resourcemanager/projects_options.h b/google/cloud/resourcemanager/projects_options.h deleted file mode 100644 index ad370fe464328..0000000000000 --- a/google/cloud/resourcemanager/projects_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/resourcemanager/v3/projects.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_PROJECTS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_PROJECTS_OPTIONS_H - -#include "google/cloud/resourcemanager/projects_connection.h" -#include "google/cloud/resourcemanager/projects_connection_idempotency_policy.h" -#include "google/cloud/resourcemanager/v3/projects_options.h" - -namespace google { -namespace cloud { -namespace resourcemanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use resourcemanager_v3::ProjectsPollingPolicyOption directly. -using ::google::cloud::resourcemanager_v3::ProjectsPollingPolicyOption; - -/// @deprecated Use resourcemanager_v3::ProjectsBackoffPolicyOption directly. -using ::google::cloud::resourcemanager_v3::ProjectsBackoffPolicyOption; - -/// @deprecated Use -/// resourcemanager_v3::ProjectsConnectionIdempotencyPolicyOption directly. -using ::google::cloud::resourcemanager_v3:: - ProjectsConnectionIdempotencyPolicyOption; - -/// @deprecated Use resourcemanager_v3::ProjectsPolicyOptionList directly. -using ::google::cloud::resourcemanager_v3::ProjectsPolicyOptionList; - -/// @deprecated Use resourcemanager_v3::ProjectsRetryPolicyOption directly. -using ::google::cloud::resourcemanager_v3::ProjectsRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace resourcemanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_PROJECTS_OPTIONS_H diff --git a/google/cloud/resourcemanager/quickstart/.bazelrc b/google/cloud/resourcemanager/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/resourcemanager/quickstart/.bazelrc +++ b/google/cloud/resourcemanager/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/resourcemanager/quickstart/CMakeLists.txt index 53381b8e80f7a..2128b6687ecd4 100644 --- a/google/cloud/resourcemanager/quickstart/CMakeLists.txt +++ b/google/cloud/resourcemanager/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Resource Manager API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-resourcemanager-quickstart CXX) find_package(google_cloud_cpp_resourcemanager REQUIRED) diff --git a/google/cloud/resourcemanager/quickstart/WORKSPACE.bazel b/google/cloud/resourcemanager/quickstart/WORKSPACE.bazel index 9062f70a6fbea..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 = "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/resourcemanager/v3/folders_client.h b/google/cloud/resourcemanager/v3/folders_client.h index f6358bb22ad90..4436f4e3efd87 100644 --- a/google/cloud/resourcemanager/v3/folders_client.h +++ b/google/cloud/resourcemanager/v3/folders_client.h @@ -28,7 +28,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/resourcemanager/v3/folders_connection.h b/google/cloud/resourcemanager/v3/folders_connection.h index 92ede61d9d579..5368099904696 100644 --- a/google/cloud/resourcemanager/v3/folders_connection.h +++ b/google/cloud/resourcemanager/v3/folders_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_FOLDERS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_FOLDERS_CONNECTION_H +#include "google/cloud/resourcemanager/v3/folders.pb.h" #include "google/cloud/resourcemanager/v3/folders_connection_idempotency_policy.h" #include "google/cloud/resourcemanager/v3/internal/folders_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/resourcemanager/v3/folders_connection_idempotency_policy.h b/google/cloud/resourcemanager/v3/folders_connection_idempotency_policy.h index 84a39dc875953..219ac32a1fa45 100644 --- a/google/cloud/resourcemanager/v3/folders_connection_idempotency_policy.h +++ b/google/cloud/resourcemanager/v3/folders_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_FOLDERS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_FOLDERS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/resourcemanager/v3/folders.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/resourcemanager/v3/internal/folders_auth_decorator.cc b/google/cloud/resourcemanager/v3/internal/folders_auth_decorator.cc index 63dc10aa1c845..0b5b84a67da94 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_auth_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/folders_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/resourcemanager/v3/folders.proto #include "google/cloud/resourcemanager/v3/internal/folders_auth_decorator.h" -#include +#include "google/cloud/resourcemanager/v3/folders.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -265,3 +268,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/folders_auth_decorator.h b/google/cloud/resourcemanager/v3/internal/folders_auth_decorator.h index e4e8977805930..cb81fb53f518a 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_auth_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/folders_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/folders_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -152,4 +155,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_FOLDERS_AUTH_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/folders_connection_impl.h b/google/cloud/resourcemanager/v3/internal/folders_connection_impl.h index c6d5b0214daa5..f24b7e2cc53f9 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_connection_impl.h +++ b/google/cloud/resourcemanager/v3/internal/folders_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/resourcemanager/v3/internal/folders_logging_decorator.cc b/google/cloud/resourcemanager/v3/internal/folders_logging_decorator.cc index ae121d3920960..45a510c79119c 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_logging_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/folders_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/resourcemanager/v3/folders.proto #include "google/cloud/resourcemanager/v3/internal/folders_logging_decorator.h" +#include "google/cloud/resourcemanager/v3/folders.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -312,3 +315,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/folders_logging_decorator.h b/google/cloud/resourcemanager/v3/internal/folders_logging_decorator.h index 08e25fe17da5d..d5142c3c60dde 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_logging_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/folders_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/folders_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -152,4 +155,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_FOLDERS_LOGGING_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/folders_metadata_decorator.cc b/google/cloud/resourcemanager/v3/internal/folders_metadata_decorator.cc index c05b59178cd47..5cab181753ce9 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_metadata_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/folders_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/resourcemanager/v3/folders.proto #include "google/cloud/resourcemanager/v3/internal/folders_metadata_decorator.h" +#include "google/cloud/resourcemanager/v3/folders.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 resourcemanager_v3_internal { @@ -244,3 +248,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/folders_metadata_decorator.h b/google/cloud/resourcemanager/v3/internal/folders_metadata_decorator.h index 8efb23c4b19ce..18a2bd70bef22 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_metadata_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/folders_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/folders_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -157,4 +160,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_FOLDERS_METADATA_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/folders_option_defaults.cc b/google/cloud/resourcemanager/v3/internal/folders_option_defaults.cc index 9a9cd0e79ecb9..80b41cb82d1bd 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_option_defaults.cc +++ b/google/cloud/resourcemanager/v3/internal/folders_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/resourcemanager/v3/internal/folders_option_defaults.h" #include "google/cloud/resourcemanager/v3/folders_connection.h" #include "google/cloud/resourcemanager/v3/folders_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options FoldersDefaultOptions(std::string const& location, Options options) { if (!options.has()) { options.set( resourcemanager_v3::FoldersLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/resourcemanager/v3/internal/folders_stub.cc b/google/cloud/resourcemanager/v3/internal/folders_stub.cc index e5ce59e3e02b7..c23dcfbc4d84d 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_stub.cc +++ b/google/cloud/resourcemanager/v3/internal/folders_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/resourcemanager/v3/folders.proto #include "google/cloud/resourcemanager/v3/internal/folders_stub.h" +#include "google/cloud/resourcemanager/v3/folders.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -305,3 +308,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/folders_stub.h b/google/cloud/resourcemanager/v3/internal/folders_stub.h index c06951c64cdfa..7a7cc6db7def8 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_stub.h +++ b/google/cloud/resourcemanager/v3/internal/folders_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_FOLDERS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_FOLDERS_STUB_H +#include "google/cloud/resourcemanager/v3/folders.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -266,4 +269,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_FOLDERS_STUB_H diff --git a/google/cloud/resourcemanager/v3/internal/folders_stub_factory.cc b/google/cloud/resourcemanager/v3/internal/folders_stub_factory.cc index cda814a4582fc..4d82c58b2d37d 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_stub_factory.cc +++ b/google/cloud/resourcemanager/v3/internal/folders_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/resourcemanager/v3/folders.proto #include "google/cloud/resourcemanager/v3/internal/folders_stub_factory.h" +#include "google/cloud/resourcemanager/v3/folders.grpc.pb.h" #include "google/cloud/resourcemanager/v3/internal/folders_auth_decorator.h" #include "google/cloud/resourcemanager/v3/internal/folders_logging_decorator.h" #include "google/cloud/resourcemanager/v3/internal/folders_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/folders_stub_factory.h b/google/cloud/resourcemanager/v3/internal/folders_stub_factory.h index 5dd2b8439b0ca..8b693cc31d5c0 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_stub_factory.h +++ b/google/cloud/resourcemanager/v3/internal/folders_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_FOLDERS_STUB_FACTORY_H diff --git a/google/cloud/resourcemanager/v3/internal/folders_tracing_connection.cc b/google/cloud/resourcemanager/v3/internal/folders_tracing_connection.cc index 4f13f6895b45a..a067235b97ae7 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_tracing_connection.cc +++ b/google/cloud/resourcemanager/v3/internal/folders_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FoldersTracingConnection::FoldersTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -236,16 +234,12 @@ StatusOr FoldersTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFoldersTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/resourcemanager/v3/internal/folders_tracing_connection.h b/google/cloud/resourcemanager/v3/internal/folders_tracing_connection.h index 61b0e244e5087..5dd9fc215accc 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_tracing_connection.h +++ b/google/cloud/resourcemanager/v3/internal/folders_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FoldersTracingConnection : public resourcemanager_v3::FoldersConnection { public: ~FoldersTracingConnection() override = default; @@ -126,8 +124,6 @@ class FoldersTracingConnection : public resourcemanager_v3::FoldersConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/resourcemanager/v3/internal/folders_tracing_stub.cc b/google/cloud/resourcemanager/v3/internal/folders_tracing_stub.cc index 69a4d46c819d5..e71b99b0f5b4d 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_tracing_stub.cc +++ b/google/cloud/resourcemanager/v3/internal/folders_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - FoldersTracingStub::FoldersTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -266,18 +267,14 @@ future FoldersTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeFoldersTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/folders_tracing_stub.h b/google/cloud/resourcemanager/v3/internal/folders_tracing_stub.h index aa4cc570895cf..2c0c5e95c2100 100644 --- a/google/cloud/resourcemanager/v3/internal/folders_tracing_stub.h +++ b/google/cloud/resourcemanager/v3/internal/folders_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class FoldersTracingStub : public FoldersStub { public: ~FoldersTracingStub() override = default; @@ -147,8 +148,6 @@ class FoldersTracingStub : public FoldersStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -163,4 +162,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_FOLDERS_TRACING_STUB_H diff --git a/google/cloud/resourcemanager/v3/internal/organizations_auth_decorator.cc b/google/cloud/resourcemanager/v3/internal/organizations_auth_decorator.cc index 18b99ce1a2208..45a66208ab174 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_auth_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/organizations_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/resourcemanager/v3/organizations.proto #include "google/cloud/resourcemanager/v3/internal/organizations_auth_decorator.h" -#include +#include "google/cloud/resourcemanager/v3/organizations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -87,3 +90,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/organizations_auth_decorator.h b/google/cloud/resourcemanager/v3/internal/organizations_auth_decorator.h index f7f15dcdaae71..0f72e7a6d5212 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_auth_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/organizations_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -75,4 +78,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_ORGANIZATIONS_AUTH_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/organizations_logging_decorator.cc b/google/cloud/resourcemanager/v3/internal/organizations_logging_decorator.cc index 2ce6b02171bd2..5db35f944256b 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_logging_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/organizations_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/resourcemanager/v3/organizations.proto #include "google/cloud/resourcemanager/v3/internal/organizations_logging_decorator.h" +#include "google/cloud/resourcemanager/v3/organizations.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -112,3 +115,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/organizations_logging_decorator.h b/google/cloud/resourcemanager/v3/internal/organizations_logging_decorator.h index 787a302b96f0b..ee630c7247a54 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_logging_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/organizations_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -75,4 +78,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_ORGANIZATIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/organizations_metadata_decorator.cc b/google/cloud/resourcemanager/v3/internal/organizations_metadata_decorator.cc index 01b2497015f4d..afff183e8137e 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_metadata_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/organizations_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/resourcemanager/v3/organizations.proto #include "google/cloud/resourcemanager/v3/internal/organizations_metadata_decorator.h" +#include "google/cloud/resourcemanager/v3/organizations.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 resourcemanager_v3_internal { @@ -115,3 +119,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/organizations_metadata_decorator.h b/google/cloud/resourcemanager/v3/internal/organizations_metadata_decorator.h index d0179c4d1acad..c405a0fc47a2b 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_metadata_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/organizations_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -80,4 +83,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_ORGANIZATIONS_METADATA_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/organizations_option_defaults.cc b/google/cloud/resourcemanager/v3/internal/organizations_option_defaults.cc index 5a0e9fc71b9c7..ba0b407763273 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_option_defaults.cc +++ b/google/cloud/resourcemanager/v3/internal/organizations_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/resourcemanager/v3/internal/organizations_option_defaults.h" #include "google/cloud/resourcemanager/v3/organizations_connection.h" #include "google/cloud/resourcemanager/v3/organizations_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -46,7 +46,7 @@ Options OrganizationsDefaultOptions(std::string const& location, if (!options.has()) { options.set( resourcemanager_v3::OrganizationsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/resourcemanager/v3/internal/organizations_stub.cc b/google/cloud/resourcemanager/v3/internal/organizations_stub.cc index c5e73b86f84d6..951506f8c45e3 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_stub.cc +++ b/google/cloud/resourcemanager/v3/internal/organizations_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/resourcemanager/v3/organizations.proto #include "google/cloud/resourcemanager/v3/internal/organizations_stub.h" +#include "google/cloud/resourcemanager/v3/organizations.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -104,3 +107,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/organizations_stub.h b/google/cloud/resourcemanager/v3/internal/organizations_stub.h index ba0b7cbeb4bfa..13d38d73c2598 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_stub.h +++ b/google/cloud/resourcemanager/v3/internal/organizations_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_ORGANIZATIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_ORGANIZATIONS_STUB_H +#include "google/cloud/resourcemanager/v3/organizations.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -118,4 +121,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_ORGANIZATIONS_STUB_H diff --git a/google/cloud/resourcemanager/v3/internal/organizations_stub_factory.cc b/google/cloud/resourcemanager/v3/internal/organizations_stub_factory.cc index 062d3d2590114..f1a8250f788f8 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_stub_factory.cc +++ b/google/cloud/resourcemanager/v3/internal/organizations_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/resourcemanager/v3/internal/organizations_metadata_decorator.h" #include "google/cloud/resourcemanager/v3/internal/organizations_stub.h" #include "google/cloud/resourcemanager/v3/internal/organizations_tracing_stub.h" +#include "google/cloud/resourcemanager/v3/organizations.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/organizations_stub_factory.h b/google/cloud/resourcemanager/v3/internal/organizations_stub_factory.h index a0e2e42ed544f..6f078b12944be 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_stub_factory.h +++ b/google/cloud/resourcemanager/v3/internal/organizations_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_ORGANIZATIONS_STUB_FACTORY_H diff --git a/google/cloud/resourcemanager/v3/internal/organizations_tracing_connection.cc b/google/cloud/resourcemanager/v3/internal/organizations_tracing_connection.cc index 9ca76ab23ece1..5b95af10b8959 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_tracing_connection.cc +++ b/google/cloud/resourcemanager/v3/internal/organizations_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - OrganizationsTracingConnection::OrganizationsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -88,16 +86,12 @@ OrganizationsTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeOrganizationsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/resourcemanager/v3/internal/organizations_tracing_connection.h b/google/cloud/resourcemanager/v3/internal/organizations_tracing_connection.h index 559077384ea46..29f9b377e8b6d 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_tracing_connection.h +++ b/google/cloud/resourcemanager/v3/internal/organizations_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class OrganizationsTracingConnection : public resourcemanager_v3::OrganizationsConnection { public: @@ -65,8 +63,6 @@ class OrganizationsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/resourcemanager/v3/internal/organizations_tracing_stub.cc b/google/cloud/resourcemanager/v3/internal/organizations_tracing_stub.cc index 7ad7b426eb215..4ca08567ef500 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_tracing_stub.cc +++ b/google/cloud/resourcemanager/v3/internal/organizations_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - OrganizationsTracingStub::OrganizationsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -102,18 +103,14 @@ StatusOr OrganizationsTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeOrganizationsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/organizations_tracing_stub.h b/google/cloud/resourcemanager/v3/internal/organizations_tracing_stub.h index 79e14da9ad2c6..a6be8f0edc8b2 100644 --- a/google/cloud/resourcemanager/v3/internal/organizations_tracing_stub.h +++ b/google/cloud/resourcemanager/v3/internal/organizations_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class OrganizationsTracingStub : public OrganizationsStub { public: ~OrganizationsTracingStub() override = default; @@ -71,8 +72,6 @@ class OrganizationsTracingStub : public OrganizationsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -87,4 +86,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_ORGANIZATIONS_TRACING_STUB_H diff --git a/google/cloud/resourcemanager/v3/internal/projects_auth_decorator.cc b/google/cloud/resourcemanager/v3/internal/projects_auth_decorator.cc index 015a0fd398569..88bf3796a4b90 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_auth_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/projects_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/resourcemanager/v3/projects.proto #include "google/cloud/resourcemanager/v3/internal/projects_auth_decorator.h" -#include +#include "google/cloud/resourcemanager/v3/projects.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -269,3 +272,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/projects_auth_decorator.h b/google/cloud/resourcemanager/v3/internal/projects_auth_decorator.h index 21f71db62adce..d8e2c1069810c 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_auth_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/projects_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/projects_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -153,4 +156,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_PROJECTS_AUTH_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/projects_connection_impl.h b/google/cloud/resourcemanager/v3/internal/projects_connection_impl.h index 945fcdee8f3ca..1c7dfe1197dec 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_connection_impl.h +++ b/google/cloud/resourcemanager/v3/internal/projects_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/resourcemanager/v3/internal/projects_logging_decorator.cc b/google/cloud/resourcemanager/v3/internal/projects_logging_decorator.cc index 02510fa6e5c75..aa5218aea97c8 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_logging_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/projects_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/resourcemanager/v3/projects.proto #include "google/cloud/resourcemanager/v3/internal/projects_logging_decorator.h" +#include "google/cloud/resourcemanager/v3/projects.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -313,3 +316,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/projects_logging_decorator.h b/google/cloud/resourcemanager/v3/internal/projects_logging_decorator.h index 75d597b196952..316b1fe02b626 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_logging_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/projects_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/projects_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -153,4 +156,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_PROJECTS_LOGGING_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/projects_metadata_decorator.cc b/google/cloud/resourcemanager/v3/internal/projects_metadata_decorator.cc index b549fa6e1f334..52081e368d903 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_metadata_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/projects_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/resourcemanager/v3/projects.proto #include "google/cloud/resourcemanager/v3/internal/projects_metadata_decorator.h" +#include "google/cloud/resourcemanager/v3/projects.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 resourcemanager_v3_internal { @@ -245,3 +249,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/projects_metadata_decorator.h b/google/cloud/resourcemanager/v3/internal/projects_metadata_decorator.h index 19aae741fc9fd..947f88b2ecaad 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_metadata_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/projects_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/projects_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -158,4 +161,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_PROJECTS_METADATA_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/projects_option_defaults.cc b/google/cloud/resourcemanager/v3/internal/projects_option_defaults.cc index 76a6d0986d713..02e6835738b5a 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_option_defaults.cc +++ b/google/cloud/resourcemanager/v3/internal/projects_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/resourcemanager/v3/internal/projects_option_defaults.h" #include "google/cloud/resourcemanager/v3/projects_connection.h" #include "google/cloud/resourcemanager/v3/projects_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options ProjectsDefaultOptions(std::string const& location, Options options) { if (!options.has()) { options.set( resourcemanager_v3::ProjectsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/resourcemanager/v3/internal/projects_stub.cc b/google/cloud/resourcemanager/v3/internal/projects_stub.cc index de86e7e7e1692..2ba267027e95e 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_stub.cc +++ b/google/cloud/resourcemanager/v3/internal/projects_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/resourcemanager/v3/projects.proto #include "google/cloud/resourcemanager/v3/internal/projects_stub.h" +#include "google/cloud/resourcemanager/v3/projects.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -305,3 +308,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/projects_stub.h b/google/cloud/resourcemanager/v3/internal/projects_stub.h index 2c0c04dc43ba2..e3e23376c4675 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_stub.h +++ b/google/cloud/resourcemanager/v3/internal/projects_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_PROJECTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_PROJECTS_STUB_H +#include "google/cloud/resourcemanager/v3/projects.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -270,4 +273,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_PROJECTS_STUB_H diff --git a/google/cloud/resourcemanager/v3/internal/projects_stub_factory.cc b/google/cloud/resourcemanager/v3/internal/projects_stub_factory.cc index e3a2079753c1f..857b7014dd12d 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_stub_factory.cc +++ b/google/cloud/resourcemanager/v3/internal/projects_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/resourcemanager/v3/internal/projects_metadata_decorator.h" #include "google/cloud/resourcemanager/v3/internal/projects_stub.h" #include "google/cloud/resourcemanager/v3/internal/projects_tracing_stub.h" +#include "google/cloud/resourcemanager/v3/projects.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/projects_stub_factory.h b/google/cloud/resourcemanager/v3/internal/projects_stub_factory.h index d43656eb261b3..33170c637fc66 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_stub_factory.h +++ b/google/cloud/resourcemanager/v3/internal/projects_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_PROJECTS_STUB_FACTORY_H diff --git a/google/cloud/resourcemanager/v3/internal/projects_tracing_connection.cc b/google/cloud/resourcemanager/v3/internal/projects_tracing_connection.cc index ee4decb00d415..888a9eed77c4a 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_tracing_connection.cc +++ b/google/cloud/resourcemanager/v3/internal/projects_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ProjectsTracingConnection::ProjectsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -240,16 +238,12 @@ ProjectsTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeProjectsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/resourcemanager/v3/internal/projects_tracing_connection.h b/google/cloud/resourcemanager/v3/internal/projects_tracing_connection.h index 9269e2b1b9c5b..78895ee0838ac 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_tracing_connection.h +++ b/google/cloud/resourcemanager/v3/internal/projects_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ProjectsTracingConnection : public resourcemanager_v3::ProjectsConnection { public: @@ -127,8 +125,6 @@ class ProjectsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/resourcemanager/v3/internal/projects_tracing_stub.cc b/google/cloud/resourcemanager/v3/internal/projects_tracing_stub.cc index eb278c5b538a2..ca0f7b6b0cbce 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_tracing_stub.cc +++ b/google/cloud/resourcemanager/v3/internal/projects_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ProjectsTracingStub::ProjectsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -266,18 +267,14 @@ future ProjectsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeProjectsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/projects_tracing_stub.h b/google/cloud/resourcemanager/v3/internal/projects_tracing_stub.h index d30093af14c3a..c38550f244a27 100644 --- a/google/cloud/resourcemanager/v3/internal/projects_tracing_stub.h +++ b/google/cloud/resourcemanager/v3/internal/projects_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ProjectsTracingStub : public ProjectsStub { public: ~ProjectsTracingStub() override = default; @@ -148,8 +149,6 @@ class ProjectsTracingStub : public ProjectsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -164,4 +163,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_PROJECTS_TRACING_STUB_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_auth_decorator.cc b/google/cloud/resourcemanager/v3/internal/tag_bindings_auth_decorator.cc index e91ab6fc7871d..944a8d6dfce32 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_auth_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/resourcemanager/v3/tag_bindings.proto #include "google/cloud/resourcemanager/v3/internal/tag_bindings_auth_decorator.h" -#include +#include "google/cloud/resourcemanager/v3/tag_bindings.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -158,3 +161,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_auth_decorator.h b/google/cloud/resourcemanager/v3/internal/tag_bindings_auth_decorator.h index f146c10a8499a..2407ef1b88e7e 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_auth_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/tag_bindings_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -101,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_BINDINGS_AUTH_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_connection_impl.h b/google/cloud/resourcemanager/v3/internal/tag_bindings_connection_impl.h index 786298f857087..50019543d18dc 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_connection_impl.h +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_logging_decorator.cc b/google/cloud/resourcemanager/v3/internal/tag_bindings_logging_decorator.cc index a753b51839475..07a33e252e68a 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_logging_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/resourcemanager/v3/tag_bindings.proto #include "google/cloud/resourcemanager/v3/internal/tag_bindings_logging_decorator.h" +#include "google/cloud/resourcemanager/v3/tag_bindings.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -178,3 +181,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_logging_decorator.h b/google/cloud/resourcemanager/v3/internal/tag_bindings_logging_decorator.h index 9f1be453c45d2..af64739113a35 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_logging_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/tag_bindings_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -101,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_BINDINGS_LOGGING_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_metadata_decorator.cc b/google/cloud/resourcemanager/v3/internal/tag_bindings_metadata_decorator.cc index e604b67578ad9..05db6ab821fbd 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_metadata_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/resourcemanager/v3/tag_bindings.proto #include "google/cloud/resourcemanager/v3/internal/tag_bindings_metadata_decorator.h" +#include "google/cloud/resourcemanager/v3/tag_bindings.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 resourcemanager_v3_internal { @@ -151,3 +155,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_metadata_decorator.h b/google/cloud/resourcemanager/v3/internal/tag_bindings_metadata_decorator.h index b2d1f954ef8e9..47ba615c5a01e 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_metadata_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/tag_bindings_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -106,4 +109,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_BINDINGS_METADATA_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_option_defaults.cc b/google/cloud/resourcemanager/v3/internal/tag_bindings_option_defaults.cc index eba120fad0e57..88bdfb2f1df56 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_option_defaults.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/resourcemanager/v3/internal/tag_bindings_option_defaults.h" #include "google/cloud/resourcemanager/v3/tag_bindings_connection.h" #include "google/cloud/resourcemanager/v3/tag_bindings_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -46,7 +46,7 @@ Options TagBindingsDefaultOptions(std::string const& location, if (!options.has()) { options.set( resourcemanager_v3::TagBindingsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_stub.cc b/google/cloud/resourcemanager/v3/internal/tag_bindings_stub.cc index f93a2fc8fd63a..18ce134b96345 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_stub.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/resourcemanager/v3/tag_bindings.proto #include "google/cloud/resourcemanager/v3/internal/tag_bindings_stub.h" +#include "google/cloud/resourcemanager/v3/tag_bindings.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -176,3 +179,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_stub.h b/google/cloud/resourcemanager/v3/internal/tag_bindings_stub.h index 74a8a9aee2c11..f849e4037f055 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_stub.h +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_BINDINGS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_BINDINGS_STUB_H +#include "google/cloud/resourcemanager/v3/tag_bindings.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -170,4 +173,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_BINDINGS_STUB_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_stub_factory.cc b/google/cloud/resourcemanager/v3/internal/tag_bindings_stub_factory.cc index d8eb627229b98..f8c1a6181a563 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_stub_factory.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/resourcemanager/v3/internal/tag_bindings_metadata_decorator.h" #include "google/cloud/resourcemanager/v3/internal/tag_bindings_stub.h" #include "google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_stub.h" +#include "google/cloud/resourcemanager/v3/tag_bindings.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_stub_factory.h b/google/cloud/resourcemanager/v3/internal/tag_bindings_stub_factory.h index 5f12d128e6b2f..167d1704fb880 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_stub_factory.h +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_BINDINGS_STUB_FACTORY_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_connection.cc b/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_connection.cc index 35661217c0f7a..fe6eff8f75731 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_connection.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TagBindingsTracingConnection::TagBindingsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -130,16 +128,12 @@ TagBindingsTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTagBindingsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_connection.h b/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_connection.h index b78993bfe4b4c..f3d7ba5095408 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_connection.h +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TagBindingsTracingConnection : public resourcemanager_v3::TagBindingsConnection { public: @@ -81,8 +79,6 @@ class TagBindingsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_stub.cc b/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_stub.cc index 6911838dd830f..cdb3c5f6b07d1 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_stub.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TagBindingsTracingStub::TagBindingsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -154,18 +155,14 @@ future TagBindingsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTagBindingsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_stub.h b/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_stub.h index 0d2b5dbdf8e36..b9a3651518ba4 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_stub.h +++ b/google/cloud/resourcemanager/v3/internal/tag_bindings_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TagBindingsTracingStub : public TagBindingsStub { public: ~TagBindingsTracingStub() override = default; @@ -96,8 +97,6 @@ class TagBindingsTracingStub : public TagBindingsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -112,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_BINDINGS_TRACING_STUB_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_auth_decorator.cc b/google/cloud/resourcemanager/v3/internal/tag_holds_auth_decorator.cc index a3db0f70d7b3d..1435943190748 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_auth_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/resourcemanager/v3/tag_holds.proto #include "google/cloud/resourcemanager/v3/internal/tag_holds_auth_decorator.h" -#include +#include "google/cloud/resourcemanager/v3/tag_holds.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -144,3 +147,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_auth_decorator.h b/google/cloud/resourcemanager/v3/internal/tag_holds_auth_decorator.h index 9f84d729c5202..a5bb75a23f10b 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_auth_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/tag_holds_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_HOLDS_AUTH_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_connection_impl.h b/google/cloud/resourcemanager/v3/internal/tag_holds_connection_impl.h index 44f6ebdb9a222..150a4c78736ee 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_connection_impl.h +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_logging_decorator.cc b/google/cloud/resourcemanager/v3/internal/tag_holds_logging_decorator.cc index 7a856bd9ad6a8..b0a0faf6cc661 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_logging_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/resourcemanager/v3/tag_holds.proto #include "google/cloud/resourcemanager/v3/internal/tag_holds_logging_decorator.h" +#include "google/cloud/resourcemanager/v3/tag_holds.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -160,3 +163,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_logging_decorator.h b/google/cloud/resourcemanager/v3/internal/tag_holds_logging_decorator.h index b85d86a325324..670677731e278 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_logging_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/tag_holds_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_HOLDS_LOGGING_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_metadata_decorator.cc b/google/cloud/resourcemanager/v3/internal/tag_holds_metadata_decorator.cc index ed391988d002b..5a3aeb5d9e0a5 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_metadata_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/resourcemanager/v3/tag_holds.proto #include "google/cloud/resourcemanager/v3/internal/tag_holds_metadata_decorator.h" +#include "google/cloud/resourcemanager/v3/tag_holds.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 resourcemanager_v3_internal { @@ -141,3 +145,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_metadata_decorator.h b/google/cloud/resourcemanager/v3/internal/tag_holds_metadata_decorator.h index 45b426c90b5b0..0e8c0f470ffd3 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_metadata_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/tag_holds_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -99,4 +102,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_HOLDS_METADATA_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_option_defaults.cc b/google/cloud/resourcemanager/v3/internal/tag_holds_option_defaults.cc index 525e92f6b2379..44d3de55aa00c 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_option_defaults.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/resourcemanager/v3/internal/tag_holds_option_defaults.h" #include "google/cloud/resourcemanager/v3/tag_holds_connection.h" #include "google/cloud/resourcemanager/v3/tag_holds_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options TagHoldsDefaultOptions(std::string const& location, Options options) { if (!options.has()) { options.set( resourcemanager_v3::TagHoldsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_stub.cc b/google/cloud/resourcemanager/v3/internal/tag_holds_stub.cc index e737b5b1aa48c..233aee8119fa9 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_stub.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/resourcemanager/v3/tag_holds.proto #include "google/cloud/resourcemanager/v3/internal/tag_holds_stub.h" +#include "google/cloud/resourcemanager/v3/tag_holds.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -157,3 +160,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_stub.h b/google/cloud/resourcemanager/v3/internal/tag_holds_stub.h index e95286d3fc407..23bc39d288c08 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_stub.h +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_HOLDS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_HOLDS_STUB_H +#include "google/cloud/resourcemanager/v3/tag_holds.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -152,4 +155,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_HOLDS_STUB_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_stub_factory.cc b/google/cloud/resourcemanager/v3/internal/tag_holds_stub_factory.cc index e337c837a09e8..62288542d1fec 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_stub_factory.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/resourcemanager/v3/internal/tag_holds_metadata_decorator.h" #include "google/cloud/resourcemanager/v3/internal/tag_holds_stub.h" #include "google/cloud/resourcemanager/v3/internal/tag_holds_tracing_stub.h" +#include "google/cloud/resourcemanager/v3/tag_holds.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_stub_factory.h b/google/cloud/resourcemanager/v3/internal/tag_holds_stub_factory.h index 5b6b9c06abc8c..c3a91c4c696d6 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_stub_factory.h +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_HOLDS_STUB_FACTORY_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_connection.cc b/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_connection.cc index 7712c9dd2a6cf..6cf2e944e2f6d 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_connection.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TagHoldsTracingConnection::TagHoldsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -110,16 +108,12 @@ TagHoldsTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTagHoldsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_connection.h b/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_connection.h index 4485de39ff377..71a62dcd23852 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_connection.h +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TagHoldsTracingConnection : public resourcemanager_v3::TagHoldsConnection { public: @@ -74,8 +72,6 @@ class TagHoldsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_stub.cc b/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_stub.cc index 0a590f2805da6..2661a9daff124 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_stub.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TagHoldsTracingStub::TagHoldsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -132,18 +133,14 @@ future TagHoldsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTagHoldsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_stub.h b/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_stub.h index 7b43a9b0147c6..831aabd74d8ad 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_stub.h +++ b/google/cloud/resourcemanager/v3/internal/tag_holds_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TagHoldsTracingStub : public TagHoldsStub { public: ~TagHoldsTracingStub() override = default; @@ -89,8 +90,6 @@ class TagHoldsTracingStub : public TagHoldsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -105,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_HOLDS_TRACING_STUB_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_auth_decorator.cc b/google/cloud/resourcemanager/v3/internal/tag_keys_auth_decorator.cc index fae3364235f90..042b6518e4c2c 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_auth_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/resourcemanager/v3/tag_keys.proto #include "google/cloud/resourcemanager/v3/internal/tag_keys_auth_decorator.h" -#include +#include "google/cloud/resourcemanager/v3/tag_keys.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -211,3 +214,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_auth_decorator.h b/google/cloud/resourcemanager/v3/internal/tag_keys_auth_decorator.h index 5179f8b3c1a24..2ddef5a898097 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_auth_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/tag_keys_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -128,4 +131,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_KEYS_AUTH_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_connection_impl.h b/google/cloud/resourcemanager/v3/internal/tag_keys_connection_impl.h index e27ba357012bd..516bbde8f34fa 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_connection_impl.h +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_logging_decorator.cc b/google/cloud/resourcemanager/v3/internal/tag_keys_logging_decorator.cc index 529f22f4fed9e..fb6abb11dc47f 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_logging_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/resourcemanager/v3/tag_keys.proto #include "google/cloud/resourcemanager/v3/internal/tag_keys_logging_decorator.h" +#include "google/cloud/resourcemanager/v3/tag_keys.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -252,3 +255,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_logging_decorator.h b/google/cloud/resourcemanager/v3/internal/tag_keys_logging_decorator.h index 38fefd78473fb..050f2f21db8c6 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_logging_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/tag_keys_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -128,4 +131,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_KEYS_LOGGING_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_metadata_decorator.cc b/google/cloud/resourcemanager/v3/internal/tag_keys_metadata_decorator.cc index 220c2cb9d4c98..f8572f7cb1562 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_metadata_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/resourcemanager/v3/tag_keys.proto #include "google/cloud/resourcemanager/v3/internal/tag_keys_metadata_decorator.h" +#include "google/cloud/resourcemanager/v3/tag_keys.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 resourcemanager_v3_internal { @@ -205,3 +209,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_metadata_decorator.h b/google/cloud/resourcemanager/v3/internal/tag_keys_metadata_decorator.h index 8dbefce59b10b..54031ba7d605e 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_metadata_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/tag_keys_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -133,4 +136,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_KEYS_METADATA_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_option_defaults.cc b/google/cloud/resourcemanager/v3/internal/tag_keys_option_defaults.cc index 10d3b9b6de000..9a973beb9b4a6 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_option_defaults.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/resourcemanager/v3/internal/tag_keys_option_defaults.h" #include "google/cloud/resourcemanager/v3/tag_keys_connection.h" #include "google/cloud/resourcemanager/v3/tag_keys_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options TagKeysDefaultOptions(std::string const& location, Options options) { if (!options.has()) { options.set( resourcemanager_v3::TagKeysLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_stub.cc b/google/cloud/resourcemanager/v3/internal/tag_keys_stub.cc index 7d5c5340e4dc7..6069587d490c7 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_stub.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/resourcemanager/v3/tag_keys.proto #include "google/cloud/resourcemanager/v3/internal/tag_keys_stub.h" +#include "google/cloud/resourcemanager/v3/tag_keys.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -246,3 +249,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_stub.h b/google/cloud/resourcemanager/v3/internal/tag_keys_stub.h index 550cb7d3ad372..43558e453b61d 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_stub.h +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_KEYS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_KEYS_STUB_H +#include "google/cloud/resourcemanager/v3/tag_keys.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -221,4 +224,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_KEYS_STUB_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_stub_factory.cc b/google/cloud/resourcemanager/v3/internal/tag_keys_stub_factory.cc index 68a9d77e2306c..d72d903b90def 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_stub_factory.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/resourcemanager/v3/internal/tag_keys_metadata_decorator.h" #include "google/cloud/resourcemanager/v3/internal/tag_keys_stub.h" #include "google/cloud/resourcemanager/v3/internal/tag_keys_tracing_stub.h" +#include "google/cloud/resourcemanager/v3/tag_keys.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_stub_factory.h b/google/cloud/resourcemanager/v3/internal/tag_keys_stub_factory.h index 108179a690357..4a2840deb3fdd 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_stub_factory.h +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_KEYS_STUB_FACTORY_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_connection.cc b/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_connection.cc index a9ad61dd32669..ce56ae8956735 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_connection.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TagKeysTracingConnection::TagKeysTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -178,16 +176,12 @@ StatusOr TagKeysTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTagKeysTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_connection.h b/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_connection.h index ad0c93454f6e8..6271420ace55d 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_connection.h +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TagKeysTracingConnection : public resourcemanager_v3::TagKeysConnection { public: ~TagKeysTracingConnection() override = default; @@ -102,8 +100,6 @@ class TagKeysTracingConnection : public resourcemanager_v3::TagKeysConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_stub.cc b/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_stub.cc index 837efae9e26c9..7cdfea75dd4f8 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_stub.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TagKeysTracingStub::TagKeysTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -216,18 +217,14 @@ future TagKeysTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTagKeysTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_stub.h b/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_stub.h index c74c3b0ba351c..e74128225f00b 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_stub.h +++ b/google/cloud/resourcemanager/v3/internal/tag_keys_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TagKeysTracingStub : public TagKeysStub { public: ~TagKeysTracingStub() override = default; @@ -123,8 +124,6 @@ class TagKeysTracingStub : public TagKeysStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -139,4 +138,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_KEYS_TRACING_STUB_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_auth_decorator.cc b/google/cloud/resourcemanager/v3/internal/tag_values_auth_decorator.cc index b4cfe228b197a..267c29e801392 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_auth_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_values_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/resourcemanager/v3/tag_values.proto #include "google/cloud/resourcemanager/v3/internal/tag_values_auth_decorator.h" -#include +#include "google/cloud/resourcemanager/v3/tag_values.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -216,3 +219,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_auth_decorator.h b/google/cloud/resourcemanager/v3/internal/tag_values_auth_decorator.h index 4b278fbe24ded..7fa445085fa76 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_auth_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/tag_values_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/tag_values_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -128,4 +131,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_VALUES_AUTH_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_connection_impl.h b/google/cloud/resourcemanager/v3/internal/tag_values_connection_impl.h index 06581bde0b29e..a1e719c398e6b 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_connection_impl.h +++ b/google/cloud/resourcemanager/v3/internal/tag_values_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_logging_decorator.cc b/google/cloud/resourcemanager/v3/internal/tag_values_logging_decorator.cc index 044c0af2cc0ca..112bc42ad3c26 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_logging_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_values_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/resourcemanager/v3/tag_values.proto #include "google/cloud/resourcemanager/v3/internal/tag_values_logging_decorator.h" +#include "google/cloud/resourcemanager/v3/tag_values.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -252,3 +255,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_logging_decorator.h b/google/cloud/resourcemanager/v3/internal/tag_values_logging_decorator.h index f16fcf0db7e79..6779bb1f6a46a 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_logging_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/tag_values_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/tag_values_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -128,4 +131,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_VALUES_LOGGING_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_metadata_decorator.cc b/google/cloud/resourcemanager/v3/internal/tag_values_metadata_decorator.cc index 2b59196d5934e..e72500d04cf26 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_metadata_decorator.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_values_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/resourcemanager/v3/tag_values.proto #include "google/cloud/resourcemanager/v3/internal/tag_values_metadata_decorator.h" +#include "google/cloud/resourcemanager/v3/tag_values.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 resourcemanager_v3_internal { @@ -206,3 +210,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_metadata_decorator.h b/google/cloud/resourcemanager/v3/internal/tag_values_metadata_decorator.h index ff7334169b932..07ecac15a1384 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_metadata_decorator.h +++ b/google/cloud/resourcemanager/v3/internal/tag_values_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/resourcemanager/v3/internal/tag_values_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 resourcemanager_v3_internal { @@ -133,4 +136,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_VALUES_METADATA_DECORATOR_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_option_defaults.cc b/google/cloud/resourcemanager/v3/internal/tag_values_option_defaults.cc index 364ae1551ec92..dbb57113f6838 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_option_defaults.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_values_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/resourcemanager/v3/internal/tag_values_option_defaults.h" #include "google/cloud/resourcemanager/v3/tag_values_connection.h" #include "google/cloud/resourcemanager/v3/tag_values_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -45,7 +45,7 @@ Options TagValuesDefaultOptions(std::string const& location, Options options) { if (!options.has()) { options.set( resourcemanager_v3::TagValuesLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_stub.cc b/google/cloud/resourcemanager/v3/internal/tag_values_stub.cc index 0c4f284bb2ede..3382935f3d6cd 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_stub.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_values_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/resourcemanager/v3/tag_values.proto #include "google/cloud/resourcemanager/v3/internal/tag_values_stub.h" +#include "google/cloud/resourcemanager/v3/tag_values.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -246,3 +249,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_stub.h b/google/cloud/resourcemanager/v3/internal/tag_values_stub.h index 13c978c154085..fe6ffd23a2bf2 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_stub.h +++ b/google/cloud/resourcemanager/v3/internal/tag_values_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_VALUES_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_VALUES_STUB_H +#include "google/cloud/resourcemanager/v3/tag_values.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -222,4 +225,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_VALUES_STUB_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_stub_factory.cc b/google/cloud/resourcemanager/v3/internal/tag_values_stub_factory.cc index 59d039c5d16ab..e791e1903ff02 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_stub_factory.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_values_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/resourcemanager/v3/internal/tag_values_metadata_decorator.h" #include "google/cloud/resourcemanager/v3/internal/tag_values_stub.h" #include "google/cloud/resourcemanager/v3/internal/tag_values_tracing_stub.h" +#include "google/cloud/resourcemanager/v3/tag_values.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_stub_factory.h b/google/cloud/resourcemanager/v3/internal/tag_values_stub_factory.h index 42d596f14f024..5f5d47668b481 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_stub_factory.h +++ b/google/cloud/resourcemanager/v3/internal/tag_values_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_VALUES_STUB_FACTORY_H diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_tracing_connection.cc b/google/cloud/resourcemanager/v3/internal/tag_values_tracing_connection.cc index cc20472b63299..c96bcda8a4c1e 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_tracing_connection.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_values_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TagValuesTracingConnection::TagValuesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -185,16 +183,12 @@ TagValuesTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTagValuesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_tracing_connection.h b/google/cloud/resourcemanager/v3/internal/tag_values_tracing_connection.h index 53bc2779c17a3..68b1b92a63d94 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_tracing_connection.h +++ b/google/cloud/resourcemanager/v3/internal/tag_values_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TagValuesTracingConnection : public resourcemanager_v3::TagValuesConnection { public: @@ -104,8 +102,6 @@ class TagValuesTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_tracing_stub.cc b/google/cloud/resourcemanager/v3/internal/tag_values_tracing_stub.cc index 6d4ef6b6a9037..ffb6e6cebb92b 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_tracing_stub.cc +++ b/google/cloud/resourcemanager/v3/internal/tag_values_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TagValuesTracingStub::TagValuesTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -219,18 +220,14 @@ future TagValuesTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTagValuesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace resourcemanager_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/resourcemanager/v3/internal/tag_values_tracing_stub.h b/google/cloud/resourcemanager/v3/internal/tag_values_tracing_stub.h index e02a3bcf0ac63..9cb40d8de4030 100644 --- a/google/cloud/resourcemanager/v3/internal/tag_values_tracing_stub.h +++ b/google/cloud/resourcemanager/v3/internal/tag_values_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace resourcemanager_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TagValuesTracingStub : public TagValuesStub { public: ~TagValuesTracingStub() override = default; @@ -123,8 +124,6 @@ class TagValuesTracingStub : public TagValuesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -139,4 +138,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_INTERNAL_TAG_VALUES_TRACING_STUB_H diff --git a/google/cloud/resourcemanager/v3/organizations_connection.h b/google/cloud/resourcemanager/v3/organizations_connection.h index a4c93743610a8..51dbe07a01c66 100644 --- a/google/cloud/resourcemanager/v3/organizations_connection.h +++ b/google/cloud/resourcemanager/v3/organizations_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_ORGANIZATIONS_CONNECTION_H #include "google/cloud/resourcemanager/v3/internal/organizations_retry_traits.h" +#include "google/cloud/resourcemanager/v3/organizations.pb.h" #include "google/cloud/resourcemanager/v3/organizations_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/resourcemanager/v3/organizations_connection_idempotency_policy.h b/google/cloud/resourcemanager/v3/organizations_connection_idempotency_policy.h index 291d35217cf59..b6612e0ec6eec 100644 --- a/google/cloud/resourcemanager/v3/organizations_connection_idempotency_policy.h +++ b/google/cloud/resourcemanager/v3/organizations_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_ORGANIZATIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_ORGANIZATIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/resourcemanager/v3/organizations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/resourcemanager/v3/projects_client.h b/google/cloud/resourcemanager/v3/projects_client.h index 1c5e6470389c1..a8a26af3ae247 100644 --- a/google/cloud/resourcemanager/v3/projects_client.h +++ b/google/cloud/resourcemanager/v3/projects_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/resourcemanager/v3/projects_connection.h b/google/cloud/resourcemanager/v3/projects_connection.h index 9a67a0467220f..3d2e222e455c0 100644 --- a/google/cloud/resourcemanager/v3/projects_connection.h +++ b/google/cloud/resourcemanager/v3/projects_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_PROJECTS_CONNECTION_H #include "google/cloud/resourcemanager/v3/internal/projects_retry_traits.h" +#include "google/cloud/resourcemanager/v3/projects.pb.h" #include "google/cloud/resourcemanager/v3/projects_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/resourcemanager/v3/projects_connection_idempotency_policy.h b/google/cloud/resourcemanager/v3/projects_connection_idempotency_policy.h index 0ac4b06c7d67d..e3e2791224510 100644 --- a/google/cloud/resourcemanager/v3/projects_connection_idempotency_policy.h +++ b/google/cloud/resourcemanager/v3/projects_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_PROJECTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_PROJECTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/resourcemanager/v3/projects.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/resourcemanager/v3/tag_bindings_client.h b/google/cloud/resourcemanager/v3/tag_bindings_client.h index d7b1656c417b1..c1f875e356551 100644 --- a/google/cloud/resourcemanager/v3/tag_bindings_client.h +++ b/google/cloud/resourcemanager/v3/tag_bindings_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/resourcemanager/v3/tag_bindings_connection.h b/google/cloud/resourcemanager/v3/tag_bindings_connection.h index 123c51f5ca76f..99d53b86f1420 100644 --- a/google/cloud/resourcemanager/v3/tag_bindings_connection.h +++ b/google/cloud/resourcemanager/v3/tag_bindings_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_TAG_BINDINGS_CONNECTION_H #include "google/cloud/resourcemanager/v3/internal/tag_bindings_retry_traits.h" +#include "google/cloud/resourcemanager/v3/tag_bindings.pb.h" #include "google/cloud/resourcemanager/v3/tag_bindings_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/resourcemanager/v3/tag_bindings_connection_idempotency_policy.h b/google/cloud/resourcemanager/v3/tag_bindings_connection_idempotency_policy.h index 08b3c50fe5f24..30db957ec7988 100644 --- a/google/cloud/resourcemanager/v3/tag_bindings_connection_idempotency_policy.h +++ b/google/cloud/resourcemanager/v3/tag_bindings_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_TAG_BINDINGS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_TAG_BINDINGS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/resourcemanager/v3/tag_bindings.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/resourcemanager/v3/tag_holds_client.h b/google/cloud/resourcemanager/v3/tag_holds_client.h index e3fe6251b4624..022cbfc381afd 100644 --- a/google/cloud/resourcemanager/v3/tag_holds_client.h +++ b/google/cloud/resourcemanager/v3/tag_holds_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/resourcemanager/v3/tag_holds_connection.h b/google/cloud/resourcemanager/v3/tag_holds_connection.h index c9ef69a2feba1..98943d28aee55 100644 --- a/google/cloud/resourcemanager/v3/tag_holds_connection.h +++ b/google/cloud/resourcemanager/v3/tag_holds_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_TAG_HOLDS_CONNECTION_H #include "google/cloud/resourcemanager/v3/internal/tag_holds_retry_traits.h" +#include "google/cloud/resourcemanager/v3/tag_holds.pb.h" #include "google/cloud/resourcemanager/v3/tag_holds_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/resourcemanager/v3/tag_holds_connection_idempotency_policy.h b/google/cloud/resourcemanager/v3/tag_holds_connection_idempotency_policy.h index fafa0875801a4..31e39c2e6f2a7 100644 --- a/google/cloud/resourcemanager/v3/tag_holds_connection_idempotency_policy.h +++ b/google/cloud/resourcemanager/v3/tag_holds_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_TAG_HOLDS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_TAG_HOLDS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/resourcemanager/v3/tag_holds.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/resourcemanager/v3/tag_keys_client.h b/google/cloud/resourcemanager/v3/tag_keys_client.h index 97ca149b0ede1..20eaf2d84b3ac 100644 --- a/google/cloud/resourcemanager/v3/tag_keys_client.h +++ b/google/cloud/resourcemanager/v3/tag_keys_client.h @@ -28,7 +28,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/resourcemanager/v3/tag_keys_connection.h b/google/cloud/resourcemanager/v3/tag_keys_connection.h index 66325751689a5..67df67e239439 100644 --- a/google/cloud/resourcemanager/v3/tag_keys_connection.h +++ b/google/cloud/resourcemanager/v3/tag_keys_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_TAG_KEYS_CONNECTION_H #include "google/cloud/resourcemanager/v3/internal/tag_keys_retry_traits.h" +#include "google/cloud/resourcemanager/v3/tag_keys.pb.h" #include "google/cloud/resourcemanager/v3/tag_keys_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/resourcemanager/v3/tag_keys_connection_idempotency_policy.h b/google/cloud/resourcemanager/v3/tag_keys_connection_idempotency_policy.h index 846bd5a5b766e..ffa1762198835 100644 --- a/google/cloud/resourcemanager/v3/tag_keys_connection_idempotency_policy.h +++ b/google/cloud/resourcemanager/v3/tag_keys_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_TAG_KEYS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_TAG_KEYS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/resourcemanager/v3/tag_keys.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/resourcemanager/v3/tag_values_client.h b/google/cloud/resourcemanager/v3/tag_values_client.h index 4b2d5ab5cc8b6..408551f49cbdf 100644 --- a/google/cloud/resourcemanager/v3/tag_values_client.h +++ b/google/cloud/resourcemanager/v3/tag_values_client.h @@ -28,7 +28,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/resourcemanager/v3/tag_values_connection.h b/google/cloud/resourcemanager/v3/tag_values_connection.h index f278e87acef8a..48e3064cd450b 100644 --- a/google/cloud/resourcemanager/v3/tag_values_connection.h +++ b/google/cloud/resourcemanager/v3/tag_values_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_TAG_VALUES_CONNECTION_H #include "google/cloud/resourcemanager/v3/internal/tag_values_retry_traits.h" +#include "google/cloud/resourcemanager/v3/tag_values.pb.h" #include "google/cloud/resourcemanager/v3/tag_values_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/resourcemanager/v3/tag_values_connection_idempotency_policy.h b/google/cloud/resourcemanager/v3/tag_values_connection_idempotency_policy.h index d2dddbd791db3..7b94014527264 100644 --- a/google/cloud/resourcemanager/v3/tag_values_connection_idempotency_policy.h +++ b/google/cloud/resourcemanager/v3/tag_values_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_TAG_VALUES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RESOURCEMANAGER_V3_TAG_VALUES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/resourcemanager/v3/tag_values.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/BUILD.bazel b/google/cloud/retail/BUILD.bazel index 4481503e6194b..66ddfb8fe3f50 100644 --- a/google/cloud/retail/BUILD.bazel +++ b/google/cloud/retail/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/retail/v2:retail_cc_grpc", + "@googleapis//google/cloud/retail/v2:retail_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/retail/CMakeLists.txt b/google/cloud/retail/CMakeLists.txt index be28238a9467a..3fae2da7d02ff 100644 --- a/google/cloud/retail/CMakeLists.txt +++ b/google/cloud/retail/CMakeLists.txt @@ -16,8 +16,7 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library(retail "Retail API" SERVICE_DIRS "__EMPTY__" - "v2/") +google_cloud_cpp_add_gapic_library(retail "Retail API" SERVICE_DIRS "v2/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(retail_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/retail/catalog_client.h b/google/cloud/retail/catalog_client.h deleted file mode 100644 index 5bf15bb2f33b4..0000000000000 --- a/google/cloud/retail/catalog_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/catalog_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_CATALOG_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_CATALOG_CLIENT_H - -#include "google/cloud/retail/catalog_connection.h" -#include "google/cloud/retail/v2/catalog_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in retail_v2 instead of the aliases defined in -/// this namespace. -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::CatalogServiceClient directly. -using ::google::cloud::retail_v2::CatalogServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_CATALOG_CLIENT_H diff --git a/google/cloud/retail/catalog_connection.h b/google/cloud/retail/catalog_connection.h deleted file mode 100644 index 3c54b08608104..0000000000000 --- a/google/cloud/retail/catalog_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/catalog_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_CATALOG_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_CATALOG_CONNECTION_H - -#include "google/cloud/retail/catalog_connection_idempotency_policy.h" -#include "google/cloud/retail/v2/catalog_connection.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::MakeCatalogServiceConnection directly. -using ::google::cloud::retail_v2::MakeCatalogServiceConnection; - -/// @deprecated Use retail_v2::CatalogServiceConnection directly. -using ::google::cloud::retail_v2::CatalogServiceConnection; - -/// @deprecated Use retail_v2::CatalogServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::retail_v2::CatalogServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use retail_v2::CatalogServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::retail_v2::CatalogServiceLimitedTimeRetryPolicy; - -/// @deprecated Use retail_v2::CatalogServiceRetryPolicy directly. -using ::google::cloud::retail_v2::CatalogServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_CATALOG_CONNECTION_H diff --git a/google/cloud/retail/catalog_connection_idempotency_policy.h b/google/cloud/retail/catalog_connection_idempotency_policy.h deleted file mode 100644 index 32b6e463b179f..0000000000000 --- a/google/cloud/retail/catalog_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/catalog_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/retail/v2/catalog_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// retail_v2::MakeDefaultCatalogServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::retail_v2:: - MakeDefaultCatalogServiceConnectionIdempotencyPolicy; - -/// @deprecated Use retail_v2::CatalogServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::retail_v2::CatalogServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/retail/catalog_options.h b/google/cloud/retail/catalog_options.h deleted file mode 100644 index 6720890fab1e1..0000000000000 --- a/google/cloud/retail/catalog_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/catalog_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_CATALOG_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_CATALOG_OPTIONS_H - -#include "google/cloud/retail/catalog_connection.h" -#include "google/cloud/retail/catalog_connection_idempotency_policy.h" -#include "google/cloud/retail/v2/catalog_options.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::CatalogServiceBackoffPolicyOption directly. -using ::google::cloud::retail_v2::CatalogServiceBackoffPolicyOption; - -/// @deprecated Use retail_v2::CatalogServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::retail_v2:: - CatalogServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use retail_v2::CatalogServicePolicyOptionList directly. -using ::google::cloud::retail_v2::CatalogServicePolicyOptionList; - -/// @deprecated Use retail_v2::CatalogServiceRetryPolicyOption directly. -using ::google::cloud::retail_v2::CatalogServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_CATALOG_OPTIONS_H diff --git a/google/cloud/retail/completion_client.h b/google/cloud/retail/completion_client.h deleted file mode 100644 index 150c0be77b99a..0000000000000 --- a/google/cloud/retail/completion_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/completion_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_COMPLETION_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_COMPLETION_CLIENT_H - -#include "google/cloud/retail/completion_connection.h" -#include "google/cloud/retail/v2/completion_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in retail_v2 instead of the aliases defined in -/// this namespace. -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::CompletionServiceClient directly. -using ::google::cloud::retail_v2::CompletionServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_COMPLETION_CLIENT_H diff --git a/google/cloud/retail/completion_connection.h b/google/cloud/retail/completion_connection.h deleted file mode 100644 index de3992ee9c8d7..0000000000000 --- a/google/cloud/retail/completion_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/completion_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_COMPLETION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_COMPLETION_CONNECTION_H - -#include "google/cloud/retail/completion_connection_idempotency_policy.h" -#include "google/cloud/retail/v2/completion_connection.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::MakeCompletionServiceConnection directly. -using ::google::cloud::retail_v2::MakeCompletionServiceConnection; - -/// @deprecated Use retail_v2::CompletionServiceConnection directly. -using ::google::cloud::retail_v2::CompletionServiceConnection; - -/// @deprecated Use retail_v2::CompletionServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::retail_v2::CompletionServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use retail_v2::CompletionServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::retail_v2::CompletionServiceLimitedTimeRetryPolicy; - -/// @deprecated Use retail_v2::CompletionServiceRetryPolicy directly. -using ::google::cloud::retail_v2::CompletionServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_COMPLETION_CONNECTION_H diff --git a/google/cloud/retail/completion_connection_idempotency_policy.h b/google/cloud/retail/completion_connection_idempotency_policy.h deleted file mode 100644 index 5a6c4dd5276c5..0000000000000 --- a/google/cloud/retail/completion_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/completion_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_COMPLETION_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_COMPLETION_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/retail/v2/completion_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// retail_v2::MakeDefaultCompletionServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::retail_v2:: - MakeDefaultCompletionServiceConnectionIdempotencyPolicy; - -/// @deprecated Use retail_v2::CompletionServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::retail_v2::CompletionServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_COMPLETION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/retail/completion_options.h b/google/cloud/retail/completion_options.h deleted file mode 100644 index eab9c65ab81fd..0000000000000 --- a/google/cloud/retail/completion_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/completion_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_COMPLETION_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_COMPLETION_OPTIONS_H - -#include "google/cloud/retail/completion_connection.h" -#include "google/cloud/retail/completion_connection_idempotency_policy.h" -#include "google/cloud/retail/v2/completion_options.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::CompletionServicePollingPolicyOption directly. -using ::google::cloud::retail_v2::CompletionServicePollingPolicyOption; - -/// @deprecated Use retail_v2::CompletionServiceBackoffPolicyOption directly. -using ::google::cloud::retail_v2::CompletionServiceBackoffPolicyOption; - -/// @deprecated Use -/// retail_v2::CompletionServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::retail_v2:: - CompletionServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use retail_v2::CompletionServicePolicyOptionList directly. -using ::google::cloud::retail_v2::CompletionServicePolicyOptionList; - -/// @deprecated Use retail_v2::CompletionServiceRetryPolicyOption directly. -using ::google::cloud::retail_v2::CompletionServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_COMPLETION_OPTIONS_H diff --git a/google/cloud/retail/mocks/mock_catalog_connection.h b/google/cloud/retail/mocks/mock_catalog_connection.h deleted file mode 100644 index 09937f7ef4027..0000000000000 --- a/google/cloud/retail/mocks/mock_catalog_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/catalog_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_CATALOG_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_CATALOG_CONNECTION_H - -#include "google/cloud/retail/catalog_connection.h" -#include "google/cloud/retail/v2/mocks/mock_catalog_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in retail_v2_mocks instead of the aliases -/// defined in this namespace. -namespace retail_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2_mocks::MockCatalogServiceConnection directly. -using ::google::cloud::retail_v2_mocks::MockCatalogServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_CATALOG_CONNECTION_H diff --git a/google/cloud/retail/mocks/mock_completion_connection.h b/google/cloud/retail/mocks/mock_completion_connection.h deleted file mode 100644 index 0e393d0d53b27..0000000000000 --- a/google/cloud/retail/mocks/mock_completion_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/completion_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_COMPLETION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_COMPLETION_CONNECTION_H - -#include "google/cloud/retail/completion_connection.h" -#include "google/cloud/retail/v2/mocks/mock_completion_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in retail_v2_mocks instead of the aliases -/// defined in this namespace. -namespace retail_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2_mocks::MockCompletionServiceConnection directly. -using ::google::cloud::retail_v2_mocks::MockCompletionServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_COMPLETION_CONNECTION_H diff --git a/google/cloud/retail/mocks/mock_prediction_connection.h b/google/cloud/retail/mocks/mock_prediction_connection.h deleted file mode 100644 index 68c508cbaf8d8..0000000000000 --- a/google/cloud/retail/mocks/mock_prediction_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/prediction_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_PREDICTION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_PREDICTION_CONNECTION_H - -#include "google/cloud/retail/prediction_connection.h" -#include "google/cloud/retail/v2/mocks/mock_prediction_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in retail_v2_mocks instead of the aliases -/// defined in this namespace. -namespace retail_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2_mocks::MockPredictionServiceConnection directly. -using ::google::cloud::retail_v2_mocks::MockPredictionServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_PREDICTION_CONNECTION_H diff --git a/google/cloud/retail/mocks/mock_product_connection.h b/google/cloud/retail/mocks/mock_product_connection.h deleted file mode 100644 index d9248c5b7584c..0000000000000 --- a/google/cloud/retail/mocks/mock_product_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/product_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_PRODUCT_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_PRODUCT_CONNECTION_H - -#include "google/cloud/retail/product_connection.h" -#include "google/cloud/retail/v2/mocks/mock_product_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in retail_v2_mocks instead of the aliases -/// defined in this namespace. -namespace retail_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2_mocks::MockProductServiceConnection directly. -using ::google::cloud::retail_v2_mocks::MockProductServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_PRODUCT_CONNECTION_H diff --git a/google/cloud/retail/mocks/mock_search_connection.h b/google/cloud/retail/mocks/mock_search_connection.h deleted file mode 100644 index db4dfca824873..0000000000000 --- a/google/cloud/retail/mocks/mock_search_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/search_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_SEARCH_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_SEARCH_CONNECTION_H - -#include "google/cloud/retail/search_connection.h" -#include "google/cloud/retail/v2/mocks/mock_search_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in retail_v2_mocks instead of the aliases -/// defined in this namespace. -namespace retail_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2_mocks::MockSearchServiceConnection directly. -using ::google::cloud::retail_v2_mocks::MockSearchServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_SEARCH_CONNECTION_H diff --git a/google/cloud/retail/mocks/mock_user_event_connection.h b/google/cloud/retail/mocks/mock_user_event_connection.h deleted file mode 100644 index 3330e4924edf0..0000000000000 --- a/google/cloud/retail/mocks/mock_user_event_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/user_event_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_USER_EVENT_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_USER_EVENT_CONNECTION_H - -#include "google/cloud/retail/user_event_connection.h" -#include "google/cloud/retail/v2/mocks/mock_user_event_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in retail_v2_mocks instead of the aliases -/// defined in this namespace. -namespace retail_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2_mocks::MockUserEventServiceConnection directly. -using ::google::cloud::retail_v2_mocks::MockUserEventServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_MOCKS_MOCK_USER_EVENT_CONNECTION_H diff --git a/google/cloud/retail/prediction_client.h b/google/cloud/retail/prediction_client.h deleted file mode 100644 index 1b9c447f01fc6..0000000000000 --- a/google/cloud/retail/prediction_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/prediction_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PREDICTION_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PREDICTION_CLIENT_H - -#include "google/cloud/retail/prediction_connection.h" -#include "google/cloud/retail/v2/prediction_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in retail_v2 instead of the aliases defined in -/// this namespace. -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::PredictionServiceClient directly. -using ::google::cloud::retail_v2::PredictionServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PREDICTION_CLIENT_H diff --git a/google/cloud/retail/prediction_connection.h b/google/cloud/retail/prediction_connection.h deleted file mode 100644 index 3d38053c741d3..0000000000000 --- a/google/cloud/retail/prediction_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/prediction_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PREDICTION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PREDICTION_CONNECTION_H - -#include "google/cloud/retail/prediction_connection_idempotency_policy.h" -#include "google/cloud/retail/v2/prediction_connection.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::MakePredictionServiceConnection directly. -using ::google::cloud::retail_v2::MakePredictionServiceConnection; - -/// @deprecated Use retail_v2::PredictionServiceConnection directly. -using ::google::cloud::retail_v2::PredictionServiceConnection; - -/// @deprecated Use retail_v2::PredictionServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::retail_v2::PredictionServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use retail_v2::PredictionServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::retail_v2::PredictionServiceLimitedTimeRetryPolicy; - -/// @deprecated Use retail_v2::PredictionServiceRetryPolicy directly. -using ::google::cloud::retail_v2::PredictionServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PREDICTION_CONNECTION_H diff --git a/google/cloud/retail/prediction_connection_idempotency_policy.h b/google/cloud/retail/prediction_connection_idempotency_policy.h deleted file mode 100644 index 85b9350df0136..0000000000000 --- a/google/cloud/retail/prediction_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/prediction_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PREDICTION_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PREDICTION_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/retail/v2/prediction_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// retail_v2::MakeDefaultPredictionServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::retail_v2:: - MakeDefaultPredictionServiceConnectionIdempotencyPolicy; - -/// @deprecated Use retail_v2::PredictionServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::retail_v2::PredictionServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PREDICTION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/retail/prediction_options.h b/google/cloud/retail/prediction_options.h deleted file mode 100644 index 255856f20cc6b..0000000000000 --- a/google/cloud/retail/prediction_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/prediction_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PREDICTION_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PREDICTION_OPTIONS_H - -#include "google/cloud/retail/prediction_connection.h" -#include "google/cloud/retail/prediction_connection_idempotency_policy.h" -#include "google/cloud/retail/v2/prediction_options.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::PredictionServiceBackoffPolicyOption directly. -using ::google::cloud::retail_v2::PredictionServiceBackoffPolicyOption; - -/// @deprecated Use -/// retail_v2::PredictionServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::retail_v2:: - PredictionServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use retail_v2::PredictionServicePolicyOptionList directly. -using ::google::cloud::retail_v2::PredictionServicePolicyOptionList; - -/// @deprecated Use retail_v2::PredictionServiceRetryPolicyOption directly. -using ::google::cloud::retail_v2::PredictionServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PREDICTION_OPTIONS_H diff --git a/google/cloud/retail/product_client.h b/google/cloud/retail/product_client.h deleted file mode 100644 index 1345b7daed323..0000000000000 --- a/google/cloud/retail/product_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/product_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PRODUCT_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PRODUCT_CLIENT_H - -#include "google/cloud/retail/product_connection.h" -#include "google/cloud/retail/v2/product_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in retail_v2 instead of the aliases defined in -/// this namespace. -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::ProductServiceClient directly. -using ::google::cloud::retail_v2::ProductServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PRODUCT_CLIENT_H diff --git a/google/cloud/retail/product_connection.h b/google/cloud/retail/product_connection.h deleted file mode 100644 index 31a961ce64780..0000000000000 --- a/google/cloud/retail/product_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/product_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PRODUCT_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PRODUCT_CONNECTION_H - -#include "google/cloud/retail/product_connection_idempotency_policy.h" -#include "google/cloud/retail/v2/product_connection.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::MakeProductServiceConnection directly. -using ::google::cloud::retail_v2::MakeProductServiceConnection; - -/// @deprecated Use retail_v2::ProductServiceConnection directly. -using ::google::cloud::retail_v2::ProductServiceConnection; - -/// @deprecated Use retail_v2::ProductServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::retail_v2::ProductServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use retail_v2::ProductServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::retail_v2::ProductServiceLimitedTimeRetryPolicy; - -/// @deprecated Use retail_v2::ProductServiceRetryPolicy directly. -using ::google::cloud::retail_v2::ProductServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PRODUCT_CONNECTION_H diff --git a/google/cloud/retail/product_connection_idempotency_policy.h b/google/cloud/retail/product_connection_idempotency_policy.h deleted file mode 100644 index 705aa99d54e1f..0000000000000 --- a/google/cloud/retail/product_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/product_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PRODUCT_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PRODUCT_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/retail/v2/product_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// retail_v2::MakeDefaultProductServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::retail_v2:: - MakeDefaultProductServiceConnectionIdempotencyPolicy; - -/// @deprecated Use retail_v2::ProductServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::retail_v2::ProductServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PRODUCT_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/retail/product_options.h b/google/cloud/retail/product_options.h deleted file mode 100644 index 06bd5c587992e..0000000000000 --- a/google/cloud/retail/product_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/product_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PRODUCT_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PRODUCT_OPTIONS_H - -#include "google/cloud/retail/product_connection.h" -#include "google/cloud/retail/product_connection_idempotency_policy.h" -#include "google/cloud/retail/v2/product_options.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::ProductServicePollingPolicyOption directly. -using ::google::cloud::retail_v2::ProductServicePollingPolicyOption; - -/// @deprecated Use retail_v2::ProductServiceBackoffPolicyOption directly. -using ::google::cloud::retail_v2::ProductServiceBackoffPolicyOption; - -/// @deprecated Use retail_v2::ProductServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::retail_v2:: - ProductServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use retail_v2::ProductServicePolicyOptionList directly. -using ::google::cloud::retail_v2::ProductServicePolicyOptionList; - -/// @deprecated Use retail_v2::ProductServiceRetryPolicyOption directly. -using ::google::cloud::retail_v2::ProductServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_PRODUCT_OPTIONS_H diff --git a/google/cloud/retail/quickstart/.bazelrc b/google/cloud/retail/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/retail/quickstart/.bazelrc +++ b/google/cloud/retail/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/retail/quickstart/CMakeLists.txt index 1a400a5a1755b..d4838aeb78cee 100644 --- a/google/cloud/retail/quickstart/CMakeLists.txt +++ b/google/cloud/retail/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Retail API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-retail-quickstart CXX) find_package(google_cloud_cpp_retail REQUIRED) diff --git a/google/cloud/retail/quickstart/WORKSPACE.bazel b/google/cloud/retail/quickstart/WORKSPACE.bazel index a30f6b0c1e39a..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 = "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/retail/search_client.h b/google/cloud/retail/search_client.h deleted file mode 100644 index 0a44750a43142..0000000000000 --- a/google/cloud/retail/search_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/search_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_SEARCH_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_SEARCH_CLIENT_H - -#include "google/cloud/retail/search_connection.h" -#include "google/cloud/retail/v2/search_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in retail_v2 instead of the aliases defined in -/// this namespace. -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::SearchServiceClient directly. -using ::google::cloud::retail_v2::SearchServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_SEARCH_CLIENT_H diff --git a/google/cloud/retail/search_connection.h b/google/cloud/retail/search_connection.h deleted file mode 100644 index 624a9e9335704..0000000000000 --- a/google/cloud/retail/search_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/search_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_SEARCH_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_SEARCH_CONNECTION_H - -#include "google/cloud/retail/search_connection_idempotency_policy.h" -#include "google/cloud/retail/v2/search_connection.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::MakeSearchServiceConnection directly. -using ::google::cloud::retail_v2::MakeSearchServiceConnection; - -/// @deprecated Use retail_v2::SearchServiceConnection directly. -using ::google::cloud::retail_v2::SearchServiceConnection; - -/// @deprecated Use retail_v2::SearchServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::retail_v2::SearchServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use retail_v2::SearchServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::retail_v2::SearchServiceLimitedTimeRetryPolicy; - -/// @deprecated Use retail_v2::SearchServiceRetryPolicy directly. -using ::google::cloud::retail_v2::SearchServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_SEARCH_CONNECTION_H diff --git a/google/cloud/retail/search_connection_idempotency_policy.h b/google/cloud/retail/search_connection_idempotency_policy.h deleted file mode 100644 index 914ef06ea2069..0000000000000 --- a/google/cloud/retail/search_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/search_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/retail/v2/search_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// retail_v2::MakeDefaultSearchServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::retail_v2:: - MakeDefaultSearchServiceConnectionIdempotencyPolicy; - -/// @deprecated Use retail_v2::SearchServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::retail_v2::SearchServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/retail/search_options.h b/google/cloud/retail/search_options.h deleted file mode 100644 index 8038e8a370c31..0000000000000 --- a/google/cloud/retail/search_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/search_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_SEARCH_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_SEARCH_OPTIONS_H - -#include "google/cloud/retail/search_connection.h" -#include "google/cloud/retail/search_connection_idempotency_policy.h" -#include "google/cloud/retail/v2/search_options.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::SearchServiceBackoffPolicyOption directly. -using ::google::cloud::retail_v2::SearchServiceBackoffPolicyOption; - -/// @deprecated Use retail_v2::SearchServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::retail_v2:: - SearchServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use retail_v2::SearchServicePolicyOptionList directly. -using ::google::cloud::retail_v2::SearchServicePolicyOptionList; - -/// @deprecated Use retail_v2::SearchServiceRetryPolicyOption directly. -using ::google::cloud::retail_v2::SearchServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_SEARCH_OPTIONS_H diff --git a/google/cloud/retail/user_event_client.h b/google/cloud/retail/user_event_client.h deleted file mode 100644 index 3a4fdc9832575..0000000000000 --- a/google/cloud/retail/user_event_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/user_event_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_USER_EVENT_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_USER_EVENT_CLIENT_H - -#include "google/cloud/retail/user_event_connection.h" -#include "google/cloud/retail/v2/user_event_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in retail_v2 instead of the aliases defined in -/// this namespace. -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::UserEventServiceClient directly. -using ::google::cloud::retail_v2::UserEventServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_USER_EVENT_CLIENT_H diff --git a/google/cloud/retail/user_event_connection.h b/google/cloud/retail/user_event_connection.h deleted file mode 100644 index ceca713906525..0000000000000 --- a/google/cloud/retail/user_event_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/user_event_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_USER_EVENT_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_USER_EVENT_CONNECTION_H - -#include "google/cloud/retail/user_event_connection_idempotency_policy.h" -#include "google/cloud/retail/v2/user_event_connection.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::MakeUserEventServiceConnection directly. -using ::google::cloud::retail_v2::MakeUserEventServiceConnection; - -/// @deprecated Use retail_v2::UserEventServiceConnection directly. -using ::google::cloud::retail_v2::UserEventServiceConnection; - -/// @deprecated Use retail_v2::UserEventServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::retail_v2::UserEventServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use retail_v2::UserEventServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::retail_v2::UserEventServiceLimitedTimeRetryPolicy; - -/// @deprecated Use retail_v2::UserEventServiceRetryPolicy directly. -using ::google::cloud::retail_v2::UserEventServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_USER_EVENT_CONNECTION_H diff --git a/google/cloud/retail/user_event_connection_idempotency_policy.h b/google/cloud/retail/user_event_connection_idempotency_policy.h deleted file mode 100644 index cc6f6340482c2..0000000000000 --- a/google/cloud/retail/user_event_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/user_event_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_USER_EVENT_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_USER_EVENT_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/retail/v2/user_event_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// retail_v2::MakeDefaultUserEventServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::retail_v2:: - MakeDefaultUserEventServiceConnectionIdempotencyPolicy; - -/// @deprecated Use retail_v2::UserEventServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::retail_v2::UserEventServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_USER_EVENT_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/retail/user_event_options.h b/google/cloud/retail/user_event_options.h deleted file mode 100644 index f385fdc2c8f63..0000000000000 --- a/google/cloud/retail/user_event_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/retail/v2/user_event_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_USER_EVENT_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_USER_EVENT_OPTIONS_H - -#include "google/cloud/retail/user_event_connection.h" -#include "google/cloud/retail/user_event_connection_idempotency_policy.h" -#include "google/cloud/retail/v2/user_event_options.h" - -namespace google { -namespace cloud { -namespace retail { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use retail_v2::UserEventServicePollingPolicyOption directly. -using ::google::cloud::retail_v2::UserEventServicePollingPolicyOption; - -/// @deprecated Use retail_v2::UserEventServiceBackoffPolicyOption directly. -using ::google::cloud::retail_v2::UserEventServiceBackoffPolicyOption; - -/// @deprecated Use retail_v2::UserEventServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::retail_v2:: - UserEventServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use retail_v2::UserEventServicePolicyOptionList directly. -using ::google::cloud::retail_v2::UserEventServicePolicyOptionList; - -/// @deprecated Use retail_v2::UserEventServiceRetryPolicyOption directly. -using ::google::cloud::retail_v2::UserEventServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace retail -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_USER_EVENT_OPTIONS_H diff --git a/google/cloud/retail/v2/analytics_client.h b/google/cloud/retail/v2/analytics_client.h index e6ce1baa3c308..dc505aad2f641 100644 --- a/google/cloud/retail/v2/analytics_client.h +++ b/google/cloud/retail/v2/analytics_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/retail/v2/analytics_connection.h b/google/cloud/retail/v2/analytics_connection.h index fee17c818d48b..15fc22d33ae10 100644 --- a/google/cloud/retail/v2/analytics_connection.h +++ b/google/cloud/retail/v2/analytics_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_ANALYTICS_CONNECTION_H #include "google/cloud/retail/v2/analytics_connection_idempotency_policy.h" +#include "google/cloud/retail/v2/analytics_service.pb.h" #include "google/cloud/retail/v2/internal/analytics_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/analytics_connection_idempotency_policy.h b/google/cloud/retail/v2/analytics_connection_idempotency_policy.h index a420c94f3564f..67b9d40f542b2 100644 --- a/google/cloud/retail/v2/analytics_connection_idempotency_policy.h +++ b/google/cloud/retail/v2/analytics_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_ANALYTICS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_ANALYTICS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/retail/v2/analytics_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/catalog_connection.h b/google/cloud/retail/v2/catalog_connection.h index 51c75582b4a55..36e9a4db20ff0 100644 --- a/google/cloud/retail/v2/catalog_connection.h +++ b/google/cloud/retail/v2/catalog_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_CATALOG_CONNECTION_H #include "google/cloud/retail/v2/catalog_connection_idempotency_policy.h" +#include "google/cloud/retail/v2/catalog_service.pb.h" #include "google/cloud/retail/v2/internal/catalog_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/retail/v2/catalog_connection_idempotency_policy.h b/google/cloud/retail/v2/catalog_connection_idempotency_policy.h index 295c6e92280d3..7659ee52a8cba 100644 --- a/google/cloud/retail/v2/catalog_connection_idempotency_policy.h +++ b/google/cloud/retail/v2/catalog_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_CATALOG_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/retail/v2/catalog_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/completion_client.h b/google/cloud/retail/v2/completion_client.h index a394fc0859cae..2c6f528cc669b 100644 --- a/google/cloud/retail/v2/completion_client.h +++ b/google/cloud/retail/v2/completion_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/retail/v2/completion_connection.h b/google/cloud/retail/v2/completion_connection.h index db49b011ba7f5..3648f70fac1c2 100644 --- a/google/cloud/retail/v2/completion_connection.h +++ b/google/cloud/retail/v2/completion_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_COMPLETION_CONNECTION_H #include "google/cloud/retail/v2/completion_connection_idempotency_policy.h" +#include "google/cloud/retail/v2/completion_service.pb.h" #include "google/cloud/retail/v2/internal/completion_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/completion_connection_idempotency_policy.h b/google/cloud/retail/v2/completion_connection_idempotency_policy.h index 9ee3c7bb3c1c8..c9a50544ba521 100644 --- a/google/cloud/retail/v2/completion_connection_idempotency_policy.h +++ b/google/cloud/retail/v2/completion_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_COMPLETION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_COMPLETION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/retail/v2/completion_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/control_connection.h b/google/cloud/retail/v2/control_connection.h index 408ab00ae2890..67f911ca9836a 100644 --- a/google/cloud/retail/v2/control_connection.h +++ b/google/cloud/retail/v2/control_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_CONTROL_CONNECTION_H #include "google/cloud/retail/v2/control_connection_idempotency_policy.h" +#include "google/cloud/retail/v2/control_service.pb.h" #include "google/cloud/retail/v2/internal/control_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/retail/v2/control_connection_idempotency_policy.h b/google/cloud/retail/v2/control_connection_idempotency_policy.h index cb21b38dfbcd6..688e5df861aea 100644 --- a/google/cloud/retail/v2/control_connection_idempotency_policy.h +++ b/google/cloud/retail/v2/control_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_CONTROL_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_CONTROL_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/retail/v2/control_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/internal/analytics_auth_decorator.cc b/google/cloud/retail/v2/internal/analytics_auth_decorator.cc index affe81b6306de..0f4d153e2a2a5 100644 --- a/google/cloud/retail/v2/internal/analytics_auth_decorator.cc +++ b/google/cloud/retail/v2/internal/analytics_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/retail/v2/analytics_service.proto #include "google/cloud/retail/v2/internal/analytics_auth_decorator.h" -#include +#include "google/cloud/retail/v2/analytics_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -117,3 +120,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/analytics_auth_decorator.h b/google/cloud/retail/v2/internal/analytics_auth_decorator.h index 5a61f87e588ac..423152d7bbf32 100644 --- a/google/cloud/retail/v2/internal/analytics_auth_decorator.h +++ b/google/cloud/retail/v2/internal/analytics_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/analytics_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -81,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_ANALYTICS_AUTH_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/analytics_connection_impl.h b/google/cloud/retail/v2/internal/analytics_connection_impl.h index f3850cfe54dd9..e926221368841 100644 --- a/google/cloud/retail/v2/internal/analytics_connection_impl.h +++ b/google/cloud/retail/v2/internal/analytics_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/internal/analytics_logging_decorator.cc b/google/cloud/retail/v2/internal/analytics_logging_decorator.cc index b274ef35a799e..74e10523d3cf9 100644 --- a/google/cloud/retail/v2/internal/analytics_logging_decorator.cc +++ b/google/cloud/retail/v2/internal/analytics_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/retail/v2/analytics_service.proto #include "google/cloud/retail/v2/internal/analytics_logging_decorator.h" +#include "google/cloud/retail/v2/analytics_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -129,3 +132,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/analytics_logging_decorator.h b/google/cloud/retail/v2/internal/analytics_logging_decorator.h index f7001030afce7..f13527a3b2e5c 100644 --- a/google/cloud/retail/v2/internal/analytics_logging_decorator.h +++ b/google/cloud/retail/v2/internal/analytics_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/analytics_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -81,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_ANALYTICS_LOGGING_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/analytics_metadata_decorator.cc b/google/cloud/retail/v2/internal/analytics_metadata_decorator.cc index f1dc53d7869af..3b5489678a98a 100644 --- a/google/cloud/retail/v2/internal/analytics_metadata_decorator.cc +++ b/google/cloud/retail/v2/internal/analytics_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/retail/v2/analytics_service.proto #include "google/cloud/retail/v2/internal/analytics_metadata_decorator.h" +#include "google/cloud/retail/v2/analytics_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 retail_v2_internal { @@ -122,3 +126,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/analytics_metadata_decorator.h b/google/cloud/retail/v2/internal/analytics_metadata_decorator.h index 957be1ccee40a..12f4e861b9fb9 100644 --- a/google/cloud/retail/v2/internal/analytics_metadata_decorator.h +++ b/google/cloud/retail/v2/internal/analytics_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/analytics_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -87,4 +90,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_ANALYTICS_METADATA_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/analytics_option_defaults.cc b/google/cloud/retail/v2/internal/analytics_option_defaults.cc index f6e35c96dda03..a2e1ec0d4303a 100644 --- a/google/cloud/retail/v2/internal/analytics_option_defaults.cc +++ b/google/cloud/retail/v2/internal/analytics_option_defaults.cc @@ -41,7 +41,7 @@ Options AnalyticsServiceDefaultOptions(Options options) { if (!options.has()) { options.set( retail_v2::AnalyticsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/retail/v2/internal/analytics_stub.cc b/google/cloud/retail/v2/internal/analytics_stub.cc index ad221c04ccd5a..d4672566ad594 100644 --- a/google/cloud/retail/v2/internal/analytics_stub.cc +++ b/google/cloud/retail/v2/internal/analytics_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/retail/v2/analytics_service.proto #include "google/cloud/retail/v2/internal/analytics_stub.h" +#include "google/cloud/retail/v2/analytics_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -130,3 +133,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/analytics_stub.h b/google/cloud/retail/v2/internal/analytics_stub.h index bec22474520f2..a9552fc02ab3a 100644 --- a/google/cloud/retail/v2/internal/analytics_stub.h +++ b/google/cloud/retail/v2/internal/analytics_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_ANALYTICS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_ANALYTICS_STUB_H +#include "google/cloud/retail/v2/analytics_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -127,4 +130,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_ANALYTICS_STUB_H diff --git a/google/cloud/retail/v2/internal/analytics_stub_factory.cc b/google/cloud/retail/v2/internal/analytics_stub_factory.cc index 46354fa94cbc8..b68cf2ed4fbe4 100644 --- a/google/cloud/retail/v2/internal/analytics_stub_factory.cc +++ b/google/cloud/retail/v2/internal/analytics_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/retail/v2/analytics_service.proto #include "google/cloud/retail/v2/internal/analytics_stub_factory.h" +#include "google/cloud/retail/v2/analytics_service.grpc.pb.h" #include "google/cloud/retail/v2/internal/analytics_auth_decorator.h" #include "google/cloud/retail/v2/internal/analytics_logging_decorator.h" #include "google/cloud/retail/v2/internal/analytics_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/analytics_stub_factory.h b/google/cloud/retail/v2/internal/analytics_stub_factory.h index 54e2e73e9dddf..f69883e922dde 100644 --- a/google/cloud/retail/v2/internal/analytics_stub_factory.h +++ b/google/cloud/retail/v2/internal/analytics_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_ANALYTICS_STUB_FACTORY_H diff --git a/google/cloud/retail/v2/internal/analytics_tracing_connection.cc b/google/cloud/retail/v2/internal/analytics_tracing_connection.cc index dec64c82d6df8..c4a3cfb8644e0 100644 --- a/google/cloud/retail/v2/internal/analytics_tracing_connection.cc +++ b/google/cloud/retail/v2/internal/analytics_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AnalyticsServiceTracingConnection::AnalyticsServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -84,16 +82,12 @@ AnalyticsServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAnalyticsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/retail/v2/internal/analytics_tracing_connection.h b/google/cloud/retail/v2/internal/analytics_tracing_connection.h index 25afd8ecc8be8..f37c8acd1fc5e 100644 --- a/google/cloud/retail/v2/internal/analytics_tracing_connection.h +++ b/google/cloud/retail/v2/internal/analytics_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AnalyticsServiceTracingConnection : public retail_v2::AnalyticsServiceConnection { public: @@ -64,8 +62,6 @@ class AnalyticsServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/retail/v2/internal/analytics_tracing_stub.cc b/google/cloud/retail/v2/internal/analytics_tracing_stub.cc index cb90c10d665bc..faa6aa8841cfc 100644 --- a/google/cloud/retail/v2/internal/analytics_tracing_stub.cc +++ b/google/cloud/retail/v2/internal/analytics_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AnalyticsServiceTracingStub::AnalyticsServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -112,18 +113,14 @@ future AnalyticsServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAnalyticsServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/analytics_tracing_stub.h b/google/cloud/retail/v2/internal/analytics_tracing_stub.h index ce09542c92e4e..d5d778ad83ae2 100644 --- a/google/cloud/retail/v2/internal/analytics_tracing_stub.h +++ b/google/cloud/retail/v2/internal/analytics_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AnalyticsServiceTracingStub : public AnalyticsServiceStub { public: ~AnalyticsServiceTracingStub() override = default; @@ -77,8 +78,6 @@ class AnalyticsServiceTracingStub : public AnalyticsServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -93,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_ANALYTICS_TRACING_STUB_H diff --git a/google/cloud/retail/v2/internal/catalog_auth_decorator.cc b/google/cloud/retail/v2/internal/catalog_auth_decorator.cc index 82278b51ca591..dbafddd3c815c 100644 --- a/google/cloud/retail/v2/internal/catalog_auth_decorator.cc +++ b/google/cloud/retail/v2/internal/catalog_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/retail/v2/catalog_service.proto #include "google/cloud/retail/v2/internal/catalog_auth_decorator.h" -#include +#include "google/cloud/retail/v2/catalog_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -149,3 +152,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/catalog_auth_decorator.h b/google/cloud/retail/v2/internal/catalog_auth_decorator.h index fc3fb5901081c..bcf89726960d4 100644 --- a/google/cloud/retail/v2/internal/catalog_auth_decorator.h +++ b/google/cloud/retail/v2/internal/catalog_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CATALOG_AUTH_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/catalog_logging_decorator.cc b/google/cloud/retail/v2/internal/catalog_logging_decorator.cc index fecde1f404acb..8330b0bf35175 100644 --- a/google/cloud/retail/v2/internal/catalog_logging_decorator.cc +++ b/google/cloud/retail/v2/internal/catalog_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/retail/v2/catalog_service.proto #include "google/cloud/retail/v2/internal/catalog_logging_decorator.h" +#include "google/cloud/retail/v2/catalog_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -202,3 +205,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/catalog_logging_decorator.h b/google/cloud/retail/v2/internal/catalog_logging_decorator.h index aece2bd097ce2..401ebc43ceb07 100644 --- a/google/cloud/retail/v2/internal/catalog_logging_decorator.h +++ b/google/cloud/retail/v2/internal/catalog_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CATALOG_LOGGING_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/catalog_metadata_decorator.cc b/google/cloud/retail/v2/internal/catalog_metadata_decorator.cc index 084db8aac336c..d66fc579c11d6 100644 --- a/google/cloud/retail/v2/internal/catalog_metadata_decorator.cc +++ b/google/cloud/retail/v2/internal/catalog_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/retail/v2/catalog_service.proto #include "google/cloud/retail/v2/internal/catalog_metadata_decorator.h" +#include "google/cloud/retail/v2/catalog_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 retail_v2_internal { @@ -184,3 +188,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/catalog_metadata_decorator.h b/google/cloud/retail/v2/internal/catalog_metadata_decorator.h index 28191b7b8334a..070a39c3c8a6e 100644 --- a/google/cloud/retail/v2/internal/catalog_metadata_decorator.h +++ b/google/cloud/retail/v2/internal/catalog_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -114,4 +117,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CATALOG_METADATA_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/catalog_option_defaults.cc b/google/cloud/retail/v2/internal/catalog_option_defaults.cc index 294845685713a..29d7c673a9f82 100644 --- a/google/cloud/retail/v2/internal/catalog_option_defaults.cc +++ b/google/cloud/retail/v2/internal/catalog_option_defaults.cc @@ -41,7 +41,7 @@ Options CatalogServiceDefaultOptions(Options options) { if (!options.has()) { options.set( retail_v2::CatalogServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/retail/v2/internal/catalog_stub.cc b/google/cloud/retail/v2/internal/catalog_stub.cc index b8030e2e05e48..67220ff94e922 100644 --- a/google/cloud/retail/v2/internal/catalog_stub.cc +++ b/google/cloud/retail/v2/internal/catalog_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/retail/v2/catalog_service.proto #include "google/cloud/retail/v2/internal/catalog_stub.h" +#include "google/cloud/retail/v2/catalog_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -193,3 +196,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/catalog_stub.h b/google/cloud/retail/v2/internal/catalog_stub.h index 0ba78e1291eb3..fd650de69953c 100644 --- a/google/cloud/retail/v2/internal/catalog_stub.h +++ b/google/cloud/retail/v2/internal/catalog_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CATALOG_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CATALOG_STUB_H +#include "google/cloud/retail/v2/catalog_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -185,4 +188,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CATALOG_STUB_H diff --git a/google/cloud/retail/v2/internal/catalog_stub_factory.cc b/google/cloud/retail/v2/internal/catalog_stub_factory.cc index 677624939cdaa..ae4cfa3e442fc 100644 --- a/google/cloud/retail/v2/internal/catalog_stub_factory.cc +++ b/google/cloud/retail/v2/internal/catalog_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/retail/v2/catalog_service.proto #include "google/cloud/retail/v2/internal/catalog_stub_factory.h" +#include "google/cloud/retail/v2/catalog_service.grpc.pb.h" #include "google/cloud/retail/v2/internal/catalog_auth_decorator.h" #include "google/cloud/retail/v2/internal/catalog_logging_decorator.h" #include "google/cloud/retail/v2/internal/catalog_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/catalog_stub_factory.h b/google/cloud/retail/v2/internal/catalog_stub_factory.h index c6f4fc523bc39..39bbe88a2d207 100644 --- a/google/cloud/retail/v2/internal/catalog_stub_factory.h +++ b/google/cloud/retail/v2/internal/catalog_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CATALOG_STUB_FACTORY_H diff --git a/google/cloud/retail/v2/internal/catalog_tracing_connection.cc b/google/cloud/retail/v2/internal/catalog_tracing_connection.cc index 07dc1422cd252..44a8095083883 100644 --- a/google/cloud/retail/v2/internal/catalog_tracing_connection.cc +++ b/google/cloud/retail/v2/internal/catalog_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CatalogServiceTracingConnection::CatalogServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -153,16 +151,12 @@ CatalogServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCatalogServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/retail/v2/internal/catalog_tracing_connection.h b/google/cloud/retail/v2/internal/catalog_tracing_connection.h index 982f949fe6601..547459393ae49 100644 --- a/google/cloud/retail/v2/internal/catalog_tracing_connection.h +++ b/google/cloud/retail/v2/internal/catalog_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CatalogServiceTracingConnection : public retail_v2::CatalogServiceConnection { public: @@ -92,8 +90,6 @@ class CatalogServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/retail/v2/internal/catalog_tracing_stub.cc b/google/cloud/retail/v2/internal/catalog_tracing_stub.cc index d005340c6f377..36c028e2b46af 100644 --- a/google/cloud/retail/v2/internal/catalog_tracing_stub.cc +++ b/google/cloud/retail/v2/internal/catalog_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CatalogServiceTracingStub::CatalogServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -191,18 +192,14 @@ CatalogServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCatalogServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/catalog_tracing_stub.h b/google/cloud/retail/v2/internal/catalog_tracing_stub.h index e363b4b63e6c9..282a2fd2f7e14 100644 --- a/google/cloud/retail/v2/internal/catalog_tracing_stub.h +++ b/google/cloud/retail/v2/internal/catalog_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CatalogServiceTracingStub : public CatalogServiceStub { public: ~CatalogServiceTracingStub() override = default; @@ -105,8 +106,6 @@ class CatalogServiceTracingStub : public CatalogServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -121,4 +120,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CATALOG_TRACING_STUB_H diff --git a/google/cloud/retail/v2/internal/completion_auth_decorator.cc b/google/cloud/retail/v2/internal/completion_auth_decorator.cc index 7c3778a80f3f5..6c7c7084603dd 100644 --- a/google/cloud/retail/v2/internal/completion_auth_decorator.cc +++ b/google/cloud/retail/v2/internal/completion_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/retail/v2/completion_service.proto #include "google/cloud/retail/v2/internal/completion_auth_decorator.h" -#include +#include "google/cloud/retail/v2/completion_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -126,3 +129,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/completion_auth_decorator.h b/google/cloud/retail/v2/internal/completion_auth_decorator.h index bc67fa4b66bbc..373fc5a1a8b51 100644 --- a/google/cloud/retail/v2/internal/completion_auth_decorator.h +++ b/google/cloud/retail/v2/internal/completion_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/completion_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -85,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_COMPLETION_AUTH_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/completion_connection_impl.h b/google/cloud/retail/v2/internal/completion_connection_impl.h index 5a190253b6a02..bac2af3cbbfa3 100644 --- a/google/cloud/retail/v2/internal/completion_connection_impl.h +++ b/google/cloud/retail/v2/internal/completion_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/internal/completion_logging_decorator.cc b/google/cloud/retail/v2/internal/completion_logging_decorator.cc index d9c7ef9ab1739..309c617234300 100644 --- a/google/cloud/retail/v2/internal/completion_logging_decorator.cc +++ b/google/cloud/retail/v2/internal/completion_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/retail/v2/completion_service.proto #include "google/cloud/retail/v2/internal/completion_logging_decorator.h" +#include "google/cloud/retail/v2/completion_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -141,3 +144,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/completion_logging_decorator.h b/google/cloud/retail/v2/internal/completion_logging_decorator.h index 43d9ac70d97f9..c8c287dc4be39 100644 --- a/google/cloud/retail/v2/internal/completion_logging_decorator.h +++ b/google/cloud/retail/v2/internal/completion_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/completion_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -85,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_COMPLETION_LOGGING_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/completion_metadata_decorator.cc b/google/cloud/retail/v2/internal/completion_metadata_decorator.cc index eeab54a998d29..db241e3c76dee 100644 --- a/google/cloud/retail/v2/internal/completion_metadata_decorator.cc +++ b/google/cloud/retail/v2/internal/completion_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/retail/v2/completion_service.proto #include "google/cloud/retail/v2/internal/completion_metadata_decorator.h" +#include "google/cloud/retail/v2/completion_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 retail_v2_internal { @@ -132,3 +136,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/completion_metadata_decorator.h b/google/cloud/retail/v2/internal/completion_metadata_decorator.h index c1c35c0913cf5..8d10720df199b 100644 --- a/google/cloud/retail/v2/internal/completion_metadata_decorator.h +++ b/google/cloud/retail/v2/internal/completion_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/completion_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -91,4 +94,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_COMPLETION_METADATA_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/completion_option_defaults.cc b/google/cloud/retail/v2/internal/completion_option_defaults.cc index 9388085c8a8a6..203a2d59411d3 100644 --- a/google/cloud/retail/v2/internal/completion_option_defaults.cc +++ b/google/cloud/retail/v2/internal/completion_option_defaults.cc @@ -41,7 +41,7 @@ Options CompletionServiceDefaultOptions(Options options) { if (!options.has()) { options.set( retail_v2::CompletionServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/retail/v2/internal/completion_stub.cc b/google/cloud/retail/v2/internal/completion_stub.cc index 1c93d2158a306..0dd89cf153377 100644 --- a/google/cloud/retail/v2/internal/completion_stub.cc +++ b/google/cloud/retail/v2/internal/completion_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/retail/v2/completion_service.proto #include "google/cloud/retail/v2/internal/completion_stub.h" +#include "google/cloud/retail/v2/completion_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -141,3 +144,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/completion_stub.h b/google/cloud/retail/v2/internal/completion_stub.h index 2bbe8b5154e5b..481b7d942feb7 100644 --- a/google/cloud/retail/v2/internal/completion_stub.h +++ b/google/cloud/retail/v2/internal/completion_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_COMPLETION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_COMPLETION_STUB_H +#include "google/cloud/retail/v2/completion_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -136,4 +139,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_COMPLETION_STUB_H diff --git a/google/cloud/retail/v2/internal/completion_stub_factory.cc b/google/cloud/retail/v2/internal/completion_stub_factory.cc index a65a9e7536cad..536446930c508 100644 --- a/google/cloud/retail/v2/internal/completion_stub_factory.cc +++ b/google/cloud/retail/v2/internal/completion_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/retail/v2/completion_service.proto #include "google/cloud/retail/v2/internal/completion_stub_factory.h" +#include "google/cloud/retail/v2/completion_service.grpc.pb.h" #include "google/cloud/retail/v2/internal/completion_auth_decorator.h" #include "google/cloud/retail/v2/internal/completion_logging_decorator.h" #include "google/cloud/retail/v2/internal/completion_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/completion_stub_factory.h b/google/cloud/retail/v2/internal/completion_stub_factory.h index d1faab5ca10d7..73956ea67e98a 100644 --- a/google/cloud/retail/v2/internal/completion_stub_factory.h +++ b/google/cloud/retail/v2/internal/completion_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_COMPLETION_STUB_FACTORY_H diff --git a/google/cloud/retail/v2/internal/completion_tracing_connection.cc b/google/cloud/retail/v2/internal/completion_tracing_connection.cc index 85b2d00be4b4e..bafa2a0b06aca 100644 --- a/google/cloud/retail/v2/internal/completion_tracing_connection.cc +++ b/google/cloud/retail/v2/internal/completion_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CompletionServiceTracingConnection::CompletionServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -93,17 +91,13 @@ CompletionServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCompletionServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/retail/v2/internal/completion_tracing_connection.h b/google/cloud/retail/v2/internal/completion_tracing_connection.h index 54cafe4ebc51c..77d54ac06ee1d 100644 --- a/google/cloud/retail/v2/internal/completion_tracing_connection.h +++ b/google/cloud/retail/v2/internal/completion_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CompletionServiceTracingConnection : public retail_v2::CompletionServiceConnection { public: @@ -67,8 +65,6 @@ class CompletionServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/retail/v2/internal/completion_tracing_stub.cc b/google/cloud/retail/v2/internal/completion_tracing_stub.cc index 6339745e5c98c..892478edcab7f 100644 --- a/google/cloud/retail/v2/internal/completion_tracing_stub.cc +++ b/google/cloud/retail/v2/internal/completion_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CompletionServiceTracingStub::CompletionServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -123,18 +124,14 @@ future CompletionServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCompletionServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/completion_tracing_stub.h b/google/cloud/retail/v2/internal/completion_tracing_stub.h index d22e1cad9556b..20983bfc0167c 100644 --- a/google/cloud/retail/v2/internal/completion_tracing_stub.h +++ b/google/cloud/retail/v2/internal/completion_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CompletionServiceTracingStub : public CompletionServiceStub { public: ~CompletionServiceTracingStub() override = default; @@ -81,8 +82,6 @@ class CompletionServiceTracingStub : public CompletionServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -97,4 +96,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_COMPLETION_TRACING_STUB_H diff --git a/google/cloud/retail/v2/internal/control_auth_decorator.cc b/google/cloud/retail/v2/internal/control_auth_decorator.cc index 433f1809e716c..7310452adc5cd 100644 --- a/google/cloud/retail/v2/internal/control_auth_decorator.cc +++ b/google/cloud/retail/v2/internal/control_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/retail/v2/control_service.proto #include "google/cloud/retail/v2/internal/control_auth_decorator.h" -#include +#include "google/cloud/retail/v2/control_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -93,3 +96,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/control_auth_decorator.h b/google/cloud/retail/v2/internal/control_auth_decorator.h index e488afed2b742..41f5f577b66eb 100644 --- a/google/cloud/retail/v2/internal/control_auth_decorator.h +++ b/google/cloud/retail/v2/internal/control_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -76,4 +79,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CONTROL_AUTH_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/control_logging_decorator.cc b/google/cloud/retail/v2/internal/control_logging_decorator.cc index ac3fcfd2e8b0b..9bd5d326e660e 100644 --- a/google/cloud/retail/v2/internal/control_logging_decorator.cc +++ b/google/cloud/retail/v2/internal/control_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/retail/v2/control_service.proto #include "google/cloud/retail/v2/internal/control_logging_decorator.h" +#include "google/cloud/retail/v2/control_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -120,3 +123,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/control_logging_decorator.h b/google/cloud/retail/v2/internal/control_logging_decorator.h index 0c4430a63ad31..89887f99ae0ba 100644 --- a/google/cloud/retail/v2/internal/control_logging_decorator.h +++ b/google/cloud/retail/v2/internal/control_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -76,4 +79,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CONTROL_LOGGING_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/control_metadata_decorator.cc b/google/cloud/retail/v2/internal/control_metadata_decorator.cc index 27606d7008b18..97afda2c61208 100644 --- a/google/cloud/retail/v2/internal/control_metadata_decorator.cc +++ b/google/cloud/retail/v2/internal/control_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/retail/v2/control_service.proto #include "google/cloud/retail/v2/internal/control_metadata_decorator.h" +#include "google/cloud/retail/v2/control_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 retail_v2_internal { @@ -122,3 +126,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/control_metadata_decorator.h b/google/cloud/retail/v2/internal/control_metadata_decorator.h index 5d94dbe661d00..1cff1445fd92d 100644 --- a/google/cloud/retail/v2/internal/control_metadata_decorator.h +++ b/google/cloud/retail/v2/internal/control_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -81,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CONTROL_METADATA_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/control_option_defaults.cc b/google/cloud/retail/v2/internal/control_option_defaults.cc index bff3f2b3651ae..ee95183d9a598 100644 --- a/google/cloud/retail/v2/internal/control_option_defaults.cc +++ b/google/cloud/retail/v2/internal/control_option_defaults.cc @@ -41,7 +41,7 @@ Options ControlServiceDefaultOptions(Options options) { if (!options.has()) { options.set( retail_v2::ControlServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/retail/v2/internal/control_stub.cc b/google/cloud/retail/v2/internal/control_stub.cc index 123c856b0ecea..83538a5abe2ee 100644 --- a/google/cloud/retail/v2/internal/control_stub.cc +++ b/google/cloud/retail/v2/internal/control_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/retail/v2/control_service.proto #include "google/cloud/retail/v2/internal/control_stub.h" +#include "google/cloud/retail/v2/control_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -117,3 +120,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/control_stub.h b/google/cloud/retail/v2/internal/control_stub.h index f11aec9164a00..6bec73b4e41f4 100644 --- a/google/cloud/retail/v2/internal/control_stub.h +++ b/google/cloud/retail/v2/internal/control_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CONTROL_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CONTROL_STUB_H +#include "google/cloud/retail/v2/control_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -116,4 +119,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CONTROL_STUB_H diff --git a/google/cloud/retail/v2/internal/control_stub_factory.cc b/google/cloud/retail/v2/internal/control_stub_factory.cc index f3bf78bbf76bc..d6492067fa9d0 100644 --- a/google/cloud/retail/v2/internal/control_stub_factory.cc +++ b/google/cloud/retail/v2/internal/control_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/retail/v2/control_service.proto #include "google/cloud/retail/v2/internal/control_stub_factory.h" +#include "google/cloud/retail/v2/control_service.grpc.pb.h" #include "google/cloud/retail/v2/internal/control_auth_decorator.h" #include "google/cloud/retail/v2/internal/control_logging_decorator.h" #include "google/cloud/retail/v2/internal/control_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/control_stub_factory.h b/google/cloud/retail/v2/internal/control_stub_factory.h index a3ebfe41eaacf..03161af9bbd82 100644 --- a/google/cloud/retail/v2/internal/control_stub_factory.h +++ b/google/cloud/retail/v2/internal/control_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CONTROL_STUB_FACTORY_H diff --git a/google/cloud/retail/v2/internal/control_tracing_connection.cc b/google/cloud/retail/v2/internal/control_tracing_connection.cc index f80cb239665bc..d171e944b928d 100644 --- a/google/cloud/retail/v2/internal/control_tracing_connection.cc +++ b/google/cloud/retail/v2/internal/control_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ControlServiceTracingConnection::ControlServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -99,16 +97,12 @@ ControlServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeControlServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/retail/v2/internal/control_tracing_connection.h b/google/cloud/retail/v2/internal/control_tracing_connection.h index f5a16af6cd8ab..62b1d7c6af4ca 100644 --- a/google/cloud/retail/v2/internal/control_tracing_connection.h +++ b/google/cloud/retail/v2/internal/control_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ControlServiceTracingConnection : public retail_v2::ControlServiceConnection { public: @@ -65,8 +63,6 @@ class ControlServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/retail/v2/internal/control_tracing_stub.cc b/google/cloud/retail/v2/internal/control_tracing_stub.cc index bf87097942f55..231c3ca005239 100644 --- a/google/cloud/retail/v2/internal/control_tracing_stub.cc +++ b/google/cloud/retail/v2/internal/control_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ControlServiceTracingStub::ControlServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -115,18 +116,14 @@ ControlServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeControlServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/control_tracing_stub.h b/google/cloud/retail/v2/internal/control_tracing_stub.h index 08f7d3430f9a9..2543cc587f3c1 100644 --- a/google/cloud/retail/v2/internal/control_tracing_stub.h +++ b/google/cloud/retail/v2/internal/control_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ControlServiceTracingStub : public ControlServiceStub { public: ~ControlServiceTracingStub() override = default; @@ -72,8 +73,6 @@ class ControlServiceTracingStub : public ControlServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -88,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_CONTROL_TRACING_STUB_H diff --git a/google/cloud/retail/v2/internal/model_auth_decorator.cc b/google/cloud/retail/v2/internal/model_auth_decorator.cc index ca3fc84360188..b86e67b49a1c3 100644 --- a/google/cloud/retail/v2/internal/model_auth_decorator.cc +++ b/google/cloud/retail/v2/internal/model_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/retail/v2/model_service.proto #include "google/cloud/retail/v2/internal/model_auth_decorator.h" -#include +#include "google/cloud/retail/v2/model_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -193,3 +196,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/model_auth_decorator.h b/google/cloud/retail/v2/internal/model_auth_decorator.h index 5bbdc5393b120..411828957e870 100644 --- a/google/cloud/retail/v2/internal/model_auth_decorator.h +++ b/google/cloud/retail/v2/internal/model_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/model_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -113,4 +116,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_MODEL_AUTH_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/model_connection_impl.h b/google/cloud/retail/v2/internal/model_connection_impl.h index 09ec76f6d140e..ca0a94b3257ac 100644 --- a/google/cloud/retail/v2/internal/model_connection_impl.h +++ b/google/cloud/retail/v2/internal/model_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/internal/model_logging_decorator.cc b/google/cloud/retail/v2/internal/model_logging_decorator.cc index f106027d06305..191beb0a707f6 100644 --- a/google/cloud/retail/v2/internal/model_logging_decorator.cc +++ b/google/cloud/retail/v2/internal/model_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/retail/v2/model_service.proto #include "google/cloud/retail/v2/internal/model_logging_decorator.h" +#include "google/cloud/retail/v2/model_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -222,3 +225,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/model_logging_decorator.h b/google/cloud/retail/v2/internal/model_logging_decorator.h index d6b437ab0a208..c1da179818fb8 100644 --- a/google/cloud/retail/v2/internal/model_logging_decorator.h +++ b/google/cloud/retail/v2/internal/model_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/model_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -113,4 +116,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_MODEL_LOGGING_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/model_metadata_decorator.cc b/google/cloud/retail/v2/internal/model_metadata_decorator.cc index 489219e1fd1e1..b51dc7a1c577a 100644 --- a/google/cloud/retail/v2/internal/model_metadata_decorator.cc +++ b/google/cloud/retail/v2/internal/model_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/retail/v2/model_service.proto #include "google/cloud/retail/v2/internal/model_metadata_decorator.h" +#include "google/cloud/retail/v2/model_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 retail_v2_internal { @@ -191,3 +195,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/model_metadata_decorator.h b/google/cloud/retail/v2/internal/model_metadata_decorator.h index c842133073614..05026bd2f5f75 100644 --- a/google/cloud/retail/v2/internal/model_metadata_decorator.h +++ b/google/cloud/retail/v2/internal/model_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/model_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -118,4 +121,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_MODEL_METADATA_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/model_option_defaults.cc b/google/cloud/retail/v2/internal/model_option_defaults.cc index 040364d4c64a5..0c88d9e9c4a7c 100644 --- a/google/cloud/retail/v2/internal/model_option_defaults.cc +++ b/google/cloud/retail/v2/internal/model_option_defaults.cc @@ -40,7 +40,7 @@ Options ModelServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - retail_v2::ModelServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + retail_v2::ModelServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/retail/v2/internal/model_stub.cc b/google/cloud/retail/v2/internal/model_stub.cc index 2c792f905021e..0ab8ceb718304 100644 --- a/google/cloud/retail/v2/internal/model_stub.cc +++ b/google/cloud/retail/v2/internal/model_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/retail/v2/model_service.proto #include "google/cloud/retail/v2/internal/model_stub.h" +#include "google/cloud/retail/v2/model_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -221,3 +224,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/model_stub.h b/google/cloud/retail/v2/internal/model_stub.h index 4718136ac438a..6228e0095c375 100644 --- a/google/cloud/retail/v2/internal/model_stub.h +++ b/google/cloud/retail/v2/internal/model_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_MODEL_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_MODEL_STUB_H +#include "google/cloud/retail/v2/model_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -189,4 +192,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_MODEL_STUB_H diff --git a/google/cloud/retail/v2/internal/model_stub_factory.cc b/google/cloud/retail/v2/internal/model_stub_factory.cc index 95d342bcdec3a..04f26532e95dd 100644 --- a/google/cloud/retail/v2/internal/model_stub_factory.cc +++ b/google/cloud/retail/v2/internal/model_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/retail/v2/internal/model_metadata_decorator.h" #include "google/cloud/retail/v2/internal/model_stub.h" #include "google/cloud/retail/v2/internal/model_tracing_stub.h" +#include "google/cloud/retail/v2/model_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/model_stub_factory.h b/google/cloud/retail/v2/internal/model_stub_factory.h index 7e5b639837043..a97b095175684 100644 --- a/google/cloud/retail/v2/internal/model_stub_factory.h +++ b/google/cloud/retail/v2/internal/model_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_MODEL_STUB_FACTORY_H diff --git a/google/cloud/retail/v2/internal/model_tracing_connection.cc b/google/cloud/retail/v2/internal/model_tracing_connection.cc index 1b90880f201b9..43ced88a3b137 100644 --- a/google/cloud/retail/v2/internal/model_tracing_connection.cc +++ b/google/cloud/retail/v2/internal/model_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ModelServiceTracingConnection::ModelServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -161,16 +159,12 @@ ModelServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeModelServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/retail/v2/internal/model_tracing_connection.h b/google/cloud/retail/v2/internal/model_tracing_connection.h index 087c43e928c84..4326a39f92234 100644 --- a/google/cloud/retail/v2/internal/model_tracing_connection.h +++ b/google/cloud/retail/v2/internal/model_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ModelServiceTracingConnection : public retail_v2::ModelServiceConnection { public: ~ModelServiceTracingConnection() override = default; @@ -87,8 +85,6 @@ class ModelServiceTracingConnection : public retail_v2::ModelServiceConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/retail/v2/internal/model_tracing_stub.cc b/google/cloud/retail/v2/internal/model_tracing_stub.cc index 16790e6de8997..fbf21e4679df1 100644 --- a/google/cloud/retail/v2/internal/model_tracing_stub.cc +++ b/google/cloud/retail/v2/internal/model_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ModelServiceTracingStub::ModelServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -200,18 +201,14 @@ future ModelServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeModelServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/model_tracing_stub.h b/google/cloud/retail/v2/internal/model_tracing_stub.h index cff1499430674..7444b2bc54a08 100644 --- a/google/cloud/retail/v2/internal/model_tracing_stub.h +++ b/google/cloud/retail/v2/internal/model_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ModelServiceTracingStub : public ModelServiceStub { public: ~ModelServiceTracingStub() override = default; @@ -108,8 +109,6 @@ class ModelServiceTracingStub : public ModelServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -124,4 +123,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_MODEL_TRACING_STUB_H diff --git a/google/cloud/retail/v2/internal/prediction_auth_decorator.cc b/google/cloud/retail/v2/internal/prediction_auth_decorator.cc index e826024e289d1..e03df5ae2ff72 100644 --- a/google/cloud/retail/v2/internal/prediction_auth_decorator.cc +++ b/google/cloud/retail/v2/internal/prediction_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/retail/v2/prediction_service.proto #include "google/cloud/retail/v2/internal/prediction_auth_decorator.h" -#include +#include "google/cloud/retail/v2/prediction_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -61,3 +64,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/prediction_auth_decorator.h b/google/cloud/retail/v2/internal/prediction_auth_decorator.h index d2a1d721b37b5..ac2d3d1329be7 100644 --- a/google/cloud/retail/v2/internal/prediction_auth_decorator.h +++ b/google/cloud/retail/v2/internal/prediction_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -60,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PREDICTION_AUTH_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/prediction_logging_decorator.cc b/google/cloud/retail/v2/internal/prediction_logging_decorator.cc index 0fcaba0028139..93fe47ee4f562 100644 --- a/google/cloud/retail/v2/internal/prediction_logging_decorator.cc +++ b/google/cloud/retail/v2/internal/prediction_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/retail/v2/prediction_service.proto #include "google/cloud/retail/v2/internal/prediction_logging_decorator.h" +#include "google/cloud/retail/v2/prediction_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/prediction_logging_decorator.h b/google/cloud/retail/v2/internal/prediction_logging_decorator.h index b107d8fd965e9..d1595a9fa39d4 100644 --- a/google/cloud/retail/v2/internal/prediction_logging_decorator.h +++ b/google/cloud/retail/v2/internal/prediction_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -60,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PREDICTION_LOGGING_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/prediction_metadata_decorator.cc b/google/cloud/retail/v2/internal/prediction_metadata_decorator.cc index 17270b053fea2..de555f5bfaf65 100644 --- a/google/cloud/retail/v2/internal/prediction_metadata_decorator.cc +++ b/google/cloud/retail/v2/internal/prediction_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/retail/v2/prediction_service.proto #include "google/cloud/retail/v2/internal/prediction_metadata_decorator.h" +#include "google/cloud/retail/v2/prediction_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 retail_v2_internal { @@ -89,3 +93,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/prediction_metadata_decorator.h b/google/cloud/retail/v2/internal/prediction_metadata_decorator.h index 36286acaed459..312ab97e0e4a5 100644 --- a/google/cloud/retail/v2/internal/prediction_metadata_decorator.h +++ b/google/cloud/retail/v2/internal/prediction_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -66,4 +69,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PREDICTION_METADATA_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/prediction_option_defaults.cc b/google/cloud/retail/v2/internal/prediction_option_defaults.cc index 8bdeadedcdba7..22ebc23a2383c 100644 --- a/google/cloud/retail/v2/internal/prediction_option_defaults.cc +++ b/google/cloud/retail/v2/internal/prediction_option_defaults.cc @@ -42,7 +42,7 @@ Options PredictionServiceDefaultOptions(Options options) { if (!options.has()) { options.set( retail_v2::PredictionServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/retail/v2/internal/prediction_stub.cc b/google/cloud/retail/v2/internal/prediction_stub.cc index e15e31971bd04..06fb6ca120e63 100644 --- a/google/cloud/retail/v2/internal/prediction_stub.cc +++ b/google/cloud/retail/v2/internal/prediction_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/retail/v2/prediction_service.proto #include "google/cloud/retail/v2/internal/prediction_stub.h" +#include "google/cloud/retail/v2/prediction_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/prediction_stub.h b/google/cloud/retail/v2/internal/prediction_stub.h index a06c80cacc5e0..a48df5fbaa007 100644 --- a/google/cloud/retail/v2/internal/prediction_stub.h +++ b/google/cloud/retail/v2/internal/prediction_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PREDICTION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PREDICTION_STUB_H +#include "google/cloud/retail/v2/prediction_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -84,4 +87,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PREDICTION_STUB_H diff --git a/google/cloud/retail/v2/internal/prediction_stub_factory.cc b/google/cloud/retail/v2/internal/prediction_stub_factory.cc index 861ddfcf44b5c..40e168b55bad4 100644 --- a/google/cloud/retail/v2/internal/prediction_stub_factory.cc +++ b/google/cloud/retail/v2/internal/prediction_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/retail/v2/internal/prediction_metadata_decorator.h" #include "google/cloud/retail/v2/internal/prediction_stub.h" #include "google/cloud/retail/v2/internal/prediction_tracing_stub.h" +#include "google/cloud/retail/v2/prediction_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/prediction_stub_factory.h b/google/cloud/retail/v2/internal/prediction_stub_factory.h index f58b89f2ad26a..29cd742d3f17d 100644 --- a/google/cloud/retail/v2/internal/prediction_stub_factory.h +++ b/google/cloud/retail/v2/internal/prediction_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PREDICTION_STUB_FACTORY_H diff --git a/google/cloud/retail/v2/internal/prediction_tracing_connection.cc b/google/cloud/retail/v2/internal/prediction_tracing_connection.cc index 337f806685499..c55b85b6e9606 100644 --- a/google/cloud/retail/v2/internal/prediction_tracing_connection.cc +++ b/google/cloud/retail/v2/internal/prediction_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PredictionServiceTracingConnection::PredictionServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -62,17 +60,13 @@ PredictionServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePredictionServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/retail/v2/internal/prediction_tracing_connection.h b/google/cloud/retail/v2/internal/prediction_tracing_connection.h index 5381b94618f7f..4b1e3faadc2a3 100644 --- a/google/cloud/retail/v2/internal/prediction_tracing_connection.h +++ b/google/cloud/retail/v2/internal/prediction_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PredictionServiceTracingConnection : public retail_v2::PredictionServiceConnection { public: @@ -53,8 +51,6 @@ class PredictionServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/retail/v2/internal/prediction_tracing_stub.cc b/google/cloud/retail/v2/internal/prediction_tracing_stub.cc index 3a7139fbffd9b..b7dc6723ef0d3 100644 --- a/google/cloud/retail/v2/internal/prediction_tracing_stub.cc +++ b/google/cloud/retail/v2/internal/prediction_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - PredictionServiceTracingStub::PredictionServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -68,18 +69,14 @@ PredictionServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakePredictionServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/prediction_tracing_stub.h b/google/cloud/retail/v2/internal/prediction_tracing_stub.h index 285f553badd1f..fd76aaec23c7d 100644 --- a/google/cloud/retail/v2/internal/prediction_tracing_stub.h +++ b/google/cloud/retail/v2/internal/prediction_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class PredictionServiceTracingStub : public PredictionServiceStub { public: ~PredictionServiceTracingStub() override = default; @@ -57,8 +58,6 @@ class PredictionServiceTracingStub : public PredictionServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -73,4 +72,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PREDICTION_TRACING_STUB_H diff --git a/google/cloud/retail/v2/internal/product_auth_decorator.cc b/google/cloud/retail/v2/internal/product_auth_decorator.cc index d1428136c6931..d3096c1720ac4 100644 --- a/google/cloud/retail/v2/internal/product_auth_decorator.cc +++ b/google/cloud/retail/v2/internal/product_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/retail/v2/product_service.proto #include "google/cloud/retail/v2/internal/product_auth_decorator.h" -#include +#include "google/cloud/retail/v2/product_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -329,3 +332,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/product_auth_decorator.h b/google/cloud/retail/v2/internal/product_auth_decorator.h index 06918c8d0b5ce..49b30282694fc 100644 --- a/google/cloud/retail/v2/internal/product_auth_decorator.h +++ b/google/cloud/retail/v2/internal/product_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/product_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -167,4 +170,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PRODUCT_AUTH_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/product_connection_impl.h b/google/cloud/retail/v2/internal/product_connection_impl.h index 5206f22185a84..4415e001f2290 100644 --- a/google/cloud/retail/v2/internal/product_connection_impl.h +++ b/google/cloud/retail/v2/internal/product_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/internal/product_logging_decorator.cc b/google/cloud/retail/v2/internal/product_logging_decorator.cc index 95d9bfa7db0f9..da02cba8a4a25 100644 --- a/google/cloud/retail/v2/internal/product_logging_decorator.cc +++ b/google/cloud/retail/v2/internal/product_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/retail/v2/product_service.proto #include "google/cloud/retail/v2/internal/product_logging_decorator.h" +#include "google/cloud/retail/v2/product_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -370,3 +373,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/product_logging_decorator.h b/google/cloud/retail/v2/internal/product_logging_decorator.h index 55dd8d52b5fdc..efd0de4e679d2 100644 --- a/google/cloud/retail/v2/internal/product_logging_decorator.h +++ b/google/cloud/retail/v2/internal/product_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/product_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -167,4 +170,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PRODUCT_LOGGING_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/product_metadata_decorator.cc b/google/cloud/retail/v2/internal/product_metadata_decorator.cc index 700a496a24cd0..3e8ebe454107f 100644 --- a/google/cloud/retail/v2/internal/product_metadata_decorator.cc +++ b/google/cloud/retail/v2/internal/product_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/retail/v2/product_service.proto #include "google/cloud/retail/v2/internal/product_metadata_decorator.h" +#include "google/cloud/retail/v2/product_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 retail_v2_internal { @@ -291,3 +295,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/product_metadata_decorator.h b/google/cloud/retail/v2/internal/product_metadata_decorator.h index 844862c8da654..27f70efd404f3 100644 --- a/google/cloud/retail/v2/internal/product_metadata_decorator.h +++ b/google/cloud/retail/v2/internal/product_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/product_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -172,4 +175,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PRODUCT_METADATA_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/product_option_defaults.cc b/google/cloud/retail/v2/internal/product_option_defaults.cc index 851f0b92d6a7b..f4d40a857ab27 100644 --- a/google/cloud/retail/v2/internal/product_option_defaults.cc +++ b/google/cloud/retail/v2/internal/product_option_defaults.cc @@ -41,7 +41,7 @@ Options ProductServiceDefaultOptions(Options options) { if (!options.has()) { options.set( retail_v2::ProductServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/retail/v2/internal/product_stub.cc b/google/cloud/retail/v2/internal/product_stub.cc index 6d98dc6203d28..000f928b5bfd0 100644 --- a/google/cloud/retail/v2/internal/product_stub.cc +++ b/google/cloud/retail/v2/internal/product_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/retail/v2/product_service.proto #include "google/cloud/retail/v2/internal/product_stub.h" +#include "google/cloud/retail/v2/product_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -373,3 +376,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/product_stub.h b/google/cloud/retail/v2/internal/product_stub.h index 3baf3d96d9d06..5f3f8192dd81f 100644 --- a/google/cloud/retail/v2/internal/product_stub.h +++ b/google/cloud/retail/v2/internal/product_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PRODUCT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PRODUCT_STUB_H +#include "google/cloud/retail/v2/product_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -300,4 +303,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PRODUCT_STUB_H diff --git a/google/cloud/retail/v2/internal/product_stub_factory.cc b/google/cloud/retail/v2/internal/product_stub_factory.cc index 78445c5333601..f2326bd7fad25 100644 --- a/google/cloud/retail/v2/internal/product_stub_factory.cc +++ b/google/cloud/retail/v2/internal/product_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/retail/v2/internal/product_metadata_decorator.h" #include "google/cloud/retail/v2/internal/product_stub.h" #include "google/cloud/retail/v2/internal/product_tracing_stub.h" +#include "google/cloud/retail/v2/product_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/product_stub_factory.h b/google/cloud/retail/v2/internal/product_stub_factory.h index d88d75505bba8..4749c7415908d 100644 --- a/google/cloud/retail/v2/internal/product_stub_factory.h +++ b/google/cloud/retail/v2/internal/product_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PRODUCT_STUB_FACTORY_H diff --git a/google/cloud/retail/v2/internal/product_tracing_connection.cc b/google/cloud/retail/v2/internal/product_tracing_connection.cc index 7f6aece8b6f3d..0757548cbd1ee 100644 --- a/google/cloud/retail/v2/internal/product_tracing_connection.cc +++ b/google/cloud/retail/v2/internal/product_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ProductServiceTracingConnection::ProductServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -307,16 +305,12 @@ ProductServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeProductServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/retail/v2/internal/product_tracing_connection.h b/google/cloud/retail/v2/internal/product_tracing_connection.h index 627ad0b426de6..3fc86daf34ea6 100644 --- a/google/cloud/retail/v2/internal/product_tracing_connection.h +++ b/google/cloud/retail/v2/internal/product_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ProductServiceTracingConnection : public retail_v2::ProductServiceConnection { public: @@ -153,8 +151,6 @@ class ProductServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/retail/v2/internal/product_tracing_stub.cc b/google/cloud/retail/v2/internal/product_tracing_stub.cc index cabc42756fa04..8b7abef8a3df7 100644 --- a/google/cloud/retail/v2/internal/product_tracing_stub.cc +++ b/google/cloud/retail/v2/internal/product_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ProductServiceTracingStub::ProductServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -332,18 +333,14 @@ future ProductServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeProductServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/product_tracing_stub.h b/google/cloud/retail/v2/internal/product_tracing_stub.h index 44612be75cb32..fc107762eed67 100644 --- a/google/cloud/retail/v2/internal/product_tracing_stub.h +++ b/google/cloud/retail/v2/internal/product_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ProductServiceTracingStub : public ProductServiceStub { public: ~ProductServiceTracingStub() override = default; @@ -162,8 +163,6 @@ class ProductServiceTracingStub : public ProductServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -178,4 +177,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_PRODUCT_TRACING_STUB_H diff --git a/google/cloud/retail/v2/internal/search_auth_decorator.cc b/google/cloud/retail/v2/internal/search_auth_decorator.cc index af18af8e463a3..f3ba4aab6168d 100644 --- a/google/cloud/retail/v2/internal/search_auth_decorator.cc +++ b/google/cloud/retail/v2/internal/search_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/retail/v2/search_service.proto #include "google/cloud/retail/v2/internal/search_auth_decorator.h" -#include +#include "google/cloud/retail/v2/search_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -60,3 +63,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/search_auth_decorator.h b/google/cloud/retail/v2/internal/search_auth_decorator.h index b331a51cb1c2d..048944b57c63f 100644 --- a/google/cloud/retail/v2/internal/search_auth_decorator.h +++ b/google/cloud/retail/v2/internal/search_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -60,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SEARCH_AUTH_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/search_logging_decorator.cc b/google/cloud/retail/v2/internal/search_logging_decorator.cc index 74d49b70f2e3c..547853f446165 100644 --- a/google/cloud/retail/v2/internal/search_logging_decorator.cc +++ b/google/cloud/retail/v2/internal/search_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/retail/v2/search_service.proto #include "google/cloud/retail/v2/internal/search_logging_decorator.h" +#include "google/cloud/retail/v2/search_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/search_logging_decorator.h b/google/cloud/retail/v2/internal/search_logging_decorator.h index 333683818e406..d4c94a6b90ad8 100644 --- a/google/cloud/retail/v2/internal/search_logging_decorator.h +++ b/google/cloud/retail/v2/internal/search_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -60,4 +63,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SEARCH_LOGGING_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/search_metadata_decorator.cc b/google/cloud/retail/v2/internal/search_metadata_decorator.cc index 4ccd2e1dc3b9a..3867443792097 100644 --- a/google/cloud/retail/v2/internal/search_metadata_decorator.cc +++ b/google/cloud/retail/v2/internal/search_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/retail/v2/search_service.proto #include "google/cloud/retail/v2/internal/search_metadata_decorator.h" +#include "google/cloud/retail/v2/search_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 retail_v2_internal { @@ -88,3 +92,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/search_metadata_decorator.h b/google/cloud/retail/v2/internal/search_metadata_decorator.h index 73446d7cd3778..3ed407e3502a7 100644 --- a/google/cloud/retail/v2/internal/search_metadata_decorator.h +++ b/google/cloud/retail/v2/internal/search_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -65,4 +68,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SEARCH_METADATA_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/search_option_defaults.cc b/google/cloud/retail/v2/internal/search_option_defaults.cc index 3e0f5aa602853..79ab7325110ba 100644 --- a/google/cloud/retail/v2/internal/search_option_defaults.cc +++ b/google/cloud/retail/v2/internal/search_option_defaults.cc @@ -40,7 +40,7 @@ Options SearchServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - retail_v2::SearchServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + retail_v2::SearchServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/retail/v2/internal/search_stub.cc b/google/cloud/retail/v2/internal/search_stub.cc index e4735880a113b..22965f7eb7cb5 100644 --- a/google/cloud/retail/v2/internal/search_stub.cc +++ b/google/cloud/retail/v2/internal/search_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/retail/v2/search_service.proto #include "google/cloud/retail/v2/internal/search_stub.h" +#include "google/cloud/retail/v2/search_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/search_stub.h b/google/cloud/retail/v2/internal/search_stub.h index 12ace728716a7..0e91352196129 100644 --- a/google/cloud/retail/v2/internal/search_stub.h +++ b/google/cloud/retail/v2/internal/search_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SEARCH_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SEARCH_STUB_H +#include "google/cloud/retail/v2/search_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -83,4 +86,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SEARCH_STUB_H diff --git a/google/cloud/retail/v2/internal/search_stub_factory.cc b/google/cloud/retail/v2/internal/search_stub_factory.cc index f54272aff8b0c..8f8e3701f88bb 100644 --- a/google/cloud/retail/v2/internal/search_stub_factory.cc +++ b/google/cloud/retail/v2/internal/search_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/retail/v2/internal/search_metadata_decorator.h" #include "google/cloud/retail/v2/internal/search_stub.h" #include "google/cloud/retail/v2/internal/search_tracing_stub.h" +#include "google/cloud/retail/v2/search_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/search_stub_factory.h b/google/cloud/retail/v2/internal/search_stub_factory.h index f11878b927b3b..1c36dcdb5f363 100644 --- a/google/cloud/retail/v2/internal/search_stub_factory.h +++ b/google/cloud/retail/v2/internal/search_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SEARCH_STUB_FACTORY_H diff --git a/google/cloud/retail/v2/internal/search_tracing_connection.cc b/google/cloud/retail/v2/internal/search_tracing_connection.cc index 07752bc6d4166..cb5a41467e0f8 100644 --- a/google/cloud/retail/v2/internal/search_tracing_connection.cc +++ b/google/cloud/retail/v2/internal/search_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SearchServiceTracingConnection::SearchServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -64,16 +62,12 @@ SearchServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSearchServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/retail/v2/internal/search_tracing_connection.h b/google/cloud/retail/v2/internal/search_tracing_connection.h index 3aa2ed9de1e0c..2bb1c4b8da4ad 100644 --- a/google/cloud/retail/v2/internal/search_tracing_connection.h +++ b/google/cloud/retail/v2/internal/search_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SearchServiceTracingConnection : public retail_v2::SearchServiceConnection { public: @@ -53,8 +51,6 @@ class SearchServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/retail/v2/internal/search_tracing_stub.cc b/google/cloud/retail/v2/internal/search_tracing_stub.cc index 95267b5680b66..d17d43c490b1f 100644 --- a/google/cloud/retail/v2/internal/search_tracing_stub.cc +++ b/google/cloud/retail/v2/internal/search_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SearchServiceTracingStub::SearchServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -67,18 +68,14 @@ StatusOr SearchServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSearchServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/search_tracing_stub.h b/google/cloud/retail/v2/internal/search_tracing_stub.h index 2f7b4ab380492..4124d1cb19894 100644 --- a/google/cloud/retail/v2/internal/search_tracing_stub.h +++ b/google/cloud/retail/v2/internal/search_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SearchServiceTracingStub : public SearchServiceStub { public: ~SearchServiceTracingStub() override = default; @@ -56,8 +57,6 @@ class SearchServiceTracingStub : public SearchServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -72,4 +71,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SEARCH_TRACING_STUB_H diff --git a/google/cloud/retail/v2/internal/serving_config_auth_decorator.cc b/google/cloud/retail/v2/internal/serving_config_auth_decorator.cc index 0d5953f17556b..6c7cce48f6ea0 100644 --- a/google/cloud/retail/v2/internal/serving_config_auth_decorator.cc +++ b/google/cloud/retail/v2/internal/serving_config_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/retail/v2/serving_config_service.proto #include "google/cloud/retail/v2/internal/serving_config_auth_decorator.h" -#include +#include "google/cloud/retail/v2/serving_config_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -114,3 +117,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/serving_config_auth_decorator.h b/google/cloud/retail/v2/internal/serving_config_auth_decorator.h index 82bcb816c2e6b..32881db4065e7 100644 --- a/google/cloud/retail/v2/internal/serving_config_auth_decorator.h +++ b/google/cloud/retail/v2/internal/serving_config_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -89,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SERVING_CONFIG_AUTH_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/serving_config_logging_decorator.cc b/google/cloud/retail/v2/internal/serving_config_logging_decorator.cc index 6d6623f34259b..5300526bf6726 100644 --- a/google/cloud/retail/v2/internal/serving_config_logging_decorator.cc +++ b/google/cloud/retail/v2/internal/serving_config_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/retail/v2/serving_config_service.proto #include "google/cloud/retail/v2/internal/serving_config_logging_decorator.h" +#include "google/cloud/retail/v2/serving_config_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -151,3 +154,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/serving_config_logging_decorator.h b/google/cloud/retail/v2/internal/serving_config_logging_decorator.h index 234dc6238b81a..1a9b992e3802c 100644 --- a/google/cloud/retail/v2/internal/serving_config_logging_decorator.h +++ b/google/cloud/retail/v2/internal/serving_config_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -89,4 +92,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SERVING_CONFIG_LOGGING_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/serving_config_metadata_decorator.cc b/google/cloud/retail/v2/internal/serving_config_metadata_decorator.cc index 636c44dcdfc77..d6d2c7e0d5eb0 100644 --- a/google/cloud/retail/v2/internal/serving_config_metadata_decorator.cc +++ b/google/cloud/retail/v2/internal/serving_config_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/retail/v2/serving_config_service.proto #include "google/cloud/retail/v2/internal/serving_config_metadata_decorator.h" +#include "google/cloud/retail/v2/serving_config_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 retail_v2_internal { @@ -145,3 +149,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/serving_config_metadata_decorator.h b/google/cloud/retail/v2/internal/serving_config_metadata_decorator.h index 58d56376c772a..7dfa44c8ab02d 100644 --- a/google/cloud/retail/v2/internal/serving_config_metadata_decorator.h +++ b/google/cloud/retail/v2/internal/serving_config_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -95,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SERVING_CONFIG_METADATA_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/serving_config_option_defaults.cc b/google/cloud/retail/v2/internal/serving_config_option_defaults.cc index 7d46b73c566b8..d85dca16f27d4 100644 --- a/google/cloud/retail/v2/internal/serving_config_option_defaults.cc +++ b/google/cloud/retail/v2/internal/serving_config_option_defaults.cc @@ -42,7 +42,7 @@ Options ServingConfigServiceDefaultOptions(Options options) { if (!options.has()) { options.set( retail_v2::ServingConfigServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/retail/v2/internal/serving_config_stub.cc b/google/cloud/retail/v2/internal/serving_config_stub.cc index 23c78c8b85b69..eace725945705 100644 --- a/google/cloud/retail/v2/internal/serving_config_stub.cc +++ b/google/cloud/retail/v2/internal/serving_config_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/retail/v2/serving_config_service.proto #include "google/cloud/retail/v2/internal/serving_config_stub.h" +#include "google/cloud/retail/v2/serving_config_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -141,3 +144,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/serving_config_stub.h b/google/cloud/retail/v2/internal/serving_config_stub.h index c03e791a87e6f..afa70a9c7f343 100644 --- a/google/cloud/retail/v2/internal/serving_config_stub.h +++ b/google/cloud/retail/v2/internal/serving_config_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SERVING_CONFIG_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SERVING_CONFIG_STUB_H +#include "google/cloud/retail/v2/serving_config_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -141,4 +144,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SERVING_CONFIG_STUB_H diff --git a/google/cloud/retail/v2/internal/serving_config_stub_factory.cc b/google/cloud/retail/v2/internal/serving_config_stub_factory.cc index 1886a346752c3..1d97d0346f6a2 100644 --- a/google/cloud/retail/v2/internal/serving_config_stub_factory.cc +++ b/google/cloud/retail/v2/internal/serving_config_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/retail/v2/internal/serving_config_metadata_decorator.h" #include "google/cloud/retail/v2/internal/serving_config_stub.h" #include "google/cloud/retail/v2/internal/serving_config_tracing_stub.h" +#include "google/cloud/retail/v2/serving_config_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/serving_config_stub_factory.h b/google/cloud/retail/v2/internal/serving_config_stub_factory.h index 7f5c589d4b4fb..e5897590e7543 100644 --- a/google/cloud/retail/v2/internal/serving_config_stub_factory.h +++ b/google/cloud/retail/v2/internal/serving_config_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SERVING_CONFIG_STUB_FACTORY_H diff --git a/google/cloud/retail/v2/internal/serving_config_tracing_connection.cc b/google/cloud/retail/v2/internal/serving_config_tracing_connection.cc index 5190b9a8b3ccc..e2582aec172fd 100644 --- a/google/cloud/retail/v2/internal/serving_config_tracing_connection.cc +++ b/google/cloud/retail/v2/internal/serving_config_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServingConfigServiceTracingConnection::ServingConfigServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -117,17 +115,13 @@ ServingConfigServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServingConfigServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/retail/v2/internal/serving_config_tracing_connection.h b/google/cloud/retail/v2/internal/serving_config_tracing_connection.h index eab919dac0fcf..7bde6b8b9f404 100644 --- a/google/cloud/retail/v2/internal/serving_config_tracing_connection.h +++ b/google/cloud/retail/v2/internal/serving_config_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServingConfigServiceTracingConnection : public retail_v2::ServingConfigServiceConnection { public: @@ -75,8 +73,6 @@ class ServingConfigServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/retail/v2/internal/serving_config_tracing_stub.cc b/google/cloud/retail/v2/internal/serving_config_tracing_stub.cc index efa17b5f2f353..5f9dbf15cbd36 100644 --- a/google/cloud/retail/v2/internal/serving_config_tracing_stub.cc +++ b/google/cloud/retail/v2/internal/serving_config_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServingConfigServiceTracingStub::ServingConfigServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -139,18 +140,14 @@ ServingConfigServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServingConfigServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/serving_config_tracing_stub.h b/google/cloud/retail/v2/internal/serving_config_tracing_stub.h index 04cfc881a2397..6c292ef4f5883 100644 --- a/google/cloud/retail/v2/internal/serving_config_tracing_stub.h +++ b/google/cloud/retail/v2/internal/serving_config_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServingConfigServiceTracingStub : public ServingConfigServiceStub { public: ~ServingConfigServiceTracingStub() override = default; @@ -86,8 +87,6 @@ class ServingConfigServiceTracingStub : public ServingConfigServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -102,4 +101,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_SERVING_CONFIG_TRACING_STUB_H diff --git a/google/cloud/retail/v2/internal/user_event_auth_decorator.cc b/google/cloud/retail/v2/internal/user_event_auth_decorator.cc index 691368b0a5c28..8f3038eeb9bad 100644 --- a/google/cloud/retail/v2/internal/user_event_auth_decorator.cc +++ b/google/cloud/retail/v2/internal/user_event_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/retail/v2/user_event_service.proto #include "google/cloud/retail/v2/internal/user_event_auth_decorator.h" -#include +#include "google/cloud/retail/v2/user_event_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -189,3 +192,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/user_event_auth_decorator.h b/google/cloud/retail/v2/internal/user_event_auth_decorator.h index 2d970b257e006..d3903f5a183e8 100644 --- a/google/cloud/retail/v2/internal/user_event_auth_decorator.h +++ b/google/cloud/retail/v2/internal/user_event_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/user_event_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -114,4 +117,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_USER_EVENT_AUTH_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/user_event_connection_impl.h b/google/cloud/retail/v2/internal/user_event_connection_impl.h index 7e79c975891ec..66779022ee39c 100644 --- a/google/cloud/retail/v2/internal/user_event_connection_impl.h +++ b/google/cloud/retail/v2/internal/user_event_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/internal/user_event_logging_decorator.cc b/google/cloud/retail/v2/internal/user_event_logging_decorator.cc index f64c2f41bc431..66174e8c3812d 100644 --- a/google/cloud/retail/v2/internal/user_event_logging_decorator.cc +++ b/google/cloud/retail/v2/internal/user_event_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/retail/v2/user_event_service.proto #include "google/cloud/retail/v2/internal/user_event_logging_decorator.h" +#include "google/cloud/retail/v2/user_event_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -215,3 +218,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/user_event_logging_decorator.h b/google/cloud/retail/v2/internal/user_event_logging_decorator.h index ae4f63349ee45..4675a79ed0aaf 100644 --- a/google/cloud/retail/v2/internal/user_event_logging_decorator.h +++ b/google/cloud/retail/v2/internal/user_event_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/user_event_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -114,4 +117,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_USER_EVENT_LOGGING_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/user_event_metadata_decorator.cc b/google/cloud/retail/v2/internal/user_event_metadata_decorator.cc index 7d4a73f6f8b93..3a81226360955 100644 --- a/google/cloud/retail/v2/internal/user_event_metadata_decorator.cc +++ b/google/cloud/retail/v2/internal/user_event_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/retail/v2/user_event_service.proto #include "google/cloud/retail/v2/internal/user_event_metadata_decorator.h" +#include "google/cloud/retail/v2/user_event_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 retail_v2_internal { @@ -181,3 +185,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/user_event_metadata_decorator.h b/google/cloud/retail/v2/internal/user_event_metadata_decorator.h index 5fab344d2c5f5..385033a364036 100644 --- a/google/cloud/retail/v2/internal/user_event_metadata_decorator.h +++ b/google/cloud/retail/v2/internal/user_event_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/retail/v2/internal/user_event_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 retail_v2_internal { @@ -120,4 +123,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_USER_EVENT_METADATA_DECORATOR_H diff --git a/google/cloud/retail/v2/internal/user_event_option_defaults.cc b/google/cloud/retail/v2/internal/user_event_option_defaults.cc index 45704903ce27e..48f1db0a656e2 100644 --- a/google/cloud/retail/v2/internal/user_event_option_defaults.cc +++ b/google/cloud/retail/v2/internal/user_event_option_defaults.cc @@ -41,7 +41,7 @@ Options UserEventServiceDefaultOptions(Options options) { if (!options.has()) { options.set( retail_v2::UserEventServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/retail/v2/internal/user_event_stub.cc b/google/cloud/retail/v2/internal/user_event_stub.cc index 9f337302135bc..b8b589a8f350a 100644 --- a/google/cloud/retail/v2/internal/user_event_stub.cc +++ b/google/cloud/retail/v2/internal/user_event_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/retail/v2/user_event_service.proto #include "google/cloud/retail/v2/internal/user_event_stub.h" +#include "google/cloud/retail/v2/user_event_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -211,3 +214,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/user_event_stub.h b/google/cloud/retail/v2/internal/user_event_stub.h index 5b299ec6f91b1..7139b2f54a7e1 100644 --- a/google/cloud/retail/v2/internal/user_event_stub.h +++ b/google/cloud/retail/v2/internal/user_event_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_USER_EVENT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_USER_EVENT_STUB_H +#include "google/cloud/retail/v2/user_event_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -187,4 +190,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_USER_EVENT_STUB_H diff --git a/google/cloud/retail/v2/internal/user_event_stub_factory.cc b/google/cloud/retail/v2/internal/user_event_stub_factory.cc index dd1f9b5329d46..d54e524b11a5a 100644 --- a/google/cloud/retail/v2/internal/user_event_stub_factory.cc +++ b/google/cloud/retail/v2/internal/user_event_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/retail/v2/internal/user_event_metadata_decorator.h" #include "google/cloud/retail/v2/internal/user_event_stub.h" #include "google/cloud/retail/v2/internal/user_event_tracing_stub.h" +#include "google/cloud/retail/v2/user_event_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/user_event_stub_factory.h b/google/cloud/retail/v2/internal/user_event_stub_factory.h index a03f9be8b57dd..ab912d46fe64e 100644 --- a/google/cloud/retail/v2/internal/user_event_stub_factory.h +++ b/google/cloud/retail/v2/internal/user_event_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_USER_EVENT_STUB_FACTORY_H diff --git a/google/cloud/retail/v2/internal/user_event_tracing_connection.cc b/google/cloud/retail/v2/internal/user_event_tracing_connection.cc index 5b731a63d06ba..fd2aafe277028 100644 --- a/google/cloud/retail/v2/internal/user_event_tracing_connection.cc +++ b/google/cloud/retail/v2/internal/user_event_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - UserEventServiceTracingConnection::UserEventServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -160,16 +158,12 @@ UserEventServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeUserEventServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/retail/v2/internal/user_event_tracing_connection.h b/google/cloud/retail/v2/internal/user_event_tracing_connection.h index 6d9bac06084fc..05ec3bb8e93ef 100644 --- a/google/cloud/retail/v2/internal/user_event_tracing_connection.h +++ b/google/cloud/retail/v2/internal/user_event_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class UserEventServiceTracingConnection : public retail_v2::UserEventServiceConnection { public: @@ -93,8 +91,6 @@ class UserEventServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/retail/v2/internal/user_event_tracing_stub.cc b/google/cloud/retail/v2/internal/user_event_tracing_stub.cc index 7ab12bcbd44aa..4d53220113151 100644 --- a/google/cloud/retail/v2/internal/user_event_tracing_stub.cc +++ b/google/cloud/retail/v2/internal/user_event_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - UserEventServiceTracingStub::UserEventServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -188,18 +189,14 @@ future UserEventServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeUserEventServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace retail_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/retail/v2/internal/user_event_tracing_stub.h b/google/cloud/retail/v2/internal/user_event_tracing_stub.h index 0abd070448eb3..ab950186903f1 100644 --- a/google/cloud/retail/v2/internal/user_event_tracing_stub.h +++ b/google/cloud/retail/v2/internal/user_event_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace retail_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class UserEventServiceTracingStub : public UserEventServiceStub { public: ~UserEventServiceTracingStub() override = default; @@ -110,8 +111,6 @@ class UserEventServiceTracingStub : public UserEventServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -126,4 +125,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_INTERNAL_USER_EVENT_TRACING_STUB_H diff --git a/google/cloud/retail/v2/model_client.h b/google/cloud/retail/v2/model_client.h index bbe342406e31b..ed79c92c8d905 100644 --- a/google/cloud/retail/v2/model_client.h +++ b/google/cloud/retail/v2/model_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/retail/v2/model_connection.h b/google/cloud/retail/v2/model_connection.h index b546dce9ff342..c1e85f4f6cd63 100644 --- a/google/cloud/retail/v2/model_connection.h +++ b/google/cloud/retail/v2/model_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/retail/v2/internal/model_retry_traits.h" #include "google/cloud/retail/v2/model_connection_idempotency_policy.h" +#include "google/cloud/retail/v2/model_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/model_connection_idempotency_policy.h b/google/cloud/retail/v2/model_connection_idempotency_policy.h index 0862f56c4906e..b3a2fa72743d7 100644 --- a/google/cloud/retail/v2/model_connection_idempotency_policy.h +++ b/google/cloud/retail/v2/model_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_MODEL_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_MODEL_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/retail/v2/model_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/prediction_connection.h b/google/cloud/retail/v2/prediction_connection.h index 65d675c9edeb6..320b1f9e622f5 100644 --- a/google/cloud/retail/v2/prediction_connection.h +++ b/google/cloud/retail/v2/prediction_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/retail/v2/internal/prediction_retry_traits.h" #include "google/cloud/retail/v2/prediction_connection_idempotency_policy.h" +#include "google/cloud/retail/v2/prediction_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 #include namespace google { diff --git a/google/cloud/retail/v2/prediction_connection_idempotency_policy.h b/google/cloud/retail/v2/prediction_connection_idempotency_policy.h index 56f095a30505d..fc1cb4cf8c1fc 100644 --- a/google/cloud/retail/v2/prediction_connection_idempotency_policy.h +++ b/google/cloud/retail/v2/prediction_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_PREDICTION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_PREDICTION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/retail/v2/prediction_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/product_client.h b/google/cloud/retail/v2/product_client.h index f7c3c85d2fd44..15acb4c381142 100644 --- a/google/cloud/retail/v2/product_client.h +++ b/google/cloud/retail/v2/product_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/retail/v2/product_connection.h b/google/cloud/retail/v2/product_connection.h index c743d2e1709d6..0431dcbd0f0d9 100644 --- a/google/cloud/retail/v2/product_connection.h +++ b/google/cloud/retail/v2/product_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/retail/v2/internal/product_retry_traits.h" #include "google/cloud/retail/v2/product_connection_idempotency_policy.h" +#include "google/cloud/retail/v2/product_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/product_connection_idempotency_policy.h b/google/cloud/retail/v2/product_connection_idempotency_policy.h index 117bb0c62cb94..fe173388d5316 100644 --- a/google/cloud/retail/v2/product_connection_idempotency_policy.h +++ b/google/cloud/retail/v2/product_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_PRODUCT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_PRODUCT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/retail/v2/product_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/search_connection.h b/google/cloud/retail/v2/search_connection.h index 051dd6e11053a..968bed33a9c7f 100644 --- a/google/cloud/retail/v2/search_connection.h +++ b/google/cloud/retail/v2/search_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/retail/v2/internal/search_retry_traits.h" #include "google/cloud/retail/v2/search_connection_idempotency_policy.h" +#include "google/cloud/retail/v2/search_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 #include namespace google { diff --git a/google/cloud/retail/v2/search_connection_idempotency_policy.h b/google/cloud/retail/v2/search_connection_idempotency_policy.h index 529101d62f6de..8ea7f59535193 100644 --- a/google/cloud/retail/v2/search_connection_idempotency_policy.h +++ b/google/cloud/retail/v2/search_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/retail/v2/search_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/serving_config_connection.h b/google/cloud/retail/v2/serving_config_connection.h index 86022cd571ff5..7b19aa544cedd 100644 --- a/google/cloud/retail/v2/serving_config_connection.h +++ b/google/cloud/retail/v2/serving_config_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/retail/v2/internal/serving_config_retry_traits.h" #include "google/cloud/retail/v2/serving_config_connection_idempotency_policy.h" +#include "google/cloud/retail/v2/serving_config_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 #include namespace google { diff --git a/google/cloud/retail/v2/serving_config_connection_idempotency_policy.h b/google/cloud/retail/v2/serving_config_connection_idempotency_policy.h index 1b74b29c4f111..ffce6c28ec671 100644 --- a/google/cloud/retail/v2/serving_config_connection_idempotency_policy.h +++ b/google/cloud/retail/v2/serving_config_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_SERVING_CONFIG_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_SERVING_CONFIG_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/retail/v2/serving_config_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/user_event_client.h b/google/cloud/retail/v2/user_event_client.h index 08086000cb0ea..2c40ee4c23703 100644 --- a/google/cloud/retail/v2/user_event_client.h +++ b/google/cloud/retail/v2/user_event_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/retail/v2/user_event_connection.h b/google/cloud/retail/v2/user_event_connection.h index 5b521904034a2..efb5c7ab7f5da 100644 --- a/google/cloud/retail/v2/user_event_connection.h +++ b/google/cloud/retail/v2/user_event_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/retail/v2/internal/user_event_retry_traits.h" #include "google/cloud/retail/v2/user_event_connection_idempotency_policy.h" +#include "google/cloud/retail/v2/user_event_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/retail/v2/user_event_connection_idempotency_policy.h b/google/cloud/retail/v2/user_event_connection_idempotency_policy.h index 6359d5d652fef..0589402027d10 100644 --- a/google/cloud/retail/v2/user_event_connection_idempotency_policy.h +++ b/google/cloud/retail/v2/user_event_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_USER_EVENT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RETAIL_V2_USER_EVENT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/retail/v2/user_event_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/run/BUILD.bazel b/google/cloud/run/BUILD.bazel index c88d2bf6c1e82..3ef1147c52537 100644 --- a/google/cloud/run/BUILD.bazel +++ b/google/cloud/run/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/run/v2:run_cc_grpc", + "@googleapis//google/cloud/run/v2:run_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/run/CMakeLists.txt b/google/cloud/run/CMakeLists.txt index 492207c77a09d..e613ad53b1267 100644 --- a/google/cloud/run/CMakeLists.txt +++ b/google/cloud/run/CMakeLists.txt @@ -16,8 +16,7 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library(run "Cloud Run Admin API" - SERVICE_DIRS "__EMPTY__" "v2/") +google_cloud_cpp_add_gapic_library(run "Cloud Run Admin API" SERVICE_DIRS "v2/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(run_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/run/mocks/mock_revisions_connection.h b/google/cloud/run/mocks/mock_revisions_connection.h deleted file mode 100644 index f1f255c55201c..0000000000000 --- a/google/cloud/run/mocks/mock_revisions_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/run/v2/revision.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_MOCKS_MOCK_REVISIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_MOCKS_MOCK_REVISIONS_CONNECTION_H - -#include "google/cloud/run/revisions_connection.h" -#include "google/cloud/run/v2/mocks/mock_revisions_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in run_v2_mocks instead of the aliases -/// defined in this namespace. -namespace run_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use run_v2_mocks::MockRevisionsConnection directly. -using ::google::cloud::run_v2_mocks::MockRevisionsConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace run_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_MOCKS_MOCK_REVISIONS_CONNECTION_H diff --git a/google/cloud/run/mocks/mock_services_connection.h b/google/cloud/run/mocks/mock_services_connection.h deleted file mode 100644 index f52e50c67b8a0..0000000000000 --- a/google/cloud/run/mocks/mock_services_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/run/v2/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_MOCKS_MOCK_SERVICES_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_MOCKS_MOCK_SERVICES_CONNECTION_H - -#include "google/cloud/run/services_connection.h" -#include "google/cloud/run/v2/mocks/mock_services_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in run_v2_mocks instead of the aliases -/// defined in this namespace. -namespace run_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use run_v2_mocks::MockServicesConnection directly. -using ::google::cloud::run_v2_mocks::MockServicesConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace run_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_MOCKS_MOCK_SERVICES_CONNECTION_H diff --git a/google/cloud/run/quickstart/.bazelrc b/google/cloud/run/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/run/quickstart/.bazelrc +++ b/google/cloud/run/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/run/quickstart/CMakeLists.txt index e0f1d6e4dea08..c5b481e764084 100644 --- a/google/cloud/run/quickstart/CMakeLists.txt +++ b/google/cloud/run/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Run Admin API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-run-quickstart CXX) find_package(google_cloud_cpp_run REQUIRED) diff --git a/google/cloud/run/quickstart/WORKSPACE.bazel b/google/cloud/run/quickstart/WORKSPACE.bazel index 3847b608eec3e..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 = "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/run/revisions_client.h b/google/cloud/run/revisions_client.h deleted file mode 100644 index cb4b6d8a52b5c..0000000000000 --- a/google/cloud/run/revisions_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/run/v2/revision.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_REVISIONS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_REVISIONS_CLIENT_H - -#include "google/cloud/run/revisions_connection.h" -#include "google/cloud/run/v2/revisions_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in run_v2 instead of the aliases defined in -/// this namespace. -namespace run { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use run_v2::RevisionsClient directly. -using ::google::cloud::run_v2::RevisionsClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace run -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_REVISIONS_CLIENT_H diff --git a/google/cloud/run/revisions_connection.h b/google/cloud/run/revisions_connection.h deleted file mode 100644 index abfa5a3291e53..0000000000000 --- a/google/cloud/run/revisions_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/run/v2/revision.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_REVISIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_REVISIONS_CONNECTION_H - -#include "google/cloud/run/revisions_connection_idempotency_policy.h" -#include "google/cloud/run/v2/revisions_connection.h" - -namespace google { -namespace cloud { -namespace run { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use run_v2::MakeRevisionsConnection directly. -using ::google::cloud::run_v2::MakeRevisionsConnection; - -/// @deprecated Use run_v2::RevisionsConnection directly. -using ::google::cloud::run_v2::RevisionsConnection; - -/// @deprecated Use run_v2::RevisionsLimitedErrorCountRetryPolicy directly. -using ::google::cloud::run_v2::RevisionsLimitedErrorCountRetryPolicy; - -/// @deprecated Use run_v2::RevisionsLimitedTimeRetryPolicy directly. -using ::google::cloud::run_v2::RevisionsLimitedTimeRetryPolicy; - -/// @deprecated Use run_v2::RevisionsRetryPolicy directly. -using ::google::cloud::run_v2::RevisionsRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace run -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_REVISIONS_CONNECTION_H diff --git a/google/cloud/run/revisions_connection_idempotency_policy.h b/google/cloud/run/revisions_connection_idempotency_policy.h deleted file mode 100644 index 08d87657fe8f2..0000000000000 --- a/google/cloud/run/revisions_connection_idempotency_policy.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/run/v2/revision.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_REVISIONS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_REVISIONS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/run/v2/revisions_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace run { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use run_v2::MakeDefaultRevisionsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::run_v2::MakeDefaultRevisionsConnectionIdempotencyPolicy; - -/// @deprecated Use run_v2::RevisionsConnectionIdempotencyPolicy directly. -using ::google::cloud::run_v2::RevisionsConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace run -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_REVISIONS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/run/revisions_options.h b/google/cloud/run/revisions_options.h deleted file mode 100644 index 53cb68246b226..0000000000000 --- a/google/cloud/run/revisions_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/run/v2/revision.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_REVISIONS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_REVISIONS_OPTIONS_H - -#include "google/cloud/run/revisions_connection.h" -#include "google/cloud/run/revisions_connection_idempotency_policy.h" -#include "google/cloud/run/v2/revisions_options.h" - -namespace google { -namespace cloud { -namespace run { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use run_v2::RevisionsPollingPolicyOption directly. -using ::google::cloud::run_v2::RevisionsPollingPolicyOption; - -/// @deprecated Use run_v2::RevisionsBackoffPolicyOption directly. -using ::google::cloud::run_v2::RevisionsBackoffPolicyOption; - -/// @deprecated Use run_v2::RevisionsConnectionIdempotencyPolicyOption directly. -using ::google::cloud::run_v2::RevisionsConnectionIdempotencyPolicyOption; - -/// @deprecated Use run_v2::RevisionsPolicyOptionList directly. -using ::google::cloud::run_v2::RevisionsPolicyOptionList; - -/// @deprecated Use run_v2::RevisionsRetryPolicyOption directly. -using ::google::cloud::run_v2::RevisionsRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace run -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_REVISIONS_OPTIONS_H diff --git a/google/cloud/run/services_client.h b/google/cloud/run/services_client.h deleted file mode 100644 index 91ef2016a2218..0000000000000 --- a/google/cloud/run/services_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/run/v2/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_SERVICES_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_SERVICES_CLIENT_H - -#include "google/cloud/run/services_connection.h" -#include "google/cloud/run/v2/services_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in run_v2 instead of the aliases defined in -/// this namespace. -namespace run { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use run_v2::ServicesClient directly. -using ::google::cloud::run_v2::ServicesClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace run -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_SERVICES_CLIENT_H diff --git a/google/cloud/run/services_connection.h b/google/cloud/run/services_connection.h deleted file mode 100644 index 9793b2f0a2a70..0000000000000 --- a/google/cloud/run/services_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/run/v2/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_SERVICES_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_SERVICES_CONNECTION_H - -#include "google/cloud/run/services_connection_idempotency_policy.h" -#include "google/cloud/run/v2/services_connection.h" - -namespace google { -namespace cloud { -namespace run { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use run_v2::MakeServicesConnection directly. -using ::google::cloud::run_v2::MakeServicesConnection; - -/// @deprecated Use run_v2::ServicesConnection directly. -using ::google::cloud::run_v2::ServicesConnection; - -/// @deprecated Use run_v2::ServicesLimitedErrorCountRetryPolicy directly. -using ::google::cloud::run_v2::ServicesLimitedErrorCountRetryPolicy; - -/// @deprecated Use run_v2::ServicesLimitedTimeRetryPolicy directly. -using ::google::cloud::run_v2::ServicesLimitedTimeRetryPolicy; - -/// @deprecated Use run_v2::ServicesRetryPolicy directly. -using ::google::cloud::run_v2::ServicesRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace run -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_SERVICES_CONNECTION_H diff --git a/google/cloud/run/services_connection_idempotency_policy.h b/google/cloud/run/services_connection_idempotency_policy.h deleted file mode 100644 index 976cb3a476a06..0000000000000 --- a/google/cloud/run/services_connection_idempotency_policy.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/run/v2/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/run/v2/services_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace run { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use run_v2::MakeDefaultServicesConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::run_v2::MakeDefaultServicesConnectionIdempotencyPolicy; - -/// @deprecated Use run_v2::ServicesConnectionIdempotencyPolicy directly. -using ::google::cloud::run_v2::ServicesConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace run -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/run/services_options.h b/google/cloud/run/services_options.h deleted file mode 100644 index 21e2ca6d83ef4..0000000000000 --- a/google/cloud/run/services_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/run/v2/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_SERVICES_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_SERVICES_OPTIONS_H - -#include "google/cloud/run/services_connection.h" -#include "google/cloud/run/services_connection_idempotency_policy.h" -#include "google/cloud/run/v2/services_options.h" - -namespace google { -namespace cloud { -namespace run { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use run_v2::ServicesPollingPolicyOption directly. -using ::google::cloud::run_v2::ServicesPollingPolicyOption; - -/// @deprecated Use run_v2::ServicesBackoffPolicyOption directly. -using ::google::cloud::run_v2::ServicesBackoffPolicyOption; - -/// @deprecated Use run_v2::ServicesConnectionIdempotencyPolicyOption directly. -using ::google::cloud::run_v2::ServicesConnectionIdempotencyPolicyOption; - -/// @deprecated Use run_v2::ServicesPolicyOptionList directly. -using ::google::cloud::run_v2::ServicesPolicyOptionList; - -/// @deprecated Use run_v2::ServicesRetryPolicyOption directly. -using ::google::cloud::run_v2::ServicesRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace run -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_SERVICES_OPTIONS_H diff --git a/google/cloud/run/v2/executions_client.h b/google/cloud/run/v2/executions_client.h index c8dc04445dd6a..eba1536b524b0 100644 --- a/google/cloud/run/v2/executions_client.h +++ b/google/cloud/run/v2/executions_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/run/v2/executions_connection.h b/google/cloud/run/v2/executions_connection.h index ee925e7d8a326..8fac26c9076eb 100644 --- a/google/cloud/run/v2/executions_connection.h +++ b/google/cloud/run/v2/executions_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_EXECUTIONS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_EXECUTIONS_CONNECTION_H +#include "google/cloud/run/v2/execution.pb.h" #include "google/cloud/run/v2/executions_connection_idempotency_policy.h" #include "google/cloud/run/v2/internal/executions_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/run/v2/executions_connection_idempotency_policy.h b/google/cloud/run/v2/executions_connection_idempotency_policy.h index 9b071a5877b7a..f0dd43e830e31 100644 --- a/google/cloud/run/v2/executions_connection_idempotency_policy.h +++ b/google/cloud/run/v2/executions_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_EXECUTIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_EXECUTIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/run/v2/execution.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/run/v2/internal/executions_auth_decorator.cc b/google/cloud/run/v2/internal/executions_auth_decorator.cc index 1f0f35ef45d55..e11ff3cb07547 100644 --- a/google/cloud/run/v2/internal/executions_auth_decorator.cc +++ b/google/cloud/run/v2/internal/executions_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/run/v2/execution.proto #include "google/cloud/run/v2/internal/executions_auth_decorator.h" -#include +#include "google/cloud/run/v2/execution.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -177,3 +180,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/executions_auth_decorator.h b/google/cloud/run/v2/internal/executions_auth_decorator.h index 58fec74f585c8..daccd67e81cdc 100644 --- a/google/cloud/run/v2/internal/executions_auth_decorator.h +++ b/google/cloud/run/v2/internal/executions_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/run/v2/internal/executions_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 run_v2_internal { @@ -105,4 +108,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_EXECUTIONS_AUTH_DECORATOR_H diff --git a/google/cloud/run/v2/internal/executions_connection_impl.h b/google/cloud/run/v2/internal/executions_connection_impl.h index 4b08ed9db6b49..f33279f9179d3 100644 --- a/google/cloud/run/v2/internal/executions_connection_impl.h +++ b/google/cloud/run/v2/internal/executions_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/run/v2/internal/executions_logging_decorator.cc b/google/cloud/run/v2/internal/executions_logging_decorator.cc index 1a7fbaf2ce65c..e556151bdc59a 100644 --- a/google/cloud/run/v2/internal/executions_logging_decorator.cc +++ b/google/cloud/run/v2/internal/executions_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/run/v2/execution.proto #include "google/cloud/run/v2/internal/executions_logging_decorator.h" +#include "google/cloud/run/v2/execution.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -200,3 +203,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/executions_logging_decorator.h b/google/cloud/run/v2/internal/executions_logging_decorator.h index 758f5bb426c02..8cc5852be9149 100644 --- a/google/cloud/run/v2/internal/executions_logging_decorator.h +++ b/google/cloud/run/v2/internal/executions_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/run/v2/internal/executions_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 run_v2_internal { @@ -105,4 +108,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_EXECUTIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/run/v2/internal/executions_metadata_decorator.cc b/google/cloud/run/v2/internal/executions_metadata_decorator.cc index fbfd08061cebf..230f14e777341 100644 --- a/google/cloud/run/v2/internal/executions_metadata_decorator.cc +++ b/google/cloud/run/v2/internal/executions_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/run/v2/execution.proto #include "google/cloud/run/v2/internal/executions_metadata_decorator.h" +#include "google/cloud/run/v2/execution.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 run_v2_internal { @@ -173,3 +177,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/executions_metadata_decorator.h b/google/cloud/run/v2/internal/executions_metadata_decorator.h index 252c4c73596d5..535f24e2047d5 100644 --- a/google/cloud/run/v2/internal/executions_metadata_decorator.h +++ b/google/cloud/run/v2/internal/executions_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/run/v2/internal/executions_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 run_v2_internal { @@ -110,4 +113,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_EXECUTIONS_METADATA_DECORATOR_H diff --git a/google/cloud/run/v2/internal/executions_option_defaults.cc b/google/cloud/run/v2/internal/executions_option_defaults.cc index 9ec8d6f4c9ee8..bb246f1e4cc81 100644 --- a/google/cloud/run/v2/internal/executions_option_defaults.cc +++ b/google/cloud/run/v2/internal/executions_option_defaults.cc @@ -40,7 +40,7 @@ Options ExecutionsDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - run_v2::ExecutionsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + run_v2::ExecutionsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/run/v2/internal/executions_stub.cc b/google/cloud/run/v2/internal/executions_stub.cc index 2e8f50368a26c..afc1ae708a76f 100644 --- a/google/cloud/run/v2/internal/executions_stub.cc +++ b/google/cloud/run/v2/internal/executions_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/run/v2/execution.proto #include "google/cloud/run/v2/internal/executions_stub.h" +#include "google/cloud/run/v2/execution.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -200,3 +203,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/executions_stub.h b/google/cloud/run/v2/internal/executions_stub.h index 1a3b61dc664c4..4e4b8646f2053 100644 --- a/google/cloud/run/v2/internal/executions_stub.h +++ b/google/cloud/run/v2/internal/executions_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_EXECUTIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_EXECUTIONS_STUB_H +#include "google/cloud/run/v2/execution.grpc.pb.h" +#include "google/cloud/run/v2/execution.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -174,4 +177,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_EXECUTIONS_STUB_H diff --git a/google/cloud/run/v2/internal/executions_stub_factory.cc b/google/cloud/run/v2/internal/executions_stub_factory.cc index 41d12c225b3c3..1342fa39d2adf 100644 --- a/google/cloud/run/v2/internal/executions_stub_factory.cc +++ b/google/cloud/run/v2/internal/executions_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/run/v2/execution.proto #include "google/cloud/run/v2/internal/executions_stub_factory.h" +#include "google/cloud/run/v2/execution.grpc.pb.h" #include "google/cloud/run/v2/internal/executions_auth_decorator.h" #include "google/cloud/run/v2/internal/executions_logging_decorator.h" #include "google/cloud/run/v2/internal/executions_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/executions_stub_factory.h b/google/cloud/run/v2/internal/executions_stub_factory.h index efac4f37fcec5..fac616049e172 100644 --- a/google/cloud/run/v2/internal/executions_stub_factory.h +++ b/google/cloud/run/v2/internal/executions_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_EXECUTIONS_STUB_FACTORY_H diff --git a/google/cloud/run/v2/internal/executions_tracing_connection.cc b/google/cloud/run/v2/internal/executions_tracing_connection.cc index 9203d5caa4af8..2dec713065c4a 100644 --- a/google/cloud/run/v2/internal/executions_tracing_connection.cc +++ b/google/cloud/run/v2/internal/executions_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ExecutionsTracingConnection::ExecutionsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -143,15 +141,11 @@ ExecutionsTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeExecutionsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/run/v2/internal/executions_tracing_connection.h b/google/cloud/run/v2/internal/executions_tracing_connection.h index b308484335e48..921d073849af8 100644 --- a/google/cloud/run/v2/internal/executions_tracing_connection.h +++ b/google/cloud/run/v2/internal/executions_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ExecutionsTracingConnection : public run_v2::ExecutionsConnection { public: ~ExecutionsTracingConnection() override = default; @@ -81,8 +79,6 @@ class ExecutionsTracingConnection : public run_v2::ExecutionsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/run/v2/internal/executions_tracing_stub.cc b/google/cloud/run/v2/internal/executions_tracing_stub.cc index 06d5ad761dfe3..9f1b0853329fe 100644 --- a/google/cloud/run/v2/internal/executions_tracing_stub.cc +++ b/google/cloud/run/v2/internal/executions_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ExecutionsTracingStub::ExecutionsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -180,18 +181,14 @@ future ExecutionsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeExecutionsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/executions_tracing_stub.h b/google/cloud/run/v2/internal/executions_tracing_stub.h index d4ded9b10f192..2e4cb39c4f8cb 100644 --- a/google/cloud/run/v2/internal/executions_tracing_stub.h +++ b/google/cloud/run/v2/internal/executions_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ExecutionsTracingStub : public ExecutionsStub { public: ~ExecutionsTracingStub() override = default; @@ -100,8 +101,6 @@ class ExecutionsTracingStub : public ExecutionsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -116,4 +115,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_EXECUTIONS_TRACING_STUB_H diff --git a/google/cloud/run/v2/internal/jobs_auth_decorator.cc b/google/cloud/run/v2/internal/jobs_auth_decorator.cc index e43a92f37f728..c35a17cea1358 100644 --- a/google/cloud/run/v2/internal/jobs_auth_decorator.cc +++ b/google/cloud/run/v2/internal/jobs_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/run/v2/job.proto #include "google/cloud/run/v2/internal/jobs_auth_decorator.h" -#include +#include "google/cloud/run/v2/job.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -251,3 +254,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/jobs_auth_decorator.h b/google/cloud/run/v2/internal/jobs_auth_decorator.h index a84c01a944207..3a8fe04e44120 100644 --- a/google/cloud/run/v2/internal/jobs_auth_decorator.h +++ b/google/cloud/run/v2/internal/jobs_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/run/v2/internal/jobs_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 run_v2_internal { @@ -137,4 +140,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_JOBS_AUTH_DECORATOR_H diff --git a/google/cloud/run/v2/internal/jobs_connection_impl.h b/google/cloud/run/v2/internal/jobs_connection_impl.h index 75a23aab2334b..b7d710c4f011b 100644 --- a/google/cloud/run/v2/internal/jobs_connection_impl.h +++ b/google/cloud/run/v2/internal/jobs_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/run/v2/internal/jobs_logging_decorator.cc b/google/cloud/run/v2/internal/jobs_logging_decorator.cc index bfa934deb6731..4ab567874eadd 100644 --- a/google/cloud/run/v2/internal/jobs_logging_decorator.cc +++ b/google/cloud/run/v2/internal/jobs_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/run/v2/job.proto #include "google/cloud/run/v2/internal/jobs_logging_decorator.h" +#include "google/cloud/run/v2/job.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -286,3 +289,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/jobs_logging_decorator.h b/google/cloud/run/v2/internal/jobs_logging_decorator.h index 553a70d1d873c..fd2f08aee3572 100644 --- a/google/cloud/run/v2/internal/jobs_logging_decorator.h +++ b/google/cloud/run/v2/internal/jobs_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/run/v2/internal/jobs_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 run_v2_internal { @@ -136,4 +139,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_JOBS_LOGGING_DECORATOR_H diff --git a/google/cloud/run/v2/internal/jobs_metadata_decorator.cc b/google/cloud/run/v2/internal/jobs_metadata_decorator.cc index 380be7f664ddd..feb1b4ba78773 100644 --- a/google/cloud/run/v2/internal/jobs_metadata_decorator.cc +++ b/google/cloud/run/v2/internal/jobs_metadata_decorator.cc @@ -17,19 +17,22 @@ // source: google/cloud/run/v2/job.proto #include "google/cloud/run/v2/internal/jobs_metadata_decorator.h" +#include "google/cloud/run/v2/job.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/routing_matcher.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#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 run_v2_internal { @@ -428,3 +431,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/jobs_metadata_decorator.h b/google/cloud/run/v2/internal/jobs_metadata_decorator.h index c2bc33ce54ce3..9a312fef97de7 100644 --- a/google/cloud/run/v2/internal/jobs_metadata_decorator.h +++ b/google/cloud/run/v2/internal/jobs_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/run/v2/internal/jobs_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 run_v2_internal { @@ -142,4 +145,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_JOBS_METADATA_DECORATOR_H diff --git a/google/cloud/run/v2/internal/jobs_option_defaults.cc b/google/cloud/run/v2/internal/jobs_option_defaults.cc index ce5a986ad0839..f18b9c3970c84 100644 --- a/google/cloud/run/v2/internal/jobs_option_defaults.cc +++ b/google/cloud/run/v2/internal/jobs_option_defaults.cc @@ -40,7 +40,7 @@ Options JobsDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - run_v2::JobsLimitedTimeRetryPolicy(std::chrono::minutes(30)).clone()); + run_v2::JobsLimitedTimeRetryPolicy(std::chrono::minutes(10)).clone()); } if (!options.has()) { options.set( diff --git a/google/cloud/run/v2/internal/jobs_stub.cc b/google/cloud/run/v2/internal/jobs_stub.cc index be653ab342910..4ce4f0a3bfa19 100644 --- a/google/cloud/run/v2/internal/jobs_stub.cc +++ b/google/cloud/run/v2/internal/jobs_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/run/v2/job.proto #include "google/cloud/run/v2/internal/jobs_stub.h" +#include "google/cloud/run/v2/job.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -286,3 +289,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/jobs_stub.h b/google/cloud/run/v2/internal/jobs_stub.h index 1f4a6aaf4b18c..fd17aa80fe9fb 100644 --- a/google/cloud/run/v2/internal/jobs_stub.h +++ b/google/cloud/run/v2/internal/jobs_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_JOBS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_JOBS_STUB_H +#include "google/cloud/run/v2/execution.pb.h" +#include "google/cloud/run/v2/job.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -237,4 +240,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_JOBS_STUB_H diff --git a/google/cloud/run/v2/internal/jobs_stub_factory.cc b/google/cloud/run/v2/internal/jobs_stub_factory.cc index 25ce80b2fa001..585750e6fd7f8 100644 --- a/google/cloud/run/v2/internal/jobs_stub_factory.cc +++ b/google/cloud/run/v2/internal/jobs_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/run/v2/internal/jobs_metadata_decorator.h" #include "google/cloud/run/v2/internal/jobs_stub.h" #include "google/cloud/run/v2/internal/jobs_tracing_stub.h" +#include "google/cloud/run/v2/job.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/jobs_stub_factory.h b/google/cloud/run/v2/internal/jobs_stub_factory.h index 26b02b4889452..21acc4178a039 100644 --- a/google/cloud/run/v2/internal/jobs_stub_factory.h +++ b/google/cloud/run/v2/internal/jobs_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_JOBS_STUB_FACTORY_H diff --git a/google/cloud/run/v2/internal/jobs_tracing_connection.cc b/google/cloud/run/v2/internal/jobs_tracing_connection.cc index addfcfcfe6685..9b9463d97def7 100644 --- a/google/cloud/run/v2/internal/jobs_tracing_connection.cc +++ b/google/cloud/run/v2/internal/jobs_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - JobsTracingConnection::JobsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -187,15 +185,11 @@ StatusOr JobsTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeJobsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/run/v2/internal/jobs_tracing_connection.h b/google/cloud/run/v2/internal/jobs_tracing_connection.h index 328cc1e2152d1..6a896fb54ac55 100644 --- a/google/cloud/run/v2/internal/jobs_tracing_connection.h +++ b/google/cloud/run/v2/internal/jobs_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class JobsTracingConnection : public run_v2::JobsConnection { public: ~JobsTracingConnection() override = default; @@ -109,8 +107,6 @@ class JobsTracingConnection : public run_v2::JobsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/run/v2/internal/jobs_tracing_stub.cc b/google/cloud/run/v2/internal/jobs_tracing_stub.cc index bfd5aa7af16ba..4fd81f8efefb8 100644 --- a/google/cloud/run/v2/internal/jobs_tracing_stub.cc +++ b/google/cloud/run/v2/internal/jobs_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - JobsTracingStub::JobsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -249,17 +250,13 @@ future JobsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeJobsTracingStub(std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/jobs_tracing_stub.h b/google/cloud/run/v2/internal/jobs_tracing_stub.h index 3bff4cccac581..40da6036ccc2b 100644 --- a/google/cloud/run/v2/internal/jobs_tracing_stub.h +++ b/google/cloud/run/v2/internal/jobs_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class JobsTracingStub : public JobsStub { public: ~JobsTracingStub() override = default; @@ -132,8 +133,6 @@ class JobsTracingStub : public JobsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -147,4 +146,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_JOBS_TRACING_STUB_H diff --git a/google/cloud/run/v2/internal/revisions_auth_decorator.cc b/google/cloud/run/v2/internal/revisions_auth_decorator.cc index c84a135a697d7..e0b951f4642a5 100644 --- a/google/cloud/run/v2/internal/revisions_auth_decorator.cc +++ b/google/cloud/run/v2/internal/revisions_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/run/v2/revision.proto #include "google/cloud/run/v2/internal/revisions_auth_decorator.h" -#include +#include "google/cloud/run/v2/revision.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -149,3 +152,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/revisions_auth_decorator.h b/google/cloud/run/v2/internal/revisions_auth_decorator.h index 97e08c530e1b5..2972bde7267e8 100644 --- a/google/cloud/run/v2/internal/revisions_auth_decorator.h +++ b/google/cloud/run/v2/internal/revisions_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/run/v2/internal/revisions_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 run_v2_internal { @@ -95,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_REVISIONS_AUTH_DECORATOR_H diff --git a/google/cloud/run/v2/internal/revisions_connection_impl.h b/google/cloud/run/v2/internal/revisions_connection_impl.h index b3fee19a82ca3..b2554dcf7f8f7 100644 --- a/google/cloud/run/v2/internal/revisions_connection_impl.h +++ b/google/cloud/run/v2/internal/revisions_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/run/v2/internal/revisions_logging_decorator.cc b/google/cloud/run/v2/internal/revisions_logging_decorator.cc index c8573540b970e..93b0efa889c68 100644 --- a/google/cloud/run/v2/internal/revisions_logging_decorator.cc +++ b/google/cloud/run/v2/internal/revisions_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/run/v2/revision.proto #include "google/cloud/run/v2/internal/revisions_logging_decorator.h" +#include "google/cloud/run/v2/revision.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -171,3 +174,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/revisions_logging_decorator.h b/google/cloud/run/v2/internal/revisions_logging_decorator.h index ba4e2bd4a3ecd..92c36a0ab17f2 100644 --- a/google/cloud/run/v2/internal/revisions_logging_decorator.h +++ b/google/cloud/run/v2/internal/revisions_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/run/v2/internal/revisions_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 run_v2_internal { @@ -95,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_REVISIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/run/v2/internal/revisions_metadata_decorator.cc b/google/cloud/run/v2/internal/revisions_metadata_decorator.cc index f2554e961d6e7..7e2ab1b9c720c 100644 --- a/google/cloud/run/v2/internal/revisions_metadata_decorator.cc +++ b/google/cloud/run/v2/internal/revisions_metadata_decorator.cc @@ -17,19 +17,22 @@ // source: google/cloud/run/v2/revision.proto #include "google/cloud/run/v2/internal/revisions_metadata_decorator.h" +#include "google/cloud/run/v2/revision.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/routing_matcher.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#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 run_v2_internal { @@ -231,3 +234,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/revisions_metadata_decorator.h b/google/cloud/run/v2/internal/revisions_metadata_decorator.h index 63305f405a640..cac1d31daab70 100644 --- a/google/cloud/run/v2/internal/revisions_metadata_decorator.h +++ b/google/cloud/run/v2/internal/revisions_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/run/v2/internal/revisions_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 run_v2_internal { @@ -100,4 +103,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_REVISIONS_METADATA_DECORATOR_H diff --git a/google/cloud/run/v2/internal/revisions_option_defaults.cc b/google/cloud/run/v2/internal/revisions_option_defaults.cc index e44456f01a6c3..29c75aef474e3 100644 --- a/google/cloud/run/v2/internal/revisions_option_defaults.cc +++ b/google/cloud/run/v2/internal/revisions_option_defaults.cc @@ -40,7 +40,7 @@ Options RevisionsDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - run_v2::RevisionsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + run_v2::RevisionsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/run/v2/internal/revisions_stub.cc b/google/cloud/run/v2/internal/revisions_stub.cc index c7e1f2068adf3..bf8766cf8bc21 100644 --- a/google/cloud/run/v2/internal/revisions_stub.cc +++ b/google/cloud/run/v2/internal/revisions_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/run/v2/revision.proto #include "google/cloud/run/v2/internal/revisions_stub.h" +#include "google/cloud/run/v2/revision.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -171,3 +174,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/revisions_stub.h b/google/cloud/run/v2/internal/revisions_stub.h index 3b55004d96000..1b5a6fe20b224 100644 --- a/google/cloud/run/v2/internal/revisions_stub.h +++ b/google/cloud/run/v2/internal/revisions_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_REVISIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_REVISIONS_STUB_H +#include "google/cloud/run/v2/revision.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -152,4 +155,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_REVISIONS_STUB_H diff --git a/google/cloud/run/v2/internal/revisions_stub_factory.cc b/google/cloud/run/v2/internal/revisions_stub_factory.cc index d60184965d83a..b100d0e42e373 100644 --- a/google/cloud/run/v2/internal/revisions_stub_factory.cc +++ b/google/cloud/run/v2/internal/revisions_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/run/v2/internal/revisions_metadata_decorator.h" #include "google/cloud/run/v2/internal/revisions_stub.h" #include "google/cloud/run/v2/internal/revisions_tracing_stub.h" +#include "google/cloud/run/v2/revision.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/revisions_stub_factory.h b/google/cloud/run/v2/internal/revisions_stub_factory.h index 50d73dd55d953..f94b82da6196b 100644 --- a/google/cloud/run/v2/internal/revisions_stub_factory.h +++ b/google/cloud/run/v2/internal/revisions_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_REVISIONS_STUB_FACTORY_H diff --git a/google/cloud/run/v2/internal/revisions_tracing_connection.cc b/google/cloud/run/v2/internal/revisions_tracing_connection.cc index b09e5a6e2e817..182317d74ef64 100644 --- a/google/cloud/run/v2/internal/revisions_tracing_connection.cc +++ b/google/cloud/run/v2/internal/revisions_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RevisionsTracingConnection::RevisionsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -110,15 +108,11 @@ RevisionsTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRevisionsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/run/v2/internal/revisions_tracing_connection.h b/google/cloud/run/v2/internal/revisions_tracing_connection.h index d8e9452fa01e5..058fd393928c9 100644 --- a/google/cloud/run/v2/internal/revisions_tracing_connection.h +++ b/google/cloud/run/v2/internal/revisions_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RevisionsTracingConnection : public run_v2::RevisionsConnection { public: ~RevisionsTracingConnection() override = default; @@ -71,8 +69,6 @@ class RevisionsTracingConnection : public run_v2::RevisionsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/run/v2/internal/revisions_tracing_stub.cc b/google/cloud/run/v2/internal/revisions_tracing_stub.cc index 91598a92cd0bb..45adf0b829229 100644 --- a/google/cloud/run/v2/internal/revisions_tracing_stub.cc +++ b/google/cloud/run/v2/internal/revisions_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RevisionsTracingStub::RevisionsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -153,18 +154,14 @@ future RevisionsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRevisionsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/revisions_tracing_stub.h b/google/cloud/run/v2/internal/revisions_tracing_stub.h index 8a50b99766932..4c88d85cc6c9a 100644 --- a/google/cloud/run/v2/internal/revisions_tracing_stub.h +++ b/google/cloud/run/v2/internal/revisions_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RevisionsTracingStub : public RevisionsStub { public: ~RevisionsTracingStub() override = default; @@ -90,8 +91,6 @@ class RevisionsTracingStub : public RevisionsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -106,4 +105,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_REVISIONS_TRACING_STUB_H diff --git a/google/cloud/run/v2/internal/services_auth_decorator.cc b/google/cloud/run/v2/internal/services_auth_decorator.cc index fc1e84a331090..15cd99c9ad94a 100644 --- a/google/cloud/run/v2/internal/services_auth_decorator.cc +++ b/google/cloud/run/v2/internal/services_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/run/v2/service.proto #include "google/cloud/run/v2/internal/services_auth_decorator.h" -#include +#include "google/cloud/run/v2/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -230,3 +233,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/services_auth_decorator.h b/google/cloud/run/v2/internal/services_auth_decorator.h index cf7692013a01c..9f76468c9aa97 100644 --- a/google/cloud/run/v2/internal/services_auth_decorator.h +++ b/google/cloud/run/v2/internal/services_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/run/v2/internal/services_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 run_v2_internal { @@ -127,4 +130,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_SERVICES_AUTH_DECORATOR_H diff --git a/google/cloud/run/v2/internal/services_connection_impl.h b/google/cloud/run/v2/internal/services_connection_impl.h index 073e2d8dd1d2e..95b11d8f6ad0d 100644 --- a/google/cloud/run/v2/internal/services_connection_impl.h +++ b/google/cloud/run/v2/internal/services_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/run/v2/internal/services_logging_decorator.cc b/google/cloud/run/v2/internal/services_logging_decorator.cc index 34e23bff120e1..71236c67730ef 100644 --- a/google/cloud/run/v2/internal/services_logging_decorator.cc +++ b/google/cloud/run/v2/internal/services_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/run/v2/service.proto #include "google/cloud/run/v2/internal/services_logging_decorator.h" +#include "google/cloud/run/v2/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -263,3 +266,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/services_logging_decorator.h b/google/cloud/run/v2/internal/services_logging_decorator.h index c1e54a1b202cc..f402c65a207b0 100644 --- a/google/cloud/run/v2/internal/services_logging_decorator.h +++ b/google/cloud/run/v2/internal/services_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/run/v2/internal/services_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 run_v2_internal { @@ -127,4 +130,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_SERVICES_LOGGING_DECORATOR_H diff --git a/google/cloud/run/v2/internal/services_metadata_decorator.cc b/google/cloud/run/v2/internal/services_metadata_decorator.cc index d0506876bf3ab..75d87c5f60af6 100644 --- a/google/cloud/run/v2/internal/services_metadata_decorator.cc +++ b/google/cloud/run/v2/internal/services_metadata_decorator.cc @@ -17,19 +17,22 @@ // source: google/cloud/run/v2/service.proto #include "google/cloud/run/v2/internal/services_metadata_decorator.h" +#include "google/cloud/run/v2/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/routing_matcher.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#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 run_v2_internal { @@ -375,3 +378,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/services_metadata_decorator.h b/google/cloud/run/v2/internal/services_metadata_decorator.h index 1678c9d73f02d..8202736e36410 100644 --- a/google/cloud/run/v2/internal/services_metadata_decorator.h +++ b/google/cloud/run/v2/internal/services_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/run/v2/internal/services_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 run_v2_internal { @@ -132,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_SERVICES_METADATA_DECORATOR_H diff --git a/google/cloud/run/v2/internal/services_option_defaults.cc b/google/cloud/run/v2/internal/services_option_defaults.cc index 0968305432cd4..5082424e3e32e 100644 --- a/google/cloud/run/v2/internal/services_option_defaults.cc +++ b/google/cloud/run/v2/internal/services_option_defaults.cc @@ -40,7 +40,7 @@ Options ServicesDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - run_v2::ServicesLimitedTimeRetryPolicy(std::chrono::minutes(30)) + run_v2::ServicesLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/run/v2/internal/services_stub.cc b/google/cloud/run/v2/internal/services_stub.cc index 0b1a81abce56b..8f90aef580d7f 100644 --- a/google/cloud/run/v2/internal/services_stub.cc +++ b/google/cloud/run/v2/internal/services_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/run/v2/service.proto #include "google/cloud/run/v2/internal/services_stub.h" +#include "google/cloud/run/v2/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -263,3 +266,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/services_stub.h b/google/cloud/run/v2/internal/services_stub.h index 92df911759265..e1d4e99980175 100644 --- a/google/cloud/run/v2/internal/services_stub.h +++ b/google/cloud/run/v2/internal/services_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_SERVICES_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_SERVICES_STUB_H +#include "google/cloud/run/v2/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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -217,4 +220,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_SERVICES_STUB_H diff --git a/google/cloud/run/v2/internal/services_stub_factory.cc b/google/cloud/run/v2/internal/services_stub_factory.cc index 4b8606e3871e8..7184bcda65d90 100644 --- a/google/cloud/run/v2/internal/services_stub_factory.cc +++ b/google/cloud/run/v2/internal/services_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/run/v2/internal/services_metadata_decorator.h" #include "google/cloud/run/v2/internal/services_stub.h" #include "google/cloud/run/v2/internal/services_tracing_stub.h" +#include "google/cloud/run/v2/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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/services_stub_factory.h b/google/cloud/run/v2/internal/services_stub_factory.h index 4e52cc7acefa4..960ae3f3895c1 100644 --- a/google/cloud/run/v2/internal/services_stub_factory.h +++ b/google/cloud/run/v2/internal/services_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_SERVICES_STUB_FACTORY_H diff --git a/google/cloud/run/v2/internal/services_tracing_connection.cc b/google/cloud/run/v2/internal/services_tracing_connection.cc index 38938fb7b26f6..f6d0361e3b6da 100644 --- a/google/cloud/run/v2/internal/services_tracing_connection.cc +++ b/google/cloud/run/v2/internal/services_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServicesTracingConnection::ServicesTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -178,15 +176,11 @@ ServicesTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServicesTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/run/v2/internal/services_tracing_connection.h b/google/cloud/run/v2/internal/services_tracing_connection.h index f592d61140e05..3b28cce779004 100644 --- a/google/cloud/run/v2/internal/services_tracing_connection.h +++ b/google/cloud/run/v2/internal/services_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServicesTracingConnection : public run_v2::ServicesConnection { public: ~ServicesTracingConnection() override = default; @@ -100,8 +98,6 @@ class ServicesTracingConnection : public run_v2::ServicesConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/run/v2/internal/services_tracing_stub.cc b/google/cloud/run/v2/internal/services_tracing_stub.cc index d5a6d529c5505..3fe0c863f11b4 100644 --- a/google/cloud/run/v2/internal/services_tracing_stub.cc +++ b/google/cloud/run/v2/internal/services_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServicesTracingStub::ServicesTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -236,18 +237,14 @@ future ServicesTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServicesTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/services_tracing_stub.h b/google/cloud/run/v2/internal/services_tracing_stub.h index 6d04b263bdd8d..e01e8699e371b 100644 --- a/google/cloud/run/v2/internal/services_tracing_stub.h +++ b/google/cloud/run/v2/internal/services_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServicesTracingStub : public ServicesStub { public: ~ServicesTracingStub() override = default; @@ -122,8 +123,6 @@ class ServicesTracingStub : public ServicesStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -138,4 +137,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_SERVICES_TRACING_STUB_H diff --git a/google/cloud/run/v2/internal/tasks_auth_decorator.cc b/google/cloud/run/v2/internal/tasks_auth_decorator.cc index a29dd3084fe7c..545f30cff9bc6 100644 --- a/google/cloud/run/v2/internal/tasks_auth_decorator.cc +++ b/google/cloud/run/v2/internal/tasks_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/run/v2/task.proto #include "google/cloud/run/v2/internal/tasks_auth_decorator.h" -#include +#include "google/cloud/run/v2/task.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -83,3 +86,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/tasks_auth_decorator.h b/google/cloud/run/v2/internal/tasks_auth_decorator.h index 9c681f7d2582f..7b5cbfdac3dd0 100644 --- a/google/cloud/run/v2/internal/tasks_auth_decorator.h +++ b/google/cloud/run/v2/internal/tasks_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -72,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_TASKS_AUTH_DECORATOR_H diff --git a/google/cloud/run/v2/internal/tasks_logging_decorator.cc b/google/cloud/run/v2/internal/tasks_logging_decorator.cc index 017961e18d01d..2583a82541ee7 100644 --- a/google/cloud/run/v2/internal/tasks_logging_decorator.cc +++ b/google/cloud/run/v2/internal/tasks_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/run/v2/task.proto #include "google/cloud/run/v2/internal/tasks_logging_decorator.h" +#include "google/cloud/run/v2/task.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -106,3 +109,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/tasks_logging_decorator.h b/google/cloud/run/v2/internal/tasks_logging_decorator.h index e712b4d7369d1..1c1d21409ea02 100644 --- a/google/cloud/run/v2/internal/tasks_logging_decorator.h +++ b/google/cloud/run/v2/internal/tasks_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -71,4 +74,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_TASKS_LOGGING_DECORATOR_H diff --git a/google/cloud/run/v2/internal/tasks_metadata_decorator.cc b/google/cloud/run/v2/internal/tasks_metadata_decorator.cc index aa5d2f265ef80..ff9afea8b6554 100644 --- a/google/cloud/run/v2/internal/tasks_metadata_decorator.cc +++ b/google/cloud/run/v2/internal/tasks_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/run/v2/task.proto #include "google/cloud/run/v2/internal/tasks_metadata_decorator.h" +#include "google/cloud/run/v2/task.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 run_v2_internal { @@ -109,3 +113,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/tasks_metadata_decorator.h b/google/cloud/run/v2/internal/tasks_metadata_decorator.h index 3a7465740290d..a74c20025b48d 100644 --- a/google/cloud/run/v2/internal/tasks_metadata_decorator.h +++ b/google/cloud/run/v2/internal/tasks_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -77,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_TASKS_METADATA_DECORATOR_H diff --git a/google/cloud/run/v2/internal/tasks_option_defaults.cc b/google/cloud/run/v2/internal/tasks_option_defaults.cc index 0055c0779532d..26d1f5621a35f 100644 --- a/google/cloud/run/v2/internal/tasks_option_defaults.cc +++ b/google/cloud/run/v2/internal/tasks_option_defaults.cc @@ -40,7 +40,7 @@ Options TasksDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - run_v2::TasksLimitedTimeRetryPolicy(std::chrono::minutes(30)).clone()); + run_v2::TasksLimitedTimeRetryPolicy(std::chrono::minutes(10)).clone()); } if (!options.has()) { options.set( diff --git a/google/cloud/run/v2/internal/tasks_stub.cc b/google/cloud/run/v2/internal/tasks_stub.cc index 140a225d3265d..bcc07f1216044 100644 --- a/google/cloud/run/v2/internal/tasks_stub.cc +++ b/google/cloud/run/v2/internal/tasks_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/run/v2/task.proto #include "google/cloud/run/v2/internal/tasks_stub.h" +#include "google/cloud/run/v2/task.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -101,3 +104,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/tasks_stub.h b/google/cloud/run/v2/internal/tasks_stub.h index fad496b1f463e..656aab590119f 100644 --- a/google/cloud/run/v2/internal/tasks_stub.h +++ b/google/cloud/run/v2/internal/tasks_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_TASKS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_TASKS_STUB_H +#include "google/cloud/run/v2/task.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -105,4 +108,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_TASKS_STUB_H diff --git a/google/cloud/run/v2/internal/tasks_stub_factory.cc b/google/cloud/run/v2/internal/tasks_stub_factory.cc index 712a090c80198..ec3149c94dafa 100644 --- a/google/cloud/run/v2/internal/tasks_stub_factory.cc +++ b/google/cloud/run/v2/internal/tasks_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/run/v2/internal/tasks_metadata_decorator.h" #include "google/cloud/run/v2/internal/tasks_stub.h" #include "google/cloud/run/v2/internal/tasks_tracing_stub.h" +#include "google/cloud/run/v2/task.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/tasks_stub_factory.h b/google/cloud/run/v2/internal/tasks_stub_factory.h index 4478a3daf6f7a..3c905c498a0ad 100644 --- a/google/cloud/run/v2/internal/tasks_stub_factory.h +++ b/google/cloud/run/v2/internal/tasks_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_TASKS_STUB_FACTORY_H diff --git a/google/cloud/run/v2/internal/tasks_tracing_connection.cc b/google/cloud/run/v2/internal/tasks_tracing_connection.cc index 4cf3c84000cce..5900f8099b787 100644 --- a/google/cloud/run/v2/internal/tasks_tracing_connection.cc +++ b/google/cloud/run/v2/internal/tasks_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TasksTracingConnection::TasksTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -80,15 +78,11 @@ StatusOr TasksTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTasksTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/run/v2/internal/tasks_tracing_connection.h b/google/cloud/run/v2/internal/tasks_tracing_connection.h index 870ced612e677..1135adb5a2b9f 100644 --- a/google/cloud/run/v2/internal/tasks_tracing_connection.h +++ b/google/cloud/run/v2/internal/tasks_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TasksTracingConnection : public run_v2::TasksConnection { public: ~TasksTracingConnection() override = default; @@ -61,8 +59,6 @@ class TasksTracingConnection : public run_v2::TasksConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/run/v2/internal/tasks_tracing_stub.cc b/google/cloud/run/v2/internal/tasks_tracing_stub.cc index 2ce99b4b7c0b5..3fe7bfe172869 100644 --- a/google/cloud/run/v2/internal/tasks_tracing_stub.cc +++ b/google/cloud/run/v2/internal/tasks_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TasksTracingStub::TasksTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -96,18 +97,14 @@ StatusOr TasksTracingStub::WaitOperation( child_->WaitOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTasksTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace run_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/run/v2/internal/tasks_tracing_stub.h b/google/cloud/run/v2/internal/tasks_tracing_stub.h index ab65a7d853384..250ea8ce3bf28 100644 --- a/google/cloud/run/v2/internal/tasks_tracing_stub.h +++ b/google/cloud/run/v2/internal/tasks_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace run_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TasksTracingStub : public TasksStub { public: ~TasksTracingStub() override = default; @@ -68,8 +69,6 @@ class TasksTracingStub : public TasksStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -84,4 +83,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_INTERNAL_TASKS_TRACING_STUB_H diff --git a/google/cloud/run/v2/jobs_client.h b/google/cloud/run/v2/jobs_client.h index 31e03722c0321..0a3b75e62b488 100644 --- a/google/cloud/run/v2/jobs_client.h +++ b/google/cloud/run/v2/jobs_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/run/v2/jobs_connection.h b/google/cloud/run/v2/jobs_connection.h index f11d24f829f92..a0ac54d22c0d8 100644 --- a/google/cloud/run/v2/jobs_connection.h +++ b/google/cloud/run/v2/jobs_connection.h @@ -19,7 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_JOBS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_JOBS_CONNECTION_H +#include "google/cloud/run/v2/execution.pb.h" #include "google/cloud/run/v2/internal/jobs_retry_traits.h" +#include "google/cloud/run/v2/job.pb.h" #include "google/cloud/run/v2/jobs_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,9 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/run/v2/jobs_connection_idempotency_policy.h b/google/cloud/run/v2/jobs_connection_idempotency_policy.h index 240b37d89f398..808acf3e4ff99 100644 --- a/google/cloud/run/v2/jobs_connection_idempotency_policy.h +++ b/google/cloud/run/v2/jobs_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_JOBS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_JOBS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/run/v2/job.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/run/v2/revisions_client.h b/google/cloud/run/v2/revisions_client.h index 4fed4e28db90c..8ceeccf7d1a91 100644 --- a/google/cloud/run/v2/revisions_client.h +++ b/google/cloud/run/v2/revisions_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/run/v2/revisions_connection.h b/google/cloud/run/v2/revisions_connection.h index 3919c4799839e..9b537642439ca 100644 --- a/google/cloud/run/v2/revisions_connection.h +++ b/google/cloud/run/v2/revisions_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_REVISIONS_CONNECTION_H #include "google/cloud/run/v2/internal/revisions_retry_traits.h" +#include "google/cloud/run/v2/revision.pb.h" #include "google/cloud/run/v2/revisions_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/run/v2/revisions_connection_idempotency_policy.h b/google/cloud/run/v2/revisions_connection_idempotency_policy.h index 985abf0b01fa2..b208faf9c21f0 100644 --- a/google/cloud/run/v2/revisions_connection_idempotency_policy.h +++ b/google/cloud/run/v2/revisions_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_REVISIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_REVISIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/run/v2/revision.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/run/v2/services_client.h b/google/cloud/run/v2/services_client.h index 1d8b685ad42eb..f0a61c7bd8afb 100644 --- a/google/cloud/run/v2/services_client.h +++ b/google/cloud/run/v2/services_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/run/v2/services_connection.h b/google/cloud/run/v2/services_connection.h index 2d72889db8f74..6045a2f7a8a5f 100644 --- a/google/cloud/run/v2/services_connection.h +++ b/google/cloud/run/v2/services_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_SERVICES_CONNECTION_H #include "google/cloud/run/v2/internal/services_retry_traits.h" +#include "google/cloud/run/v2/service.pb.h" #include "google/cloud/run/v2/services_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/run/v2/services_connection_idempotency_policy.h b/google/cloud/run/v2/services_connection_idempotency_policy.h index 25e9c545e34e1..c8db086991353 100644 --- a/google/cloud/run/v2/services_connection_idempotency_policy.h +++ b/google/cloud/run/v2/services_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_SERVICES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/run/v2/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/run/v2/tasks_connection.h b/google/cloud/run/v2/tasks_connection.h index 7360236798918..817b7499a1181 100644 --- a/google/cloud/run/v2/tasks_connection.h +++ b/google/cloud/run/v2/tasks_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_TASKS_CONNECTION_H #include "google/cloud/run/v2/internal/tasks_retry_traits.h" +#include "google/cloud/run/v2/task.pb.h" #include "google/cloud/run/v2/tasks_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/run/v2/tasks_connection_idempotency_policy.h b/google/cloud/run/v2/tasks_connection_idempotency_policy.h index 5ba9ae37de252..0c41873b4eae7 100644 --- a/google/cloud/run/v2/tasks_connection_idempotency_policy.h +++ b/google/cloud/run/v2/tasks_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_TASKS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_RUN_V2_TASKS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/run/v2/task.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/scheduler/BUILD.bazel b/google/cloud/scheduler/BUILD.bazel index d2f15d3dc935d..8e5563c0aa22d 100644 --- a/google/cloud/scheduler/BUILD.bazel +++ b/google/cloud/scheduler/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/scheduler/v1:scheduler_cc_grpc", + "@googleapis//google/cloud/scheduler/v1:scheduler_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/scheduler/CMakeLists.txt b/google/cloud/scheduler/CMakeLists.txt index 1c268d72d837e..90079925e16c8 100644 --- a/google/cloud/scheduler/CMakeLists.txt +++ b/google/cloud/scheduler/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(scheduler "Cloud Scheduler API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(scheduler_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/scheduler/cloud_scheduler_client.h b/google/cloud/scheduler/cloud_scheduler_client.h deleted file mode 100644 index b75103311946c..0000000000000 --- a/google/cloud/scheduler/cloud_scheduler_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/scheduler/v1/cloudscheduler.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_CLOUD_SCHEDULER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_CLOUD_SCHEDULER_CLIENT_H - -#include "google/cloud/scheduler/cloud_scheduler_connection.h" -#include "google/cloud/scheduler/v1/cloud_scheduler_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in scheduler_v1 instead of the aliases defined in -/// this namespace. -namespace scheduler { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use scheduler_v1::CloudSchedulerClient directly. -using ::google::cloud::scheduler_v1::CloudSchedulerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace scheduler -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_CLOUD_SCHEDULER_CLIENT_H diff --git a/google/cloud/scheduler/cloud_scheduler_connection.h b/google/cloud/scheduler/cloud_scheduler_connection.h deleted file mode 100644 index 0960cafbd3b52..0000000000000 --- a/google/cloud/scheduler/cloud_scheduler_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/scheduler/v1/cloudscheduler.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_CLOUD_SCHEDULER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_CLOUD_SCHEDULER_CONNECTION_H - -#include "google/cloud/scheduler/cloud_scheduler_connection_idempotency_policy.h" -#include "google/cloud/scheduler/v1/cloud_scheduler_connection.h" - -namespace google { -namespace cloud { -namespace scheduler { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use scheduler_v1::MakeCloudSchedulerConnection directly. -using ::google::cloud::scheduler_v1::MakeCloudSchedulerConnection; - -/// @deprecated Use scheduler_v1::CloudSchedulerConnection directly. -using ::google::cloud::scheduler_v1::CloudSchedulerConnection; - -/// @deprecated Use scheduler_v1::CloudSchedulerLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::scheduler_v1::CloudSchedulerLimitedErrorCountRetryPolicy; - -/// @deprecated Use scheduler_v1::CloudSchedulerLimitedTimeRetryPolicy directly. -using ::google::cloud::scheduler_v1::CloudSchedulerLimitedTimeRetryPolicy; - -/// @deprecated Use scheduler_v1::CloudSchedulerRetryPolicy directly. -using ::google::cloud::scheduler_v1::CloudSchedulerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace scheduler -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_CLOUD_SCHEDULER_CONNECTION_H diff --git a/google/cloud/scheduler/cloud_scheduler_connection_idempotency_policy.h b/google/cloud/scheduler/cloud_scheduler_connection_idempotency_policy.h deleted file mode 100644 index 74485af20aa5e..0000000000000 --- a/google/cloud/scheduler/cloud_scheduler_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/scheduler/v1/cloudscheduler.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_CLOUD_SCHEDULER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_CLOUD_SCHEDULER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/scheduler/v1/cloud_scheduler_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace scheduler { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// scheduler_v1::MakeDefaultCloudSchedulerConnectionIdempotencyPolicy directly. -using ::google::cloud::scheduler_v1:: - MakeDefaultCloudSchedulerConnectionIdempotencyPolicy; - -/// @deprecated Use scheduler_v1::CloudSchedulerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::scheduler_v1::CloudSchedulerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace scheduler -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_CLOUD_SCHEDULER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/scheduler/cloud_scheduler_options.h b/google/cloud/scheduler/cloud_scheduler_options.h deleted file mode 100644 index ecc0a4d9823e3..0000000000000 --- a/google/cloud/scheduler/cloud_scheduler_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/scheduler/v1/cloudscheduler.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_CLOUD_SCHEDULER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_CLOUD_SCHEDULER_OPTIONS_H - -#include "google/cloud/scheduler/cloud_scheduler_connection.h" -#include "google/cloud/scheduler/cloud_scheduler_connection_idempotency_policy.h" -#include "google/cloud/scheduler/v1/cloud_scheduler_options.h" - -namespace google { -namespace cloud { -namespace scheduler { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use scheduler_v1::CloudSchedulerBackoffPolicyOption directly. -using ::google::cloud::scheduler_v1::CloudSchedulerBackoffPolicyOption; - -/// @deprecated Use -/// scheduler_v1::CloudSchedulerConnectionIdempotencyPolicyOption directly. -using ::google::cloud::scheduler_v1:: - CloudSchedulerConnectionIdempotencyPolicyOption; - -/// @deprecated Use scheduler_v1::CloudSchedulerPolicyOptionList directly. -using ::google::cloud::scheduler_v1::CloudSchedulerPolicyOptionList; - -/// @deprecated Use scheduler_v1::CloudSchedulerRetryPolicyOption directly. -using ::google::cloud::scheduler_v1::CloudSchedulerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace scheduler -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_CLOUD_SCHEDULER_OPTIONS_H diff --git a/google/cloud/scheduler/mocks/mock_cloud_scheduler_connection.h b/google/cloud/scheduler/mocks/mock_cloud_scheduler_connection.h deleted file mode 100644 index 9aa74e412cd85..0000000000000 --- a/google/cloud/scheduler/mocks/mock_cloud_scheduler_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/scheduler/v1/cloudscheduler.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_MOCKS_MOCK_CLOUD_SCHEDULER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_MOCKS_MOCK_CLOUD_SCHEDULER_CONNECTION_H - -#include "google/cloud/scheduler/cloud_scheduler_connection.h" -#include "google/cloud/scheduler/v1/mocks/mock_cloud_scheduler_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in scheduler_v1_mocks instead of the aliases -/// defined in this namespace. -namespace scheduler_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use scheduler_v1_mocks::MockCloudSchedulerConnection directly. -using ::google::cloud::scheduler_v1_mocks::MockCloudSchedulerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace scheduler_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_MOCKS_MOCK_CLOUD_SCHEDULER_CONNECTION_H diff --git a/google/cloud/scheduler/quickstart/.bazelrc b/google/cloud/scheduler/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/scheduler/quickstart/.bazelrc +++ b/google/cloud/scheduler/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/scheduler/quickstart/CMakeLists.txt index 7a5aad231def1..d81e192252b7d 100644 --- a/google/cloud/scheduler/quickstart/CMakeLists.txt +++ b/google/cloud/scheduler/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Scheduler API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-scheduler-quickstart CXX) find_package(google_cloud_cpp_scheduler REQUIRED) diff --git a/google/cloud/scheduler/quickstart/WORKSPACE.bazel b/google/cloud/scheduler/quickstart/WORKSPACE.bazel index 00acbb0206e9f..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 = "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/scheduler/v1/cloud_scheduler_connection.h b/google/cloud/scheduler/v1/cloud_scheduler_connection.h index 91550e83073be..2bd216ae4a78d 100644 --- a/google/cloud/scheduler/v1/cloud_scheduler_connection.h +++ b/google/cloud/scheduler/v1/cloud_scheduler_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_V1_CLOUD_SCHEDULER_CONNECTION_H #include "google/cloud/scheduler/v1/cloud_scheduler_connection_idempotency_policy.h" +#include "google/cloud/scheduler/v1/cloudscheduler.pb.h" #include "google/cloud/scheduler/v1/internal/cloud_scheduler_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/scheduler/v1/cloud_scheduler_connection_idempotency_policy.h b/google/cloud/scheduler/v1/cloud_scheduler_connection_idempotency_policy.h index 22e095e371197..edfdd4a997e66 100644 --- a/google/cloud/scheduler/v1/cloud_scheduler_connection_idempotency_policy.h +++ b/google/cloud/scheduler/v1/cloud_scheduler_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_V1_CLOUD_SCHEDULER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_V1_CLOUD_SCHEDULER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/scheduler/v1/cloudscheduler.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_auth_decorator.cc b/google/cloud/scheduler/v1/internal/cloud_scheduler_auth_decorator.cc index cf53941711794..4d7d7c0c73807 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_auth_decorator.cc +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/scheduler/v1/cloudscheduler.proto #include "google/cloud/scheduler/v1/internal/cloud_scheduler_auth_decorator.h" -#include +#include "google/cloud/scheduler/v1/cloudscheduler.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace scheduler_v1_internal { @@ -117,3 +120,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace scheduler_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_auth_decorator.h b/google/cloud/scheduler/v1/internal/cloud_scheduler_auth_decorator.h index 944de210af00d..7606f6bc033c1 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_auth_decorator.h +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace scheduler_v1_internal { @@ -88,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_V1_INTERNAL_CLOUD_SCHEDULER_AUTH_DECORATOR_H diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_logging_decorator.cc b/google/cloud/scheduler/v1/internal/cloud_scheduler_logging_decorator.cc index ce049626513ad..f5434cb8849fb 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_logging_decorator.cc +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/scheduler/v1/cloudscheduler.proto #include "google/cloud/scheduler/v1/internal/cloud_scheduler_logging_decorator.h" +#include "google/cloud/scheduler/v1/cloudscheduler.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace scheduler_v1_internal { @@ -151,3 +154,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace scheduler_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_logging_decorator.h b/google/cloud/scheduler/v1/internal/cloud_scheduler_logging_decorator.h index bcbc9e1bc4e34..02fb78ad6063d 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_logging_decorator.h +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace scheduler_v1_internal { @@ -88,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_V1_INTERNAL_CLOUD_SCHEDULER_LOGGING_DECORATOR_H diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_metadata_decorator.cc b/google/cloud/scheduler/v1/internal/cloud_scheduler_metadata_decorator.cc index 75807d95ec4d0..d622982a3a8dd 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_metadata_decorator.cc +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/scheduler/v1/cloudscheduler.proto #include "google/cloud/scheduler/v1/internal/cloud_scheduler_metadata_decorator.h" +#include "google/cloud/scheduler/v1/cloudscheduler.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 scheduler_v1_internal { @@ -144,3 +148,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace scheduler_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_metadata_decorator.h b/google/cloud/scheduler/v1/internal/cloud_scheduler_metadata_decorator.h index 69c998a76cc6e..2f9746a240c9b 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_metadata_decorator.h +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace scheduler_v1_internal { @@ -93,4 +96,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_V1_INTERNAL_CLOUD_SCHEDULER_METADATA_DECORATOR_H diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_option_defaults.cc b/google/cloud/scheduler/v1/internal/cloud_scheduler_option_defaults.cc index c7c8f94796299..7000c87794ede 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_option_defaults.cc +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_option_defaults.cc @@ -42,7 +42,7 @@ Options CloudSchedulerDefaultOptions(Options options) { if (!options.has()) { options.set( scheduler_v1::CloudSchedulerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_stub.cc b/google/cloud/scheduler/v1/internal/cloud_scheduler_stub.cc index 3f92cfe48b930..34bff03df8af6 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_stub.cc +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/scheduler/v1/cloudscheduler.proto #include "google/cloud/scheduler/v1/internal/cloud_scheduler_stub.h" +#include "google/cloud/scheduler/v1/cloudscheduler.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace scheduler_v1_internal { @@ -150,3 +153,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace scheduler_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_stub.h b/google/cloud/scheduler/v1/internal/cloud_scheduler_stub.h index 476a9c66244e9..326f694505d82 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_stub.h +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_V1_INTERNAL_CLOUD_SCHEDULER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_V1_INTERNAL_CLOUD_SCHEDULER_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/scheduler/v1/cloudscheduler.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace scheduler_v1_internal { @@ -141,4 +144,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_V1_INTERNAL_CLOUD_SCHEDULER_STUB_H diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_stub_factory.cc b/google/cloud/scheduler/v1/internal/cloud_scheduler_stub_factory.cc index b5439a4121c8c..b629322fa1c5c 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_stub_factory.cc +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_stub_factory.cc @@ -17,6 +17,8 @@ // source: google/cloud/scheduler/v1/cloudscheduler.proto #include "google/cloud/scheduler/v1/internal/cloud_scheduler_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/scheduler/v1/cloudscheduler.grpc.pb.h" #include "google/cloud/scheduler/v1/internal/cloud_scheduler_auth_decorator.h" #include "google/cloud/scheduler/v1/internal/cloud_scheduler_logging_decorator.h" #include "google/cloud/scheduler/v1/internal/cloud_scheduler_metadata_decorator.h" @@ -28,11 +30,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace scheduler_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace scheduler_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_stub_factory.h b/google/cloud/scheduler/v1/internal/cloud_scheduler_stub_factory.h index 66840a7b0f879..40a6e74b13e51 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_stub_factory.h +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace scheduler_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_V1_INTERNAL_CLOUD_SCHEDULER_STUB_FACTORY_H diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_connection.cc b/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_connection.cc index 4b27e7b1c7148..79bc0eb6bce18 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_connection.cc +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace scheduler_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudSchedulerTracingConnection::CloudSchedulerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -126,16 +124,12 @@ CloudSchedulerTracingConnection::GetLocation( return internal::EndSpan(*span, child_->GetLocation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudSchedulerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_connection.h b/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_connection.h index d59c57c27f28f..fe19d77cafec6 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_connection.h +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace scheduler_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudSchedulerTracingConnection : public scheduler_v1::CloudSchedulerConnection { public: @@ -74,8 +72,6 @@ class CloudSchedulerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_stub.cc b/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_stub.cc index 4846d56ed0af9..216ada909f883 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_stub.cc +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace scheduler_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudSchedulerTracingStub::CloudSchedulerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -148,18 +149,14 @@ CloudSchedulerTracingStub::GetLocation( child_->GetLocation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudSchedulerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace scheduler_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_stub.h b/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_stub.h index 2bf6cc785e00a..496b9f74e338e 100644 --- a/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_stub.h +++ b/google/cloud/scheduler/v1/internal/cloud_scheduler_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace scheduler_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudSchedulerTracingStub : public CloudSchedulerStub { public: ~CloudSchedulerTracingStub() override = default; @@ -84,8 +85,6 @@ class CloudSchedulerTracingStub : public CloudSchedulerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -100,4 +99,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SCHEDULER_V1_INTERNAL_CLOUD_SCHEDULER_TRACING_STUB_H diff --git a/google/cloud/secretmanager/BUILD.bazel b/google/cloud/secretmanager/BUILD.bazel index e54f4680e3542..5026b4341582a 100644 --- a/google/cloud/secretmanager/BUILD.bazel +++ b/google/cloud/secretmanager/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/secretmanager/v1:secretmanager_cc_grpc", + "@googleapis//google/cloud/secretmanager/v1:secretmanager_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/secretmanager/CMakeLists.txt b/google/cloud/secretmanager/CMakeLists.txt index 0ba0333c787c9..bad61df6b0779 100644 --- a/google/cloud/secretmanager/CMakeLists.txt +++ b/google/cloud/secretmanager/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(secretmanager "Secret Manager API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(secretmanager_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/secretmanager/mocks/mock_secret_manager_connection.h b/google/cloud/secretmanager/mocks/mock_secret_manager_connection.h deleted file mode 100644 index ea1fb8e45d164..0000000000000 --- a/google/cloud/secretmanager/mocks/mock_secret_manager_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/secretmanager/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_MOCKS_MOCK_SECRET_MANAGER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_MOCKS_MOCK_SECRET_MANAGER_CONNECTION_H - -#include "google/cloud/secretmanager/secret_manager_connection.h" -#include "google/cloud/secretmanager/v1/mocks/mock_secret_manager_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in secretmanager_v1_mocks instead of the aliases -/// defined in this namespace. -namespace secretmanager_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use secretmanager_v1_mocks::MockSecretManagerServiceConnection -/// directly. -using ::google::cloud::secretmanager_v1_mocks:: - MockSecretManagerServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace secretmanager_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_MOCKS_MOCK_SECRET_MANAGER_CONNECTION_H diff --git a/google/cloud/secretmanager/quickstart/.bazelrc b/google/cloud/secretmanager/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/secretmanager/quickstart/.bazelrc +++ b/google/cloud/secretmanager/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/secretmanager/quickstart/CMakeLists.txt index 11d929d1eab53..9b8e9c916561b 100644 --- a/google/cloud/secretmanager/quickstart/CMakeLists.txt +++ b/google/cloud/secretmanager/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Secret Manager API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-secretmanager-quickstart CXX) find_package(google_cloud_cpp_secretmanager REQUIRED) diff --git a/google/cloud/secretmanager/quickstart/WORKSPACE.bazel b/google/cloud/secretmanager/quickstart/WORKSPACE.bazel index 7cc4643413d56..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 = "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/secretmanager/secret_manager_client.h b/google/cloud/secretmanager/secret_manager_client.h deleted file mode 100644 index 1d9e79f474263..0000000000000 --- a/google/cloud/secretmanager/secret_manager_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/secretmanager/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_SECRET_MANAGER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_SECRET_MANAGER_CLIENT_H - -#include "google/cloud/secretmanager/secret_manager_connection.h" -#include "google/cloud/secretmanager/v1/secret_manager_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in secretmanager_v1 instead of the aliases defined in -/// this namespace. -namespace secretmanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use secretmanager_v1::SecretManagerServiceClient directly. -using ::google::cloud::secretmanager_v1::SecretManagerServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace secretmanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_SECRET_MANAGER_CLIENT_H diff --git a/google/cloud/secretmanager/secret_manager_connection.h b/google/cloud/secretmanager/secret_manager_connection.h deleted file mode 100644 index d52e9c613572f..0000000000000 --- a/google/cloud/secretmanager/secret_manager_connection.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/secretmanager/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_SECRET_MANAGER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_SECRET_MANAGER_CONNECTION_H - -#include "google/cloud/secretmanager/secret_manager_connection_idempotency_policy.h" -#include "google/cloud/secretmanager/v1/secret_manager_connection.h" - -namespace google { -namespace cloud { -namespace secretmanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use secretmanager_v1::MakeSecretManagerServiceConnection -/// directly. -using ::google::cloud::secretmanager_v1::MakeSecretManagerServiceConnection; - -/// @deprecated Use secretmanager_v1::SecretManagerServiceConnection directly. -using ::google::cloud::secretmanager_v1::SecretManagerServiceConnection; - -/// @deprecated Use -/// secretmanager_v1::SecretManagerServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::secretmanager_v1:: - SecretManagerServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use secretmanager_v1::SecretManagerServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::secretmanager_v1:: - SecretManagerServiceLimitedTimeRetryPolicy; - -/// @deprecated Use secretmanager_v1::SecretManagerServiceRetryPolicy directly. -using ::google::cloud::secretmanager_v1::SecretManagerServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace secretmanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_SECRET_MANAGER_CONNECTION_H diff --git a/google/cloud/secretmanager/secret_manager_connection_idempotency_policy.h b/google/cloud/secretmanager/secret_manager_connection_idempotency_policy.h deleted file mode 100644 index 35a3e6fdb0ec9..0000000000000 --- a/google/cloud/secretmanager/secret_manager_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/secretmanager/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_SECRET_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_SECRET_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/secretmanager/v1/secret_manager_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace secretmanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// secretmanager_v1::MakeDefaultSecretManagerServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::secretmanager_v1:: - MakeDefaultSecretManagerServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// secretmanager_v1::SecretManagerServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::secretmanager_v1:: - SecretManagerServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace secretmanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_SECRET_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/secretmanager/secret_manager_options.h b/google/cloud/secretmanager/secret_manager_options.h deleted file mode 100644 index c92b9a8384ce4..0000000000000 --- a/google/cloud/secretmanager/secret_manager_options.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/secretmanager/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_SECRET_MANAGER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_SECRET_MANAGER_OPTIONS_H - -#include "google/cloud/secretmanager/secret_manager_connection.h" -#include "google/cloud/secretmanager/secret_manager_connection_idempotency_policy.h" -#include "google/cloud/secretmanager/v1/secret_manager_options.h" - -namespace google { -namespace cloud { -namespace secretmanager { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use secretmanager_v1::SecretManagerServiceBackoffPolicyOption -/// directly. -using ::google::cloud::secretmanager_v1:: - SecretManagerServiceBackoffPolicyOption; - -/// @deprecated Use -/// secretmanager_v1::SecretManagerServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::secretmanager_v1:: - SecretManagerServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use secretmanager_v1::SecretManagerServicePolicyOptionList -/// directly. -using ::google::cloud::secretmanager_v1::SecretManagerServicePolicyOptionList; - -/// @deprecated Use secretmanager_v1::SecretManagerServiceRetryPolicyOption -/// directly. -using ::google::cloud::secretmanager_v1::SecretManagerServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace secretmanager -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_SECRET_MANAGER_OPTIONS_H diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_auth_decorator.cc b/google/cloud/secretmanager/v1/internal/secret_manager_auth_decorator.cc index 0a108b16dc6d0..a8d976bd70792 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_auth_decorator.cc +++ b/google/cloud/secretmanager/v1/internal/secret_manager_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/secretmanager/v1/service.proto #include "google/cloud/secretmanager/v1/internal/secret_manager_auth_decorator.h" -#include +#include "google/cloud/secretmanager/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace secretmanager_v1_internal { @@ -190,3 +193,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace secretmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_auth_decorator.h b/google/cloud/secretmanager/v1/internal/secret_manager_auth_decorator.h index fd840b087848c..d1f93cb27111f 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_auth_decorator.h +++ b/google/cloud/secretmanager/v1/internal/secret_manager_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace secretmanager_v1_internal { @@ -132,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_V1_INTERNAL_SECRET_MANAGER_AUTH_DECORATOR_H diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_logging_decorator.cc b/google/cloud/secretmanager/v1/internal/secret_manager_logging_decorator.cc index 937554e35ab1e..ac94fb80100a4 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_logging_decorator.cc +++ b/google/cloud/secretmanager/v1/internal/secret_manager_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/secretmanager/v1/service.proto #include "google/cloud/secretmanager/v1/internal/secret_manager_logging_decorator.h" +#include "google/cloud/secretmanager/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace secretmanager_v1_internal { @@ -259,3 +262,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace secretmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_logging_decorator.h b/google/cloud/secretmanager/v1/internal/secret_manager_logging_decorator.h index 040de9f3dca62..d9f79c18b3c5a 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_logging_decorator.h +++ b/google/cloud/secretmanager/v1/internal/secret_manager_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace secretmanager_v1_internal { @@ -132,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_V1_INTERNAL_SECRET_MANAGER_LOGGING_DECORATOR_H diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_metadata_decorator.cc b/google/cloud/secretmanager/v1/internal/secret_manager_metadata_decorator.cc index b10049334d21e..dcca104ace345 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_metadata_decorator.cc +++ b/google/cloud/secretmanager/v1/internal/secret_manager_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/secretmanager/v1/service.proto #include "google/cloud/secretmanager/v1/internal/secret_manager_metadata_decorator.h" +#include "google/cloud/secretmanager/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 secretmanager_v1_internal { @@ -220,3 +224,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace secretmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_metadata_decorator.h b/google/cloud/secretmanager/v1/internal/secret_manager_metadata_decorator.h index b8588c2f3f765..9357d19f15e1c 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_metadata_decorator.h +++ b/google/cloud/secretmanager/v1/internal/secret_manager_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace secretmanager_v1_internal { @@ -138,4 +141,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_V1_INTERNAL_SECRET_MANAGER_METADATA_DECORATOR_H diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_option_defaults.cc b/google/cloud/secretmanager/v1/internal/secret_manager_option_defaults.cc index b729a01d11815..e6a9ddfc6505e 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_option_defaults.cc +++ b/google/cloud/secretmanager/v1/internal/secret_manager_option_defaults.cc @@ -42,7 +42,7 @@ Options SecretManagerServiceDefaultOptions(Options options) { if (!options.has()) { options.set( secretmanager_v1::SecretManagerServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_stub.cc b/google/cloud/secretmanager/v1/internal/secret_manager_stub.cc index 19c110253915e..181734ce319d7 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_stub.cc +++ b/google/cloud/secretmanager/v1/internal/secret_manager_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/secretmanager/v1/service.proto #include "google/cloud/secretmanager/v1/internal/secret_manager_stub.h" +#include "google/cloud/secretmanager/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace secretmanager_v1_internal { @@ -240,3 +243,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace secretmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_stub.h b/google/cloud/secretmanager/v1/internal/secret_manager_stub.h index d910ac5d5f498..79b9a8b8d5b31 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_stub.h +++ b/google/cloud/secretmanager/v1/internal/secret_manager_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_V1_INTERNAL_SECRET_MANAGER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_V1_INTERNAL_SECRET_MANAGER_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/secretmanager/v1/service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace secretmanager_v1_internal { @@ -231,4 +234,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_V1_INTERNAL_SECRET_MANAGER_STUB_H diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_stub_factory.cc b/google/cloud/secretmanager/v1/internal/secret_manager_stub_factory.cc index d4461b4ed80e5..9016b765f62f6 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_stub_factory.cc +++ b/google/cloud/secretmanager/v1/internal/secret_manager_stub_factory.cc @@ -17,22 +17,25 @@ // source: google/cloud/secretmanager/v1/service.proto #include "google/cloud/secretmanager/v1/internal/secret_manager_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/secretmanager/v1/internal/secret_manager_auth_decorator.h" #include "google/cloud/secretmanager/v1/internal/secret_manager_logging_decorator.h" #include "google/cloud/secretmanager/v1/internal/secret_manager_metadata_decorator.h" #include "google/cloud/secretmanager/v1/internal/secret_manager_stub.h" #include "google/cloud/secretmanager/v1/internal/secret_manager_tracing_stub.h" +#include "google/cloud/secretmanager/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 -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace secretmanager_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace secretmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_stub_factory.h b/google/cloud/secretmanager/v1/internal/secret_manager_stub_factory.h index eb82a156f1ac3..fc48ddf7f0017 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_stub_factory.h +++ b/google/cloud/secretmanager/v1/internal/secret_manager_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace secretmanager_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_V1_INTERNAL_SECRET_MANAGER_STUB_FACTORY_H diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_tracing_connection.cc b/google/cloud/secretmanager/v1/internal/secret_manager_tracing_connection.cc index 86775307618e2..1aac92d620960 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_tracing_connection.cc +++ b/google/cloud/secretmanager/v1/internal/secret_manager_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace secretmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SecretManagerServiceTracingConnection::SecretManagerServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -196,17 +194,13 @@ SecretManagerServiceTracingConnection::GetLocation( return internal::EndSpan(*span, child_->GetLocation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSecretManagerServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_tracing_connection.h b/google/cloud/secretmanager/v1/internal/secret_manager_tracing_connection.h index 038bafd99e049..1d69be01eda88 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_tracing_connection.h +++ b/google/cloud/secretmanager/v1/internal/secret_manager_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace secretmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SecretManagerServiceTracingConnection : public secretmanager_v1::SecretManagerServiceConnection { public: @@ -109,8 +107,6 @@ class SecretManagerServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_tracing_stub.cc b/google/cloud/secretmanager/v1/internal/secret_manager_tracing_stub.cc index 92888a8899b78..382b4f92df182 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_tracing_stub.cc +++ b/google/cloud/secretmanager/v1/internal/secret_manager_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace secretmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SecretManagerServiceTracingStub::SecretManagerServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -244,18 +245,14 @@ SecretManagerServiceTracingStub::GetLocation( child_->GetLocation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSecretManagerServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace secretmanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/secretmanager/v1/internal/secret_manager_tracing_stub.h b/google/cloud/secretmanager/v1/internal/secret_manager_tracing_stub.h index 73a6793ff8cde..78fa4d42f5571 100644 --- a/google/cloud/secretmanager/v1/internal/secret_manager_tracing_stub.h +++ b/google/cloud/secretmanager/v1/internal/secret_manager_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace secretmanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SecretManagerServiceTracingStub : public SecretManagerServiceStub { public: ~SecretManagerServiceTracingStub() override = default; @@ -129,8 +130,6 @@ class SecretManagerServiceTracingStub : public SecretManagerServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -145,4 +144,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_V1_INTERNAL_SECRET_MANAGER_TRACING_STUB_H diff --git a/google/cloud/secretmanager/v1/secret_manager_connection.h b/google/cloud/secretmanager/v1/secret_manager_connection.h index 6fb96415a12ef..10a6745e73af5 100644 --- a/google/cloud/secretmanager/v1/secret_manager_connection.h +++ b/google/cloud/secretmanager/v1/secret_manager_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/secretmanager/v1/internal/secret_manager_retry_traits.h" #include "google/cloud/secretmanager/v1/secret_manager_connection_idempotency_policy.h" +#include "google/cloud/secretmanager/v1/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 #include namespace google { diff --git a/google/cloud/secretmanager/v1/secret_manager_connection_idempotency_policy.h b/google/cloud/secretmanager/v1/secret_manager_connection_idempotency_policy.h index 1a55e8e9c2ef4..482a07b7742e6 100644 --- a/google/cloud/secretmanager/v1/secret_manager_connection_idempotency_policy.h +++ b/google/cloud/secretmanager/v1/secret_manager_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_V1_SECRET_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECRETMANAGER_V1_SECRET_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/secretmanager/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/securesourcemanager/BUILD.bazel b/google/cloud/securesourcemanager/BUILD.bazel index 186fabf4020bb..f9fe82b0d8601 100644 --- a/google/cloud/securesourcemanager/BUILD.bazel +++ b/google/cloud/securesourcemanager/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/securesourcemanager/v1:securesourcemanager_cc_grpc", + "@googleapis//google/cloud/securesourcemanager/v1:securesourcemanager_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/securesourcemanager/quickstart/.bazelrc b/google/cloud/securesourcemanager/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/securesourcemanager/quickstart/.bazelrc +++ b/google/cloud/securesourcemanager/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/securesourcemanager/quickstart/CMakeLists.txt index c733718193719..b103f841aeb90 100644 --- a/google/cloud/securesourcemanager/quickstart/CMakeLists.txt +++ b/google/cloud/securesourcemanager/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Secure Source Manager API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-securesourcemanager-quickstart CXX) find_package(google_cloud_cpp_securesourcemanager REQUIRED) diff --git a/google/cloud/securesourcemanager/quickstart/WORKSPACE.bazel b/google/cloud/securesourcemanager/quickstart/WORKSPACE.bazel index 33bced4c43ee3..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 = "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/securesourcemanager/v1/internal/secure_source_manager_auth_decorator.cc b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_auth_decorator.cc index 0675c198ce193..15d4e4be2d0c8 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_auth_decorator.cc +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/securesourcemanager/v1/secure_source_manager.proto #include "google/cloud/securesourcemanager/v1/internal/secure_source_manager_auth_decorator.h" -#include +#include "google/cloud/securesourcemanager/v1/secure_source_manager.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securesourcemanager_v1_internal { @@ -1263,3 +1266,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securesourcemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_auth_decorator.h b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_auth_decorator.h index 7d83bf6c137cb..039303e3afdd5 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_auth_decorator.h +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 securesourcemanager_v1_internal { @@ -581,4 +584,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURESOURCEMANAGER_V1_INTERNAL_SECURE_SOURCE_MANAGER_AUTH_DECORATOR_H diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_connection_impl.h b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_connection_impl.h index 889c464395405..237119b748711 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_connection_impl.h +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_logging_decorator.cc b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_logging_decorator.cc index 4f84a0525f70e..7c609c09bce8c 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_logging_decorator.cc +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/securesourcemanager/v1/secure_source_manager.proto #include "google/cloud/securesourcemanager/v1/internal/secure_source_manager_logging_decorator.h" +#include "google/cloud/securesourcemanager/v1/secure_source_manager.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securesourcemanager_v1_internal { @@ -1500,3 +1503,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securesourcemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_logging_decorator.h b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_logging_decorator.h index 85df78a00f20f..d6d269ef5a5e9 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_logging_decorator.h +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 securesourcemanager_v1_internal { @@ -581,4 +584,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURESOURCEMANAGER_V1_INTERNAL_SECURE_SOURCE_MANAGER_LOGGING_DECORATOR_H diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_metadata_decorator.cc b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_metadata_decorator.cc index b6afb1fe39022..1278aec502cdb 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_metadata_decorator.cc +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/securesourcemanager/v1/secure_source_manager.proto #include "google/cloud/securesourcemanager/v1/internal/secure_source_manager_metadata_decorator.h" +#include "google/cloud/securesourcemanager/v1/secure_source_manager.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 securesourcemanager_v1_internal { @@ -1070,3 +1074,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securesourcemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_metadata_decorator.h b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_metadata_decorator.h index fed56c12b3a39..febf97e0a5228 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_metadata_decorator.h +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 securesourcemanager_v1_internal { @@ -587,4 +590,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURESOURCEMANAGER_V1_INTERNAL_SECURE_SOURCE_MANAGER_METADATA_DECORATOR_H diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_option_defaults.cc b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_option_defaults.cc index d54447e1a7cb2..fd279185de573 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_option_defaults.cc +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_option_defaults.cc @@ -43,7 +43,7 @@ Options SecureSourceManagerDefaultOptions(Options options) { securesourcemanager_v1::SecureSourceManagerRetryPolicyOption>()) { options.set( securesourcemanager_v1::SecureSourceManagerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub.cc b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub.cc index dfccc9a7aabd4..27a8debfebd81 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub.cc +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/securesourcemanager/v1/secure_source_manager.proto #include "google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub.h" +#include "google/cloud/securesourcemanager/v1/secure_source_manager.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securesourcemanager_v1_internal { @@ -1456,3 +1459,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securesourcemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub.h b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub.h index 98b7f139e030c..5607144db7f9c 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub.h +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURESOURCEMANAGER_V1_INTERNAL_SECURE_SOURCE_MANAGER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURESOURCEMANAGER_V1_INTERNAL_SECURE_SOURCE_MANAGER_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/securesourcemanager/v1/secure_source_manager.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 -#include -#include -#include +#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 securesourcemanager_v1_internal { @@ -1161,4 +1164,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURESOURCEMANAGER_V1_INTERNAL_SECURE_SOURCE_MANAGER_STUB_H diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub_factory.cc b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub_factory.cc index 124bd48abe5af..d3c610ff6e2c1 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub_factory.cc +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/securesourcemanager/v1/secure_source_manager.proto #include "google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/securesourcemanager/v1/internal/secure_source_manager_auth_decorator.h" #include "google/cloud/securesourcemanager/v1/internal/secure_source_manager_logging_decorator.h" #include "google/cloud/securesourcemanager/v1/internal/secure_source_manager_metadata_decorator.h" #include "google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub.h" #include "google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_stub.h" +#include "google/cloud/securesourcemanager/v1/secure_source_manager.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 -#include -#include -#include +#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 securesourcemanager_v1_internal { @@ -79,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securesourcemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub_factory.h b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub_factory.h index f9a2eef736969..8849124c816c8 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub_factory.h +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securesourcemanager_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURESOURCEMANAGER_V1_INTERNAL_SECURE_SOURCE_MANAGER_STUB_FACTORY_H diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_connection.cc b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_connection.cc index b2a94c6ee157a..b2ccc20a52533 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_connection.cc +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace securesourcemanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SecureSourceManagerTracingConnection::SecureSourceManagerTracingConnection( std::shared_ptr child) @@ -1353,18 +1351,14 @@ Status SecureSourceManagerTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSecureSourceManagerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_connection.h b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_connection.h index feddef996ec36..7882479a18316 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_connection.h +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace securesourcemanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SecureSourceManagerTracingConnection : public securesourcemanager_v1::SecureSourceManagerConnection { public: @@ -555,8 +553,6 @@ class SecureSourceManagerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_stub.cc b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_stub.cc index 26ade867630af..20f9b575291ab 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_stub.cc +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securesourcemanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SecureSourceManagerTracingStub::SecureSourceManagerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -1364,18 +1365,14 @@ future SecureSourceManagerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSecureSourceManagerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securesourcemanager_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_stub.h b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_stub.h index 12621e8e026c5..aa9b3bc218bb1 100644 --- a/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_stub.h +++ b/google/cloud/securesourcemanager/v1/internal/secure_source_manager_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securesourcemanager_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SecureSourceManagerTracingStub : public SecureSourceManagerStub { public: ~SecureSourceManagerTracingStub() override = default; @@ -577,8 +578,6 @@ class SecureSourceManagerTracingStub : public SecureSourceManagerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -593,4 +592,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURESOURCEMANAGER_V1_INTERNAL_SECURE_SOURCE_MANAGER_TRACING_STUB_H diff --git a/google/cloud/securesourcemanager/v1/secure_source_manager_client.h b/google/cloud/securesourcemanager/v1/secure_source_manager_client.h index b72ae781e6e82..42b72f1cc36c3 100644 --- a/google/cloud/securesourcemanager/v1/secure_source_manager_client.h +++ b/google/cloud/securesourcemanager/v1/secure_source_manager_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/securesourcemanager/v1/secure_source_manager_connection.h b/google/cloud/securesourcemanager/v1/secure_source_manager_connection.h index 0c0d461e30bfd..ca25a5b9cac65 100644 --- a/google/cloud/securesourcemanager/v1/secure_source_manager_connection.h +++ b/google/cloud/securesourcemanager/v1/secure_source_manager_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURESOURCEMANAGER_V1_SECURE_SOURCE_MANAGER_CONNECTION_H #include "google/cloud/securesourcemanager/v1/internal/secure_source_manager_retry_traits.h" +#include "google/cloud/securesourcemanager/v1/secure_source_manager.pb.h" #include "google/cloud/securesourcemanager/v1/secure_source_manager_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/securesourcemanager/v1/secure_source_manager_connection_idempotency_policy.h b/google/cloud/securesourcemanager/v1/secure_source_manager_connection_idempotency_policy.h index e16db34d16f47..a81dbc60a06af 100644 --- a/google/cloud/securesourcemanager/v1/secure_source_manager_connection_idempotency_policy.h +++ b/google/cloud/securesourcemanager/v1/secure_source_manager_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURESOURCEMANAGER_V1_SECURE_SOURCE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURESOURCEMANAGER_V1_SECURE_SOURCE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/securesourcemanager/v1/secure_source_manager.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/securitycenter/BUILD.bazel b/google/cloud/securitycenter/BUILD.bazel index 30a842d8bf8bc..71b679464b08e 100644 --- a/google/cloud/securitycenter/BUILD.bazel +++ b/google/cloud/securitycenter/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/securitycenter/v1:securitycenter_cc_grpc", - "@com_google_googleapis//google/cloud/securitycenter/v2:securitycenter_cc_grpc", + "@googleapis//google/cloud/securitycenter/v1:securitycenter_cc_grpc", + "@googleapis//google/cloud/securitycenter/v2:securitycenter_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/securitycenter/CMakeLists.txt b/google/cloud/securitycenter/CMakeLists.txt index cd333a293591f..d9234b4a91d4a 100644 --- a/google/cloud/securitycenter/CMakeLists.txt +++ b/google/cloud/securitycenter/CMakeLists.txt @@ -25,7 +25,7 @@ endif () include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(securitycenter "Security Command Center API" - SERVICE_DIRS "__EMPTY__" "v1/" "v2/") + SERVICE_DIRS "v1/" "v2/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(securitycenter_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/securitycenter/mocks/mock_security_center_connection.h b/google/cloud/securitycenter/mocks/mock_security_center_connection.h deleted file mode 100644 index e112e09a05ee6..0000000000000 --- a/google/cloud/securitycenter/mocks/mock_security_center_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/securitycenter/v1/securitycenter_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_MOCKS_MOCK_SECURITY_CENTER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_MOCKS_MOCK_SECURITY_CENTER_CONNECTION_H - -#include "google/cloud/securitycenter/security_center_connection.h" -#include "google/cloud/securitycenter/v1/mocks/mock_security_center_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in securitycenter_v1_mocks instead of the aliases -/// defined in this namespace. -namespace securitycenter_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use securitycenter_v1_mocks::MockSecurityCenterConnection -/// directly. -using ::google::cloud::securitycenter_v1_mocks::MockSecurityCenterConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace securitycenter_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_MOCKS_MOCK_SECURITY_CENTER_CONNECTION_H diff --git a/google/cloud/securitycenter/quickstart/.bazelrc b/google/cloud/securitycenter/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/securitycenter/quickstart/.bazelrc +++ b/google/cloud/securitycenter/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/securitycenter/quickstart/CMakeLists.txt index 9af7a8b64a06d..4ac30d6d8d808 100644 --- a/google/cloud/securitycenter/quickstart/CMakeLists.txt +++ b/google/cloud/securitycenter/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Security Command Center API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-securitycenter-quickstart CXX) find_package(google_cloud_cpp_securitycenter REQUIRED) diff --git a/google/cloud/securitycenter/quickstart/WORKSPACE.bazel b/google/cloud/securitycenter/quickstart/WORKSPACE.bazel index 3c9fc4e2199ca..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 = "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/securitycenter/security_center_client.h b/google/cloud/securitycenter/security_center_client.h deleted file mode 100644 index bde60f1a5fb35..0000000000000 --- a/google/cloud/securitycenter/security_center_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/securitycenter/v1/securitycenter_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_SECURITY_CENTER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_SECURITY_CENTER_CLIENT_H - -#include "google/cloud/securitycenter/security_center_connection.h" -#include "google/cloud/securitycenter/v1/security_center_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in securitycenter_v1 instead of the aliases defined in -/// this namespace. -namespace securitycenter { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use securitycenter_v1::SecurityCenterClient directly. -using ::google::cloud::securitycenter_v1::SecurityCenterClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace securitycenter -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_SECURITY_CENTER_CLIENT_H diff --git a/google/cloud/securitycenter/security_center_connection.h b/google/cloud/securitycenter/security_center_connection.h deleted file mode 100644 index 2f486ce428039..0000000000000 --- a/google/cloud/securitycenter/security_center_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/securitycenter/v1/securitycenter_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_SECURITY_CENTER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_SECURITY_CENTER_CONNECTION_H - -#include "google/cloud/securitycenter/security_center_connection_idempotency_policy.h" -#include "google/cloud/securitycenter/v1/security_center_connection.h" - -namespace google { -namespace cloud { -namespace securitycenter { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use securitycenter_v1::MakeSecurityCenterConnection directly. -using ::google::cloud::securitycenter_v1::MakeSecurityCenterConnection; - -/// @deprecated Use securitycenter_v1::SecurityCenterConnection directly. -using ::google::cloud::securitycenter_v1::SecurityCenterConnection; - -/// @deprecated Use -/// securitycenter_v1::SecurityCenterLimitedErrorCountRetryPolicy directly. -using ::google::cloud::securitycenter_v1:: - SecurityCenterLimitedErrorCountRetryPolicy; - -/// @deprecated Use securitycenter_v1::SecurityCenterLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::securitycenter_v1::SecurityCenterLimitedTimeRetryPolicy; - -/// @deprecated Use securitycenter_v1::SecurityCenterRetryPolicy directly. -using ::google::cloud::securitycenter_v1::SecurityCenterRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace securitycenter -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_SECURITY_CENTER_CONNECTION_H diff --git a/google/cloud/securitycenter/security_center_connection_idempotency_policy.h b/google/cloud/securitycenter/security_center_connection_idempotency_policy.h deleted file mode 100644 index 9833b79f95ca0..0000000000000 --- a/google/cloud/securitycenter/security_center_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/securitycenter/v1/securitycenter_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_SECURITY_CENTER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_SECURITY_CENTER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/securitycenter/v1/security_center_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace securitycenter { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// securitycenter_v1::MakeDefaultSecurityCenterConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::securitycenter_v1:: - MakeDefaultSecurityCenterConnectionIdempotencyPolicy; - -/// @deprecated Use securitycenter_v1::SecurityCenterConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::securitycenter_v1:: - SecurityCenterConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace securitycenter -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_SECURITY_CENTER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/securitycenter/security_center_options.h b/google/cloud/securitycenter/security_center_options.h deleted file mode 100644 index ddaa3e59fcc3e..0000000000000 --- a/google/cloud/securitycenter/security_center_options.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/securitycenter/v1/securitycenter_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_SECURITY_CENTER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_SECURITY_CENTER_OPTIONS_H - -#include "google/cloud/securitycenter/security_center_connection.h" -#include "google/cloud/securitycenter/security_center_connection_idempotency_policy.h" -#include "google/cloud/securitycenter/v1/security_center_options.h" - -namespace google { -namespace cloud { -namespace securitycenter { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use securitycenter_v1::SecurityCenterPollingPolicyOption -/// directly. -using ::google::cloud::securitycenter_v1::SecurityCenterPollingPolicyOption; - -/// @deprecated Use securitycenter_v1::SecurityCenterBackoffPolicyOption -/// directly. -using ::google::cloud::securitycenter_v1::SecurityCenterBackoffPolicyOption; - -/// @deprecated Use -/// securitycenter_v1::SecurityCenterConnectionIdempotencyPolicyOption directly. -using ::google::cloud::securitycenter_v1:: - SecurityCenterConnectionIdempotencyPolicyOption; - -/// @deprecated Use securitycenter_v1::SecurityCenterPolicyOptionList directly. -using ::google::cloud::securitycenter_v1::SecurityCenterPolicyOptionList; - -/// @deprecated Use securitycenter_v1::SecurityCenterRetryPolicyOption directly. -using ::google::cloud::securitycenter_v1::SecurityCenterRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace securitycenter -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_SECURITY_CENTER_OPTIONS_H diff --git a/google/cloud/securitycenter/v1/internal/security_center_auth_decorator.cc b/google/cloud/securitycenter/v1/internal/security_center_auth_decorator.cc index c19357e2d6d7a..8ad7d130461a5 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_auth_decorator.cc +++ b/google/cloud/securitycenter/v1/internal/security_center_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/securitycenter/v1/securitycenter_service.proto #include "google/cloud/securitycenter/v1/internal/security_center_auth_decorator.h" -#include +#include "google/cloud/securitycenter/v1/securitycenter_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v1_internal { @@ -772,3 +775,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycenter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycenter/v1/internal/security_center_auth_decorator.h b/google/cloud/securitycenter/v1/internal/security_center_auth_decorator.h index 87e661281d567..6ef124300d395 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_auth_decorator.h +++ b/google/cloud/securitycenter/v1/internal/security_center_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/securitycenter/v1/internal/security_center_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 securitycenter_v1_internal { @@ -467,4 +470,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V1_INTERNAL_SECURITY_CENTER_AUTH_DECORATOR_H diff --git a/google/cloud/securitycenter/v1/internal/security_center_connection_impl.h b/google/cloud/securitycenter/v1/internal/security_center_connection_impl.h index e2a5bb014cdb3..58e9f478cbd86 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_connection_impl.h +++ b/google/cloud/securitycenter/v1/internal/security_center_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/securitycenter/v1/internal/security_center_logging_decorator.cc b/google/cloud/securitycenter/v1/internal/security_center_logging_decorator.cc index 416c5c2f6dfe0..15a365f4bee87 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_logging_decorator.cc +++ b/google/cloud/securitycenter/v1/internal/security_center_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/securitycenter/v1/securitycenter_service.proto #include "google/cloud/securitycenter/v1/internal/security_center_logging_decorator.h" +#include "google/cloud/securitycenter/v1/securitycenter_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v1_internal { @@ -1058,3 +1061,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycenter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycenter/v1/internal/security_center_logging_decorator.h b/google/cloud/securitycenter/v1/internal/security_center_logging_decorator.h index aef83ffc98951..cc3fe17397f83 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_logging_decorator.h +++ b/google/cloud/securitycenter/v1/internal/security_center_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/securitycenter/v1/internal/security_center_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 securitycenter_v1_internal { @@ -467,4 +470,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V1_INTERNAL_SECURITY_CENTER_LOGGING_DECORATOR_H diff --git a/google/cloud/securitycenter/v1/internal/security_center_metadata_decorator.cc b/google/cloud/securitycenter/v1/internal/security_center_metadata_decorator.cc index 67b130e2c3b81..57ca139f97d0a 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_metadata_decorator.cc +++ b/google/cloud/securitycenter/v1/internal/security_center_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/securitycenter/v1/securitycenter_service.proto #include "google/cloud/securitycenter/v1/internal/security_center_metadata_decorator.h" +#include "google/cloud/securitycenter/v1/securitycenter_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 securitycenter_v1_internal { @@ -796,3 +800,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycenter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycenter/v1/internal/security_center_metadata_decorator.h b/google/cloud/securitycenter/v1/internal/security_center_metadata_decorator.h index 5980fd8d9a8f8..628c895745c6f 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_metadata_decorator.h +++ b/google/cloud/securitycenter/v1/internal/security_center_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/securitycenter/v1/internal/security_center_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 securitycenter_v1_internal { @@ -472,4 +475,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V1_INTERNAL_SECURITY_CENTER_METADATA_DECORATOR_H diff --git a/google/cloud/securitycenter/v1/internal/security_center_option_defaults.cc b/google/cloud/securitycenter/v1/internal/security_center_option_defaults.cc index 3043b87b6b2e6..98d708ca07de2 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_option_defaults.cc +++ b/google/cloud/securitycenter/v1/internal/security_center_option_defaults.cc @@ -42,7 +42,7 @@ Options SecurityCenterDefaultOptions(Options options) { if (!options.has()) { options.set( securitycenter_v1::SecurityCenterLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/securitycenter/v1/internal/security_center_stub.cc b/google/cloud/securitycenter/v1/internal/security_center_stub.cc index 5d1b0d739b28f..30055e433876d 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_stub.cc +++ b/google/cloud/securitycenter/v1/internal/security_center_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/securitycenter/v1/securitycenter_service.proto #include "google/cloud/securitycenter/v1/internal/security_center_stub.h" +#include "google/cloud/securitycenter/v1/securitycenter_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v1_internal { @@ -1003,3 +1006,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycenter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycenter/v1/internal/security_center_stub.h b/google/cloud/securitycenter/v1/internal/security_center_stub.h index d79cd749ae0a7..c4dfa876aab2f 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_stub.h +++ b/google/cloud/securitycenter/v1/internal/security_center_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V1_INTERNAL_SECURITY_CENTER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V1_INTERNAL_SECURITY_CENTER_STUB_H +#include "google/cloud/securitycenter/v1/securitycenter_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v1_internal { @@ -904,4 +907,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V1_INTERNAL_SECURITY_CENTER_STUB_H diff --git a/google/cloud/securitycenter/v1/internal/security_center_stub_factory.cc b/google/cloud/securitycenter/v1/internal/security_center_stub_factory.cc index 063f11fa446be..8f1dfe199f68d 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_stub_factory.cc +++ b/google/cloud/securitycenter/v1/internal/security_center_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/securitycenter/v1/internal/security_center_metadata_decorator.h" #include "google/cloud/securitycenter/v1/internal/security_center_stub.h" #include "google/cloud/securitycenter/v1/internal/security_center_tracing_stub.h" +#include "google/cloud/securitycenter/v1/securitycenter_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycenter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycenter/v1/internal/security_center_stub_factory.h b/google/cloud/securitycenter/v1/internal/security_center_stub_factory.h index 5a0c02af4c131..16416b68d783e 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_stub_factory.h +++ b/google/cloud/securitycenter/v1/internal/security_center_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V1_INTERNAL_SECURITY_CENTER_STUB_FACTORY_H diff --git a/google/cloud/securitycenter/v1/internal/security_center_tracing_connection.cc b/google/cloud/securitycenter/v1/internal/security_center_tracing_connection.cc index 9cd3719a3d721..666a34be1104e 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_tracing_connection.cc +++ b/google/cloud/securitycenter/v1/internal/security_center_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace securitycenter_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SecurityCenterTracingConnection::SecurityCenterTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -816,16 +814,12 @@ Status SecurityCenterTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSecurityCenterTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/securitycenter/v1/internal/security_center_tracing_connection.h b/google/cloud/securitycenter/v1/internal/security_center_tracing_connection.h index 84d81f11604cb..24c6471fca1d0 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_tracing_connection.h +++ b/google/cloud/securitycenter/v1/internal/security_center_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace securitycenter_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SecurityCenterTracingConnection : public securitycenter_v1::SecurityCenterConnection { public: @@ -383,8 +381,6 @@ class SecurityCenterTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/securitycenter/v1/internal/security_center_tracing_stub.cc b/google/cloud/securitycenter/v1/internal/security_center_tracing_stub.cc index f7ec9e3bfe555..ae7087c433bdc 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_tracing_stub.cc +++ b/google/cloud/securitycenter/v1/internal/security_center_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SecurityCenterTracingStub::SecurityCenterTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -1001,18 +1002,14 @@ future SecurityCenterTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSecurityCenterTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycenter_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycenter/v1/internal/security_center_tracing_stub.h b/google/cloud/securitycenter/v1/internal/security_center_tracing_stub.h index e254e1ec7d0fa..fbb9307a95db2 100644 --- a/google/cloud/securitycenter/v1/internal/security_center_tracing_stub.h +++ b/google/cloud/securitycenter/v1/internal/security_center_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SecurityCenterTracingStub : public SecurityCenterStub { public: ~SecurityCenterTracingStub() override = default; @@ -462,8 +463,6 @@ class SecurityCenterTracingStub : public SecurityCenterStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -478,4 +477,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V1_INTERNAL_SECURITY_CENTER_TRACING_STUB_H diff --git a/google/cloud/securitycenter/v1/security_center_client.h b/google/cloud/securitycenter/v1/security_center_client.h index ac6335a048c5c..6440931b97db7 100644 --- a/google/cloud/securitycenter/v1/security_center_client.h +++ b/google/cloud/securitycenter/v1/security_center_client.h @@ -28,7 +28,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/v1/security_center_connection.h b/google/cloud/securitycenter/v1/security_center_connection.h index 9d9666a00692b..2e43481c88551 100644 --- a/google/cloud/securitycenter/v1/security_center_connection.h +++ b/google/cloud/securitycenter/v1/security_center_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/securitycenter/v1/internal/security_center_retry_traits.h" #include "google/cloud/securitycenter/v1/security_center_connection_idempotency_policy.h" +#include "google/cloud/securitycenter/v1/securitycenter_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/securitycenter/v1/security_center_connection_idempotency_policy.h b/google/cloud/securitycenter/v1/security_center_connection_idempotency_policy.h index f635efe79ee01..3c5fe8140252e 100644 --- a/google/cloud/securitycenter/v1/security_center_connection_idempotency_policy.h +++ b/google/cloud/securitycenter/v1/security_center_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V1_SECURITY_CENTER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V1_SECURITY_CENTER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/securitycenter/v1/securitycenter_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/securitycenter/v2/internal/security_center_auth_decorator.cc b/google/cloud/securitycenter/v2/internal/security_center_auth_decorator.cc index ce468cb2cc479..0007a3580ab85 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_auth_decorator.cc +++ b/google/cloud/securitycenter/v2/internal/security_center_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/securitycenter/v2/securitycenter_service.proto #include "google/cloud/securitycenter/v2/internal/security_center_auth_decorator.h" -#include +#include "google/cloud/securitycenter/v2/securitycenter_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v2_internal { @@ -497,3 +500,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycenter_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycenter/v2/internal/security_center_auth_decorator.h b/google/cloud/securitycenter/v2/internal/security_center_auth_decorator.h index 7167ed38f3a19..9b457b64ee166 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_auth_decorator.h +++ b/google/cloud/securitycenter/v2/internal/security_center_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/securitycenter/v2/internal/security_center_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 securitycenter_v2_internal { @@ -298,4 +301,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V2_INTERNAL_SECURITY_CENTER_AUTH_DECORATOR_H diff --git a/google/cloud/securitycenter/v2/internal/security_center_connection_impl.h b/google/cloud/securitycenter/v2/internal/security_center_connection_impl.h index 301df2b0759d9..197f81c965dd9 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_connection_impl.h +++ b/google/cloud/securitycenter/v2/internal/security_center_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/securitycenter/v2/internal/security_center_logging_decorator.cc b/google/cloud/securitycenter/v2/internal/security_center_logging_decorator.cc index d6c438fa5d6ee..8fcfeae666ff0 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_logging_decorator.cc +++ b/google/cloud/securitycenter/v2/internal/security_center_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/securitycenter/v2/securitycenter_service.proto #include "google/cloud/securitycenter/v2/internal/security_center_logging_decorator.h" +#include "google/cloud/securitycenter/v2/securitycenter_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v2_internal { @@ -677,3 +680,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycenter_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycenter/v2/internal/security_center_logging_decorator.h b/google/cloud/securitycenter/v2/internal/security_center_logging_decorator.h index 3d45e4b3e060f..c31f71e3186ed 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_logging_decorator.h +++ b/google/cloud/securitycenter/v2/internal/security_center_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/securitycenter/v2/internal/security_center_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 securitycenter_v2_internal { @@ -298,4 +301,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V2_INTERNAL_SECURITY_CENTER_LOGGING_DECORATOR_H diff --git a/google/cloud/securitycenter/v2/internal/security_center_metadata_decorator.cc b/google/cloud/securitycenter/v2/internal/security_center_metadata_decorator.cc index 0f67bbff60a22..19c95cf37e431 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_metadata_decorator.cc +++ b/google/cloud/securitycenter/v2/internal/security_center_metadata_decorator.cc @@ -17,19 +17,22 @@ // source: google/cloud/securitycenter/v2/securitycenter_service.proto #include "google/cloud/securitycenter/v2/internal/security_center_metadata_decorator.h" +#include "google/cloud/securitycenter/v2/securitycenter_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/routing_matcher.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#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 securitycenter_v2_internal { @@ -667,3 +670,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycenter_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycenter/v2/internal/security_center_metadata_decorator.h b/google/cloud/securitycenter/v2/internal/security_center_metadata_decorator.h index 00571e354992e..1c71cc6b73766 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_metadata_decorator.h +++ b/google/cloud/securitycenter/v2/internal/security_center_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/securitycenter/v2/internal/security_center_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 securitycenter_v2_internal { @@ -303,4 +306,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V2_INTERNAL_SECURITY_CENTER_METADATA_DECORATOR_H diff --git a/google/cloud/securitycenter/v2/internal/security_center_option_defaults.cc b/google/cloud/securitycenter/v2/internal/security_center_option_defaults.cc index 4551f81542420..7a62c2006126e 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_option_defaults.cc +++ b/google/cloud/securitycenter/v2/internal/security_center_option_defaults.cc @@ -42,7 +42,7 @@ Options SecurityCenterDefaultOptions(Options options) { if (!options.has()) { options.set( securitycenter_v2::SecurityCenterLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/securitycenter/v2/internal/security_center_stub.cc b/google/cloud/securitycenter/v2/internal/security_center_stub.cc index b0463f5dc952f..ad35cbdfe7cf0 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_stub.cc +++ b/google/cloud/securitycenter/v2/internal/security_center_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/securitycenter/v2/securitycenter_service.proto #include "google/cloud/securitycenter/v2/internal/security_center_stub.h" +#include "google/cloud/securitycenter/v2/securitycenter_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v2_internal { @@ -643,3 +646,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycenter_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycenter/v2/internal/security_center_stub.h b/google/cloud/securitycenter/v2/internal/security_center_stub.h index e9a141bf926ea..1422cd16c6c00 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_stub.h +++ b/google/cloud/securitycenter/v2/internal/security_center_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V2_INTERNAL_SECURITY_CENTER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V2_INTERNAL_SECURITY_CENTER_STUB_H +#include "google/cloud/securitycenter/v2/securitycenter_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v2_internal { @@ -569,4 +572,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V2_INTERNAL_SECURITY_CENTER_STUB_H diff --git a/google/cloud/securitycenter/v2/internal/security_center_stub_factory.cc b/google/cloud/securitycenter/v2/internal/security_center_stub_factory.cc index c14c0ad6a439d..23212ee417bf0 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_stub_factory.cc +++ b/google/cloud/securitycenter/v2/internal/security_center_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/securitycenter/v2/internal/security_center_metadata_decorator.h" #include "google/cloud/securitycenter/v2/internal/security_center_stub.h" #include "google/cloud/securitycenter/v2/internal/security_center_tracing_stub.h" +#include "google/cloud/securitycenter/v2/securitycenter_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v2_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycenter_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycenter/v2/internal/security_center_stub_factory.h b/google/cloud/securitycenter/v2/internal/security_center_stub_factory.h index d6937ee009429..fdafe25d8c59c 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_stub_factory.h +++ b/google/cloud/securitycenter/v2/internal/security_center_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V2_INTERNAL_SECURITY_CENTER_STUB_FACTORY_H diff --git a/google/cloud/securitycenter/v2/internal/security_center_tracing_connection.cc b/google/cloud/securitycenter/v2/internal/security_center_tracing_connection.cc index 70293c612b27d..36a56aef5ba10 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_tracing_connection.cc +++ b/google/cloud/securitycenter/v2/internal/security_center_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace securitycenter_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SecurityCenterTracingConnection::SecurityCenterTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -491,16 +489,12 @@ Status SecurityCenterTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSecurityCenterTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/securitycenter/v2/internal/security_center_tracing_connection.h b/google/cloud/securitycenter/v2/internal/security_center_tracing_connection.h index 85a35113c4d32..534a7c70144c7 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_tracing_connection.h +++ b/google/cloud/securitycenter/v2/internal/security_center_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace securitycenter_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SecurityCenterTracingConnection : public securitycenter_v2::SecurityCenterConnection { public: @@ -236,8 +234,6 @@ class SecurityCenterTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/securitycenter/v2/internal/security_center_tracing_stub.cc b/google/cloud/securitycenter/v2/internal/security_center_tracing_stub.cc index 61263b2ebedfd..a8eff00dadfa9 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_tracing_stub.cc +++ b/google/cloud/securitycenter/v2/internal/security_center_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SecurityCenterTracingStub::SecurityCenterTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -633,18 +634,14 @@ future SecurityCenterTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSecurityCenterTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycenter_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycenter/v2/internal/security_center_tracing_stub.h b/google/cloud/securitycenter/v2/internal/security_center_tracing_stub.h index 5ba5c2df21fde..1a92a3fcdb3b8 100644 --- a/google/cloud/securitycenter/v2/internal/security_center_tracing_stub.h +++ b/google/cloud/securitycenter/v2/internal/security_center_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycenter_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SecurityCenterTracingStub : public SecurityCenterStub { public: ~SecurityCenterTracingStub() override = default; @@ -293,8 +294,6 @@ class SecurityCenterTracingStub : public SecurityCenterStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -309,4 +308,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V2_INTERNAL_SECURITY_CENTER_TRACING_STUB_H diff --git a/google/cloud/securitycenter/v2/security_center_client.h b/google/cloud/securitycenter/v2/security_center_client.h index caf5b652abdf9..42084ed9268a7 100644 --- a/google/cloud/securitycenter/v2/security_center_client.h +++ b/google/cloud/securitycenter/v2/security_center_client.h @@ -28,7 +28,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/securitycenter/v2/security_center_connection.h b/google/cloud/securitycenter/v2/security_center_connection.h index 6974301db8d4b..4514020b3ff78 100644 --- a/google/cloud/securitycenter/v2/security_center_connection.h +++ b/google/cloud/securitycenter/v2/security_center_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/securitycenter/v2/internal/security_center_retry_traits.h" #include "google/cloud/securitycenter/v2/security_center_connection_idempotency_policy.h" +#include "google/cloud/securitycenter/v2/securitycenter_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/securitycenter/v2/security_center_connection_idempotency_policy.h b/google/cloud/securitycenter/v2/security_center_connection_idempotency_policy.h index 874334a29dfef..607c46fd8ab65 100644 --- a/google/cloud/securitycenter/v2/security_center_connection_idempotency_policy.h +++ b/google/cloud/securitycenter/v2/security_center_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V2_SECURITY_CENTER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTER_V2_SECURITY_CENTER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/securitycenter/v2/securitycenter_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/securitycentermanagement/BUILD.bazel b/google/cloud/securitycentermanagement/BUILD.bazel index f037e3967d9e5..b41b78be5efd1 100644 --- a/google/cloud/securitycentermanagement/BUILD.bazel +++ b/google/cloud/securitycentermanagement/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/securitycentermanagement/v1:securitycentermanagement_cc_grpc", + "@googleapis//google/cloud/securitycentermanagement/v1:securitycentermanagement_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/securitycentermanagement/quickstart/.bazelrc b/google/cloud/securitycentermanagement/quickstart/.bazelrc index 15d5c055db074..343e7f623d628 100644 --- a/google/cloud/securitycentermanagement/quickstart/.bazelrc +++ b/google/cloud/securitycentermanagement/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/securitycentermanagement/quickstart/CMakeLists.txt index 93190c893d5c1..b804894e2267c 100644 --- a/google/cloud/securitycentermanagement/quickstart/CMakeLists.txt +++ b/google/cloud/securitycentermanagement/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Security Center Management API C++ client # library from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-securitycentermanagement-quickstart CXX) find_package(google_cloud_cpp_securitycentermanagement REQUIRED) diff --git a/google/cloud/securitycentermanagement/quickstart/WORKSPACE.bazel b/google/cloud/securitycentermanagement/quickstart/WORKSPACE.bazel index a08791d0533bf..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 = "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/securitycentermanagement/v1/internal/security_center_management_auth_decorator.cc b/google/cloud/securitycentermanagement/v1/internal/security_center_management_auth_decorator.cc index 64756ee568c9a..3260e79b3e947 100644 --- a/google/cloud/securitycentermanagement/v1/internal/security_center_management_auth_decorator.cc +++ b/google/cloud/securitycentermanagement/v1/internal/security_center_management_auth_decorator.cc @@ -18,10 +18,13 @@ // google/cloud/securitycentermanagement/v1/security_center_management.proto #include "google/cloud/securitycentermanagement/v1/internal/security_center_management_auth_decorator.h" -#include +#include "google/cloud/securitycentermanagement/v1/security_center_management.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycentermanagement_v1_internal { @@ -299,3 +302,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycentermanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycentermanagement/v1/internal/security_center_management_auth_decorator.h b/google/cloud/securitycentermanagement/v1/internal/security_center_management_auth_decorator.h index 9326588f830d8..881cb403af135 100644 --- a/google/cloud/securitycentermanagement/v1/internal/security_center_management_auth_decorator.h +++ b/google/cloud/securitycentermanagement/v1/internal/security_center_management_auth_decorator.h @@ -27,6 +27,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycentermanagement_v1_internal { @@ -214,4 +217,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTERMANAGEMENT_V1_INTERNAL_SECURITY_CENTER_MANAGEMENT_AUTH_DECORATOR_H diff --git a/google/cloud/securitycentermanagement/v1/internal/security_center_management_logging_decorator.cc b/google/cloud/securitycentermanagement/v1/internal/security_center_management_logging_decorator.cc index 1aaf5ee8b9275..b4dff048a98ad 100644 --- a/google/cloud/securitycentermanagement/v1/internal/security_center_management_logging_decorator.cc +++ b/google/cloud/securitycentermanagement/v1/internal/security_center_management_logging_decorator.cc @@ -18,14 +18,17 @@ // google/cloud/securitycentermanagement/v1/security_center_management.proto #include "google/cloud/securitycentermanagement/v1/internal/security_center_management_logging_decorator.h" +#include "google/cloud/securitycentermanagement/v1/security_center_management.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycentermanagement_v1_internal { @@ -413,3 +416,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycentermanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycentermanagement/v1/internal/security_center_management_logging_decorator.h b/google/cloud/securitycentermanagement/v1/internal/security_center_management_logging_decorator.h index ddc86a639da66..4dc1c47217dc0 100644 --- a/google/cloud/securitycentermanagement/v1/internal/security_center_management_logging_decorator.h +++ b/google/cloud/securitycentermanagement/v1/internal/security_center_management_logging_decorator.h @@ -27,6 +27,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycentermanagement_v1_internal { @@ -214,4 +217,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTERMANAGEMENT_V1_INTERNAL_SECURITY_CENTER_MANAGEMENT_LOGGING_DECORATOR_H diff --git a/google/cloud/securitycentermanagement/v1/internal/security_center_management_metadata_decorator.cc b/google/cloud/securitycentermanagement/v1/internal/security_center_management_metadata_decorator.cc index 1b502638ebadf..f93a3eb0497ec 100644 --- a/google/cloud/securitycentermanagement/v1/internal/security_center_management_metadata_decorator.cc +++ b/google/cloud/securitycentermanagement/v1/internal/security_center_management_metadata_decorator.cc @@ -18,17 +18,21 @@ // google/cloud/securitycentermanagement/v1/security_center_management.proto #include "google/cloud/securitycentermanagement/v1/internal/security_center_management_metadata_decorator.h" +#include "google/cloud/securitycentermanagement/v1/security_center_management.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 securitycentermanagement_v1_internal { @@ -342,3 +346,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycentermanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycentermanagement/v1/internal/security_center_management_metadata_decorator.h b/google/cloud/securitycentermanagement/v1/internal/security_center_management_metadata_decorator.h index 984498c2d93f7..ce81d7eda60c6 100644 --- a/google/cloud/securitycentermanagement/v1/internal/security_center_management_metadata_decorator.h +++ b/google/cloud/securitycentermanagement/v1/internal/security_center_management_metadata_decorator.h @@ -27,6 +27,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycentermanagement_v1_internal { @@ -220,4 +223,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTERMANAGEMENT_V1_INTERNAL_SECURITY_CENTER_MANAGEMENT_METADATA_DECORATOR_H diff --git a/google/cloud/securitycentermanagement/v1/internal/security_center_management_option_defaults.cc b/google/cloud/securitycentermanagement/v1/internal/security_center_management_option_defaults.cc index b4a97ebfa3592..72c5a2549cb6f 100644 --- a/google/cloud/securitycentermanagement/v1/internal/security_center_management_option_defaults.cc +++ b/google/cloud/securitycentermanagement/v1/internal/security_center_management_option_defaults.cc @@ -47,7 +47,7 @@ Options SecurityCenterManagementDefaultOptions(Options options) { securitycentermanagement_v1::SecurityCenterManagementRetryPolicyOption>( securitycentermanagement_v1:: SecurityCenterManagementLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycentermanagement_v1_internal { @@ -400,3 +403,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycentermanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycentermanagement/v1/internal/security_center_management_stub.h b/google/cloud/securitycentermanagement/v1/internal/security_center_management_stub.h index 4056c591eb945..b9ce230be5444 100644 --- a/google/cloud/securitycentermanagement/v1/internal/security_center_management_stub.h +++ b/google/cloud/securitycentermanagement/v1/internal/security_center_management_stub.h @@ -20,14 +20,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTERMANAGEMENT_V1_INTERNAL_SECURITY_CENTER_MANAGEMENT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTERMANAGEMENT_V1_INTERNAL_SECURITY_CENTER_MANAGEMENT_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/securitycentermanagement/v1/security_center_management.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycentermanagement_v1_internal { @@ -389,4 +392,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTERMANAGEMENT_V1_INTERNAL_SECURITY_CENTER_MANAGEMENT_STUB_H diff --git a/google/cloud/securitycentermanagement/v1/internal/security_center_management_stub_factory.cc b/google/cloud/securitycentermanagement/v1/internal/security_center_management_stub_factory.cc index 4eb0865866361..420f18ca676c6 100644 --- a/google/cloud/securitycentermanagement/v1/internal/security_center_management_stub_factory.cc +++ b/google/cloud/securitycentermanagement/v1/internal/security_center_management_stub_factory.cc @@ -18,22 +18,25 @@ // google/cloud/securitycentermanagement/v1/security_center_management.proto #include "google/cloud/securitycentermanagement/v1/internal/security_center_management_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/securitycentermanagement/v1/internal/security_center_management_auth_decorator.h" #include "google/cloud/securitycentermanagement/v1/internal/security_center_management_logging_decorator.h" #include "google/cloud/securitycentermanagement/v1/internal/security_center_management_metadata_decorator.h" #include "google/cloud/securitycentermanagement/v1/internal/security_center_management_stub.h" #include "google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_stub.h" +#include "google/cloud/securitycentermanagement/v1/security_center_management.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 -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycentermanagement_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycentermanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycentermanagement/v1/internal/security_center_management_stub_factory.h b/google/cloud/securitycentermanagement/v1/internal/security_center_management_stub_factory.h index b300af54f0fd7..571c21d50e71d 100644 --- a/google/cloud/securitycentermanagement/v1/internal/security_center_management_stub_factory.h +++ b/google/cloud/securitycentermanagement/v1/internal/security_center_management_stub_factory.h @@ -26,6 +26,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycentermanagement_v1_internal { @@ -41,4 +44,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTERMANAGEMENT_V1_INTERNAL_SECURITY_CENTER_MANAGEMENT_STUB_FACTORY_H diff --git a/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_connection.cc b/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_connection.cc index 7f853dbbd7807..260c33d8eabfe 100644 --- a/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_connection.cc +++ b/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_connection.cc @@ -28,8 +28,6 @@ namespace cloud { namespace securitycentermanagement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SecurityCenterManagementTracingConnection:: SecurityCenterManagementTracingConnection( std::shared_ptr< @@ -363,19 +361,15 @@ SecurityCenterManagementTracingConnection::GetLocation( return internal::EndSpan(*span, child_->GetLocation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSecurityCenterManagementTracingConnection( std::shared_ptr< securitycentermanagement_v1::SecurityCenterManagementConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_connection.h b/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_connection.h index 4ad2407574b9a..810eea10e7e5e 100644 --- a/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_connection.h +++ b/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_connection.h @@ -29,8 +29,6 @@ namespace cloud { namespace securitycentermanagement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SecurityCenterManagementTracingConnection : public securitycentermanagement_v1::SecurityCenterManagementConnection { public: @@ -190,8 +188,6 @@ class SecurityCenterManagementTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_stub.cc b/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_stub.cc index c2ccbb580b421..c5e5d43bbdd69 100644 --- a/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_stub.cc +++ b/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycentermanagement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SecurityCenterManagementTracingStub::SecurityCenterManagementTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -409,19 +410,15 @@ SecurityCenterManagementTracingStub::GetLocation( child_->GetLocation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSecurityCenterManagementTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace securitycentermanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_stub.h b/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_stub.h index 80d28004c4b08..a0179ce6697ff 100644 --- a/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_stub.h +++ b/google/cloud/securitycentermanagement/v1/internal/security_center_management_tracing_stub.h @@ -26,13 +26,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace securitycentermanagement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SecurityCenterManagementTracingStub : public SecurityCenterManagementStub { public: @@ -212,8 +213,6 @@ class SecurityCenterManagementTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -229,4 +228,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTERMANAGEMENT_V1_INTERNAL_SECURITY_CENTER_MANAGEMENT_TRACING_STUB_H diff --git a/google/cloud/securitycentermanagement/v1/security_center_management_connection.h b/google/cloud/securitycentermanagement/v1/security_center_management_connection.h index 27a78128e5bc0..0badebea49bc3 100644 --- a/google/cloud/securitycentermanagement/v1/security_center_management_connection.h +++ b/google/cloud/securitycentermanagement/v1/security_center_management_connection.h @@ -21,6 +21,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTERMANAGEMENT_V1_SECURITY_CENTER_MANAGEMENT_CONNECTION_H #include "google/cloud/securitycentermanagement/v1/internal/security_center_management_retry_traits.h" +#include "google/cloud/securitycentermanagement/v1/security_center_management.pb.h" #include "google/cloud/securitycentermanagement/v1/security_center_management_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -28,7 +29,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/securitycentermanagement/v1/security_center_management_connection_idempotency_policy.h b/google/cloud/securitycentermanagement/v1/security_center_management_connection_idempotency_policy.h index 27315750d8ca0..70c2dbb7de93b 100644 --- a/google/cloud/securitycentermanagement/v1/security_center_management_connection_idempotency_policy.h +++ b/google/cloud/securitycentermanagement/v1/security_center_management_connection_idempotency_policy.h @@ -20,10 +20,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTERMANAGEMENT_V1_SECURITY_CENTER_MANAGEMENT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SECURITYCENTERMANAGEMENT_V1_SECURITY_CENTER_MANAGEMENT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/securitycentermanagement/v1/security_center_management.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/servicecontrol/BUILD.bazel b/google/cloud/servicecontrol/BUILD.bazel index 8528b124568e9..7e4932e01f526 100644 --- a/google/cloud/servicecontrol/BUILD.bazel +++ b/google/cloud/servicecontrol/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/api/servicecontrol/v1:servicecontrol_cc_grpc", - "@com_google_googleapis//google/api/servicecontrol/v2:servicecontrol_cc_grpc", + "@googleapis//google/api/servicecontrol/v1:servicecontrol_cc_grpc", + "@googleapis//google/api/servicecontrol/v2:servicecontrol_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/servicecontrol/CMakeLists.txt b/google/cloud/servicecontrol/CMakeLists.txt index 1de3dd070c93c..1ef6771458560 100644 --- a/google/cloud/servicecontrol/CMakeLists.txt +++ b/google/cloud/servicecontrol/CMakeLists.txt @@ -18,7 +18,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( servicecontrol "Service Control API" - SERVICE_DIRS "__EMPTY__" "v1/" "v2/" + SERVICE_DIRS "v1/" "v2/" SHARED_PROTO_DEPS "logging_type") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) diff --git a/google/cloud/servicecontrol/mocks/mock_quota_controller_connection.h b/google/cloud/servicecontrol/mocks/mock_quota_controller_connection.h deleted file mode 100644 index 66a53c09a492f..0000000000000 --- a/google/cloud/servicecontrol/mocks/mock_quota_controller_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicecontrol/v1/quota_controller.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_MOCKS_MOCK_QUOTA_CONTROLLER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_MOCKS_MOCK_QUOTA_CONTROLLER_CONNECTION_H - -#include "google/cloud/servicecontrol/quota_controller_connection.h" -#include "google/cloud/servicecontrol/v1/mocks/mock_quota_controller_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in servicecontrol_v1_mocks instead of the aliases -/// defined in this namespace. -namespace servicecontrol_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicecontrol_v1_mocks::MockQuotaControllerConnection -/// directly. -using ::google::cloud::servicecontrol_v1_mocks::MockQuotaControllerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicecontrol_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_MOCKS_MOCK_QUOTA_CONTROLLER_CONNECTION_H diff --git a/google/cloud/servicecontrol/mocks/mock_service_controller_connection.h b/google/cloud/servicecontrol/mocks/mock_service_controller_connection.h deleted file mode 100644 index f2be921e7aae5..0000000000000 --- a/google/cloud/servicecontrol/mocks/mock_service_controller_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicecontrol/v1/service_controller.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_MOCKS_MOCK_SERVICE_CONTROLLER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_MOCKS_MOCK_SERVICE_CONTROLLER_CONNECTION_H - -#include "google/cloud/servicecontrol/service_controller_connection.h" -#include "google/cloud/servicecontrol/v1/mocks/mock_service_controller_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in servicecontrol_v1_mocks instead of the aliases -/// defined in this namespace. -namespace servicecontrol_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicecontrol_v1_mocks::MockServiceControllerConnection -/// directly. -using ::google::cloud::servicecontrol_v1_mocks::MockServiceControllerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicecontrol_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_MOCKS_MOCK_SERVICE_CONTROLLER_CONNECTION_H diff --git a/google/cloud/servicecontrol/quickstart/.bazelrc b/google/cloud/servicecontrol/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/servicecontrol/quickstart/.bazelrc +++ b/google/cloud/servicecontrol/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/servicecontrol/quickstart/CMakeLists.txt index 1fa110a7c3969..a5262c538242e 100644 --- a/google/cloud/servicecontrol/quickstart/CMakeLists.txt +++ b/google/cloud/servicecontrol/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Service Control API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-servicecontrol-quickstart CXX) find_package(google_cloud_cpp_servicecontrol REQUIRED) diff --git a/google/cloud/servicecontrol/quickstart/WORKSPACE.bazel b/google/cloud/servicecontrol/quickstart/WORKSPACE.bazel index 63472e2e21a06..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 = "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/servicecontrol/quota_controller_client.h b/google/cloud/servicecontrol/quota_controller_client.h deleted file mode 100644 index f9232cc134f04..0000000000000 --- a/google/cloud/servicecontrol/quota_controller_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicecontrol/v1/quota_controller.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_QUOTA_CONTROLLER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_QUOTA_CONTROLLER_CLIENT_H - -#include "google/cloud/servicecontrol/quota_controller_connection.h" -#include "google/cloud/servicecontrol/v1/quota_controller_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in servicecontrol_v1 instead of the aliases defined in -/// this namespace. -namespace servicecontrol { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicecontrol_v1::QuotaControllerClient directly. -using ::google::cloud::servicecontrol_v1::QuotaControllerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicecontrol -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_QUOTA_CONTROLLER_CLIENT_H diff --git a/google/cloud/servicecontrol/quota_controller_connection.h b/google/cloud/servicecontrol/quota_controller_connection.h deleted file mode 100644 index 2e4bf51ca4e15..0000000000000 --- a/google/cloud/servicecontrol/quota_controller_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicecontrol/v1/quota_controller.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_QUOTA_CONTROLLER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_QUOTA_CONTROLLER_CONNECTION_H - -#include "google/cloud/servicecontrol/quota_controller_connection_idempotency_policy.h" -#include "google/cloud/servicecontrol/v1/quota_controller_connection.h" - -namespace google { -namespace cloud { -namespace servicecontrol { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicecontrol_v1::MakeQuotaControllerConnection directly. -using ::google::cloud::servicecontrol_v1::MakeQuotaControllerConnection; - -/// @deprecated Use servicecontrol_v1::QuotaControllerConnection directly. -using ::google::cloud::servicecontrol_v1::QuotaControllerConnection; - -/// @deprecated Use -/// servicecontrol_v1::QuotaControllerLimitedErrorCountRetryPolicy directly. -using ::google::cloud::servicecontrol_v1:: - QuotaControllerLimitedErrorCountRetryPolicy; - -/// @deprecated Use servicecontrol_v1::QuotaControllerLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::servicecontrol_v1::QuotaControllerLimitedTimeRetryPolicy; - -/// @deprecated Use servicecontrol_v1::QuotaControllerRetryPolicy directly. -using ::google::cloud::servicecontrol_v1::QuotaControllerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicecontrol -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_QUOTA_CONTROLLER_CONNECTION_H diff --git a/google/cloud/servicecontrol/quota_controller_connection_idempotency_policy.h b/google/cloud/servicecontrol/quota_controller_connection_idempotency_policy.h deleted file mode 100644 index 6057a64f04029..0000000000000 --- a/google/cloud/servicecontrol/quota_controller_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicecontrol/v1/quota_controller.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_QUOTA_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_QUOTA_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/servicecontrol/v1/quota_controller_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace servicecontrol { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// servicecontrol_v1::MakeDefaultQuotaControllerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::servicecontrol_v1:: - MakeDefaultQuotaControllerConnectionIdempotencyPolicy; - -/// @deprecated Use -/// servicecontrol_v1::QuotaControllerConnectionIdempotencyPolicy directly. -using ::google::cloud::servicecontrol_v1:: - QuotaControllerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicecontrol -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_QUOTA_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/servicecontrol/quota_controller_options.h b/google/cloud/servicecontrol/quota_controller_options.h deleted file mode 100644 index 57163ffd6b3a9..0000000000000 --- a/google/cloud/servicecontrol/quota_controller_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicecontrol/v1/quota_controller.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_QUOTA_CONTROLLER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_QUOTA_CONTROLLER_OPTIONS_H - -#include "google/cloud/servicecontrol/quota_controller_connection.h" -#include "google/cloud/servicecontrol/quota_controller_connection_idempotency_policy.h" -#include "google/cloud/servicecontrol/v1/quota_controller_options.h" - -namespace google { -namespace cloud { -namespace servicecontrol { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicecontrol_v1::QuotaControllerBackoffPolicyOption -/// directly. -using ::google::cloud::servicecontrol_v1::QuotaControllerBackoffPolicyOption; - -/// @deprecated Use -/// servicecontrol_v1::QuotaControllerConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::servicecontrol_v1:: - QuotaControllerConnectionIdempotencyPolicyOption; - -/// @deprecated Use servicecontrol_v1::QuotaControllerPolicyOptionList directly. -using ::google::cloud::servicecontrol_v1::QuotaControllerPolicyOptionList; - -/// @deprecated Use servicecontrol_v1::QuotaControllerRetryPolicyOption -/// directly. -using ::google::cloud::servicecontrol_v1::QuotaControllerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicecontrol -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_QUOTA_CONTROLLER_OPTIONS_H diff --git a/google/cloud/servicecontrol/service_controller_client.h b/google/cloud/servicecontrol/service_controller_client.h deleted file mode 100644 index de75e6543334d..0000000000000 --- a/google/cloud/servicecontrol/service_controller_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicecontrol/v1/service_controller.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_SERVICE_CONTROLLER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_SERVICE_CONTROLLER_CLIENT_H - -#include "google/cloud/servicecontrol/service_controller_connection.h" -#include "google/cloud/servicecontrol/v1/service_controller_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in servicecontrol_v1 instead of the aliases defined in -/// this namespace. -namespace servicecontrol { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicecontrol_v1::ServiceControllerClient directly. -using ::google::cloud::servicecontrol_v1::ServiceControllerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicecontrol -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_SERVICE_CONTROLLER_CLIENT_H diff --git a/google/cloud/servicecontrol/service_controller_connection.h b/google/cloud/servicecontrol/service_controller_connection.h deleted file mode 100644 index 28f05228809d9..0000000000000 --- a/google/cloud/servicecontrol/service_controller_connection.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicecontrol/v1/service_controller.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_SERVICE_CONTROLLER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_SERVICE_CONTROLLER_CONNECTION_H - -#include "google/cloud/servicecontrol/service_controller_connection_idempotency_policy.h" -#include "google/cloud/servicecontrol/v1/service_controller_connection.h" - -namespace google { -namespace cloud { -namespace servicecontrol { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicecontrol_v1::MakeServiceControllerConnection directly. -using ::google::cloud::servicecontrol_v1::MakeServiceControllerConnection; - -/// @deprecated Use servicecontrol_v1::ServiceControllerConnection directly. -using ::google::cloud::servicecontrol_v1::ServiceControllerConnection; - -/// @deprecated Use -/// servicecontrol_v1::ServiceControllerLimitedErrorCountRetryPolicy directly. -using ::google::cloud::servicecontrol_v1:: - ServiceControllerLimitedErrorCountRetryPolicy; - -/// @deprecated Use servicecontrol_v1::ServiceControllerLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::servicecontrol_v1:: - ServiceControllerLimitedTimeRetryPolicy; - -/// @deprecated Use servicecontrol_v1::ServiceControllerRetryPolicy directly. -using ::google::cloud::servicecontrol_v1::ServiceControllerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicecontrol -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_SERVICE_CONTROLLER_CONNECTION_H diff --git a/google/cloud/servicecontrol/service_controller_connection_idempotency_policy.h b/google/cloud/servicecontrol/service_controller_connection_idempotency_policy.h deleted file mode 100644 index e91ab5a25823f..0000000000000 --- a/google/cloud/servicecontrol/service_controller_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicecontrol/v1/service_controller.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_SERVICE_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_SERVICE_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/servicecontrol/v1/service_controller_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace servicecontrol { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// servicecontrol_v1::MakeDefaultServiceControllerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::servicecontrol_v1:: - MakeDefaultServiceControllerConnectionIdempotencyPolicy; - -/// @deprecated Use -/// servicecontrol_v1::ServiceControllerConnectionIdempotencyPolicy directly. -using ::google::cloud::servicecontrol_v1:: - ServiceControllerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicecontrol -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_SERVICE_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/servicecontrol/service_controller_options.h b/google/cloud/servicecontrol/service_controller_options.h deleted file mode 100644 index 70ef1613e5ea1..0000000000000 --- a/google/cloud/servicecontrol/service_controller_options.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicecontrol/v1/service_controller.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_SERVICE_CONTROLLER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_SERVICE_CONTROLLER_OPTIONS_H - -#include "google/cloud/servicecontrol/service_controller_connection.h" -#include "google/cloud/servicecontrol/service_controller_connection_idempotency_policy.h" -#include "google/cloud/servicecontrol/v1/service_controller_options.h" - -namespace google { -namespace cloud { -namespace servicecontrol { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicecontrol_v1::ServiceControllerBackoffPolicyOption -/// directly. -using ::google::cloud::servicecontrol_v1::ServiceControllerBackoffPolicyOption; - -/// @deprecated Use -/// servicecontrol_v1::ServiceControllerConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::servicecontrol_v1:: - ServiceControllerConnectionIdempotencyPolicyOption; - -/// @deprecated Use servicecontrol_v1::ServiceControllerPolicyOptionList -/// directly. -using ::google::cloud::servicecontrol_v1::ServiceControllerPolicyOptionList; - -/// @deprecated Use servicecontrol_v1::ServiceControllerRetryPolicyOption -/// directly. -using ::google::cloud::servicecontrol_v1::ServiceControllerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicecontrol -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_SERVICE_CONTROLLER_OPTIONS_H diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_auth_decorator.cc b/google/cloud/servicecontrol/v1/internal/quota_controller_auth_decorator.cc index d3ffdec0c7ec6..5393ef42e31ec 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_auth_decorator.cc +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/api/servicecontrol/v1/quota_controller.proto #include "google/cloud/servicecontrol/v1/internal/quota_controller_auth_decorator.h" -#include +#include "google/api/servicecontrol/v1/quota_controller.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -44,3 +47,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_auth_decorator.h b/google/cloud/servicecontrol/v1/internal/quota_controller_auth_decorator.h index 6ffcfedcf0cec..5e0e4ce240ce8 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_auth_decorator.h +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -53,4 +56,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V1_INTERNAL_QUOTA_CONTROLLER_AUTH_DECORATOR_H diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_logging_decorator.cc b/google/cloud/servicecontrol/v1/internal/quota_controller_logging_decorator.cc index 1e58504250c10..7a2ec3eec0545 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_logging_decorator.cc +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/servicecontrol/v1/internal/quota_controller_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/api/servicecontrol/v1/quota_controller.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -52,3 +55,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_logging_decorator.h b/google/cloud/servicecontrol/v1/internal/quota_controller_logging_decorator.h index 80bdf2568ea00..3649b3a057288 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_logging_decorator.h +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -53,4 +56,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V1_INTERNAL_QUOTA_CONTROLLER_LOGGING_DECORATOR_H diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_metadata_decorator.cc b/google/cloud/servicecontrol/v1/internal/quota_controller_metadata_decorator.cc index fd70f2d356165..03dda0ca3d347 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_metadata_decorator.cc +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/servicecontrol/v1/internal/quota_controller_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/api/servicecontrol/v1/quota_controller.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -71,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_metadata_decorator.h b/google/cloud/servicecontrol/v1/internal/quota_controller_metadata_decorator.h index 4e6622be47208..c4cabd1ee631a 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_metadata_decorator.h +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -59,4 +62,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V1_INTERNAL_QUOTA_CONTROLLER_METADATA_DECORATOR_H diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_option_defaults.cc b/google/cloud/servicecontrol/v1/internal/quota_controller_option_defaults.cc index 22ed8af7c4c58..a39218fd91505 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_option_defaults.cc +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_option_defaults.cc @@ -42,7 +42,7 @@ Options QuotaControllerDefaultOptions(Options options) { if (!options.has()) { options.set( servicecontrol_v1::QuotaControllerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_stub.cc b/google/cloud/servicecontrol/v1/internal/quota_controller_stub.cc index 79f264de8338e..622577c24e700 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_stub.cc +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/servicecontrol/v1/internal/quota_controller_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/api/servicecontrol/v1/quota_controller.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -46,3 +49,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_stub.h b/google/cloud/servicecontrol/v1/internal/quota_controller_stub.h index 525fc5ad79279..0f2e5266b2755 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_stub.h +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/api/servicecontrol/v1/quota_controller.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -65,4 +68,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V1_INTERNAL_QUOTA_CONTROLLER_STUB_H diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_stub_factory.cc b/google/cloud/servicecontrol/v1/internal/quota_controller_stub_factory.cc index ca96e63a68a85..3fd68f424838f 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_stub_factory.cc +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/api/servicecontrol/v1/quota_controller.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_stub_factory.h b/google/cloud/servicecontrol/v1/internal/quota_controller_stub_factory.h index b14b887fea68d..d0c272bcfc55d 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_stub_factory.h +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V1_INTERNAL_QUOTA_CONTROLLER_STUB_FACTORY_H diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_connection.cc b/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_connection.cc index 25bf47b2c8400..44e7063d066a0 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_connection.cc +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace servicecontrol_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - QuotaControllerTracingConnection::QuotaControllerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -41,16 +39,12 @@ QuotaControllerTracingConnection::AllocateQuota( return internal::EndSpan(*span, child_->AllocateQuota(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeQuotaControllerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_connection.h b/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_connection.h index 756b95cec530e..5fcec6d74a836 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_connection.h +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace servicecontrol_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class QuotaControllerTracingConnection : public servicecontrol_v1::QuotaControllerConnection { public: @@ -48,8 +46,6 @@ class QuotaControllerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_stub.cc b/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_stub.cc index c657c5a1189b5..7dc0a1980c57b 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_stub.cc +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - QuotaControllerTracingStub::QuotaControllerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -44,18 +45,14 @@ QuotaControllerTracingStub::AllocateQuota( child_->AllocateQuota(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeQuotaControllerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_stub.h b/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_stub.h index 93ee960667cf5..e9ab5b39f6da2 100644 --- a/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_stub.h +++ b/google/cloud/servicecontrol/v1/internal/quota_controller_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class QuotaControllerTracingStub : public QuotaControllerStub { public: ~QuotaControllerTracingStub() override = default; @@ -50,8 +51,6 @@ class QuotaControllerTracingStub : public QuotaControllerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -66,4 +65,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V1_INTERNAL_QUOTA_CONTROLLER_TRACING_STUB_H diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_auth_decorator.cc b/google/cloud/servicecontrol/v1/internal/service_controller_auth_decorator.cc index 3c8350d354d1f..d8d9ebb51e4fa 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_auth_decorator.cc +++ b/google/cloud/servicecontrol/v1/internal/service_controller_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/api/servicecontrol/v1/service_controller.proto #include "google/cloud/servicecontrol/v1/internal/service_controller_auth_decorator.h" -#include +#include "google/api/servicecontrol/v1/service_controller.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -53,3 +56,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_auth_decorator.h b/google/cloud/servicecontrol/v1/internal/service_controller_auth_decorator.h index 5580768317de8..a29f97807d6be 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_auth_decorator.h +++ b/google/cloud/servicecontrol/v1/internal/service_controller_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -56,4 +59,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V1_INTERNAL_SERVICE_CONTROLLER_AUTH_DECORATOR_H diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_logging_decorator.cc b/google/cloud/servicecontrol/v1/internal/service_controller_logging_decorator.cc index c8a06b4ab41ac..0f845d01dcbee 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_logging_decorator.cc +++ b/google/cloud/servicecontrol/v1/internal/service_controller_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/servicecontrol/v1/internal/service_controller_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/api/servicecontrol/v1/service_controller.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -63,3 +66,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_logging_decorator.h b/google/cloud/servicecontrol/v1/internal/service_controller_logging_decorator.h index b940a52839c2a..c55929c58faaa 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_logging_decorator.h +++ b/google/cloud/servicecontrol/v1/internal/service_controller_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -56,4 +59,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V1_INTERNAL_SERVICE_CONTROLLER_LOGGING_DECORATOR_H diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_metadata_decorator.cc b/google/cloud/servicecontrol/v1/internal/service_controller_metadata_decorator.cc index 2f97c190ba7b1..5f639a58a8432 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_metadata_decorator.cc +++ b/google/cloud/servicecontrol/v1/internal/service_controller_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/servicecontrol/v1/internal/service_controller_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/api/servicecontrol/v1/service_controller.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -81,3 +85,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_metadata_decorator.h b/google/cloud/servicecontrol/v1/internal/service_controller_metadata_decorator.h index 6f0a9355e594d..72c485b1abf1d 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_metadata_decorator.h +++ b/google/cloud/servicecontrol/v1/internal/service_controller_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -62,4 +65,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V1_INTERNAL_SERVICE_CONTROLLER_METADATA_DECORATOR_H diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_option_defaults.cc b/google/cloud/servicecontrol/v1/internal/service_controller_option_defaults.cc index 81144d5249673..1d94e26822cd8 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_option_defaults.cc +++ b/google/cloud/servicecontrol/v1/internal/service_controller_option_defaults.cc @@ -42,7 +42,7 @@ Options ServiceControllerDefaultOptions(Options options) { if (!options.has()) { options.set( servicecontrol_v1::ServiceControllerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_stub.cc b/google/cloud/servicecontrol/v1/internal/service_controller_stub.cc index 65f4340cd1017..9a1409b1c9644 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_stub.cc +++ b/google/cloud/servicecontrol/v1/internal/service_controller_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/servicecontrol/v1/internal/service_controller_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/api/servicecontrol/v1/service_controller.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -58,3 +61,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_stub.h b/google/cloud/servicecontrol/v1/internal/service_controller_stub.h index 8a5aef06d1de1..f62940603fcd3 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_stub.h +++ b/google/cloud/servicecontrol/v1/internal/service_controller_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/api/servicecontrol/v1/service_controller.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -71,4 +74,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V1_INTERNAL_SERVICE_CONTROLLER_STUB_H diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_stub_factory.cc b/google/cloud/servicecontrol/v1/internal/service_controller_stub_factory.cc index 548cd5573897d..74110803690cb 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_stub_factory.cc +++ b/google/cloud/servicecontrol/v1/internal/service_controller_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/api/servicecontrol/v1/service_controller.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_stub_factory.h b/google/cloud/servicecontrol/v1/internal/service_controller_stub_factory.h index e0b1a9313fb64..737b739c4b4a4 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_stub_factory.h +++ b/google/cloud/servicecontrol/v1/internal/service_controller_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V1_INTERNAL_SERVICE_CONTROLLER_STUB_FACTORY_H diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_tracing_connection.cc b/google/cloud/servicecontrol/v1/internal/service_controller_tracing_connection.cc index c9c99834bd059..aa4b8b9690109 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_tracing_connection.cc +++ b/google/cloud/servicecontrol/v1/internal/service_controller_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace servicecontrol_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServiceControllerTracingConnection::ServiceControllerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -50,17 +48,13 @@ ServiceControllerTracingConnection::Report( return internal::EndSpan(*span, child_->Report(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServiceControllerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_tracing_connection.h b/google/cloud/servicecontrol/v1/internal/service_controller_tracing_connection.h index 9965ea39798ee..5be2d90af403e 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_tracing_connection.h +++ b/google/cloud/servicecontrol/v1/internal/service_controller_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace servicecontrol_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServiceControllerTracingConnection : public servicecontrol_v1::ServiceControllerConnection { public: @@ -50,8 +48,6 @@ class ServiceControllerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_tracing_stub.cc b/google/cloud/servicecontrol/v1/internal/service_controller_tracing_stub.cc index d1a0404904110..44d5bf677a2bb 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_tracing_stub.cc +++ b/google/cloud/servicecontrol/v1/internal/service_controller_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServiceControllerTracingStub::ServiceControllerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -56,18 +57,14 @@ ServiceControllerTracingStub::Report( child_->Report(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServiceControllerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v1/internal/service_controller_tracing_stub.h b/google/cloud/servicecontrol/v1/internal/service_controller_tracing_stub.h index c1909e1756708..d83037e956a6f 100644 --- a/google/cloud/servicecontrol/v1/internal/service_controller_tracing_stub.h +++ b/google/cloud/servicecontrol/v1/internal/service_controller_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServiceControllerTracingStub : public ServiceControllerStub { public: ~ServiceControllerTracingStub() override = default; @@ -53,8 +54,6 @@ class ServiceControllerTracingStub : public ServiceControllerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -69,4 +68,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V1_INTERNAL_SERVICE_CONTROLLER_TRACING_STUB_H diff --git a/google/cloud/servicecontrol/v1/quota_controller_connection.h b/google/cloud/servicecontrol/v1/quota_controller_connection.h index 9e8f65c30f43d..681d5b22c6586 100644 --- a/google/cloud/servicecontrol/v1/quota_controller_connection.h +++ b/google/cloud/servicecontrol/v1/quota_controller_connection.h @@ -26,7 +26,7 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/api/servicecontrol/v1/quota_controller.pb.h" #include namespace google { diff --git a/google/cloud/servicecontrol/v1/quota_controller_connection_idempotency_policy.h b/google/cloud/servicecontrol/v1/quota_controller_connection_idempotency_policy.h index 85e5c40c55ac6..ec78728a16951 100644 --- a/google/cloud/servicecontrol/v1/quota_controller_connection_idempotency_policy.h +++ b/google/cloud/servicecontrol/v1/quota_controller_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/api/servicecontrol/v1/quota_controller.grpc.pb.h" #include namespace google { diff --git a/google/cloud/servicecontrol/v1/service_controller_connection.h b/google/cloud/servicecontrol/v1/service_controller_connection.h index 5475e099a3396..d97a91d3d4f70 100644 --- a/google/cloud/servicecontrol/v1/service_controller_connection.h +++ b/google/cloud/servicecontrol/v1/service_controller_connection.h @@ -26,7 +26,7 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/api/servicecontrol/v1/service_controller.pb.h" #include namespace google { diff --git a/google/cloud/servicecontrol/v1/service_controller_connection_idempotency_policy.h b/google/cloud/servicecontrol/v1/service_controller_connection_idempotency_policy.h index 20b1546733cd1..9c39a951d149a 100644 --- a/google/cloud/servicecontrol/v1/service_controller_connection_idempotency_policy.h +++ b/google/cloud/servicecontrol/v1/service_controller_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/api/servicecontrol/v1/service_controller.grpc.pb.h" #include namespace google { diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_auth_decorator.cc b/google/cloud/servicecontrol/v2/internal/service_controller_auth_decorator.cc index e22b57e66999a..b816c956a195c 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_auth_decorator.cc +++ b/google/cloud/servicecontrol/v2/internal/service_controller_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/api/servicecontrol/v2/service_controller.proto #include "google/cloud/servicecontrol/v2/internal/service_controller_auth_decorator.h" -#include +#include "google/api/servicecontrol/v2/service_controller.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v2_internal { @@ -53,3 +56,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_auth_decorator.h b/google/cloud/servicecontrol/v2/internal/service_controller_auth_decorator.h index 7dea6fff5f337..2b28d24c79e11 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_auth_decorator.h +++ b/google/cloud/servicecontrol/v2/internal/service_controller_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v2_internal { @@ -56,4 +59,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V2_INTERNAL_SERVICE_CONTROLLER_AUTH_DECORATOR_H diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_logging_decorator.cc b/google/cloud/servicecontrol/v2/internal/service_controller_logging_decorator.cc index bded98ab6e4e4..f89bfc3566cc5 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_logging_decorator.cc +++ b/google/cloud/servicecontrol/v2/internal/service_controller_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/servicecontrol/v2/internal/service_controller_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/api/servicecontrol/v2/service_controller.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v2_internal { @@ -63,3 +66,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_logging_decorator.h b/google/cloud/servicecontrol/v2/internal/service_controller_logging_decorator.h index 3436b45f0be33..d1b0bec0c84da 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_logging_decorator.h +++ b/google/cloud/servicecontrol/v2/internal/service_controller_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v2_internal { @@ -56,4 +59,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V2_INTERNAL_SERVICE_CONTROLLER_LOGGING_DECORATOR_H diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_metadata_decorator.cc b/google/cloud/servicecontrol/v2/internal/service_controller_metadata_decorator.cc index 04932bbb72150..230d15960e67c 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_metadata_decorator.cc +++ b/google/cloud/servicecontrol/v2/internal/service_controller_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/servicecontrol/v2/internal/service_controller_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/api/servicecontrol/v2/service_controller.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v2_internal { @@ -81,3 +85,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_metadata_decorator.h b/google/cloud/servicecontrol/v2/internal/service_controller_metadata_decorator.h index 9a320a6ce7e62..e779092552192 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_metadata_decorator.h +++ b/google/cloud/servicecontrol/v2/internal/service_controller_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v2_internal { @@ -62,4 +65,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V2_INTERNAL_SERVICE_CONTROLLER_METADATA_DECORATOR_H diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_option_defaults.cc b/google/cloud/servicecontrol/v2/internal/service_controller_option_defaults.cc index 2d250a76c0af9..160988e523939 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_option_defaults.cc +++ b/google/cloud/servicecontrol/v2/internal/service_controller_option_defaults.cc @@ -42,7 +42,7 @@ Options ServiceControllerDefaultOptions(Options options) { if (!options.has()) { options.set( servicecontrol_v2::ServiceControllerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_stub.cc b/google/cloud/servicecontrol/v2/internal/service_controller_stub.cc index 7a861bea1a911..15352c0662bcc 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_stub.cc +++ b/google/cloud/servicecontrol/v2/internal/service_controller_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/servicecontrol/v2/internal/service_controller_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/api/servicecontrol/v2/service_controller.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v2_internal { @@ -58,3 +61,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_stub.h b/google/cloud/servicecontrol/v2/internal/service_controller_stub.h index f8e73cc9ecd91..e3251118dd95c 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_stub.h +++ b/google/cloud/servicecontrol/v2/internal/service_controller_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/api/servicecontrol/v2/service_controller.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v2_internal { @@ -71,4 +74,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V2_INTERNAL_SERVICE_CONTROLLER_STUB_H diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_stub_factory.cc b/google/cloud/servicecontrol/v2/internal/service_controller_stub_factory.cc index c25a2f5aa701c..f99479cf55706 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_stub_factory.cc +++ b/google/cloud/servicecontrol/v2/internal/service_controller_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/api/servicecontrol/v2/service_controller.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v2_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_stub_factory.h b/google/cloud/servicecontrol/v2/internal/service_controller_stub_factory.h index da6225ea00906..0c7bc56095156 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_stub_factory.h +++ b/google/cloud/servicecontrol/v2/internal/service_controller_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V2_INTERNAL_SERVICE_CONTROLLER_STUB_FACTORY_H diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_tracing_connection.cc b/google/cloud/servicecontrol/v2/internal/service_controller_tracing_connection.cc index 5a043f7496bf2..ccff8dfe59152 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_tracing_connection.cc +++ b/google/cloud/servicecontrol/v2/internal/service_controller_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace servicecontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServiceControllerTracingConnection::ServiceControllerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -50,17 +48,13 @@ ServiceControllerTracingConnection::Report( return internal::EndSpan(*span, child_->Report(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServiceControllerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_tracing_connection.h b/google/cloud/servicecontrol/v2/internal/service_controller_tracing_connection.h index 5c7ddc2f38f10..7cae48d7855fa 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_tracing_connection.h +++ b/google/cloud/servicecontrol/v2/internal/service_controller_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace servicecontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServiceControllerTracingConnection : public servicecontrol_v2::ServiceControllerConnection { public: @@ -50,8 +48,6 @@ class ServiceControllerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_tracing_stub.cc b/google/cloud/servicecontrol/v2/internal/service_controller_tracing_stub.cc index 3595cb198ac5a..df744b09b37fd 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_tracing_stub.cc +++ b/google/cloud/servicecontrol/v2/internal/service_controller_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServiceControllerTracingStub::ServiceControllerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -56,18 +57,14 @@ ServiceControllerTracingStub::Report( child_->Report(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServiceControllerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicecontrol_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicecontrol/v2/internal/service_controller_tracing_stub.h b/google/cloud/servicecontrol/v2/internal/service_controller_tracing_stub.h index 59b4e0da92bcd..5a415c3839fa3 100644 --- a/google/cloud/servicecontrol/v2/internal/service_controller_tracing_stub.h +++ b/google/cloud/servicecontrol/v2/internal/service_controller_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicecontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServiceControllerTracingStub : public ServiceControllerStub { public: ~ServiceControllerTracingStub() override = default; @@ -53,8 +54,6 @@ class ServiceControllerTracingStub : public ServiceControllerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -69,4 +68,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICECONTROL_V2_INTERNAL_SERVICE_CONTROLLER_TRACING_STUB_H diff --git a/google/cloud/servicecontrol/v2/service_controller_connection.h b/google/cloud/servicecontrol/v2/service_controller_connection.h index 1cfbdfd836578..2fdc4f38c9625 100644 --- a/google/cloud/servicecontrol/v2/service_controller_connection.h +++ b/google/cloud/servicecontrol/v2/service_controller_connection.h @@ -26,7 +26,7 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/api/servicecontrol/v2/service_controller.pb.h" #include namespace google { diff --git a/google/cloud/servicecontrol/v2/service_controller_connection_idempotency_policy.h b/google/cloud/servicecontrol/v2/service_controller_connection_idempotency_policy.h index a48459d234f66..1fc737b1eefa8 100644 --- a/google/cloud/servicecontrol/v2/service_controller_connection_idempotency_policy.h +++ b/google/cloud/servicecontrol/v2/service_controller_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/api/servicecontrol/v2/service_controller.grpc.pb.h" #include namespace google { diff --git a/google/cloud/servicedirectory/BUILD.bazel b/google/cloud/servicedirectory/BUILD.bazel index 77e33da3c8fa4..473496754c24a 100644 --- a/google/cloud/servicedirectory/BUILD.bazel +++ b/google/cloud/servicedirectory/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/servicedirectory/v1:servicedirectory_cc_grpc", + "@googleapis//google/cloud/servicedirectory/v1:servicedirectory_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/servicedirectory/CMakeLists.txt b/google/cloud/servicedirectory/CMakeLists.txt index 4861598ac3b95..fc364b620f381 100644 --- a/google/cloud/servicedirectory/CMakeLists.txt +++ b/google/cloud/servicedirectory/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(servicedirectory "Service Directory API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(servicedirectory_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/servicedirectory/lookup_client.h b/google/cloud/servicedirectory/lookup_client.h deleted file mode 100644 index d26129ca8d0fe..0000000000000 --- a/google/cloud/servicedirectory/lookup_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/servicedirectory/v1/lookup_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_LOOKUP_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_LOOKUP_CLIENT_H - -#include "google/cloud/servicedirectory/lookup_connection.h" -#include "google/cloud/servicedirectory/v1/lookup_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in servicedirectory_v1 instead of the aliases defined in -/// this namespace. -namespace servicedirectory { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicedirectory_v1::LookupServiceClient directly. -using ::google::cloud::servicedirectory_v1::LookupServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicedirectory -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_LOOKUP_CLIENT_H diff --git a/google/cloud/servicedirectory/lookup_connection.h b/google/cloud/servicedirectory/lookup_connection.h deleted file mode 100644 index e60ca6d18bf08..0000000000000 --- a/google/cloud/servicedirectory/lookup_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/servicedirectory/v1/lookup_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_LOOKUP_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_LOOKUP_CONNECTION_H - -#include "google/cloud/servicedirectory/lookup_connection_idempotency_policy.h" -#include "google/cloud/servicedirectory/v1/lookup_connection.h" - -namespace google { -namespace cloud { -namespace servicedirectory { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicedirectory_v1::MakeLookupServiceConnection directly. -using ::google::cloud::servicedirectory_v1::MakeLookupServiceConnection; - -/// @deprecated Use servicedirectory_v1::LookupServiceConnection directly. -using ::google::cloud::servicedirectory_v1::LookupServiceConnection; - -/// @deprecated Use -/// servicedirectory_v1::LookupServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::servicedirectory_v1:: - LookupServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use servicedirectory_v1::LookupServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::servicedirectory_v1::LookupServiceLimitedTimeRetryPolicy; - -/// @deprecated Use servicedirectory_v1::LookupServiceRetryPolicy directly. -using ::google::cloud::servicedirectory_v1::LookupServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicedirectory -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_LOOKUP_CONNECTION_H diff --git a/google/cloud/servicedirectory/lookup_connection_idempotency_policy.h b/google/cloud/servicedirectory/lookup_connection_idempotency_policy.h deleted file mode 100644 index f537ff0639191..0000000000000 --- a/google/cloud/servicedirectory/lookup_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/servicedirectory/v1/lookup_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_LOOKUP_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_LOOKUP_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/servicedirectory/v1/lookup_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace servicedirectory { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// servicedirectory_v1::MakeDefaultLookupServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::servicedirectory_v1:: - MakeDefaultLookupServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// servicedirectory_v1::LookupServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::servicedirectory_v1:: - LookupServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicedirectory -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_LOOKUP_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/servicedirectory/lookup_options.h b/google/cloud/servicedirectory/lookup_options.h deleted file mode 100644 index 468dda7ffb66a..0000000000000 --- a/google/cloud/servicedirectory/lookup_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/servicedirectory/v1/lookup_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_LOOKUP_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_LOOKUP_OPTIONS_H - -#include "google/cloud/servicedirectory/lookup_connection.h" -#include "google/cloud/servicedirectory/lookup_connection_idempotency_policy.h" -#include "google/cloud/servicedirectory/v1/lookup_options.h" - -namespace google { -namespace cloud { -namespace servicedirectory { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicedirectory_v1::LookupServiceBackoffPolicyOption -/// directly. -using ::google::cloud::servicedirectory_v1::LookupServiceBackoffPolicyOption; - -/// @deprecated Use -/// servicedirectory_v1::LookupServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::servicedirectory_v1:: - LookupServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use servicedirectory_v1::LookupServicePolicyOptionList directly. -using ::google::cloud::servicedirectory_v1::LookupServicePolicyOptionList; - -/// @deprecated Use servicedirectory_v1::LookupServiceRetryPolicyOption -/// directly. -using ::google::cloud::servicedirectory_v1::LookupServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicedirectory -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_LOOKUP_OPTIONS_H diff --git a/google/cloud/servicedirectory/mocks/mock_lookup_connection.h b/google/cloud/servicedirectory/mocks/mock_lookup_connection.h deleted file mode 100644 index 8e7880975ed62..0000000000000 --- a/google/cloud/servicedirectory/mocks/mock_lookup_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/servicedirectory/v1/lookup_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_MOCKS_MOCK_LOOKUP_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_MOCKS_MOCK_LOOKUP_CONNECTION_H - -#include "google/cloud/servicedirectory/lookup_connection.h" -#include "google/cloud/servicedirectory/v1/mocks/mock_lookup_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in servicedirectory_v1_mocks instead of the aliases -/// defined in this namespace. -namespace servicedirectory_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicedirectory_v1_mocks::MockLookupServiceConnection -/// directly. -using ::google::cloud::servicedirectory_v1_mocks::MockLookupServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicedirectory_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_MOCKS_MOCK_LOOKUP_CONNECTION_H diff --git a/google/cloud/servicedirectory/mocks/mock_registration_connection.h b/google/cloud/servicedirectory/mocks/mock_registration_connection.h deleted file mode 100644 index f36f104522107..0000000000000 --- a/google/cloud/servicedirectory/mocks/mock_registration_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/servicedirectory/v1/registration_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_MOCKS_MOCK_REGISTRATION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_MOCKS_MOCK_REGISTRATION_CONNECTION_H - -#include "google/cloud/servicedirectory/registration_connection.h" -#include "google/cloud/servicedirectory/v1/mocks/mock_registration_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in servicedirectory_v1_mocks instead of the aliases -/// defined in this namespace. -namespace servicedirectory_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicedirectory_v1_mocks::MockRegistrationServiceConnection -/// directly. -using ::google::cloud::servicedirectory_v1_mocks:: - MockRegistrationServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicedirectory_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_MOCKS_MOCK_REGISTRATION_CONNECTION_H diff --git a/google/cloud/servicedirectory/quickstart/.bazelrc b/google/cloud/servicedirectory/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/servicedirectory/quickstart/.bazelrc +++ b/google/cloud/servicedirectory/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/servicedirectory/quickstart/CMakeLists.txt index 30f65e7d8dbbb..5410518a7a531 100644 --- a/google/cloud/servicedirectory/quickstart/CMakeLists.txt +++ b/google/cloud/servicedirectory/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Service Directory API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-servicedirectory-quickstart CXX) find_package(google_cloud_cpp_servicedirectory REQUIRED) diff --git a/google/cloud/servicedirectory/quickstart/WORKSPACE.bazel b/google/cloud/servicedirectory/quickstart/WORKSPACE.bazel index 63d8540b6fd90..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 = "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/servicedirectory/registration_client.h b/google/cloud/servicedirectory/registration_client.h deleted file mode 100644 index fe2d2dd67c85c..0000000000000 --- a/google/cloud/servicedirectory/registration_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/servicedirectory/v1/registration_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_REGISTRATION_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_REGISTRATION_CLIENT_H - -#include "google/cloud/servicedirectory/registration_connection.h" -#include "google/cloud/servicedirectory/v1/registration_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in servicedirectory_v1 instead of the aliases defined in -/// this namespace. -namespace servicedirectory { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicedirectory_v1::RegistrationServiceClient directly. -using ::google::cloud::servicedirectory_v1::RegistrationServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicedirectory -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_REGISTRATION_CLIENT_H diff --git a/google/cloud/servicedirectory/registration_connection.h b/google/cloud/servicedirectory/registration_connection.h deleted file mode 100644 index 8370f825bcf23..0000000000000 --- a/google/cloud/servicedirectory/registration_connection.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/servicedirectory/v1/registration_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_REGISTRATION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_REGISTRATION_CONNECTION_H - -#include "google/cloud/servicedirectory/registration_connection_idempotency_policy.h" -#include "google/cloud/servicedirectory/v1/registration_connection.h" - -namespace google { -namespace cloud { -namespace servicedirectory { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicedirectory_v1::MakeRegistrationServiceConnection -/// directly. -using ::google::cloud::servicedirectory_v1::MakeRegistrationServiceConnection; - -/// @deprecated Use servicedirectory_v1::RegistrationServiceConnection directly. -using ::google::cloud::servicedirectory_v1::RegistrationServiceConnection; - -/// @deprecated Use -/// servicedirectory_v1::RegistrationServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::servicedirectory_v1:: - RegistrationServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// servicedirectory_v1::RegistrationServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::servicedirectory_v1:: - RegistrationServiceLimitedTimeRetryPolicy; - -/// @deprecated Use servicedirectory_v1::RegistrationServiceRetryPolicy -/// directly. -using ::google::cloud::servicedirectory_v1::RegistrationServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicedirectory -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_REGISTRATION_CONNECTION_H diff --git a/google/cloud/servicedirectory/registration_connection_idempotency_policy.h b/google/cloud/servicedirectory/registration_connection_idempotency_policy.h deleted file mode 100644 index 6039401743258..0000000000000 --- a/google/cloud/servicedirectory/registration_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/servicedirectory/v1/registration_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_REGISTRATION_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_REGISTRATION_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/servicedirectory/v1/registration_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace servicedirectory { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// servicedirectory_v1::MakeDefaultRegistrationServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::servicedirectory_v1:: - MakeDefaultRegistrationServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// servicedirectory_v1::RegistrationServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::servicedirectory_v1:: - RegistrationServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicedirectory -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_REGISTRATION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/servicedirectory/registration_options.h b/google/cloud/servicedirectory/registration_options.h deleted file mode 100644 index 0a878a55430fc..0000000000000 --- a/google/cloud/servicedirectory/registration_options.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/servicedirectory/v1/registration_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_REGISTRATION_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_REGISTRATION_OPTIONS_H - -#include "google/cloud/servicedirectory/registration_connection.h" -#include "google/cloud/servicedirectory/registration_connection_idempotency_policy.h" -#include "google/cloud/servicedirectory/v1/registration_options.h" - -namespace google { -namespace cloud { -namespace servicedirectory { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicedirectory_v1::RegistrationServiceBackoffPolicyOption -/// directly. -using ::google::cloud::servicedirectory_v1:: - RegistrationServiceBackoffPolicyOption; - -/// @deprecated Use -/// servicedirectory_v1::RegistrationServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::servicedirectory_v1:: - RegistrationServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use servicedirectory_v1::RegistrationServicePolicyOptionList -/// directly. -using ::google::cloud::servicedirectory_v1::RegistrationServicePolicyOptionList; - -/// @deprecated Use servicedirectory_v1::RegistrationServiceRetryPolicyOption -/// directly. -using ::google::cloud::servicedirectory_v1:: - RegistrationServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicedirectory -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_REGISTRATION_OPTIONS_H diff --git a/google/cloud/servicedirectory/v1/internal/lookup_auth_decorator.cc b/google/cloud/servicedirectory/v1/internal/lookup_auth_decorator.cc index 8232f7a4c7c88..20f550d4a9267 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_auth_decorator.cc +++ b/google/cloud/servicedirectory/v1/internal/lookup_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/servicedirectory/v1/lookup_service.proto #include "google/cloud/servicedirectory/v1/internal/lookup_auth_decorator.h" -#include +#include "google/cloud/servicedirectory/v1/lookup_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -61,3 +64,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicedirectory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicedirectory/v1/internal/lookup_auth_decorator.h b/google/cloud/servicedirectory/v1/internal/lookup_auth_decorator.h index 2c0681dbf74bd..de8eace51c73a 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_auth_decorator.h +++ b/google/cloud/servicedirectory/v1/internal/lookup_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -62,4 +65,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_LOOKUP_AUTH_DECORATOR_H diff --git a/google/cloud/servicedirectory/v1/internal/lookup_logging_decorator.cc b/google/cloud/servicedirectory/v1/internal/lookup_logging_decorator.cc index e67fd31703f6d..9bb9e814f29eb 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_logging_decorator.cc +++ b/google/cloud/servicedirectory/v1/internal/lookup_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/servicedirectory/v1/lookup_service.proto #include "google/cloud/servicedirectory/v1/internal/lookup_logging_decorator.h" +#include "google/cloud/servicedirectory/v1/lookup_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicedirectory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicedirectory/v1/internal/lookup_logging_decorator.h b/google/cloud/servicedirectory/v1/internal/lookup_logging_decorator.h index 9db99dd7fde0a..cfcbaf7c7d312 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_logging_decorator.h +++ b/google/cloud/servicedirectory/v1/internal/lookup_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -62,4 +65,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_LOOKUP_LOGGING_DECORATOR_H diff --git a/google/cloud/servicedirectory/v1/internal/lookup_metadata_decorator.cc b/google/cloud/servicedirectory/v1/internal/lookup_metadata_decorator.cc index 385a023edfcf3..e8ab907585d7d 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_metadata_decorator.cc +++ b/google/cloud/servicedirectory/v1/internal/lookup_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/servicedirectory/v1/lookup_service.proto #include "google/cloud/servicedirectory/v1/internal/lookup_metadata_decorator.h" +#include "google/cloud/servicedirectory/v1/lookup_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 servicedirectory_v1_internal { @@ -87,3 +91,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicedirectory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicedirectory/v1/internal/lookup_metadata_decorator.h b/google/cloud/servicedirectory/v1/internal/lookup_metadata_decorator.h index dd2eee8f9cb3e..c962153de4e74 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_metadata_decorator.h +++ b/google/cloud/servicedirectory/v1/internal/lookup_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -67,4 +70,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_LOOKUP_METADATA_DECORATOR_H diff --git a/google/cloud/servicedirectory/v1/internal/lookup_option_defaults.cc b/google/cloud/servicedirectory/v1/internal/lookup_option_defaults.cc index f0582da2f3746..8731a9a916c5b 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_option_defaults.cc +++ b/google/cloud/servicedirectory/v1/internal/lookup_option_defaults.cc @@ -42,7 +42,7 @@ Options LookupServiceDefaultOptions(Options options) { if (!options.has()) { options.set( servicedirectory_v1::LookupServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/servicedirectory/v1/internal/lookup_stub.cc b/google/cloud/servicedirectory/v1/internal/lookup_stub.cc index 401d2dcb3a864..0ab8ee355848b 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_stub.cc +++ b/google/cloud/servicedirectory/v1/internal/lookup_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/servicedirectory/v1/lookup_service.proto #include "google/cloud/servicedirectory/v1/internal/lookup_stub.h" +#include "google/cloud/servicedirectory/v1/lookup_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicedirectory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicedirectory/v1/internal/lookup_stub.h b/google/cloud/servicedirectory/v1/internal/lookup_stub.h index e28f7388a2f84..42e53807f5d32 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_stub.h +++ b/google/cloud/servicedirectory/v1/internal/lookup_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_LOOKUP_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_LOOKUP_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/servicedirectory/v1/lookup_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -90,4 +93,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_LOOKUP_STUB_H diff --git a/google/cloud/servicedirectory/v1/internal/lookup_stub_factory.cc b/google/cloud/servicedirectory/v1/internal/lookup_stub_factory.cc index 591267c340d6b..01d7ffc4364e6 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_stub_factory.cc +++ b/google/cloud/servicedirectory/v1/internal/lookup_stub_factory.cc @@ -17,22 +17,25 @@ // source: google/cloud/servicedirectory/v1/lookup_service.proto #include "google/cloud/servicedirectory/v1/internal/lookup_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/servicedirectory/v1/internal/lookup_auth_decorator.h" #include "google/cloud/servicedirectory/v1/internal/lookup_logging_decorator.h" #include "google/cloud/servicedirectory/v1/internal/lookup_metadata_decorator.h" #include "google/cloud/servicedirectory/v1/internal/lookup_stub.h" #include "google/cloud/servicedirectory/v1/internal/lookup_tracing_stub.h" +#include "google/cloud/servicedirectory/v1/lookup_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 -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicedirectory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicedirectory/v1/internal/lookup_stub_factory.h b/google/cloud/servicedirectory/v1/internal/lookup_stub_factory.h index 06546c0da7c43..70c01e03879d8 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_stub_factory.h +++ b/google/cloud/servicedirectory/v1/internal/lookup_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_LOOKUP_STUB_FACTORY_H diff --git a/google/cloud/servicedirectory/v1/internal/lookup_tracing_connection.cc b/google/cloud/servicedirectory/v1/internal/lookup_tracing_connection.cc index 98c928e7ac94a..56673203bc80c 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_tracing_connection.cc +++ b/google/cloud/servicedirectory/v1/internal/lookup_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace servicedirectory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LookupServiceTracingConnection::LookupServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -62,16 +60,12 @@ LookupServiceTracingConnection::GetLocation( return internal::EndSpan(*span, child_->GetLocation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLookupServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/servicedirectory/v1/internal/lookup_tracing_connection.h b/google/cloud/servicedirectory/v1/internal/lookup_tracing_connection.h index e5618e5e819c5..77a1f91680296 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_tracing_connection.h +++ b/google/cloud/servicedirectory/v1/internal/lookup_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace servicedirectory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LookupServiceTracingConnection : public servicedirectory_v1::LookupServiceConnection { public: @@ -55,8 +53,6 @@ class LookupServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/servicedirectory/v1/internal/lookup_tracing_stub.cc b/google/cloud/servicedirectory/v1/internal/lookup_tracing_stub.cc index e2a8eb0fb436b..df23432803aab 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_tracing_stub.cc +++ b/google/cloud/servicedirectory/v1/internal/lookup_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LookupServiceTracingStub::LookupServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -68,18 +69,14 @@ LookupServiceTracingStub::GetLocation( child_->GetLocation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLookupServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicedirectory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicedirectory/v1/internal/lookup_tracing_stub.h b/google/cloud/servicedirectory/v1/internal/lookup_tracing_stub.h index fd5b16d914776..f04fdba0d7e11 100644 --- a/google/cloud/servicedirectory/v1/internal/lookup_tracing_stub.h +++ b/google/cloud/servicedirectory/v1/internal/lookup_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LookupServiceTracingStub : public LookupServiceStub { public: ~LookupServiceTracingStub() override = default; @@ -58,8 +59,6 @@ class LookupServiceTracingStub : public LookupServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -74,4 +73,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_LOOKUP_TRACING_STUB_H diff --git a/google/cloud/servicedirectory/v1/internal/registration_auth_decorator.cc b/google/cloud/servicedirectory/v1/internal/registration_auth_decorator.cc index 47e9734dfefd1..42763cb870041 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_auth_decorator.cc +++ b/google/cloud/servicedirectory/v1/internal/registration_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/servicedirectory/v1/registration_service.proto #include "google/cloud/servicedirectory/v1/internal/registration_auth_decorator.h" -#include +#include "google/cloud/servicedirectory/v1/registration_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -213,3 +216,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicedirectory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicedirectory/v1/internal/registration_auth_decorator.h b/google/cloud/servicedirectory/v1/internal/registration_auth_decorator.h index 1663e37e2fae4..5bc372112c687 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_auth_decorator.h +++ b/google/cloud/servicedirectory/v1/internal/registration_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -144,4 +147,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_REGISTRATION_AUTH_DECORATOR_H diff --git a/google/cloud/servicedirectory/v1/internal/registration_logging_decorator.cc b/google/cloud/servicedirectory/v1/internal/registration_logging_decorator.cc index 34ae7ecaf8359..dd5ce105ce286 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_logging_decorator.cc +++ b/google/cloud/servicedirectory/v1/internal/registration_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/servicedirectory/v1/registration_service.proto #include "google/cloud/servicedirectory/v1/internal/registration_logging_decorator.h" +#include "google/cloud/servicedirectory/v1/registration_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -292,3 +295,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicedirectory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicedirectory/v1/internal/registration_logging_decorator.h b/google/cloud/servicedirectory/v1/internal/registration_logging_decorator.h index 7b7dabe9c5305..9d3187ceb5865 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_logging_decorator.h +++ b/google/cloud/servicedirectory/v1/internal/registration_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -144,4 +147,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_REGISTRATION_LOGGING_DECORATOR_H diff --git a/google/cloud/servicedirectory/v1/internal/registration_metadata_decorator.cc b/google/cloud/servicedirectory/v1/internal/registration_metadata_decorator.cc index da21c765a77df..e00a9e779828e 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_metadata_decorator.cc +++ b/google/cloud/servicedirectory/v1/internal/registration_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/servicedirectory/v1/registration_service.proto #include "google/cloud/servicedirectory/v1/internal/registration_metadata_decorator.h" +#include "google/cloud/servicedirectory/v1/registration_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 servicedirectory_v1_internal { @@ -245,3 +249,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicedirectory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicedirectory/v1/internal/registration_metadata_decorator.h b/google/cloud/servicedirectory/v1/internal/registration_metadata_decorator.h index d173c4bd5fb64..bfae4a0b8f9c0 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_metadata_decorator.h +++ b/google/cloud/servicedirectory/v1/internal/registration_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -150,4 +153,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_REGISTRATION_METADATA_DECORATOR_H diff --git a/google/cloud/servicedirectory/v1/internal/registration_option_defaults.cc b/google/cloud/servicedirectory/v1/internal/registration_option_defaults.cc index 4b382dd8f7844..5ac3a39358366 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_option_defaults.cc +++ b/google/cloud/servicedirectory/v1/internal/registration_option_defaults.cc @@ -43,7 +43,7 @@ Options RegistrationServiceDefaultOptions(Options options) { .has()) { options.set( servicedirectory_v1::RegistrationServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/servicedirectory/v1/internal/registration_stub.cc b/google/cloud/servicedirectory/v1/internal/registration_stub.cc index f8457526979ef..8200090d9eb25 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_stub.cc +++ b/google/cloud/servicedirectory/v1/internal/registration_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/servicedirectory/v1/registration_service.proto #include "google/cloud/servicedirectory/v1/internal/registration_stub.h" +#include "google/cloud/servicedirectory/v1/registration_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -272,3 +275,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicedirectory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicedirectory/v1/internal/registration_stub.h b/google/cloud/servicedirectory/v1/internal/registration_stub.h index 1c8d79aa32041..95b718cebc57a 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_stub.h +++ b/google/cloud/servicedirectory/v1/internal/registration_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_REGISTRATION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_REGISTRATION_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/servicedirectory/v1/registration_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -259,4 +262,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_REGISTRATION_STUB_H diff --git a/google/cloud/servicedirectory/v1/internal/registration_stub_factory.cc b/google/cloud/servicedirectory/v1/internal/registration_stub_factory.cc index ed9032d70407c..4ecc7c7ac42ef 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_stub_factory.cc +++ b/google/cloud/servicedirectory/v1/internal/registration_stub_factory.cc @@ -17,22 +17,25 @@ // source: google/cloud/servicedirectory/v1/registration_service.proto #include "google/cloud/servicedirectory/v1/internal/registration_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/servicedirectory/v1/internal/registration_auth_decorator.h" #include "google/cloud/servicedirectory/v1/internal/registration_logging_decorator.h" #include "google/cloud/servicedirectory/v1/internal/registration_metadata_decorator.h" #include "google/cloud/servicedirectory/v1/internal/registration_stub.h" #include "google/cloud/servicedirectory/v1/internal/registration_tracing_stub.h" +#include "google/cloud/servicedirectory/v1/registration_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 -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicedirectory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicedirectory/v1/internal/registration_stub_factory.h b/google/cloud/servicedirectory/v1/internal/registration_stub_factory.h index 823d898306246..2775010661817 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_stub_factory.h +++ b/google/cloud/servicedirectory/v1/internal/registration_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_REGISTRATION_STUB_FACTORY_H diff --git a/google/cloud/servicedirectory/v1/internal/registration_tracing_connection.cc b/google/cloud/servicedirectory/v1/internal/registration_tracing_connection.cc index 5e5d8da1e8ae8..f07f63974c560 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_tracing_connection.cc +++ b/google/cloud/servicedirectory/v1/internal/registration_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace servicedirectory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegistrationServiceTracingConnection::RegistrationServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -224,17 +222,13 @@ RegistrationServiceTracingConnection::GetLocation( return internal::EndSpan(*span, child_->GetLocation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegistrationServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/servicedirectory/v1/internal/registration_tracing_connection.h b/google/cloud/servicedirectory/v1/internal/registration_tracing_connection.h index 96777e2ef8dbf..d06a82d99ffb7 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_tracing_connection.h +++ b/google/cloud/servicedirectory/v1/internal/registration_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace servicedirectory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegistrationServiceTracingConnection : public servicedirectory_v1::RegistrationServiceConnection { public: @@ -120,8 +118,6 @@ class RegistrationServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/servicedirectory/v1/internal/registration_tracing_stub.cc b/google/cloud/servicedirectory/v1/internal/registration_tracing_stub.cc index d7009eab91e0f..0491bfd4e70f1 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_tracing_stub.cc +++ b/google/cloud/servicedirectory/v1/internal/registration_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - RegistrationServiceTracingStub::RegistrationServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -274,18 +275,14 @@ RegistrationServiceTracingStub::GetLocation( child_->GetLocation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeRegistrationServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicedirectory_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicedirectory/v1/internal/registration_tracing_stub.h b/google/cloud/servicedirectory/v1/internal/registration_tracing_stub.h index 11b373a2493d2..7abd8e371d72f 100644 --- a/google/cloud/servicedirectory/v1/internal/registration_tracing_stub.h +++ b/google/cloud/servicedirectory/v1/internal/registration_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicedirectory_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class RegistrationServiceTracingStub : public RegistrationServiceStub { public: ~RegistrationServiceTracingStub() override = default; @@ -141,8 +142,6 @@ class RegistrationServiceTracingStub : public RegistrationServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -157,4 +156,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_INTERNAL_REGISTRATION_TRACING_STUB_H diff --git a/google/cloud/servicedirectory/v1/lookup_connection.h b/google/cloud/servicedirectory/v1/lookup_connection.h index 969748a503959..61a3ca8d6810f 100644 --- a/google/cloud/servicedirectory/v1/lookup_connection.h +++ b/google/cloud/servicedirectory/v1/lookup_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/servicedirectory/v1/internal/lookup_retry_traits.h" #include "google/cloud/servicedirectory/v1/lookup_connection_idempotency_policy.h" +#include "google/cloud/servicedirectory/v1/lookup_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 #include namespace google { diff --git a/google/cloud/servicedirectory/v1/lookup_connection_idempotency_policy.h b/google/cloud/servicedirectory/v1/lookup_connection_idempotency_policy.h index ad5130c57d640..4d17ed48be641 100644 --- a/google/cloud/servicedirectory/v1/lookup_connection_idempotency_policy.h +++ b/google/cloud/servicedirectory/v1/lookup_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_LOOKUP_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_LOOKUP_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/servicedirectory/v1/lookup_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/servicedirectory/v1/registration_connection.h b/google/cloud/servicedirectory/v1/registration_connection.h index b2e3f416ec8ed..9c4a3e5f64d9d 100644 --- a/google/cloud/servicedirectory/v1/registration_connection.h +++ b/google/cloud/servicedirectory/v1/registration_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/servicedirectory/v1/internal/registration_retry_traits.h" #include "google/cloud/servicedirectory/v1/registration_connection_idempotency_policy.h" +#include "google/cloud/servicedirectory/v1/registration_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 #include namespace google { diff --git a/google/cloud/servicedirectory/v1/registration_connection_idempotency_policy.h b/google/cloud/servicedirectory/v1/registration_connection_idempotency_policy.h index 0697b4ce310e0..464185582bf70 100644 --- a/google/cloud/servicedirectory/v1/registration_connection_idempotency_policy.h +++ b/google/cloud/servicedirectory/v1/registration_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_REGISTRATION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEDIRECTORY_V1_REGISTRATION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/servicedirectory/v1/registration_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/servicehealth/BUILD.bazel b/google/cloud/servicehealth/BUILD.bazel index aa1ac8cf6011b..632a15c056b59 100644 --- a/google/cloud/servicehealth/BUILD.bazel +++ b/google/cloud/servicehealth/BUILD.bazel @@ -21,8 +21,8 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/servicehealth/logging/v1:logging_cc_grpc", - "@com_google_googleapis//google/cloud/servicehealth/v1:servicehealth_cc_grpc", + "@googleapis//google/cloud/servicehealth/logging/v1:logging_cc_grpc", + "@googleapis//google/cloud/servicehealth/v1:servicehealth_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/servicehealth/quickstart/.bazelrc b/google/cloud/servicehealth/quickstart/.bazelrc index 15d5c055db074..343e7f623d628 100644 --- a/google/cloud/servicehealth/quickstart/.bazelrc +++ b/google/cloud/servicehealth/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/servicehealth/quickstart/CMakeLists.txt index 28bac4a9d41c1..5c114d9a2a029 100644 --- a/google/cloud/servicehealth/quickstart/CMakeLists.txt +++ b/google/cloud/servicehealth/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Service Health API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-servicehealth-quickstart CXX) find_package(google_cloud_cpp_servicehealth REQUIRED) diff --git a/google/cloud/servicehealth/quickstart/WORKSPACE.bazel b/google/cloud/servicehealth/quickstart/WORKSPACE.bazel index c246f8391c606..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 = "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/servicehealth/v1/internal/service_health_auth_decorator.cc b/google/cloud/servicehealth/v1/internal/service_health_auth_decorator.cc index dc7e7ae4c0ee8..2652fa53a52b6 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_auth_decorator.cc +++ b/google/cloud/servicehealth/v1/internal/service_health_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/servicehealth/v1/event_service.proto #include "google/cloud/servicehealth/v1/internal/service_health_auth_decorator.h" -#include +#include "google/cloud/servicehealth/v1/event_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicehealth_v1_internal { @@ -109,3 +112,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicehealth_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicehealth/v1/internal/service_health_auth_decorator.h b/google/cloud/servicehealth/v1/internal/service_health_auth_decorator.h index d335fcfbd1595..0c54a8c4d47bb 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_auth_decorator.h +++ b/google/cloud/servicehealth/v1/internal/service_health_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicehealth_v1_internal { @@ -90,4 +93,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEHEALTH_V1_INTERNAL_SERVICE_HEALTH_AUTH_DECORATOR_H diff --git a/google/cloud/servicehealth/v1/internal/service_health_logging_decorator.cc b/google/cloud/servicehealth/v1/internal/service_health_logging_decorator.cc index e2c7c208fc26d..ee64e0d8adc7e 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_logging_decorator.cc +++ b/google/cloud/servicehealth/v1/internal/service_health_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/servicehealth/v1/event_service.proto #include "google/cloud/servicehealth/v1/internal/service_health_logging_decorator.h" +#include "google/cloud/servicehealth/v1/event_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicehealth_v1_internal { @@ -146,3 +149,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicehealth_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicehealth/v1/internal/service_health_logging_decorator.h b/google/cloud/servicehealth/v1/internal/service_health_logging_decorator.h index 3e16bc80de835..307d22bf70909 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_logging_decorator.h +++ b/google/cloud/servicehealth/v1/internal/service_health_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicehealth_v1_internal { @@ -90,4 +93,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEHEALTH_V1_INTERNAL_SERVICE_HEALTH_LOGGING_DECORATOR_H diff --git a/google/cloud/servicehealth/v1/internal/service_health_metadata_decorator.cc b/google/cloud/servicehealth/v1/internal/service_health_metadata_decorator.cc index 61f5e1ca8a421..4bdef8947c8c4 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_metadata_decorator.cc +++ b/google/cloud/servicehealth/v1/internal/service_health_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/servicehealth/v1/event_service.proto #include "google/cloud/servicehealth/v1/internal/service_health_metadata_decorator.h" +#include "google/cloud/servicehealth/v1/event_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 servicehealth_v1_internal { @@ -136,3 +140,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicehealth_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicehealth/v1/internal/service_health_metadata_decorator.h b/google/cloud/servicehealth/v1/internal/service_health_metadata_decorator.h index fce7cbdc2fd2e..1e109c36ce121 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_metadata_decorator.h +++ b/google/cloud/servicehealth/v1/internal/service_health_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicehealth_v1_internal { @@ -95,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEHEALTH_V1_INTERNAL_SERVICE_HEALTH_METADATA_DECORATOR_H diff --git a/google/cloud/servicehealth/v1/internal/service_health_option_defaults.cc b/google/cloud/servicehealth/v1/internal/service_health_option_defaults.cc index 93d42aa0eeda9..b9b5ec802e773 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_option_defaults.cc +++ b/google/cloud/servicehealth/v1/internal/service_health_option_defaults.cc @@ -42,7 +42,7 @@ Options ServiceHealthDefaultOptions(Options options) { if (!options.has()) { options.set( servicehealth_v1::ServiceHealthLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/servicehealth/v1/internal/service_health_stub.cc b/google/cloud/servicehealth/v1/internal/service_health_stub.cc index 4783f0eecb6a5..10619607faf67 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_stub.cc +++ b/google/cloud/servicehealth/v1/internal/service_health_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/servicehealth/v1/event_service.proto #include "google/cloud/servicehealth/v1/internal/service_health_stub.h" +#include "google/cloud/servicehealth/v1/event_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicehealth_v1_internal { @@ -136,3 +139,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicehealth_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicehealth/v1/internal/service_health_stub.h b/google/cloud/servicehealth/v1/internal/service_health_stub.h index 734ae5dd6c3c6..3e94b75e17cb0 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_stub.h +++ b/google/cloud/servicehealth/v1/internal/service_health_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEHEALTH_V1_INTERNAL_SERVICE_HEALTH_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEHEALTH_V1_INTERNAL_SERVICE_HEALTH_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/servicehealth/v1/event_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicehealth_v1_internal { @@ -147,4 +150,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEHEALTH_V1_INTERNAL_SERVICE_HEALTH_STUB_H diff --git a/google/cloud/servicehealth/v1/internal/service_health_stub_factory.cc b/google/cloud/servicehealth/v1/internal/service_health_stub_factory.cc index 114a9226b78f0..0f061c94c3e3e 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_stub_factory.cc +++ b/google/cloud/servicehealth/v1/internal/service_health_stub_factory.cc @@ -17,6 +17,8 @@ // source: google/cloud/servicehealth/v1/event_service.proto #include "google/cloud/servicehealth/v1/internal/service_health_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/servicehealth/v1/event_service.grpc.pb.h" #include "google/cloud/servicehealth/v1/internal/service_health_auth_decorator.h" #include "google/cloud/servicehealth/v1/internal/service_health_logging_decorator.h" #include "google/cloud/servicehealth/v1/internal/service_health_metadata_decorator.h" @@ -28,11 +30,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicehealth_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicehealth_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicehealth/v1/internal/service_health_stub_factory.h b/google/cloud/servicehealth/v1/internal/service_health_stub_factory.h index d8f02d710ceb8..0c0576965deb4 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_stub_factory.h +++ b/google/cloud/servicehealth/v1/internal/service_health_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicehealth_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEHEALTH_V1_INTERNAL_SERVICE_HEALTH_STUB_FACTORY_H diff --git a/google/cloud/servicehealth/v1/internal/service_health_tracing_connection.cc b/google/cloud/servicehealth/v1/internal/service_health_tracing_connection.cc index 16e0d84caa8cc..5f8e6d3aebcea 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_tracing_connection.cc +++ b/google/cloud/servicehealth/v1/internal/service_health_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace servicehealth_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServiceHealthTracingConnection::ServiceHealthTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -117,16 +115,12 @@ ServiceHealthTracingConnection::GetLocation( return internal::EndSpan(*span, child_->GetLocation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServiceHealthTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/servicehealth/v1/internal/service_health_tracing_connection.h b/google/cloud/servicehealth/v1/internal/service_health_tracing_connection.h index b8c1d0466d901..3780912dbf700 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_tracing_connection.h +++ b/google/cloud/servicehealth/v1/internal/service_health_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace servicehealth_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServiceHealthTracingConnection : public servicehealth_v1::ServiceHealthConnection { public: @@ -77,8 +75,6 @@ class ServiceHealthTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/servicehealth/v1/internal/service_health_tracing_stub.cc b/google/cloud/servicehealth/v1/internal/service_health_tracing_stub.cc index 224dace0ccbad..08d374326ccb1 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_tracing_stub.cc +++ b/google/cloud/servicehealth/v1/internal/service_health_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicehealth_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServiceHealthTracingStub::ServiceHealthTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -134,18 +135,14 @@ ServiceHealthTracingStub::GetLocation( child_->GetLocation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServiceHealthTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicehealth_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicehealth/v1/internal/service_health_tracing_stub.h b/google/cloud/servicehealth/v1/internal/service_health_tracing_stub.h index 80b4bddbfc86c..0ba66197ea8a8 100644 --- a/google/cloud/servicehealth/v1/internal/service_health_tracing_stub.h +++ b/google/cloud/servicehealth/v1/internal/service_health_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicehealth_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServiceHealthTracingStub : public ServiceHealthStub { public: ~ServiceHealthTracingStub() override = default; @@ -86,8 +87,6 @@ class ServiceHealthTracingStub : public ServiceHealthStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -102,4 +101,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEHEALTH_V1_INTERNAL_SERVICE_HEALTH_TRACING_STUB_H diff --git a/google/cloud/servicehealth/v1/service_health_connection.h b/google/cloud/servicehealth/v1/service_health_connection.h index 6a3ac93de78de..8a00cdde01509 100644 --- a/google/cloud/servicehealth/v1/service_health_connection.h +++ b/google/cloud/servicehealth/v1/service_health_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEHEALTH_V1_SERVICE_HEALTH_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEHEALTH_V1_SERVICE_HEALTH_CONNECTION_H +#include "google/cloud/servicehealth/v1/event_service.pb.h" #include "google/cloud/servicehealth/v1/internal/service_health_retry_traits.h" #include "google/cloud/servicehealth/v1/service_health_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/servicehealth/v1/service_health_connection_idempotency_policy.h b/google/cloud/servicehealth/v1/service_health_connection_idempotency_policy.h index eb725cf911e73..7ddd8f4b582a4 100644 --- a/google/cloud/servicehealth/v1/service_health_connection_idempotency_policy.h +++ b/google/cloud/servicehealth/v1/service_health_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEHEALTH_V1_SERVICE_HEALTH_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEHEALTH_V1_SERVICE_HEALTH_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/servicehealth/v1/event_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/servicemanagement/BUILD.bazel b/google/cloud/servicemanagement/BUILD.bazel index adaa712d116f3..1f8cdf50ec2d1 100644 --- a/google/cloud/servicemanagement/BUILD.bazel +++ b/google/cloud/servicemanagement/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/api/servicemanagement/v1:servicemanagement_cc_grpc", + "@googleapis//google/api/servicemanagement/v1:servicemanagement_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/servicemanagement/CMakeLists.txt b/google/cloud/servicemanagement/CMakeLists.txt index b90d42b4779cd..a3eb69430c3dd 100644 --- a/google/cloud/servicemanagement/CMakeLists.txt +++ b/google/cloud/servicemanagement/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(servicemanagement "Service Management API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(servicemanagement_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/servicemanagement/mocks/mock_service_manager_connection.h b/google/cloud/servicemanagement/mocks/mock_service_manager_connection.h deleted file mode 100644 index c685f4018467c..0000000000000 --- a/google/cloud/servicemanagement/mocks/mock_service_manager_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicemanagement/v1/servicemanager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_MOCKS_MOCK_SERVICE_MANAGER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_MOCKS_MOCK_SERVICE_MANAGER_CONNECTION_H - -#include "google/cloud/servicemanagement/service_manager_connection.h" -#include "google/cloud/servicemanagement/v1/mocks/mock_service_manager_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in servicemanagement_v1_mocks instead of the aliases -/// defined in this namespace. -namespace servicemanagement_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicemanagement_v1_mocks::MockServiceManagerConnection -/// directly. -using ::google::cloud::servicemanagement_v1_mocks::MockServiceManagerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicemanagement_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_MOCKS_MOCK_SERVICE_MANAGER_CONNECTION_H diff --git a/google/cloud/servicemanagement/quickstart/.bazelrc b/google/cloud/servicemanagement/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/servicemanagement/quickstart/.bazelrc +++ b/google/cloud/servicemanagement/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/servicemanagement/quickstart/CMakeLists.txt index 53b64d7a5227e..208616e369847 100644 --- a/google/cloud/servicemanagement/quickstart/CMakeLists.txt +++ b/google/cloud/servicemanagement/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Service Management API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-servicemanagement-quickstart CXX) find_package(google_cloud_cpp_servicemanagement REQUIRED) diff --git a/google/cloud/servicemanagement/quickstart/WORKSPACE.bazel b/google/cloud/servicemanagement/quickstart/WORKSPACE.bazel index 94af29718c0ab..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 = "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/servicemanagement/service_manager_client.h b/google/cloud/servicemanagement/service_manager_client.h deleted file mode 100644 index 669f79069ff45..0000000000000 --- a/google/cloud/servicemanagement/service_manager_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicemanagement/v1/servicemanager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_SERVICE_MANAGER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_SERVICE_MANAGER_CLIENT_H - -#include "google/cloud/servicemanagement/service_manager_connection.h" -#include "google/cloud/servicemanagement/v1/service_manager_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in servicemanagement_v1 instead of the aliases defined in -/// this namespace. -namespace servicemanagement { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicemanagement_v1::ServiceManagerClient directly. -using ::google::cloud::servicemanagement_v1::ServiceManagerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicemanagement -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_SERVICE_MANAGER_CLIENT_H diff --git a/google/cloud/servicemanagement/service_manager_connection.h b/google/cloud/servicemanagement/service_manager_connection.h deleted file mode 100644 index 219dcead28ad6..0000000000000 --- a/google/cloud/servicemanagement/service_manager_connection.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicemanagement/v1/servicemanager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_SERVICE_MANAGER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_SERVICE_MANAGER_CONNECTION_H - -#include "google/cloud/servicemanagement/service_manager_connection_idempotency_policy.h" -#include "google/cloud/servicemanagement/v1/service_manager_connection.h" - -namespace google { -namespace cloud { -namespace servicemanagement { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicemanagement_v1::MakeServiceManagerConnection directly. -using ::google::cloud::servicemanagement_v1::MakeServiceManagerConnection; - -/// @deprecated Use servicemanagement_v1::ServiceManagerConnection directly. -using ::google::cloud::servicemanagement_v1::ServiceManagerConnection; - -/// @deprecated Use -/// servicemanagement_v1::ServiceManagerLimitedErrorCountRetryPolicy directly. -using ::google::cloud::servicemanagement_v1:: - ServiceManagerLimitedErrorCountRetryPolicy; - -/// @deprecated Use servicemanagement_v1::ServiceManagerLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::servicemanagement_v1:: - ServiceManagerLimitedTimeRetryPolicy; - -/// @deprecated Use servicemanagement_v1::ServiceManagerRetryPolicy directly. -using ::google::cloud::servicemanagement_v1::ServiceManagerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicemanagement -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_SERVICE_MANAGER_CONNECTION_H diff --git a/google/cloud/servicemanagement/service_manager_connection_idempotency_policy.h b/google/cloud/servicemanagement/service_manager_connection_idempotency_policy.h deleted file mode 100644 index 5c412b37ad4f2..0000000000000 --- a/google/cloud/servicemanagement/service_manager_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicemanagement/v1/servicemanager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_SERVICE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_SERVICE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/servicemanagement/v1/service_manager_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace servicemanagement { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// servicemanagement_v1::MakeDefaultServiceManagerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::servicemanagement_v1:: - MakeDefaultServiceManagerConnectionIdempotencyPolicy; - -/// @deprecated Use -/// servicemanagement_v1::ServiceManagerConnectionIdempotencyPolicy directly. -using ::google::cloud::servicemanagement_v1:: - ServiceManagerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicemanagement -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_SERVICE_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/servicemanagement/service_manager_options.h b/google/cloud/servicemanagement/service_manager_options.h deleted file mode 100644 index 1e35150041d25..0000000000000 --- a/google/cloud/servicemanagement/service_manager_options.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/servicemanagement/v1/servicemanager.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_SERVICE_MANAGER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_SERVICE_MANAGER_OPTIONS_H - -#include "google/cloud/servicemanagement/service_manager_connection.h" -#include "google/cloud/servicemanagement/service_manager_connection_idempotency_policy.h" -#include "google/cloud/servicemanagement/v1/service_manager_options.h" - -namespace google { -namespace cloud { -namespace servicemanagement { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use servicemanagement_v1::ServiceManagerPollingPolicyOption -/// directly. -using ::google::cloud::servicemanagement_v1::ServiceManagerPollingPolicyOption; - -/// @deprecated Use servicemanagement_v1::ServiceManagerBackoffPolicyOption -/// directly. -using ::google::cloud::servicemanagement_v1::ServiceManagerBackoffPolicyOption; - -/// @deprecated Use -/// servicemanagement_v1::ServiceManagerConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::servicemanagement_v1:: - ServiceManagerConnectionIdempotencyPolicyOption; - -/// @deprecated Use servicemanagement_v1::ServiceManagerPolicyOptionList -/// directly. -using ::google::cloud::servicemanagement_v1::ServiceManagerPolicyOptionList; - -/// @deprecated Use servicemanagement_v1::ServiceManagerRetryPolicyOption -/// directly. -using ::google::cloud::servicemanagement_v1::ServiceManagerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace servicemanagement -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_SERVICE_MANAGER_OPTIONS_H diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_auth_decorator.cc b/google/cloud/servicemanagement/v1/internal/service_manager_auth_decorator.cc index 6afa8cf09e1f6..ef2e3858f19a2 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_auth_decorator.cc +++ b/google/cloud/servicemanagement/v1/internal/service_manager_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/api/servicemanagement/v1/servicemanager.proto #include "google/cloud/servicemanagement/v1/internal/service_manager_auth_decorator.h" -#include +#include "google/api/servicemanagement/v1/servicemanager.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicemanagement_v1_internal { @@ -326,3 +329,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicemanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_auth_decorator.h b/google/cloud/servicemanagement/v1/internal/service_manager_auth_decorator.h index 542f697b2ee82..20dd99dab2447 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_auth_decorator.h +++ b/google/cloud/servicemanagement/v1/internal/service_manager_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/servicemanagement/v1/internal/service_manager_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 servicemanagement_v1_internal { @@ -180,4 +183,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_V1_INTERNAL_SERVICE_MANAGER_AUTH_DECORATOR_H diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_connection_impl.h b/google/cloud/servicemanagement/v1/internal/service_manager_connection_impl.h index 0bc6e894a8fb0..793db61363e76 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_connection_impl.h +++ b/google/cloud/servicemanagement/v1/internal/service_manager_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_logging_decorator.cc b/google/cloud/servicemanagement/v1/internal/service_manager_logging_decorator.cc index 1f93d7baefdee..6dbbbb1b1bf31 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_logging_decorator.cc +++ b/google/cloud/servicemanagement/v1/internal/service_manager_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/servicemanagement/v1/internal/service_manager_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/api/servicemanagement/v1/servicemanager.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicemanagement_v1_internal { @@ -397,3 +400,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicemanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_logging_decorator.h b/google/cloud/servicemanagement/v1/internal/service_manager_logging_decorator.h index 0d7b9982ae8ba..16328967f334a 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_logging_decorator.h +++ b/google/cloud/servicemanagement/v1/internal/service_manager_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/servicemanagement/v1/internal/service_manager_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 servicemanagement_v1_internal { @@ -180,4 +183,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_V1_INTERNAL_SERVICE_MANAGER_LOGGING_DECORATOR_H diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_metadata_decorator.cc b/google/cloud/servicemanagement/v1/internal/service_manager_metadata_decorator.cc index 5aa72efcbd0da..3c9b470ca6618 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_metadata_decorator.cc +++ b/google/cloud/servicemanagement/v1/internal/service_manager_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/servicemanagement/v1/internal/service_manager_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/api/servicemanagement/v1/servicemanager.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicemanagement_v1_internal { @@ -316,3 +320,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicemanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_metadata_decorator.h b/google/cloud/servicemanagement/v1/internal/service_manager_metadata_decorator.h index 389ff63765554..f33a8b502ad16 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_metadata_decorator.h +++ b/google/cloud/servicemanagement/v1/internal/service_manager_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/servicemanagement/v1/internal/service_manager_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 servicemanagement_v1_internal { @@ -185,4 +188,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_V1_INTERNAL_SERVICE_MANAGER_METADATA_DECORATOR_H diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_option_defaults.cc b/google/cloud/servicemanagement/v1/internal/service_manager_option_defaults.cc index 40e6194bab7c5..56789cd620db8 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_option_defaults.cc +++ b/google/cloud/servicemanagement/v1/internal/service_manager_option_defaults.cc @@ -42,7 +42,7 @@ Options ServiceManagerDefaultOptions(Options options) { if (!options.has()) { options.set( servicemanagement_v1::ServiceManagerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_stub.cc b/google/cloud/servicemanagement/v1/internal/service_manager_stub.cc index 6504c930dfd4e..aefba9412e2cf 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_stub.cc +++ b/google/cloud/servicemanagement/v1/internal/service_manager_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/servicemanagement/v1/internal/service_manager_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/api/servicemanagement/v1/servicemanager.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 servicemanagement_v1_internal { @@ -382,3 +385,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicemanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_stub.h b/google/cloud/servicemanagement/v1/internal/service_manager_stub.h index 6d07b37103b53..0db5fecbb92c7 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_stub.h +++ b/google/cloud/servicemanagement/v1/internal/service_manager_stub.h @@ -24,12 +24,15 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/api/servicemanagement/v1/servicemanager.grpc.pb.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 servicemanagement_v1_internal { @@ -336,4 +339,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_V1_INTERNAL_SERVICE_MANAGER_STUB_H diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_stub_factory.cc b/google/cloud/servicemanagement/v1/internal/service_manager_stub_factory.cc index 4e9cae2222a10..89b90af98d5ad 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_stub_factory.cc +++ b/google/cloud/servicemanagement/v1/internal/service_manager_stub_factory.cc @@ -28,12 +28,15 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include +#include "google/api/servicemanagement/v1/servicemanager.grpc.pb.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 servicemanagement_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicemanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_stub_factory.h b/google/cloud/servicemanagement/v1/internal/service_manager_stub_factory.h index d14f0911bffe5..4ed2b722ab398 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_stub_factory.h +++ b/google/cloud/servicemanagement/v1/internal/service_manager_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicemanagement_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_V1_INTERNAL_SERVICE_MANAGER_STUB_FACTORY_H diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_tracing_connection.cc b/google/cloud/servicemanagement/v1/internal/service_manager_tracing_connection.cc index 78f6e7dbf31dd..78dbe9ff946bd 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_tracing_connection.cc +++ b/google/cloud/servicemanagement/v1/internal/service_manager_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace servicemanagement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServiceManagerTracingConnection::ServiceManagerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -304,16 +302,12 @@ ServiceManagerTracingConnection::ListOperations( std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServiceManagerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_tracing_connection.h b/google/cloud/servicemanagement/v1/internal/service_manager_tracing_connection.h index 8917a041898a5..a87800590f365 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_tracing_connection.h +++ b/google/cloud/servicemanagement/v1/internal/service_manager_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace servicemanagement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServiceManagerTracingConnection : public servicemanagement_v1::ServiceManagerConnection { public: @@ -154,8 +152,6 @@ class ServiceManagerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_tracing_stub.cc b/google/cloud/servicemanagement/v1/internal/service_manager_tracing_stub.cc index ba441f08574e6..ba4f3a7164b4f 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_tracing_stub.cc +++ b/google/cloud/servicemanagement/v1/internal/service_manager_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicemanagement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServiceManagerTracingStub::ServiceManagerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -343,18 +344,14 @@ future ServiceManagerTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServiceManagerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace servicemanagement_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/servicemanagement/v1/internal/service_manager_tracing_stub.h b/google/cloud/servicemanagement/v1/internal/service_manager_tracing_stub.h index a8c37bbc0af6c..6a2c33c1382fc 100644 --- a/google/cloud/servicemanagement/v1/internal/service_manager_tracing_stub.h +++ b/google/cloud/servicemanagement/v1/internal/service_manager_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace servicemanagement_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServiceManagerTracingStub : public ServiceManagerStub { public: ~ServiceManagerTracingStub() override = default; @@ -175,8 +176,6 @@ class ServiceManagerTracingStub : public ServiceManagerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -191,4 +190,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEMANAGEMENT_V1_INTERNAL_SERVICE_MANAGER_TRACING_STUB_H diff --git a/google/cloud/servicemanagement/v1/service_manager_client.h b/google/cloud/servicemanagement/v1/service_manager_client.h index 610180f30c8f3..c6d315225a18f 100644 --- a/google/cloud/servicemanagement/v1/service_manager_client.h +++ b/google/cloud/servicemanagement/v1/service_manager_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/servicemanagement/v1/service_manager_connection.h b/google/cloud/servicemanagement/v1/service_manager_connection.h index 6730c69f11cda..6f6e1f8139ed9 100644 --- a/google/cloud/servicemanagement/v1/service_manager_connection.h +++ b/google/cloud/servicemanagement/v1/service_manager_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/api/servicemanagement/v1/servicemanager.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/servicemanagement/v1/service_manager_connection_idempotency_policy.h b/google/cloud/servicemanagement/v1/service_manager_connection_idempotency_policy.h index 336837dc80807..187de47221a8c 100644 --- a/google/cloud/servicemanagement/v1/service_manager_connection_idempotency_policy.h +++ b/google/cloud/servicemanagement/v1/service_manager_connection_idempotency_policy.h @@ -21,9 +21,9 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/api/servicemanagement/v1/servicemanager.grpc.pb.h" +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/serviceusage/BUILD.bazel b/google/cloud/serviceusage/BUILD.bazel index 5c3a1505e99e0..2b6c4d93e0452 100644 --- a/google/cloud/serviceusage/BUILD.bazel +++ b/google/cloud/serviceusage/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/api/serviceusage/v1:serviceusage_cc_grpc", + "@googleapis//google/api/serviceusage/v1:serviceusage_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/serviceusage/CMakeLists.txt b/google/cloud/serviceusage/CMakeLists.txt index 3a3279574c25f..61a5e8ff9f12f 100644 --- a/google/cloud/serviceusage/CMakeLists.txt +++ b/google/cloud/serviceusage/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(serviceusage "Service Usage API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(serviceusage_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/serviceusage/mocks/mock_service_usage_connection.h b/google/cloud/serviceusage/mocks/mock_service_usage_connection.h deleted file mode 100644 index 80c811733a678..0000000000000 --- a/google/cloud/serviceusage/mocks/mock_service_usage_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/serviceusage/v1/serviceusage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_MOCKS_MOCK_SERVICE_USAGE_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_MOCKS_MOCK_SERVICE_USAGE_CONNECTION_H - -#include "google/cloud/serviceusage/service_usage_connection.h" -#include "google/cloud/serviceusage/v1/mocks/mock_service_usage_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in serviceusage_v1_mocks instead of the aliases -/// defined in this namespace. -namespace serviceusage_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use serviceusage_v1_mocks::MockServiceUsageConnection directly. -using ::google::cloud::serviceusage_v1_mocks::MockServiceUsageConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace serviceusage_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_MOCKS_MOCK_SERVICE_USAGE_CONNECTION_H diff --git a/google/cloud/serviceusage/quickstart/.bazelrc b/google/cloud/serviceusage/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/serviceusage/quickstart/.bazelrc +++ b/google/cloud/serviceusage/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/serviceusage/quickstart/CMakeLists.txt index 0528474e1d8d3..5709906c42f89 100644 --- a/google/cloud/serviceusage/quickstart/CMakeLists.txt +++ b/google/cloud/serviceusage/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Service Usage API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-serviceusage-quickstart CXX) find_package(google_cloud_cpp_serviceusage REQUIRED) diff --git a/google/cloud/serviceusage/quickstart/WORKSPACE.bazel b/google/cloud/serviceusage/quickstart/WORKSPACE.bazel index d6a8739667d89..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 = "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/serviceusage/service_usage_client.h b/google/cloud/serviceusage/service_usage_client.h deleted file mode 100644 index 906b150bef6d6..0000000000000 --- a/google/cloud/serviceusage/service_usage_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/serviceusage/v1/serviceusage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_SERVICE_USAGE_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_SERVICE_USAGE_CLIENT_H - -#include "google/cloud/serviceusage/service_usage_connection.h" -#include "google/cloud/serviceusage/v1/service_usage_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in serviceusage_v1 instead of the aliases defined in -/// this namespace. -namespace serviceusage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use serviceusage_v1::ServiceUsageClient directly. -using ::google::cloud::serviceusage_v1::ServiceUsageClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace serviceusage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_SERVICE_USAGE_CLIENT_H diff --git a/google/cloud/serviceusage/service_usage_connection.h b/google/cloud/serviceusage/service_usage_connection.h deleted file mode 100644 index 77ad5fed3e003..0000000000000 --- a/google/cloud/serviceusage/service_usage_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/serviceusage/v1/serviceusage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_SERVICE_USAGE_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_SERVICE_USAGE_CONNECTION_H - -#include "google/cloud/serviceusage/service_usage_connection_idempotency_policy.h" -#include "google/cloud/serviceusage/v1/service_usage_connection.h" - -namespace google { -namespace cloud { -namespace serviceusage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use serviceusage_v1::MakeServiceUsageConnection directly. -using ::google::cloud::serviceusage_v1::MakeServiceUsageConnection; - -/// @deprecated Use serviceusage_v1::ServiceUsageConnection directly. -using ::google::cloud::serviceusage_v1::ServiceUsageConnection; - -/// @deprecated Use serviceusage_v1::ServiceUsageLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::serviceusage_v1:: - ServiceUsageLimitedErrorCountRetryPolicy; - -/// @deprecated Use serviceusage_v1::ServiceUsageLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::serviceusage_v1::ServiceUsageLimitedTimeRetryPolicy; - -/// @deprecated Use serviceusage_v1::ServiceUsageRetryPolicy directly. -using ::google::cloud::serviceusage_v1::ServiceUsageRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace serviceusage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_SERVICE_USAGE_CONNECTION_H diff --git a/google/cloud/serviceusage/service_usage_connection_idempotency_policy.h b/google/cloud/serviceusage/service_usage_connection_idempotency_policy.h deleted file mode 100644 index fcd7db1f68abf..0000000000000 --- a/google/cloud/serviceusage/service_usage_connection_idempotency_policy.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/serviceusage/v1/serviceusage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_SERVICE_USAGE_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_SERVICE_USAGE_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/serviceusage/v1/service_usage_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace serviceusage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// serviceusage_v1::MakeDefaultServiceUsageConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::serviceusage_v1:: - MakeDefaultServiceUsageConnectionIdempotencyPolicy; - -/// @deprecated Use serviceusage_v1::ServiceUsageConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::serviceusage_v1::ServiceUsageConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace serviceusage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_SERVICE_USAGE_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/serviceusage/service_usage_options.h b/google/cloud/serviceusage/service_usage_options.h deleted file mode 100644 index 4734efbfae2cf..0000000000000 --- a/google/cloud/serviceusage/service_usage_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/api/serviceusage/v1/serviceusage.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_SERVICE_USAGE_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_SERVICE_USAGE_OPTIONS_H - -#include "google/cloud/serviceusage/service_usage_connection.h" -#include "google/cloud/serviceusage/service_usage_connection_idempotency_policy.h" -#include "google/cloud/serviceusage/v1/service_usage_options.h" - -namespace google { -namespace cloud { -namespace serviceusage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use serviceusage_v1::ServiceUsagePollingPolicyOption directly. -using ::google::cloud::serviceusage_v1::ServiceUsagePollingPolicyOption; - -/// @deprecated Use serviceusage_v1::ServiceUsageBackoffPolicyOption directly. -using ::google::cloud::serviceusage_v1::ServiceUsageBackoffPolicyOption; - -/// @deprecated Use -/// serviceusage_v1::ServiceUsageConnectionIdempotencyPolicyOption directly. -using ::google::cloud::serviceusage_v1:: - ServiceUsageConnectionIdempotencyPolicyOption; - -/// @deprecated Use serviceusage_v1::ServiceUsagePolicyOptionList directly. -using ::google::cloud::serviceusage_v1::ServiceUsagePolicyOptionList; - -/// @deprecated Use serviceusage_v1::ServiceUsageRetryPolicyOption directly. -using ::google::cloud::serviceusage_v1::ServiceUsageRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace serviceusage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_SERVICE_USAGE_OPTIONS_H diff --git a/google/cloud/serviceusage/v1/internal/service_usage_auth_decorator.cc b/google/cloud/serviceusage/v1/internal/service_usage_auth_decorator.cc index 0a4032ac9d768..825f7f1340e8e 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_auth_decorator.cc +++ b/google/cloud/serviceusage/v1/internal/service_usage_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/api/serviceusage/v1/serviceusage.proto #include "google/cloud/serviceusage/v1/internal/service_usage_auth_decorator.h" -#include +#include "google/api/serviceusage/v1/serviceusage.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace serviceusage_v1_internal { @@ -198,3 +201,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace serviceusage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/serviceusage/v1/internal/service_usage_auth_decorator.h b/google/cloud/serviceusage/v1/internal/service_usage_auth_decorator.h index 4f78fafbe0653..3057eb92c399d 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_auth_decorator.h +++ b/google/cloud/serviceusage/v1/internal/service_usage_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/serviceusage/v1/internal/service_usage_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 serviceusage_v1_internal { @@ -119,4 +122,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_V1_INTERNAL_SERVICE_USAGE_AUTH_DECORATOR_H diff --git a/google/cloud/serviceusage/v1/internal/service_usage_connection_impl.h b/google/cloud/serviceusage/v1/internal/service_usage_connection_impl.h index b3f0b3f595e59..160ba1e2a6b83 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_connection_impl.h +++ b/google/cloud/serviceusage/v1/internal/service_usage_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/serviceusage/v1/internal/service_usage_logging_decorator.cc b/google/cloud/serviceusage/v1/internal/service_usage_logging_decorator.cc index 6fe5a02501ba5..d788a5238a95a 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_logging_decorator.cc +++ b/google/cloud/serviceusage/v1/internal/service_usage_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/serviceusage/v1/internal/service_usage_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/api/serviceusage/v1/serviceusage.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace serviceusage_v1_internal { @@ -229,3 +232,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace serviceusage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/serviceusage/v1/internal/service_usage_logging_decorator.h b/google/cloud/serviceusage/v1/internal/service_usage_logging_decorator.h index 3150b4a3548c9..3ed65b1464f33 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_logging_decorator.h +++ b/google/cloud/serviceusage/v1/internal/service_usage_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/serviceusage/v1/internal/service_usage_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 serviceusage_v1_internal { @@ -119,4 +122,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_V1_INTERNAL_SERVICE_USAGE_LOGGING_DECORATOR_H diff --git a/google/cloud/serviceusage/v1/internal/service_usage_metadata_decorator.cc b/google/cloud/serviceusage/v1/internal/service_usage_metadata_decorator.cc index b47374b8d7e36..ca370a8f7cd41 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_metadata_decorator.cc +++ b/google/cloud/serviceusage/v1/internal/service_usage_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/serviceusage/v1/internal/service_usage_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/api/serviceusage/v1/serviceusage.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace serviceusage_v1_internal { @@ -188,3 +192,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace serviceusage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/serviceusage/v1/internal/service_usage_metadata_decorator.h b/google/cloud/serviceusage/v1/internal/service_usage_metadata_decorator.h index cf920c014fbda..b7b549eee3c9f 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_metadata_decorator.h +++ b/google/cloud/serviceusage/v1/internal/service_usage_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/serviceusage/v1/internal/service_usage_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 serviceusage_v1_internal { @@ -124,4 +127,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_V1_INTERNAL_SERVICE_USAGE_METADATA_DECORATOR_H diff --git a/google/cloud/serviceusage/v1/internal/service_usage_option_defaults.cc b/google/cloud/serviceusage/v1/internal/service_usage_option_defaults.cc index 95a9ac48bfd0a..137c1b3f97ad3 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_option_defaults.cc +++ b/google/cloud/serviceusage/v1/internal/service_usage_option_defaults.cc @@ -42,7 +42,7 @@ Options ServiceUsageDefaultOptions(Options options) { if (!options.has()) { options.set( serviceusage_v1::ServiceUsageLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/serviceusage/v1/internal/service_usage_stub.cc b/google/cloud/serviceusage/v1/internal/service_usage_stub.cc index 717c825848f99..d05881efe9012 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_stub.cc +++ b/google/cloud/serviceusage/v1/internal/service_usage_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/serviceusage/v1/internal/service_usage_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/api/serviceusage/v1/serviceusage.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 serviceusage_v1_internal { @@ -224,3 +227,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace serviceusage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/serviceusage/v1/internal/service_usage_stub.h b/google/cloud/serviceusage/v1/internal/service_usage_stub.h index 48ebbc130f100..5f35142deafde 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_stub.h +++ b/google/cloud/serviceusage/v1/internal/service_usage_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/api/serviceusage/v1/serviceusage.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 serviceusage_v1_internal { @@ -199,4 +202,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_V1_INTERNAL_SERVICE_USAGE_STUB_H diff --git a/google/cloud/serviceusage/v1/internal/service_usage_stub_factory.cc b/google/cloud/serviceusage/v1/internal/service_usage_stub_factory.cc index dd5099889271f..ed0471775ceac 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_stub_factory.cc +++ b/google/cloud/serviceusage/v1/internal/service_usage_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/api/serviceusage/v1/serviceusage.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 serviceusage_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace serviceusage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/serviceusage/v1/internal/service_usage_stub_factory.h b/google/cloud/serviceusage/v1/internal/service_usage_stub_factory.h index ca2c9b5a38f88..e7b0db353dfdc 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_stub_factory.h +++ b/google/cloud/serviceusage/v1/internal/service_usage_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace serviceusage_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_V1_INTERNAL_SERVICE_USAGE_STUB_FACTORY_H diff --git a/google/cloud/serviceusage/v1/internal/service_usage_tracing_connection.cc b/google/cloud/serviceusage/v1/internal/service_usage_tracing_connection.cc index bc43e2f579aaa..e49e16b88adac 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_tracing_connection.cc +++ b/google/cloud/serviceusage/v1/internal/service_usage_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace serviceusage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServiceUsageTracingConnection::ServiceUsageTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -170,16 +168,12 @@ ServiceUsageTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServiceUsageTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/serviceusage/v1/internal/service_usage_tracing_connection.h b/google/cloud/serviceusage/v1/internal/service_usage_tracing_connection.h index a209e18e344e4..0df975c58b391 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_tracing_connection.h +++ b/google/cloud/serviceusage/v1/internal/service_usage_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace serviceusage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServiceUsageTracingConnection : public serviceusage_v1::ServiceUsageConnection { public: @@ -97,8 +95,6 @@ class ServiceUsageTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/serviceusage/v1/internal/service_usage_tracing_stub.cc b/google/cloud/serviceusage/v1/internal/service_usage_tracing_stub.cc index 349cf6f8db76c..c59364e6c964e 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_tracing_stub.cc +++ b/google/cloud/serviceusage/v1/internal/service_usage_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace serviceusage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ServiceUsageTracingStub::ServiceUsageTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -198,18 +199,14 @@ future ServiceUsageTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeServiceUsageTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace serviceusage_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/serviceusage/v1/internal/service_usage_tracing_stub.h b/google/cloud/serviceusage/v1/internal/service_usage_tracing_stub.h index 33a98ac435300..fa838e1f83d15 100644 --- a/google/cloud/serviceusage/v1/internal/service_usage_tracing_stub.h +++ b/google/cloud/serviceusage/v1/internal/service_usage_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace serviceusage_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ServiceUsageTracingStub : public ServiceUsageStub { public: ~ServiceUsageTracingStub() override = default; @@ -114,8 +115,6 @@ class ServiceUsageTracingStub : public ServiceUsageStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -130,4 +129,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SERVICEUSAGE_V1_INTERNAL_SERVICE_USAGE_TRACING_STUB_H diff --git a/google/cloud/serviceusage/v1/service_usage_client.h b/google/cloud/serviceusage/v1/service_usage_client.h index 356059d80b887..9b61116cf69d1 100644 --- a/google/cloud/serviceusage/v1/service_usage_client.h +++ b/google/cloud/serviceusage/v1/service_usage_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/serviceusage/v1/service_usage_connection.h b/google/cloud/serviceusage/v1/service_usage_connection.h index 57ac988d14c21..c993df8624b42 100644 --- a/google/cloud/serviceusage/v1/service_usage_connection.h +++ b/google/cloud/serviceusage/v1/service_usage_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/api/serviceusage/v1/serviceusage.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/serviceusage/v1/service_usage_connection_idempotency_policy.h b/google/cloud/serviceusage/v1/service_usage_connection_idempotency_policy.h index f2162f9e3302f..25c21d08d3016 100644 --- a/google/cloud/serviceusage/v1/service_usage_connection_idempotency_policy.h +++ b/google/cloud/serviceusage/v1/service_usage_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/api/serviceusage/v1/serviceusage.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/shell/BUILD.bazel b/google/cloud/shell/BUILD.bazel index 49ef335321bee..e6bbde2f1719f 100644 --- a/google/cloud/shell/BUILD.bazel +++ b/google/cloud/shell/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/shell/v1:shell_cc_grpc", + "@googleapis//google/cloud/shell/v1:shell_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/shell/CMakeLists.txt b/google/cloud/shell/CMakeLists.txt index 12d1523ba9af6..72fd1622b3b4c 100644 --- a/google/cloud/shell/CMakeLists.txt +++ b/google/cloud/shell/CMakeLists.txt @@ -16,8 +16,7 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library(shell "Cloud Shell API" - SERVICE_DIRS "__EMPTY__" "v1/") +google_cloud_cpp_add_gapic_library(shell "Cloud Shell API" SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(shell_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/shell/cloud_shell_client.h b/google/cloud/shell/cloud_shell_client.h deleted file mode 100644 index 16192011c4790..0000000000000 --- a/google/cloud/shell/cloud_shell_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/shell/v1/cloudshell.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_CLOUD_SHELL_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_CLOUD_SHELL_CLIENT_H - -#include "google/cloud/shell/cloud_shell_connection.h" -#include "google/cloud/shell/v1/cloud_shell_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in shell_v1 instead of the aliases defined in -/// this namespace. -namespace shell { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use shell_v1::CloudShellServiceClient directly. -using ::google::cloud::shell_v1::CloudShellServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace shell -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_CLOUD_SHELL_CLIENT_H diff --git a/google/cloud/shell/cloud_shell_connection.h b/google/cloud/shell/cloud_shell_connection.h deleted file mode 100644 index 26ce2041839ba..0000000000000 --- a/google/cloud/shell/cloud_shell_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/shell/v1/cloudshell.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_CLOUD_SHELL_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_CLOUD_SHELL_CONNECTION_H - -#include "google/cloud/shell/cloud_shell_connection_idempotency_policy.h" -#include "google/cloud/shell/v1/cloud_shell_connection.h" - -namespace google { -namespace cloud { -namespace shell { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use shell_v1::MakeCloudShellServiceConnection directly. -using ::google::cloud::shell_v1::MakeCloudShellServiceConnection; - -/// @deprecated Use shell_v1::CloudShellServiceConnection directly. -using ::google::cloud::shell_v1::CloudShellServiceConnection; - -/// @deprecated Use shell_v1::CloudShellServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::shell_v1::CloudShellServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use shell_v1::CloudShellServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::shell_v1::CloudShellServiceLimitedTimeRetryPolicy; - -/// @deprecated Use shell_v1::CloudShellServiceRetryPolicy directly. -using ::google::cloud::shell_v1::CloudShellServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace shell -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_CLOUD_SHELL_CONNECTION_H diff --git a/google/cloud/shell/cloud_shell_connection_idempotency_policy.h b/google/cloud/shell/cloud_shell_connection_idempotency_policy.h deleted file mode 100644 index 4393ca675c9d3..0000000000000 --- a/google/cloud/shell/cloud_shell_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/shell/v1/cloudshell.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_CLOUD_SHELL_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_CLOUD_SHELL_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/shell/v1/cloud_shell_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace shell { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// shell_v1::MakeDefaultCloudShellServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::shell_v1:: - MakeDefaultCloudShellServiceConnectionIdempotencyPolicy; - -/// @deprecated Use shell_v1::CloudShellServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::shell_v1::CloudShellServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace shell -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_CLOUD_SHELL_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/shell/cloud_shell_options.h b/google/cloud/shell/cloud_shell_options.h deleted file mode 100644 index 17a96dad8c54f..0000000000000 --- a/google/cloud/shell/cloud_shell_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/shell/v1/cloudshell.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_CLOUD_SHELL_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_CLOUD_SHELL_OPTIONS_H - -#include "google/cloud/shell/cloud_shell_connection.h" -#include "google/cloud/shell/cloud_shell_connection_idempotency_policy.h" -#include "google/cloud/shell/v1/cloud_shell_options.h" - -namespace google { -namespace cloud { -namespace shell { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use shell_v1::CloudShellServicePollingPolicyOption directly. -using ::google::cloud::shell_v1::CloudShellServicePollingPolicyOption; - -/// @deprecated Use shell_v1::CloudShellServiceBackoffPolicyOption directly. -using ::google::cloud::shell_v1::CloudShellServiceBackoffPolicyOption; - -/// @deprecated Use shell_v1::CloudShellServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::shell_v1:: - CloudShellServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use shell_v1::CloudShellServicePolicyOptionList directly. -using ::google::cloud::shell_v1::CloudShellServicePolicyOptionList; - -/// @deprecated Use shell_v1::CloudShellServiceRetryPolicyOption directly. -using ::google::cloud::shell_v1::CloudShellServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace shell -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_CLOUD_SHELL_OPTIONS_H diff --git a/google/cloud/shell/mocks/mock_cloud_shell_connection.h b/google/cloud/shell/mocks/mock_cloud_shell_connection.h deleted file mode 100644 index 7fe8f7e8d5135..0000000000000 --- a/google/cloud/shell/mocks/mock_cloud_shell_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/shell/v1/cloudshell.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_MOCKS_MOCK_CLOUD_SHELL_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_MOCKS_MOCK_CLOUD_SHELL_CONNECTION_H - -#include "google/cloud/shell/cloud_shell_connection.h" -#include "google/cloud/shell/v1/mocks/mock_cloud_shell_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in shell_v1_mocks instead of the aliases -/// defined in this namespace. -namespace shell_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use shell_v1_mocks::MockCloudShellServiceConnection directly. -using ::google::cloud::shell_v1_mocks::MockCloudShellServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace shell_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_MOCKS_MOCK_CLOUD_SHELL_CONNECTION_H diff --git a/google/cloud/shell/quickstart/.bazelrc b/google/cloud/shell/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/shell/quickstart/.bazelrc +++ b/google/cloud/shell/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/shell/quickstart/CMakeLists.txt index c4a06ff31edd8..0d7baa82ba0e5 100644 --- a/google/cloud/shell/quickstart/CMakeLists.txt +++ b/google/cloud/shell/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Shell API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-shell-quickstart CXX) find_package(google_cloud_cpp_shell REQUIRED) diff --git a/google/cloud/shell/quickstart/WORKSPACE.bazel b/google/cloud/shell/quickstart/WORKSPACE.bazel index 6628492463048..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 = "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/shell/v1/cloud_shell_client.h b/google/cloud/shell/v1/cloud_shell_client.h index 30c7dd604b081..5ff83bfb1bff5 100644 --- a/google/cloud/shell/v1/cloud_shell_client.h +++ b/google/cloud/shell/v1/cloud_shell_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/shell/v1/cloud_shell_connection.h b/google/cloud/shell/v1/cloud_shell_connection.h index aed82262ddea5..2cd391da2c49a 100644 --- a/google/cloud/shell/v1/cloud_shell_connection.h +++ b/google/cloud/shell/v1/cloud_shell_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_V1_CLOUD_SHELL_CONNECTION_H #include "google/cloud/shell/v1/cloud_shell_connection_idempotency_policy.h" +#include "google/cloud/shell/v1/cloudshell.pb.h" #include "google/cloud/shell/v1/internal/cloud_shell_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -29,8 +30,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/shell/v1/cloud_shell_connection_idempotency_policy.h b/google/cloud/shell/v1/cloud_shell_connection_idempotency_policy.h index a6b33729e2ed0..10940b4954703 100644 --- a/google/cloud/shell/v1/cloud_shell_connection_idempotency_policy.h +++ b/google/cloud/shell/v1/cloud_shell_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_V1_CLOUD_SHELL_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_V1_CLOUD_SHELL_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/shell/v1/cloudshell.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/shell/v1/internal/cloud_shell_auth_decorator.cc b/google/cloud/shell/v1/internal/cloud_shell_auth_decorator.cc index a743647351ce7..eaa47a8dae4d3 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_auth_decorator.cc +++ b/google/cloud/shell/v1/internal/cloud_shell_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/shell/v1/cloudshell.proto #include "google/cloud/shell/v1/internal/cloud_shell_auth_decorator.h" -#include +#include "google/cloud/shell/v1/cloudshell.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace shell_v1_internal { @@ -194,3 +197,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace shell_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/shell/v1/internal/cloud_shell_auth_decorator.h b/google/cloud/shell/v1/internal/cloud_shell_auth_decorator.h index 088a3df6f32ac..7f80829467c90 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_auth_decorator.h +++ b/google/cloud/shell/v1/internal/cloud_shell_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/shell/v1/internal/cloud_shell_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 shell_v1_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_V1_INTERNAL_CLOUD_SHELL_AUTH_DECORATOR_H diff --git a/google/cloud/shell/v1/internal/cloud_shell_connection_impl.h b/google/cloud/shell/v1/internal/cloud_shell_connection_impl.h index 0a49b3527da72..d5ede1ba54551 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_connection_impl.h +++ b/google/cloud/shell/v1/internal/cloud_shell_connection_impl.h @@ -31,7 +31,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/shell/v1/internal/cloud_shell_logging_decorator.cc b/google/cloud/shell/v1/internal/cloud_shell_logging_decorator.cc index 27c942031b1f5..63ac86494744e 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_logging_decorator.cc +++ b/google/cloud/shell/v1/internal/cloud_shell_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/shell/v1/cloudshell.proto #include "google/cloud/shell/v1/internal/cloud_shell_logging_decorator.h" +#include "google/cloud/shell/v1/cloudshell.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace shell_v1_internal { @@ -207,3 +210,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace shell_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/shell/v1/internal/cloud_shell_logging_decorator.h b/google/cloud/shell/v1/internal/cloud_shell_logging_decorator.h index de103279e3e28..542a7b0b2c30a 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_logging_decorator.h +++ b/google/cloud/shell/v1/internal/cloud_shell_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/shell/v1/internal/cloud_shell_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 shell_v1_internal { @@ -109,4 +112,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_V1_INTERNAL_CLOUD_SHELL_LOGGING_DECORATOR_H diff --git a/google/cloud/shell/v1/internal/cloud_shell_metadata_decorator.cc b/google/cloud/shell/v1/internal/cloud_shell_metadata_decorator.cc index 30d24903ef250..abe49092f6a2a 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_metadata_decorator.cc +++ b/google/cloud/shell/v1/internal/cloud_shell_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/shell/v1/cloudshell.proto #include "google/cloud/shell/v1/internal/cloud_shell_metadata_decorator.h" +#include "google/cloud/shell/v1/cloudshell.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 shell_v1_internal { @@ -181,3 +185,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace shell_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/shell/v1/internal/cloud_shell_metadata_decorator.h b/google/cloud/shell/v1/internal/cloud_shell_metadata_decorator.h index e9051d4aaab58..c035fd12b3586 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_metadata_decorator.h +++ b/google/cloud/shell/v1/internal/cloud_shell_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/shell/v1/internal/cloud_shell_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 shell_v1_internal { @@ -115,4 +118,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_V1_INTERNAL_CLOUD_SHELL_METADATA_DECORATOR_H diff --git a/google/cloud/shell/v1/internal/cloud_shell_option_defaults.cc b/google/cloud/shell/v1/internal/cloud_shell_option_defaults.cc index ddb27ae7b9155..3a9875aac3806 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_option_defaults.cc +++ b/google/cloud/shell/v1/internal/cloud_shell_option_defaults.cc @@ -42,7 +42,7 @@ Options CloudShellServiceDefaultOptions(Options options) { if (!options.has()) { options.set( shell_v1::CloudShellServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/shell/v1/internal/cloud_shell_stub.cc b/google/cloud/shell/v1/internal/cloud_shell_stub.cc index 8af6fc920f1b0..b0a8715da9d5a 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_stub.cc +++ b/google/cloud/shell/v1/internal/cloud_shell_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/shell/v1/cloudshell.proto #include "google/cloud/shell/v1/internal/cloud_shell_stub.h" +#include "google/cloud/shell/v1/cloudshell.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace shell_v1_internal { @@ -207,3 +210,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace shell_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/shell/v1/internal/cloud_shell_stub.h b/google/cloud/shell/v1/internal/cloud_shell_stub.h index 05af3728101cf..ff1696ff2d6cd 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_stub.h +++ b/google/cloud/shell/v1/internal/cloud_shell_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_V1_INTERNAL_CLOUD_SHELL_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_V1_INTERNAL_CLOUD_SHELL_STUB_H +#include "google/cloud/shell/v1/cloudshell.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace shell_v1_internal { @@ -180,4 +183,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_V1_INTERNAL_CLOUD_SHELL_STUB_H diff --git a/google/cloud/shell/v1/internal/cloud_shell_stub_factory.cc b/google/cloud/shell/v1/internal/cloud_shell_stub_factory.cc index 6dd87e4aa6503..991fea2f7d63c 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_stub_factory.cc +++ b/google/cloud/shell/v1/internal/cloud_shell_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/shell/v1/cloudshell.proto #include "google/cloud/shell/v1/internal/cloud_shell_stub_factory.h" +#include "google/cloud/shell/v1/cloudshell.grpc.pb.h" #include "google/cloud/shell/v1/internal/cloud_shell_auth_decorator.h" #include "google/cloud/shell/v1/internal/cloud_shell_logging_decorator.h" #include "google/cloud/shell/v1/internal/cloud_shell_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace shell_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace shell_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/shell/v1/internal/cloud_shell_stub_factory.h b/google/cloud/shell/v1/internal/cloud_shell_stub_factory.h index c1a40a66cfdf7..70ae8735bb9f1 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_stub_factory.h +++ b/google/cloud/shell/v1/internal/cloud_shell_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace shell_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_V1_INTERNAL_CLOUD_SHELL_STUB_FACTORY_H diff --git a/google/cloud/shell/v1/internal/cloud_shell_tracing_connection.cc b/google/cloud/shell/v1/internal/cloud_shell_tracing_connection.cc index 9dadcf10c557e..02ea117f21807 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_tracing_connection.cc +++ b/google/cloud/shell/v1/internal/cloud_shell_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace shell_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudShellServiceTracingConnection::CloudShellServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -158,17 +156,13 @@ CloudShellServiceTracingConnection::RemovePublicKey( return internal::EndSpan(std::move(span), child_->RemovePublicKey(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudShellServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/shell/v1/internal/cloud_shell_tracing_connection.h b/google/cloud/shell/v1/internal/cloud_shell_tracing_connection.h index 14374d7da46ca..d9cdb82c18539 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_tracing_connection.h +++ b/google/cloud/shell/v1/internal/cloud_shell_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace shell_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudShellServiceTracingConnection : public shell_v1::CloudShellServiceConnection { public: @@ -94,8 +92,6 @@ class CloudShellServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/shell/v1/internal/cloud_shell_tracing_stub.cc b/google/cloud/shell/v1/internal/cloud_shell_tracing_stub.cc index 0c8f5d3047a19..add115ea60775 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_tracing_stub.cc +++ b/google/cloud/shell/v1/internal/cloud_shell_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace shell_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudShellServiceTracingStub::CloudShellServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -179,18 +180,14 @@ future CloudShellServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudShellServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace shell_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/shell/v1/internal/cloud_shell_tracing_stub.h b/google/cloud/shell/v1/internal/cloud_shell_tracing_stub.h index d71f6e3329fac..35391136e3f2a 100644 --- a/google/cloud/shell/v1/internal/cloud_shell_tracing_stub.h +++ b/google/cloud/shell/v1/internal/cloud_shell_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace shell_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudShellServiceTracingStub : public CloudShellServiceStub { public: ~CloudShellServiceTracingStub() override = default; @@ -105,8 +106,6 @@ class CloudShellServiceTracingStub : public CloudShellServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -121,4 +120,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SHELL_V1_INTERNAL_CLOUD_SHELL_TRACING_STUB_H diff --git a/google/cloud/spanner/BUILD.bazel b/google/cloud/spanner/BUILD.bazel index 97913dd76b11d..431a4bd588b69 100644 --- a/google/cloud/spanner/BUILD.bazel +++ b/google/cloud/spanner/BUILD.bazel @@ -40,16 +40,16 @@ cc_library( deps = [ "//:common", "//:grpc_utils", - "@com_google_absl//absl/container:fixed_array", - "@com_google_absl//absl/numeric:int128", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/time", - "@com_google_googleapis//google/longrunning:longrunning_cc_grpc", - "@com_google_googleapis//google/spanner/admin/database/v1:database_cc_grpc", - "@com_google_googleapis//google/spanner/admin/instance/v1:instance_cc_grpc", - "@com_google_googleapis//google/spanner/v1:spanner_cc_grpc", + "@abseil-cpp//absl/container:fixed_array", + "@abseil-cpp//absl/numeric:int128", + "@abseil-cpp//absl/strings", + "@abseil-cpp//absl/time", + "@googleapis//google/longrunning:longrunning_cc_grpc", + "@googleapis//google/spanner/admin/database/v1:database_cc_grpc", + "@googleapis//google/spanner/admin/instance/v1:instance_cc_grpc", + "@googleapis//google/spanner/v1:spanner_cc_grpc", # Do not sort: grpc++ must come last - "@com_github_grpc_grpc//:grpc++", + "@grpc//:grpc++", ], ) @@ -87,7 +87,7 @@ cc_library( ":google_cloud_cpp_spanner", "//:common", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) @@ -104,23 +104,20 @@ cc_library( ":google_cloud_cpp_spanner_mocks", "//:common", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "//protos:system_includes", "//protos/google/cloud/spanner/testing:singer_cc_proto", - "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest_main", + "@abseil-cpp//absl/strings", + "@googletest//:gtest_main", ], ) -# TODO(#3701): Delete this target after 2023-04-01. cc_library( name = "spanner_client_testing", testonly = True, - deprecation = """ - This target is deprecated and will be removed on or after 2023-04-01. More - info: https://github.com/googleapis/google-cloud-cpp/issues/3701 - """, tags = ["manual"], - visibility = ["//visibility:public"], + visibility = [ + ":__subpackages__", + "//:__pkg__", + ], deps = [":spanner_client_testing_private"], ) @@ -135,10 +132,9 @@ cc_library( "//google/cloud:google_cloud_cpp_mocks", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "//protos:system_includes", "//protos/google/cloud/spanner/testing:singer_cc_proto", - "@com_google_absl//absl/numeric:int128", - "@com_google_googletest//:gtest_main", + "@abseil-cpp//absl/numeric:int128", + "@googletest//:gtest_main", ], ) for test in spanner_client_unit_tests] diff --git a/google/cloud/spanner/CMakeLists.txt b/google/cloud/spanner/CMakeLists.txt index acb029537fecb..a4b54cf773fd7 100644 --- a/google/cloud/spanner/CMakeLists.txt +++ b/google/cloud/spanner/CMakeLists.txt @@ -88,7 +88,6 @@ add_library( admin/internal/instance_admin_tracing_connection.h admin/internal/instance_admin_tracing_stub.cc admin/internal/instance_admin_tracing_stub.h - admin/retry_traits.h backoff_policy.h backup.cc backup.h @@ -97,7 +96,6 @@ add_library( bytes.h client.cc client.h - client_options.h commit_options.cc commit_options.h commit_result.h @@ -108,20 +106,12 @@ add_library( create_instance_request_builder.h database.cc database.h - database_admin_client.cc - database_admin_client.h - database_admin_connection.cc - database_admin_connection.h date.h directed_read_replicas.h encryption_config.h iam_updater.h instance.cc instance.h - instance_admin_client.cc - instance_admin_client.h - instance_admin_connection.cc - instance_admin_connection.h internal/channel.h internal/connection_impl.cc internal/connection_impl.h @@ -363,8 +353,6 @@ if (GOOGLE_CLOUD_CPP_WITH_MOCKS) # cmake-format: sort admin/mocks/mock_database_admin_connection.h admin/mocks/mock_instance_admin_connection.h - mocks/mock_database_admin_connection.h - mocks/mock_instance_admin_connection.h mocks/mock_spanner_connection.h mocks/row.h) export_list_to_bazel("google_cloud_cpp_spanner_mocks.bzl" @@ -456,16 +444,11 @@ function (spanner_client_define_tests) # cmake-format: sort backup_test.cc bytes_test.cc - client_options_test.cc client_test.cc commit_options_test.cc connection_options_test.cc create_instance_request_builder_test.cc - database_admin_client_test.cc - database_admin_connection_test.cc database_test.cc - instance_admin_client_test.cc - instance_admin_connection_test.cc instance_test.cc internal/connection_impl_test.cc internal/database_admin_logging_test.cc diff --git a/google/cloud/spanner/README.md b/google/cloud/spanner/README.md index e02250f356a8a..01463c94475ca 100644 --- a/google/cloud/spanner/README.md +++ b/google/cloud/spanner/README.md @@ -18,6 +18,8 @@ this library. ```cc +#include "google/cloud/internal/disable_deprecation_warnings.inc" + #include "google/cloud/spanner/client.h" #include @@ -45,6 +47,7 @@ int main(int argc, char* argv[]) { return 0; } +#include "google/cloud/internal/diagnostics_pop.inc" ``` diff --git a/google/cloud/spanner/admin/database_admin_client.h b/google/cloud/spanner/admin/database_admin_client.h index ea7db34c66e35..1d207599ac710 100644 --- a/google/cloud/spanner/admin/database_admin_client.h +++ b/google/cloud/spanner/admin/database_admin_client.h @@ -28,7 +28,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -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( @@ -2765,7 +2765,6 @@ class DatabaseAdminClient { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin } // namespace cloud } // namespace google diff --git a/google/cloud/spanner/admin/database_admin_connection.h b/google/cloud/spanner/admin/database_admin_connection.h index 6437d3716673f..1d12c5d69d374 100644 --- a/google/cloud/spanner/admin/database_admin_connection.h +++ b/google/cloud/spanner/admin/database_admin_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/spanner/admin/database/v1/spanner_database_admin.pb.h" #include namespace google { @@ -376,7 +376,6 @@ std::shared_ptr MakeDatabaseAdminConnection( Options options = {}); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin } // namespace cloud } // namespace google diff --git a/google/cloud/spanner/admin/database_admin_connection_idempotency_policy.h b/google/cloud/spanner/admin/database_admin_connection_idempotency_policy.h index e37f4113a9d48..768f1e9becf11 100644 --- a/google/cloud/spanner/admin/database_admin_connection_idempotency_policy.h +++ b/google/cloud/spanner/admin/database_admin_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/spanner/admin/database/v1/spanner_database_admin.grpc.pb.h" #include namespace google { @@ -145,7 +145,6 @@ std::unique_ptr MakeDefaultDatabaseAdminConnectionIdempotencyPolicy(); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin } // namespace cloud } // namespace google diff --git a/google/cloud/spanner/admin/instance_admin_client.h b/google/cloud/spanner/admin/instance_admin_client.h index 62f14cd042d8f..2302c1e84c71a 100644 --- a/google/cloud/spanner/admin/instance_admin_client.h +++ b/google/cloud/spanner/admin/instance_admin_client.h @@ -28,7 +28,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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( @@ -2842,7 +2842,6 @@ class InstanceAdminClient { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin } // namespace cloud } // namespace google diff --git a/google/cloud/spanner/admin/instance_admin_connection.h b/google/cloud/spanner/admin/instance_admin_connection.h index 17b3e1ecdcf77..6b5393e914497 100644 --- a/google/cloud/spanner/admin/instance_admin_connection.h +++ b/google/cloud/spanner/admin/instance_admin_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/spanner/admin/instance/v1/spanner_instance_admin.pb.h" #include namespace google { @@ -372,7 +372,6 @@ std::shared_ptr MakeInstanceAdminConnection( Options options = {}); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin } // namespace cloud } // namespace google diff --git a/google/cloud/spanner/admin/instance_admin_connection_idempotency_policy.h b/google/cloud/spanner/admin/instance_admin_connection_idempotency_policy.h index 09360562e83be..224d72de579a5 100644 --- a/google/cloud/spanner/admin/instance_admin_connection_idempotency_policy.h +++ b/google/cloud/spanner/admin/instance_admin_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/spanner/admin/instance/v1/spanner_instance_admin.grpc.pb.h" #include namespace google { @@ -132,7 +132,6 @@ std::unique_ptr MakeDefaultInstanceAdminConnectionIdempotencyPolicy(); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin } // namespace cloud } // namespace google diff --git a/google/cloud/spanner/admin/integration_tests/BUILD.bazel b/google/cloud/spanner/admin/integration_tests/BUILD.bazel index affef991023c5..6f9755cdb236b 100644 --- a/google/cloud/spanner/admin/integration_tests/BUILD.bazel +++ b/google/cloud/spanner/admin/integration_tests/BUILD.bazel @@ -30,7 +30,7 @@ licenses(["notice"]) # Apache 2.0 "//:spanner", "//google/cloud/spanner:spanner_client_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in spanner_admin_integration_tests] @@ -46,6 +46,6 @@ licenses(["notice"]) # Apache 2.0 "//google/cloud/spanner:google_cloud_cpp_spanner_rest", "//google/cloud/spanner:spanner_client_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in spanner_admin_integration_tests_rest] diff --git a/google/cloud/spanner/admin/integration_tests/backup_extra_integration_test.cc b/google/cloud/spanner/admin/integration_tests/backup_extra_integration_test.cc index 595eacceadc1b..8e880f7fa88d7 100644 --- a/google/cloud/spanner/admin/integration_tests/backup_extra_integration_test.cc +++ b/google/cloud/spanner/admin/integration_tests/backup_extra_integration_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/admin/database_admin_client.h" #include "google/cloud/spanner/admin/database_admin_options.h" #include "google/cloud/spanner/admin/instance_admin_client.h" @@ -25,13 +25,13 @@ #include "google/cloud/spanner/testing/random_backup_name.h" #include "google/cloud/spanner/testing/random_database_name.h" #include "google/cloud/spanner/timestamp.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/random.h" #include "google/cloud/kms_key_name.h" #include "google/cloud/testing_util/integration_test.h" #include "google/cloud/testing_util/status_matchers.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include "absl/time/time.h" #include #include @@ -541,3 +541,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/admin/integration_tests/backup_integration_test.cc b/google/cloud/spanner/admin/integration_tests/backup_integration_test.cc index 3f60a31f53ee3..14085985883d5 100644 --- a/google/cloud/spanner/admin/integration_tests/backup_integration_test.cc +++ b/google/cloud/spanner/admin/integration_tests/backup_integration_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/admin/database_admin_client.h" #include "google/cloud/spanner/admin/database_admin_options.h" #include "google/cloud/spanner/backoff_policy.h" @@ -22,13 +22,13 @@ #include "google/cloud/spanner/testing/pick_random_instance.h" #include "google/cloud/spanner/testing/random_database_name.h" #include "google/cloud/spanner/timestamp.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/random.h" #include "google/cloud/kms_key_name.h" #include "google/cloud/testing_util/integration_test.h" #include "google/cloud/testing_util/status_matchers.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include "absl/time/time.h" #include #include @@ -275,3 +275,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/admin/integration_tests/database_admin_integration_test.cc b/google/cloud/spanner/admin/integration_tests/database_admin_integration_test.cc index d79c5c2afffa5..e73389092fac6 100644 --- a/google/cloud/spanner/admin/integration_tests/database_admin_integration_test.cc +++ b/google/cloud/spanner/admin/integration_tests/database_admin_integration_test.cc @@ -18,13 +18,13 @@ #include "google/cloud/spanner/testing/pick_random_instance.h" #include "google/cloud/spanner/testing/random_database_name.h" #include "google/cloud/spanner/timestamp.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/random.h" #include "google/cloud/kms_key_name.h" #include "google/cloud/testing_util/integration_test.h" #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/status_matchers.h" +#include "absl/strings/str_cat.h" #include namespace google { diff --git a/google/cloud/spanner/admin/internal/database_admin_auth_decorator.cc b/google/cloud/spanner/admin/internal/database_admin_auth_decorator.cc index 7a9effadf8b8a..c5028ce5aba04 100644 --- a/google/cloud/spanner/admin/internal/database_admin_auth_decorator.cc +++ b/google/cloud/spanner/admin/internal/database_admin_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/spanner/admin/database/v1/spanner_database_admin.proto #include "google/cloud/spanner/admin/internal/database_admin_auth_decorator.h" -#include +#include "google/spanner/admin/database/v1/spanner_database_admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { @@ -465,3 +468,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/admin/internal/database_admin_auth_decorator.h b/google/cloud/spanner/admin/internal/database_admin_auth_decorator.h index 2d2d8acb4cb3a..cc7e57140056d 100644 --- a/google/cloud/spanner/admin/internal/database_admin_auth_decorator.h +++ b/google/cloud/spanner/admin/internal/database_admin_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/spanner/admin/internal/database_admin_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 spanner_admin_internal { @@ -252,9 +255,10 @@ class DatabaseAdminAuth : public DatabaseAdminStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_DATABASE_ADMIN_AUTH_DECORATOR_H diff --git a/google/cloud/spanner/admin/internal/database_admin_connection_impl.h b/google/cloud/spanner/admin/internal/database_admin_connection_impl.h index ab6ab5b4d4a6c..263962aa5dac8 100644 --- a/google/cloud/spanner/admin/internal/database_admin_connection_impl.h +++ b/google/cloud/spanner/admin/internal/database_admin_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -233,7 +233,6 @@ class DatabaseAdminConnectionImpl }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google diff --git a/google/cloud/spanner/admin/internal/database_admin_logging_decorator.cc b/google/cloud/spanner/admin/internal/database_admin_logging_decorator.cc index 2bf7d8a4aad50..22268bd02408e 100644 --- a/google/cloud/spanner/admin/internal/database_admin_logging_decorator.cc +++ b/google/cloud/spanner/admin/internal/database_admin_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/spanner/admin/internal/database_admin_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/spanner/admin/database/v1/spanner_database_admin.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { @@ -580,3 +583,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/admin/internal/database_admin_logging_decorator.h b/google/cloud/spanner/admin/internal/database_admin_logging_decorator.h index d32a38b9c7457..3686528711447 100644 --- a/google/cloud/spanner/admin/internal/database_admin_logging_decorator.h +++ b/google/cloud/spanner/admin/internal/database_admin_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/spanner/admin/internal/database_admin_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 spanner_admin_internal { @@ -252,9 +255,10 @@ class DatabaseAdminLogging : public DatabaseAdminStub { }; // DatabaseAdminLogging GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_DATABASE_ADMIN_LOGGING_DECORATOR_H diff --git a/google/cloud/spanner/admin/internal/database_admin_metadata_decorator.cc b/google/cloud/spanner/admin/internal/database_admin_metadata_decorator.cc index 2a2f223d17bf7..b274e1262641e 100644 --- a/google/cloud/spanner/admin/internal/database_admin_metadata_decorator.cc +++ b/google/cloud/spanner/admin/internal/database_admin_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/spanner/admin/internal/database_admin_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/spanner/admin/database/v1/spanner_database_admin.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { @@ -444,3 +448,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/admin/internal/database_admin_metadata_decorator.h b/google/cloud/spanner/admin/internal/database_admin_metadata_decorator.h index ee9ebd142d999..291021dcbd0a8 100644 --- a/google/cloud/spanner/admin/internal/database_admin_metadata_decorator.h +++ b/google/cloud/spanner/admin/internal/database_admin_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/spanner/admin/internal/database_admin_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 spanner_admin_internal { @@ -257,9 +260,10 @@ class DatabaseAdminMetadata : public DatabaseAdminStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_DATABASE_ADMIN_METADATA_DECORATOR_H diff --git a/google/cloud/spanner/admin/internal/database_admin_option_defaults.cc b/google/cloud/spanner/admin/internal/database_admin_option_defaults.cc index 08058b74139d3..466cf7b27bed0 100644 --- a/google/cloud/spanner/admin/internal/database_admin_option_defaults.cc +++ b/google/cloud/spanner/admin/internal/database_admin_option_defaults.cc @@ -42,7 +42,7 @@ Options DatabaseAdminDefaultOptions(Options options) { if (!options.has()) { options.set( spanner_admin::DatabaseAdminLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/spanner/admin/internal/database_admin_option_defaults.h b/google/cloud/spanner/admin/internal/database_admin_option_defaults.h index 329f4e3e68add..e88462c78dee2 100644 --- a/google/cloud/spanner/admin/internal/database_admin_option_defaults.h +++ b/google/cloud/spanner/admin/internal/database_admin_option_defaults.h @@ -30,7 +30,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN Options DatabaseAdminDefaultOptions(Options options); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google diff --git a/google/cloud/spanner/admin/internal/database_admin_rest_connection_impl.h b/google/cloud/spanner/admin/internal/database_admin_rest_connection_impl.h index a2b12feac3fd4..53ddc0a4ffa77 100644 --- a/google/cloud/spanner/admin/internal/database_admin_rest_connection_impl.h +++ b/google/cloud/spanner/admin/internal/database_admin_rest_connection_impl.h @@ -30,7 +30,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.pb.h" #include namespace google { diff --git a/google/cloud/spanner/admin/internal/database_admin_rest_logging_decorator.h b/google/cloud/spanner/admin/internal/database_admin_rest_logging_decorator.h index 6ffd3976fed32..236b25e842a6c 100644 --- a/google/cloud/spanner/admin/internal/database_admin_rest_logging_decorator.h +++ b/google/cloud/spanner/admin/internal/database_admin_rest_logging_decorator.h @@ -24,8 +24,8 @@ #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.pb.h" +#include "google/spanner/admin/database/v1/spanner_database_admin.pb.h" #include #include #include diff --git a/google/cloud/spanner/admin/internal/database_admin_rest_metadata_decorator.cc b/google/cloud/spanner/admin/internal/database_admin_rest_metadata_decorator.cc index b1de55b89970b..2555a46a01a1d 100644 --- a/google/cloud/spanner/admin/internal/database_admin_rest_metadata_decorator.cc +++ b/google/cloud/spanner/admin/internal/database_admin_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/spanner/admin/database/v1/spanner_database_admin.proto #include "google/cloud/spanner/admin/internal/database_admin_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/spanner/admin/internal/database_admin_rest_metadata_decorator.h b/google/cloud/spanner/admin/internal/database_admin_rest_metadata_decorator.h index de4a4ebce4dfd..9e51d91518bed 100644 --- a/google/cloud/spanner/admin/internal/database_admin_rest_metadata_decorator.h +++ b/google/cloud/spanner/admin/internal/database_admin_rest_metadata_decorator.h @@ -23,8 +23,8 @@ #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.pb.h" +#include "google/spanner/admin/database/v1/spanner_database_admin.pb.h" #include #include diff --git a/google/cloud/spanner/admin/internal/database_admin_rest_stub.cc b/google/cloud/spanner/admin/internal/database_admin_rest_stub.cc index 83ccbb0c35c0c..8d62a7950fe1d 100644 --- a/google/cloud/spanner/admin/internal/database_admin_rest_stub.cc +++ b/google/cloud/spanner/admin/internal/database_admin_rest_stub.cc @@ -18,11 +18,11 @@ #include "google/cloud/spanner/admin/internal/database_admin_rest_stub.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" +#include "google/longrunning/operations.pb.h" +#include "google/spanner/admin/database/v1/spanner_database_admin.pb.h" #include #include diff --git a/google/cloud/spanner/admin/internal/database_admin_rest_stub.h b/google/cloud/spanner/admin/internal/database_admin_rest_stub.h index 909157bc41860..c66257d16e824 100644 --- a/google/cloud/spanner/admin/internal/database_admin_rest_stub.h +++ b/google/cloud/spanner/admin/internal/database_admin_rest_stub.h @@ -24,8 +24,8 @@ #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.pb.h" +#include "google/spanner/admin/database/v1/spanner_database_admin.pb.h" #include namespace google { diff --git a/google/cloud/spanner/admin/internal/database_admin_stub.cc b/google/cloud/spanner/admin/internal/database_admin_stub.cc index b1f01bff5033a..462a09c786c25 100644 --- a/google/cloud/spanner/admin/internal/database_admin_stub.cc +++ b/google/cloud/spanner/admin/internal/database_admin_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/spanner/admin/internal/database_admin_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/spanner/admin/database/v1/spanner_database_admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { @@ -558,3 +561,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/admin/internal/database_admin_stub.h b/google/cloud/spanner/admin/internal/database_admin_stub.h index dc65472c5867a..257577406e046 100644 --- a/google/cloud/spanner/admin/internal/database_admin_stub.h +++ b/google/cloud/spanner/admin/internal/database_admin_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/spanner/admin/database/v1/spanner_database_admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { @@ -479,9 +482,10 @@ class DefaultDatabaseAdminStub : public DatabaseAdminStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_DATABASE_ADMIN_STUB_H diff --git a/google/cloud/spanner/admin/internal/database_admin_stub_factory.cc b/google/cloud/spanner/admin/internal/database_admin_stub_factory.cc index a11c9d8b1535f..a442aa5bc1a1f 100644 --- a/google/cloud/spanner/admin/internal/database_admin_stub_factory.cc +++ b/google/cloud/spanner/admin/internal/database_admin_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/spanner/admin/database/v1/spanner_database_admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/admin/internal/database_admin_stub_factory.h b/google/cloud/spanner/admin/internal/database_admin_stub_factory.h index a93736a852a18..af198a5889359 100644 --- a/google/cloud/spanner/admin/internal/database_admin_stub_factory.h +++ b/google/cloud/spanner/admin/internal/database_admin_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { @@ -35,9 +38,10 @@ std::shared_ptr CreateDefaultDatabaseAdminStub( Options const& options); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_DATABASE_ADMIN_STUB_FACTORY_H diff --git a/google/cloud/spanner/admin/internal/database_admin_tracing_connection.cc b/google/cloud/spanner/admin/internal/database_admin_tracing_connection.cc index e162841b83920..c6fb018613466 100644 --- a/google/cloud/spanner/admin/internal/database_admin_tracing_connection.cc +++ b/google/cloud/spanner/admin/internal/database_admin_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace spanner_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DatabaseAdminTracingConnection::DatabaseAdminTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -450,16 +448,12 @@ Status DatabaseAdminTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDatabaseAdminTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/spanner/admin/internal/database_admin_tracing_connection.h b/google/cloud/spanner/admin/internal/database_admin_tracing_connection.h index e100b8543b75d..2375fc8e6438f 100644 --- a/google/cloud/spanner/admin/internal/database_admin_tracing_connection.h +++ b/google/cloud/spanner/admin/internal/database_admin_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace spanner_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DatabaseAdminTracingConnection : public spanner_admin::DatabaseAdminConnection { public: @@ -218,8 +216,6 @@ class DatabaseAdminTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * @@ -231,7 +227,6 @@ MakeDatabaseAdminTracingConnection( std::shared_ptr conn); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google diff --git a/google/cloud/spanner/admin/internal/database_admin_tracing_stub.cc b/google/cloud/spanner/admin/internal/database_admin_tracing_stub.cc index b196593eab748..0eb90aeff5cdb 100644 --- a/google/cloud/spanner/admin/internal/database_admin_tracing_stub.cc +++ b/google/cloud/spanner/admin/internal/database_admin_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - DatabaseAdminTracingStub::DatabaseAdminTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -518,18 +519,14 @@ future DatabaseAdminTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeDatabaseAdminTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/admin/internal/database_admin_tracing_stub.h b/google/cloud/spanner/admin/internal/database_admin_tracing_stub.h index 713af527d5a30..e106172d008fb 100644 --- a/google/cloud/spanner/admin/internal/database_admin_tracing_stub.h +++ b/google/cloud/spanner/admin/internal/database_admin_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class DatabaseAdminTracingStub : public DatabaseAdminStub { public: ~DatabaseAdminTracingStub() override = default; @@ -251,8 +252,6 @@ class DatabaseAdminTracingStub : public DatabaseAdminStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -263,9 +262,10 @@ std::shared_ptr MakeDatabaseAdminTracingStub( std::shared_ptr stub); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_DATABASE_ADMIN_TRACING_STUB_H diff --git a/google/cloud/spanner/admin/internal/instance_admin_auth_decorator.cc b/google/cloud/spanner/admin/internal/instance_admin_auth_decorator.cc index fd72f79b6bdc0..371611e92e4b1 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_auth_decorator.cc +++ b/google/cloud/spanner/admin/internal/instance_admin_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/spanner/admin/instance/v1/spanner_instance_admin.proto #include "google/cloud/spanner/admin/internal/instance_admin_auth_decorator.h" -#include +#include "google/spanner/admin/instance/v1/spanner_instance_admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { @@ -448,3 +451,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/admin/internal/instance_admin_auth_decorator.h b/google/cloud/spanner/admin/internal/instance_admin_auth_decorator.h index 44de21d1dda76..98817cef21d54 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_auth_decorator.h +++ b/google/cloud/spanner/admin/internal/instance_admin_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/spanner/admin/internal/instance_admin_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 spanner_admin_internal { @@ -233,9 +236,10 @@ class InstanceAdminAuth : public InstanceAdminStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_INSTANCE_ADMIN_AUTH_DECORATOR_H diff --git a/google/cloud/spanner/admin/internal/instance_admin_connection_impl.h b/google/cloud/spanner/admin/internal/instance_admin_connection_impl.h index 341b2a3ee10f6..bc818678ba1c0 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_connection_impl.h +++ b/google/cloud/spanner/admin/internal/instance_admin_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -220,7 +220,6 @@ class InstanceAdminConnectionImpl }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google diff --git a/google/cloud/spanner/admin/internal/instance_admin_logging_decorator.cc b/google/cloud/spanner/admin/internal/instance_admin_logging_decorator.cc index fc23fdae84002..8481a439eb0ff 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_logging_decorator.cc +++ b/google/cloud/spanner/admin/internal/instance_admin_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/spanner/admin/internal/instance_admin_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/spanner/admin/instance/v1/spanner_instance_admin.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { @@ -539,3 +542,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/admin/internal/instance_admin_logging_decorator.h b/google/cloud/spanner/admin/internal/instance_admin_logging_decorator.h index e50a21b2be37e..dd1265ded979c 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_logging_decorator.h +++ b/google/cloud/spanner/admin/internal/instance_admin_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/spanner/admin/internal/instance_admin_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 spanner_admin_internal { @@ -233,9 +236,10 @@ class InstanceAdminLogging : public InstanceAdminStub { }; // InstanceAdminLogging GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_INSTANCE_ADMIN_LOGGING_DECORATOR_H diff --git a/google/cloud/spanner/admin/internal/instance_admin_metadata_decorator.cc b/google/cloud/spanner/admin/internal/instance_admin_metadata_decorator.cc index ececec6fa18dd..244b1d1599a01 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_metadata_decorator.cc +++ b/google/cloud/spanner/admin/internal/instance_admin_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/spanner/admin/internal/instance_admin_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/spanner/admin/instance/v1/spanner_instance_admin.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { @@ -418,3 +422,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/admin/internal/instance_admin_metadata_decorator.h b/google/cloud/spanner/admin/internal/instance_admin_metadata_decorator.h index ba980eefaea01..4430f768021a6 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_metadata_decorator.h +++ b/google/cloud/spanner/admin/internal/instance_admin_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/spanner/admin/internal/instance_admin_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 spanner_admin_internal { @@ -238,9 +241,10 @@ class InstanceAdminMetadata : public InstanceAdminStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_INSTANCE_ADMIN_METADATA_DECORATOR_H diff --git a/google/cloud/spanner/admin/internal/instance_admin_option_defaults.cc b/google/cloud/spanner/admin/internal/instance_admin_option_defaults.cc index f7e4e19c9f5a8..5fc9a272264d4 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_option_defaults.cc +++ b/google/cloud/spanner/admin/internal/instance_admin_option_defaults.cc @@ -42,7 +42,7 @@ Options InstanceAdminDefaultOptions(Options options) { if (!options.has()) { options.set( spanner_admin::InstanceAdminLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/spanner/admin/internal/instance_admin_option_defaults.h b/google/cloud/spanner/admin/internal/instance_admin_option_defaults.h index bbdfe14c7d061..9890d8fcf9ecb 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_option_defaults.h +++ b/google/cloud/spanner/admin/internal/instance_admin_option_defaults.h @@ -30,7 +30,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN Options InstanceAdminDefaultOptions(Options options); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google diff --git a/google/cloud/spanner/admin/internal/instance_admin_rest_connection_impl.h b/google/cloud/spanner/admin/internal/instance_admin_rest_connection_impl.h index 4dc4af03a8ccb..59dac0328c462 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_rest_connection_impl.h +++ b/google/cloud/spanner/admin/internal/instance_admin_rest_connection_impl.h @@ -30,7 +30,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.pb.h" #include namespace google { diff --git a/google/cloud/spanner/admin/internal/instance_admin_rest_logging_decorator.h b/google/cloud/spanner/admin/internal/instance_admin_rest_logging_decorator.h index 7e97c2d7b5945..43b9e2785ce4b 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_rest_logging_decorator.h +++ b/google/cloud/spanner/admin/internal/instance_admin_rest_logging_decorator.h @@ -24,8 +24,8 @@ #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.pb.h" +#include "google/spanner/admin/instance/v1/spanner_instance_admin.pb.h" #include #include #include diff --git a/google/cloud/spanner/admin/internal/instance_admin_rest_metadata_decorator.cc b/google/cloud/spanner/admin/internal/instance_admin_rest_metadata_decorator.cc index 8217e0d5d4e95..d1fc1b42307e2 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_rest_metadata_decorator.cc +++ b/google/cloud/spanner/admin/internal/instance_admin_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/spanner/admin/instance/v1/spanner_instance_admin.proto #include "google/cloud/spanner/admin/internal/instance_admin_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/spanner/admin/internal/instance_admin_rest_metadata_decorator.h b/google/cloud/spanner/admin/internal/instance_admin_rest_metadata_decorator.h index fc7bff64c6c9b..b2b9497e972e8 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_rest_metadata_decorator.h +++ b/google/cloud/spanner/admin/internal/instance_admin_rest_metadata_decorator.h @@ -23,8 +23,8 @@ #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.pb.h" +#include "google/spanner/admin/instance/v1/spanner_instance_admin.pb.h" #include #include diff --git a/google/cloud/spanner/admin/internal/instance_admin_rest_stub.cc b/google/cloud/spanner/admin/internal/instance_admin_rest_stub.cc index c99ebe8c7859a..8c5597687f05c 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_rest_stub.cc +++ b/google/cloud/spanner/admin/internal/instance_admin_rest_stub.cc @@ -18,11 +18,11 @@ #include "google/cloud/spanner/admin/internal/instance_admin_rest_stub.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include -#include +#include "absl/strings/str_cat.h" +#include "google/longrunning/operations.pb.h" +#include "google/spanner/admin/instance/v1/spanner_instance_admin.pb.h" #include #include diff --git a/google/cloud/spanner/admin/internal/instance_admin_rest_stub.h b/google/cloud/spanner/admin/internal/instance_admin_rest_stub.h index 969b72a42239d..5a5f91778ce61 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_rest_stub.h +++ b/google/cloud/spanner/admin/internal/instance_admin_rest_stub.h @@ -24,8 +24,8 @@ #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.pb.h" +#include "google/spanner/admin/instance/v1/spanner_instance_admin.pb.h" #include namespace google { diff --git a/google/cloud/spanner/admin/internal/instance_admin_stub.cc b/google/cloud/spanner/admin/internal/instance_admin_stub.cc index ce1a3040e144d..d7ccf1403bd93 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_stub.cc +++ b/google/cloud/spanner/admin/internal/instance_admin_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/spanner/admin/internal/instance_admin_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/spanner/admin/instance/v1/spanner_instance_admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { @@ -529,3 +532,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/admin/internal/instance_admin_stub.h b/google/cloud/spanner/admin/internal/instance_admin_stub.h index 539b05644915f..28c97cac41370 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_stub.h +++ b/google/cloud/spanner/admin/internal/instance_admin_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/spanner/admin/instance/v1/spanner_instance_admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { @@ -442,9 +445,10 @@ class DefaultInstanceAdminStub : public InstanceAdminStub { }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_INSTANCE_ADMIN_STUB_H diff --git a/google/cloud/spanner/admin/internal/instance_admin_stub_factory.cc b/google/cloud/spanner/admin/internal/instance_admin_stub_factory.cc index 9e843bf4e3641..c2087c030fb66 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_stub_factory.cc +++ b/google/cloud/spanner/admin/internal/instance_admin_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/spanner/admin/instance/v1/spanner_instance_admin.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/admin/internal/instance_admin_stub_factory.h b/google/cloud/spanner/admin/internal/instance_admin_stub_factory.h index 4b4aab76b51cb..5b1a943452a8f 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_stub_factory.h +++ b/google/cloud/spanner/admin/internal/instance_admin_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { @@ -35,9 +38,10 @@ std::shared_ptr CreateDefaultInstanceAdminStub( Options const& options); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_INSTANCE_ADMIN_STUB_FACTORY_H diff --git a/google/cloud/spanner/admin/internal/instance_admin_tracing_connection.cc b/google/cloud/spanner/admin/internal/instance_admin_tracing_connection.cc index b107fccbcb89c..a09f84d2791e2 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_tracing_connection.cc +++ b/google/cloud/spanner/admin/internal/instance_admin_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace spanner_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InstanceAdminTracingConnection::InstanceAdminTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -434,16 +432,12 @@ Status InstanceAdminTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeInstanceAdminTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/spanner/admin/internal/instance_admin_tracing_connection.h b/google/cloud/spanner/admin/internal/instance_admin_tracing_connection.h index 688ccd004bbe7..3ffbca5738a1c 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_tracing_connection.h +++ b/google/cloud/spanner/admin/internal/instance_admin_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace spanner_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InstanceAdminTracingConnection : public spanner_admin::InstanceAdminConnection { public: @@ -205,8 +203,6 @@ class InstanceAdminTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * @@ -218,7 +214,6 @@ MakeInstanceAdminTracingConnection( std::shared_ptr conn); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google diff --git a/google/cloud/spanner/admin/internal/instance_admin_tracing_stub.cc b/google/cloud/spanner/admin/internal/instance_admin_tracing_stub.cc index 5aa8b0d3eeeb8..ab89ef745e944 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_tracing_stub.cc +++ b/google/cloud/spanner/admin/internal/instance_admin_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - InstanceAdminTracingStub::InstanceAdminTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -492,18 +493,14 @@ future InstanceAdminTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeInstanceAdminTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_admin_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/admin/internal/instance_admin_tracing_stub.h b/google/cloud/spanner/admin/internal/instance_admin_tracing_stub.h index 7e24e58a73094..d5855f294b0b0 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_tracing_stub.h +++ b/google/cloud/spanner/admin/internal/instance_admin_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_admin_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class InstanceAdminTracingStub : public InstanceAdminStub { public: ~InstanceAdminTracingStub() override = default; @@ -232,8 +233,6 @@ class InstanceAdminTracingStub : public InstanceAdminStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -244,9 +243,10 @@ std::shared_ptr MakeInstanceAdminTracingStub( std::shared_ptr stub); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner_admin_internal } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_INTERNAL_INSTANCE_ADMIN_TRACING_STUB_H diff --git a/google/cloud/spanner/admin/retry_traits.h b/google/cloud/spanner/admin/retry_traits.h deleted file mode 100644 index c0460f752763d..0000000000000 --- a/google/cloud/spanner/admin/retry_traits.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_SPANNER_ADMIN_RETRY_TRAITS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_RETRY_TRAITS_H - -#include "google/cloud/spanner/admin/internal/database_admin_retry_traits.h" -#include "google/cloud/spanner/admin/internal/instance_admin_retry_traits.h" -#warning "This header is deprecated, it provided internal-only symbols" - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_RETRY_TRAITS_H diff --git a/google/cloud/spanner/benchmarks/BUILD.bazel b/google/cloud/spanner/benchmarks/BUILD.bazel index 69b5801d80a7c..359a4783dbac1 100644 --- a/google/cloud/spanner/benchmarks/BUILD.bazel +++ b/google/cloud/spanner/benchmarks/BUILD.bazel @@ -30,7 +30,7 @@ cc_library( "//:spanner_mocks", "//google/cloud/spanner:spanner_client_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) diff --git a/google/cloud/spanner/benchmarks/multiple_rows_cpu_benchmark.cc b/google/cloud/spanner/benchmarks/multiple_rows_cpu_benchmark.cc index c97c92d158068..edfd09d82e1e6 100644 --- a/google/cloud/spanner/benchmarks/multiple_rows_cpu_benchmark.cc +++ b/google/cloud/spanner/benchmarks/multiple_rows_cpu_benchmark.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/admin/database_admin_client.h" #include "google/cloud/spanner/benchmarks/benchmarks_config.h" #include "google/cloud/spanner/client.h" @@ -23,13 +23,13 @@ #include "google/cloud/spanner/testing/random_database_name.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/random.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/testing_util/timer.h" +#include "absl/strings/str_cat.h" #include "absl/time/civil_time.h" -#include +#include "google/spanner/v1/result_set.pb.h" #include #include #include @@ -1434,3 +1434,4 @@ int main(int argc, char* argv[]) { : "database dropped\n"); return exit_status; } +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/benchmarks/single_row_throughput_benchmark.cc b/google/cloud/spanner/benchmarks/single_row_throughput_benchmark.cc index a6e1456b2f7b7..115d324d601bc 100644 --- a/google/cloud/spanner/benchmarks/single_row_throughput_benchmark.cc +++ b/google/cloud/spanner/benchmarks/single_row_throughput_benchmark.cc @@ -11,16 +11,16 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/admin/database_admin_client.h" #include "google/cloud/spanner/benchmarks/benchmarks_config.h" #include "google/cloud/spanner/client.h" #include "google/cloud/spanner/testing/pick_random_instance.h" #include "google/cloud/spanner/testing/random_database_name.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/random.h" +#include "absl/strings/str_cat.h" #include #include #include @@ -511,3 +511,4 @@ int main(int argc, char* argv[]) { : "database dropped\n"); return 0; } +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/client.cc b/google/cloud/spanner/client.cc index 03a04dd965fed..210e03858858c 100644 --- a/google/cloud/spanner/client.cc +++ b/google/cloud/spanner/client.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/client.h" #include "google/cloud/spanner/internal/connection_impl.h" #include "google/cloud/spanner/internal/spanner_stub_factory.h" @@ -432,3 +432,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/client.h b/google/cloud/spanner/client.h index d87f459f724e3..af5b64d8872f6 100644 --- a/google/cloud/spanner/client.h +++ b/google/cloud/spanner/client.h @@ -16,7 +16,6 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_CLIENT_H #include "google/cloud/spanner/batch_dml_result.h" -#include "google/cloud/spanner/client_options.h" #include "google/cloud/spanner/commit_options.h" #include "google/cloud/spanner/commit_result.h" #include "google/cloud/spanner/connection.h" @@ -41,7 +40,7 @@ #include "google/cloud/options.h" #include "google/cloud/status.h" #include "google/cloud/status_or.h" -#include +#include "google/spanner/v1/spanner.pb.h" #include #include #include @@ -717,15 +716,6 @@ class Client { StatusOr ExecutePartitionedDml(SqlStatement statement, Options opts = {}); - ///@{ - /// @name Backwards compatibility for ClientOptions. - explicit Client(std::shared_ptr conn, ClientOptions const& opts) - : Client(std::move(conn), Options(opts)) {} - explicit Client(std::shared_ptr conn, - std::initializer_list) - : Client(std::move(conn)) {} - ///@} - ///@{ /// @name Backwards compatibility for ReadOptions. /** diff --git a/google/cloud/spanner/client_options.cc b/google/cloud/spanner/client_options.cc deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/google/cloud/spanner/client_options.h b/google/cloud/spanner/client_options.h deleted file mode 100644 index 05b383f979d35..0000000000000 --- a/google/cloud/spanner/client_options.h +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_SPANNER_CLIENT_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_CLIENT_OPTIONS_H - -#include "google/cloud/spanner/query_options.h" -#include "google/cloud/spanner/version.h" -#include "google/cloud/options.h" - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * ClientOptions allows the caller to set a variety of options when - * constructing a `Client` instance. - * - * @deprecated Use [`Options`](@ref google::cloud::Options) instead, - * and set (as needed) - * [`QueryOptimizerVersionOption`]( - * @ref google::cloud::spanner::QueryOptimizerVersionOption), - * [`QueryOptimizerStatisticsPackageOption`]( - * @ref google::cloud::spanner::QueryOptimizerStatisticsPackageOption), - * [`RequestPriorityOption`]( - * @ref google::cloud::spanner::RequestPriorityOption), or - * [`RequestTagOption`]( - * @ref google::cloud::spanner::RequestTagOption). - */ -class ClientOptions { - public: - ClientOptions() = default; - ClientOptions(ClientOptions const&) = default; - ClientOptions& operator=(ClientOptions const&) = default; - ClientOptions(ClientOptions&&) = default; - ClientOptions& operator=(ClientOptions&&) = default; - - /** - * Convert the `ClientOptions` to the new, recommended way to represent - * options of all varieties, `google::cloud::Options`. - */ - explicit operator Options() const { return Options(query_options_); } - - /// Returns the `QueryOptions` - QueryOptions const& query_options() const { return query_options_; } - - /// Sets the `QueryOptions` - ClientOptions& set_query_options(QueryOptions qo) { - query_options_ = std::move(qo); - return *this; - } - - friend bool operator==(ClientOptions const& a, ClientOptions const& b) { - return a.query_options_ == b.query_options_; - } - - friend bool operator!=(ClientOptions const& a, ClientOptions const& b) { - return !(a == b); - } - - private: - QueryOptions query_options_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_CLIENT_OPTIONS_H diff --git a/google/cloud/spanner/client_options_test.cc b/google/cloud/spanner/client_options_test.cc deleted file mode 100644 index 0fb24f2896570..0000000000000 --- a/google/cloud/spanner/client_options_test.cc +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/spanner/client_options.h" -#include "google/cloud/spanner/options.h" -#include "google/cloud/spanner/query_options.h" -#include "google/cloud/spanner/version.h" -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -TEST(ClientOptionsTest, OptimizerVersion) { - ClientOptions const default_constructed{}; - EXPECT_EQ(QueryOptions{}, default_constructed.query_options()); - - auto copy = default_constructed; - EXPECT_EQ(copy, default_constructed); - - copy.set_query_options(QueryOptions{}.set_optimizer_version("foo")); - EXPECT_NE(copy, default_constructed); - - copy.set_query_options(QueryOptions{}); - EXPECT_EQ(copy, default_constructed); -} - -TEST(ClientOptionsTest, OptionsConversionEmpty) { - ClientOptions const client_options; - auto const options = Options(client_options); - EXPECT_FALSE(options.has()); - EXPECT_FALSE(options.has()); - EXPECT_FALSE(options.has()); - EXPECT_FALSE(options.has()); -} - -TEST(ClientOptionsTest, OptionsConversionFull) { - auto query_options = QueryOptions{} - .set_optimizer_version("1") - .set_optimizer_statistics_package("latest") - .set_request_priority(RequestPriority::kHigh) - .set_request_tag("tag"); - ClientOptions client_options; - client_options.set_query_options(std::move(query_options)); - auto const options = Options(client_options); - EXPECT_TRUE(options.has()); - EXPECT_EQ(options.get(), "1"); - EXPECT_TRUE(options.has()); - EXPECT_EQ(options.get(), "latest"); - EXPECT_TRUE(options.has()); - EXPECT_EQ(options.get(), RequestPriority::kHigh); - EXPECT_TRUE(options.has()); - EXPECT_EQ(options.get(), "tag"); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner -} // namespace cloud -} // namespace google diff --git a/google/cloud/spanner/client_test.cc b/google/cloud/spanner/client_test.cc index 6f628eb43c9bc..7d642c99dd7f8 100644 --- a/google/cloud/spanner/client_test.cc +++ b/google/cloud/spanner/client_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/client.h" #include "google/cloud/mocks/mock_stream_range.h" #include "google/cloud/spanner/connection.h" @@ -1313,26 +1313,6 @@ TEST(ClientTest, UsesConnectionOptions) { EXPECT_STATUS_OK(rollback); } -TEST(ClientTest, UsesClientOptions) { - auto conn = std::make_shared(); - auto txn = MakeReadWriteTransaction(); - - EXPECT_CALL(*conn, options).WillOnce([] { - return Options{}.set("connection"); - }); - EXPECT_CALL(*conn, Rollback) - .WillOnce([txn](Connection::RollbackParams const& params) { - auto const& options = internal::CurrentOptions(); - EXPECT_THAT(options.get(), Eq("client")); - EXPECT_THAT(params.transaction, Eq(txn)); - return Status(); - }); - - Client client(conn, Options{}.set("client")); - auto rollback = client.Rollback(txn, Options{}); - EXPECT_STATUS_OK(rollback); -} - TEST(ClientTest, UsesOperationOptions) { auto conn = std::make_shared(); auto txn = MakeReadWriteTransaction(); @@ -1359,3 +1339,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/commit_options.cc b/google/cloud/spanner/commit_options.cc index 804b40908f0bf..0291668647d2a 100644 --- a/google/cloud/spanner/commit_options.cc +++ b/google/cloud/spanner/commit_options.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/commit_options.h" #include "google/cloud/spanner/options.h" @@ -48,3 +48,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/connection.cc b/google/cloud/spanner/connection.cc index 9a3352f68901a..8c7309423b4c3 100644 --- a/google/cloud/spanner/connection.cc +++ b/google/cloud/spanner/connection.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/connection.h" #include "google/cloud/spanner/query_partition.h" #include "google/cloud/spanner/read_partition.h" @@ -115,3 +115,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/connection_options.cc b/google/cloud/spanner/connection_options.cc index 43e52ac3abe1c..a1c41b0aaae17 100644 --- a/google/cloud/spanner/connection_options.cc +++ b/google/cloud/spanner/connection_options.cc @@ -16,9 +16,9 @@ #include "google/cloud/spanner/internal/defaults.h" #include "google/cloud/common_options.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/user_agent_prefix.h" +#include "absl/strings/str_join.h" namespace google { namespace cloud { diff --git a/google/cloud/spanner/create_instance_request_builder.h b/google/cloud/spanner/create_instance_request_builder.h index 4749192a45bd3..241ada42450d4 100644 --- a/google/cloud/spanner/create_instance_request_builder.h +++ b/google/cloud/spanner/create_instance_request_builder.h @@ -17,8 +17,8 @@ #include "google/cloud/spanner/instance.h" #include "google/cloud/spanner/version.h" +#include "google/spanner/admin/instance/v1/spanner_instance_admin.pb.h" #include -#include #include #include diff --git a/google/cloud/spanner/database_admin_client.cc b/google/cloud/spanner/database_admin_client.cc deleted file mode 100644 index 60a21f2e65faa..0000000000000 --- a/google/cloud/spanner/database_admin_client.cc +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO(#7356): Remove this file after the deprecation period expires -#include "google/cloud/internal/disable_deprecation_warnings.inc" -#include "google/cloud/spanner/database_admin_client.h" -#include "google/cloud/spanner/timestamp.h" -#include "google/cloud/options.h" -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -namespace gsad = ::google::spanner::admin::database; - -DatabaseAdminClient::DatabaseAdminClient(ConnectionOptions const& options) - : conn_(MakeDatabaseAdminConnection(options)) {} - -future> DatabaseAdminClient::CreateDatabase( - Database db, std::vector extra_statements, - EncryptionConfig encryption_config) { - internal::OptionsSpan span(conn_->options()); - return conn_->CreateDatabase({std::move(db), std::move(extra_statements), - std::move(encryption_config)}); -} - -StatusOr DatabaseAdminClient::GetDatabase(Database db) { - internal::OptionsSpan span(conn_->options()); - return conn_->GetDatabase({std::move(db)}); -} - -StatusOr DatabaseAdminClient::GetDatabaseDdl( - Database db) { - internal::OptionsSpan span(conn_->options()); - return conn_->GetDatabaseDdl({std::move(db)}); -} - -future> -DatabaseAdminClient::UpdateDatabase(Database db, - std::vector statements) { - internal::OptionsSpan span(conn_->options()); - return conn_->UpdateDatabase({std::move(db), std::move(statements)}); -} - -ListDatabaseRange DatabaseAdminClient::ListDatabases(Instance in) { - internal::OptionsSpan span(conn_->options()); - return conn_->ListDatabases({std::move(in)}); -} - -Status DatabaseAdminClient::DropDatabase(Database db) { - internal::OptionsSpan span(conn_->options()); - return conn_->DropDatabase({std::move(db)}); -} - -future> DatabaseAdminClient::RestoreDatabase( - Database db, Backup const& backup, EncryptionConfig encryption_config) { - internal::OptionsSpan span(conn_->options()); - return conn_->RestoreDatabase( - {std::move(db), backup.FullName(), std::move(encryption_config)}); -} - -future> DatabaseAdminClient::RestoreDatabase( - Database db, google::spanner::admin::database::v1::Backup const& backup, - EncryptionConfig encryption_config) { - internal::OptionsSpan span(conn_->options()); - return conn_->RestoreDatabase( - {std::move(db), backup.name(), std::move(encryption_config)}); -} - -StatusOr DatabaseAdminClient::GetIamPolicy( - Database db) { - internal::OptionsSpan span(conn_->options()); - return conn_->GetIamPolicy({std::move(db)}); -} - -StatusOr DatabaseAdminClient::SetIamPolicy( - Database db, google::iam::v1::Policy policy) { - internal::OptionsSpan span(conn_->options()); - return conn_->SetIamPolicy({std::move(db), std::move(policy)}); -} - -StatusOr DatabaseAdminClient::SetIamPolicy( - Database const& db, IamUpdater const& updater) { - auto const rerun_maximum_duration = std::chrono::minutes(15); - auto default_rerun_policy = - LimitedTimeTransactionRerunPolicy(rerun_maximum_duration).clone(); - - auto const backoff_initial_delay = std::chrono::milliseconds(1000); - auto const backoff_maximum_delay = std::chrono::minutes(5); - auto const backoff_scaling = 2.0; - auto default_backoff_policy = - ExponentialBackoffPolicy(backoff_initial_delay, backoff_maximum_delay, - backoff_scaling) - .clone(); - - return SetIamPolicy(db, updater, std::move(default_rerun_policy), - std::move(default_backoff_policy)); -} - -StatusOr DatabaseAdminClient::SetIamPolicy( - Database const& db, IamUpdater const& updater, - std::unique_ptr rerun_policy, - std::unique_ptr backoff_policy) { - internal::OptionsSpan span(conn_->options()); - using RerunnablePolicy = spanner_internal::SafeTransactionRerun; - - Status last_status; - do { - auto current_policy = conn_->GetIamPolicy({db}); - if (!current_policy) { - last_status = std::move(current_policy).status(); - } else { - auto etag = current_policy->etag(); - auto desired = updater(*current_policy); - if (!desired.has_value()) { - return current_policy; - } - desired->set_etag(std::move(etag)); - auto result = conn_->SetIamPolicy({db, *std::move(desired)}); - if (RerunnablePolicy::IsOk(result.status())) { - return result; - } - last_status = std::move(result).status(); - } - if (!rerun_policy->OnFailure(last_status)) break; - std::this_thread::sleep_for(backoff_policy->OnCompletion()); - } while (!rerun_policy->IsExhausted()); - return last_status; -} - -StatusOr -DatabaseAdminClient::TestIamPermissions(Database db, - std::vector permissions) { - internal::OptionsSpan span(conn_->options()); - return conn_->TestIamPermissions({std::move(db), std::move(permissions)}); -} - -future> DatabaseAdminClient::CreateBackup( - Database db, std::string backup_id, Timestamp expire_time, - absl::optional version_time, - EncryptionConfig encryption_config) { - internal::OptionsSpan span(conn_->options()); - auto expire_time_point = - expire_time.get(); - if (!expire_time_point) { - expire_time_point = std::chrono::system_clock::time_point::max(); - } - return conn_->CreateBackup( - {std::move(db), std::move(backup_id), *std::move(expire_time_point), - expire_time, std::move(version_time), std::move(encryption_config)}); -} - -future> DatabaseAdminClient::CreateBackup( - Database db, std::string backup_id, - std::chrono::system_clock::time_point expire_time) { - internal::OptionsSpan span(conn_->options()); - auto ts = MakeTimestamp(expire_time); - if (!ts) return make_ready_future(StatusOr(ts.status())); - return CreateBackup(std::move(db), std::move(backup_id), *ts); -} - -StatusOr DatabaseAdminClient::GetBackup( - Backup const& backup) { - internal::OptionsSpan span(conn_->options()); - return conn_->GetBackup({backup.FullName()}); -} - -Status DatabaseAdminClient::DeleteBackup( - google::spanner::admin::database::v1::Backup const& backup) { - internal::OptionsSpan span(conn_->options()); - return conn_->DeleteBackup({backup.name()}); -} - -Status DatabaseAdminClient::DeleteBackup(Backup const& backup) { - internal::OptionsSpan span(conn_->options()); - return conn_->DeleteBackup({backup.FullName()}); -} - -ListBackupsRange DatabaseAdminClient::ListBackups(Instance in, - std::string filter) { - internal::OptionsSpan span(conn_->options()); - return conn_->ListBackups({std::move(in), std::move(filter)}); -} - -StatusOr DatabaseAdminClient::UpdateBackupExpireTime( - google::spanner::admin::database::v1::Backup const& backup, - Timestamp expire_time) { - internal::OptionsSpan span(conn_->options()); - google::spanner::admin::database::v1::UpdateBackupRequest request; - request.mutable_backup()->set_name(backup.name()); - *request.mutable_backup()->mutable_expire_time() = - expire_time.get().value(); - request.mutable_update_mask()->add_paths("expire_time"); - return conn_->UpdateBackup({request}); -} - -StatusOr DatabaseAdminClient::UpdateBackupExpireTime( - Backup const& backup, Timestamp expire_time) { - internal::OptionsSpan span(conn_->options()); - google::spanner::admin::database::v1::UpdateBackupRequest request; - request.mutable_backup()->set_name(backup.FullName()); - *request.mutable_backup()->mutable_expire_time() = - expire_time.get().value(); - request.mutable_update_mask()->add_paths("expire_time"); - return conn_->UpdateBackup({request}); -} - -StatusOr DatabaseAdminClient::UpdateBackupExpireTime( - google::spanner::admin::database::v1::Backup const& backup, - std::chrono::system_clock::time_point const& expire_time) { - auto ts = MakeTimestamp(expire_time); - if (!ts) return ts.status(); - return UpdateBackupExpireTime(backup, *ts); -} - -StatusOr DatabaseAdminClient::UpdateBackupExpireTime( - Backup const& backup, - std::chrono::system_clock::time_point const& expire_time) { - auto ts = MakeTimestamp(expire_time); - if (!ts) return ts.status(); - return UpdateBackupExpireTime(backup, *ts); -} - -ListBackupOperationsRange DatabaseAdminClient::ListBackupOperations( - Instance in, std::string filter) { - internal::OptionsSpan span(conn_->options()); - return conn_->ListBackupOperations({std::move(in), std::move(filter)}); -} - -ListDatabaseOperationsRange DatabaseAdminClient::ListDatabaseOperations( - Instance in, std::string filter) { - internal::OptionsSpan span(conn_->options()); - return conn_->ListDatabaseOperations({std::move(in), std::move(filter)}); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner -} // namespace cloud -} // namespace google diff --git a/google/cloud/spanner/database_admin_client.h b/google/cloud/spanner/database_admin_client.h deleted file mode 100644 index 9ee3db0d35493..0000000000000 --- a/google/cloud/spanner/database_admin_client.h +++ /dev/null @@ -1,604 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_SPANNER_DATABASE_ADMIN_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_DATABASE_ADMIN_CLIENT_H - -#include "google/cloud/spanner/backup.h" -#include "google/cloud/spanner/connection_options.h" -#include "google/cloud/spanner/database.h" -#include "google/cloud/spanner/database_admin_connection.h" -#include "google/cloud/spanner/encryption_config.h" -#include "google/cloud/spanner/iam_updater.h" -#include "google/cloud/spanner/instance.h" -#include "google/cloud/spanner/timestamp.h" -#include "google/cloud/spanner/version.h" -#include "google/cloud/future.h" -#include "google/cloud/status_or.h" -#include "absl/types/optional.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * Performs database administration operations on Spanner. - * - * @deprecated Please use #google::cloud::spanner_admin::InstanceAdminClient - * instead. - * - * Applications use this class to perform administrative operations on spanner - * [Databases][database-doc-link]. - * - * @par Performance - * - * Creating a new `DatabaseAdminClient` is a relatively expensive operation, new - * objects establish new connections to the service. In contrast, copying or - * moving an existing `DatabaseAdminClient` object is a relatively cheap - * operation. Copied clients share the underlying resources. - * - * @par Thread Safety - * - * Instances of this class created via copy-construction or copy-assignment - * share the underlying pool of connections. Access to these copies via multiple - * threads is guaranteed to work. Two threads operating on the same instance of - * this class is not guaranteed to work. - * - * @par Error Handling - * - * This class uses `StatusOr` to report errors. When an operation fails to - * perform its work the returned `StatusOr` contains the error details. If - * the `ok()` member function in the `StatusOr` returns `true` then it - * contains the expected result. For more information, see the - * [Error Handling Guide](#spanner-error-handling). - * - * @code - * namespace spanner = ::google::cloud::spanner; - * using ::google::cloud::StatusOr; - * spanner::DatabaseAdminClient client = ...; - * StatusOr db = - * client.CreateDatabase(...).get(); - * - * if (!db) { - * std::cerr << "Error in CreateDatabase: " << db.status() << "\n"; - * return; - * } - * - * // Use `db` as a smart pointer here, e.g.: - * std::cout << "The database fully qualified name is: " << db->name() << "\n"; - * @endcode - * - * @par Long running operations - * - * Some operations in this class can take minutes to complete. In this case the - * class returns a `google::cloud::future>`, the application can - * then poll the `future` or associate a callback to be invoked when the - * operation completes: - * - * @code - * namespace spanner = ::google::cloud::spanner; - * spanner::DatabaseAdminClient client = ...; - * // Make example less verbose. - * using ::google::cloud::future; - * using ::google::cloud::StatusOr; - * using std::chrono::chrono_literals; // C++14 - * - * auto database = client.CreateDatabase(...); - * if (database.wait_for(5m) == std::future_state::ready) { - * std::cout << "Database created in under 5 minutes, yay!\n"; - * return; - * } - * // Too slow, setup a callback instead: - * database.then([](auto f) { - * StatusOr db = f.get(); - * if (!db) { - * std::cout << "Failed creating a database!\n"; - * return; - * } - * std::cout << "Database created!\n"; - * }); - * @endcode - * - * [database-doc-link]: - * https://cloud.google.com/spanner/docs/schema-and-data-model - */ -class GOOGLE_CLOUD_CPP_SPANNER_ADMIN_API_DEPRECATED("DatabaseAdminClient") - DatabaseAdminClient { - public: - explicit DatabaseAdminClient( - ConnectionOptions const& options = ConnectionOptions()); - - /** - * Creates a new Cloud Spanner database in the given project and instance. - * - * This function creates a database (using the "CREATE DATABASE" DDL - * statement) in the given Google Cloud Project and Cloud Spanner instance. - * The application can provide an optional list of additional DDL statements - * to atomically create tables and indices as well as the new database. - * - * Note that the database id must be between 2 and 30 characters long, it must - * start with a lowercase letter (`[a-z]`), it must end with a lowercase - * letter or a number (`[a-z0-9]`) and any characters between the beginning - * and ending characters must be lower case letters, numbers, underscore (`_`) - * or dashes (`-`), that is, they must belong to the `[a-z0-9_-]` character - * set. - * - * @p encryption_config How to encrypt the database. - * - * @return A `google::cloud::future` that becomes satisfied when the operation - * completes on the service. Note that this can take minutes in some cases. - * - * @par Example - * @snippet samples.cc create-database - * - * @see https://cloud.google.com/spanner/docs/data-definition-language for a - * full list of the DDL operations - * - * @see - * https://cloud.google.com/spanner/docs/data-definition-language#create_database - * for the regular expression that must be satisfied by the database id. - */ - future> - CreateDatabase(Database db, std::vector extra_statements = {}, - EncryptionConfig encryption_config = DefaultEncryption()); - - /** - * Retrieve metadata information about a database. - * - * @par Idempotency - * This is a read-only operation and therefore always idempotent. Transient - * failures are automatically retried. - * - * @par Example - * @snippet samples.cc get-database - */ - StatusOr GetDatabase( - Database db); - - /** - * Retrieve a database schema. - * - * @par Idempotency - * This is a read-only operation and therefore always idempotent. Transient - * failures are automatically retried. - * - * @par Example - * @snippet samples.cc get-database-ddl - */ - StatusOr - GetDatabaseDdl(Database db); - - /** - * Updates the database using a series of DDL statements. - * - * This function schedules a series of updates to the database using a - * sequence of DDL statements. - * - * @return A `google::cloud::future` that becomes satisfied when all the - * statements complete. Note that Cloud Spanner may fail to execute some of - * the statements. - * - * @par Example - * @snippet samples.cc add-column - * - * @see https://cloud.google.com/spanner/docs/data-definition-language for a - * full list of the DDL operations - */ - future< - StatusOr> - UpdateDatabase(Database db, std::vector statements); - - /** - * Drops (deletes) an existing Cloud Spanner database. - * - * @warning Dropping a database deletes all the tables and other data in the - * database. This is an unrecoverable operation. - * - * @par Example - * @snippet samples.cc drop-database - */ - Status DropDatabase(Database db); - - /** - * List all the databases in a give project and instance. - * - * @par Idempotency - * This operation is read-only and therefore always idempotent. - * - * @par Example - * @snippet samples.cc list-databases - */ - ListDatabaseRange ListDatabases(Instance in); - - /** - * Create a new database by restoring from a completed backup. - * - * @par Idempotency - * This is not an idempotent operation. Transient failures are not retried. - * - * The new database must be in the same project and in an instance with the - * same instance configuration as the instance containing the backup. - * - * @p encryption_config How to encrypt the database. - * - * @return A `google::cloud::future` that becomes satisfied when the operation - * completes on the service. Note that this can take minutes in some cases. - * - * @par Example - * @snippet samples.cc restore-database - */ - future> - RestoreDatabase(Database db, Backup const& backup, - EncryptionConfig encryption_config = DefaultEncryption()); - - /** - * Create a new database by restoring from a completed backup. - * - * @par Idempotency - * This is not an idempotent operation. Transient failures are not retried. - * - * The new database must be in the same project and in an instance with the - * same instance configuration as the instance containing the backup. - * - * @p encryption_config How to encrypt the database. - * - * @return A `google::cloud::future` that becomes satisfied when the operation - * completes on the service. Note that this can take minutes in some cases. - */ - future> - RestoreDatabase(Database db, - google::spanner::admin::database::v1::Backup const& backup, - EncryptionConfig encryption_config = DefaultEncryption()); - - /** - * Gets the IAM policy for a database. - * - * @par Idempotency - * This operation is read-only and therefore always idempotent. - * - * @par Example - * @snippet samples.cc database-get-iam-policy - */ - StatusOr GetIamPolicy(Database db); - - /** - * Set the IAM policy for the given database. - * - * This function changes the IAM policy configured in the given database to - * the value of @p policy. - * - * @par Idempotency - * This function is only idempotent if the `etag` field in @p policy is set. - * Therefore, the underlying RPCs are only retried if the field is set, and - * the function returns the first RPC error in any other case. - * - * @see The [Cloud Spanner - * documentation](https://cloud.google.com/spanner/docs/iam) for a - * description of the roles and permissions supported by Cloud Spanner. - * @see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions) - * for an introduction to Identity and Access Management in Google Cloud - * Platform. - */ - StatusOr SetIamPolicy( - Database db, google::iam::v1::Policy policy); - - /** - * Updates the IAM policy for an instance using an optimistic concurrency - * control loop. - * - * This function repeatedly reads the current IAM policy in @p db, and then - * calls the @p updater with the this policy. The @p updater returns an empty - * optional if no changes are required, or it returns the new desired value - * for the IAM policy. This function then updates the policy. - * - * Updating an IAM policy can fail with retryable errors or can be aborted - * because there were simultaneous changes the to IAM policy. In these cases - * this function reruns the loop until it succeeds. - * - * The function returns the final IAM policy, or an error if the rerun policy - * for the underlying connection has expired. - * - * @par Idempotency - * This function always sets the `etag` field on the policy, so the underlying - * RPCs are retried automatically. - * - * @par Example - * @snippet samples.cc add-database-reader-on-database - * - * @param db the identifier for the database where you want to change the IAM - * policy. - * @param updater a callback to modify the policy. Return an unset optional - * to indicate that no changes to the policy are needed. - */ - StatusOr SetIamPolicy(Database const& db, - IamUpdater const& updater); - - /** - * @copydoc SetIamPolicy(Database const&,IamUpdater const&) - * - * @param rerun_policy controls for how long (or how many times) the updater - * will be rerun after the IAM policy update aborts. - * @param backoff_policy controls how long `SetIamPolicy` waits between - * reruns. - */ - StatusOr SetIamPolicy( - Database const& db, IamUpdater const& updater, - std::unique_ptr rerun_policy, - std::unique_ptr backoff_policy); - - /** - * Get the subset of the permissions the caller has on the given database. - * - * This function compares the given list of permissions against those - * permissions granted to the caller, and returns the subset of the list that - * the caller actually holds. - * - * @note Permission wildcards, such as `spanner.*` are not allowed. - * - * @par Idempotency - * This operation is read-only and therefore always idempotent. - * - * @par Example - * @snippet samples.cc database-test-iam-permissions - * - * @see The [Cloud Spanner - * documentation](https://cloud.google.com/spanner/docs/iam) for a description - * of the roles and permissions supported by Cloud Spanner. - * @see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions) - * for an introduction to Identity and Access Management in Google Cloud - * Platform. - */ - StatusOr TestIamPermissions( - Database db, std::vector permissions); - - /** - * Creates a new Cloud Spanner backup for the given database. - * - * @par Idempotency - * This is not an idempotent operation. Transient failures are not retried. - * - * This function creates a database backup for the given Google Cloud Spanner - * database. - * - * Note that the @p backup_id must be unique within the same instance, it must - * be between 2 and 60 characters long, it must start with a lowercase letter - * (`[a-z]`), it must end with a lowercase letter or a number (`[a-z0-9]`) and - * any characters between the beginning and ending characters must be lower - * case letters, numbers, underscore (`_`) or dashes (`-`), that is, they must - * belong to the `[a-z0-9_-]` character set. - * - * The @p expire_time must be at least 6 hours and at most 366 days from the - * time the `CreateBackup()` request is processed. - * - * The backup will contain an externally consistent copy of the database - * at @p version_time, if set. Otherwise, the version_time will be the - * create_time of the backup. - * - * @p encryption_config How to encrypt the backup. - * - * @return A `google::cloud::future` that becomes satisfied when the operation - * completes on the service. Note that this can take minutes in some cases. - * - * @par Example - * @snippet samples.cc create-backup - */ - future> CreateBackup( - Database db, std::string backup_id, Timestamp expire_time, - absl::optional version_time = absl::nullopt, - EncryptionConfig encryption_config = DefaultEncryption()); - - /** - * Creates a new Cloud Spanner backup for the given database. - * - * @deprecated this overload is deprecated; use the `Timestamp` overload - * instead. - * - * @par Idempotency - * This is not an idempotent operation. Transient failures are not retried. - * - * This function creates a database backup for the given Google Cloud Spanner - * database. - * - * Note that the @p backup_id must be unique within the same instance, it must - * be between 2 and 60 characters long, it must start with a lowercase letter - * (`[a-z]`), it must end with a lowercase letter or a number (`[a-z0-9]`) and - * any characters between the beginning and ending characters must be lower - * case letters, numbers, underscore (`_`) or dashes (`-`), that is, they must - * belong to the `[a-z0-9_-]` character set. - * - * The @p expire_time must be at least 6 hours and at most 366 days from the - * time the `CreateBackup()` request is processed. - * - * @return A `google::cloud::future` that becomes satisfied when the operation - * completes on the service. Note that this can take minutes in some cases. - */ - future> CreateBackup( - Database db, std::string backup_id, - std::chrono::system_clock::time_point expire_time); - - /** - * Retrieve metadata information about a Backup. - * - * @par Idempotency - * This is a read-only operation and therefore always idempotent. Transient - * failures are automatically retried. - * - * @par Example - * @snippet samples.cc get-backup - */ - StatusOr GetBackup( - Backup const& backup); - - /** - * Deletes a pending or completed Backup. - * - * @par Idempotency - * We treat this operation as idempotent. Transient failures are automatically - * retried. - */ - Status DeleteBackup( - google::spanner::admin::database::v1::Backup const& backup); - - /** - * Deletes a pending or completed Backup. - * - * @par Idempotency - * We treat this operation as idempotent. Transient failures are automatically - * retried. - * - * @par Example - * @snippet samples.cc delete-backup - */ - Status DeleteBackup(Backup const& backup); - - /** - * List all the backups in a given project and instance that match - * the filter. - * - * @par Idempotency - * This operation is read-only and therefore always idempotent. - * - * @param in An instance where the backup operations belong to. - * @param filter A filter expression that filters backups listed in the - * response. See [this documentation][spanner-api-reference-link] for the - * syntax of the filter expression. - * - * @par Example - * @snippet samples.cc list-backups - * - * [spanner-api-reference-link]: - * https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.ListBackupsRequest - */ - ListBackupsRange ListBackups(Instance in, std::string filter = {}); - - /** - * Update backup's @p expire_time. - * - * @par Idempotency - * This operation is idempotent as its result does not depend on the previous - * state of the backup. Note that, as is the case with all operations, it is - * subject to race conditions if multiple tasks are attempting to change the - * expire time in the same backup. - */ - StatusOr UpdateBackupExpireTime( - google::spanner::admin::database::v1::Backup const& backup, - Timestamp expire_time); - - /** - * Update backup's @p expire_time. - * - * @par Idempotency - * This operation is idempotent as its result does not depend on the previous - * state of the backup. Note that, as is the case with all operations, it is - * subject to race conditions if multiple tasks are attempting to change the - * expire time in the same backup. - * - * @par Example - * @snippet samples.cc update-backup - */ - StatusOr UpdateBackupExpireTime( - Backup const& backup, Timestamp expire_time); - - /** - * Update backup's @p expire_time. - * - * @deprecated this overload is deprecated; use the `Timestamp` overload - * instead. - * - * @par Idempotency - * This operation is idempotent as its result does not depend on the previous - * state of the backup. Note that, as is the case with all operations, it is - * subject to race conditions if multiple tasks are attempting to change the - * expire time in the same backup. - */ - StatusOr UpdateBackupExpireTime( - google::spanner::admin::database::v1::Backup const& backup, - std::chrono::system_clock::time_point const& expire_time); - - /** - * Update backup's @p expire_time. - * - * @deprecated this overload is deprecated; use the `Timestamp` overload - * instead. - * - * @par Idempotency - * This operation is idempotent as its result does not depend on the previous - * state of the backup. Note that, as is the case with all operations, it is - * subject to race conditions if multiple tasks are attempting to change the - * expire time in the same backup. - */ - StatusOr UpdateBackupExpireTime( - Backup const& backup, - std::chrono::system_clock::time_point const& expire_time); - - /** - * List all the backup operations in a given project and instance that match - * the filter. - * - * @par Idempotency - * This operation is read-only and therefore always idempotent. - * - * @param in An instance where the backup operations belong to. - * @param filter A filter expression that filters what operations are returned - * in the response. See [this documentation][spanner-api-reference-link] for - * the syntax of the filter expression. - * - * @par Example - * @snippet samples.cc list-backup-operations - * - * [spanner-api-reference-link]: - * https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.ListBackupOperationsRequest - */ - ListBackupOperationsRange ListBackupOperations(Instance in, - std::string filter = {}); - - /** - * List all the database operations in a given project and instance that match - * the filter. - * - * @par Idempotency - * This operation is read-only and therefore always idempotent. - * - * @param in An instance where the database operations belong to. - * @param filter A filter expression that filters what operations are returned - * in the response. See [this documentation][spanner-api-reference-link] for - * the syntax of the filter expression. - * - * @par Example - * @snippet samples.cc list-database-operations - * - * [spanner-api-reference-link]: - * https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.ListDatabaseOperationsRequest - */ - ListDatabaseOperationsRange ListDatabaseOperations(Instance in, - std::string filter = {}); - - /// Create a new client with the given stub. For testing only. - explicit DatabaseAdminClient(std::shared_ptr c) - : conn_(std::move(c)) {} - - private: - std::shared_ptr conn_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_DATABASE_ADMIN_CLIENT_H diff --git a/google/cloud/spanner/database_admin_client_test.cc b/google/cloud/spanner/database_admin_client_test.cc deleted file mode 100644 index 0f178d89e355e..0000000000000 --- a/google/cloud/spanner/database_admin_client_test.cc +++ /dev/null @@ -1,725 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO(#7356): Remove this file after the deprecation period expires -#include "google/cloud/internal/disable_deprecation_warnings.inc" -#include "google/cloud/spanner/database_admin_client.h" -#include "google/cloud/spanner/mocks/mock_database_admin_connection.h" -#include "google/cloud/spanner/timestamp.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "absl/time/clock.h" -#include "absl/time/time.h" -#include "absl/types/optional.h" -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace gsad = ::google::spanner::admin::database; - -using ::google::cloud::spanner_mocks::MockDatabaseAdminConnection; -using ::google::cloud::testing_util::StatusIs; -using ::testing::AtLeast; -using ::testing::ElementsAre; -using ::testing::HasSubstr; - -/// @test Verify DatabaseAdminClient uses CreateDatabase() correctly. -TEST(DatabaseAdminClientTest, CreateDatabase) { - auto mock = std::make_shared(); - - Database dbase("test-project", "test-instance", "test-db"); - - EXPECT_CALL(*mock, CreateDatabase) - .WillOnce( - [&dbase](DatabaseAdminConnection::CreateDatabaseParams const& p) { - EXPECT_EQ(p.database, dbase); - EXPECT_THAT(p.extra_statements, ElementsAre("-- NOT SQL for test")); - gsad::v1::Database database; - database.set_name(dbase.FullName()); - database.set_state(gsad::v1::Database::CREATING); - return make_ready_future(make_status_or(database)); - }); - - DatabaseAdminClient client(std::move(mock)); - auto fut = client.CreateDatabase(dbase, {"-- NOT SQL for test"}); - ASSERT_EQ(std::future_status::ready, fut.wait_for(std::chrono::seconds(0))); - auto db = fut.get(); - ASSERT_STATUS_OK(db); - - EXPECT_EQ(dbase.FullName(), db->name()); - EXPECT_EQ(gsad::v1::Database::CREATING, db->state()); -} - -/// @test Verify DatabaseAdminClient uses GetDatabase() correctly. -TEST(DatabaseAdminClientTest, GetDatabase) { - auto mock = std::make_shared(); - Database dbase("test-project", "test-instance", "test-db"); - - EXPECT_CALL(*mock, GetDatabase) - .WillOnce([&dbase](DatabaseAdminConnection::GetDatabaseParams const& p) { - EXPECT_EQ(dbase, p.database); - gsad::v1::Database response; - response.set_name(p.database.FullName()); - response.set_state(gsad::v1::Database::READY); - return response; - }); - - DatabaseAdminClient client(std::move(mock)); - auto response = client.GetDatabase(dbase); - ASSERT_STATUS_OK(response); - EXPECT_EQ(gsad::v1::Database::READY, response->state()); - EXPECT_EQ(dbase.FullName(), response->name()); -} - -/// @test Verify DatabaseAdminClient uses GetDatabaseDdl() correctly. -TEST(DatabaseAdminClientTest, GetDatabaseDdl) { - auto mock = std::make_shared(); - Database const expected_name("test-project", "test-instance", - "test-database"); - - EXPECT_CALL(*mock, GetDatabaseDdl) - .WillOnce([&expected_name]( - DatabaseAdminConnection::GetDatabaseDdlParams const& p) { - EXPECT_EQ(expected_name, p.database); - gsad::v1::GetDatabaseDdlResponse response; - response.add_statements("CREATE DATABASE test-database"); - return response; - }); - - DatabaseAdminClient client(std::move(mock)); - auto response = client.GetDatabaseDdl(expected_name); - ASSERT_STATUS_OK(response); - ASSERT_EQ(1, response->statements_size()); - EXPECT_EQ("CREATE DATABASE test-database", response->statements(0)); -} - -/// @test Verify DatabaseAdminClient uses UpdateDatabase() correctly. -TEST(DatabaseAdminClientTest, UpdateDatabase) { - auto mock = std::make_shared(); - - Database dbase("test-project", "test-instance", "test-db"); - - EXPECT_CALL(*mock, UpdateDatabase) - .WillOnce( - [&dbase](DatabaseAdminConnection::UpdateDatabaseParams const& p) { - EXPECT_EQ(p.database, dbase); - EXPECT_THAT(p.statements, ElementsAre("-- test only: NOT SQL")); - gsad::v1::UpdateDatabaseDdlMetadata metadata; - metadata.add_statements("-- test only: NOT SQL"); - return make_ready_future(make_status_or(metadata)); - }); - - DatabaseAdminClient client(std::move(mock)); - auto fut = client.UpdateDatabase(dbase, {"-- test only: NOT SQL"}); - ASSERT_EQ(std::future_status::ready, fut.wait_for(std::chrono::seconds(0))); - auto db = fut.get(); - ASSERT_STATUS_OK(db); - - EXPECT_THAT(db->statements(), ElementsAre("-- test only: NOT SQL")); -} - -TEST(DatabaseAdminClientTest, ListDatabases) { - auto mock = std::make_shared(); - Instance const expected_instance("test-project", "test-instance"); - EXPECT_CALL(*mock, ListDatabases) - .WillOnce([&expected_instance]( - DatabaseAdminConnection::ListDatabasesParams const& p) { - EXPECT_EQ(expected_instance, p.instance); - - return google::cloud::internal::MakePaginationRange( - gsad::v1::ListDatabasesRequest{}, - [](gsad::v1::ListDatabasesRequest const&) { - return StatusOr( - Status(StatusCode::kPermissionDenied, "uh-oh")); - }, - [](gsad::v1::ListDatabasesResponse const&) { - return std::vector{}; - }); - }); - - DatabaseAdminClient client(mock); - auto range = client.ListDatabases(expected_instance); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify DatabaseAdminClient uses GetIamPolicy() correctly. -TEST(DatabaseAdminClientTest, GetIamPolicy) { - auto mock = std::make_shared(); - Database const expected_db("test-project", "test-instance", "test-database"); - std::string const expected_role = "roles/spanner.databaseReader"; - std::string const expected_member = "user:foobar@example.com"; - EXPECT_CALL(*mock, GetIamPolicy) - .WillOnce([&expected_db, &expected_role, &expected_member]( - DatabaseAdminConnection::GetIamPolicyParams const& p) { - EXPECT_EQ(expected_db, p.database); - google::iam::v1::Policy response; - auto& binding = *response.add_bindings(); - binding.set_role(expected_role); - *binding.add_members() = expected_member; - return response; - }); - - DatabaseAdminClient client(std::move(mock)); - auto response = client.GetIamPolicy(expected_db); - ASSERT_STATUS_OK(response); - ASSERT_EQ(1, response->bindings().size()); - EXPECT_EQ(expected_role, response->bindings().Get(0).role()); - ASSERT_EQ(1, response->bindings().Get(0).members().size()); - EXPECT_EQ(expected_member, response->bindings().Get(0).members().Get(0)); -} - -/// @test Verify DatabaseAdminClient uses SetIamPolicy() correctly. -TEST(DatabaseAdminClientTest, SetIamPolicy) { - auto mock = std::make_shared(); - Database const expected_db("test-project", "test-instance", "test-database"); - EXPECT_CALL(*mock, SetIamPolicy) - .WillOnce( - [&expected_db](DatabaseAdminConnection::SetIamPolicyParams const& p) { - EXPECT_EQ(expected_db, p.database); - return p.policy; - }); - DatabaseAdminClient client(std::move(mock)); - auto response = client.SetIamPolicy(expected_db, google::iam::v1::Policy{}); - EXPECT_STATUS_OK(response); -} - -TEST(DatabaseAdminClientTest, SetIamPolicyOccGetFailure) { - Database const db("test-project", "test-instance", "test-database"); - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetIamPolicy) - .WillOnce([&db](DatabaseAdminConnection::GetIamPolicyParams const& p) { - EXPECT_EQ(db, p.database); - return Status(StatusCode::kPermissionDenied, "uh-oh"); - }); - - DatabaseAdminClient client(mock); - auto actual = client.SetIamPolicy(db, [](google::iam::v1::Policy const&) { - return absl::optional{}; - }); - EXPECT_THAT(actual, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(DatabaseAdminClientTest, SetIamPolicyOccNoUpdates) { - Database const db("test-project", "test-instance", "test-database"); - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetIamPolicy) - .WillOnce([&db](DatabaseAdminConnection::GetIamPolicyParams const& p) { - EXPECT_EQ(db, p.database); - google::iam::v1::Policy r; - r.set_etag("test-etag"); - return r; - }); - EXPECT_CALL(*mock, SetIamPolicy).Times(0); - - DatabaseAdminClient client(mock); - auto actual = client.SetIamPolicy(db, [](google::iam::v1::Policy const& p) { - EXPECT_EQ("test-etag", p.etag()); - return absl::optional{}; - }); - ASSERT_STATUS_OK(actual); - EXPECT_EQ("test-etag", actual->etag()); -} - -std::unique_ptr RerunPolicyForTesting() { - return LimitedErrorCountTransactionRerunPolicy(/*maximum_failures=*/3) - .clone(); -} - -std::unique_ptr BackoffPolicyForTesting() { - return ExponentialBackoffPolicy( - /*initial_delay=*/std::chrono::microseconds(1), - /*maximum_delay=*/std::chrono::microseconds(1), /*scaling=*/2.0) - .clone(); -} - -TEST(DatabaseAdminClientTest, SetIamPolicyOccRetryAborted) { - Database const db("test-project", "test-instance", "test-database"); - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetIamPolicy) - .WillOnce([&db](DatabaseAdminConnection::GetIamPolicyParams const& p) { - EXPECT_EQ(db, p.database); - google::iam::v1::Policy r; - r.set_etag("test-etag-1"); - return r; - }) - .WillOnce([&db](DatabaseAdminConnection::GetIamPolicyParams const& p) { - EXPECT_EQ(db, p.database); - google::iam::v1::Policy r; - r.set_etag("test-etag-2"); - return r; - }); - EXPECT_CALL(*mock, SetIamPolicy) - .WillOnce([&db](DatabaseAdminConnection::SetIamPolicyParams const& p) { - EXPECT_EQ(db, p.database); - EXPECT_EQ("test-etag-1", p.policy.etag()); - return Status(StatusCode::kAborted, "aborted"); - }) - .WillOnce([&db](DatabaseAdminConnection::SetIamPolicyParams const& p) { - EXPECT_EQ(db, p.database); - EXPECT_EQ("test-etag-2", p.policy.etag()); - google::iam::v1::Policy r; - r.set_etag("test-etag-3"); - return r; - }); - - DatabaseAdminClient client(mock); - int counter = 0; - auto actual = client.SetIamPolicy( - db, - [&counter](google::iam::v1::Policy p) { - EXPECT_EQ("test-etag-" + std::to_string(++counter), p.etag()); - return p; - }, - RerunPolicyForTesting(), BackoffPolicyForTesting()); - ASSERT_STATUS_OK(actual); - EXPECT_EQ("test-etag-3", actual->etag()); -} - -TEST(DatabaseAdminClientTest, SetIamPolicyOccRetryAbortedTooManyFailures) { - Database const db("test-project", "test-instance", "test-database"); - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetIamPolicy) - .WillRepeatedly( - [&db](DatabaseAdminConnection::GetIamPolicyParams const& p) { - EXPECT_EQ(db, p.database); - google::iam::v1::Policy r; - r.set_etag("test-etag-1"); - return r; - }); - EXPECT_CALL(*mock, SetIamPolicy) - .Times(AtLeast(2)) - .WillRepeatedly( - [&db](DatabaseAdminConnection::SetIamPolicyParams const& p) { - EXPECT_EQ(db, p.database); - EXPECT_EQ("test-etag-1", p.policy.etag()); - return Status(StatusCode::kAborted, "test-msg"); - }); - - DatabaseAdminClient client(mock); - auto actual = client.SetIamPolicy( - db, [](google::iam::v1::Policy p) { return p; }, RerunPolicyForTesting(), - BackoffPolicyForTesting()); - EXPECT_THAT(actual, StatusIs(StatusCode::kAborted, HasSubstr("test-msg"))); -} - -/// @test Verify DatabaseAdminClient uses TestIamPermissions() correctly. -TEST(DatabaseAdminClientTest, TestIamPermissions) { - auto mock = std::make_shared(); - Database const expected_db("test-project", "test-instance", "test-database"); - std::string expected_permission = "spanner.databases.read"; - EXPECT_CALL(*mock, TestIamPermissions) - .WillOnce( - [&expected_db, &expected_permission]( - DatabaseAdminConnection::TestIamPermissionsParams const& p) { - EXPECT_EQ(expected_db, p.database); - EXPECT_EQ(1, p.permissions.size()); - EXPECT_EQ(expected_permission, p.permissions.at(0)); - google::iam::v1::TestIamPermissionsResponse response; - response.add_permissions(expected_permission); - return response; - }); - DatabaseAdminClient client(std::move(mock)); - auto response = client.TestIamPermissions(expected_db, {expected_permission}); - ASSERT_STATUS_OK(response); - ASSERT_EQ(1, response->permissions_size()); - EXPECT_EQ(expected_permission, response->permissions(0)); -} - -/// @test Verify DatabaseAdminClient uses CreateBackup() correctly. -TEST(DatabaseAdminClientTest, CreateBackup) { - auto mock = std::make_shared(); - - Database dbase("test-project", "test-instance", "test-db"); - std::string backup_id = "test-backup"; - auto now = absl::Now(); - auto expire_time = MakeTimestamp(now + absl::Hours(7)).value(); - auto version_time = MakeTimestamp(now - absl::Hours(7)).value(); - Backup backup_name(dbase.instance(), backup_id); - EXPECT_CALL(*mock, CreateBackup) - .WillOnce([&dbase, &expire_time, &version_time, &backup_id, &backup_name]( - DatabaseAdminConnection::CreateBackupParams const& p) { - EXPECT_EQ(p.database, dbase); - EXPECT_EQ(MakeTimestamp(p.expire_time).value(), - MakeTimestamp( - expire_time.get() - .value()) - .value()); - EXPECT_EQ(p.expire_timestamp, expire_time); - EXPECT_EQ(p.version_time, version_time); - EXPECT_EQ(p.backup_id, backup_id); - gsad::v1::Backup backup; - backup.set_name(backup_name.FullName()); - backup.set_state(gsad::v1::Backup::CREATING); - return make_ready_future(make_status_or(backup)); - }) - .WillOnce([&dbase, &expire_time, &backup_id, &backup_name]( - DatabaseAdminConnection::CreateBackupParams const& p) { - EXPECT_EQ(p.database, dbase); - EXPECT_EQ(MakeTimestamp(p.expire_time).value(), - MakeTimestamp( - expire_time.get() - .value()) - .value()); - EXPECT_EQ(p.expire_timestamp, - MakeTimestamp( - expire_time.get() - .value()) - .value()); // loss of precision - EXPECT_FALSE(p.version_time.has_value()); - EXPECT_EQ(p.backup_id, backup_id); - gsad::v1::Backup backup; - backup.set_name(backup_name.FullName()); - backup.set_state(gsad::v1::Backup::CREATING); - return make_ready_future(make_status_or(backup)); - }); - - DatabaseAdminClient client(std::move(mock)); - auto fut = client.CreateBackup(dbase, backup_id, expire_time, version_time); - ASSERT_EQ(std::future_status::ready, fut.wait_for(std::chrono::seconds(0))); - auto backup = fut.get(); - ASSERT_STATUS_OK(backup); - EXPECT_EQ(backup_name.FullName(), backup->name()); - EXPECT_EQ(gsad::v1::Backup::CREATING, backup->state()); - - // Exercise the old interface with just a `time_point` expiration parameter. - fut = client.CreateBackup( - dbase, backup_id, - expire_time.get().value()); - ASSERT_EQ(std::future_status::ready, fut.wait_for(std::chrono::seconds(0))); - backup = fut.get(); - ASSERT_STATUS_OK(backup); - EXPECT_EQ(backup_name.FullName(), backup->name()); - EXPECT_EQ(gsad::v1::Backup::CREATING, backup->state()); -} - -/// @test Verify DatabaseAdminClient uses RestoreDatabase() correctly. -TEST(DatabaseAdminClientTest, RestoreDatabase) { - auto mock = std::make_shared(); - - Database dbase("test-project", "test-instance", "test-db"); - Backup backup(dbase.instance(), "test-backup"); - EXPECT_CALL(*mock, RestoreDatabase) - .WillOnce([&dbase, &backup]( - DatabaseAdminConnection::RestoreDatabaseParams const& p) { - EXPECT_EQ(p.database, dbase); - EXPECT_EQ(p.backup_full_name, backup.FullName()); - gsad::v1::Database database; - database.set_name(dbase.FullName()); - database.set_state(gsad::v1::Database::READY_OPTIMIZING); - return make_ready_future(make_status_or(database)); - }); - - DatabaseAdminClient client(std::move(mock)); - auto fut = client.RestoreDatabase(dbase, backup); - ASSERT_EQ(std::future_status::ready, fut.wait_for(std::chrono::seconds(0))); - auto database = fut.get(); - ASSERT_STATUS_OK(database); - - EXPECT_EQ(dbase.FullName(), database->name()); - EXPECT_EQ(gsad::v1::Database::READY_OPTIMIZING, database->state()); -} - -/// @test Verify DatabaseAdminClient uses RestoreDatabase() correctly. -TEST(DatabaseAdminClientTest, RestoreDatabaseOverload) { - auto mock = std::make_shared(); - - Database dbase("test-project", "test-instance", "test-db"); - Backup backup_name(dbase.instance(), "test-backup"); - gsad::v1::Backup backup; - backup.set_name(backup_name.FullName()); - EXPECT_CALL(*mock, RestoreDatabase) - .WillOnce([&dbase, &backup_name]( - DatabaseAdminConnection::RestoreDatabaseParams const& p) { - EXPECT_EQ(p.database, dbase); - EXPECT_EQ(p.backup_full_name, backup_name.FullName()); - gsad::v1::Database database; - database.set_name(dbase.FullName()); - database.set_state(gsad::v1::Database::READY_OPTIMIZING); - return make_ready_future(make_status_or(database)); - }); - - DatabaseAdminClient client(std::move(mock)); - auto fut = client.RestoreDatabase(dbase, backup); - ASSERT_EQ(std::future_status::ready, fut.wait_for(std::chrono::seconds(0))); - auto database = fut.get(); - ASSERT_STATUS_OK(database); - - EXPECT_EQ(dbase.FullName(), database->name()); - EXPECT_EQ(gsad::v1::Database::READY_OPTIMIZING, database->state()); -} - -/// @test Verify DatabaseAdminClient uses GetBackup() correctly. -TEST(DatabaseAdminClientTest, GetBackup) { - auto mock = std::make_shared(); - Backup backup(Instance("test-project", "test-instance"), "test-backup"); - - EXPECT_CALL(*mock, GetBackup) - .WillOnce([&backup](DatabaseAdminConnection::GetBackupParams const& p) { - EXPECT_EQ(backup.FullName(), p.backup_full_name); - gsad::v1::Backup response; - response.set_name(p.backup_full_name); - response.set_state(gsad::v1::Backup::READY); - return response; - }); - - DatabaseAdminClient client(std::move(mock)); - auto response = client.GetBackup(backup); - ASSERT_STATUS_OK(response); - EXPECT_EQ(gsad::v1::Backup::READY, response->state()); - EXPECT_EQ(backup.FullName(), response->name()); -} - -/// @test Verify DatabaseAdminClient uses DeleteBackup() correctly. -TEST(DatabaseAdminClientTest, DeleteBackup) { - auto mock = std::make_shared(); - Backup backup(Instance("test-project", "test-instance"), "test-backup"); - - EXPECT_CALL(*mock, DeleteBackup) - .WillOnce( - [&backup](DatabaseAdminConnection::DeleteBackupParams const& p) { - EXPECT_EQ(backup.FullName(), p.backup_full_name); - return Status(); - }); - - DatabaseAdminClient client(std::move(mock)); - auto response = client.DeleteBackup(backup); - EXPECT_STATUS_OK(response); -} - -/// @test Verify DatabaseAdminClient uses DeleteBackup() correctly. -TEST(DatabaseAdminClientTest, DeleteBackupOverload) { - auto mock = std::make_shared(); - Backup backup_name(Instance("test-project", "test-instance"), "test-backup"); - gsad::v1::Backup backup; - backup.set_name(backup_name.FullName()); - - EXPECT_CALL(*mock, DeleteBackup) - .WillOnce( - [&backup_name](DatabaseAdminConnection::DeleteBackupParams const& p) { - EXPECT_EQ(backup_name.FullName(), p.backup_full_name); - return Status(); - }); - - DatabaseAdminClient client(std::move(mock)); - auto response = client.DeleteBackup(backup); - EXPECT_STATUS_OK(response); -} - -TEST(DatabaseAdminClientTest, ListBackups) { - auto mock = std::make_shared(); - Instance const expected_instance("test-project", "test-instance"); - std::string expected_filter("test-filter"); - EXPECT_CALL(*mock, ListBackups) - .WillOnce([&expected_instance, &expected_filter]( - DatabaseAdminConnection::ListBackupsParams const& p) { - EXPECT_EQ(expected_instance, p.instance); - EXPECT_EQ(expected_filter, p.filter); - - return google::cloud::internal::MakePaginationRange( - gsad::v1::ListBackupsRequest{}, - [](gsad::v1::ListBackupsRequest const&) { - return StatusOr( - Status(StatusCode::kPermissionDenied, "uh-oh")); - }, - [](gsad::v1::ListBackupsResponse const&) { - return std::vector{}; - }); - }); - - DatabaseAdminClient client(mock); - auto range = client.ListBackups(expected_instance, expected_filter); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify DatabaseAdminClient uses GetBackup() correctly. -TEST(DatabaseAdminClientTest, UpdateBackupExpireTime) { - auto mock = std::make_shared(); - Backup backup(Instance("test-project", "test-instance"), "test-backup"); - auto expire_time = MakeTimestamp(absl::Now() + absl::Hours(7)).value(); - - EXPECT_CALL(*mock, UpdateBackup) - .WillOnce([&backup, &expire_time]( - DatabaseAdminConnection::UpdateBackupParams const& p) { - EXPECT_EQ(backup.FullName(), p.request.backup().name()); - EXPECT_THAT(expire_time, - MakeTimestamp(p.request.backup().expire_time()).value()); - gsad::v1::Backup response; - response.set_name(p.request.backup().name()); - *response.mutable_expire_time() = p.request.backup().expire_time(); - response.set_state(gsad::v1::Backup::READY); - return response; - }) - .WillOnce([&backup, &expire_time]( - DatabaseAdminConnection::UpdateBackupParams const& p) { - EXPECT_EQ(backup.FullName(), p.request.backup().name()); - EXPECT_THAT(MakeTimestamp( - expire_time.get() - .value()) - .value(), // loss of precision - MakeTimestamp(p.request.backup().expire_time()).value()); - gsad::v1::Backup response; - response.set_name(p.request.backup().name()); - *response.mutable_expire_time() = p.request.backup().expire_time(); - response.set_state(gsad::v1::Backup::READY); - return response; - }); - - DatabaseAdminClient client(std::move(mock)); - auto response = client.UpdateBackupExpireTime(backup, expire_time); - ASSERT_STATUS_OK(response); - EXPECT_EQ(gsad::v1::Backup::READY, response->state()); - EXPECT_EQ(backup.FullName(), response->name()); - EXPECT_THAT(expire_time, MakeTimestamp(response->expire_time()).value()); - - // Exercise the old interface with a `time_point` expiration parameter. - response = client.UpdateBackupExpireTime( - backup, expire_time.get().value()); - ASSERT_STATUS_OK(response); - EXPECT_EQ(gsad::v1::Backup::READY, response->state()); - EXPECT_EQ(backup.FullName(), response->name()); - EXPECT_THAT( - MakeTimestamp( - expire_time.get().value()) - .value(), // loss of precision - MakeTimestamp(response->expire_time()).value()); -} - -/// @test Verify DatabaseAdminClient uses GetBackup() correctly. -TEST(DatabaseAdminClientTest, UpdateBackupExpireTimeOverload) { - auto mock = std::make_shared(); - Backup backup_name(Instance("test-project", "test-instance"), "test-backup"); - gsad::v1::Backup backup; - backup.set_name(backup_name.FullName()); - auto expire_time = MakeTimestamp(absl::Now() + absl::Hours(7)).value(); - - EXPECT_CALL(*mock, UpdateBackup) - .WillOnce([&backup_name, &expire_time]( - DatabaseAdminConnection::UpdateBackupParams const& p) { - EXPECT_EQ(backup_name.FullName(), p.request.backup().name()); - EXPECT_THAT(expire_time, - MakeTimestamp(p.request.backup().expire_time()).value()); - gsad::v1::Backup response; - response.set_name(p.request.backup().name()); - *response.mutable_expire_time() = p.request.backup().expire_time(); - response.set_state(gsad::v1::Backup::READY); - return response; - }) - .WillOnce([&backup_name, &expire_time]( - DatabaseAdminConnection::UpdateBackupParams const& p) { - EXPECT_EQ(backup_name.FullName(), p.request.backup().name()); - EXPECT_THAT(MakeTimestamp( - expire_time.get() - .value()) - .value(), // loss of precision - MakeTimestamp(p.request.backup().expire_time()).value()); - gsad::v1::Backup response; - response.set_name(p.request.backup().name()); - *response.mutable_expire_time() = p.request.backup().expire_time(); - response.set_state(gsad::v1::Backup::READY); - return response; - }); - - DatabaseAdminClient client(std::move(mock)); - auto response = client.UpdateBackupExpireTime(backup, expire_time); - ASSERT_STATUS_OK(response); - EXPECT_EQ(gsad::v1::Backup::READY, response->state()); - EXPECT_EQ(backup_name.FullName(), response->name()); - EXPECT_THAT(expire_time, MakeTimestamp(response->expire_time()).value()); - - // Exercise the old interface with a `time_point` expiration parameter. - response = client.UpdateBackupExpireTime( - backup, expire_time.get().value()); - ASSERT_STATUS_OK(response); - EXPECT_EQ(gsad::v1::Backup::READY, response->state()); - EXPECT_EQ(backup_name.FullName(), response->name()); - EXPECT_THAT( - MakeTimestamp( - expire_time.get().value()) - .value(), // loss of precision - MakeTimestamp(response->expire_time()).value()); -} - -TEST(DatabaseAdminClientTest, ListBackupOperations) { - auto mock = std::make_shared(); - Instance const expected_instance("test-project", "test-instance"); - std::string expected_filter("test-filter"); - EXPECT_CALL(*mock, ListBackupOperations) - .WillOnce( - [&expected_instance, &expected_filter]( - DatabaseAdminConnection::ListBackupOperationsParams const& p) { - EXPECT_EQ(expected_instance, p.instance); - EXPECT_EQ(expected_filter, p.filter); - - return google::cloud::internal::MakePaginationRange< - ListBackupOperationsRange>( - gsad::v1::ListBackupOperationsRequest{}, - [](gsad::v1::ListBackupOperationsRequest const&) { - return StatusOr( - Status(StatusCode::kPermissionDenied, "uh-oh")); - }, - [](gsad::v1::ListBackupOperationsResponse const&) { - return std::vector{}; - }); - }); - - DatabaseAdminClient client(mock); - auto range = client.ListBackupOperations(expected_instance, expected_filter); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(DatabaseAdminClientTest, ListDatabaseOperations) { - auto mock = std::make_shared(); - Instance const expected_instance("test-project", "test-instance"); - std::string expected_filter("test-filter"); - EXPECT_CALL(*mock, ListDatabaseOperations) - .WillOnce( - [&expected_instance, &expected_filter]( - DatabaseAdminConnection::ListDatabaseOperationsParams const& p) { - EXPECT_EQ(expected_instance, p.instance); - EXPECT_EQ(expected_filter, p.filter); - - return google::cloud::internal::MakePaginationRange< - ListDatabaseOperationsRange>( - gsad::v1::ListDatabaseOperationsRequest{}, - [](gsad::v1::ListDatabaseOperationsRequest const&) { - return StatusOr( - Status(StatusCode::kPermissionDenied, "uh-oh")); - }, - [](gsad::v1::ListDatabaseOperationsResponse const&) { - return std::vector{}; - }); - }); - - DatabaseAdminClient client(mock); - auto range = - client.ListDatabaseOperations(expected_instance, expected_filter); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kPermissionDenied)); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner -} // namespace cloud -} // namespace google diff --git a/google/cloud/spanner/database_admin_connection.cc b/google/cloud/spanner/database_admin_connection.cc deleted file mode 100644 index 310585993fd58..0000000000000 --- a/google/cloud/spanner/database_admin_connection.cc +++ /dev/null @@ -1,680 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO(#7356): Remove this file after the deprecation period expires -#include "google/cloud/internal/disable_deprecation_warnings.inc" -#include "google/cloud/spanner/database_admin_connection.h" -#include "google/cloud/spanner/internal/defaults.h" -#include "google/cloud/spanner/options.h" -#include "google/cloud/spanner/timestamp.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/retry_loop.h" -#include "google/cloud/options.h" -#include -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -namespace gsad = ::google::spanner::admin::database; - -using ::google::cloud::Idempotency; -using ::google::cloud::internal::RetryLoop; - -future> -// NOLINTNEXTLINE(performance-unnecessary-value-param) -DatabaseAdminConnection::CreateBackup(CreateBackupParams) { - return google::cloud::make_ready_future(StatusOr( - Status(StatusCode::kUnimplemented, "not implemented"))); -} - -future> -// NOLINTNEXTLINE(performance-unnecessary-value-param) -DatabaseAdminConnection::RestoreDatabase(RestoreDatabaseParams) { - return google::cloud::make_ready_future(StatusOr( - Status(StatusCode::kUnimplemented, "not implemented"))); -} - -StatusOr -// NOLINTNEXTLINE(performance-unnecessary-value-param) -DatabaseAdminConnection::GetBackup(GetBackupParams) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - -// NOLINTNEXTLINE(performance-unnecessary-value-param) -Status DatabaseAdminConnection::DeleteBackup(DeleteBackupParams) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - -// NOLINTNEXTLINE(performance-unnecessary-value-param) -ListBackupsRange DatabaseAdminConnection::ListBackups(ListBackupsParams) { - return google::cloud::internal::MakePaginationRange( - gsad::v1::ListBackupsRequest{}, - [](gsad::v1::ListBackupsRequest const&) { - return StatusOr( - Status(StatusCode::kUnimplemented, "not implemented")); - }, - [](gsad::v1::ListBackupsResponse const&) { - return std::vector{}; - }); -} - -StatusOr -// NOLINTNEXTLINE(performance-unnecessary-value-param) -DatabaseAdminConnection::UpdateBackup(UpdateBackupParams) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - -ListBackupOperationsRange DatabaseAdminConnection::ListBackupOperations( - // NOLINTNEXTLINE(performance-unnecessary-value-param) - ListBackupOperationsParams) { - return google::cloud::internal::MakePaginationRange< - ListBackupOperationsRange>( - gsad::v1::ListBackupOperationsRequest{}, - [](gsad::v1::ListBackupOperationsRequest const&) { - return StatusOr( - Status(StatusCode::kUnimplemented, "not implemented")); - }, - [](gsad::v1::ListBackupOperationsResponse const&) { - return std::vector{}; - }); -} - -ListDatabaseOperationsRange DatabaseAdminConnection::ListDatabaseOperations( - // NOLINTNEXTLINE(performance-unnecessary-value-param) - ListDatabaseOperationsParams) { - return google::cloud::internal::MakePaginationRange< - ListDatabaseOperationsRange>( - gsad::v1::ListDatabaseOperationsRequest{}, - [](gsad::v1::ListDatabaseOperationsRequest const&) { - return StatusOr( - Status(StatusCode::kUnimplemented, "not implemented")); - }, - [](gsad::v1::ListDatabaseOperationsResponse const&) { - return std::vector{}; - }); -} - -namespace { - -class DatabaseAdminConnectionImpl : public DatabaseAdminConnection { - public: - // Note all the policies will be set to their default non-null values in the - // `MakeDatabaseAdminConnection()` function below. - explicit DatabaseAdminConnectionImpl( - std::shared_ptr stub, Options opts) - : stub_(std::move(stub)), - opts_(std::move(opts)), - retry_policy_prototype_(opts_.get()->clone()), - backoff_policy_prototype_( - opts_.get()->clone()), - polling_policy_prototype_( - opts_.get()->clone()), - background_threads_(internal::MakeBackgroundThreadsFactory(opts_)()) {} - - ~DatabaseAdminConnectionImpl() override = default; - - Options options() override { return opts_; } - - future> - CreateDatabase(CreateDatabaseParams p) override { - gsad::v1::CreateDatabaseRequest request; - request.set_parent(p.database.instance().FullName()); - request.set_create_statement("CREATE DATABASE `" + - p.database.database_id() + "`"); - struct EncryptionVisitor { - explicit EncryptionVisitor(gsad::v1::CreateDatabaseRequest& request) - : request_(request) {} - void operator()(DefaultEncryption const&) const { - // No encryption_config => GOOGLE_DEFAULT_ENCRYPTION. - } - void operator()(GoogleEncryption const&) const { - // No encryption_config => GOOGLE_DEFAULT_ENCRYPTION. - } - void operator()(CustomerManagedEncryption const& cme) const { - auto* config = request_.mutable_encryption_config(); - config->set_kms_key_name(cme.encryption_key().FullName()); - } - gsad::v1::CreateDatabaseRequest& request_; - }; - absl::visit(EncryptionVisitor(request), p.encryption_config); - for (auto& s : p.extra_statements) { - *request.add_extra_statements() = std::move(s); - } - return google::cloud::internal::AsyncLongRunningOperation< - gsad::v1::Database>( - background_threads_->cq(), internal::SaveCurrentOptions(), - std::move(request), - [stub = stub_](google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - gsad::v1::CreateDatabaseRequest const& request) { - return stub->AsyncCreateDatabase(cq, std::move(context), request); - }, - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - google::longrunning::GetOperationRequest const& request) { - return stub->AsyncGetOperation(cq, std::move(context), request); - }, - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - google::longrunning::CancelOperationRequest const& request) { - return stub->AsyncCancelOperation(cq, std::move(context), request); - }, - &google::cloud::internal::ExtractLongRunningResultResponse< - gsad::v1::Database>, - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kNonIdempotent, polling_policy_prototype_->clone(), - __func__); - } - - StatusOr GetDatabase( - GetDatabaseParams p) override { - gsad::v1::GetDatabaseRequest request; - request.set_name(p.database.FullName()); - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kIdempotent, - [this](grpc::ClientContext& context, - gsad::v1::GetDatabaseRequest const& request) { - return stub_->GetDatabase(context, request); - }, - request, __func__); - } - - StatusOr - GetDatabaseDdl(GetDatabaseDdlParams p) override { - gsad::v1::GetDatabaseDdlRequest request; - request.set_database(p.database.FullName()); - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kIdempotent, - [this](grpc::ClientContext& context, - gsad::v1::GetDatabaseDdlRequest const& request) { - return stub_->GetDatabaseDdl(context, request); - }, - request, __func__); - } - - future< - StatusOr> - UpdateDatabase(UpdateDatabaseParams p) override { - gsad::v1::UpdateDatabaseDdlRequest request; - request.set_database(p.database.FullName()); - for (auto& s : p.statements) { - *request.add_statements() = std::move(s); - } - return google::cloud::internal::AsyncLongRunningOperation< - gsad::v1::UpdateDatabaseDdlMetadata>( - background_threads_->cq(), internal::SaveCurrentOptions(), - std::move(request), - [stub = stub_](google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - gsad::v1::UpdateDatabaseDdlRequest const& request) { - return stub->AsyncUpdateDatabaseDdl(cq, std::move(context), request); - }, - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - google::longrunning::GetOperationRequest const& request) { - return stub->AsyncGetOperation(cq, std::move(context), request); - }, - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - google::longrunning::CancelOperationRequest const& request) { - return stub->AsyncCancelOperation(cq, std::move(context), request); - }, - &google::cloud::internal::ExtractLongRunningResultMetadata< - gsad::v1::UpdateDatabaseDdlMetadata>, - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kNonIdempotent, polling_policy_prototype_->clone(), - __func__); - } - - Status DropDatabase(DropDatabaseParams p) override { - google::spanner::admin::database::v1::DropDatabaseRequest request; - request.set_database(p.database.FullName()); - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kIdempotent, - [this](grpc::ClientContext& context, - gsad::v1::DropDatabaseRequest const& request) { - return stub_->DropDatabase(context, request); - }, - request, __func__); - } - - ListDatabaseRange ListDatabases(ListDatabasesParams p) override { - gsad::v1::ListDatabasesRequest request; - request.set_parent(p.instance.FullName()); - request.clear_page_token(); - auto& stub = stub_; - // Because we do not have C++14 generalized lambda captures we cannot just - // use the unique_ptr<> here, so convert to shared_ptr<> instead. - auto retry = - std::shared_ptr(retry_policy_prototype_->clone()); - auto backoff = std::shared_ptr( - backoff_policy_prototype_->clone()); - - char const* function_name = __func__; - return google::cloud::internal::MakePaginationRange( - std::move(request), - [stub, retry, backoff, - function_name](gsad::v1::ListDatabasesRequest const& r) { - return RetryLoop( - retry->clone(), backoff->clone(), Idempotency::kIdempotent, - [stub](grpc::ClientContext& context, - gsad::v1::ListDatabasesRequest const& request) { - return stub->ListDatabases(context, request); - }, - r, function_name); - }, - [](gsad::v1::ListDatabasesResponse r) { - std::vector result(r.databases().size()); - auto& dbs = *r.mutable_databases(); - std::move(dbs.begin(), dbs.end(), result.begin()); - return result; - }); - } - - future> - RestoreDatabase(RestoreDatabaseParams p) override { - gsad::v1::RestoreDatabaseRequest request; - request.set_parent(p.database.instance().FullName()); - request.set_database_id(p.database.database_id()); - request.set_backup(std::move(p.backup_full_name)); - struct EncryptionVisitor { - explicit EncryptionVisitor(gsad::v1::RestoreDatabaseRequest& request) - : request_(request) {} - void operator()(DefaultEncryption const&) const { - // No encryption_config => USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION. - // That is, use the same encryption configuration as the backup. - } - void operator()(GoogleEncryption const&) const { - auto* config = request_.mutable_encryption_config(); - config->set_encryption_type(gsad::v1::RestoreDatabaseEncryptionConfig:: - GOOGLE_DEFAULT_ENCRYPTION); - } - void operator()(CustomerManagedEncryption const& cme) const { - auto* config = request_.mutable_encryption_config(); - config->set_encryption_type(gsad::v1::RestoreDatabaseEncryptionConfig:: - CUSTOMER_MANAGED_ENCRYPTION); - config->set_kms_key_name(cme.encryption_key().FullName()); - } - gsad::v1::RestoreDatabaseRequest& request_; - }; - absl::visit(EncryptionVisitor(request), p.encryption_config); - return google::cloud::internal::AsyncLongRunningOperation< - gsad::v1::Database>( - background_threads_->cq(), internal::SaveCurrentOptions(), - std::move(request), - [stub = stub_](google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - gsad::v1::RestoreDatabaseRequest const& request) { - return stub->AsyncRestoreDatabase(cq, std::move(context), request); - }, - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - google::longrunning::GetOperationRequest const& request) { - return stub->AsyncGetOperation(cq, std::move(context), request); - }, - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - google::longrunning::CancelOperationRequest const& request) { - return stub->AsyncCancelOperation(cq, std::move(context), request); - }, - &google::cloud::internal::ExtractLongRunningResultResponse< - gsad::v1::Database>, - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kNonIdempotent, polling_policy_prototype_->clone(), - __func__); - } - - StatusOr GetIamPolicy( - GetIamPolicyParams p) override { - google::iam::v1::GetIamPolicyRequest request; - request.set_resource(p.database.FullName()); - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kIdempotent, - [this](grpc::ClientContext& context, - google::iam::v1::GetIamPolicyRequest const& request) { - return stub_->GetIamPolicy(context, request); - }, - request, __func__); - } - - StatusOr SetIamPolicy( - SetIamPolicyParams p) override { - google::iam::v1::SetIamPolicyRequest request; - request.set_resource(p.database.FullName()); - *request.mutable_policy() = std::move(p.policy); - auto const idempotency = request.policy().etag().empty() - ? Idempotency::kNonIdempotent - : Idempotency::kIdempotent; - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - idempotency, - [this](grpc::ClientContext& context, - google::iam::v1::SetIamPolicyRequest const& request) { - return stub_->SetIamPolicy(context, request); - }, - request, __func__); - } - - StatusOr TestIamPermissions( - TestIamPermissionsParams p) override { - google::iam::v1::TestIamPermissionsRequest request; - request.set_resource(p.database.FullName()); - for (auto& permission : p.permissions) { - request.add_permissions(std::move(permission)); - } - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kIdempotent, - [this](grpc::ClientContext& context, - google::iam::v1::TestIamPermissionsRequest const& request) { - return stub_->TestIamPermissions(context, request); - }, - request, __func__); - } - - future> CreateBackup( - CreateBackupParams p) override { - gsad::v1::CreateBackupRequest request; - request.set_parent(p.database.instance().FullName()); - request.set_backup_id(p.backup_id); - auto& backup = *request.mutable_backup(); - backup.set_database(p.database.FullName()); - // `p.expire_time` is deprecated and ignored here. - *backup.mutable_expire_time() = - p.expire_timestamp.get().value(); - if (p.version_time) { - *backup.mutable_version_time() = - p.version_time->get().value(); - } - struct EncryptionVisitor { - explicit EncryptionVisitor(gsad::v1::CreateBackupRequest& request) - : request_(request) {} - void operator()(DefaultEncryption const&) const { - // No encryption_config => USE_DATABASE_ENCRYPTION. - // That is, use the same encryption configuration as the database. - } - void operator()(GoogleEncryption const&) const { - auto* config = request_.mutable_encryption_config(); - config->set_encryption_type( - gsad::v1::CreateBackupEncryptionConfig::GOOGLE_DEFAULT_ENCRYPTION); - } - void operator()(CustomerManagedEncryption const& cme) const { - auto* config = request_.mutable_encryption_config(); - config->set_encryption_type(gsad::v1::CreateBackupEncryptionConfig:: - CUSTOMER_MANAGED_ENCRYPTION); - config->set_kms_key_name(cme.encryption_key().FullName()); - } - gsad::v1::CreateBackupRequest& request_; - }; - absl::visit(EncryptionVisitor(request), p.encryption_config); - return google::cloud::internal::AsyncLongRunningOperation( - background_threads_->cq(), internal::SaveCurrentOptions(), - std::move(request), - [stub = stub_](google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - gsad::v1::CreateBackupRequest const& request) { - return stub->AsyncCreateBackup(cq, std::move(context), request); - }, - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - google::longrunning::GetOperationRequest const& request) { - return stub->AsyncGetOperation(cq, std::move(context), request); - }, - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - google::longrunning::CancelOperationRequest const& request) { - return stub->AsyncCancelOperation(cq, std::move(context), request); - }, - &google::cloud::internal::ExtractLongRunningResultResponse< - gsad::v1::Backup>, - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kNonIdempotent, polling_policy_prototype_->clone(), - __func__); - } - - StatusOr GetBackup( - GetBackupParams p) override { - gsad::v1::GetBackupRequest request; - request.set_name(p.backup_full_name); - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kIdempotent, - [this](grpc::ClientContext& context, - gsad::v1::GetBackupRequest const& request) { - return stub_->GetBackup(context, request); - }, - request, __func__); - } - - Status DeleteBackup(DeleteBackupParams p) override { - google::spanner::admin::database::v1::DeleteBackupRequest request; - request.set_name(p.backup_full_name); - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kIdempotent, - [this](grpc::ClientContext& context, - gsad::v1::DeleteBackupRequest const& request) { - return stub_->DeleteBackup(context, request); - }, - request, __func__); - } - - ListBackupsRange ListBackups(ListBackupsParams p) override { - gsad::v1::ListBackupsRequest request; - request.set_parent(p.instance.FullName()); - request.set_filter(std::move(p.filter)); - auto& stub = stub_; - // Because we do not have C++14 generalized lambda captures we cannot just - // use the unique_ptr<> here, so convert to shared_ptr<> instead. - auto retry = - std::shared_ptr(retry_policy_prototype_->clone()); - auto backoff = std::shared_ptr( - backoff_policy_prototype_->clone()); - - char const* function_name = __func__; - return google::cloud::internal::MakePaginationRange( - std::move(request), - [stub, retry, backoff, - function_name](gsad::v1::ListBackupsRequest const& r) { - return RetryLoop( - retry->clone(), backoff->clone(), Idempotency::kIdempotent, - [stub](grpc::ClientContext& context, - gsad::v1::ListBackupsRequest const& request) { - return stub->ListBackups(context, request); - }, - r, function_name); - }, - [](gsad::v1::ListBackupsResponse r) { - std::vector result(r.backups().size()); - auto& backups = *r.mutable_backups(); - std::move(backups.begin(), backups.end(), result.begin()); - return result; - }); - } - - StatusOr UpdateBackup( - UpdateBackupParams p) override { - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kIdempotent, - [this](grpc::ClientContext& context, - gsad::v1::UpdateBackupRequest const& request) { - return stub_->UpdateBackup(context, request); - }, - p.request, __func__); - } - - ListBackupOperationsRange ListBackupOperations( - ListBackupOperationsParams p) override { - gsad::v1::ListBackupOperationsRequest request; - request.set_parent(p.instance.FullName()); - request.set_filter(std::move(p.filter)); - auto& stub = stub_; - // Because we do not have C++14 generalized lambda captures we cannot just - // use the unique_ptr<> here, so convert to shared_ptr<> instead. - auto retry = - std::shared_ptr(retry_policy_prototype_->clone()); - auto backoff = std::shared_ptr( - backoff_policy_prototype_->clone()); - - char const* function_name = __func__; - return google::cloud::internal::MakePaginationRange< - ListBackupOperationsRange>( - std::move(request), - [stub, retry, backoff, - function_name](gsad::v1::ListBackupOperationsRequest const& r) { - return RetryLoop( - retry->clone(), backoff->clone(), Idempotency::kIdempotent, - [stub](grpc::ClientContext& context, - gsad::v1::ListBackupOperationsRequest const& request) { - return stub->ListBackupOperations(context, request); - }, - r, function_name); - }, - [](gsad::v1::ListBackupOperationsResponse r) { - std::vector result( - r.operations().size()); - auto& operations = *r.mutable_operations(); - std::move(operations.begin(), operations.end(), result.begin()); - return result; - }); - } - - ListDatabaseOperationsRange ListDatabaseOperations( - ListDatabaseOperationsParams p) override { - gsad::v1::ListDatabaseOperationsRequest request; - request.set_parent(p.instance.FullName()); - request.set_filter(std::move(p.filter)); - auto& stub = stub_; - // Because we do not have C++14 generalized lambda captures we cannot just - // use the unique_ptr<> here, so convert to shared_ptr<> instead. - auto retry = - std::shared_ptr(retry_policy_prototype_->clone()); - auto backoff = std::shared_ptr( - backoff_policy_prototype_->clone()); - - char const* function_name = __func__; - return google::cloud::internal::MakePaginationRange< - ListDatabaseOperationsRange>( - std::move(request), - [stub, retry, backoff, - function_name](gsad::v1::ListDatabaseOperationsRequest const& r) { - return RetryLoop( - retry->clone(), backoff->clone(), Idempotency::kIdempotent, - [stub](grpc::ClientContext& context, - gsad::v1::ListDatabaseOperationsRequest const& request) { - return stub->ListDatabaseOperations(context, request); - }, - r, function_name); - }, - [](gsad::v1::ListDatabaseOperationsResponse r) { - std::vector result( - r.operations().size()); - auto& operations = *r.mutable_operations(); - std::move(operations.begin(), operations.end(), result.begin()); - return result; - }); - } - - private: - std::shared_ptr stub_; - Options opts_; - std::unique_ptr retry_policy_prototype_; - std::unique_ptr backoff_policy_prototype_; - std::unique_ptr polling_policy_prototype_; - - // Implementations of `BackgroundThreads` typically create a pool of - // threads that are joined during destruction, so, to avoid ownership - // cycles, those threads should never assume ownership of this object - // (e.g., via a `std::shared_ptr<>`). - std::unique_ptr background_threads_; -}; - -} // namespace - -DatabaseAdminConnection::~DatabaseAdminConnection() = default; - -std::shared_ptr MakeDatabaseAdminConnection( - Options opts) { - internal::CheckExpectedOptions(opts, __func__); - opts = spanner_internal::DefaultAdminOptions(std::move(opts)); - auto stub = spanner_internal::CreateDefaultDatabaseAdminStub(opts); - return std::make_shared( - std::move(stub), std::move(opts)); -} - -std::shared_ptr MakeDatabaseAdminConnection( - ConnectionOptions const& options) { - return MakeDatabaseAdminConnection(internal::MakeOptions(options)); -} - -std::shared_ptr MakeDatabaseAdminConnection( - ConnectionOptions const& options, std::unique_ptr retry_policy, - std::unique_ptr backoff_policy, - std::unique_ptr polling_policy) { - auto opts = internal::MakeOptions(options); - opts.set(std::move(retry_policy)); - opts.set(std::move(backoff_policy)); - opts.set(std::move(polling_policy)); - return MakeDatabaseAdminConnection(std::move(opts)); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner - -namespace spanner_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -std::shared_ptr -MakeDatabaseAdminConnectionForTesting(std::shared_ptr stub, - Options opts) { - opts = spanner_internal::DefaultAdminOptions(std::move(opts)); - return std::make_shared( - std::move(stub), std::move(opts)); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/spanner/database_admin_connection.h b/google/cloud/spanner/database_admin_connection.h deleted file mode 100644 index 588d5b6305e36..0000000000000 --- a/google/cloud/spanner/database_admin_connection.h +++ /dev/null @@ -1,419 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_SPANNER_DATABASE_ADMIN_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_DATABASE_ADMIN_CONNECTION_H - -#include "google/cloud/spanner/backoff_policy.h" -#include "google/cloud/spanner/backup.h" -#include "google/cloud/spanner/database.h" -#include "google/cloud/spanner/encryption_config.h" -#include "google/cloud/spanner/instance.h" -#include "google/cloud/spanner/internal/database_admin_stub.h" -#include "google/cloud/spanner/polling_policy.h" -#include "google/cloud/spanner/retry_policy.h" -#include "google/cloud/spanner/timestamp.h" -#include "google/cloud/spanner/version.h" -#include "google/cloud/backoff_policy.h" -#include "google/cloud/internal/pagination_range.h" -#include "google/cloud/options.h" -#include "absl/types/optional.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * An input range to stream all the databases in a Cloud Spanner instance. - * - * This type models an [input range][cppref-input-range] of - * `google::spanner::admin::v1::Database` objects. Applications can make a - * single pass through the results. - * - * [cppref-input-range]: https://en.cppreference.com/w/cpp/ranges/input_range - */ -using ListDatabaseRange = ::google::cloud::internal::PaginationRange< - google::spanner::admin::database::v1::Database>; - -/** - * An input range to stream backup operations in Cloud Spanner instance. - * - * This type models an [input range][cppref-input-range] of - * `google::longrunning::Operation` objects. Applications can make a - * single pass through the results. - * - * [cppref-input-range]: https://en.cppreference.com/w/cpp/ranges/input_range - */ -using ListBackupOperationsRange = - google::cloud::internal::PaginationRange; - -/** - * An input range to stream database operations in Cloud Spanner instance. - * - * This type models an [input range][cppref-input-range] of - * `google::longrunning::Operation` objects. Applications can make a - * single pass through the results. - * - * [cppref-input-range]: https://en.cppreference.com/w/cpp/ranges/input_range - */ -using ListDatabaseOperationsRange = - google::cloud::internal::PaginationRange; - -/** - * An input range to stream backups in Cloud Spanner instance. - * - * This type models an [input range][cppref-input-range] of - * `google::longrunning::Operation` objects. Applications can make a - * single pass through the results. - * - * [cppref-input-range]: https://en.cppreference.com/w/cpp/ranges/input_range - */ -using ListBackupsRange = ::google::cloud::internal::PaginationRange< - google::spanner::admin::database::v1::Backup>; - -/** - * A connection to the Cloud Spanner instance administration service. - * - * @deprecated Please use #google::cloud::spanner_admin::DatabaseAdminClient - * and #google::cloud::spanner_admin::DatabaseAdminConnection instead. - * - * This interface defines pure-virtual methods for each of the user-facing - * overload sets in `DatabaseAdminClient`. This allows users to inject custom - * behavior (e.g., with a Google Mock object) in a `DatabaseAdminClient` object - * for use in their own tests. - * - * To create a concrete instance that connects you to a real Cloud Spanner - * instance administration service, see `MakeDatabaseAdminConnection()`. - */ -class GOOGLE_CLOUD_CPP_SPANNER_ADMIN_API_DEPRECATED("DatabaseAdminConnection") - DatabaseAdminConnection { - public: - virtual ~DatabaseAdminConnection() = 0; - - ///@{ - /** - * @name Define the arguments for each member function. - * - * Applications may define classes derived from `DatabaseAdminConnection`, for - * example, because they want to mock the class. To avoid breaking all such - * derived classes when we change the number or type of the arguments to the - * member functions we define light weight structures to pass the arguments. - */ - /// Wrap the arguments for `CreateDatabase()`. - struct CreateDatabaseParams { - /// The name of the database. - Database database; - /// Any additional statements to execute after creating the database. - std::vector extra_statements; - /// How to encrypt the database. - EncryptionConfig encryption_config; - }; - - /// Wrap the arguments for `GetDatabase()`. - struct GetDatabaseParams { - /// The name of the database. - Database database; - }; - - /// Wrap the arguments for `GetDatabaseDdl()`. - struct GetDatabaseDdlParams { - /// The name of the database. - Database database; - }; - - /// Wrap the arguments for `UpdateDatabase()`. - struct UpdateDatabaseParams { - /// The name of the database. - Database database; - /// The DDL statements updating the database schema. - std::vector statements; - }; - - /// Wrap the arguments for `DropDatabase()`. - struct DropDatabaseParams { - /// The name of the database. - Database database; - }; - - /// Wrap the arguments for `ListDatabases()`. - struct ListDatabasesParams { - /// The name of the instance. - Instance instance; - }; - - /// Wrap the arguments for `GetIamPolicy()`. - struct GetIamPolicyParams { - /// The name of the database. - Database database; - }; - - /// Wrap the arguments for `SetIamPolicy()`. - struct SetIamPolicyParams { - /// The name of the database. - Database database; - google::iam::v1::Policy policy; - }; - - /// Wrap the arguments for `TestIamPermissions()`. - struct TestIamPermissionsParams { - /// The name of the database. - Database database; - std::vector permissions; - }; - - /// Wrap the arguments for `CreateBackup()`. - struct CreateBackupParams { - /// The name of the database. - Database database; - std::string backup_id; - /// @deprecated `DatabaseAdminClient::CreateBackup()` initializes - /// `expire_time`, but `DatabaseAdminConnection::CreateBackup()` now - /// ignores it. Use `expire_timestamp` instead. - std::chrono::system_clock::time_point expire_time; - Timestamp expire_timestamp; - /// The backup will contain an externally consistent copy of the database - /// at `version_time`. If `version_time` is not specified, the system will - /// set `version_time` to the `create_time` of the backup. - absl::optional version_time; - /// How to encrypt the backup. - EncryptionConfig encryption_config; - }; - - /// Wrap the arguments for `GetBackup()`. - struct GetBackupParams { - /// The name of the backup. - std::string backup_full_name; - }; - - /// Wrap the arguments for `DeleteBackup()`. - struct DeleteBackupParams { - /// The name of the backup. - std::string backup_full_name; - }; - - /// Wrap the arguments for `ListBackups()`. - struct ListBackupsParams { - /// The name of the instance. - Instance instance; - std::string filter; - }; - - /// Wrap the arguments for `RestoreDatabase()`. - struct RestoreDatabaseParams { - /// The name of the database. - Database database; - /// The source backup for the restore. - std::string backup_full_name; - /// How to encrypt the database. - EncryptionConfig encryption_config; - }; - - /// Wrap the arguments for `UpdateBackup()`. - struct UpdateBackupParams { - google::spanner::admin::database::v1::UpdateBackupRequest request; - }; - - /// Wrap the arguments for `ListBackupOperations()`. - struct ListBackupOperationsParams { - /// The name of the instance. - Instance instance; - std::string filter; - }; - - /// Wrap the arguments for `ListDatabaseOperations()`. - struct ListDatabaseOperationsParams { - /// The name of the instance. - Instance instance; - std::string filter; - }; - ///@} - - virtual Options options() { return Options{}; } - - /// Define the interface for a google.spanner.v1.DatabaseAdmin.CreateDatabase - /// RPC. - virtual future> - CreateDatabase(CreateDatabaseParams) = 0; - - /// Define the interface for a google.spanner.v1.DatabaseAdmin.GetDatabase - /// RPC. - virtual StatusOr GetDatabase( - GetDatabaseParams) = 0; - - /// Define the interface for a google.spanner.v1.DatabaseAdmin.GetDatabaseDdl - /// RPC. - virtual StatusOr - GetDatabaseDdl(GetDatabaseDdlParams) = 0; - - /// Define the interface for a google.spanner.v1.DatabaseAdmin.UpdateDatabase - /// RPC. - virtual future< - StatusOr> - UpdateDatabase(UpdateDatabaseParams) = 0; - - /// Define the interface for a google.spanner.v1.DatabaseAdmin.DropDatabase - /// RPC. - virtual Status DropDatabase(DropDatabaseParams) = 0; - - /// Define the interface for a google.spanner.v1.DatabaseAdmin.DropDatabase - /// RPC. - virtual ListDatabaseRange ListDatabases(ListDatabasesParams) = 0; - - /// Define the interface for a google.spanner.v1.DatabaseAdmin.RestoreDatabase - /// RPC. - virtual future> - RestoreDatabase(RestoreDatabaseParams); - - /// Define the interface for a google.spanner.v1.DatabaseAdmin.GetIamPolicy - /// RPC. - virtual StatusOr GetIamPolicy( - GetIamPolicyParams) = 0; - - /// Define the interface for a google.spanner.v1.DatabaseAdmin.SetIamPolicy - /// RPC. - virtual StatusOr SetIamPolicy( - SetIamPolicyParams) = 0; - - /// Define the interface for a - /// google.spanner.v1.DatabaseAdmin.TestIamPermissions RPC. - virtual StatusOr - TestIamPermissions(TestIamPermissionsParams) = 0; - - /// Define the interface for a google.spanner.v1.DatabaseAdmin.CreateBackup - /// RPC. - virtual future> - CreateBackup(CreateBackupParams); - - /// Define the interface for a google.spanner.v1.DatabaseAdmin.GetBackup RPC. - virtual StatusOr GetBackup( - GetBackupParams); - - /// Define the interface for a google.spanner.v1.DatabaseAdmin.DeleteBackup - /// RPC. - virtual Status DeleteBackup(DeleteBackupParams); - - /// Define the interface for a google.spanner.v1.DatabaseAdmin.ListBackups - /// RPC. - virtual ListBackupsRange ListBackups(ListBackupsParams); - - /// Define the interface for a google.spanner.v1.DatabaseAdmin.UpdateBackup - /// RPC. - virtual StatusOr UpdateBackup( - UpdateBackupParams); - - /// Define the interface for a - /// google.spanner.v1.DatabaseAdmin.ListBackupOperations RPC. - virtual ListBackupOperationsRange ListBackupOperations( - ListBackupOperationsParams); - - /// Define the interface for a - /// google.spanner.v1.DatabaseAdmin.ListDatabaseOperations RPC. - virtual ListDatabaseOperationsRange ListDatabaseOperations( - ListDatabaseOperationsParams); -}; - -/** - * Returns a DatabaseAdminConnection object that can be used for interacting - * with Cloud Spanner's admin APIs. - * - * The returned connection object should not be used directly; instead it - * should be given to a `DatabaseAdminClient` instance. - * - * The optional @p opts argument may be used to configure aspects of the - * returned `DatabaseAdminConnection`. Expected options are any of types in the - * following option lists. - * - * - `google::cloud::CommonOptionList` - * - `google::cloud::GrpcOptionList` - * - `google::cloud::SpannerPolicyOptionList` - * - * @see `DatabaseAdminConnection` - * - * @param opts (optional) configure the `DatabaseAdminConnection` created by - * this function. - */ -GOOGLE_CLOUD_CPP_SPANNER_ADMIN_API_DEPRECATED("MakeDatabaseAdminConnection()") -std::shared_ptr MakeDatabaseAdminConnection( - Options opts = {}); - -/** - * Returns a DatabaseAdminConnection object that can be used for interacting - * with Cloud Spanner's admin APIs. - * - * The returned connection object should not be used directly, rather it should - * be given to a `DatabaseAdminClient` instance. - * - * @note Prefer using the `MakeDatabaseAdminConnection()` overload that accepts - * `google::cloud::Options`. - * - * @see `DatabaseAdminConnection` - * - * @param options configure the `DatabaseAdminConnection` created by this - * function. - */ -GOOGLE_CLOUD_CPP_SPANNER_ADMIN_API_DEPRECATED("MakeDatabaseAdminConnection()") -std::shared_ptr MakeDatabaseAdminConnection( - ConnectionOptions const& options); - -/** - * Returns a DatabaseAdminConnection object that can be used for interacting - * with Cloud Spanner's admin APIs. - * - * The returned connection object should not be used directly, rather it should - * be given to a `DatabaseAdminClient` instance. - * - * @note Prefer using the `MakeDatabaseAdminConnection()` overload that accepts - * `google::cloud::Options`. - * - * @param options configure the `DatabaseAdminConnection` created by this - * function. - * @param retry_policy control for how long (or how many times) are retryable - * RPCs attempted - * @param backoff_policy controls the backoff behavior between retry attempts, - * typically some form of exponential backoff with jitter - * @param polling_policy controls for how often, and how quickly, are long - * running checked for completion - * - * @par Example - * @snippet samples.cc custom-database-admin-policies - */ -GOOGLE_CLOUD_CPP_SPANNER_ADMIN_API_DEPRECATED("MakeDatabaseAdminConnection()") -std::shared_ptr MakeDatabaseAdminConnection( - ConnectionOptions const& options, std::unique_ptr retry_policy, - std::unique_ptr backoff_policy, - std::unique_ptr polling_policy); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner - -namespace spanner_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// Internal-only factory that allows us to inject mock stubs for testing. -std::shared_ptr -MakeDatabaseAdminConnectionForTesting(std::shared_ptr stub, - Options opts); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner_internal - -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_DATABASE_ADMIN_CONNECTION_H diff --git a/google/cloud/spanner/database_admin_connection_test.cc b/google/cloud/spanner/database_admin_connection_test.cc deleted file mode 100644 index 4ed83b5ee61cf..0000000000000 --- a/google/cloud/spanner/database_admin_connection_test.cc +++ /dev/null @@ -1,1576 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO(#7356): Remove this file after the deprecation period expires -#include "google/cloud/internal/disable_deprecation_warnings.inc" -#include "google/cloud/spanner/database_admin_connection.h" -#include "google/cloud/spanner/internal/defaults.h" -#include "google/cloud/spanner/options.h" -#include "google/cloud/spanner/testing/mock_database_admin_stub.h" -#include "google/cloud/spanner/timestamp.h" -#include "google/cloud/kms_key_name.h" -#include "google/cloud/options.h" -#include "google/cloud/testing_util/is_proto_equal.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "absl/time/clock.h" -#include "absl/time/time.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace gsad = ::google::spanner::admin::database; - -using ::google::cloud::spanner_testing::MockDatabaseAdminStub; -using ::google::cloud::testing_util::IsProtoEqual; -using ::google::cloud::testing_util::StatusIs; -using ::google::protobuf::TextFormat; -using ::testing::AnyOf; -using ::testing::AtLeast; -using ::testing::AtMost; -using ::testing::ElementsAre; -using ::testing::IsEmpty; -using ::testing::Return; - -std::shared_ptr CreateTestingConnection( - std::shared_ptr mock) { - LimitedErrorCountRetryPolicy retry(/*maximum_failures=*/2); - ExponentialBackoffPolicy backoff( - /*initial_delay=*/std::chrono::microseconds(1), - /*maximum_delay=*/std::chrono::microseconds(1), - /*scaling=*/2.0); - GenericPollingPolicy polling(retry, backoff); - Options opts; - opts.set(retry.clone()); - opts.set(backoff.clone()); - opts.set(polling.clone()); - return spanner_internal::MakeDatabaseAdminConnectionForTesting( - std::move(mock), std::move(opts)); -} - -/// @test Verify that successful case works. -TEST(DatabaseAdminConnectionTest, CreateDatabaseSuccess) { - auto mock = std::make_shared(); - std::string const database_name = - "projects/test-project/instances/test-instance/databases/test-database"; - - EXPECT_CALL(*mock, AsyncCreateDatabase) - .WillOnce([](CompletionQueue&, auto, - gsad::v1::CreateDatabaseRequest const& request) { - EXPECT_FALSE(request.has_encryption_config()); - google::longrunning::Operation op; - op.set_name("test-operation-name"); - op.set_done(false); - return make_ready_future(make_status_or(std::move(op))); - }); - EXPECT_CALL(*mock, AsyncGetOperation) - .WillOnce( - [&database_name](CompletionQueue&, auto, - google::longrunning::GetOperationRequest const& r) { - EXPECT_EQ("test-operation-name", r.name()); - google::longrunning::Operation op; - op.set_name(r.name()); - op.set_done(true); - gsad::v1::Database response; - response.set_name(database_name); - response.set_state(gsad::v1::Database::READY); - op.mutable_response()->PackFrom(response); - return make_ready_future(make_status_or(std::move(op))); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - Database dbase("test-project", "test-instance", "test-database"); - EXPECT_EQ(dbase.FullName(), database_name); - auto fut = conn->CreateDatabase({dbase, {}, {}}); - auto response = fut.get(); - ASSERT_STATUS_OK(response); - EXPECT_EQ(response->name(), database_name); - EXPECT_EQ(response->state(), gsad::v1::Database::READY); - EXPECT_FALSE(response->has_encryption_config()); -} - -/// @test Verify creating a database with an encryption key. -TEST(DatabaseAdminClientTest, CreateDatabaseWithEncryption) { - auto mock = std::make_shared(); - std::string const database_name = - "projects/test-project/instances/test-instance/databases/test-database"; - - EXPECT_CALL(*mock, AsyncCreateDatabase) - .WillOnce([](CompletionQueue&, auto, - gsad::v1::CreateDatabaseRequest const& request) { - EXPECT_TRUE(request.has_encryption_config()); - if (request.has_encryption_config()) { - EXPECT_EQ(request.encryption_config().kms_key_name(), - "projects/test-project/locations/some-location/keyRings/" - "a-key-ring/cryptoKeys/a-key-name"); - } - google::longrunning::Operation op; - op.set_name("test-operation-name"); - op.set_done(false); - return make_ready_future(make_status_or(std::move(op))); - }); - EXPECT_CALL(*mock, AsyncGetOperation) - .WillOnce( - [&database_name](CompletionQueue&, auto, - google::longrunning::GetOperationRequest const& r) { - EXPECT_EQ("test-operation-name", r.name()); - google::longrunning::Operation op; - op.set_name(r.name()); - op.set_done(true); - gsad::v1::Database response; - response.set_name(database_name); - response.set_state(gsad::v1::Database::READY); - response.mutable_encryption_config()->set_kms_key_name( - "projects/test-project/locations/some-location/keyRings/" - "a-key-ring/cryptoKeys/some-key-name"); - op.mutable_response()->PackFrom(response); - return make_ready_future(make_status_or(std::move(op))); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - Database dbase("test-project", "test-instance", "test-database"); - EXPECT_EQ(dbase.FullName(), database_name); - KmsKeyName encryption_key("test-project", "some-location", "a-key-ring", - "a-key-name"); - auto fut = conn->CreateDatabase( - {dbase, {}, CustomerManagedEncryption(std::move(encryption_key))}); - auto response = fut.get(); - ASSERT_STATUS_OK(response); - EXPECT_EQ(response->name(), database_name); - EXPECT_EQ(response->state(), gsad::v1::Database::READY); - EXPECT_TRUE(response->has_encryption_config()); - if (response->has_encryption_config()) { - EXPECT_EQ( - response->encryption_config().kms_key_name(), - "projects/test-project/locations/some-location/keyRings/a-key-ring/" - "cryptoKeys/some-key-name"); - } -} - -/// @test Verify that a permanent error in CreateDatabase is immediately -/// reported. -TEST(DatabaseAdminConnectionTest, HandleCreateDatabaseError) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, AsyncCreateDatabase) - .WillOnce( - [](CompletionQueue&, auto, gsad::v1::CreateDatabaseRequest const&) { - return make_ready_future(StatusOr( - Status(StatusCode::kPermissionDenied, "uh-oh"))); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - Database dbase("test-project", "test-instance", "test-database"); - auto fut = conn->CreateDatabase({dbase, {}, {}}); - auto response = fut.get(); - EXPECT_THAT(response, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify that the successful case works. -TEST(DatabaseAdminConnectionTest, GetDatabase) { - auto constexpr kResponseText = R"pb( - name: "projects/project/instances/instance/databases/database" - state: READY - create_time { seconds: 1625696199 nanos: 123456789 } - restore_info { - source_type: BACKUP - backup_info { - backup: "projects/project/instances/instance/backups/backup" - create_time { seconds: 1625696099 nanos: 987564321 } - source_database: "projects/project/instances/instance/databases/database" - version_time { seconds: 1625696099 nanos: 987564321 } - } - } - encryption_config { - kms_key_name: "projects/project/locations/location/keyRings/ring/cryptoKeys/key" - } - version_retention_period: "7d" - earliest_version_time { seconds: 1625696199 nanos: 123456789 } - default_leader: "us-east5" - )pb"; - gsad::v1::Database expected_response; - ASSERT_TRUE(TextFormat::ParseFromString(kResponseText, &expected_response)); - - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetDatabase) - .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) - .WillOnce([&](grpc::ClientContext&, - gsad::v1::GetDatabaseRequest const& request) { - EXPECT_EQ(request.name(), expected_response.name()); - return expected_response; - }); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = - conn->GetDatabase({Database("project", "instance", "database")}); - EXPECT_THAT(response, IsOkAndHolds(IsProtoEqual(expected_response))); -} - -/// @test Verify that permanent errors are reported immediately. -TEST(DatabaseAdminConnectionTest, GetDatabasePermanentError) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, GetDatabase) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->GetDatabase( - {Database("test-project", "test-instance", "test-database")}); - EXPECT_THAT(response, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify that too many transients errors are reported correctly. -TEST(DatabaseAdminConnectionTest, GetDatabaseTooManyTransients) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, GetDatabase) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->GetDatabase( - {Database("test-project", "test-instance", "test-database")}); - EXPECT_THAT(response, StatusIs(StatusCode::kUnavailable)); -} - -/// @test Verify that the successful case works. -TEST(DatabaseAdminConnectionTest, GetDatabaseDdlSuccess) { - auto mock = std::make_shared(); - std::string const expected_name = - "projects/test-project/instances/test-instance/databases/test-database"; - - EXPECT_CALL(*mock, GetDatabaseDdl) - .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) - .WillOnce( - [&expected_name](grpc::ClientContext&, - gsad::v1::GetDatabaseDdlRequest const& request) { - EXPECT_EQ(expected_name, request.database()); - gsad::v1::GetDatabaseDdlResponse response; - response.add_statements("CREATE DATABASE test-database"); - return response; - }); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->GetDatabaseDdl( - {Database("test-project", "test-instance", "test-database")}); - ASSERT_STATUS_OK(response); - ASSERT_EQ(1, response->statements_size()); - EXPECT_EQ("CREATE DATABASE test-database", response->statements(0)); -} - -/// @test Verify that permanent errors are reported immediately. -TEST(DatabaseAdminConnectionTest, GetDatabaseDdlPermanentError) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, GetDatabaseDdl) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->GetDatabaseDdl( - {Database("test-project", "test-instance", "test-database")}); - EXPECT_THAT(response, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify that too many transients errors are reported correctly. -TEST(DatabaseAdminConnectionTest, GetDatabaseDdlTooManyTransients) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, GetDatabaseDdl) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->GetDatabaseDdl( - {Database("test-project", "test-instance", "test-database")}); - EXPECT_THAT(response, StatusIs(StatusCode::kUnavailable)); -} - -/// @test Verify that successful case works. -TEST(DatabaseAdminConnectionTest, UpdateDatabaseSuccess) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, AsyncUpdateDatabaseDdl) - .WillOnce([](CompletionQueue&, auto, - gsad::v1::UpdateDatabaseDdlRequest const&) { - google::longrunning::Operation op; - op.set_name("test-operation-name"); - op.set_done(false); - return make_ready_future(make_status_or(std::move(op))); - }); - EXPECT_CALL(*mock, AsyncGetOperation) - .WillOnce([](CompletionQueue&, auto, - google::longrunning::GetOperationRequest const& r) { - EXPECT_EQ("test-operation-name", r.name()); - google::longrunning::Operation op; - op.set_name(r.name()); - op.set_done(true); - gsad::v1::UpdateDatabaseDdlMetadata metadata; - metadata.set_database("test-database"); - op.mutable_metadata()->PackFrom(metadata); - return make_ready_future(make_status_or(std::move(op))); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - Database dbase("test-project", "test-instance", "test-database"); - auto fut = conn->UpdateDatabase( - {dbase, {"ALTER TABLE Albums ADD COLUMN MarketingBudget INT64"}}); - auto response = fut.get(); - ASSERT_STATUS_OK(response); - EXPECT_EQ(response->database(), "test-database"); -} - -/// @test Verify that a permanent error in UpdateDatabase is immediately -/// reported. -TEST(DatabaseAdminConnectionTest, UpdateDatabaseErrorInPoll) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, AsyncUpdateDatabaseDdl) - .WillOnce([](CompletionQueue&, auto, - gsad::v1::UpdateDatabaseDdlRequest const&) { - return make_ready_future(StatusOr( - Status(StatusCode::kPermissionDenied, "uh-oh"))); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - Database dbase("test-project", "test-instance", "test-database"); - auto fut = conn->UpdateDatabase( - {dbase, {"ALTER TABLE Albums ADD COLUMN MarketingBudget INT64"}}); - auto response = fut.get(); - EXPECT_THAT(response, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify that errors in the polling loop are reported. -TEST(DatabaseAdminConnectionTest, CreateDatabaseErrorInPoll) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, AsyncCreateDatabase) - .WillOnce( - [](CompletionQueue&, auto, gsad::v1::CreateDatabaseRequest const&) { - google::longrunning::Operation op; - op.set_name("test-operation-name"); - op.set_done(false); - return make_ready_future(make_status_or(std::move(op))); - }); - EXPECT_CALL(*mock, AsyncGetOperation) - .WillOnce([](CompletionQueue&, auto, - google::longrunning::GetOperationRequest const& r) { - EXPECT_EQ("test-operation-name", r.name()); - google::longrunning::Operation op; - op.set_done(true); - op.mutable_error()->set_code( - static_cast(grpc::StatusCode::PERMISSION_DENIED)); - op.mutable_error()->set_message("uh-oh"); - return make_ready_future(make_status_or(std::move(op))); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - Database dbase("test-project", "test-instance", "test-database"); - auto response = conn->CreateDatabase({dbase, {}, {}}).get(); - EXPECT_THAT(response, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify that errors in the polling loop are reported. -TEST(DatabaseAdminConnectionTest, UpdateDatabaseGetOperationError) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, AsyncUpdateDatabaseDdl) - .WillOnce([](CompletionQueue&, auto, - gsad::v1::UpdateDatabaseDdlRequest const&) { - google::longrunning::Operation op; - op.set_name("test-operation-name"); - op.set_done(false); - return make_ready_future(make_status_or(std::move(op))); - }); - EXPECT_CALL(*mock, AsyncGetOperation) - .WillOnce([](CompletionQueue&, auto, - google::longrunning::GetOperationRequest const& r) { - EXPECT_EQ("test-operation-name", r.name()); - google::longrunning::Operation op; - op.set_done(true); - op.mutable_error()->set_code( - static_cast(grpc::StatusCode::PERMISSION_DENIED)); - op.mutable_error()->set_message("uh-oh"); - return make_ready_future(make_status_or(std::move(op))); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - Database dbase("test-project", "test-instance", "test-database"); - auto response = - conn->UpdateDatabase( - {dbase, {"ALTER TABLE Albums ADD COLUMN MarketingBudget INT64"}}) - .get(); - EXPECT_THAT(response, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify that we can list databases in multiple pages. -TEST(DatabaseAdminConnectionTest, ListDatabases) { - constexpr char const* kDatabaseText[5] = { - R"pb( - name: "projects/project/instances/instance/databases/db-1" - state: READY - create_time { seconds: 1625696199 nanos: 111111111 } - restore_info { - source_type: BACKUP - backup_info { - backup: "projects/project/instances/instance/backups/backup" - create_time { seconds: 1625696099 nanos: 111111111 } - source_database: "projects/project/instances/instance/databases/db" - version_time { seconds: 1625696099 nanos: 111111111 } - } - } - encryption_config { - kms_key_name: "projects/project/locations/location/keyRings/ring/cryptoKeys/key" - } - version_retention_period: "1d" - earliest_version_time { seconds: 1625696199 nanos: 111111111 } - default_leader: "us-east1" - )pb", - R"pb( - name: "projects/project/instances/instance/databases/db-2" - state: READY - create_time { seconds: 1625696199 nanos: 222222222 } - restore_info { - source_type: BACKUP - backup_info { - backup: "projects/project/instances/instance/backups/backup" - create_time { seconds: 1625696099 nanos: 222222222 } - source_database: "projects/project/instances/instance/databases/db" - version_time { seconds: 1625696099 nanos: 222222222 } - } - } - encryption_config { - kms_key_name: "projects/project/locations/location/keyRings/ring/cryptoKeys/key" - } - version_retention_period: "2d" - earliest_version_time { seconds: 1625696199 nanos: 222222222 } - default_leader: "us-east2" - )pb", - R"pb( - name: "projects/project/instances/instance/databases/db-3" - state: READY - create_time { seconds: 1625696199 nanos: 333333333 } - restore_info { - source_type: BACKUP - backup_info { - backup: "projects/project/instances/instance/backups/backup" - create_time { seconds: 1625696099 nanos: 333333333 } - source_database: "projects/project/instances/instance/databases/db" - version_time { seconds: 1625696099 nanos: 333333333 } - } - } - encryption_config { - kms_key_name: "projects/project/locations/location/keyRings/ring/cryptoKeys/key" - } - version_retention_period: "3d" - earliest_version_time { seconds: 1625696199 nanos: 333333333 } - default_leader: "us-east3" - )pb", - R"pb( - name: "projects/project/instances/instance/databases/db-4" - state: READY - create_time { seconds: 1625696199 nanos: 444444444 } - restore_info { - source_type: BACKUP - backup_info { - backup: "projects/project/instances/instance/backups/backup" - create_time { seconds: 1625696099 nanos: 444444444 } - source_database: "projects/project/instances/instance/databases/db" - version_time { seconds: 1625696099 nanos: 444444444 } - } - } - encryption_config { - kms_key_name: "projects/project/locations/location/keyRings/ring/cryptoKeys/key" - } - version_retention_period: "4d" - earliest_version_time { seconds: 1625696199 nanos: 444444444 } - default_leader: "us-east4" - )pb", - R"pb( - name: "projects/project/instances/instance/databases/db-5" - state: READY - create_time { seconds: 1625696199 nanos: 555555555 } - restore_info { - source_type: BACKUP - backup_info { - backup: "projects/project/instances/instance/backups/backup" - create_time { seconds: 1625696099 nanos: 555555555 } - source_database: "projects/project/instances/instance/databases/db" - version_time { seconds: 1625696099 nanos: 555555555 } - } - } - encryption_config { - kms_key_name: "projects/project/locations/location/keyRings/ring/cryptoKeys/key" - } - version_retention_period: "5d" - earliest_version_time { seconds: 1625696199 nanos: 555555555 } - default_leader: "us-east5" - )pb", - }; - gsad::v1::Database expected_databases[5]; - ASSERT_TRUE( - TextFormat::ParseFromString(kDatabaseText[0], &expected_databases[0])); - ASSERT_TRUE( - TextFormat::ParseFromString(kDatabaseText[1], &expected_databases[1])); - ASSERT_TRUE( - TextFormat::ParseFromString(kDatabaseText[2], &expected_databases[2])); - ASSERT_TRUE( - TextFormat::ParseFromString(kDatabaseText[3], &expected_databases[3])); - ASSERT_TRUE( - TextFormat::ParseFromString(kDatabaseText[4], &expected_databases[4])); - - Instance in("project", "instance"); - std::string const expected_parent = in.FullName(); - auto mock = std::make_shared(); - EXPECT_CALL(*mock, ListDatabases) - .WillOnce([&](grpc::ClientContext&, - gsad::v1::ListDatabasesRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_TRUE(request.page_token().empty()); - - gsad::v1::ListDatabasesResponse page; - page.set_next_page_token("page-1"); - *page.add_databases() = expected_databases[0]; - *page.add_databases() = expected_databases[1]; - return make_status_or(page); - }) - .WillOnce([&](grpc::ClientContext&, - gsad::v1::ListDatabasesRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_EQ("page-1", request.page_token()); - - gsad::v1::ListDatabasesResponse page; - page.set_next_page_token("page-2"); - *page.add_databases() = expected_databases[2]; - *page.add_databases() = expected_databases[3]; - return make_status_or(page); - }) - .WillOnce([&](grpc::ClientContext&, - gsad::v1::ListDatabasesRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_EQ("page-2", request.page_token()); - - gsad::v1::ListDatabasesResponse page; - page.clear_next_page_token(); - *page.add_databases() = expected_databases[4]; - return make_status_or(page); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - std::vector actual_databases; - for (auto const& database : conn->ListDatabases({in})) { - ASSERT_STATUS_OK(database); - actual_databases.push_back(*database); - } - EXPECT_THAT(actual_databases, - ElementsAre(IsProtoEqual(expected_databases[0]), - IsProtoEqual(expected_databases[1]), - IsProtoEqual(expected_databases[2]), - IsProtoEqual(expected_databases[3]), - IsProtoEqual(expected_databases[4]))); -} - -TEST(DatabaseAdminConnectionTest, ListDatabasesPermanentFailure) { - auto mock = std::make_shared(); - Instance in("test-project", "test-instance"); - - EXPECT_CALL(*mock, ListDatabases) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto range = conn->ListDatabases({in}); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(DatabaseAdminConnectionTest, ListDatabasesTooManyFailures) { - auto mock = std::make_shared(); - Instance in("test-project", "test-instance"); - - EXPECT_CALL(*mock, ListDatabases) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto range = conn->ListDatabases({in}); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kUnavailable)); -} - -/// @test Verify that successful case works. -TEST(DatabaseAdminConnectionTest, RestoreDatabaseSuccess) { - auto mock = std::make_shared(); - std::string const database_name = - "projects/test-project/instances/test-instance/databases/test-database"; - - EXPECT_CALL(*mock, AsyncRestoreDatabase) - .WillOnce([](CompletionQueue&, auto, - gsad::v1::RestoreDatabaseRequest const& request) { - EXPECT_EQ(request.database_id(), "test-database"); - EXPECT_FALSE(request.has_encryption_config()); - google::longrunning::Operation op; - op.set_name("test-operation-name"); - op.set_done(false); - return make_ready_future(make_status_or(std::move(op))); - }); - EXPECT_CALL(*mock, AsyncGetOperation) - .WillOnce( - [&database_name](CompletionQueue&, auto, - google::longrunning::GetOperationRequest const& r) { - EXPECT_EQ("test-operation-name", r.name()); - google::longrunning::Operation op; - op.set_name(r.name()); - op.set_done(true); - gsad::v1::Database response; - response.set_name(database_name); - response.set_state(gsad::v1::Database::READY); - op.mutable_response()->PackFrom(response); - return make_ready_future(make_status_or(std::move(op))); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - Database dbase("test-project", "test-instance", "test-database"); - EXPECT_EQ(dbase.FullName(), database_name); - Backup backup(Instance("test-project", "test-instance"), "test-backup"); - auto fut = conn->RestoreDatabase({dbase, backup.FullName(), {}}); - auto response = fut.get(); - ASSERT_STATUS_OK(response); - EXPECT_EQ(response->name(), database_name); - EXPECT_EQ(response->state(), gsad::v1::Database::READY); - EXPECT_FALSE(response->has_encryption_config()); -} - -/// @test Verify that using an encryption key works. -TEST(DatabaseAdminClientTest, RestoreDatabaseWithEncryption) { - auto mock = std::make_shared(); - std::string const database_name = - "projects/test-project/instances/test-instance/databases/test-database"; - - EXPECT_CALL(*mock, AsyncRestoreDatabase) - .WillOnce([](CompletionQueue&, auto, - gsad::v1::RestoreDatabaseRequest const& request) { - EXPECT_EQ(request.database_id(), "test-database"); - EXPECT_TRUE(request.has_encryption_config()); - if (request.has_encryption_config()) { - EXPECT_EQ(request.encryption_config().encryption_type(), - gsad::v1::RestoreDatabaseEncryptionConfig:: - CUSTOMER_MANAGED_ENCRYPTION); - EXPECT_EQ(request.encryption_config().kms_key_name(), - "projects/test-project/locations/some-location/keyRings/" - "a-key-ring/cryptoKeys/restore-key-name"); - } - google::longrunning::Operation op; - op.set_name("test-operation-name"); - op.set_done(false); - return make_ready_future(make_status_or(std::move(op))); - }); - EXPECT_CALL(*mock, AsyncGetOperation) - .WillOnce( - [&database_name](CompletionQueue&, auto, - google::longrunning::GetOperationRequest const& r) { - EXPECT_EQ("test-operation-name", r.name()); - google::longrunning::Operation op; - op.set_name(r.name()); - op.set_done(true); - gsad::v1::Database response; - response.set_name(database_name); - response.set_state(gsad::v1::Database::READY); - response.mutable_encryption_config()->set_kms_key_name( - "projects/test-project/locations/some-location/keyRings/" - "a-key-ring/cryptoKeys/restore-key-name"); - op.mutable_response()->PackFrom(response); - return make_ready_future(make_status_or(std::move(op))); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - Instance instance("test-project", "test-instance"); - Database dbase(instance, "test-database"); - Backup backup(instance, "test-backup"); - KmsKeyName encryption_key("test-project", "some-location", "a-key-ring", - "restore-key-name"); - auto fut = conn->RestoreDatabase( - {dbase, backup.FullName(), - CustomerManagedEncryption(std::move(encryption_key))}); - auto response = fut.get(); - ASSERT_STATUS_OK(response); - EXPECT_EQ(response->name(), database_name); - EXPECT_EQ(response->state(), gsad::v1::Database::READY); - EXPECT_TRUE(response->has_encryption_config()); - if (response->has_encryption_config()) { - EXPECT_EQ( - response->encryption_config().kms_key_name(), - "projects/test-project/locations/some-location/keyRings/a-key-ring/" - "cryptoKeys/restore-key-name"); - } -} - -/// @test Verify that a permanent error in RestoreDatabase is immediately -/// reported. -TEST(DatabaseAdminConnectionTest, HandleRestoreDatabaseError) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, AsyncRestoreDatabase) - .WillOnce( - [](CompletionQueue&, auto, gsad::v1::RestoreDatabaseRequest const&) { - return make_ready_future(StatusOr( - Status(StatusCode::kPermissionDenied, "uh-oh"))); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - Database dbase("test-project", "test-instance", "test-database"); - Backup backup(Instance("test-project", "test-instance"), "test-backup"); - auto fut = conn->RestoreDatabase({dbase, backup.FullName(), {}}); - auto response = fut.get(); - EXPECT_THAT(response, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify that the successful case works. -TEST(DatabaseAdminConnectionTest, GetIamPolicySuccess) { - auto mock = std::make_shared(); - std::string const expected_name = - "projects/test-project/instances/test-instance/databases/test-database"; - std::string const expected_role = "roles/spanner.databaseReader"; - std::string const expected_member = "user:foobar@example.com"; - - EXPECT_CALL(*mock, GetIamPolicy) - .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) - .WillOnce([&expected_name, &expected_role, &expected_member]( - grpc::ClientContext&, - google::iam::v1::GetIamPolicyRequest const& request) { - EXPECT_EQ(expected_name, request.resource()); - google::iam::v1::Policy response; - auto& binding = *response.add_bindings(); - binding.set_role(expected_role); - *binding.add_members() = expected_member; - return response; - }); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->GetIamPolicy( - {Database("test-project", "test-instance", "test-database")}); - EXPECT_STATUS_OK(response); - ASSERT_EQ(1, response->bindings().size()); - EXPECT_EQ(expected_role, response->bindings().Get(0).role()); - ASSERT_EQ(1, response->bindings().Get(0).members().size()); - EXPECT_EQ(expected_member, response->bindings().Get(0).members().Get(0)); -} - -/// @test Verify that permanent errors are reported immediately. -TEST(DatabaseAdminConnectionTest, GetIamPolicyPermanentError) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, GetIamPolicy) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->GetIamPolicy( - {Database("test-project", "test-instance", "test-database")}); - EXPECT_THAT(response, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify that too many transients errors are reported correctly. -TEST(DatabaseAdminConnectionTest, GetIamPolicyTooManyTransients) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, GetIamPolicy) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->GetIamPolicy( - {Database("test-project", "test-instance", "test-database")}); - EXPECT_THAT(response, StatusIs(StatusCode::kUnavailable)); -} - -/// @test Verify that the successful case works. -TEST(DatabaseAdminConnectionTest, SetIamPolicySuccess) { - std::string const expected_name = - "projects/test-project/instances/test-instance/databases/test-database"; - auto constexpr kPolicyText = R"pb( - etag: "request-etag" - bindings { - role: "roles/spanner.databaseReader" - members: "user:test-user-1@example.com" - members: "user:test-user-2@example.com" - } - )pb"; - google::iam::v1::Policy expected_policy; - ASSERT_TRUE(TextFormat::ParseFromString(kPolicyText, &expected_policy)); - - auto mock = std::make_shared(); - EXPECT_CALL(*mock, SetIamPolicy) - .WillOnce([&expected_name]( - grpc::ClientContext&, - google::iam::v1::SetIamPolicyRequest const& request) { - EXPECT_EQ(expected_name, request.resource()); - return Status(StatusCode::kUnavailable, "try-again"); - }) - .WillOnce([&expected_name, &expected_policy]( - grpc::ClientContext&, - google::iam::v1::SetIamPolicyRequest const& request) { - EXPECT_EQ(expected_name, request.resource()); - EXPECT_THAT(request.policy(), IsProtoEqual(expected_policy)); - auto response = expected_policy; - response.set_etag("response-etag"); - return response; - }); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->SetIamPolicy( - {Database("test-project", "test-instance", "test-database"), - expected_policy}); - ASSERT_STATUS_OK(response); - expected_policy.set_etag("response-etag"); - EXPECT_THAT(*response, IsProtoEqual(expected_policy)); -} - -/// @test Verify that permanent errors are reported immediately. -TEST(DatabaseAdminConnectionTest, SetIamPolicyPermanentError) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, SetIamPolicy) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->SetIamPolicy( - {Database("test-project", "test-instance", "test-database"), {}}); - EXPECT_THAT(response, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify that request without the Etag field should fail with the first -/// transient error. -TEST(DatabaseAdminConnectionTest, SetIamPolicyNonIdempotent) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, SetIamPolicy) - .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = CreateTestingConnection(std::move(mock)); - google::iam::v1::Policy policy; - auto response = conn->SetIamPolicy( - {Database("test-project", "test-instance", "test-database"), policy}); - EXPECT_THAT(response, StatusIs(StatusCode::kUnavailable)); -} - -/// @test Verify that request with the Etag field is retried for transient -/// errors. -TEST(DatabaseAdminConnectionTest, SetIamPolicyIdempotent) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, SetIamPolicy) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = CreateTestingConnection(std::move(mock)); - google::iam::v1::Policy policy; - policy.set_etag("test-etag-value"); - auto response = conn->SetIamPolicy( - {Database("test-project", "test-instance", "test-database"), policy}); - EXPECT_THAT(response, StatusIs(StatusCode::kUnavailable)); -} - -/// @test Verify that the successful case works. -TEST(DatabaseAdminConnectionTest, TestIamPermissionsSuccess) { - auto mock = std::make_shared(); - std::string const expected_name = - "projects/test-project/instances/test-instance/databases/test-database"; - std::string const expected_permission = "spanner.databases.read"; - - EXPECT_CALL(*mock, TestIamPermissions) - .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) - .WillOnce([&expected_name, &expected_permission]( - grpc::ClientContext&, - google::iam::v1::TestIamPermissionsRequest const& request) { - EXPECT_EQ(expected_name, request.resource()); - EXPECT_EQ(1, request.permissions_size()); - EXPECT_EQ(expected_permission, request.permissions(0)); - google::iam::v1::TestIamPermissionsResponse response; - response.add_permissions(expected_permission); - return response; - }); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->TestIamPermissions( - {Database("test-project", "test-instance", "test-database"), - {expected_permission}}); - ASSERT_STATUS_OK(response); - ASSERT_EQ(1, response->permissions_size()); - EXPECT_EQ(expected_permission, response->permissions(0)); -} - -/// @test Verify that permanent errors are reported immediately. -TEST(DatabaseAdminConnectionTest, TestIamPermissionsPermanentError) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, TestIamPermissions) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->TestIamPermissions( - {Database("test-project", "test-instance", "test-database"), {}}); - EXPECT_THAT(response, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify that too many transients errors are reported correctly. -TEST(DatabaseAdminConnectionTest, TestIamPermissionsTooManyTransients) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, TestIamPermissions) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->TestIamPermissions( - {Database("test-project", "test-instance", "test-database"), {}}); - EXPECT_THAT(response, StatusIs(StatusCode::kUnavailable)); -} - -/// @test Verify that successful case works. -TEST(DatabaseAdminConnectionTest, CreateBackupSuccess) { - auto mock = std::make_shared(); - Database dbase("test-project", "test-instance", "test-database"); - auto now = absl::Now(); - auto expire_time = MakeTimestamp(now + absl::Hours(7)).value(); - auto version_time = MakeTimestamp(now - absl::Hours(7)).value(); - - EXPECT_CALL(*mock, AsyncCreateBackup) - .WillOnce([&dbase, &expire_time, &version_time]( - CompletionQueue&, auto, - gsad::v1::CreateBackupRequest const& request) { - EXPECT_EQ(request.parent(), dbase.instance().FullName()); - EXPECT_EQ(request.backup_id(), "test-backup"); - auto const& backup = request.backup(); - EXPECT_EQ(backup.database(), dbase.FullName()); - EXPECT_EQ(MakeTimestamp(backup.expire_time()).value(), expire_time); - EXPECT_EQ(MakeTimestamp(backup.version_time()).value(), version_time); - google::longrunning::Operation op; - op.set_name("test-operation-name"); - op.set_done(false); - return make_ready_future(make_status_or(std::move(op))); - }); - EXPECT_CALL(*mock, AsyncGetOperation) - .WillOnce([&expire_time, &version_time]( - CompletionQueue&, auto, - google::longrunning::GetOperationRequest const& r) { - EXPECT_EQ("test-operation-name", r.name()); - google::longrunning::Operation op; - op.set_name(r.name()); - op.set_done(true); - gsad::v1::Backup response; - response.set_name("test-backup"); - response.set_state(gsad::v1::Backup::READY); - *response.mutable_expire_time() = - expire_time.get().value(); - *response.mutable_version_time() = - version_time.get().value(); - *response.mutable_create_time() = MakeTimestamp(absl::Now()) - .value() - .get() - .value(); - op.mutable_response()->PackFrom(response); - return make_ready_future(make_status_or(std::move(op))); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - auto fut = conn->CreateBackup( - {dbase, "test-backup", {}, expire_time, version_time, {}}); - auto response = fut.get(); - ASSERT_STATUS_OK(response); - EXPECT_EQ(response->name(), "test-backup"); - EXPECT_EQ(response->state(), gsad::v1::Backup::READY); - EXPECT_EQ(MakeTimestamp(response->expire_time()).value(), expire_time); - EXPECT_EQ(MakeTimestamp(response->version_time()).value(), version_time); - EXPECT_GT(MakeTimestamp(response->create_time()).value(), version_time); - EXPECT_FALSE(response->has_encryption_info()); -} - -/// @test Verify that using an encryption key works. -TEST(DatabaseAdminClientTest, CreateBackupWithEncryption) { - auto mock = std::make_shared(); - Database dbase("test-project", "test-instance", "test-database"); - - EXPECT_CALL(*mock, AsyncCreateBackup) - .WillOnce([&dbase](CompletionQueue&, auto, - gsad::v1::CreateBackupRequest const& request) { - EXPECT_EQ(request.parent(), dbase.instance().FullName()); - EXPECT_EQ(request.backup_id(), "test-backup"); - EXPECT_EQ(request.backup().database(), dbase.FullName()); - EXPECT_TRUE(request.has_encryption_config()); - if (request.has_encryption_config()) { - EXPECT_EQ(request.encryption_config().encryption_type(), - gsad::v1::CreateBackupEncryptionConfig:: - GOOGLE_DEFAULT_ENCRYPTION); - EXPECT_THAT(request.encryption_config().kms_key_name(), IsEmpty()); - } - google::longrunning::Operation op; - op.set_name("test-operation-name"); - op.set_done(false); - return make_ready_future(make_status_or(std::move(op))); - }); - EXPECT_CALL(*mock, AsyncGetOperation) - .WillOnce([](CompletionQueue&, auto, - google::longrunning::GetOperationRequest const& r) { - EXPECT_EQ("test-operation-name", r.name()); - google::longrunning::Operation op; - op.set_name(r.name()); - op.set_done(true); - gsad::v1::Backup response; - response.set_name("test-backup"); - response.set_state(gsad::v1::Backup::READY); - response.mutable_encryption_info()->set_encryption_type( - gsad::v1::EncryptionInfo::GOOGLE_DEFAULT_ENCRYPTION); - op.mutable_response()->PackFrom(response); - return make_ready_future(make_status_or(std::move(op))); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - auto fut = conn->CreateBackup( - {dbase, "test-backup", {}, {}, absl::nullopt, GoogleEncryption()}); - auto response = fut.get(); - ASSERT_STATUS_OK(response); - EXPECT_EQ(response->name(), "test-backup"); - EXPECT_EQ(response->state(), gsad::v1::Backup::READY); - EXPECT_TRUE(response->has_encryption_info()); - if (response->has_encryption_info()) { - EXPECT_EQ(response->encryption_info().encryption_type(), - gsad::v1::EncryptionInfo::GOOGLE_DEFAULT_ENCRYPTION); - EXPECT_THAT(response->encryption_info().kms_key_version(), IsEmpty()); - } -} - -/// @test Verify cancellation. -TEST(DatabaseAdminConnectionTest, CreateBackupCancel) { - auto mock = std::make_shared(); - promise p; - - EXPECT_CALL(*mock, AsyncCreateBackup) - .WillOnce( - [](CompletionQueue&, auto, gsad::v1::CreateBackupRequest const&) { - google::longrunning::Operation op; - op.set_name("test-operation-name"); - op.set_done(false); - return make_ready_future(make_status_or(std::move(op))); - }); - EXPECT_CALL(*mock, AsyncCancelOperation) - .Times(AtMost(1)) - .WillRepeatedly( - [](CompletionQueue&, auto, - google::longrunning::CancelOperationRequest const& request) { - EXPECT_EQ("test-operation-name", request.name()); - return make_ready_future(Status()); - }); - EXPECT_CALL(*mock, AsyncGetOperation) - .WillOnce([&p](CompletionQueue&, auto, - google::longrunning::GetOperationRequest const& r) { - EXPECT_EQ("test-operation-name", r.name()); - google::longrunning::Operation op; - op.set_name(r.name()); - op.set_done(false); - p.set_value(); // enable `cancel()` call in the main thread. - return make_ready_future(make_status_or(std::move(op))); - }) - .WillRepeatedly([](CompletionQueue&, auto, - google::longrunning::GetOperationRequest const& r) { - EXPECT_EQ("test-operation-name", r.name()); - google::longrunning::Operation op; - op.set_name(r.name()); - op.set_done(false); - return make_ready_future(make_status_or(std::move(op))); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - Database dbase("test-project", "test-instance", "test-database"); - auto fut = - conn->CreateBackup({dbase, "test-backup", {}, {}, absl::nullopt, {}}); - p.get_future().get(); // await first poll before `cancel()` - fut.cancel(); - auto backup = fut.get(); - EXPECT_THAT(backup, StatusIs(AnyOf(StatusCode::kCancelled, - StatusCode::kDeadlineExceeded))); -} - -/// @test Verify that a permanent error in CreateBackup is immediately -/// reported. -TEST(DatabaseAdminConnectionTest, HandleCreateBackupError) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, AsyncCreateBackup) - .WillOnce( - [](CompletionQueue&, auto, gsad::v1::CreateBackupRequest const&) { - return make_ready_future(StatusOr( - Status(StatusCode::kPermissionDenied, "uh-oh"))); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - Database dbase("test-project", "test-instance", "test-database"); - auto fut = - conn->CreateBackup({dbase, "test-backup", {}, {}, absl::nullopt, {}}); - auto backup = fut.get(); - EXPECT_THAT(backup, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify that the successful case works. -TEST(DatabaseAdminConnectionTest, GetBackupSuccess) { - auto mock = std::make_shared(); - std::string const expected_name = - "projects/test-project/instances/test-instance/backups/test-backup"; - - EXPECT_CALL(*mock, GetBackup) - .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) - .WillOnce([&expected_name](grpc::ClientContext&, - gsad::v1::GetBackupRequest const& request) { - EXPECT_EQ(expected_name, request.name()); - gsad::v1::Backup response; - response.set_name(request.name()); - response.set_state(gsad::v1::Backup::READY); - return response; - }); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->GetBackup( - {Backup(Instance("test-project", "test-instance"), "test-backup") - .FullName()}); - ASSERT_STATUS_OK(response); - EXPECT_EQ(gsad::v1::Backup::READY, response->state()); - EXPECT_EQ(expected_name, response->name()); - EXPECT_FALSE(response->has_encryption_info()); -} - -/// @test Verify that GetBackup can return encryption info and key version. -TEST(DatabaseAdminClientTest, GetBackupWithEncryption) { - auto mock = std::make_shared(); - std::string const expected_name = - "projects/test-project/instances/test-instance/backups/test-backup"; - - EXPECT_CALL(*mock, GetBackup) - .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) - .WillOnce([&expected_name](grpc::ClientContext&, - gsad::v1::GetBackupRequest const& request) { - EXPECT_EQ(expected_name, request.name()); - gsad::v1::Backup response; - response.set_name(request.name()); - response.set_state(gsad::v1::Backup::READY); - response.mutable_encryption_info()->set_encryption_type( - gsad::v1::EncryptionInfo::CUSTOMER_MANAGED_ENCRYPTION); - response.mutable_encryption_info()->set_kms_key_version( - "projects/test-project/locations/some-location/keyRings/a-key-ring/" - "cryptoKeys/a-key-name/cryptoKeyVersions/1"); - return response; - }); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->GetBackup( - {Backup(Instance("test-project", "test-instance"), "test-backup") - .FullName()}); - ASSERT_STATUS_OK(response); - EXPECT_EQ(response->name(), expected_name); - EXPECT_EQ(response->state(), gsad::v1::Backup::READY); - EXPECT_TRUE(response->has_encryption_info()); - if (response->has_encryption_info()) { - EXPECT_EQ(response->encryption_info().encryption_type(), - gsad::v1::EncryptionInfo::CUSTOMER_MANAGED_ENCRYPTION); - EXPECT_EQ( - response->encryption_info().kms_key_version(), - "projects/test-project/locations/some-location/keyRings/a-key-ring/" - "cryptoKeys/a-key-name/cryptoKeyVersions/1"); - } -} - -/// @test Verify that permanent errors are reported immediately. -TEST(DatabaseAdminConnectionTest, GetBackupPermanentError) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, GetBackup) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->GetBackup( - {Backup(Instance("test-project", "test-instance"), "test-backup") - .FullName()}); - EXPECT_THAT(response, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify that too many transients errors are reported correctly. -TEST(DatabaseAdminConnectionTest, GetBackupTooManyTransients) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, GetBackup) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto response = conn->GetBackup( - {Backup(Instance("test-project", "test-instance"), "test-backup") - .FullName()}); - EXPECT_THAT(response, StatusIs(StatusCode::kUnavailable)); -} - -/// @test Verify that the successful case works. -TEST(DatabaseAdminConnectionTest, DeleteBackupSuccess) { - auto mock = std::make_shared(); - std::string const expected_name = - "projects/test-project/instances/test-instance/backups/test-backup"; - - EXPECT_CALL(*mock, DeleteBackup) - .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) - .WillOnce([&expected_name](grpc::ClientContext&, - gsad::v1::DeleteBackupRequest const& request) { - EXPECT_EQ(expected_name, request.name()); - return google::cloud::Status(); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - auto status = conn->DeleteBackup({expected_name}); - EXPECT_STATUS_OK(status); -} - -/// @test Verify that permanent errors are reported immediately. -TEST(DatabaseAdminConnectionTest, DeleteBackupPermanentError) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, DeleteBackup) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto status = conn->DeleteBackup( - {"projects/test-project/instances/test-instance/backups/test-backup"}); - EXPECT_THAT(status, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify that too many transients errors are reported correctly. -TEST(DatabaseAdminConnectionTest, DeleteBackupTooManyTransients) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, DeleteBackup) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto status = conn->DeleteBackup( - {"projects/test-project/instances/test-instance/backups/test-backup"}); - EXPECT_THAT(status, StatusIs(StatusCode::kUnavailable)); -} - -/// @test Verify that we can list backups in multiple pages. -TEST(DatabaseAdminConnectionTest, ListBackups) { - auto mock = std::make_shared(); - Instance in("test-project", "test-instance"); - std::string const expected_parent = in.FullName(); - - EXPECT_CALL(*mock, ListBackups) - .WillOnce( - [&expected_parent](grpc::ClientContext&, - gsad::v1::ListBackupsRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_TRUE(request.page_token().empty()); - - gsad::v1::ListBackupsResponse page; - page.set_next_page_token("page-1"); - page.add_backups()->set_name("backup-1"); - page.add_backups()->set_name("backup-2"); - return make_status_or(page); - }) - .WillOnce( - [&expected_parent](grpc::ClientContext&, - gsad::v1::ListBackupsRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_EQ("page-1", request.page_token()); - - gsad::v1::ListBackupsResponse page; - page.set_next_page_token("page-2"); - page.add_backups()->set_name("backup-3"); - page.add_backups()->set_name("backup-4"); - return make_status_or(page); - }) - .WillOnce( - [&expected_parent](grpc::ClientContext&, - gsad::v1::ListBackupsRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_EQ("page-2", request.page_token()); - - gsad::v1::ListBackupsResponse page; - page.clear_next_page_token(); - page.add_backups()->set_name("backup-5"); - return make_status_or(page); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - std::vector actual_names; - for (auto const& backup : conn->ListBackups({in, ""})) { - ASSERT_STATUS_OK(backup); - actual_names.push_back(backup->name()); - } - EXPECT_THAT(actual_names, ElementsAre("backup-1", "backup-2", "backup-3", - "backup-4", "backup-5")); -} - -TEST(DatabaseAdminConnectionTest, ListBackupsPermanentFailure) { - auto mock = std::make_shared(); - Instance in("test-project", "test-instance"); - - EXPECT_CALL(*mock, ListBackups) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto range = conn->ListBackups({in, ""}); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(DatabaseAdminConnectionTest, ListBackupsTooManyFailures) { - auto mock = std::make_shared(); - Instance in("test-project", "test-instance"); - - EXPECT_CALL(*mock, ListBackups) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto range = conn->ListBackups({in, ""}); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kUnavailable)); -} - -/// @test Verify that the successful case works. -TEST(DatabaseAdminConnectionTest, UpdateBackupSuccess) { - auto mock = std::make_shared(); - std::string const expected_name = - "projects/test-project/instances/test-instance/backups/test-backup"; - - EXPECT_CALL(*mock, UpdateBackup) - .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) - .WillOnce([&expected_name](grpc::ClientContext&, - gsad::v1::UpdateBackupRequest const& request) { - EXPECT_EQ(expected_name, request.backup().name()); - gsad::v1::Backup response; - response.set_name(request.backup().name()); - response.set_state(gsad::v1::Backup::READY); - return response; - }); - - auto conn = CreateTestingConnection(std::move(mock)); - google::spanner::admin::database::v1::UpdateBackupRequest request; - request.mutable_backup()->set_name( - Backup(Instance("test-project", "test-instance"), "test-backup") - .FullName()); - auto response = conn->UpdateBackup({request}); - ASSERT_STATUS_OK(response); - EXPECT_EQ(gsad::v1::Backup::READY, response->state()); - EXPECT_EQ(expected_name, response->name()); -} - -/// @test Verify that permanent errors are reported immediately. -TEST(DatabaseAdminConnectionTest, UpdateBackupPermanentError) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, UpdateBackup) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = CreateTestingConnection(std::move(mock)); - google::spanner::admin::database::v1::UpdateBackupRequest request; - auto response = conn->UpdateBackup({request}); - EXPECT_THAT(response, StatusIs(StatusCode::kPermissionDenied)); -} - -/// @test Verify that too many transients errors are reported correctly. -TEST(DatabaseAdminConnectionTest, UpdateBackupTooManyTransients) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, UpdateBackup) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = CreateTestingConnection(std::move(mock)); - google::spanner::admin::database::v1::UpdateBackupRequest request; - auto response = conn->UpdateBackup({request}); - EXPECT_THAT(response, StatusIs(StatusCode::kUnavailable)); -} - -/// @test Verify that we can list backup operations in multiple pages. -TEST(DatabaseAdminConnectionTest, ListBackupOperations) { - auto mock = std::make_shared(); - Instance in("test-project", "test-instance"); - std::string const expected_parent = in.FullName(); - - EXPECT_CALL(*mock, ListBackupOperations) - .WillOnce([&expected_parent]( - grpc::ClientContext&, - gsad::v1::ListBackupOperationsRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_TRUE(request.page_token().empty()); - - gsad::v1::ListBackupOperationsResponse page; - page.set_next_page_token("page-1"); - page.add_operations()->set_name("op-1"); - page.add_operations()->set_name("op-2"); - return make_status_or(page); - }) - .WillOnce([&expected_parent]( - grpc::ClientContext&, - gsad::v1::ListBackupOperationsRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_EQ("page-1", request.page_token()); - - gsad::v1::ListBackupOperationsResponse page; - page.set_next_page_token("page-2"); - page.add_operations()->set_name("op-3"); - page.add_operations()->set_name("op-4"); - return make_status_or(page); - }) - .WillOnce([&expected_parent]( - grpc::ClientContext&, - gsad::v1::ListBackupOperationsRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_EQ("page-2", request.page_token()); - - gsad::v1::ListBackupOperationsResponse page; - page.clear_next_page_token(); - page.add_operations()->set_name("op-5"); - return make_status_or(page); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - std::vector actual_names; - for (auto const& operation : conn->ListBackupOperations({in, ""})) { - ASSERT_STATUS_OK(operation); - actual_names.push_back(operation->name()); - } - EXPECT_THAT(actual_names, - ElementsAre("op-1", "op-2", "op-3", "op-4", "op-5")); -} - -TEST(DatabaseAdminConnectionTest, ListBackupOperationsPermanentFailure) { - auto mock = std::make_shared(); - Instance in("test-project", "test-instance"); - - EXPECT_CALL(*mock, ListBackupOperations) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto range = conn->ListBackupOperations({in, ""}); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(DatabaseAdminConnectionTest, ListBackupOperationsTooManyFailures) { - auto mock = std::make_shared(); - Instance in("test-project", "test-instance"); - - EXPECT_CALL(*mock, ListBackupOperations) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto range = conn->ListBackupOperations({in, ""}); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kUnavailable)); -} - -/// @test Verify that we can list database operations in multiple pages. -TEST(DatabaseAdminConnectionTest, ListDatabaseOperations) { - auto mock = std::make_shared(); - Instance in("test-project", "test-instance"); - std::string const expected_parent = in.FullName(); - - EXPECT_CALL(*mock, ListDatabaseOperations) - .WillOnce([&expected_parent]( - grpc::ClientContext&, - gsad::v1::ListDatabaseOperationsRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_TRUE(request.page_token().empty()); - - gsad::v1::ListDatabaseOperationsResponse page; - page.set_next_page_token("page-1"); - page.add_operations()->set_name("op-1"); - page.add_operations()->set_name("op-2"); - return make_status_or(page); - }) - .WillOnce([&expected_parent]( - grpc::ClientContext&, - gsad::v1::ListDatabaseOperationsRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_EQ("page-1", request.page_token()); - - gsad::v1::ListDatabaseOperationsResponse page; - page.set_next_page_token("page-2"); - page.add_operations()->set_name("op-3"); - page.add_operations()->set_name("op-4"); - return make_status_or(page); - }) - .WillOnce([&expected_parent]( - grpc::ClientContext&, - gsad::v1::ListDatabaseOperationsRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_EQ("page-2", request.page_token()); - - gsad::v1::ListDatabaseOperationsResponse page; - page.clear_next_page_token(); - page.add_operations()->set_name("op-5"); - return make_status_or(page); - }); - - auto conn = CreateTestingConnection(std::move(mock)); - std::vector actual_names; - for (auto const& operation : conn->ListDatabaseOperations({in, ""})) { - ASSERT_STATUS_OK(operation); - actual_names.push_back(operation->name()); - } - EXPECT_THAT(actual_names, - ElementsAre("op-1", "op-2", "op-3", "op-4", "op-5")); -} - -TEST(DatabaseAdminConnectionTest, ListDatabaseOperationsPermanentFailure) { - auto mock = std::make_shared(); - Instance in("test-project", "test-instance"); - - EXPECT_CALL(*mock, ListDatabaseOperations) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto range = conn->ListDatabaseOperations({in, ""}); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(DatabaseAdminConnectionTest, ListDatabaseOperationsTooManyFailures) { - auto mock = std::make_shared(); - Instance in("test-project", "test-instance"); - - EXPECT_CALL(*mock, ListDatabaseOperations) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = CreateTestingConnection(std::move(mock)); - auto range = conn->ListDatabaseOperations({in, ""}); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kUnavailable)); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner -} // namespace cloud -} // namespace google diff --git a/google/cloud/spanner/google_cloud_cpp_spanner.bzl b/google/cloud/spanner/google_cloud_cpp_spanner.bzl index 2225628fa9d8e..4ee5cfe878095 100644 --- a/google/cloud/spanner/google_cloud_cpp_spanner.bzl +++ b/google/cloud/spanner/google_cloud_cpp_spanner.bzl @@ -45,28 +45,22 @@ google_cloud_cpp_spanner_hdrs = [ "admin/internal/instance_admin_stub_factory.h", "admin/internal/instance_admin_tracing_connection.h", "admin/internal/instance_admin_tracing_stub.h", - "admin/retry_traits.h", "backoff_policy.h", "backup.h", "batch_dml_result.h", "bytes.h", "client.h", - "client_options.h", "commit_options.h", "commit_result.h", "connection.h", "connection_options.h", "create_instance_request_builder.h", "database.h", - "database_admin_client.h", - "database_admin_connection.h", "date.h", "directed_read_replicas.h", "encryption_config.h", "iam_updater.h", "instance.h", - "instance_admin_client.h", - "instance_admin_connection.h", "internal/channel.h", "internal/connection_impl.h", "internal/database_admin_logging.h", @@ -159,11 +153,7 @@ google_cloud_cpp_spanner_srcs = [ "connection.cc", "connection_options.cc", "database.cc", - "database_admin_client.cc", - "database_admin_connection.cc", "instance.cc", - "instance_admin_client.cc", - "instance_admin_connection.cc", "internal/connection_impl.cc", "internal/database_admin_logging.cc", "internal/database_admin_metadata.cc", diff --git a/google/cloud/spanner/google_cloud_cpp_spanner_mocks.bzl b/google/cloud/spanner/google_cloud_cpp_spanner_mocks.bzl index c23e21f05027c..8cb589854248d 100644 --- a/google/cloud/spanner/google_cloud_cpp_spanner_mocks.bzl +++ b/google/cloud/spanner/google_cloud_cpp_spanner_mocks.bzl @@ -19,8 +19,6 @@ google_cloud_cpp_spanner_mocks_hdrs = [ "admin/mocks/mock_database_admin_connection.h", "admin/mocks/mock_instance_admin_connection.h", - "mocks/mock_database_admin_connection.h", - "mocks/mock_instance_admin_connection.h", "mocks/mock_spanner_connection.h", "mocks/row.h", ] diff --git a/google/cloud/spanner/instance_admin_client.cc b/google/cloud/spanner/instance_admin_client.cc deleted file mode 100644 index bbb4f3b6969b1..0000000000000 --- a/google/cloud/spanner/instance_admin_client.cc +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO(#7356): Remove this file after the deprecation period expires -#include "google/cloud/internal/disable_deprecation_warnings.inc" -#include "google/cloud/spanner/instance_admin_client.h" -#include "google/cloud/options.h" - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -StatusOr -InstanceAdminClient::GetInstance(Instance const& in) { - internal::OptionsSpan span(conn_->options()); - return conn_->GetInstance({in.FullName()}); -} - -future> -InstanceAdminClient::CreateInstance( - google::spanner::admin::instance::v1::CreateInstanceRequest const& - request) { - internal::OptionsSpan span(conn_->options()); - return conn_->CreateInstance({request}); -} - -future> -InstanceAdminClient::UpdateInstance( - google::spanner::admin::instance::v1::UpdateInstanceRequest const& - request) { - internal::OptionsSpan span(conn_->options()); - return conn_->UpdateInstance({request}); -} - -Status InstanceAdminClient::DeleteInstance(Instance const& in) { - internal::OptionsSpan span(conn_->options()); - return conn_->DeleteInstance({in.FullName()}); -} - -StatusOr -InstanceAdminClient::GetInstanceConfig(std::string const& name) { - internal::OptionsSpan span(conn_->options()); - return conn_->GetInstanceConfig({name}); -} - -ListInstanceConfigsRange InstanceAdminClient::ListInstanceConfigs( - std::string project_id) { - internal::OptionsSpan span(conn_->options()); - return conn_->ListInstanceConfigs({std::move(project_id)}); -} - -ListInstancesRange InstanceAdminClient::ListInstances(std::string project_id, - std::string filter) { - internal::OptionsSpan span(conn_->options()); - return conn_->ListInstances({std::move(project_id), std::move(filter)}); -} - -StatusOr InstanceAdminClient::GetIamPolicy( - Instance const& in) { - internal::OptionsSpan span(conn_->options()); - return conn_->GetIamPolicy({in.FullName()}); -} - -StatusOr InstanceAdminClient::SetIamPolicy( - Instance const& in, google::iam::v1::Policy policy) { - internal::OptionsSpan span(conn_->options()); - return conn_->SetIamPolicy({in.FullName(), std::move(policy)}); -} - -StatusOr InstanceAdminClient::SetIamPolicy( - Instance const& in, IamUpdater const& updater) { - auto const rerun_maximum_duration = std::chrono::minutes(15); - auto default_rerun_policy = - LimitedTimeTransactionRerunPolicy(rerun_maximum_duration).clone(); - - auto const backoff_initial_delay = std::chrono::milliseconds(1000); - auto const backoff_maximum_delay = std::chrono::minutes(5); - auto const backoff_scaling = 2.0; - auto default_backoff_policy = - ExponentialBackoffPolicy(backoff_initial_delay, backoff_maximum_delay, - backoff_scaling) - .clone(); - - return SetIamPolicy(in, updater, std::move(default_rerun_policy), - std::move(default_backoff_policy)); -} - -StatusOr InstanceAdminClient::SetIamPolicy( - Instance const& in, IamUpdater const& updater, - std::unique_ptr rerun_policy, - std::unique_ptr backoff_policy) { - internal::OptionsSpan span(conn_->options()); - using RerunnablePolicy = spanner_internal::SafeTransactionRerun; - - Status last_status; - do { - auto current_policy = conn_->GetIamPolicy({in.FullName()}); - if (!current_policy) { - last_status = std::move(current_policy).status(); - } else { - auto etag = current_policy->etag(); - auto desired = updater(*current_policy); - if (!desired.has_value()) { - return current_policy; - } - desired->set_etag(std::move(etag)); - auto result = conn_->SetIamPolicy({in.FullName(), *std::move(desired)}); - if (RerunnablePolicy::IsOk(result.status())) { - return result; - } - last_status = std::move(result).status(); - } - if (!rerun_policy->OnFailure(last_status)) break; - std::this_thread::sleep_for(backoff_policy->OnCompletion()); - } while (!rerun_policy->IsExhausted()); - return last_status; -} - -StatusOr -InstanceAdminClient::TestIamPermissions(Instance const& in, - std::vector permissions) { - internal::OptionsSpan span(conn_->options()); - return conn_->TestIamPermissions({in.FullName(), std::move(permissions)}); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner -} // namespace cloud -} // namespace google diff --git a/google/cloud/spanner/instance_admin_client.h b/google/cloud/spanner/instance_admin_client.h deleted file mode 100644 index 3a00e56a7b08a..0000000000000 --- a/google/cloud/spanner/instance_admin_client.h +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_SPANNER_INSTANCE_ADMIN_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_INSTANCE_ADMIN_CLIENT_H - -#include "google/cloud/spanner/iam_updater.h" -#include "google/cloud/spanner/instance.h" -#include "google/cloud/spanner/instance_admin_connection.h" -#include "google/cloud/spanner/version.h" -#include "google/cloud/status_or.h" -#include -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * Performs instance administration operations on Cloud Spanner. - * - * @deprecated Please use #google::cloud::spanner_admin::InstanceAdminClient - * instead. - * - * Applications use this class to perform operations on - * [Spanner Databases][spanner-doc-link]. - * - * @par Performance - * - * `InstanceAdminClient` objects are cheap to create, copy, and move. However, - * each `InstanceAdminClient` object must be created with a - * `std::shared_ptr`, which itself is relatively - * expensive to create. Therefore, connection instances should be shared when - * possible. See the `MakeInstanceAdminConnection()` method and the - * `InstanceAdminConnection` interface for more details. - * - * @par Thread Safety - * - * Instances of this class created via copy-construction or copy-assignment - * share the underlying pool of connections. Access to these copies via multiple - * threads is guaranteed to work. Two threads operating on the same instance of - * this class is not guaranteed to work. - * - * @par Error Handling - * - * This class uses `StatusOr` to report errors. When an operation fails to - * perform its work the returned `StatusOr` contains the error details. If - * the `ok()` member function in the `StatusOr` returns `true` then it - * contains the expected result. For more information, see the - * [Error Handling Guide](#spanner-error-handling). - * - * [spanner-doc-link]: - * https://cloud.google.com/spanner/docs/api-libraries-overview - */ -class GOOGLE_CLOUD_CPP_SPANNER_ADMIN_API_DEPRECATED("InstanceAdminClient") - InstanceAdminClient { - public: - explicit InstanceAdminClient(std::shared_ptr conn) - : conn_(std::move(conn)) {} - - /// No default construction. - /// Use `InstanceAdminClient(std::shared_ptr)` - InstanceAdminClient() = delete; - - ///@{ - /// @name Copy and move support - InstanceAdminClient(InstanceAdminClient const&) = default; - InstanceAdminClient& operator=(InstanceAdminClient const&) = default; - InstanceAdminClient(InstanceAdminClient&&) = default; - InstanceAdminClient& operator=(InstanceAdminClient&&) = default; - ///@} - - ///@{ - /// @name Equality - friend bool operator==(InstanceAdminClient const& a, - InstanceAdminClient const& b) { - return a.conn_ == b.conn_; - } - friend bool operator!=(InstanceAdminClient const& a, - InstanceAdminClient const& b) { - return !(a == b); - } - ///@} - - /** - * Retrieve metadata information about a Cloud Spanner Instance. - * - * @par Idempotency - * This is a read-only operation and therefore it is always treated as - * idempotent. - * - * @par Example - * @snippet samples.cc get-instance - */ - StatusOr GetInstance( - Instance const& in); - - /** - * Creates a new Cloud Spanner instance in the given project. - * - * Use CreateInstanceRequestBuilder to build the - * `google::spanner::admin::instance::v1::CreateInstanceRequest` object. - * - * Note that the instance id must be between 2 and 64 characters long, it must - * start with a lowercase letter (`[a-z]`), it must end with a lowercase - * letter or a number (`[a-z0-9]`) and any characters between the beginning - * and ending characters must be lower case letters, numbers, or dashes (`-`), - * that is, they must belong to the `[-a-z0-9]` character set. - * - * @par Example - * @snippet samples.cc create-instance - * - */ - future> - CreateInstance( - google::spanner::admin::instance::v1::CreateInstanceRequest const&); - - /** - * Updates a Cloud Spanner instance. - * - * Use `google::cloud::spanner::UpdateInstanceRequestBuilder` to build the - * `google::spanner::admin::instance::v1::UpdateInstanceRequest` object. - * - * @par Idempotency - * This operation is idempotent as its result does not depend on the previous - * state of the instance. Note that, as is the case with all operations, it is - * subject to race conditions if multiple tasks are attempting to change the - * same fields in the same instance. - * - * @par Example - * @snippet samples.cc update-instance - * - */ - future> - UpdateInstance( - google::spanner::admin::instance::v1::UpdateInstanceRequest const&); - - /** - * Deletes an existing Cloud Spanner instance. - * - * @warning Deleting an instance deletes all the databases in the - * instance. This is an unrecoverable operation. - * - * @par Example - * @snippet samples.cc delete-instance - */ - Status DeleteInstance(Instance const& in); - - /** - * Retrieve information about a Cloud Spanner Instance Config. - * - * @par Idempotency - * This is a read-only operation and therefore it is always treated as - * idempotent. - * - * @par Example - * @snippet samples.cc get-instance-config - */ - StatusOr - GetInstanceConfig(std::string const& name); - - /** - * Retrieve a list of instance configs for a given project. - * - * @par Idempotency - * This is a read-only operation and therefore it is always treated as - * idempotent. - * - * @par Example - * @snippet samples.cc list-instance-configs - */ - ListInstanceConfigsRange ListInstanceConfigs(std::string project_id); - - /** - * Retrieve a list of instances for a given project. - * - * @par Idempotency - * This is a read-only operation and therefore it is always treated as - * idempotent. - * - * @par Example - * @snippet samples.cc list-instances - */ - ListInstancesRange ListInstances(std::string project_id, std::string filter); - - /** - * Get the IAM policy in effect for the given instance. - * - * This function retrieves the IAM policy configured in the given instance, - * that is, which roles are enabled in the instance, and what entities are - * members of each role. - * - * @par Idempotency - * This is a read-only operation and therefore it is always treated as - * idempotent. - * - * @par Example - * @snippet samples.cc instance-get-iam-policy - * - * @see The [Cloud Spanner - * documentation](https://cloud.google.com/spanner/docs/iam) for a - * description of the roles and permissions supported by Cloud Spanner. - * @see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions) - * for an introduction to Identity and Access Management in Google Cloud - * Platform. - */ - StatusOr GetIamPolicy(Instance const& in); - - /** - * Set the IAM policy for the given instance. - * - * This function changes the IAM policy configured in the given instance to - * the value of @p policy. - * - * @par Idempotency - * This function is only idempotent if the `etag` field in @p policy is set. - * Therefore, the underlying RPCs are only retried if the field is set, and - * the function returns the first RPC error in any other case. - * - * @par Example - * @snippet samples.cc add-database-reader - * - * @see The [Cloud Spanner - * documentation](https://cloud.google.com/spanner/docs/iam) for a - * description of the roles and permissions supported by Cloud Spanner. - * @see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions) - * for an introduction to Identity and Access Management in Google Cloud - * Platform. - */ - StatusOr SetIamPolicy( - Instance const& in, google::iam::v1::Policy policy); - - /** - * Updates the IAM policy for an instance using an optimistic concurrency - * control loop. - * - * This function repeatedly reads the current IAM policy in @p in, and then - * calls the @p updater with the this policy. The @p updater returns an empty - * optional if no changes are required, or it returns the new desired value - * for the IAM policy. This function then updates the policy. - * - * Updating an IAM policy can fail with retryable errors or can be aborted - * because there were simultaneous changes the to IAM policy. In these cases - * this function reruns the loop until it succeeds. - * - * The function returns the final IAM policy, or an error if the rerun policy - * for the underlying connection has expired. - * - * @par Idempotency - * This function always sets the `etag` field on the policy, so the underlying - * RPCs are retried automatically. - * - * @param in the identifier for the instance where you want to change the IAM - * policy. - * @param updater a callback to modify the policy. Return an unset optional - * to indicate that no changes to the policy are needed. - */ - StatusOr SetIamPolicy(Instance const& in, - IamUpdater const& updater); - - /** - * @copydoc SetIamPolicy(Instance const&,IamUpdater const&) - * - * @param rerun_policy controls for how long (or how many times) the updater - * will be rerun after the IAM policy update aborts. - * @param backoff_policy controls how long `SetIamPolicy` waits between - * reruns. - */ - StatusOr SetIamPolicy( - Instance const& in, IamUpdater const& updater, - std::unique_ptr rerun_policy, - std::unique_ptr backoff_policy); - - /** - * Get the subset of the permissions the caller has on the given instance. - * - * This function compares the given list of permissions against those - * permissions granted to the caller, and returns the subset of the list that - * the caller actually holds. - * - * @note Permission wildcards, such as `spanner.*` are not allowed. - * - * @par Example - * @snippet samples.cc instance-test-iam-permissions - * - * @see The [Cloud Spanner - * documentation](https://cloud.google.com/spanner/docs/iam) for a description - * of the roles and permissions supported by Cloud Spanner. - * @see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions) - * for an introduction to Identity and Access Management in Google Cloud - * Platform. - */ - StatusOr TestIamPermissions( - Instance const& in, std::vector permissions); - - private: - std::shared_ptr conn_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_INSTANCE_ADMIN_CLIENT_H diff --git a/google/cloud/spanner/instance_admin_client_test.cc b/google/cloud/spanner/instance_admin_client_test.cc deleted file mode 100644 index 44f838f805fb5..0000000000000 --- a/google/cloud/spanner/instance_admin_client_test.cc +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO(#7356): Remove this file after the deprecation period expires -#include "google/cloud/internal/disable_deprecation_warnings.inc" -#include "google/cloud/spanner/instance_admin_client.h" -#include "google/cloud/spanner/mocks/mock_instance_admin_connection.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "absl/types/optional.h" -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace gsai = ::google::spanner::admin::instance; - -using ::google::cloud::testing_util::StatusIs; -using spanner_mocks::MockInstanceAdminConnection; -using ::testing::AtLeast; -using ::testing::ElementsAre; -using ::testing::HasSubstr; - -TEST(InstanceAdminClientTest, CopyAndMove) { - auto conn1 = std::make_shared(); - auto conn2 = std::make_shared(); - - InstanceAdminClient c1(conn1); - InstanceAdminClient c2(conn2); - EXPECT_NE(c1, c2); - - // Copy construction - InstanceAdminClient c3 = c1; - EXPECT_EQ(c3, c1); - - // Copy assignment - c3 = c2; - EXPECT_EQ(c3, c2); - - // Move construction - InstanceAdminClient c4 = std::move(c3); - EXPECT_EQ(c4, c2); - - // Move assignment - c1 = std::move(c4); - EXPECT_EQ(c1, c2); -} - -TEST(InstanceAdminClientTest, GetInstance) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetInstance) - .WillOnce([](InstanceAdminConnection::GetInstanceParams const& p) { - EXPECT_EQ("projects/test-project/instances/test-instance", - p.instance_name); - return Status(StatusCode::kPermissionDenied, "uh-oh"); - }); - - InstanceAdminClient client(mock); - auto actual = client.GetInstance(Instance("test-project", "test-instance")); - EXPECT_THAT(actual, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminClientTest, GetInstanceConfig) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetInstanceConfig) - .WillOnce([](InstanceAdminConnection::GetInstanceConfigParams const& p) { - EXPECT_EQ("projects/test-project/instanceConfigs/test-config", - p.instance_config_name); - return Status(StatusCode::kPermissionDenied, "uh-oh"); - }); - - InstanceAdminClient client(mock); - auto actual = client.GetInstanceConfig( - "projects/test-project/instanceConfigs/test-config"); - EXPECT_THAT(actual, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminClientTest, ListInstanceConfigs) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, ListInstanceConfigs) - .WillOnce( - [](InstanceAdminConnection::ListInstanceConfigsParams const& p) { - EXPECT_EQ("test-project", p.project_id); - return google::cloud::internal::MakePaginationRange< - ListInstanceConfigsRange>( - gsai::v1::ListInstanceConfigsRequest{}, - [](gsai::v1::ListInstanceConfigsRequest const&) { - return StatusOr( - Status(StatusCode::kPermissionDenied, "uh-oh")); - }, - [](gsai::v1::ListInstanceConfigsResponse const&) { - return std::vector{}; - }); - }); - - InstanceAdminClient client(mock); - auto range = client.ListInstanceConfigs("test-project"); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminClientTest, ListInstances) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, ListInstances) - .WillOnce([](InstanceAdminConnection::ListInstancesParams const& p) { - EXPECT_EQ("test-project", p.project_id); - EXPECT_EQ("labels.test-key:test-value", p.filter); - - return google::cloud::internal::MakePaginationRange( - gsai::v1::ListInstancesRequest{}, - [](gsai::v1::ListInstancesRequest const&) { - return StatusOr( - Status(StatusCode::kPermissionDenied, "uh-oh")); - }, - [](gsai::v1::ListInstancesResponse const&) { - return std::vector{}; - }); - }); - - InstanceAdminClient client(mock); - auto range = - client.ListInstances("test-project", "labels.test-key:test-value"); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminClientTest, GetIamPolicy) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetIamPolicy) - .WillOnce([](InstanceAdminConnection::GetIamPolicyParams const& p) { - EXPECT_EQ("projects/test-project/instances/test-instance", - p.instance_name); - return Status(StatusCode::kPermissionDenied, "uh-oh"); - }); - - InstanceAdminClient client(mock); - auto actual = client.GetIamPolicy(Instance("test-project", "test-instance")); - EXPECT_THAT(actual, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminClientTest, SetIamPolicy) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, SetIamPolicy) - .WillOnce([](InstanceAdminConnection::SetIamPolicyParams const& p) { - EXPECT_EQ("projects/test-project/instances/test-instance", - p.instance_name); - return Status(StatusCode::kPermissionDenied, "uh-oh"); - }); - - InstanceAdminClient client(mock); - auto actual = client.SetIamPolicy(Instance("test-project", "test-instance"), - google::iam::v1::Policy{}); - EXPECT_THAT(actual, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminClientTest, SetIamPolicyOccGetFailure) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetIamPolicy) - .WillOnce([](InstanceAdminConnection::GetIamPolicyParams const& p) { - EXPECT_THAT(p.instance_name, HasSubstr("test-project")); - EXPECT_THAT(p.instance_name, HasSubstr("test-instance")); - return Status(StatusCode::kPermissionDenied, "uh-oh"); - }); - - InstanceAdminClient client(mock); - auto actual = - client.SetIamPolicy(Instance("test-project", "test-instance"), - [](google::iam::v1::Policy const&) { - return absl::optional{}; - }); - EXPECT_THAT(actual, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminClientTest, SetIamPolicyOccNoUpdates) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetIamPolicy) - .WillOnce([](InstanceAdminConnection::GetIamPolicyParams const& p) { - EXPECT_THAT(p.instance_name, HasSubstr("test-project")); - EXPECT_THAT(p.instance_name, HasSubstr("test-instance")); - google::iam::v1::Policy r; - r.set_etag("test-etag"); - return r; - }); - EXPECT_CALL(*mock, SetIamPolicy).Times(0); - - InstanceAdminClient client(mock); - auto actual = - client.SetIamPolicy(Instance("test-project", "test-instance"), - [](google::iam::v1::Policy const& p) { - EXPECT_EQ("test-etag", p.etag()); - return absl::optional{}; - }); - ASSERT_STATUS_OK(actual); - EXPECT_EQ("test-etag", actual->etag()); -} - -std::unique_ptr RerunPolicyForTesting() { - return LimitedErrorCountTransactionRerunPolicy(/*maximum_failures=*/3) - .clone(); -} - -std::unique_ptr BackoffPolicyForTesting() { - return ExponentialBackoffPolicy( - /*initial_delay=*/std::chrono::microseconds(1), - /*maximum_delay=*/std::chrono::microseconds(1), /*scaling=*/2.0) - .clone(); -} - -TEST(InstanceAdminClientTest, SetIamPolicyOccRetryAborted) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetIamPolicy) - .WillOnce([](InstanceAdminConnection::GetIamPolicyParams const& p) { - EXPECT_THAT(p.instance_name, HasSubstr("test-project")); - EXPECT_THAT(p.instance_name, HasSubstr("test-instance")); - google::iam::v1::Policy r; - r.set_etag("test-etag-1"); - return r; - }) - .WillOnce([](InstanceAdminConnection::GetIamPolicyParams const& p) { - EXPECT_THAT(p.instance_name, HasSubstr("test-project")); - EXPECT_THAT(p.instance_name, HasSubstr("test-instance")); - google::iam::v1::Policy r; - r.set_etag("test-etag-2"); - return r; - }); - EXPECT_CALL(*mock, SetIamPolicy) - .WillOnce([](InstanceAdminConnection::SetIamPolicyParams const& p) { - EXPECT_THAT(p.instance_name, HasSubstr("test-project")); - EXPECT_THAT(p.instance_name, HasSubstr("test-instance")); - EXPECT_EQ("test-etag-1", p.policy.etag()); - return Status(StatusCode::kAborted, "aborted"); - }) - .WillOnce([](InstanceAdminConnection::SetIamPolicyParams const& p) { - EXPECT_THAT(p.instance_name, HasSubstr("test-project")); - EXPECT_THAT(p.instance_name, HasSubstr("test-instance")); - EXPECT_EQ("test-etag-2", p.policy.etag()); - google::iam::v1::Policy r; - r.set_etag("test-etag-3"); - return r; - }); - - InstanceAdminClient client(mock); - int counter = 0; - auto actual = client.SetIamPolicy( - Instance("test-project", "test-instance"), - [&counter](google::iam::v1::Policy p) { - EXPECT_EQ("test-etag-" + std::to_string(++counter), p.etag()); - return p; - }, - RerunPolicyForTesting(), BackoffPolicyForTesting()); - ASSERT_STATUS_OK(actual); - EXPECT_EQ("test-etag-3", actual->etag()); -} - -TEST(InstanceAdminClientTest, SetIamPolicyOccRetryAbortedTooManyFailures) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetIamPolicy) - .WillRepeatedly([](InstanceAdminConnection::GetIamPolicyParams const& p) { - EXPECT_THAT(p.instance_name, HasSubstr("test-project")); - EXPECT_THAT(p.instance_name, HasSubstr("test-instance")); - google::iam::v1::Policy r; - r.set_etag("test-etag-1"); - return r; - }); - EXPECT_CALL(*mock, SetIamPolicy) - .Times(AtLeast(2)) - .WillRepeatedly([](InstanceAdminConnection::SetIamPolicyParams const& p) { - EXPECT_THAT(p.instance_name, HasSubstr("test-project")); - EXPECT_THAT(p.instance_name, HasSubstr("test-instance")); - EXPECT_EQ("test-etag-1", p.policy.etag()); - return Status(StatusCode::kAborted, "test-msg"); - }); - - InstanceAdminClient client(mock); - auto actual = client.SetIamPolicy( - Instance("test-project", "test-instance"), - [](google::iam::v1::Policy p) { return p; }, RerunPolicyForTesting(), - BackoffPolicyForTesting()); - EXPECT_THAT(actual, StatusIs(StatusCode::kAborted, HasSubstr("test-msg"))); -} - -TEST(InstanceAdminClientTest, TestIamPermissions) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, TestIamPermissions) - .WillOnce([](InstanceAdminConnection::TestIamPermissionsParams const& p) { - EXPECT_EQ("projects/test-project/instances/test-instance", - p.instance_name); - EXPECT_THAT(p.permissions, - ElementsAre("test.permission1", "test.permission2")); - return Status(StatusCode::kPermissionDenied, "uh-oh"); - }); - - InstanceAdminClient client(mock); - auto actual = - client.TestIamPermissions(Instance("test-project", "test-instance"), - {"test.permission1", "test.permission2"}); - EXPECT_THAT(actual, StatusIs(StatusCode::kPermissionDenied)); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner -} // namespace cloud -} // namespace google diff --git a/google/cloud/spanner/instance_admin_connection.cc b/google/cloud/spanner/instance_admin_connection.cc deleted file mode 100644 index 90685c40d55ca..0000000000000 --- a/google/cloud/spanner/instance_admin_connection.cc +++ /dev/null @@ -1,337 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO(#7356): Remove this file after the deprecation period expires -#include "google/cloud/internal/disable_deprecation_warnings.inc" -#include "google/cloud/spanner/instance_admin_connection.h" -#include "google/cloud/spanner/instance.h" -#include "google/cloud/spanner/internal/defaults.h" -#include "google/cloud/spanner/options.h" -#include "google/cloud/internal/async_long_running_operation.h" -#include "google/cloud/internal/retry_loop.h" -#include -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -namespace gsai = ::google::spanner::admin::instance; - -using ::google::cloud::Idempotency; - -namespace { - -class InstanceAdminConnectionImpl : public InstanceAdminConnection { - public: - InstanceAdminConnectionImpl( - std::shared_ptr stub, Options opts) - : stub_(std::move(stub)), - opts_(std::move(opts)), - retry_policy_prototype_(opts_.get()->clone()), - backoff_policy_prototype_( - opts_.get()->clone()), - polling_policy_prototype_( - opts_.get()->clone()), - background_threads_(internal::MakeBackgroundThreadsFactory(opts_)()) {} - - ~InstanceAdminConnectionImpl() override = default; - - Options options() override { return opts_; } - - StatusOr GetInstance(GetInstanceParams gip) override { - gsai::v1::GetInstanceRequest request; - request.set_name(std::move(gip.instance_name)); - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kIdempotent, - [this](grpc::ClientContext& context, - gsai::v1::GetInstanceRequest const& request) { - return stub_->GetInstance(context, request); - }, - request, __func__); - } - - future> CreateInstance( - CreateInstanceParams p) override { - return google::cloud::internal::AsyncLongRunningOperation< - gsai::v1::Instance>( - background_threads_->cq(), - google::cloud::internal::SaveCurrentOptions(), std::move(p.request), - [stub = stub_](google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - gsai::v1::CreateInstanceRequest const& request) { - return stub->AsyncCreateInstance(cq, std::move(context), request); - }, - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - google::longrunning::GetOperationRequest const& request) { - return stub->AsyncGetOperation(cq, std::move(context), request); - }, - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - google::longrunning::CancelOperationRequest const& request) { - return stub->AsyncCancelOperation(cq, std::move(context), request); - }, - &google::cloud::internal::ExtractLongRunningResultResponse< - gsai::v1::Instance>, - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kNonIdempotent, polling_policy_prototype_->clone(), - __func__); - } - - future> UpdateInstance( - UpdateInstanceParams p) override { - return google::cloud::internal::AsyncLongRunningOperation< - gsai::v1::Instance>( - background_threads_->cq(), - google::cloud::internal::SaveCurrentOptions(), std::move(p.request), - [stub = stub_](google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - gsai::v1::UpdateInstanceRequest const& request) { - return stub->AsyncUpdateInstance(cq, std::move(context), request); - }, - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - google::longrunning::GetOperationRequest const& request) { - return stub->AsyncGetOperation(cq, std::move(context), request); - }, - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions const&, - google::longrunning::CancelOperationRequest const& request) { - return stub->AsyncCancelOperation(cq, std::move(context), request); - }, - &google::cloud::internal::ExtractLongRunningResultResponse< - gsai::v1::Instance>, - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kIdempotent, polling_policy_prototype_->clone(), __func__); - } - - Status DeleteInstance(DeleteInstanceParams p) override { - gsai::v1::DeleteInstanceRequest request; - request.set_name(std::move(p.instance_name)); - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kIdempotent, - [this](grpc::ClientContext& context, - gsai::v1::DeleteInstanceRequest const& request) { - return stub_->DeleteInstance(context, request); - }, - request, __func__); - } - - StatusOr GetInstanceConfig( - GetInstanceConfigParams p) override { - gsai::v1::GetInstanceConfigRequest request; - request.set_name(std::move(p.instance_config_name)); - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kIdempotent, - [this](grpc::ClientContext& context, - gsai::v1::GetInstanceConfigRequest const& request) { - return stub_->GetInstanceConfig(context, request); - }, - request, __func__); - } - - ListInstanceConfigsRange ListInstanceConfigs( - ListInstanceConfigsParams params) override { - gsai::v1::ListInstanceConfigsRequest request; - request.set_parent("projects/" + params.project_id); - request.clear_page_token(); - auto& stub = stub_; - // Because we do not have C++14 generalized lambda captures we cannot just - // use the unique_ptr<> here, so convert to shared_ptr<> instead. - auto retry = std::shared_ptr(retry_policy_prototype_->clone()); - auto backoff = - std::shared_ptr(backoff_policy_prototype_->clone()); - - char const* function_name = __func__; - return google::cloud::internal::MakePaginationRange< - ListInstanceConfigsRange>( - std::move(request), - [stub, retry, backoff, - function_name](gsai::v1::ListInstanceConfigsRequest const& r) { - return RetryLoop( - retry->clone(), backoff->clone(), Idempotency::kIdempotent, - [stub](grpc::ClientContext& context, - gsai::v1::ListInstanceConfigsRequest const& request) { - return stub->ListInstanceConfigs(context, request); - }, - r, function_name); - }, - [](gsai::v1::ListInstanceConfigsResponse r) { - std::vector result( - r.instance_configs().size()); - auto& configs = *r.mutable_instance_configs(); - std::move(configs.begin(), configs.end(), result.begin()); - return result; - }); - } - - ListInstancesRange ListInstances(ListInstancesParams params) override { - gsai::v1::ListInstancesRequest request; - request.set_parent("projects/" + params.project_id); - request.set_filter(std::move(params.filter)); - request.clear_page_token(); - auto& stub = stub_; - // Because we do not have C++14 generalized lambda captures we cannot just - // use the unique_ptr<> here, so convert to shared_ptr<> instead. - auto retry = std::shared_ptr(retry_policy_prototype_->clone()); - auto backoff = - std::shared_ptr(backoff_policy_prototype_->clone()); - - char const* function_name = __func__; - return google::cloud::internal::MakePaginationRange( - std::move(request), - [stub, retry, backoff, - function_name](gsai::v1::ListInstancesRequest const& r) { - return RetryLoop( - retry->clone(), backoff->clone(), Idempotency::kIdempotent, - [stub](grpc::ClientContext& context, - gsai::v1::ListInstancesRequest const& request) { - return stub->ListInstances(context, request); - }, - r, function_name); - }, - [](gsai::v1::ListInstancesResponse r) { - std::vector result(r.instances().size()); - auto& instances = *r.mutable_instances(); - std::move(instances.begin(), instances.end(), result.begin()); - return result; - }); - } - - StatusOr GetIamPolicy( - GetIamPolicyParams p) override { - google::iam::v1::GetIamPolicyRequest request; - request.set_resource(std::move(p.instance_name)); - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kIdempotent, - [this](grpc::ClientContext& context, - google::iam::v1::GetIamPolicyRequest const& request) { - return stub_->GetIamPolicy(context, request); - }, - request, __func__); - } - - StatusOr SetIamPolicy( - SetIamPolicyParams p) override { - google::iam::v1::SetIamPolicyRequest request; - request.set_resource(std::move(p.instance_name)); - *request.mutable_policy() = std::move(p.policy); - auto const idempotency = request.policy().etag().empty() - ? Idempotency::kNonIdempotent - : Idempotency::kIdempotent; - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - idempotency, - [this](grpc::ClientContext& context, - google::iam::v1::SetIamPolicyRequest const& request) { - return stub_->SetIamPolicy(context, request); - }, - request, __func__); - } - - StatusOr TestIamPermissions( - TestIamPermissionsParams p) override { - google::iam::v1::TestIamPermissionsRequest request; - request.set_resource(std::move(p.instance_name)); - for (auto& permission : p.permissions) { - request.add_permissions(std::move(permission)); - } - return RetryLoop( - retry_policy_prototype_->clone(), backoff_policy_prototype_->clone(), - Idempotency::kIdempotent, - [this](grpc::ClientContext& context, - google::iam::v1::TestIamPermissionsRequest const& request) { - return stub_->TestIamPermissions(context, request); - }, - request, __func__); - } - - private: - std::shared_ptr stub_; - Options opts_; - std::unique_ptr retry_policy_prototype_; - std::unique_ptr backoff_policy_prototype_; - std::unique_ptr polling_policy_prototype_; - - // Implementations of `BackgroundThreads` typically create a pool of - // threads that are joined during destruction, so, to avoid ownership - // cycles, those threads should never assume ownership of this object - // (e.g., via a `std::shared_ptr<>`). - std::unique_ptr background_threads_; -}; - -} // namespace - -InstanceAdminConnection::~InstanceAdminConnection() = default; - -std::shared_ptr MakeInstanceAdminConnection( - Options opts) { - internal::CheckExpectedOptions(opts, __func__); - opts = spanner_internal::DefaultAdminOptions(std::move(opts)); - auto stub = spanner_internal::CreateDefaultInstanceAdminStub(opts); - return std::make_shared( - std::move(stub), std::move(opts)); -} - -std::shared_ptr MakeInstanceAdminConnection( - ConnectionOptions const& options) { - return MakeInstanceAdminConnection(internal::MakeOptions(options)); -} - -std::shared_ptr MakeInstanceAdminConnection( - ConnectionOptions const& options, std::unique_ptr retry_policy, - std::unique_ptr backoff_policy, - std::unique_ptr polling_policy) { - auto opts = internal::MakeOptions(options); - opts.set(std::move(retry_policy)); - opts.set(std::move(backoff_policy)); - opts.set(std::move(polling_policy)); - return MakeInstanceAdminConnection(std::move(opts)); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner - -namespace spanner_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -std::shared_ptr -MakeInstanceAdminConnectionForTesting(std::shared_ptr stub, - Options opts) { - opts = spanner_internal::DefaultAdminOptions(std::move(opts)); - return std::make_shared( - std::move(stub), std::move(opts)); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/spanner/instance_admin_connection.h b/google/cloud/spanner/instance_admin_connection.h deleted file mode 100644 index c725996d6794d..0000000000000 --- a/google/cloud/spanner/instance_admin_connection.h +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_SPANNER_INSTANCE_ADMIN_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_INSTANCE_ADMIN_CONNECTION_H - -#include "google/cloud/spanner/backoff_policy.h" -#include "google/cloud/spanner/internal/instance_admin_stub.h" -#include "google/cloud/spanner/polling_policy.h" -#include "google/cloud/spanner/retry_policy.h" -#include "google/cloud/spanner/version.h" -#include "google/cloud/backoff_policy.h" -#include "google/cloud/internal/pagination_range.h" -#include "google/cloud/options.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * An input range to stream all the instances in a Cloud project. - * - * This type models an [input range][cppref-input-range] of - * `google::spanner::admin::v1::Instance` objects. Applications can make a - * single pass through the results. - * - * [cppref-input-range]: https://en.cppreference.com/w/cpp/ranges/input_range - */ -using ListInstancesRange = ::google::cloud::internal::PaginationRange< - google::spanner::admin::instance::v1::Instance>; - -/** - * An input range to stream all the instance configs in a Cloud project. - * - * This type models an [input range][cppref-input-range] of - * `google::spanner::admin::v1::Instance` objects. Applications can make a - * single pass through the results. - * - * [cppref-input-range]: https://en.cppreference.com/w/cpp/ranges/input_range - */ -using ListInstanceConfigsRange = ::google::cloud::internal::PaginationRange< - google::spanner::admin::instance::v1::InstanceConfig>; - -/** - * A connection to the Cloud Spanner instance administration service. - * - * @deprecated Please use #google::cloud::spanner_admin::InstanceAdminClient - * and #google::cloud::spanner_admin::InstanceAdminConnection instead. - * - * This interface defines pure-virtual methods for each of the user-facing - * overload sets in `InstanceAdminClient`. This allows users to inject custom - * behavior (e.g., with a Google Mock object) in a `InstanceAdminClient` object - * for use in their own tests. - * - * To create a concrete instance that connects you to a real Cloud Spanner - * instance administration service, see `MakeInstanceAdminConnection()`. - */ -class GOOGLE_CLOUD_CPP_SPANNER_ADMIN_API_DEPRECATED("InstanceAdminConnection") - InstanceAdminConnection { - public: - virtual ~InstanceAdminConnection() = 0; - - ///@{ - /** - * @name Define the arguments for each member function. - * - * Applications may define classes derived from `InstanceAdminConnection`, - * for example, because they want to mock the class. To avoid breaking all - * such derived classes when we change the number or type of the arguments - * to the member functions we define light weight structures to pass the - * arguments. - */ - /// Wrap the arguments for `GetInstance()`. - struct GetInstanceParams { - /// The full name of the instance in - /// `projects//instances/` format. - std::string instance_name; - }; - - /// Wrap the arguments for `CreateInstance()`. - struct CreateInstanceParams { - google::spanner::admin::instance::v1::CreateInstanceRequest request; - }; - - /// Wrap the arguments for `UpdateInstance()`. - struct UpdateInstanceParams { - google::spanner::admin::instance::v1::UpdateInstanceRequest request; - }; - - /// Wrap the arguments for `DeleteInstance()`. - struct DeleteInstanceParams { - std::string instance_name; - }; - - /// Wrap the arguments for `GetInstanceConfig()`. - struct GetInstanceConfigParams { - std::string instance_config_name; - }; - - /// Wrap the arguments for `ListInstanceConfigs()`. - struct ListInstanceConfigsParams { - std::string project_id; - }; - - /** - * Wrap the arguments for `ListInstances()`. - */ - struct ListInstancesParams { - /** - * Query the instances in this project. - * - * This is a required value, it must be non-empty. - */ - std::string project_id; - - /** - * A filtering expression to restrict the set of instances included in the - * response. - * - * @see The [RPC reference documentation][1] for the format of the filtering - * expression. - * - * [1]: - * https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.ListInstancesRequest - */ - std::string filter; - }; - - /// Wrap the arguments for `GetIamPolicy()`. - struct GetIamPolicyParams { - std::string instance_name; - }; - - /// Wrap the arguments for `SetIamPolicy()`. - struct SetIamPolicyParams { - std::string instance_name; - google::iam::v1::Policy policy; - }; - - /// Wrap the arguments for `TestIamPermissions()`. - struct TestIamPermissionsParams { - std::string instance_name; - std::vector permissions; - }; - ///@} - - virtual Options options() { return Options{}; } - - /// Return the metadata for the given instance. - virtual StatusOr GetInstance( - GetInstanceParams) = 0; - - virtual future> - CreateInstance(CreateInstanceParams p) = 0; - - virtual future> - UpdateInstance(UpdateInstanceParams p) = 0; - - virtual Status DeleteInstance(DeleteInstanceParams p) = 0; - - /// Return the InstanceConfig with the given name. - virtual StatusOr - GetInstanceConfig(GetInstanceConfigParams) = 0; - - /** - * Returns a one-pass input range with all the instance configs. - */ - virtual ListInstanceConfigsRange ListInstanceConfigs( - ListInstanceConfigsParams) = 0; - - /** - * Returns a one-pass input range with all the instances meeting the - * requirements in @p params - */ - virtual ListInstancesRange ListInstances(ListInstancesParams params) = 0; - - /// Define the interface for a - /// google.spanner.v1.DatabaseAdmin.GetIamPolicy RPC. - virtual StatusOr GetIamPolicy( - GetIamPolicyParams) = 0; - - /// Define the interface for a - /// google.spanner.v1.DatabaseAdmin.SetIamPolicy RPC. - virtual StatusOr SetIamPolicy( - SetIamPolicyParams) = 0; - - /// Define the interface for a - /// google.spanner.v1.DatabaseAdmin.TestIamPermissions RPC. - virtual StatusOr - TestIamPermissions(TestIamPermissionsParams) = 0; -}; - -/** - * Returns an InstanceAdminConnection object that can be used for interacting - * with Cloud Spanner's admin APIs. - * - * The returned connection object should not be used directly; instead it - * should be given to a `InstanceAdminClient` instance. - * - * The optional @p opts argument may be used to configure aspects of the - * returned `InstanceAdminConnection`. Expected options are any of the types in - * the following option lists. - * - * - `google::cloud::CommonOptionList` - * - `google::cloud::GrpcOptionList` - * - `google::cloud::SpannerPolicyOptionList` - * - * @see `InstanceAdminConnection` - * - * @param opts (optional) configure the `InstanceAdminConnection` created by - * this function. - */ -GOOGLE_CLOUD_CPP_SPANNER_ADMIN_API_DEPRECATED("MakeInstanceAdminConnection()") -std::shared_ptr MakeInstanceAdminConnection( - Options opts = {}); - -/** - * Returns an InstanceAdminConnection object that can be used for interacting - * with Cloud Spanner's admin APIs. - * - * The returned connection object should not be used directly, rather it should - * be given to a `InstanceAdminClient` instance. - * - * @note Prefer using the `MakeInstanceAdminConnection()` overload that accepts - * `google::cloud::Options`. - * - * @see `InstanceAdminConnection` - * - * @param options configure the `InstanceAdminConnection` created by this - * function. - */ -GOOGLE_CLOUD_CPP_SPANNER_ADMIN_API_DEPRECATED("MakeInstanceAdminConnection()") -std::shared_ptr MakeInstanceAdminConnection( - ConnectionOptions const& options); - -/** - * Returns an InstanceAdminConnection object that can be used for interacting - * with Cloud Spanner's admin APIs. - * - * The returned connection object should not be used directly, rather it should - * be given to a `InstanceAdminClient` instance. - * - * @note Prefer using the `MakeInstanceAdminConnection()` overload that accepts - * `google::cloud::Options`. - * - * @param options configure the `InstanceAdminConnection` created by this - * function. - * @param retry_policy control for how long (or how many times) are retryable - * RPCs attempted - * @param backoff_policy controls the backoff behavior between retry attempts, - * typically some form of exponential backoff with jitter - * @param polling_policy controls for how often, and how quickly, are long - * running checked for completion - * - * @par Example - * @snippet samples.cc custom-instance-admin-policies - */ -GOOGLE_CLOUD_CPP_SPANNER_ADMIN_API_DEPRECATED("MakeInstanceAdminConnection()") -std::shared_ptr MakeInstanceAdminConnection( - ConnectionOptions const& options, std::unique_ptr retry_policy, - std::unique_ptr backoff_policy, - std::unique_ptr polling_policy); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner - -namespace spanner_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// Internal-only factory that allows us to inject mock stubs for testing. -std::shared_ptr -MakeInstanceAdminConnectionForTesting( - std::shared_ptr base_stub, Options opts); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner_internal - -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_INSTANCE_ADMIN_CONNECTION_H diff --git a/google/cloud/spanner/instance_admin_connection_test.cc b/google/cloud/spanner/instance_admin_connection_test.cc deleted file mode 100644 index b347b06734159..0000000000000 --- a/google/cloud/spanner/instance_admin_connection_test.cc +++ /dev/null @@ -1,732 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO(#7356): Remove this file after the deprecation period expires -#include "google/cloud/internal/disable_deprecation_warnings.inc" -#include "google/cloud/spanner/instance_admin_connection.h" -#include "google/cloud/spanner/create_instance_request_builder.h" -#include "google/cloud/spanner/internal/defaults.h" -#include "google/cloud/spanner/options.h" -#include "google/cloud/spanner/testing/mock_instance_admin_stub.h" -#include "google/cloud/testing_util/is_proto_equal.h" -#include "google/cloud/testing_util/status_matchers.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace gsai = ::google::spanner::admin::instance; - -using ::google::cloud::testing_util::IsProtoEqual; -using ::google::cloud::testing_util::StatusIs; -using ::google::protobuf::TextFormat; -using ::testing::AtLeast; -using ::testing::ElementsAre; -using ::testing::Return; - -// Create a `Connection` suitable for use in tests that continue retrying -// until the retry policy is exhausted - attempting that with the default -// policies would take too long (30 minutes). -// Other tests can use this method or just call `MakeInstanceAdminConnection()` -// directly. -std::shared_ptr MakeLimitedRetryConnection( - std::shared_ptr mock) { - LimitedErrorCountRetryPolicy retry(/*maximum_failures=*/2); - ExponentialBackoffPolicy backoff( - /*initial_delay=*/std::chrono::microseconds(1), - /*maximum_delay=*/std::chrono::microseconds(1), - /*scaling=*/2.0); - GenericPollingPolicy polling(retry, backoff); - Options opts; - opts.set(retry.clone()); - opts.set(backoff.clone()); - opts.set(polling.clone()); - return spanner_internal::MakeInstanceAdminConnectionForTesting( - std::move(mock), std::move(opts)); -} - -TEST(InstanceAdminConnectionTest, GetInstanceSuccess) { - std::string const expected_name = - "projects/test-project/instances/test-instance"; - - auto constexpr kInstanceText = R"pb( - name: "projects/test-project/instances/test-instance" - config: "test-config" - display_name: "test display name" - node_count: 7 - state: CREATING - create_time { seconds: 1657025805 nanos: 967908745 } - update_time { seconds: 1657025805 nanos: 967908745 } - )pb"; - gsai::v1::Instance expected_instance; - ASSERT_TRUE(TextFormat::ParseFromString(kInstanceText, &expected_instance)); - - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetInstance) - .WillOnce([&expected_name](grpc::ClientContext&, - gsai::v1::GetInstanceRequest const& request) { - EXPECT_EQ(expected_name, request.name()); - return Status(StatusCode::kUnavailable, "try-again"); - }) - .WillOnce([&expected_name, &expected_instance]( - grpc::ClientContext&, - gsai::v1::GetInstanceRequest const& request) { - EXPECT_EQ(expected_name, request.name()); - return expected_instance; - }); - - auto conn = MakeLimitedRetryConnection(mock); - auto actual = conn->GetInstance({expected_name}); - EXPECT_THAT(*actual, IsProtoEqual(expected_instance)); -} - -TEST(InstanceAdminConnectionTest, GetInstancePermanentFailure) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetInstance) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto actual = conn->GetInstance({"test-name"}); - EXPECT_THAT(actual, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminConnectionTest, GetInstanceTooManyTransients) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetInstance) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto actual = conn->GetInstance({"test-name"}); - EXPECT_THAT(actual, StatusIs(StatusCode::kUnavailable)); -} - -TEST(InstanceAdminClientTest, CreateInstanceSuccess) { - auto mock = std::make_shared(); - std::string const expected_name = - "projects/test-project/instances/test-instance"; - - EXPECT_CALL(*mock, AsyncCreateInstance) - .WillOnce([&expected_name](CompletionQueue&, auto, - gsai::v1::CreateInstanceRequest const& r) { - EXPECT_EQ("test-instance", r.instance_id()); - EXPECT_EQ("projects/test-project", r.parent()); - auto const& instance = r.instance(); - EXPECT_EQ(expected_name, instance.name()); - EXPECT_EQ("test-instance-config", instance.config()); - EXPECT_EQ("test-display-name", instance.display_name()); - auto const& labels = instance.labels(); - EXPECT_EQ(1, labels.count("key")); - EXPECT_EQ("value", labels.at("key")); - google::longrunning::Operation op; - op.set_name("test-operation-name"); - op.set_done(false); - return make_ready_future(make_status_or(op)); - }); - EXPECT_CALL(*mock, AsyncGetOperation) - .WillOnce( - [&expected_name](CompletionQueue&, auto, - google::longrunning::GetOperationRequest const& r) { - EXPECT_EQ("test-operation-name", r.name()); - google::longrunning::Operation op; - op.set_name(r.name()); - op.set_done(true); - gsai::v1::Instance instance; - instance.set_name(expected_name); - op.mutable_response()->PackFrom(instance); - return make_ready_future(make_status_or(op)); - }); - - auto conn = MakeLimitedRetryConnection(std::move(mock)); - Instance in("test-project", "test-instance"); - auto fut = conn->CreateInstance( - {CreateInstanceRequestBuilder(in, "test-instance-config") - .SetDisplayName("test-display-name") - .SetNodeCount(1) - .SetLabels({{"key", "value"}}) - .Build()}); - auto instance = fut.get(); - ASSERT_STATUS_OK(instance); - - EXPECT_EQ(expected_name, instance->name()); -} - -TEST(InstanceAdminClientTest, CreateInstanceError) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, AsyncCreateInstance) - .WillOnce( - [](CompletionQueue&, auto, gsai::v1::CreateInstanceRequest const&) { - return make_ready_future(StatusOr( - Status(StatusCode::kPermissionDenied, "uh-oh"))); - }); - - auto conn = MakeLimitedRetryConnection(std::move(mock)); - Instance in("test-project", "test-instance"); - auto fut = conn->CreateInstance( - {CreateInstanceRequestBuilder(in, "test-instance-config") - .SetDisplayName("test-display-name") - .SetNodeCount(1) - .SetLabels({{"key", "value"}}) - .Build()}); - auto instance = fut.get(); - EXPECT_THAT(instance, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminClientTest, UpdateInstanceSuccess) { - auto mock = std::make_shared(); - std::string expected_name = "projects/test-project/instances/test-instance"; - - EXPECT_CALL(*mock, AsyncUpdateInstance) - .WillOnce( - [](CompletionQueue&, auto, gsai::v1::UpdateInstanceRequest const&) { - return make_ready_future(StatusOr( - Status(StatusCode::kUnavailable, "try-again"))); - }) - .WillOnce([&expected_name](CompletionQueue&, auto, - gsai::v1::UpdateInstanceRequest const& r) { - EXPECT_EQ(expected_name, r.instance().name()); - google::longrunning::Operation op; - op.set_name("test-operation-name"); - op.set_done(false); - return make_ready_future(make_status_or(op)); - }); - EXPECT_CALL(*mock, AsyncGetOperation) - .WillOnce( - [&expected_name](CompletionQueue&, auto, - google::longrunning::GetOperationRequest const& r) { - EXPECT_EQ("test-operation-name", r.name()); - google::longrunning::Operation op; - op.set_name(r.name()); - op.set_done(true); - gsai::v1::Instance instance; - instance.set_name(expected_name); - op.mutable_response()->PackFrom(instance); - return make_ready_future(make_status_or(op)); - }); - - auto conn = MakeLimitedRetryConnection(std::move(mock)); - gsai::v1::UpdateInstanceRequest req; - req.mutable_instance()->set_name(expected_name); - auto fut = conn->UpdateInstance({req}); - auto instance = fut.get(); - ASSERT_STATUS_OK(instance); - - EXPECT_EQ(expected_name, instance->name()); -} - -TEST(InstanceAdminClientTest, UpdateInstancePermanentFailure) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, AsyncUpdateInstance) - .WillOnce( - [](CompletionQueue&, auto, gsai::v1::UpdateInstanceRequest const&) { - return make_ready_future(StatusOr( - Status(StatusCode::kPermissionDenied, "uh-oh"))); - }); - - auto conn = MakeLimitedRetryConnection(std::move(mock)); - auto fut = conn->UpdateInstance({gsai::v1::UpdateInstanceRequest()}); - auto instance = fut.get(); - EXPECT_THAT(instance, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminClientTest, UpdateInstanceTooManyTransients) { - auto mock = std::make_shared(); - - EXPECT_CALL(*mock, AsyncUpdateInstance) - .Times(AtLeast(2)) - .WillRepeatedly( - [](CompletionQueue&, auto, gsai::v1::UpdateInstanceRequest const&) { - return make_ready_future(StatusOr( - Status(StatusCode::kUnavailable, "try-again"))); - }); - auto conn = MakeLimitedRetryConnection(std::move(mock)); - auto fut = conn->UpdateInstance({gsai::v1::UpdateInstanceRequest()}); - auto instance = fut.get(); - EXPECT_THAT(instance, StatusIs(StatusCode::kUnavailable)); -} - -TEST(InstanceAdminConnectionTest, DeleteInstanceSuccess) { - std::string const expected_name = - "projects/test-project/instances/test-instance"; - - auto mock = std::make_shared(); - EXPECT_CALL(*mock, DeleteInstance) - .WillOnce( - [&expected_name](grpc::ClientContext&, - gsai::v1::DeleteInstanceRequest const& request) { - EXPECT_EQ(expected_name, request.name()); - return Status(StatusCode::kUnavailable, "try-again"); - }) - .WillOnce( - [&expected_name](grpc::ClientContext&, - gsai::v1::DeleteInstanceRequest const& request) { - EXPECT_EQ(expected_name, request.name()); - return Status(); - }); - - auto conn = MakeLimitedRetryConnection(mock); - auto status = conn->DeleteInstance({expected_name}); - EXPECT_STATUS_OK(status); -} - -TEST(InstanceAdminConnectionTest, DeleteInstancePermanentFailure) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, DeleteInstance) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto status = conn->DeleteInstance({"test-name"}); - EXPECT_THAT(status, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminConnectionTest, DeleteInstanceTooManyTransients) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, DeleteInstance) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto status = conn->DeleteInstance({"test-name"}); - EXPECT_THAT(status, StatusIs(StatusCode::kUnavailable)); -} - -TEST(InstanceAdminConnectionTest, GetInstanceConfigSuccess) { - std::string const expected_name = - "projects/test-project/instanceConfigs/test-instance-config"; - auto constexpr kConfigText = R"pb( - name: "projects/test-project/instanceConfigs/test-instance-config" - display_name: "test display name" - replicas { - location: "location" - type: READ_WRITE - default_leader_location: true - } - leader_options: "location" - )pb"; - gsai::v1::InstanceConfig expected_instance_config; - ASSERT_TRUE( - TextFormat::ParseFromString(kConfigText, &expected_instance_config)); - - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetInstanceConfig) - .WillOnce( - [&expected_name](grpc::ClientContext&, - gsai::v1::GetInstanceConfigRequest const& request) { - EXPECT_EQ(expected_name, request.name()); - return Status(StatusCode::kUnavailable, "try-again"); - }) - .WillOnce([&expected_name, &expected_instance_config]( - grpc::ClientContext&, - gsai::v1::GetInstanceConfigRequest const& request) { - EXPECT_EQ(expected_name, request.name()); - return expected_instance_config; - }); - - auto conn = MakeLimitedRetryConnection(mock); - auto actual = conn->GetInstanceConfig({expected_name}); - EXPECT_THAT(*actual, IsProtoEqual(expected_instance_config)); -} - -TEST(InstanceAdminConnectionTest, GetInstanceConfigPermanentFailure) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetInstanceConfig) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto actual = - conn->GetInstanceConfig({"projects/test/instanceConfig/test-name"}); - EXPECT_THAT(actual, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminConnectionTest, GetInstanceConfigTooManyTransients) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetInstanceConfig) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto actual = - conn->GetInstanceConfig({"projects/test/instanceConfig/test-name"}); - EXPECT_THAT(actual, StatusIs(StatusCode::kUnavailable)); -} - -TEST(InstanceAdminConnectionTest, ListInstanceConfigsSuccess) { - constexpr char const* kInstanceConfigText[3] = { - R"pb( - name: "projects/test-project/instanceConfigs/test-instance-config-1" - display_name: "test display name 1" - replicas { - location: "location1" - type: READ_WRITE - default_leader_location: true - } - leader_options: "location1" - )pb", - R"pb( - name: "projects/test-project/instanceConfigs/test-instance-config-2" - display_name: "test display name 2" - replicas { - location: "location2" - type: READ_WRITE - default_leader_location: true - } - leader_options: "location2" - )pb", - R"pb( - name: "projects/test-project/instanceConfigs/test-instance-config-3" - display_name: "test display name 3" - replicas { - location: "location3" - type: READ_WRITE - default_leader_location: true - } - leader_options: "location3" - )pb", - }; - gsai::v1::InstanceConfig expected_instance_configs[3]; - ASSERT_TRUE(TextFormat::ParseFromString(kInstanceConfigText[0], - &expected_instance_configs[0])); - ASSERT_TRUE(TextFormat::ParseFromString(kInstanceConfigText[1], - &expected_instance_configs[1])); - ASSERT_TRUE(TextFormat::ParseFromString(kInstanceConfigText[2], - &expected_instance_configs[2])); - - std::string const expected_parent = "projects/test-project"; - auto mock = std::make_shared(); - EXPECT_CALL(*mock, ListInstanceConfigs) - .WillOnce([&](grpc::ClientContext&, - gsai::v1::ListInstanceConfigsRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_TRUE(request.page_token().empty()); - return Status(StatusCode::kUnavailable, "try-again"); - }) - .WillOnce([&](grpc::ClientContext&, - gsai::v1::ListInstanceConfigsRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_TRUE(request.page_token().empty()); - - gsai::v1::ListInstanceConfigsResponse response; - response.set_next_page_token("p1"); - *response.add_instance_configs() = expected_instance_configs[0]; - *response.add_instance_configs() = expected_instance_configs[1]; - return response; - }) - .WillOnce([&](grpc::ClientContext&, - gsai::v1::ListInstanceConfigsRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_EQ("p1", request.page_token()); - - gsai::v1::ListInstanceConfigsResponse response; - response.clear_next_page_token(); - *response.add_instance_configs() = expected_instance_configs[2]; - return response; - }); - - auto conn = MakeLimitedRetryConnection(mock); - std::vector actual_instance_configs; - for (auto const& instance_config : - conn->ListInstanceConfigs({"test-project"})) { - ASSERT_STATUS_OK(instance_config); - actual_instance_configs.push_back(*instance_config); - } - EXPECT_THAT(actual_instance_configs, - ElementsAre(IsProtoEqual(expected_instance_configs[0]), - IsProtoEqual(expected_instance_configs[1]), - IsProtoEqual(expected_instance_configs[2]))); -} - -TEST(InstanceAdminConnectionTest, ListInstanceConfigsPermanentFailure) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, ListInstanceConfigs) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto range = conn->ListInstanceConfigs({"test-project"}); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminConnectionTest, ListInstanceConfigsTooManyTransients) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, ListInstanceConfigs) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto range = conn->ListInstanceConfigs({"test-project"}); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kUnavailable)); -} - -TEST(InstanceAdminConnectionTest, ListInstancesSuccess) { - std::string const expected_parent = "projects/test-project"; - - auto mock = std::make_shared(); - EXPECT_CALL(*mock, ListInstances) - .WillOnce([&](grpc::ClientContext&, - gsai::v1::ListInstancesRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_EQ("labels.test-key:test-value", request.filter()); - EXPECT_TRUE(request.page_token().empty()); - return Status(StatusCode::kUnavailable, "try-again"); - }) - .WillOnce([&](grpc::ClientContext&, - gsai::v1::ListInstancesRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_EQ("labels.test-key:test-value", request.filter()); - EXPECT_TRUE(request.page_token().empty()); - - gsai::v1::ListInstancesResponse response; - response.set_next_page_token("p1"); - response.add_instances()->set_name("i1"); - response.add_instances()->set_name("i2"); - return response; - }) - .WillOnce([&](grpc::ClientContext&, - gsai::v1::ListInstancesRequest const& request) { - EXPECT_EQ(expected_parent, request.parent()); - EXPECT_EQ("labels.test-key:test-value", request.filter()); - EXPECT_EQ("p1", request.page_token()); - - gsai::v1::ListInstancesResponse response; - response.clear_next_page_token(); - response.add_instances()->set_name("i3"); - return response; - }); - - auto conn = MakeLimitedRetryConnection(mock); - std::vector actual_names; - for (auto const& instance : - conn->ListInstances({"test-project", "labels.test-key:test-value"})) { - ASSERT_STATUS_OK(instance); - actual_names.push_back(instance->name()); - } - EXPECT_THAT(actual_names, ElementsAre("i1", "i2", "i3")); -} - -TEST(InstanceAdminConnectionTest, ListInstancesPermanentFailure) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, ListInstances) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto range = conn->ListInstances({"test-project", ""}); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminConnectionTest, ListInstancesTooManyTransients) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, ListInstances) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto range = conn->ListInstances({"test-project", ""}); - auto begin = range.begin(); - ASSERT_NE(begin, range.end()); - EXPECT_THAT(*begin, StatusIs(StatusCode::kUnavailable)); -} - -TEST(InstanceAdminConnectionTest, GetIamPolicySuccess) { - std::string const expected_name = - "projects/test-project/instances/test-instance"; - - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetIamPolicy) - .WillOnce([&expected_name]( - grpc::ClientContext&, - google::iam::v1::GetIamPolicyRequest const& request) { - EXPECT_EQ(expected_name, request.resource()); - return Status(StatusCode::kUnavailable, "try-again"); - }) - .WillOnce([&expected_name]( - grpc::ClientContext&, - google::iam::v1::GetIamPolicyRequest const& request) { - EXPECT_EQ(expected_name, request.resource()); - google::iam::v1::Policy response; - auto& binding = *response.add_bindings(); - binding.set_role("roles/spanner.databaseReader"); - binding.add_members("user:test-account@example.com"); - return response; - }); - - auto conn = MakeLimitedRetryConnection(mock); - auto actual = conn->GetIamPolicy({expected_name}); - ASSERT_STATUS_OK(actual); - ASSERT_EQ(1, actual->bindings_size()); - EXPECT_EQ("roles/spanner.databaseReader", actual->bindings(0).role()); - ASSERT_EQ(1, actual->bindings(0).members_size()); - ASSERT_EQ("user:test-account@example.com", actual->bindings(0).members(0)); -} - -TEST(InstanceAdminConnectionTest, GetIamPolicyPermanentFailure) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetIamPolicy) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto actual = conn->GetIamPolicy({"test-instance-name"}); - EXPECT_THAT(actual, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminConnectionTest, GetIamPolicyTooManyTransients) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GetIamPolicy) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto actual = conn->GetIamPolicy({"test-instance-name"}); - EXPECT_THAT(actual, StatusIs(StatusCode::kUnavailable)); -} - -TEST(InstanceAdminConnectionTest, SetIamPolicySuccess) { - std::string const expected_name = - "projects/test-project/instances/test-instance"; - - auto constexpr kPolicyText = R"pb( - etag: "request-etag" - bindings { - role: "roles/spanner.databaseReader" - members: "user:test-user-1@example.com" - members: "user:test-user-2@example.com" - } - )pb"; - google::iam::v1::Policy expected_policy; - ASSERT_TRUE(TextFormat::ParseFromString(kPolicyText, &expected_policy)); - - auto mock = std::make_shared(); - EXPECT_CALL(*mock, SetIamPolicy) - .WillOnce([&expected_name]( - grpc::ClientContext&, - google::iam::v1::SetIamPolicyRequest const& request) { - EXPECT_EQ(expected_name, request.resource()); - return Status(StatusCode::kUnavailable, "try-again"); - }) - .WillOnce([&expected_name, &expected_policy]( - grpc::ClientContext&, - google::iam::v1::SetIamPolicyRequest const& request) { - EXPECT_EQ(expected_name, request.resource()); - EXPECT_THAT(request.policy(), IsProtoEqual(expected_policy)); - google::iam::v1::Policy response = expected_policy; - response.set_etag("response-etag"); - return response; - }); - - auto conn = MakeLimitedRetryConnection(mock); - auto actual = conn->SetIamPolicy({expected_name, expected_policy}); - ASSERT_STATUS_OK(actual); - expected_policy.set_etag("response-etag"); - EXPECT_THAT(*actual, IsProtoEqual(expected_policy)); -} - -TEST(InstanceAdminConnectionTest, SetIamPolicyPermanentFailure) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, SetIamPolicy) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto actual = conn->SetIamPolicy({"test-instance-name", {}}); - EXPECT_THAT(actual, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminConnectionTest, SetIamPolicyNonIdempotent) { - auto mock = std::make_shared(); - // If the Etag field is not set, then the RPC is not idempotent and should - // fail on the first transient error. - EXPECT_CALL(*mock, SetIamPolicy) - .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = MakeLimitedRetryConnection(mock); - google::iam::v1::Policy policy; - auto actual = conn->SetIamPolicy({"test-instance-name", policy}); - EXPECT_THAT(actual, StatusIs(StatusCode::kUnavailable)); -} - -TEST(InstanceAdminConnectionTest, SetIamPolicyIdempotent) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, SetIamPolicy) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = MakeLimitedRetryConnection(mock); - google::iam::v1::Policy policy; - policy.set_etag("test-etag-value"); - auto actual = conn->SetIamPolicy({"test-instance-name", policy}); - EXPECT_THAT(actual, StatusIs(StatusCode::kUnavailable)); -} - -TEST(InstanceAdminConnectionTest, TestIamPermissionsSuccess) { - std::string const expected_name = - "projects/test-project/instances/test-instance"; - - auto mock = std::make_shared(); - EXPECT_CALL(*mock, TestIamPermissions) - .WillOnce([&expected_name]( - grpc::ClientContext&, - google::iam::v1::TestIamPermissionsRequest const& request) { - EXPECT_EQ(expected_name, request.resource()); - return Status(StatusCode::kUnavailable, "try-again"); - }) - .WillOnce([&expected_name]( - grpc::ClientContext&, - google::iam::v1::TestIamPermissionsRequest const& request) { - EXPECT_EQ(expected_name, request.resource()); - google::iam::v1::TestIamPermissionsResponse response; - response.add_permissions("test.permission2"); - return response; - }); - - auto conn = MakeLimitedRetryConnection(mock); - auto actual = conn->TestIamPermissions( - {expected_name, {"test.permission1", "test.permission2"}}); - ASSERT_STATUS_OK(actual); - ASSERT_EQ(1, actual->permissions_size()); - ASSERT_EQ("test.permission2", actual->permissions(0)); -} - -TEST(InstanceAdminConnectionTest, TestIamPermissionsPermanentFailure) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, TestIamPermissions) - .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto actual = - conn->TestIamPermissions({"test-instance-name", {"test.permission"}}); - EXPECT_THAT(actual, StatusIs(StatusCode::kPermissionDenied)); -} - -TEST(InstanceAdminConnectionTest, TestIamPermissionsTooManyTransients) { - auto mock = std::make_shared(); - EXPECT_CALL(*mock, TestIamPermissions) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again"))); - - auto conn = MakeLimitedRetryConnection(mock); - auto actual = - conn->TestIamPermissions({"test-instance-name", {"test.permission"}}); - EXPECT_THAT(actual, StatusIs(StatusCode::kUnavailable)); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner -} // namespace cloud -} // namespace google diff --git a/google/cloud/spanner/integration_tests/BUILD.bazel b/google/cloud/spanner/integration_tests/BUILD.bazel index 08b790694d194..e557dbe258475 100644 --- a/google/cloud/spanner/integration_tests/BUILD.bazel +++ b/google/cloud/spanner/integration_tests/BUILD.bazel @@ -33,9 +33,8 @@ licenses(["notice"]) # Apache 2.0 "//google/cloud/spanner:spanner_client_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "//protos:system_includes", "//protos/google/cloud/spanner/testing:singer_cc_proto", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in spanner_client_integration_tests] @@ -60,8 +59,7 @@ VARIATIONS = { "//google/cloud/spanner:spanner_client_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "//protos:system_includes", "//protos/google/cloud/spanner/testing:singer_cc_proto", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in spanner_client_session_mode_sensitive_integration_tests for v_label, v_env in VARIATIONS.items()] diff --git a/google/cloud/spanner/integration_tests/CMakeLists.txt b/google/cloud/spanner/integration_tests/CMakeLists.txt index 04705b73893af..720c157905f02 100644 --- a/google/cloud/spanner/integration_tests/CMakeLists.txt +++ b/google/cloud/spanner/integration_tests/CMakeLists.txt @@ -23,12 +23,7 @@ function (spanner_client_define_integration_tests) set(spanner_client_integration_tests # cmake-format: sort - backup_extra_integration_test.cc - backup_integration_test.cc - client_stress_test.cc - data_types_integration_test.cc - database_admin_integration_test.cc - instance_admin_integration_test.cc + client_stress_test.cc data_types_integration_test.cc session_pool_integration_test.cc) set(spanner_client_session_mode_sensitive_integration_tests diff --git a/google/cloud/spanner/integration_tests/backup_extra_integration_test.cc b/google/cloud/spanner/integration_tests/backup_extra_integration_test.cc deleted file mode 100644 index 260b507641dee..0000000000000 --- a/google/cloud/spanner/integration_tests/backup_extra_integration_test.cc +++ /dev/null @@ -1,445 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO(#7356): Remove this file after the deprecation period expires -#include "google/cloud/internal/disable_deprecation_warnings.inc" -#include "google/cloud/spanner/client.h" -#include "google/cloud/spanner/database_admin_client.h" -#include "google/cloud/spanner/instance_admin_client.h" -#include "google/cloud/spanner/testing/instance_location.h" -#include "google/cloud/spanner/testing/pick_random_instance.h" -#include "google/cloud/spanner/testing/random_database_name.h" -#include "google/cloud/spanner/timestamp.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/getenv.h" -#include "google/cloud/internal/random.h" -#include "google/cloud/testing_util/integration_test.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "absl/strings/match.h" -#include "absl/time/time.h" -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -using ::google::cloud::testing_util::IsOk; -using ::google::cloud::testing_util::StatusIs; -using ::testing::HasSubstr; -using ::testing::IsEmpty; -using ::testing::Not; - -// Constants used to identify the encryption key. -auto constexpr kKeyRing = "spanner-cmek"; -auto constexpr kKeyName = "spanner-cmek-test-key"; - -std::string const& ProjectId() { - static std::string project_id = - google::cloud::internal::GetEnv("GOOGLE_CLOUD_PROJECT").value_or(""); - return project_id; -} - -bool RunSlowBackupTests() { - static bool run_slow_backup_tests = - absl::StrContains(google::cloud::internal::GetEnv( - "GOOGLE_CLOUD_CPP_SPANNER_SLOW_INTEGRATION_TESTS") - .value_or(""), - "backup"); - return run_slow_backup_tests; -} - -bool Emulator() { - static bool emulator = - google::cloud::internal::GetEnv("SPANNER_EMULATOR_HOST").has_value(); - return emulator; -} - -class BackupExtraIntegrationTest - : public ::google::cloud::testing_util::IntegrationTest { - public: - BackupExtraIntegrationTest() - : generator_(google::cloud::internal::MakeDefaultPRNG()), - database_admin_client_(MakeDatabaseAdminConnection( - ConnectionOptions{}, - LimitedTimeRetryPolicy(std::chrono::minutes(60)).clone(), - ExponentialBackoffPolicy(std::chrono::seconds(1), - std::chrono::minutes(1), 2.0) - .clone(), - GenericPollingPolicy<>( - LimitedTimeRetryPolicy(std::chrono::minutes(90)), - ExponentialBackoffPolicy(std::chrono::seconds(1), - std::chrono::minutes(1), 2.0)) - .clone())) {} - - protected: - google::cloud::internal::DefaultPRNG generator_; - DatabaseAdminClient database_admin_client_; -}; - -/// @test Verify creating/restoring a backup with a valid version_time. -TEST_F(BackupExtraIntegrationTest, BackupRestoreWithVersionTime) { - if (!RunSlowBackupTests()) GTEST_SKIP(); - - auto instance_id = spanner_testing::PickRandomInstance( - generator_, ProjectId(), - "(labels.restore-database-partition:legacy-extra OR" - " labels.restore-database-partition:all)"); - ASSERT_THAT(instance_id, IsOk()); - Instance in(ProjectId(), *instance_id); - Database db(in, spanner_testing::RandomDatabaseName(generator_)); - - std::vector extra_statements = { - absl::StrCat("ALTER DATABASE `", db.database_id(), - "` SET OPTIONS (version_retention_period='1h')"), - "CREATE TABLE Counters (" - " Name STRING(64) NOT NULL," - " Value INT64 NOT NULL" - ") PRIMARY KEY (Name)"}; - auto database = - database_admin_client_.CreateDatabase(db, extra_statements).get(); - if (Emulator()) { // version_retention_period - EXPECT_THAT(database, Not(IsOk())); - return; - } - ASSERT_THAT(database, IsOk()); - auto create_time = - MakeTimestamp(database->create_time()).value().get().value(); - - std::string const version_key = "version"; - std::vector version_times; - { - spanner::Client client(spanner::MakeConnection(db)); - auto commit = client.Commit(spanner::Mutations{ - spanner::InsertMutationBuilder("Counters", {"Name", "Value"}) - .EmplaceRow(version_key, 0) // the version we'll backup/restore - .Build()}); - EXPECT_STATUS_OK(commit); - if (commit) { - // version_times[0]: when Counters[version_key] == 0 - version_times.push_back(commit->commit_timestamp); - commit = client.Commit(spanner::Mutations{ - spanner::UpdateMutationBuilder("Counters", {"Name", "Value"}) - .EmplaceRow(version_key, 1) // latest version - .Build()}); - EXPECT_STATUS_OK(commit); - if (commit) { - // version_times[1]: when Counters[version_key] == 1 - version_times.push_back(commit->commit_timestamp); - } - } - } - - if (version_times.size() == 2) { - EXPECT_LT(MakeTimestamp(create_time).value(), version_times[0]); - EXPECT_LT(version_times[0], version_times[1]); - // Create a backup when Counters[version_key] == 0. - auto version_time = version_times[0]; - auto expire_time = MakeTimestamp(create_time + absl::Hours(12)).value(); - auto backup = - database_admin_client_ - .CreateBackup(db, db.database_id(), expire_time, version_time) - .get(); - EXPECT_THAT(backup, IsOk()); - if (backup) { - EXPECT_EQ(MakeTimestamp(backup->expire_time()).value(), expire_time); - EXPECT_EQ(MakeTimestamp(backup->version_time()).value(), version_time); - EXPECT_GT(MakeTimestamp(backup->create_time()).value(), version_time); - - Database rdb(in, spanner_testing::RandomDatabaseName(generator_)); - auto restored = - database_admin_client_.RestoreDatabase(rdb, *backup).get(); - EXPECT_THAT(restored, IsOk()); - if (restored) { - auto const& restore_info = restored->restore_info(); - EXPECT_EQ(restore_info.source_type(), - google::spanner::admin::database::v1::BACKUP); - if (restore_info.source_type() == - google::spanner::admin::database::v1::BACKUP) { - auto const& backup_info = restore_info.backup_info(); - EXPECT_EQ(backup_info.backup(), backup->name()); - EXPECT_EQ(MakeTimestamp(backup_info.version_time()).value(), - version_time); - EXPECT_LT(MakeTimestamp(backup_info.version_time()).value(), - MakeTimestamp(backup_info.create_time()).value()); - EXPECT_EQ(backup_info.source_database(), db.FullName()); - } - auto database = database_admin_client_.GetDatabase(rdb); - EXPECT_THAT(database, IsOk()); - if (database) { - auto const& restore_info = database->restore_info(); - EXPECT_EQ(restore_info.source_type(), - google::spanner::admin::database::v1::BACKUP); - if (restore_info.source_type() == - google::spanner::admin::database::v1::BACKUP) { - auto const& backup_info = restore_info.backup_info(); - EXPECT_EQ(MakeTimestamp(backup_info.version_time()).value(), - version_time); - } - } - bool found_restored = false; - for (auto const& database : database_admin_client_.ListDatabases(in)) { - EXPECT_THAT(database, IsOk()); - if (!database) continue; - if (database->name() == rdb.FullName()) { - EXPECT_FALSE(found_restored); - found_restored = true; - auto const& restore_info = database->restore_info(); - EXPECT_EQ(restore_info.source_type(), - google::spanner::admin::database::v1::BACKUP); - if (restore_info.source_type() == - google::spanner::admin::database::v1::BACKUP) { - auto const& backup_info = restore_info.backup_info(); - EXPECT_EQ(MakeTimestamp(backup_info.version_time()).value(), - version_time); - } - } - } - EXPECT_TRUE(found_restored); - { - spanner::Client client(spanner::MakeConnection(rdb)); - auto keys = spanner::KeySet().AddKey(spanner::MakeKey(version_key)); - auto rows = client.Read("Counters", std::move(keys), {"Value"}); - using RowType = std::tuple; - auto row = spanner::GetSingularRow(spanner::StreamOf(rows)); - EXPECT_THAT(row, IsOk()); - if (row) { - // Expect to see the state of the table at version_time. - EXPECT_EQ(std::get<0>(*std::move(row)), 0); - } - } - EXPECT_STATUS_OK(database_admin_client_.DropDatabase(rdb)); - } - - EXPECT_STATUS_OK(database_admin_client_.DeleteBackup(*backup)); - } - } - - EXPECT_STATUS_OK(database_admin_client_.DropDatabase(db)); -} - -/// @test Verify creating a backup with an expired version_time fails. -TEST_F(BackupExtraIntegrationTest, BackupWithExpiredVersionTime) { - auto instance_id = spanner_testing::PickRandomInstance( - generator_, ProjectId(), "NOT labels.edition:enterprise"); - ASSERT_THAT(instance_id, IsOk()); - Instance in(ProjectId(), *instance_id); - Database db(in, spanner_testing::RandomDatabaseName(generator_)); - - std::vector extra_statements = { - absl::StrCat("ALTER DATABASE `", db.database_id(), - "` SET OPTIONS (version_retention_period='1h')")}; - auto database = - database_admin_client_.CreateDatabase(db, extra_statements).get(); - if (Emulator()) { // version_retention_period - EXPECT_THAT(database, Not(IsOk())); - return; - } - ASSERT_THAT(database, IsOk()); - - auto create_time = - MakeTimestamp(database->create_time()).value().get().value(); - // version_time too far in the past (outside the version_retention_period). - auto version_time = MakeTimestamp(create_time - absl::Hours(2)).value(); - auto expire_time = MakeTimestamp(create_time + absl::Hours(12)).value(); - auto backup = - database_admin_client_ - .CreateBackup(db, db.database_id(), expire_time, version_time) - .get(); - EXPECT_THAT(backup, StatusIs(StatusCode::kInvalidArgument, - HasSubstr("earlier than the creation time"))); - if (backup) { - EXPECT_STATUS_OK(database_admin_client_.DeleteBackup(*backup)); - } - - EXPECT_STATUS_OK(database_admin_client_.DropDatabase(db)); -} - -/// @test Verify creating a backup with a future version_time fails. -TEST_F(BackupExtraIntegrationTest, BackupWithFutureVersionTime) { - auto instance_id = spanner_testing::PickRandomInstance( - generator_, ProjectId(), "NOT labels.edition:enterprise"); - ASSERT_THAT(instance_id, IsOk()); - Instance in(ProjectId(), *instance_id); - Database db(in, spanner_testing::RandomDatabaseName(generator_)); - - std::vector extra_statements = { - absl::StrCat("ALTER DATABASE `", db.database_id(), - "` SET OPTIONS (version_retention_period='1h')")}; - auto database = - database_admin_client_.CreateDatabase(db, extra_statements).get(); - if (Emulator()) { // version_retention_period - EXPECT_THAT(database, Not(IsOk())); - return; - } - ASSERT_THAT(database, IsOk()); - - auto create_time = - MakeTimestamp(database->create_time()).value().get().value(); - // version_time in the future. - auto version_time = MakeTimestamp(create_time + absl::Hours(2)).value(); - auto expire_time = MakeTimestamp(create_time + absl::Hours(12)).value(); - auto backup = - database_admin_client_ - .CreateBackup(db, db.database_id(), expire_time, version_time) - .get(); - EXPECT_THAT(backup, StatusIs(StatusCode::kInvalidArgument, - HasSubstr("with a future version time"))); - if (backup) { - EXPECT_STATUS_OK(database_admin_client_.DeleteBackup(*backup)); - } - - EXPECT_STATUS_OK(database_admin_client_.DropDatabase(db)); -} - -/// @test Tests backup/restore with Customer Managed Encryption Key -TEST_F(BackupExtraIntegrationTest, BackupRestoreWithCMEK) { - if (!RunSlowBackupTests() || Emulator()) GTEST_SKIP(); - - auto instance_id = spanner_testing::PickRandomInstance( - generator_, ProjectId(), - "(labels.restore-database-partition:legacy-extra OR" - " labels.restore-database-partition:all)" - " AND NOT name:/instances/test-instance-mr-"); - ASSERT_STATUS_OK(instance_id); - Instance in(ProjectId(), *instance_id); - - auto location = spanner_testing::InstanceLocation(in); - ASSERT_STATUS_OK(location); - KmsKeyName encryption_key(in.project_id(), *location, kKeyRing, kKeyName); - auto encryption_config = CustomerManagedEncryption(encryption_key); - - Database db(in, spanner_testing::RandomDatabaseName(generator_)); - auto database = - database_admin_client_ - .CreateDatabase(db, /*extra_statements=*/{}, encryption_config) - .get(); - ASSERT_STATUS_OK(database); - EXPECT_TRUE(database->has_encryption_config()); - if (database->has_encryption_config()) { - EXPECT_EQ(database->encryption_config().kms_key_name(), - encryption_key.FullName()); - } - EXPECT_THAT(database->encryption_info(), IsEmpty()); - - auto database_get = database_admin_client_.GetDatabase(db); - ASSERT_STATUS_OK(database_get); - EXPECT_EQ(database_get->name(), database->name()); - EXPECT_TRUE(database_get->has_encryption_config()); - if (database_get->has_encryption_config()) { - EXPECT_EQ(database_get->encryption_config().kms_key_name(), - encryption_key.FullName()); - } - - auto create_time = - MakeTimestamp(database->create_time()).value().get().value(); - auto expire_time = MakeTimestamp(create_time + absl::Hours(12)).value(); - auto backup = database_admin_client_ - .CreateBackup(db, db.database_id(), expire_time, - absl::nullopt, encryption_config) - .get(); - { - // TODO(#8616): Remove this when we know how to deal with the issue. - auto matcher = testing_util::StatusIs( - StatusCode::kDeadlineExceeded, - testing::HasSubstr("terminated by polling policy")); - testing::StringMatchResultListener listener; - if (matcher.impl().MatchAndExplain(backup, &listener)) { - // The backup is still in progress (and may eventually complete), - // and we can't drop the database while it has pending backups, so - // we simply abandon them, to be cleaned up offline. - GTEST_SKIP(); - } - } - ASSERT_STATUS_OK(backup); - EXPECT_TRUE(backup->has_encryption_info()); - if (backup->has_encryption_info()) { - EXPECT_EQ(backup->encryption_info().encryption_type(), - google::spanner::admin::database::v1::EncryptionInfo:: - CUSTOMER_MANAGED_ENCRYPTION); - EXPECT_THAT(backup->encryption_info().kms_key_version(), - HasSubstr(encryption_key.FullName() + "/cryptoKeyVersions/")); - } - - EXPECT_STATUS_OK(database_admin_client_.DropDatabase(db)); - - Backup backup_name(in, db.database_id()); - auto backup_get = database_admin_client_.GetBackup(backup_name); - ASSERT_STATUS_OK(backup_get); - EXPECT_EQ(backup_get->name(), backup->name()); - EXPECT_TRUE(backup_get->has_encryption_info()); - if (backup_get->has_encryption_info()) { - EXPECT_EQ(backup_get->encryption_info().encryption_type(), - google::spanner::admin::database::v1::EncryptionInfo:: - CUSTOMER_MANAGED_ENCRYPTION); - EXPECT_THAT(backup_get->encryption_info().kms_key_version(), - HasSubstr(encryption_key.FullName() + "/cryptoKeyVersions/")); - } - - Database restore_db(in, spanner_testing::RandomDatabaseName(generator_)); - auto restored_database = - database_admin_client_ - .RestoreDatabase(restore_db, backup_name, encryption_config) - .get(); - ASSERT_STATUS_OK(restored_database); - EXPECT_TRUE(restored_database->has_encryption_config()); - if (restored_database->has_encryption_config()) { - EXPECT_EQ(restored_database->encryption_config().kms_key_name(), - encryption_key.FullName()); - } - - auto restored_get = database_admin_client_.GetDatabase(restore_db); - ASSERT_STATUS_OK(restored_get); - EXPECT_EQ(restored_get->name(), restored_database->name()); - EXPECT_TRUE(restored_get->has_encryption_config()); - if (restored_get->has_encryption_config()) { - EXPECT_EQ(restored_get->encryption_config().kms_key_name(), - encryption_key.FullName()); - } - - EXPECT_STATUS_OK(database_admin_client_.DropDatabase(restore_db)); - - std::ostringstream backup_filter; - backup_filter << "expire_time <= \"" << expire_time << "\""; - bool found = false; - for (auto const& b : - database_admin_client_.ListBackups(in, backup_filter.str())) { - if (b->name() == backup->name()) { - found = true; - EXPECT_TRUE(b->has_encryption_info()); - if (b->has_encryption_info()) { - EXPECT_EQ(b->encryption_info().encryption_type(), - google::spanner::admin::database::v1::EncryptionInfo:: - CUSTOMER_MANAGED_ENCRYPTION); - EXPECT_THAT( - b->encryption_info().kms_key_version(), - HasSubstr(encryption_key.FullName() + "/cryptoKeyVersions/")); - } - } - } - EXPECT_TRUE(found); - - EXPECT_STATUS_OK(database_admin_client_.DeleteBackup(*backup)); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner -} // namespace cloud -} // namespace google diff --git a/google/cloud/spanner/integration_tests/backup_integration_test.cc b/google/cloud/spanner/integration_tests/backup_integration_test.cc deleted file mode 100644 index 36c147417a22b..0000000000000 --- a/google/cloud/spanner/integration_tests/backup_integration_test.cc +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO(#7356): Remove this file after the deprecation period expires -#include "google/cloud/internal/disable_deprecation_warnings.inc" -#include "google/cloud/spanner/client.h" -#include "google/cloud/spanner/database_admin_client.h" -#include "google/cloud/spanner/instance_admin_client.h" -#include "google/cloud/spanner/testing/instance_location.h" -#include "google/cloud/spanner/testing/pick_random_instance.h" -#include "google/cloud/spanner/testing/random_database_name.h" -#include "google/cloud/spanner/timestamp.h" -#include "google/cloud/internal/getenv.h" -#include "google/cloud/internal/random.h" -#include "google/cloud/testing_util/integration_test.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "absl/strings/match.h" -#include "absl/time/time.h" -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -std::string const& ProjectId() { - static std::string project_id = - google::cloud::internal::GetEnv("GOOGLE_CLOUD_PROJECT").value_or(""); - return project_id; -} - -bool RunSlowBackupTests() { - static bool run_slow_backup_tests = - absl::StrContains(google::cloud::internal::GetEnv( - "GOOGLE_CLOUD_CPP_SPANNER_SLOW_INTEGRATION_TESTS") - .value_or(""), - "backup"); - return run_slow_backup_tests; -} - -bool Emulator() { - static bool emulator = - google::cloud::internal::GetEnv("SPANNER_EMULATOR_HOST").has_value(); - return emulator; -} - -class BackupIntegrationTest - : public ::google::cloud::testing_util::IntegrationTest { - public: - BackupIntegrationTest() - : generator_(google::cloud::internal::MakeDefaultPRNG()), - database_admin_client_(MakeDatabaseAdminConnection( - ConnectionOptions{}, - LimitedTimeRetryPolicy(std::chrono::minutes(60)).clone(), - ExponentialBackoffPolicy(std::chrono::seconds(1), - std::chrono::minutes(1), 2.0) - .clone(), - GenericPollingPolicy<>( - LimitedTimeRetryPolicy(std::chrono::minutes(90)), - ExponentialBackoffPolicy(std::chrono::seconds(1), - std::chrono::minutes(1), 2.0)) - .clone())) {} - - protected: - google::cloud::internal::DefaultPRNG generator_; - DatabaseAdminClient database_admin_client_; -}; - -/// @test Backup related integration tests. -TEST_F(BackupIntegrationTest, BackupRestore) { - if (!RunSlowBackupTests() || Emulator()) GTEST_SKIP(); - - auto instance_id = spanner_testing::PickRandomInstance( - generator_, ProjectId(), - "(labels.restore-database-partition:legacy-core OR" - " labels.restore-database-partition:all)"); - ASSERT_STATUS_OK(instance_id); - Instance in(ProjectId(), *instance_id); - Database db(in, spanner_testing::RandomDatabaseName(generator_)); - - auto database = database_admin_client_.CreateDatabase(db).get(); - ASSERT_STATUS_OK(database); - auto create_time = - MakeTimestamp(database->create_time()).value().get().value(); - - auto expire_time = MakeTimestamp(create_time + absl::Hours(12)).value(); - auto backup_future = - database_admin_client_.CreateBackup(db, db.database_id(), expire_time); - - // Cancel the CreateBackup operation. - backup_future.cancel(); - auto cancelled_backup = backup_future.get(); - if (cancelled_backup) { - EXPECT_STATUS_OK(database_admin_client_.DeleteBackup(*cancelled_backup)); - } - - // Then create a Backup without cancelling - backup_future = - database_admin_client_.CreateBackup(db, db.database_id(), expire_time); - - // List the backup operations - std::ostringstream backup_op_filter; - backup_op_filter << "(metadata.@type=type.googleapis.com/" - << "google.spanner.admin.database.v1.CreateBackupMetadata)" - << " AND (metadata.database=" << db.FullName() << ")"; - std::vector db_names; - for (auto const& operation : database_admin_client_.ListBackupOperations( - in, backup_op_filter.str())) { - if (!operation) break; - google::spanner::admin::database::v1::CreateBackupMetadata metadata; - operation->metadata().UnpackTo(&metadata); - db_names.push_back(metadata.database()); - } - EXPECT_LE(1, std::count(db_names.begin(), db_names.end(), database->name())) - << "Database " << database->name() - << " not found in the backup operation list."; - - auto backup = backup_future.get(); - { - // TODO(#8616): Remove this when we know how to deal with the issue. - auto matcher = testing_util::StatusIs( - StatusCode::kDeadlineExceeded, - testing::HasSubstr("terminated by polling policy")); - testing::StringMatchResultListener listener; - if (matcher.impl().MatchAndExplain(backup, &listener)) { - // The backup is still in progress (and may eventually complete), - // and we can't drop the database while it has pending backups, so - // we simply abandon them, to be cleaned up offline. - GTEST_SKIP(); - } - } - ASSERT_STATUS_OK(backup); - EXPECT_EQ(MakeTimestamp(backup->expire_time()).value(), expire_time); - // Verify that the version_time is the same as the creation_time. - EXPECT_EQ(MakeTimestamp(backup->version_time()).value(), - MakeTimestamp(backup->create_time()).value()); - - EXPECT_STATUS_OK(database_admin_client_.DropDatabase(db)); - - Backup backup_name(in, db.database_id()); - auto backup_get = database_admin_client_.GetBackup(backup_name); - EXPECT_STATUS_OK(backup_get); - if (backup_get) { - EXPECT_EQ(backup_get->name(), backup->name()); - } - - Database restore_db(in, spanner_testing::RandomDatabaseName(generator_)); - auto restored_database = - database_admin_client_.RestoreDatabase(restore_db, backup_name).get(); - EXPECT_STATUS_OK(restored_database); - if (restored_database) { - // List the database operations - std::ostringstream db_op_filter; - db_op_filter - << "(metadata.@type:type.googleapis.com/" - << "google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata)"; - std::vector restored_db_names; - for (auto const& operation : database_admin_client_.ListDatabaseOperations( - in, db_op_filter.str())) { - if (!operation) break; - google::spanner::admin::database::v1::OptimizeRestoredDatabaseMetadata md; - operation->metadata().UnpackTo(&md); - restored_db_names.push_back(md.name()); - } - EXPECT_LE(1, std::count(restored_db_names.begin(), restored_db_names.end(), - restored_database->name())) - << "Backup " << restored_database->name() - << " not found in the OptimizeRestoredDatabase operation list."; - EXPECT_STATUS_OK(database_admin_client_.DropDatabase(restore_db)); - } - - std::ostringstream backup_filter; - backup_filter << "expire_time <= \"" << expire_time << "\""; - std::vector backup_names; - for (auto const& b : - database_admin_client_.ListBackups(in, backup_filter.str())) { - backup_names.push_back(b->name()); - } - EXPECT_LE( - 1, std::count(backup_names.begin(), backup_names.end(), backup->name())) - << "Backup " << backup->name() << " not found in the backup list."; - - auto new_expire_time = MakeTimestamp(create_time + absl::Hours(16)).value(); - auto updated_backup = - database_admin_client_.UpdateBackupExpireTime(*backup, new_expire_time); - EXPECT_STATUS_OK(updated_backup); - if (updated_backup) { - EXPECT_EQ(MakeTimestamp(updated_backup->expire_time()).value(), - new_expire_time); - } - - EXPECT_STATUS_OK(database_admin_client_.DeleteBackup(*backup)); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner -} // namespace cloud -} // namespace google diff --git a/google/cloud/spanner/integration_tests/client_integration_test.cc b/google/cloud/spanner/integration_tests/client_integration_test.cc index 2c114ca56f18b..f21bbec7a636a 100644 --- a/google/cloud/spanner/integration_tests/client_integration_test.cc +++ b/google/cloud/spanner/integration_tests/client_integration_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/admin/database_admin_client.h" #include "google/cloud/spanner/client.h" #include "google/cloud/spanner/database.h" @@ -1764,15 +1764,9 @@ TEST_F(ClientIntegrationTest, MakeConnectionOverloads) { .clone()); } -/// @test Verify the backwards compatibility `v1` namespace still exists. -TEST_F(ClientIntegrationTest, BackwardsCompatibility) { - auto connection = ::google::cloud::spanner::v1::MakeConnection(GetDatabase()); - EXPECT_THAT(connection, NotNull()); - ASSERT_NO_FATAL_FAILURE(Client(std::move(connection))); -} - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/integration_tests/client_stress_test.cc b/google/cloud/spanner/integration_tests/client_stress_test.cc index 472b71ec3432d..eab83e81d0b6f 100644 --- a/google/cloud/spanner/integration_tests/client_stress_test.cc +++ b/google/cloud/spanner/integration_tests/client_stress_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/client.h" #include "google/cloud/spanner/database.h" #include "google/cloud/spanner/testing/database_integration_test.h" @@ -148,6 +148,8 @@ TEST_F(ClientStressTest, ParseArgs) { /// @test Stress test the library using ExecuteQuery calls. TEST_F(ClientStressTest, UpsertAndSelect) { + // TODO(#15939): Update emulator and enable this test. + if (UsingEmulator()) GTEST_SKIP(); int const task_count = TaskCount(); auto select_task = [](Client client) { @@ -216,6 +218,8 @@ TEST_F(ClientStressTest, UpsertAndSelect) { /// @test Stress test the library using Read calls. TEST_F(ClientStressTest, UpsertAndRead) { + // TODO(#15939): Update emulator and enable this test. + if (UsingEmulator()) GTEST_SKIP(); int const task_count = TaskCount(); auto read_task = [](Client client) { @@ -302,3 +306,4 @@ int main(int argc, char* argv[]) { return RUN_ALL_TESTS(); } +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/integration_tests/data_types_integration_test.cc b/google/cloud/spanner/integration_tests/data_types_integration_test.cc index 4df1d1e2bcb51..5847543baf621 100644 --- a/google/cloud/spanner/integration_tests/data_types_integration_test.cc +++ b/google/cloud/spanner/integration_tests/data_types_integration_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/admin/database_admin_client.h" #include "google/cloud/spanner/client.h" #include "google/cloud/spanner/database.h" @@ -20,7 +20,7 @@ #include "google/cloud/spanner/timestamp.h" #include "google/cloud/testing_util/status_matchers.h" #include "absl/time/time.h" -#include +#include "protos/google/cloud/spanner/testing/singer.pb.h" #include #include #include @@ -1021,3 +1021,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/integration_tests/database_admin_integration_test.cc b/google/cloud/spanner/integration_tests/database_admin_integration_test.cc deleted file mode 100644 index eef1afb441532..0000000000000 --- a/google/cloud/spanner/integration_tests/database_admin_integration_test.cc +++ /dev/null @@ -1,495 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO(#7356): Remove this file after the deprecation period expires -#include "google/cloud/internal/disable_deprecation_warnings.inc" -#include "google/cloud/spanner/database.h" -#include "google/cloud/spanner/database_admin_client.h" -#include "google/cloud/spanner/testing/instance_location.h" -#include "google/cloud/spanner/testing/pick_random_instance.h" -#include "google/cloud/spanner/testing/random_database_name.h" -#include "google/cloud/spanner/timestamp.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/getenv.h" -#include "google/cloud/internal/random.h" -#include "google/cloud/testing_util/integration_test.h" -#include "google/cloud/testing_util/is_proto_equal.h" -#include "google/cloud/testing_util/status_matchers.h" -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -using ::google::cloud::testing_util::IsOk; -using ::google::cloud::testing_util::IsProtoEqual; -using ::google::cloud::testing_util::StatusIs; -using ::testing::AllOf; -using ::testing::AnyOf; -using ::testing::Contains; -using ::testing::ContainsRegex; -using ::testing::EndsWith; -using ::testing::HasSubstr; -using ::testing::IsEmpty; -using ::testing::Not; -using ::testing::NotNull; - -// Constants used to identify the encryption key. -auto constexpr kKeyRing = "spanner-cmek"; -auto constexpr kKeyName = "spanner-cmek-test-key"; - -class DatabaseAdminClientTest - : public ::google::cloud::testing_util::IntegrationTest { - protected: - // We can't use ASSERT* in the constructor, so defer initializing `instance_` - // and `database_` until `SetUp()`. - DatabaseAdminClientTest() - : instance_("placeholder", "placeholder"), - database_(instance_, "placeholder") {} - - void SetUp() override { - using ::google::cloud::internal::GetEnv; - emulator_ = GetEnv("SPANNER_EMULATOR_HOST").has_value(); - auto project_id = GetEnv("GOOGLE_CLOUD_PROJECT").value_or(""); - ASSERT_FALSE(project_id.empty()); - - auto generator = google::cloud::internal::MakeDefaultPRNG(); - - auto instance_id = spanner_testing::PickRandomInstance( - generator, project_id, "NOT name:/instances/test-instance-mr-"); - ASSERT_STATUS_OK(instance_id); - instance_ = Instance(project_id, *instance_id); - - auto location = spanner_testing::InstanceLocation(instance_); - if (emulator_) { - if (!location) location = "emulator"; - } else { - ASSERT_STATUS_OK(location); - } - location_ = *std::move(location); - - database_ = - Database(instance_, spanner_testing::RandomDatabaseName(generator)); - - test_iam_service_account_ = - GetEnv("GOOGLE_CLOUD_CPP_SPANNER_TEST_SERVICE_ACCOUNT").value_or(""); - ASSERT_TRUE(emulator_ || !test_iam_service_account_.empty()); - } - - // Does `database_` exist in `instance_`? - bool DatabaseExists() { - auto full_name = database_.FullName(); - for (auto const& database : client_.ListDatabases(instance_)) { - EXPECT_STATUS_OK(database); - if (!database) break; - if (database->name() == full_name) return true; - } - return false; - }; - - Instance instance_; - std::string location_; - Database database_; - DatabaseAdminClient client_; - bool emulator_; - std::string test_iam_service_account_; -}; - -/// @test Verify the basic CRUD operations for databases work. -TEST_F(DatabaseAdminClientTest, DatabaseBasicCRUD) { - // We test Client::ListDatabases() by verifying that (a) it does not return - // a randomly generated database name before we create a database with that - // name, (b) it *does* return that database name once created, and (c) it no - // longer returns that name once the database is dropped. Implicitly that - // also tests that Client::DropDatabase() and client::CreateDatabase() do - // something, which is nice. - EXPECT_FALSE(DatabaseExists()) << "Database " << database_ - << " already exists, this is unexpected as " - "the database id is selected at random."; - - auto database = - client_.CreateDatabase(database_, /*extra_statements=*/{}).get(); - ASSERT_STATUS_OK(database); - EXPECT_THAT(database->name(), EndsWith(database_.database_id())); - EXPECT_FALSE(database->has_encryption_config()); - EXPECT_THAT(database->encryption_info(), IsEmpty()); - - auto get_result = client_.GetDatabase(database_); - ASSERT_STATUS_OK(get_result); - EXPECT_EQ(database->name(), get_result->name()); - EXPECT_FALSE(get_result->has_encryption_config()); - if (emulator_) { - EXPECT_THAT(get_result->encryption_info(), IsEmpty()); - } else { - EXPECT_EQ(get_result->encryption_info().size(), 1); - if (!get_result->encryption_info().empty()) { - EXPECT_EQ(get_result->encryption_info()[0].encryption_type(), - google::spanner::admin::database::v1::EncryptionInfo:: - GOOGLE_DEFAULT_ENCRYPTION); - } - } - - if (!emulator_) { - auto current_policy = client_.GetIamPolicy(database_); - ASSERT_STATUS_OK(current_policy); - EXPECT_EQ(0, current_policy->bindings_size()); - - std::string const reader_role = "roles/spanner.databaseReader"; - std::string const writer_role = "roles/spanner.databaseUser"; - std::string const expected_member = - "serviceAccount:" + test_iam_service_account_; - auto& binding = *current_policy->add_bindings(); - binding.set_role(reader_role); - *binding.add_members() = expected_member; - - auto updated_policy = client_.SetIamPolicy(database_, *current_policy); - ASSERT_THAT(updated_policy, AnyOf(IsOk(), StatusIs(StatusCode::kAborted))); - if (updated_policy) { - EXPECT_EQ(1, updated_policy->bindings_size()); - ASSERT_EQ(reader_role, updated_policy->bindings().Get(0).role()); - ASSERT_EQ(1, updated_policy->bindings().Get(0).members().size()); - ASSERT_EQ(expected_member, - updated_policy->bindings().Get(0).members().Get(0)); - } - - // Perform a different update using the OCC loop API: - updated_policy = client_.SetIamPolicy( - database_, [this, &writer_role](google::iam::v1::Policy current) { - std::string const expected_member = - "serviceAccount:" + test_iam_service_account_; - auto& binding = *current.add_bindings(); - binding.set_role(writer_role); - *binding.add_members() = expected_member; - return current; - }); - ASSERT_STATUS_OK(updated_policy); - EXPECT_EQ(2, updated_policy->bindings_size()); - ASSERT_EQ(writer_role, updated_policy->bindings().Get(1).role()); - ASSERT_EQ(1, updated_policy->bindings().Get(1).members().size()); - ASSERT_EQ(expected_member, - updated_policy->bindings().Get(1).members().Get(0)); - - // Fetch the Iam Policy again. - current_policy = client_.GetIamPolicy(database_); - ASSERT_STATUS_OK(current_policy); - EXPECT_THAT(*updated_policy, IsProtoEqual(*current_policy)); - - auto test_iam_permission_result = - client_.TestIamPermissions(database_, {"spanner.databases.read"}); - ASSERT_STATUS_OK(test_iam_permission_result); - ASSERT_EQ(1, test_iam_permission_result->permissions_size()); - ASSERT_EQ("spanner.databases.read", - test_iam_permission_result->permissions(0)); - } - - auto get_ddl_result = client_.GetDatabaseDdl(database_); - ASSERT_STATUS_OK(get_ddl_result); - EXPECT_EQ(0, get_ddl_result->statements_size()); - - std::vector statements; - if (!emulator_) { // version_retention_period - statements.push_back("ALTER DATABASE `" + database_.database_id() + - "` SET OPTIONS (version_retention_period='7d')"); - } - statements.emplace_back(R"""( - CREATE TABLE Singers ( - SingerId INT64 NOT NULL, - FirstName STRING(1024), - LastName STRING(1024), - SingerInfo BYTES(MAX), - SingerDetails JSON - ) PRIMARY KEY (SingerId) - )"""); - auto metadata = client_.UpdateDatabase(database_, statements).get(); - ASSERT_STATUS_OK(metadata); - EXPECT_THAT(metadata->database(), EndsWith(database_.database_id())); - EXPECT_EQ(statements.size(), metadata->statements_size()); - EXPECT_EQ(statements.size(), metadata->commit_timestamps_size()); - if (metadata->statements_size() >= 1) { - EXPECT_THAT(metadata->statements(), Contains(HasSubstr("CREATE TABLE"))); - } - if (metadata->statements_size() >= 2) { - EXPECT_THAT(metadata->statements(), Contains(HasSubstr("ALTER DATABASE"))); - } - EXPECT_FALSE(metadata->throttled()); - - // Verify that a JSON column cannot be used as an index. - statements.clear(); - statements.emplace_back(R"""( - CREATE INDEX SingersByDetail - ON Singers(SingerDetails) - )"""); - metadata = client_.UpdateDatabase(database_, statements).get(); - EXPECT_THAT(metadata, StatusIs(StatusCode::kFailedPrecondition, - HasSubstr("SingersByDetail"))); - - // Verify that a JSON column cannot be used as a primary key. - statements.clear(); - statements.emplace_back(R"""( - CREATE TABLE JsonKey ( - Key JSON NOT NULL - ) PRIMARY KEY (Key) - )"""); - metadata = client_.UpdateDatabase(database_, statements).get(); - EXPECT_THAT(metadata, StatusIs(StatusCode::kInvalidArgument, - AllOf(HasSubstr("Key has type JSON"), - HasSubstr("part of the primary key")))); - - EXPECT_TRUE(DatabaseExists()) << "Database " << database_; - auto drop_status = client_.DropDatabase(database_); - EXPECT_STATUS_OK(drop_status); - EXPECT_FALSE(DatabaseExists()) << "Database " << database_; -} - -/// @test Verify setting version_retention_period via CreateDatabase(). -TEST_F(DatabaseAdminClientTest, VersionRetentionPeriodCreate) { - // Set the version_retention_period via CreateDatabase(). - auto database = - client_ - .CreateDatabase( - database_, - {absl::StrCat("ALTER DATABASE `", database_.database_id(), - "` SET OPTIONS (version_retention_period='7d')")}) - .get(); - if (emulator_) { // version_retention_period - EXPECT_THAT(database, Not(IsOk())); - GTEST_SKIP(); - } - ASSERT_THAT(database, IsOk()); - EXPECT_EQ(database_.FullName(), database->name()); - EXPECT_EQ("7d", database->version_retention_period()); - - // Verify that version_retention_period is returned from GetDatabase(). - auto get = client_.GetDatabase(database_); - ASSERT_THAT(get, IsOk()); - EXPECT_EQ(database->name(), get->name()); - EXPECT_EQ("7d", get->version_retention_period()); - - // Verify that earliest_version_time doesn't go past database create_time. - EXPECT_TRUE(get->has_create_time()); - EXPECT_TRUE(get->has_earliest_version_time()); - EXPECT_LE(MakeTimestamp(get->create_time()).value(), - MakeTimestamp(get->earliest_version_time()).value()); - - auto drop = client_.DropDatabase(database_); - EXPECT_THAT(drop, IsOk()); -} - -/// @test Verify setting bad version_retention_period via CreateDatabase(). -TEST_F(DatabaseAdminClientTest, VersionRetentionPeriodCreateFailure) { - // Set an invalid version_retention_period (zero) via CreateDatabase(), - // and verify that an error is returned. - auto database = - client_ - .CreateDatabase( - database_, - {absl::StrCat("ALTER DATABASE `", database_.database_id(), - "` SET OPTIONS (version_retention_period='0')")}) - .get(); - EXPECT_THAT(database, Not(IsOk())); -} - -/// @test Verify setting version_retention_period via UpdateDatabase(). -TEST_F(DatabaseAdminClientTest, VersionRetentionPeriodUpdate) { - // Create the database. - auto database = - client_.CreateDatabase(database_, /*extra_statements=*/{}).get(); - ASSERT_THAT(database, IsOk()); - EXPECT_EQ(database_.FullName(), database->name()); - if (emulator_) { // version_retention_period - EXPECT_EQ("", database->version_retention_period()); - } else { - EXPECT_NE("", database->version_retention_period()); // default value - } - - // Set the version_retention_period via UpdateDatabase(). - auto update = - client_ - .UpdateDatabase( - database_, - {absl::StrCat("ALTER DATABASE `", database_.database_id(), - "` SET OPTIONS (version_retention_period='7d')")}) - .get(); - if (emulator_) { // version_retention_period - EXPECT_THAT(update, Not(IsOk())); - } else { - ASSERT_THAT(update, IsOk()); - EXPECT_EQ(database->name(), update->database()); - EXPECT_THAT(update->statements(), - Contains(ContainsRegex("version_retention_period *= *'7d'"))); - } - - // Verify that version_retention_period is returned from GetDatabase(). - auto get = client_.GetDatabase(database_); - ASSERT_THAT(get, IsOk()); - EXPECT_EQ(database->name(), get->name()); - if (emulator_) { // version_retention_period - EXPECT_EQ("", get->version_retention_period()); - } else { - EXPECT_EQ("7d", get->version_retention_period()); - } - - // Verify that version_retention_period is returned via ListDatabases(). - auto list_db = [&] { - for (auto const& db : client_.ListDatabases(instance_)) { - if (db && db->name() == database_.FullName()) return db; - } - return StatusOr{ - Status{StatusCode::kNotFound, "disappeared"}}; - }(); - ASSERT_THAT(list_db, IsOk()); - EXPECT_EQ(database->name(), list_db->name()); - if (emulator_) { // version_retention_period - EXPECT_EQ("", list_db->version_retention_period()); - } else { - EXPECT_EQ("7d", list_db->version_retention_period()); - } - - // Verify that version_retention_period is returned from GetDatabaseDdl(). - auto ddl = client_.GetDatabaseDdl(database_); - ASSERT_THAT(ddl, IsOk()); - if (emulator_) { // version_retention_period - } else { - EXPECT_THAT(ddl->statements(), - Contains(ContainsRegex("version_retention_period *= *'7d'"))); - } - - auto drop = client_.DropDatabase(database_); - EXPECT_THAT(drop, IsOk()); -} - -/// @test Verify setting bad version_retention_period via UpdateDatabase(). -TEST_F(DatabaseAdminClientTest, VersionRetentionPeriodUpdateFailure) { - // Create the database. - auto database = - client_.CreateDatabase(database_, /*extra_statements=*/{}).get(); - ASSERT_THAT(database, IsOk()); - EXPECT_EQ(database_.FullName(), database->name()); - if (emulator_) { // version_retention_period - EXPECT_EQ("", database->version_retention_period()); - } else { - EXPECT_NE("", database->version_retention_period()); // default value - } - - auto get0 = client_.GetDatabase(database_); - ASSERT_THAT(get0, IsOk()); - EXPECT_EQ(database->name(), get0->name()); - if (emulator_) { // version_retention_period - EXPECT_EQ("", get0->version_retention_period()); - } else { - EXPECT_NE("", get0->version_retention_period()); // default value - } - - // Set an invalid version_retention_period (zero) via UpdateDatabase(), - // and verify that an error is returned. - auto update = - client_ - .UpdateDatabase( - database_, - {absl::StrCat("ALTER DATABASE `", database_.database_id(), - "` SET OPTIONS (version_retention_period='0')")}) - .get(); - EXPECT_THAT(update, Not(IsOk())); - - // Also verify that version_retention_period was NOT changed. - auto get = client_.GetDatabase(database_); - ASSERT_THAT(get, IsOk()); - EXPECT_EQ(database->name(), get->name()); - EXPECT_EQ(get0->version_retention_period(), get->version_retention_period()); - - auto drop = client_.DropDatabase(database_); - EXPECT_THAT(drop, IsOk()); -} - -// @test Verify we can create a database with an encryption key. -TEST_F(DatabaseAdminClientTest, CreateWithEncryptionKey) { - KmsKeyName encryption_key(instance_.project_id(), location_, kKeyRing, - kKeyName); - auto database = client_ - .CreateDatabase(database_, /*extra_statements=*/{}, - CustomerManagedEncryption(encryption_key)) - .get(); - ASSERT_STATUS_OK(database); - EXPECT_EQ(database->name(), database_.FullName()); - if (emulator_) { - EXPECT_FALSE(database->has_encryption_config()); - } else { - EXPECT_TRUE(database->has_encryption_config()); - if (database->has_encryption_config()) { - EXPECT_EQ(database->encryption_config().kms_key_name(), - encryption_key.FullName()); - } - - auto get_result = client_.GetDatabase(database_); - ASSERT_STATUS_OK(get_result); - EXPECT_EQ(database->name(), get_result->name()); - EXPECT_TRUE(get_result->has_encryption_config()); - if (get_result->has_encryption_config()) { - EXPECT_EQ(get_result->encryption_config().kms_key_name(), - encryption_key.FullName()); - } - - // Verify that encryption config is returned via ListDatabases(). - auto list_db = [&] { - for (auto const& db : client_.ListDatabases(database_.instance())) { - if (db && db->name() == database_.FullName()) return db; - } - return StatusOr{ - Status{StatusCode::kNotFound, "disappeared"}}; - }(); - ASSERT_THAT(list_db, IsOk()); - EXPECT_TRUE(list_db->has_encryption_config()); - if (list_db->has_encryption_config()) { - EXPECT_EQ(list_db->encryption_config().kms_key_name(), - encryption_key.FullName()); - } - } - - EXPECT_STATUS_OK(client_.DropDatabase(database_)); -} - -// @test Verify creating a database fails if a nonexistent encryption key is -// supplied. -TEST_F(DatabaseAdminClientTest, CreateWithNonexistentEncryptionKey) { - KmsKeyName nonexistent_encryption_key(instance_.project_id(), location_, - kKeyRing, "ceci-n-est-pas-une-cle"); - auto database = - client_ - .CreateDatabase(database_, /*extra_statements=*/{}, - CustomerManagedEncryption(nonexistent_encryption_key)) - .get(); - if (emulator_) { - EXPECT_THAT(database, IsOk()); - EXPECT_STATUS_OK(client_.DropDatabase(database_)); - } else { - EXPECT_THAT(database, - StatusIs(StatusCode::kFailedPrecondition, - HasSubstr("KMS Key provided is not usable"))); - } -} - -/// @test Verify the backwards compatibility `v1` namespace still exists. -TEST_F(DatabaseAdminClientTest, BackwardsCompatibility) { - auto connection = ::google::cloud::spanner::v1::MakeDatabaseAdminConnection(); - EXPECT_THAT(connection, NotNull()); - ASSERT_NO_FATAL_FAILURE(DatabaseAdminClient(std::move(connection))); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner -} // namespace cloud -} // namespace google diff --git a/google/cloud/spanner/integration_tests/instance_admin_integration_test.cc b/google/cloud/spanner/integration_tests/instance_admin_integration_test.cc deleted file mode 100644 index 5d09bc1eb1f6e..0000000000000 --- a/google/cloud/spanner/integration_tests/instance_admin_integration_test.cc +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO(#7356): Remove this file after the deprecation period expires -#include "google/cloud/internal/disable_deprecation_warnings.inc" -#include "google/cloud/spanner/create_instance_request_builder.h" -#include "google/cloud/spanner/instance_admin_client.h" -#include "google/cloud/spanner/testing/cleanup_stale_instances.h" -#include "google/cloud/spanner/testing/pick_instance_config.h" -#include "google/cloud/spanner/testing/random_instance_name.h" -#include "google/cloud/spanner/update_instance_request_builder.h" -#include "google/cloud/internal/getenv.h" -#include "google/cloud/internal/random.h" -#include "google/cloud/testing_util/integration_test.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "absl/strings/match.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace spanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -using ::google::cloud::testing_util::IsOk; -using ::google::cloud::testing_util::StatusIs; -using ::testing::AnyOf; -using ::testing::HasSubstr; -using ::testing::IsEmpty; -using ::testing::Not; -using ::testing::NotNull; -using ::testing::UnorderedElementsAre; - -std::string const& ProjectId() { - static std::string project_id = - internal::GetEnv("GOOGLE_CLOUD_PROJECT").value_or(""); - return project_id; -} - -std::string const& InstanceId() { - static std::string instance_id = - internal::GetEnv("GOOGLE_CLOUD_CPP_SPANNER_TEST_INSTANCE_ID") - .value_or(""); - return instance_id; -} - -bool RunSlowInstanceTests() { - static bool run_slow_instance_tests = absl::StrContains( - internal::GetEnv("GOOGLE_CLOUD_CPP_SPANNER_SLOW_INTEGRATION_TESTS") - .value_or(""), - "instance"); - return run_slow_instance_tests; -} - -bool Emulator() { - static bool emulator = internal::GetEnv("SPANNER_EMULATOR_HOST").has_value(); - return emulator; -} - -class CleanupStaleInstances : public ::testing::Environment { - public: - void SetUp() override { - spanner_admin::InstanceAdminClient instance_admin_client( - spanner_admin::MakeInstanceAdminConnection()); - spanner_admin::DatabaseAdminClient database_admin_client( - spanner_admin::MakeDatabaseAdminConnection()); - EXPECT_STATUS_OK(spanner_testing::CleanupStaleInstances( - Project(ProjectId()), std::move(instance_admin_client), - std::move(database_admin_client))); - } -}; - -::testing::Environment* const kCleanupEnv = - ::testing::AddGlobalTestEnvironment(new CleanupStaleInstances); - -class InstanceAdminClientTest - : public ::google::cloud::testing_util::IntegrationTest { - public: - InstanceAdminClientTest() - : generator_(internal::MakeDefaultPRNG()), - client_(MakeInstanceAdminConnection()) { - static_cast(kCleanupEnv); - } - - protected: - void SetUp() override { - if (Emulator()) { - // We expect test instances to exist when running against real services, - // but if we are running against the emulator we're happy to create one. - Instance in(ProjectId(), InstanceId()); - auto create_instance_request = - CreateInstanceRequestBuilder(in, - "projects/" + in.project_id() + - "/instanceConfigs/emulator-config") - .Build(); - auto instance = client_.CreateInstance(create_instance_request).get(); - if (!instance) { - ASSERT_THAT(instance, StatusIs(StatusCode::kAlreadyExists)); - } - } - } - - internal::DefaultPRNG generator_; - InstanceAdminClient client_; -}; - -/// @test Verify the basic read operations for instances work. -TEST_F(InstanceAdminClientTest, InstanceReadOperations) { - Instance in(ProjectId(), InstanceId()); - ASSERT_FALSE(in.project_id().empty()); - ASSERT_FALSE(in.instance_id().empty()); - - auto instance = client_.GetInstance(in); - ASSERT_STATUS_OK(instance); - EXPECT_EQ(instance->name(), in.FullName()); - EXPECT_NE(instance->node_count(), 0); - - auto instance_names = [&in, this]() mutable { - std::vector names; - for (auto const& instance : client_.ListInstances(in.project_id(), "")) { - EXPECT_STATUS_OK(instance); - if (!instance) break; - names.push_back(instance->name()); - } - return names; - }(); - EXPECT_EQ(1, std::count(instance_names.begin(), instance_names.end(), - instance->name())); -} - -/// @test Verify the basic CRUD operations for instances work. -TEST_F(InstanceAdminClientTest, InstanceCRUDOperations) { - if (!RunSlowInstanceTests()) { - GTEST_SKIP() << "skipping slow instance tests; set " - << "GOOGLE_CLOUD_CPP_SPANNER_SLOW_INTEGRATION_TESTS=instance" - << " to override"; - } - - std::string instance_id = spanner_testing::RandomInstanceName(generator_); - Instance in(ProjectId(), instance_id); - ASSERT_FALSE(in.project_id().empty()); - ASSERT_FALSE(in.instance_id().empty()); - - auto config_name = spanner_testing::PickInstanceConfig( - in.project(), generator_, - [](google::spanner::admin::instance::v1::InstanceConfig const& config) { - return absl::StrContains(config.name(), "/regional-us-west"); - }); - ASSERT_FALSE(config_name.empty()) << "could not get an instance config"; - - auto instance = - client_ - .CreateInstance(CreateInstanceRequestBuilder(in, config_name) - .SetDisplayName("test-display-name") - .SetNodeCount(1) - .SetLabels({{"label-key", "label-value"}}) - .Build()) - .get(); - - ASSERT_STATUS_OK(instance); - EXPECT_EQ(instance->name(), in.FullName()); - EXPECT_EQ(instance->display_name(), "test-display-name"); - EXPECT_NE(instance->node_count(), 0); - EXPECT_EQ(instance->config(), config_name); - EXPECT_EQ(instance->labels().at("label-key"), "label-value"); - - // Then update the instance - instance = client_ - .UpdateInstance(UpdateInstanceRequestBuilder(*instance) - .SetDisplayName("New display name") - .AddLabels({{"new-key", "new-value"}}) - .SetNodeCount(2) - .Build()) - .get(); - if (Emulator()) { - EXPECT_THAT(instance, StatusIs(StatusCode::kUnimplemented)); - } else { - EXPECT_STATUS_OK(instance); - if (instance) { - EXPECT_EQ(instance->display_name(), "New display name"); - EXPECT_EQ(instance->labels_size(), 2); - EXPECT_EQ(instance->labels().at("new-key"), "new-value"); - EXPECT_EQ(instance->node_count(), 2); - } - } - - EXPECT_STATUS_OK(client_.DeleteInstance(in)); -} - -TEST_F(InstanceAdminClientTest, InstanceConfig) { - auto project_id = ProjectId(); - ASSERT_FALSE(project_id.empty()); - - auto config_names = [&project_id, this]() mutable { - std::vector names; - for (auto const& config : client_.ListInstanceConfigs(project_id)) { - EXPECT_STATUS_OK(config); - if (!config) break; - names.push_back(config->name()); - } - return names; - }(); - ASSERT_FALSE(config_names.empty()); - - // Use the name of the first element from the list of instance configs. - auto config = client_.GetInstanceConfig(config_names[0]); - ASSERT_STATUS_OK(config); - EXPECT_THAT(config->name(), HasSubstr(project_id)); - EXPECT_EQ( - 1, std::count(config_names.begin(), config_names.end(), config->name())); -} - -TEST_F(InstanceAdminClientTest, InstanceIam) { - Instance in(ProjectId(), InstanceId()); - ASSERT_FALSE(in.project_id().empty()); - ASSERT_FALSE(in.instance_id().empty()); - - auto actual_policy = client_.GetIamPolicy(in); - if (Emulator()) { - EXPECT_THAT(actual_policy, StatusIs(StatusCode::kUnimplemented)); - GTEST_SKIP() << "emulator does not support IAM policies"; - } - ASSERT_STATUS_OK(actual_policy); - EXPECT_FALSE(actual_policy->etag().empty()); - - if (RunSlowInstanceTests()) { - // Set the policy to the existing value of the policy. While this - // changes nothing, it tests all the code in the client library. - auto updated_policy = client_.SetIamPolicy(in, *actual_policy); - ASSERT_THAT(updated_policy, AnyOf(IsOk(), StatusIs(StatusCode::kAborted))); - if (updated_policy) { - EXPECT_THAT(updated_policy->etag(), Not(IsEmpty())); - } - - // Repeat the test using the OCC API. - updated_policy = - client_.SetIamPolicy(in, [](google::iam::v1::Policy p) { return p; }); - ASSERT_STATUS_OK(updated_policy); - EXPECT_THAT(updated_policy->etag(), Not(IsEmpty())); - } - - auto actual = client_.TestIamPermissions( - in, {"spanner.databases.list", "spanner.databases.get"}); - ASSERT_STATUS_OK(actual); - EXPECT_THAT( - actual->permissions(), - UnorderedElementsAre("spanner.databases.list", "spanner.databases.get")); -} - -/// @test Verify the backwards compatibility `v1` namespace still exists. -TEST_F(InstanceAdminClientTest, BackwardsCompatibility) { - auto connection = ::google::cloud::spanner::v1::MakeInstanceAdminConnection(); - EXPECT_THAT(connection, NotNull()); - ASSERT_NO_FATAL_FAILURE(InstanceAdminClient(std::move(connection))); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner -} // namespace cloud -} // namespace google diff --git a/google/cloud/spanner/integration_tests/session_pool_integration_test.cc b/google/cloud/spanner/integration_tests/session_pool_integration_test.cc index 08e6ba6274d2f..ef3036e083e77 100644 --- a/google/cloud/spanner/integration_tests/session_pool_integration_test.cc +++ b/google/cloud/spanner/integration_tests/session_pool_integration_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/internal/defaults.h" #include "google/cloud/spanner/internal/session_pool.h" #include "google/cloud/spanner/internal/spanner_stub_factory.h" @@ -124,3 +124,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/integration_tests/spanner_client_integration_tests.bzl b/google/cloud/spanner/integration_tests/spanner_client_integration_tests.bzl index f101d8f668d23..f1e518714142e 100644 --- a/google/cloud/spanner/integration_tests/spanner_client_integration_tests.bzl +++ b/google/cloud/spanner/integration_tests/spanner_client_integration_tests.bzl @@ -17,11 +17,7 @@ """Automatically generated unit tests list - DO NOT EDIT.""" spanner_client_integration_tests = [ - "backup_extra_integration_test.cc", - "backup_integration_test.cc", "client_stress_test.cc", "data_types_integration_test.cc", - "database_admin_integration_test.cc", - "instance_admin_integration_test.cc", "session_pool_integration_test.cc", ] diff --git a/google/cloud/spanner/internal/connection_impl.cc b/google/cloud/spanner/internal/connection_impl.cc index f137fcd2ca1ef..e7da01b3d48b2 100644 --- a/google/cloud/spanner/internal/connection_impl.cc +++ b/google/cloud/spanner/internal/connection_impl.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/internal/connection_impl.h" #include "google/cloud/spanner/internal/defaults.h" #include "google/cloud/spanner/internal/logging_result_set_reader.h" @@ -1446,3 +1446,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/internal/connection_impl.h b/google/cloud/spanner/internal/connection_impl.h index 6bed1878e81e1..20d87e75b7aae 100644 --- a/google/cloud/spanner/internal/connection_impl.h +++ b/google/cloud/spanner/internal/connection_impl.h @@ -26,7 +26,7 @@ #include "google/cloud/background_threads.h" #include "google/cloud/status.h" #include "google/cloud/status_or.h" -#include +#include "google/spanner/v1/spanner.pb.h" #include #include #include diff --git a/google/cloud/spanner/internal/connection_impl_test.cc b/google/cloud/spanner/internal/connection_impl_test.cc index e01ae824baea3..becf5a35ff6db 100644 --- a/google/cloud/spanner/internal/connection_impl_test.cc +++ b/google/cloud/spanner/internal/connection_impl_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/internal/connection_impl.h" #include "google/cloud/spanner/client.h" #include "google/cloud/spanner/internal/defaults.h" @@ -90,8 +90,6 @@ using ::testing::Property; using ::testing::Return; using ::testing::Sequence; using ::testing::SetArgPointee; -using ::testing::StartsWith; -using ::testing::StrictMock; using ::testing::UnorderedElementsAre; using ::testing::UnorderedPointwise; using ::testing::Unused; @@ -287,16 +285,6 @@ google::spanner::v1::Transaction MakeTestTransaction( return txn; } -// Create a `BatchCreateSessionsResponse` with the given `sessions`. -google::spanner::v1::BatchCreateSessionsResponse MakeSessionsResponse( - std::vector sessions) { - google::spanner::v1::BatchCreateSessionsResponse response; - for (auto& session : sessions) { - response.add_session()->set_name(std::move(session)); - } - return response; -} - // Create a `CommitResponse` with the given `commit_timestamp` and // `commit_stats`. google::spanner::v1::CommitResponse MakeCommitResponse( @@ -409,14 +397,9 @@ TEST(ConnectionImplTest, ReadCreateSessionFailure) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, CreateSession(_, _, HasDatabase(db))) + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) .WillRepeatedly(Return( Status(StatusCode::kPermissionDenied, "uh-oh in CreateSession"))); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kPermissionDenied, - "uh-oh in BatchCreateSessions"))); - EXPECT_CALL(*mock, AsyncDeleteSession).Times(0); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -427,7 +410,7 @@ TEST(ConnectionImplTest, ReadCreateSessionFailure) { {"column1"}}); for (auto& row : rows) { EXPECT_THAT(row, StatusIs(StatusCode::kPermissionDenied, - HasSubstr("uh-oh in BatchCreateSessions"))); + HasSubstr("uh-oh in CreateSession"))); } } @@ -435,16 +418,13 @@ TEST(ConnectionImplTest, ReadStreamingReadFailure) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto finish_status = internal::PermissionDeniedError("uh-oh in GrpcReader::Finish"); EXPECT_CALL(*mock, StreamingRead) .WillOnce( Return(ByMove(MakeReader({}, finish_status)))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -463,8 +443,8 @@ TEST(ConnectionImplTest, ReadSuccess) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto retry_status = internal::UnavailableError("try-again"); std::vector responses = { R"pb( @@ -527,9 +507,6 @@ TEST(ConnectionImplTest, ReadSuccess) { EXPECT_THAT(request.resume_token(), Eq("restart-row-2")); return MakeReader({responses[1], responses[2]}); }); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -553,13 +530,13 @@ TEST(ConnectionImplTest, ReadDirectedRead) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction).Times(0); EXPECT_CALL(*mock, StreamingRead) .WillOnce([](std::shared_ptr const&, Options const&, google::spanner::v1::ReadRequest const& request) { - EXPECT_EQ("test-session-name", request.session()); + EXPECT_EQ("multiplexed", request.session()); EXPECT_TRUE(request.has_directed_read_options()); auto const& directed_read_options = request.directed_read_options(); EXPECT_TRUE(directed_read_options.has_include_replicas()); @@ -572,9 +549,6 @@ TEST(ConnectionImplTest, ReadDirectedRead) { return MakeReader( {R"pb(metadata: { transaction: { id: "ABCDEF00" } })pb"}); }); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -593,22 +567,19 @@ TEST(ConnectionImplTest, ReadDirectedRead) { spanner::ReplicaSelection(spanner::ReplicaType::kReadOnly)}, true)}); EXPECT_TRUE(ContainsNoRows(rows)); - EXPECT_THAT(txn, HasSessionAndTransaction("test-session-name", "ABCDEF00", - false, "")); + EXPECT_THAT(txn, + HasSessionAndTransaction("multiplexed", "ABCDEF00", false, "")); } TEST(ConnectionImplTest, ReadPermanentFailure) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, StreamingRead) .WillOnce(Return(ByMove(MakeReader( {}, internal::PermissionDeniedError("uh-oh"))))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -627,8 +598,8 @@ TEST(ConnectionImplTest, ReadTooManyTransientFailures) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, StreamingRead) .Times(AtLeast(2)) // This won't compile without `Unused` despite what the gMock docs say. @@ -636,9 +607,6 @@ TEST(ConnectionImplTest, ReadTooManyTransientFailures) { return MakeReader( {}, internal::UnavailableError("try-again")); }); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -658,17 +626,14 @@ TEST(ConnectionImplTest, ReadImplicitBeginTransaction) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction).Times(0); auto constexpr kText = R"pb( metadata: { transaction: { id: "ABCDEF00" } } )pb"; EXPECT_CALL(*mock, StreamingRead) .WillOnce(Return(ByMove(MakeReader({kText})))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -677,8 +642,8 @@ TEST(ConnectionImplTest, ReadImplicitBeginTransaction) { auto rows = conn->Read( {txn, "table", spanner::KeySet::All(), {"UserId", "UserName"}}); EXPECT_TRUE(ContainsNoRows(rows)); - EXPECT_THAT(txn, HasSessionAndTransaction("test-session-name", "ABCDEF00", - false, "")); + EXPECT_THAT(txn, + HasSessionAndTransaction("multiplexed", "ABCDEF00", false, "")); } TEST(ConnectionImplTest, ReadImplicitBeginTransactionOneTransientFailure) { @@ -711,23 +676,19 @@ TEST(ConnectionImplTest, ReadImplicitBeginTransactionOneTransientFailure) { // n.b. these calls are explicitly sequenced because using the scoped // `InSequence` object causes gMock to get confused by the reader calls. Sequence s; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) .InSequence(s) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); - EXPECT_CALL(*mock, StreamingRead(_, _, - AllOf(HasSession("test-session-name"), - HasBeginTransaction()))) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); + EXPECT_CALL( + *mock, StreamingRead( + _, _, AllOf(HasSession("multiplexed"), HasBeginTransaction()))) .InSequence(s) .WillOnce(Return(ByMove(std::move(failing_reader)))); - EXPECT_CALL(*mock, StreamingRead(_, _, - AllOf(HasSession("test-session-name"), - HasBeginTransaction()))) + EXPECT_CALL( + *mock, StreamingRead( + _, _, AllOf(HasSession("multiplexed"), HasBeginTransaction()))) .InSequence(s) .WillOnce(Return(ByMove(std::move(ok_reader)))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .InSequence(s) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -741,8 +702,8 @@ TEST(ConnectionImplTest, ReadImplicitBeginTransactionOneTransientFailure) { auto actual = std::vector>{stream.begin(), stream.end()}; EXPECT_THAT(actual, ElementsAre(IsOkAndHolds(RowType(12, "Steve")), IsOkAndHolds(RowType(42, "Ann")))); - EXPECT_THAT(txn, HasSessionAndTransaction("test-session-name", "ABCDEF00", - false, "")); + EXPECT_THAT(txn, + HasSessionAndTransaction("multiplexed", "ABCDEF00", false, "")); } TEST(ConnectionImplTest, ReadImplicitBeginTransactionOnePermanentFailure) { @@ -774,26 +735,22 @@ TEST(ConnectionImplTest, ReadImplicitBeginTransactionOnePermanentFailure) { // n.b. these calls are explicitly sequenced because using the scoped // `InSequence` object causes gMock to get confused by the reader calls. Sequence s; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) .InSequence(s) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); - EXPECT_CALL(*mock, StreamingRead(_, _, - AllOf(HasSession("test-session-name"), - HasBeginTransaction()))) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); + EXPECT_CALL( + *mock, StreamingRead( + _, _, AllOf(HasSession("multiplexed"), HasBeginTransaction()))) .InSequence(s) .WillOnce(Return(ByMove(std::move(failing_reader)))); EXPECT_CALL(*mock, BeginTransaction) .InSequence(s) .WillOnce(Return(MakeTestTransaction("FEDCBA98"))); EXPECT_CALL(*mock, StreamingRead(_, _, - AllOf(HasSession("test-session-name"), + AllOf(HasSession("multiplexed"), HasTransactionId("FEDCBA98")))) .InSequence(s) .WillOnce(Return(ByMove(std::move(ok_reader)))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .InSequence(s) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -807,8 +764,8 @@ TEST(ConnectionImplTest, ReadImplicitBeginTransactionOnePermanentFailure) { auto actual = std::vector>{stream.begin(), stream.end()}; EXPECT_THAT(actual, ElementsAre(IsOkAndHolds(RowType(12, "Steve")), IsOkAndHolds(RowType(42, "Ann")))); - EXPECT_THAT(txn, HasSessionAndTransaction("test-session-name", "FEDCBA98", - false, "")); + EXPECT_THAT(txn, + HasSessionAndTransaction("multiplexed", "FEDCBA98", false, "")); } TEST(ConnectionImplTest, ReadImplicitBeginTransactionPermanentFailure) { @@ -822,26 +779,22 @@ TEST(ConnectionImplTest, ReadImplicitBeginTransactionPermanentFailure) { // n.b. these calls are explicitly sequenced because using the scoped // `InSequence` object causes gMock to get confused by the reader calls. Sequence s; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) .InSequence(s) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); - EXPECT_CALL(*mock, StreamingRead(_, _, - AllOf(HasSession("test-session-name"), - HasBeginTransaction()))) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); + EXPECT_CALL( + *mock, StreamingRead( + _, _, AllOf(HasSession("multiplexed"), HasBeginTransaction()))) .InSequence(s) .WillOnce(Return(ByMove(std::move(reader1)))); EXPECT_CALL(*mock, BeginTransaction) .InSequence(s) .WillOnce(Return(MakeTestTransaction("FEDCBA98"))); EXPECT_CALL(*mock, StreamingRead(_, _, - AllOf(HasSession("test-session-name"), + AllOf(HasSession("multiplexed"), HasTransactionId("FEDCBA98")))) .InSequence(s) .WillOnce(Return(ByMove(std::move(reader2)))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .InSequence(s) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -859,13 +812,10 @@ TEST(ConnectionImplTest, ExecuteQueryCreateSessionFailure) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kPermissionDenied, - "uh-oh in BatchCreateSessions"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); + + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillRepeatedly(Return( + Status(StatusCode::kPermissionDenied, "uh-oh in CreateSession"))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -874,7 +824,7 @@ TEST(ConnectionImplTest, ExecuteQueryCreateSessionFailure) { spanner::SqlStatement("SELECT * FROM Table")}); for (auto& row : rows) { EXPECT_THAT(row, StatusIs(StatusCode::kPermissionDenied, - HasSubstr("uh-oh in BatchCreateSessions"))); + HasSubstr("uh-oh in CreateSession"))); } } @@ -882,15 +832,12 @@ TEST(ConnectionImplTest, ExecuteQueryStreamingReadFailure) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, ExecuteStreamingSql) .WillOnce(Return(ByMove(MakeReader( {}, internal::PermissionDeniedError("uh-oh in GrpcReader::Finish"))))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -907,8 +854,8 @@ TEST(ConnectionImplTest, ExecuteQueryReadSuccess) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto constexpr kText = R"pb( metadata: { row_type: { @@ -935,9 +882,6 @@ TEST(ConnectionImplTest, ExecuteQueryReadSuccess) { )pb"; EXPECT_CALL(*mock, ExecuteStreamingSql) .WillOnce(Return(ByMove(MakeReader({kText})))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -960,13 +904,13 @@ TEST(ConnectionImplTest, ExecuteQueryDirectedRead) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction).Times(0); EXPECT_CALL(*mock, ExecuteStreamingSql) .WillOnce([](std::shared_ptr const&, Options const&, google::spanner::v1::ExecuteSqlRequest const& request) { - EXPECT_EQ("test-session-name", request.session()); + EXPECT_EQ("multiplexed", request.session()); EXPECT_TRUE(request.has_directed_read_options()); auto const& directed_read_options = request.directed_read_options(); EXPECT_TRUE(directed_read_options.has_exclude_replicas()); @@ -979,9 +923,6 @@ TEST(ConnectionImplTest, ExecuteQueryDirectedRead) { return MakeReader( {R"pb(metadata: { transaction: { id: "00FEDCBA" } })pb"}); }); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -996,16 +937,16 @@ TEST(ConnectionImplTest, ExecuteQueryDirectedRead) { {spanner::ReplicaSelection(spanner::ReplicaType::kReadWrite), spanner::ReplicaSelection("us-east4")})}); EXPECT_TRUE(ContainsNoRows(rows)); - EXPECT_THAT(txn, HasSessionAndTransaction("test-session-name", "00FEDCBA", - false, "")); + EXPECT_THAT(txn, + HasSessionAndTransaction("multiplexed", "00FEDCBA", false, "")); } TEST(ConnectionImplTest, ExecuteQueryPgNumericResult) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto constexpr kText = R"pb( metadata: { row_type: { @@ -1026,9 +967,6 @@ TEST(ConnectionImplTest, ExecuteQueryPgNumericResult) { )pb"; EXPECT_CALL(*mock, ExecuteStreamingSql) .WillOnce(Return(ByMove(MakeReader({kText})))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -1053,8 +991,8 @@ TEST(ConnectionImplTest, ExecuteQueryJsonBResult) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto constexpr kText = R"pb( metadata: { row_type: { @@ -1075,9 +1013,6 @@ TEST(ConnectionImplTest, ExecuteQueryJsonBResult) { )pb"; EXPECT_CALL(*mock, ExecuteStreamingSql) .WillOnce(Return(ByMove(MakeReader({kText})))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -1100,8 +1035,8 @@ TEST(ConnectionImplTest, ExecuteQueryNumericParameter) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto constexpr kResponseNumeric = R"pb( metadata: { row_type: { @@ -1153,9 +1088,6 @@ TEST(ConnectionImplTest, ExecuteQueryNumericParameter) { google::spanner::v1::TypeAnnotationCode::PG_NUMERIC); return MakeReader({kResponsePgNumeric}); }); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -1186,8 +1118,8 @@ TEST(ConnectionImplTest, ExecuteQueryPgOidResult) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto constexpr kText = R"pb( metadata: { row_type: { @@ -1208,9 +1140,6 @@ TEST(ConnectionImplTest, ExecuteQueryPgOidResult) { )pb"; EXPECT_CALL(*mock, ExecuteStreamingSql) .WillOnce(Return(ByMove(MakeReader({kText})))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -1233,17 +1162,14 @@ TEST(ConnectionImplTest, ExecuteQueryImplicitBeginTransaction) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction).Times(0); auto constexpr kText = R"pb( metadata: { transaction: { id: "00FEDCBA" } } )pb"; EXPECT_CALL(*mock, ExecuteStreamingSql) .WillOnce(Return(ByMove(MakeReader({kText})))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -1252,8 +1178,8 @@ TEST(ConnectionImplTest, ExecuteQueryImplicitBeginTransaction) { auto rows = conn->ExecuteQuery({txn, spanner::SqlStatement("SELECT * FROM Table")}); EXPECT_TRUE(ContainsNoRows(rows)); - EXPECT_THAT(txn, HasSessionAndTransaction("test-session-name", "00FEDCBA", - false, "")); + EXPECT_THAT(txn, + HasSessionAndTransaction("multiplexed", "00FEDCBA", false, "")); } /** @@ -1261,6 +1187,9 @@ TEST(ConnectionImplTest, ExecuteQueryImplicitBeginTransaction) { * by QueryOptions contain the expected fields. */ TEST(ConnectionImplTest, QueryOptions) { + // TODO(#15927): Update the instrumentation of this test for multiplexed + // sessions. + GTEST_SKIP(); struct { // Given these QueryOptions ... spanner::QueryOptions options; @@ -1452,8 +1381,8 @@ TEST(ConnectionImplTest, QueryOptions) { .Build())); // ExecuteQuery(). - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))) + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))) .RetiresOnSaturation(); EXPECT_CALL(*mock, ExecuteStreamingSql(_, _, execute_sql_request_matcher)) .WillOnce(Return(ByMove(std::move(stream)))) @@ -1467,8 +1396,8 @@ TEST(ConnectionImplTest, QueryOptions) { .RetiresOnSaturation(); // ExecutePartitionedDml(). - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))) + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))) .RetiresOnSaturation(); EXPECT_CALL(*mock, BeginTransaction(_, _, begin_transaction_request_matcher)) @@ -1503,11 +1432,6 @@ TEST(ConnectionImplTest, QueryOptions) { EXPECT_CALL(*mock, Commit(_, _, commit_request_matcher)) .Times(1) .RetiresOnSaturation(); - - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))) - .RetiresOnSaturation(); } auto conn = MakeConnectionImpl(db, mock); @@ -1531,11 +1455,6 @@ TEST(ConnectionImplTest, ExecuteDmlCreateSessionFailure) { EXPECT_CALL(*mock, CreateSession(_, _, HasDatabase(db))) .WillRepeatedly(Return( Status(StatusCode::kPermissionDenied, "uh-oh in CreateSession"))); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kPermissionDenied, - "uh-oh in BatchCreateSessions"))); - EXPECT_CALL(*mock, AsyncDeleteSession).Times(0); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -1545,15 +1464,15 @@ TEST(ConnectionImplTest, ExecuteDmlCreateSessionFailure) { conn->ExecuteDml({txn, spanner::SqlStatement("DELETE * FROM Table")}); EXPECT_THAT(result, StatusIs(StatusCode::kPermissionDenied, - HasSubstr("uh-oh in BatchCreateSessions"))); + HasSubstr("uh-oh in CreateSession"))); } TEST(ConnectionImplTest, ExecuteDmlDeleteSuccess) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto constexpr kText = R"pb( metadata: { transaction: { id: "1234567890" } } stats: { row_count_exact: 42 } @@ -1563,9 +1482,6 @@ TEST(ConnectionImplTest, ExecuteDmlDeleteSuccess) { EXPECT_CALL(*mock, ExecuteSql) .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) .WillOnce(Return(response)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -1584,16 +1500,13 @@ TEST(ConnectionImplTest, ExecuteDmlDeletePermanentFailure) { "placeholder_database_id"); { InSequence seq; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); Status status(StatusCode::kPermissionDenied, "uh-oh in ExecuteDml"); EXPECT_CALL(*mock, ExecuteSql).WillOnce(Return(status)); EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return(MakeTestTransaction())); EXPECT_CALL(*mock, ExecuteSql).WillOnce(Return(status)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); } auto conn = MakeConnectionImpl(db, mock); @@ -1612,8 +1525,8 @@ TEST(ConnectionImplTest, ExecuteDmlDeleteTooManyTransientFailures) { "placeholder_database_id"); { InSequence seq; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); Status status(StatusCode::kUnavailable, "try-again in ExecuteDml"); EXPECT_CALL(*mock, ExecuteSql) .Times(AtLeast(2)) @@ -1623,9 +1536,6 @@ TEST(ConnectionImplTest, ExecuteDmlDeleteTooManyTransientFailures) { EXPECT_CALL(*mock, ExecuteSql) .Times(AtLeast(2)) .WillRepeatedly(Return(status)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); } auto conn = MakeConnectionImpl(db, mock); @@ -1648,8 +1558,8 @@ TEST(ConnectionImplTest, ExecuteDmlTransactionAtomicity) { Status begin_status(StatusCode::kInvalidArgument, "BeginTransaction status"); { InSequence seq; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); // The first `ExecuteDml` call tries to implicitly begin the transaction // via `ExecuteSql`, and then explicitly via `BeginTransaction`. Both fail, @@ -1657,10 +1567,6 @@ TEST(ConnectionImplTest, ExecuteDmlTransactionAtomicity) { // not valid the client fails any subsequent operations itself. EXPECT_CALL(*mock, ExecuteSql).WillOnce(Return(op_status)); EXPECT_CALL(*mock, BeginTransaction).WillOnce(Return(begin_status)); - - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); } auto conn = MakeConnectionImpl(db, mock); @@ -1683,18 +1589,14 @@ TEST(ConnectionImplTest, ExecuteDmlTransactionMissing) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); // Return an otherwise valid response that does not contain a transaction. google::spanner::v1::ResultSet response; ASSERT_TRUE(TextFormat::ParseFromString("metadata: {}", &response)); EXPECT_CALL(*mock, ExecuteSql).WillOnce(Return(response)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); - auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); spanner::Transaction txn = @@ -1710,8 +1612,8 @@ TEST(ConnectionImplTest, ProfileQuerySuccess) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto constexpr kText = R"pb( metadata: { row_type: { @@ -1741,9 +1643,6 @@ TEST(ConnectionImplTest, ProfileQuerySuccess) { )pb"; EXPECT_CALL(*mock, ExecuteStreamingSql) .WillOnce(Return(ByMove(MakeReader({kText})))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -1780,11 +1679,6 @@ TEST(ConnectionImplTest, ProfileQueryCreateSessionFailure) { EXPECT_CALL(*mock, CreateSession(_, _, HasDatabase(db))) .WillRepeatedly(Return( Status(StatusCode::kPermissionDenied, "uh-oh in CreateSession"))); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kPermissionDenied, - "uh-oh in BatchCreateSessions"))); - EXPECT_CALL(*mock, AsyncDeleteSession).Times(0); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -1793,7 +1687,7 @@ TEST(ConnectionImplTest, ProfileQueryCreateSessionFailure) { spanner::SqlStatement("SELECT * FROM Table")}); for (auto& row : result) { EXPECT_THAT(row, StatusIs(StatusCode::kPermissionDenied, - HasSubstr("uh-oh in BatchCreateSessions"))); + HasSubstr("uh-oh in CreateSession"))); } } @@ -1801,16 +1695,13 @@ TEST(ConnectionImplTest, ProfileQueryStreamingReadFailure) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto finish_status = internal::PermissionDeniedError("uh-oh in GrpcReader::Finish"); EXPECT_CALL(*mock, ExecuteStreamingSql) .WillOnce( Return(ByMove(MakeReader({}, finish_status)))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -1830,10 +1721,6 @@ TEST(ConnectionImplTest, ProfileDmlCreateSessionFailure) { EXPECT_CALL(*mock, CreateSession(_, _, HasDatabase(db))) .WillRepeatedly(Return( Status(StatusCode::kPermissionDenied, "uh-oh in CreateSession"))); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kPermissionDenied, - "uh-oh in BatchCreateSessions"))); EXPECT_CALL(*mock, AsyncDeleteSession).Times(0); auto conn = MakeConnectionImpl(db, mock); @@ -1843,15 +1730,15 @@ TEST(ConnectionImplTest, ProfileDmlCreateSessionFailure) { auto result = conn->ProfileDml({txn, spanner::SqlStatement("DELETE * FROM Table")}); EXPECT_THAT(result, StatusIs(StatusCode::kPermissionDenied, - HasSubstr("uh-oh in BatchCreateSessions"))); + HasSubstr("uh-oh in CreateSession"))); } TEST(ConnectionImplTest, ProfileDmlDeleteSuccess) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto constexpr kText = R"pb( metadata: { transaction: { id: "1234567890" } } stats: { @@ -1870,9 +1757,6 @@ TEST(ConnectionImplTest, ProfileDmlDeleteSuccess) { EXPECT_CALL(*mock, ExecuteSql) .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) .WillOnce(Return(response)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -1906,16 +1790,13 @@ TEST(ConnectionImplTest, ProfileDmlDeletePermanentFailure) { "placeholder_database_id"); { InSequence seq; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); Status status(StatusCode::kPermissionDenied, "uh-oh in ExecuteDml"); EXPECT_CALL(*mock, ExecuteSql).WillOnce(Return(status)); EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return(MakeTestTransaction())); EXPECT_CALL(*mock, ExecuteSql).WillOnce(Return(status)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); } auto conn = MakeConnectionImpl(db, mock); @@ -1934,8 +1815,8 @@ TEST(ConnectionImplTest, ProfileDmlDeleteTooManyTransientFailures) { "placeholder_database_id"); { InSequence seq; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); Status status(StatusCode::kUnavailable, "try-again in ExecuteDml"); EXPECT_CALL(*mock, ExecuteSql) .Times(AtLeast(2)) @@ -1945,9 +1826,6 @@ TEST(ConnectionImplTest, ProfileDmlDeleteTooManyTransientFailures) { EXPECT_CALL(*mock, ExecuteSql) .Times(AtLeast(2)) .WillRepeatedly(Return(status)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); } auto conn = MakeConnectionImpl(db, mock); @@ -1965,8 +1843,8 @@ TEST(ConnectionImplTest, AnalyzeSqlSuccess) { auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto constexpr kText = R"pb( metadata: {} stats: { query_plan { plan_nodes: { index: 42 } } } @@ -1976,9 +1854,6 @@ TEST(ConnectionImplTest, AnalyzeSqlSuccess) { EXPECT_CALL(*mock, ExecuteSql) .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) .WillOnce(Return(ByMove(std::move(response)))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -2002,11 +1877,6 @@ TEST(ConnectionImplTest, AnalyzeSqlCreateSessionFailure) { EXPECT_CALL(*mock, CreateSession(_, _, HasDatabase(db))) .WillRepeatedly(Return( Status(StatusCode::kPermissionDenied, "uh-oh in CreateSession"))); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kPermissionDenied, - "uh-oh in BatchCreateSessions"))); - EXPECT_CALL(*mock, AsyncDeleteSession).Times(0); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -2015,7 +1885,7 @@ TEST(ConnectionImplTest, AnalyzeSqlCreateSessionFailure) { auto result = conn->AnalyzeSql({txn, spanner::SqlStatement("DELETE * FROM Table")}); EXPECT_THAT(result, StatusIs(StatusCode::kPermissionDenied, - HasSubstr("uh-oh in BatchCreateSessions"))); + HasSubstr("uh-oh in CreateSession"))); } TEST(ConnectionImplTest, AnalyzeSqlDeletePermanentFailure) { @@ -2024,16 +1894,13 @@ TEST(ConnectionImplTest, AnalyzeSqlDeletePermanentFailure) { "placeholder_database_id"); { InSequence seq; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); Status status(StatusCode::kPermissionDenied, "uh-oh in ExecuteDml"); EXPECT_CALL(*mock, ExecuteSql).WillOnce(Return(status)); EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return(MakeTestTransaction())); EXPECT_CALL(*mock, ExecuteSql).WillOnce(Return(status)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); } auto conn = MakeConnectionImpl(db, mock); @@ -2052,8 +1919,8 @@ TEST(ConnectionImplTest, AnalyzeSqlDeleteTooManyTransientFailures) { "placeholder_database_id"); { InSequence seq; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); Status status(StatusCode::kUnavailable, "try-again in ExecuteDml"); EXPECT_CALL(*mock, ExecuteSql) .Times(AtLeast(2)) @@ -2063,9 +1930,6 @@ TEST(ConnectionImplTest, AnalyzeSqlDeleteTooManyTransientFailures) { EXPECT_CALL(*mock, ExecuteSql) .Times(AtLeast(2)) .WillRepeatedly(Return(status)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); } auto conn = MakeConnectionImpl(db, mock); @@ -2082,8 +1946,8 @@ TEST(ConnectionImplTest, ExecuteBatchDmlSuccess) { auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); auto mock = std::make_shared(); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto constexpr kText = R"pb( result_sets: { metadata: { transaction: { id: "1234567890" } } @@ -2101,9 +1965,6 @@ TEST(ConnectionImplTest, ExecuteBatchDmlSuccess) { HasPriority(google::spanner::v1::RequestOptions::PRIORITY_MEDIUM))) .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) .WillOnce(Return(response)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto request = { spanner::SqlStatement("UPDATE ..."), @@ -2127,7 +1988,7 @@ TEST(ConnectionImplTest, ExecuteBatchDmlSuccess) { EXPECT_EQ(result->stats[1].row_count, 1); EXPECT_EQ(result->stats[2].row_count, 2); EXPECT_THAT( - txn, HasSessionAndTransaction("session-name", "1234567890", true, "tag")); + txn, HasSessionAndTransaction("multiplexed", "1234567890", true, "tag")); } TEST(ConnectionImplTest, MultiplexedExecuteBatchDmlSuccess) { @@ -2173,8 +2034,7 @@ TEST(ConnectionImplTest, MultiplexedExecuteBatchDmlSuccess) { spanner::SqlStatement("UPDATE ..."), }; - auto options = Options{}.set({}); - auto conn = MakeConnectionImpl(db, mock, options); + auto conn = MakeConnectionImpl(db, mock, Options{}); internal::OptionsSpan span(MakeLimitedTimeOptions()); auto txn = spanner::MakeReadWriteTransaction( spanner::Transaction::ReadWriteOptions().WithTag("tag")); @@ -2199,8 +2059,8 @@ TEST(ConnectionImplTest, ExecuteBatchDmlPartialFailure) { auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); auto mock = std::make_shared(); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto constexpr kText = R"pb( result_sets: { metadata: { transaction: { id: "1234567890" } } @@ -2212,9 +2072,6 @@ TEST(ConnectionImplTest, ExecuteBatchDmlPartialFailure) { google::spanner::v1::ExecuteBatchDmlResponse response; ASSERT_TRUE(TextFormat::ParseFromString(kText, &response)); EXPECT_CALL(*mock, ExecuteBatchDml).WillOnce(Return(response)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto request = { spanner::SqlStatement("UPDATE ..."), @@ -2234,7 +2091,7 @@ TEST(ConnectionImplTest, ExecuteBatchDmlPartialFailure) { EXPECT_EQ(result->stats[0].row_count, 42); EXPECT_EQ(result->stats[1].row_count, 43); EXPECT_THAT( - txn, HasSessionAndTransaction("session-name", "1234567890", true, "tag")); + txn, HasSessionAndTransaction("multiplexed", "1234567890", true, "tag")); } TEST(ConnectionImplTest, ExecuteBatchDmlPermanentFailure) { @@ -2243,17 +2100,14 @@ TEST(ConnectionImplTest, ExecuteBatchDmlPermanentFailure) { auto mock = std::make_shared(); { InSequence seq; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); Status status(StatusCode::kPermissionDenied, "uh-oh in ExecuteBatchDml"); EXPECT_CALL(*mock, ExecuteBatchDml).WillOnce(Return(status)); EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return(MakeTestTransaction())); EXPECT_CALL(*mock, ExecuteBatchDml).WillOnce(Return(status)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); } auto request = { @@ -2276,8 +2130,8 @@ TEST(ConnectionImplTest, ExecuteBatchDmlTooManyTransientFailures) { auto mock = std::make_shared(); { InSequence seq; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); Status status(StatusCode::kUnavailable, "try-again in ExecuteBatchDml"); EXPECT_CALL(*mock, ExecuteBatchDml) @@ -2288,10 +2142,6 @@ TEST(ConnectionImplTest, ExecuteBatchDmlTooManyTransientFailures) { EXPECT_CALL(*mock, ExecuteBatchDml) .Times(AtLeast(2)) .WillRepeatedly(Return(status)); - - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); } auto request = { @@ -2314,8 +2164,8 @@ TEST(ConnectionImplTest, ExecuteBatchDmlNoResultSets) { auto mock = std::make_shared(); { InSequence seq; - EXPECT_CALL(*mock, BatchCreateSessions) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); // The `ExecuteBatchDml` call can succeed, but with no `ResultSet`s and an // error status in the response. auto constexpr kText = R"pb( @@ -2324,18 +2174,15 @@ TEST(ConnectionImplTest, ExecuteBatchDmlNoResultSets) { google::spanner::v1::ExecuteBatchDmlResponse response; ASSERT_TRUE(TextFormat::ParseFromString(kText, &response)); EXPECT_CALL(*mock, ExecuteBatchDml(_, _, - AllOf(HasSession("session-name"), + AllOf(HasSession("multiplexed"), HasBeginTransaction()))) .WillOnce(Return(response)); EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return(MakeTestTransaction("BD000001"))); EXPECT_CALL(*mock, ExecuteBatchDml(_, _, - AllOf(HasSession("session-name"), + AllOf(HasSession("multiplexed"), HasTransactionId("BD000001")))) .WillOnce(Return(response)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); } auto request = {spanner::SqlStatement("UPDATE ...")}; @@ -2353,8 +2200,8 @@ TEST(ConnectionImplTest, ExecutePartitionedDmlDeleteSuccess) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) .WillOnce( @@ -2375,9 +2222,6 @@ TEST(ConnectionImplTest, ExecutePartitionedDmlDeleteSuccess) { {}, internal::UnavailableError("try-again in ExecutePartitionedDml"))))) .WillOnce(Return(ByMove(MakeReader({kTextResponse})))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -2392,8 +2236,8 @@ TEST(ConnectionImplTest, ExecutePartitionedDmlExcludeFromChangeStreams) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction) .WillOnce( [](grpc::ClientContext&, Options const&, @@ -2410,9 +2254,6 @@ TEST(ConnectionImplTest, ExecutePartitionedDmlExcludeFromChangeStreams) { ExecuteStreamingSql( _, _, AllOf(HasRequestTag("tag"), HasTransactionTag("")))) .WillOnce(Return(ByMove(MakeReader({kTextResponse})))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span( @@ -2432,26 +2273,21 @@ TEST(ConnectionImplTest, ExecutePartitionedDmlCreateSessionFailure) { EXPECT_CALL(*mock, CreateSession(_, _, HasDatabase(db))) .WillRepeatedly(Return( Status(StatusCode::kPermissionDenied, "uh-oh in CreateSession"))); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kPermissionDenied, - "uh-oh in BatchCreateSessions"))); - EXPECT_CALL(*mock, AsyncDeleteSession).Times(0); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); auto result = conn->ExecutePartitionedDml( {spanner::SqlStatement("DELETE * FROM Table")}); EXPECT_THAT(result, StatusIs(StatusCode::kPermissionDenied, - HasSubstr("uh-oh in BatchCreateSessions"))); + HasSubstr("uh-oh in CreateSession"))); } TEST(ConnectionImplTest, ExecutePartitionedDmlDeletePermanentFailure) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) .WillOnce(Return(MakeTestTransaction())); @@ -2462,10 +2298,6 @@ TEST(ConnectionImplTest, ExecutePartitionedDmlDeletePermanentFailure) { .WillOnce(Return(ByMove(MakeReader( {}, internal::InternalError("permanent failure"))))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); - auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); auto result = conn->ExecutePartitionedDml( @@ -2478,8 +2310,8 @@ TEST(ConnectionImplTest, ExecutePartitionedDmlDeleteTooManyTransientFailures) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) .WillOnce(Return(MakeTestTransaction())); @@ -2491,9 +2323,6 @@ TEST(ConnectionImplTest, ExecutePartitionedDmlDeleteTooManyTransientFailures) { {}, internal::UnavailableError("try-again in ExecutePartitionedDml")); }); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -2508,8 +2337,8 @@ TEST(ConnectionImplTest, ExecutePartitionedDmlRetryableInternalErrors) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return(MakeTestTransaction("2345678901"))); @@ -2529,10 +2358,6 @@ TEST(ConnectionImplTest, ExecutePartitionedDmlRetryableInternalErrors) { "HTTP/2 error code: INTERNAL_ERROR\nReceived Rst Stream"))))) .WillOnce(Return(ByMove(MakeReader({kTextResponse})))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); - auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); auto result = conn->ExecutePartitionedDml( @@ -2546,14 +2371,11 @@ TEST(ConnectionImplTest, auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return(Status(StatusCode::kPermissionDenied, "uh-oh in ExecutePartitionedDml"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -2568,15 +2390,12 @@ TEST(ConnectionImplTest, auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction) .Times(AtLeast(2)) .WillRepeatedly(Return(Status(StatusCode::kUnavailable, "try-again in ExecutePartitionedDml"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -2594,56 +2413,47 @@ TEST(ConnectionImplTest, CommitCreateSessionPermanentFailure) { EXPECT_CALL(*mock, CreateSession(_, _, HasDatabase(db))) .WillRepeatedly(Return( Status(StatusCode::kPermissionDenied, "uh-oh in CreateSession"))); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kPermissionDenied, - "uh-oh in BatchCreateSessions"))); EXPECT_CALL(*mock, AsyncDeleteSession).Times(0); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); auto commit = conn->Commit({spanner::MakeReadWriteTransaction()}); EXPECT_THAT(commit, StatusIs(StatusCode::kPermissionDenied, - HasSubstr("uh-oh in BatchCreateSessions"))); + HasSubstr("uh-oh in CreateSession"))); } TEST(ConnectionImplTest, CommitCreateSessionTooManyTransientFailures) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kUnavailable, - "try-again in BatchCreateSessions"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); + .WillRepeatedly(Return( + Status(StatusCode::kUnavailable, "try-again in CreateSession"))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); auto commit = conn->Commit({spanner::MakeReadWriteTransaction()}); EXPECT_THAT(commit, StatusIs(StatusCode::kUnavailable, - HasSubstr("try-again in BatchCreateSessions"))); + HasSubstr("try-again in CreateSession"))); } TEST(ConnectionImplTest, CommitCreateSessionRetry) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) .WillOnce(Return( - Status(StatusCode::kUnavailable, "try-again in BatchCreateSessions"))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + Status(StatusCode::kUnavailable, "try-again in CreateSession"))) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); + google::spanner::v1::Transaction txn = MakeTestTransaction(); EXPECT_CALL(*mock, BeginTransaction).WillOnce(Return(txn)); EXPECT_CALL(*mock, Commit(_, _, - AllOf(HasSession("test-session-name"), + AllOf(HasSession("multiplexed"), HasNakedTransactionId(txn.id())))) .WillOnce( Return(Status(StatusCode::kPermissionDenied, "uh-oh in Commit"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -2656,8 +2466,8 @@ TEST(ConnectionImplTest, CommitBeginTransactionRetry) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); google::spanner::v1::Transaction txn = MakeTestTransaction(); EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) @@ -2666,12 +2476,9 @@ TEST(ConnectionImplTest, CommitBeginTransactionRetry) { spanner::MakeTimestamp(std::chrono::system_clock::from_time_t(123)) .value(); EXPECT_CALL(*mock, Commit(_, _, - AllOf(HasSession("test-session-name"), + AllOf(HasSession("multiplexed"), HasNakedTransactionId(txn.id())))) .WillOnce(Return(MakeCommitResponse(commit_timestamp))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -2684,13 +2491,10 @@ TEST(ConnectionImplTest, CommitBeginTransactionSessionNotFound) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction) - .WillOnce(Return(SessionNotFoundError("test-session-name"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); + .WillOnce(Return(SessionNotFoundError("multiplexed"))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -2706,14 +2510,11 @@ TEST(ConnectionImplTest, CommitBeginTransactionPermanentFailure) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return( Status(StatusCode::kInvalidArgument, "BeginTransaction failed"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -2733,18 +2534,15 @@ TEST(ConnectionImplTest, CommitCommitPermanentFailure) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); google::spanner::v1::Transaction txn = MakeTestTransaction(); EXPECT_CALL(*mock, BeginTransaction).WillOnce(Return(txn)); EXPECT_CALL(*mock, Commit(_, _, - AllOf(HasSession("test-session-name"), + AllOf(HasSession("multiplexed"), HasNakedTransactionId(txn.id())))) .WillOnce( Return(Status(StatusCode::kPermissionDenied, "uh-oh in Commit"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -2757,18 +2555,15 @@ TEST(ConnectionImplTest, CommitCommitTooManyTransientFailures) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); google::spanner::v1::Transaction txn = MakeTestTransaction(); EXPECT_CALL(*mock, BeginTransaction).WillOnce(Return(txn)); EXPECT_CALL(*mock, Commit(_, _, - AllOf(HasSession("test-session-name"), + AllOf(HasSession("multiplexed"), HasNakedTransactionId(txn.id())))) .WillOnce( Return(Status(StatusCode::kPermissionDenied, "uh-oh in Commit"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -2781,13 +2576,10 @@ TEST(ConnectionImplTest, CommitCommitInvalidatedTransaction) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction).Times(0); EXPECT_CALL(*mock, Commit).Times(0); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -2806,19 +2598,16 @@ TEST(ConnectionImplTest, CommitCommitIdempotentTransientSuccess) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto const commit_timestamp = spanner::MakeTimestamp(std::chrono::system_clock::from_time_t(123)) .value(); EXPECT_CALL(*mock, Commit(_, _, - AllOf(HasSession("test-session-name"), + AllOf(HasSession("multiplexed"), HasNakedTransactionId("test-txn-id")))) .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) .WillOnce(Return(MakeCommitResponse(commit_timestamp))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -2836,21 +2625,18 @@ TEST(ConnectionImplTest, CommitSuccessWithTransactionId) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL( *mock, - Commit(_, _, - AllOf(HasSession("test-session-name"), - HasNakedTransactionId("test-txn-id"), - HasPriority( - google::spanner::v1::RequestOptions::PRIORITY_HIGH)))) + Commit( + _, _, + AllOf( + HasSession("multiplexed"), HasNakedTransactionId("test-txn-id"), + HasPriority(google::spanner::v1::RequestOptions::PRIORITY_HIGH)))) .WillOnce(Return(MakeCommitResponse( spanner::MakeTimestamp(std::chrono::system_clock::from_time_t(123)) .value()))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -2870,8 +2656,8 @@ TEST(ConnectionImplTest, CommitSuccessWithStats) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction) .WillOnce( [](grpc::ClientContext&, Options const&, @@ -2881,16 +2667,13 @@ TEST(ConnectionImplTest, CommitSuccessWithStats) { EXPECT_FALSE(request.has_mutation_key()); return MakeTestTransaction(); }); - EXPECT_CALL(*mock, Commit(_, _, - AllOf(HasSession("test-session-name"), - HasReturnStats(true)))) + EXPECT_CALL( + *mock, + Commit(_, _, AllOf(HasSession("multiplexed"), HasReturnStats(true)))) .WillOnce(Return(MakeCommitResponse( spanner::MakeTimestamp(std::chrono::system_clock::from_time_t(123)) .value(), spanner::CommitStats{42}))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -2948,8 +2731,7 @@ TEST(ConnectionImplTest, MutationCommitSuccess) { commit_timestamp, spanner::CommitStats{request.mutations_size()}); }); - auto options = Options{}.set({}); - auto conn = MakeConnectionImpl(db, mock, options); + auto conn = MakeConnectionImpl(db, mock, Options{}); internal::OptionsSpan span(MakeLimitedTimeOptions()); auto commit = conn->Commit({spanner::MakeReadWriteTransaction(), mutations, spanner::CommitOptions{}.set_return_stats(true)}); @@ -3019,8 +2801,7 @@ TEST(ConnectionImplTest, MutationCommitRetryOnceSuccess) { commit_timestamp, spanner::CommitStats{original_mutations_size}); }); - auto options = Options{}.set({}); - auto conn = MakeConnectionImpl(db, mock, options); + auto conn = MakeConnectionImpl(db, mock, Options{}); internal::OptionsSpan span(MakeLimitedTimeOptions()); auto commit = conn->Commit({spanner::MakeReadWriteTransaction(), mutations, spanner::CommitOptions{}.set_return_stats(true)}); @@ -3104,8 +2885,7 @@ TEST(ConnectionImplTest, MutationCommitRetryMoreThanOnceSuccess) { commit_timestamp, spanner::CommitStats{original_mutations_size}); }); - auto options = Options{}.set({}); - auto conn = MakeConnectionImpl(db, mock, options); + auto conn = MakeConnectionImpl(db, mock, Options{}); internal::OptionsSpan span(MakeLimitedTimeOptions()); auto commit = conn->Commit({spanner::MakeReadWriteTransaction(), mutations, spanner::CommitOptions{}.set_return_stats(true)}); @@ -3188,8 +2968,7 @@ TEST(ConnectionImplTest, MultiplexedPrecommitUpdated) { }); } - auto options = Options{}.set({}); - auto conn = MakeConnectionImpl(db, mock, options); + auto conn = MakeConnectionImpl(db, mock, Options{}); internal::OptionsSpan span(MakeLimitedTimeOptions()); spanner::Transaction txn = MakeReadWriteTransaction(spanner::Transaction::ReadWriteOptions()); @@ -3207,8 +2986,8 @@ TEST(ConnectionImplTest, CommitSuccessExcludeFromChangeStreams) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction) .WillOnce( [](grpc::ClientContext&, Options const&, @@ -3217,13 +2996,10 @@ TEST(ConnectionImplTest, CommitSuccessExcludeFromChangeStreams) { EXPECT_TRUE(request.options().exclude_txn_from_change_streams()); return MakeTestTransaction(); }); - EXPECT_CALL(*mock, Commit(_, _, HasSession("test-session-name"))) + EXPECT_CALL(*mock, Commit(_, _, HasSession("multiplexed"))) .WillOnce(Return(MakeCommitResponse( spanner::MakeTimestamp(std::chrono::system_clock::from_time_t(123)) .value()))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span( @@ -3241,20 +3017,17 @@ TEST(ConnectionImplTest, CommitSuccessWithMaxCommitDelay) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); google::spanner::v1::Transaction txn = MakeTestTransaction(); EXPECT_CALL(*mock, BeginTransaction).WillOnce(Return(txn)); EXPECT_CALL(*mock, Commit(_, _, - AllOf(HasSession("test-session-name"), + AllOf(HasSession("multiplexed"), HasMaxCommitDelay(std::chrono::milliseconds(100))))) .WillOnce(Return(MakeCommitResponse( spanner::MakeTimestamp(std::chrono::system_clock::from_time_t(123)) .value()))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -3269,21 +3042,18 @@ TEST(ConnectionImplTest, CommitSuccessWithCompression) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); google::spanner::v1::Transaction txn = MakeTestTransaction(); EXPECT_CALL(*mock, BeginTransaction).WillOnce(Return(txn)); EXPECT_CALL(*mock, Commit(HasCompressionAlgorithm(GRPC_COMPRESS_GZIP), _, - HasSession("test-session-name"))) + HasSession("multiplexed"))) .WillOnce([](grpc::ClientContext&, Options const&, google::spanner::v1::CommitRequest const&) { return MakeCommitResponse( spanner::MakeTimestamp(std::chrono::system_clock::from_time_t(123)) .value()); }); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span( @@ -3301,8 +3071,8 @@ TEST(ConnectionImplTest, CommitAtLeastOnce) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction).Times(0); // The whole point! auto const commit_timestamp = spanner::MakeTimestamp(std::chrono::system_clock::from_time_t(123)) @@ -3311,7 +3081,7 @@ TEST(ConnectionImplTest, CommitAtLeastOnce) { .WillOnce([commit_timestamp]( grpc::ClientContext&, Options const&, google::spanner::v1::CommitRequest const& request) { - EXPECT_EQ("test-session-name", request.session()); + EXPECT_EQ("multiplexed", request.session()); EXPECT_TRUE(request.has_single_use_transaction()); EXPECT_EQ(0, request.mutations_size()); EXPECT_FALSE(request.return_commit_stats()); @@ -3321,9 +3091,6 @@ TEST(ConnectionImplTest, CommitAtLeastOnce) { EXPECT_THAT(request.request_options().transaction_tag(), IsEmpty()); return MakeCommitResponse(commit_timestamp); }); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -3338,13 +3105,13 @@ TEST(ConnectionImplTest, CommitAtLeastOnceBatched) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); using BatchWriteRequest = google::spanner::v1::BatchWriteRequest; EXPECT_CALL(*mock, BatchWrite) .WillOnce([](std::shared_ptr const&, Options const&, BatchWriteRequest const& request) { - EXPECT_EQ("test-session-name", request.session()); + EXPECT_EQ("multiplexed", request.session()); EXPECT_EQ(google::spanner::v1::RequestOptions::PRIORITY_UNSPECIFIED, request.request_options().priority()); EXPECT_THAT(request.request_options().request_tag(), IsEmpty()); @@ -3359,7 +3126,7 @@ TEST(ConnectionImplTest, CommitAtLeastOnceBatched) { }) .WillOnce([&](std::shared_ptr const&, Options const&, BatchWriteRequest const& request) { - EXPECT_EQ("test-session-name", request.session()); + EXPECT_EQ("multiplexed", request.session()); EXPECT_EQ(google::spanner::v1::RequestOptions::PRIORITY_UNSPECIFIED, request.request_options().priority()); EXPECT_THAT(request.request_options().request_tag(), IsEmpty()); @@ -3378,9 +3145,6 @@ TEST(ConnectionImplTest, CommitAtLeastOnceBatched) { commit_timestamp { seconds: 123 } )pb"}); }); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -3396,75 +3160,17 @@ TEST(ConnectionImplTest, CommitAtLeastOnceBatched) { EXPECT_EQ(++it, commit_results.end()); } -TEST(ConnectionImplTest, CommitAtLeastOnceBatchedSessionNotFound) { - auto mock = std::make_shared>(); - auto db = spanner::Database("placeholder_project", "placeholder_instance", - "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name-1"}))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name-2"}))); - using BatchWriteRequest = google::spanner::v1::BatchWriteRequest; - EXPECT_CALL(*mock, BatchWrite) - .WillOnce([](std::shared_ptr const&, Options const&, - BatchWriteRequest const& request) { - EXPECT_EQ("test-session-name-1", request.session()); - EXPECT_THAT(request.mutation_groups(), IsEmpty()); - EXPECT_FALSE(request.exclude_txn_from_change_streams()); - return MakeReader( - {}, SessionNotFoundError(request.session())); - }) - .WillOnce([&](std::shared_ptr const&, Options const&, - BatchWriteRequest const& request) { - EXPECT_EQ("test-session-name-2", request.session()); - EXPECT_THAT(request.mutation_groups(), IsEmpty()); - EXPECT_FALSE(request.exclude_txn_from_change_streams()); - return MakeReader( - {R"pb(status {} - commit_timestamp { seconds: 123 })pb"}); - }); - EXPECT_CALL( - *mock, AsyncDeleteSession(_, _, _, HasSessionName("test-session-name-2"))) - .WillOnce(Return(make_ready_future(Status{}))); - - auto conn = MakeConnectionImpl(db, mock); - internal::OptionsSpan span(MakeLimitedTimeOptions()); - { - auto commit_results = conn->BatchWrite({{}, Options{}}); - auto it = commit_results.begin(); - ASSERT_NE(it, commit_results.end()); - EXPECT_THAT(*it, Not(IsOk())); - EXPECT_TRUE(IsSessionNotFound(it->status())) << it->status(); - EXPECT_EQ(++it, commit_results.end()); - } - - // "test-session-name-1" should not have been returned to the pool. - // The best (only?) way to verify this is to make another write and - // check that another session was allocated (hence the strict mock). - { - auto commit_results = conn->BatchWrite({{}, Options{}}); - auto it = commit_results.begin(); - ASSERT_NE(it, commit_results.end()); - EXPECT_THAT( - *it, - IsOkAndHolds(AllOf( - Field(&spanner::BatchedCommitResult::indexes, IsEmpty()), - Field(&spanner::BatchedCommitResult::commit_timestamp, - Eq(spanner::MakeTimestamp(absl::FromUnixSeconds(123))))))); - EXPECT_EQ(++it, commit_results.end()); - } -} - TEST(ConnectionImplTest, CommitAtLeastOnceBatchedExcludeFromChangeStreams) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); using BatchWriteRequest = google::spanner::v1::BatchWriteRequest; EXPECT_CALL(*mock, BatchWrite) .WillOnce([&](std::shared_ptr const&, Options const&, BatchWriteRequest const& request) { - EXPECT_EQ("test-session-name", request.session()); + EXPECT_EQ("multiplexed", request.session()); EXPECT_EQ(google::spanner::v1::RequestOptions::PRIORITY_UNSPECIFIED, request.request_options().priority()); EXPECT_THAT(request.request_options().request_tag(), IsEmpty()); @@ -3483,9 +3189,6 @@ TEST(ConnectionImplTest, CommitAtLeastOnceBatchedExcludeFromChangeStreams) { commit_timestamp { seconds: 123 } )pb"}); }); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span( @@ -3506,13 +3209,9 @@ TEST(ConnectionImplTest, CommitAtLeastOnceBatchedExcludeFromChangeStreams) { TEST(ConnectionImplTest, RollbackCreateSessionFailure) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, CreateSession(_, _, HasDatabase(db))) + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) .WillRepeatedly(Return( Status(StatusCode::kPermissionDenied, "uh-oh in CreateSession"))); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .Times(AtLeast(2)) - .WillRepeatedly(Return(Status(StatusCode::kPermissionDenied, - "uh-oh in BatchCreateSessions"))); EXPECT_CALL(*mock, Rollback).Times(0); EXPECT_CALL(*mock, AsyncDeleteSession).Times(0); @@ -3522,15 +3221,15 @@ TEST(ConnectionImplTest, RollbackCreateSessionFailure) { SetTransactionId(txn, "test-txn-id"); auto rollback = conn->Rollback({txn}); EXPECT_THAT(rollback, StatusIs(StatusCode::kPermissionDenied, - HasSubstr("uh-oh in BatchCreateSessions"))); + HasSubstr("uh-oh in CreateSession"))); } TEST(ConnectionImplTest, RollbackBeginTransaction) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - std::string const session_name = "test-session-name"; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({session_name}))); + std::string const session_name = "multiplexed"; + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); std::string const transaction_id = "RollbackBeginTransaction"; EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return(MakeTestTransaction(transaction_id))); @@ -3538,9 +3237,6 @@ TEST(ConnectionImplTest, RollbackBeginTransaction) { AllOf(HasSession(session_name), HasNakedTransactionId(transaction_id)))) .WillOnce(Return(Status())); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -3552,12 +3248,9 @@ TEST(ConnectionImplTest, RollbackBeginTransaction) { TEST(ConnectionImplTest, RollbackSingleUseTransaction) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, Rollback).Times(0); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -3572,18 +3265,15 @@ TEST(ConnectionImplTest, RollbackSingleUseTransaction) { TEST(ConnectionImplTest, RollbackPermanentFailure) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - std::string const session_name = "test-session-name"; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({session_name}))); + std::string const session_name = "multiplexed"; + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); std::string const transaction_id = "test-txn-id"; EXPECT_CALL(*mock, Rollback(_, _, - AllOf(HasSession(session_name), + AllOf(HasSession("multiplexed"), HasNakedTransactionId(transaction_id)))) .WillOnce( Return(Status(StatusCode::kPermissionDenied, "uh-oh in Rollback"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -3597,9 +3287,9 @@ TEST(ConnectionImplTest, RollbackPermanentFailure) { TEST(ConnectionImplTest, RollbackTooManyTransientFailures) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - std::string const session_name = "test-session-name"; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({session_name}))); + std::string const session_name = "multiplexed"; + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); std::string const transaction_id = "test-txn-id"; EXPECT_CALL(*mock, Rollback(_, _, AllOf(HasSession(session_name), @@ -3607,9 +3297,6 @@ TEST(ConnectionImplTest, RollbackTooManyTransientFailures) { .Times(AtLeast(2)) .WillRepeatedly( Return(Status(StatusCode::kUnavailable, "try-again in Rollback"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -3623,18 +3310,15 @@ TEST(ConnectionImplTest, RollbackTooManyTransientFailures) { TEST(ConnectionImplTest, RollbackSuccess) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - std::string const session_name = "test-session-name"; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({session_name}))); + std::string const session_name = "multiplexed"; + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); std::string const transaction_id = "test-txn-id"; EXPECT_CALL(*mock, Rollback(_, _, - AllOf(HasSession(session_name), + AllOf(HasSession("multiplexed"), HasNakedTransactionId(transaction_id)))) .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) .WillOnce(Return(Status())); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -3648,12 +3332,9 @@ TEST(ConnectionImplTest, RollbackInvalidatedTransaction) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, Rollback).Times(0); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -3673,22 +3354,19 @@ TEST(ConnectionImplTest, ReadPartition) { auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction).Times(0); EXPECT_CALL(*mock, StreamingRead) .WillOnce([](std::shared_ptr const&, Options const&, google::spanner::v1::ReadRequest const& request) { - EXPECT_EQ("test-session-name", request.session()); + EXPECT_EQ("multiplexed", request.session()); EXPECT_EQ("Table", request.table()); EXPECT_EQ("DEADBEEF", request.partition_token()); EXPECT_TRUE(request.data_boost_enabled()); return MakeReader( {R"pb(metadata: { transaction: { id: "ABCDEF00" } })pb"}); }); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -3706,8 +3384,8 @@ TEST(ConnectionImplTest, PartitionReadSuccess) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto constexpr kTextPartitionResponse = R"pb( partitions: { partition_token: "BADDECAF" } partitions: { partition_token: "DEADBEEF" } @@ -3718,7 +3396,7 @@ TEST(ConnectionImplTest, PartitionReadSuccess) { TextFormat::ParseFromString(kTextPartitionResponse, &partition_response)); auto constexpr kTextPartitionRequest = R"pb( - session: "test-session-name" + session: "multiplexed" transaction: { begin { read_only { strong: true return_read_timestamp: true } } } @@ -3737,10 +3415,6 @@ TEST(ConnectionImplTest, PartitionReadSuccess) { .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) .WillOnce(Return(partition_response)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); - auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); spanner::Transaction txn = @@ -3758,16 +3432,16 @@ TEST(ConnectionImplTest, PartitionReadSuccess) { read_options}, {absl::nullopt, absl::nullopt, data_boost}}); ASSERT_STATUS_OK(result); - EXPECT_THAT(txn, HasSessionAndTransaction("test-session-name", "CAFEDEAD", - false, "")); + EXPECT_THAT(txn, + HasSessionAndTransaction("multiplexed", "CAFEDEAD", false, "")); std::vector expected_read_partitions = { spanner_internal::MakeReadPartition( - "CAFEDEAD", false, "", "test-session-name", "BADDECAF", "table", + "CAFEDEAD", false, "", "multiplexed", "BADDECAF", "table", spanner::KeySet::All(), {"UserId", "UserName"}, data_boost, read_options), spanner_internal::MakeReadPartition( - "CAFEDEAD", false, "", "test-session-name", "DEADBEEF", "table", + "CAFEDEAD", false, "", "multiplexed", "DEADBEEF", "table", spanner::KeySet::All(), {"UserId", "UserName"}, data_boost, read_options)}; @@ -3780,16 +3454,13 @@ TEST(ConnectionImplTest, PartitionReadPermanentFailure) { "placeholder_database_id"); { InSequence seq; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); Status status(StatusCode::kPermissionDenied, "uh-oh"); EXPECT_CALL(*mock, PartitionRead).WillOnce(Return(status)); EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return(MakeTestTransaction())); EXPECT_CALL(*mock, PartitionRead).WillOnce(Return(status)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); } auto conn = MakeConnectionImpl(db, mock); @@ -3809,8 +3480,8 @@ TEST(ConnectionImplTest, PartitionReadTooManyTransientFailures) { "placeholder_database_id"); { InSequence seq; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); Status status(StatusCode::kUnavailable, "try-again"); EXPECT_CALL(*mock, PartitionRead) .Times(AtLeast(2)) @@ -3820,9 +3491,6 @@ TEST(ConnectionImplTest, PartitionReadTooManyTransientFailures) { EXPECT_CALL(*mock, PartitionRead) .Times(AtLeast(2)) .WillRepeatedly(Return(status)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); } auto conn = MakeConnectionImpl(db, mock); @@ -3841,22 +3509,19 @@ TEST(ConnectionImplTest, QueryPartition) { auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction).Times(0); EXPECT_CALL(*mock, ExecuteStreamingSql) .WillOnce([](std::shared_ptr const&, Options const&, google::spanner::v1::ExecuteSqlRequest const& request) { - EXPECT_EQ("test-session-name", request.session()); + EXPECT_EQ("multiplexed", request.session()); EXPECT_EQ("SELECT * FROM Table", request.sql()); EXPECT_EQ("DEADBEEF", request.partition_token()); EXPECT_TRUE(request.data_boost_enabled()); return MakeReader( {R"pb(metadata: { transaction: { id: "ABCDEF00" } })pb"}); }); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -3872,8 +3537,8 @@ TEST(ConnectionImplTest, PartitionQuerySuccess) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto constexpr kTextPartitionResponse = R"pb( partitions: { partition_token: "BADDECAF" } partitions: { partition_token: "DEADBEEF" } @@ -3884,7 +3549,7 @@ TEST(ConnectionImplTest, PartitionQuerySuccess) { TextFormat::ParseFromString(kTextPartitionResponse, &partition_response)); auto constexpr kTextPartitionRequest = R"pb( - session: "test-session-name" + session: "multiplexed" transaction: { begin { read_only { strong: true return_read_timestamp: true } } } @@ -3899,10 +3564,6 @@ TEST(ConnectionImplTest, PartitionQuerySuccess) { .WillOnce(Return(Status(StatusCode::kUnavailable, "try-again"))) .WillOnce(Return(partition_response)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); - auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); spanner::SqlStatement sql_statement("SELECT * FROM Table"); @@ -3914,12 +3575,12 @@ TEST(ConnectionImplTest, PartitionQuerySuccess) { ASSERT_STATUS_OK(result); std::vector expected_query_partitions = { - spanner_internal::MakeQueryPartition("CAFEDEAD", false, "", - "test-session-name", "BADDECAF", - data_boost, sql_statement), - spanner_internal::MakeQueryPartition("CAFEDEAD", false, "", - "test-session-name", "DEADBEEF", - data_boost, sql_statement)}; + spanner_internal::MakeQueryPartition("CAFEDEAD", false, "", "multiplexed", + "BADDECAF", data_boost, + sql_statement), + spanner_internal::MakeQueryPartition("CAFEDEAD", false, "", "multiplexed", + "DEADBEEF", data_boost, + sql_statement)}; EXPECT_THAT(*result, UnorderedPointwise(Eq(), expected_query_partitions)); } @@ -3931,15 +3592,12 @@ TEST(ConnectionImplTest, PartitionQueryPermanentFailure) { Status failed_status = Status(StatusCode::kPermissionDenied, "End of line."); { InSequence seq; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, PartitionQuery).WillOnce(Return(failed_status)); EXPECT_CALL(*mock, BeginTransaction) .WillOnce(Return(MakeTestTransaction())); EXPECT_CALL(*mock, PartitionQuery).WillOnce(Return(failed_status)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); } auto conn = MakeConnectionImpl(db, mock); @@ -3960,8 +3618,8 @@ TEST(ConnectionImplTest, PartitionQueryTooManyTransientFailures) { Status(StatusCode::kUnavailable, "try-again in PartitionQuery"); { InSequence seq; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, PartitionQuery) .Times(AtLeast(2)) .WillRepeatedly(Return(failed_status)); @@ -3970,9 +3628,6 @@ TEST(ConnectionImplTest, PartitionQueryTooManyTransientFailures) { EXPECT_CALL(*mock, PartitionQuery) .Times(AtLeast(2)) .WillRepeatedly(Return(failed_status)); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); } auto conn = MakeConnectionImpl(db, mock); @@ -3990,36 +3645,15 @@ TEST(ConnectionImplTest, MultipleThreads) { auto db = spanner::Database("project", "instance", "database"); std::string const session_prefix = "test-session-prefix-"; std::string const role = "TestRole"; - std::atomic session_counter(0); - EXPECT_CALL(*mock, BatchCreateSessions( - _, _, AllOf(HasDatabase(db), HasCreatorRole(role)))) - .WillRepeatedly( - [&session_prefix, &session_counter]( - grpc::ClientContext&, Options const&, - google::spanner::v1::BatchCreateSessionsRequest const& request) { - google::spanner::v1::BatchCreateSessionsResponse response; - for (int i = 0; i < request.session_count(); ++i) { - response.add_session()->set_name( - session_prefix + std::to_string(++session_counter)); - } - return response; - }); + EXPECT_CALL(*mock, CreateSession(_, _, AllOf(IsMultiplexed()))) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, Rollback) .WillRepeatedly([session_prefix]( grpc::ClientContext&, Options const&, google::spanner::v1::RollbackRequest const& request) { - EXPECT_THAT(request.session(), StartsWith(session_prefix)); + EXPECT_THAT(request.session(), Eq("multiplexed")); return Status(); }); - EXPECT_CALL(*mock, AsyncDeleteSession) - .WillRepeatedly( - [session_prefix]( - CompletionQueue&, std::shared_ptr const&, - internal::ImmutableOptions const&, - google::spanner::v1::DeleteSessionRequest const& request) { - EXPECT_THAT(request.name(), StartsWith(session_prefix)); - return make_ready_future(Status{}); - }); int const per_thread_iterations = 1000; auto const thread_count = []() -> unsigned { @@ -4052,118 +3686,6 @@ TEST(ConnectionImplTest, MultipleThreads) { } } -/** - * @test Verify Transactions remain bound to a single Session. - * - * This test makes interleaved Read() calls using two separate Transactions, - * and ensures each Transaction uses the same session consistently. - */ -TEST(ConnectionImplTest, TransactionSessionBinding) { - auto mock = std::make_shared(); - auto db = spanner::Database("placeholder_project", "placeholder_instance", - "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"session-1"}))) - .WillOnce(Return(MakeSessionsResponse({"session-2"}))); - - constexpr int kNumResponses = 4; - std::array>, - kNumResponses> - readers; - for (int i = 0; i < kNumResponses; ++i) { - auto constexpr kText = R"pb( - metadata: { - row_type: { - fields: { - name: "Number", - type: { code: INT64 } - } - } - } - )pb"; - PartialResultSet response; - ASSERT_TRUE(TextFormat::ParseFromString(kText, &response)); - // The first two responses are reads from two different "begin" - // transactions. - if (i == 0) { - *response.mutable_metadata()->mutable_transaction() = - MakeTestTransaction("ABCDEF01"); - } else if (i == 1) { - *response.mutable_metadata()->mutable_transaction() = - MakeTestTransaction("ABCDEF02"); - } - response.add_values()->set_string_value(std::to_string(i)); - readers[i] = MakeReader({std::move(response)}); - } - - // Ensure the StreamingRead calls have the expected session and transaction - // IDs or "begin" set as appropriate. - { - InSequence s; - EXPECT_CALL( - *mock, StreamingRead( - _, _, AllOf(HasSession("session-1"), HasBeginTransaction()))) - .WillOnce(Return(ByMove(std::move(readers[0])))); - EXPECT_CALL( - *mock, StreamingRead( - _, _, AllOf(HasSession("session-2"), HasBeginTransaction()))) - .WillOnce(Return(ByMove(std::move(readers[1])))); - EXPECT_CALL(*mock, StreamingRead(_, _, - AllOf(HasSession("session-1"), - HasTransactionId("ABCDEF01")))) - .WillOnce(Return(ByMove(std::move(readers[2])))); - EXPECT_CALL(*mock, StreamingRead(_, _, - AllOf(HasSession("session-2"), - HasTransactionId("ABCDEF02")))) - .WillOnce(Return(ByMove(std::move(readers[3])))); - } - - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, HasSessionName("session-1"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, HasSessionName("session-2"))) - .WillOnce(Return(make_ready_future(Status{}))); - - // Now do the actual reads and verify the results. - auto conn = MakeConnectionImpl(db, mock); - internal::OptionsSpan span(MakeLimitedTimeOptions()); - - spanner::Transaction txn1 = - MakeReadOnlyTransaction(spanner::Transaction::ReadOnlyOptions()); - auto rows = conn->Read({txn1, "table", spanner::KeySet::All(), {"Number"}}); - EXPECT_THAT(txn1, - HasSessionAndTransaction("session-1", "ABCDEF01", false, "")); - for (auto& row : spanner::StreamOf>(rows)) { - ASSERT_STATUS_OK(row); - EXPECT_EQ(std::get<0>(*row), 0); - } - - spanner::Transaction txn2 = - MakeReadOnlyTransaction(spanner::Transaction::ReadOnlyOptions()); - rows = conn->Read({txn2, "table", spanner::KeySet::All(), {"Number"}}); - EXPECT_THAT(txn2, - HasSessionAndTransaction("session-2", "ABCDEF02", false, "")); - for (auto& row : spanner::StreamOf>(rows)) { - ASSERT_STATUS_OK(row); - EXPECT_EQ(std::get<0>(*row), 1); - } - - rows = conn->Read({txn1, "table", spanner::KeySet::All(), {"Number"}}); - EXPECT_THAT(txn1, - HasSessionAndTransaction("session-1", "ABCDEF01", false, "")); - for (auto& row : spanner::StreamOf>(rows)) { - ASSERT_STATUS_OK(row); - EXPECT_EQ(std::get<0>(*row), 2); - } - - rows = conn->Read({txn2, "table", spanner::KeySet::All(), {"Number"}}); - EXPECT_THAT(txn2, - HasSessionAndTransaction("session-2", "ABCDEF02", false, "")); - for (auto& row : spanner::StreamOf>(rows)) { - ASSERT_STATUS_OK(row); - EXPECT_EQ(std::get<0>(*row), 3); - } -} - /** * @test Verify if a `Transaction` outlives the `ConnectionImpl` it was used * with, it does not call back into the deleted `ConnectionImpl` to release @@ -4173,8 +3695,8 @@ TEST(ConnectionImplTest, TransactionOutlivesConnection) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, BeginTransaction).Times(0); auto constexpr kText = R"pb( @@ -4183,13 +3705,6 @@ TEST(ConnectionImplTest, TransactionOutlivesConnection) { EXPECT_CALL(*mock, StreamingRead) .WillOnce(Return(ByMove(MakeReader({kText})))); - // Because the transaction outlives the connection, the session is not in - // the pool when the connection is destroyed, so the session is leaked. - // Only the multiplexed session is deleted. - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); - auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); spanner::Transaction txn = @@ -4197,8 +3712,8 @@ TEST(ConnectionImplTest, TransactionOutlivesConnection) { auto rows = conn->Read( {txn, "table", spanner::KeySet::All(), {"UserId", "UserName"}}); EXPECT_TRUE(ContainsNoRows(rows)); - EXPECT_THAT(txn, HasSessionAndTransaction("test-session-name", "ABCDEF00", - false, "")); + EXPECT_THAT(txn, + HasSessionAndTransaction("multiplexed", "ABCDEF00", false, "")); // `conn` is the only reference to the `ConnectionImpl`, so dropping it will // cause the `ConnectionImpl` object to be deleted, while `txn` and its @@ -4206,85 +3721,13 @@ TEST(ConnectionImplTest, TransactionOutlivesConnection) { conn.reset(); } -TEST(ConnectionImplTest, ReadSessionNotFound) { - auto mock = std::make_shared>(); - auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name-1"}))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name-2"}))); - EXPECT_CALL(*mock, StreamingRead) - .WillOnce([](std::shared_ptr const&, Options const&, - google::spanner::v1::ReadRequest const& request) { - EXPECT_THAT(request.session(), Eq("test-session-name-1")); - EXPECT_THAT(request.transaction().id(), Eq("test-txn-id-1")); - return MakeReader( - {}, SessionNotFoundError(request.session())); - }) - .WillOnce([](std::shared_ptr const&, Options const&, - google::spanner::v1::ReadRequest const& request) { - EXPECT_THAT(request.session(), Eq("test-session-name-2")); - EXPECT_THAT(request.transaction().id(), Eq("test-txn-id-2")); - return MakeReader({ - R"pb( - metadata: { - row_type: { - fields: { - name: "UserId", - type: { code: INT64 } - } - fields: { - name: "UserName", - type: { code: STRING } - } - } - } - )pb"}); - }); - EXPECT_CALL( - *mock, AsyncDeleteSession(_, _, _, HasSessionName("test-session-name-1"))) - .Times(0); - EXPECT_CALL( - *mock, AsyncDeleteSession(_, _, _, HasSessionName("test-session-name-2"))) - .WillOnce(Return(make_ready_future(Status{}))); - - auto conn = MakeConnectionImpl(db, mock); - internal::OptionsSpan span(MakeLimitedRetryOptions()); - { - auto txn = spanner::MakeReadWriteTransaction(); - SetTransactionId(txn, "test-txn-id-1"); - auto params = spanner::Connection::ReadParams{txn}; - auto response = GetSingularRow(conn->Read(std::move(params))); - EXPECT_THAT(response, Not(IsOk())); - auto const& status = response.status(); - EXPECT_TRUE(IsSessionNotFound(status)) << status; - EXPECT_THAT(txn, HasBadSession()); - } - - // "test-session-name-1" should not have been returned to the pool. - // The best (only?) way to verify this is to make another read and - // check that another session was allocated (hence the strict mock). - { - auto txn = spanner::MakeReadWriteTransaction(); - SetTransactionId(txn, "test-txn-id-2"); - auto params = spanner::Connection::ReadParams{txn}; - auto rows = conn->Read(std::move(params)); - using RowType = std::tuple; - auto stream = spanner::StreamOf(rows); - auto actual = std::vector>{stream.begin(), stream.end()}; - EXPECT_THAT(actual, IsEmpty()); - } -} - TEST(ConnectionImplTest, PartitionReadSessionNotFound) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, PartitionRead) - .WillOnce(Return(SessionNotFoundError("test-session-name"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); + .WillOnce(Return(SessionNotFoundError("multiplexed"))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -4301,15 +3744,12 @@ TEST(ConnectionImplTest, PartitionReadSessionNotFound) { TEST(ConnectionImplTest, ExecuteQuerySessionNotFound) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); - auto finish_status = SessionNotFoundError("test-session-name"); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); + auto finish_status = SessionNotFoundError("multiplexed"); EXPECT_CALL(*mock, ExecuteStreamingSql) .WillOnce( Return(ByMove(MakeReader({}, finish_status)))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -4325,15 +3765,12 @@ TEST(ConnectionImplTest, ExecuteQuerySessionNotFound) { TEST(ConnectionImplTest, ProfileQuerySessionNotFound) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); - auto finish_status = SessionNotFoundError("test-session-name"); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); + auto finish_status = SessionNotFoundError("multiplexed"); EXPECT_CALL(*mock, ExecuteStreamingSql) .WillOnce( Return(ByMove(MakeReader({}, finish_status)))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -4349,13 +3786,10 @@ TEST(ConnectionImplTest, ProfileQuerySessionNotFound) { TEST(ConnectionImplTest, ExecuteDmlSessionNotFound) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, ExecuteSql) - .WillOnce(Return(SessionNotFoundError("test-session-name"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); + .WillOnce(Return(SessionNotFoundError("multiplexed"))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -4371,13 +3805,10 @@ TEST(ConnectionImplTest, ExecuteDmlSessionNotFound) { TEST(ConnectionImplTest, ProfileDmlSessionNotFound) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, ExecuteSql) - .WillOnce(Return(SessionNotFoundError("test-session-name"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); + .WillOnce(Return(SessionNotFoundError("multiplexed"))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -4393,13 +3824,10 @@ TEST(ConnectionImplTest, ProfileDmlSessionNotFound) { TEST(ConnectionImplTest, AnalyzeSqlSessionNotFound) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, ExecuteSql) - .WillOnce(Return(SessionNotFoundError("test-session-name"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); + .WillOnce(Return(SessionNotFoundError("multiplexed"))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -4415,13 +3843,10 @@ TEST(ConnectionImplTest, AnalyzeSqlSessionNotFound) { TEST(ConnectionImplTest, PartitionQuerySessionNotFound) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, PartitionQuery) - .WillOnce(Return(SessionNotFoundError("test-session-name"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); + .WillOnce(Return(SessionNotFoundError("multiplexed"))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -4437,13 +3862,10 @@ TEST(ConnectionImplTest, PartitionQuerySessionNotFound) { TEST(ConnectionImplTest, ExecuteBatchDmlSessionNotFound) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, ExecuteBatchDml) - .WillOnce(Return(SessionNotFoundError("test-session-name"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); + .WillOnce(Return(SessionNotFoundError("multiplexed"))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -4466,13 +3888,10 @@ TEST(ConnectionImplTest, ExecutePartitionedDmlSessionNotFound) { TEST(ConnectionImplTest, CommitSessionNotFound) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, Commit) - .WillOnce(Return(SessionNotFoundError("test-session-name"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); + .WillOnce(Return(SessionNotFoundError("multiplexed"))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -4488,13 +3907,10 @@ TEST(ConnectionImplTest, CommitSessionNotFound) { TEST(ConnectionImplTest, RollbackSessionNotFound) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, Rollback) - .WillOnce(Return(SessionNotFoundError("test-session-name"))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, Not(HasSessionName("multiplexed")))) - .Times(0); + .WillOnce(Return(SessionNotFoundError("multiplexed"))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedRetryOptions()); @@ -4508,17 +3924,14 @@ TEST(ConnectionImplTest, RollbackSessionNotFound) { TEST(ConnectionImplTest, ReadRequestOrderByParameterUnspecified) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); Sequence s; EXPECT_CALL( *mock, StreamingRead( _, _, - AllOf(HasSession("test-session-name"), + AllOf(HasSession("multiplexed"), HasOrderBy( google::spanner::v1::ReadRequest::ORDER_BY_UNSPECIFIED)))) .InSequence(s) @@ -4537,25 +3950,21 @@ TEST(ConnectionImplTest, ReadRequestOrderByParameterUnspecified) { for (auto const& row : rows1) { (void)row; } - EXPECT_THAT(txn1, - HasSessionAndTransaction("test-session-name", "txn1", false, "")); + EXPECT_THAT(txn1, HasSessionAndTransaction("multiplexed", "txn1", false, "")); } TEST(ConnectionImplTest, ReadRequestOrderByParameterNoOrder) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); Sequence s; EXPECT_CALL( *mock, StreamingRead( _, _, AllOf( - HasSession("test-session-name"), + HasSession("multiplexed"), HasOrderBy(google::spanner::v1::ReadRequest::ORDER_BY_NO_ORDER)))) .InSequence(s) .WillOnce(Return(ByMove(MakeReader( @@ -4580,24 +3989,20 @@ TEST(ConnectionImplTest, ReadRequestOrderByParameterNoOrder) { for (auto const& row : rows1) { (void)row; } - EXPECT_THAT(txn1, - HasSessionAndTransaction("test-session-name", "txn1", false, "")); + EXPECT_THAT(txn1, HasSessionAndTransaction("multiplexed", "txn1", false, "")); } TEST(ConnectionImplTest, ReadRequestLockHintParameterUnspecified) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); Sequence s; EXPECT_CALL( *mock, StreamingRead( _, _, - AllOf(HasSession("test-session-name"), + AllOf(HasSession("multiplexed"), HasLockHint( google::spanner::v1::ReadRequest::LOCK_HINT_UNSPECIFIED)))) .InSequence(s) @@ -4616,25 +4021,21 @@ TEST(ConnectionImplTest, ReadRequestLockHintParameterUnspecified) { for (auto const& row : rows1) { (void)row; } - EXPECT_THAT(txn1, - HasSessionAndTransaction("test-session-name", "txn1", false, "")); + EXPECT_THAT(txn1, HasSessionAndTransaction("multiplexed", "txn1", false, "")); } TEST(ConnectionImplTest, ReadRequestLockHintShared) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); Sequence s; EXPECT_CALL( *mock, StreamingRead( _, _, AllOf( - HasSession("test-session-name"), + HasSession("multiplexed"), HasLockHint(google::spanner::v1::ReadRequest::LOCK_HINT_SHARED)))) .InSequence(s) .WillOnce(Return(ByMove(MakeReader( @@ -4660,19 +4061,15 @@ TEST(ConnectionImplTest, ReadRequestLockHintShared) { for (auto const& row : rows1) { (void)row; } - EXPECT_THAT(txn1, - HasSessionAndTransaction("test-session-name", "txn1", false, "")); + EXPECT_THAT(txn1, HasSessionAndTransaction("multiplexed", "txn1", false, "")); } TEST(ConnectionImplTest, OperationsFailOnInvalidatedTransaction) { auto mock = std::make_shared(); auto db = spanner::Database("placeholder_project", "placeholder_instance", "placeholder_database_id"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, HasDatabase(db))) - .WillOnce(Return(MakeSessionsResponse({"test-session-name"}))); - EXPECT_CALL(*mock, - AsyncDeleteSession(_, _, _, HasSessionName("test-session-name"))) - .WillOnce(Return(make_ready_future(Status{}))); + EXPECT_CALL(*mock, CreateSession(_, _, IsMultiplexed())) + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); auto conn = MakeConnectionImpl(db, mock); internal::OptionsSpan span(MakeLimitedTimeOptions()); @@ -4752,3 +4149,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/internal/database_admin_stub.cc b/google/cloud/spanner/internal/database_admin_stub.cc index b30ff25be4b4a..3092d53f23a18 100644 --- a/google/cloud/spanner/internal/database_admin_stub.cc +++ b/google/cloud/spanner/internal/database_admin_stub.cc @@ -17,8 +17,8 @@ #include "google/cloud/spanner/internal/database_admin_metadata.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/log.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/spanner/admin/database/v1/spanner_database_admin.grpc.pb.h" #include namespace google { diff --git a/google/cloud/spanner/internal/database_admin_stub.h b/google/cloud/spanner/internal/database_admin_stub.h index 7ffdc4a0614b1..3cde124566d2f 100644 --- a/google/cloud/spanner/internal/database_admin_stub.h +++ b/google/cloud/spanner/internal/database_admin_stub.h @@ -21,7 +21,7 @@ #include "google/cloud/future.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" -#include +#include "google/spanner/admin/database/v1/spanner_database_admin.pb.h" #include namespace google { diff --git a/google/cloud/spanner/internal/defaults.cc b/google/cloud/spanner/internal/defaults.cc index 863dc944c7e7f..fdfd785c366c8 100644 --- a/google/cloud/spanner/internal/defaults.cc +++ b/google/cloud/spanner/internal/defaults.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/internal/defaults.h" #include "google/cloud/spanner/internal/session_pool.h" #include "google/cloud/spanner/options.h" @@ -72,6 +72,8 @@ Options DefaultOptions(Options opts) { } } + opts.set({}); + // Sets Spanner-specific session-pool options. auto& num_channels = opts.lookup(); num_channels = (std::max)(num_channels, 1); @@ -164,3 +166,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/internal/defaults_test.cc b/google/cloud/spanner/internal/defaults_test.cc index f07d76d5d0a10..d3c2a498f65dd 100644 --- a/google/cloud/spanner/internal/defaults_test.cc +++ b/google/cloud/spanner/internal/defaults_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/internal/defaults.h" #include "google/cloud/spanner/internal/session_pool.h" #include "google/cloud/spanner/options.h" @@ -304,3 +304,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/internal/instance_admin_stub.cc b/google/cloud/spanner/internal/instance_admin_stub.cc index d5f452f12e1c2..71a241459ba21 100644 --- a/google/cloud/spanner/internal/instance_admin_stub.cc +++ b/google/cloud/spanner/internal/instance_admin_stub.cc @@ -20,8 +20,8 @@ #include "google/cloud/grpc_options.h" #include "google/cloud/internal/algorithm.h" #include "google/cloud/log.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/spanner/admin/instance/v1/spanner_instance_admin.grpc.pb.h" #include namespace google { diff --git a/google/cloud/spanner/internal/instance_admin_stub.h b/google/cloud/spanner/internal/instance_admin_stub.h index 54b26e95f69e8..a500b207db054 100644 --- a/google/cloud/spanner/internal/instance_admin_stub.h +++ b/google/cloud/spanner/internal/instance_admin_stub.h @@ -21,7 +21,7 @@ #include "google/cloud/future.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" -#include +#include "google/spanner/admin/instance/v1/spanner_instance_admin.pb.h" #include namespace google { diff --git a/google/cloud/spanner/internal/merge_chunk.h b/google/cloud/spanner/internal/merge_chunk.h index 77fd6ecf447d2..92834a33dc36e 100644 --- a/google/cloud/spanner/internal/merge_chunk.h +++ b/google/cloud/spanner/internal/merge_chunk.h @@ -17,7 +17,7 @@ #include "google/cloud/spanner/version.h" #include "google/cloud/status.h" -#include +#include "google/protobuf/struct.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/spanner/internal/merge_chunk_test.cc b/google/cloud/spanner/internal/merge_chunk_test.cc index c1fde868bc95e..be8ef9b6ab2b3 100644 --- a/google/cloud/spanner/internal/merge_chunk_test.cc +++ b/google/cloud/spanner/internal/merge_chunk_test.cc @@ -16,7 +16,7 @@ #include "google/cloud/spanner/value.h" #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/status_matchers.h" -#include +#include "google/protobuf/struct.pb.h" #include #include #include diff --git a/google/cloud/spanner/internal/partial_result_set_reader.h b/google/cloud/spanner/internal/partial_result_set_reader.h index 8d71f8588aff7..db80d1f27e00c 100644 --- a/google/cloud/spanner/internal/partial_result_set_reader.h +++ b/google/cloud/spanner/internal/partial_result_set_reader.h @@ -19,7 +19,7 @@ #include "google/cloud/status.h" #include "google/cloud/status_or.h" #include "absl/types/optional.h" -#include +#include "google/spanner/v1/spanner.pb.h" #include #include #include diff --git a/google/cloud/spanner/internal/partial_result_set_resume_test.cc b/google/cloud/spanner/internal/partial_result_set_resume_test.cc index 844e9ceb14442..7fef58f76f520 100644 --- a/google/cloud/spanner/internal/partial_result_set_resume_test.cc +++ b/google/cloud/spanner/internal/partial_result_set_resume_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/internal/partial_result_set_resume.h" #include "google/cloud/spanner/internal/partial_result_set_source.h" #include "google/cloud/spanner/mocks/row.h" @@ -610,3 +610,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/internal/partial_result_set_source.cc b/google/cloud/spanner/internal/partial_result_set_source.cc index 937aa714df83d..bf763ff48082a 100644 --- a/google/cloud/spanner/internal/partial_result_set_source.cc +++ b/google/cloud/spanner/internal/partial_result_set_source.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/internal/partial_result_set_source.h" #include "google/cloud/spanner/internal/merge_chunk.h" #include "google/cloud/spanner/options.h" @@ -299,3 +299,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/internal/partial_result_set_source.h b/google/cloud/spanner/internal/partial_result_set_source.h index 16c74db827410..9e2bfc4f20cdc 100644 --- a/google/cloud/spanner/internal/partial_result_set_source.h +++ b/google/cloud/spanner/internal/partial_result_set_source.h @@ -23,10 +23,10 @@ #include "google/cloud/status.h" #include "google/cloud/status_or.h" #include "absl/types/optional.h" +#include "google/protobuf/struct.pb.h" +#include "google/spanner/v1/spanner.pb.h" #include #include -#include -#include #include #include #include diff --git a/google/cloud/spanner/internal/partial_result_set_source_test.cc b/google/cloud/spanner/internal/partial_result_set_source_test.cc index 1238436be66a9..bc3a408c41cff 100644 --- a/google/cloud/spanner/internal/partial_result_set_source_test.cc +++ b/google/cloud/spanner/internal/partial_result_set_source_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/internal/partial_result_set_source.h" #include "google/cloud/spanner/mocks/row.h" #include "google/cloud/spanner/options.h" @@ -938,3 +938,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/internal/route_to_leader.cc b/google/cloud/spanner/internal/route_to_leader.cc index f53a3615bd668..b404321fca9ec 100644 --- a/google/cloud/spanner/internal/route_to_leader.cc +++ b/google/cloud/spanner/internal/route_to_leader.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/internal/route_to_leader.h" #include "google/cloud/spanner/options.h" #include "google/cloud/options.h" @@ -33,3 +33,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/internal/route_to_leader_test.cc b/google/cloud/spanner/internal/route_to_leader_test.cc index df4bef1e6b1b9..58785f7136f56 100644 --- a/google/cloud/spanner/internal/route_to_leader_test.cc +++ b/google/cloud/spanner/internal/route_to_leader_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/internal/route_to_leader.h" #include "google/cloud/spanner/options.h" #include "google/cloud/options.h" @@ -82,3 +82,4 @@ TEST_F(RouteToLeader, OptionFalse) { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/internal/session_pool.cc b/google/cloud/spanner/internal/session_pool.cc index e1a9d6f03342f..ca064dad712c0 100644 --- a/google/cloud/spanner/internal/session_pool.cc +++ b/google/cloud/spanner/internal/session_pool.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/internal/session_pool.h" #include "google/cloud/spanner/internal/route_to_leader.h" #include "google/cloud/spanner/internal/session.h" @@ -734,3 +734,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/internal/session_pool.h b/google/cloud/spanner/internal/session_pool.h index ab108ae92af25..82ce975b059f4 100644 --- a/google/cloud/spanner/internal/session_pool.h +++ b/google/cloud/spanner/internal/session_pool.h @@ -28,7 +28,7 @@ #include "google/cloud/future.h" #include "google/cloud/status_or.h" #include "absl/container/fixed_array.h" -#include +#include "google/spanner/v1/spanner.pb.h" #include #include #include diff --git a/google/cloud/spanner/internal/session_pool_test.cc b/google/cloud/spanner/internal/session_pool_test.cc index 8f95b27a556e4..9f5cc8e619f6a 100644 --- a/google/cloud/spanner/internal/session_pool_test.cc +++ b/google/cloud/spanner/internal/session_pool_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/internal/session_pool.h" #include "google/cloud/spanner/internal/defaults.h" #include "google/cloud/spanner/internal/session.h" @@ -47,7 +47,6 @@ namespace { using ::google::cloud::testing_util::FakeCompletionQueueImpl; using ::google::cloud::testing_util::FakeSteadyClock; using ::google::cloud::testing_util::StatusIs; -using ::google::protobuf::TextFormat; using ::testing::_; using ::testing::AllOf; using ::testing::AnyOf; @@ -57,8 +56,6 @@ using ::testing::HasSubstr; using ::testing::Not; using ::testing::Pair; using ::testing::Return; -using ::testing::StrictMock; -using ::testing::UnorderedElementsAre; auto constexpr kRouteToLeader = "x-goog-spanner-route-to-leader"; @@ -125,20 +122,6 @@ google::spanner::v1::Session MakeMultiplexedSession(std::string name, return session; } -// Create a response with the given `sessions`. -google::spanner::v1::BatchCreateSessionsResponse MakeSessionsResponse( - std::vector sessions, std::string role = "") { - google::spanner::v1::BatchCreateSessionsResponse response; - for (auto& session : sessions) { - auto* s = response.add_session(); - s->set_name(std::move(session)); - *s->mutable_create_time() = Now(); - *s->mutable_approximate_last_use_time() = Now(); - if (!role.empty()) s->set_creator_role(role); - } - return response; -} - std::shared_ptr MakeTestSessionPool( spanner::Database db, std::vector> stubs, CompletionQueue cq, Options opts = {}) { @@ -162,9 +145,7 @@ TEST_F(SessionPoolTest, Multiplexed) { .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - auto pool = MakeTestSessionPool( - db, {mock}, threads.cq(), - Options{}.set({})); + auto pool = MakeTestSessionPool(db, {mock}, threads.cq(), {}); auto session = pool->Multiplexed(); ASSERT_STATUS_OK(session); EXPECT_EQ((*session)->session_name(), "multiplexed"); @@ -184,11 +165,10 @@ TEST_F(SessionPoolTest, MultiplexedAllocateRouteToLeader) { }); google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - auto pool = MakeTestSessionPool( - db, {mock}, threads.cq(), - Options{} - .set(true) - .set({})); + auto pool = + MakeTestSessionPool(db, {mock}, threads.cq(), + Options{}.set(true)); + auto session = pool->Multiplexed(); ASSERT_STATUS_OK(session); EXPECT_EQ((*session)->session_name(), "multiplexed"); @@ -198,17 +178,16 @@ TEST_F(SessionPoolTest, MultiplexedAllocateRouteToLeader) { TEST_F(SessionPoolTest, AllocateRouteToLeader) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, - BatchCreateSessions( - _, _, AllOf(DatabaseIs(db.FullName()), SessionCountIs(42)))) + + EXPECT_CALL( + *mock, + CreateSession(_, _, AllOf(DatabaseIs(db.FullName()), IsMultiplexed()))) .WillOnce([this](grpc::ClientContext& context, Options const&, - google::spanner::v1::BatchCreateSessionsRequest const&) { + google::spanner::v1::CreateSessionRequest const&) { EXPECT_THAT(GetMetadata(context), Contains(Pair(kRouteToLeader, "true"))); - return MakeSessionsResponse({"session1"}); + return MakeMultiplexedSession("multiplexed"); }); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("session1"))) - .WillOnce(Return(make_ready_future(Status{}))); google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; auto pool = @@ -216,15 +195,16 @@ TEST_F(SessionPoolTest, AllocateRouteToLeader) { Options{} .set(true) .set(42)); - auto session = pool->Allocate(); + auto session = pool->Multiplexed(); ASSERT_STATUS_OK(session); - EXPECT_EQ((*session)->session_name(), "session1"); + EXPECT_EQ((*session)->session_name(), "multiplexed"); EXPECT_EQ(pool->GetStub(**session), mock); } TEST_F(SessionPoolTest, MultiplexedAllocateNoRouteToLeader) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); + EXPECT_CALL( *mock, CreateSession(_, _, AllOf(DatabaseIs(db.FullName()), IsMultiplexed()))) @@ -237,11 +217,10 @@ TEST_F(SessionPoolTest, MultiplexedAllocateNoRouteToLeader) { }); google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - auto pool = MakeTestSessionPool( - db, {mock}, threads.cq(), - Options{} - .set(false) - .set({})); + auto pool = + MakeTestSessionPool(db, {mock}, threads.cq(), + Options{}.set(false)); + auto session = pool->Multiplexed(); ASSERT_STATUS_OK(session); EXPECT_EQ((*session)->session_name(), "multiplexed"); @@ -251,18 +230,17 @@ TEST_F(SessionPoolTest, MultiplexedAllocateNoRouteToLeader) { TEST_F(SessionPoolTest, AllocateNoRouteToLeader) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, - BatchCreateSessions( - _, _, AllOf(DatabaseIs(db.FullName()), SessionCountIs(42)))) + + EXPECT_CALL( + *mock, + CreateSession(_, _, AllOf(DatabaseIs(db.FullName()), IsMultiplexed()))) .WillOnce([this](grpc::ClientContext& context, Options const&, - google::spanner::v1::BatchCreateSessionsRequest const&) { + google::spanner::v1::CreateSessionRequest const&) { EXPECT_THAT(GetMetadata(context), AnyOf(Contains(Pair(kRouteToLeader, "false")), Not(Contains(Pair(kRouteToLeader, _))))); - return MakeSessionsResponse({"session1"}); + return MakeMultiplexedSession("multiplexed"); }); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("session1"))) - .WillOnce(Return(make_ready_future(Status{}))); google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; auto pool = @@ -270,50 +248,12 @@ TEST_F(SessionPoolTest, AllocateNoRouteToLeader) { Options{} .set(false) .set(42)); - auto session = pool->Allocate(); + auto session = pool->Multiplexed(); ASSERT_STATUS_OK(session); - EXPECT_EQ((*session)->session_name(), "session1"); + EXPECT_EQ((*session)->session_name(), "multiplexed"); EXPECT_EQ(pool->GetStub(**session), mock); } -TEST_F(SessionPoolTest, ReleaseBadSession) { - auto mock = std::make_shared(); - auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, - BatchCreateSessions( - _, _, AllOf(DatabaseIs(db.FullName()), SessionCountIs(1)))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"session1"})))); - EXPECT_CALL(*mock, - BatchCreateSessions( - _, _, AllOf(DatabaseIs(db.FullName()), SessionCountIs(2)))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"session2"})))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("session1"))) - .Times(0); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("session2"))) - .WillOnce(Return(make_ready_future(Status{}))); - - google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - auto pool = MakeTestSessionPool( - db, {mock}, threads.cq(), - Options{}.set(1)); - { - auto session = pool->Allocate(); - ASSERT_STATUS_OK(session); - EXPECT_EQ((*session)->session_name(), "session1"); - } - { - auto session = pool->Allocate(); - ASSERT_STATUS_OK(session); - EXPECT_EQ((*session)->session_name(), "session1"); - (*session)->set_bad(); // Marking session1 as bad - } - { - auto session = pool->Allocate(); - ASSERT_STATUS_OK(session); - EXPECT_EQ((*session)->session_name(), "session2"); // Got a new session - } -} - TEST_F(SessionPoolTest, MultiplexedCreateError) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); @@ -322,213 +262,34 @@ TEST_F(SessionPoolTest, MultiplexedCreateError) { Return(ByMove(Status(StatusCode::kInternal, "init failure")))); google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - auto pool = MakeTestSessionPool( - db, {mock}, threads.cq(), - Options{}.set({})); + auto pool = MakeTestSessionPool(db, {mock}, threads.cq(), {}); + auto session = pool->Multiplexed(); EXPECT_THAT(session, StatusIs(StatusCode::kInternal, HasSubstr("init failure"))); } -TEST_F(SessionPoolTest, CreateError) { - auto mock = std::make_shared(); - auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions) - .WillOnce(Return(ByMove(Status(StatusCode::kInternal, "init failure")))) - .WillOnce(Return(ByMove(Status(StatusCode::kInternal, "some failure")))); - EXPECT_CALL(*mock, AsyncDeleteSession).Times(0); - - google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - auto pool = MakeTestSessionPool(db, {mock}, threads.cq()); - auto session = pool->Allocate(); - EXPECT_THAT(session, - StatusIs(StatusCode::kInternal, HasSubstr("some failure"))); -} - TEST_F(SessionPoolTest, ReuseSession) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions) - .WillOnce(Return(ByMove(MakeSessionsResponse({"session1"})))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("session1"))) - .WillOnce(Return(make_ready_future(Status{}))); + EXPECT_CALL( + *mock, + CreateSession(_, _, AllOf(DatabaseIs(db.FullName()), IsMultiplexed()))) + .WillOnce([](grpc::ClientContext&, Options const&, + google::spanner::v1::CreateSessionRequest const&) { + return MakeMultiplexedSession("multiplexed"); + }); google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; auto pool = MakeTestSessionPool(db, {mock}, threads.cq()); - auto session = pool->Allocate(); + auto session = pool->Multiplexed(); ASSERT_STATUS_OK(session); - EXPECT_EQ((*session)->session_name(), "session1"); + EXPECT_EQ((*session)->session_name(), "multiplexed"); session->reset(); - auto session2 = pool->Allocate(); - ASSERT_STATUS_OK(session2); - EXPECT_EQ((*session2)->session_name(), "session1"); -} - -TEST_F(SessionPoolTest, Lifo) { - auto mock = std::make_shared(); - auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions) - .WillOnce(Return(ByMove(MakeSessionsResponse({"session1"})))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"session2"})))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("session1"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("session2"))) - .WillOnce(Return(make_ready_future(Status{}))); - - google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - auto pool = MakeTestSessionPool(db, {mock}, threads.cq()); - auto session = pool->Allocate(); - ASSERT_STATUS_OK(session); - EXPECT_EQ((*session)->session_name(), "session1"); - - auto session2 = pool->Allocate(); + auto session2 = pool->Multiplexed(); ASSERT_STATUS_OK(session2); - EXPECT_EQ((*session2)->session_name(), "session2"); - - session->reset(); - session2->reset(); - - // The pool is Last-In-First-Out (LIFO), so we expect to get the sessions - // back in the reverse order they were released. - auto session3 = pool->Allocate(); - ASSERT_STATUS_OK(session3); - EXPECT_EQ((*session3)->session_name(), "session2"); - - auto session4 = pool->Allocate(); - ASSERT_STATUS_OK(session4); - EXPECT_EQ((*session4)->session_name(), "session1"); -} - -TEST_F(SessionPoolTest, MinSessionsEagerAllocation) { - int const min_sessions = 3; - auto mock = std::make_shared(); - auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions(_, _, SessionCountIs(min_sessions))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"s3", "s2", "s1"})))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s1"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s2"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s3"))) - .WillOnce(Return(make_ready_future(Status{}))); - - google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - auto pool = MakeTestSessionPool( - db, {mock}, threads.cq(), - Options{}.set(min_sessions)); - auto session = pool->Allocate(); -} - -TEST_F(SessionPoolTest, MinSessionsMultipleAllocations) { - int const min_sessions = 3; - auto mock = std::make_shared(); - auto db = spanner::Database("project", "instance", "database"); - // The constructor will make this call. - EXPECT_CALL(*mock, BatchCreateSessions(_, _, SessionCountIs(min_sessions))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"s3", "s2", "s1"})))); - // When we run out of sessions it will make this call. - EXPECT_CALL(*mock, - BatchCreateSessions(_, _, SessionCountIs(min_sessions + 1))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"s7", "s6", "s5", "s4"})))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s1"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s2"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s3"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s4"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s5"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s6"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s7"))) - .WillOnce(Return(make_ready_future(Status{}))); - - google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - auto pool = MakeTestSessionPool( - db, {mock}, threads.cq(), - Options{}.set(min_sessions)); - std::vector sessions; - std::vector session_names; - for (int i = 1; i <= 7; ++i) { - auto session = pool->Allocate(); - ASSERT_STATUS_OK(session); - session_names.push_back((*session)->session_name()); - sessions.push_back(*std::move(session)); - } - EXPECT_THAT(session_names, - UnorderedElementsAre("s1", "s2", "s3", "s4", "s5", "s6", "s7")); -} - -TEST_F(SessionPoolTest, MaxSessionsFailOnExhaustion) { - int const max_sessions_per_channel = 3; - auto mock = std::make_shared(); - auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions) - .WillOnce(Return(ByMove(MakeSessionsResponse({"s1"})))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"s2"})))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"s3"})))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s1"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s2"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s3"))) - .WillOnce(Return(make_ready_future(Status{}))); - - google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - auto pool = MakeTestSessionPool( - db, {mock}, threads.cq(), - Options{} - .set( - max_sessions_per_channel) - .set( - spanner::ActionOnExhaustion::kFail)); - std::vector sessions; - std::vector session_names; - for (int i = 1; i <= 3; ++i) { - auto session = pool->Allocate(); - ASSERT_STATUS_OK(session); - session_names.push_back((*session)->session_name()); - sessions.push_back(*std::move(session)); - } - EXPECT_THAT(session_names, UnorderedElementsAre("s1", "s2", "s3")); - auto session = pool->Allocate(); - EXPECT_THAT(session, StatusIs(StatusCode::kResourceExhausted, - "session pool exhausted")); -} - -TEST_F(SessionPoolTest, MaxSessionsBlockUntilRelease) { - int const max_sessions_per_channel = 1; - auto mock = std::make_shared(); - auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock, BatchCreateSessions) - .WillOnce(Return(ByMove(MakeSessionsResponse({"s1"})))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s1"))) - .WillOnce(Return(make_ready_future(Status{}))); - - google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - auto pool = MakeTestSessionPool( - db, {mock}, threads.cq(), - Options{} - .set( - max_sessions_per_channel) - .set( - spanner::ActionOnExhaustion::kBlock)); - auto session = pool->Allocate(); - ASSERT_STATUS_OK(session); - EXPECT_EQ((*session)->session_name(), "s1"); - - // This thread will block in Allocate() until the main thread releases s1. - std::thread t([&pool]() { - auto session = pool->Allocate(); - ASSERT_STATUS_OK(session); - EXPECT_EQ((*session)->session_name(), "s1"); - }); - - session->reset(); - t.join(); + EXPECT_EQ((*session2)->session_name(), "multiplexed"); } TEST_F(SessionPoolTest, MultiplexedLabels) { @@ -552,33 +313,12 @@ TEST_F(SessionPoolTest, MultiplexedLabels) { google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; auto pool = MakeTestSessionPool( db, {mock}, threads.cq(), - Options{} - .set(std::move(labels)) - .set({})); + Options{}.set(std::move(labels))); auto session = pool->Multiplexed(); ASSERT_STATUS_OK(session); EXPECT_EQ((*session)->session_name(), "multiplexed"); } -TEST_F(SessionPoolTest, Labels) { - auto mock = std::make_shared(); - auto db = spanner::Database("project", "instance", "database"); - std::map labels = { - {"k1", "v1"}, {"k2", "v2"}, {"k3", "v3"}}; - EXPECT_CALL(*mock, BatchCreateSessions(_, _, LabelsAre(labels))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"session1"})))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("session1"))) - .WillOnce(Return(make_ready_future(Status{}))); - - google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - auto pool = MakeTestSessionPool( - db, {mock}, threads.cq(), - Options{}.set(std::move(labels))); - auto session = pool->Allocate(); - ASSERT_STATUS_OK(session); - EXPECT_EQ((*session)->session_name(), "session1"); -} - TEST_F(SessionPoolTest, MultiplexedCreatorRole) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); @@ -596,143 +336,13 @@ TEST_F(SessionPoolTest, MultiplexedCreatorRole) { google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; auto pool = MakeTestSessionPool( db, {mock}, threads.cq(), - Options{} - .set(role) - .set({})); + Options{}.set(role)); + auto session = pool->Multiplexed(); ASSERT_STATUS_OK(session); EXPECT_EQ((*session)->session_name(), "multiplexed"); } -TEST_F(SessionPoolTest, CreatorRole) { - auto mock = std::make_shared(); - auto db = spanner::Database("project", "instance", "database"); - std::string const role = "public"; - EXPECT_CALL(*mock, - BatchCreateSessions( - _, _, AllOf(DatabaseIs(db.FullName()), CreatorRoleIs(role)))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"session1"}, role)))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("session1"))) - .WillOnce(Return(make_ready_future(Status{}))); - - google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - auto pool = MakeTestSessionPool( - db, {mock}, threads.cq(), - Options{}.set(role)); - auto session = pool->Allocate(); - ASSERT_STATUS_OK(session); - EXPECT_EQ((*session)->session_name(), "session1"); -} - -TEST_F(SessionPoolTest, MultipleChannels) { - auto mock1 = std::make_shared(); - auto mock2 = std::make_shared(); - auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock1, CreateSession) - .WillRepeatedly( - Return(ByMove(Status(StatusCode::kInternal, "init failure")))); - EXPECT_CALL(*mock1, BatchCreateSessions) - .WillOnce(Return(ByMove(MakeSessionsResponse({"c1s1"})))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"c1s2"})))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"c1s3"})))); - EXPECT_CALL(*mock1, AsyncDeleteSession(_, _, _, SessionNameIs("c1s1"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock1, AsyncDeleteSession(_, _, _, SessionNameIs("c1s2"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock1, AsyncDeleteSession(_, _, _, SessionNameIs("c1s3"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock2, CreateSession) - .WillRepeatedly( - Return(ByMove(Status(StatusCode::kInternal, "init failure")))); - EXPECT_CALL(*mock2, BatchCreateSessions) - .WillOnce(Return(ByMove(MakeSessionsResponse({"c2s1"})))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"c2s2"})))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"c2s3"})))); - EXPECT_CALL(*mock2, AsyncDeleteSession(_, _, _, SessionNameIs("c2s1"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock2, AsyncDeleteSession(_, _, _, SessionNameIs("c2s2"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock2, AsyncDeleteSession(_, _, _, SessionNameIs("c2s3"))) - .WillOnce(Return(make_ready_future(Status{}))); - - google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - auto pool = MakeTestSessionPool(db, {mock1, mock2}, threads.cq()); - std::vector sessions; - std::vector session_names; - for (int i = 1; i <= 6; ++i) { - auto session = pool->Allocate(); - ASSERT_STATUS_OK(session); - session_names.push_back((*session)->session_name()); - sessions.push_back(*std::move(session)); - } - EXPECT_THAT(session_names, UnorderedElementsAre("c1s1", "c1s2", "c1s3", - "c2s1", "c2s2", "c2s3")); -} - -TEST_F(SessionPoolTest, MultipleChannelsPreAllocation) { - auto mock1 = std::make_shared(); - auto mock2 = std::make_shared(); - auto mock3 = std::make_shared(); - auto db = spanner::Database("project", "instance", "database"); - EXPECT_CALL(*mock1, CreateSession) - .WillRepeatedly( - Return(ByMove(Status(StatusCode::kInternal, "init failure")))); - EXPECT_CALL(*mock1, BatchCreateSessions) - .WillOnce(Return(ByMove(MakeSessionsResponse({"c1s1", "c1s2", "c1s3"})))); - EXPECT_CALL(*mock1, AsyncDeleteSession(_, _, _, SessionNameIs("c1s1"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock1, AsyncDeleteSession(_, _, _, SessionNameIs("c1s2"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock1, AsyncDeleteSession(_, _, _, SessionNameIs("c1s3"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock2, CreateSession) - .WillRepeatedly( - Return(ByMove(Status(StatusCode::kInternal, "init failure")))); - EXPECT_CALL(*mock2, BatchCreateSessions) - .WillOnce(Return(ByMove(MakeSessionsResponse({"c2s1", "c2s2", "c2s3"})))); - EXPECT_CALL(*mock2, AsyncDeleteSession(_, _, _, SessionNameIs("c2s1"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock2, AsyncDeleteSession(_, _, _, SessionNameIs("c2s2"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock2, AsyncDeleteSession(_, _, _, SessionNameIs("c2s3"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock3, CreateSession) - .WillRepeatedly( - Return(ByMove(Status(StatusCode::kInternal, "init failure")))); - EXPECT_CALL(*mock3, BatchCreateSessions) - .WillOnce(Return(ByMove(MakeSessionsResponse({"c3s1", "c3s2", "c3s3"})))); - EXPECT_CALL(*mock3, AsyncDeleteSession(_, _, _, SessionNameIs("c3s1"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock3, AsyncDeleteSession(_, _, _, SessionNameIs("c3s2"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock3, AsyncDeleteSession(_, _, _, SessionNameIs("c3s3"))) - .WillOnce(Return(make_ready_future(Status{}))); - - google::cloud::internal::AutomaticallyCreatedBackgroundThreads threads; - // note that min_sessions will effectively be reduced to 9 - // (max_sessions_per_channel * num_channels). - auto pool = MakeTestSessionPool( - db, {mock1, mock2, mock3}, threads.cq(), - Options{} - .set(3) - .set( - spanner::ActionOnExhaustion::kFail)); - std::vector sessions; - std::vector session_names; - for (int i = 1; i <= 9; ++i) { - auto session = pool->Allocate(); - ASSERT_STATUS_OK(session); - session_names.push_back((*session)->session_name()); - sessions.push_back(*std::move(session)); - } - EXPECT_THAT(session_names, - UnorderedElementsAre("c1s1", "c1s2", "c1s3", "c2s1", "c2s2", - "c2s3", "c3s1", "c3s2", "c3s3")); - auto session = pool->Allocate(); - EXPECT_THAT(session, StatusIs(StatusCode::kResourceExhausted, - "session pool exhausted")); -} - TEST_F(SessionPoolTest, GetStubForStublessSession) { auto mock = std::make_shared(); auto db = spanner::Database("project", "instance", "database"); @@ -772,8 +382,7 @@ TEST_F(SessionPoolTest, MultilpexedSessionReplacementSuccess) { .set( background_interval) .set( - replacement_interval) - .set({})); + replacement_interval)); auto s1 = pool->Multiplexed(); ASSERT_STATUS_OK(s1); @@ -796,7 +405,7 @@ TEST_F(SessionPoolTest, MultilpexedSessionReplacementRpcPermanentFailure) { EXPECT_CALL( *mock, CreateSession(_, _, AllOf(DatabaseIs(db.FullName()), IsMultiplexed()))) - .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed1"})))); + .WillOnce(Return(ByMove(MakeMultiplexedSession({"multiplexed"})))); EXPECT_CALL(*mock, AsyncCreateSession(_, _, _, _)) .WillOnce(Return(make_ready_future(StatusOr( Status(StatusCode::kResourceExhausted, "retry policy exhausted"))))); @@ -814,172 +423,26 @@ TEST_F(SessionPoolTest, MultilpexedSessionReplacementRpcPermanentFailure) { .set( background_interval) .set( - replacement_interval) - .set({})); + replacement_interval)); auto s1 = pool->Multiplexed(); ASSERT_STATUS_OK(s1); - EXPECT_EQ((*s1)->session_name(), "multiplexed1"); + EXPECT_EQ((*s1)->session_name(), "multiplexed"); clock->AdvanceTime(background_interval); impl->SimulateCompletion(true); auto s2 = pool->Multiplexed(); ASSERT_STATUS_OK(s2); - EXPECT_EQ((*s2)->session_name(), "multiplexed1"); + EXPECT_EQ((*s2)->session_name(), "multiplexed"); // Cancel all pending operations, satisfying any remaining futures. impl->SimulateCompletion(false); } -TEST_F(SessionPoolTest, SessionRefresh) { - auto mock = std::make_shared>(); - EXPECT_CALL(*mock, BatchCreateSessions) - .WillOnce(Return(ByMove(MakeSessionsResponse({"s1"})))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"s2"})))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s1"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s2"))) - .WillOnce(Return(make_ready_future(Status{}))); - - google::spanner::v1::ResultSet result; - auto constexpr kResultSetText = R"pb( - metadata: { - row_type: { fields: { type: { code: INT64 } } } - transaction: {} - } - rows: { values: { string_value: "1" } } - )pb"; - ASSERT_TRUE(TextFormat::ParseFromString(kResultSetText, &result)); - - EXPECT_CALL(*mock, AsyncExecuteSql) - .WillOnce( - [&result](CompletionQueue&, auto, auto, - google::spanner::v1::ExecuteSqlRequest const& request) { - EXPECT_EQ("s2", request.session()); - return make_ready_future(make_status_or(std::move(result))); - }); - - auto db = spanner::Database("project", "instance", "database"); - auto impl = std::make_shared(); - auto keep_alive_interval = std::chrono::seconds(1); - auto clock = std::make_shared(); - auto pool = MakeTestSessionPool( - db, {mock}, CompletionQueue(impl), - Options{} - .set(keep_alive_interval) - .set(clock)); - - // Allocate and release two session, "s1" and "s2". This will satisfy the - // BatchCreateSessions() expectations. - { - auto s1 = pool->Allocate(); - ASSERT_STATUS_OK(s1); - EXPECT_EQ("s1", (*s1)->session_name()); - { - auto s2 = pool->Allocate(); - ASSERT_STATUS_OK(s2); - EXPECT_EQ("s2", (*s2)->session_name()); - } - // Wait for "s2" to need refreshing before releasing "s1". - clock->AdvanceTime(keep_alive_interval * 2); - } - - // Simulate completion of pending operations, which will result in - // a call to RefreshExpiringSessions(). This should refresh "s2" and - // satisfy the AsyncExecuteSql() expectation. - impl->SimulateCompletion(true); - - // We should still be able to allocate sessions "s1" and "s2". - auto s1 = pool->Allocate(); - ASSERT_STATUS_OK(s1); - EXPECT_EQ("s1", (*s1)->session_name()); - auto s2 = pool->Allocate(); - ASSERT_STATUS_OK(s2); - EXPECT_EQ("s2", (*s2)->session_name()); - - // Cancel all pending operations, satisfying any remaining futures. When - // compiling with exceptions disabled the destructors eventually invoke - // `std::abort()`. On real programs, shutting down the completion queue - // will have the same effect. - impl->SimulateCompletion(false); -} - -TEST_F(SessionPoolTest, SessionRefreshNotFound) { - auto mock = std::make_shared>(); - EXPECT_CALL(*mock, BatchCreateSessions) - .WillOnce(Return(ByMove(MakeSessionsResponse({"s1"})))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"s2"})))) - .WillOnce(Return(ByMove(MakeSessionsResponse({"s3"})))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s1"))) - .WillOnce(Return(make_ready_future(Status{}))); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s2"))).Times(0); - EXPECT_CALL(*mock, AsyncDeleteSession(_, _, _, SessionNameIs("s3"))) - .WillOnce(Return(make_ready_future(Status{}))); - - EXPECT_CALL(*mock, AsyncExecuteSql) - .WillOnce([](CompletionQueue&, auto, auto, - google::spanner::v1::ExecuteSqlRequest const& request) { - EXPECT_EQ("s2", request.session()); - // The "SELECT 1" refresh returns "Session not found". - return make_ready_future(StatusOr( - spanner_testing::SessionNotFoundError(request.session()))); - }); - - auto db = spanner::Database("project", "instance", "database"); - auto impl = std::make_shared(); - auto keep_alive_interval = std::chrono::seconds(1); - auto clock = std::make_shared(); - auto pool = MakeTestSessionPool( - db, {mock}, CompletionQueue(impl), - Options{} - .set(keep_alive_interval) - .set(clock)); - - // Allocate and release two session, "s1" and "s2". This will satisfy the - // the first two BatchCreateSessions() expectations. - { - auto s1 = pool->Allocate(); - ASSERT_STATUS_OK(s1); - EXPECT_EQ("s1", (*s1)->session_name()); - { - auto s2 = pool->Allocate(); - ASSERT_STATUS_OK(s2); - EXPECT_EQ("s2", (*s2)->session_name()); - } - // Wait for "s2" to need refreshing before releasing "s1". - clock->AdvanceTime(keep_alive_interval * 2); - } - EXPECT_EQ(pool->total_sessions(), 2); - - // Simulate completion of pending operations, which will result in - // a call to RefreshExpiringSessions(). This should refresh "s2" and - // satisfy the AsyncExecuteSql() expectation, which fails the call. - impl->SimulateCompletion(true); - EXPECT_EQ(pool->total_sessions(), 1); - - // We should still be able to allocate session "s1". - auto s1 = pool->Allocate(); - ASSERT_STATUS_OK(s1); - EXPECT_EQ("s1", (*s1)->session_name()); - EXPECT_EQ(pool->total_sessions(), 1); - - // However "s2" will be gone now, so a new allocation will produce - // "s3", satisfying the final BatchCreateSessions() expectation. - auto s3 = pool->Allocate(); - ASSERT_STATUS_OK(s3); - EXPECT_EQ("s3", (*s3)->session_name()); - EXPECT_EQ(pool->total_sessions(), 2); - - // Cancel all pending operations, satisfying any remaining futures. When - // compiling with exceptions disabled the destructors eventually invoke - // `std::abort()`. In non-test programs, the completion queue does this - // automatically as part of its shutdown. - impl->SimulateCompletion(false); -} - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/internal/spanner_auth_decorator.cc b/google/cloud/spanner/internal/spanner_auth_decorator.cc index b70a5b2d1a737..26eaf0a09a652 100644 --- a/google/cloud/spanner/internal/spanner_auth_decorator.cc +++ b/google/cloud/spanner/internal/spanner_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/spanner/v1/spanner.proto #include "google/cloud/spanner/internal/spanner_auth_decorator.h" -#include +#include "google/spanner/v1/spanner.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_internal { @@ -228,3 +231,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/internal/spanner_auth_decorator.h b/google/cloud/spanner/internal/spanner_auth_decorator.h index ddf602a85ec0c..1c62ae46ba48b 100644 --- a/google/cloud/spanner/internal/spanner_auth_decorator.h +++ b/google/cloud/spanner/internal/spanner_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_internal { @@ -131,4 +134,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_INTERNAL_SPANNER_AUTH_DECORATOR_H diff --git a/google/cloud/spanner/internal/spanner_logging_decorator.cc b/google/cloud/spanner/internal/spanner_logging_decorator.cc index a41ac38d302ca..8da01f2f71e37 100644 --- a/google/cloud/spanner/internal/spanner_logging_decorator.cc +++ b/google/cloud/spanner/internal/spanner_logging_decorator.cc @@ -20,12 +20,15 @@ #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/internal/streaming_read_rpc_logging.h" #include "google/cloud/status_or.h" -#include +#include "google/spanner/v1/spanner.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_internal { @@ -299,3 +302,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/internal/spanner_logging_decorator.h b/google/cloud/spanner/internal/spanner_logging_decorator.h index d6349d1f86e8b..23c64796f981e 100644 --- a/google/cloud/spanner/internal/spanner_logging_decorator.h +++ b/google/cloud/spanner/internal/spanner_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_internal { @@ -132,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_INTERNAL_SPANNER_LOGGING_DECORATOR_H diff --git a/google/cloud/spanner/internal/spanner_metadata_decorator.cc b/google/cloud/spanner/internal/spanner_metadata_decorator.cc index 94e93d46b9896..6bc4aa9bba599 100644 --- a/google/cloud/spanner/internal/spanner_metadata_decorator.cc +++ b/google/cloud/spanner/internal/spanner_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/spanner/internal/spanner_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/spanner/v1/spanner.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_internal { @@ -225,3 +229,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/internal/spanner_metadata_decorator.h b/google/cloud/spanner/internal/spanner_metadata_decorator.h index 559a16eea7828..21c5e6a310cfd 100644 --- a/google/cloud/spanner/internal/spanner_metadata_decorator.h +++ b/google/cloud/spanner/internal/spanner_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_internal { @@ -136,4 +139,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_INTERNAL_SPANNER_METADATA_DECORATOR_H diff --git a/google/cloud/spanner/internal/spanner_stub.cc b/google/cloud/spanner/internal/spanner_stub.cc index 5fe853065e92f..4b4be22900fbc 100644 --- a/google/cloud/spanner/internal/spanner_stub.cc +++ b/google/cloud/spanner/internal/spanner_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/spanner/internal/spanner_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/spanner/v1/spanner.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_internal { @@ -256,3 +259,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/internal/spanner_stub.h b/google/cloud/spanner/internal/spanner_stub.h index a494d2e088241..54037402ed126 100644 --- a/google/cloud/spanner/internal/spanner_stub.h +++ b/google/cloud/spanner/internal/spanner_stub.h @@ -25,10 +25,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/spanner/v1/spanner.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_internal { @@ -222,4 +225,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_INTERNAL_SPANNER_STUB_H diff --git a/google/cloud/spanner/internal/spanner_stub_factory_test.cc b/google/cloud/spanner/internal/spanner_stub_factory_test.cc index 65b1c3c45514c..b6315d1de8c26 100644 --- a/google/cloud/spanner/internal/spanner_stub_factory_test.cc +++ b/google/cloud/spanner/internal/spanner_stub_factory_test.cc @@ -112,7 +112,6 @@ TEST(DecorateSpannerStub, Logging) { Contains(AllOf(HasSubstr("CreateSession"), HasSubstr("fail")))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanNamed; @@ -168,7 +167,6 @@ TEST(DecorateSpannerStub, TracingDisabled) { EXPECT_THAT(span_catcher->GetSpans(), IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/spanner/internal/spanner_tracing_stub.cc b/google/cloud/spanner/internal/spanner_tracing_stub.cc index 4e40897a4a5ba..b927b9b9a5783 100644 --- a/google/cloud/spanner/internal/spanner_tracing_stub.cc +++ b/google/cloud/spanner/internal/spanner_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SpannerTracingStub::SpannerTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -242,18 +243,14 @@ SpannerTracingStub::AsyncExecuteSql( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSpannerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/spanner/internal/spanner_tracing_stub.h b/google/cloud/spanner/internal/spanner_tracing_stub.h index e2ca3b3d1b58b..9abf3bc8dc530 100644 --- a/google/cloud/spanner/internal/spanner_tracing_stub.h +++ b/google/cloud/spanner/internal/spanner_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace spanner_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SpannerTracingStub : public SpannerStub { public: ~SpannerTracingStub() override = default; @@ -127,8 +128,6 @@ class SpannerTracingStub : public SpannerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -143,4 +142,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_INTERNAL_SPANNER_TRACING_STUB_H diff --git a/google/cloud/spanner/internal/status_utils.cc b/google/cloud/spanner/internal/status_utils.cc index cf01d5da5d108..e2c69451d7e16 100644 --- a/google/cloud/spanner/internal/status_utils.cc +++ b/google/cloud/spanner/internal/status_utils.cc @@ -14,12 +14,12 @@ #include "google/cloud/spanner/internal/status_utils.h" #include "google/cloud/grpc_error_delegate.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/status_payload_keys.h" #include "absl/strings/match.h" -#include -#include -#include +#include "absl/strings/str_cat.h" +#include "google/rpc/error_details.pb.h" +#include "google/rpc/status.pb.h" +#include "google/spanner/v1/spanner.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/spanner/internal/transaction_impl.h b/google/cloud/spanner/internal/transaction_impl.h index a289abe039e64..abcb33a07ca98 100644 --- a/google/cloud/spanner/internal/transaction_impl.h +++ b/google/cloud/spanner/internal/transaction_impl.h @@ -20,7 +20,7 @@ #include "google/cloud/internal/invoke_result.h" #include "google/cloud/internal/port_platform.h" #include "google/cloud/status_or.h" -#include +#include "google/spanner/v1/transaction.pb.h" #include #include #include diff --git a/google/cloud/spanner/interval.cc b/google/cloud/spanner/interval.cc index b8baaf131ae39..8fcb122471d41 100644 --- a/google/cloud/spanner/interval.cc +++ b/google/cloud/spanner/interval.cc @@ -13,13 +13,13 @@ // limitations under the License. #include "google/cloud/spanner/interval.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/time_utils.h" #include "absl/strings/ascii.h" #include "absl/strings/match.h" #include "absl/strings/numbers.h" #include "absl/strings/str_format.h" +#include "absl/strings/str_replace.h" #include "absl/strings/string_view.h" #include "absl/strings/strip.h" #include "absl/time/time.h" diff --git a/google/cloud/spanner/keys.cc b/google/cloud/spanner/keys.cc index 333a3877e0cbe..2e54ce36142b4 100644 --- a/google/cloud/spanner/keys.cc +++ b/google/cloud/spanner/keys.cc @@ -14,8 +14,8 @@ #include "google/cloud/spanner/keys.h" #include "google/cloud/spanner/value.h" +#include "google/spanner/v1/keys.pb.h" #include -#include namespace google { namespace cloud { diff --git a/google/cloud/spanner/keys.h b/google/cloud/spanner/keys.h index d674baf040ddd..3f61463fc828e 100644 --- a/google/cloud/spanner/keys.h +++ b/google/cloud/spanner/keys.h @@ -17,7 +17,7 @@ #include "google/cloud/spanner/value.h" #include "google/cloud/spanner/version.h" -#include +#include "google/spanner/v1/keys.pb.h" #include #include diff --git a/google/cloud/spanner/keys_test.cc b/google/cloud/spanner/keys_test.cc index 139de6f11db7d..dfda69ac6b0ea 100644 --- a/google/cloud/spanner/keys_test.cc +++ b/google/cloud/spanner/keys_test.cc @@ -14,8 +14,8 @@ #include "google/cloud/spanner/keys.h" #include "google/cloud/testing_util/is_proto_equal.h" +#include "google/spanner/v1/keys.pb.h" #include -#include #include #include #include diff --git a/google/cloud/spanner/mocks/mock_database_admin_connection.h b/google/cloud/spanner/mocks/mock_database_admin_connection.h deleted file mode 100644 index 0ce3c7188d016..0000000000000 --- a/google/cloud/spanner/mocks/mock_database_admin_connection.h +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_SPANNER_MOCKS_MOCK_DATABASE_ADMIN_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_MOCKS_MOCK_DATABASE_ADMIN_CONNECTION_H - -#include "google/cloud/spanner/database_admin_connection.h" -#include "google/cloud/spanner/version.h" -#include - -namespace google { -namespace cloud { -namespace spanner_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * A class to mock `google::cloud::spanner::DatabaseAdminConnection`. - * - * Application developers may want to test their code with simulated responses, - * including errors from a `spanner::DatabaseAdminClient`. To do so, construct a - * `spanner::DatabaseAdminClient` with an instance of this class. Then use the - * Google Test framework functions to program the behavior of this mock. - */ -class MockDatabaseAdminConnection - : public google::cloud::spanner::DatabaseAdminConnection { - public: - MOCK_METHOD(future>, - CreateDatabase, (CreateDatabaseParams), (override)); - MOCK_METHOD(StatusOr, - GetDatabase, (GetDatabaseParams), (override)); - MOCK_METHOD( - StatusOr, - GetDatabaseDdl, (GetDatabaseDdlParams), (override)); - MOCK_METHOD( - future>, - UpdateDatabase, (UpdateDatabaseParams), (override)); - MOCK_METHOD(Status, DropDatabase, (DropDatabaseParams), (override)); - MOCK_METHOD(spanner::ListDatabaseRange, ListDatabases, (ListDatabasesParams), - (override)); - MOCK_METHOD(future>, - RestoreDatabase, (RestoreDatabaseParams), (override)); - MOCK_METHOD(StatusOr, GetIamPolicy, - (GetIamPolicyParams), (override)); - MOCK_METHOD(StatusOr, SetIamPolicy, - (SetIamPolicyParams), (override)); - MOCK_METHOD(StatusOr, - TestIamPermissions, (TestIamPermissionsParams), (override)); - MOCK_METHOD(future>, - CreateBackup, (CreateBackupParams), (override)); - MOCK_METHOD(StatusOr, GetBackup, - (GetBackupParams), (override)); - MOCK_METHOD(Status, DeleteBackup, (DeleteBackupParams), (override)); - MOCK_METHOD(spanner::ListBackupsRange, ListBackups, (ListBackupsParams), - (override)); - MOCK_METHOD(StatusOr, - UpdateBackup, (UpdateBackupParams), (override)); - MOCK_METHOD(spanner::ListBackupOperationsRange, ListBackupOperations, - (ListBackupOperationsParams), (override)); - MOCK_METHOD(spanner::ListDatabaseOperationsRange, ListDatabaseOperations, - (ListDatabaseOperationsParams), (override)); -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_MOCKS_MOCK_DATABASE_ADMIN_CONNECTION_H diff --git a/google/cloud/spanner/mocks/mock_instance_admin_connection.h b/google/cloud/spanner/mocks/mock_instance_admin_connection.h deleted file mode 100644 index 6afdcb472dea2..0000000000000 --- a/google/cloud/spanner/mocks/mock_instance_admin_connection.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_SPANNER_MOCKS_MOCK_INSTANCE_ADMIN_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_MOCKS_MOCK_INSTANCE_ADMIN_CONNECTION_H - -#include "google/cloud/spanner/instance_admin_connection.h" -#include "google/cloud/spanner/version.h" -#include - -namespace google { -namespace cloud { -namespace spanner_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -/** - * A class to mock `google::cloud::spanner::InstanceAdminConnection`. - * - * Application developers may want to test their code with simulated responses, - * including errors from a `spanner::InstanceAdminClient`. To do so, construct a - * `spanner::InstanceAdminClient` with an instance of this class. Then use the - * Google Test framework functions to program the behavior of this mock. - */ -class MockInstanceAdminConnection - : public google::cloud::spanner::InstanceAdminConnection { - public: - MOCK_METHOD(StatusOr, - GetInstance, (GetInstanceParams), (override)); - MOCK_METHOD(future>, - CreateInstance, (CreateInstanceParams), (override)); - MOCK_METHOD(future>, - UpdateInstance, (UpdateInstanceParams), (override)); - MOCK_METHOD(Status, DeleteInstance, (DeleteInstanceParams), (override)); - MOCK_METHOD(StatusOr, - GetInstanceConfig, (GetInstanceConfigParams), (override)); - MOCK_METHOD(spanner::ListInstanceConfigsRange, ListInstanceConfigs, - (ListInstanceConfigsParams), (override)); - MOCK_METHOD(spanner::ListInstancesRange, ListInstances, (ListInstancesParams), - (override)); - MOCK_METHOD(StatusOr, GetIamPolicy, - (GetIamPolicyParams), (override)); - MOCK_METHOD(StatusOr, SetIamPolicy, - (SetIamPolicyParams), (override)); - MOCK_METHOD(StatusOr, - TestIamPermissions, (TestIamPermissionsParams), (override)); -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace spanner_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_MOCKS_MOCK_INSTANCE_ADMIN_CONNECTION_H diff --git a/google/cloud/spanner/mocks/row.h b/google/cloud/spanner/mocks/row.h index 1ff5b5102377d..62782965ba76f 100644 --- a/google/cloud/spanner/mocks/row.h +++ b/google/cloud/spanner/mocks/row.h @@ -18,6 +18,7 @@ #include "google/cloud/spanner/row.h" #include "google/cloud/spanner/value.h" #include "google/cloud/version.h" +#include #include #include #include @@ -27,9 +28,6 @@ namespace cloud { namespace spanner_mocks { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -// TODO(#9086): Delete this when the MakeRow() implementation is moved here. -#include "google/cloud/internal/disable_deprecation_warnings.inc" - /** * Creates a `spanner::Row` with the specified column names and values. * @@ -41,7 +39,14 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN */ inline spanner::Row MakeRow( std::vector> pairs) { - return spanner::MakeTestRow(std::move(pairs)); + auto values = std::vector{}; + auto columns = std::make_shared>(); + for (auto& p : pairs) { + values.emplace_back(std::move(p.second)); + columns->emplace_back(std::move(p.first)); + } + return spanner_internal::RowFriend::MakeRow(std::move(values), + std::move(columns)); } /** @@ -58,12 +63,14 @@ inline spanner::Row MakeRow( */ template spanner::Row MakeRow(Ts&&... ts) { - return spanner::MakeTestRow(std::forward(ts)...); + auto columns = std::make_shared>(); + for (std::size_t i = 0; i < sizeof...(ts); ++i) { + columns->emplace_back(std::to_string(i)); + } + std::vector v{spanner::Value(std::forward(ts))...}; + return spanner_internal::RowFriend::MakeRow(std::move(v), std::move(columns)); } -// TODO(#9086): Delete this when the MakeRow() implementation is moved here. -#include "google/cloud/internal/diagnostics_pop.inc" - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_mocks } // namespace cloud diff --git a/google/cloud/spanner/mutations.h b/google/cloud/spanner/mutations.h index d28a5161b4dfa..e342406680926 100644 --- a/google/cloud/spanner/mutations.h +++ b/google/cloud/spanner/mutations.h @@ -18,7 +18,7 @@ #include "google/cloud/spanner/keys.h" #include "google/cloud/spanner/value.h" #include "google/cloud/spanner/version.h" -#include +#include "google/spanner/v1/mutation.pb.h" #include #include diff --git a/google/cloud/spanner/options.h b/google/cloud/spanner/options.h index 663b605ae17ce..f749c73914da3 100644 --- a/google/cloud/spanner/options.h +++ b/google/cloud/spanner/options.h @@ -77,7 +77,8 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN * * @ingroup google-cloud-spanner-options */ -struct EnableMultiplexedSessionOption { +struct GOOGLE_CLOUD_CPP_DEPRECATED("Multiplex Sessions are always enabled") + EnableMultiplexedSessionOption { using Type = absl::monostate; }; @@ -156,7 +157,8 @@ struct SessionCreatorRoleOption { * * @ingroup google-cloud-spanner-options */ -struct SessionPoolMinSessionsOption { +struct GOOGLE_CLOUD_CPP_DEPRECATED("Option not used with Multiplex Sessions") + SessionPoolMinSessionsOption { using Type = int; }; @@ -168,7 +170,8 @@ struct SessionPoolMinSessionsOption { * * @ingroup google-cloud-spanner-options */ -struct SessionPoolMaxSessionsPerChannelOption { +struct GOOGLE_CLOUD_CPP_DEPRECATED("Option not used with Multiplex Sessions") + SessionPoolMaxSessionsPerChannelOption { using Type = int; }; @@ -180,12 +183,14 @@ struct SessionPoolMaxSessionsPerChannelOption { * * @ingroup google-cloud-spanner-options */ -struct SessionPoolMaxIdleSessionsOption { +struct GOOGLE_CLOUD_CPP_DEPRECATED("Option not used with Multiplex Sessions") + SessionPoolMaxIdleSessionsOption { using Type = int; }; /// Action to take when the session pool is exhausted. -enum class ActionOnExhaustion { +enum class GOOGLE_CLOUD_CPP_DEPRECATED( + "Option not used with Multiplex Sessions") ActionOnExhaustion { /// Wait until a session is returned to the pool. kBlock, /// Fail the operation immediately. @@ -198,7 +203,8 @@ enum class ActionOnExhaustion { * * @ingroup google-cloud-spanner-options */ -struct SessionPoolActionOnExhaustionOption { +struct GOOGLE_CLOUD_CPP_DEPRECATED("Option not used with Multiplex Sessions") + SessionPoolActionOnExhaustionOption { using Type = spanner::ActionOnExhaustion; }; @@ -232,7 +238,8 @@ struct LockHintOption { * * @ingroup google-cloud-spanner-options */ -struct SessionPoolKeepAliveIntervalOption { +struct GOOGLE_CLOUD_CPP_DEPRECATED("Option not used with Multiplex Sessions") + SessionPoolKeepAliveIntervalOption { using Type = std::chrono::seconds; }; @@ -253,11 +260,9 @@ struct SessionPoolLabelsOption { /** * List of all SessionPool options. Pass to `spanner::MakeConnection()`. */ -using SessionPoolOptionList = OptionList< - RouteToLeaderOption, SessionCreatorRoleOption, SessionPoolMinSessionsOption, - SessionPoolMaxSessionsPerChannelOption, SessionPoolMaxIdleSessionsOption, - SessionPoolActionOnExhaustionOption, SessionPoolKeepAliveIntervalOption, - SessionPoolLabelsOption, EnableMultiplexedSessionOption>; +using SessionPoolOptionList = + OptionList; /** * Option for `google::cloud::Options` to set the optimizer version used in an @@ -425,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/partition_options.cc b/google/cloud/spanner/partition_options.cc index b96c3f0ad648c..3e8195c51e699 100644 --- a/google/cloud/spanner/partition_options.cc +++ b/google/cloud/spanner/partition_options.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/partition_options.h" #include "google/cloud/spanner/options.h" @@ -72,3 +72,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/partition_options.h b/google/cloud/spanner/partition_options.h index 3e71aa00531a3..f22f9b9512e29 100644 --- a/google/cloud/spanner/partition_options.h +++ b/google/cloud/spanner/partition_options.h @@ -19,7 +19,7 @@ #include "google/cloud/optional.h" #include "google/cloud/options.h" #include "absl/types/optional.h" -#include +#include "google/spanner/v1/spanner.pb.h" #include namespace google { diff --git a/google/cloud/spanner/proto_enum_test.cc b/google/cloud/spanner/proto_enum_test.cc index 5b40fcd2a3165..ec6f7755d003f 100644 --- a/google/cloud/spanner/proto_enum_test.cc +++ b/google/cloud/spanner/proto_enum_test.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "google/cloud/spanner/proto_enum.h" -#include +#include "protos/google/cloud/spanner/testing/singer.pb.h" #include #include #include diff --git a/google/cloud/spanner/proto_message_test.cc b/google/cloud/spanner/proto_message_test.cc index 64221ee6291f0..dba85c9774272 100644 --- a/google/cloud/spanner/proto_message_test.cc +++ b/google/cloud/spanner/proto_message_test.cc @@ -14,7 +14,7 @@ #include "google/cloud/spanner/proto_message.h" #include "google/cloud/testing_util/is_proto_equal.h" -#include +#include "protos/google/cloud/spanner/testing/singer.pb.h" #include #include diff --git a/google/cloud/spanner/query_options.cc b/google/cloud/spanner/query_options.cc index ce682dabfea1a..2d04751078508 100644 --- a/google/cloud/spanner/query_options.cc +++ b/google/cloud/spanner/query_options.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/query_options.h" #include "google/cloud/spanner/options.h" @@ -54,3 +54,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/query_options_test.cc b/google/cloud/spanner/query_options_test.cc index d5389a76220b0..3a60d897656d6 100644 --- a/google/cloud/spanner/query_options_test.cc +++ b/google/cloud/spanner/query_options_test.cc @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "google/cloud/internal/disable_deprecation_warnings.inc" #include "google/cloud/spanner/query_options.h" #include "google/cloud/spanner/options.h" #include "google/cloud/spanner/version.h" @@ -132,3 +133,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/query_partition.cc b/google/cloud/spanner/query_partition.cc index 1449f21aa42dd..289ba4c2fd0f0 100644 --- a/google/cloud/spanner/query_partition.cc +++ b/google/cloud/spanner/query_partition.cc @@ -11,10 +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/internal/disable_deprecation_warnings.inc" #include "google/cloud/spanner/query_partition.h" #include "google/cloud/internal/make_status.h" -#include +#include "google/spanner/v1/spanner.pb.h" namespace google { namespace cloud { @@ -133,3 +133,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/query_partition_test.cc b/google/cloud/spanner/query_partition_test.cc index 3e6cc8a87936b..cd34b2deda4a2 100644 --- a/google/cloud/spanner/query_partition_test.cc +++ b/google/cloud/spanner/query_partition_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/query_partition.h" #include "google/cloud/spanner/connection.h" #include "google/cloud/spanner/testing/matchers.h" @@ -176,3 +176,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/quickstart/.bazelrc b/google/cloud/spanner/quickstart/.bazelrc index f8f4bb3e07a87..1ccef142904e8 100644 --- a/google/cloud/spanner/quickstart/.bazelrc +++ b/google/cloud/spanner/quickstart/.bazelrc @@ -15,19 +15,12 @@ # 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 +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 - -#Our quickstarts do not yet support bzlmod -build --noenable_bzlmod 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/CMakeLists.txt b/google/cloud/spanner/quickstart/CMakeLists.txt index 21bacf3deae92..b4df11cba8859 100644 --- a/google/cloud/spanner/quickstart/CMakeLists.txt +++ b/google/cloud/spanner/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This CMake file shows how to use the Cloud Spanner C++ client from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-spanner-quickstart CXX) find_package(google_cloud_cpp_spanner REQUIRED) diff --git a/google/cloud/spanner/quickstart/MODULE.bazel b/google/cloud/spanner/quickstart/MODULE.bazel new file mode 100644 index 0000000000000..e47bfb6fa8af0 --- /dev/null +++ b/google/cloud/spanner/quickstart/MODULE.bazel @@ -0,0 +1,20 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +module( + name = "quickstart", + version = "0.0.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 3393e12dde791..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 = "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/spanner/quickstart/bazel/BUILD.bazel b/google/cloud/spanner/quickstart/bazel/BUILD.bazel new file mode 100644 index 0000000000000..9d3c52804de76 --- /dev/null +++ b/google/cloud/spanner/quickstart/bazel/BUILD.bazel @@ -0,0 +1,17 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 v2 + +package(default_visibility = ["//:__subpackages__"]) diff --git a/google/cloud/spanner/quickstart/bazel/remove_upb_c_rules.patch b/google/cloud/spanner/quickstart/bazel/remove_upb_c_rules.patch new file mode 100644 index 0000000000000..43b077224c29d --- /dev/null +++ b/google/cloud/spanner/quickstart/bazel/remove_upb_c_rules.patch @@ -0,0 +1,124 @@ +diff --git google/api/expr/v1alpha1/BUILD.bazel google/api/expr/v1alpha1/BUILD.bazel +index 9bed46809..197e5249c 100644 +--- google/api/expr/v1alpha1/BUILD.bazel ++++ google/api/expr/v1alpha1/BUILD.bazel +@@ -233,32 +233,32 @@ cc_proto_library( + ############################################################################## + # upb + ############################################################################## +-load( +- "@com_google_googleapis_imports//:imports.bzl", +- "upb_c_proto_library", +-) +- +-upb_c_proto_library( +- name = "checked_upb_proto", +- deps = [":checked_proto"], +-) +- +-upb_c_proto_library( +- name = "eval_upb_proto", +- deps = [":eval_proto"], +-) +- +-upb_c_proto_library( +- name = "explain_upb_proto", +- deps = [":explain_proto"], +-) +- +-upb_c_proto_library( +- name = "syntax_upb_proto", +- deps = [":syntax_proto"], +-) +- +-upb_c_proto_library( +- name = "value_upb_proto", +- deps = [":value_proto"], +-) ++#load( ++ #"@com_google_googleapis_imports//:imports.bzl", ++ #"upb_c_proto_library", ++#) ++# ++#upb_c_proto_library( ++ #name = "checked_upb_proto", ++ #deps = [":checked_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "eval_upb_proto", ++ #deps = [":eval_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "explain_upb_proto", ++ #deps = [":explain_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "syntax_upb_proto", ++ #deps = [":syntax_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "value_upb_proto", ++ #deps = [":value_proto"], ++#) +diff --git google/rpc/BUILD.bazel google/rpc/BUILD.bazel +index 31fd6457d..c38f00c46 100644 +--- google/rpc/BUILD.bazel ++++ google/rpc/BUILD.bazel +@@ -11,7 +11,7 @@ load( + "php_proto_library", + "py_gapic_assembly_pkg", + "py_proto_library", +- "upb_c_proto_library", ++ #"upb_c_proto_library", + ) + load("@rules_proto//proto:defs.bzl", "proto_library") + +@@ -104,15 +104,15 @@ cc_proto_library( + deps = [":status_proto"], + ) + +-upb_c_proto_library( +- name = "code_upb_proto", +- deps = [":code_proto"], +-) ++#upb_c_proto_library( ++ #name = "code_upb_proto", ++ #deps = [":code_proto"], ++#) + +-upb_c_proto_library( +- name = "status_upb_proto", +- deps = [":status_proto"], +-) ++#upb_c_proto_library( ++ #name = "status_upb_proto", ++ #deps = [":status_proto"], ++#) + + py_proto_library( + name = "code_py_proto", +diff --git repository_rules.bzl repository_rules.bzl +index 2f87ad682..2ab3bd054 100644 +--- repository_rules.bzl ++++ repository_rules.bzl +@@ -224,11 +224,11 @@ def switched_rules_by_language( + # + # upb + # +- rules["upb_c_proto_library"] = _switch( +- upb, +- "@com_google_protobuf//bazel:upb_c_proto_library.bzl", +- "upb_c_proto_library", +- ) ++ #rules["upb_c_proto_library"] = _switch( ++ # upb, ++ # "@com_google_protobuf//bazel:upb_c_proto_library.bzl", ++ # "upb_c_proto_library", ++ #) + + # + # PHP diff --git a/google/cloud/spanner/quickstart/quickstart.cc b/google/cloud/spanner/quickstart/quickstart.cc index 20637df503486..e4b6a644a4924 100644 --- a/google/cloud/spanner/quickstart/quickstart.cc +++ b/google/cloud/spanner/quickstart/quickstart.cc @@ -11,6 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" //! [all] #include "google/cloud/spanner/client.h" @@ -41,3 +42,4 @@ int main(int argc, char* argv[]) { return 0; } //! [all] +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/read_options.cc b/google/cloud/spanner/read_options.cc index 82ce337c63f4b..75cb195f4959e 100644 --- a/google/cloud/spanner/read_options.cc +++ b/google/cloud/spanner/read_options.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/read_options.h" #include "google/cloud/spanner/options.h" @@ -58,3 +58,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/read_partition.cc b/google/cloud/spanner/read_partition.cc index 6c2a7c18cf31c..dab03a30d97f6 100644 --- a/google/cloud/spanner/read_partition.cc +++ b/google/cloud/spanner/read_partition.cc @@ -11,10 +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/internal/disable_deprecation_warnings.inc" #include "google/cloud/spanner/read_partition.h" #include "google/cloud/internal/make_status.h" -#include +#include "google/spanner/v1/spanner.pb.h" namespace google { namespace cloud { @@ -148,3 +148,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/read_partition.h b/google/cloud/spanner/read_partition.h index bb90e84b4e0a0..9709e18524ec0 100644 --- a/google/cloud/spanner/read_partition.h +++ b/google/cloud/spanner/read_partition.h @@ -19,7 +19,7 @@ #include "google/cloud/spanner/keys.h" #include "google/cloud/spanner/version.h" #include "google/cloud/status_or.h" -#include +#include "google/spanner/v1/spanner.pb.h" #include #include diff --git a/google/cloud/spanner/read_partition_test.cc b/google/cloud/spanner/read_partition_test.cc index 14866aa7e5f9f..0e5481ae944b9 100644 --- a/google/cloud/spanner/read_partition_test.cc +++ b/google/cloud/spanner/read_partition_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/read_partition.h" #include "google/cloud/spanner/testing/matchers.h" #include "google/cloud/testing_util/is_proto_equal.h" @@ -234,3 +234,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/results.cc b/google/cloud/spanner/results.cc index 93ecd924dcd79..b81ce553dfb23 100644 --- a/google/cloud/spanner/results.cc +++ b/google/cloud/spanner/results.cc @@ -14,7 +14,7 @@ #include "google/cloud/spanner/results.h" #include "absl/types/optional.h" -#include +#include "google/spanner/v1/result_set.pb.h" #include #include #include diff --git a/google/cloud/spanner/results.h b/google/cloud/spanner/results.h index b46f92e79b67d..9600792af5378 100644 --- a/google/cloud/spanner/results.h +++ b/google/cloud/spanner/results.h @@ -20,7 +20,7 @@ #include "google/cloud/spanner/version.h" #include "google/cloud/optional.h" #include "absl/types/optional.h" -#include +#include "google/spanner/v1/spanner.pb.h" #include #include #include diff --git a/google/cloud/spanner/results_test.cc b/google/cloud/spanner/results_test.cc index f182c799f9e74..a9d53bcb68c29 100644 --- a/google/cloud/spanner/results_test.cc +++ b/google/cloud/spanner/results_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/results.h" #include "google/cloud/spanner/mocks/mock_spanner_connection.h" #include "google/cloud/spanner/mocks/row.h" @@ -261,3 +261,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/row.cc b/google/cloud/spanner/row.cc index 9db2726b5f477..4b02d98823f9e 100644 --- a/google/cloud/spanner/row.cc +++ b/google/cloud/spanner/row.cc @@ -35,16 +35,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END namespace spanner { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -Row MakeTestRow(std::vector> pairs) { - auto values = std::vector{}; - auto columns = std::make_shared>(); - for (auto& p : pairs) { - values.emplace_back(std::move(p.second)); - columns->emplace_back(std::move(p.first)); - } - return spanner_internal::RowFriend::MakeRow(std::move(values), - std::move(columns)); -} Row::Row() : Row({}, std::make_shared>()) {} diff --git a/google/cloud/spanner/row.h b/google/cloud/spanner/row.h index d73624551d1b6..3a288ab6b6b43 100644 --- a/google/cloud/spanner/row.h +++ b/google/cloud/spanner/row.h @@ -200,41 +200,6 @@ class Row { std::shared_ptr const> columns_; }; -/** - * Creates a `Row` with the specified column names and values. - * - * This overload accepts a vector of pairs, allowing the caller to specify both - * the column names and the `Value` that goes in each column. - * - * This function is intended for application developers who are mocking the - * results of a `Client::ExecuteQuery` call. - */ -GOOGLE_CLOUD_CPP_SPANNER_MAKE_TEST_ROW_DEPRECATED() -Row MakeTestRow(std::vector> pairs); - -/** - * Creates a `Row` with `Value`s created from the given arguments and with - * auto-generated column names. - * - * This overload accepts a variadic list of arguments that will be used to - * create the `Value`s in the row. The column names will be implicitly - * generated, the first column being "0", the second "1", and so on, - * corresponding to the argument's position. - * - * This function is intended for application developers who are mocking the - * results of a `Client::ExecuteQuery` call. - */ -template -GOOGLE_CLOUD_CPP_SPANNER_MAKE_TEST_ROW_DEPRECATED() -Row MakeTestRow(Ts&&... ts) { - auto columns = std::make_shared>(); - for (std::size_t i = 0; i < sizeof...(ts); ++i) { - columns->emplace_back(std::to_string(i)); - } - std::vector v{Value(std::forward(ts))...}; - return spanner_internal::RowFriend::MakeRow(std::move(v), std::move(columns)); -} - /** * A `RowStreamIterator` is an _Input Iterator_ (see below) that returns a * sequence of `StatusOr` objects. diff --git a/google/cloud/spanner/samples/BUILD.bazel b/google/cloud/spanner/samples/BUILD.bazel index fb52fefabf98e..ee79fbbc03e95 100644 --- a/google/cloud/spanner/samples/BUILD.bazel +++ b/google/cloud/spanner/samples/BUILD.bazel @@ -34,7 +34,7 @@ licenses(["notice"]) # Apache 2.0 "//:universe_domain", "//google/cloud/spanner:spanner_client_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "//protos:system_includes", + # "//protos:system_includes", "//protos/google/cloud/spanner/testing:singer_cc_proto", ], ) for test in spanner_client_integration_samples] @@ -47,6 +47,6 @@ licenses(["notice"]) # Apache 2.0 "//:spanner", "//google/cloud/spanner:spanner_client_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in spanner_client_unit_samples] diff --git a/google/cloud/spanner/samples/client_samples.cc b/google/cloud/spanner/samples/client_samples.cc index d38b404221777..468bd1096fd32 100644 --- a/google/cloud/spanner/samples/client_samples.cc +++ b/google/cloud/spanner/samples/client_samples.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/admin/database_admin_client.h" #include "google/cloud/spanner/admin/instance_admin_client.h" #include "google/cloud/spanner/client.h" @@ -140,3 +140,4 @@ int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) }); return example.Run(argc, argv); } +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/samples/graph_samples.cc b/google/cloud/spanner/samples/graph_samples.cc index f01d2ac9009b5..547751b31df14 100644 --- a/google/cloud/spanner/samples/graph_samples.cc +++ b/google/cloud/spanner/samples/graph_samples.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/admin/database_admin_client.h" #include "google/cloud/spanner/admin/database_admin_options.h" #include "google/cloud/spanner/client.h" @@ -21,6 +21,7 @@ #include "google/cloud/spanner/timestamp.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/log.h" +#include "absl/time/clock.h" #include #include #include @@ -606,3 +607,4 @@ int main(int ac, char* av[]) try { std::cerr << ex.what() << "\n"; return 1; } +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/samples/mock_execute_query.cc b/google/cloud/spanner/samples/mock_execute_query.cc index 3927168aaa68a..0086a05858645 100644 --- a/google/cloud/spanner/samples/mock_execute_query.cc +++ b/google/cloud/spanner/samples/mock_execute_query.cc @@ -11,6 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" //! [all] @@ -108,3 +109,4 @@ TEST(MockSpannerClient, SuccessfulExecuteQuery) { } // namespace //! [all] +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/samples/postgresql_samples.cc b/google/cloud/spanner/samples/postgresql_samples.cc index 6f8e8f83bcf8a..073fcbe11a9e7 100644 --- a/google/cloud/spanner/samples/postgresql_samples.cc +++ b/google/cloud/spanner/samples/postgresql_samples.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/admin/database_admin_client.h" #include "google/cloud/spanner/bytes.h" #include "google/cloud/spanner/client.h" @@ -1321,3 +1321,4 @@ int main(int ac, char* av[]) try { std::cerr << "\n" << ex.what() << "\n"; return 1; } +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/samples/samples.cc b/google/cloud/spanner/samples/samples.cc index 0d73109fae0c2..e3abff8e3cc04 100644 --- a/google/cloud/spanner/samples/samples.cc +++ b/google/cloud/spanner/samples/samples.cc @@ -11,6 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" //! [START spanner_quickstart] #include "google/cloud/spanner/client.h" @@ -42,7 +43,7 @@ #include "absl/time/clock.h" #include "absl/time/time.h" #include "absl/types/optional.h" -#include +#include "protos/google/cloud/spanner/testing/singer.pb.h" #include #include #include @@ -3538,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; @@ -5257,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), @@ -6280,3 +6347,4 @@ int main(int ac, char* av[]) try { std::cerr << ex.what() << "\n"; return 1; } +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/session_pool_options_test.cc b/google/cloud/spanner/session_pool_options_test.cc index 2fc944f4237ff..3ed25147a965f 100644 --- a/google/cloud/spanner/session_pool_options_test.cc +++ b/google/cloud/spanner/session_pool_options_test.cc @@ -11,7 +11,7 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/session_pool_options.h" #include "google/cloud/spanner/version.h" #include @@ -82,3 +82,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/spanner_client_unit_tests.bzl b/google/cloud/spanner/spanner_client_unit_tests.bzl index ad40b1f607946..6a501b33fdeb2 100644 --- a/google/cloud/spanner/spanner_client_unit_tests.bzl +++ b/google/cloud/spanner/spanner_client_unit_tests.bzl @@ -19,16 +19,11 @@ spanner_client_unit_tests = [ "backup_test.cc", "bytes_test.cc", - "client_options_test.cc", "client_test.cc", "commit_options_test.cc", "connection_options_test.cc", "create_instance_request_builder_test.cc", - "database_admin_client_test.cc", - "database_admin_connection_test.cc", "database_test.cc", - "instance_admin_client_test.cc", - "instance_admin_connection_test.cc", "instance_test.cc", "internal/connection_impl_test.cc", "internal/database_admin_logging_test.cc", diff --git a/google/cloud/spanner/sql_statement.h b/google/cloud/spanner/sql_statement.h index 4c3d80dd60cf7..ae33854a22ac3 100644 --- a/google/cloud/spanner/sql_statement.h +++ b/google/cloud/spanner/sql_statement.h @@ -18,7 +18,7 @@ #include "google/cloud/spanner/value.h" #include "google/cloud/spanner/version.h" #include "google/cloud/status_or.h" -#include +#include "google/spanner/v1/spanner.pb.h" #include #include #include diff --git a/google/cloud/spanner/testing/database_integration_test.cc b/google/cloud/spanner/testing/database_integration_test.cc index 5586420ec952b..c2f1184ce0bad 100644 --- a/google/cloud/spanner/testing/database_integration_test.cc +++ b/google/cloud/spanner/testing/database_integration_test.cc @@ -17,10 +17,10 @@ #include "google/cloud/spanner/testing/cleanup_stale_databases.h" #include "google/cloud/spanner/testing/pick_random_instance.h" #include "google/cloud/spanner/testing/random_database_name.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/testing_util/status_matchers.h" -#include +#include "absl/strings/str_cat.h" +#include "protos/google/cloud/spanner/testing/singer.pb.h" #include #include diff --git a/google/cloud/spanner/testing/pick_instance_config.h b/google/cloud/spanner/testing/pick_instance_config.h index 26b7cd0875af2..b5d5959677a1e 100644 --- a/google/cloud/spanner/testing/pick_instance_config.h +++ b/google/cloud/spanner/testing/pick_instance_config.h @@ -18,7 +18,7 @@ #include "google/cloud/spanner/version.h" #include "google/cloud/internal/random.h" #include "google/cloud/project.h" -#include +#include "google/spanner/admin/instance/v1/spanner_instance_admin.pb.h" #include #include diff --git a/google/cloud/spanner/testing/status_utils.cc b/google/cloud/spanner/testing/status_utils.cc index 1629f3110bd60..4ee7904e9caed 100644 --- a/google/cloud/spanner/testing/status_utils.cc +++ b/google/cloud/spanner/testing/status_utils.cc @@ -14,10 +14,10 @@ #include "google/cloud/spanner/testing/status_utils.h" #include "google/cloud/grpc_error_delegate.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include -#include -#include +#include "absl/strings/str_cat.h" +#include "google/rpc/error_details.pb.h" +#include "google/rpc/status.pb.h" +#include "google/spanner/v1/spanner.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/spanner/timestamp.h b/google/cloud/spanner/timestamp.h index 11d05023f7277..27ec07416fafe 100644 --- a/google/cloud/spanner/timestamp.h +++ b/google/cloud/spanner/timestamp.h @@ -18,7 +18,7 @@ #include "google/cloud/spanner/version.h" #include "google/cloud/status_or.h" #include "absl/time/time.h" -#include +#include "google/protobuf/timestamp.pb.h" #include #include #include diff --git a/google/cloud/spanner/timestamp_test.cc b/google/cloud/spanner/timestamp_test.cc index 09262ec45c741..31dad46016ce4 100644 --- a/google/cloud/spanner/timestamp_test.cc +++ b/google/cloud/spanner/timestamp_test.cc @@ -14,7 +14,7 @@ #include "google/cloud/spanner/timestamp.h" #include "google/cloud/testing_util/status_matchers.h" -#include +#include "google/protobuf/timestamp.pb.h" #include #include #include diff --git a/google/cloud/spanner/transaction.cc b/google/cloud/spanner/transaction.cc index 31771427fddda..2a9b4803c11c5 100644 --- a/google/cloud/spanner/transaction.cc +++ b/google/cloud/spanner/transaction.cc @@ -11,12 +11,12 @@ // WITHOUT 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/disable_deprecation_warnings.inc" #include "google/cloud/spanner/transaction.h" #include "google/cloud/spanner/internal/session.h" #include "google/cloud/spanner/internal/transaction_impl.h" #include "google/cloud/spanner/options.h" -#include +#include "google/protobuf/duration.pb.h" namespace google { namespace cloud { @@ -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; } @@ -225,3 +233,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_internal } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/transaction.h b/google/cloud/spanner/transaction.h index 6bb76fe700ddc..f709eb6c88341 100644 --- a/google/cloud/spanner/transaction.h +++ b/google/cloud/spanner/transaction.h @@ -19,7 +19,7 @@ #include "google/cloud/spanner/timestamp.h" #include "google/cloud/spanner/version.h" #include "absl/types/optional.h" -#include +#include "google/spanner/v1/transaction.pb.h" #include #include #include diff --git a/google/cloud/spanner/transaction_test.cc b/google/cloud/spanner/transaction_test.cc index 32fe36539c7a5..11577fa494a87 100644 --- a/google/cloud/spanner/transaction_test.cc +++ b/google/cloud/spanner/transaction_test.cc @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "google/cloud/internal/disable_deprecation_warnings.inc" #include "google/cloud/spanner/transaction.h" #include "google/cloud/spanner/internal/session.h" #include "google/cloud/spanner/options.h" @@ -216,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); @@ -262,3 +315,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner } // namespace cloud } // namespace google +#include "google/cloud/internal/diagnostics_pop.inc" diff --git a/google/cloud/spanner/update_instance_request_builder.h b/google/cloud/spanner/update_instance_request_builder.h index 46ee9ba4654ac..3b7b126ae6756 100644 --- a/google/cloud/spanner/update_instance_request_builder.h +++ b/google/cloud/spanner/update_instance_request_builder.h @@ -17,9 +17,9 @@ #include "google/cloud/spanner/instance.h" #include "google/cloud/spanner/version.h" +#include "google/spanner/admin/instance/v1/spanner_instance_admin.pb.h" #include #include -#include #include #include diff --git a/google/cloud/spanner/value.h b/google/cloud/spanner/value.h index 261af303fc21f..b6db62634de18 100644 --- a/google/cloud/spanner/value.h +++ b/google/cloud/spanner/value.h @@ -34,9 +34,9 @@ #include "google/cloud/status_or.h" #include "absl/time/civil_time.h" #include "absl/types/optional.h" -#include +#include "google/protobuf/struct.pb.h" +#include "google/spanner/v1/type.pb.h" #include -#include #include #include #include diff --git a/google/cloud/spanner/value_test.cc b/google/cloud/spanner/value_test.cc index 7d68ff7a46923..073d38a7800b0 100644 --- a/google/cloud/spanner/value_test.cc +++ b/google/cloud/spanner/value_test.cc @@ -18,7 +18,7 @@ #include "google/cloud/testing_util/status_matchers.h" #include "absl/time/time.h" #include "absl/types/optional.h" -#include +#include "protos/google/cloud/spanner/testing/singer.pb.h" #include #include #include diff --git a/google/cloud/spanner/version.h b/google/cloud/spanner/version.h index c1ceabf71de99..f297cdfa8b6ff 100644 --- a/google/cloud/spanner/version.h +++ b/google/cloud/spanner/version.h @@ -76,8 +76,6 @@ int constexpr Version() { return google::cloud::version(); } std::string VersionString(); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -// TODO(#7463) - remove backwards compatibility namespaces -namespace v1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace spanner } // namespace cloud } // namespace google diff --git a/google/cloud/speech/BUILD.bazel b/google/cloud/speech/BUILD.bazel index 7f211c3fcf76e..5b1fc246d16d4 100644 --- a/google/cloud/speech/BUILD.bazel +++ b/google/cloud/speech/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/speech/v1:speech_cc_grpc", - "@com_google_googleapis//google/cloud/speech/v2:speech_cc_grpc", + "@googleapis//google/cloud/speech/v1:speech_cc_grpc", + "@googleapis//google/cloud/speech/v2:speech_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/speech/CMakeLists.txt b/google/cloud/speech/CMakeLists.txt index 91b886f41f8ad..65a95f2c110e0 100644 --- a/google/cloud/speech/CMakeLists.txt +++ b/google/cloud/speech/CMakeLists.txt @@ -18,7 +18,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( speech "Cloud Speech-to-Text API" - SERVICE_DIRS "__EMPTY__" "v1/" "v2/" + SERVICE_DIRS "v1/" "v2/" BACKWARDS_COMPAT_PROTO_TARGETS "cloud_speech_protos") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) diff --git a/google/cloud/speech/mocks/mock_speech_connection.h b/google/cloud/speech/mocks/mock_speech_connection.h deleted file mode 100644 index 1b150b6eca38c..0000000000000 --- a/google/cloud/speech/mocks/mock_speech_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/speech/v1/cloud_speech.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_MOCKS_MOCK_SPEECH_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_MOCKS_MOCK_SPEECH_CONNECTION_H - -#include "google/cloud/speech/speech_connection.h" -#include "google/cloud/speech/v1/mocks/mock_speech_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in speech_v1_mocks instead of the aliases -/// defined in this namespace. -namespace speech_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use speech_v1_mocks::MockSpeechConnection directly. -using ::google::cloud::speech_v1_mocks::MockSpeechConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace speech_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_MOCKS_MOCK_SPEECH_CONNECTION_H diff --git a/google/cloud/speech/quickstart/.bazelrc b/google/cloud/speech/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/speech/quickstart/.bazelrc +++ b/google/cloud/speech/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/speech/quickstart/CMakeLists.txt index f00678d80604a..e6d304bf1a678 100644 --- a/google/cloud/speech/quickstart/CMakeLists.txt +++ b/google/cloud/speech/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Speech-to-Text API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-speech-quickstart CXX) find_package(google_cloud_cpp_speech REQUIRED) diff --git a/google/cloud/speech/quickstart/WORKSPACE.bazel b/google/cloud/speech/quickstart/WORKSPACE.bazel index a5a6a225d7d71..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 = "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/speech/speech_client.h b/google/cloud/speech/speech_client.h deleted file mode 100644 index dfa416c22b2cd..0000000000000 --- a/google/cloud/speech/speech_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/speech/v1/cloud_speech.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_CLIENT_H - -#include "google/cloud/speech/speech_connection.h" -#include "google/cloud/speech/v1/speech_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in speech_v1 instead of the aliases defined in -/// this namespace. -namespace speech { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use speech_v1::SpeechClient directly. -using ::google::cloud::speech_v1::SpeechClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace speech -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_CLIENT_H diff --git a/google/cloud/speech/speech_connection.h b/google/cloud/speech/speech_connection.h deleted file mode 100644 index 31f37b4489bc3..0000000000000 --- a/google/cloud/speech/speech_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/speech/v1/cloud_speech.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_CONNECTION_H - -#include "google/cloud/speech/speech_connection_idempotency_policy.h" -#include "google/cloud/speech/v1/speech_connection.h" - -namespace google { -namespace cloud { -namespace speech { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use speech_v1::MakeSpeechConnection directly. -using ::google::cloud::speech_v1::MakeSpeechConnection; - -/// @deprecated Use speech_v1::SpeechConnection directly. -using ::google::cloud::speech_v1::SpeechConnection; - -/// @deprecated Use speech_v1::SpeechLimitedErrorCountRetryPolicy directly. -using ::google::cloud::speech_v1::SpeechLimitedErrorCountRetryPolicy; - -/// @deprecated Use speech_v1::SpeechLimitedTimeRetryPolicy directly. -using ::google::cloud::speech_v1::SpeechLimitedTimeRetryPolicy; - -/// @deprecated Use speech_v1::SpeechRetryPolicy directly. -using ::google::cloud::speech_v1::SpeechRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace speech -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_CONNECTION_H diff --git a/google/cloud/speech/speech_connection_idempotency_policy.h b/google/cloud/speech/speech_connection_idempotency_policy.h deleted file mode 100644 index eebf1175cd0af..0000000000000 --- a/google/cloud/speech/speech_connection_idempotency_policy.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/speech/v1/cloud_speech.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/speech/v1/speech_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace speech { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use speech_v1::MakeDefaultSpeechConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::speech_v1::MakeDefaultSpeechConnectionIdempotencyPolicy; - -/// @deprecated Use speech_v1::SpeechConnectionIdempotencyPolicy directly. -using ::google::cloud::speech_v1::SpeechConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace speech -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/speech/speech_options.h b/google/cloud/speech/speech_options.h deleted file mode 100644 index 4e7ac87acf863..0000000000000 --- a/google/cloud/speech/speech_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/speech/v1/cloud_speech.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_OPTIONS_H - -#include "google/cloud/speech/speech_connection.h" -#include "google/cloud/speech/speech_connection_idempotency_policy.h" -#include "google/cloud/speech/v1/speech_options.h" - -namespace google { -namespace cloud { -namespace speech { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use speech_v1::SpeechPollingPolicyOption directly. -using ::google::cloud::speech_v1::SpeechPollingPolicyOption; - -/// @deprecated Use speech_v1::SpeechBackoffPolicyOption directly. -using ::google::cloud::speech_v1::SpeechBackoffPolicyOption; - -/// @deprecated Use speech_v1::SpeechConnectionIdempotencyPolicyOption directly. -using ::google::cloud::speech_v1::SpeechConnectionIdempotencyPolicyOption; - -/// @deprecated Use speech_v1::SpeechPolicyOptionList directly. -using ::google::cloud::speech_v1::SpeechPolicyOptionList; - -/// @deprecated Use speech_v1::SpeechRetryPolicyOption directly. -using ::google::cloud::speech_v1::SpeechRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace speech -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_OPTIONS_H diff --git a/google/cloud/speech/v1/adaptation_connection.h b/google/cloud/speech/v1/adaptation_connection.h index 8a05fec6aaa07..9364d15c5dd69 100644 --- a/google/cloud/speech/v1/adaptation_connection.h +++ b/google/cloud/speech/v1/adaptation_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_ADAPTATION_CONNECTION_H #include "google/cloud/speech/v1/adaptation_connection_idempotency_policy.h" +#include "google/cloud/speech/v1/cloud_speech_adaptation.pb.h" #include "google/cloud/speech/v1/internal/adaptation_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/speech/v1/adaptation_connection_idempotency_policy.h b/google/cloud/speech/v1/adaptation_connection_idempotency_policy.h index d9eb54dd36a7e..d419b05a43ae6 100644 --- a/google/cloud/speech/v1/adaptation_connection_idempotency_policy.h +++ b/google/cloud/speech/v1/adaptation_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_ADAPTATION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_ADAPTATION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/speech/v1/cloud_speech_adaptation.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/speech/v1/internal/adaptation_auth_decorator.cc b/google/cloud/speech/v1/internal/adaptation_auth_decorator.cc index 200f07d57167b..31a7d75fb0547 100644 --- a/google/cloud/speech/v1/internal/adaptation_auth_decorator.cc +++ b/google/cloud/speech/v1/internal/adaptation_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/speech/v1/cloud_speech_adaptation.proto #include "google/cloud/speech/v1/internal/adaptation_auth_decorator.h" -#include +#include "google/cloud/speech/v1/cloud_speech_adaptation.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -136,3 +139,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v1/internal/adaptation_auth_decorator.h b/google/cloud/speech/v1/internal/adaptation_auth_decorator.h index 325d4dfef53c8..15df0ab82544d 100644 --- a/google/cloud/speech/v1/internal/adaptation_auth_decorator.h +++ b/google/cloud/speech/v1/internal/adaptation_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_ADAPTATION_AUTH_DECORATOR_H diff --git a/google/cloud/speech/v1/internal/adaptation_logging_decorator.cc b/google/cloud/speech/v1/internal/adaptation_logging_decorator.cc index a84b5d529af17..c97d92bfc1ad0 100644 --- a/google/cloud/speech/v1/internal/adaptation_logging_decorator.cc +++ b/google/cloud/speech/v1/internal/adaptation_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/speech/v1/cloud_speech_adaptation.proto #include "google/cloud/speech/v1/internal/adaptation_logging_decorator.h" +#include "google/cloud/speech/v1/cloud_speech_adaptation.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -183,3 +186,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v1/internal/adaptation_logging_decorator.h b/google/cloud/speech/v1/internal/adaptation_logging_decorator.h index 872ee8a445b1a..252c152a2b0fc 100644 --- a/google/cloud/speech/v1/internal/adaptation_logging_decorator.h +++ b/google/cloud/speech/v1/internal/adaptation_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -103,4 +106,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_ADAPTATION_LOGGING_DECORATOR_H diff --git a/google/cloud/speech/v1/internal/adaptation_metadata_decorator.cc b/google/cloud/speech/v1/internal/adaptation_metadata_decorator.cc index 312dd4892dd78..474dcffadf686 100644 --- a/google/cloud/speech/v1/internal/adaptation_metadata_decorator.cc +++ b/google/cloud/speech/v1/internal/adaptation_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/speech/v1/cloud_speech_adaptation.proto #include "google/cloud/speech/v1/internal/adaptation_metadata_decorator.h" +#include "google/cloud/speech/v1/cloud_speech_adaptation.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 speech_v1_internal { @@ -166,3 +170,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v1/internal/adaptation_metadata_decorator.h b/google/cloud/speech/v1/internal/adaptation_metadata_decorator.h index b4fd52ac1e2a4..4ec0761665659 100644 --- a/google/cloud/speech/v1/internal/adaptation_metadata_decorator.h +++ b/google/cloud/speech/v1/internal/adaptation_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -108,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_ADAPTATION_METADATA_DECORATOR_H diff --git a/google/cloud/speech/v1/internal/adaptation_option_defaults.cc b/google/cloud/speech/v1/internal/adaptation_option_defaults.cc index 8194a2517a33f..8a7e8f1d4e073 100644 --- a/google/cloud/speech/v1/internal/adaptation_option_defaults.cc +++ b/google/cloud/speech/v1/internal/adaptation_option_defaults.cc @@ -40,7 +40,7 @@ Options AdaptationDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - speech_v1::AdaptationLimitedTimeRetryPolicy(std::chrono::minutes(30)) + speech_v1::AdaptationLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/speech/v1/internal/adaptation_stub.cc b/google/cloud/speech/v1/internal/adaptation_stub.cc index d344e21695ea1..d1db9b09d88eb 100644 --- a/google/cloud/speech/v1/internal/adaptation_stub.cc +++ b/google/cloud/speech/v1/internal/adaptation_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/speech/v1/cloud_speech_adaptation.proto #include "google/cloud/speech/v1/internal/adaptation_stub.h" +#include "google/cloud/speech/v1/cloud_speech_adaptation.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -175,3 +178,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v1/internal/adaptation_stub.h b/google/cloud/speech/v1/internal/adaptation_stub.h index d3958e3be9163..b1f233581b4c8 100644 --- a/google/cloud/speech/v1/internal/adaptation_stub.h +++ b/google/cloud/speech/v1/internal/adaptation_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_ADAPTATION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_ADAPTATION_STUB_H +#include "google/cloud/speech/v1/cloud_speech_adaptation.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -164,4 +167,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_ADAPTATION_STUB_H diff --git a/google/cloud/speech/v1/internal/adaptation_stub_factory.cc b/google/cloud/speech/v1/internal/adaptation_stub_factory.cc index 79612b3e89d64..023ba00dbd0ea 100644 --- a/google/cloud/speech/v1/internal/adaptation_stub_factory.cc +++ b/google/cloud/speech/v1/internal/adaptation_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/speech/v1/cloud_speech_adaptation.proto #include "google/cloud/speech/v1/internal/adaptation_stub_factory.h" +#include "google/cloud/speech/v1/cloud_speech_adaptation.grpc.pb.h" #include "google/cloud/speech/v1/internal/adaptation_auth_decorator.h" #include "google/cloud/speech/v1/internal/adaptation_logging_decorator.h" #include "google/cloud/speech/v1/internal/adaptation_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v1/internal/adaptation_stub_factory.h b/google/cloud/speech/v1/internal/adaptation_stub_factory.h index 1ab092324deb0..1bd643a5e59fd 100644 --- a/google/cloud/speech/v1/internal/adaptation_stub_factory.h +++ b/google/cloud/speech/v1/internal/adaptation_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_ADAPTATION_STUB_FACTORY_H diff --git a/google/cloud/speech/v1/internal/adaptation_tracing_connection.cc b/google/cloud/speech/v1/internal/adaptation_tracing_connection.cc index c257af21efe52..3fe8e44619f92 100644 --- a/google/cloud/speech/v1/internal/adaptation_tracing_connection.cc +++ b/google/cloud/speech/v1/internal/adaptation_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace speech_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AdaptationTracingConnection::AdaptationTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -145,16 +143,12 @@ AdaptationTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAdaptationTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/speech/v1/internal/adaptation_tracing_connection.h b/google/cloud/speech/v1/internal/adaptation_tracing_connection.h index 8a9fe20d67bc5..9e67ac2fac0a0 100644 --- a/google/cloud/speech/v1/internal/adaptation_tracing_connection.h +++ b/google/cloud/speech/v1/internal/adaptation_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace speech_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AdaptationTracingConnection : public speech_v1::AdaptationConnection { public: ~AdaptationTracingConnection() override = default; @@ -85,8 +83,6 @@ class AdaptationTracingConnection : public speech_v1::AdaptationConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/speech/v1/internal/adaptation_tracing_stub.cc b/google/cloud/speech/v1/internal/adaptation_tracing_stub.cc index b215d4dfa5ba4..8201a7c92abf4 100644 --- a/google/cloud/speech/v1/internal/adaptation_tracing_stub.cc +++ b/google/cloud/speech/v1/internal/adaptation_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - AdaptationTracingStub::AdaptationTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -173,18 +174,14 @@ StatusOr AdaptationTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeAdaptationTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v1/internal/adaptation_tracing_stub.h b/google/cloud/speech/v1/internal/adaptation_tracing_stub.h index c90f7b696b072..1e7aef731bea7 100644 --- a/google/cloud/speech/v1/internal/adaptation_tracing_stub.h +++ b/google/cloud/speech/v1/internal/adaptation_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class AdaptationTracingStub : public AdaptationStub { public: ~AdaptationTracingStub() override = default; @@ -99,8 +100,6 @@ class AdaptationTracingStub : public AdaptationStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -115,4 +114,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_ADAPTATION_TRACING_STUB_H diff --git a/google/cloud/speech/v1/internal/speech_auth_decorator.cc b/google/cloud/speech/v1/internal/speech_auth_decorator.cc index 757ce0eefb590..afc692bd6b766 100644 --- a/google/cloud/speech/v1/internal/speech_auth_decorator.cc +++ b/google/cloud/speech/v1/internal/speech_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/speech/v1/cloud_speech.proto #include "google/cloud/speech/v1/internal/speech_auth_decorator.h" +#include "google/cloud/speech/v1/cloud_speech.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -143,3 +146,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v1/internal/speech_auth_decorator.h b/google/cloud/speech/v1/internal/speech_auth_decorator.h index 6cbdf1ee3f2ce..13902c8966063 100644 --- a/google/cloud/speech/v1/internal/speech_auth_decorator.h +++ b/google/cloud/speech/v1/internal/speech_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/speech/v1/internal/speech_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 speech_v1_internal { @@ -93,4 +96,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_SPEECH_AUTH_DECORATOR_H diff --git a/google/cloud/speech/v1/internal/speech_connection_impl.h b/google/cloud/speech/v1/internal/speech_connection_impl.h index 471dc894e89eb..940fa78ef6bef 100644 --- a/google/cloud/speech/v1/internal/speech_connection_impl.h +++ b/google/cloud/speech/v1/internal/speech_connection_impl.h @@ -33,7 +33,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/speech/v1/internal/speech_logging_decorator.cc b/google/cloud/speech/v1/internal/speech_logging_decorator.cc index 98066d2c2aa89..186cbacb0f8a5 100644 --- a/google/cloud/speech/v1/internal/speech_logging_decorator.cc +++ b/google/cloud/speech/v1/internal/speech_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/speech/v1/cloud_speech.proto #include "google/cloud/speech/v1/internal/speech_logging_decorator.h" +#include "google/cloud/speech/v1/cloud_speech.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -165,3 +168,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v1/internal/speech_logging_decorator.h b/google/cloud/speech/v1/internal/speech_logging_decorator.h index 5bcb5e9c441ae..d274faf2d89c7 100644 --- a/google/cloud/speech/v1/internal/speech_logging_decorator.h +++ b/google/cloud/speech/v1/internal/speech_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/speech/v1/internal/speech_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 speech_v1_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_SPEECH_LOGGING_DECORATOR_H diff --git a/google/cloud/speech/v1/internal/speech_metadata_decorator.cc b/google/cloud/speech/v1/internal/speech_metadata_decorator.cc index 2663bc75c9c76..082bc87274325 100644 --- a/google/cloud/speech/v1/internal/speech_metadata_decorator.cc +++ b/google/cloud/speech/v1/internal/speech_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/speech/v1/cloud_speech.proto #include "google/cloud/speech/v1/internal/speech_metadata_decorator.h" +#include "google/cloud/speech/v1/cloud_speech.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 speech_v1_internal { @@ -138,3 +142,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v1/internal/speech_metadata_decorator.h b/google/cloud/speech/v1/internal/speech_metadata_decorator.h index 4d0e90d1fded6..399384b36c717 100644 --- a/google/cloud/speech/v1/internal/speech_metadata_decorator.h +++ b/google/cloud/speech/v1/internal/speech_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/speech/v1/internal/speech_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 speech_v1_internal { @@ -98,4 +101,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_SPEECH_METADATA_DECORATOR_H diff --git a/google/cloud/speech/v1/internal/speech_option_defaults.cc b/google/cloud/speech/v1/internal/speech_option_defaults.cc index bc018547e1850..b83e2f78d4da1 100644 --- a/google/cloud/speech/v1/internal/speech_option_defaults.cc +++ b/google/cloud/speech/v1/internal/speech_option_defaults.cc @@ -40,7 +40,7 @@ Options SpeechDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - speech_v1::SpeechLimitedTimeRetryPolicy(std::chrono::minutes(30)) + speech_v1::SpeechLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/speech/v1/internal/speech_stub.cc b/google/cloud/speech/v1/internal/speech_stub.cc index f1d635cb54942..fbafb523c9320 100644 --- a/google/cloud/speech/v1/internal/speech_stub.cc +++ b/google/cloud/speech/v1/internal/speech_stub.cc @@ -17,14 +17,17 @@ // source: google/cloud/speech/v1/cloud_speech.proto #include "google/cloud/speech/v1/internal/speech_stub.h" +#include "google/cloud/speech/v1/cloud_speech.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 +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -157,3 +160,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v1/internal/speech_stub.h b/google/cloud/speech/v1/internal/speech_stub.h index 404d8dab06263..e8abaf2cfa925 100644 --- a/google/cloud/speech/v1/internal/speech_stub.h +++ b/google/cloud/speech/v1/internal/speech_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_SPEECH_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_SPEECH_STUB_H +#include "google/cloud/speech/v1/cloud_speech.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -150,4 +153,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_SPEECH_STUB_H diff --git a/google/cloud/speech/v1/internal/speech_stub_factory.cc b/google/cloud/speech/v1/internal/speech_stub_factory.cc index 3005e1eb4be59..df06268764f24 100644 --- a/google/cloud/speech/v1/internal/speech_stub_factory.cc +++ b/google/cloud/speech/v1/internal/speech_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/speech/v1/cloud_speech.proto #include "google/cloud/speech/v1/internal/speech_stub_factory.h" +#include "google/cloud/speech/v1/cloud_speech.grpc.pb.h" #include "google/cloud/speech/v1/internal/speech_auth_decorator.h" #include "google/cloud/speech/v1/internal/speech_logging_decorator.h" #include "google/cloud/speech/v1/internal/speech_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v1/internal/speech_stub_factory.h b/google/cloud/speech/v1/internal/speech_stub_factory.h index 124fe32c9efef..faa61fff7d15c 100644 --- a/google/cloud/speech/v1/internal/speech_stub_factory.h +++ b/google/cloud/speech/v1/internal/speech_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_SPEECH_STUB_FACTORY_H diff --git a/google/cloud/speech/v1/internal/speech_tracing_connection.cc b/google/cloud/speech/v1/internal/speech_tracing_connection.cc index 4d680eadd758c..8cc000ee16af2 100644 --- a/google/cloud/speech/v1/internal/speech_tracing_connection.cc +++ b/google/cloud/speech/v1/internal/speech_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace speech_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SpeechTracingConnection::SpeechTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -96,15 +94,11 @@ StatusOr SpeechTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSpeechTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/speech/v1/internal/speech_tracing_connection.h b/google/cloud/speech/v1/internal/speech_tracing_connection.h index 705d74ddccfac..a48357f0652e9 100644 --- a/google/cloud/speech/v1/internal/speech_tracing_connection.h +++ b/google/cloud/speech/v1/internal/speech_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace speech_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SpeechTracingConnection : public speech_v1::SpeechConnection { public: ~SpeechTracingConnection() override = default; @@ -71,8 +69,6 @@ class SpeechTracingConnection : public speech_v1::SpeechConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/speech/v1/internal/speech_tracing_stub.cc b/google/cloud/speech/v1/internal/speech_tracing_stub.cc index a204626591229..2a510e3ae37bb 100644 --- a/google/cloud/speech/v1/internal/speech_tracing_stub.cc +++ b/google/cloud/speech/v1/internal/speech_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SpeechTracingStub::SpeechTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -140,18 +141,14 @@ future SpeechTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSpeechTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v1/internal/speech_tracing_stub.h b/google/cloud/speech/v1/internal/speech_tracing_stub.h index 32ebbf32b9335..a17e67f184d2b 100644 --- a/google/cloud/speech/v1/internal/speech_tracing_stub.h +++ b/google/cloud/speech/v1/internal/speech_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SpeechTracingStub : public SpeechStub { public: ~SpeechTracingStub() override = default; @@ -88,8 +89,6 @@ class SpeechTracingStub : public SpeechStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -104,4 +103,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_INTERNAL_SPEECH_TRACING_STUB_H diff --git a/google/cloud/speech/v1/speech_client.h b/google/cloud/speech/v1/speech_client.h index 321d1ffc0b8a5..b7cf192cefcc9 100644 --- a/google/cloud/speech/v1/speech_client.h +++ b/google/cloud/speech/v1/speech_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/speech/v1/speech_connection.h b/google/cloud/speech/v1/speech_connection.h index 706e288c0bf9c..1924d14d2df94 100644 --- a/google/cloud/speech/v1/speech_connection.h +++ b/google/cloud/speech/v1/speech_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_SPEECH_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_SPEECH_CONNECTION_H +#include "google/cloud/speech/v1/cloud_speech.pb.h" #include "google/cloud/speech/v1/internal/speech_retry_traits.h" #include "google/cloud/speech/v1/speech_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -31,8 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/speech/v1/speech_connection_idempotency_policy.h b/google/cloud/speech/v1/speech_connection_idempotency_policy.h index 470090a8926c9..bf3cd2dc53d7c 100644 --- a/google/cloud/speech/v1/speech_connection_idempotency_policy.h +++ b/google/cloud/speech/v1/speech_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_SPEECH_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V1_SPEECH_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/speech/v1/cloud_speech.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/speech/v2/internal/speech_auth_decorator.cc b/google/cloud/speech/v2/internal/speech_auth_decorator.cc index 2548d0a5fa3f6..111590625104a 100644 --- a/google/cloud/speech/v2/internal/speech_auth_decorator.cc +++ b/google/cloud/speech/v2/internal/speech_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/speech/v2/cloud_speech.proto #include "google/cloud/speech/v2/internal/speech_auth_decorator.h" +#include "google/cloud/speech/v2/cloud_speech.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v2_internal { @@ -579,3 +582,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v2/internal/speech_auth_decorator.h b/google/cloud/speech/v2/internal/speech_auth_decorator.h index b097cbdba1322..443be8e939467 100644 --- a/google/cloud/speech/v2/internal/speech_auth_decorator.h +++ b/google/cloud/speech/v2/internal/speech_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/speech/v2/internal/speech_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 speech_v2_internal { @@ -285,4 +288,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V2_INTERNAL_SPEECH_AUTH_DECORATOR_H diff --git a/google/cloud/speech/v2/internal/speech_connection_impl.h b/google/cloud/speech/v2/internal/speech_connection_impl.h index c25fde9d80893..85e09d6232ac6 100644 --- a/google/cloud/speech/v2/internal/speech_connection_impl.h +++ b/google/cloud/speech/v2/internal/speech_connection_impl.h @@ -33,7 +33,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/speech/v2/internal/speech_logging_decorator.cc b/google/cloud/speech/v2/internal/speech_logging_decorator.cc index 0ef00f263e678..a0bc0150288f8 100644 --- a/google/cloud/speech/v2/internal/speech_logging_decorator.cc +++ b/google/cloud/speech/v2/internal/speech_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/speech/v2/cloud_speech.proto #include "google/cloud/speech/v2/internal/speech_logging_decorator.h" +#include "google/cloud/speech/v2/cloud_speech.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v2_internal { @@ -666,3 +669,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v2/internal/speech_logging_decorator.h b/google/cloud/speech/v2/internal/speech_logging_decorator.h index b5e97c3951d00..d8d3d919c15f3 100644 --- a/google/cloud/speech/v2/internal/speech_logging_decorator.h +++ b/google/cloud/speech/v2/internal/speech_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/speech/v2/internal/speech_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 speech_v2_internal { @@ -286,4 +289,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V2_INTERNAL_SPEECH_LOGGING_DECORATOR_H diff --git a/google/cloud/speech/v2/internal/speech_metadata_decorator.cc b/google/cloud/speech/v2/internal/speech_metadata_decorator.cc index 4c0b2cbd76e80..50a8983cd1c8a 100644 --- a/google/cloud/speech/v2/internal/speech_metadata_decorator.cc +++ b/google/cloud/speech/v2/internal/speech_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/speech/v2/cloud_speech.proto #include "google/cloud/speech/v2/internal/speech_metadata_decorator.h" +#include "google/cloud/speech/v2/cloud_speech.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 speech_v2_internal { @@ -492,3 +496,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v2/internal/speech_metadata_decorator.h b/google/cloud/speech/v2/internal/speech_metadata_decorator.h index a30d439aa5954..5e6bc06721d56 100644 --- a/google/cloud/speech/v2/internal/speech_metadata_decorator.h +++ b/google/cloud/speech/v2/internal/speech_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/speech/v2/internal/speech_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 speech_v2_internal { @@ -290,4 +293,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V2_INTERNAL_SPEECH_METADATA_DECORATOR_H diff --git a/google/cloud/speech/v2/internal/speech_option_defaults.cc b/google/cloud/speech/v2/internal/speech_option_defaults.cc index 3bcf9bcc30ca1..672a549abd692 100644 --- a/google/cloud/speech/v2/internal/speech_option_defaults.cc +++ b/google/cloud/speech/v2/internal/speech_option_defaults.cc @@ -19,9 +19,9 @@ #include "google/cloud/speech/v2/internal/speech_option_defaults.h" #include "google/cloud/speech/v2/speech_connection.h" #include "google/cloud/speech/v2/speech_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/populate_common_options.h" #include "google/cloud/internal/populate_grpc_options.h" +#include "absl/strings/str_cat.h" #include #include @@ -43,7 +43,7 @@ Options SpeechDefaultOptions(std::string const& location, Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - speech_v2::SpeechLimitedTimeRetryPolicy(std::chrono::minutes(30)) + speech_v2::SpeechLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/speech/v2/internal/speech_stub.cc b/google/cloud/speech/v2/internal/speech_stub.cc index 03e60e63c6850..f769f92aca4cd 100644 --- a/google/cloud/speech/v2/internal/speech_stub.cc +++ b/google/cloud/speech/v2/internal/speech_stub.cc @@ -17,14 +17,17 @@ // source: google/cloud/speech/v2/cloud_speech.proto #include "google/cloud/speech/v2/internal/speech_stub.h" +#include "google/cloud/speech/v2/cloud_speech.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 +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v2_internal { @@ -643,3 +646,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v2/internal/speech_stub.h b/google/cloud/speech/v2/internal/speech_stub.h index 8b3da0a839668..f9207ec3193c7 100644 --- a/google/cloud/speech/v2/internal/speech_stub.h +++ b/google/cloud/speech/v2/internal/speech_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V2_INTERNAL_SPEECH_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V2_INTERNAL_SPEECH_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/speech/v2/cloud_speech.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v2_internal { @@ -526,4 +529,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V2_INTERNAL_SPEECH_STUB_H diff --git a/google/cloud/speech/v2/internal/speech_stub_factory.cc b/google/cloud/speech/v2/internal/speech_stub_factory.cc index 234472c27e88b..0ce95c3458ae4 100644 --- a/google/cloud/speech/v2/internal/speech_stub_factory.cc +++ b/google/cloud/speech/v2/internal/speech_stub_factory.cc @@ -17,6 +17,8 @@ // source: google/cloud/speech/v2/cloud_speech.proto #include "google/cloud/speech/v2/internal/speech_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/speech/v2/cloud_speech.grpc.pb.h" #include "google/cloud/speech/v2/internal/speech_auth_decorator.h" #include "google/cloud/speech/v2/internal/speech_logging_decorator.h" #include "google/cloud/speech/v2/internal/speech_metadata_decorator.h" @@ -28,12 +30,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v2_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v2/internal/speech_stub_factory.h b/google/cloud/speech/v2/internal/speech_stub_factory.h index 7e90e4b73e13d..e75b664abcb7a 100644 --- a/google/cloud/speech/v2/internal/speech_stub_factory.h +++ b/google/cloud/speech/v2/internal/speech_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V2_INTERNAL_SPEECH_STUB_FACTORY_H diff --git a/google/cloud/speech/v2/internal/speech_tracing_connection.cc b/google/cloud/speech/v2/internal/speech_tracing_connection.cc index 0efaeaa2e73f1..71d3b79454ff0 100644 --- a/google/cloud/speech/v2/internal/speech_tracing_connection.cc +++ b/google/cloud/speech/v2/internal/speech_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace speech_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SpeechTracingConnection::SpeechTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -555,15 +553,11 @@ Status SpeechTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSpeechTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/speech/v2/internal/speech_tracing_connection.h b/google/cloud/speech/v2/internal/speech_tracing_connection.h index 1c2fc7be4f0ed..43e16138e1995 100644 --- a/google/cloud/speech/v2/internal/speech_tracing_connection.h +++ b/google/cloud/speech/v2/internal/speech_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace speech_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SpeechTracingConnection : public speech_v2::SpeechConnection { public: ~SpeechTracingConnection() override = default; @@ -248,8 +246,6 @@ class SpeechTracingConnection : public speech_v2::SpeechConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/speech/v2/internal/speech_tracing_stub.cc b/google/cloud/speech/v2/internal/speech_tracing_stub.cc index 24199bfe37cba..ab756f7c455dd 100644 --- a/google/cloud/speech/v2/internal/speech_tracing_stub.cc +++ b/google/cloud/speech/v2/internal/speech_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SpeechTracingStub::SpeechTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -589,18 +590,14 @@ future SpeechTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSpeechTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace speech_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/speech/v2/internal/speech_tracing_stub.h b/google/cloud/speech/v2/internal/speech_tracing_stub.h index 61b985aa8c805..0d454e98a4cf7 100644 --- a/google/cloud/speech/v2/internal/speech_tracing_stub.h +++ b/google/cloud/speech/v2/internal/speech_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace speech_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SpeechTracingStub : public SpeechStub { public: ~SpeechTracingStub() override = default; @@ -280,8 +281,6 @@ class SpeechTracingStub : public SpeechStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -296,4 +295,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V2_INTERNAL_SPEECH_TRACING_STUB_H diff --git a/google/cloud/speech/v2/speech_client.h b/google/cloud/speech/v2/speech_client.h index 85a907350c3af..69c8b45ae008a 100644 --- a/google/cloud/speech/v2/speech_client.h +++ b/google/cloud/speech/v2/speech_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -805,8 +805,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.StreamingRecognizeRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1252} - /// [google.cloud.speech.v2.StreamingRecognizeResponse]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1617} + /// [google.cloud.speech.v2.StreamingRecognizeRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1278} + /// [google.cloud.speech.v2.StreamingRecognizeResponse]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1643} /// // clang-format on std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< @@ -865,10 +865,10 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.BatchRecognizeRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1279} - /// [google.cloud.speech.v2.BatchRecognizeRequest.config]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1308} - /// [google.cloud.speech.v2.BatchRecognizeRequest.config_mask]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1323} - /// [google.cloud.speech.v2.BatchRecognizeResponse]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1398} + /// [google.cloud.speech.v2.BatchRecognizeRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1305} + /// [google.cloud.speech.v2.BatchRecognizeRequest.config]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1334} + /// [google.cloud.speech.v2.BatchRecognizeRequest.config_mask]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1349} + /// [google.cloud.speech.v2.BatchRecognizeResponse]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1424} /// [google.cloud.speech.v2.Recognizer.default_recognition_config]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L631} /// // clang-format on @@ -932,8 +932,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.BatchRecognizeRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1279} - /// [google.cloud.speech.v2.BatchRecognizeResponse]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1398} + /// [google.cloud.speech.v2.BatchRecognizeRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1305} + /// [google.cloud.speech.v2.BatchRecognizeResponse]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1424} /// // clang-format on future> @@ -990,8 +990,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.Config]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1666} - /// [google.cloud.speech.v2.GetConfigRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1700} + /// [google.cloud.speech.v2.Config]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1692} + /// [google.cloud.speech.v2.GetConfigRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1726} /// // clang-format on StatusOr GetConfig(std::string const& name, @@ -1020,8 +1020,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.Config]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1666} - /// [google.cloud.speech.v2.GetConfigRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1700} + /// [google.cloud.speech.v2.Config]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1692} + /// [google.cloud.speech.v2.GetConfigRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1726} /// // clang-format on StatusOr GetConfig( @@ -1050,8 +1050,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.Config]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1666} - /// [google.cloud.speech.v2.UpdateConfigRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1712} + /// [google.cloud.speech.v2.Config]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1692} + /// [google.cloud.speech.v2.UpdateConfigRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1738} /// // clang-format on StatusOr UpdateConfig( @@ -1081,8 +1081,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.Config]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1666} - /// [google.cloud.speech.v2.UpdateConfigRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1712} + /// [google.cloud.speech.v2.Config]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1692} + /// [google.cloud.speech.v2.UpdateConfigRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1738} /// // clang-format on StatusOr UpdateConfig( @@ -1121,8 +1121,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.CreateCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1957} - /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1726} + /// [google.cloud.speech.v2.CreateCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1983} + /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1752} /// // clang-format on future> CreateCustomClass( @@ -1176,8 +1176,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.CreateCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1957} - /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1726} + /// [google.cloud.speech.v2.CreateCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1983} + /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1752} /// // clang-format on future> CreateCustomClass( @@ -1240,8 +1240,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1726} - /// [google.cloud.speech.v2.ListCustomClassesRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1984} + /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1752} + /// [google.cloud.speech.v2.ListCustomClassesRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2010} /// // clang-format on StreamRange ListCustomClasses( @@ -1279,8 +1279,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1726} - /// [google.cloud.speech.v2.ListCustomClassesRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1984} + /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1752} + /// [google.cloud.speech.v2.ListCustomClassesRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2010} /// // clang-format on StreamRange ListCustomClasses( @@ -1307,8 +1307,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1726} - /// [google.cloud.speech.v2.GetCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2028} + /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1752} + /// [google.cloud.speech.v2.GetCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2054} /// // clang-format on StatusOr GetCustomClass( @@ -1338,8 +1338,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1726} - /// [google.cloud.speech.v2.GetCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2028} + /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1752} + /// [google.cloud.speech.v2.GetCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2054} /// // clang-format on StatusOr GetCustomClass( @@ -1377,8 +1377,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1726} - /// [google.cloud.speech.v2.UpdateCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2041} + /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1752} + /// [google.cloud.speech.v2.UpdateCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2067} /// // clang-format on future> UpdateCustomClass( @@ -1430,8 +1430,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1726} - /// [google.cloud.speech.v2.UpdateCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2041} + /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1752} + /// [google.cloud.speech.v2.UpdateCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2067} /// // clang-format on future> UpdateCustomClass( @@ -1493,8 +1493,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1726} - /// [google.cloud.speech.v2.DeleteCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2060} + /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1752} + /// [google.cloud.speech.v2.DeleteCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2086} /// // clang-format on future> DeleteCustomClass( @@ -1544,8 +1544,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1726} - /// [google.cloud.speech.v2.DeleteCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2060} + /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1752} + /// [google.cloud.speech.v2.DeleteCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2086} /// // clang-format on future> DeleteCustomClass( @@ -1607,8 +1607,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1726} - /// [google.cloud.speech.v2.UndeleteCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2088} + /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1752} + /// [google.cloud.speech.v2.UndeleteCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2114} /// // clang-format on future> UndeleteCustomClass( @@ -1658,8 +1658,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1726} - /// [google.cloud.speech.v2.UndeleteCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2088} + /// [google.cloud.speech.v2.CustomClass]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1752} + /// [google.cloud.speech.v2.UndeleteCustomClassRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2114} /// // clang-format on future> UndeleteCustomClass( @@ -1726,8 +1726,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.CreatePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2111} - /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1829} + /// [google.cloud.speech.v2.CreatePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2137} + /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1855} /// // clang-format on future> CreatePhraseSet( @@ -1781,8 +1781,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.CreatePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2111} - /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1829} + /// [google.cloud.speech.v2.CreatePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2137} + /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1855} /// // clang-format on future> CreatePhraseSet( @@ -1845,8 +1845,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.ListPhraseSetsRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2138} - /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1829} + /// [google.cloud.speech.v2.ListPhraseSetsRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2164} + /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1855} /// // clang-format on StreamRange ListPhraseSets( @@ -1884,8 +1884,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.ListPhraseSetsRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2138} - /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1829} + /// [google.cloud.speech.v2.ListPhraseSetsRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2164} + /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1855} /// // clang-format on StreamRange ListPhraseSets( @@ -1912,8 +1912,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.GetPhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2181} - /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1829} + /// [google.cloud.speech.v2.GetPhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2207} + /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1855} /// // clang-format on StatusOr GetPhraseSet( @@ -1943,8 +1943,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.GetPhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2181} - /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1829} + /// [google.cloud.speech.v2.GetPhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2207} + /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1855} /// // clang-format on StatusOr GetPhraseSet( @@ -1981,8 +1981,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1829} - /// [google.cloud.speech.v2.UpdatePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2194} + /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1855} + /// [google.cloud.speech.v2.UpdatePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2220} /// // clang-format on future> UpdatePhraseSet( @@ -2034,8 +2034,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1829} - /// [google.cloud.speech.v2.UpdatePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2194} + /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1855} + /// [google.cloud.speech.v2.UpdatePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2220} /// // clang-format on future> UpdatePhraseSet( @@ -2096,8 +2096,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.DeletePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2212} - /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1829} + /// [google.cloud.speech.v2.DeletePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2238} + /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1855} /// // clang-format on future> DeletePhraseSet( @@ -2147,8 +2147,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.DeletePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2212} - /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1829} + /// [google.cloud.speech.v2.DeletePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2238} + /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1855} /// // clang-format on future> DeletePhraseSet( @@ -2209,8 +2209,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1829} - /// [google.cloud.speech.v2.UndeletePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2239} + /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1855} + /// [google.cloud.speech.v2.UndeletePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2265} /// // clang-format on future> UndeletePhraseSet( @@ -2260,8 +2260,8 @@ class SpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1829} - /// [google.cloud.speech.v2.UndeletePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2239} + /// [google.cloud.speech.v2.PhraseSet]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L1855} + /// [google.cloud.speech.v2.UndeletePhraseSetRequest]: @googleapis_reference_link{google/cloud/speech/v2/cloud_speech.proto#L2265} /// // clang-format on future> UndeletePhraseSet( @@ -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/speech/v2/speech_connection.h b/google/cloud/speech/v2/speech_connection.h index 99c252621fec5..d9c73527c6020 100644 --- a/google/cloud/speech/v2/speech_connection.h +++ b/google/cloud/speech/v2/speech_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V2_SPEECH_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V2_SPEECH_CONNECTION_H +#include "google/cloud/speech/v2/cloud_speech.pb.h" #include "google/cloud/speech/v2/internal/speech_retry_traits.h" #include "google/cloud/speech/v2/speech_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -31,8 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/speech/v2/speech_connection_idempotency_policy.h b/google/cloud/speech/v2/speech_connection_idempotency_policy.h index 61453cf20b41b..0289eae86aeed 100644 --- a/google/cloud/speech/v2/speech_connection_idempotency_policy.h +++ b/google/cloud/speech/v2/speech_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V2_SPEECH_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_V2_SPEECH_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/speech/v2/cloud_speech.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/sql/BUILD.bazel b/google/cloud/sql/BUILD.bazel index 8bcbb6aa9c84f..6eaf7edb26433 100644 --- a/google/cloud/sql/BUILD.bazel +++ b/google/cloud/sql/BUILD.bazel @@ -23,7 +23,7 @@ service_dirs = ["v1/"] src_dirs = service_dirs + [d + "internal/" for d in service_dirs] googleapis_deps = [ - "@com_google_googleapis//google/cloud/sql/v1:sql_cc_proto", + "@googleapis//google/cloud/sql/v1:sql_cc_proto", ] cc_gapic_library( diff --git a/google/cloud/sql/quickstart/.bazelrc b/google/cloud/sql/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/sql/quickstart/.bazelrc +++ b/google/cloud/sql/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/sql/quickstart/CMakeLists.txt index c27926332622d..9ce7962b349f1 100644 --- a/google/cloud/sql/quickstart/CMakeLists.txt +++ b/google/cloud/sql/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud SQL Admin API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-sql-quickstart CXX) find_package(google_cloud_cpp_sql REQUIRED) diff --git a/google/cloud/sql/quickstart/WORKSPACE.bazel b/google/cloud/sql/quickstart/WORKSPACE.bazel index 1429fc03688ca..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 = "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/sql/v1/internal/sql_available_database_versions_option_defaults.cc b/google/cloud/sql/v1/internal/sql_available_database_versions_option_defaults.cc index 9e5dcc8a1c67d..52bf2d9042a25 100644 --- a/google/cloud/sql/v1/internal/sql_available_database_versions_option_defaults.cc +++ b/google/cloud/sql/v1/internal/sql_available_database_versions_option_defaults.cc @@ -44,7 +44,7 @@ Options SqlAvailableDatabaseVersionsServiceDefaultOptions(Options options) { sql_v1::SqlAvailableDatabaseVersionsServiceRetryPolicyOption>()) { options.set( sql_v1::SqlAvailableDatabaseVersionsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/sql/v1/internal/sql_available_database_versions_rest_logging_decorator.h b/google/cloud/sql/v1/internal/sql_available_database_versions_rest_logging_decorator.h index cdc4d80649199..962f53d41c0b1 100644 --- a/google/cloud/sql/v1/internal/sql_available_database_versions_rest_logging_decorator.h +++ b/google/cloud/sql/v1/internal/sql_available_database_versions_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_AVAILABLE_DATABASE_VERSIONS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_AVAILABLE_DATABASE_VERSIONS_REST_LOGGING_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_available_database_versions.pb.h" #include "google/cloud/sql/v1/internal/sql_available_database_versions_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/sql/v1/internal/sql_available_database_versions_rest_metadata_decorator.cc b/google/cloud/sql/v1/internal/sql_available_database_versions_rest_metadata_decorator.cc index 53af0e504388f..1568d3b4963e7 100644 --- a/google/cloud/sql/v1/internal/sql_available_database_versions_rest_metadata_decorator.cc +++ b/google/cloud/sql/v1/internal/sql_available_database_versions_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/sql/v1/cloud_sql_available_database_versions.proto #include "google/cloud/sql/v1/internal/sql_available_database_versions_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_available_database_versions_rest_metadata_decorator.h b/google/cloud/sql/v1/internal/sql_available_database_versions_rest_metadata_decorator.h index e32f703b03a83..5906de1755ead 100644 --- a/google/cloud/sql/v1/internal/sql_available_database_versions_rest_metadata_decorator.h +++ b/google/cloud/sql/v1/internal/sql_available_database_versions_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_AVAILABLE_DATABASE_VERSIONS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_AVAILABLE_DATABASE_VERSIONS_REST_METADATA_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_available_database_versions.pb.h" #include "google/cloud/sql/v1/internal/sql_available_database_versions_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/sql/v1/internal/sql_available_database_versions_rest_stub.cc b/google/cloud/sql/v1/internal/sql_available_database_versions_rest_stub.cc index 54415b5e70e71..5f81d3ddbdb2e 100644 --- a/google/cloud/sql/v1/internal/sql_available_database_versions_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_available_database_versions_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/sql/v1/cloud_sql_available_database_versions.proto #include "google/cloud/sql/v1/internal/sql_available_database_versions_rest_stub.h" +#include "google/cloud/sql/v1/cloud_sql_available_database_versions.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_available_database_versions_rest_stub.h b/google/cloud/sql/v1/internal/sql_available_database_versions_rest_stub.h index d18301da99b19..5b44f114126e3 100644 --- a/google/cloud/sql/v1/internal/sql_available_database_versions_rest_stub.h +++ b/google/cloud/sql/v1/internal/sql_available_database_versions_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_AVAILABLE_DATABASE_VERSIONS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_AVAILABLE_DATABASE_VERSIONS_REST_STUB_H +#include "google/cloud/sql/v1/cloud_sql_available_database_versions.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/internal/sql_available_database_versions_tracing_connection.cc b/google/cloud/sql/v1/internal/sql_available_database_versions_tracing_connection.cc index caa0950bdf60b..5560c644aebfe 100644 --- a/google/cloud/sql/v1/internal/sql_available_database_versions_tracing_connection.cc +++ b/google/cloud/sql/v1/internal/sql_available_database_versions_tracing_connection.cc @@ -26,27 +26,21 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SqlAvailableDatabaseVersionsServiceTracingConnection:: SqlAvailableDatabaseVersionsServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSqlAvailableDatabaseVersionsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/sql/v1/internal/sql_available_database_versions_tracing_connection.h b/google/cloud/sql/v1/internal/sql_available_database_versions_tracing_connection.h index 7ac30e663ccc3..d546178573e71 100644 --- a/google/cloud/sql/v1/internal/sql_available_database_versions_tracing_connection.h +++ b/google/cloud/sql/v1/internal/sql_available_database_versions_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SqlAvailableDatabaseVersionsServiceTracingConnection : public sql_v1::SqlAvailableDatabaseVersionsServiceConnection { public: @@ -45,8 +43,6 @@ class SqlAvailableDatabaseVersionsServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/sql/v1/internal/sql_backup_runs_option_defaults.cc b/google/cloud/sql/v1/internal/sql_backup_runs_option_defaults.cc index aee929f3fc4bb..f8222b7acb38b 100644 --- a/google/cloud/sql/v1/internal/sql_backup_runs_option_defaults.cc +++ b/google/cloud/sql/v1/internal/sql_backup_runs_option_defaults.cc @@ -42,7 +42,7 @@ Options SqlBackupRunsServiceDefaultOptions(Options options) { if (!options.has()) { options.set( sql_v1::SqlBackupRunsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/sql/v1/internal/sql_backup_runs_rest_logging_decorator.h b/google/cloud/sql/v1/internal/sql_backup_runs_rest_logging_decorator.h index 7a134627be870..6faf492076f30 100644 --- a/google/cloud/sql/v1/internal/sql_backup_runs_rest_logging_decorator.h +++ b/google/cloud/sql/v1/internal/sql_backup_runs_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_BACKUP_RUNS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_BACKUP_RUNS_REST_LOGGING_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_backup_runs.pb.h" #include "google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/sql/v1/internal/sql_backup_runs_rest_metadata_decorator.cc b/google/cloud/sql/v1/internal/sql_backup_runs_rest_metadata_decorator.cc index 97a588504abe4..4cd0df3fdfaab 100644 --- a/google/cloud/sql/v1/internal/sql_backup_runs_rest_metadata_decorator.cc +++ b/google/cloud/sql/v1/internal/sql_backup_runs_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/sql/v1/cloud_sql_backup_runs.proto #include "google/cloud/sql/v1/internal/sql_backup_runs_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_backup_runs_rest_metadata_decorator.h b/google/cloud/sql/v1/internal/sql_backup_runs_rest_metadata_decorator.h index 747e6214eab5d..b01f120c0f952 100644 --- a/google/cloud/sql/v1/internal/sql_backup_runs_rest_metadata_decorator.h +++ b/google/cloud/sql/v1/internal/sql_backup_runs_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_BACKUP_RUNS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_BACKUP_RUNS_REST_METADATA_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_backup_runs.pb.h" #include "google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.cc b/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.cc index 2ff96a76cb088..3dabd743f0345 100644 --- a/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/sql/v1/cloud_sql_backup_runs.proto #include "google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.h" +#include "google/cloud/sql/v1/cloud_sql_backup_runs.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.h b/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.h index 2a247f5705d13..de42ffd8cf2b3 100644 --- a/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.h +++ b/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_BACKUP_RUNS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_BACKUP_RUNS_REST_STUB_H +#include "google/cloud/sql/v1/cloud_sql_backup_runs.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/internal/sql_backup_runs_tracing_connection.cc b/google/cloud/sql/v1/internal/sql_backup_runs_tracing_connection.cc index 95d34e3ff9c19..cb3d04404ffb7 100644 --- a/google/cloud/sql/v1/internal/sql_backup_runs_tracing_connection.cc +++ b/google/cloud/sql/v1/internal/sql_backup_runs_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SqlBackupRunsServiceTracingConnection::SqlBackupRunsServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -67,17 +65,13 @@ SqlBackupRunsServiceTracingConnection::List( return internal::EndSpan(*span, child_->List(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSqlBackupRunsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/sql/v1/internal/sql_backup_runs_tracing_connection.h b/google/cloud/sql/v1/internal/sql_backup_runs_tracing_connection.h index e45b55897f792..f393055761297 100644 --- a/google/cloud/sql/v1/internal/sql_backup_runs_tracing_connection.h +++ b/google/cloud/sql/v1/internal/sql_backup_runs_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SqlBackupRunsServiceTracingConnection : public sql_v1::SqlBackupRunsServiceConnection { public: @@ -58,8 +56,6 @@ class SqlBackupRunsServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/sql/v1/internal/sql_connect_option_defaults.cc b/google/cloud/sql/v1/internal/sql_connect_option_defaults.cc index 248774b4a4113..48e563cde40af 100644 --- a/google/cloud/sql/v1/internal/sql_connect_option_defaults.cc +++ b/google/cloud/sql/v1/internal/sql_connect_option_defaults.cc @@ -42,7 +42,7 @@ Options SqlConnectServiceDefaultOptions(Options options) { if (!options.has()) { options.set( sql_v1::SqlConnectServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/sql/v1/internal/sql_connect_rest_logging_decorator.h b/google/cloud/sql/v1/internal/sql_connect_rest_logging_decorator.h index b291b925d1419..4d9557868f50b 100644 --- a/google/cloud/sql/v1/internal/sql_connect_rest_logging_decorator.h +++ b/google/cloud/sql/v1/internal/sql_connect_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_CONNECT_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_CONNECT_REST_LOGGING_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_connect.pb.h" #include "google/cloud/sql/v1/internal/sql_connect_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/sql/v1/internal/sql_connect_rest_metadata_decorator.cc b/google/cloud/sql/v1/internal/sql_connect_rest_metadata_decorator.cc index ebb2cfe2e056b..e8c0b4e176c3a 100644 --- a/google/cloud/sql/v1/internal/sql_connect_rest_metadata_decorator.cc +++ b/google/cloud/sql/v1/internal/sql_connect_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/sql/v1/cloud_sql_connect.proto #include "google/cloud/sql/v1/internal/sql_connect_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_connect_rest_metadata_decorator.h b/google/cloud/sql/v1/internal/sql_connect_rest_metadata_decorator.h index 970422179e6b6..fa01129459f5f 100644 --- a/google/cloud/sql/v1/internal/sql_connect_rest_metadata_decorator.h +++ b/google/cloud/sql/v1/internal/sql_connect_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_CONNECT_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_CONNECT_REST_METADATA_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_connect.pb.h" #include "google/cloud/sql/v1/internal/sql_connect_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/sql/v1/internal/sql_connect_rest_stub.cc b/google/cloud/sql/v1/internal/sql_connect_rest_stub.cc index fa81b309f37fb..8f206944e2ccc 100644 --- a/google/cloud/sql/v1/internal/sql_connect_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_connect_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/sql/v1/cloud_sql_connect.proto #include "google/cloud/sql/v1/internal/sql_connect_rest_stub.h" +#include "google/cloud/sql/v1/cloud_sql_connect.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_connect_rest_stub.h b/google/cloud/sql/v1/internal/sql_connect_rest_stub.h index f5be5b26a5f34..15d04feb6cbaf 100644 --- a/google/cloud/sql/v1/internal/sql_connect_rest_stub.h +++ b/google/cloud/sql/v1/internal/sql_connect_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_CONNECT_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_CONNECT_REST_STUB_H +#include "google/cloud/sql/v1/cloud_sql_connect.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/internal/sql_connect_tracing_connection.cc b/google/cloud/sql/v1/internal/sql_connect_tracing_connection.cc index cd935da020181..1f7b9070b19ea 100644 --- a/google/cloud/sql/v1/internal/sql_connect_tracing_connection.cc +++ b/google/cloud/sql/v1/internal/sql_connect_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SqlConnectServiceTracingConnection::SqlConnectServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -50,17 +48,13 @@ SqlConnectServiceTracingConnection::GenerateEphemeralCert( return internal::EndSpan(*span, child_->GenerateEphemeralCert(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSqlConnectServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/sql/v1/internal/sql_connect_tracing_connection.h b/google/cloud/sql/v1/internal/sql_connect_tracing_connection.h index f9b359514d326..4bfe28e4455d2 100644 --- a/google/cloud/sql/v1/internal/sql_connect_tracing_connection.h +++ b/google/cloud/sql/v1/internal/sql_connect_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SqlConnectServiceTracingConnection : public sql_v1::SqlConnectServiceConnection { public: @@ -53,8 +51,6 @@ class SqlConnectServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/sql/v1/internal/sql_databases_option_defaults.cc b/google/cloud/sql/v1/internal/sql_databases_option_defaults.cc index d6fdd20337d2a..5c078977cf13f 100644 --- a/google/cloud/sql/v1/internal/sql_databases_option_defaults.cc +++ b/google/cloud/sql/v1/internal/sql_databases_option_defaults.cc @@ -42,7 +42,7 @@ Options SqlDatabasesServiceDefaultOptions(Options options) { if (!options.has()) { options.set( sql_v1::SqlDatabasesServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/sql/v1/internal/sql_databases_rest_logging_decorator.h b/google/cloud/sql/v1/internal/sql_databases_rest_logging_decorator.h index c01240829fcca..58138b68584cd 100644 --- a/google/cloud/sql/v1/internal/sql_databases_rest_logging_decorator.h +++ b/google/cloud/sql/v1/internal/sql_databases_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_DATABASES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_DATABASES_REST_LOGGING_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_databases.pb.h" #include "google/cloud/sql/v1/internal/sql_databases_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/sql/v1/internal/sql_databases_rest_metadata_decorator.cc b/google/cloud/sql/v1/internal/sql_databases_rest_metadata_decorator.cc index 6e2ecfbc44b90..acece75b3f125 100644 --- a/google/cloud/sql/v1/internal/sql_databases_rest_metadata_decorator.cc +++ b/google/cloud/sql/v1/internal/sql_databases_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/sql/v1/cloud_sql_databases.proto #include "google/cloud/sql/v1/internal/sql_databases_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_databases_rest_metadata_decorator.h b/google/cloud/sql/v1/internal/sql_databases_rest_metadata_decorator.h index dc3b740bb3356..d7a283a68064f 100644 --- a/google/cloud/sql/v1/internal/sql_databases_rest_metadata_decorator.h +++ b/google/cloud/sql/v1/internal/sql_databases_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_DATABASES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_DATABASES_REST_METADATA_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_databases.pb.h" #include "google/cloud/sql/v1/internal/sql_databases_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/sql/v1/internal/sql_databases_rest_stub.cc b/google/cloud/sql/v1/internal/sql_databases_rest_stub.cc index 75c1bb1a1a041..9e70ce9c3873c 100644 --- a/google/cloud/sql/v1/internal/sql_databases_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_databases_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/sql/v1/cloud_sql_databases.proto #include "google/cloud/sql/v1/internal/sql_databases_rest_stub.h" +#include "google/cloud/sql/v1/cloud_sql_databases.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_databases_rest_stub.h b/google/cloud/sql/v1/internal/sql_databases_rest_stub.h index da73cf3ac4ef3..4c837af5c02ac 100644 --- a/google/cloud/sql/v1/internal/sql_databases_rest_stub.h +++ b/google/cloud/sql/v1/internal/sql_databases_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_DATABASES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_DATABASES_REST_STUB_H +#include "google/cloud/sql/v1/cloud_sql_databases.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/internal/sql_databases_tracing_connection.cc b/google/cloud/sql/v1/internal/sql_databases_tracing_connection.cc index a3caf03a8dd12..d261e927ad333 100644 --- a/google/cloud/sql/v1/internal/sql_databases_tracing_connection.cc +++ b/google/cloud/sql/v1/internal/sql_databases_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SqlDatabasesServiceTracingConnection::SqlDatabasesServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -84,17 +82,13 @@ SqlDatabasesServiceTracingConnection::Update( return internal::EndSpan(*span, child_->Update(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSqlDatabasesServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/sql/v1/internal/sql_databases_tracing_connection.h b/google/cloud/sql/v1/internal/sql_databases_tracing_connection.h index b0e04431aef22..d0879cc12401a 100644 --- a/google/cloud/sql/v1/internal/sql_databases_tracing_connection.h +++ b/google/cloud/sql/v1/internal/sql_databases_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SqlDatabasesServiceTracingConnection : public sql_v1::SqlDatabasesServiceConnection { public: @@ -66,8 +64,6 @@ class SqlDatabasesServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/sql/v1/internal/sql_events_option_defaults.cc b/google/cloud/sql/v1/internal/sql_events_option_defaults.cc index b4c8b5dfe0054..61514203c850c 100644 --- a/google/cloud/sql/v1/internal/sql_events_option_defaults.cc +++ b/google/cloud/sql/v1/internal/sql_events_option_defaults.cc @@ -41,7 +41,7 @@ Options SqlEventsServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - sql_v1::SqlEventsServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + sql_v1::SqlEventsServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/sql/v1/internal/sql_events_rest_logging_decorator.h b/google/cloud/sql/v1/internal/sql_events_rest_logging_decorator.h index 609a0402219b2..991bf4910b386 100644 --- a/google/cloud/sql/v1/internal/sql_events_rest_logging_decorator.h +++ b/google/cloud/sql/v1/internal/sql_events_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_EVENTS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_EVENTS_REST_LOGGING_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_events.pb.h" #include "google/cloud/sql/v1/internal/sql_events_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/sql/v1/internal/sql_events_rest_metadata_decorator.cc b/google/cloud/sql/v1/internal/sql_events_rest_metadata_decorator.cc index 45c6ce1387fc0..e740f0b90929e 100644 --- a/google/cloud/sql/v1/internal/sql_events_rest_metadata_decorator.cc +++ b/google/cloud/sql/v1/internal/sql_events_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/sql/v1/cloud_sql_events.proto #include "google/cloud/sql/v1/internal/sql_events_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_events_rest_metadata_decorator.h b/google/cloud/sql/v1/internal/sql_events_rest_metadata_decorator.h index 5df73f2e64aca..5116d2f3fdb4c 100644 --- a/google/cloud/sql/v1/internal/sql_events_rest_metadata_decorator.h +++ b/google/cloud/sql/v1/internal/sql_events_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_EVENTS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_EVENTS_REST_METADATA_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_events.pb.h" #include "google/cloud/sql/v1/internal/sql_events_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/sql/v1/internal/sql_events_rest_stub.cc b/google/cloud/sql/v1/internal/sql_events_rest_stub.cc index 4b52fc09bab4c..1358a4e22c2d2 100644 --- a/google/cloud/sql/v1/internal/sql_events_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_events_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/sql/v1/cloud_sql_events.proto #include "google/cloud/sql/v1/internal/sql_events_rest_stub.h" +#include "google/cloud/sql/v1/cloud_sql_events.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_events_rest_stub.h b/google/cloud/sql/v1/internal/sql_events_rest_stub.h index 9b248e611c6a6..1e3d1887b38cc 100644 --- a/google/cloud/sql/v1/internal/sql_events_rest_stub.h +++ b/google/cloud/sql/v1/internal/sql_events_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_EVENTS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_EVENTS_REST_STUB_H +#include "google/cloud/sql/v1/cloud_sql_events.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/internal/sql_events_tracing_connection.cc b/google/cloud/sql/v1/internal/sql_events_tracing_connection.cc index 7cfc14f5f7448..0a7a53178359e 100644 --- a/google/cloud/sql/v1/internal/sql_events_tracing_connection.cc +++ b/google/cloud/sql/v1/internal/sql_events_tracing_connection.cc @@ -26,22 +26,16 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SqlEventsServiceTracingConnection::SqlEventsServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSqlEventsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/sql/v1/internal/sql_events_tracing_connection.h b/google/cloud/sql/v1/internal/sql_events_tracing_connection.h index edea58e81f587..cb471bf58ccd8 100644 --- a/google/cloud/sql/v1/internal/sql_events_tracing_connection.h +++ b/google/cloud/sql/v1/internal/sql_events_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SqlEventsServiceTracingConnection : public sql_v1::SqlEventsServiceConnection { public: @@ -44,8 +42,6 @@ class SqlEventsServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/sql/v1/internal/sql_flags_option_defaults.cc b/google/cloud/sql/v1/internal/sql_flags_option_defaults.cc index 4d6448358a78a..dfd2d9b3d1ca6 100644 --- a/google/cloud/sql/v1/internal/sql_flags_option_defaults.cc +++ b/google/cloud/sql/v1/internal/sql_flags_option_defaults.cc @@ -41,7 +41,7 @@ Options SqlFlagsServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - sql_v1::SqlFlagsServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + sql_v1::SqlFlagsServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/sql/v1/internal/sql_flags_rest_logging_decorator.h b/google/cloud/sql/v1/internal/sql_flags_rest_logging_decorator.h index 354bf3d088553..8bda83927e7c7 100644 --- a/google/cloud/sql/v1/internal/sql_flags_rest_logging_decorator.h +++ b/google/cloud/sql/v1/internal/sql_flags_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_FLAGS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_FLAGS_REST_LOGGING_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_flags.pb.h" #include "google/cloud/sql/v1/internal/sql_flags_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/sql/v1/internal/sql_flags_rest_metadata_decorator.cc b/google/cloud/sql/v1/internal/sql_flags_rest_metadata_decorator.cc index 7cc660120b025..be3607d037a30 100644 --- a/google/cloud/sql/v1/internal/sql_flags_rest_metadata_decorator.cc +++ b/google/cloud/sql/v1/internal/sql_flags_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/sql/v1/cloud_sql_flags.proto #include "google/cloud/sql/v1/internal/sql_flags_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_flags_rest_metadata_decorator.h b/google/cloud/sql/v1/internal/sql_flags_rest_metadata_decorator.h index 5852f9b97705b..e14b341432247 100644 --- a/google/cloud/sql/v1/internal/sql_flags_rest_metadata_decorator.h +++ b/google/cloud/sql/v1/internal/sql_flags_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_FLAGS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_FLAGS_REST_METADATA_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_flags.pb.h" #include "google/cloud/sql/v1/internal/sql_flags_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/sql/v1/internal/sql_flags_rest_stub.cc b/google/cloud/sql/v1/internal/sql_flags_rest_stub.cc index 9bb52a9b8883f..9c0f9ab4b8f85 100644 --- a/google/cloud/sql/v1/internal/sql_flags_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_flags_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/sql/v1/cloud_sql_flags.proto #include "google/cloud/sql/v1/internal/sql_flags_rest_stub.h" +#include "google/cloud/sql/v1/cloud_sql_flags.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_flags_rest_stub.h b/google/cloud/sql/v1/internal/sql_flags_rest_stub.h index ea7834f9150fb..c86a19c9f9654 100644 --- a/google/cloud/sql/v1/internal/sql_flags_rest_stub.h +++ b/google/cloud/sql/v1/internal/sql_flags_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_FLAGS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_FLAGS_REST_STUB_H +#include "google/cloud/sql/v1/cloud_sql_flags.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/internal/sql_flags_tracing_connection.cc b/google/cloud/sql/v1/internal/sql_flags_tracing_connection.cc index 87ce6fc57f711..91527018b0c5b 100644 --- a/google/cloud/sql/v1/internal/sql_flags_tracing_connection.cc +++ b/google/cloud/sql/v1/internal/sql_flags_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SqlFlagsServiceTracingConnection::SqlFlagsServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -40,16 +38,12 @@ SqlFlagsServiceTracingConnection::List( return internal::EndSpan(*span, child_->List(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSqlFlagsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/sql/v1/internal/sql_flags_tracing_connection.h b/google/cloud/sql/v1/internal/sql_flags_tracing_connection.h index bf6f282ab7897..f6f851fd3d87d 100644 --- a/google/cloud/sql/v1/internal/sql_flags_tracing_connection.h +++ b/google/cloud/sql/v1/internal/sql_flags_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SqlFlagsServiceTracingConnection : public sql_v1::SqlFlagsServiceConnection { public: @@ -47,8 +45,6 @@ class SqlFlagsServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/sql/v1/internal/sql_iam_policies_option_defaults.cc b/google/cloud/sql/v1/internal/sql_iam_policies_option_defaults.cc index e9671da0e84f0..b20213bee1f8e 100644 --- a/google/cloud/sql/v1/internal/sql_iam_policies_option_defaults.cc +++ b/google/cloud/sql/v1/internal/sql_iam_policies_option_defaults.cc @@ -42,7 +42,7 @@ Options SqlIamPoliciesServiceDefaultOptions(Options options) { if (!options.has()) { options.set( sql_v1::SqlIamPoliciesServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/sql/v1/internal/sql_iam_policies_rest_logging_decorator.h b/google/cloud/sql/v1/internal/sql_iam_policies_rest_logging_decorator.h index 3716c338235b5..5577600e7693c 100644 --- a/google/cloud/sql/v1/internal/sql_iam_policies_rest_logging_decorator.h +++ b/google/cloud/sql/v1/internal/sql_iam_policies_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_IAM_POLICIES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_IAM_POLICIES_REST_LOGGING_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_iam_policies.pb.h" #include "google/cloud/sql/v1/internal/sql_iam_policies_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/sql/v1/internal/sql_iam_policies_rest_metadata_decorator.cc b/google/cloud/sql/v1/internal/sql_iam_policies_rest_metadata_decorator.cc index 68d53aca0f311..a63d4f30ac717 100644 --- a/google/cloud/sql/v1/internal/sql_iam_policies_rest_metadata_decorator.cc +++ b/google/cloud/sql/v1/internal/sql_iam_policies_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/sql/v1/cloud_sql_iam_policies.proto #include "google/cloud/sql/v1/internal/sql_iam_policies_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_iam_policies_rest_metadata_decorator.h b/google/cloud/sql/v1/internal/sql_iam_policies_rest_metadata_decorator.h index 151f7d279fbd2..87788e00ea2ca 100644 --- a/google/cloud/sql/v1/internal/sql_iam_policies_rest_metadata_decorator.h +++ b/google/cloud/sql/v1/internal/sql_iam_policies_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_IAM_POLICIES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_IAM_POLICIES_REST_METADATA_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_iam_policies.pb.h" #include "google/cloud/sql/v1/internal/sql_iam_policies_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/sql/v1/internal/sql_iam_policies_rest_stub.cc b/google/cloud/sql/v1/internal/sql_iam_policies_rest_stub.cc index c5a5438d81799..c7cafb063cd39 100644 --- a/google/cloud/sql/v1/internal/sql_iam_policies_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_iam_policies_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/sql/v1/cloud_sql_iam_policies.proto #include "google/cloud/sql/v1/internal/sql_iam_policies_rest_stub.h" +#include "google/cloud/sql/v1/cloud_sql_iam_policies.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_iam_policies_rest_stub.h b/google/cloud/sql/v1/internal/sql_iam_policies_rest_stub.h index 6f040aa856fa2..9f4c74c66890a 100644 --- a/google/cloud/sql/v1/internal/sql_iam_policies_rest_stub.h +++ b/google/cloud/sql/v1/internal/sql_iam_policies_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_IAM_POLICIES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_IAM_POLICIES_REST_STUB_H +#include "google/cloud/sql/v1/cloud_sql_iam_policies.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/internal/sql_iam_policies_tracing_connection.cc b/google/cloud/sql/v1/internal/sql_iam_policies_tracing_connection.cc index 305b20b6fc3ce..a8f04198de3ee 100644 --- a/google/cloud/sql/v1/internal/sql_iam_policies_tracing_connection.cc +++ b/google/cloud/sql/v1/internal/sql_iam_policies_tracing_connection.cc @@ -26,23 +26,17 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SqlIamPoliciesServiceTracingConnection::SqlIamPoliciesServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSqlIamPoliciesServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/sql/v1/internal/sql_iam_policies_tracing_connection.h b/google/cloud/sql/v1/internal/sql_iam_policies_tracing_connection.h index 060bf25807edb..6ba486e1beb56 100644 --- a/google/cloud/sql/v1/internal/sql_iam_policies_tracing_connection.h +++ b/google/cloud/sql/v1/internal/sql_iam_policies_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SqlIamPoliciesServiceTracingConnection : public sql_v1::SqlIamPoliciesServiceConnection { public: @@ -44,8 +42,6 @@ class SqlIamPoliciesServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/sql/v1/internal/sql_instance_names_option_defaults.cc b/google/cloud/sql/v1/internal/sql_instance_names_option_defaults.cc index 37c402c17736f..4518ae23dda0f 100644 --- a/google/cloud/sql/v1/internal/sql_instance_names_option_defaults.cc +++ b/google/cloud/sql/v1/internal/sql_instance_names_option_defaults.cc @@ -43,7 +43,7 @@ Options SqlInstanceNamesServiceDefaultOptions(Options options) { if (!options.has()) { options.set( sql_v1::SqlInstanceNamesServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/sql/v1/internal/sql_instance_names_rest_logging_decorator.h b/google/cloud/sql/v1/internal/sql_instance_names_rest_logging_decorator.h index 593927258df81..42803a94abbb0 100644 --- a/google/cloud/sql/v1/internal/sql_instance_names_rest_logging_decorator.h +++ b/google/cloud/sql/v1/internal/sql_instance_names_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_INSTANCE_NAMES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_INSTANCE_NAMES_REST_LOGGING_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_instance_names.pb.h" #include "google/cloud/sql/v1/internal/sql_instance_names_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/sql/v1/internal/sql_instance_names_rest_metadata_decorator.cc b/google/cloud/sql/v1/internal/sql_instance_names_rest_metadata_decorator.cc index 221f5e2f91aaf..c449c5d8cf95f 100644 --- a/google/cloud/sql/v1/internal/sql_instance_names_rest_metadata_decorator.cc +++ b/google/cloud/sql/v1/internal/sql_instance_names_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/sql/v1/cloud_sql_instance_names.proto #include "google/cloud/sql/v1/internal/sql_instance_names_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_instance_names_rest_metadata_decorator.h b/google/cloud/sql/v1/internal/sql_instance_names_rest_metadata_decorator.h index d2deae2874291..fcdebf5302e3b 100644 --- a/google/cloud/sql/v1/internal/sql_instance_names_rest_metadata_decorator.h +++ b/google/cloud/sql/v1/internal/sql_instance_names_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_INSTANCE_NAMES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_INSTANCE_NAMES_REST_METADATA_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_instance_names.pb.h" #include "google/cloud/sql/v1/internal/sql_instance_names_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/sql/v1/internal/sql_instance_names_rest_stub.cc b/google/cloud/sql/v1/internal/sql_instance_names_rest_stub.cc index 58771a0a1bbc5..747cb7eadf27d 100644 --- a/google/cloud/sql/v1/internal/sql_instance_names_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_instance_names_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/sql/v1/cloud_sql_instance_names.proto #include "google/cloud/sql/v1/internal/sql_instance_names_rest_stub.h" +#include "google/cloud/sql/v1/cloud_sql_instance_names.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_instance_names_rest_stub.h b/google/cloud/sql/v1/internal/sql_instance_names_rest_stub.h index 51ab64014eaea..0a6cdab4ad2af 100644 --- a/google/cloud/sql/v1/internal/sql_instance_names_rest_stub.h +++ b/google/cloud/sql/v1/internal/sql_instance_names_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_INSTANCE_NAMES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_INSTANCE_NAMES_REST_STUB_H +#include "google/cloud/sql/v1/cloud_sql_instance_names.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/internal/sql_instance_names_tracing_connection.cc b/google/cloud/sql/v1/internal/sql_instance_names_tracing_connection.cc index d21bd6ea46716..6afbb25e1d1c5 100644 --- a/google/cloud/sql/v1/internal/sql_instance_names_tracing_connection.cc +++ b/google/cloud/sql/v1/internal/sql_instance_names_tracing_connection.cc @@ -26,24 +26,18 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SqlInstanceNamesServiceTracingConnection:: SqlInstanceNamesServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSqlInstanceNamesServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/sql/v1/internal/sql_instance_names_tracing_connection.h b/google/cloud/sql/v1/internal/sql_instance_names_tracing_connection.h index 3ff2df4f55abd..be83fa65807ff 100644 --- a/google/cloud/sql/v1/internal/sql_instance_names_tracing_connection.h +++ b/google/cloud/sql/v1/internal/sql_instance_names_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SqlInstanceNamesServiceTracingConnection : public sql_v1::SqlInstanceNamesServiceConnection { public: @@ -44,8 +42,6 @@ class SqlInstanceNamesServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/sql/v1/internal/sql_instances_option_defaults.cc b/google/cloud/sql/v1/internal/sql_instances_option_defaults.cc index 4708e78c75462..ab3b0925d07db 100644 --- a/google/cloud/sql/v1/internal/sql_instances_option_defaults.cc +++ b/google/cloud/sql/v1/internal/sql_instances_option_defaults.cc @@ -42,7 +42,7 @@ Options SqlInstancesServiceDefaultOptions(Options options) { if (!options.has()) { options.set( sql_v1::SqlInstancesServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/sql/v1/internal/sql_instances_rest_logging_decorator.h b/google/cloud/sql/v1/internal/sql_instances_rest_logging_decorator.h index 174197bdb44b5..f6da2356aeb84 100644 --- a/google/cloud/sql/v1/internal/sql_instances_rest_logging_decorator.h +++ b/google/cloud/sql/v1/internal/sql_instances_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_INSTANCES_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_INSTANCES_REST_LOGGING_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_instances.pb.h" #include "google/cloud/sql/v1/internal/sql_instances_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/sql/v1/internal/sql_instances_rest_metadata_decorator.cc b/google/cloud/sql/v1/internal/sql_instances_rest_metadata_decorator.cc index 3ce2128854671..dc4973bf3ab97 100644 --- a/google/cloud/sql/v1/internal/sql_instances_rest_metadata_decorator.cc +++ b/google/cloud/sql/v1/internal/sql_instances_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/sql/v1/cloud_sql_instances.proto #include "google/cloud/sql/v1/internal/sql_instances_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_instances_rest_metadata_decorator.h b/google/cloud/sql/v1/internal/sql_instances_rest_metadata_decorator.h index 56f59f4c79496..2d46a8f5f9340 100644 --- a/google/cloud/sql/v1/internal/sql_instances_rest_metadata_decorator.h +++ b/google/cloud/sql/v1/internal/sql_instances_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_INSTANCES_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_INSTANCES_REST_METADATA_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_instances.pb.h" #include "google/cloud/sql/v1/internal/sql_instances_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/sql/v1/internal/sql_instances_rest_stub.cc b/google/cloud/sql/v1/internal/sql_instances_rest_stub.cc index f6fd88423d232..d4fa524c099e5 100644 --- a/google/cloud/sql/v1/internal/sql_instances_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_instances_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/sql/v1/cloud_sql_instances.proto #include "google/cloud/sql/v1/internal/sql_instances_rest_stub.h" +#include "google/cloud/sql/v1/cloud_sql_instances.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_instances_rest_stub.h b/google/cloud/sql/v1/internal/sql_instances_rest_stub.h index 97d145a056c3f..705324f560cf7 100644 --- a/google/cloud/sql/v1/internal/sql_instances_rest_stub.h +++ b/google/cloud/sql/v1/internal/sql_instances_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_INSTANCES_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_INSTANCES_REST_STUB_H +#include "google/cloud/sql/v1/cloud_sql_instances.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/internal/sql_instances_tracing_connection.cc b/google/cloud/sql/v1/internal/sql_instances_tracing_connection.cc index cd0ed26791327..58e4c29f1fa28 100644 --- a/google/cloud/sql/v1/internal/sql_instances_tracing_connection.cc +++ b/google/cloud/sql/v1/internal/sql_instances_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SqlInstancesServiceTracingConnection::SqlInstancesServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -438,17 +436,13 @@ SqlInstancesServiceTracingConnection::PointInTimeRestore( return internal::EndSpan(*span, child_->PointInTimeRestore(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSqlInstancesServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/sql/v1/internal/sql_instances_tracing_connection.h b/google/cloud/sql/v1/internal/sql_instances_tracing_connection.h index a74518de801c4..35f56bb2dd4f2 100644 --- a/google/cloud/sql/v1/internal/sql_instances_tracing_connection.h +++ b/google/cloud/sql/v1/internal/sql_instances_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SqlInstancesServiceTracingConnection : public sql_v1::SqlInstancesServiceConnection { public: @@ -222,8 +220,6 @@ class SqlInstancesServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/sql/v1/internal/sql_operations_option_defaults.cc b/google/cloud/sql/v1/internal/sql_operations_option_defaults.cc index a19e0f5d35032..530674832e9ef 100644 --- a/google/cloud/sql/v1/internal/sql_operations_option_defaults.cc +++ b/google/cloud/sql/v1/internal/sql_operations_option_defaults.cc @@ -42,7 +42,7 @@ Options SqlOperationsServiceDefaultOptions(Options options) { if (!options.has()) { options.set( sql_v1::SqlOperationsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/sql/v1/internal/sql_operations_rest_logging_decorator.h b/google/cloud/sql/v1/internal/sql_operations_rest_logging_decorator.h index faaad29aaabf0..fa5e8290deda4 100644 --- a/google/cloud/sql/v1/internal/sql_operations_rest_logging_decorator.h +++ b/google/cloud/sql/v1/internal/sql_operations_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_OPERATIONS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_OPERATIONS_REST_LOGGING_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_operations.pb.h" #include "google/cloud/sql/v1/internal/sql_operations_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/sql/v1/internal/sql_operations_rest_metadata_decorator.cc b/google/cloud/sql/v1/internal/sql_operations_rest_metadata_decorator.cc index 1d9d6996c2635..c02ac7123d1e0 100644 --- a/google/cloud/sql/v1/internal/sql_operations_rest_metadata_decorator.cc +++ b/google/cloud/sql/v1/internal/sql_operations_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/sql/v1/cloud_sql_operations.proto #include "google/cloud/sql/v1/internal/sql_operations_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_operations_rest_metadata_decorator.h b/google/cloud/sql/v1/internal/sql_operations_rest_metadata_decorator.h index 51b49068d598d..626f9f64fd724 100644 --- a/google/cloud/sql/v1/internal/sql_operations_rest_metadata_decorator.h +++ b/google/cloud/sql/v1/internal/sql_operations_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_OPERATIONS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_OPERATIONS_REST_METADATA_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_operations.pb.h" #include "google/cloud/sql/v1/internal/sql_operations_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/sql/v1/internal/sql_operations_rest_stub.cc b/google/cloud/sql/v1/internal/sql_operations_rest_stub.cc index c3133516e26ce..a899674c5a19d 100644 --- a/google/cloud/sql/v1/internal/sql_operations_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_operations_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/sql/v1/cloud_sql_operations.proto #include "google/cloud/sql/v1/internal/sql_operations_rest_stub.h" +#include "google/cloud/sql/v1/cloud_sql_operations.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_operations_rest_stub.h b/google/cloud/sql/v1/internal/sql_operations_rest_stub.h index 1db82f215bc3b..d164fc76bed10 100644 --- a/google/cloud/sql/v1/internal/sql_operations_rest_stub.h +++ b/google/cloud/sql/v1/internal/sql_operations_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_OPERATIONS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_OPERATIONS_REST_STUB_H +#include "google/cloud/sql/v1/cloud_sql_operations.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/internal/sql_operations_tracing_connection.cc b/google/cloud/sql/v1/internal/sql_operations_tracing_connection.cc index 5b4d66327dec7..0d33bc34fc4ee 100644 --- a/google/cloud/sql/v1/internal/sql_operations_tracing_connection.cc +++ b/google/cloud/sql/v1/internal/sql_operations_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SqlOperationsServiceTracingConnection::SqlOperationsServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -60,17 +58,13 @@ Status SqlOperationsServiceTracingConnection::Cancel( return internal::EndSpan(*span, child_->Cancel(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSqlOperationsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/sql/v1/internal/sql_operations_tracing_connection.h b/google/cloud/sql/v1/internal/sql_operations_tracing_connection.h index 80efb7ff87fe3..66e4980dbb862 100644 --- a/google/cloud/sql/v1/internal/sql_operations_tracing_connection.h +++ b/google/cloud/sql/v1/internal/sql_operations_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SqlOperationsServiceTracingConnection : public sql_v1::SqlOperationsServiceConnection { public: @@ -53,8 +51,6 @@ class SqlOperationsServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/sql/v1/internal/sql_regions_option_defaults.cc b/google/cloud/sql/v1/internal/sql_regions_option_defaults.cc index 4821c45eaf932..6c672ed117913 100644 --- a/google/cloud/sql/v1/internal/sql_regions_option_defaults.cc +++ b/google/cloud/sql/v1/internal/sql_regions_option_defaults.cc @@ -42,7 +42,7 @@ Options SqlRegionsServiceDefaultOptions(Options options) { if (!options.has()) { options.set( sql_v1::SqlRegionsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/sql/v1/internal/sql_regions_rest_logging_decorator.h b/google/cloud/sql/v1/internal/sql_regions_rest_logging_decorator.h index d15fd9176a26e..be7d8b160b348 100644 --- a/google/cloud/sql/v1/internal/sql_regions_rest_logging_decorator.h +++ b/google/cloud/sql/v1/internal/sql_regions_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_REGIONS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_REGIONS_REST_LOGGING_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_regions.pb.h" #include "google/cloud/sql/v1/internal/sql_regions_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/sql/v1/internal/sql_regions_rest_metadata_decorator.cc b/google/cloud/sql/v1/internal/sql_regions_rest_metadata_decorator.cc index a37c8fea19a29..7f0af87a043a4 100644 --- a/google/cloud/sql/v1/internal/sql_regions_rest_metadata_decorator.cc +++ b/google/cloud/sql/v1/internal/sql_regions_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/sql/v1/cloud_sql_regions.proto #include "google/cloud/sql/v1/internal/sql_regions_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_regions_rest_metadata_decorator.h b/google/cloud/sql/v1/internal/sql_regions_rest_metadata_decorator.h index f95266c5f73f7..8f4b6d6ac9888 100644 --- a/google/cloud/sql/v1/internal/sql_regions_rest_metadata_decorator.h +++ b/google/cloud/sql/v1/internal/sql_regions_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_REGIONS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_REGIONS_REST_METADATA_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_regions.pb.h" #include "google/cloud/sql/v1/internal/sql_regions_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/sql/v1/internal/sql_regions_rest_stub.cc b/google/cloud/sql/v1/internal/sql_regions_rest_stub.cc index c93045f697e34..447a4e1385156 100644 --- a/google/cloud/sql/v1/internal/sql_regions_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_regions_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/sql/v1/cloud_sql_regions.proto #include "google/cloud/sql/v1/internal/sql_regions_rest_stub.h" +#include "google/cloud/sql/v1/cloud_sql_regions.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_regions_rest_stub.h b/google/cloud/sql/v1/internal/sql_regions_rest_stub.h index 40f0e34688fb5..5ec87b50c9c19 100644 --- a/google/cloud/sql/v1/internal/sql_regions_rest_stub.h +++ b/google/cloud/sql/v1/internal/sql_regions_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_REGIONS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_REGIONS_REST_STUB_H +#include "google/cloud/sql/v1/cloud_sql_regions.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/internal/sql_regions_tracing_connection.cc b/google/cloud/sql/v1/internal/sql_regions_tracing_connection.cc index 4351588fd3e82..d37c03bff745c 100644 --- a/google/cloud/sql/v1/internal/sql_regions_tracing_connection.cc +++ b/google/cloud/sql/v1/internal/sql_regions_tracing_connection.cc @@ -26,23 +26,17 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SqlRegionsServiceTracingConnection::SqlRegionsServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSqlRegionsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/sql/v1/internal/sql_regions_tracing_connection.h b/google/cloud/sql/v1/internal/sql_regions_tracing_connection.h index e570ff4ccfbe3..e3b3d62783872 100644 --- a/google/cloud/sql/v1/internal/sql_regions_tracing_connection.h +++ b/google/cloud/sql/v1/internal/sql_regions_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SqlRegionsServiceTracingConnection : public sql_v1::SqlRegionsServiceConnection { public: @@ -44,8 +42,6 @@ class SqlRegionsServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/sql/v1/internal/sql_ssl_certs_option_defaults.cc b/google/cloud/sql/v1/internal/sql_ssl_certs_option_defaults.cc index b2f087972698a..367ca77faf6ed 100644 --- a/google/cloud/sql/v1/internal/sql_ssl_certs_option_defaults.cc +++ b/google/cloud/sql/v1/internal/sql_ssl_certs_option_defaults.cc @@ -42,7 +42,7 @@ Options SqlSslCertsServiceDefaultOptions(Options options) { if (!options.has()) { options.set( sql_v1::SqlSslCertsServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/sql/v1/internal/sql_ssl_certs_rest_logging_decorator.h b/google/cloud/sql/v1/internal/sql_ssl_certs_rest_logging_decorator.h index 6765595ee6ff5..43c3ab9db8946 100644 --- a/google/cloud/sql/v1/internal/sql_ssl_certs_rest_logging_decorator.h +++ b/google/cloud/sql/v1/internal/sql_ssl_certs_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_SSL_CERTS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_SSL_CERTS_REST_LOGGING_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_ssl_certs.pb.h" #include "google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/sql/v1/internal/sql_ssl_certs_rest_metadata_decorator.cc b/google/cloud/sql/v1/internal/sql_ssl_certs_rest_metadata_decorator.cc index d1f38c496bb84..5025d899243c9 100644 --- a/google/cloud/sql/v1/internal/sql_ssl_certs_rest_metadata_decorator.cc +++ b/google/cloud/sql/v1/internal/sql_ssl_certs_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto #include "google/cloud/sql/v1/internal/sql_ssl_certs_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_ssl_certs_rest_metadata_decorator.h b/google/cloud/sql/v1/internal/sql_ssl_certs_rest_metadata_decorator.h index aca7d957b51dc..e5e0b0723ec19 100644 --- a/google/cloud/sql/v1/internal/sql_ssl_certs_rest_metadata_decorator.h +++ b/google/cloud/sql/v1/internal/sql_ssl_certs_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_SSL_CERTS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_SSL_CERTS_REST_METADATA_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_ssl_certs.pb.h" #include "google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.cc b/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.cc index 35e7275be1be4..e5909f99c7ef2 100644 --- a/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/sql/v1/cloud_sql_ssl_certs.proto #include "google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.h" +#include "google/cloud/sql/v1/cloud_sql_ssl_certs.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.h b/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.h index dfa852015f200..d6e6c2b1b3fd8 100644 --- a/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.h +++ b/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_SSL_CERTS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_SSL_CERTS_REST_STUB_H +#include "google/cloud/sql/v1/cloud_sql_ssl_certs.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/internal/sql_ssl_certs_tracing_connection.cc b/google/cloud/sql/v1/internal/sql_ssl_certs_tracing_connection.cc index 14fa961160d1c..73390d7e33146 100644 --- a/google/cloud/sql/v1/internal/sql_ssl_certs_tracing_connection.cc +++ b/google/cloud/sql/v1/internal/sql_ssl_certs_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SqlSslCertsServiceTracingConnection::SqlSslCertsServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -66,17 +64,13 @@ SqlSslCertsServiceTracingConnection::List( return internal::EndSpan(*span, child_->List(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSqlSslCertsServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/sql/v1/internal/sql_ssl_certs_tracing_connection.h b/google/cloud/sql/v1/internal/sql_ssl_certs_tracing_connection.h index 8beaf09d096f5..fa3567a7bdf20 100644 --- a/google/cloud/sql/v1/internal/sql_ssl_certs_tracing_connection.h +++ b/google/cloud/sql/v1/internal/sql_ssl_certs_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SqlSslCertsServiceTracingConnection : public sql_v1::SqlSslCertsServiceConnection { public: @@ -56,8 +54,6 @@ class SqlSslCertsServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/sql/v1/internal/sql_tiers_option_defaults.cc b/google/cloud/sql/v1/internal/sql_tiers_option_defaults.cc index e04b64b31199e..85975fe0546af 100644 --- a/google/cloud/sql/v1/internal/sql_tiers_option_defaults.cc +++ b/google/cloud/sql/v1/internal/sql_tiers_option_defaults.cc @@ -41,7 +41,7 @@ Options SqlTiersServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - sql_v1::SqlTiersServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + sql_v1::SqlTiersServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/sql/v1/internal/sql_tiers_rest_logging_decorator.h b/google/cloud/sql/v1/internal/sql_tiers_rest_logging_decorator.h index e96676d11be40..941c14f48dedc 100644 --- a/google/cloud/sql/v1/internal/sql_tiers_rest_logging_decorator.h +++ b/google/cloud/sql/v1/internal/sql_tiers_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_TIERS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_TIERS_REST_LOGGING_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_tiers.pb.h" #include "google/cloud/sql/v1/internal/sql_tiers_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/sql/v1/internal/sql_tiers_rest_metadata_decorator.cc b/google/cloud/sql/v1/internal/sql_tiers_rest_metadata_decorator.cc index 2ca7ee8e153ee..1f5335c937368 100644 --- a/google/cloud/sql/v1/internal/sql_tiers_rest_metadata_decorator.cc +++ b/google/cloud/sql/v1/internal/sql_tiers_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/sql/v1/cloud_sql_tiers.proto #include "google/cloud/sql/v1/internal/sql_tiers_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_tiers_rest_metadata_decorator.h b/google/cloud/sql/v1/internal/sql_tiers_rest_metadata_decorator.h index ba373041d26d2..471c398f577ca 100644 --- a/google/cloud/sql/v1/internal/sql_tiers_rest_metadata_decorator.h +++ b/google/cloud/sql/v1/internal/sql_tiers_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_TIERS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_TIERS_REST_METADATA_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_tiers.pb.h" #include "google/cloud/sql/v1/internal/sql_tiers_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/sql/v1/internal/sql_tiers_rest_stub.cc b/google/cloud/sql/v1/internal/sql_tiers_rest_stub.cc index 4df4e634f7dcd..8b878729a22c0 100644 --- a/google/cloud/sql/v1/internal/sql_tiers_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_tiers_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/sql/v1/cloud_sql_tiers.proto #include "google/cloud/sql/v1/internal/sql_tiers_rest_stub.h" +#include "google/cloud/sql/v1/cloud_sql_tiers.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_tiers_rest_stub.h b/google/cloud/sql/v1/internal/sql_tiers_rest_stub.h index 58960bd4a13a6..61c44390e4d62 100644 --- a/google/cloud/sql/v1/internal/sql_tiers_rest_stub.h +++ b/google/cloud/sql/v1/internal/sql_tiers_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_TIERS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_TIERS_REST_STUB_H +#include "google/cloud/sql/v1/cloud_sql_tiers.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/internal/sql_tiers_tracing_connection.cc b/google/cloud/sql/v1/internal/sql_tiers_tracing_connection.cc index bf4e4f21c015f..ca0227189bd3f 100644 --- a/google/cloud/sql/v1/internal/sql_tiers_tracing_connection.cc +++ b/google/cloud/sql/v1/internal/sql_tiers_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SqlTiersServiceTracingConnection::SqlTiersServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -40,16 +38,12 @@ SqlTiersServiceTracingConnection::List( return internal::EndSpan(*span, child_->List(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSqlTiersServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/sql/v1/internal/sql_tiers_tracing_connection.h b/google/cloud/sql/v1/internal/sql_tiers_tracing_connection.h index 7b3693d58268b..3c046c3516636 100644 --- a/google/cloud/sql/v1/internal/sql_tiers_tracing_connection.h +++ b/google/cloud/sql/v1/internal/sql_tiers_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SqlTiersServiceTracingConnection : public sql_v1::SqlTiersServiceConnection { public: @@ -47,8 +45,6 @@ class SqlTiersServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/sql/v1/internal/sql_users_option_defaults.cc b/google/cloud/sql/v1/internal/sql_users_option_defaults.cc index d474e709e16b8..74494ecb38892 100644 --- a/google/cloud/sql/v1/internal/sql_users_option_defaults.cc +++ b/google/cloud/sql/v1/internal/sql_users_option_defaults.cc @@ -41,7 +41,7 @@ Options SqlUsersServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - sql_v1::SqlUsersServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + sql_v1::SqlUsersServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/sql/v1/internal/sql_users_rest_logging_decorator.h b/google/cloud/sql/v1/internal/sql_users_rest_logging_decorator.h index 20838a8ba2c50..b9f708edf5319 100644 --- a/google/cloud/sql/v1/internal/sql_users_rest_logging_decorator.h +++ b/google/cloud/sql/v1/internal/sql_users_rest_logging_decorator.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_USERS_REST_LOGGING_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_USERS_REST_LOGGING_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_users.pb.h" #include "google/cloud/sql/v1/internal/sql_users_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include #include #include #include diff --git a/google/cloud/sql/v1/internal/sql_users_rest_metadata_decorator.cc b/google/cloud/sql/v1/internal/sql_users_rest_metadata_decorator.cc index 84173a86b1f2c..6ff348b8439d8 100644 --- a/google/cloud/sql/v1/internal/sql_users_rest_metadata_decorator.cc +++ b/google/cloud/sql/v1/internal/sql_users_rest_metadata_decorator.cc @@ -17,10 +17,10 @@ // source: google/cloud/sql/v1/cloud_sql_users.proto #include "google/cloud/sql/v1/internal/sql_users_rest_metadata_decorator.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/rest_set_metadata.h" #include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/sql/v1/internal/sql_users_rest_metadata_decorator.h b/google/cloud/sql/v1/internal/sql_users_rest_metadata_decorator.h index a9d2107b576d2..bffe9429b5367 100644 --- a/google/cloud/sql/v1/internal/sql_users_rest_metadata_decorator.h +++ b/google/cloud/sql/v1/internal/sql_users_rest_metadata_decorator.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_USERS_REST_METADATA_DECORATOR_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_USERS_REST_METADATA_DECORATOR_H +#include "google/cloud/sql/v1/cloud_sql_users.pb.h" #include "google/cloud/sql/v1/internal/sql_users_rest_stub.h" #include "google/cloud/future.h" #include "google/cloud/rest_options.h" #include "google/cloud/version.h" -#include #include #include diff --git a/google/cloud/sql/v1/internal/sql_users_rest_stub.cc b/google/cloud/sql/v1/internal/sql_users_rest_stub.cc index 9ca7a082c3ecc..67a57880f4a6f 100644 --- a/google/cloud/sql/v1/internal/sql_users_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_users_rest_stub.cc @@ -17,11 +17,11 @@ // source: google/cloud/sql/v1/cloud_sql_users.proto #include "google/cloud/sql/v1/internal/sql_users_rest_stub.h" +#include "google/cloud/sql/v1/cloud_sql_users.pb.h" #include "google/cloud/common_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/rest_stub_helpers.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" #include #include @@ -109,6 +109,8 @@ DefaultSqlUsersServiceRestStub::Update( std::vector> query_params; query_params.push_back({"host", request.host()}); query_params.push_back({"name", request.name()}); + query_params.push_back( + {"revoke_existing_roles", (request.revoke_existing_roles() ? "1" : "0")}); query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( diff --git a/google/cloud/sql/v1/internal/sql_users_rest_stub.h b/google/cloud/sql/v1/internal/sql_users_rest_stub.h index 965a9cd3454f4..a182422afbb74 100644 --- a/google/cloud/sql/v1/internal/sql_users_rest_stub.h +++ b/google/cloud/sql/v1/internal/sql_users_rest_stub.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_USERS_REST_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_INTERNAL_SQL_USERS_REST_STUB_H +#include "google/cloud/sql/v1/cloud_sql_users.pb.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/rest_context.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/internal/sql_users_tracing_connection.cc b/google/cloud/sql/v1/internal/sql_users_tracing_connection.cc index b70df674acf51..501fdb6dfa053 100644 --- a/google/cloud/sql/v1/internal/sql_users_tracing_connection.cc +++ b/google/cloud/sql/v1/internal/sql_users_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - SqlUsersServiceTracingConnection::SqlUsersServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -71,16 +69,12 @@ SqlUsersServiceTracingConnection::Update( return internal::EndSpan(*span, child_->Update(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeSqlUsersServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/sql/v1/internal/sql_users_tracing_connection.h b/google/cloud/sql/v1/internal/sql_users_tracing_connection.h index 1fafd3f5c369c..c2562a14ff5e3 100644 --- a/google/cloud/sql/v1/internal/sql_users_tracing_connection.h +++ b/google/cloud/sql/v1/internal/sql_users_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace sql_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class SqlUsersServiceTracingConnection : public sql_v1::SqlUsersServiceConnection { public: @@ -59,8 +57,6 @@ class SqlUsersServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/sql/v1/sql_available_database_versions_connection.h b/google/cloud/sql/v1/sql_available_database_versions_connection.h index 6576fac464dec..c1ac92c8bdff5 100644 --- a/google/cloud/sql/v1/sql_available_database_versions_connection.h +++ b/google/cloud/sql/v1/sql_available_database_versions_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_AVAILABLE_DATABASE_VERSIONS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_AVAILABLE_DATABASE_VERSIONS_CONNECTION_H +#include "google/cloud/sql/v1/cloud_sql_available_database_versions.pb.h" #include "google/cloud/sql/v1/internal/sql_available_database_versions_retry_traits.h" #include "google/cloud/sql/v1/sql_available_database_versions_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_available_database_versions_connection_idempotency_policy.h b/google/cloud/sql/v1/sql_available_database_versions_connection_idempotency_policy.h index 71b053a532c76..5a229730aac93 100644 --- a/google/cloud/sql/v1/sql_available_database_versions_connection_idempotency_policy.h +++ b/google/cloud/sql/v1/sql_available_database_versions_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_AVAILABLE_DATABASE_VERSIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_AVAILABLE_DATABASE_VERSIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/sql/v1/cloud_sql_available_database_versions.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_backup_runs_client.h b/google/cloud/sql/v1/sql_backup_runs_client.h index 2d5fa44d8f50d..1a9563aa30e30 100644 --- a/google/cloud/sql/v1/sql_backup_runs_client.h +++ b/google/cloud/sql/v1/sql_backup_runs_client.h @@ -110,7 +110,7 @@ class SqlBackupRunsServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlBackupRunsDeleteRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_backup_runs.proto#L70} /// // clang-format on @@ -172,7 +172,7 @@ class SqlBackupRunsServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlBackupRunsInsertRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_backup_runs.proto#L96} /// // clang-format on diff --git a/google/cloud/sql/v1/sql_backup_runs_connection.h b/google/cloud/sql/v1/sql_backup_runs_connection.h index efcd57cd843fd..b49ff1b14c0c0 100644 --- a/google/cloud/sql/v1/sql_backup_runs_connection.h +++ b/google/cloud/sql/v1/sql_backup_runs_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_BACKUP_RUNS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_BACKUP_RUNS_CONNECTION_H +#include "google/cloud/sql/v1/cloud_sql_backup_runs.pb.h" #include "google/cloud/sql/v1/internal/sql_backup_runs_retry_traits.h" #include "google/cloud/sql/v1/sql_backup_runs_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_backup_runs_connection_idempotency_policy.h b/google/cloud/sql/v1/sql_backup_runs_connection_idempotency_policy.h index d3dbfcaf720a7..15b8f43254edc 100644 --- a/google/cloud/sql/v1/sql_backup_runs_connection_idempotency_policy.h +++ b/google/cloud/sql/v1/sql_backup_runs_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_BACKUP_RUNS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_BACKUP_RUNS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/sql/v1/cloud_sql_backup_runs.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_connect_connection.h b/google/cloud/sql/v1/sql_connect_connection.h index 774ae47a898d4..e249291440721 100644 --- a/google/cloud/sql/v1/sql_connect_connection.h +++ b/google/cloud/sql/v1/sql_connect_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_CONNECT_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_CONNECT_CONNECTION_H +#include "google/cloud/sql/v1/cloud_sql_connect.pb.h" #include "google/cloud/sql/v1/internal/sql_connect_retry_traits.h" #include "google/cloud/sql/v1/sql_connect_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_connect_connection_idempotency_policy.h b/google/cloud/sql/v1/sql_connect_connection_idempotency_policy.h index 5f77f2ffb0672..7ddc6041e03a3 100644 --- a/google/cloud/sql/v1/sql_connect_connection_idempotency_policy.h +++ b/google/cloud/sql/v1/sql_connect_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_CONNECT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_CONNECT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/sql/v1/cloud_sql_connect.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_databases_client.h b/google/cloud/sql/v1/sql_databases_client.h index 2bf04fd1de95d..e99c755521f0b 100644 --- a/google/cloud/sql/v1/sql_databases_client.h +++ b/google/cloud/sql/v1/sql_databases_client.h @@ -110,7 +110,7 @@ class SqlDatabasesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlDatabasesDeleteRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_databases.proto#L88} /// // clang-format on @@ -142,7 +142,7 @@ class SqlDatabasesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Database]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L247} + /// [google.cloud.sql.v1.Database]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L248} /// [google.cloud.sql.v1.SqlDatabasesGetRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_databases.proto#L100} /// // clang-format on @@ -176,7 +176,7 @@ class SqlDatabasesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlDatabasesInsertRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_databases.proto#L112} /// // clang-format on @@ -239,7 +239,7 @@ class SqlDatabasesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlDatabasesUpdateRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_databases.proto#L132} /// // clang-format on @@ -271,7 +271,7 @@ class SqlDatabasesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlDatabasesUpdateRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_databases.proto#L132} /// // clang-format on diff --git a/google/cloud/sql/v1/sql_databases_connection.h b/google/cloud/sql/v1/sql_databases_connection.h index 504b9dca07ae0..315b22d3ffe0b 100644 --- a/google/cloud/sql/v1/sql_databases_connection.h +++ b/google/cloud/sql/v1/sql_databases_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_DATABASES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_DATABASES_CONNECTION_H +#include "google/cloud/sql/v1/cloud_sql_databases.pb.h" #include "google/cloud/sql/v1/internal/sql_databases_retry_traits.h" #include "google/cloud/sql/v1/sql_databases_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_databases_connection_idempotency_policy.h b/google/cloud/sql/v1/sql_databases_connection_idempotency_policy.h index 471cb463e24f1..4e7388c6f3974 100644 --- a/google/cloud/sql/v1/sql_databases_connection_idempotency_policy.h +++ b/google/cloud/sql/v1/sql_databases_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_DATABASES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_DATABASES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/sql/v1/cloud_sql_databases.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_events_connection.h b/google/cloud/sql/v1/sql_events_connection.h index 722f9fa85596f..b29ca87c41505 100644 --- a/google/cloud/sql/v1/sql_events_connection.h +++ b/google/cloud/sql/v1/sql_events_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_EVENTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_EVENTS_CONNECTION_H +#include "google/cloud/sql/v1/cloud_sql_events.pb.h" #include "google/cloud/sql/v1/internal/sql_events_retry_traits.h" #include "google/cloud/sql/v1/sql_events_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_events_connection_idempotency_policy.h b/google/cloud/sql/v1/sql_events_connection_idempotency_policy.h index 11588d194dcee..8cb120e6df3ff 100644 --- a/google/cloud/sql/v1/sql_events_connection_idempotency_policy.h +++ b/google/cloud/sql/v1/sql_events_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_EVENTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_EVENTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/sql/v1/cloud_sql_events.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_flags_connection.h b/google/cloud/sql/v1/sql_flags_connection.h index 1f43563e386af..16adedc1bde06 100644 --- a/google/cloud/sql/v1/sql_flags_connection.h +++ b/google/cloud/sql/v1/sql_flags_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_FLAGS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_FLAGS_CONNECTION_H +#include "google/cloud/sql/v1/cloud_sql_flags.pb.h" #include "google/cloud/sql/v1/internal/sql_flags_retry_traits.h" #include "google/cloud/sql/v1/sql_flags_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_flags_connection_idempotency_policy.h b/google/cloud/sql/v1/sql_flags_connection_idempotency_policy.h index da1bd0c468cc7..2110b9936e0a8 100644 --- a/google/cloud/sql/v1/sql_flags_connection_idempotency_policy.h +++ b/google/cloud/sql/v1/sql_flags_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_FLAGS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_FLAGS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/sql/v1/cloud_sql_flags.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_iam_policies_connection.h b/google/cloud/sql/v1/sql_iam_policies_connection.h index 4e3bb2d488d49..74d8ed9d14f5e 100644 --- a/google/cloud/sql/v1/sql_iam_policies_connection.h +++ b/google/cloud/sql/v1/sql_iam_policies_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_IAM_POLICIES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_IAM_POLICIES_CONNECTION_H +#include "google/cloud/sql/v1/cloud_sql_iam_policies.pb.h" #include "google/cloud/sql/v1/internal/sql_iam_policies_retry_traits.h" #include "google/cloud/sql/v1/sql_iam_policies_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_iam_policies_connection_idempotency_policy.h b/google/cloud/sql/v1/sql_iam_policies_connection_idempotency_policy.h index 4f2c4d89bdae8..2c277c8c17583 100644 --- a/google/cloud/sql/v1/sql_iam_policies_connection_idempotency_policy.h +++ b/google/cloud/sql/v1/sql_iam_policies_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_IAM_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_IAM_POLICIES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/sql/v1/cloud_sql_iam_policies.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_instance_names_connection.h b/google/cloud/sql/v1/sql_instance_names_connection.h index c9886606e6633..80433568f1240 100644 --- a/google/cloud/sql/v1/sql_instance_names_connection.h +++ b/google/cloud/sql/v1/sql_instance_names_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_INSTANCE_NAMES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_INSTANCE_NAMES_CONNECTION_H +#include "google/cloud/sql/v1/cloud_sql_instance_names.pb.h" #include "google/cloud/sql/v1/internal/sql_instance_names_retry_traits.h" #include "google/cloud/sql/v1/sql_instance_names_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_instance_names_connection_idempotency_policy.h b/google/cloud/sql/v1/sql_instance_names_connection_idempotency_policy.h index 1e6af25ba1333..bbffe7af88a9d 100644 --- a/google/cloud/sql/v1/sql_instance_names_connection_idempotency_policy.h +++ b/google/cloud/sql/v1/sql_instance_names_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_INSTANCE_NAMES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_INSTANCE_NAMES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/sql/v1/cloud_sql_instance_names.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_instances_client.h b/google/cloud/sql/v1/sql_instances_client.h index 2950d81ab630e..6f2effaab3341 100644 --- a/google/cloud/sql/v1/sql_instances_client.h +++ b/google/cloud/sql/v1/sql_instances_client.h @@ -117,7 +117,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesAddServerCaRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L452} /// // clang-format on @@ -154,7 +154,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L461} /// // clang-format on @@ -188,7 +188,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L470} /// // clang-format on @@ -221,7 +221,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesCloneRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L479} /// // clang-format on @@ -252,7 +252,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesDeleteRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L491} /// // clang-format on @@ -284,7 +284,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesDemoteMasterRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L516} /// // clang-format on @@ -316,7 +316,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesDemoteRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L527} /// // clang-format on @@ -348,7 +348,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesExportRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L539} /// // clang-format on @@ -386,7 +386,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesFailoverRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L550} /// // clang-format on @@ -417,7 +417,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesReencryptRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L833} /// // clang-format on @@ -448,7 +448,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.DatabaseInstance]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L1368} + /// [google.cloud.sql.v1.DatabaseInstance]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L1384} /// [google.cloud.sql.v1.SqlInstancesGetRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L561} /// // clang-format on @@ -480,7 +480,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesImportRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L570} /// // clang-format on @@ -511,7 +511,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesInsertRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L581} /// // clang-format on @@ -551,7 +551,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.DatabaseInstance]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L1368} + /// [google.cloud.sql.v1.DatabaseInstance]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L1384} /// [google.cloud.sql.v1.SqlInstancesListRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L590} /// // clang-format on @@ -693,7 +693,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesPatchRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L644} /// // clang-format on @@ -726,7 +726,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L655} /// // clang-format on @@ -758,7 +758,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesSwitchoverRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L672} /// // clang-format on @@ -790,7 +790,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesResetSslConfigRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L687} /// // clang-format on @@ -821,7 +821,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesRestartRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L713} /// // clang-format on @@ -853,7 +853,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesRestoreBackupRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L722} /// // clang-format on @@ -887,7 +887,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesRotateServerCaRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L733} /// // clang-format on @@ -920,7 +920,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L744} /// // clang-format on @@ -953,7 +953,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L757} /// // clang-format on @@ -985,7 +985,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesStartReplicaRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L770} /// // clang-format on @@ -1016,7 +1016,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesStopReplicaRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L779} /// // clang-format on @@ -1048,7 +1048,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesTruncateLogRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L788} /// // clang-format on @@ -1080,7 +1080,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesUpdateRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L811} /// // clang-format on @@ -1115,7 +1115,7 @@ class SqlInstancesServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L1013} - /// [google.cloud.sql.v1.SslCert]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1887} + /// [google.cloud.sql.v1.SslCert]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1888} /// // clang-format on StatusOr CreateEphemeral( @@ -1146,7 +1146,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L822} /// // clang-format on @@ -1212,7 +1212,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L967} /// // clang-format on @@ -1244,7 +1244,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L799} /// // clang-format on @@ -1309,7 +1309,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L1004} /// // clang-format on @@ -1374,8 +1374,8 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.SqlInstancesExecuteSqlRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L2257} - /// [google.cloud.sql.v1.SqlInstancesExecuteSqlResponse]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L2322} + /// [google.cloud.sql.v1.SqlInstancesExecuteSqlRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L2273} + /// [google.cloud.sql.v1.SqlInstancesExecuteSqlResponse]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L2338} /// // clang-format on StatusOr ExecuteSql( @@ -1405,8 +1405,8 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L2406} - /// [google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L2423} + /// [google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L2422} + /// [google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L2439} /// // clang-format on StatusOr @@ -1438,8 +1438,8 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L2429} - /// [google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L2441} + /// [google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L2445} + /// [google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L2457} /// // clang-format on StatusOr @@ -1471,7 +1471,7 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L1201} /// // clang-format on @@ -1504,8 +1504,8 @@ class SqlInstancesServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} - /// [google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L2448} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} + /// [google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_instances.proto#L2464} /// // clang-format on StatusOr PointInTimeRestore( diff --git a/google/cloud/sql/v1/sql_instances_connection.h b/google/cloud/sql/v1/sql_instances_connection.h index 9db1a32aeed0a..783a6c043ca7c 100644 --- a/google/cloud/sql/v1/sql_instances_connection.h +++ b/google/cloud/sql/v1/sql_instances_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_INSTANCES_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_INSTANCES_CONNECTION_H +#include "google/cloud/sql/v1/cloud_sql_instances.pb.h" #include "google/cloud/sql/v1/internal/sql_instances_retry_traits.h" #include "google/cloud/sql/v1/sql_instances_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_instances_connection_idempotency_policy.h b/google/cloud/sql/v1/sql_instances_connection_idempotency_policy.h index 00cb4ac6fab45..22ab46d50cc25 100644 --- a/google/cloud/sql/v1/sql_instances_connection_idempotency_policy.h +++ b/google/cloud/sql/v1/sql_instances_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_INSTANCES_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_INSTANCES_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/sql/v1/cloud_sql_instances.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_operations_client.h b/google/cloud/sql/v1/sql_operations_client.h index 45b4a00c85dbc..2dcbedfcdd607 100644 --- a/google/cloud/sql/v1/sql_operations_client.h +++ b/google/cloud/sql/v1/sql_operations_client.h @@ -110,7 +110,7 @@ class SqlOperationsServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlOperationsGetRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_operations.proto#L61} /// // clang-format on @@ -151,7 +151,7 @@ class SqlOperationsServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlOperationsListRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_operations.proto#L70} /// // clang-format on diff --git a/google/cloud/sql/v1/sql_operations_connection.h b/google/cloud/sql/v1/sql_operations_connection.h index 308c5c0d0a6dc..7368c322b551b 100644 --- a/google/cloud/sql/v1/sql_operations_connection.h +++ b/google/cloud/sql/v1/sql_operations_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_OPERATIONS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_OPERATIONS_CONNECTION_H +#include "google/cloud/sql/v1/cloud_sql_operations.pb.h" #include "google/cloud/sql/v1/internal/sql_operations_retry_traits.h" #include "google/cloud/sql/v1/sql_operations_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_operations_connection_idempotency_policy.h b/google/cloud/sql/v1/sql_operations_connection_idempotency_policy.h index cda1f2473f33b..c063ca7632ba7 100644 --- a/google/cloud/sql/v1/sql_operations_connection_idempotency_policy.h +++ b/google/cloud/sql/v1/sql_operations_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_OPERATIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_OPERATIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/sql/v1/cloud_sql_operations.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_regions_connection.h b/google/cloud/sql/v1/sql_regions_connection.h index 49a891c1ba1d6..39566ba63c571 100644 --- a/google/cloud/sql/v1/sql_regions_connection.h +++ b/google/cloud/sql/v1/sql_regions_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_REGIONS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_REGIONS_CONNECTION_H +#include "google/cloud/sql/v1/cloud_sql_regions.pb.h" #include "google/cloud/sql/v1/internal/sql_regions_retry_traits.h" #include "google/cloud/sql/v1/sql_regions_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_regions_connection_idempotency_policy.h b/google/cloud/sql/v1/sql_regions_connection_idempotency_policy.h index b3ad5ca636762..82ad0242667b2 100644 --- a/google/cloud/sql/v1/sql_regions_connection_idempotency_policy.h +++ b/google/cloud/sql/v1/sql_regions_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_REGIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_REGIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/sql/v1/cloud_sql_regions.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_ssl_certs_client.h b/google/cloud/sql/v1/sql_ssl_certs_client.h index 06afe8f5091df..dec096fc998e8 100644 --- a/google/cloud/sql/v1/sql_ssl_certs_client.h +++ b/google/cloud/sql/v1/sql_ssl_certs_client.h @@ -111,7 +111,7 @@ class SqlSslCertsServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlSslCertsDeleteRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_ssl_certs.proto#L70} /// // clang-format on @@ -145,7 +145,7 @@ class SqlSslCertsServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.sql.v1.SqlSslCertsGetRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_ssl_certs.proto#L81} - /// [google.cloud.sql.v1.SslCert]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1887} + /// [google.cloud.sql.v1.SslCert]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1888} /// // clang-format on StatusOr Get( diff --git a/google/cloud/sql/v1/sql_ssl_certs_connection.h b/google/cloud/sql/v1/sql_ssl_certs_connection.h index 72c02c2404fdc..7bd5c49a1a7f5 100644 --- a/google/cloud/sql/v1/sql_ssl_certs_connection.h +++ b/google/cloud/sql/v1/sql_ssl_certs_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_SSL_CERTS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_SSL_CERTS_CONNECTION_H +#include "google/cloud/sql/v1/cloud_sql_ssl_certs.pb.h" #include "google/cloud/sql/v1/internal/sql_ssl_certs_retry_traits.h" #include "google/cloud/sql/v1/sql_ssl_certs_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_ssl_certs_connection_idempotency_policy.h b/google/cloud/sql/v1/sql_ssl_certs_connection_idempotency_policy.h index 2974b4dcc66ff..9205243966459 100644 --- a/google/cloud/sql/v1/sql_ssl_certs_connection_idempotency_policy.h +++ b/google/cloud/sql/v1/sql_ssl_certs_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_SSL_CERTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_SSL_CERTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/sql/v1/cloud_sql_ssl_certs.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_tiers_connection.h b/google/cloud/sql/v1/sql_tiers_connection.h index 2f911d7176dd2..e4f4ff31d629e 100644 --- a/google/cloud/sql/v1/sql_tiers_connection.h +++ b/google/cloud/sql/v1/sql_tiers_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_TIERS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_TIERS_CONNECTION_H +#include "google/cloud/sql/v1/cloud_sql_tiers.pb.h" #include "google/cloud/sql/v1/internal/sql_tiers_retry_traits.h" #include "google/cloud/sql/v1/sql_tiers_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_tiers_connection_idempotency_policy.h b/google/cloud/sql/v1/sql_tiers_connection_idempotency_policy.h index 378384f1da51c..b88c2a5a7fad7 100644 --- a/google/cloud/sql/v1/sql_tiers_connection_idempotency_policy.h +++ b/google/cloud/sql/v1/sql_tiers_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_TIERS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_TIERS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/sql/v1/cloud_sql_tiers.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_users_client.h b/google/cloud/sql/v1/sql_users_client.h index 195e3abfca8fd..efe85f0b2f9ce 100644 --- a/google/cloud/sql/v1/sql_users_client.h +++ b/google/cloud/sql/v1/sql_users_client.h @@ -108,7 +108,7 @@ class SqlUsersServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlUsersDeleteRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_users.proto#L76} /// // clang-format on @@ -140,7 +140,7 @@ class SqlUsersServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.sql.v1.SqlUsersGetRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_users.proto#L91} - /// [google.cloud.sql.v1.User]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_users.proto#L172} + /// [google.cloud.sql.v1.User]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_users.proto#L178} /// // clang-format on StatusOr Get( @@ -170,7 +170,7 @@ class SqlUsersServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlUsersInsertRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_users.proto#L105} /// // clang-format on @@ -202,7 +202,7 @@ class SqlUsersServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.sql.v1.SqlUsersListRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_users.proto#L115} - /// [google.cloud.sql.v1.UsersListResponse]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_users.proto#L297} + /// [google.cloud.sql.v1.UsersListResponse]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_users.proto#L303} /// // clang-format on StatusOr List( @@ -232,7 +232,7 @@ class SqlUsersServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1169} + /// [google.cloud.sql.v1.Operation]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_resources.proto#L1170} /// [google.cloud.sql.v1.SqlUsersUpdateRequest]: @googleapis_reference_link{google/cloud/sql/v1/cloud_sql_users.proto#L123} /// // clang-format on diff --git a/google/cloud/sql/v1/sql_users_connection.h b/google/cloud/sql/v1/sql_users_connection.h index c46c470fe8d31..239a01ba00b2f 100644 --- a/google/cloud/sql/v1/sql_users_connection.h +++ b/google/cloud/sql/v1/sql_users_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_USERS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_USERS_CONNECTION_H +#include "google/cloud/sql/v1/cloud_sql_users.pb.h" #include "google/cloud/sql/v1/internal/sql_users_retry_traits.h" #include "google/cloud/sql/v1/sql_users_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -26,7 +27,6 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/sql/v1/sql_users_connection_idempotency_policy.h b/google/cloud/sql/v1/sql_users_connection_idempotency_policy.h index 20eff7405ac42..dfbe34ba72df5 100644 --- a/google/cloud/sql/v1/sql_users_connection_idempotency_policy.h +++ b/google/cloud/sql/v1/sql_users_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_USERS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SQL_V1_SQL_USERS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/sql/v1/cloud_sql_users.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/storage/BUILD.bazel b/google/cloud/storage/BUILD.bazel index 2926a5ba7f503..0055ee1662500 100644 --- a/google/cloud/storage/BUILD.bazel +++ b/google/cloud/storage/BUILD.bazel @@ -74,20 +74,19 @@ cc_library( deps = [ ":google_cloud_cpp_storage", "//:grpc_utils", - "@com_github_curl_curl//:curl", - "@com_github_google_crc32c//:crc32c", - "@com_github_grpc_grpc//:grpc++", - "@com_github_nlohmann_json//:json", - "@com_google_absl//absl/algorithm:container", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/time", - "@com_google_googleapis//google/storage/v2:storage_cc_grpc", - "@com_google_googleapis//google/storage/v2:storage_cc_proto", + "@abseil-cpp//absl/algorithm:container", + "@abseil-cpp//absl/strings", + "@abseil-cpp//absl/time", + "@curl", + "@googleapis//google/storage/v2:storage_cc_grpc", + "@googleapis//google/storage/v2:storage_cc_proto", + "@grpc//:grpc++", + "@nlohmann_json//:json", ] + select({ ":grpc_metrics_enabled": [ "//:opentelemetry", - "@com_github_grpc_grpc//:grpcpp_otel_plugin", - "@io_opentelemetry_cpp//sdk/src/metrics", + "@grpc//:grpcpp_otel_plugin", + "@opentelemetry-cpp//sdk/src/metrics", ], "//conditions:default": [], }), @@ -110,7 +109,7 @@ cc_library( deps = [ ":google_cloud_cpp_storage", ":google_cloud_cpp_storage_grpc", - "@com_google_googletest//:gtest", + "@googletest//:gtest", ], ) @@ -141,14 +140,14 @@ cc_library( deps = [ "//:common", "//google/cloud:google_cloud_cpp_rest_internal", - "@com_github_curl_curl//:curl", - "@com_github_google_crc32c//:crc32c", - "@com_github_nlohmann_json//:json", - "@com_google_absl//absl/strings:cord", - "@com_google_absl//absl/strings:str_format", - "@com_google_absl//absl/time", - "@com_google_absl//absl/types:span", - "@com_google_absl//absl/types:variant", + "@abseil-cpp//absl/crc:crc32c", + "@abseil-cpp//absl/strings:cord", + "@abseil-cpp//absl/strings:str_format", + "@abseil-cpp//absl/time", + "@abseil-cpp//absl/types:span", + "@abseil-cpp//absl/types:variant", + "@curl", + "@nlohmann_json//:json", ] + select({ "@platforms//os:windows": [], "//conditions:default": [ @@ -177,7 +176,7 @@ cc_library( deps = [ ":google_cloud_cpp_storage", "//:common", - "@com_google_googletest//:gtest", + "@googletest//:gtest", ], ) @@ -186,7 +185,10 @@ cc_library( testonly = True, srcs = storage_client_testing_srcs, hdrs = storage_client_testing_hdrs, - visibility = ["//visibility:public"], + visibility = [ + ":__subpackages__", + "//:__pkg__", + ], deps = [ ":google_cloud_cpp_storage", ":google_cloud_cpp_storage_grpc", @@ -194,8 +196,8 @@ cc_library( "//google/cloud:google_cloud_cpp_mocks", "//google/cloud/testing_util:google_cloud_cpp_testing_private", "//google/cloud/testing_util:google_cloud_cpp_testing_rest_private", - "@com_github_curl_curl//:curl", - "@com_google_googletest//:gtest_main", + "@curl", + "@googletest//:gtest_main", ], ) @@ -211,8 +213,8 @@ cc_library( ":storage_client_testing", "//:common", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_github_curl_curl//:curl", - "@com_google_googletest//:gtest_main", + "@curl", + "@googletest//:gtest_main", ] + select({ "@platforms//os:windows": [], "//conditions:default": [ @@ -246,9 +248,9 @@ cc_library( "//:mocks", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_github_curl_curl//:curl", - "@com_google_googletest//:gtest", - "@com_google_googletest//:gtest_main", + "@curl", + "@googletest//:gtest", + "@googletest//:gtest_main", ], ) for test in storage_client_grpc_unit_tests] diff --git a/google/cloud/storage/CMakeLists.txt b/google/cloud/storage/CMakeLists.txt index b3c2eaa890eb0..32f4e6ccf2094 100644 --- a/google/cloud/storage/CMakeLists.txt +++ b/google/cloud/storage/CMakeLists.txt @@ -30,8 +30,7 @@ google_cloud_cpp_doxygen_targets("storage" DEPENDS cloud-docs include(GoogleCloudCppCommon) -include(IncludeNlohmannJson) -find_package(Crc32c) +find_package(nlohmann_json CONFIG REQUIRED) # Export the version information for Bazel. include(CreateBazelConfig) diff --git a/google/cloud/storage/async/bucket_name.cc b/google/cloud/storage/async/bucket_name.cc index dada26fdcf320..d1ef10326e178 100644 --- a/google/cloud/storage/async/bucket_name.cc +++ b/google/cloud/storage/async/bucket_name.cc @@ -13,9 +13,9 @@ // limitations under the License. #include "google/cloud/storage/async/bucket_name.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/make_status.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include "absl/strings/strip.h" #include #include diff --git a/google/cloud/storage/async/client.h b/google/cloud/storage/async/client.h index 49903eb12ac86..93009005af3c5 100644 --- a/google/cloud/storage/async/client.h +++ b/google/cloud/storage/async/client.h @@ -28,7 +28,7 @@ #include "google/cloud/background_threads.h" #include "google/cloud/internal/group_options.h" #include "google/cloud/status_or.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include diff --git a/google/cloud/storage/async/connection.h b/google/cloud/storage/async/connection.h index 5d554a07144b4..8e9df06d9f9e9 100644 --- a/google/cloud/storage/async/connection.h +++ b/google/cloud/storage/async/connection.h @@ -23,7 +23,7 @@ #include "google/cloud/future.h" #include "google/cloud/status.h" #include "google/cloud/version.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include diff --git a/google/cloud/storage/async/idempotency_policy.h b/google/cloud/storage/async/idempotency_policy.h index eeeebaa53d4e5..6f4b721ae1296 100644 --- a/google/cloud/storage/async/idempotency_policy.h +++ b/google/cloud/storage/async/idempotency_policy.h @@ -17,7 +17,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include 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 5c03ac39f44a1..6d8115fb7fcd0 100644 --- a/google/cloud/storage/async/object_descriptor_connection.h +++ b/google/cloud/storage/async/object_descriptor_connection.h @@ -19,7 +19,7 @@ #include "google/cloud/options.h" #include "google/cloud/version.h" #include "absl/types/optional.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include @@ -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/async/object_responses.h b/google/cloud/storage/async/object_responses.h index bd0421056504b..064b31ac2485f 100644 --- a/google/cloud/storage/async/object_responses.h +++ b/google/cloud/storage/async/object_responses.h @@ -22,7 +22,7 @@ #include "absl/strings/cord.h" #include "absl/strings/string_view.h" #include "absl/types/optional.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include diff --git a/google/cloud/storage/async/rewriter.h b/google/cloud/storage/async/rewriter.h index 55c90a700a83c..a5f5eb82829de 100644 --- a/google/cloud/storage/async/rewriter.h +++ b/google/cloud/storage/async/rewriter.h @@ -23,7 +23,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/version.h" #include "absl/types/optional.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include diff --git a/google/cloud/storage/async/rewriter_connection.h b/google/cloud/storage/async/rewriter_connection.h index 08ee405707caf..ded7ef32225c3 100644 --- a/google/cloud/storage/async/rewriter_connection.h +++ b/google/cloud/storage/async/rewriter_connection.h @@ -18,7 +18,7 @@ #include "google/cloud/future.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/storage/v2/storage.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/storage/async/writer.h b/google/cloud/storage/async/writer.h index 53d8a42fd54bc..f39f8f5bee3db 100644 --- a/google/cloud/storage/async/writer.h +++ b/google/cloud/storage/async/writer.h @@ -22,7 +22,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/version.h" #include "absl/types/variant.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include diff --git a/google/cloud/storage/async/writer_connection.h b/google/cloud/storage/async/writer_connection.h index 7c7048dda28f8..43d6348f055ae 100644 --- a/google/cloud/storage/async/writer_connection.h +++ b/google/cloud/storage/async/writer_connection.h @@ -23,7 +23,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/version.h" #include "absl/types/variant.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include diff --git a/google/cloud/storage/benchmarks/BUILD.bazel b/google/cloud/storage/benchmarks/BUILD.bazel index ff365a9bda208..30fb66ad7fa05 100644 --- a/google/cloud/storage/benchmarks/BUILD.bazel +++ b/google/cloud/storage/benchmarks/BUILD.bazel @@ -35,9 +35,9 @@ cc_library( "//:storage", "//google/cloud/storage:storage_client_testing", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_github_curl_curl//:curl", - "@com_google_googleapis//google/storage/v2:storage_cc_grpc", - "@com_google_googleapis//google/storage/v2:storage_cc_proto", + "@curl", + "@googleapis//google/storage/v2:storage_cc_grpc", + "@googleapis//google/storage/v2:storage_cc_proto", ], ) @@ -55,8 +55,8 @@ cc_library( "//:storage", "//google/cloud/storage:storage_client_testing", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_github_curl_curl//:curl", - "@com_google_absl//absl/strings", + "@abseil-cpp//absl/strings", + "@curl", ], ) for program in storage_benchmark_programs] @@ -73,8 +73,8 @@ cc_library( "//:storage", "//google/cloud/storage:storage_client_testing", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_github_curl_curl//:curl", - "@com_google_googletest//:gtest_main", + "@curl", + "@googletest//:gtest_main", ], ) for test in storage_benchmarks_unit_tests] diff --git a/google/cloud/storage/benchmarks/aggregate_download_throughput_options.cc b/google/cloud/storage/benchmarks/aggregate_download_throughput_options.cc index 35e18922ba994..8892603258851 100644 --- a/google/cloud/storage/benchmarks/aggregate_download_throughput_options.cc +++ b/google/cloud/storage/benchmarks/aggregate_download_throughput_options.cc @@ -14,8 +14,8 @@ #include "google/cloud/storage/benchmarks/aggregate_download_throughput_options.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/make_status.h" +#include "absl/strings/str_join.h" #include #include #include diff --git a/google/cloud/storage/benchmarks/aggregate_upload_throughput_options.cc b/google/cloud/storage/benchmarks/aggregate_upload_throughput_options.cc index 9868a928bd26c..267eda0f35316 100644 --- a/google/cloud/storage/benchmarks/aggregate_upload_throughput_options.cc +++ b/google/cloud/storage/benchmarks/aggregate_upload_throughput_options.cc @@ -14,7 +14,7 @@ #include "google/cloud/storage/benchmarks/aggregate_upload_throughput_options.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_join_quiet.h" +#include "absl/strings/str_join.h" #include #include #include diff --git a/google/cloud/storage/benchmarks/async_throughput_benchmark.cc b/google/cloud/storage/benchmarks/async_throughput_benchmark.cc index bf2ac557b287c..a298f26551ec4 100644 --- a/google/cloud/storage/benchmarks/async_throughput_benchmark.cc +++ b/google/cloud/storage/benchmarks/async_throughput_benchmark.cc @@ -24,11 +24,11 @@ #include "google/cloud/storage/client.h" #include "google/cloud/storage/grpc_plugin.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/build_info.h" #include "google/cloud/options.h" #include "google/cloud/status.h" #include "google/cloud/testing_util/command_line_parsing.h" +#include "absl/strings/str_join.h" #include "absl/strings/str_split.h" #include #include diff --git a/google/cloud/storage/benchmarks/benchmark_utils.cc b/google/cloud/storage/benchmarks/benchmark_utils.cc index 0ede910e40c77..a95352dd8c161 100644 --- a/google/cloud/storage/benchmarks/benchmark_utils.cc +++ b/google/cloud/storage/benchmarks/benchmark_utils.cc @@ -16,14 +16,14 @@ #include "google/cloud/storage/benchmarks/bounded_queue.h" #include "google/cloud/storage/options.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/compute_engine_util.h" #include "google/cloud/internal/curl_options.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/rest_client.h" #include "google/cloud/internal/throw_delegate.h" #include "google/cloud/options.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include "absl/strings/str_split.h" #include "absl/strings/strip.h" #include "absl/time/time.h" diff --git a/google/cloud/storage/benchmarks/storage_throughput_vs_cpu_benchmark.cc b/google/cloud/storage/benchmarks/storage_throughput_vs_cpu_benchmark.cc index dda095d1f1c05..39cd64855fc6c 100644 --- a/google/cloud/storage/benchmarks/storage_throughput_vs_cpu_benchmark.cc +++ b/google/cloud/storage/benchmarks/storage_throughput_vs_cpu_benchmark.cc @@ -18,12 +18,12 @@ #include "google/cloud/storage/benchmarks/throughput_result.h" #include "google/cloud/storage/client.h" #include "google/cloud/storage/grpc_plugin.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/build_info.h" #include "google/cloud/internal/format_time_point.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/random.h" #include "google/cloud/log.h" +#include "absl/strings/str_join.h" #include "absl/time/time.h" #include #include diff --git a/google/cloud/storage/benchmarks/throughput_experiment.cc b/google/cloud/storage/benchmarks/throughput_experiment.cc index 7639d692b26e3..2611a280b43eb 100644 --- a/google/cloud/storage/benchmarks/throughput_experiment.cc +++ b/google/cloud/storage/benchmarks/throughput_experiment.cc @@ -16,10 +16,11 @@ #include "google/cloud/storage/benchmarks/benchmark_utils.h" #include "google/cloud/storage/client.h" #include "google/cloud/internal/make_status.h" +#include "google/cloud/internal/unified_rest_credentials.h" #if GOOGLE_CLOUD_CPP_STORAGE_HAVE_GRPC #include "google/cloud/storage/internal/grpc/ctype_cord_workaround.h" #include "google/cloud/grpc_error_delegate.h" -#include +#include "google/storage/v2/storage.grpc.pb.h" #include #include #include @@ -260,8 +261,7 @@ class DownloadObjectLibcurl : public ThroughputExperiment { : endpoint_(options.rest_options.get()), target_api_version_path_( options.rest_options.get()), - creds_(google::cloud::storage::oauth2::GoogleDefaultCredentials() - .value()) { + creds_(rest_internal::MapCredentials(*MakeGoogleDefaultCredentials())) { if (target_api_version_path_.empty()) { target_api_version_path_ = "v1"; } @@ -271,13 +271,14 @@ class DownloadObjectLibcurl : public ThroughputExperiment { ThroughputResult Run(std::string const& bucket_name, std::string const& object_name, ThroughputExperimentConfig const& config) override { - auto header = creds_->AuthorizationHeader(); - if (!header) return {}; + auto token = creds_->GetToken(std::chrono::system_clock::now()); + if (!token) return {}; + auto header = std::string{"Authorization: "} + token->token; auto const start = std::chrono::system_clock::now(); auto timer = Timer::PerThread(); struct curl_slist* slist1 = nullptr; - slist1 = curl_slist_append(slist1, header->c_str()); + slist1 = curl_slist_append(slist1, header.c_str()); auto* hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); @@ -339,7 +340,7 @@ class DownloadObjectLibcurl : public ThroughputExperiment { private: std::string endpoint_; std::string target_api_version_path_; - std::shared_ptr creds_; + std::shared_ptr creds_; }; #if GOOGLE_CLOUD_CPP_STORAGE_HAVE_GRPC diff --git a/google/cloud/storage/bucket_cors_entry.cc b/google/cloud/storage/bucket_cors_entry.cc index a6db2cbdcfc56..f7e68069377d8 100644 --- a/google/cloud/storage/bucket_cors_entry.cc +++ b/google/cloud/storage/bucket_cors_entry.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "google/cloud/storage/bucket_cors_entry.h" -#include "google/cloud/internal/absl_str_join_quiet.h" +#include "absl/strings/str_join.h" #include namespace google { diff --git a/google/cloud/storage/bucket_custom_placement_config.cc b/google/cloud/storage/bucket_custom_placement_config.cc index 3402b69659d24..bc2fcb8b8fdb0 100644 --- a/google/cloud/storage/bucket_custom_placement_config.cc +++ b/google/cloud/storage/bucket_custom_placement_config.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "google/cloud/storage/bucket_custom_placement_config.h" -#include "google/cloud/internal/absl_str_join_quiet.h" +#include "absl/strings/str_join.h" #include namespace google { diff --git a/google/cloud/storage/bucket_metadata.cc b/google/cloud/storage/bucket_metadata.cc index 0d4a3ea42d4fa..8b55962a9b520 100644 --- a/google/cloud/storage/bucket_metadata.cc +++ b/google/cloud/storage/bucket_metadata.cc @@ -14,11 +14,11 @@ #include "google/cloud/storage/bucket_metadata.h" #include "google/cloud/storage/internal/bucket_metadata_parser.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/format_time_point.h" #include "google/cloud/internal/ios_flags_saver.h" #include "google/cloud/status.h" #include "absl/strings/str_format.h" +#include "absl/strings/str_join.h" #include #include #include @@ -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/bucket_object_retention_test.cc b/google/cloud/storage/bucket_object_retention_test.cc index 162ef6800b857..19175cad39dbf 100644 --- a/google/cloud/storage/bucket_object_retention_test.cc +++ b/google/cloud/storage/bucket_object_retention_test.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "google/cloud/storage/bucket_object_retention.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" #include #include diff --git a/google/cloud/storage/bucket_soft_delete_policy_test.cc b/google/cloud/storage/bucket_soft_delete_policy_test.cc index 8e15a53e8d271..03eefd5f73259 100644 --- a/google/cloud/storage/bucket_soft_delete_policy_test.cc +++ b/google/cloud/storage/bucket_soft_delete_policy_test.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "google/cloud/storage/bucket_soft_delete_policy.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" #include "absl/time/time.h" #include #include diff --git a/google/cloud/storage/client.cc b/google/cloud/storage/client.cc index 8d67b1fb0e6c0..559d2f87fca7c 100644 --- a/google/cloud/storage/client.cc +++ b/google/cloud/storage/client.cc @@ -13,19 +13,34 @@ // limitations under the License. #include "google/cloud/storage/client.h" +#include "google/cloud/storage/idempotency_policy.h" #include "google/cloud/storage/internal/base64.h" #include "google/cloud/storage/internal/connection_factory.h" -#include "google/cloud/storage/oauth2/service_account_credentials.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "google/cloud/storage/options.h" #include "google/cloud/internal/curl_handle.h" #include "google/cloud/internal/curl_options.h" #include "google/cloud/internal/filesystem.h" +#include "google/cloud/internal/getenv.h" #include "google/cloud/internal/make_status.h" +#include "google/cloud/internal/oauth2_service_account_credentials.h" #include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/populate_common_options.h" +#include "google/cloud/internal/rest_options.h" +#include "google/cloud/internal/rest_response.h" +#include "google/cloud/internal/service_endpoint.h" +#include "google/cloud/internal/sha256_hash.h" +#include "google/cloud/internal/unified_rest_credentials.h" #include "google/cloud/log.h" +#include "google/cloud/opentelemetry_options.h" +#include "google/cloud/universe_domain_options.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include "absl/strings/str_split.h" +#include #include #include +#include +#include #include #include #include @@ -36,6 +51,28 @@ namespace cloud { namespace storage { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { +class WrapRestCredentials { + public: + explicit WrapRestCredentials( + std::shared_ptr impl) + : impl_(std::move(impl)) {} + + StatusOr> SignBlob( + SigningAccount const& signing_account, std::string const& blob) const { + return impl_->SignBlob(signing_account.value_or(impl_->AccountEmail()), + blob); + } + + std::string AccountEmail() const { return impl_->AccountEmail(); } + std::string KeyId() const { return impl_->KeyId(); } + + private: + std::shared_ptr impl_; +}; + +} // namespace + using ::google::cloud::rest_internal::CurlHandle; static_assert(std::is_copy_constructible::value, @@ -60,8 +97,6 @@ Client::Client(InternalOnly, Options const& opts) : Client(InternalOnlyNoDecorations{}, storage_internal::MakeStorageConnection(opts)) {} -StatusOr Client::CreateDefaultClient() { return Client(Options{}); } - ObjectReadStream Client::ReadObjectImpl( internal::ReadObjectRangeRequest const& request) { auto source = connection_->ReadObject(request); @@ -235,17 +270,21 @@ std::string Client::SigningEmail(SigningAccount const& signing_account) const { if (signing_account.has_value()) { return signing_account.value(); } - return connection_->client_options().credentials()->AccountEmail(); + + auto credentials = WrapRestCredentials(rest_internal::MapCredentials( + *connection_->options().get())); + return credentials.AccountEmail(); } StatusOr Client::SignBlobImpl( SigningAccount const& signing_account, std::string const& string_to_sign) { - auto credentials = connection_->client_options().credentials(); + auto credentials = WrapRestCredentials(rest_internal::MapCredentials( + *connection_->options().get())); // First try to sign locally. - auto signed_blob = credentials->SignBlob(signing_account, string_to_sign); + auto signed_blob = credentials.SignBlob(signing_account, string_to_sign); if (signed_blob) { - return SignBlobResponseRaw{credentials->KeyId(), *std::move(signed_blob)}; + return SignBlobResponseRaw{credentials.KeyId(), *std::move(signed_blob)}; } // If signing locally fails that may be because the credentials do not @@ -389,8 +428,224 @@ std::string Client::EndpointAuthority() const { return std::string(endpoint_authority); } +// This magic number was obtained by experimentation summarized in #2657 +#ifndef GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_UPLOAD_BUFFER_SIZE +#define GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_UPLOAD_BUFFER_SIZE (8 * 1024 * 1024) +#endif // GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_UPLOAD_BUFFER_SIZE + +// This magic number was obtained by experimentation summarized in #2657 +#ifndef GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_BUFFER_SIZE +#define GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_BUFFER_SIZE \ + (3 * 1024 * 1024 / 2) +#endif // GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_BUFFER_SIZE + +// This is a result of experiments performed in #2657. +#ifndef GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_MAXIMUM_SIMPLE_UPLOAD_SIZE +#define GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_MAXIMUM_SIMPLE_UPLOAD_SIZE \ + (20 * 1024 * 1024L) +#endif // GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_MAXIMUM_SIMPLE_UPLOAD_SIZE + +#ifndef GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_STALL_TIMEOUT +#define GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_STALL_TIMEOUT 120 +#endif // GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_STALL_TIMEOUT + +// Define the defaults using a pre-processor macro, this allows the application +// developers to change the defaults for their application by compiling with +// different values. +#ifndef STORAGE_CLIENT_DEFAULT_MAXIMUM_RETRY_PERIOD +#define STORAGE_CLIENT_DEFAULT_MAXIMUM_RETRY_PERIOD std::chrono::minutes(15) +#endif // STORAGE_CLIENT_DEFAULT_MAXIMUM_RETRY_PERIOD + +#ifndef STORAGE_CLIENT_DEFAULT_INITIAL_BACKOFF_DELAY +#define STORAGE_CLIENT_DEFAULT_INITIAL_BACKOFF_DELAY std::chrono::seconds(1) +#endif // STORAGE_CLIENT_DEFAULT_INITIAL_BACKOFF_DELAY + +#ifndef STORAGE_CLIENT_DEFAULT_MAXIMUM_BACKOFF_DELAY +#define STORAGE_CLIENT_DEFAULT_MAXIMUM_BACKOFF_DELAY std::chrono::minutes(5) +#endif // STORAGE_CLIENT_DEFAULT_MAXIMUM_BACKOFF_DELAY + +#ifndef STORAGE_CLIENT_DEFAULT_BACKOFF_SCALING +#define STORAGE_CLIENT_DEFAULT_BACKOFF_SCALING 2.0 +#endif // STORAGE_CLIENT_DEFAULT_BACKOFF_SCALING + +namespace { + +using ::google::cloud::internal::GetEnv; + +absl::optional GetEmulator() { + auto emulator = GetEnv("CLOUD_STORAGE_EMULATOR_ENDPOINT"); + if (emulator) return emulator; + return GetEnv("CLOUD_STORAGE_TESTBENCH_ENDPOINT"); +} + +std::size_t DefaultConnectionPoolSize() { + std::size_t nthreads = std::thread::hardware_concurrency(); + if (nthreads == 0) { + return 4; + } + return 4 * nthreads; +} + +} // namespace + namespace internal { +Options ApplyPolicy(Options opts, RetryPolicy const& p) { + opts.set(p.clone()); + return opts; +} + +Options ApplyPolicy(Options opts, BackoffPolicy const& p) { + opts.set(p.clone()); + return opts; +} + +Options ApplyPolicy(Options opts, IdempotencyPolicy const& p) { + opts.set(p.clone()); + return opts; +} + +Options DefaultOptions(std::shared_ptr const&, + Options opts) { + return DefaultOptions(std::move(opts)); +} + +Options DefaultOptions(Options opts) { + auto ud = GetEnv("GOOGLE_CLOUD_UNIVERSE_DOMAIN"); + if (ud && !ud->empty()) { + opts.set(*std::move(ud)); + } + auto gcs_ep = google::cloud::internal::UniverseDomainEndpoint( + "https://storage.googleapis.com", opts); + auto iam_ep = absl::StrCat(google::cloud::internal::UniverseDomainEndpoint( + "https://iamcredentials.googleapis.com", opts), + "/v1"); + Options o; + if (!opts.has()) { + o.set(MakeGoogleDefaultCredentials()); + } + // Storage has more stringent requirements w.r.t. self-signed JWTs + // than most services. Any scope makes the self-signed JWTs unusable with + // storage, but they remain usable with other services. We need to disable + // self-signed JWTs. + o.set({}) + .set(std::move(gcs_ep)) + .set(std::move(iam_ep)) + .set("v1") + .set(DefaultConnectionPoolSize()) + .set( + GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_BUFFER_SIZE) + .set( + GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_UPLOAD_BUFFER_SIZE) + .set( + GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_MAXIMUM_SIMPLE_UPLOAD_SIZE) + .set(true) + .set(true) + .set(0) + .set(0) + .set(std::chrono::seconds( + GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_STALL_TIMEOUT)) + .set(1) + .set(1) + .set( + LimitedTimeRetryPolicy(STORAGE_CLIENT_DEFAULT_MAXIMUM_RETRY_PERIOD) + .clone()) + .set( + ExponentialBackoffPolicy(STORAGE_CLIENT_DEFAULT_INITIAL_BACKOFF_DELAY, + STORAGE_CLIENT_DEFAULT_MAXIMUM_BACKOFF_DELAY, + STORAGE_CLIENT_DEFAULT_BACKOFF_SCALING) + .clone()) + .set(AlwaysRetryIdempotencyPolicy().clone()); + + o = google::cloud::internal::MergeOptions(std::move(opts), std::move(o)); + // If the application did not set `DownloadStallTimeoutOption` then use the + // same value as `TransferStallTimeoutOption` (which could be the default + // value). Some applications need tighter timeouts for downloads, but longer + // timeouts for other transfers. + if (!o.has()) { + o.set(o.get()); + } + + auto emulator = GetEmulator(); + if (emulator.has_value()) { + o.set(*emulator).set(*emulator + + "/iamapi"); + } + + auto logging = GetEnv("CLOUD_STORAGE_ENABLE_TRACING"); + if (logging) { + for (auto c : absl::StrSplit(*logging, ',')) { + GCP_LOG(INFO) << "Enabling logging for " << c; + o.lookup().insert(std::string(c)); + } + } + + auto tracing = GetEnv("GOOGLE_CLOUD_CPP_OPENTELEMETRY_TRACING"); + if (tracing && !tracing->empty()) { + o.set(true); + } + + auto project_id = GetEnv("GOOGLE_CLOUD_PROJECT"); + if (project_id.has_value()) { + o.set(std::move(*project_id)); + } + + // Always apply the RestClient defaults, even if it is not in use. Now that we + // use the low-level initialization code in + // google/cloud/internal/curl_wrappers.cc, these are always needed. + namespace rest = ::google::cloud::rest_internal; + auto rest_defaults = Options{} + .set( + o.get()) + .set( + o.get()) + .set( + o.get()) + .set( + o.get()) + .set( + o.get()) + .set( + o.get()) + .set( + o.get()) + .set( + o.get()) + .set( + o.get()); + + // These two are not always present, but if they are, and only if they are, we + // need to map their value to the corresponding option in `rest_internal::`. + if (o.has()) { + rest_defaults.set( + o.get()); + } + if (o.has()) { + rest_defaults.set(o.get()); + } + + return google::cloud::internal::MergeOptions(std::move(o), + std::move(rest_defaults)); +} + +Options DefaultOptionsWithCredentials(Options opts) { + if (opts.has()) { + auto credentials = + rest_internal::MapCredentials(*opts.get()); + return internal::DefaultOptions(std::move(credentials), std::move(opts)); + } + if (GetEmulator().has_value()) { + return internal::DefaultOptions( + rest_internal::MapCredentials( + *google::cloud::MakeInsecureCredentials()), + std::move(opts)); + } + auto credentials = rest_internal::MapCredentials( + *google::cloud::MakeGoogleDefaultCredentials( + google::cloud::internal::MakeAuthOptions(opts))); + return internal::DefaultOptions(std::move(credentials), std::move(opts)); +} + Client ClientImplDetails::CreateWithDecorations( Options const& opts, std::shared_ptr connection) { return Client( diff --git a/google/cloud/storage/client.h b/google/cloud/storage/client.h index 1b279dfeaa7f1..9b62a8be5d088 100644 --- a/google/cloud/storage/client.h +++ b/google/cloud/storage/client.h @@ -28,13 +28,13 @@ #include "google/cloud/storage/list_objects_reader.h" #include "google/cloud/storage/notification_event_type.h" #include "google/cloud/storage/notification_payload_format.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/object_rewriter.h" #include "google/cloud/storage/object_stream.h" #include "google/cloud/storage/retry_policy.h" #include "google/cloud/storage/upload_options.h" #include "google/cloud/storage/version.h" #include "google/cloud/internal/group_options.h" +#include "google/cloud/internal/oauth2_credentials.h" #include "google/cloud/internal/throw_delegate.h" #include "google/cloud/options.h" #include "google/cloud/status.h" @@ -54,6 +54,25 @@ namespace internal { class NonResumableParallelUploadState; class ResumableParallelUploadState; struct ClientImplDetails; + +Options ApplyPolicy(Options opts, RetryPolicy const& p); +Options ApplyPolicy(Options opts, BackoffPolicy const& p); +Options ApplyPolicy(Options opts, IdempotencyPolicy const& p); + +inline Options ApplyPolicies(Options opts) { return opts; } + +template +Options ApplyPolicies(Options opts, P&& head, Policies&&... tail) { + opts = ApplyPolicy(std::move(opts), std::forward

(head)); + return ApplyPolicies(std::move(opts), std::forward(tail)...); +} + +Options DefaultOptions( + std::shared_ptr const& credentials, + Options opts); +Options DefaultOptions(Options opts = {}); +Options DefaultOptionsWithCredentials(Options opts); + } // namespace internal /** * The Google Cloud Storage (GCS) Client. @@ -3421,103 +3440,9 @@ class Client { } ///@} - /** - * Creates the default client type given the options. - * - * @param options the client options, these are used to control credentials, - * buffer sizes, etc. - * @param policies the client policies, these control the behavior of the - * client, for example, how to backoff when an operation needs to be - * retried, or what operations cannot be retried because they are not - * idempotent. - * - * @deprecated use the constructor from `google::cloud::Options` instead. - */ - template - explicit Client(ClientOptions options, Policies&&... policies) - : Client(InternalOnly{}, internal::ApplyPolicies( - internal::MakeOptions(std::move(options)), - std::forward(policies)...)) {} - - /** - * Creates the default client type given the credentials and policies. - * - * @param credentials a set of credentials to initialize the `ClientOptions`. - * @param policies the client policies, these control the behavior of the - * client, for example, how to backoff when an operation needs to be - * retried, or what operations cannot be retried because they are not - * idempotent. - * - * @deprecated use the constructor from `google::cloud::Options` instead. - */ - template - explicit Client(std::shared_ptr credentials, - Policies&&... policies) - : Client(InternalOnly{}, - internal::ApplyPolicies( - internal::DefaultOptions(std::move(credentials), {}), - std::forward(policies)...)) {} - - /** - * Create a Client using ClientOptions::CreateDefaultClientOptions(). - * - * @deprecated use the constructor from `google::cloud::Options` instead. - */ - static StatusOr CreateDefaultClient(); - - /// Builds a client and maybe override the retry, idempotency, and/or backoff - /// policies. - /// @deprecated This was intended only for test code, applications should not - /// use it. - template -#if !defined(_MSC_VER) || _MSC_VER >= 1920 - GOOGLE_CLOUD_CPP_DEPRECATED( - "applications should not need this." - " Please use the constructors from ClientOptions instead." - " For mocking, please use testing::ClientFromMock() instead." - " Please file a bug at https://github.com/googleapis/google-cloud-cpp" - " if you have a use-case not covered by these.") -#endif // _MSC_VER - // We cannot `std::move(connection)` because it is used twice in the delegated - // constructor parameters. And we cannot just use `StorageConnection const&` - // because we do hold on to the `std::shared_ptr<>`. - explicit Client( - std::shared_ptr const& connection, - Policies&&... policies) - : Client(InternalOnly{}, - internal::ApplyPolicies( - internal::DefaultOptions( - connection->client_options().credentials(), {}), - std::forward(policies)...), - // We cannot std::move() because it is also used in the previous - // parameter. - connection) { - } - /// Define a tag to disable automatic decorations of the StorageConnection. struct NoDecorations {}; - /// Builds a client with a specific StorageConnection, without decorations. - /// @deprecated This was intended only for test code, applications should not - /// use it. - GOOGLE_CLOUD_CPP_DEPRECATED( - "applications should not need this." - " Please file a bug at https://github.com/googleapis/google-cloud-cpp" - " if you do.") - explicit Client(std::shared_ptr connection, - NoDecorations) - : Client(InternalOnlyNoDecorations{}, std::move(connection)) {} - - /// Access the underlying `StorageConnection`. - /// @deprecated Only intended for implementors, do not use. - GOOGLE_CLOUD_CPP_DEPRECATED( - "applications should not need this." - " Please file a bug at https://github.com/googleapis/google-cloud-cpp" - " if you do.") - std::shared_ptr raw_client() const { - return connection_; - } - private: friend class internal::NonResumableParallelUploadState; friend class internal::ResumableParallelUploadState; diff --git a/google/cloud/storage/client_bucket_acl_test.cc b/google/cloud/storage/client_bucket_acl_test.cc index 09828ed385151..0c481bd50622b 100644 --- a/google/cloud/storage/client_bucket_acl_test.cc +++ b/google/cloud/storage/client_bucket_acl_test.cc @@ -14,7 +14,6 @@ #include "google/cloud/storage/client.h" #include "google/cloud/storage/internal/bucket_access_control_parser.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/retry_policy.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/client_unit_test.h" diff --git a/google/cloud/storage/client_bucket_test.cc b/google/cloud/storage/client_bucket_test.cc index fe7962ab7d8fb..9bc25ec988781 100644 --- a/google/cloud/storage/client_bucket_test.cc +++ b/google/cloud/storage/client_bucket_test.cc @@ -14,7 +14,6 @@ #include "google/cloud/storage/client.h" #include "google/cloud/storage/internal/bucket_metadata_parser.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/retry_policy.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/client_unit_test.h" @@ -197,7 +196,6 @@ TEST_F(BucketTest, CreateBucket) { })"""; auto expected = internal::BucketMetadataParser::FromString(text).value(); - EXPECT_CALL(*mock_, client_options()).Times(0); EXPECT_CALL(*mock_, CreateBucket) .WillOnce(Return(StatusOr(TransientError()))) .WillOnce([&expected](internal::CreateBucketRequest const& r) { diff --git a/google/cloud/storage/client_default_object_acl_test.cc b/google/cloud/storage/client_default_object_acl_test.cc index 7505e6a0ba26a..fb9ff8400a0c9 100644 --- a/google/cloud/storage/client_default_object_acl_test.cc +++ b/google/cloud/storage/client_default_object_acl_test.cc @@ -14,7 +14,6 @@ #include "google/cloud/storage/client.h" #include "google/cloud/storage/internal/object_access_control_parser.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/retry_policy.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/client_unit_test.h" diff --git a/google/cloud/storage/client_notifications_test.cc b/google/cloud/storage/client_notifications_test.cc index dae426e0f7a38..e1d827bbdc990 100644 --- a/google/cloud/storage/client_notifications_test.cc +++ b/google/cloud/storage/client_notifications_test.cc @@ -16,7 +16,6 @@ #include "google/cloud/storage/internal/notification_metadata_parser.h" #include "google/cloud/storage/notification_event_type.h" #include "google/cloud/storage/notification_payload_format.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/retry_policy.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/client_unit_test.h" diff --git a/google/cloud/storage/client_object_acl_test.cc b/google/cloud/storage/client_object_acl_test.cc index fcec747c12599..3ef51a51ec21f 100644 --- a/google/cloud/storage/client_object_acl_test.cc +++ b/google/cloud/storage/client_object_acl_test.cc @@ -14,7 +14,6 @@ #include "google/cloud/storage/client.h" #include "google/cloud/storage/internal/object_access_control_parser.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/retry_policy.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/client_unit_test.h" diff --git a/google/cloud/storage/client_object_copy_test.cc b/google/cloud/storage/client_object_copy_test.cc index e3ccfe6060877..873721aaa5b60 100644 --- a/google/cloud/storage/client_object_copy_test.cc +++ b/google/cloud/storage/client_object_copy_test.cc @@ -14,7 +14,6 @@ #include "google/cloud/storage/client.h" #include "google/cloud/storage/internal/object_metadata_parser.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/retry_policy.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/client_unit_test.h" diff --git a/google/cloud/storage/client_object_test.cc b/google/cloud/storage/client_object_test.cc index ab743c2aafda4..06b0cb060a6bd 100644 --- a/google/cloud/storage/client_object_test.cc +++ b/google/cloud/storage/client_object_test.cc @@ -14,7 +14,6 @@ #include "google/cloud/storage/client.h" #include "google/cloud/storage/internal/object_metadata_parser.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/retry_policy.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/client_unit_test.h" diff --git a/google/cloud/storage/client_options.cc b/google/cloud/storage/client_options.cc deleted file mode 100644 index 686ed1a74d173..0000000000000 --- a/google/cloud/storage/client_options.cc +++ /dev/null @@ -1,378 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_options.h" -#include "google/cloud/storage/internal/unified_rest_credentials.h" -#include "google/cloud/storage/oauth2/credentials.h" -#include "google/cloud/storage/oauth2/google_credentials.h" -#include "google/cloud/internal/absl_str_join_quiet.h" -#include "google/cloud/internal/curl_options.h" -#include "google/cloud/internal/getenv.h" -#include "google/cloud/internal/populate_common_options.h" -#include "google/cloud/internal/rest_options.h" -#include "google/cloud/internal/rest_response.h" -#include "google/cloud/internal/service_endpoint.h" -#include "google/cloud/log.h" -#include "google/cloud/opentelemetry_options.h" -#include "google/cloud/universe_domain_options.h" -#include "absl/strings/str_split.h" -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -using ::google::cloud::internal::GetEnv; - -namespace { - -absl::optional GetEmulator() { - auto emulator = GetEnv("CLOUD_STORAGE_EMULATOR_ENDPOINT"); - if (emulator) return emulator; - return GetEnv("CLOUD_STORAGE_TESTBENCH_ENDPOINT"); -} - -StatusOr> StorageDefaultCredentials( - ChannelOptions const& channel_options) { - auto emulator = GetEmulator(); - if (emulator.has_value()) { - return StatusOr>( - oauth2::CreateAnonymousCredentials()); - } - return oauth2::GoogleDefaultCredentials(channel_options); -} - -std::size_t DefaultConnectionPoolSize() { - std::size_t nthreads = std::thread::hardware_concurrency(); - if (nthreads == 0) { - return 4; - } - return 4 * nthreads; -} - -// This magic number was obtained by experimentation summarized in #2657 -#ifndef GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_UPLOAD_BUFFER_SIZE -#define GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_UPLOAD_BUFFER_SIZE (8 * 1024 * 1024) -#endif // GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_BUFFER_SIZE - -// This magic number was obtained by experimentation summarized in #2657 -#ifndef GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_BUFFER_SIZE -#define GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_BUFFER_SIZE \ - (3 * 1024 * 1024 / 2) -#endif // GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_BUFFER_SIZE - -// This is a result of experiments performed in #2657. -#ifndef GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_MAXIMUM_SIMPLE_UPLOAD_SIZE -#define GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_MAXIMUM_SIMPLE_UPLOAD_SIZE \ - (20 * 1024 * 1024L) -#endif // GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_MAXIMUM_SIMPLE_UPLOAD_SIZE - -#ifndef GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_STALL_TIMEOUT -#define GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_STALL_TIMEOUT 120 -#endif // GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_STALL_TIMEOUT - -// Define the defaults using a pre-processor macro, this allows the application -// developers to change the defaults for their application by compiling with -// different values. -#ifndef STORAGE_CLIENT_DEFAULT_MAXIMUM_RETRY_PERIOD -#define STORAGE_CLIENT_DEFAULT_MAXIMUM_RETRY_PERIOD std::chrono::minutes(15) -#endif // STORAGE_CLIENT_DEFAULT_MAXIMUM_RETRY_PERIOD - -#ifndef STORAGE_CLIENT_DEFAULT_INITIAL_BACKOFF_DELAY -#define STORAGE_CLIENT_DEFAULT_INITIAL_BACKOFF_DELAY std::chrono::seconds(1) -#endif // STORAGE_CLIENT_DEFAULT_INITIAL_BACKOFF_DELAY - -#ifndef STORAGE_CLIENT_DEFAULT_MAXIMUM_BACKOFF_DELAY -#define STORAGE_CLIENT_DEFAULT_MAXIMUM_BACKOFF_DELAY std::chrono::minutes(5) -#endif // STORAGE_CLIENT_DEFAULT_MAXIMUM_BACKOFF_DELAY - -#ifndef STORAGE_CLIENT_DEFAULT_BACKOFF_SCALING -#define STORAGE_CLIENT_DEFAULT_BACKOFF_SCALING 2.0 -#endif // STORAGE_CLIENT_DEFAULT_BACKOFF_SCALING - -} // namespace - -namespace internal { - -std::string RestEndpoint(Options const& options) { - return GetEmulator().value_or(options.get()); -} - -std::string IamRestEndpoint(Options const& options) { - return GetEmulator().value_or(options.get()); -} - -std::string IamRestPath() { - auto emulator = GetEmulator(); - if (emulator) return "/iamapi"; - return {}; -} - -std::string JsonEndpoint(Options const& options) { - return GetEmulator().value_or(options.get()) + - "/storage/" + options.get(); -} - -std::string JsonUploadEndpoint(Options const& options) { - return GetEmulator().value_or(options.get()) + - "/upload/storage/" + options.get(); -} - -std::string XmlEndpoint(Options const& options) { - return GetEmulator().value_or(options.get()); -} - -std::string IamEndpoint(Options const& options) { - auto emulator = GetEmulator(); - if (emulator) return *emulator + "/iamapi"; - return options.get(); -} - -Options MakeOptions(ClientOptions o) { - auto opts = std::move(o.opts_); - if (!o.channel_options().ssl_root_path().empty()) { - opts.set(o.channel_options().ssl_root_path()); - } - return opts; -} - -ClientOptions MakeBackwardsCompatibleClientOptions(Options opts) { - return ClientOptions(std::move(opts)); -} - -Options ApplyPolicy(Options opts, RetryPolicy const& p) { - opts.set(p.clone()); - return opts; -} - -Options ApplyPolicy(Options opts, BackoffPolicy const& p) { - opts.set(p.clone()); - return opts; -} - -Options ApplyPolicy(Options opts, IdempotencyPolicy const& p) { - opts.set(p.clone()); - return opts; -} - -Options DefaultOptions(std::shared_ptr credentials, - Options opts) { - auto ud = GetEnv("GOOGLE_CLOUD_UNIVERSE_DOMAIN"); - if (ud && !ud->empty()) { - opts.set(*std::move(ud)); - } - auto gcs_ep = google::cloud::internal::UniverseDomainEndpoint( - "https://storage.googleapis.com", opts); - auto iam_ep = absl::StrCat(google::cloud::internal::UniverseDomainEndpoint( - "https://iamcredentials.googleapis.com", opts), - "/v1"); - auto o = - Options{} - .set(std::move(credentials)) - .set(std::move(gcs_ep)) - .set(std::move(iam_ep)) - .set("v1") - .set(DefaultConnectionPoolSize()) - .set( - GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_BUFFER_SIZE) - .set( - GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_UPLOAD_BUFFER_SIZE) - .set( - GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_MAXIMUM_SIMPLE_UPLOAD_SIZE) - .set(true) - .set(true) - .set(0) - .set(0) - .set(std::chrono::seconds( - GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_STALL_TIMEOUT)) - .set(1) - .set(1) - .set( - LimitedTimeRetryPolicy( - STORAGE_CLIENT_DEFAULT_MAXIMUM_RETRY_PERIOD) - .clone()) - .set( - ExponentialBackoffPolicy( - STORAGE_CLIENT_DEFAULT_INITIAL_BACKOFF_DELAY, - STORAGE_CLIENT_DEFAULT_MAXIMUM_BACKOFF_DELAY, - STORAGE_CLIENT_DEFAULT_BACKOFF_SCALING) - .clone()) - .set(AlwaysRetryIdempotencyPolicy().clone()); - - o = google::cloud::internal::MergeOptions(std::move(opts), std::move(o)); - // If the application did not set `DownloadStallTimeoutOption` then use the - // same value as `TransferStallTimeoutOption` (which could be the default - // value). Some applications need tighter timeouts for downloads, but longer - // timeouts for other transfers. - if (!o.has()) { - o.set(o.get()); - } - - auto emulator = GetEmulator(); - if (emulator.has_value()) { - o.set(*emulator).set(*emulator + - "/iamapi"); - } - - auto logging = GetEnv("CLOUD_STORAGE_ENABLE_TRACING"); - if (logging) { - for (auto c : absl::StrSplit(*logging, ',')) { - GCP_LOG(INFO) << "Enabling logging for " << c; - o.lookup().insert(std::string(c)); - } - } - - auto tracing = GetEnv("GOOGLE_CLOUD_CPP_OPENTELEMETRY_TRACING"); - if (tracing && !tracing->empty()) { - o.set(true); - } - - auto project_id = GetEnv("GOOGLE_CLOUD_PROJECT"); - if (project_id.has_value()) { - o.set(std::move(*project_id)); - } - - // Always apply the RestClient defaults, even if it is not in use. Now that we - // use the low-level initialization code in - // google/cloud/internal/curl_wrappers.cc, these are always needed. - namespace rest = ::google::cloud::rest_internal; - auto rest_defaults = Options{} - .set( - o.get()) - .set( - o.get()) - .set( - o.get()) - .set( - o.get()) - .set( - o.get()) - .set( - o.get()) - .set( - o.get()) - .set( - o.get()) - .set( - o.get()); - - // These two are not always present, but if they are, and only if they are, we - // need to map their value to the corresponding option in `rest_internal::`. - if (o.has()) { - rest_defaults.set( - o.get()); - } - if (o.has()) { - rest_defaults.set(o.get()); - } - - return google::cloud::internal::MergeOptions(std::move(o), - std::move(rest_defaults)); -} - -Options DefaultOptionsWithCredentials(Options opts) { - if (opts.has()) { - auto credentials = opts.get(); - return internal::DefaultOptions(std::move(credentials), std::move(opts)); - } - if (opts.has()) { - auto credentials = - internal::MapCredentials(*opts.get()); - return internal::DefaultOptions(std::move(credentials), std::move(opts)); - } - if (GetEmulator().has_value()) { - return internal::DefaultOptions( - internal::MapCredentials(*google::cloud::MakeInsecureCredentials()), - std::move(opts)); - } - auto credentials = - internal::MapCredentials(*google::cloud::MakeGoogleDefaultCredentials( - google::cloud::internal::MakeAuthOptions(opts))); - return internal::DefaultOptions(std::move(credentials), std::move(opts)); -} - -} // namespace internal - -StatusOr ClientOptions::CreateDefaultClientOptions() { - return CreateDefaultClientOptions(ChannelOptions{}); -} - -StatusOr ClientOptions::CreateDefaultClientOptions( - ChannelOptions const& channel_options) { - auto creds = StorageDefaultCredentials(channel_options); - if (!creds) return creds.status(); - return ClientOptions(*creds, channel_options); -} - -ClientOptions::ClientOptions(std::shared_ptr credentials, - ChannelOptions channel_options) - : opts_(internal::DefaultOptions(std::move(credentials), {})), - channel_options_(std::move(channel_options)) {} - -ClientOptions::ClientOptions(Options o) - : opts_(std::move(o)), - user_agent_prefix_( - absl::StrJoin(opts_.get(), " ")) { - channel_options_.set_ssl_root_path(opts_.get()); -} - -bool ClientOptions::enable_http_tracing() const { - return opts_.get().count("http") != 0; -} - -ClientOptions& ClientOptions::set_enable_http_tracing(bool enable) { - if (enable) { - opts_.lookup().insert("http"); - } else { - opts_.lookup().erase("http"); - } - return *this; -} - -bool ClientOptions::enable_raw_client_tracing() const { - return opts_.get().count("raw-client") != 0; -} - -ClientOptions& ClientOptions::set_enable_raw_client_tracing(bool enable) { - if (enable) { - opts_.lookup().insert("raw-client"); - } else { - opts_.lookup().erase("raw-client"); - } - return *this; -} - -ClientOptions& ClientOptions::SetDownloadBufferSize(std::size_t size) { - opts_.set( - size == 0 ? GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_BUFFER_SIZE : size); - return *this; -} - -ClientOptions& ClientOptions::SetUploadBufferSize(std::size_t size) { - opts_.set( - size == 0 ? GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_UPLOAD_BUFFER_SIZE : size); - return *this; -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/client_options.h b/google/cloud/storage/client_options.h deleted file mode 100644 index 09f5e968aff7c..0000000000000 --- a/google/cloud/storage/client_options.h +++ /dev/null @@ -1,461 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_CLIENT_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_CLIENT_OPTIONS_H - -#include "google/cloud/storage/oauth2/credentials.h" -#include "google/cloud/storage/options.h" -#include "google/cloud/storage/version.h" -#include "google/cloud/common_options.h" -#include "google/cloud/options.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -class ClientOptions; -namespace internal { -std::string RestEndpoint(Options const&); -std::string IamRestEndpoint(Options const&); -std::string IamRestPath(); -std::string JsonEndpoint(Options const&); -std::string JsonUploadEndpoint(Options const&); -std::string XmlEndpoint(Options const&); -std::string IamEndpoint(Options const&); - -Options MakeOptions(ClientOptions); - -ClientOptions MakeBackwardsCompatibleClientOptions(Options); - -Options ApplyPolicy(Options opts, RetryPolicy const& p); -Options ApplyPolicy(Options opts, BackoffPolicy const& p); -Options ApplyPolicy(Options opts, IdempotencyPolicy const& p); - -inline Options ApplyPolicies(Options opts) { return opts; } - -template -Options ApplyPolicies(Options opts, P&& head, Policies&&... tail) { - opts = ApplyPolicy(std::move(opts), std::forward

(head)); - return ApplyPolicies(std::move(opts), std::forward(tail)...); -} - -Options DefaultOptions(std::shared_ptr credentials, - Options opts); -Options DefaultOptionsWithCredentials(Options opts); - -} // namespace internal - -/** - * Describes the configuration for low-level connection features. - * - * Some applications may want to use a different SSL root of trust for their - * connections, for example, containerized applications might store the - * certificate authority certificates in a hard-coded location. - * - * This is a separate class, as it is used to configure both the normal - * connections to GCS and the connections used to obtain OAuth2 access - * tokens. - */ -class ChannelOptions { - public: - /// @deprecated Use google::cloud::Options and - /// google::cloud::CARootsFilePathOption instead. - std::string ssl_root_path() const { return ssl_root_path_; } - - /// @deprecated Use google::cloud::Options and - /// google::cloud::CARootsFilePathOption instead. - ChannelOptions& set_ssl_root_path(std::string ssl_root_path) { - ssl_root_path_ = std::move(ssl_root_path); - return *this; - } - - private: - std::string ssl_root_path_; -}; - -/** - * Describes the configuration for a `storage::Client` object. - * - * By default, several environment variables are read to configure the client: - * - * - `CLOUD_STORAGE_EMULATOR_ENDPOINT`: if set, use this http endpoint to - * make all http requests instead of the production GCS service. Also, - * if set, the `CreateDefaultClientOptions()` function will use an - * `AnonymousCredentials` object instead of loading Application Default - * %Credentials. - * - `CLOUD_STORAGE_ENABLE_CLOG`: if set, enable std::clog as a backend for - * `google::cloud::LogSink`. - * - `CLOUD_STORAGE_ENABLE_TRACING`: if set, this is the list of components that - * will have logging enabled, the component this is: - * - `http`: trace all http request / responses. - * - * @deprecated Please use google::cloud::Options instead. - */ -class ClientOptions { - public: - /** - * Constructor with channel options. - * - * @deprecated use google::cloud::Options instead. - * - * @param credentials how to authenticate to the client. Using a `nullptr` for - * @p credentials results in undefined behavior. - */ - explicit ClientOptions(std::shared_ptr credentials) - : ClientOptions(std::move(credentials), {}) {} - - /** - * Constructor with channel options. - * - * @deprecated use google::cloud::Options instead. - * - * @param credentials how to authenticate to the client. Using a `nullptr` for - * @p credentials results in undefined behavior. - * @param channel_options the configuration for SSL certificate validation. - */ - ClientOptions(std::shared_ptr credentials, - ChannelOptions channel_options); - - /** - * Creates a `ClientOptions` with Google Application Default %Credentials. - * - * If Application Default %Credentials could not be loaded, this returns a - * `Status` with failure details. If the `CLOUD_STORAGE_EMULATOR_ENDPOINT` - * environment variable is set, this function instead uses an - * `AnonymousCredentials` to configure the client. - * - * @deprecated Please use google::cloud::Options instead. - */ - static StatusOr CreateDefaultClientOptions(); - /// @deprecated Please use google::cloud::Options instead. - static StatusOr CreateDefaultClientOptions( - ChannelOptions const& channel_options); - - /** - * @deprecated Use google::cloud::Options and Oauth2CredentialsOption instead. - */ - std::shared_ptr credentials() const { - return opts_.get(); - } - - /** - * @deprecated Use google::cloud::Options and Oauth2CredentialsOption instead. - */ - ClientOptions& set_credentials(std::shared_ptr c) { - opts_.set(std::move(c)); - return *this; - } - - /** - * @deprecated Use google::cloud::Options and RestEndpointOption instead. - */ - std::string const& endpoint() const { - return opts_.get(); - } - - /** - * @deprecated Use google::cloud::Options and RestEndpointOption instead. - */ - ClientOptions& set_endpoint(std::string endpoint) { - opts_.set(std::move(endpoint)); - return *this; - } - - /** - * @deprecated Use google::cloud::Options and IamEndpointOption instead. - */ - std::string const& iam_endpoint() const { - return opts_.get(); - } - - /** - * @deprecated Use google::cloud::Options and IamEndpointOption instead. - */ - ClientOptions& set_iam_endpoint(std::string endpoint) { - opts_.set(std::move(endpoint)); - return *this; - } - - /** - * @deprecated This was intended for development and not a public API. - */ - std::string const& version() const { - return opts_.get(); - } - - /** - * @deprecated This was intended for development and not a public API. - */ - ClientOptions& set_version(std::string version) { - opts_.set(std::move(version)); - return *this; - } - - /** - * @deprecated Use google::cloud::Options and - * google::cloud::LoggingComponentsOption instead. - */ - bool enable_http_tracing() const; - - /** - * @deprecated Use google::cloud::Options and - * google::cloud::LoggingComponentsOption instead. - */ - ClientOptions& set_enable_http_tracing(bool enable); - - /** - * @deprecated Use google::cloud::Options and - * google::cloud::LoggingComponentsOption instead. - */ - bool enable_raw_client_tracing() const; - - /** - * @deprecated Use google::cloud::Options and - * google::cloud::LoggingComponentsOption instead. - */ - ClientOptions& set_enable_raw_client_tracing(bool enable); - - /** - * @deprecated Use google::cloud::Options and ProjectIdOption instead. - */ - std::string const& project_id() const { return opts_.get(); } - - /** - * @deprecated Use google::cloud::Options and ProjectIdOption instead. - */ - ClientOptions& set_project_id(std::string v) { - opts_.set(std::move(v)); - return *this; - } - - /** - * @deprecated Use google::cloud::Options and ConnectionPoolSizeOption - * instead. - */ - std::size_t connection_pool_size() const { - return opts_.get(); - } - - /** - * @deprecated Use google::cloud::Options and ConnectionPoolSizeOption - * instead. - */ - ClientOptions& set_connection_pool_size(std::size_t size) { - opts_.set(size); - return *this; - } - - /** - * @deprecated Use google::cloud::Options and DownloadBufferSizeOption - * instead. - */ - std::size_t download_buffer_size() const { - return opts_.get(); - } - - /** - * @deprecated Use google::cloud::Options and DownloadBufferSizeOption - * instead. - */ - ClientOptions& SetDownloadBufferSize(std::size_t size); - - /** - * @deprecated Use google::cloud::Options and UploadBufferSizeOption instead. - */ - std::size_t upload_buffer_size() const { - return opts_.get(); - } - - /** - * @deprecated Use google::cloud::Options and UploadBufferSizeOption instead. - */ - ClientOptions& SetUploadBufferSize(std::size_t size); - - /** - * @deprecated Use google::cloud::Options and - * google::cloud::UserAgentProductsOption instead. - */ - std::string const& user_agent_prefix() const { return user_agent_prefix_; } - - /** - * @deprecated Use google::cloud::Options and - * google::cloud::UserAgentProductsOption instead. - */ - ClientOptions& add_user_agent_prefix(std::string prefix) { - opts_.lookup().push_back(prefix); - if (!user_agent_prefix_.empty()) { - prefix += ' '; - prefix += user_agent_prefix_; - } - user_agent_prefix_ = std::move(prefix); - return *this; - } - - /// @deprecated use `add_user_agent_prefix()` instead. - ClientOptions& add_user_agent_prefx(std::string const& v) { - return add_user_agent_prefix(v); - } - - /** - * @deprecated Use google::cloud::Options and MaximumSimpleUploadSizeOption - * instead. - */ - std::size_t maximum_simple_upload_size() const { - return opts_.get(); - } - - /** - * @deprecated Use google::cloud::Options and MaximumSimpleUploadSizeOption - * instead. - */ - ClientOptions& set_maximum_simple_upload_size(std::size_t v) { - opts_.set(v); - return *this; - } - - /** - * If true and using OpenSSL 1.0.2 the library configures the OpenSSL - * callbacks for locking. - * - * @deprecated Use google::cloud::options and EnableCurlSslLockingOption - * instead. - */ - bool enable_ssl_locking_callbacks() const { - return opts_.get(); - } - - /** - * If true and using OpenSSL 1.0.2 the library configures the OpenSSL - * callbacks for locking. - * - * @deprecated Use google::cloud::options and EnableCurlSslLockingOption - * instead. - */ - ClientOptions& set_enable_ssl_locking_callbacks(bool v) { - opts_.set(v); - return *this; - } - - /** - * @deprecated Use google::cloud::Options and EnableCurlSigpipeOption - * instead. - */ - bool enable_sigpipe_handler() const { - return opts_.get(); - } - - /** - * @deprecated Use google::cloud::Options and EnableCurlSigpipeOption - * instead. - */ - ClientOptions& set_enable_sigpipe_handler(bool v) { - opts_.set(v); - return *this; - } - - /** - * @deprecated Use google::cloud::Options and MaximumCurlSocketRecvSizeOption - * instead. - */ - std::size_t maximum_socket_recv_size() const { - return opts_.get(); - } - - /** - * @deprecated Use google::cloud::Options and MaximumCurlSocketRecvSizeOption - * instead. - */ - ClientOptions& set_maximum_socket_recv_size(std::size_t v) { - opts_.set(v); - return *this; - } - - /** - * @deprecated Use google::cloud::Options and MaximumCurlSocketSendSizeOption - * instead. - */ - std::size_t maximum_socket_send_size() const { - return opts_.get(); - } - - /** - * @deprecated Use google::cloud::Options and MaximumCurlSocketSendSizeOption - * instead. - */ - ClientOptions& set_maximum_socket_send_size(std::size_t v) { - opts_.set(v); - return *this; - } - - /// @deprecated Use google::cloud::Options and - /// google::cloud::CARootsFilePathOption instead. - ChannelOptions& channel_options() { return channel_options_; } - - /// @deprecated Use google::cloud::Options and - /// google::cloud::CARootsFilePathOption instead. - ChannelOptions const& channel_options() const { return channel_options_; } - - ///@{ - /** - * Control the maximum amount of time allowed for "stalls" during a download. - * - * A download that receives no data is considered "stalled". If the download - * remains stalled for more than the time set in this option then the download - * is aborted. - * - * The default value is 2 minutes. Can be disabled by setting the value to 0. - * - * @deprecated Use google::cloud::Options and DownloadStallTimeoutOption - * instead. - */ - std::chrono::seconds download_stall_timeout() const { - return opts_.get(); - } - - /** - * @deprecated Use google::cloud::Options and DownloadStallTimeoutOption - * instead. - */ - ClientOptions& set_download_stall_timeout(std::chrono::seconds v) { - opts_.set(std::move(v)); - return *this; - } - ///@} - - private: - friend Options internal::MakeOptions(ClientOptions); - friend ClientOptions internal::MakeBackwardsCompatibleClientOptions(Options); - - explicit ClientOptions(Options o); - - Options opts_; - - // Used for backwards compatibility. The value here is merged with the values - // in `opts_` by internal::MakeOptions(ClientOptions const&); - ChannelOptions channel_options_; - - // Only used for backwards compatibility, the value in `opts_. - std::string user_agent_prefix_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_CLIENT_OPTIONS_H diff --git a/google/cloud/storage/client_options_test.cc b/google/cloud/storage/client_options_test.cc deleted file mode 100644 index 722e5e82c1369..0000000000000 --- a/google/cloud/storage/client_options_test.cc +++ /dev/null @@ -1,546 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_options.h" -#include "google/cloud/storage/oauth2/google_credentials.h" -#include "google/cloud/internal/curl_options.h" -#include "google/cloud/internal/filesystem.h" -#include "google/cloud/internal/random.h" -#include "google/cloud/internal/rest_options.h" -#include "google/cloud/internal/rest_response.h" -#include "google/cloud/opentelemetry_options.h" -#include "google/cloud/testing_util/scoped_environment.h" -#include "google/cloud/testing_util/setenv.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "google/cloud/universe_domain_options.h" -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -using ::google::cloud::testing_util::IsOk; -using ::google::cloud::testing_util::ScopedEnvironment; -using ::testing::IsEmpty; -using ::testing::Not; -using ::testing::UnorderedElementsAre; - -namespace { -class ClientOptionsTest : public ::testing::Test { - public: - ClientOptionsTest() - : enable_tracing_("CLOUD_STORAGE_ENABLE_TRACING", {}), - endpoint_("CLOUD_STORAGE_EMULATOR_ENDPOINT", {}), - old_endpoint_("CLOUD_STORAGE_TESTBENCH_ENDPOINT", {}), - generator_(std::random_device{}()) {} - - std::string CreateRandomFileName() { - // When running on the internal Google CI systems we cannot write to the - // local directory. GTest has a good temporary directory in that case. - return google::cloud::internal::PathAppend( - ::testing::TempDir(), - google::cloud::internal::Sample( - generator_, 8, "abcdefghijklmnopqrstuvwxyz0123456789") + - ".json"); - } - - protected: - ScopedEnvironment enable_tracing_; - ScopedEnvironment endpoint_; - ScopedEnvironment old_endpoint_; - google::cloud::internal::DefaultPRNG generator_; -}; - -// This is a syntactically valid JSON key file, but the key has been invalidated -// and therefore present no security risks. -constexpr char kJsonKeyfileContents[] = R"""({ - "type": "service_account", - "project_id": "foo-project", - "private_key_id": "a1a111aa1111a11a11a11aa111a111a1a1111111", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCltiF2oP3KJJ+S\ntTc1McylY+TuAi3AdohX7mmqIjd8a3eBYDHs7FlnUrFC4CRijCr0rUqYfg2pmk4a\n6TaKbQRAhWDJ7XD931g7EBvCtd8+JQBNWVKnP9ByJUaO0hWVniM50KTsWtyX3up/\nfS0W2R8Cyx4yvasE8QHH8gnNGtr94iiORDC7De2BwHi/iU8FxMVJAIyDLNfyk0hN\neheYKfIDBgJV2v6VaCOGWaZyEuD0FJ6wFeLybFBwibrLIBE5Y/StCrZoVZ5LocFP\nT4o8kT7bU6yonudSCyNMedYmqHj/iF8B2UN1WrYx8zvoDqZk0nxIglmEYKn/6U7U\ngyETGcW9AgMBAAECggEAC231vmkpwA7JG9UYbviVmSW79UecsLzsOAZnbtbn1VLT\nPg7sup7tprD/LXHoyIxK7S/jqINvPU65iuUhgCg3Rhz8+UiBhd0pCH/arlIdiPuD\n2xHpX8RIxAq6pGCsoPJ0kwkHSw8UTnxPV8ZCPSRyHV71oQHQgSl/WjNhRi6PQroB\nSqc/pS1m09cTwyKQIopBBVayRzmI2BtBxyhQp9I8t5b7PYkEZDQlbdq0j5Xipoov\n9EW0+Zvkh1FGNig8IJ9Wp+SZi3rd7KLpkyKPY7BK/g0nXBkDxn019cET0SdJOHQG\nDiHiv4yTRsDCHZhtEbAMKZEpku4WxtQ+JjR31l8ueQKBgQDkO2oC8gi6vQDcx/CX\nZ23x2ZUyar6i0BQ8eJFAEN+IiUapEeCVazuxJSt4RjYfwSa/p117jdZGEWD0GxMC\n+iAXlc5LlrrWs4MWUc0AHTgXna28/vii3ltcsI0AjWMqaybhBTTNbMFa2/fV2OX2\nUimuFyBWbzVc3Zb9KAG4Y7OmJQKBgQC5324IjXPq5oH8UWZTdJPuO2cgRsvKmR/r\n9zl4loRjkS7FiOMfzAgUiXfH9XCnvwXMqJpuMw2PEUjUT+OyWjJONEK4qGFJkbN5\n3ykc7p5V7iPPc7Zxj4mFvJ1xjkcj+i5LY8Me+gL5mGIrJ2j8hbuv7f+PWIauyjnp\nNx/0GVFRuQKBgGNT4D1L7LSokPmFIpYh811wHliE0Fa3TDdNGZnSPhaD9/aYyy78\nLkxYKuT7WY7UVvLN+gdNoVV5NsLGDa4cAV+CWPfYr5PFKGXMT/Wewcy1WOmJ5des\nAgMC6zq0TdYmMBN6WpKUpEnQtbmh3eMnuvADLJWxbH3wCkg+4xDGg2bpAoGAYRNk\nMGtQQzqoYNNSkfus1xuHPMA8508Z8O9pwKU795R3zQs1NAInpjI1sOVrNPD7Ymwc\nW7mmNzZbxycCUL/yzg1VW4P1a6sBBYGbw1SMtWxun4ZbnuvMc2CTCh+43/1l+FHe\nMmt46kq/2rH2jwx5feTbOE6P6PINVNRJh/9BDWECgYEAsCWcH9D3cI/QDeLG1ao7\nrE2NcknP8N783edM07Z/zxWsIsXhBPY3gjHVz2LDl+QHgPWhGML62M0ja/6SsJW3\nYvLLIc82V7eqcVJTZtaFkuht68qu/Jn1ezbzJMJ4YXDYo1+KFi+2CAGR06QILb+I\nlUtj+/nH3HDQjM4ltYfTPUg=\n-----END PRIVATE KEY-----\n", - "client_email": "foo-email@foo-project.iam.gserviceaccount.com", - "client_id": "100000000000000000001", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/foo-email%40foo-project.iam.gserviceaccount.com" -})"""; - -TEST_F(ClientOptionsTest, Default) { - // Create the options with the anonymous credentials because the default - // credentials try to load the application default credentials, and those do - // not exist in the CI environment, which results in errors or warnings. - auto creds = oauth2::CreateAnonymousCredentials(); - ClientOptions options(creds); - EXPECT_FALSE(options.enable_http_tracing()); - EXPECT_FALSE(options.enable_raw_client_tracing()); - EXPECT_TRUE(creds.get() == options.credentials().get()); - EXPECT_EQ("https://storage.googleapis.com", options.endpoint()); - EXPECT_EQ("v1", options.version()); - EXPECT_EQ("https://iamcredentials.googleapis.com/v1", options.iam_endpoint()); -} - -TEST_F(ClientOptionsTest, CreateDefaultError) { - testing_util::ScopedEnvironment creds("GOOGLE_APPLICATION_CREDENTIALS", - "not-a-file-should-fail"); - auto connection = ClientOptions::CreateDefaultClientOptions(); - EXPECT_THAT(connection, Not(IsOk())); -} - -TEST_F(ClientOptionsTest, CreateDefaultWithChannelOptionsError) { - testing_util::ScopedEnvironment creds("GOOGLE_APPLICATION_CREDENTIALS", - "not-a-file-should-fail"); - auto connection = ClientOptions::CreateDefaultClientOptions({}); - EXPECT_THAT(connection, Not(IsOk())); -} - -TEST_F(ClientOptionsTest, CreateDefault) { - auto file = CreateRandomFileName(); - std::ofstream(file) << kJsonKeyfileContents; - testing_util::ScopedEnvironment creds("GOOGLE_APPLICATION_CREDENTIALS", file); - auto connection = ClientOptions::CreateDefaultClientOptions(); - EXPECT_STATUS_OK(connection); - std::remove(file.c_str()); -} - -TEST_F(ClientOptionsTest, CreateDefaultWithChannelOptions) { - auto file = CreateRandomFileName(); - std::ofstream(file) << kJsonKeyfileContents; - testing_util::ScopedEnvironment creds("GOOGLE_APPLICATION_CREDENTIALS", file); - auto connection = ClientOptions::CreateDefaultClientOptions({}); - EXPECT_STATUS_OK(connection); -} - -TEST_F(ClientOptionsTest, EnableRpc) { - testing_util::ScopedEnvironment enable_tracing("CLOUD_STORAGE_ENABLE_TRACING", - "foo,raw-client,bar"); - ClientOptions options(oauth2::CreateAnonymousCredentials()); - EXPECT_TRUE(options.enable_raw_client_tracing()); -} - -TEST_F(ClientOptionsTest, EnableHttp) { - testing_util::ScopedEnvironment enable_tracing("CLOUD_STORAGE_ENABLE_TRACING", - "foo,http,bar"); - ClientOptions options(oauth2::CreateAnonymousCredentials()); - EXPECT_TRUE(options.enable_http_tracing()); -} - -TEST_F(ClientOptionsTest, EndpointsDefault) { - testing_util::ScopedEnvironment endpoint("CLOUD_STORAGE_EMULATOR_ENDPOINT", - {}); - ClientOptions options(oauth2::CreateAnonymousCredentials()); - EXPECT_EQ("https://storage.googleapis.com", options.endpoint()); - auto o = internal::MakeOptions(std::move(options)); - EXPECT_EQ("https://storage.googleapis.com/storage/v1", - internal::JsonEndpoint(o)); - EXPECT_EQ("https://storage.googleapis.com/upload/storage/v1", - internal::JsonUploadEndpoint(o)); - EXPECT_EQ("https://iamcredentials.googleapis.com/v1", - internal::IamEndpoint(o)); -} - -TEST_F(ClientOptionsTest, EndpointsOverride) { - testing_util::ScopedEnvironment endpoint("CLOUD_STORAGE_EMULATOR_ENDPOINT", - {}); - ClientOptions options(oauth2::CreateAnonymousCredentials()); - options.set_endpoint("http://127.0.0.1.nip.io:1234"); - EXPECT_EQ("http://127.0.0.1.nip.io:1234", options.endpoint()); - auto o = internal::MakeOptions(std::move(options)); - EXPECT_EQ("http://127.0.0.1.nip.io:1234/storage/v1", - internal::JsonEndpoint(o)); - EXPECT_EQ("http://127.0.0.1.nip.io:1234/upload/storage/v1", - internal::JsonUploadEndpoint(o)); - EXPECT_EQ("http://127.0.0.1.nip.io:1234", internal::XmlEndpoint(o)); - EXPECT_EQ("https://iamcredentials.googleapis.com/v1", - internal::IamEndpoint(o)); -} - -TEST_F(ClientOptionsTest, EndpointsEmulator) { - testing_util::ScopedEnvironment endpoint("CLOUD_STORAGE_EMULATOR_ENDPOINT", - "http://localhost:1234"); - ClientOptions options(oauth2::CreateAnonymousCredentials()); - EXPECT_EQ("http://localhost:1234", options.endpoint()); - auto o = internal::MakeOptions(std::move(options)); - EXPECT_EQ("http://localhost:1234/storage/v1", internal::JsonEndpoint(o)); - EXPECT_EQ("http://localhost:1234/upload/storage/v1", - internal::JsonUploadEndpoint(o)); - EXPECT_EQ("http://localhost:1234", internal::XmlEndpoint(o)); - EXPECT_EQ("http://localhost:1234/iamapi", internal::IamEndpoint(o)); -} - -TEST_F(ClientOptionsTest, OldEndpointsEmulator) { - google::cloud::testing_util::UnsetEnv("CLOUD_STORAGE_EMULATOR_ENDPOINT"); - testing_util::ScopedEnvironment endpoint("CLOUD_STORAGE_TESTBENCH_ENDPOINT", - "http://localhost:1234"); - ClientOptions options(oauth2::CreateAnonymousCredentials()); - EXPECT_EQ("http://localhost:1234", options.endpoint()); - auto o = internal::MakeOptions(std::move(options)); - EXPECT_EQ("http://localhost:1234/storage/v1", internal::JsonEndpoint(o)); - EXPECT_EQ("http://localhost:1234/upload/storage/v1", - internal::JsonUploadEndpoint(o)); - EXPECT_EQ("http://localhost:1234", internal::XmlEndpoint(o)); - EXPECT_EQ("http://localhost:1234/iamapi", internal::IamEndpoint(o)); -} - -TEST_F(ClientOptionsTest, SetVersion) { - ClientOptions options(oauth2::CreateAnonymousCredentials()); - options.set_version("vTest"); - EXPECT_EQ("vTest", options.version()); - auto o = internal::MakeOptions(std::move(options)); - EXPECT_EQ("https://storage.googleapis.com/storage/vTest", - internal::JsonEndpoint(o)); - EXPECT_EQ("https://storage.googleapis.com/upload/storage/vTest", - internal::JsonUploadEndpoint(o)); -} - -TEST_F(ClientOptionsTest, SetIamEndpoint) { - ClientOptions options(oauth2::CreateAnonymousCredentials()); - options.set_iam_endpoint("http://localhost:1/v2"); - EXPECT_EQ("http://localhost:1/v2", options.iam_endpoint()); -} - -TEST_F(ClientOptionsTest, SetCredentials) { - auto creds = oauth2::CreateAnonymousCredentials(); - ClientOptions options(creds); - auto other = oauth2::CreateAnonymousCredentials(); - options.set_credentials(other); - EXPECT_TRUE(other.get() == options.credentials().get()); - EXPECT_FALSE(creds.get() == other.get()); -} - -TEST_F(ClientOptionsTest, ProjectIdFromEnvironment) { - google::cloud::testing_util::SetEnv("GOOGLE_CLOUD_PROJECT", - "test-project-id"); - ClientOptions options(oauth2::CreateAnonymousCredentials()); - EXPECT_EQ("test-project-id", options.project_id()); -} - -TEST_F(ClientOptionsTest, ProjectIdFromEnvironmentNotSet) { - google::cloud::testing_util::UnsetEnv("GOOGLE_CLOUD_PROJECT"); - ClientOptions options(oauth2::CreateAnonymousCredentials()); - EXPECT_EQ("", options.project_id()); -} - -TEST_F(ClientOptionsTest, SetProjectId) { - ClientOptions options(oauth2::CreateAnonymousCredentials()); - options.set_project_id("test-project-id"); - EXPECT_EQ("test-project-id", options.project_id()); -} - -TEST_F(ClientOptionsTest, SetDownloadBufferSize) { - ClientOptions client_options(oauth2::CreateAnonymousCredentials()); - auto default_size = client_options.download_buffer_size(); - EXPECT_NE(0U, default_size); - client_options.SetDownloadBufferSize(1024); - EXPECT_EQ(1024, client_options.download_buffer_size()); - client_options.SetDownloadBufferSize(0); - EXPECT_EQ(default_size, client_options.download_buffer_size()); -} - -TEST_F(ClientOptionsTest, SetUploadBufferSize) { - ClientOptions client_options(oauth2::CreateAnonymousCredentials()); - auto default_size = client_options.upload_buffer_size(); - EXPECT_NE(0U, default_size); - client_options.SetUploadBufferSize(1024); - EXPECT_EQ(1024, client_options.upload_buffer_size()); - client_options.SetUploadBufferSize(0); - EXPECT_EQ(default_size, client_options.upload_buffer_size()); -} - -TEST_F(ClientOptionsTest, UserAgentPrefix) { - ClientOptions options(oauth2::CreateAnonymousCredentials()); - EXPECT_EQ("", options.user_agent_prefix()); - options.add_user_agent_prefix("foo-1.0"); - EXPECT_EQ("foo-1.0", options.user_agent_prefix()); - options.add_user_agent_prefix("bar-2.2"); - EXPECT_EQ("bar-2.2 foo-1.0", options.user_agent_prefix()); -} - -TEST_F(ClientOptionsTest, SetMaximumSimpleUploadSize) { - ClientOptions client_options(oauth2::CreateAnonymousCredentials()); - auto default_size = client_options.maximum_simple_upload_size(); - EXPECT_NE(0U, default_size); - client_options.set_maximum_simple_upload_size(1024); - EXPECT_EQ(1024, client_options.maximum_simple_upload_size()); - client_options.set_maximum_simple_upload_size(0); - EXPECT_EQ(0, client_options.maximum_simple_upload_size()); -} - -TEST_F(ClientOptionsTest, SetEnableLockingCallbacks) { - ClientOptions client_options(oauth2::CreateAnonymousCredentials()); - auto default_value = client_options.enable_ssl_locking_callbacks(); - EXPECT_TRUE(default_value); - client_options.set_enable_ssl_locking_callbacks(false); - EXPECT_FALSE(client_options.enable_ssl_locking_callbacks()); - client_options.set_enable_ssl_locking_callbacks(true); - EXPECT_TRUE(client_options.enable_ssl_locking_callbacks()); -} - -TEST_F(ClientOptionsTest, SetMaximumSocketRecvSize) { - ClientOptions client_options(oauth2::CreateAnonymousCredentials()); - auto default_value = client_options.maximum_socket_recv_size(); - EXPECT_EQ(0, default_value); - client_options.set_maximum_socket_recv_size(16 * 1024); - EXPECT_EQ(16 * 1024, client_options.maximum_socket_recv_size()); -} - -TEST_F(ClientOptionsTest, SetMaximumSocketSendSize) { - ClientOptions client_options(oauth2::CreateAnonymousCredentials()); - auto default_value = client_options.maximum_socket_send_size(); - EXPECT_EQ(0, default_value); - client_options.set_maximum_socket_send_size(16 * 1024); - EXPECT_EQ(16 * 1024, client_options.maximum_socket_send_size()); -} - -TEST_F(ClientOptionsTest, SetMaximumDownloadStall) { - ClientOptions client_options(oauth2::CreateAnonymousCredentials()); - auto default_value = client_options.download_stall_timeout(); - EXPECT_NE(0, default_value.count()); - client_options.set_download_stall_timeout(std::chrono::seconds(60)); - EXPECT_EQ(60, client_options.download_stall_timeout().count()); -} - -TEST_F(ClientOptionsTest, MakeOptionsFromDefault) { - google::cloud::testing_util::SetEnv("GOOGLE_CLOUD_PROJECT", - "test-project-id"); - auto const opts = internal::MakeOptions( - ClientOptions(oauth2::CreateAnonymousCredentials())); - EXPECT_EQ("https://storage.googleapis.com", opts.get()); - EXPECT_EQ("https://iamcredentials.googleapis.com/v1", - opts.get()); - EXPECT_TRUE(opts.has()); - EXPECT_EQ("v1", opts.get()); - EXPECT_EQ("test-project-id", opts.get()); - EXPECT_LT(0, opts.get()); - EXPECT_LT(0, opts.get()); - EXPECT_LT(0, opts.get()); - EXPECT_LT(0, opts.get()); - EXPECT_LT(0, opts.get()); - EXPECT_TRUE(opts.has()); - EXPECT_TRUE(opts.has()); - EXPECT_EQ(0, opts.get()); - EXPECT_EQ(0, opts.get()); - EXPECT_LT(0, opts.get().count()); - EXPECT_LT(0, opts.get()); - EXPECT_THAT(opts.get(), IsEmpty()); -} - -TEST_F(ClientOptionsTest, DefaultOptions) { - auto o = internal::DefaultOptions(oauth2::CreateAnonymousCredentials(), {}); - EXPECT_EQ("https://storage.googleapis.com", o.get()); - - // Verify any set values are respected overridden. - o = internal::DefaultOptions( - oauth2::CreateAnonymousCredentials(), - Options{}.set("https://private.googleapis.com")); - EXPECT_EQ("https://private.googleapis.com", o.get()); - - o = internal::DefaultOptions(oauth2::CreateAnonymousCredentials(), {}); - EXPECT_EQ("https://storage.googleapis.com", o.get()); - EXPECT_EQ("https://iamcredentials.googleapis.com/v1", - o.get()); - - EXPECT_EQ("v1", o.get()); - EXPECT_LT(0, o.get()); - EXPECT_LT(0, o.get()); - EXPECT_LT(0, o.get()); - EXPECT_LE(0, o.get()); - EXPECT_TRUE(o.get()); - EXPECT_TRUE(o.get()); - EXPECT_EQ(0, o.get()); - EXPECT_EQ(0, o.get()); - EXPECT_LT(std::chrono::seconds(0), o.get()); - EXPECT_LT(0, o.get()); - EXPECT_LT(std::chrono::seconds(0), o.get()); - EXPECT_LT(0, o.get()); - - namespace rest = ::google::cloud::rest_internal; - EXPECT_EQ(o.get(), - o.get()); - EXPECT_EQ(o.get(), - o.get()); - EXPECT_EQ(o.get(), - o.get()); - EXPECT_EQ(o.get(), - o.get()); - EXPECT_EQ(o.get(), - o.get()); - EXPECT_EQ(o.get(), - o.get()); - EXPECT_EQ(o.get(), - o.get()); - EXPECT_EQ(o.get(), - o.get()); - EXPECT_EQ(o.get(), - o.get()); - - EXPECT_FALSE(o.has()); - EXPECT_FALSE(o.has()); -} - -TEST_F(ClientOptionsTest, IncorporatesUniverseDomain) { - auto o = internal::DefaultOptions( - oauth2::CreateAnonymousCredentials(), - Options{}.set( - "my-ud.net")); - EXPECT_EQ(o.get(), "https://storage.my-ud.net"); - EXPECT_EQ(o.get(), "https://iamcredentials.my-ud.net/v1"); -} - -TEST_F(ClientOptionsTest, IncorporatesUniverseDomainEnvVar) { - ScopedEnvironment ud("GOOGLE_CLOUD_UNIVERSE_DOMAIN", "ud-env-var.net"); - - auto o = internal::DefaultOptions( - oauth2::CreateAnonymousCredentials(), - Options{}.set( - "ud-option.net")); - EXPECT_EQ(o.get(), "https://storage.ud-env-var.net"); - EXPECT_EQ(o.get(), - "https://iamcredentials.ud-env-var.net/v1"); -} - -TEST_F(ClientOptionsTest, CustomEndpointOverridesUniverseDomain) { - ScopedEnvironment ud("GOOGLE_CLOUD_UNIVERSE_DOMAIN", "ud-env-var.net"); - - auto o = internal::DefaultOptions( - oauth2::CreateAnonymousCredentials(), - Options{} - .set("https://custom-storage.googleapis.com") - .set( - "https://custom-iamcredentials.googleapis.com/v1") - .set("ud-option.net")); - EXPECT_EQ(o.get(), - "https://custom-storage.googleapis.com"); - EXPECT_EQ(o.get(), - "https://custom-iamcredentials.googleapis.com/v1"); -} - -TEST_F(ClientOptionsTest, HttpVersion) { - namespace rest = ::google::cloud::rest_internal; - auto const options = internal::DefaultOptions( - oauth2::CreateAnonymousCredentials(), - Options{}.set("2.0")); - EXPECT_EQ("2.0", options.get()); -} - -TEST_F(ClientOptionsTest, CAPathOption) { - namespace rest = ::google::cloud::rest_internal; - auto const options = internal::DefaultOptions( - oauth2::CreateAnonymousCredentials(), - Options{}.set("test-only")); - EXPECT_EQ("test-only", options.get()); -} - -TEST_F(ClientOptionsTest, LoggingWithoutEnv) { - ScopedEnvironment env_common("GOOGLE_CLOUD_CPP_ENABLE_TRACING", - absl::nullopt); - ScopedEnvironment env("CLOUD_STORAGE_ENABLE_TRACING", absl::nullopt); - auto const options = - internal::DefaultOptions(oauth2::CreateAnonymousCredentials(), {}); - EXPECT_FALSE(options.has()); -} - -TEST_F(ClientOptionsTest, LoggingWithEnv) { - ScopedEnvironment env_common("GOOGLE_CLOUD_CPP_ENABLE_TRACING", - absl::nullopt); - ScopedEnvironment env("CLOUD_STORAGE_ENABLE_TRACING", "rpc,http"); - auto const options = - internal::DefaultOptions(oauth2::CreateAnonymousCredentials(), {}); - EXPECT_THAT(options.get(), - UnorderedElementsAre("rpc", "http")); -} - -TEST_F(ClientOptionsTest, TracingWithoutEnv) { - ScopedEnvironment env("GOOGLE_CLOUD_CPP_OPENTELEMETRY_TRACING", - absl::nullopt); - auto options = - internal::DefaultOptions(oauth2::CreateAnonymousCredentials(), {}); - EXPECT_FALSE(options.get()); - - options = - internal::DefaultOptions(oauth2::CreateAnonymousCredentials(), - Options{}.set(true)); - EXPECT_TRUE(options.get()); -} - -TEST_F(ClientOptionsTest, TracingWithEnv) { - ScopedEnvironment env("GOOGLE_CLOUD_CPP_OPENTELEMETRY_TRACING", "ON"); - auto const options = internal::DefaultOptions( - oauth2::CreateAnonymousCredentials(), - Options{}.set(false)); - EXPECT_TRUE(options.get()); -} - -TEST_F(ClientOptionsTest, ProjectIdWithoutEnv) { - ScopedEnvironment env("GOOGLE_CLOUD_PROJECT", absl::nullopt); - auto const options = - internal::DefaultOptions(oauth2::CreateAnonymousCredentials(), {}); - EXPECT_FALSE(options.has()); -} - -TEST_F(ClientOptionsTest, ProjecIdtWithEnv) { - ScopedEnvironment env("GOOGLE_CLOUD_PROJECT", "my-project"); - auto const options = - internal::DefaultOptions(oauth2::CreateAnonymousCredentials(), {}); - EXPECT_EQ("my-project", options.get()); -} - -TEST_F(ClientOptionsTest, OverrideWithRestInternal) { - namespace rest = ::google::cloud::rest_internal; - auto const options = - internal::DefaultOptions(oauth2::CreateAnonymousCredentials(), - Options{} - .set(1234) - .set(2345)); - EXPECT_EQ(1234, options.get()); - EXPECT_EQ(2345, options.get()); -} - -TEST_F(ClientOptionsTest, Timeouts) { - EXPECT_EQ(std::chrono::seconds(42), - internal::DefaultOptions(oauth2::CreateAnonymousCredentials(), - Options{}.set( - std::chrono::seconds(42))) - .get()); - - EXPECT_EQ(std::chrono::seconds(7), - internal::DefaultOptions( - oauth2::CreateAnonymousCredentials(), - Options{} - .set(std::chrono::seconds(42)) - .set(std::chrono::seconds(7))) - .get()); - - EXPECT_EQ(std::chrono::seconds(7), - internal::DefaultOptions(oauth2::CreateAnonymousCredentials(), - Options{}.set( - std::chrono::seconds(7))) - .get()); - - EXPECT_NE( - std::chrono::seconds(0), - internal::DefaultOptions(oauth2::CreateAnonymousCredentials(), Options{}) - .get()); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/client_service_account_test.cc b/google/cloud/storage/client_service_account_test.cc index 38301786909c9..3be52afdefc07 100644 --- a/google/cloud/storage/client_service_account_test.cc +++ b/google/cloud/storage/client_service_account_test.cc @@ -15,7 +15,6 @@ #include "google/cloud/storage/client.h" #include "google/cloud/storage/internal/hmac_key_metadata_parser.h" #include "google/cloud/storage/internal/service_account_parser.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/retry_policy.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/client_unit_test.h" diff --git a/google/cloud/storage/client_sign_policy_document_test.cc b/google/cloud/storage/client_sign_policy_document_test.cc index 860b5792cebb8..0763425b3ac96 100644 --- a/google/cloud/storage/client_sign_policy_document_test.cc +++ b/google/cloud/storage/client_sign_policy_document_test.cc @@ -14,8 +14,6 @@ #include "google/cloud/storage/client.h" #include "google/cloud/storage/internal/base64.h" -#include "google/cloud/storage/oauth2/google_application_default_credentials_file.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/client_unit_test.h" #include "google/cloud/storage/testing/mock_client.h" diff --git a/google/cloud/storage/client_sign_url_test.cc b/google/cloud/storage/client_sign_url_test.cc index cd0adb12f5190..a136f226a2323 100644 --- a/google/cloud/storage/client_sign_url_test.cc +++ b/google/cloud/storage/client_sign_url_test.cc @@ -13,8 +13,6 @@ // limitations under the License. #include "google/cloud/storage/client.h" -#include "google/cloud/storage/oauth2/google_application_default_credentials_file.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/client_unit_test.h" #include "google/cloud/testing_util/status_matchers.h" diff --git a/google/cloud/storage/client_test.cc b/google/cloud/storage/client_test.cc index 07ebb8a424bbc..8d49ac1d7ea72 100644 --- a/google/cloud/storage/client_test.cc +++ b/google/cloud/storage/client_test.cc @@ -13,19 +13,28 @@ // limitations under the License. #include "google/cloud/storage/client.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/retry_policy.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/mock_client.h" +#include "google/cloud/internal/curl_options.h" +#include "google/cloud/internal/filesystem.h" #include "google/cloud/internal/getenv.h" +#include "google/cloud/internal/random.h" +#include "google/cloud/internal/rest_options.h" +#include "google/cloud/internal/rest_response.h" #include "google/cloud/opentelemetry_options.h" #include "google/cloud/testing_util/mock_backoff_policy.h" #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/scoped_environment.h" +#include "google/cloud/testing_util/setenv.h" #include "google/cloud/testing_util/status_matchers.h" +#include "google/cloud/universe_domain_options.h" #include #include +#include +#include #include +#include #include #include @@ -37,12 +46,11 @@ namespace { using ::google::cloud::storage::internal::ClientImplDetails; using ::google::cloud::storage::testing::canonical_errors::TransientError; -using ::google::cloud::testing_util::IsOkAndHolds; -using ::google::cloud::testing_util::MockBackoffPolicy; using ::google::cloud::testing_util::ScopedEnvironment; using ::testing::ElementsAre; using ::testing::NotNull; using ::testing::Return; +using ::testing::UnorderedElementsAre; class ObservableRetryPolicy : public LimitedErrorCountRetryPolicy { public: @@ -81,6 +89,13 @@ class ObservableBackoffPolicy : public ExponentialBackoffPolicy { int ObservableBackoffPolicy::on_completion_call_count_; class ClientTest : public ::testing::Test { + public: + ClientTest() + : enable_tracing_("CLOUD_STORAGE_ENABLE_TRACING", {}), + endpoint_("CLOUD_STORAGE_EMULATOR_ENDPOINT", {}), + old_endpoint_("CLOUD_STORAGE_TESTBENCH_ENDPOINT", {}), + generator_(std::random_device{}()) {} + protected: void SetUp() override { mock_ = std::make_shared(); @@ -94,6 +109,10 @@ class ClientTest : public ::testing::Test { } std::shared_ptr mock_; + ScopedEnvironment enable_tracing_; + ScopedEnvironment endpoint_; + ScopedEnvironment old_endpoint_; + google::cloud::internal::DefaultPRNG generator_; }; TEST_F(ClientTest, Equality) { @@ -196,7 +215,6 @@ TEST_F(ClientTest, LoggingDecoratorsRestClient) { ElementsAre("RestStub", "LoggingStub", "StorageConnectionImpl")); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; @@ -239,63 +257,220 @@ TEST_F(ClientTest, OTelDisableTracing) { ElementsAre("RestStub", "LoggingStub", "StorageConnectionImpl")); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY +TEST_F(ClientTest, EndpointsDefault) { + testing_util::ScopedEnvironment endpoint("CLOUD_STORAGE_EMULATOR_ENDPOINT", + {}); + auto options = internal::DefaultOptions(); + EXPECT_EQ("https://storage.googleapis.com", + options.get()); + EXPECT_EQ("https://iamcredentials.googleapis.com/v1", + options.get()); +} + +TEST_F(ClientTest, EndpointsOverride) { + testing_util::ScopedEnvironment endpoint("CLOUD_STORAGE_EMULATOR_ENDPOINT", + {}); + auto options = internal::DefaultOptions( + Options{}.set("http://127.0.0.1.nip.io:1234")); + EXPECT_EQ("http://127.0.0.1.nip.io:1234", options.get()); + EXPECT_EQ("https://iamcredentials.googleapis.com/v1", + options.get()); +} + +TEST_F(ClientTest, EndpointsEmulator) { + testing_util::ScopedEnvironment endpoint("CLOUD_STORAGE_EMULATOR_ENDPOINT", + "http://localhost:1234"); + auto options = internal::DefaultOptions(); + EXPECT_EQ("http://localhost:1234", options.get()); + EXPECT_EQ("http://localhost:1234/iamapi", options.get()); +} + +TEST_F(ClientTest, OldEndpointsEmulator) { + google::cloud::testing_util::UnsetEnv("CLOUD_STORAGE_EMULATOR_ENDPOINT"); + testing_util::ScopedEnvironment endpoint("CLOUD_STORAGE_TESTBENCH_ENDPOINT", + "http://localhost:1234"); + auto options = internal::DefaultOptions(); + EXPECT_EQ("http://localhost:1234", options.get()); + EXPECT_EQ("http://localhost:1234/iamapi", options.get()); +} + +TEST_F(ClientTest, DefaultOptions) { + auto o = internal::DefaultOptions(); + EXPECT_EQ("https://storage.googleapis.com", o.get()); + + // Verify any set values are respected overridden. + o = internal::DefaultOptions( + Options{}.set("https://private.googleapis.com")); + EXPECT_EQ("https://private.googleapis.com", o.get()); + + o = internal::DefaultOptions(); + EXPECT_EQ("https://storage.googleapis.com", o.get()); + EXPECT_EQ("https://iamcredentials.googleapis.com/v1", + o.get()); + + EXPECT_EQ("v1", o.get()); + EXPECT_LT(0, o.get()); + EXPECT_LT(0, o.get()); + EXPECT_LT(0, o.get()); + EXPECT_LE(0, o.get()); + EXPECT_TRUE(o.get()); + EXPECT_TRUE(o.get()); + EXPECT_EQ(0, o.get()); + EXPECT_EQ(0, o.get()); + EXPECT_LT(std::chrono::seconds(0), o.get()); + EXPECT_LT(0, o.get()); + EXPECT_LT(std::chrono::seconds(0), o.get()); + EXPECT_LT(0, o.get()); + + namespace rest = ::google::cloud::rest_internal; + EXPECT_EQ(o.get(), + o.get()); + EXPECT_EQ(o.get(), + o.get()); + EXPECT_EQ(o.get(), + o.get()); + EXPECT_EQ(o.get(), + o.get()); + EXPECT_EQ(o.get(), + o.get()); + EXPECT_EQ(o.get(), + o.get()); + EXPECT_EQ(o.get(), + o.get()); + EXPECT_EQ(o.get(), + o.get()); + EXPECT_EQ(o.get(), + o.get()); + + EXPECT_FALSE(o.has()); + EXPECT_FALSE(o.has()); +} + +TEST_F(ClientTest, IncorporatesUniverseDomain) { + auto o = internal::DefaultOptions( + Options{}.set( + "my-ud.net")); + EXPECT_EQ(o.get(), "https://storage.my-ud.net"); + EXPECT_EQ(o.get(), "https://iamcredentials.my-ud.net/v1"); +} + +TEST_F(ClientTest, IncorporatesUniverseDomainEnvVar) { + ScopedEnvironment ud("GOOGLE_CLOUD_UNIVERSE_DOMAIN", "ud-env-var.net"); + + auto o = internal::DefaultOptions( + Options{}.set( + "ud-option.net")); + EXPECT_EQ(o.get(), "https://storage.ud-env-var.net"); + EXPECT_EQ(o.get(), + "https://iamcredentials.ud-env-var.net/v1"); +} + +TEST_F(ClientTest, CustomEndpointOverridesUniverseDomain) { + ScopedEnvironment ud("GOOGLE_CLOUD_UNIVERSE_DOMAIN", "ud-env-var.net"); + + auto o = internal::DefaultOptions( + Options{} + .set("https://custom-storage.googleapis.com") + .set( + "https://custom-iamcredentials.googleapis.com/v1") + .set("ud-option.net")); + EXPECT_EQ(o.get(), + "https://custom-storage.googleapis.com"); + EXPECT_EQ(o.get(), + "https://custom-iamcredentials.googleapis.com/v1"); +} + +TEST_F(ClientTest, HttpVersion) { + namespace rest = ::google::cloud::rest_internal; + auto const options = internal::DefaultOptions( + Options{}.set("2.0")); + EXPECT_EQ("2.0", options.get()); +} -#include "google/cloud/internal/disable_deprecation_warnings.inc" +TEST_F(ClientTest, CAPathOption) { + namespace rest = ::google::cloud::rest_internal; + auto const options = internal::DefaultOptions( + Options{}.set("test-only")); + EXPECT_EQ("test-only", options.get()); +} -TEST_F(ClientTest, DeprecatedButNotDecommissioned) { - auto m1 = std::make_shared(); +TEST_F(ClientTest, LoggingWithoutEnv) { + ScopedEnvironment env_common("GOOGLE_CLOUD_CPP_ENABLE_TRACING", + absl::nullopt); + ScopedEnvironment env("CLOUD_STORAGE_ENABLE_TRACING", absl::nullopt); + auto const options = internal::DefaultOptions(); + EXPECT_FALSE(options.has()); +} - auto c1 = storage::Client(m1, Client::NoDecorations{}); - EXPECT_EQ(c1.raw_client().get(), m1.get()); +TEST_F(ClientTest, LoggingWithEnv) { + ScopedEnvironment env_common("GOOGLE_CLOUD_CPP_ENABLE_TRACING", + absl::nullopt); + ScopedEnvironment env("CLOUD_STORAGE_ENABLE_TRACING", "rpc,http"); + auto const options = internal::DefaultOptions(); + EXPECT_THAT(options.get(), + UnorderedElementsAre("rpc", "http")); +} + +TEST_F(ClientTest, TracingWithoutEnv) { + ScopedEnvironment env("GOOGLE_CLOUD_CPP_OPENTELEMETRY_TRACING", + absl::nullopt); + auto options = internal::DefaultOptions(); + EXPECT_FALSE(options.get()); + + options = + internal::DefaultOptions(Options{}.set(true)); + EXPECT_TRUE(options.get()); +} + +TEST_F(ClientTest, TracingWithEnv) { + ScopedEnvironment env("GOOGLE_CLOUD_CPP_OPENTELEMETRY_TRACING", "ON"); + auto const options = internal::DefaultOptions( + Options{}.set(false)); + EXPECT_TRUE(options.get()); +} + +TEST_F(ClientTest, ProjectIdWithoutEnv) { + ScopedEnvironment env("GOOGLE_CLOUD_PROJECT", absl::nullopt); + auto const options = internal::DefaultOptions(); + EXPECT_FALSE(options.has()); +} - auto m2 = std::make_shared(); - auto c2 = storage::Client(m2, LimitedErrorCountRetryPolicy(3)); - EXPECT_NE(c2.raw_client().get(), m2.get()); +TEST_F(ClientTest, ProjectIdtWithEnv) { + ScopedEnvironment env("GOOGLE_CLOUD_PROJECT", "my-project"); + auto const options = internal::DefaultOptions(); + EXPECT_EQ("my-project", options.get()); } -TEST_F(ClientTest, DeprecatedRetryPolicies) { - auto constexpr kNumRetries = 2; - auto mock_b = std::make_unique(); - EXPECT_CALL(*mock_b, clone).WillOnce([=] { - auto clone_1 = std::make_unique(); - EXPECT_CALL(*clone_1, clone).WillOnce([=] { - auto clone_2 = std::make_unique(); - EXPECT_CALL(*clone_2, OnCompletion) - .Times(kNumRetries) - .WillRepeatedly(Return(std::chrono::milliseconds(0))); - return clone_2; - }); - return clone_1; - }); - - auto mock = std::make_shared(); - EXPECT_CALL(*mock, ListBuckets) - .Times(kNumRetries + 1) - .WillRepeatedly(Return(TransientError())); - - auto client = storage::Client(mock, LimitedErrorCountRetryPolicy(kNumRetries), - std::move(*mock_b)); - (void)client.ListBuckets(OverrideDefaultProject("fake-project")); +TEST_F(ClientTest, OverrideWithRestInternal) { + namespace rest = ::google::cloud::rest_internal; + auto const options = + internal::DefaultOptions(Options{} + .set(1234) + .set(2345)); + EXPECT_EQ(1234, options.get()); + EXPECT_EQ(2345, options.get()); } -TEST_F(ClientTest, DeprecatedClientFromMock) { - auto mock = std::make_shared(); - auto client = testing::ClientFromMock(mock); - - internal::ListObjectsResponse response; - response.items.push_back( - ObjectMetadata{}.set_bucket("bucket").set_name("object/1")); - response.items.push_back( - ObjectMetadata{}.set_bucket("bucket").set_name("object/2")); - EXPECT_CALL(*mock, ListObjects) - .WillOnce(Return(TransientError())) - .WillOnce(Return(response)); - - auto stream = client.ListObjects("bucket", Prefix("object/")); - std::vector> objects{stream.begin(), stream.end()}; - EXPECT_THAT(objects, ElementsAre(IsOkAndHolds(response.items[0]), - IsOkAndHolds(response.items[1]))); +TEST_F(ClientTest, Timeouts) { + EXPECT_EQ(std::chrono::seconds(42), + internal::DefaultOptions(Options{}.set( + std::chrono::seconds(42))) + .get()); + + EXPECT_EQ(std::chrono::seconds(7), + internal::DefaultOptions( + Options{} + .set(std::chrono::seconds(42)) + .set(std::chrono::seconds(7))) + .get()); + + EXPECT_EQ(std::chrono::seconds(7), + internal::DefaultOptions(Options{}.set( + std::chrono::seconds(7))) + .get()); + + EXPECT_NE(std::chrono::seconds(0), + internal::DefaultOptions().get()); } } // namespace diff --git a/google/cloud/storage/client_write_object_test.cc b/google/cloud/storage/client_write_object_test.cc index 49e91651bb229..65a04e2f04ae0 100644 --- a/google/cloud/storage/client_write_object_test.cc +++ b/google/cloud/storage/client_write_object_test.cc @@ -14,7 +14,6 @@ #include "google/cloud/storage/client.h" #include "google/cloud/storage/internal/object_metadata_parser.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/retry_policy.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/client_unit_test.h" diff --git a/google/cloud/storage/config-grpc.cmake.in b/google/cloud/storage/config-grpc.cmake.in index 4a205b397ec52..ed7cab8090484 100644 --- a/google/cloud/storage/config-grpc.cmake.in +++ b/google/cloud/storage/config-grpc.cmake.in @@ -18,6 +18,5 @@ find_dependency(google_cloud_cpp_googleapis) find_dependency(google_cloud_cpp_grpc_utils) find_dependency(google_cloud_cpp_opentelemetry) find_dependency(absl) -find_dependency(Crc32c) include("${CMAKE_CURRENT_LIST_DIR}/storage_grpc-targets.cmake") diff --git a/google/cloud/storage/config.cmake.in b/google/cloud/storage/config.cmake.in index 9f10f775d01bf..fc0d2a1f3e37d 100644 --- a/google/cloud/storage/config.cmake.in +++ b/google/cloud/storage/config.cmake.in @@ -17,7 +17,6 @@ find_dependency(google_cloud_cpp_rest_internal) find_dependency(google_cloud_cpp_common) find_dependency(absl) find_dependency(CURL) -find_dependency(Crc32c) find_dependency(nlohmann_json) if (NOT WIN32) find_dependency(OpenSSL) diff --git a/google/cloud/storage/examples/BUILD.bazel b/google/cloud/storage/examples/BUILD.bazel index 4cdc4c6d3c531..dce88abeeec74 100644 --- a/google/cloud/storage/examples/BUILD.bazel +++ b/google/cloud/storage/examples/BUILD.bazel @@ -44,7 +44,7 @@ cc_library( "//:storage", "//google/cloud/storage:storage_client_testing", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in storage_examples_unit_tests] @@ -75,7 +75,7 @@ cc_library( "//:storage_grpc_mocks", "//google/cloud/storage:storage_client_testing", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in storage_grpc_unit_tests] 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 41bb9f343edbb..ed40ddb04ab5f 100644 --- a/google/cloud/storage/google_cloud_cpp_storage.bzl +++ b/google/cloud/storage/google_cloud_cpp_storage.bzl @@ -36,7 +36,6 @@ google_cloud_cpp_storage_hdrs = [ "bucket_versioning.h", "bucket_website.h", "client.h", - "client_options.h", "download_options.h", "enable_object_retention.h", "hash_mismatch_error.h", @@ -46,17 +45,12 @@ google_cloud_cpp_storage_hdrs = [ "iam_policy.h", "idempotency_policy.h", "include_folders_as_prefixes.h", - "internal/access_control_common.h", - "internal/access_control_common_parser.h", - "internal/access_token_credentials.h", "internal/base64.h", "internal/binary_data_as_debug_string.h", "internal/bucket_access_control_parser.h", "internal/bucket_acl_requests.h", "internal/bucket_metadata_parser.h", "internal/bucket_requests.h", - "internal/common_metadata.h", - "internal/common_metadata_parser.h", "internal/complex_option.h", "internal/compute_engine_util.h", "internal/connection_factory.h", @@ -67,7 +61,6 @@ google_cloud_cpp_storage_hdrs = [ "internal/curl/request_builder.h", "internal/default_object_acl_requests.h", "internal/empty_response.h", - "internal/error_credentials.h", "internal/generate_message_boundary.h", "internal/generic_object_request.h", "internal/generic_request.h", @@ -82,7 +75,6 @@ google_cloud_cpp_storage_hdrs = [ "internal/hmac_key_metadata_parser.h", "internal/hmac_key_requests.h", "internal/http_response.h", - "internal/impersonate_service_account_credentials.h", "internal/lifecycle_rule_parser.h", "internal/logging_stub.h", "internal/make_jwt_assertion.h", @@ -113,7 +105,6 @@ google_cloud_cpp_storage_hdrs = [ "internal/tracing_connection.h", "internal/tracing_object_read_source.h", "internal/tuple_filter.h", - "internal/unified_rest_credentials.h", "internal/well_known_parameters_impl.h", "lifecycle_rule.h", "list_buckets_extended_reader.h", @@ -124,16 +115,8 @@ google_cloud_cpp_storage_hdrs = [ "notification_event_type.h", "notification_metadata.h", "notification_payload_format.h", - "oauth2/anonymous_credentials.h", - "oauth2/authorized_user_credentials.h", - "oauth2/compute_engine_credentials.h", - "oauth2/credential_constants.h", - "oauth2/credentials.h", - "oauth2/google_application_default_credentials_file.h", - "oauth2/google_credentials.h", - "oauth2/refreshing_credentials_wrapper.h", - "oauth2/service_account_credentials.h", "object_access_control.h", + "object_contexts.h", "object_metadata.h", "object_read_stream.h", "object_retention.h", @@ -174,13 +157,10 @@ google_cloud_cpp_storage_srcs = [ "bucket_retention_policy.cc", "bucket_soft_delete_policy.cc", "client.cc", - "client_options.cc", "hashing_options.cc", "hmac_key_metadata.cc", "iam_policy.cc", "idempotency_policy.cc", - "internal/access_control_common_parser.cc", - "internal/access_token_credentials.cc", "internal/base64.cc", "internal/bucket_access_control_parser.cc", "internal/bucket_acl_requests.cc", @@ -193,7 +173,6 @@ google_cloud_cpp_storage_srcs = [ "internal/crc32c.cc", "internal/default_object_acl_requests.cc", "internal/empty_response.cc", - "internal/error_credentials.cc", "internal/generate_message_boundary.cc", "internal/generic_stub_adapter.cc", "internal/generic_stub_factory.cc", @@ -205,7 +184,6 @@ google_cloud_cpp_storage_srcs = [ "internal/hmac_key_metadata_parser.cc", "internal/hmac_key_requests.cc", "internal/http_response.cc", - "internal/impersonate_service_account_credentials.cc", "internal/lifecycle_rule_parser.cc", "internal/logging_stub.cc", "internal/make_jwt_assertion.cc", @@ -235,22 +213,14 @@ google_cloud_cpp_storage_srcs = [ "internal/storage_connection.cc", "internal/tracing_connection.cc", "internal/tracing_object_read_source.cc", - "internal/unified_rest_credentials.cc", "internal/win32/hash_function_impl.cc", "lifecycle_rule.cc", "list_buckets_reader.cc", "list_hmac_keys_reader.cc", "list_objects_reader.cc", "notification_metadata.cc", - "oauth2/anonymous_credentials.cc", - "oauth2/authorized_user_credentials.cc", - "oauth2/compute_engine_credentials.cc", - "oauth2/credentials.cc", - "oauth2/google_application_default_credentials_file.cc", - "oauth2/google_credentials.cc", - "oauth2/refreshing_credentials_wrapper.cc", - "oauth2/service_account_credentials.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 6867722eadaf7..f3d70b6766817 100644 --- a/google/cloud/storage/google_cloud_cpp_storage.cmake +++ b/google/cloud/storage/google_cloud_cpp_storage.cmake @@ -54,8 +54,6 @@ add_library( bucket_website.h client.cc client.h - client_options.cc - client_options.h download_options.h enable_object_retention.h hash_mismatch_error.h @@ -69,11 +67,6 @@ add_library( idempotency_policy.cc idempotency_policy.h include_folders_as_prefixes.h - internal/access_control_common.h - internal/access_control_common_parser.cc - internal/access_control_common_parser.h - internal/access_token_credentials.cc - internal/access_token_credentials.h internal/base64.cc internal/base64.h internal/binary_data_as_debug_string.h @@ -85,8 +78,6 @@ add_library( internal/bucket_metadata_parser.h internal/bucket_requests.cc internal/bucket_requests.h - internal/common_metadata.h - internal/common_metadata_parser.h internal/complex_option.h internal/compute_engine_util.cc internal/compute_engine_util.h @@ -104,8 +95,6 @@ add_library( internal/default_object_acl_requests.h internal/empty_response.cc internal/empty_response.h - internal/error_credentials.cc - internal/error_credentials.h internal/generate_message_boundary.cc internal/generate_message_boundary.h internal/generic_object_request.h @@ -131,8 +120,6 @@ add_library( internal/hmac_key_requests.h internal/http_response.cc internal/http_response.h - internal/impersonate_service_account_credentials.cc - internal/impersonate_service_account_credentials.h internal/lifecycle_rule_parser.cc internal/lifecycle_rule_parser.h internal/logging_stub.cc @@ -192,8 +179,6 @@ add_library( internal/tracing_object_read_source.cc internal/tracing_object_read_source.h internal/tuple_filter.h - internal/unified_rest_credentials.cc - internal/unified_rest_credentials.h internal/well_known_parameters_impl.h internal/win32/hash_function_impl.cc lifecycle_rule.cc @@ -210,25 +195,10 @@ add_library( notification_metadata.cc notification_metadata.h notification_payload_format.h - oauth2/anonymous_credentials.cc - oauth2/anonymous_credentials.h - oauth2/authorized_user_credentials.cc - oauth2/authorized_user_credentials.h - oauth2/compute_engine_credentials.cc - oauth2/compute_engine_credentials.h - oauth2/credential_constants.h - oauth2/credentials.cc - oauth2/credentials.h - oauth2/google_application_default_credentials_file.cc - oauth2/google_application_default_credentials_file.h - oauth2/google_credentials.cc - oauth2/google_credentials.h - oauth2/refreshing_credentials_wrapper.cc - oauth2/refreshing_credentials_wrapper.h - oauth2/service_account_credentials.cc - oauth2/service_account_credentials.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 @@ -274,7 +244,6 @@ target_link_libraries( google-cloud-cpp::common google-cloud-cpp::rest_internal nlohmann_json::nlohmann_json - Crc32c::crc32c CURL::libcurl Threads::Threads) if (WIN32) @@ -348,8 +317,6 @@ google_cloud_cpp_add_pkgconfig( "absl_variant" NON_WIN32_REQUIRES openssl - LIBS - crc32c WIN32_LIBS ws2_32 bcrypt) @@ -441,7 +408,6 @@ if (BUILD_TESTING) client_object_acl_test.cc client_object_copy_test.cc client_object_test.cc - client_options_test.cc client_service_account_test.cc client_sign_policy_document_test.cc client_sign_url_test.cc @@ -452,9 +418,6 @@ if (BUILD_TESTING) hashing_options_test.cc hmac_key_metadata_test.cc idempotency_policy_test.cc - internal/access_control_common_parser_test.cc - internal/access_control_common_test.cc - internal/access_token_credentials_test.cc internal/base64_test.cc internal/bucket_acl_requests_test.cc internal/bucket_requests_test.cc @@ -481,7 +444,6 @@ if (BUILD_TESTING) internal/hash_values_test.cc internal/hmac_key_requests_test.cc internal/http_response_test.cc - internal/impersonate_service_account_credentials_test.cc internal/logging_stub_test.cc internal/make_jwt_assertion_test.cc internal/md5hash_test.cc @@ -505,7 +467,6 @@ if (BUILD_TESTING) internal/tracing_connection_test.cc internal/tracing_object_read_source_test.cc internal/tuple_filter_test.cc - internal/unified_rest_credentials_test.cc lifecycle_rule_test.cc list_buckets_extended_reader_test.cc list_buckets_reader_test.cc @@ -513,12 +474,6 @@ if (BUILD_TESTING) list_objects_and_prefixes_reader_test.cc list_objects_reader_test.cc notification_metadata_test.cc - oauth2/anonymous_credentials_test.cc - oauth2/authorized_user_credentials_test.cc - oauth2/compute_engine_credentials_test.cc - oauth2/google_application_default_credentials_file_test.cc - oauth2/google_credentials_test.cc - oauth2/service_account_credentials_test.cc object_access_control_test.cc object_metadata_test.cc object_retention_test.cc diff --git a/google/cloud/storage/google_cloud_cpp_storage_grpc.cmake b/google/cloud/storage/google_cloud_cpp_storage_grpc.cmake index 8349ed1889b8f..35f458503ec73 100644 --- a/google/cloud/storage/google_cloud_cpp_storage_grpc.cmake +++ b/google/cloud/storage/google_cloud_cpp_storage_grpc.cmake @@ -272,16 +272,6 @@ create_bazel_config(google_cloud_cpp_storage_grpc) add_library(google-cloud-cpp::storage_grpc ALIAS google_cloud_cpp_storage_grpc) -# TODO(#13857) - remove the backwards compatibility shims -add_library(google_cloud_cpp_experimental_storage_grpc INTERFACE) -set_target_properties( - google_cloud_cpp_experimental_storage_grpc - PROPERTIES EXPORT_NAME "google-cloud-cpp::experimental-storage_grpc") -target_link_libraries(google_cloud_cpp_experimental_storage_grpc - INTERFACE google-cloud-cpp::storage_grpc) -add_library(google-cloud-cpp::experimental-storage_grpc ALIAS - google_cloud_cpp_experimental_storage_grpc) - google_cloud_cpp_add_pkgconfig( storage_grpc "The GCS (Google Cloud Storage) gRPC plugin" @@ -318,8 +308,6 @@ install( install( TARGETS google_cloud_cpp_storage_grpc google_cloud_cpp_storage_protos - # TODO(#13857) - remove the backwards compatibility shims - google_cloud_cpp_experimental_storage_grpc EXPORT storage_grpc-targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT google_cloud_cpp_runtime @@ -362,13 +350,6 @@ if (GOOGLE_CLOUD_CPP_WITH_MOCKS) add_library(google-cloud-cpp::storage_grpc_mocks ALIAS google_cloud_cpp_storage_grpc_mocks) - # TODO(#13857) - remove backwards compatibility shims - add_library(google_cloud_cpp_experimental_storage_grpc_mocks INTERFACE) - target_link_libraries(google_cloud_cpp_experimental_storage_grpc_mocks - INTERFACE google-cloud-cpp::storage_grpc_mocks) - add_library(google-cloud-cpp::experimental-storage_grpc_mocks ALIAS - google_cloud_cpp_experimental_storage_grpc_mocks) - install( FILES ${google_cloud_cpp_storage_grpc_mocks_hdrs} DESTINATION "include/google/cloud/storage/mocks" @@ -382,8 +363,6 @@ if (GOOGLE_CLOUD_CPP_WITH_MOCKS) install( TARGETS google_cloud_cpp_storage_grpc_mocks - # TODO(#13857) - remove backwards compatibility shims - google_cloud_cpp_experimental_storage_grpc_mocks EXPORT storage_grpc_mocks-targets COMPONENT google_cloud_cpp_development) diff --git a/google/cloud/storage/grpc_plugin.cc b/google/cloud/storage/grpc_plugin.cc index dafee35e6f06a..61c2d1c92fc3e 100644 --- a/google/cloud/storage/grpc_plugin.cc +++ b/google/cloud/storage/grpc_plugin.cc @@ -26,23 +26,8 @@ namespace google { namespace cloud { namespace storage { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -// TODO(#13857) - stop using storage_experimental::GrpcPluginOption -#include "google/cloud/internal/disable_deprecation_warnings.inc" -bool UseRest(Options const& options) { - using ::google::cloud::internal::GetEnv; - auto const config = - GetEnv("GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG") - .value_or(options.get()); - return config == "none"; -} -#include "google/cloud/internal/diagnostics_pop.inc" - -} // namespace google::cloud::storage::Client MakeGrpcClient(Options opts) { - if (UseRest(opts)) return google::cloud::storage::Client(std::move(opts)); opts = google::cloud::storage_internal::DefaultOptionsGrpc(std::move(opts)); storage_internal::EnableGrpcMetrics(opts); auto stub = std::make_unique(opts); @@ -52,16 +37,5 @@ google::cloud::storage::Client MakeGrpcClient(Options opts) { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage - -namespace storage_experimental { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -google::cloud::storage::Client DefaultGrpcClient(Options opts) { - return google::cloud::storage::MakeGrpcClient(std::move(opts)); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage_experimental - } // namespace cloud } // namespace google diff --git a/google/cloud/storage/grpc_plugin.h b/google/cloud/storage/grpc_plugin.h index ddc24ae55ab0c..51f25f2fdc73c 100644 --- a/google/cloud/storage/grpc_plugin.h +++ b/google/cloud/storage/grpc_plugin.h @@ -37,33 +37,9 @@ google::cloud::storage::Client MakeGrpcClient(Options opts = {}); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage -// TODO(#13857) - remove the backwards compatibility shims. namespace storage_experimental { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -/** - * Configure the GCS+gRPC plugin. - * - * @deprecated use `google::cloud::storage::Client()` to create JSON-based - * clients and `google::cloud::storage::DefaultGrpcClient()` to create - * gRPC-based clients. If you need to pick one dynamically a simple - * `if()` statement or ternary expression can do the job. - */ -struct [[deprecated( - "use storage::Client() or storage::MakeGrpcClient()")]] GrpcPluginOption { - using Type = std::string; -}; - -/** - * Create a `google::cloud::storage::Client` object configured to use gRPC. - * - * @deprecated Please use `google::cloud::storage::MakeGrpcClient`. - */ -[[deprecated( - "use ::google::cloud::storage::MakeGrpcClient() instead")]] google::cloud:: - storage::Client - DefaultGrpcClient(Options opts = {}); - /** * Enable gRPC telemetry for GCS RPCs. * diff --git a/google/cloud/storage/grpc_plugin_test.cc b/google/cloud/storage/grpc_plugin_test.cc index 8be88c86aae45..7f66ce4f79ef0 100644 --- a/google/cloud/storage/grpc_plugin_test.cc +++ b/google/cloud/storage/grpc_plugin_test.cc @@ -50,38 +50,6 @@ TEST(GrpcPluginTest, DefaultCreatesGrpc) { ElementsAre("GrpcStub", "StorageConnectionImpl")); } -#include "google/cloud/internal/disable_deprecation_warnings.inc" -TEST(GrpcPluginTest, MostConfigValuesCreatesGrpc) { - // Explicitly disable logging, which may be enabled by our CI builds. - auto logging = - ScopedEnvironment("CLOUD_STORAGE_ENABLE_TRACING", absl::nullopt); - auto config = - ScopedEnvironment("GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG", absl::nullopt); - // Unless the config is set to "none" we want to create the gRPC stub. - for (auto const* config : {"", "metadata", "media", "anything-but-none"}) { - auto client = MakeGrpcClient( - TestOptions().set(config)); - auto impl = ClientImplDetails::GetConnection(client); - ASSERT_THAT(impl, NotNull()); - EXPECT_THAT(impl->InspectStackStructure(), - ElementsAre("GrpcStub", "StorageConnectionImpl")); - } -} - -TEST(GrpcPluginTest, EnvironmentOverrides) { - // Explicitly disable logging, which may be enabled by our CI builds. - auto logging = - ScopedEnvironment("CLOUD_STORAGE_ENABLE_TRACING", absl::nullopt); - auto config = - ScopedEnvironment("GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG", "none"); - auto client = MakeGrpcClient( - TestOptions().set("metadata")); - auto impl = ClientImplDetails::GetConnection(client); - ASSERT_THAT(impl, NotNull()); - EXPECT_THAT(impl->InspectStackStructure(), - ElementsAre("RestStub", "StorageConnectionImpl")); -} - TEST(GrpcPluginTest, UnsetConfigCreatesMetadata) { // Explicitly disable logging, which may be enabled by our CI builds. auto logging = @@ -95,49 +63,6 @@ TEST(GrpcPluginTest, UnsetConfigCreatesMetadata) { ElementsAre("GrpcStub", "StorageConnectionImpl")); } -TEST(GrpcPluginTest, NoneConfigCreatesCurl) { - // Explicitly disable logging, which may be enabled by our CI builds. - auto logging = - ScopedEnvironment("CLOUD_STORAGE_ENABLE_TRACING", absl::nullopt); - auto config = - ScopedEnvironment("GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG", absl::nullopt); - auto client = MakeGrpcClient( - TestOptions().set("none")); - auto impl = ClientImplDetails::GetConnection(client); - ASSERT_THAT(impl, NotNull()); - EXPECT_THAT(impl->InspectStackStructure(), - ElementsAre("RestStub", "StorageConnectionImpl")); -} - -TEST(GrpcPluginTest, HybridUsesGrpcBufferOptions) { - // Explicitly disable logging, which may be enabled by our CI builds. - auto logging = - ScopedEnvironment("CLOUD_STORAGE_ENABLE_TRACING", absl::nullopt); - auto config = - ScopedEnvironment("GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG", absl::nullopt); - auto client = MakeGrpcClient( - TestOptions().set("media")); - EXPECT_GE( - client.raw_client()->options().get(), - 32 * 1024 * 1024L); -} - -TEST(GrpcPluginTest, BackwardsCompatibilityShims) { - // Explicitly disable logging, which may be enabled by our CI builds. - auto logging = - ScopedEnvironment("CLOUD_STORAGE_ENABLE_TRACING", absl::nullopt); - auto config = - ScopedEnvironment("GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG", absl::nullopt); - namespace gcs_ex = ::google::cloud::storage_experimental; - auto client = gcs_ex::DefaultGrpcClient( - TestOptions().set("none")); - auto impl = ClientImplDetails::GetConnection(client); - ASSERT_THAT(impl, NotNull()); - EXPECT_THAT(impl->InspectStackStructure(), - ElementsAre("RestStub", "StorageConnectionImpl")); -} -#include "google/cloud/internal/diagnostics_pop.inc" - TEST(GrpcPluginTest, GrpcMetricsExcludedLabelsOption) { auto const expected = std::set{"service_name", "service_version", "custom_label"}; diff --git a/google/cloud/storage/internal/access_control_common.h b/google/cloud/storage/internal/access_control_common.h deleted file mode 100644 index 2ab66207ac7b0..0000000000000 --- a/google/cloud/storage/internal/access_control_common.h +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_INTERNAL_ACCESS_CONTROL_COMMON_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ACCESS_CONTROL_COMMON_H - -#include "google/cloud/storage/project_team.h" -#include "google/cloud/storage/version.h" -#include "google/cloud/status.h" -#include "absl/types/optional.h" -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { -struct AccessControlCommonParser; - -/** - * Defines common code to both `BucketAccessControl` and `ObjectAccessControl`. - * - * @see - * https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls - * https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls - */ -// TODO(#9897) - remove this class and any references to it -class GOOGLE_CLOUD_CPP_DEPRECATED( - "This class will be removed shortly after 2023-06-01") AccessControlCommon { - public: - AccessControlCommon() = default; - - ///@{ - /** - * @name Well-known values for the role() field.. - * - * The following functions are handy to avoid common typos in the role names. - * We use functions instead of enums because enums are not backwards - * compatible and are brittle to changes in the server-side. - */ - static std::string ROLE_OWNER() { return "OWNER"; } - static std::string ROLE_READER() { return "READER"; } - ///@} - - ///@{ - /** - * @name Well-known values for the project_team().team field.. - * - * The following functions are handy to avoid common typos in the team names. - * We use functions instead of enums because enums are not backwards - * compatible and are brittle to changes in the server-side. - */ - static std::string TEAM_EDITORS() { return storage::TEAM_EDITORS(); } - static std::string TEAM_OWNERS() { return storage::TEAM_OWNERS(); } - static std::string TEAM_VIEWERS() { return storage::TEAM_VIEWERS(); } - ///@} - - std::string const& bucket() const { return bucket_; } - std::string const& domain() const { return domain_; } - std::string const& email() const { return email_; } - - std::string const& entity() const { return entity_; } - void set_entity(std::string e) { entity_ = std::move(e); } - - std::string const& entity_id() const { return entity_id_; } - std::string const& etag() const { return etag_; } - std::string const& id() const { return id_; } - std::string const& kind() const { return kind_; } - - bool has_project_team() const { return project_team_.has_value(); } - ProjectTeam const& project_team() const { return *project_team_; } - absl::optional const& project_team_as_optional() const { - return project_team_; - } - - std::string const& role() const { return role_; } - void set_role(std::string r) { role_ = std::move(r); } - - std::string const& self_link() const { return self_link_; } - - private: - friend struct internal::AccessControlCommonParser; - - std::string bucket_; - std::string domain_; - std::string email_; - std::string entity_; - std::string entity_id_; - std::string etag_; - std::string id_; - std::string kind_; - absl::optional project_team_; - std::string role_; - std::string self_link_; -}; - -#include "google/cloud/internal/disable_deprecation_warnings.inc" - -inline bool operator==(AccessControlCommon const& lhs, - AccessControlCommon const& rhs) { - // Start with id, bucket, etag because they should fail early, then - // alphabetical for readability. - return lhs.id() == rhs.id() && lhs.bucket() == rhs.bucket() && - lhs.etag() == rhs.etag() && lhs.domain() == rhs.domain() && - lhs.email() == rhs.email() && lhs.entity() == rhs.entity() && - lhs.entity_id() == rhs.entity_id() && lhs.kind() == rhs.kind() && - lhs.has_project_team() == rhs.has_project_team() && - (!lhs.has_project_team() || - lhs.project_team() == rhs.project_team()) && - lhs.role() == rhs.role() && lhs.self_link() == rhs.self_link(); -} - -inline bool operator!=(AccessControlCommon const& lhs, - AccessControlCommon const& rhs) { - return std::rel_ops::operator!=(lhs, rhs); -} - -#include "google/cloud/internal/diagnostics_pop.inc" - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ACCESS_CONTROL_COMMON_H diff --git a/google/cloud/storage/internal/access_control_common_parser.cc b/google/cloud/storage/internal/access_control_common_parser.cc deleted file mode 100644 index 66efe5f967354..0000000000000 --- a/google/cloud/storage/internal/access_control_common_parser.cc +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/access_control_common_parser.h" -#include "google/cloud/storage/internal/metadata_parser.h" -#include -// This file contains the implementation for deprecated functions, we need to -// disable the warnings. -#include "google/cloud/internal/disable_deprecation_warnings.inc" - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { -Status AccessControlCommonParser::FromJson(AccessControlCommon& result, - nlohmann::json const& json) { - if (!json.is_object()) return NotJsonObject(json, GCP_ERROR_INFO()); - result.bucket_ = json.value("bucket", ""); - result.domain_ = json.value("domain", ""); - result.email_ = json.value("email", ""); - result.entity_ = json.value("entity", ""); - result.entity_id_ = json.value("entityId", ""); - result.etag_ = json.value("etag", ""); - result.id_ = json.value("id", ""); - result.kind_ = json.value("kind", ""); - result.role_ = json.value("role", ""); - result.self_link_ = json.value("selfLink", ""); - if (json.count("projectTeam") != 0) { - auto const& tmp = json["projectTeam"]; - if (tmp.is_null()) return Status{}; - ProjectTeam p; - p.project_number = tmp.value("projectNumber", ""); - p.team = tmp.value("team", ""); - result.project_team_ = std::move(p); - } - return Status(); -} - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/internal/access_control_common_parser.h b/google/cloud/storage/internal/access_control_common_parser.h deleted file mode 100644 index 459efdc619ecb..0000000000000 --- a/google/cloud/storage/internal/access_control_common_parser.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_INTERNAL_ACCESS_CONTROL_COMMON_PARSER_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ACCESS_CONTROL_COMMON_PARSER_H - -#include "google/cloud/storage/internal/access_control_common.h" -#include "google/cloud/status.h" -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { - -// TODO(#9897) - remove this class and any references to it -struct GOOGLE_CLOUD_CPP_DEPRECATED( - "This class will be removed shortly after 2023-06-01") - AccessControlCommonParser { -#include "google/cloud/internal/disable_deprecation_warnings.inc" - - static Status FromJson(AccessControlCommon& result, - nlohmann::json const& json); - -#include "google/cloud/internal/diagnostics_pop.inc" -}; - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ACCESS_CONTROL_COMMON_PARSER_H diff --git a/google/cloud/storage/internal/access_control_common_parser_test.cc b/google/cloud/storage/internal/access_control_common_parser_test.cc deleted file mode 100644 index ceb919627dd7d..0000000000000 --- a/google/cloud/storage/internal/access_control_common_parser_test.cc +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/access_control_common_parser.h" -#include "google/cloud/testing_util/status_matchers.h" -#include -#include -#include -// This file contains tests for deprecated functions, we need to disable the -// warnings -#include "google/cloud/internal/disable_deprecation_warnings.inc" - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -using ::testing::Eq; - -TEST(AccessControlCommonParserTest, FromJson) { - std::string bucket = "bucket-0"; - std::string role = internal::AccessControlCommon::ROLE_OWNER(); - std::string email = "foo@example.com"; - nlohmann::json metadata{{"bucket", bucket}, {"role", role}, {"email", email}}; - internal::AccessControlCommon result{}; - auto status = internal::AccessControlCommonParser::FromJson(result, metadata); - ASSERT_STATUS_OK(status); - - EXPECT_THAT(result.bucket(), Eq(bucket)); - EXPECT_THAT(result.role(), Eq(role)); - EXPECT_THAT(result.email(), Eq(email)); - EXPECT_FALSE(result.has_project_team()); -} - -TEST(AccessControlCommonParserTest, NullProjectTeamIsValid) { - nlohmann::json metadata{{"projectTeam", nullptr}}; - internal::AccessControlCommon result{}; - auto status = internal::AccessControlCommonParser::FromJson(result, metadata); - ASSERT_STATUS_OK(status); - - EXPECT_FALSE(result.has_project_team()); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/internal/access_control_common_test.cc b/google/cloud/storage/internal/access_control_common_test.cc deleted file mode 100644 index ae8acc14d6c8e..0000000000000 --- a/google/cloud/storage/internal/access_control_common_test.cc +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/access_control_common.h" -#include -// This file contains tests for deprecated functions, we need to disable the -// warnings. -#include "google/cloud/internal/disable_deprecation_warnings.inc" - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { -namespace { -/// @test Verify the well-known values defined in AccessControlCommon. -TEST(AccessControlCommonTest, WellKnownValues) { - EXPECT_EQ("OWNER", AccessControlCommon::ROLE_OWNER()); - EXPECT_EQ("READER", AccessControlCommon::ROLE_READER()); - - EXPECT_EQ("editors", AccessControlCommon::TEAM_EDITORS()); - EXPECT_EQ("owners", AccessControlCommon::TEAM_OWNERS()); - EXPECT_EQ("viewers", AccessControlCommon::TEAM_VIEWERS()); -} - -} // namespace -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/internal/access_token_credentials.cc b/google/cloud/storage/internal/access_token_credentials.cc deleted file mode 100644 index f0315c76adb1a..0000000000000 --- a/google/cloud/storage/internal/access_token_credentials.cc +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/access_token_credentials.h" - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { - -AccessTokenCredentials::AccessTokenCredentials( - google::cloud::AccessToken const& access_token) - : header_("Authorization: Bearer " + access_token.token) {} - -StatusOr AccessTokenCredentials::AuthorizationHeader() { - return header_; -} - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/internal/access_token_credentials.h b/google/cloud/storage/internal/access_token_credentials.h deleted file mode 100644 index 5e8920d3b93a0..0000000000000 --- a/google/cloud/storage/internal/access_token_credentials.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_INTERNAL_ACCESS_TOKEN_CREDENTIALS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ACCESS_TOKEN_CREDENTIALS_H - -#include "google/cloud/storage/oauth2/credentials.h" -#include "google/cloud/storage/version.h" -#include "google/cloud/internal/credentials_impl.h" -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { - -class AccessTokenCredentials : public oauth2::Credentials { - public: - explicit AccessTokenCredentials( - google::cloud::AccessToken const& access_token); - - StatusOr AuthorizationHeader() override; - - private: - std::string header_; -}; - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ACCESS_TOKEN_CREDENTIALS_H diff --git a/google/cloud/storage/internal/access_token_credentials_test.cc b/google/cloud/storage/internal/access_token_credentials_test.cc deleted file mode 100644 index b668d628d758f..0000000000000 --- a/google/cloud/storage/internal/access_token_credentials_test.cc +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/access_token_credentials.h" -#include "google/cloud/testing_util/status_matchers.h" -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { -namespace { - -using ::google::cloud::AccessToken; - -TEST(AccessTokenCredentials, Simple) { - auto const expiration = - std::chrono::system_clock::now() - std::chrono::minutes(10); - - AccessTokenCredentials tested(AccessToken{"token1", expiration}); - EXPECT_EQ("Authorization: Bearer token1", - tested.AuthorizationHeader().value()); - EXPECT_EQ("Authorization: Bearer token1", - tested.AuthorizationHeader().value()); -} - -} // namespace -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google 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.h b/google/cloud/storage/internal/async/connection_impl.h index ad83d3ce098d9..f52750caa427c 100644 --- a/google/cloud/storage/internal/async/connection_impl.h +++ b/google/cloud/storage/internal/async/connection_impl.h @@ -31,7 +31,7 @@ #include "google/cloud/version.h" #include "absl/strings/cord.h" #include "absl/strings/string_view.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include 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/connection_tracing.cc b/google/cloud/storage/internal/async/connection_tracing.cc index 284a340b65d71..a3c6c8b1e531e 100644 --- a/google/cloud/storage/internal/async/connection_tracing.cc +++ b/google/cloud/storage/internal/async/connection_tracing.cc @@ -27,8 +27,6 @@ namespace cloud { namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - namespace { class AsyncConnectionTracing : public storage::AsyncConnection { @@ -224,15 +222,6 @@ std::shared_ptr MakeTracingAsyncConnection( return std::make_unique(std::move(impl)); } -#else - -std::shared_ptr MakeTracingAsyncConnection( - std::shared_ptr impl) { - return impl; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud diff --git a/google/cloud/storage/internal/async/connection_tracing_test.cc b/google/cloud/storage/internal/async/connection_tracing_test.cc index 0171b22875d17..5673ddf426f90 100644 --- a/google/cloud/storage/internal/async/connection_tracing_test.cc +++ b/google/cloud/storage/internal/async/connection_tracing_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/storage/internal/async/connection_tracing.h" #include "google/cloud/storage/async/object_descriptor_connection.h" #include "google/cloud/storage/async/reader_connection.h" @@ -726,5 +724,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY 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 2026203fc8b4d..29d2a6025c3ec 100644 --- a/google/cloud/storage/internal/async/handle_redirect_error.h +++ b/google/cloud/storage/internal/async/handle_redirect_error.h @@ -17,17 +17,18 @@ #include "google/cloud/status.h" #include "google/cloud/version.h" -#include -#include +#include "google/rpc/status.pb.h" +#include "google/storage/v2/storage.pb.h" namespace google { 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 0324afd1fb069..b3ecca5bb5073 100644 --- a/google/cloud/storage/internal/async/handle_redirect_error_test.cc +++ b/google/cloud/storage/internal/async/handle_redirect_error_test.cc @@ -17,9 +17,9 @@ #include "google/cloud/internal/status_payload_keys.h" #include "google/cloud/status.h" #include "google/cloud/testing_util/status_matchers.h" +#include "google/rpc/error_details.pb.h" +#include "google/rpc/status.pb.h" #include -#include -#include #include namespace google { @@ -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/insert_object.h b/google/cloud/storage/internal/async/insert_object.h index 7b2714fdc4ffa..475a8b1f190df 100644 --- a/google/cloud/storage/internal/async/insert_object.h +++ b/google/cloud/storage/internal/async/insert_object.h @@ -23,7 +23,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/version.h" #include "absl/strings/cord.h" -#include +#include "google/storage/v2/storage.pb.h" #include namespace google { 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 e1e7b65f4a8fd..58adf2e2c6c5f 100644 --- a/google/cloud/storage/internal/async/object_descriptor_connection_tracing.cc +++ b/google/cloud/storage/internal/async/object_descriptor_connection_tracing.cc @@ -17,9 +17,7 @@ #include "google/cloud/storage/internal/async/reader_connection_tracing.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/version.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY -#include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY +#include #include namespace google { @@ -27,11 +25,9 @@ namespace cloud { namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - namespace { -namespace sc = ::opentelemetry::trace::SemanticConventions; +namespace sc = ::opentelemetry::semconv; class AsyncObjectDescriptorConnectionTracing : public storage::ObjectDescriptorConnection { @@ -50,12 +46,13 @@ 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_); auto result = impl_->Read(p); span_->AddEvent("gl-cpp.open.read", - {{sc::kThreadId, internal::CurrentThreadId()}, + {{sc::thread::kThreadId, internal::CurrentThreadId()}, {"read-start", p.start}, {"read-length", p.length}}); return MakeTracingReaderConnection(span_, std::move(result)); @@ -80,8 +77,6 @@ MakeTracingObjectDescriptorConnection( std::move(span), std::move(impl)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud diff --git a/google/cloud/storage/internal/async/object_descriptor_connection_tracing.h b/google/cloud/storage/internal/async/object_descriptor_connection_tracing.h index ff0ee34a52389..ffe78427a365a 100644 --- a/google/cloud/storage/internal/async/object_descriptor_connection_tracing.h +++ b/google/cloud/storage/internal/async/object_descriptor_connection_tracing.h @@ -16,24 +16,18 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ASYNC_OBJECT_DESCRIPTOR_CONNECTION_TRACING_H #include "google/cloud/storage/async/object_descriptor_connection.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/opentelemetry.h" -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY namespace google { namespace cloud { namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTracingObjectDescriptorConnection( opentelemetry::nostd::shared_ptr span, std::shared_ptr impl); -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud diff --git a/google/cloud/storage/internal/async/object_descriptor_connection_tracing_test.cc b/google/cloud/storage/internal/async/object_descriptor_connection_tracing_test.cc index 0dbe97d99b68f..5719e76c954a7 100644 --- a/google/cloud/storage/internal/async/object_descriptor_connection_tracing_test.cc +++ b/google/cloud/storage/internal/async/object_descriptor_connection_tracing_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/storage/internal/async/object_descriptor_connection_tracing.h" #include "google/cloud/storage/async/object_descriptor_connection.h" #include "google/cloud/storage/mocks/mock_async_object_descriptor_connection.h" @@ -23,7 +21,7 @@ #include "google/cloud/testing_util/opentelemetry_matchers.h" #include #include -#include +#include namespace google { namespace cloud { @@ -70,7 +68,7 @@ auto expect_no_context = [](auto f) { }; TEST(ObjectDescriptorConnectionTracing, Read) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_unique(); @@ -86,21 +84,22 @@ TEST(ObjectDescriptorConnectionTracing, Read) { actual.reset(); auto spans = span_catcher->GetSpans(); - EXPECT_THAT(spans, - ElementsAre(AllOf( - SpanNamed("test-span-name"), - SpanWithStatus(opentelemetry::trace::StatusCode::kOk), - SpanHasInstrumentationScope(), SpanKindIsClient(), - SpanHasEvents(AllOf( - EventNamed("gl-cpp.open.read"), - SpanEventAttributesAre( - OTelAttribute("read-length", 200), - OTelAttribute("read-start", 100), - OTelAttribute(sc::kThreadId, _))))))); + EXPECT_THAT( + spans, + ElementsAre(AllOf( + SpanNamed("test-span-name"), + SpanWithStatus(opentelemetry::trace::StatusCode::kOk), + SpanHasInstrumentationScope(), SpanKindIsClient(), + SpanHasEvents(AllOf( + EventNamed("gl-cpp.open.read"), + SpanEventAttributesAre( + OTelAttribute("read-length", 200), + OTelAttribute("read-start", 100), + OTelAttribute(sc::thread::kThreadId, _))))))); } TEST(ObjectDescriptorConnectionTracing, ReadThenRead) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock_connection = @@ -126,25 +125,26 @@ TEST(ObjectDescriptorConnectionTracing, ReadThenRead) { auto spans = span_catcher->GetSpans(); EXPECT_THAT( - spans, ElementsAre(AllOf( - SpanNamed("test-span"), - SpanWithStatus(opentelemetry::trace::StatusCode::kOk), - SpanHasInstrumentationScope(), SpanKindIsClient(), - SpanEventsAre( - AllOf(EventNamed("gl-cpp.open.read"), - SpanEventAttributesAre( - OTelAttribute("read-length", 0), - OTelAttribute("read-start", 0), - OTelAttribute(sc::kThreadId, _))), - AllOf(EventNamed("gl-cpp.read"), - SpanEventAttributesAre( - OTelAttribute( - "message.starting_offset", 123), - OTelAttribute(sc::kThreadId, _), - OTelAttribute("rpc.message.id", 1), - // THIS WAS THE MISSING ATTRIBUTE: - OTelAttribute("rpc.message.type", - "RECEIVED"))))))); + spans, + ElementsAre(AllOf( + SpanNamed("test-span"), + SpanWithStatus(opentelemetry::trace::StatusCode::kOk), + SpanHasInstrumentationScope(), SpanKindIsClient(), + SpanEventsAre( + AllOf(EventNamed("gl-cpp.open.read"), + SpanEventAttributesAre( + OTelAttribute("read-length", 0), + OTelAttribute("read-start", 0), + OTelAttribute(sc::thread::kThreadId, _))), + AllOf(EventNamed("gl-cpp.read"), + SpanEventAttributesAre( + OTelAttribute("message.starting_offset", + 123), + OTelAttribute(sc::thread::kThreadId, _), + OTelAttribute("rpc.message.id", 1), + // THIS WAS THE MISSING ATTRIBUTE: + OTelAttribute("rpc.message.type", + "RECEIVED"))))))); } } // namespace @@ -152,5 +152,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/storage/internal/async/object_descriptor_impl.cc b/google/cloud/storage/internal/async/object_descriptor_impl.cc index 6509bcba1b0aa..f1a1906c65018 100644 --- a/google/cloud/storage/internal/async/object_descriptor_impl.cc +++ b/google/cloud/storage/internal/async/object_descriptor_impl.cc @@ -21,7 +21,7 @@ #include "google/cloud/storage/internal/hash_function_impl.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/internal/opentelemetry.h" -#include +#include "google/rpc/status.pb.h" #include #include @@ -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 6c3a8fad42cdd..e45ce7caf6cfb 100644 --- a/google/cloud/storage/internal/async/object_descriptor_impl.h +++ b/google/cloud/storage/internal/async/object_descriptor_impl.h @@ -25,8 +25,9 @@ #include "google/cloud/status.h" #include "google/cloud/version.h" #include "absl/types/optional.h" -#include +#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 ce1a7884aeef8..f87f8b3c1a939 100644 --- a/google/cloud/storage/internal/async/object_descriptor_impl_test.cc +++ b/google/cloud/storage/internal/async/object_descriptor_impl_test.cc @@ -24,9 +24,9 @@ #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/status_matchers.h" #include "absl/strings/string_view.h" +#include "google/storage/v2/storage.pb.h" #include #include -#include #include #include @@ -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/object_descriptor_reader_tracing.cc b/google/cloud/storage/internal/async/object_descriptor_reader_tracing.cc index e1b8eae09e40a..8b95c508c3360 100644 --- a/google/cloud/storage/internal/async/object_descriptor_reader_tracing.cc +++ b/google/cloud/storage/internal/async/object_descriptor_reader_tracing.cc @@ -17,9 +17,7 @@ #include "google/cloud/storage/internal/async/object_descriptor_reader.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/version.h" -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY -#include -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY +#include #include namespace google { @@ -27,11 +25,9 @@ namespace cloud { namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - namespace { -namespace sc = ::opentelemetry::trace::SemanticConventions; +namespace sc = ::opentelemetry::semconv; class ObjectDescriptorReaderTracing : public ObjectDescriptorReader { public: @@ -55,13 +51,13 @@ class ObjectDescriptorReaderTracing : public ObjectDescriptorReader { span->AddEvent( "gl-cpp.read-range", {{/*sc::kRpcMessageType=*/"rpc.message.type", "RECEIVED"}, - {sc::kThreadId, internal::CurrentThreadId()}, + {sc::thread::kThreadId, internal::CurrentThreadId()}, {"message.size", static_cast(payload.size())}}); } else { span->AddEvent( "gl-cpp.read-range", {{/*sc::kRpcMessageType=*/"rpc.message.type", "RECEIVED"}, - {sc::kThreadId, internal::CurrentThreadId()}}); + {sc::thread::kThreadId, internal::CurrentThreadId()}}); return internal::EndSpan(*span, absl::get(std::move(result))); } @@ -77,15 +73,6 @@ MakeTracingObjectDescriptorReader(std::shared_ptr impl) { return std::make_unique(std::move(impl)); } -#else // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::unique_ptr -MakeTracingObjectDescriptorReader(std::shared_ptr impl) { - return std::make_unique(std::move(impl)); -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud diff --git a/google/cloud/storage/internal/async/object_descriptor_reader_tracing_test.cc b/google/cloud/storage/internal/async/object_descriptor_reader_tracing_test.cc index c82015c8bf8e6..5b759637e3596 100644 --- a/google/cloud/storage/internal/async/object_descriptor_reader_tracing_test.cc +++ b/google/cloud/storage/internal/async/object_descriptor_reader_tracing_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/storage/internal/async/object_descriptor_reader_tracing.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/opentelemetry_options.h" @@ -22,7 +20,7 @@ #include #include #include -#include +#include namespace google { namespace cloud { @@ -41,7 +39,7 @@ using ::google::cloud::testing_util::SpanNamed; using ::google::protobuf::TextFormat; using ::testing::_; -namespace sc = ::opentelemetry::trace::SemanticConventions; +namespace sc = ::opentelemetry::semconv; TEST(ObjectDescriptorReaderTracing, Read) { auto span_catcher = InstallSpanCatcher(); @@ -60,16 +58,16 @@ TEST(ObjectDescriptorReaderTracing, Read) { auto actual = reader->Read().get(); auto spans = span_catcher->GetSpans(); - EXPECT_THAT( - spans, ElementsAre( - AllOf(SpanNamed("storage::AsyncConnection::ReadRange"), - SpanHasEvents(AllOf( - EventNamed("gl-cpp.read-range"), - SpanEventAttributesAre( - OTelAttribute("message.size", 10), - OTelAttribute(sc::kThreadId, _), - OTelAttribute("rpc.message.type", - "RECEIVED"))))))); + EXPECT_THAT(spans, + ElementsAre(AllOf( + SpanNamed("storage::AsyncConnection::ReadRange"), + SpanHasEvents(AllOf( + EventNamed("gl-cpp.read-range"), + SpanEventAttributesAre( + OTelAttribute("message.size", 10), + OTelAttribute(sc::thread::kThreadId, _), + OTelAttribute("rpc.message.type", + "RECEIVED"))))))); } TEST(ObjectDescriptorReaderTracing, ReadError) { @@ -81,17 +79,17 @@ TEST(ObjectDescriptorReaderTracing, ReadError) { auto actual = reader->Read().get(); auto spans = span_catcher->GetSpans(); - EXPECT_THAT( - spans, - ElementsAre(AllOf( - SpanNamed("storage::AsyncConnection::ReadRange"), - SpanHasAttributes( - OTelAttribute("gl-cpp.status_code", "NOT_FOUND")), - SpanHasEvents(AllOf(EventNamed("gl-cpp.read-range"), - SpanEventAttributesAre( - OTelAttribute(sc::kThreadId, _), - OTelAttribute("rpc.message.type", - "RECEIVED"))))))); + EXPECT_THAT(spans, + ElementsAre(AllOf( + SpanNamed("storage::AsyncConnection::ReadRange"), + SpanHasAttributes(OTelAttribute( + "gl-cpp.status_code", "NOT_FOUND")), + SpanHasEvents(AllOf( + EventNamed("gl-cpp.read-range"), + SpanEventAttributesAre( + OTelAttribute(sc::thread::kThreadId, _), + OTelAttribute("rpc.message.type", + "RECEIVED"))))))); } } // namespace @@ -99,5 +97,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/storage/internal/async/open_object.cc b/google/cloud/storage/internal/async/open_object.cc index e112d2376b1ed..f8465b92055a4 100644 --- a/google/cloud/storage/internal/async/open_object.cc +++ b/google/cloud/storage/internal/async/open_object.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/storage/internal/async/open_object.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/make_status.h" +#include "absl/strings/str_cat.h" #include namespace google { diff --git a/google/cloud/storage/internal/async/open_object.h b/google/cloud/storage/internal/async/open_object.h index a3e4c4b6972b6..6398778622da1 100644 --- a/google/cloud/storage/internal/async/open_object.h +++ b/google/cloud/storage/internal/async/open_object.h @@ -23,7 +23,7 @@ #include "google/cloud/status.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include diff --git a/google/cloud/storage/internal/async/open_stream.h b/google/cloud/storage/internal/async/open_stream.h index bea42960f1336..c0922781b83a2 100644 --- a/google/cloud/storage/internal/async/open_stream.h +++ b/google/cloud/storage/internal/async/open_stream.h @@ -21,7 +21,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/version.h" #include "absl/types/optional.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include diff --git a/google/cloud/storage/internal/async/open_stream_test.cc b/google/cloud/storage/internal/async/open_stream_test.cc index eade037781006..1848992311ef1 100644 --- a/google/cloud/storage/internal/async/open_stream_test.cc +++ b/google/cloud/storage/internal/async/open_stream_test.cc @@ -17,7 +17,7 @@ #include "google/cloud/internal/make_status.h" #include "google/cloud/testing_util/async_sequencer.h" #include "google/cloud/testing_util/status_matchers.h" -#include +#include "google/storage/v2/storage.pb.h" #include namespace google { diff --git a/google/cloud/storage/internal/async/partial_upload.h b/google/cloud/storage/internal/async/partial_upload.h index f15ae1bb83526..bf4a7be3b2bf4 100644 --- a/google/cloud/storage/internal/async/partial_upload.h +++ b/google/cloud/storage/internal/async/partial_upload.h @@ -21,7 +21,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/version.h" #include "absl/strings/cord.h" -#include +#include "google/storage/v2/storage.pb.h" #include namespace google { diff --git a/google/cloud/storage/internal/async/read_payload_impl_test.cc b/google/cloud/storage/internal/async/read_payload_impl_test.cc index 80a29c934de5d..e206e2185abd0 100644 --- a/google/cloud/storage/internal/async/read_payload_impl_test.cc +++ b/google/cloud/storage/internal/async/read_payload_impl_test.cc @@ -15,7 +15,7 @@ #include "google/cloud/storage/internal/async/read_payload_impl.h" #include "google/cloud/testing_util/is_proto_equal.h" #include "absl/strings/string_view.h" -#include +#include "google/storage/v2/storage.pb.h" #include namespace google { diff --git a/google/cloud/storage/internal/async/read_range.h b/google/cloud/storage/internal/async/read_range.h index fd808ef96a29b..79cde0d5add38 100644 --- a/google/cloud/storage/internal/async/read_range.h +++ b/google/cloud/storage/internal/async/read_range.h @@ -21,7 +21,7 @@ #include "google/cloud/status.h" #include "google/cloud/version.h" #include "absl/types/optional.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include diff --git a/google/cloud/storage/internal/async/reader_connection_factory.h b/google/cloud/storage/internal/async/reader_connection_factory.h index 2d6b9d69f5e99..eabb03d1afe00 100644 --- a/google/cloud/storage/internal/async/reader_connection_factory.h +++ b/google/cloud/storage/internal/async/reader_connection_factory.h @@ -20,7 +20,7 @@ #include "google/cloud/future.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include diff --git a/google/cloud/storage/internal/async/reader_connection_factory_test.cc b/google/cloud/storage/internal/async/reader_connection_factory_test.cc index ca055e0332251..53b0bbabd8fe6 100644 --- a/google/cloud/storage/internal/async/reader_connection_factory_test.cc +++ b/google/cloud/storage/internal/async/reader_connection_factory_test.cc @@ -14,8 +14,8 @@ #include "google/cloud/storage/internal/async/reader_connection_factory.h" #include "google/cloud/testing_util/is_proto_equal.h" +#include "google/storage/v2/storage.pb.h" #include -#include #include namespace google { diff --git a/google/cloud/storage/internal/async/reader_connection_impl.h b/google/cloud/storage/internal/async/reader_connection_impl.h index fc5d7d866e408..522b479fb4d71 100644 --- a/google/cloud/storage/internal/async/reader_connection_impl.h +++ b/google/cloud/storage/internal/async/reader_connection_impl.h @@ -21,7 +21,7 @@ #include "google/cloud/options.h" #include "google/cloud/version.h" #include "absl/types/optional.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include diff --git a/google/cloud/storage/internal/async/reader_connection_resume.cc b/google/cloud/storage/internal/async/reader_connection_resume.cc index 6ffb491d4b897..8d7bd62e5c058 100644 --- a/google/cloud/storage/internal/async/reader_connection_resume.cc +++ b/google/cloud/storage/internal/async/reader_connection_resume.cc @@ -14,8 +14,8 @@ #include "google/cloud/storage/internal/async/reader_connection_resume.h" #include "google/cloud/storage/internal/async/read_payload_impl.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/make_status.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/storage/internal/async/reader_connection_resume.h b/google/cloud/storage/internal/async/reader_connection_resume.h index 3d70585de5e41..3b91f52362d55 100644 --- a/google/cloud/storage/internal/async/reader_connection_resume.h +++ b/google/cloud/storage/internal/async/reader_connection_resume.h @@ -25,7 +25,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/version.h" #include "absl/types/optional.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include diff --git a/google/cloud/storage/internal/async/reader_connection_tracing.cc b/google/cloud/storage/internal/async/reader_connection_tracing.cc index 7fca064d8ead9..eef65f7bb7208 100644 --- a/google/cloud/storage/internal/async/reader_connection_tracing.cc +++ b/google/cloud/storage/internal/async/reader_connection_tracing.cc @@ -13,10 +13,8 @@ // limitations under the License. #include "google/cloud/storage/internal/async/reader_connection_tracing.h" - -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/internal/opentelemetry.h" -#include +#include #include #include #include @@ -27,7 +25,7 @@ namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { -namespace sc = ::opentelemetry::trace::SemanticConventions; +namespace sc = ::opentelemetry::semconv; class AsyncReaderConnectionTracing : public storage::AsyncReaderConnection { public: @@ -40,7 +38,7 @@ class AsyncReaderConnectionTracing : public storage::AsyncReaderConnection { auto scope = opentelemetry::trace::Scope(span_); span_->AddEvent("gl-cpp.cancel", { - {sc::kThreadId, internal::CurrentThreadId()}, + {sc::thread::kThreadId, internal::CurrentThreadId()}, }); return impl_->Cancel(); } @@ -56,7 +54,7 @@ class AsyncReaderConnectionTracing : public storage::AsyncReaderConnection { { {/*sc::kRpcMessageType=*/"rpc.message.type", "RECEIVED"}, {/*sc::kRpcMessageId=*/"rpc.message.id", count}, - {sc::kThreadId, internal::CurrentThreadId()}, + {sc::thread::kThreadId, internal::CurrentThreadId()}, }); return internal::EndSpan(*span, absl::get(std::move(r))); } @@ -66,7 +64,7 @@ class AsyncReaderConnectionTracing : public storage::AsyncReaderConnection { { {/*sc::kRpcMessageType=*/"rpc.message.type", "RECEIVED"}, {/*sc::kRpcMessageId=*/"rpc.message.id", count}, - {sc::kThreadId, internal::CurrentThreadId()}, + {sc::thread::kThreadId, internal::CurrentThreadId()}, {"message.starting_offset", payload.offset()}, }); return r; @@ -102,5 +100,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/storage/internal/async/reader_connection_tracing.h b/google/cloud/storage/internal/async/reader_connection_tracing.h index ce986bf5feef9..d0f8799dfd83e 100644 --- a/google/cloud/storage/internal/async/reader_connection_tracing.h +++ b/google/cloud/storage/internal/async/reader_connection_tracing.h @@ -15,8 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ASYNC_READER_CONNECTION_TRACING_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ASYNC_READER_CONNECTION_TRACING_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/storage/async/reader_connection.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/options.h" @@ -37,6 +35,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ASYNC_READER_CONNECTION_TRACING_H diff --git a/google/cloud/storage/internal/async/reader_connection_tracing_test.cc b/google/cloud/storage/internal/async/reader_connection_tracing_test.cc index b8710e8d654e4..9c5abdc4bf703 100644 --- a/google/cloud/storage/internal/async/reader_connection_tracing_test.cc +++ b/google/cloud/storage/internal/async/reader_connection_tracing_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/storage/internal/async/reader_connection_tracing.h" #include "google/cloud/storage/mocks/mock_async_reader_connection.h" #include "google/cloud/storage/testing/canonical_errors.h" @@ -21,7 +19,7 @@ #include "google/cloud/opentelemetry_options.h" #include "google/cloud/testing_util/opentelemetry_matchers.h" #include -#include +#include #include namespace google { @@ -71,7 +69,7 @@ auto expect_no_context = [](auto f) { }; TEST(ReaderConnectionTracing, WithError) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); PromiseWithOTelContext p1; PromiseWithOTelContext p2; @@ -112,7 +110,7 @@ TEST(ReaderConnectionTracing, WithError) { /*sc::kRpcMessageType=*/"rpc.message.type", "RECEIVED"), OTelAttribute("message.starting_offset", 0), - OTelAttribute(sc::kThreadId, _))), + OTelAttribute(sc::thread::kThreadId, _))), AllOf(EventNamed("gl-cpp.read"), SpanEventAttributesAre( OTelAttribute( @@ -120,11 +118,12 @@ TEST(ReaderConnectionTracing, WithError) { OTelAttribute( /*sc::kRpcMessageType=*/"rpc.message.type", "RECEIVED"), - OTelAttribute(sc::kThreadId, _))))))); + OTelAttribute(sc::thread::kThreadId, + _))))))); } TEST(ReaderConnectionTracing, WithSuccess) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); PromiseWithOTelContext p1; PromiseWithOTelContext p2; @@ -170,7 +169,7 @@ TEST(ReaderConnectionTracing, WithSuccess) { /*sc::kRpcMessageType=*/"rpc.message.type", "RECEIVED"), OTelAttribute("message.starting_offset", 0), - OTelAttribute(sc::kThreadId, _))), + OTelAttribute(sc::thread::kThreadId, _))), AllOf(EventNamed("gl-cpp.read"), SpanEventAttributesAre( OTelAttribute( @@ -180,7 +179,7 @@ TEST(ReaderConnectionTracing, WithSuccess) { "RECEIVED"), OTelAttribute("message.starting_offset", 1024), - OTelAttribute(sc::kThreadId, _))), + OTelAttribute(sc::thread::kThreadId, _))), AllOf(EventNamed("gl-cpp.read"), SpanEventAttributesAre( OTelAttribute( @@ -188,7 +187,8 @@ TEST(ReaderConnectionTracing, WithSuccess) { OTelAttribute( /*sc::kRpcMessageType=*/"rpc.message.type", "RECEIVED"), - OTelAttribute(sc::kThreadId, _))))))); + OTelAttribute(sc::thread::kThreadId, + _))))))); auto const metadata = actual->GetRequestMetadata(); EXPECT_THAT(metadata.headers, @@ -202,5 +202,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/storage/internal/async/rewriter_connection_impl.h b/google/cloud/storage/internal/async/rewriter_connection_impl.h index d27f388e6b56a..06c52e85a6d04 100644 --- a/google/cloud/storage/internal/async/rewriter_connection_impl.h +++ b/google/cloud/storage/internal/async/rewriter_connection_impl.h @@ -17,12 +17,12 @@ #include "google/cloud/storage/async/rewriter_connection.h" #include "google/cloud/storage/internal/storage_stub.h" +#include "google/cloud/storage/options.h" #include "google/cloud/completion_queue.h" #include "google/cloud/future.h" -#include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/storage/v2/storage.pb.h" #include namespace google { diff --git a/google/cloud/storage/internal/async/rewriter_connection_tracing.cc b/google/cloud/storage/internal/async/rewriter_connection_tracing.cc index cd84526b33509..be91d0038961d 100644 --- a/google/cloud/storage/internal/async/rewriter_connection_tracing.cc +++ b/google/cloud/storage/internal/async/rewriter_connection_tracing.cc @@ -21,8 +21,6 @@ namespace cloud { namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - namespace { using google::cloud::internal::EndSpan; @@ -74,16 +72,6 @@ MakeTracingAsyncRewriterConnection( std::move(span)); } -#else - -std::shared_ptr -MakeTracingAsyncRewriterConnection( - std::shared_ptr impl, bool /*enabled*/) { - return impl; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud diff --git a/google/cloud/storage/internal/async/rewriter_connection_tracing_test.cc b/google/cloud/storage/internal/async/rewriter_connection_tracing_test.cc index 064af5ed4d1fb..417eabf621e71 100644 --- a/google/cloud/storage/internal/async/rewriter_connection_tracing_test.cc +++ b/google/cloud/storage/internal/async/rewriter_connection_tracing_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/storage/internal/async/rewriter_connection_tracing.h" #include "google/cloud/storage/mocks/mock_async_rewriter_connection.h" #include "google/cloud/storage/testing/canonical_errors.h" @@ -23,7 +21,6 @@ #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" #include -#include #include namespace google { @@ -158,5 +155,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/storage/internal/async/write_object.cc b/google/cloud/storage/internal/async/write_object.cc index 065a4384dcd09..e246425d0871f 100644 --- a/google/cloud/storage/internal/async/write_object.cc +++ b/google/cloud/storage/internal/async/write_object.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/storage/internal/async/write_object.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/make_status.h" +#include "absl/strings/str_cat.h" #include namespace google { diff --git a/google/cloud/storage/internal/async/write_object.h b/google/cloud/storage/internal/async/write_object.h index 4f7d3f51c1870..4131c8d0db1cb 100644 --- a/google/cloud/storage/internal/async/write_object.h +++ b/google/cloud/storage/internal/async/write_object.h @@ -22,7 +22,7 @@ #include "google/cloud/status.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include diff --git a/google/cloud/storage/internal/async/write_payload_impl_test.cc b/google/cloud/storage/internal/async/write_payload_impl_test.cc index 6ae255f66787b..5198dc9037eb4 100644 --- a/google/cloud/storage/internal/async/write_payload_impl_test.cc +++ b/google/cloud/storage/internal/async/write_payload_impl_test.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/storage/internal/async/write_payload_impl.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/random.h" +#include "absl/strings/str_join.h" #include namespace google { 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.h b/google/cloud/storage/internal/async/writer_connection_impl.h index 7189f0f37df96..46e505c20b827 100644 --- a/google/cloud/storage/internal/async/writer_connection_impl.h +++ b/google/cloud/storage/internal/async/writer_connection_impl.h @@ -20,7 +20,7 @@ #include "google/cloud/async_streaming_read_write_rpc.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include 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 68a8b12e0cc14..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,16 +11,17 @@ // WITHOUT 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" #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" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include @@ -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/async/writer_connection_tracing.cc b/google/cloud/storage/internal/async/writer_connection_tracing.cc index 4c9ecaffeea80..a2cd9f514f1dd 100644 --- a/google/cloud/storage/internal/async/writer_connection_tracing.cc +++ b/google/cloud/storage/internal/async/writer_connection_tracing.cc @@ -12,10 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/storage/internal/async/writer_connection_tracing.h" #include "google/cloud/internal/opentelemetry.h" -#include +#include #include #include #include @@ -26,7 +25,7 @@ namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { -namespace sc = ::opentelemetry::trace::SemanticConventions; +namespace sc = ::opentelemetry::semconv; class AsyncWriterConnectionTracing : public storage::AsyncWriterConnection { public: @@ -39,7 +38,7 @@ class AsyncWriterConnectionTracing : public storage::AsyncWriterConnection { auto scope = opentelemetry::trace::Scope(span_); span_->AddEvent("gl-cpp.cancel", { - {sc::kThreadId, internal::CurrentThreadId()}, + {sc::thread::kThreadId, internal::CurrentThreadId()}, }); return impl_->Cancel(); } @@ -71,7 +70,7 @@ class AsyncWriterConnectionTracing : public storage::AsyncWriterConnection { { {/*sc::kRpcMessageType=*/"rpc.message.type", "SENT"}, {/*sc::kRpcMessageId=*/"rpc.message.id", count}, - {sc::kThreadId, internal::CurrentThreadId()}, + {sc::thread::kThreadId, internal::CurrentThreadId()}, {"gl-cpp.size", size}, }); auto status = f.get(); @@ -91,7 +90,7 @@ class AsyncWriterConnectionTracing : public storage::AsyncWriterConnection { { {/*sc::kRpcMessageType=*/"rpc.message.type", "SENT"}, {/*sc::kRpcMessageId=*/"rpc.message.id", count}, - {sc::kThreadId, internal::CurrentThreadId()}, + {sc::thread::kThreadId, internal::CurrentThreadId()}, {"gl-cpp.size", size}, }); return internal::EndSpan(*span, f.get()); @@ -108,7 +107,7 @@ class AsyncWriterConnectionTracing : public storage::AsyncWriterConnection { { {/*sc::kRpcMessageType=*/"rpc.message.type", "SENT"}, {/*sc::kRpcMessageId=*/"rpc.message.id", count}, - {sc::kThreadId, internal::CurrentThreadId()}, + {sc::thread::kThreadId, internal::CurrentThreadId()}, {"gl-cpp.size", size}, }); auto status = f.get(); @@ -125,7 +124,7 @@ class AsyncWriterConnectionTracing : public storage::AsyncWriterConnection { { {/*sc::kRpcMessageType=*/"rpc.message.type", "RECEIVE"}, {/*sc::kRpcMessageId=*/"rpc.message.id", count}, - {sc::kThreadId, internal::CurrentThreadId()}, + {sc::thread::kThreadId, internal::CurrentThreadId()}, }); auto response = f.get(); if (!response) return internal::EndSpan(*span, std::move(response)); @@ -157,5 +156,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/storage/internal/async/writer_connection_tracing.h b/google/cloud/storage/internal/async/writer_connection_tracing.h index e8a6ccb8fa993..102bafe3e3274 100644 --- a/google/cloud/storage/internal/async/writer_connection_tracing.h +++ b/google/cloud/storage/internal/async/writer_connection_tracing.h @@ -15,8 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ASYNC_WRITER_CONNECTION_TRACING_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ASYNC_WRITER_CONNECTION_TRACING_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/storage/async/writer_connection.h" #include "google/cloud/version.h" #include @@ -37,6 +35,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ASYNC_WRITER_CONNECTION_TRACING_H diff --git a/google/cloud/storage/internal/async/writer_connection_tracing_test.cc b/google/cloud/storage/internal/async/writer_connection_tracing_test.cc index 4e46b11a1b86f..46c5dd1caf736 100644 --- a/google/cloud/storage/internal/async/writer_connection_tracing_test.cc +++ b/google/cloud/storage/internal/async/writer_connection_tracing_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/storage/internal/async/writer_connection_tracing.h" #include "google/cloud/storage/mocks/mock_async_writer_connection.h" #include "google/cloud/storage/testing/canonical_errors.h" @@ -22,7 +20,7 @@ #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/status_matchers.h" #include -#include +#include #include namespace google { @@ -53,12 +51,12 @@ using ::testing::UnorderedElementsAre; using ::testing::VariantWith; auto ExpectSent(std::int64_t id, std::uint64_t size) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; return SpanEventAttributesAre( OTelAttribute(/*sc::kRpcMessageType=*/"rpc.message.type", "SENT"), OTelAttribute(/*sc::kRpcMessageId=*/"rpc.message.id", id), - OTelAttribute(sc::kThreadId, _), + OTelAttribute(sc::thread::kThreadId, _), OTelAttribute("gl-cpp.size", size)); } @@ -71,14 +69,14 @@ auto ExpectFlush(std::int64_t id, std::uint64_t size) { } auto ExpectQuery(std::int64_t id) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; return AllOf(EventNamed("gl-cpp.query"), SpanEventAttributesAre( OTelAttribute( /*sc::kRpcMessageType=*/"rpc.message.type", "RECEIVE"), OTelAttribute( /*sc::kRpcMessageId=*/"rpc.message.id", id), - OTelAttribute(sc::kThreadId, _))); + OTelAttribute(sc::thread::kThreadId, _))); } TEST(WriterConnectionTracing, FullCycle) { @@ -224,7 +222,7 @@ TEST(WriterConnectionTracing, QueryError) { } TEST(WriterConnectionTracing, Cancel) { - namespace sc = ::opentelemetry::trace::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto span_catcher = InstallSpanCatcher(); auto mock = std::make_unique(); @@ -247,7 +245,7 @@ TEST(WriterConnectionTracing, Cancel) { SpanHasInstrumentationScope(), SpanKindIsClient(), SpanHasEvents(AllOf(EventNamed("gl-cpp.cancel"), SpanEventAttributesAre(OTelAttribute( - sc::kThreadId, _))))))); + sc::thread::kThreadId, _))))))); } } // namespace @@ -255,5 +253,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/storage/internal/bucket_access_control_parser.cc b/google/cloud/storage/internal/bucket_access_control_parser.cc index 5a7d4161880e2..d03fde1f23579 100644 --- a/google/cloud/storage/internal/bucket_access_control_parser.cc +++ b/google/cloud/storage/internal/bucket_access_control_parser.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/storage/internal/bucket_access_control_parser.h" -#include "google/cloud/storage/internal/access_control_common_parser.h" #include "google/cloud/storage/internal/metadata_parser.h" #include #include diff --git a/google/cloud/storage/internal/bucket_acl_requests.cc b/google/cloud/storage/internal/bucket_acl_requests.cc index 64e86b9068f05..c9a30931b956c 100644 --- a/google/cloud/storage/internal/bucket_acl_requests.cc +++ b/google/cloud/storage/internal/bucket_acl_requests.cc @@ -15,7 +15,7 @@ #include "google/cloud/storage/internal/bucket_acl_requests.h" #include "google/cloud/storage/internal/bucket_access_control_parser.h" #include "google/cloud/storage/internal/metadata_parser.h" -#include "google/cloud/internal/absl_str_join_quiet.h" +#include "absl/strings/str_join.h" #include #include #include 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/bucket_requests.cc b/google/cloud/storage/internal/bucket_requests.cc index 9b1bab4c8f843..8c0075d5c15e5 100644 --- a/google/cloud/storage/internal/bucket_requests.cc +++ b/google/cloud/storage/internal/bucket_requests.cc @@ -16,8 +16,8 @@ #include "google/cloud/storage/internal/bucket_acl_requests.h" #include "google/cloud/storage/internal/bucket_metadata_parser.h" #include "google/cloud/storage/internal/metadata_parser.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/format_time_point.h" +#include "absl/strings/str_join.h" #include #include #include diff --git a/google/cloud/storage/internal/common_metadata.h b/google/cloud/storage/internal/common_metadata.h deleted file mode 100644 index d13daef446c7a..0000000000000 --- a/google/cloud/storage/internal/common_metadata.h +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_INTERNAL_COMMON_METADATA_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_COMMON_METADATA_H - -#include "google/cloud/storage/owner.h" -#include "google/cloud/storage/version.h" -#include "google/cloud/status_or.h" -#include "absl/types/optional.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { - -/** - * Defines common attributes to both `BucketMetadata` and `ObjectMetadata`. - * - * @tparam Derived a class derived from CommonMetadata. This class uses - * the Curiously recurring template pattern. - * - * @see https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern - */ -// TODO(#9897) - remove this class and any references to it -template -class GOOGLE_CLOUD_CPP_DEPRECATED( - "This class will be removed shortly after 2023-06-01") CommonMetadata { - public: - CommonMetadata() = default; - - std::string const& etag() const { return etag_; } - std::string const& id() const { return id_; } - std::string const& kind() const { return kind_; } - std::int64_t metageneration() const { return metageneration_; } - - std::string const& name() const { return name_; } - void set_name(std::string value) { name_ = std::move(value); } - - bool has_owner() const { return owner_.has_value(); } - Owner const& owner() const { return owner_.value(); } - - std::string const& self_link() const { return self_link_; } - - std::string const& storage_class() const { return storage_class_; } - void set_storage_class(std::string value) { - storage_class_ = std::move(value); - } - - std::chrono::system_clock::time_point time_created() const { - return time_created_; - } - std::chrono::system_clock::time_point updated() const { return updated_; } - - private: - template - friend struct CommonMetadataParser; - - // Keep the fields in alphabetical order. - std::string etag_; - std::string id_; - std::string kind_; - std::int64_t metageneration_{0}; - std::string name_; - absl::optional owner_; - std::string self_link_; - std::string storage_class_; - std::chrono::system_clock::time_point time_created_; - std::chrono::system_clock::time_point updated_; -}; - -template -GOOGLE_CLOUD_CPP_DEPRECATED( - "This function will be removed shortly after 2023-06-01") -inline bool -operator==(CommonMetadata const& lhs, CommonMetadata const& rhs) { - // etag changes each time the metadata changes, so that is the best field - // to short-circuit this comparison. The check the name, project number, - // and metadata generation, which have the next best chance to - // short-circuit. The rest just put in alphabetical order. - return lhs.name() == rhs.name() && - lhs.metageneration() == rhs.metageneration() && lhs.id() == rhs.id() && - lhs.etag() == rhs.etag() && lhs.kind() == rhs.kind() && - lhs.self_link() == rhs.self_link() && - lhs.storage_class() == rhs.storage_class() && - lhs.time_created() == rhs.time_created() && - lhs.updated() == rhs.updated() && lhs.has_owner() == rhs.has_owner() && - (!lhs.has_owner() || lhs.owner() == rhs.owner()); -} - -template -GOOGLE_CLOUD_CPP_DEPRECATED( - "This function will be removed shortly after 2023-06-01") -inline bool -operator!=(CommonMetadata const& lhs, CommonMetadata const& rhs) { - return std::rel_ops::operator!=(lhs, rhs); -} - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_COMMON_METADATA_H diff --git a/google/cloud/storage/internal/common_metadata_parser.h b/google/cloud/storage/internal/common_metadata_parser.h deleted file mode 100644 index 8357ed5c4162f..0000000000000 --- a/google/cloud/storage/internal/common_metadata_parser.h +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_INTERNAL_COMMON_METADATA_PARSER_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_COMMON_METADATA_PARSER_H - -#include "google/cloud/storage/internal/common_metadata.h" -#include "google/cloud/storage/internal/metadata_parser.h" -#include "google/cloud/status.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { -// TODO(#9897) - remove this class and any references to it -template -struct GOOGLE_CLOUD_CPP_DEPRECATED( - "This class will be removed shortly after 2023-06-01") - CommonMetadataParser { - static Status FromJson(CommonMetadata& result, - nlohmann::json const& json) { - if (!json.is_object()) return NotJsonObject(json, GCP_ERROR_INFO()); - result.etag_ = json.value("etag", ""); - result.id_ = json.value("id", ""); - result.kind_ = json.value("kind", ""); - auto metageneration = ParseLongField(json, "metageneration"); - if (!metageneration) return std::move(metageneration).status(); - result.metageneration_ = *metageneration; - result.name_ = json.value("name", ""); - if (json.count("owner") != 0) { - Owner o; - o.entity = json["owner"].value("entity", ""); - o.entity_id = json["owner"].value("entityId", ""); - result.owner_ = std::move(o); - } - result.self_link_ = json.value("selfLink", ""); - result.storage_class_ = json.value("storageClass", ""); - auto time_created = ParseTimestampField(json, "timeCreated"); - if (!time_created) return std::move(time_created).status(); - result.time_created_ = *time_created; - auto updated = ParseTimestampField(json, "updated"); - if (!updated) return std::move(updated).status(); - result.updated_ = *updated; - return Status(); - } - static StatusOr> FromString( - std::string const& payload) { - auto json = nlohmann::json::parse(payload); - return FromJson(json); - } -}; - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_COMMON_METADATA_PARSER_H diff --git a/google/cloud/storage/internal/connection_impl.cc b/google/cloud/storage/internal/connection_impl.cc index e86236b7942ab..6078d137b10d8 100644 --- a/google/cloud/storage/internal/connection_impl.cc +++ b/google/cloud/storage/internal/connection_impl.cc @@ -154,12 +154,7 @@ std::shared_ptr StorageConnectionImpl::Create( StorageConnectionImpl::StorageConnectionImpl( std::unique_ptr stub, Options options) : stub_(std::move(stub)), - options_(MergeOptions(std::move(options), stub_->options())), - client_options_(MakeBackwardsCompatibleClientOptions(options_)) {} - -ClientOptions const& StorageConnectionImpl::client_options() const { - return client_options_; -} + options_(MergeOptions(std::move(options), stub_->options())) {} Options StorageConnectionImpl::options() const { return options_; } diff --git a/google/cloud/storage/internal/connection_impl.h b/google/cloud/storage/internal/connection_impl.h index 43bc8795f479d..b487aa6fd6efa 100644 --- a/google/cloud/storage/internal/connection_impl.h +++ b/google/cloud/storage/internal/connection_impl.h @@ -44,7 +44,6 @@ class StorageConnectionImpl ~StorageConnectionImpl() override = default; - ClientOptions const& client_options() const override; Options options() const override; StatusOr ListBuckets( @@ -188,7 +187,6 @@ class StorageConnectionImpl std::unique_ptr stub_; Options options_; - ClientOptions client_options_; // For backwards compatibility google::cloud::internal::InvocationIdGenerator invocation_id_generator_; }; diff --git a/google/cloud/storage/internal/connection_impl_test.cc b/google/cloud/storage/internal/connection_impl_test.cc index 4de482b5ebe87..fd0e59c531c44 100644 --- a/google/cloud/storage/internal/connection_impl_test.cc +++ b/google/cloud/storage/internal/connection_impl_test.cc @@ -637,7 +637,6 @@ TEST(RetryClientTest, UploadFinalChunkQueryTooManyMissingPayloads) { ASSERT_THAT(response, Not(IsOk())); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::InstallSpanCatcher; using ::google::cloud::testing_util::SpanNamed; @@ -695,7 +694,6 @@ TEST(RetryClientTest, BackoffSpansUploadChunk) { SpanNamed("Backoff"), SpanNamed("storage::Client::WriteObject/UploadChunk"))); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace } // namespace internal diff --git a/google/cloud/storage/internal/crc32c.cc b/google/cloud/storage/internal/crc32c.cc index 57c16dfe38e20..9357d7c03f35d 100644 --- a/google/cloud/storage/internal/crc32c.cc +++ b/google/cloud/storage/internal/crc32c.cc @@ -14,13 +14,7 @@ #include "google/cloud/storage/internal/crc32c.h" #include "absl/base/config.h" -#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION >= 20230125 #include "absl/crc/crc32c.h" -#define GOOGLE_CLOUD_CPP_USE_ABSL_CRC32C 1 -#else -#define GOOGLE_CLOUD_CPP_USE_ABSL_CRC32C 0 -#endif // ABSL_LTS_RELEASE_VERSION -#include namespace google { namespace cloud { @@ -28,8 +22,8 @@ namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::string_view data) { - return crc32c::Extend(crc, reinterpret_cast(data.data()), - data.size()); + return static_cast( + absl::ExtendCrc32c(absl::crc32c_t{crc}, data)); } std::uint32_t ExtendCrc32c(std::uint32_t crc, @@ -47,8 +41,6 @@ std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::Cord const& data) { return crc; } -#if GOOGLE_CLOUD_CPP_USE_ABSL_CRC32C - std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::string_view data, std::uint32_t data_crc) { return static_cast(absl::ConcatCrc32c( @@ -69,26 +61,6 @@ std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::Cord const& data, absl::crc32c_t{crc}, absl::crc32c_t{data_crc}, data.size())); } -#else - -std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::string_view data, - std::uint32_t /*data_crc*/) { - return ExtendCrc32c(crc, data); -} - -std::uint32_t ExtendCrc32c(std::uint32_t crc, - storage::internal::ConstBufferSequence const& data, - std::uint32_t /*data_crc*/) { - return ExtendCrc32c(crc, data); -} - -std::uint32_t ExtendCrc32c(std::uint32_t crc, absl::Cord const& data, - std::uint32_t /*data_crc*/) { - return ExtendCrc32c(crc, data); -} - -#endif // GOOGLE_CLOUD_CPP_USE_ABSL_CRC32C - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud diff --git a/google/cloud/storage/internal/crc32c_benchmark.cc b/google/cloud/storage/internal/crc32c_benchmark.cc index 5dcf8a8450194..5975b713d78c0 100644 --- a/google/cloud/storage/internal/crc32c_benchmark.cc +++ b/google/cloud/storage/internal/crc32c_benchmark.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/storage/internal/crc32c.h" +#include "absl/crc/crc32c.h" #include -#include #include namespace google { @@ -33,7 +33,7 @@ namespace { // ---------------------------------------------------------------------- // Benchmark Time CPU Iterations // ---------------------------------------------------------------------- -// BM_Crc32cDuplicateNonAbseil 25520759 ns 25520833 ns 28 +// BM_Crc32cExtendStringView 25520759 ns 25520833 ns 28 // BM_Crc32cDuplicate 24168074 ns 24168122 ns 28 // BM_Crc32cConcat 12213494 ns 12213077 ns 57 @@ -41,23 +41,21 @@ auto constexpr kMessage = 2 * 1024 * std::size_t{1024}; auto constexpr kWriteSize = 16 * kMessage; auto constexpr kUploadSize = 8 * kWriteSize; -void BM_Crc32cDuplicateNonAbseil(benchmark::State& state) { +void BM_Crc32cExtendStringView(benchmark::State& state) { auto buffer = std::string(kWriteSize, '0'); - auto crc = std::uint32_t{0}; + auto crc = absl::crc32c_t{0}; for (auto _ : state) { for (std::size_t offset = 0; offset < kUploadSize; offset += kWriteSize) { for (std::size_t m = 0; m < kWriteSize; m += kMessage) { auto w = absl::string_view{buffer}.substr(m, kMessage); - benchmark::DoNotOptimize(crc32c::Crc32c(w.data(), w.size())); + benchmark::DoNotOptimize(absl::ComputeCrc32c(w)); } - crc = crc32c::Extend(crc, - reinterpret_cast(buffer.data()), - buffer.size()); + crc = absl::ExtendCrc32c(crc, buffer); } } benchmark::DoNotOptimize(crc); } -BENCHMARK(BM_Crc32cDuplicateNonAbseil); +BENCHMARK(BM_Crc32cExtendStringView); void BM_Crc32cDuplicate(benchmark::State& state) { auto buffer = std::string(kWriteSize, '0'); diff --git a/google/cloud/storage/internal/default_object_acl_requests.cc b/google/cloud/storage/internal/default_object_acl_requests.cc index 7e74e2eb9438f..59b6846876c81 100644 --- a/google/cloud/storage/internal/default_object_acl_requests.cc +++ b/google/cloud/storage/internal/default_object_acl_requests.cc @@ -16,7 +16,7 @@ #include "google/cloud/storage/internal/metadata_parser.h" #include "google/cloud/storage/internal/object_access_control_parser.h" #include "google/cloud/storage/internal/object_acl_requests.h" -#include "google/cloud/internal/absl_str_join_quiet.h" +#include "absl/strings/str_join.h" #include #include #include diff --git a/google/cloud/storage/internal/error_credentials.cc b/google/cloud/storage/internal/error_credentials.cc deleted file mode 100644 index bea0279b63952..0000000000000 --- a/google/cloud/storage/internal/error_credentials.cc +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/error_credentials.h" - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { - -StatusOr ErrorCredentials::AuthorizationHeader() { - return status_; -} - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/internal/error_credentials.h b/google/cloud/storage/internal/error_credentials.h deleted file mode 100644 index 56a394d0be9a2..0000000000000 --- a/google/cloud/storage/internal/error_credentials.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_INTERNAL_ERROR_CREDENTIALS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ERROR_CREDENTIALS_H - -#include "google/cloud/storage/oauth2/credentials.h" -#include "google/cloud/storage/version.h" -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { - -/** - * Report errors loading credentials when the RPC is called. - * - * With the "unified authentication client" approach the application just - * declares its *intent*, e.g., "load the default credentials", the actual work - * is delayed and depends on how the client library is implemented. We also want - * the behavior with gRPC and REST to be as similar as possible. - * - * For some credential types (e.g. service account impersonation) there may be - * problems with the credentials that are not manifest until after several RPCs - * succeed. - * - * For gRPC, creating the credentials always succeeds, but using them may fail. - * - * With REST we typically validate the credentials when loaded, and then again - * when we try to use them. - * - * This last approach was problematic, because it made some credentials fail - * early. This class allows us to treat all credentials, including REST - * credentials that failed to load as "evaluated at RPC time". - */ -class ErrorCredentials : public oauth2::Credentials { - public: - explicit ErrorCredentials(Status status) : status_(std::move(status)) {} - - StatusOr AuthorizationHeader() override; - - private: - Status status_; -}; - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_ERROR_CREDENTIALS_H diff --git a/google/cloud/storage/internal/generic_stub.h b/google/cloud/storage/internal/generic_stub.h index ddf35b377488a..7c48c83751548 100644 --- a/google/cloud/storage/internal/generic_stub.h +++ b/google/cloud/storage/internal/generic_stub.h @@ -16,7 +16,6 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_GENERIC_STUB_H #include "google/cloud/storage/bucket_metadata.h" -#include "google/cloud/storage/client_options.h" #include "google/cloud/storage/internal/bucket_acl_requests.h" #include "google/cloud/storage/internal/bucket_requests.h" #include "google/cloud/storage/internal/default_object_acl_requests.h" @@ -29,7 +28,6 @@ #include "google/cloud/storage/internal/object_requests.h" #include "google/cloud/storage/internal/service_account_requests.h" #include "google/cloud/storage/internal/sign_blob_requests.h" -#include "google/cloud/storage/oauth2/credentials.h" #include "google/cloud/storage/object_metadata.h" #include "google/cloud/storage/service_account.h" #include "google/cloud/internal/rest_context.h" diff --git a/google/cloud/storage/internal/grpc/bucket_access_control_parser.cc b/google/cloud/storage/internal/grpc/bucket_access_control_parser.cc index 64c9aa8e7270a..4d864614731e6 100644 --- a/google/cloud/storage/internal/grpc/bucket_access_control_parser.cc +++ b/google/cloud/storage/internal/grpc/bucket_access_control_parser.cc @@ -16,7 +16,7 @@ #include "google/cloud/storage/bucket_access_control.h" #include "google/cloud/storage/internal/patch_builder_details.h" #include "google/cloud/storage/version.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/storage/internal/grpc/bucket_access_control_parser.h b/google/cloud/storage/internal/grpc/bucket_access_control_parser.h index ceeac76b5b301..a01c28487de21 100644 --- a/google/cloud/storage/internal/grpc/bucket_access_control_parser.h +++ b/google/cloud/storage/internal/grpc/bucket_access_control_parser.h @@ -17,7 +17,7 @@ #include "google/cloud/storage/internal/storage_connection.h" #include "google/cloud/storage/version.h" -#include +#include "google/storage/v2/storage.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/storage/internal/grpc/bucket_metadata_parser.h b/google/cloud/storage/internal/grpc/bucket_metadata_parser.h index 4efc7631ffabe..3cadf64c7b98e 100644 --- a/google/cloud/storage/internal/grpc/bucket_metadata_parser.h +++ b/google/cloud/storage/internal/grpc/bucket_metadata_parser.h @@ -17,7 +17,7 @@ #include "google/cloud/storage/internal/storage_connection.h" #include "google/cloud/storage/version.h" -#include +#include "google/storage/v2/storage.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/storage/internal/grpc/bucket_name.cc b/google/cloud/storage/internal/grpc/bucket_name.cc index c26ea31d66df2..38154842029dd 100644 --- a/google/cloud/storage/internal/grpc/bucket_name.cc +++ b/google/cloud/storage/internal/grpc/bucket_name.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "google/cloud/storage/internal/grpc/bucket_name.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" #include "absl/strings/strip.h" namespace google { 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.h b/google/cloud/storage/internal/grpc/bucket_request_parser.h index e766f992dac6d..e603285606757 100644 --- a/google/cloud/storage/internal/grpc/bucket_request_parser.h +++ b/google/cloud/storage/internal/grpc/bucket_request_parser.h @@ -17,7 +17,7 @@ #include "google/cloud/storage/internal/bucket_requests.h" #include "google/cloud/storage/version.h" -#include +#include "google/storage/v2/storage.pb.h" namespace google { namespace cloud { 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 e1fc9ca748ff7..329f6c3f47358 100644 --- a/google/cloud/storage/internal/grpc/bucket_request_parser_test.cc +++ b/google/cloud/storage/internal/grpc/bucket_request_parser_test.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/storage/internal/grpc/bucket_request_parser.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/status_matchers.h" #include @@ -462,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 } @@ -746,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 36b441560f941..bbc4a4c80d226 100644 --- a/google/cloud/storage/internal/grpc/configure_client_context.h +++ b/google/cloud/storage/internal/grpc/configure_client_context.h @@ -20,7 +20,7 @@ #include "google/cloud/storage/version.h" #include "google/cloud/grpc_options.h" #include "google/cloud/internal/rest_context.h" -#include +#include "google/storage/v2/storage.pb.h" #include namespace google { @@ -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/ctype_cord_workaround.h b/google/cloud/storage/internal/grpc/ctype_cord_workaround.h index b265c647d52e8..2273bd03ac474 100644 --- a/google/cloud/storage/internal/grpc/ctype_cord_workaround.h +++ b/google/cloud/storage/internal/grpc/ctype_cord_workaround.h @@ -18,7 +18,7 @@ #include "google/cloud/internal/type_traits.h" #include "google/cloud/version.h" #include "absl/strings/cord.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include diff --git a/google/cloud/storage/internal/grpc/default_options.cc b/google/cloud/storage/internal/grpc/default_options.cc index abd150c40d9ea..27ac0996a369b 100644 --- a/google/cloud/storage/internal/grpc/default_options.cc +++ b/google/cloud/storage/internal/grpc/default_options.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/storage/internal/grpc/default_options.h" -#include "google/cloud/storage/client_options.h" #include "google/cloud/storage/grpc_plugin.h" #include "google/cloud/storage/options.h" #include "google/cloud/common_options.h" @@ -78,13 +77,18 @@ Options DefaultOptionsGrpc( google::cloud::internal::MakeAuthOptions(options))); } + auto const preserve_creds = + GetEnv("GOOGLE_CLOUD_CPP_STORAGE_TESTING_PRESERVE_CREDENTIALS"); auto const testbench = GetEnv("CLOUD_STORAGE_EXPERIMENTAL_GRPC_TESTBENCH_ENDPOINT"); if (testbench.has_value() && !testbench->empty()) { options.set(*testbench); - // The emulator does not support HTTPS or authentication, use insecure - // (sometimes called "anonymous") credentials, which disable SSL. - options.set(MakeInsecureCredentials()); + + if (!preserve_creds.has_value()) { + // The emulator does not support HTTPS or authentication, use insecure + // (sometimes called "anonymous") credentials, which disable SSL. + options.set(MakeInsecureCredentials()); + } } // gRPC <= 1.64 may crash when metrics are enabled, so we don't enable them by diff --git a/google/cloud/storage/internal/grpc/make_cord_test.cc b/google/cloud/storage/internal/grpc/make_cord_test.cc index f15e0a30d4101..064eadc6f77a3 100644 --- a/google/cloud/storage/internal/grpc/make_cord_test.cc +++ b/google/cloud/storage/internal/grpc/make_cord_test.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/storage/internal/async/write_payload_impl.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/random.h" +#include "absl/strings/str_join.h" #include namespace google { diff --git a/google/cloud/storage/internal/grpc/metrics_exporter_impl.cc b/google/cloud/storage/internal/grpc/metrics_exporter_impl.cc index e7b8a36bbc785..0b6824b7750e3 100644 --- a/google/cloud/storage/internal/grpc/metrics_exporter_impl.cc +++ b/google/cloud/storage/internal/grpc/metrics_exporter_impl.cc @@ -24,9 +24,9 @@ #include "google/cloud/storage/options.h" #include "google/cloud/common_options.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/log.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "absl/strings/strip.h" #include diff --git a/google/cloud/storage/internal/grpc/metrics_exporter_options.cc b/google/cloud/storage/internal/grpc/metrics_exporter_options.cc index f573eb6cc0248..27c50ec1424a0 100644 --- a/google/cloud/storage/internal/grpc/metrics_exporter_options.cc +++ b/google/cloud/storage/internal/grpc/metrics_exporter_options.cc @@ -20,8 +20,9 @@ #include "google/cloud/internal/invocation_id_generator.h" #include "google/cloud/universe_domain_options.h" #include "absl/types/variant.h" -#include -#include +#include "google/api/monitored_resource.pb.h" +#include +#include #include #include @@ -43,18 +44,20 @@ auto ByName(opentelemetry::sdk::resource::ResourceAttributes const& attributes, Options MetricsExporterOptions( Project const& project, opentelemetry::sdk::resource::Resource const& resource) { - namespace sc = ::opentelemetry::sdk::resource::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto const& attributes = resource.GetAttributes(); auto monitored_resource = google::api::MonitoredResource{}; monitored_resource.set_type("storage.googleapis.com/Client"); auto& labels = *monitored_resource.mutable_labels(); labels["project_id"] = project.project_id(); - labels["location"] = ByName(attributes, sc::kCloudAvailabilityZone, - ByName(attributes, sc::kCloudRegion, "global")); - labels["cloud_platform"] = ByName(attributes, sc::kCloudPlatform, "unknown"); - labels["host_id"] = - ByName(attributes, "faas.id", ByName(attributes, sc::kHostId, "unknown")); + labels["location"] = + ByName(attributes, sc::cloud::kCloudAvailabilityZone, + ByName(attributes, sc::cloud::kCloudRegion, "global")); + labels["cloud_platform"] = + ByName(attributes, sc::cloud::kCloudPlatform, "unknown"); + labels["host_id"] = ByName(attributes, "faas.id", + ByName(attributes, sc::host::kHostId, "unknown")); // We need a UUID because there may be multiple monitored resources within the // same process, and we need these monitored resources to be globally unique diff --git a/google/cloud/storage/internal/grpc/metrics_exporter_options_test.cc b/google/cloud/storage/internal/grpc/metrics_exporter_options_test.cc index e3244780d66f9..7fad2c591d4d4 100644 --- a/google/cloud/storage/internal/grpc/metrics_exporter_options_test.cc +++ b/google/cloud/storage/internal/grpc/metrics_exporter_options_test.cc @@ -23,7 +23,7 @@ #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/scoped_environment.h" #include "google/cloud/universe_domain_options.h" -#include +#include "google/api/monitored_resource.pb.h" #include #include #include diff --git a/google/cloud/storage/internal/grpc/metrics_meter_provider.cc b/google/cloud/storage/internal/grpc/metrics_meter_provider.cc index e0db509b0d7bb..66fae1750b909 100644 --- a/google/cloud/storage/internal/grpc/metrics_meter_provider.cc +++ b/google/cloud/storage/internal/grpc/metrics_meter_provider.cc @@ -16,7 +16,7 @@ #include "google/cloud/storage/internal/grpc/metrics_meter_provider.h" #include "google/cloud/storage/internal/grpc/metrics_histograms.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" #include #include #if OPENTELEMETRY_VERSION_MAJOR > 1 || \ @@ -66,6 +66,18 @@ void AddHistogramView(opentelemetry::sdk::metrics::MeterProvider& provider, // These are useful on Windows with DLLs and mixed CRTs, and we should try to // them if they are available. #if OPENTELEMETRY_VERSION_MAJOR > 1 || \ + (OPENTELEMETRY_VERSION_MAJOR == 1 && OPENTELEMETRY_VERSION_MINOR >= 23) + (void)unit; + provider.AddView( + opentelemetry::sdk::metrics::InstrumentSelectorFactory::Create( + opentelemetry::sdk::metrics::InstrumentType::kHistogram, name, unit), + opentelemetry::sdk::metrics::MeterSelectorFactory::Create( + kGrpcMeterName, grpc::Version(), kGrpcSchema), + opentelemetry::sdk::metrics::ViewFactory::Create( + name, std::move(description), + opentelemetry::sdk::metrics::AggregationType::kHistogram, + std::move(aggregation_config))); +#elif OPENTELEMETRY_VERSION_MAJOR > 1 || \ (OPENTELEMETRY_VERSION_MAJOR == 1 && OPENTELEMETRY_VERSION_MINOR >= 10) provider.AddView( opentelemetry::sdk::metrics::InstrumentSelectorFactory::Create( diff --git a/google/cloud/storage/internal/grpc/monitoring_project.cc b/google/cloud/storage/internal/grpc/monitoring_project.cc index f69f9ce9b6b95..598f41fac210b 100644 --- a/google/cloud/storage/internal/grpc/monitoring_project.cc +++ b/google/cloud/storage/internal/grpc/monitoring_project.cc @@ -17,7 +17,7 @@ #include "google/cloud/storage/internal/grpc/monitoring_project.h" #include "google/cloud/storage/options.h" #include "google/cloud/internal/unified_rest_credentials.h" -#include +#include namespace google { namespace cloud { @@ -46,14 +46,14 @@ absl::optional MonitoringProject(Credentials const& credentials) { absl::optional MonitoringProject( opentelemetry::sdk::resource::Resource const& resource) { - namespace sc = ::opentelemetry::sdk::resource::SemanticConventions; + namespace sc = ::opentelemetry::semconv; auto const& attributes = resource.GetAttributes(); - auto l = attributes.find(sc::kCloudProvider); + auto l = attributes.find(sc::cloud::kCloudProvider); if (l == attributes.end() || opentelemetry::nostd::get(l->second) != "gcp") { return absl::nullopt; } - l = attributes.find(sc::kCloudAccountId); + l = attributes.find(sc::cloud::kCloudAccountId); if (l == attributes.end()) return absl::nullopt; return Project(opentelemetry::nostd::get(l->second)); } diff --git a/google/cloud/storage/internal/grpc/object_access_control_parser.h b/google/cloud/storage/internal/grpc/object_access_control_parser.h index c030944d08b7e..813b033dc2adc 100644 --- a/google/cloud/storage/internal/grpc/object_access_control_parser.h +++ b/google/cloud/storage/internal/grpc/object_access_control_parser.h @@ -17,7 +17,7 @@ #include "google/cloud/storage/internal/storage_connection.h" #include "google/cloud/storage/version.h" -#include +#include "google/storage/v2/storage.pb.h" namespace google { namespace cloud { 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.h b/google/cloud/storage/internal/grpc/object_metadata_parser.h index 0e7e11a590299..d0459631145f7 100644 --- a/google/cloud/storage/internal/grpc/object_metadata_parser.h +++ b/google/cloud/storage/internal/grpc/object_metadata_parser.h @@ -19,7 +19,7 @@ #include "google/cloud/storage/version.h" #include "google/cloud/options.h" #include "absl/strings/string_view.h" -#include +#include "google/storage/v2/storage.pb.h" namespace google { namespace cloud { 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_read_source.h b/google/cloud/storage/internal/grpc/object_read_source.h index e8acc9c4e9dbd..93e2068f1e2ef 100644 --- a/google/cloud/storage/internal/grpc/object_read_source.h +++ b/google/cloud/storage/internal/grpc/object_read_source.h @@ -21,7 +21,7 @@ #include "google/cloud/future.h" #include "google/cloud/internal/streaming_read_rpc.h" #include "absl/functional/function_ref.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include diff --git a/google/cloud/storage/internal/grpc/object_request_parser.cc b/google/cloud/storage/internal/grpc/object_request_parser.cc index 81a562c4e78c9..5c6e1027a2d72 100644 --- a/google/cloud/storage/internal/grpc/object_request_parser.cc +++ b/google/cloud/storage/internal/grpc/object_request_parser.cc @@ -19,10 +19,11 @@ #include "google/cloud/storage/internal/grpc/object_metadata_parser.h" #include "google/cloud/storage/internal/object_access_control_parser.h" #include "google/cloud/storage/internal/patch_builder_details.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/invoke_result.h" #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.h b/google/cloud/storage/internal/grpc/object_request_parser.h index 656414d43a475..771fac2890c0a 100644 --- a/google/cloud/storage/internal/grpc/object_request_parser.h +++ b/google/cloud/storage/internal/grpc/object_request_parser.h @@ -18,7 +18,7 @@ #include "google/cloud/storage/internal/storage_connection.h" #include "google/cloud/storage/version.h" #include "google/cloud/rpc_metadata.h" -#include +#include "google/storage/v2/storage.pb.h" #include namespace google { 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 af33a5a54059f..a429dd70f2718 100644 --- a/google/cloud/storage/internal/grpc/object_request_parser_test.cc +++ b/google/cloud/storage/internal/grpc/object_request_parser_test.cc @@ -15,7 +15,6 @@ #include "google/cloud/storage/internal/grpc/object_request_parser.h" #include "google/cloud/storage/internal/grpc/stub.h" #include "google/cloud/storage/internal/hash_function_impl.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/grpc_options.h" #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/scoped_environment.h" @@ -89,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"; @@ -114,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) + @@ -480,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{} @@ -506,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)); @@ -536,6 +545,7 @@ TEST(GrpcObjectRequestParser, PatchObjectRequestAllResets) { .ResetContentType() .ResetEventBasedHold() .ResetMetadata() + .ResetContexts() .ResetTemporaryHold() .ResetCustomTime()); @@ -548,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)); @@ -605,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" @@ -644,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/grpc/owner_parser.h b/google/cloud/storage/internal/grpc/owner_parser.h index 28cafcfce2067..0e8ace0ca229a 100644 --- a/google/cloud/storage/internal/grpc/owner_parser.h +++ b/google/cloud/storage/internal/grpc/owner_parser.h @@ -17,7 +17,7 @@ #include "google/cloud/storage/owner.h" #include "google/cloud/storage/version.h" -#include +#include "google/storage/v2/storage.pb.h" namespace google { namespace cloud { diff --git a/google/cloud/storage/internal/grpc/split_write_object_data.cc b/google/cloud/storage/internal/grpc/split_write_object_data.cc index 9a8e1a15422f6..c346ac71ce63e 100644 --- a/google/cloud/storage/internal/grpc/split_write_object_data.cc +++ b/google/cloud/storage/internal/grpc/split_write_object_data.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "google/cloud/storage/internal/grpc/split_write_object_data.h" -#include +#include "google/storage/v2/storage.pb.h" #include namespace google { diff --git a/google/cloud/storage/internal/grpc/stub.cc b/google/cloud/storage/internal/grpc/stub.cc index 733b42bf4f94d..20f853bd71c99 100644 --- a/google/cloud/storage/internal/grpc/stub.cc +++ b/google/cloud/storage/internal/grpc/stub.cc @@ -30,6 +30,7 @@ #include "google/cloud/storage/internal/grpc/split_write_object_data.h" #include "google/cloud/storage/internal/grpc/synthetic_self_link.h" #include "google/cloud/storage/internal/storage_stub_factory.h" +#include "google/cloud/storage/options.h" #include "google/cloud/internal/big_endian.h" #include "google/cloud/internal/invoke_result.h" #include "google/cloud/internal/make_status.h" @@ -40,6 +41,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { diff --git a/google/cloud/storage/internal/grpc/stub.h b/google/cloud/storage/internal/grpc/stub.h index d5cfe4db066e4..b3b863c0651e4 100644 --- a/google/cloud/storage/internal/grpc/stub.h +++ b/google/cloud/storage/internal/grpc/stub.h @@ -20,12 +20,15 @@ #include "google/cloud/background_threads.h" #include "google/cloud/internal/minimal_iam_credentials_stub.h" #include "google/cloud/internal/streaming_write_rpc.h" -#include +#include "google/storage/v2/storage.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { @@ -297,4 +300,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_GRPC_STUB_H diff --git a/google/cloud/storage/internal/grpc/stub_acl_test.cc b/google/cloud/storage/internal/grpc/stub_acl_test.cc index e82c00a83d6cc..00d53d1a4d8bf 100644 --- a/google/cloud/storage/internal/grpc/stub_acl_test.cc +++ b/google/cloud/storage/internal/grpc/stub_acl_test.cc @@ -23,6 +23,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { diff --git a/google/cloud/storage/internal/grpc/stub_insert_object_media_test.cc b/google/cloud/storage/internal/grpc/stub_insert_object_media_test.cc index f3f207b9a1e00..4481b0089a9c9 100644 --- a/google/cloud/storage/internal/grpc/stub_insert_object_media_test.cc +++ b/google/cloud/storage/internal/grpc/stub_insert_object_media_test.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "google/cloud/storage/internal/grpc/stub.h" -#include "google/cloud/storage/oauth2/google_credentials.h" +#include "google/cloud/storage/options.h" #include "google/cloud/storage/testing/mock_storage_stub.h" #include "google/cloud/grpc_options.h" #include "google/cloud/testing_util/is_proto_equal.h" diff --git a/google/cloud/storage/internal/grpc/stub_read_object_test.cc b/google/cloud/storage/internal/grpc/stub_read_object_test.cc index aa191d6733c0a..ea3ddea3cbf2a 100644 --- a/google/cloud/storage/internal/grpc/stub_read_object_test.cc +++ b/google/cloud/storage/internal/grpc/stub_read_object_test.cc @@ -14,14 +14,15 @@ #include "google/cloud/storage/internal/grpc/object_read_source.h" #include "google/cloud/storage/internal/grpc/stub.h" +#include "google/cloud/storage/options.h" #include "google/cloud/storage/testing/mock_storage_stub.h" #include "google/cloud/grpc_options.h" #include "google/cloud/options.h" #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/mock_completion_queue_impl.h" #include "google/cloud/testing_util/status_matchers.h" +#include "google/storage/v2/storage.pb.h" #include -#include #include namespace google { diff --git a/google/cloud/storage/internal/grpc/stub_test.cc b/google/cloud/storage/internal/grpc/stub_test.cc index 7a672e3f2592d..dd5a86425a05e 100644 --- a/google/cloud/storage/internal/grpc/stub_test.cc +++ b/google/cloud/storage/internal/grpc/stub_test.cc @@ -23,6 +23,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { diff --git a/google/cloud/storage/internal/grpc/stub_upload_chunk_test.cc b/google/cloud/storage/internal/grpc/stub_upload_chunk_test.cc index 2c42cb69d45df..a50a5b6cfefd9 100644 --- a/google/cloud/storage/internal/grpc/stub_upload_chunk_test.cc +++ b/google/cloud/storage/internal/grpc/stub_upload_chunk_test.cc @@ -13,6 +13,7 @@ // limitations under the License. #include "google/cloud/storage/internal/grpc/stub.h" +#include "google/cloud/storage/options.h" #include "google/cloud/storage/testing/mock_storage_stub.h" #include "google/cloud/grpc_options.h" #include "google/cloud/options.h" diff --git a/google/cloud/storage/internal/grpc/synthetic_self_link.cc b/google/cloud/storage/internal/grpc/synthetic_self_link.cc index 9536c4c319a38..b7453765ec12a 100644 --- a/google/cloud/storage/internal/grpc/synthetic_self_link.cc +++ b/google/cloud/storage/internal/grpc/synthetic_self_link.cc @@ -14,8 +14,8 @@ #include "google/cloud/storage/internal/grpc/synthetic_self_link.h" #include "google/cloud/storage/options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/url_encode.h" +#include "absl/strings/str_cat.h" namespace google { namespace cloud { diff --git a/google/cloud/storage/internal/hash_values.cc b/google/cloud/storage/internal/hash_values.cc index 7841a6ab9129e..0567a37f4c8a6 100644 --- a/google/cloud/storage/internal/hash_values.cc +++ b/google/cloud/storage/internal/hash_values.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "google/cloud/storage/internal/hash_values.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "absl/strings/str_cat.h" #include namespace google { diff --git a/google/cloud/storage/internal/http_response.cc b/google/cloud/storage/internal/http_response.cc index a9b97e824aecd..5952be5552270 100644 --- a/google/cloud/storage/internal/http_response.cc +++ b/google/cloud/storage/internal/http_response.cc @@ -13,9 +13,9 @@ // limitations under the License. #include "google/cloud/storage/internal/http_response.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/rest_parse_json_error.h" #include "google/cloud/internal/rest_response.h" +#include "absl/strings/str_join.h" #include #include diff --git a/google/cloud/storage/internal/impersonate_service_account_credentials.cc b/google/cloud/storage/internal/impersonate_service_account_credentials.cc deleted file mode 100644 index f63f325eedea9..0000000000000 --- a/google/cloud/storage/internal/impersonate_service_account_credentials.cc +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/impersonate_service_account_credentials.h" -#include "google/cloud/internal/rest_client.h" -#include "google/cloud/internal/unified_rest_credentials.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { -namespace { - -oauth2_internal::GenerateAccessTokenRequest MakeRequest( - google::cloud::internal::ImpersonateServiceAccountConfig const& config) { - return oauth2_internal::GenerateAccessTokenRequest{ - /*.service_account=*/config.target_service_account(), - /*.lifetime=*/config.lifetime(), - /*.scopes=*/config.scopes(), - /*.delegates=*/config.delegates(), - }; -} - -auto constexpr kUseSlack = std::chrono::seconds(30); - -} // namespace - -ImpersonateServiceAccountCredentials::ImpersonateServiceAccountCredentials( - google::cloud::internal::ImpersonateServiceAccountConfig const& config) - : ImpersonateServiceAccountCredentials( - config, oauth2_internal::MakeMinimalIamCredentialsRestStub( - rest_internal::MapCredentials(*config.base_credentials()), - config.options(), [](Options const& o) { - return rest_internal::MakeDefaultRestClient("", o); - })) {} - -ImpersonateServiceAccountCredentials::ImpersonateServiceAccountCredentials( - google::cloud::internal::ImpersonateServiceAccountConfig const& config, - std::shared_ptr stub) - : stub_(std::move(stub)), request_(MakeRequest(config)) {} - -StatusOr -ImpersonateServiceAccountCredentials::AuthorizationHeader() { - return AuthorizationHeader(std::chrono::system_clock::now()); -} - -StatusOr ImpersonateServiceAccountCredentials::AuthorizationHeader( - std::chrono::system_clock::time_point now) { - std::unique_lock lk(mu_); - if (now + kUseSlack <= expiration_) return header_; - auto response = stub_->GenerateAccessToken(request_); - if (!response) return std::move(response).status(); - expiration_ = response->expiration; - header_ = "Authorization: Bearer " + response->token; - return header_; -} - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/internal/impersonate_service_account_credentials.h b/google/cloud/storage/internal/impersonate_service_account_credentials.h deleted file mode 100644 index 463868eab93f5..0000000000000 --- a/google/cloud/storage/internal/impersonate_service_account_credentials.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_INTERNAL_IMPERSONATE_SERVICE_ACCOUNT_CREDENTIALS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_IMPERSONATE_SERVICE_ACCOUNT_CREDENTIALS_H - -#include "google/cloud/storage/oauth2/credentials.h" -#include "google/cloud/storage/version.h" -#include "google/cloud/credentials.h" -#include "google/cloud/internal/oauth2_minimal_iam_credentials_rest.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { - -class ImpersonateServiceAccountCredentials : public oauth2::Credentials { - public: - explicit ImpersonateServiceAccountCredentials( - google::cloud::internal::ImpersonateServiceAccountConfig const& config); - explicit ImpersonateServiceAccountCredentials( - google::cloud::internal::ImpersonateServiceAccountConfig const& config, - std::shared_ptr stub); - - StatusOr AuthorizationHeader() override; - StatusOr AuthorizationHeader( - std::chrono::system_clock::time_point now); - - private: - std::shared_ptr stub_; - oauth2_internal::GenerateAccessTokenRequest request_; - std::mutex mu_; - std::string header_; - std::chrono::system_clock::time_point expiration_; -}; - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_IMPERSONATE_SERVICE_ACCOUNT_CREDENTIALS_H diff --git a/google/cloud/storage/internal/impersonate_service_account_credentials_test.cc b/google/cloud/storage/internal/impersonate_service_account_credentials_test.cc deleted file mode 100644 index e4009eafeea03..0000000000000 --- a/google/cloud/storage/internal/impersonate_service_account_credentials_test.cc +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/impersonate_service_account_credentials.h" -#include "google/cloud/testing_util/status_matchers.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { -namespace { - -using ::google::cloud::AccessToken; -using ::google::cloud::AccessTokenLifetimeOption; -using ::google::cloud::testing_util::IsOk; -using ::std::chrono::minutes; -using ::testing::EndsWith; -using ::testing::Return; -using ::testing::StartsWith; - -class MockMinimalIamCredentialsRest - : public oauth2_internal::MinimalIamCredentialsRest { - public: - MOCK_METHOD(StatusOr, GenerateAccessToken, - (oauth2_internal::GenerateAccessTokenRequest const&), (override)); - MOCK_METHOD(StatusOr, universe_domain, (Options const& options), - (override, const)); -}; - -TEST(ImpersonateServiceAccountCredentialsTest, Basic) { - auto const now = std::chrono::system_clock::now(); - - auto mock = std::make_shared(); - EXPECT_CALL(*mock, GenerateAccessToken) - .WillOnce( - Return(make_status_or(AccessToken{"token1", now + minutes(15)}))) - .WillOnce( - Return(make_status_or(AccessToken{"token2", now + minutes(30)}))); - - auto config = google::cloud::internal::ImpersonateServiceAccountConfig( - google::cloud::MakeGoogleDefaultCredentials(), - "test-only-invalid@test.invalid", - Options{}.set(std::chrono::minutes(15))); - ImpersonateServiceAccountCredentials under_test(config, mock); - - for (auto const i : {1, 5, 9}) { - SCOPED_TRACE("Testing with i = " + std::to_string(i)); - auto header = under_test.AuthorizationHeader(now + minutes(i)); - ASSERT_THAT(header, IsOk()); - EXPECT_THAT(*header, StartsWith("Authorization: Bearer")); - EXPECT_THAT(*header, EndsWith("token1")); - } - - auto header = under_test.AuthorizationHeader(now + minutes(20)); - ASSERT_THAT(header, IsOk()); - EXPECT_THAT(*header, StartsWith("Authorization: Bearer")); - EXPECT_THAT(*header, EndsWith("token2")); -} - -} // namespace -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/internal/notification_requests.cc b/google/cloud/storage/internal/notification_requests.cc index 30825a1982e7f..2931cb589eeaa 100644 --- a/google/cloud/storage/internal/notification_requests.cc +++ b/google/cloud/storage/internal/notification_requests.cc @@ -15,8 +15,8 @@ #include "google/cloud/storage/internal/notification_requests.h" #include "google/cloud/storage/internal/metadata_parser.h" #include "google/cloud/storage/internal/notification_metadata_parser.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/make_status.h" +#include "absl/strings/str_join.h" #include #include #include diff --git a/google/cloud/storage/internal/object_access_control_parser.cc b/google/cloud/storage/internal/object_access_control_parser.cc index 2f4ba2fb67e8d..c60472ed9c53f 100644 --- a/google/cloud/storage/internal/object_access_control_parser.cc +++ b/google/cloud/storage/internal/object_access_control_parser.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/storage/internal/object_access_control_parser.h" -#include "google/cloud/storage/internal/access_control_common_parser.h" #include "google/cloud/storage/internal/metadata_parser.h" #include #include diff --git a/google/cloud/storage/internal/object_acl_requests.cc b/google/cloud/storage/internal/object_acl_requests.cc index d1480a0786277..58301fe71af0d 100644 --- a/google/cloud/storage/internal/object_acl_requests.cc +++ b/google/cloud/storage/internal/object_acl_requests.cc @@ -16,8 +16,8 @@ #include "google/cloud/storage/internal/metadata_parser.h" #include "google/cloud/storage/internal/object_access_control_parser.h" #include "google/cloud/storage/internal/patch_builder.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/make_status.h" +#include "absl/strings/str_join.h" #include #include #include 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/object_write_streambuf_test.cc b/google/cloud/storage/internal/object_write_streambuf_test.cc index 077dc83a67e55..baa3c2eb051ce 100644 --- a/google/cloud/storage/internal/object_write_streambuf_test.cc +++ b/google/cloud/storage/internal/object_write_streambuf_test.cc @@ -444,7 +444,7 @@ TEST(ObjectWriteStreambufTest, Regression8868) { auto retry = StorageConnectionImpl::Create(std::move(mock)); google::cloud::internal::OptionsSpan const span( Options{} - .set(oauth2::CreateAnonymousCredentials()) + .set(MakeInsecureCredentials()) .set(LimitedErrorCountRetryPolicy(3).clone()) .set( ExponentialBackoffPolicy(us(1), us(2), 2).clone()) 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/policy_document_request.cc b/google/cloud/storage/internal/policy_document_request.cc index 69c9198edb539..7ab732a487d19 100644 --- a/google/cloud/storage/internal/policy_document_request.cc +++ b/google/cloud/storage/internal/policy_document_request.cc @@ -14,10 +14,10 @@ #include "google/cloud/storage/internal/policy_document_request.h" #include "google/cloud/storage/internal/base64.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/format_time_point.h" #include "google/cloud/internal/make_status.h" #include "absl/functional/function_ref.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include #include diff --git a/google/cloud/storage/internal/rest/stub.cc b/google/cloud/storage/internal/rest/stub.cc index 4a1e338f64e7c..c26cac0455ef5 100644 --- a/google/cloud/storage/internal/rest/stub.cc +++ b/google/cloud/storage/internal/rest/stub.cc @@ -26,13 +26,14 @@ #include "google/cloud/storage/internal/rest/request_builder.h" #include "google/cloud/storage/internal/service_account_parser.h" #include "google/cloud/storage/version.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/auth_header_error.h" #include "google/cloud/internal/curl_wrappers.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/make_status.h" +#include "google/cloud/internal/rest_options.h" #include "google/cloud/internal/url_encode.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include "absl/strings/strip.h" #include @@ -43,7 +44,7 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace internal { namespace rest = google::cloud::rest_internal; -using ::google::cloud::internal::AuthHeaderError; +using ::google::cloud::internal::GetEnv; using ::google::cloud::internal::UrlEncode; namespace { @@ -106,18 +107,6 @@ StatusOr CreateFromJson( return ReturnType::CreateFromJson(*payload); } -Status AddAuthorizationHeader(Options const& options, - RestRequestBuilder& builder) { - // In tests this option may not be set. And over time we want to retire it. - if (!options.has()) return {}; - auto auth_header = - options.get()->AuthorizationHeader(); - if (!auth_header) return AuthHeaderError(std::move(auth_header).status()); - builder.AddHeader("Authorization", std::string(absl::StripPrefix( - *auth_header, "Authorization: "))); - return {}; -} - void AddCustomHeaders(Options const& options, RestRequestBuilder& builder) { if (!options.has()) return; for (auto const& h : options.get()) { @@ -126,12 +115,26 @@ void AddCustomHeaders(Options const& options, RestRequestBuilder& builder) { } Status AddHeaders(Options const& options, RestRequestBuilder& builder) { - auto ah = AddAuthorizationHeader(options, builder); - if (!ah.ok()) return ah; AddCustomHeaders(options, builder); return {}; } +absl::optional GetEmulator() { + auto emulator = GetEnv("CLOUD_STORAGE_EMULATOR_ENDPOINT"); + if (emulator) return emulator; + return GetEnv("CLOUD_STORAGE_TESTBENCH_ENDPOINT"); +} + +std::string RestEndpoint(Options const& options) { + return GetEmulator().value_or(options.get()); +} + +std::string IamEndpoint(Options const& options) { + auto emulator = GetEmulator(); + if (emulator) return *emulator + "/iamapi"; + return options.get(); +} + } // namespace RestStub::RestStub(Options options) diff --git a/google/cloud/storage/internal/rest/stub.h b/google/cloud/storage/internal/rest/stub.h index d6a04a96c2a20..e0d100bc486cb 100644 --- a/google/cloud/storage/internal/rest/stub.h +++ b/google/cloud/storage/internal/rest/stub.h @@ -17,6 +17,7 @@ #include "google/cloud/storage/internal/generic_stub.h" #include "google/cloud/storage/internal/rest/request_builder.h" +#include "google/cloud/storage/options.h" #include "google/cloud/storage/version.h" #include "google/cloud/internal/random.h" #include "google/cloud/internal/rest_client.h" 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/internal/retry_object_read_source_test.cc b/google/cloud/storage/internal/retry_object_read_source_test.cc index dca08aeabfe08..f264e3e743539 100644 --- a/google/cloud/storage/internal/retry_object_read_source_test.cc +++ b/google/cloud/storage/internal/retry_object_read_source_test.cc @@ -489,7 +489,6 @@ TEST(RetryObjectReadSourceTest, DiscardDataForDecompressiveTranscoding) { Contains(Pair("x-test-only", "download 3 r1"))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanNamed; @@ -600,8 +599,6 @@ TEST(RetryObjectReadSourceTest, TracingDisabled) { EXPECT_THAT(spans, IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace } // namespace internal GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/storage/internal/sign_blob_requests.cc b/google/cloud/storage/internal/sign_blob_requests.cc index 7bfcdaec3a456..57be526663bf6 100644 --- a/google/cloud/storage/internal/sign_blob_requests.cc +++ b/google/cloud/storage/internal/sign_blob_requests.cc @@ -15,8 +15,8 @@ #include "google/cloud/storage/internal/sign_blob_requests.h" #include "google/cloud/storage/internal/http_response.h" #include "google/cloud/storage/internal/metadata_parser.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/make_status.h" +#include "absl/strings/str_join.h" #include #include diff --git a/google/cloud/storage/internal/signed_url_requests.cc b/google/cloud/storage/internal/signed_url_requests.cc index 7fa6aeb6c119f..6505b065b6e7d 100644 --- a/google/cloud/storage/internal/signed_url_requests.cc +++ b/google/cloud/storage/internal/signed_url_requests.cc @@ -13,11 +13,11 @@ // limitations under the License. #include "google/cloud/storage/internal/signed_url_requests.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/curl_handle.h" #include "google/cloud/internal/format_time_point.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/sha256_hash.h" +#include "absl/strings/str_join.h" #include "absl/strings/str_split.h" #include #include diff --git a/google/cloud/storage/internal/storage_auth_decorator.cc b/google/cloud/storage/internal/storage_auth_decorator.cc index da06fadad2694..53da6fc29644e 100644 --- a/google/cloud/storage/internal/storage_auth_decorator.cc +++ b/google/cloud/storage/internal/storage_auth_decorator.cc @@ -21,10 +21,13 @@ #include "google/cloud/internal/async_streaming_read_rpc_auth.h" #include "google/cloud/internal/async_streaming_write_rpc_auth.h" #include "google/cloud/internal/streaming_write_rpc_impl.h" -#include +#include "google/storage/v2/storage.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { @@ -402,3 +405,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storage/internal/storage_auth_decorator.h b/google/cloud/storage/internal/storage_auth_decorator.h index 952872c796350..c0a8225164980 100644 --- a/google/cloud/storage/internal/storage_auth_decorator.h +++ b/google/cloud/storage/internal/storage_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { @@ -206,4 +209,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_STORAGE_AUTH_DECORATOR_H diff --git a/google/cloud/storage/internal/storage_connection.h b/google/cloud/storage/internal/storage_connection.h index 0cc24e6876125..a002570e6283f 100644 --- a/google/cloud/storage/internal/storage_connection.h +++ b/google/cloud/storage/internal/storage_connection.h @@ -16,7 +16,6 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_STORAGE_CONNECTION_H #include "google/cloud/storage/bucket_metadata.h" -#include "google/cloud/storage/client_options.h" #include "google/cloud/storage/internal/bucket_acl_requests.h" #include "google/cloud/storage/internal/bucket_requests.h" #include "google/cloud/storage/internal/default_object_acl_requests.h" @@ -29,7 +28,6 @@ #include "google/cloud/storage/internal/object_requests.h" #include "google/cloud/storage/internal/service_account_requests.h" #include "google/cloud/storage/internal/sign_blob_requests.h" -#include "google/cloud/storage/oauth2/credentials.h" #include "google/cloud/storage/object_metadata.h" #include "google/cloud/storage/object_read_stream.h" #include "google/cloud/storage/service_account.h" @@ -57,8 +55,6 @@ class StorageConnection { public: virtual ~StorageConnection() = default; - virtual ClientOptions const& client_options() const = 0; - virtual google::cloud::Options options() const { return {}; } ///@{ diff --git a/google/cloud/storage/internal/storage_connection_test.cc b/google/cloud/storage/internal/storage_connection_test.cc index 09c0e539bd234..54b23c3172d50 100644 --- a/google/cloud/storage/internal/storage_connection_test.cc +++ b/google/cloud/storage/internal/storage_connection_test.cc @@ -33,7 +33,6 @@ class TestStorageConnection : public StorageConnection { public: ~TestStorageConnection() override = default; // LCOV_EXCL_START - MOCK_METHOD(ClientOptions const&, client_options, (), (const, override)); MOCK_METHOD(StatusOr, ListBuckets, (ListBucketsRequest const&), (override)); MOCK_METHOD(StatusOr, CreateBucket, diff --git a/google/cloud/storage/internal/storage_logging_decorator.cc b/google/cloud/storage/internal/storage_logging_decorator.cc index 4bbb9223f347f..2d522fd8cf244 100644 --- a/google/cloud/storage/internal/storage_logging_decorator.cc +++ b/google/cloud/storage/internal/storage_logging_decorator.cc @@ -24,12 +24,15 @@ #include "google/cloud/internal/streaming_read_rpc_logging.h" #include "google/cloud/internal/streaming_write_rpc_logging.h" #include "google/cloud/status_or.h" -#include +#include "google/storage/v2/storage.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { @@ -495,3 +498,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storage/internal/storage_logging_decorator.h b/google/cloud/storage/internal/storage_logging_decorator.h index a889b442da7c9..423ca1fcbb141 100644 --- a/google/cloud/storage/internal/storage_logging_decorator.h +++ b/google/cloud/storage/internal/storage_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { @@ -207,4 +210,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_STORAGE_LOGGING_DECORATOR_H diff --git a/google/cloud/storage/internal/storage_metadata_decorator.cc b/google/cloud/storage/internal/storage_metadata_decorator.cc index 6d21d4590c994..3d3ccc9d394a2 100644 --- a/google/cloud/storage/internal/storage_metadata_decorator.cc +++ b/google/cloud/storage/internal/storage_metadata_decorator.cc @@ -18,18 +18,21 @@ #include "google/cloud/storage/internal/storage_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/routing_matcher.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/storage/v2/storage.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { @@ -727,3 +730,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storage/internal/storage_metadata_decorator.h b/google/cloud/storage/internal/storage_metadata_decorator.h index a4667ae73a67e..17d1589fd1f58 100644 --- a/google/cloud/storage/internal/storage_metadata_decorator.h +++ b/google/cloud/storage/internal/storage_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { @@ -211,4 +214,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_STORAGE_METADATA_DECORATOR_H diff --git a/google/cloud/storage/internal/storage_round_robin_decorator.cc b/google/cloud/storage/internal/storage_round_robin_decorator.cc index 501460011cd03..97651673f61ae 100644 --- a/google/cloud/storage/internal/storage_round_robin_decorator.cc +++ b/google/cloud/storage/internal/storage_round_robin_decorator.cc @@ -21,6 +21,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { @@ -277,3 +280,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storage/internal/storage_round_robin_decorator.h b/google/cloud/storage/internal/storage_round_robin_decorator.h index f1af4daea07ee..714622e727e7c 100644 --- a/google/cloud/storage/internal/storage_round_robin_decorator.h +++ b/google/cloud/storage/internal/storage_round_robin_decorator.h @@ -25,6 +25,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { @@ -207,4 +210,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_STORAGE_ROUND_ROBIN_DECORATOR_H diff --git a/google/cloud/storage/internal/storage_stub.cc b/google/cloud/storage/internal/storage_stub.cc index 716556f4d2f76..70ceb62cdfba5 100644 --- a/google/cloud/storage/internal/storage_stub.cc +++ b/google/cloud/storage/internal/storage_stub.cc @@ -23,10 +23,13 @@ #include "google/cloud/internal/async_streaming_write_rpc_impl.h" #include "google/cloud/internal/streaming_write_rpc_impl.h" #include "google/cloud/status_or.h" -#include +#include "google/storage/v2/storage.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { @@ -453,3 +456,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storage/internal/storage_stub.h b/google/cloud/storage/internal/storage_stub.h index ca8dde86c7564..135f474739207 100644 --- a/google/cloud/storage/internal/storage_stub.h +++ b/google/cloud/storage/internal/storage_stub.h @@ -29,10 +29,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/storage/v2/storage.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { @@ -373,4 +376,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_STORAGE_STUB_H diff --git a/google/cloud/storage/internal/storage_stub_factory_test.cc b/google/cloud/storage/internal/storage_stub_factory_test.cc index e7464a9254e34..4505906939c7e 100644 --- a/google/cloud/storage/internal/storage_stub_factory_test.cc +++ b/google/cloud/storage/internal/storage_stub_factory_test.cc @@ -258,7 +258,6 @@ TEST_F(StorageStubFactory, QueryWriteStatus) { EXPECT_THAT(log.ExtractLines(), Contains(HasSubstr("QueryWriteStatus"))); } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY using ::google::cloud::testing_util::DisableTracing; using ::google::cloud::testing_util::EnableTracing; using ::google::cloud::testing_util::SpanNamed; @@ -315,7 +314,6 @@ TEST_F(StorageStubFactory, TracingDisabled) { EXPECT_THAT(span_catcher->GetSpans(), IsEmpty()); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/storage/internal/storage_tracing_stub.cc b/google/cloud/storage/internal/storage_tracing_stub.cc index f78e0e85ec7d4..09043577736f5 100644 --- a/google/cloud/storage/internal/storage_tracing_stub.cc +++ b/google/cloud/storage/internal/storage_tracing_stub.cc @@ -26,13 +26,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - StorageTracingStub::StorageTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -432,18 +433,14 @@ StorageTracingStub::AsyncQueryWriteStatus( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeStorageTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storage/internal/storage_tracing_stub.h b/google/cloud/storage/internal/storage_tracing_stub.h index 68c2d70b1cda6..74e639e517b75 100644 --- a/google/cloud/storage/internal/storage_tracing_stub.h +++ b/google/cloud/storage/internal/storage_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class StorageTracingStub : public StorageStub { public: ~StorageTracingStub() override = default; @@ -202,8 +203,6 @@ class StorageTracingStub : public StorageStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -218,4 +217,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_STORAGE_TRACING_STUB_H diff --git a/google/cloud/storage/internal/tracing_connection.cc b/google/cloud/storage/internal/tracing_connection.cc index a282a1133cc08..6d7e20a2d349b 100644 --- a/google/cloud/storage/internal/tracing_connection.cc +++ b/google/cloud/storage/internal/tracing_connection.cc @@ -26,14 +26,9 @@ namespace cloud { namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TracingConnection::TracingConnection(std::shared_ptr impl) : impl_(std::move(impl)) {} -storage::ClientOptions const& TracingConnection::client_options() const { - return impl_->client_options(); -} Options TracingConnection::options() const { return impl_->options(); } StatusOr TracingConnection::ListBuckets( @@ -507,15 +502,6 @@ std::shared_ptr MakeTracingClient( return std::make_shared(std::move(impl)); } -#else - -std::shared_ptr MakeTracingClient( - std::shared_ptr impl) { - return impl; -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud diff --git a/google/cloud/storage/internal/tracing_connection.h b/google/cloud/storage/internal/tracing_connection.h index c59ec011d91ec..45df6239f956d 100644 --- a/google/cloud/storage/internal/tracing_connection.h +++ b/google/cloud/storage/internal/tracing_connection.h @@ -27,14 +27,11 @@ namespace cloud { namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TracingConnection : public storage::internal::StorageConnection { public: explicit TracingConnection(std::shared_ptr impl); ~TracingConnection() override = default; - storage::ClientOptions const& client_options() const override; Options options() const override; StatusOr ListBuckets( @@ -184,8 +181,6 @@ class TracingConnection : public storage::internal::StorageConnection { std::shared_ptr impl_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTracingClient( std::shared_ptr impl); diff --git a/google/cloud/storage/internal/tracing_connection_test.cc b/google/cloud/storage/internal/tracing_connection_test.cc index 9e952293db9eb..bda9bc46d0a2d 100644 --- a/google/cloud/storage/internal/tracing_connection_test.cc +++ b/google/cloud/storage/internal/tracing_connection_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/storage/internal/tracing_connection.h" #include "google/cloud/storage/object_read_stream.h" #include "google/cloud/storage/testing/canonical_errors.h" @@ -1491,5 +1489,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/storage/internal/tracing_object_read_source.cc b/google/cloud/storage/internal/tracing_object_read_source.cc index 4dc148b1937fa..f6f642a9cd132 100644 --- a/google/cloud/storage/internal/tracing_object_read_source.cc +++ b/google/cloud/storage/internal/tracing_object_read_source.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/storage/internal/tracing_object_read_source.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/status.h" @@ -80,5 +78,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/storage/internal/tracing_object_read_source.h b/google/cloud/storage/internal/tracing_object_read_source.h index 2914d33584627..2c608f6982565 100644 --- a/google/cloud/storage/internal/tracing_object_read_source.h +++ b/google/cloud/storage/internal/tracing_object_read_source.h @@ -15,8 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_TRACING_OBJECT_READ_SOURCE_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_TRACING_OBJECT_READ_SOURCE_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/storage/internal/object_read_source.h" #include "google/cloud/storage/version.h" #include "google/cloud/internal/opentelemetry.h" @@ -57,6 +55,4 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_TRACING_OBJECT_READ_SOURCE_H diff --git a/google/cloud/storage/internal/tracing_object_read_source_test.cc b/google/cloud/storage/internal/tracing_object_read_source_test.cc index 56edc4e4974b0..43869203758fe 100644 --- a/google/cloud/storage/internal/tracing_object_read_source_test.cc +++ b/google/cloud/storage/internal/tracing_object_read_source_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - #include "google/cloud/storage/internal/tracing_object_read_source.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/mock_client.h" @@ -205,5 +203,3 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud } // namespace google - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/storage/internal/unified_rest_credentials.cc b/google/cloud/storage/internal/unified_rest_credentials.cc deleted file mode 100644 index 88045788f734b..0000000000000 --- a/google/cloud/storage/internal/unified_rest_credentials.cc +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/unified_rest_credentials.h" -#include "google/cloud/storage/internal/access_token_credentials.h" -#include "google/cloud/storage/internal/error_credentials.h" -#include "google/cloud/storage/internal/impersonate_service_account_credentials.h" -#include "google/cloud/storage/oauth2/google_credentials.h" -#include "google/cloud/storage/oauth2/service_account_credentials.h" -#include "google/cloud/internal/getenv.h" -#include "google/cloud/internal/oauth2_access_token_credentials.h" -#include "google/cloud/internal/oauth2_compute_engine_credentials.h" -#include "google/cloud/internal/oauth2_credentials.h" -#include "google/cloud/internal/oauth2_decorate_credentials.h" -#include "google/cloud/internal/oauth2_external_account_credentials.h" -#include "google/cloud/internal/oauth2_google_credentials.h" -#include "google/cloud/internal/oauth2_service_account_credentials.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { -namespace { - -using ::google::cloud::internal::AccessTokenConfig; -using ::google::cloud::internal::ApiKeyConfig; -using ::google::cloud::internal::ComputeEngineCredentialsConfig; -using ::google::cloud::internal::CredentialsVisitor; -using ::google::cloud::internal::ErrorCredentialsConfig; -using ::google::cloud::internal::ExternalAccountConfig; -using ::google::cloud::internal::GoogleDefaultCredentialsConfig; -using ::google::cloud::internal::ImpersonateServiceAccountConfig; -using ::google::cloud::internal::InsecureCredentialsConfig; -using ::google::cloud::internal::ServiceAccountConfig; -using ::google::cloud::oauth2_internal::Decorate; - -std::shared_ptr MakeErrorCredentials(Status status) { - return std::make_shared(std::move(status)); -} - -class WrapRestCredentials : public oauth2::Credentials { - public: - explicit WrapRestCredentials( - std::shared_ptr impl) - : impl_(std::move(impl)) {} - - StatusOr AuthorizationHeader() override { - return oauth2_internal::AuthenticationHeaderJoined(*impl_); - } - - StatusOr> SignBlob( - SigningAccount const& signing_account, - std::string const& blob) const override { - return impl_->SignBlob(signing_account.value_or(impl_->AccountEmail()), - blob); - } - - std::string AccountEmail() const override { return impl_->AccountEmail(); } - std::string KeyId() const override { return impl_->KeyId(); } - - private: - std::shared_ptr impl_; -}; - -} // namespace - -std::shared_ptr MapCredentials( - google::cloud::Credentials const& credentials) { - class RestVisitor : public CredentialsVisitor { - public: - explicit RestVisitor(oauth2_internal::HttpClientFactory client_factory) - : client_factory_(std::move(client_factory)) {} - - std::shared_ptr result; - - void visit(ErrorCredentialsConfig const& cfg) override { - result = MakeErrorCredentials(cfg.status()); - } - - void visit(InsecureCredentialsConfig const&) override { - result = google::cloud::storage::oauth2::CreateAnonymousCredentials(); - } - void visit(GoogleDefaultCredentialsConfig const& cfg) override { - auto credentials = oauth2_internal::GoogleDefaultCredentials( - cfg.options(), std::move(client_factory_)); - if (credentials) { - result = std::make_shared( - Decorate(*std::move(credentials), cfg.options())); - return; - } - result = MakeErrorCredentials(std::move(credentials).status()); - } - void visit(AccessTokenConfig const& cfg) override { - result = std::make_shared(cfg.access_token()); - } - void visit(ImpersonateServiceAccountConfig const& config) override { - result = std::make_shared(config); - } - void visit(ServiceAccountConfig const& cfg) override { - auto info = oauth2::ParseServiceAccountCredentials(cfg.json_object(), {}); - if (!info) { - result = MakeErrorCredentials(std::move(info).status()); - return; - } - auto impl = std::make_shared( - internal::MapServiceAccountCredentialsInfo(*std::move(info)), - cfg.options(), std::move(client_factory_)); - result = - std::make_shared(WithCaching(std::move(impl))); - } - - void visit(ExternalAccountConfig const& cfg) override { - auto const ec = google::cloud::internal::ErrorContext(); - auto info = oauth2_internal::ParseExternalAccountConfiguration( - cfg.json_object(), ec); - if (!info) { - result = std::make_shared(std::move(info).status()); - return; - } - auto impl = std::make_shared( - *info, std::move(client_factory_), cfg.options()); - result = std::make_shared( - Decorate(std::move(impl), cfg.options())); - } - void visit(internal::ApiKeyConfig const&) override { - // Circa 2024, GCS does not support API key authentication. Moreover, we - // would have to grow the deprecated `storage::oauth2::Credentials` class - // to support setting the `x-goog-api-key` header. For these reasons, we - // just return anonymous (no-op) credentials. - result = google::cloud::storage::oauth2::CreateAnonymousCredentials(); - } - void visit(internal::ComputeEngineCredentialsConfig const& cfg) override { - result = std::make_shared( - Decorate(std::make_shared( - cfg.options(), std::move(client_factory_)), - cfg.options())); - } - - private: - oauth2_internal::HttpClientFactory client_factory_; - }; - - RestVisitor visitor([](Options const& o) { - return rest_internal::MakeDefaultRestClient(std::string{}, o); - }); - CredentialsVisitor::dispatch(credentials, visitor); - return std::move(visitor.result); -} - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/internal/unified_rest_credentials.h b/google/cloud/storage/internal/unified_rest_credentials.h deleted file mode 100644 index 480cfaddea161..0000000000000 --- a/google/cloud/storage/internal/unified_rest_credentials.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_INTERNAL_UNIFIED_REST_CREDENTIALS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_UNIFIED_REST_CREDENTIALS_H - -#include "google/cloud/storage/oauth2/credentials.h" -#include "google/cloud/storage/version.h" -#include "google/cloud/credentials.h" -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { - -std::shared_ptr MapCredentials( - google::cloud::Credentials const& credentials); - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_UNIFIED_REST_CREDENTIALS_H diff --git a/google/cloud/storage/internal/unified_rest_credentials_test.cc b/google/cloud/storage/internal/unified_rest_credentials_test.cc deleted file mode 100644 index 237d7cacdb7d3..0000000000000 --- a/google/cloud/storage/internal/unified_rest_credentials_test.cc +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/unified_rest_credentials.h" -#include "google/cloud/storage/testing/constants.h" -#include "google/cloud/internal/credentials_impl.h" -#include "google/cloud/internal/filesystem.h" -#include "google/cloud/internal/random.h" -#include "google/cloud/testing_util/scoped_environment.h" -#include "google/cloud/testing_util/status_matchers.h" -#include -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace internal { -namespace { - -using ::google::cloud::MakeAccessTokenCredentials; -using ::google::cloud::MakeGoogleDefaultCredentials; -using ::google::cloud::MakeInsecureCredentials; -using ::google::cloud::testing_util::IsOk; -using ::google::cloud::testing_util::ScopedEnvironment; -using ::google::cloud::testing_util::StatusIs; -using ::testing::IsEmpty; - -class UnifiedRestCredentialsTest : public ::testing::Test { - public: - UnifiedRestCredentialsTest() : generator_(std::random_device{}()) {} - - std::string TempKeyFileName() { - return google::cloud::internal::PathAppend( - ::testing::TempDir(), - ::google::cloud::internal::Sample( - generator_, 16, "abcdefghijlkmnopqrstuvwxyz0123456789") + - ".json"); - } - - private: - google::cloud::internal::DefaultPRNG generator_; -}; - -TEST_F(UnifiedRestCredentialsTest, Insecure) { - auto credentials = MapCredentials(*MakeInsecureCredentials()); - auto header = credentials->AuthorizationHeader(); - ASSERT_THAT(header, IsOk()); - EXPECT_THAT(*header, IsEmpty()); -} - -TEST_F(UnifiedRestCredentialsTest, Error) { - Status const error_status{StatusCode::kFailedPrecondition, - "Precondition failed."}; - auto credentials = MapCredentials( - *google::cloud::internal::MakeErrorCredentials(error_status)); - auto header = credentials->AuthorizationHeader(); - EXPECT_THAT(header, StatusIs(error_status.code())); -} - -TEST_F(UnifiedRestCredentialsTest, AccessToken) { - auto credentials = MapCredentials( - *MakeAccessTokenCredentials("token1", std::chrono::system_clock::now())); - for (std::string expected : {"token1", "token1", "token1"}) { - auto header = credentials->AuthorizationHeader(); - ASSERT_THAT(header, IsOk()); - EXPECT_EQ("Authorization: Bearer " + expected, *header); - } -} - -TEST_F(UnifiedRestCredentialsTest, LoadError) { - // Create a name for a non-existing file, try to load it, and verify it - // returns errors. - auto const filename = TempKeyFileName(); - ScopedEnvironment env("GOOGLE_APPLICATION_CREDENTIALS", filename); - - auto credentials = MapCredentials(*MakeGoogleDefaultCredentials()); - EXPECT_THAT(credentials->AuthorizationHeader(), Not(IsOk())); -} - -TEST_F(UnifiedRestCredentialsTest, LoadSuccess) { - // Create a loadable, i.e., syntactically valid, key file, load it, and it - // has the right contents. - auto constexpr kKeyId = "test-only-key-id"; - auto constexpr kClientEmail = - "sa@invalid-test-only-project.iam.gserviceaccount.com"; - auto contents = nlohmann::json{ - {"type", "service_account"}, - {"project_id", "invalid-test-only-project"}, - {"private_key_id", kKeyId}, - {"private_key", google::cloud::storage::testing::kWellFormattedKey}, - {"client_email", kClientEmail}, - {"client_id", "invalid-test-only-client-id"}, - {"auth_uri", "https://accounts.google.com/o/oauth2/auth"}, - {"token_uri", "https://accounts.google.com/o/oauth2/token"}, - {"auth_provider_x509_cert_url", - "https://www.googleapis.com/oauth2/v1/certs"}, - {"client_x509_cert_url", - "https://www.googleapis.com/robot/v1/metadata/x509/" - "foo-email%40foo-project.iam.gserviceaccount.com"}, - }; - auto const filename = TempKeyFileName(); - std::ofstream(filename) << contents.dump(4) << "\n"; - - ScopedEnvironment env("GOOGLE_APPLICATION_CREDENTIALS", filename); - - auto credentials = MapCredentials(*MakeGoogleDefaultCredentials()); - // Calling AuthenticationHeader() makes RPCs which would turn this into an - // integration test, fortunately there are easier ways to verify the file was - // loaded correctly: - EXPECT_EQ(kClientEmail, credentials->AccountEmail()); - EXPECT_EQ(kKeyId, credentials->KeyId()); - - std::remove(filename.c_str()); -} - -} // namespace -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/lifecycle_rule.cc b/google/cloud/storage/lifecycle_rule.cc index b8d00ec3ce7f0..837d98e377e3f 100644 --- a/google/cloud/storage/lifecycle_rule.cc +++ b/google/cloud/storage/lifecycle_rule.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "google/cloud/storage/lifecycle_rule.h" -#include "google/cloud/internal/absl_str_join_quiet.h" +#include "absl/strings/str_join.h" #include #include #include 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/notification_metadata.cc b/google/cloud/storage/notification_metadata.cc index a14c4da41f58b..6f763f2a85d92 100644 --- a/google/cloud/storage/notification_metadata.cc +++ b/google/cloud/storage/notification_metadata.cc @@ -14,7 +14,7 @@ #include "google/cloud/storage/notification_metadata.h" #include "google/cloud/storage/internal/notification_requests.h" -#include "google/cloud/internal/absl_str_join_quiet.h" +#include "absl/strings/str_join.h" #include #include diff --git a/google/cloud/storage/oauth2/anonymous_credentials.cc b/google/cloud/storage/oauth2/anonymous_credentials.cc deleted file mode 100644 index faaf664a95e18..0000000000000 --- a/google/cloud/storage/oauth2/anonymous_credentials.cc +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/oauth2/anonymous_credentials.h" - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -StatusOr AnonymousCredentials::AuthorizationHeader() { - return std::string{}; -} - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/oauth2/anonymous_credentials.h b/google/cloud/storage/oauth2/anonymous_credentials.h deleted file mode 100644 index d127eb0fcfa09..0000000000000 --- a/google/cloud/storage/oauth2/anonymous_credentials.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_OAUTH2_ANONYMOUS_CREDENTIALS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_ANONYMOUS_CREDENTIALS_H - -#include "google/cloud/storage/oauth2/credentials.h" -#include "google/cloud/storage/version.h" -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -/** - * A `Credentials` type representing "anonymous" Google OAuth2.0 credentials. - * - * This is only useful in two cases: (a) in testing, where you want to access - * a test bench without having to worry about authentication or SSL setup, and - * (b) when accessing publicly readable resources (e.g. a Google Cloud Storage - * object that is readable by the "allUsers" entity), which requires no - * authentication or authorization. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -class AnonymousCredentials : public Credentials { - public: - AnonymousCredentials() = default; - - /** - * While other Credentials subclasses return a string containing an - * Authorization HTTP header from this method, this class always returns an - * empty string as its value. - */ - StatusOr AuthorizationHeader() override; -}; - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_ANONYMOUS_CREDENTIALS_H diff --git a/google/cloud/storage/oauth2/anonymous_credentials_test.cc b/google/cloud/storage/oauth2/anonymous_credentials_test.cc deleted file mode 100644 index 3404352fb6075..0000000000000 --- a/google/cloud/storage/oauth2/anonymous_credentials_test.cc +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/oauth2/anonymous_credentials.h" -#include "google/cloud/testing_util/status_matchers.h" -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { -namespace { - -class AnonymousCredentialsTest : public ::testing::Test {}; - -/// @test Verify `AnonymousCredentials` works as expected. -TEST_F(AnonymousCredentialsTest, AuthorizationHeaderReturnsEmptyString) { - AnonymousCredentials credentials; - auto header = credentials.AuthorizationHeader(); - ASSERT_STATUS_OK(header); - EXPECT_EQ("", header.value()); -} - -} // namespace -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/oauth2/authorized_user_credentials.cc b/google/cloud/storage/oauth2/authorized_user_credentials.cc deleted file mode 100644 index d17956c5c7d49..0000000000000 --- a/google/cloud/storage/oauth2/authorized_user_credentials.cc +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/oauth2/authorized_user_credentials.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -StatusOr ParseAuthorizedUserCredentials( - std::string const& content, std::string const& source, - std::string const& default_token_uri) { - auto info = google::cloud::oauth2_internal::ParseAuthorizedUserCredentials( - content, source, default_token_uri); - if (!info.ok()) return info.status(); - AuthorizedUserCredentialsInfo i; - i.token_uri = std::move(info->token_uri); - i.refresh_token = std::move(info->refresh_token); - i.client_secret = std::move(info->client_secret); - i.client_id = std::move(info->client_id); - return i; -} - -StatusOr -ParseAuthorizedUserRefreshResponse( - storage::internal::HttpResponse const& response, - std::chrono::system_clock::time_point now) { - auto access_token = nlohmann::json::parse(response.payload, nullptr, false); - if (!access_token.is_object() || access_token.count("access_token") == 0 || - access_token.count("expires_in") == 0 || - access_token.count("id_token") == 0 || - access_token.count("token_type") == 0) { - auto payload = - response.payload + - "Could not find all required fields in response (access_token," - " id_token, expires_in, token_type) while trying to obtain an access" - " token for authorized user credentials."; - return AsStatus(storage::internal::HttpResponse{response.status_code, - payload, response.headers}); - } - std::string header = "Authorization: "; - header += access_token.value("token_type", ""); - header += ' '; - header += access_token.value("access_token", ""); - std::string new_id = access_token.value("id_token", ""); - auto expires_in = std::chrono::seconds(access_token.value("expires_in", 0)); - auto new_expiration = now + expires_in; - return RefreshingCredentialsWrapper::TemporaryToken{std::move(header), - new_expiration}; -} - -AuthorizedUserCredentials:: - AuthorizedUserCredentials(AuthorizedUserCredentialsInfo const& info, - ChannelOptions const& channel_options) - : AuthorizedUserCredentials( - google::cloud::oauth2_internal::AuthorizedUserCredentialsInfo{ - info.client_id, info.client_secret, info.refresh_token, - info.token_uri, info.universe_domain}, - channel_options) {} - -AuthorizedUserCredentials:: - AuthorizedUserCredentials( - google::cloud::oauth2_internal::AuthorizedUserCredentialsInfo info, - ChannelOptions const& channel_options) - : AuthorizedUserCredentials( - std::move(info), - Options{}.set(channel_options.ssl_root_path()), - [](Options const& o) { - return rest_internal::MakeDefaultRestClient(std::string{}, o); - }) {} - -AuthorizedUserCredentials:: - AuthorizedUserCredentials( - google::cloud::oauth2_internal::AuthorizedUserCredentialsInfo info, - Options options, oauth2_internal::HttpClientFactory client_factory) - : impl_(std::make_shared( - std::make_shared( - std::move(info), std::move(options), - std::move(client_factory)))) {} - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/oauth2/authorized_user_credentials.h b/google/cloud/storage/oauth2/authorized_user_credentials.h deleted file mode 100644 index 240698c47da9c..0000000000000 --- a/google/cloud/storage/oauth2/authorized_user_credentials.h +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_OAUTH2_AUTHORIZED_USER_CREDENTIALS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_AUTHORIZED_USER_CREDENTIALS_H - -#include "google/cloud/storage/client_options.h" -#include "google/cloud/storage/internal/curl/request_builder.h" -#include "google/cloud/storage/internal/http_response.h" -#include "google/cloud/storage/oauth2/credential_constants.h" -#include "google/cloud/storage/oauth2/credentials.h" -#include "google/cloud/storage/oauth2/refreshing_credentials_wrapper.h" -#include "google/cloud/storage/version.h" -#include "google/cloud/internal/curl_handle_factory.h" -#include "google/cloud/internal/oauth2_authorized_user_credentials.h" -#include "google/cloud/internal/oauth2_cached_credentials.h" -#include "google/cloud/internal/oauth2_credential_constants.h" -#include "google/cloud/status.h" -#include -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -/** - * Object to hold information used to instantiate an AuthorizedUserCredentials. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -struct AuthorizedUserCredentialsInfo { - std::string client_id; - std::string client_secret; - std::string refresh_token; - std::string token_uri; - std::string universe_domain; -}; - -/** - * Parses a refresh response JSON string into an authorization header. - * - * The header and the current time (for the expiration) form a TemporaryToken. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr -ParseAuthorizedUserRefreshResponse( - storage::internal::HttpResponse const& response, - std::chrono::system_clock::time_point now); - -/** - * Parses a user credentials JSON string into an AuthorizedUserCredentialsInfo. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr ParseAuthorizedUserCredentials( - std::string const& content, std::string const& source, - std::string const& default_token_uri = - google::cloud::oauth2_internal::GoogleOAuthRefreshEndpoint()); - -/** - * Wrapper class for Google OAuth 2.0 user account credentials. - * - * Takes a AuthorizedUserCredentialsInfo and obtains access tokens from the - * Google Authorization Service as needed. Instances of this class should - * usually be created via the convenience methods declared in - * google_credentials.h. - * - * An HTTP Authorization header, with an access token as its value, - * can be obtained by calling the AuthorizationHeader() method; if the current - * access token is invalid or nearing expiration, this will class will first - * obtain a new access token before returning the Authorization header string. - * - * @see https://developers.google.com/identity/protocols/OAuth2 for an overview - * of using user credentials with Google's OAuth 2.0 system. - * - * @tparam HttpRequestBuilderType a dependency injection point. It makes it - * possible to mock internal libcurl wrappers. This should generally not be - * overridden except for testing. - * @tparam ClockType a dependency injection point to fetch the current time. - * This should generally not be overridden except for testing. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -template -class AuthorizedUserCredentials; - -/// @copydoc AuthorizedUserCredentials -template <> -class AuthorizedUserCredentials - : public Credentials { - public: - explicit AuthorizedUserCredentials( - AuthorizedUserCredentialsInfo const& info, - ChannelOptions const& channel_options = {}); - - explicit AuthorizedUserCredentials( - google::cloud::oauth2_internal::AuthorizedUserCredentialsInfo info, - ChannelOptions const& channel_options = {}); - - StatusOr AuthorizationHeader() override { - return oauth2_internal::AuthenticationHeaderJoined(*impl_); - } - - private: - friend struct AuthorizedUserCredentialsTester; - AuthorizedUserCredentials( - google::cloud::oauth2_internal::AuthorizedUserCredentialsInfo, - Options options, oauth2_internal::HttpClientFactory client_factory); - - StatusOr AuthorizationHeaderForTesting( - std::chrono::system_clock::time_point tp) { - return oauth2_internal::AuthenticationHeaderJoined(*impl_, tp); - } - - std::shared_ptr impl_; -}; - -/// @copydoc AuthorizedUserCredentials -template -class AuthorizedUserCredentials : public Credentials { - public: - explicit AuthorizedUserCredentials(AuthorizedUserCredentialsInfo info, - ChannelOptions const& channel_options = {}) - : info_(std::move(info)), - options_(Options{}.set( - channel_options.ssl_root_path())), - clock_() {} - - StatusOr AuthorizationHeader() override { - std::unique_lock lock(mu_); - return refreshing_creds_.AuthorizationHeader(clock_.now(), - [this] { return Refresh(); }); - } - - private: - StatusOr Refresh() { - HttpRequestBuilderType builder( - info_.token_uri, rest_internal::GetDefaultCurlHandleFactory(options_)); - std::string payload("grant_type=refresh_token"); - payload += "&client_id="; - payload += builder.MakeEscapedString(info_.client_id).get(); - payload += "&client_secret="; - payload += builder.MakeEscapedString(info_.client_secret).get(); - payload += "&refresh_token="; - payload += builder.MakeEscapedString(info_.refresh_token).get(); - auto response = std::move(builder).BuildRequest().MakeRequest(payload); - if (!response) return std::move(response).status(); - if (response->status_code >= 300) return AsStatus(*response); - return ParseAuthorizedUserRefreshResponse(*response, clock_.now()); - } - - AuthorizedUserCredentialsInfo info_; - Options options_; - ClockType clock_; - mutable std::mutex mu_; - RefreshingCredentialsWrapper refreshing_creds_; -}; - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_AUTHORIZED_USER_CREDENTIALS_H diff --git a/google/cloud/storage/oauth2/authorized_user_credentials_test.cc b/google/cloud/storage/oauth2/authorized_user_credentials_test.cc deleted file mode 100644 index 141872cd2e76c..0000000000000 --- a/google/cloud/storage/oauth2/authorized_user_credentials_test.cc +++ /dev/null @@ -1,504 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/oauth2/authorized_user_credentials.h" -#include "google/cloud/storage/oauth2/credential_constants.h" -#include "google/cloud/storage/testing/mock_http_request.h" -#include "google/cloud/testing_util/mock_fake_clock.h" -#include "google/cloud/testing_util/mock_http_payload.h" -#include "google/cloud/testing_util/mock_rest_client.h" -#include "google/cloud/testing_util/mock_rest_response.h" -#include "google/cloud/testing_util/status_matchers.h" -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -// Define a helper to test the specialization. -struct AuthorizedUserCredentialsTester { - static StatusOr Header( - AuthorizedUserCredentials<>& tested, - std::chrono::system_clock::time_point tp) { - return tested.AuthorizationHeaderForTesting(tp); - } - - static AuthorizedUserCredentials<> MakeAuthorizedUserCredentials( - google::cloud::oauth2_internal::AuthorizedUserCredentialsInfo info, - oauth2_internal::HttpClientFactory factory) { - return AuthorizedUserCredentials<>(std::move(info), Options{}, - std::move(factory)); - } -}; - -namespace { - -using ::google::cloud::storage::internal::HttpResponse; -using ::google::cloud::storage::testing::MockHttpRequest; -using ::google::cloud::storage::testing::MockHttpRequestBuilder; -using ::google::cloud::testing_util::FakeClock; -using ::google::cloud::testing_util::IsOk; -using ::google::cloud::testing_util::IsOkAndHolds; -using ::google::cloud::testing_util::MakeMockHttpPayloadSuccess; -using ::google::cloud::testing_util::MockRestClient; -using ::google::cloud::testing_util::MockRestResponse; -using ::google::cloud::testing_util::StatusIs; -using ::testing::_; -using ::testing::AllOf; -using ::testing::An; -using ::testing::AtLeast; -using ::testing::ByMove; -using ::testing::HasSubstr; -using ::testing::Not; -using ::testing::Return; -using ::testing::StrEq; - -class AuthorizedUserCredentialsTest : public ::testing::Test { - protected: - void SetUp() override { - MockHttpRequestBuilder::mock_ = - std::make_shared(); - } - void TearDown() override { MockHttpRequestBuilder::mock_.reset(); } -}; - -/// @test Verify that we can create credentials from a JWT string. -TEST_F(AuthorizedUserCredentialsTest, Simple) { - std::string response = R"""({ - "token_type": "Type", - "access_token": "access-token-value", - "id_token": "id-token-value", - "expires_in": 1234 -})"""; - auto mock_request = std::make_shared(); - EXPECT_CALL(*mock_request, MakeRequest) - .WillOnce([response](std::string const& payload) { - EXPECT_THAT(payload, HasSubstr("grant_type=refresh_token")); - EXPECT_THAT(payload, HasSubstr("client_id=a-client-id.example.com")); - EXPECT_THAT(payload, HasSubstr("client_secret=a-123456ABCDEF")); - EXPECT_THAT(payload, HasSubstr("refresh_token=1/THETOKEN")); - return HttpResponse{200, response, {}}; - }); - - auto mock_builder = MockHttpRequestBuilder::mock_; - EXPECT_CALL(*mock_builder, - Constructor(StrEq("https://oauth2.googleapis.com/token"), _, _)) - .Times(1); - EXPECT_CALL(*mock_builder, BuildRequest()).WillOnce([mock_request]() { - MockHttpRequest result; - result.mock = mock_request; - return result; - }); - EXPECT_CALL(*mock_builder, MakeEscapedString) - .WillRepeatedly([](std::string const& s) { - auto t = std::unique_ptr(new char[s.size() + 1]); - std::copy(s.begin(), s.end(), t.get()); - t[s.size()] = '\0'; - return t; - }); - - std::string config = R"""({ - "client_id": "a-client-id.example.com", - "client_secret": "a-123456ABCDEF", - "refresh_token": "1/THETOKEN", - "type": "magic_type" -})"""; - - auto info = ParseAuthorizedUserCredentials(config, "test"); - ASSERT_STATUS_OK(info); - AuthorizedUserCredentials credentials(*info); - EXPECT_EQ("Authorization: Type access-token-value", - credentials.AuthorizationHeader().value()); -} - -/// @test Verify that we can refresh service account credentials. -TEST_F(AuthorizedUserCredentialsTest, Refresh) { - // Prepare two responses, the first one is used but becomes immediately - // expired, resulting in another refresh next time the caller tries to get - // an authorization header. - std::string r1 = R"""({ - "token_type": "Type", - "access_token": "access-token-r1", - "id_token": "id-token-value", - "expires_in": 0 -})"""; - std::string r2 = R"""({ - "token_type": "Type", - "access_token": "access-token-r2", - "id_token": "id-token-value", - "expires_in": 1000 -})"""; - - // Now setup the builder to return those responses. - auto mock_builder = MockHttpRequestBuilder::mock_; - EXPECT_CALL(*mock_builder, BuildRequest()) - .WillOnce([&] { - MockHttpRequest request; - EXPECT_CALL(*request.mock, MakeRequest) - .WillOnce(Return(HttpResponse{200, r1, {}})); - return request; - }) - .WillOnce([&] { - MockHttpRequest request; - EXPECT_CALL(*request.mock, MakeRequest) - .WillOnce(Return(HttpResponse{200, r2, {}})); - return request; - }); - EXPECT_CALL(*mock_builder, Constructor(GoogleOAuthRefreshEndpoint(), _, _)) - .Times(AtLeast(1)); - EXPECT_CALL(*mock_builder, MakeEscapedString) - .WillRepeatedly([](std::string const& s) { - auto t = std::unique_ptr(new char[s.size() + 1]); - std::copy(s.begin(), s.end(), t.get()); - t[s.size()] = '\0'; - return t; - }); - - std::string config = R"""({ - "client_id": "a-client-id.example.com", - "client_secret": "a-123456ABCDEF", - "refresh_token": "1/THETOKEN", - "type": "magic_type" -})"""; - auto info = ParseAuthorizedUserCredentials(config, "test"); - ASSERT_STATUS_OK(info); - AuthorizedUserCredentials credentials(*info); - EXPECT_EQ("Authorization: Type access-token-r1", - credentials.AuthorizationHeader().value()); - EXPECT_EQ("Authorization: Type access-token-r2", - credentials.AuthorizationHeader().value()); - EXPECT_EQ("Authorization: Type access-token-r2", - credentials.AuthorizationHeader().value()); -} - -/// @test Mock a failed refresh response. -TEST_F(AuthorizedUserCredentialsTest, FailedRefresh) { - // Now setup the builder to return those responses. - auto mock_builder = MockHttpRequestBuilder::mock_; - EXPECT_CALL(*mock_builder, BuildRequest()) - .WillOnce([] { - MockHttpRequest request; - EXPECT_CALL(*request.mock, MakeRequest) - .WillOnce(Return(Status(StatusCode::kAborted, "Fake Curl error"))); - return request; - }) - .WillOnce([] { - MockHttpRequest request; - EXPECT_CALL(*request.mock, MakeRequest) - .WillOnce(Return(HttpResponse{400, "", {}})); - return request; - }); - EXPECT_CALL(*mock_builder, Constructor(GoogleOAuthRefreshEndpoint(), _, _)) - .Times(AtLeast(1)); - EXPECT_CALL(*mock_builder, MakeEscapedString(An())) - .WillRepeatedly([](std::string const& s) { - auto t = std::unique_ptr(new char[s.size() + 1]); - std::copy(s.begin(), s.end(), t.get()); - t[s.size()] = '\0'; - return t; - }); - - std::string config = R"""({ - "client_id": "a-client-id.example.com", - "client_secret": "a-123456ABCDEF", - "refresh_token": "1/THETOKEN", - "type": "magic_type" -})"""; - auto info = ParseAuthorizedUserCredentials(config, "test"); - ASSERT_STATUS_OK(info); - AuthorizedUserCredentials credentials(*info); - // Response 1 - auto status = credentials.AuthorizationHeader(); - EXPECT_THAT(status, StatusIs(StatusCode::kAborted)); - // Response 2 - status = credentials.AuthorizationHeader(); - EXPECT_THAT(status, Not(IsOk())); -} - -/// @test Verify that the options are used in the constructor. -TEST_F(AuthorizedUserCredentialsTest, UsesCARootsInfo) { - // Now setup the builder to return a valid response. - auto mock_builder = MockHttpRequestBuilder::mock_; - EXPECT_CALL(*mock_builder, BuildRequest()).WillOnce([&] { - MockHttpRequest request; - nlohmann::json response{{"token_type", "Mock-Type"}, - {"access_token", "fake-token"}, - {"id_token", "fake-id-token-value"}, - {"expires_in", 3600}}; - EXPECT_CALL(*request.mock, MakeRequest) - .WillOnce(Return(HttpResponse{200, response.dump(), {}})); - return request; - }); - - // This is the key check in this test, verify the constructor is called with - // the right parameters. - auto const cainfo = std::string{"fake-cainfo-path-aka-roots-pem"}; - EXPECT_CALL(*mock_builder, Constructor(GoogleOAuthRefreshEndpoint(), - absl::make_optional(cainfo), _)) - .Times(AtLeast(1)); - EXPECT_CALL(*mock_builder, MakeEscapedString(An())) - .WillRepeatedly([](std::string const& s) { - auto t = std::unique_ptr(new char[s.size() + 1]); - std::copy(s.begin(), s.end(), t.get()); - t[s.size()] = '\0'; - return t; - }); - - std::string config = R"""({ - "client_id": "a-client-id.example.com", - "client_secret": "a-123456ABCDEF", - "refresh_token": "1/THETOKEN", - "type": "magic_type" -})"""; - auto info = ParseAuthorizedUserCredentials(config, "test"); - ASSERT_STATUS_OK(info); - AuthorizedUserCredentials credentials( - *info, ChannelOptions().set_ssl_root_path(cainfo)); - EXPECT_EQ("Authorization: Mock-Type fake-token", - credentials.AuthorizationHeader().value()); -} - -/// @test Verify that parsing an authorized user account JSON string works. -TEST_F(AuthorizedUserCredentialsTest, ParseSimple) { - std::string config = R"""({ - "client_id": "a-client-id.example.com", - "client_secret": "a-123456ABCDEF", - "refresh_token": "1/THETOKEN", - "token_uri": "https://oauth2.googleapis.com/test_endpoint", - "type": "magic_type" -})"""; - - auto actual = - ParseAuthorizedUserCredentials(config, "test-data", "unused-uri"); - ASSERT_STATUS_OK(actual); - EXPECT_EQ("a-client-id.example.com", actual->client_id); - EXPECT_EQ("a-123456ABCDEF", actual->client_secret); - EXPECT_EQ("1/THETOKEN", actual->refresh_token); - EXPECT_EQ("https://oauth2.googleapis.com/test_endpoint", actual->token_uri); -} - -/// @test Verify that parsing an authorized user account JSON string works. -TEST_F(AuthorizedUserCredentialsTest, ParseUsesExplicitDefaultTokenUri) { - // No token_uri attribute here, so the default passed below should be used. - std::string config = R"""({ - "client_id": "a-client-id.example.com", - "client_secret": "a-123456ABCDEF", - "refresh_token": "1/THETOKEN", - "type": "magic_type" -})"""; - - auto actual = ParseAuthorizedUserCredentials( - config, "test-data", "https://oauth2.googleapis.com/test_endpoint"); - ASSERT_STATUS_OK(actual); - EXPECT_EQ("a-client-id.example.com", actual->client_id); - EXPECT_EQ("a-123456ABCDEF", actual->client_secret); - EXPECT_EQ("1/THETOKEN", actual->refresh_token); - EXPECT_EQ("https://oauth2.googleapis.com/test_endpoint", actual->token_uri); -} - -/// @test Verify that parsing an authorized user account JSON string works. -TEST_F(AuthorizedUserCredentialsTest, ParseUsesImplicitDefaultTokenUri) { - // No token_uri attribute here. - std::string config = R"""({ - "client_id": "a-client-id.example.com", - "client_secret": "a-123456ABCDEF", - "refresh_token": "1/THETOKEN", - "type": "magic_type" -})"""; - - // No token_uri passed in here, either. - auto actual = ParseAuthorizedUserCredentials(config, "test-data"); - ASSERT_STATUS_OK(actual); - EXPECT_EQ("a-client-id.example.com", actual->client_id); - EXPECT_EQ("a-123456ABCDEF", actual->client_secret); - EXPECT_EQ("1/THETOKEN", actual->refresh_token); - EXPECT_EQ(std::string(GoogleOAuthRefreshEndpoint()), actual->token_uri); -} - -/// @test Verify that invalid contents result in a readable error. -TEST_F(AuthorizedUserCredentialsTest, ParseInvalidContentsFails) { - EXPECT_THAT(ParseAuthorizedUserCredentials( - R"""( not-a-valid-json-string })""", "test-as-a-source"), - StatusIs(Not(StatusCode::kOk), - AllOf(HasSubstr("Invalid AuthorizedUserCredentials"), - HasSubstr("test-as-a-source")))); - - EXPECT_THAT(ParseAuthorizedUserCredentials( - R"""("valid-json-but-not-an-object")""", "test-as-a-source"), - StatusIs(Not(StatusCode::kOk), - AllOf(HasSubstr("Invalid AuthorizedUserCredentials"), - HasSubstr("test-as-a-source")))); -} - -/// @test Parsing a service account JSON string should detect empty fields. -TEST_F(AuthorizedUserCredentialsTest, ParseEmptyFieldFails) { - std::string contents = R"""({ - "client_id": "a-client-id.example.com", - "client_secret": "a-123456ABCDEF", - "refresh_token": "1/THETOKEN", - "type": "magic_type" -})"""; - - for (auto const& field : {"client_id", "client_secret", "refresh_token"}) { - auto json = nlohmann::json::parse(contents); - json[field] = ""; - auto info = ParseAuthorizedUserCredentials(json.dump(), "test-data"); - EXPECT_THAT(info, - StatusIs(Not(StatusCode::kOk), - AllOf(HasSubstr(field), HasSubstr(" field is empty"), - HasSubstr("test-data")))); - } -} - -/// @test Parsing a service account JSON string should detect missing fields. -TEST_F(AuthorizedUserCredentialsTest, ParseMissingFieldFails) { - std::string contents = R"""({ - "client_id": "a-client-id.example.com", - "client_secret": "a-123456ABCDEF", - "refresh_token": "1/THETOKEN", - "type": "magic_type" -})"""; - - for (auto const& field : {"client_id", "client_secret", "refresh_token"}) { - auto json = nlohmann::json::parse(contents); - json.erase(field); - auto info = ParseAuthorizedUserCredentials(json.dump(), "test-data"); - EXPECT_THAT(info, - StatusIs(Not(StatusCode::kOk), - AllOf(HasSubstr(field), HasSubstr(" field is missing"), - HasSubstr("test-data")))); - } -} - -/// @test Parsing an invalid refresh response results in failure. -TEST_F(AuthorizedUserCredentialsTest, ParseAuthorizedUserRefreshResponseError) { - std::string r1 = R"""({})"""; - // Does not have access_token. - std::string r2 = R"""({ - "token_type": "Type", - "id_token": "id-token-value", - "expires_in": 1000 -})"""; - - FakeClock::reset_clock(1000); - auto status = ParseAuthorizedUserRefreshResponse(HttpResponse{400, r1, {}}, - FakeClock::now()); - EXPECT_THAT(status, - StatusIs(StatusCode::kInvalidArgument, - HasSubstr("Could not find all required fields"))); - - status = ParseAuthorizedUserRefreshResponse(HttpResponse{400, r2, {}}, - FakeClock::now()); - EXPECT_THAT(status, - StatusIs(StatusCode::kInvalidArgument, - HasSubstr("Could not find all required fields"))); - - EXPECT_THAT(ParseAuthorizedUserRefreshResponse( - HttpResponse{400, R"js("valid-json-but-not-an-object)js", {}}, - FakeClock::now()), - StatusIs(StatusCode::kInvalidArgument, - HasSubstr("Could not find all required fields"))); -} - -/// @test Parsing a refresh response yields a TemporaryToken. -TEST_F(AuthorizedUserCredentialsTest, ParseAuthorizedUserRefreshResponse) { - std::string r1 = R"""({ - "token_type": "Type", - "access_token": "access-token-r1", - "id_token": "id-token-value", - "expires_in": 1000 -})"""; - - auto expires_in = 1000; - FakeClock::reset_clock(2000); - auto status = ParseAuthorizedUserRefreshResponse(HttpResponse{200, r1, {}}, - FakeClock::now()); - EXPECT_STATUS_OK(status); - auto token = *status; - EXPECT_EQ( - std::chrono::time_point_cast(token.expiration_time) - .time_since_epoch() - .count(), - FakeClock::now_value_ + expires_in); - EXPECT_EQ(token.token, "Authorization: Type access-token-r1"); -} - -TEST_F(AuthorizedUserCredentialsTest, Caching) { - // We need to mock the Security Token Service or this would be an - // integration test that requires a valid user account. - auto make_mock_client = [](std::string const& payload) { - auto response = std::make_unique(); - EXPECT_CALL(*response, StatusCode) - .WillRepeatedly( - Return(google::cloud::rest_internal::HttpStatusCode::kOk)); - EXPECT_CALL(std::move(*response), ExtractPayload) - .WillOnce(Return(ByMove(MakeMockHttpPayloadSuccess(payload)))); - auto mock = std::make_unique(); - using PostPayloadType = std::vector>; - EXPECT_CALL(*mock, Post(_, _, An())) - .WillOnce(Return(ByMove(std::unique_ptr( - std::move(response))))); - return std::unique_ptr(std::move(mock)); - }; - - auto constexpr kPayload1 = R"js({ - "access_token": "access-token-1", "id_token": "id-token-1", - "token_type": "Bearer", "expires_in": 3600})js"; - auto constexpr kPayload2 = R"js({ - "access_token": "access-token-2", "id_token": "id-token-2", - "token_type": "Bearer", "expires_in": 3600})js"; - - using MockHttpClientFactory = - ::testing::MockFunction( - Options const&)>; - MockHttpClientFactory mock_factory; - EXPECT_CALL(mock_factory, Call) - .WillOnce(Return(ByMove(make_mock_client(kPayload1)))) - .WillOnce(Return(ByMove(make_mock_client(kPayload2)))); - - auto tested = AuthorizedUserCredentialsTester::MakeAuthorizedUserCredentials( - oauth2_internal::AuthorizedUserCredentialsInfo{}, - mock_factory.AsStdFunction()); - auto const tp = std::chrono::system_clock::now(); - auto initial = AuthorizedUserCredentialsTester::Header(tested, tp); - ASSERT_STATUS_OK(initial); - - auto cached = AuthorizedUserCredentialsTester::Header( - tested, tp + std::chrono::seconds(30)); - EXPECT_THAT(cached, IsOkAndHolds(*initial)); - - cached = AuthorizedUserCredentialsTester::Header( - tested, tp + std::chrono::seconds(300)); - EXPECT_THAT(cached, IsOkAndHolds(*initial)); - - auto uncached = AuthorizedUserCredentialsTester::Header( - tested, tp + std::chrono::hours(2)); - ASSERT_STATUS_OK(uncached); - EXPECT_NE(*initial, *uncached); -} - -} // namespace -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/oauth2/compute_engine_credentials.cc b/google/cloud/storage/oauth2/compute_engine_credentials.cc deleted file mode 100644 index 088436bf8f074..0000000000000 --- a/google/cloud/storage/oauth2/compute_engine_credentials.cc +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/oauth2/compute_engine_credentials.h" -#include "google/cloud/internal/oauth2_cached_credentials.h" -#include "google/cloud/internal/oauth2_compute_engine_credentials.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -StatusOr ParseMetadataServerResponse( - storage::internal::HttpResponse const& response) { - auto meta = google::cloud::oauth2_internal::ParseMetadataServerResponse( - response.payload); - return ServiceAccountMetadata{std::move(meta.scopes), std::move(meta.email)}; -} - -StatusOr -ParseComputeEngineRefreshResponse( - storage::internal::HttpResponse const& response, - std::chrono::system_clock::time_point now) { - // Response should have the attributes "access_token", "expires_in", and - // "token_type". - auto access_token = nlohmann::json::parse(response.payload, nullptr, false); - if (!access_token.is_object() || access_token.count("access_token") == 0 || - access_token.count("expires_in") == 0 || - access_token.count("token_type") == 0) { - auto payload = - response.payload + - "Could not find all required fields in response (access_token," - " expires_in, token_type) while trying to obtain an access token for" - " compute engine credentials."; - return AsStatus(storage::internal::HttpResponse{response.status_code, - payload, response.headers}); - } - std::string header = "Authorization: "; - header += access_token.value("token_type", ""); - header += ' '; - header += access_token.value("access_token", ""); - auto expires_in = std::chrono::seconds(access_token.value("expires_in", 0)); - auto new_expiration = now + expires_in; - - return RefreshingCredentialsWrapper::TemporaryToken{std::move(header), - new_expiration}; -} - -ComputeEngineCredentials:: - ComputeEngineCredentials(std::string service_account_email) - : ComputeEngineCredentials( - std::move(service_account_email), [](Options const& o) { - return rest_internal::MakeDefaultRestClient(std::string{}, o); - }) {} - -ComputeEngineCredentials:: - ComputeEngineCredentials(std::string service_account_email, - oauth2_internal::HttpClientFactory client_factory) - : impl_(std::make_shared( - std::move(service_account_email), Options{}, - std::move(client_factory))), - cached_(std::make_shared(impl_)) {} - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/oauth2/compute_engine_credentials.h b/google/cloud/storage/oauth2/compute_engine_credentials.h deleted file mode 100644 index 7c4772e438754..0000000000000 --- a/google/cloud/storage/oauth2/compute_engine_credentials.h +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_OAUTH2_COMPUTE_ENGINE_CREDENTIALS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_COMPUTE_ENGINE_CREDENTIALS_H - -#include "google/cloud/storage/internal/base64.h" -#include "google/cloud/storage/internal/compute_engine_util.h" -#include "google/cloud/storage/internal/curl/request_builder.h" -#include "google/cloud/storage/internal/http_response.h" -#include "google/cloud/storage/oauth2/credential_constants.h" -#include "google/cloud/storage/oauth2/credentials.h" -#include "google/cloud/storage/oauth2/refreshing_credentials_wrapper.h" -#include "google/cloud/storage/version.h" -#include "google/cloud/internal/curl_handle_factory.h" -#include "google/cloud/internal/getenv.h" -#include "google/cloud/internal/oauth2_cached_credentials.h" -#include "google/cloud/internal/oauth2_compute_engine_credentials.h" -#include "google/cloud/status.h" -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -/** - * A helper struct that contains service account metadata. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -struct ServiceAccountMetadata { - std::set scopes; - std::string email; -}; - -/** - * Parses a metadata server response JSON string into a ServiceAccountMetadata. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr ParseMetadataServerResponse( - storage::internal::HttpResponse const& response); - -/** - * Parses a refresh response JSON string into an authorization header. - * - * The header and the current time (for the expiration) form a TemporaryToken. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr -ParseComputeEngineRefreshResponse( - storage::internal::HttpResponse const& response, - std::chrono::system_clock::time_point now); - -/** - * Wrapper class for Google OAuth 2.0 GCE instance service account credentials. - * - * Takes a service account email address or alias (e.g. "default") and uses the - * Google Compute Engine instance's metadata server to obtain service account - * metadata and OAuth 2.0 access tokens as needed. Instances of this class - * should usually be created via the convenience methods declared in - * google_credentials.h. - * - * An HTTP Authorization header, with an access token as its value, can be - * obtained by calling the AuthorizationHeader() method; if the current access - * token is invalid or nearing expiration, this will class will first obtain a - * new access token before returning the Authorization header string. - * - * @see https://cloud.google.com/compute/docs/authentication#using for details - * on how to get started with Compute Engine service account credentials. - * - * @tparam HttpRequestBuilderType a dependency injection point. It makes it - * possible to mock internal libcurl wrappers. This should generally not - * be overridden except for testing. - * @tparam ClockType a dependency injection point to fetch the current time. - * This should generally not be overridden except for testing. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -template -class ComputeEngineCredentials; - -/// @copydoc ComputeEngineCredentials -template <> -class ComputeEngineCredentials : public Credentials { - public: - explicit ComputeEngineCredentials() : ComputeEngineCredentials("default") {} - explicit ComputeEngineCredentials(std::string service_account_email); - - StatusOr AuthorizationHeader() override { - return oauth2_internal::AuthenticationHeaderJoined(*cached_); - } - - std::string AccountEmail() const override { return impl_->AccountEmail(); } - - /** - * Returns the email or alias of this credential's service account. - * - * @note This class must query the Compute Engine instance's metadata server - * to fetch service account metadata. Because of this, if an alias (e.g. - * "default") was supplied in place of an actual email address when - * initializing this credential, that alias is returned as this credential's - * email address if the credential has not been refreshed yet. - */ - std::string service_account_email() { return impl_->service_account_email(); } - - /** - * Returns the set of scopes granted to this credential's service account. - * - * @note Because this class must query the Compute Engine instance's metadata - * server to fetch service account metadata, this method will return an empty - * set if the credential has not been refreshed yet. - */ - std::set scopes() const { return impl_->scopes(); } - - private: - friend struct ComputeEngineCredentialsTester; - ComputeEngineCredentials(std::string service_account_email, - oauth2_internal::HttpClientFactory client_factory); - - StatusOr AuthorizationHeaderForTesting( - std::chrono::system_clock::time_point tp) { - return oauth2_internal::AuthenticationHeaderJoined(*cached_, tp); - } - - std::shared_ptr impl_; - std::shared_ptr cached_; -}; - -/// @copydoc ComputeEngineCredentials -template -class ComputeEngineCredentials : public Credentials { - public: - explicit ComputeEngineCredentials() : ComputeEngineCredentials("default") {} - - explicit ComputeEngineCredentials(std::string service_account_email) - : clock_(), service_account_email_(std::move(service_account_email)) {} - - StatusOr AuthorizationHeader() override { - std::unique_lock lock(mu_); - return refreshing_creds_.AuthorizationHeader(clock_.now(), - [this] { return Refresh(); }); - } - - std::string AccountEmail() const override { - std::unique_lock lock(mu_); - // Force a refresh on the account info. - RetrieveServiceAccountInfo(); - return service_account_email_; - } - - /** - * Returns the email or alias of this credential's service account. - * - * @note This class must query the Compute Engine instance's metadata server - * to fetch service account metadata. Because of this, if an alias (e.g. - * "default") was supplied in place of an actual email address when - * initializing this credential, that alias is returned as this credential's - * email address if the credential has not been refreshed yet. - */ - std::string service_account_email() const { - std::unique_lock lock(mu_); - return service_account_email_; - } - - /** - * Returns the set of scopes granted to this credential's service account. - * - * @note Because this class must query the Compute Engine instance's metadata - * server to fetch service account metadata, this method will return an empty - * set if the credential has not been refreshed yet. - */ - std::set scopes() const { - std::unique_lock lock(mu_); - return scopes_; - } - - private: - /** - * Sends an HTTP GET request to the GCE metadata server. - * - * @see https://cloud.google.com/compute/docs/storing-retrieving-metadata for - * an overview of retrieving information from the GCE metadata server. - */ - StatusOr DoMetadataServerGetRequest( - std::string const& path, bool recursive) const { - // Allows mocking the metadata server hostname for testing. - std::string metadata_server_hostname = - google::cloud::storage::internal::GceMetadataHostname(); - - HttpRequestBuilderType builder( - "http://" + metadata_server_hostname + path, - rest_internal::GetDefaultCurlHandleFactory()); - builder.AddHeader("metadata-flavor: Google"); - if (recursive) builder.AddQueryParameter("recursive", "true"); - return std::move(builder).BuildRequest().MakeRequest(std::string{}); - } - - /** - * Fetches metadata for an instance's service account. - * - * @see - * https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances - * for more details. - */ - Status RetrieveServiceAccountInfo() const { - auto response = DoMetadataServerGetRequest( - "/computeMetadata/v1/instance/service-accounts/" + - service_account_email_ + "/", - true); - if (!response) { - return std::move(response).status(); - } - if (response->status_code >= 300) { - return AsStatus(*response); - } - - auto metadata = ParseMetadataServerResponse(*response); - if (!metadata) { - return metadata.status(); - } - service_account_email_ = std::move(metadata->email); - scopes_ = std::move(metadata->scopes); - return Status(); - } - - StatusOr Refresh() const { - auto status = RetrieveServiceAccountInfo(); - if (!status.ok()) { - return status; - } - - auto response = DoMetadataServerGetRequest( - "/computeMetadata/v1/instance/service-accounts/" + - service_account_email_ + "/token", - false); - if (!response) { - return std::move(response).status(); - } - if (response->status_code >= 300) { - return AsStatus(*response); - } - - return ParseComputeEngineRefreshResponse(*response, clock_.now()); - } - - ClockType clock_; - mutable std::mutex mu_; - RefreshingCredentialsWrapper refreshing_creds_; - mutable std::set scopes_; - mutable std::string service_account_email_; -}; - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_COMPUTE_ENGINE_CREDENTIALS_H diff --git a/google/cloud/storage/oauth2/compute_engine_credentials_test.cc b/google/cloud/storage/oauth2/compute_engine_credentials_test.cc deleted file mode 100644 index c0116adbda333..0000000000000 --- a/google/cloud/storage/oauth2/compute_engine_credentials_test.cc +++ /dev/null @@ -1,506 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/oauth2/compute_engine_credentials.h" -#include "google/cloud/storage/internal/compute_engine_util.h" -#include "google/cloud/storage/oauth2/credential_constants.h" -#include "google/cloud/storage/testing/mock_http_request.h" -#include "google/cloud/testing_util/mock_fake_clock.h" -#include "google/cloud/testing_util/mock_http_payload.h" -#include "google/cloud/testing_util/mock_rest_client.h" -#include "google/cloud/testing_util/mock_rest_response.h" -#include "google/cloud/testing_util/status_matchers.h" -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -// Define a helper to test the specialization. -struct ComputeEngineCredentialsTester { - static StatusOr Header( - ComputeEngineCredentials<>& tested, - std::chrono::system_clock::time_point tp) { - return tested.AuthorizationHeaderForTesting(tp); - } - - static ComputeEngineCredentials<> MakeComputeEngineCredentials( - std::string service_account_email, - oauth2_internal::HttpClientFactory factory) { - return ComputeEngineCredentials<>(std::move(service_account_email), - std::move(factory)); - } -}; - -namespace { - -using ::google::cloud::storage::internal::GceMetadataHostname; -using ::google::cloud::storage::internal::HttpResponse; -using ::google::cloud::storage::testing::MockHttpRequest; -using ::google::cloud::storage::testing::MockHttpRequestBuilder; -using ::google::cloud::testing_util::FakeClock; -using ::google::cloud::testing_util::IsOk; -using ::google::cloud::testing_util::IsOkAndHolds; -using ::google::cloud::testing_util::MakeMockHttpPayloadSuccess; -using ::google::cloud::testing_util::MockRestClient; -using ::google::cloud::testing_util::MockRestResponse; -using ::google::cloud::testing_util::StatusIs; -using ::testing::_; -using ::testing::ByMove; -using ::testing::HasSubstr; -using ::testing::IsEmpty; -using ::testing::Not; -using ::testing::Return; -using ::testing::StrEq; -using ::testing::UnorderedElementsAre; - -class ComputeEngineCredentialsTest : public ::testing::Test { - protected: - void SetUp() override { - MockHttpRequestBuilder::mock_ = - std::make_shared(); - } - void TearDown() override { MockHttpRequestBuilder::mock_.reset(); } -}; - -/// @test Verify that we can create and refresh ComputeEngineCredentials. -TEST_F(ComputeEngineCredentialsTest, - RefreshingSendsCorrectRequestBodyAndParsesResponse) { - std::string alias = "default"; - std::string email = "foo@bar.baz"; - std::string hostname = GceMetadataHostname(); - std::string svc_acct_info_resp = R"""({ - "email": ")""" + email + R"""(", - "scopes": ["scope1","scope2"] - })"""; - std::string token_info_resp = R"""({ - "access_token": "mysupersecrettoken", - "expires_in": 3600, - "token_type": "tokentype" - })"""; - - auto first_mock_req_impl = std::make_shared(); - EXPECT_CALL(*first_mock_req_impl, MakeRequest) - .WillOnce(Return(HttpResponse{200, svc_acct_info_resp, {}})); - auto second_mock_req_impl = std::make_shared(); - EXPECT_CALL(*second_mock_req_impl, MakeRequest) - .WillOnce(Return(HttpResponse{200, token_info_resp, {}})); - - auto mock_req_builder = MockHttpRequestBuilder::mock_; - EXPECT_CALL(*mock_req_builder, BuildRequest()) - .WillOnce([first_mock_req_impl] { - MockHttpRequest mock_request; - mock_request.mock = first_mock_req_impl; - return mock_request; - }) - .WillOnce([second_mock_req_impl] { - MockHttpRequest mock_request; - mock_request.mock = second_mock_req_impl; - return mock_request; - }); - - // Both requests add this header. - EXPECT_CALL(*mock_req_builder, AddHeader(StrEq("metadata-flavor: Google"))) - .Times(2); - EXPECT_CALL( - *mock_req_builder, - Constructor(StrEq(std::string("http://") + hostname + - "/computeMetadata/v1/instance/service-accounts/" + - email + "/token"), - _, _)) - .Times(1); - // Only the call to retrieve service account info sends this query param. - EXPECT_CALL(*mock_req_builder, - AddQueryParameter(StrEq("recursive"), StrEq("true"))) - .Times(1); - EXPECT_CALL( - *mock_req_builder, - Constructor( - StrEq(std::string("http://") + hostname + - "/computeMetadata/v1/instance/service-accounts/" + alias + "/"), - _, _)) - .Times(1); - - ComputeEngineCredentials credentials(alias); - // Calls Refresh to obtain the access token for our authorization header. - EXPECT_EQ("Authorization: tokentype mysupersecrettoken", - credentials.AuthorizationHeader().value()); - // Make sure we obtain the scopes and email from the metadata server. - EXPECT_EQ(email, credentials.service_account_email()); - EXPECT_THAT(credentials.scopes(), UnorderedElementsAre("scope1", "scope2")); -} - -/// @test Parsing a refresh response with missing fields results in failure. -TEST_F(ComputeEngineCredentialsTest, ParseComputeEngineRefreshResponseInvalid) { - std::string token_info_resp = R"""({})"""; - // Does not have access_token. - std::string token_info_resp2 = R"""({ - "expires_in": 3600, - "token_type": "tokentype" -)"""; - - FakeClock::reset_clock(1000); - auto status = ParseComputeEngineRefreshResponse( - HttpResponse{400, token_info_resp, {}}, FakeClock::now()); - EXPECT_THAT(status, - StatusIs(StatusCode::kInvalidArgument, - HasSubstr("Could not find all required fields"))); - - status = ParseComputeEngineRefreshResponse( - HttpResponse{400, token_info_resp2, {}}, FakeClock::now()); - EXPECT_THAT(status, - StatusIs(StatusCode::kInvalidArgument, - HasSubstr("Could not find all required fields"))); - - EXPECT_THAT(ParseComputeEngineRefreshResponse( - HttpResponse{400, R"js("valid-json-but-not-object")js", {}}, - FakeClock::now()), - StatusIs(StatusCode::kInvalidArgument, - HasSubstr("Could not find all required fields"))); -} - -/// @test Parsing a refresh response yields a TemporaryToken. -TEST_F(ComputeEngineCredentialsTest, ParseComputeEngineRefreshResponse) { - std::string token_info_resp = R"""({ - "access_token": "mysupersecrettoken", - "expires_in": 3600, - "token_type": "tokentype" -})"""; - - auto expires_in = 3600; - auto clock_value = 2000; - FakeClock::reset_clock(clock_value); - - auto status = ParseComputeEngineRefreshResponse( - HttpResponse{200, token_info_resp, {}}, FakeClock::now()); - EXPECT_STATUS_OK(status); - auto token = *status; - EXPECT_EQ( - std::chrono::time_point_cast(token.expiration_time) - .time_since_epoch() - .count(), - clock_value + expires_in); - EXPECT_EQ(token.token, "Authorization: tokentype mysupersecrettoken"); -} - -/// @test Parsing a metadata server response with missing fields results in -/// failure. -TEST_F(ComputeEngineCredentialsTest, ParseMetadataServerResponseInvalid) { - std::string svc_acct_info_resp1 = R"""({})"""; - std::string svc_acct_info_resp2 = R"""({"scopes": ["scope1","scope2"]})"""; - std::string svc_acct_info_resp3 = R"""({"email": "foo@bar"})"""; - std::string svc_acct_info_resp4 = - R"""({"email": "foo@bar", "scopes": "scope1\nscope2\n"})"""; - - auto status = - ParseMetadataServerResponse(HttpResponse{200, svc_acct_info_resp1, {}}); - EXPECT_THAT(status, IsOk()); - EXPECT_THAT(status->email, IsEmpty()); - EXPECT_THAT(status->scopes, IsEmpty()); - - status = - ParseMetadataServerResponse(HttpResponse{400, svc_acct_info_resp2, {}}); - EXPECT_THAT(status, IsOk()); - EXPECT_THAT(status->email, IsEmpty()); - EXPECT_THAT(status->scopes, UnorderedElementsAre("scope1", "scope2")); - - status = - ParseMetadataServerResponse(HttpResponse{400, svc_acct_info_resp3, {}}); - EXPECT_THAT(status, IsOk()); - EXPECT_THAT(status->email, "foo@bar"); - EXPECT_THAT(status->scopes, IsEmpty()); - - status = - ParseMetadataServerResponse(HttpResponse{400, svc_acct_info_resp4, {}}); - EXPECT_THAT(status, IsOk()); - EXPECT_THAT(status->email, "foo@bar"); - EXPECT_THAT(status->scopes, UnorderedElementsAre("scope1", "scope2")); - - status = ParseMetadataServerResponse( - HttpResponse{400, R"js("valid-json-but-not-an-object")js", {}}); - EXPECT_THAT(status, IsOk()); - EXPECT_THAT(status->email, IsEmpty()); - EXPECT_THAT(status->scopes, IsEmpty()); -} - -/// @test Parsing a metadata server response yields a ServiceAccountMetadata. -TEST_F(ComputeEngineCredentialsTest, ParseMetadataServerResponse) { - std::string email = "foo@bar.baz"; - std::string svc_acct_info_resp = R"""({ - "email": ")""" + email + R"""(", - "scopes": ["scope1","scope2"] - })"""; - - auto status = - ParseMetadataServerResponse(HttpResponse{200, svc_acct_info_resp, {}}); - EXPECT_STATUS_OK(status); - auto metadata = *status; - EXPECT_EQ(metadata.email, email); - EXPECT_TRUE(metadata.scopes.count("scope1")); - EXPECT_TRUE(metadata.scopes.count("scope2")); -} - -/// @test Mock a failed refresh response during RetrieveServiceAccountInfo. -TEST_F(ComputeEngineCredentialsTest, FailedRetrieveServiceAccountInfo) { - std::string alias = "default"; - std::string hostname = GceMetadataHostname(); - - auto first_mock_req_impl = std::make_shared(); - EXPECT_CALL(*first_mock_req_impl, MakeRequest) - // Fail the first call to DoMetadataServerGetRequest immediately. - .WillOnce(Return(Status(StatusCode::kAborted, "Fake Curl error"))) - // Likewise, except with a >= 300 status code. - .WillOnce(Return(HttpResponse{400, "", {}})); - - auto mock_req_builder = MockHttpRequestBuilder::mock_; - EXPECT_CALL(*mock_req_builder, BuildRequest()) - .Times(2) - .WillRepeatedly([first_mock_req_impl] { - MockHttpRequest mock_request; - mock_request.mock = first_mock_req_impl; - return mock_request; - }); - - EXPECT_CALL(*mock_req_builder, AddHeader(StrEq("metadata-flavor: Google"))) - .Times(2); - EXPECT_CALL(*mock_req_builder, - AddQueryParameter(StrEq("recursive"), StrEq("true"))) - .Times(2); - EXPECT_CALL( - *mock_req_builder, - Constructor( - StrEq(std::string("http://") + hostname + - "/computeMetadata/v1/instance/service-accounts/" + alias + "/"), - _, _)) - .Times(2); - - ComputeEngineCredentials credentials(alias); - // Response 1 - auto status = credentials.AuthorizationHeader(); - EXPECT_THAT(status, Not(IsOk())); - // Response 2 - status = credentials.AuthorizationHeader(); - EXPECT_THAT(status, Not(IsOk())); -} - -/// @test Mock a failed refresh response. -TEST_F(ComputeEngineCredentialsTest, FailedRefresh) { - std::string alias = "default"; - std::string email = "foo@bar.baz"; - std::string hostname = GceMetadataHostname(); - std::string svc_acct_info_resp = R"""({ - "email": ")""" + email + R"""(", - "scopes": ["scope1","scope2"] - })"""; - // Missing fields. - std::string token_info_resp = R"""({ - "expires_in": 3600, - "token_type": "tokentype" - })"""; - - auto mock_req = std::make_shared(); - EXPECT_CALL(*mock_req, MakeRequest) - // Fail the first call to RetrieveServiceAccountInfo immediately. - .WillOnce(Return(Status(StatusCode::kAborted, "Fake Curl error"))) - // Make the call to RetrieveServiceAccountInfo return a good response, - // but fail the token request immediately. - .WillOnce(Return(HttpResponse{200, svc_acct_info_resp, {}})) - .WillOnce(Return(Status(StatusCode::kAborted, "Fake Curl error"))) - // Likewise, except test with a >= 300 status code. - .WillOnce(Return(HttpResponse{200, svc_acct_info_resp, {}})) - .WillOnce(Return(HttpResponse{400, "", {}})) - // Parse with an invalid token response. - .WillOnce(Return(HttpResponse{200, svc_acct_info_resp, {}})) - .WillOnce(Return(HttpResponse{1, token_info_resp, {}})); - - auto mock_req_builder = MockHttpRequestBuilder::mock_; - auto mock_matcher = [mock_req] { - MockHttpRequest mock_request; - mock_request.mock = mock_req; - return mock_request; - }; - EXPECT_CALL(*mock_req_builder, BuildRequest()) - .Times(7) - .WillRepeatedly(mock_matcher); - - // This is added for all 7 requests. - EXPECT_CALL(*mock_req_builder, AddHeader(StrEq("metadata-flavor: Google"))) - .Times(7); - // These requests happen after RetrieveServiceAccountInfo, so they only - // occur 3 times. - EXPECT_CALL( - *mock_req_builder, - Constructor(StrEq(std::string("http://") + hostname + - "/computeMetadata/v1/instance/service-accounts/" + - email + "/token"), - _, _)) - .Times(3); - // This is only set when not retrieving the token. - EXPECT_CALL(*mock_req_builder, - AddQueryParameter(StrEq("recursive"), StrEq("true"))) - .Times(4); - // For the first expected failures, the alias is used until the metadata - // request succeeds. Then the email is refreshed. - EXPECT_CALL( - *mock_req_builder, - Constructor( - StrEq(std::string("http://") + hostname + - "/computeMetadata/v1/instance/service-accounts/" + alias + "/"), - _, _)) - .Times(2); - EXPECT_CALL( - *mock_req_builder, - Constructor( - StrEq(std::string("http://") + hostname + - "/computeMetadata/v1/instance/service-accounts/" + email + "/"), - _, _)) - .Times(2); - - ComputeEngineCredentials credentials(alias); - // Response 1 - auto status = credentials.AuthorizationHeader(); - EXPECT_THAT(status, StatusIs(StatusCode::kAborted)); - // Response 2 - status = credentials.AuthorizationHeader(); - EXPECT_THAT(status, Not(IsOk())); - // Response 3 - status = credentials.AuthorizationHeader(); - EXPECT_THAT(status, Not(IsOk())); - // Response 4 - status = credentials.AuthorizationHeader(); - EXPECT_THAT(status, - StatusIs(Not(StatusCode::kOk), - HasSubstr("Could not find all required fields"))); -} - -/// @test Verify that we can force a refresh of the service account email. -TEST_F(ComputeEngineCredentialsTest, AccountEmail) { - std::string alias = "default"; - std::string email = "foo@bar.baz"; - std::string hostname = GceMetadataHostname(); - std::string svc_acct_info_resp = R"""({ - "email": ")""" + email + R"""(", - "scopes": ["scope1","scope2"] - })"""; - - auto first_mock_req_impl = std::make_shared(); - EXPECT_CALL(*first_mock_req_impl, MakeRequest) - .WillOnce(Return(HttpResponse{200, svc_acct_info_resp, {}})); - - auto mock_req_builder = MockHttpRequestBuilder::mock_; - EXPECT_CALL(*mock_req_builder, BuildRequest()) - .WillOnce([first_mock_req_impl] { - MockHttpRequest mock_request; - mock_request.mock = first_mock_req_impl; - return mock_request; - }); - - // Both requests add this header. - EXPECT_CALL(*mock_req_builder, AddHeader(StrEq("metadata-flavor: Google"))) - .Times(1); - // Only the call to retrieve service account info sends this query param. - EXPECT_CALL(*mock_req_builder, - AddQueryParameter(StrEq("recursive"), StrEq("true"))) - .Times(1); - EXPECT_CALL( - *mock_req_builder, - Constructor( - StrEq(std::string("http://") + hostname + - "/computeMetadata/v1/instance/service-accounts/" + alias + "/"), - _, _)) - .Times(1); - - ComputeEngineCredentials credentials(alias); - EXPECT_EQ(credentials.service_account_email(), alias); - auto refreshed_email = credentials.AccountEmail(); - EXPECT_EQ(email, refreshed_email); - EXPECT_EQ(credentials.service_account_email(), refreshed_email); -} - -TEST_F(ComputeEngineCredentialsTest, Caching) { - // We need to mock the Compute Engine Metadata Service or this would be an - // integration test that only runs on GCE. - auto make_mock_client = [](std::string const& payload) { - auto response = std::make_unique(); - EXPECT_CALL(*response, StatusCode) - .WillRepeatedly( - Return(google::cloud::rest_internal::HttpStatusCode::kOk)); - EXPECT_CALL(std::move(*response), ExtractPayload) - .WillOnce(Return(ByMove(MakeMockHttpPayloadSuccess(payload)))); - auto mock = std::make_unique(); - EXPECT_CALL(*mock, Get) - .WillOnce(Return(ByMove(std::unique_ptr( - std::move(response))))); - return std::unique_ptr(std::move(mock)); - }; - - // We expect a call to the metadata service to get the service account - // metadata. Then one call to get the token (which is cached), and finally a - // call the refresh the token. - auto constexpr kPayload0 = - R"""({"email": "test-only-email", "scopes": ["s1", "s2]})"""; - auto constexpr kPayload1 = R"""({ - "access_token": "test-token-1", - "expires_in": 3600, - "token_type": "tokentype" - })"""; - auto constexpr kPayload2 = R"""({ - "access_token": "test-token-2", - "expires_in": 3600, - "token_type": "tokentype" - })"""; - - using MockHttpClientFactory = - ::testing::MockFunction( - Options const&)>; - MockHttpClientFactory mock_factory; - EXPECT_CALL(mock_factory, Call) - .WillOnce(Return(ByMove(make_mock_client(kPayload0)))) - .WillOnce(Return(ByMove(make_mock_client(kPayload1)))) - .WillOnce(Return(ByMove(make_mock_client(kPayload2)))); - - auto tested = ComputeEngineCredentialsTester::MakeComputeEngineCredentials( - "test-only", mock_factory.AsStdFunction()); - auto const tp = std::chrono::system_clock::now(); - auto initial = ComputeEngineCredentialsTester::Header(tested, tp); - ASSERT_STATUS_OK(initial); - - auto cached = ComputeEngineCredentialsTester::Header( - tested, tp + std::chrono::seconds(30)); - EXPECT_THAT(cached, IsOkAndHolds(*initial)); - - cached = ComputeEngineCredentialsTester::Header( - tested, tp + std::chrono::seconds(300)); - EXPECT_THAT(cached, IsOkAndHolds(*initial)); - - auto uncached = ComputeEngineCredentialsTester::Header( - tested, tp + std::chrono::hours(2)); - ASSERT_STATUS_OK(uncached); - EXPECT_NE(*initial, *uncached); -} - -} // namespace -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/oauth2/credential_constants.h b/google/cloud/storage/oauth2/credential_constants.h deleted file mode 100644 index a26831ed4cd81..0000000000000 --- a/google/cloud/storage/oauth2/credential_constants.h +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_OAUTH2_CREDENTIAL_CONSTANTS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_CREDENTIAL_CONSTANTS_H - -#include "google/cloud/storage/version.h" -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -/** - * Supported signing algorithms used in JWT auth flows. - * - * We currently only support RSA with SHA-256, but use this enum for - * readability and easy addition of support for other algorithms. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -// NOLINTNEXTLINE(readability-identifier-naming) -enum class JwtSigningAlgorithms { RS256 }; - -/** - * The max lifetime in seconds of an access token. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -constexpr std::chrono::seconds GoogleOAuthAccessTokenLifetime() { - return std::chrono::seconds(3600); -} - -/** - * Returns the slack to consider when checking if an access token is expired. - * - * This time should be subtracted from a token's expiration time when checking - * if it is expired. This prevents race conditions where, for example, one might - * check expiration time one second before the expiration, see that the token is - * still valid, then attempt to use it two seconds later and receive an - * error. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -constexpr std::chrono::seconds GoogleOAuthAccessTokenExpirationSlack() { - return std::chrono::seconds(300); -} - -/** - * The endpoint to fetch an OAuth 2.0 access token from. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -inline char const* GoogleOAuthRefreshEndpoint() { - static constexpr char kEndpoint[] = "https://oauth2.googleapis.com/token"; - return kEndpoint; -} - -/** - * String representing the "cloud-platform" OAuth 2.0 scope. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -inline char const* GoogleOAuthScopeCloudPlatform() { - static constexpr char kScope[] = - "https://www.googleapis.com/auth/cloud-platform"; - return kScope; -} - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_CREDENTIAL_CONSTANTS_H diff --git a/google/cloud/storage/oauth2/credentials.cc b/google/cloud/storage/oauth2/credentials.cc deleted file mode 100644 index a2ce6d3a0629c..0000000000000 --- a/google/cloud/storage/oauth2/credentials.cc +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/oauth2/credentials.h" -#include "google/cloud/internal/make_status.h" -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -StatusOr> Credentials::SignBlob( - SigningAccount const&, std::string const&) const { - return google::cloud::internal::UnimplementedError( - "The current credentials cannot sign blobs locally", GCP_ERROR_INFO()); -} - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/oauth2/credentials.h b/google/cloud/storage/oauth2/credentials.h deleted file mode 100644 index 962dbc0ce8e3e..0000000000000 --- a/google/cloud/storage/oauth2/credentials.h +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_OAUTH2_CREDENTIALS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_CREDENTIALS_H - -#include "google/cloud/storage/signed_url_options.h" -#include "google/cloud/storage/version.h" -#include "google/cloud/status.h" -#include "google/cloud/status_or.h" -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -/** - * Authentication components for Google Cloud Storage. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -namespace oauth2 { - -/** - * Interface for OAuth 2.0 credentials used to access Google Cloud services. - * - * Instantiating a specific kind of `Credentials` should usually be done via the - * convenience methods declared in google_credentials.h. - * - * @see https://cloud.google.com/docs/authentication/ for an overview of - * authenticating to Google Cloud Platform APIs. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -class Credentials { - public: - virtual ~Credentials() = default; - - /** - * Attempts to obtain a value for the Authorization HTTP header. - * - * If unable to obtain a value for the Authorization 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 Authorization - * header to be used in HTTP requests. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ - virtual StatusOr AuthorizationHeader() = 0; - - /** - * Try to sign @p string_to_sign using @p service_account. - * - * Some %Credentials types can locally sign a blob, most often just on behalf - * of an specific service account. This function returns an error if the - * credentials cannot sign the blob at all, or if the service account is a - * mismatch. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ - virtual StatusOr> SignBlob( - SigningAccount const& service_account, - std::string const& string_to_sign) const; - - /** - * Return the account's email associated with these credentials, if any. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ - virtual std::string AccountEmail() const { return std::string{}; } - - /** - * Return the account's key_id associated with these credentials, if any. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ - virtual std::string KeyId() const { return std::string{}; } -}; - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_CREDENTIALS_H diff --git a/google/cloud/storage/oauth2/google_application_default_credentials_file.cc b/google/cloud/storage/oauth2/google_application_default_credentials_file.cc deleted file mode 100644 index 2cf03f61b76c5..0000000000000 --- a/google/cloud/storage/oauth2/google_application_default_credentials_file.cc +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/oauth2/google_application_default_credentials_file.h" -#include "google/cloud/internal/oauth2_google_application_default_credentials_file.h" - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -char const* GoogleAdcEnvVar() { - return google::cloud::oauth2_internal::GoogleAdcEnvVar(); -} - -std::string GoogleAdcFilePathFromEnvVarOrEmpty() { - return oauth2_internal::GoogleAdcFilePathFromEnvVarOrEmpty(); -} - -std::string GoogleAdcFilePathFromWellKnownPathOrEmpty() { - return oauth2_internal::GoogleAdcFilePathFromWellKnownPathOrEmpty(); -} - -char const* GoogleGcloudAdcFileEnvVar() { - return google::cloud::oauth2_internal::GoogleGcloudAdcFileEnvVar(); -} - -char const* GoogleAdcHomeEnvVar() { - return google::cloud::oauth2_internal::GoogleAdcHomeEnvVar(); -} - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/oauth2/google_application_default_credentials_file.h b/google/cloud/storage/oauth2/google_application_default_credentials_file.h deleted file mode 100644 index 0b3f903e01e14..0000000000000 --- a/google/cloud/storage/oauth2/google_application_default_credentials_file.h +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_OAUTH2_GOOGLE_APPLICATION_DEFAULT_CREDENTIALS_FILE_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_GOOGLE_APPLICATION_DEFAULT_CREDENTIALS_FILE_H - -#include "google/cloud/storage/version.h" -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -/** - * Returns the Application Default %Credentials environment variable name. - * - * This environment variable should be checked for a valid file path when - * attempting to load Google Application Default %Credentials. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -char const* GoogleAdcEnvVar(); - -/** - * Returns the path to the Application Default %Credentials file, if set. - * - * If the Application Default %Credentials environment variable is set, we check - * the path specified by its value for a file containing ADCs. Returns an - * empty string if no such path exists or the environment variable is not set. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -std::string GoogleAdcFilePathFromEnvVarOrEmpty(); - -/** - * Returns the path to the Application Default %Credentials file, if set. - * - * If the gcloud utility has configured an Application Default %Credentials - * file, the path to that file is returned. Returns an empty string if no such - * file exists at the well known path. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -std::string GoogleAdcFilePathFromWellKnownPathOrEmpty(); - -/** - * Returns the environment variable to override the gcloud ADC path. - * - * This environment variable is used for testing to override the path that - * should be searched for the gcloud Application Default %Credentials file. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -char const* GoogleGcloudAdcFileEnvVar(); - -/** - * Returns the environment variable used to construct the well known ADC path. - * - * The directory containing a user's application configuration data, indicated - * by this environment variable, varies across environments. That directory is - * used when constructing the well known path of the Application Default - * Credentials file. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -char const* GoogleAdcHomeEnvVar(); - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_GOOGLE_APPLICATION_DEFAULT_CREDENTIALS_FILE_H diff --git a/google/cloud/storage/oauth2/google_application_default_credentials_file_test.cc b/google/cloud/storage/oauth2/google_application_default_credentials_file_test.cc deleted file mode 100644 index 02f01a7ba2f36..0000000000000 --- a/google/cloud/storage/oauth2/google_application_default_credentials_file_test.cc +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_application_default_credentials_file.h" -#include "google/cloud/testing_util/scoped_environment.h" -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { -namespace { - -using ::google::cloud::testing_util::ScopedEnvironment; -using ::testing::HasSubstr; - -class DefaultServiceAccountFileTest : public ::testing::Test { - public: - DefaultServiceAccountFileTest() - : home_env_var_(GoogleAdcHomeEnvVar(), {}), - adc_env_var_(GoogleAdcEnvVar(), {}), - gcloud_path_override_env_var_(GoogleGcloudAdcFileEnvVar(), {}) {} - - protected: - ScopedEnvironment home_env_var_; - ScopedEnvironment adc_env_var_; - ScopedEnvironment gcloud_path_override_env_var_; -}; - -/// @test Verify that the specified path is given when the ADC env var is set. -TEST_F(DefaultServiceAccountFileTest, AdcEnvironmentVariableSet) { - ScopedEnvironment adc_env_var(GoogleAdcEnvVar(), "/foo/bar/baz"); - EXPECT_EQ("/foo/bar/baz", GoogleAdcFilePathFromEnvVarOrEmpty()); -} - -/// @test Verify that an empty string is given when the ADC env var is unset. -TEST_F(DefaultServiceAccountFileTest, AdcEnvironmentVariableNotSet) { - EXPECT_EQ(GoogleAdcFilePathFromEnvVarOrEmpty(), ""); -} - -/// @test Verify that the gcloud ADC file path can be overridden for testing. -TEST_F(DefaultServiceAccountFileTest, GcloudAdcPathOverrideViaEnvVar) { - ScopedEnvironment gcloud_path_override_env_var(GoogleGcloudAdcFileEnvVar(), - "/foo/bar/baz"); - EXPECT_EQ(GoogleAdcFilePathFromWellKnownPathOrEmpty(), "/foo/bar/baz"); -} - -/// @test Verify that the gcloud ADC file path is given when HOME is set. -TEST_F(DefaultServiceAccountFileTest, HomeSet) { - ScopedEnvironment home_env_var(GoogleAdcHomeEnvVar(), "/foo/bar/baz"); - - auto actual = GoogleAdcFilePathFromWellKnownPathOrEmpty(); - - EXPECT_THAT(actual, HasSubstr("/foo/bar/baz")); - // The rest of the path differs depending on the OS; just make sure that we - // appended this suffix of the path to the path prefix set above. - EXPECT_THAT(actual, HasSubstr("gcloud/application_default_credentials.json")); -} - -/// @test Verify that the gcloud ADC file path is not given when HOME is unset. -TEST_F(DefaultServiceAccountFileTest, HomeNotSet) { - EXPECT_EQ(GoogleAdcFilePathFromWellKnownPathOrEmpty(), ""); -} - -} // namespace -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/oauth2/google_credentials.cc b/google/cloud/storage/oauth2/google_credentials.cc deleted file mode 100644 index 31f384f7543e2..0000000000000 --- a/google/cloud/storage/oauth2/google_credentials.cc +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/oauth2/google_credentials.h" -#include "google/cloud/storage/internal/make_jwt_assertion.h" -#include "google/cloud/storage/oauth2/anonymous_credentials.h" -#include "google/cloud/storage/oauth2/authorized_user_credentials.h" -#include "google/cloud/storage/oauth2/compute_engine_credentials.h" -#include "google/cloud/storage/oauth2/google_application_default_credentials_file.h" -#include "google/cloud/storage/oauth2/service_account_credentials.h" -#include "google/cloud/internal/filesystem.h" -#include "google/cloud/internal/make_status.h" -#include "google/cloud/internal/throw_delegate.h" -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -char constexpr kAdcLink[] = - "https://developers.google.com/identity/protocols/" - "application-default-credentials"; - -// Parses the JSON or P12 file at `path` and creates the appropriate -// Credentials type. -// -// If `service_account_scopes` or `service_account_subject` are specified, the -// file at `path` must be a P12 service account or a JSON service account. If -// a different type of credential file is found, this function returns -// nullptr to indicate a service account file wasn't found. -StatusOr> LoadCredsFromPath( - std::string const& path, bool non_service_account_ok, - absl::optional> service_account_scopes, - absl::optional service_account_subject, - ChannelOptions const& options) { - std::ifstream ifs(path); - if (!ifs.is_open()) { - // We use kUnknown here because we don't know if the file does not exist, or - // if we were unable to open it for some other reason. - return google::cloud::internal::UnknownError( - "Cannot open credentials file " + path, GCP_ERROR_INFO()); - } - std::string contents(std::istreambuf_iterator{ifs}, {}); - auto cred_json = nlohmann::json::parse(contents, nullptr, false); - if (!cred_json.is_object()) { - // This is not a JSON file, try to load it as a P12 service account. - auto info = ParseServiceAccountP12File(path); - if (!info) return std::move(info).status(); - info->subject = std::move(service_account_subject); - info->scopes = std::move(service_account_scopes); - auto credentials = std::make_unique>(*info); - return std::unique_ptr(std::move(credentials)); - } - std::string cred_type = cred_json.value("type", "no type given"); - // If non_service_account_ok==false and the cred_type is authorized_user, - // we'll return "Unsupported credential type (authorized_user)". - if (cred_type == "authorized_user" && non_service_account_ok) { - if (service_account_scopes || service_account_subject) { - // No ptr indicates that the file we found was not a service account file. - return StatusOr>(nullptr); - } - auto info = ParseAuthorizedUserCredentials(contents, path); - if (!info) { - return info.status(); - } - std::unique_ptr ptr = - std::make_unique>(*info); - return StatusOr>(std::move(ptr)); - } - if (cred_type == "service_account") { - auto info = ParseServiceAccountCredentials(contents, path); - if (!info) { - return info.status(); - } - info->subject = std::move(service_account_subject); - info->scopes = std::move(service_account_scopes); - std::unique_ptr ptr = - std::make_unique>(*info, options); - return StatusOr>(std::move(ptr)); - } - return google::cloud::internal::InvalidArgumentError( - "Unsupported credential type (" + cred_type + - ") when reading Application Default Credentials file from " + path + - ".", - GCP_ERROR_INFO()); -} - -// Tries to load the file at the path specified by the value of the Application -// Default %Credentials environment variable and to create the appropriate -// Credentials type. -// -// Returns nullptr if the environment variable is not set or the path does not -// exist. -// -// If `service_account_scopes` or `service_account_subject` are specified, the -// found file must be a P12 service account or a JSON service account. If a -// different type of credential file is found, this function returns nullptr -// to indicate a service account file wasn't found. -StatusOr> MaybeLoadCredsFromAdcPaths( - bool non_service_account_ok, - absl::optional> service_account_scopes, - absl::optional service_account_subject, - ChannelOptions const& options = {}) { - // 1) Check if the GOOGLE_APPLICATION_CREDENTIALS environment variable is set. - auto path = GoogleAdcFilePathFromEnvVarOrEmpty(); - if (path.empty()) { - // 2) If no path was specified via environment variable, check if the - // gcloud ADC file exists. - path = GoogleAdcFilePathFromWellKnownPathOrEmpty(); - if (path.empty()) { - return StatusOr>(nullptr); - } - // Just because we had the necessary information to build the path doesn't - // mean that a file exists there. - std::error_code ec; - auto adc_file_status = google::cloud::internal::status(path, ec); - if (!google::cloud::internal::exists(adc_file_status)) { - return StatusOr>(nullptr); - } - } - - // If the path was specified, try to load that file; explicitly fail if it - // doesn't exist or can't be read and parsed. - return LoadCredsFromPath(path, non_service_account_ok, - std::move(service_account_scopes), - std::move(service_account_subject), options); -} - -StatusOr> GoogleDefaultCredentials( - ChannelOptions const& options) { - // 1 and 2) Check if the GOOGLE_APPLICATION_CREDENTIALS environment variable - // is set or if the gcloud ADC file exists. - auto creds = MaybeLoadCredsFromAdcPaths(true, {}, {}, options); - if (!creds) { - return StatusOr>(creds.status()); - } - if (*creds) { - return StatusOr>(std::move(*creds)); - } - - // 3) Use the implicit environment-based credentials (GCE, GAE Flexible, - // Cloud Run or GKE Environment). - return StatusOr>( - std::make_shared>()); -} - -std::shared_ptr CreateAnonymousCredentials() { - return std::make_shared(); -} - -StatusOr> -CreateAuthorizedUserCredentialsFromJsonFilePath(std::string const& path) { - std::ifstream is(path); - std::string contents(std::istreambuf_iterator{is}, {}); - auto info = ParseAuthorizedUserCredentials(contents, path); - if (!info) { - return StatusOr>(info.status()); - } - return StatusOr>( - std::make_shared>(*info)); -} - -StatusOr> -CreateAuthorizedUserCredentialsFromJsonContents(std::string const& contents, - ChannelOptions const& options) { - auto info = ParseAuthorizedUserCredentials(contents, "memory"); - if (!info) { - return StatusOr>(info.status()); - } - return StatusOr>( - std::make_shared>(*info, options)); -} - -StatusOr> -CreateServiceAccountCredentialsFromFilePath(std::string const& path) { - return CreateServiceAccountCredentialsFromFilePath(path, {}, {}); -} - -StatusOr> -CreateServiceAccountCredentialsFromFilePath( - std::string const& path, absl::optional> scopes, - absl::optional subject) { - auto credentials = - CreateServiceAccountCredentialsFromJsonFilePath(path, scopes, subject); - if (credentials) { - return credentials; - } - return CreateServiceAccountCredentialsFromP12FilePath(path, std::move(scopes), - std::move(subject)); -} - -StatusOr> -CreateServiceAccountCredentialsFromJsonFilePath(std::string const& path) { - return CreateServiceAccountCredentialsFromJsonFilePath(path, {}, {}); -} - -StatusOr> -CreateServiceAccountCredentialsFromJsonFilePath( - std::string const& path, absl::optional> scopes, - absl::optional subject, ChannelOptions const& options) { - std::ifstream is(path); - std::string contents(std::istreambuf_iterator{is}, {}); - auto info = ParseServiceAccountCredentials(contents, path); - if (!info) { - return StatusOr>(info.status()); - } - // These are supplied as extra parameters to this method, not in the JSON - // file. - info->subject = std::move(subject); - info->scopes = std::move(scopes); - return StatusOr>( - std::make_shared>(*info, options)); -} - -StatusOr> -CreateServiceAccountCredentialsFromP12FilePath( - std::string const& path, absl::optional> scopes, - absl::optional subject, ChannelOptions const& options) { - auto info = ParseServiceAccountP12File(path); - if (!info) { - return StatusOr>(info.status()); - } - // These are supplied as extra parameters to this method, not in the P12 - // file. - info->subject = std::move(subject); - info->scopes = std::move(scopes); - return StatusOr>( - std::make_shared>(*info, options)); -} - -StatusOr> -CreateServiceAccountCredentialsFromP12FilePath(std::string const& path) { - return CreateServiceAccountCredentialsFromP12FilePath(path, {}, {}); -} - -StatusOr> -CreateServiceAccountCredentialsFromDefaultPaths(ChannelOptions const& options) { - return CreateServiceAccountCredentialsFromDefaultPaths({}, {}, options); -} - -StatusOr> -CreateServiceAccountCredentialsFromDefaultPaths( - absl::optional> scopes, - absl::optional subject, ChannelOptions const& options) { - auto creds = MaybeLoadCredsFromAdcPaths(false, std::move(scopes), - std::move(subject), options); - if (!creds) { - return StatusOr>(creds.status()); - } - if (*creds) { - return StatusOr>(std::move(*creds)); - } - - // We've exhausted all search points, thus credentials cannot be constructed. - return google::cloud::internal::UnknownError( - "Could not create service account credentials using Application" - "Default Credentials paths. For more information, please see " + - std::string(kAdcLink), - GCP_ERROR_INFO()); -} - -StatusOr> -CreateServiceAccountCredentialsFromJsonContents(std::string const& contents, - ChannelOptions const& options) { - return CreateServiceAccountCredentialsFromJsonContents(contents, {}, {}, - options); -} - -StatusOr> -CreateServiceAccountCredentialsFromJsonContents( - std::string const& contents, absl::optional> scopes, - absl::optional subject, ChannelOptions const& options) { - auto info = ParseServiceAccountCredentials(contents, "memory"); - if (!info) { - return StatusOr>(info.status()); - } - std::chrono::system_clock::time_point now; - auto components = AssertionComponentsFromInfo(*info, now); - auto jwt_assertion = internal::MakeJWTAssertionNoThrow( - components.first, components.second, info->private_key); - if (!jwt_assertion) return std::move(jwt_assertion).status(); - - // These are supplied as extra parameters to this method, not in the JSON - // file. - info->subject = std::move(subject); - info->scopes = std::move(scopes); - return StatusOr>( - std::make_shared>(*info, options)); -} - -std::shared_ptr CreateComputeEngineCredentials() { - return std::make_shared>(); -} - -std::shared_ptr CreateComputeEngineCredentials( - std::string const& service_account_email) { - return std::make_shared>(service_account_email); -} - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/oauth2/google_credentials.h b/google/cloud/storage/oauth2/google_credentials.h deleted file mode 100644 index 11c81abdcd717..0000000000000 --- a/google/cloud/storage/oauth2/google_credentials.h +++ /dev/null @@ -1,332 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_OAUTH2_GOOGLE_CREDENTIALS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_GOOGLE_CREDENTIALS_H - -#include "google/cloud/storage/client_options.h" -#include "google/cloud/storage/oauth2/credentials.h" -#include "google/cloud/storage/version.h" -#include "google/cloud/optional.h" -#include "absl/types/optional.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -/** - * Produces a Credentials type based on the runtime environment. - * - * If the GOOGLE_APPLICATION_CREDENTIALS environment variable is set, the JSON - * file it points to will be loaded and used to create a credential of the - * specified type. Otherwise, if running on a Google-hosted environment (e.g. - * Compute Engine), credentials for the environment's default service - * account will be used. - * - * @see https://cloud.google.com/docs/authentication/production for details - * about Application Default %Credentials. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr> GoogleDefaultCredentials( - ChannelOptions const& options = {}); - -///@{ -/** - * @name Functions to manually create specific credential types. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ - -/** - * Creates an AnonymousCredentials. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -std::shared_ptr CreateAnonymousCredentials(); - -/** - * Creates an AuthorizedUserCredentials from a JSON file at the specified path. - * - * @note It is strongly preferred to instead use service account credentials - * with Cloud Storage client libraries. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr> -CreateAuthorizedUserCredentialsFromJsonFilePath(std::string const& path); - -/** - * Creates an AuthorizedUserCredentials from a JSON string. - * - * @note It is strongly preferred to instead use service account credentials - * with Cloud Storage client libraries. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr> -CreateAuthorizedUserCredentialsFromJsonContents( - std::string const& contents, ChannelOptions const& options = {}); - -///@{ -/** - * @name Load service account key files. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ - -/** - * Creates a ServiceAccountCredentials from a file at the specified path. - * - * @note This function automatically detects if the file is a JSON or P12 (aka - * PFX aka PKCS#12) file and tries to load the file as a service account - * credential. We strongly recommend that applications use JSON files for - * service account key files. - * - * These credentials use the cloud-platform OAuth 2.0 scope, defined by - * `GoogleOAuthScopeCloudPlatform()`. To specify alternate scopes, use the - * overloaded version of this function. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr> -CreateServiceAccountCredentialsFromFilePath(std::string const& path); - -/** - * Creates a ServiceAccountCredentials from a file at the specified path. - * - * @note This function automatically detects if the file is a JSON or P12 (aka - * PFX aka PKCS#12) file and tries to load the file as a service account - * credential. We strongly recommend that applications use JSON files for - * service account key files. - * - * @param path the path to the file containing service account JSON credentials. - * @param scopes the scopes to request during the authorization grant. If - * omitted, the cloud-platform scope, defined by - * `GoogleOAuthScopeCloudPlatform()`, is used as a default. - * @param subject for domain-wide delegation; the email address of the user for - * which to request delegated access. If omitted, no "subject" attribute is - * included in the authorization grant. - * - * @see https://developers.google.com/identity/protocols/googlescopes for a list - * of OAuth 2.0 scopes used with Google APIs. - * - * @see https://developers.google.com/identity/protocols/OAuth2ServiceAccount - * for more information about domain-wide delegation. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr> -CreateServiceAccountCredentialsFromFilePath( - std::string const& path, absl::optional> scopes, - absl::optional subject); - -/** - * Creates a ServiceAccountCredentials from a JSON file at the specified path. - * - * These credentials use the cloud-platform OAuth 2.0 scope, defined by - * `GoogleOAuthScopeCloudPlatform()`. To specify alternate scopes, use the - * overloaded version of this function. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr> -CreateServiceAccountCredentialsFromJsonFilePath(std::string const& path); - -/** - * Creates a ServiceAccountCredentials from a JSON file at the specified path. - * - * @param path the path to the file containing service account JSON credentials. - * @param scopes the scopes to request during the authorization grant. If - * omitted, the cloud-platform scope, defined by - * `GoogleOAuthScopeCloudPlatform()`, is used as a default. - * @param subject for domain-wide delegation; the email address of the user for - * which to request delegated access. If omitted, no "subject" attribute is - * included in the authorization grant. - * @param options any configuration needed for the transport channel to - * Google's authentication servers. - * - * @see https://developers.google.com/identity/protocols/googlescopes for a list - * of OAuth 2.0 scopes used with Google APIs. - * - * @see https://developers.google.com/identity/protocols/OAuth2ServiceAccount - * for more information about domain-wide delegation. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr> -CreateServiceAccountCredentialsFromJsonFilePath( - std::string const& path, absl::optional> scopes, - absl::optional subject, ChannelOptions const& options = {}); - -/** - * Creates a ServiceAccountCredentials from a P12 file at the specified path. - * - * These credentials use the cloud-platform OAuth 2.0 scope, defined by - * `GoogleOAuthScopeCloudPlatform()`. To specify alternate scopes, use the - * overloaded version of this function. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr> -CreateServiceAccountCredentialsFromP12FilePath(std::string const& path); - -/** - * Creates a ServiceAccountCredentials from a P12 file at the specified path. - * - * @param path the path to the file containing service account JSON credentials. - * @param scopes the scopes to request during the authorization grant. If - * omitted, the cloud-platform scope, defined by - * `GoogleOAuthScopeCloudPlatform()`, is used as a default. - * @param subject for domain-wide delegation; the email address of the user for - * which to request delegated access. If omitted, no "subject" attribute is - * included in the authorization grant. - * @param options any configuration needed for the transport channel to - * Google's authentication servers. - * - * @see https://developers.google.com/identity/protocols/googlescopes for a list - * of OAuth 2.0 scopes used with Google APIs. - * - * @see https://developers.google.com/identity/protocols/OAuth2ServiceAccount - * for more information about domain-wide delegation. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr> -CreateServiceAccountCredentialsFromP12FilePath( - std::string const& path, absl::optional> scopes, - absl::optional subject, ChannelOptions const& options = {}); -///@} - -/** - * Produces a ServiceAccountCredentials type by trying to load the standard - * Application Default %Credentials paths. - * - * If the GOOGLE_APPLICATION_CREDENTIALS environment variable is set, the JSON - * or P12 file it points to will be loaded. Otherwise, if the gcloud utility - * has configured an Application Default %Credentials file, that file is - * loaded. The loaded file is used to create a ServiceAccountCredentials. - * - * @param options any configuration needed for the transport channel to - * Google's authentication servers. - * - * @see https://cloud.google.com/docs/authentication/production for details - * about Application Default %Credentials. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr> -CreateServiceAccountCredentialsFromDefaultPaths( - ChannelOptions const& options = {}); - -/** - * Produces a ServiceAccountCredentials type by trying to load the standard - * Application Default %Credentials paths. - * - * If the GOOGLE_APPLICATION_CREDENTIALS environment variable is set, the JSON - * or P12 file it points to will be loaded. Otherwise, if the gcloud utility - * has configured an Application Default %Credentials file, that file is - * loaded. The loaded file is used to create a ServiceAccountCredentials. - * - * @param scopes the scopes to request during the authorization grant. If - * omitted, the cloud-platform scope, defined by - * `GoogleOAuthScopeCloudPlatform()`, is used as a default. - * @param subject for domain-wide delegation; the email address of the user for - * which to request delegated access. If omitted, no "subject" attribute is - * included in the authorization grant. - * @param options any configuration needed for the transport channel to - * Google's authentication servers. - * - * @see https://developers.google.com/identity/protocols/googlescopes for a list - * of OAuth 2.0 scopes used with Google APIs. - * - * @see https://cloud.google.com/docs/authentication/production for details - * about Application Default %Credentials. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr> -CreateServiceAccountCredentialsFromDefaultPaths( - absl::optional> scopes, - absl::optional subject, ChannelOptions const& options = {}); - -/** - * Creates a ServiceAccountCredentials from a JSON string. - * - * These credentials use the cloud-platform OAuth 2.0 scope, defined by - * `GoogleOAuthScopeCloudPlatform()`. To specify an alternate set of scopes, use - * the overloaded version of this function. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr> -CreateServiceAccountCredentialsFromJsonContents( - std::string const& contents, ChannelOptions const& options = {}); - -/** - * Creates a ServiceAccountCredentials from a JSON string. - * - * @param contents the string containing the JSON contents of a service account - * credentials file. - * @param scopes the scopes to request during the authorization grant. If - * omitted, the cloud-platform scope, defined by - * `GoogleOAuthScopeCloudPlatform()`, is used as a default. - * @param subject for domain-wide delegation; the email address of the user for - * which to request delegated access. If omitted, no "subject" attribute is - * included in the authorization grant. - * @param options any configuration needed for the transport channel to - * Google's authentication servers. - * - * @see https://developers.google.com/identity/protocols/googlescopes for a list - * of OAuth 2.0 scopes used with Google APIs. - * - * @see https://developers.google.com/identity/protocols/OAuth2ServiceAccount - * for more information about domain-wide delegation. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr> -CreateServiceAccountCredentialsFromJsonContents( - std::string const& contents, absl::optional> scopes, - absl::optional subject, ChannelOptions const& options = {}); - -/** - * Creates a ComputeEngineCredentials for the VM's default service account. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -std::shared_ptr CreateComputeEngineCredentials(); - -/** - * Creates a ComputeEngineCredentials for the VM's specified service account. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -std::shared_ptr CreateComputeEngineCredentials( - std::string const& service_account_email); - -///@} - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_GOOGLE_CREDENTIALS_H diff --git a/google/cloud/storage/oauth2/google_credentials_test.cc b/google/cloud/storage/oauth2/google_credentials_test.cc deleted file mode 100644 index 909fba2e3df7e..0000000000000 --- a/google/cloud/storage/oauth2/google_credentials_test.cc +++ /dev/null @@ -1,562 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/oauth2/google_credentials.h" -#include "google/cloud/storage/internal/compute_engine_util.h" -#include "google/cloud/storage/oauth2/anonymous_credentials.h" -#include "google/cloud/storage/oauth2/authorized_user_credentials.h" -#include "google/cloud/storage/oauth2/compute_engine_credentials.h" -#include "google/cloud/storage/oauth2/google_application_default_credentials_file.h" -#include "google/cloud/storage/oauth2/service_account_credentials.h" -#include "google/cloud/storage/testing/constants.h" -#include "google/cloud/storage/testing/write_base64.h" -#include "google/cloud/internal/filesystem.h" -#include "google/cloud/testing_util/scoped_environment.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "absl/strings/match.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { -namespace { - -using ::google::cloud::storage::internal::GceCheckOverrideEnvVar; -using ::google::cloud::storage::testing::kP12KeyFileContents; -using ::google::cloud::storage::testing::kP12ServiceAccountId; -using ::google::cloud::storage::testing::WriteBase64AsBinary; -using ::google::cloud::testing_util::IsOk; -using ::google::cloud::testing_util::ScopedEnvironment; -using ::google::cloud::testing_util::StatusIs; -using ::testing::AllOf; -using ::testing::HasSubstr; -using ::testing::Not; -using ::testing::NotNull; - -class GoogleCredentialsTest : public ::testing::Test { - public: - // Make sure other higher-precedence credentials (ADC env var, gcloud ADC from - // well-known path) aren't loaded. - GoogleCredentialsTest() - : home_env_var_(GoogleAdcHomeEnvVar(), {}), - adc_env_var_(GoogleAdcEnvVar(), {}), - gcloud_path_override_env_var_(GoogleGcloudAdcFileEnvVar(), {}), - gce_check_override_env_var_(GceCheckOverrideEnvVar(), {}) {} - - protected: - ScopedEnvironment home_env_var_; - ScopedEnvironment adc_env_var_; - ScopedEnvironment gcloud_path_override_env_var_; - ScopedEnvironment gce_check_override_env_var_; -}; - -std::string const kAuthorizedUserCredFilename = "authorized-user.json"; -std::string const kAuthorizedUserCredContents = R"""({ - "client_id": "test-invalid-test-invalid.apps.googleusercontent.com", - "client_secret": "invalid-invalid-invalid", - "refresh_token": "1/test-test-test", - "type": "authorized_user" -})"""; - -void SetupAuthorizedUserCredentialsFileForTest(std::string const& filename) { - std::ofstream os(filename); - os << kAuthorizedUserCredContents; - os.close(); -} - -/** - * @test Verify `GoogleDefaultCredentials()` loads authorized user credentials. - * - * This test only verifies the right type of object is created, the unit tests - * for `AuthorizedUserCredentials` already check that once loaded the class - * works correctly. Testing here would be redundant. Furthermore, calling - * `AuthorizationHeader()` initiates the key verification workflow, that - * requires valid keys and contacting Google's production servers, and would - * make this an integration test. - */ -TEST_F(GoogleCredentialsTest, LoadValidAuthorizedUserCredentialsViaEnvVar) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), kAuthorizedUserCredFilename); - SetupAuthorizedUserCredentialsFileForTest(filename); - - // Test that the authorized user credentials are loaded as the default when - // specified via the well known environment variable. - ScopedEnvironment adc_env_var(GoogleAdcEnvVar(), filename.c_str()); - auto creds = GoogleDefaultCredentials(); - ASSERT_STATUS_OK(creds); - // Need to create a temporary for the pointer because clang-tidy warns about - // using expressions with (potential) side-effects inside typeid(). - auto* ptr = creds->get(); - EXPECT_EQ(typeid(*ptr), typeid(AuthorizedUserCredentials<>)); -} - -TEST_F(GoogleCredentialsTest, LoadValidAuthorizedUserCredentialsViaGcloudFile) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), kAuthorizedUserCredFilename); - SetupAuthorizedUserCredentialsFileForTest(filename); - // Test that the authorized user credentials are loaded as the default when - // stored in the well known gcloud ADC file path. - ScopedEnvironment gcloud_path_override_env_var(GoogleGcloudAdcFileEnvVar(), - filename.c_str()); - auto creds = GoogleDefaultCredentials(); - ASSERT_STATUS_OK(creds); - auto* ptr = creds->get(); - EXPECT_EQ(typeid(*ptr), typeid(AuthorizedUserCredentials<>)); -} - -TEST_F(GoogleCredentialsTest, LoadValidAuthorizedUserCredentialsFromFilename) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), kAuthorizedUserCredFilename); - SetupAuthorizedUserCredentialsFileForTest(filename); - auto creds = CreateAuthorizedUserCredentialsFromJsonFilePath(filename); - ASSERT_STATUS_OK(creds); - auto* ptr = creds->get(); - EXPECT_EQ(typeid(*ptr), typeid(AuthorizedUserCredentials<>)); -} - -TEST_F(GoogleCredentialsTest, LoadValidAuthorizedUserCredentialsFromContents) { - // Test that the authorized user credentials are loaded from a string - // representing JSON contents. - auto creds = CreateAuthorizedUserCredentialsFromJsonContents( - kAuthorizedUserCredContents); - ASSERT_STATUS_OK(creds); - auto* ptr = creds->get(); - EXPECT_EQ(typeid(*ptr), typeid(AuthorizedUserCredentials<>)); -} - -TEST_F(GoogleCredentialsTest, - LoadInvalidAuthorizedUserCredentialsFromFilename) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), "invalid-credentials.json"); - std::ofstream os(filename); - std::string contents_str = R"""( not-a-json-object-string )"""; - os << contents_str; - os.close(); - auto creds = CreateAuthorizedUserCredentialsFromJsonFilePath(filename); - EXPECT_THAT(creds, Not(IsOk())); -} - -TEST_F(GoogleCredentialsTest, - LoadInvalidAuthorizedUserCredentialsFromJsonContents) { - std::string contents_str = R"""( not-a-json-object-string )"""; - auto creds = CreateAuthorizedUserCredentialsFromJsonContents(contents_str); - EXPECT_THAT(creds, Not(IsOk())); -} - -/** - * @test Verify `GoogleDefaultCredentials()` loads service account credentials. - * - * This test only verifies the right type of object is created, the unit tests - * for `ServiceAccountCredentials` already check that once loaded the class - * works correctly. Testing here would be redundant. Furthermore, calling - * `AuthorizationHeader()` initiates the key verification workflow, that - * requires valid keys and contacting Google's production servers, and would - * make this an integration test. - */ - -std::string const kServiceAccountCredFilename = "service-account.json"; -std::string const kServiceAccountCredContents = R"""({ - "type": "service_account", - "project_id": "foo-project", - "private_key_id": "a1a111aa1111a11a11a11aa111a111a1a1111111", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCltiF2oP3KJJ+S\ntTc1McylY+TuAi3AdohX7mmqIjd8a3eBYDHs7FlnUrFC4CRijCr0rUqYfg2pmk4a\n6TaKbQRAhWDJ7XD931g7EBvCtd8+JQBNWVKnP9ByJUaO0hWVniM50KTsWtyX3up/\nfS0W2R8Cyx4yvasE8QHH8gnNGtr94iiORDC7De2BwHi/iU8FxMVJAIyDLNfyk0hN\neheYKfIDBgJV2v6VaCOGWaZyEuD0FJ6wFeLybFBwibrLIBE5Y/StCrZoVZ5LocFP\nT4o8kT7bU6yonudSCyNMedYmqHj/iF8B2UN1WrYx8zvoDqZk0nxIglmEYKn/6U7U\ngyETGcW9AgMBAAECggEAC231vmkpwA7JG9UYbviVmSW79UecsLzsOAZnbtbn1VLT\nPg7sup7tprD/LXHoyIxK7S/jqINvPU65iuUhgCg3Rhz8+UiBhd0pCH/arlIdiPuD\n2xHpX8RIxAq6pGCsoPJ0kwkHSw8UTnxPV8ZCPSRyHV71oQHQgSl/WjNhRi6PQroB\nSqc/pS1m09cTwyKQIopBBVayRzmI2BtBxyhQp9I8t5b7PYkEZDQlbdq0j5Xipoov\n9EW0+Zvkh1FGNig8IJ9Wp+SZi3rd7KLpkyKPY7BK/g0nXBkDxn019cET0SdJOHQG\nDiHiv4yTRsDCHZhtEbAMKZEpku4WxtQ+JjR31l8ueQKBgQDkO2oC8gi6vQDcx/CX\nZ23x2ZUyar6i0BQ8eJFAEN+IiUapEeCVazuxJSt4RjYfwSa/p117jdZGEWD0GxMC\n+iAXlc5LlrrWs4MWUc0AHTgXna28/vii3ltcsI0AjWMqaybhBTTNbMFa2/fV2OX2\nUimuFyBWbzVc3Zb9KAG4Y7OmJQKBgQC5324IjXPq5oH8UWZTdJPuO2cgRsvKmR/r\n9zl4loRjkS7FiOMfzAgUiXfH9XCnvwXMqJpuMw2PEUjUT+OyWjJONEK4qGFJkbN5\n3ykc7p5V7iPPc7Zxj4mFvJ1xjkcj+i5LY8Me+gL5mGIrJ2j8hbuv7f+PWIauyjnp\nNx/0GVFRuQKBgGNT4D1L7LSokPmFIpYh811wHliE0Fa3TDdNGZnSPhaD9/aYyy78\nLkxYKuT7WY7UVvLN+gdNoVV5NsLGDa4cAV+CWPfYr5PFKGXMT/Wewcy1WOmJ5des\nAgMC6zq0TdYmMBN6WpKUpEnQtbmh3eMnuvADLJWxbH3wCkg+4xDGg2bpAoGAYRNk\nMGtQQzqoYNNSkfus1xuHPMA8508Z8O9pwKU795R3zQs1NAInpjI1sOVrNPD7Ymwc\nW7mmNzZbxycCUL/yzg1VW4P1a6sBBYGbw1SMtWxun4ZbnuvMc2CTCh+43/1l+FHe\nMmt46kq/2rH2jwx5feTbOE6P6PINVNRJh/9BDWECgYEAsCWcH9D3cI/QDeLG1ao7\nrE2NcknP8N783edM07Z/zxWsIsXhBPY3gjHVz2LDl+QHgPWhGML62M0ja/6SsJW3\nYvLLIc82V7eqcVJTZtaFkuht68qu/Jn1ezbzJMJ4YXDYo1+KFi+2CAGR06QILb+I\nlUtj+/nH3HDQjM4ltYfTPUg=\n-----END PRIVATE KEY-----\n", - "client_email": "foo-email@foo-project.iam.gserviceaccount.com", - "client_id": "100000000000000000001", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://accounts.google.com/o/oauth2/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/foo-email%40foo-project.iam.gserviceaccount.com" -})"""; - -std::string const kServiceAccountCredInvalidPrivateKey = R"""({ - "type": "service_account", - "project_id": "foo-project", - "private_key_id": "a1a111aa1111a11a11a11aa111a111a1a1111111", - "private_key": "an-invalid-private-key", - "client_email": "foo-email@foo-project.iam.gserviceaccount.com", - "client_id": "100000000000000000001", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://accounts.google.com/o/oauth2/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/foo-email%40foo-project.iam.gserviceaccount.com" -})"""; - -void SetupServiceAccountCredentialsFileForTest(std::string const& filename) { - std::ofstream os(filename); - os << kServiceAccountCredContents; - os.close(); -} - -TEST_F(GoogleCredentialsTest, LoadValidServiceAccountCredentialsViaEnvVar) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), kAuthorizedUserCredFilename); - SetupServiceAccountCredentialsFileForTest(filename); - - // Test that the service account credentials are loaded as the default when - // specified via the well known environment variable. - ScopedEnvironment adc_env_var(GoogleAdcEnvVar(), filename.c_str()); - auto creds = GoogleDefaultCredentials(); - ASSERT_STATUS_OK(creds); - // Need to create a temporary for the pointer because clang-tidy warns about - // using expressions with (potential) side-effects inside typeid(). - auto* ptr = creds->get(); - EXPECT_EQ(typeid(*ptr), typeid(ServiceAccountCredentials<>)); -} - -TEST_F(GoogleCredentialsTest, LoadValidServiceAccountCredentialsViaGcloudFile) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), kAuthorizedUserCredFilename); - SetupServiceAccountCredentialsFileForTest(filename); - - // Test that the service account credentials are loaded as the default when - // stored in the well known gcloud ADC file path. - ScopedEnvironment gcloud_path_override_env_var(GoogleGcloudAdcFileEnvVar(), - filename.c_str()); - auto creds = GoogleDefaultCredentials(); - ASSERT_STATUS_OK(creds); - auto* ptr = creds->get(); - EXPECT_EQ(typeid(*ptr), typeid(ServiceAccountCredentials<>)); -} - -TEST_F(GoogleCredentialsTest, LoadValidServiceAccountCredentialsFromFilename) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), kServiceAccountCredFilename); - SetupServiceAccountCredentialsFileForTest(filename); - - // Test that the service account credentials are loaded from a file. - auto creds = CreateServiceAccountCredentialsFromJsonFilePath(filename); - ASSERT_STATUS_OK(creds); - auto* ptr = creds->get(); - EXPECT_EQ(typeid(*ptr), typeid(ServiceAccountCredentials<>)); - - // Test the wrapper function. - creds = CreateServiceAccountCredentialsFromFilePath(filename); - ASSERT_STATUS_OK(creds); - auto* ptr2 = creds->get(); - EXPECT_EQ(typeid(*ptr2), typeid(ServiceAccountCredentials<>)); - - creds = CreateServiceAccountCredentialsFromFilePath( - filename, {{"https://www.googleapis.com/auth/devstorage.full_control"}}, - "user@foo.bar"); - ASSERT_STATUS_OK(creds); - auto* ptr3 = creds->get(); - EXPECT_EQ(typeid(*ptr3), typeid(ServiceAccountCredentials<>)); -} - -TEST_F(GoogleCredentialsTest, - LoadValidServiceAccountCredentialsFromFilenameWithOptionalArgs) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), kServiceAccountCredFilename); - SetupServiceAccountCredentialsFileForTest(filename); - - // Test that the service account credentials are loaded from a file. - auto creds = CreateServiceAccountCredentialsFromJsonFilePath( - filename, {{"https://www.googleapis.com/auth/devstorage.full_control"}}, - "user@foo.bar"); - ASSERT_STATUS_OK(creds); - auto* ptr = creds->get(); - EXPECT_EQ(typeid(*ptr), typeid(ServiceAccountCredentials<>)); -} - -TEST_F(GoogleCredentialsTest, - LoadInvalidServiceAccountCredentialsFromFilename) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), "invalid-credentials.json"); - std::ofstream os(filename); - std::string contents_str = R"""( not-a-json-object-string )"""; - os << contents_str; - os.close(); - - auto creds = CreateServiceAccountCredentialsFromJsonFilePath( - filename, {{"https://www.googleapis.com/auth/devstorage.full_control"}}, - "user@foo.bar"); - EXPECT_THAT(creds, Not(IsOk())); -} - -TEST_F(GoogleCredentialsTest, - LoadValidServiceAccountCredentialsFromDefaultPathsViaEnvVar) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), kAuthorizedUserCredFilename); - SetupServiceAccountCredentialsFileForTest(filename); - - // Test that the service account credentials are loaded as the default when - // specified via the well known environment variable. - ScopedEnvironment adc_env_var(GoogleAdcEnvVar(), filename.c_str()); - auto creds = CreateServiceAccountCredentialsFromDefaultPaths(); - ASSERT_STATUS_OK(creds); - // Need to create a temporary for the pointer because clang-tidy warns about - // using expressions with (potential) side-effects inside typeid(). - auto* ptr = creds->get(); - EXPECT_EQ(typeid(*ptr), typeid(ServiceAccountCredentials<>)); -} - -TEST_F(GoogleCredentialsTest, - LoadValidServiceAccountCredentialsFromDefaultPathsViaGcloudFile) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), kAuthorizedUserCredFilename); - SetupServiceAccountCredentialsFileForTest(filename); - - // Test that the service account credentials are loaded as the default when - // stored in the well known gcloud ADC file path. - ScopedEnvironment gcloud_path_override_env_var(GoogleGcloudAdcFileEnvVar(), - filename.c_str()); - auto creds = CreateServiceAccountCredentialsFromDefaultPaths(); - ASSERT_STATUS_OK(creds); - auto* ptr = creds->get(); - EXPECT_EQ(typeid(*ptr), typeid(ServiceAccountCredentials<>)); -} - -TEST_F(GoogleCredentialsTest, - LoadValidServiceAccountCredentialsFromDefaultPathsWithOptionalArgs) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), kAuthorizedUserCredFilename); - SetupServiceAccountCredentialsFileForTest(filename); - - // Test that the service account credentials are loaded as the default when - // specified via the well known environment variable. - ScopedEnvironment adc_env_var(GoogleAdcEnvVar(), filename.c_str()); - auto creds = CreateServiceAccountCredentialsFromDefaultPaths( - {{"https://www.googleapis.com/auth/devstorage.full_control"}}, - "user@foo.bar"); - ASSERT_STATUS_OK(creds); - auto* ptr = creds->get(); - EXPECT_EQ(typeid(*ptr), typeid(ServiceAccountCredentials<>)); -} - -TEST_F( - GoogleCredentialsTest, - DoNotLoadAuthorizedUserCredentialsFromCreateServiceAccountCredentialsFromDefaultPaths) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), kAuthorizedUserCredFilename); - SetupAuthorizedUserCredentialsFileForTest(filename); - - // Test that the authorized user credentials are loaded as the default when - // specified via the well known environment variable. - ScopedEnvironment adc_env_var(GoogleAdcEnvVar(), filename.c_str()); - auto creds = CreateServiceAccountCredentialsFromDefaultPaths(); - EXPECT_THAT(creds, StatusIs(Not(StatusCode::kOk), - HasSubstr("Unsupported credential type"))); -} - -TEST_F(GoogleCredentialsTest, - MissingCredentialsCreateServiceAccountCredentialsFromDefaultPaths) { - // The developer may have configured something that are not service account - // credentials in the well-known path. Change the search location to a - // directory that should have have developer configuration files. - ScopedEnvironment home_env_var(GoogleAdcHomeEnvVar(), ::testing::TempDir()); - // Test that when CreateServiceAccountCredentialsFromDefaultPaths cannot - // find any credentials, it fails. - auto creds = CreateServiceAccountCredentialsFromDefaultPaths(); - EXPECT_THAT( - creds, - StatusIs(Not(StatusCode::kOk), - HasSubstr("Could not create service account credentials"))); -} - -TEST_F(GoogleCredentialsTest, LoadValidServiceAccountCredentialsFromContents) { - // Test that the service account credentials are loaded from a string - // representing JSON contents. - auto creds = CreateServiceAccountCredentialsFromJsonContents( - kServiceAccountCredContents, - {{"https://www.googleapis.com/auth/devstorage.full_control"}}, - "user@foo.bar"); - ASSERT_STATUS_OK(creds); - auto* ptr = creds->get(); - EXPECT_EQ(typeid(*ptr), typeid(ServiceAccountCredentials<>)); -} - -TEST_F(GoogleCredentialsTest, - LoadInvalidServiceAccountCredentialsFromContents) { - // Test that providing invalid contents returns a failure status. - auto creds = CreateServiceAccountCredentialsFromJsonContents( - "not-a-valid-jason-object", - {{"https://www.googleapis.com/auth/devstorage.full_control"}}, - "user@foo.bar"); - EXPECT_THAT(creds, Not(IsOk())); -} - -TEST_F(GoogleCredentialsTest, - LoadInvalidServiceAccountCredentialsWithInvalidKey) { - // Test that providing invalid private_key returns a failure status. - auto creds = CreateServiceAccountCredentialsFromJsonContents( - kServiceAccountCredInvalidPrivateKey); - EXPECT_THAT(creds, Not(IsOk())); -} - -TEST_F(GoogleCredentialsTest, LoadComputeEngineCredentialsFromADCFlow) { - ScopedEnvironment gcloud_path_override_env_var(GoogleGcloudAdcFileEnvVar(), - ""); - // If the ADC flow thinks we're on a GCE instance, it should return - // ComputeEngineCredentials. - ScopedEnvironment gce_check_override_env_var(GceCheckOverrideEnvVar(), "1"); - - auto creds = GoogleDefaultCredentials(); - ASSERT_STATUS_OK(creds); - auto* ptr = creds->get(); - EXPECT_EQ(typeid(*ptr), typeid(ComputeEngineCredentials<>)); -} - -TEST_F(GoogleCredentialsTest, CreateComputeEngineCredentialsWithDefaultEmail) { - auto credentials = CreateComputeEngineCredentials(); - auto* ptr = credentials.get(); - EXPECT_EQ(typeid(*ptr), typeid(ComputeEngineCredentials<>)); - EXPECT_EQ( - std::string("default"), - dynamic_cast*>(ptr)->service_account_email()); -} - -TEST_F(GoogleCredentialsTest, CreateComputeEngineCredentialsWithExplicitEmail) { - auto credentials = CreateComputeEngineCredentials("foo@bar.baz"); - auto* ptr = credentials.get(); - EXPECT_EQ(typeid(*ptr), typeid(ComputeEngineCredentials<>)); - EXPECT_EQ( - std::string("foo@bar.baz"), - dynamic_cast*>(ptr)->service_account_email()); -} - -TEST_F(GoogleCredentialsTest, LoadUnknownTypeCredentials) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), "unknown-type-credentials.json"); - std::ofstream os(filename); - std::string contents_str = R"""({ - "type": "unknown_type" -})"""; - os << contents_str; - os.close(); - ScopedEnvironment adc_env_var(GoogleAdcEnvVar(), filename.c_str()); - - auto creds = GoogleDefaultCredentials(); - EXPECT_THAT(creds, StatusIs(Not(StatusCode::kOk), - AllOf(HasSubstr("Unsupported credential type"), - HasSubstr(filename)))); -} - -TEST_F(GoogleCredentialsTest, LoadInvalidCredentials) { - char const* const test_cases[] = { - R"""( not-a-json-object-string )""", - R"js("valid-json-but-not-an-object")js", - }; - for (auto const* contents : test_cases) { - SCOPED_TRACE("Testing with: " + std::string{contents}); - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), "invalid-credentials.json"); - std::ofstream os(filename); - os << contents; - os.close(); - ScopedEnvironment adc_env_var(GoogleAdcEnvVar(), filename.c_str()); - - auto creds = GoogleDefaultCredentials(); - EXPECT_THAT(creds, - StatusIs(StatusCode::kInvalidArgument, HasSubstr(filename))); - } -} - -TEST_F(GoogleCredentialsTest, LoadInvalidAuthorizedUserCredentialsViaADC) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), "invalid-au-credentials.json"); - std::ofstream os(filename); - std::string contents_str = R"""("type": "authorized_user")"""; - os << contents_str; - os.close(); - ScopedEnvironment adc_env_var(GoogleAdcEnvVar(), filename.c_str()); - - auto creds = GoogleDefaultCredentials(); - EXPECT_THAT(creds, StatusIs(StatusCode::kInvalidArgument)); -} - -TEST_F(GoogleCredentialsTest, LoadInvalidServiceAccountCredentialsViaADC) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), "invalid-au-credentials.json"); - std::ofstream os(filename); - std::string contents_str = R"""("type": "service_account")"""; - os << contents_str; - os.close(); - ScopedEnvironment adc_env_var(GoogleAdcEnvVar(), filename.c_str()); - - auto creds = GoogleDefaultCredentials(); - EXPECT_THAT(creds, StatusIs(StatusCode::kInvalidArgument)); -} - -TEST_F(GoogleCredentialsTest, MissingCredentialsViaEnvVar) { - char const filename[] = "missing-credentials.json"; - ScopedEnvironment adc_env_var(GoogleAdcEnvVar(), filename); - - auto creds = GoogleDefaultCredentials(); - EXPECT_THAT(creds, StatusIs(Not(StatusCode::kOk), - AllOf(HasSubstr("Cannot open credentials file"), - HasSubstr(filename)))); -} - -TEST_F(GoogleCredentialsTest, MissingCredentialsViaGcloudFilePath) { - char const filename[] = "missing-credentials.json"; - - // The method to create default credentials should see that no file exists at - // this path, then continue trying to load the other credential types, - // eventually finding no valid credentials and hitting a runtime error. - ScopedEnvironment gcloud_path_override_env_var(GoogleGcloudAdcFileEnvVar(), - filename); - ScopedEnvironment gcloud_metadata_host_override_env_var( - internal::GceMetadataHostnameEnvVar(), "invalid.google.internal"); - - auto creds = GoogleDefaultCredentials(); - ASSERT_STATUS_OK(creds); - ASSERT_THAT(*creds, NotNull()); - auto header = (*creds)->AuthorizationHeader(); - EXPECT_THAT(header, StatusIs(Not(StatusCode::kOk))); -} - -TEST_F(GoogleCredentialsTest, LoadP12Credentials) { - // Ensure that the parser detects that it's not a JSON file and parses it as - // a P12 file. - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), "credentials.p12"); - WriteBase64AsBinary(filename, kP12KeyFileContents); - ScopedEnvironment adc_env_var(GoogleAdcEnvVar(), filename.c_str()); - - auto creds = GoogleDefaultCredentials(); - EXPECT_EQ(0, std::remove(filename.c_str())); - - if (creds.status().code() == StatusCode::kInvalidArgument) { - if (absl::StrContains(creds.status().message(), "error:0308010C")) { - // With OpenSSL 3.0 the PKCS#12 files may not be supported by default. - GTEST_SKIP() << "PKCS#12 support unavailable, skipping test"; - } -#if _WIN32 - // On Windows, the OS may not have the necessary providers to support - // PKCS#12. Unfortunately the error message is not as unambiguous, so we use - // the function that fails instead. - auto const& metadata = creds.status().error_info().metadata(); - auto const l = metadata.find("gcloud-cpp.source.function"); - if (l != metadata.end() && l->second == "GetCertificatePrivateKey") { - GTEST_SKIP() << "PKCS#12 support unavailable, skipping test"; - } -#endif // _WIN32 - } - ASSERT_STATUS_OK(creds); - auto* ptr = creds->get(); - EXPECT_EQ(typeid(*ptr), typeid(ServiceAccountCredentials<>)); - EXPECT_EQ(kP12ServiceAccountId, ptr->AccountEmail()); - EXPECT_FALSE(ptr->KeyId().empty()); -} - -} // namespace -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/oauth2/refreshing_credentials_wrapper.cc b/google/cloud/storage/oauth2/refreshing_credentials_wrapper.cc deleted file mode 100644 index ddb055c3512c5..0000000000000 --- a/google/cloud/storage/oauth2/refreshing_credentials_wrapper.cc +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/oauth2/refreshing_credentials_wrapper.h" -#include "google/cloud/storage/oauth2/credential_constants.h" -#include "google/cloud/internal/oauth2_refreshing_credentials_wrapper.h" -#include "absl/strings/str_split.h" -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -RefreshingCredentialsWrapper::RefreshingCredentialsWrapper() - : impl_(std::make_unique()) { -} - -std::pair RefreshingCredentialsWrapper::SplitToken( - std::string const& token) { - std::pair split_token = absl::StrSplit(token, ": "); - return split_token; -} - -bool RefreshingCredentialsWrapper::IsExpired( - std::chrono::system_clock::time_point now) const { - return now > - (impl_->token_.expiration - GoogleOAuthAccessTokenExpirationSlack()); -} - -bool RefreshingCredentialsWrapper::IsValid( - std::chrono::system_clock::time_point now) const { - return !impl_->token_.token.empty() && !IsExpired(now); -} - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/oauth2/refreshing_credentials_wrapper.h b/google/cloud/storage/oauth2/refreshing_credentials_wrapper.h deleted file mode 100644 index 85496c491f7c2..0000000000000 --- a/google/cloud/storage/oauth2/refreshing_credentials_wrapper.h +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_OAUTH2_REFRESHING_CREDENTIALS_WRAPPER_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_REFRESHING_CREDENTIALS_WRAPPER_H - -#include "google/cloud/storage/version.h" -#include "google/cloud/internal/oauth2_refreshing_credentials_wrapper.h" -#include "google/cloud/status.h" -#include "google/cloud/status_or.h" -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -/** - * Wrapper for refreshable parts of a Credentials object. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -class RefreshingCredentialsWrapper { - public: - RefreshingCredentialsWrapper(); - - struct TemporaryToken { - std::string token; - std::chrono::system_clock::time_point expiration_time; - }; - - template - StatusOr AuthorizationHeader( - std::chrono::system_clock::time_point, RefreshFunctor refresh_fn) const { - auto refresh_fn_wrapper = - [refresh_fn]() -> StatusOr { - auto temp_token = refresh_fn(); - if (!temp_token.ok()) return temp_token.status(); - auto token = SplitToken(temp_token->token); - return google::cloud::AccessToken{std::move(token.second), - temp_token->expiration_time}; - }; - auto header = impl_->AuthorizationHeader(refresh_fn_wrapper); - if (!header.ok()) return std::move(header).status(); - return header->first + ": " + header->second; - } - - /** - * Returns whether the current access token should be considered expired. - * - * When determining if a Credentials object needs to be refreshed, the IsValid - * method should be used instead; there may be cases where a Credentials is - * not expired but should be considered invalid. - * - * If a Credentials is close to expiration but not quite expired, this method - * may still return false. This helps prevent the case where an access token - * expires between when it is obtained and when it is used. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ - bool IsExpired(std::chrono::system_clock::time_point now) const; - - /** - * Returns whether the current access token should be considered valid. - * - * This method should be used to determine whether a Credentials object needs - * to be refreshed. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ - bool IsValid(std::chrono::system_clock::time_point now) const; - - private: - static std::pair SplitToken( - std::string const& token); - - std::unique_ptr impl_; -}; - -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_REFRESHING_CREDENTIALS_WRAPPER_H diff --git a/google/cloud/storage/oauth2/service_account_credentials.cc b/google/cloud/storage/oauth2/service_account_credentials.cc deleted file mode 100644 index 248152e8b64ad..0000000000000 --- a/google/cloud/storage/oauth2/service_account_credentials.cc +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/oauth2/service_account_credentials.h" -#include "google/cloud/storage/client_options.h" -#include "google/cloud/storage/internal/base64.h" -#include "google/cloud/storage/internal/make_jwt_assertion.h" -#include "google/cloud/internal/absl_str_join_quiet.h" -#include "google/cloud/internal/oauth2_cached_credentials.h" -#include "google/cloud/internal/oauth2_service_account_credentials.h" -#include "google/cloud/internal/parse_service_account_p12_file.h" -#include "google/cloud/internal/sign_using_sha256.h" -#include -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -auto constexpr kP12PrivateKeyIdMarker = "--unknown--"; - -StatusOr ParseServiceAccountCredentials( - std::string const& content, std::string const& source, - std::string const& default_token_uri) { - auto info = oauth2_internal::ParseServiceAccountCredentials( - content, source, default_token_uri); - if (!info.ok()) return info.status(); - return ServiceAccountCredentialsInfo{info->client_email, info->private_key_id, - info->private_key, info->token_uri, - info->scopes, info->subject}; -} - -StatusOr ParseServiceAccountP12File( - std::string const& source, std::string const&) { - auto info = oauth2_internal::ParseServiceAccountP12File(source); - if (!info.ok()) return info.status(); - return ServiceAccountCredentialsInfo{info->client_email, info->private_key_id, - info->private_key, info->token_uri, - info->scopes, info->subject}; -} - -std::pair AssertionComponentsFromInfo( - ServiceAccountCredentialsInfo const& info, - std::chrono::system_clock::time_point now) { - return oauth2_internal::AssertionComponentsFromInfo( - internal::MapServiceAccountCredentialsInfo(info), now); -} - -std::string MakeJWTAssertion(std::string const& header, - std::string const& payload, - std::string const& pem_contents) { - return internal::MakeJWTAssertionNoThrow(header, payload, pem_contents) - .value(); -} - -std::string CreateServiceAccountRefreshPayload( - ServiceAccountCredentialsInfo const& info, std::string const&, - std::chrono::system_clock::time_point now) { - auto params = oauth2_internal::CreateServiceAccountRefreshPayload( - internal::MapServiceAccountCredentialsInfo(info), now); - return absl::StrJoin(params, "&", absl::PairFormatter("=")); -} - -StatusOr -ParseServiceAccountRefreshResponse( - storage::internal::HttpResponse const& response, - std::chrono::system_clock::time_point now) { - auto access_token = nlohmann::json::parse(response.payload, nullptr, false); - if (access_token.is_discarded() || access_token.count("access_token") == 0 || - access_token.count("expires_in") == 0 || - access_token.count("token_type") == 0) { - auto payload = - response.payload + - "Could not find all required fields in response (access_token," - " expires_in, token_type) while trying to obtain an access token for" - " service account credentials."; - return AsStatus(storage::internal::HttpResponse{response.status_code, - payload, response.headers}); - } - // Response should have the attributes "access_token", "expires_in", and - // "token_type". - std::string header = - "Authorization: " + access_token.value("token_type", "") + " " + - access_token.value("access_token", ""); - auto expires_in = std::chrono::seconds(access_token.value("expires_in", 0)); - auto new_expiration = now + expires_in; - - return RefreshingCredentialsWrapper::TemporaryToken{std::move(header), - new_expiration}; -} - -StatusOr MakeSelfSignedJWT( - ServiceAccountCredentialsInfo const& info, - std::chrono::system_clock::time_point tp) { - auto mapped = internal::MapServiceAccountCredentialsInfo(info); - return ::google::cloud::oauth2_internal::MakeSelfSignedJWT(mapped, tp); -} - -bool ServiceAccountUseOAuth(ServiceAccountCredentialsInfo const& info) { - if (info.private_key_id == kP12PrivateKeyIdMarker) return true; - // Self-signed JWTs do not work in GCS if they have scopes. - if (info.scopes.has_value()) return true; - auto disable_jwt = google::cloud::internal::GetEnv( - "GOOGLE_CLOUD_CPP_EXPERIMENTAL_DISABLE_SELF_SIGNED_JWT"); - return disable_jwt.has_value(); -} - -ServiceAccountCredentials:: - ServiceAccountCredentials(ServiceAccountCredentialsInfo info, - ChannelOptions const& options) - : impl_(std::make_unique( - std::make_unique( - internal::MapServiceAccountCredentialsInfo(std::move(info)), - Options{}.set(options.ssl_root_path()), - [](Options const& o) { - return rest_internal::MakeDefaultRestClient(std::string{}, o); - }))) {} - -} // namespace oauth2 - -namespace internal { - -oauth2_internal::ServiceAccountCredentialsInfo MapServiceAccountCredentialsInfo( - oauth2::ServiceAccountCredentialsInfo info) { - // Storage has more stringent requirements w.r.t. self-signed JWTs - // than most services. Any scope makes the self-signed JWTs unusable with - // storage, but they remain usable with other services. We need to disable - // self-signed JWTs in the implementation class as it is unaware of the - // storage service limitations. - auto enable_self_signed_jwt = !ServiceAccountUseOAuth(info); - return {std::move(info.client_email), std::move(info.private_key_id), - std::move(info.private_key), std::move(info.token_uri), - std::move(info.scopes), std::move(info.subject), - enable_self_signed_jwt, /*.universe_domain=*/absl::nullopt, - /*.project_id=*/absl::nullopt}; -} - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/oauth2/service_account_credentials.h b/google/cloud/storage/oauth2/service_account_credentials.h deleted file mode 100644 index 7da214edbea8b..0000000000000 --- a/google/cloud/storage/oauth2/service_account_credentials.h +++ /dev/null @@ -1,365 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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_OAUTH2_SERVICE_ACCOUNT_CREDENTIALS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_SERVICE_ACCOUNT_CREDENTIALS_H - -#include "google/cloud/storage/client_options.h" -#include "google/cloud/storage/internal/base64.h" -#include "google/cloud/storage/internal/curl/request_builder.h" -#include "google/cloud/storage/internal/http_response.h" -#include "google/cloud/storage/oauth2/credential_constants.h" -#include "google/cloud/storage/oauth2/credentials.h" -#include "google/cloud/storage/oauth2/refreshing_credentials_wrapper.h" -#include "google/cloud/storage/version.h" -#include "google/cloud/internal/curl_handle_factory.h" -#include "google/cloud/internal/getenv.h" -#include "google/cloud/internal/make_status.h" -#include "google/cloud/internal/oauth2_service_account_credentials.h" -#include "google/cloud/internal/sha256_hash.h" -#include "google/cloud/internal/sign_using_sha256.h" -#include "google/cloud/optional.h" -#include "google/cloud/status_or.h" -#include "absl/types/optional.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -/** - * Object to hold information used to instantiate an ServiceAccountCredentials. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -struct ServiceAccountCredentialsInfo { - std::string client_email; - std::string private_key_id; - std::string private_key; - std::string token_uri; - // If no set is supplied, a default set of scopes will be used. - absl::optional> scopes; - // See https://developers.google.com/identity/protocols/OAuth2ServiceAccount. - absl::optional subject; -}; - -/** - * Parses the contents of a JSON keyfile into a ServiceAccountCredentialsInfo. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ - -StatusOr ParseServiceAccountCredentials( - std::string const& content, std::string const& source, - std::string const& default_token_uri = GoogleOAuthRefreshEndpoint()); - -/** - * Parses the contents of a P12 keyfile into a ServiceAccountCredentialsInfo. - * - * @warning We strongly recommend that applications use JSON keyfiles instead. - * - * @note Note that P12 keyfiles do not contain the `client_email` for the - * service account, the application must obtain this through some other means - * and provide them to the function. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr ParseServiceAccountP12File( - std::string const& source, - std::string const& default_token_uri = GoogleOAuthRefreshEndpoint()); - -/** - * Parses a refresh response JSON string and uses the current time to create a - * TemporaryToken. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr -ParseServiceAccountRefreshResponse( - storage::internal::HttpResponse const& response, - std::chrono::system_clock::time_point now); - -/** - * Splits a ServiceAccountCredentialsInfo into header and payload components - * and uses the current time to make a JWT assertion. - * - * @see - * https://cloud.google.com/endpoints/docs/frameworks/java/troubleshoot-jwt - * - * @see https://tools.ietf.org/html/rfc7523 - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -std::pair AssertionComponentsFromInfo( - ServiceAccountCredentialsInfo const& info, - std::chrono::system_clock::time_point now); - -/** - * Given a key and a JSON header and payload, creates a JWT assertion string. - * - * @see https://tools.ietf.org/html/rfc7519 - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -std::string MakeJWTAssertion(std::string const& header, - std::string const& payload, - std::string const& pem_contents); - -/** - * Uses a ServiceAccountCredentialsInfo and the current time to construct a JWT - * assertion. - * - * The assertion combined with the grant type is used to create the refresh - * payload. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -std::string CreateServiceAccountRefreshPayload( - ServiceAccountCredentialsInfo const& info, std::string const& grant_type, - std::chrono::system_clock::time_point now); - -/** - * Make a self-signed JWT from the service account. - * - * [Self-signed JWTs] bypass the intermediate step of exchanging client - * assertions for OAuth tokens. The advantages of self-signed JTWs include: - * - * - They are more efficient, as they require more or less the same amount of - * local work, and save a round-trip to the token endpoint, typically - * https://oauth2.googleapis.com/token. - * - While this service is extremely reliable, removing external dependencies in - * the critical path almost always improves reliability. - * - They work better in VPC-SC environments and other environments with limited - * Internet access. - * - * @warning At this time only scope-based self-signed JWTs are supported. - * - * [Self-signed JWTs]: https://google.aip.dev/auth/4111 - * - * @param info the parsed service account information, see - * `ParseServiceAccountCredentials()` - * @param tp the current time - * @return a bearer token for authentication. Include this value in the - * `Authorization` header with the "Bearer" type. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -StatusOr MakeSelfSignedJWT( - ServiceAccountCredentialsInfo const& info, - std::chrono::system_clock::time_point tp); - -/** - * Return true if we need to use the OAuth path to create tokens - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -bool ServiceAccountUseOAuth(ServiceAccountCredentialsInfo const& info); - -/** - * Wrapper class for Google OAuth 2.0 service account credentials. - * - * Takes a ServiceAccountCredentialsInfo and obtains access tokens from the - * Google Authorization Service as needed. Instances of this class should - * usually be created via the convenience methods declared in - * google_credentials.h. - * - * An HTTP Authorization header, with an access token as its value, - * can be obtained by calling the AuthorizationHeader() method; if the current - * access token is invalid or nearing expiration, this will class will first - * obtain a new access token before returning the Authorization header string. - * - * @see https://developers.google.com/identity/protocols/OAuth2ServiceAccount - * for an overview of using service accounts with Google's OAuth 2.0 system. - * - * @see https://cloud.google.com/storage/docs/reference/libraries for details on - * how to obtain and get started with service account credentials. - * - * @tparam HttpRequestBuilderType a dependency injection point. It makes it - * possible to mock internal libcurl wrappers. This should generally not be - * overridden except for testing. - * @tparam ClockType a dependency injection point to fetch the current time. - * This should generally not be overridden except for testing. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ -template -class ServiceAccountCredentials; - -/// @copydoc ServiceAccountCredentials -template <> -class ServiceAccountCredentials - : public Credentials { - public: - explicit ServiceAccountCredentials(ServiceAccountCredentialsInfo info) - : ServiceAccountCredentials(std::move(info), {}) {} - ServiceAccountCredentials(ServiceAccountCredentialsInfo info, - ChannelOptions const& options); - - StatusOr AuthorizationHeader() override { - return oauth2_internal::AuthenticationHeaderJoined(*impl_); - } - - /** - * Create a RSA SHA256 signature of the blob using the Credential object. - * - * @param signing_account the desired service account which should sign - * @p blob. If not set, uses this object's account. If set, it must match - * this object's service account. - * @param blob the string to sign. Note that sometimes the application must - * Base64-encode the data before signing. - * @return the signed blob as raw bytes. An error if the @p signing_account - * does not match the email for the credential's account. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ - StatusOr> SignBlob( - SigningAccount const& signing_account, - std::string const& blob) const override { - return impl_->SignBlob((signing_account.has_value() - ? signing_account.value() - : absl::optional(absl::nullopt)), - blob); - } - - std::string AccountEmail() const override { return impl_->AccountEmail(); } - std::string KeyId() const override { return impl_->KeyId(); } - - private: - friend struct ServiceAccountCredentialsTester; - StatusOr AuthorizationHeaderForTesting( - std::chrono::system_clock::time_point tp) { - return oauth2_internal::AuthenticationHeaderJoined(*impl_, tp); - } - std::unique_ptr impl_; -}; - -/// @copydoc ServiceAccountCredentials -template -class ServiceAccountCredentials : public Credentials { - public: - explicit ServiceAccountCredentials(ServiceAccountCredentialsInfo info) - : ServiceAccountCredentials(std::move(info), {}) {} - ServiceAccountCredentials(ServiceAccountCredentialsInfo info, - ChannelOptions const& options) - : info_(std::move(info)), - options_(Options{}.set(options.ssl_root_path())), - clock_() {} - - StatusOr AuthorizationHeader() override { - std::unique_lock lock(mu_); - return refreshing_creds_.AuthorizationHeader(clock_.now(), - [this] { return Refresh(); }); - } - - /** - * Create a RSA SHA256 signature of the blob using the Credential object. - * - * @param signing_account the desired service account which should sign - * @p blob. If not set, uses this object's account. If set, it must match - * this object's service account. - * @param blob the string to sign. Note that sometimes the application must - * Base64-encode the data before signing. - * @return the signed blob as raw bytes. An error if the @p signing_account - * does not match the email for the credential's account. - * - * @deprecated Prefer using the unified credentials documented in @ref guac - */ - StatusOr> SignBlob( - SigningAccount const& signing_account, - std::string const& blob) const override { - if (signing_account.has_value() && - signing_account.value() != info_.client_email) { - return google::cloud::internal::InvalidArgumentError( - "The current_credentials cannot sign blobs for " + - signing_account.value(), - GCP_ERROR_INFO()); - } - return google::cloud::internal::SignUsingSha256(blob, info_.private_key); - } - - std::string AccountEmail() const override { return info_.client_email; } - std::string KeyId() const override { return info_.private_key_id; } - - private: - bool UseOAuth() const { return ServiceAccountUseOAuth(info_); } - - StatusOr Refresh() { - if (UseOAuth()) return RefreshOAuth(); - return RefreshSelfSigned(); - } - - StatusOr RefreshOAuth() const { - HttpRequestBuilderType builder( - info_.token_uri, rest_internal::GetDefaultCurlHandleFactory(options_)); - builder.AddHeader("Content-Type: application/x-www-form-urlencoded"); - // This is the value of grant_type for JSON-formatted service account - // keyfiles downloaded from Cloud Console. - std::string grant_type("grant_type="); - grant_type += - builder.MakeEscapedString("urn:ietf:params:oauth:grant-type:jwt-bearer") - .get(); - - auto payload = - CreateServiceAccountRefreshPayload(info_, grant_type, clock_.now()); - auto response = std::move(builder).BuildRequest().MakeRequest(payload); - if (!response) return std::move(response).status(); - if (response->status_code >= 300) return AsStatus(*response); - return ParseServiceAccountRefreshResponse(*response, clock_.now()); - } - - StatusOr RefreshSelfSigned() - const { - auto const tp = clock_.now(); - auto token = MakeSelfSignedJWT(info_, tp); - if (!token) return std::move(token).status(); - return RefreshingCredentialsWrapper::TemporaryToken{ - "Authorization: Bearer " + *token, - tp + GoogleOAuthAccessTokenLifetime()}; - } - - ServiceAccountCredentialsInfo info_; - Options options_; - mutable std::mutex mu_; - RefreshingCredentialsWrapper refreshing_creds_; - ClockType clock_; -}; - -} // namespace oauth2 - -namespace internal { - -oauth2_internal::ServiceAccountCredentialsInfo MapServiceAccountCredentialsInfo( - oauth2::ServiceAccountCredentialsInfo info); - -} // namespace internal -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_SERVICE_ACCOUNT_CREDENTIALS_H diff --git a/google/cloud/storage/oauth2/service_account_credentials_test.cc b/google/cloud/storage/oauth2/service_account_credentials_test.cc deleted file mode 100644 index e0dbfececf785..0000000000000 --- a/google/cloud/storage/oauth2/service_account_credentials_test.cc +++ /dev/null @@ -1,884 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/oauth2/service_account_credentials.h" -#include "google/cloud/storage/oauth2/credential_constants.h" -#include "google/cloud/storage/oauth2/google_credentials.h" -#include "google/cloud/storage/testing/constants.h" -#include "google/cloud/storage/testing/mock_http_request.h" -#include "google/cloud/storage/testing/write_base64.h" -#include "google/cloud/internal/base64_transforms.h" -#include "google/cloud/internal/filesystem.h" -#include "google/cloud/internal/random.h" -#include "google/cloud/internal/sign_using_sha256.h" -#include "google/cloud/testing_util/mock_fake_clock.h" -#include "google/cloud/testing_util/scoped_environment.h" -#include "google/cloud/testing_util/status_matchers.h" -#include "absl/strings/match.h" -#include "absl/strings/str_split.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace storage { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace oauth2 { - -// Define a helper to test the specialization. -struct ServiceAccountCredentialsTester { - static StatusOr Header( - ServiceAccountCredentials<>& tested, - std::chrono::system_clock::time_point tp) { - return tested.AuthorizationHeaderForTesting(tp); - } -}; - -namespace { - -using ::google::cloud::internal::SignUsingSha256; -using ::google::cloud::internal::UrlsafeBase64Decode; -using ::google::cloud::internal::UrlsafeBase64Encode; -using ::google::cloud::storage::internal::HttpResponse; -using ::google::cloud::storage::testing::kP12KeyFileContents; -using ::google::cloud::storage::testing::kP12ServiceAccountId; -using ::google::cloud::storage::testing::kWellFormattedKey; -using ::google::cloud::storage::testing::MockHttpRequest; -using ::google::cloud::storage::testing::MockHttpRequestBuilder; -using ::google::cloud::storage::testing::WriteBase64AsBinary; -using ::google::cloud::testing_util::FakeClock; -using ::google::cloud::testing_util::IsOk; -using ::google::cloud::testing_util::IsOkAndHolds; -using ::google::cloud::testing_util::ScopedEnvironment; -using ::google::cloud::testing_util::StatusIs; -using ::testing::_; -using ::testing::An; -using ::testing::AtLeast; -using ::testing::ElementsAre; -using ::testing::ElementsAreArray; -using ::testing::HasSubstr; -using ::testing::Not; -using ::testing::Return; -using ::testing::StrEq; - -constexpr char kScopeForTest0[] = - "https://www.googleapis.com/auth/devstorage.full_control"; -constexpr char kScopeForTest1[] = - "https://www.googleapis.com/auth/cloud-platform"; -constexpr std::time_t kFixedJwtTimestamp = 1530060324; -constexpr char kGrantParamUnescaped[] = - "urn:ietf:params:oauth:grant-type:jwt-bearer"; -constexpr char kGrantParamEscaped[] = - "urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer"; - -auto constexpr kProjectId = "foo-project"; -auto constexpr kPrivateKeyId = "a1a111aa1111a11a11a11aa111a111a1a1111111"; -auto constexpr kClientEmail = "foo-email@foo-project.iam.gserviceaccount.com"; -auto constexpr kClientId = "100000000000000000001"; -auto constexpr kAuthUri = "https://accounts.google.com/o/oauth2/auth"; -auto constexpr kTokenUri = "https://oauth2.googleapis.com/token"; -auto constexpr kAuthProviderX509CerlUrl = - "https://www.googleapis.com/oauth2/v1/certs"; -auto constexpr kClientX509CertUrl = - "https://www.googleapis.com/robot/v1/metadata/x509/" - "foo-email%40foo-project.iam.gserviceaccount.com"; -constexpr char kSubjectForGrant[] = "user@foo.bar"; - -std::string MakeTestContents() { - return nlohmann::json{ - {"type", "service_account"}, - {"project_id", kProjectId}, - {"private_key_id", kPrivateKeyId}, - {"private_key", kWellFormattedKey}, - {"client_email", kClientEmail}, - {"client_id", kClientId}, - {"auth_uri", kAuthUri}, - {"token_uri", kTokenUri}, - {"auth_provider_x509_cert_url", kAuthProviderX509CerlUrl}, - {"client_x509_cert_url", kClientX509CertUrl}, - } - .dump(); -} - -class ServiceAccountCredentialsTest : public ::testing::Test { - protected: - void SetUp() override { - MockHttpRequestBuilder::mock_ = - std::make_shared(); - FakeClock::reset_clock(kFixedJwtTimestamp); - } - void TearDown() override { MockHttpRequestBuilder::mock_.reset(); } - - std::string CreateRandomFileName() { - // When running on the internal Google CI systems we cannot write to the - // local directory, GTest has a good temporary directory in that case. - return google::cloud::internal::PathAppend( - ::testing::TempDir(), - google::cloud::internal::Sample( - generator_, 8, "abcdefghijklmnopqrstuvwxyz0123456789")); - } - - google::cloud::internal::DefaultPRNG generator_ = - google::cloud::internal::MakeDefaultPRNG(); -}; - -TEST_F(ServiceAccountCredentialsTest, MultipleScopes) { - auto info = ParseServiceAccountCredentials(MakeTestContents(), "test"); - ASSERT_STATUS_OK(info); - auto expected_info = *info; - // .scopes is a `std::set` so we need to preserve order. - ASSERT_LT(std::string{kScopeForTest1}, kScopeForTest0); - expected_info.scopes = {std::string{kScopeForTest1} + " " + kScopeForTest0}; - expected_info.subject = std::string(kSubjectForGrant); - auto const now = std::chrono::system_clock::now(); - auto const expected_components = - AssertionComponentsFromInfo(expected_info, now); - - auto actual_info = *info; - actual_info.scopes = {kScopeForTest0, kScopeForTest1}; - actual_info.subject = std::string(kSubjectForGrant); - auto const actual_components = AssertionComponentsFromInfo(actual_info, now); - EXPECT_EQ(actual_components, expected_components); -} - -/// @test Verify that we refresh service account credentials appropriately. -TEST_F(ServiceAccountCredentialsTest, - RefreshCalledOnlyWhenAccessTokenIsMissingOrInvalid) { - ScopedEnvironment disable_self_signed_jwt( - "GOOGLE_CLOUD_CPP_EXPERIMENTAL_DISABLE_SELF_SIGNED_JWT", "1"); - - // Prepare two responses, the first one is used but becomes immediately - // expired, resulting in another refresh next time the caller tries to get - // an authorization header. - std::string r1 = R"""({ - "token_type": "Type", - "access_token": "access-token-r1", - "expires_in": 0 -})"""; - std::string r2 = R"""({ - "token_type": "Type", - "access_token": "access-token-r2", - "expires_in": 1000 -})"""; - - // Now setup the builder to return those responses. - auto mock_builder = MockHttpRequestBuilder::mock_; - EXPECT_CALL(*mock_builder, BuildRequest()) - .WillOnce([&] { - MockHttpRequest request; - EXPECT_CALL(*request.mock, MakeRequest) - .WillOnce(Return(HttpResponse{200, r1, {}})); - return request; - }) - .WillOnce([&] { - MockHttpRequest request; - EXPECT_CALL(*request.mock, MakeRequest) - .WillOnce(Return(HttpResponse{200, r2, {}})); - return request; - }); - EXPECT_CALL(*mock_builder, AddHeader(An())) - .Times(AtLeast(1)); - EXPECT_CALL(*mock_builder, Constructor(GoogleOAuthRefreshEndpoint(), _, _)) - .Times(AtLeast(1)); - EXPECT_CALL(*mock_builder, MakeEscapedString(An())) - .WillRepeatedly([](std::string const& s) -> std::unique_ptr { - EXPECT_EQ(kGrantParamUnescaped, s); - auto t = std::unique_ptr(new char[sizeof(kGrantParamEscaped)]); - std::copy(kGrantParamEscaped, - kGrantParamEscaped + sizeof(kGrantParamEscaped), t.get()); - return t; - }); - - auto info = ParseServiceAccountCredentials(MakeTestContents(), "test"); - ASSERT_STATUS_OK(info); - ServiceAccountCredentials credentials(*info); - // Calls Refresh to obtain the access token for our authorization header. - EXPECT_EQ("Authorization: Type access-token-r1", - credentials.AuthorizationHeader().value()); - // Token is expired, resulting in another call to Refresh. - EXPECT_EQ("Authorization: Type access-token-r2", - credentials.AuthorizationHeader().value()); - // Token still valid; should return cached token instead of calling Refresh. - EXPECT_EQ("Authorization: Type access-token-r2", - credentials.AuthorizationHeader().value()); -} - -/// @test Verify that parsing a service account JSON string works. -TEST_F(ServiceAccountCredentialsTest, ParseSimple) { - std::string contents = R"""({ - "type": "service_account", - "private_key_id": "not-a-key-id-just-for-testing", - "private_key": "not-a-valid-key-just-for-testing", - "client_email": "test-only@test-group.example.com", - "token_uri": "https://oauth2.googleapis.com/test_endpoint" -})"""; - - auto actual = - ParseServiceAccountCredentials(contents, "test-data", "unused-uri"); - ASSERT_STATUS_OK(actual); - EXPECT_EQ("not-a-key-id-just-for-testing", actual->private_key_id); - EXPECT_EQ("not-a-valid-key-just-for-testing", actual->private_key); - EXPECT_EQ("test-only@test-group.example.com", actual->client_email); - EXPECT_EQ("https://oauth2.googleapis.com/test_endpoint", actual->token_uri); -} - -/// @test Verify that parsing a service account JSON string works. -TEST_F(ServiceAccountCredentialsTest, ParseUsesExplicitDefaultTokenUri) { - // No token_uri attribute here, so the default passed below should be used. - std::string contents = R"""({ - "type": "service_account", - "private_key_id": "not-a-key-id-just-for-testing", - "private_key": "not-a-valid-key-just-for-testing", - "client_email": "test-only@test-group.example.com" -})"""; - - auto actual = ParseServiceAccountCredentials( - contents, "test-data", "https://oauth2.googleapis.com/test_endpoint"); - ASSERT_STATUS_OK(actual); - EXPECT_EQ("not-a-key-id-just-for-testing", actual->private_key_id); - EXPECT_EQ("not-a-valid-key-just-for-testing", actual->private_key); - EXPECT_EQ("test-only@test-group.example.com", actual->client_email); - EXPECT_EQ("https://oauth2.googleapis.com/test_endpoint", actual->token_uri); -} - -/// @test Verify that parsing a service account JSON string works. -TEST_F(ServiceAccountCredentialsTest, ParseUsesImplicitDefaultTokenUri) { - // No token_uri attribute here. - std::string contents = R"""({ - "type": "service_account", - "private_key_id": "not-a-key-id-just-for-testing", - "private_key": "not-a-valid-key-just-for-testing", - "client_email": "test-only@test-group.example.com" -})"""; - - // No token_uri passed in here, either. - auto actual = ParseServiceAccountCredentials(contents, "test-data"); - ASSERT_STATUS_OK(actual); - EXPECT_EQ("not-a-key-id-just-for-testing", actual->private_key_id); - EXPECT_EQ("not-a-valid-key-just-for-testing", actual->private_key); - EXPECT_EQ("test-only@test-group.example.com", actual->client_email); - EXPECT_EQ(std::string(GoogleOAuthRefreshEndpoint()), actual->token_uri); -} - -/// @test Verify that invalid contents result in a readable error. -TEST_F(ServiceAccountCredentialsTest, ParseInvalidContentsFails) { - EXPECT_THAT(ParseServiceAccountCredentials(R"""( not-a-valid-json-string )""", - "test-as-a-source"), - StatusIs(Not(StatusCode::kOk), - AllOf(HasSubstr("Invalid ServiceAccountCredentials"), - HasSubstr("test-as-a-source")))); - - EXPECT_THAT(ParseServiceAccountCredentials( - R"""("valid-json-but-not-an-object")""", "test-as-a-source"), - StatusIs(Not(StatusCode::kOk), - AllOf(HasSubstr("Invalid ServiceAccountCredentials"), - HasSubstr("test-as-a-source")))); -} - -/// @test Parsing a service account JSON string should detect empty fields. -TEST_F(ServiceAccountCredentialsTest, ParseEmptyFieldFails) { - std::string contents = R"""({ - "type": "service_account", - "private_key": "not-a-valid-key-just-for-testing", - "client_email": "test-only@test-group.example.com", - "token_uri": "https://oauth2.googleapis.com/token" -})"""; - - for (auto const& field : {"private_key", "client_email", "token_uri"}) { - auto json = nlohmann::json::parse(contents); - json[field] = ""; - auto actual = ParseServiceAccountCredentials(json.dump(), "test-data", ""); - EXPECT_THAT(actual, - StatusIs(Not(StatusCode::kOk), - AllOf(HasSubstr(field), HasSubstr(" field is empty"), - HasSubstr("test-data")))); - } -} - -/// @test Parsing a service account JSON string should detect missing fields. -TEST_F(ServiceAccountCredentialsTest, ParseMissingFieldFails) { - std::string contents = R"""({ - "type": "service_account", - "private_key": "not-a-valid-key-just-for-testing", - "client_email": "test-only@test-group.example.com", - "token_uri": "https://oauth2.googleapis.com/token" -})"""; - - for (auto const& field : {"private_key", "client_email"}) { - auto json = nlohmann::json::parse(contents); - json.erase(field); - auto actual = ParseServiceAccountCredentials(json.dump(), "test-data", ""); - EXPECT_THAT(actual, - StatusIs(Not(StatusCode::kOk), - AllOf(HasSubstr(field), HasSubstr(" field is missing"), - HasSubstr("test-data")))); - } -} - -/// @test Parsing a service account JSON string allows an optional field. -TEST_F(ServiceAccountCredentialsTest, ParseOptionalField) { - std::string contents = R"""({ - "type": "service_account", - "private_key_id": "", - "private_key": "not-a-valid-key-just-for-testing", - "client_email": "test-only@test-group.example.com", - "token_uri": "https://oauth2.googleapis.com/token" -})"""; - - auto json = nlohmann::json::parse(contents); - auto actual = ParseServiceAccountCredentials(json.dump(), "test-data", ""); - ASSERT_STATUS_OK(actual.status()); -} - -/// @test Verify that the options are used in the constructor. -TEST_F(ServiceAccountCredentialsTest, UsesCARootsInfo) { - ScopedEnvironment disable_self_signed_jwt( - "GOOGLE_CLOUD_CPP_EXPERIMENTAL_DISABLE_SELF_SIGNED_JWT", "1"); - - auto info = ParseServiceAccountCredentials(MakeTestContents(), "test"); - ASSERT_STATUS_OK(info); - - auto mock_builder = MockHttpRequestBuilder::mock_; - EXPECT_CALL(*mock_builder, BuildRequest()).WillOnce([&] { - MockHttpRequest result; - EXPECT_CALL(*result.mock, MakeRequest).WillOnce([](std::string const&) { - nlohmann::json response{{"token_type", "Mock-Type"}, - {"access_token", "fake-token"}, - {"expires_in", 3600}}; - return HttpResponse{200, response.dump(), {}}; - }); - return result; - }); - - // This is the key check in this test, verify the constructor is called with - // the right parameters. - auto const cainfo = std::string{"fake-cainfo-path-aka-roots-pem"}; - EXPECT_CALL(*mock_builder, Constructor(GoogleOAuthRefreshEndpoint(), - absl::make_optional(cainfo), _)) - .Times(AtLeast(1)); - - auto const expected_header = - std::string{"Content-Type: application/x-www-form-urlencoded"}; - EXPECT_CALL(*mock_builder, AddHeader(StrEq(expected_header))) - .Times(AtLeast(1)); - EXPECT_CALL(*mock_builder, MakeEscapedString(An())) - .WillRepeatedly([](std::string const& s) -> std::unique_ptr { - EXPECT_EQ(kGrantParamUnescaped, s); - auto t = std::unique_ptr(new char[sizeof(kGrantParamEscaped)]); - std::copy(kGrantParamEscaped, - kGrantParamEscaped + sizeof(kGrantParamEscaped), t.get()); - return t; - }); - - ServiceAccountCredentials credentials( - *info, ChannelOptions().set_ssl_root_path(cainfo)); - // Call Refresh to obtain the access token for our authorization header. - auto authorization_header = credentials.AuthorizationHeader(); - ASSERT_STATUS_OK(authorization_header); - EXPECT_EQ("Authorization: Mock-Type fake-token", *authorization_header); -} - -/// @test Verify that we can create sign blobs using a service account. -TEST_F(ServiceAccountCredentialsTest, SignBlob) { - auto info = ParseServiceAccountCredentials(MakeTestContents(), "test"); - ASSERT_STATUS_OK(info); - ServiceAccountCredentials credentials( - *info); - - std::string blob = R"""(GET -rmYdCNHKFXam78uCt7xQLw== -text/plain -1388534400 -x-goog-encryption-algorithm:AES256 -x-goog-meta-foo:bar,baz -/bucket/objectname)"""; - - auto actual = credentials.SignBlob(SigningAccount(), blob); - ASSERT_STATUS_OK(actual); - - // To generate the expected output I used: - // `openssl dgst -sha256 -sign private.pem blob.txt | openssl base64 -A` - // where `blob.txt` contains the `blob` string, and `private.pem` contains - // the private key embedded in `kJsonKeyfileContents`. - std::string expected_signed = - "Zsy8o5ci07DQTvO/" - "SVr47PKsCXvN+" - "FzXga0iYrReAnngdZYewHdcAnMQ8bZvFlTM8HY3msrRw64Jc6hoXVL979An5ugXoZ1ol/" - "DT1KlKp3l9E0JSIbqL88ogpElTxFvgPHOtHOUsy2mzhqOVrNSXSj4EM50gKHhvHKSbFq8Pcj" - "lAkROtq5gqp5t0OFd7EMIaRH+tekVUZjQPfFT/" - "hRW9bSCCV8w1Ex+" - "QxmB5z7P7zZn2pl7JAcL850emTo8f2tfv1xXWQGhACvIJeMdPmyjbc04Ye4M8Ljpkg3YhE6l" - "4GwC2MnI8TkuoHe4Bj2MvA8mM8TVwIvpBs6Etsj6Jdaz4rg=="; - EXPECT_EQ(expected_signed, internal::Base64Encode(*actual)); -} - -/// @test Verify that signing blobs fails with invalid e-mail. -TEST_F(ServiceAccountCredentialsTest, SignBlobFailure) { - auto info = ParseServiceAccountCredentials(MakeTestContents(), "test"); - ASSERT_STATUS_OK(info); - ServiceAccountCredentials credentials( - *info); - - auto actual = - credentials.SignBlob(SigningAccount("fake@fake.com"), "test-blob"); - EXPECT_THAT( - actual, - StatusIs(StatusCode::kInvalidArgument, - HasSubstr("The current_credentials cannot sign blobs for "))); -} - -/// @test Verify that we can get the client id from a service account. -TEST_F(ServiceAccountCredentialsTest, ClientId) { - auto info = ParseServiceAccountCredentials(MakeTestContents(), "test"); - ASSERT_STATUS_OK(info); - ServiceAccountCredentials credentials( - *info); - - EXPECT_EQ("foo-email@foo-project.iam.gserviceaccount.com", - credentials.AccountEmail()); - EXPECT_EQ("a1a111aa1111a11a11a11aa111a111a1a1111111", credentials.KeyId()); -} - -char const kP12KeyFileMissingCerts[] = - "MIIDzAIBAzCCA5IGCSqGSIb3DQEHAaCCA4MEggN/MIIDezCCA3cGCSqGSIb3DQEH" - "BqCCA2gwggNkAgEAMIIDXQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQILaGB" - "fWhJ2V0CAggAgIIDMM5EI/ck4VQD4JyGchVPbgd5HQjFbn+HThIoxBYpMPEK+iT7" - "t32idiirDi0qH+6nZancp69nnKhjpAOnMLSjCvba7HDFzi/op7fgf9hnwupEOahv" - "4b8Wv0S9ePTqsLfJy8tJzOAPYKOJO7HGSeZanWh2HpyCd2g1K1dBXsqsabTtJBsF" - "TSGsfUg08/SMT5o12BlMk/wjzUrcSNQxntyPXLfjO1uZ0gFjFO6xsFyclVWr8Zax" - "7fTA6SLdgeE1Iu2+mS1ohwNNzeBrCU6kXVzgw1GSn0UV0ZGbANRWDZZThWzQs9UW" - "sn8l1fr70OZ4JhUwPZe9g0Tu7EeGNPkM5dW1Lr3izKNtYdInBD/1J7wGxsmomsU3" - "khIH2FMqqYX7NFkI0TZiHpLYk2bQmMnfFbBDlXluzO2iLvBY5FPUCn5W4ZPAJlFs" - "Ryo/OytciwJUIRoz76CIg3TmzM1b+RLBMEr6lAsD1za3fcTMwbsBeYY0FEFfb/I6" - "ddmJTxjbCLPLekgkV7MIFSWPiL4t2eXR3rlu1Vnoys0aTWmFtJhEOI16Q1bkJ9L1" - "c/KXHm/Srccm8hTazNYQewHRXWiAvigg6slRnx1I36Z0TMbnikDVCRH8cjFsMKO5" - "/qNMKSsZ6EAePHYAu4N5CpqaTl0hjHI8sW+CDzzmGOn8Acb00gJ+DOu+wiTZtJYS" - "GIZogs7PluMJ7cU1Ju38OixWbQDvfDdloQ/7kZrM6DoEKhvC2bwMwlfxin9jUwjJ" - "98dtdAwQVgckvnYYVpqKnn/dlkiStaiZFKx27kw6o2oobcDrkg0wtOZFeX8k0SXZ" - "ekcmMc5Xfl+5HyJxH5ni8UmHyOHAM8dNjpnzCD9J2K0U7z8kdzslZ95X5MAxYIUa" - "r50tIaWHxeLLYYZUi+nyjNbMZ+yvAqOjQqI1mIcYZurHRPRIHVi2x4nfcKKQIkxn" - "UTF9d3VWbkWoJ1qfe0OSpWg4RrdgDCSB1BlF0gQHEsDTT5/xoZIEoUV8t6TYTVCe" - "axreBYxLhvROONz94v6GD6Eb4kakbSObn8NuBiWnaPevFyEF5YluKR87MbZRQY0Z" - "yJ/4PuEhDIioRdY7ujAxMCEwCQYFKw4DAhoFAAQU4/UMFJQGUvgPuTXRKp0gVU4B" - "GbkECPTYJIica3DWAgIIAA=="; - -char const kP12KeyFileMissingKey[] = - "MIIDzAIBAzCCA5IGCSqGSIb3DQEHAaCCA4MEggN/MIIDezCCA3cGCSqGSIb3DQEH" - "BqCCA2gwggNkAgEAMIIDXQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQILaGB" - "fWhJ2V0CAggAgIIDMM5EI/ck4VQD4JyGchVPbgd5HQjFbn+HThIoxBYpMPEK+iT7" - "t32idiirDi0qH+6nZancp69nnKhjpAOnMLSjCvba7HDFzi/op7fgf9hnwupEOahv" - "4b8Wv0S9ePTqsLfJy8tJzOAPYKOJO7HGSeZanWh2HpyCd2g1K1dBXsqsabTtJBsF" - "TSGsfUg08/SMT5o12BlMk/wjzUrcSNQxntyPXLfjO1uZ0gFjFO6xsFyclVWr8Zax" - "7fTA6SLdgeE1Iu2+mS1ohwNNzeBrCU6kXVzgw1GSn0UV0ZGbANRWDZZThWzQs9UW" - "sn8l1fr70OZ4JhUwPZe9g0Tu7EeGNPkM5dW1Lr3izKNtYdInBD/1J7wGxsmomsU3" - "khIH2FMqqYX7NFkI0TZiHpLYk2bQmMnfFbBDlXluzO2iLvBY5FPUCn5W4ZPAJlFs" - "Ryo/OytciwJUIRoz76CIg3TmzM1b+RLBMEr6lAsD1za3fcTMwbsBeYY0FEFfb/I6" - "ddmJTxjbCLPLekgkV7MIFSWPiL4t2eXR3rlu1Vnoys0aTWmFtJhEOI16Q1bkJ9L1" - "c/KXHm/Srccm8hTazNYQewHRXWiAvigg6slRnx1I36Z0TMbnikDVCRH8cjFsMKO5" - "/qNMKSsZ6EAePHYAu4N5CpqaTl0hjHI8sW+CDzzmGOn8Acb00gJ+DOu+wiTZtJYS" - "GIZogs7PluMJ7cU1Ju38OixWbQDvfDdloQ/7kZrM6DoEKhvC2bwMwlfxin9jUwjJ" - "98dtdAwQVgckvnYYVpqKnn/dlkiStaiZFKx27kw6o2oobcDrkg0wtOZFeX8k0SXZ" - "ekcmMc5Xfl+5HyJxH5ni8UmHyOHAM8dNjpnzCD9J2K0U7z8kdzslZ95X5MAxYIUa" - "r50tIaWHxeLLYYZUi+nyjNbMZ+yvAqOjQqI1mIcYZurHRPRIHVi2x4nfcKKQIkxn" - "UTF9d3VWbkWoJ1qfe0OSpWg4RrdgDCSB1BlF0gQHEsDTT5/xoZIEoUV8t6TYTVCe" - "axreBYxLhvROONz94v6GD6Eb4kakbSObn8NuBiWnaPevFyEF5YluKR87MbZRQY0Z" - "yJ/4PuEhDIioRdY7ujAxMCEwCQYFKw4DAhoFAAQU4/UMFJQGUvgPuTXRKp0gVU4B" - "GbkECPTYJIica3DWAgIIAA=="; - -/// @test Verify that parsing a service account JSON string works. -TEST_F(ServiceAccountCredentialsTest, ParseSimpleP12) { - auto filename = CreateRandomFileName() + ".p12"; - WriteBase64AsBinary(filename, kP12KeyFileContents); - - auto info = ParseServiceAccountP12File(filename); - EXPECT_EQ(0, std::remove(filename.c_str())); - - if (info.status().code() == StatusCode::kInvalidArgument) { - if (absl::StrContains(info.status().message(), "error:0308010C")) { - // With OpenSSL 3.0 the PKCS#12 files may not be supported by default. - GTEST_SKIP() << "PKCS#12 support unavailable, skipping test"; - } -#if _WIN32 - // On Windows, the OS may not have the necessary providers to support - // PKCS#12. Unfortunately the error message is not as unambiguous, so we use - // the function that fails instead. - auto const& metadata = info.status().error_info().metadata(); - auto const l = metadata.find("gcloud-cpp.source.function"); - if (l != metadata.end() && l->second == "GetCertificatePrivateKey") { - GTEST_SKIP() << "PKCS#12 support unavailable, skipping test"; - } -#endif // _WIN32 - } - ASSERT_STATUS_OK(info); - - EXPECT_EQ(kP12ServiceAccountId, info->client_email); - EXPECT_FALSE(info->private_key.empty()); - - ServiceAccountCredentials<> credentials(*info); - - auto signed_blob = credentials.SignBlob(SigningAccount(), "test-blob"); - EXPECT_STATUS_OK(signed_blob); -} - -TEST_F(ServiceAccountCredentialsTest, ParseP12MissingKey) { - std::string filename = CreateRandomFileName() + ".p12"; - WriteBase64AsBinary(filename, kP12KeyFileMissingKey); - auto info = ParseServiceAccountP12File(filename); - EXPECT_THAT(info, Not(IsOk())); -} - -TEST_F(ServiceAccountCredentialsTest, ParseP12MissingCerts) { - std::string filename = google::cloud::internal::PathAppend( - ::testing::TempDir(), CreateRandomFileName() + ".p12"); - WriteBase64AsBinary(filename, kP12KeyFileMissingCerts); - auto info = ParseServiceAccountP12File(filename); - EXPECT_THAT(info, Not(IsOk())); -} - -TEST_F(ServiceAccountCredentialsTest, CreateFromP12MissingFile) { - std::string filename = CreateRandomFileName(); - // Loading a non-existent file should fail. - auto actual = CreateServiceAccountCredentialsFromP12FilePath(filename); - EXPECT_THAT(actual, Not(IsOk())); -} - -TEST_F(ServiceAccountCredentialsTest, CreateFromP12EmptyFile) { - std::string filename = CreateRandomFileName(); - std::ofstream(filename).close(); - - // Loading an empty file should fail. - auto actual = CreateServiceAccountCredentialsFromP12FilePath(filename); - EXPECT_THAT(actual, Not(IsOk())); - - EXPECT_EQ(0, std::remove(filename.c_str())); -} - -TEST_F(ServiceAccountCredentialsTest, CreateFromP12ValidFile) { - std::string filename = CreateRandomFileName() + ".p12"; - WriteBase64AsBinary(filename, kP12KeyFileContents); - - auto actual = CreateServiceAccountCredentialsFromP12FilePath(filename); - EXPECT_EQ(0, std::remove(filename.c_str())); - - if (actual.status().code() == StatusCode::kInvalidArgument) { - if (absl::StrContains(actual.status().message(), "error:0308010C")) { - // With OpenSSL 3.0 the PKCS#12 files may not be supported by default. - GTEST_SKIP() << "PKCS#12 support unavailable, skipping test"; - } -#if _WIN32 - // On Windows, the OS may not have the necessary providers to support - // PKCS#12. Unfortunately the error message is not as unambiguous, so we use - // the function that fails instead. - auto const& metadata = actual.status().error_info().metadata(); - auto const l = metadata.find("gcloud-cpp.source.function"); - if (l != metadata.end() && l->second == "GetCertificatePrivateKey") { - GTEST_SKIP() << "PKCS#12 support unavailable, skipping test"; - } -#endif // _WIN32 - } - EXPECT_STATUS_OK(actual); -} - -/// @test Verify we can obtain JWT assertion components given the info parsed -/// from a keyfile. -TEST_F(ServiceAccountCredentialsTest, AssertionComponentsFromInfo) { - auto info = ParseServiceAccountCredentials(MakeTestContents(), "test"); - ASSERT_STATUS_OK(info); - auto const clock_value_1 = 10000; - FakeClock::now_value_ = clock_value_1; - auto components = AssertionComponentsFromInfo(*info, FakeClock::now()); - - auto header = nlohmann::json::parse(components.first); - EXPECT_EQ("RS256", header.value("alg", "")); - EXPECT_EQ("JWT", header.value("typ", "")); - EXPECT_EQ(info->private_key_id, header.value("kid", "")); - - auto payload = nlohmann::json::parse(components.second); - EXPECT_EQ(clock_value_1, payload.value("iat", 0)); - EXPECT_EQ(clock_value_1 + 3600, payload.value("exp", 0)); - EXPECT_EQ(info->client_email, payload.value("iss", "")); - EXPECT_EQ(info->token_uri, payload.value("aud", "")); -} - -/// @test Verify we can construct a JWT assertion given the info parsed from a -/// keyfile. -TEST_F(ServiceAccountCredentialsTest, MakeJWTAssertion) { - auto info = ParseServiceAccountCredentials(MakeTestContents(), "test"); - ASSERT_STATUS_OK(info); - FakeClock::reset_clock(kFixedJwtTimestamp); - auto components = AssertionComponentsFromInfo(*info, FakeClock::now()); - auto assertion = - MakeJWTAssertion(components.first, components.second, info->private_key); - - auto const body = UrlsafeBase64Encode(components.first) + "." + - UrlsafeBase64Encode(components.second); - auto signed_body = - google::cloud::internal::SignUsingSha256(body, info->private_key); - ASSERT_STATUS_OK(signed_body); - - std::vector actual_tokens = absl::StrSplit(assertion, '.'); - EXPECT_THAT(actual_tokens, ElementsAre(UrlsafeBase64Encode(components.first), - UrlsafeBase64Encode(components.second), - UrlsafeBase64Encode(*signed_body))); -} - -/// @test Verify we can construct a service account refresh payload given the -/// info parsed from a keyfile. -TEST_F(ServiceAccountCredentialsTest, CreateServiceAccountRefreshPayload) { - auto info = ParseServiceAccountCredentials(MakeTestContents(), "test"); - ASSERT_STATUS_OK(info); - FakeClock::reset_clock(kFixedJwtTimestamp); - auto components = AssertionComponentsFromInfo(*info, FakeClock::now()); - auto assertion = - MakeJWTAssertion(components.first, components.second, info->private_key); - auto actual_payload = CreateServiceAccountRefreshPayload( - *info, kGrantParamEscaped, FakeClock::now()); - - EXPECT_THAT(actual_payload, HasSubstr(std::string("assertion=") + assertion)); - EXPECT_THAT(actual_payload, HasSubstr(kGrantParamUnescaped)); -} - -/// @test Parsing a refresh response with missing fields results in failure. -TEST_F(ServiceAccountCredentialsTest, - ParseServiceAccountRefreshResponseInvalid) { - ScopedEnvironment disable_self_signed_jwt( - "GOOGLE_CLOUD_CPP_EXPERIMENTAL_DISABLE_SELF_SIGNED_JWT", "1"); - - std::string r1 = R"""({})"""; - // Does not have access_token. - std::string r2 = R"""({ - "token_type": "Type", - "id_token": "id-token-value", - "expires_in": 1000 -})"""; - - FakeClock::reset_clock(1000); - auto status = ParseServiceAccountRefreshResponse(HttpResponse{400, r1, {}}, - FakeClock::now()); - EXPECT_THAT(status, - StatusIs(StatusCode::kInvalidArgument, - HasSubstr("Could not find all required fields"))); - - status = ParseServiceAccountRefreshResponse(HttpResponse{400, r2, {}}, - FakeClock::now()); - EXPECT_THAT(status, - StatusIs(StatusCode::kInvalidArgument, - HasSubstr("Could not find all required fields"))); - - EXPECT_THAT( - ParseServiceAccountRefreshResponse( - HttpResponse{400, R"js("valid-json-but-not-an-object")js", {}}, - FakeClock::now()), - StatusIs(StatusCode::kInvalidArgument, - HasSubstr("Could not find all required fields"))); -} - -/// @test Parsing a refresh response yields a TemporaryToken. -TEST_F(ServiceAccountCredentialsTest, ParseServiceAccountRefreshResponse) { - ScopedEnvironment disable_self_signed_jwt( - "GOOGLE_CLOUD_CPP_EXPERIMENTAL_DISABLE_SELF_SIGNED_JWT", "1"); - - std::string r1 = R"""({ - "token_type": "Type", - "access_token": "access-token-r1", - "expires_in": 1000 -})"""; - - auto expires_in = 1000; - FakeClock::reset_clock(2000); - auto status = ParseServiceAccountRefreshResponse(HttpResponse{200, r1, {}}, - FakeClock::now()); - EXPECT_STATUS_OK(status); - auto token = *status; - EXPECT_EQ( - std::chrono::time_point_cast(token.expiration_time) - .time_since_epoch() - .count(), - FakeClock::now_value_ + expires_in); - EXPECT_EQ(token.token, "Authorization: Type access-token-r1"); -} - -TEST_F(ServiceAccountCredentialsTest, MakeSelfSignedJWT) { - auto info = ParseServiceAccountCredentials(MakeTestContents(), "test"); - ASSERT_STATUS_OK(info); - auto const now = std::chrono::system_clock::now(); - auto actual = MakeSelfSignedJWT(*info, now); - ASSERT_STATUS_OK(actual); - - std::vector components = absl::StrSplit(*actual, '.'); - std::vector decoded(components.size()); - std::transform(components.begin(), components.end(), decoded.begin(), - [](std::string const& e) { - auto v = UrlsafeBase64Decode(e).value(); - return std::string{v.begin(), v.end()}; - }); - ASSERT_THAT(3, decoded.size()); - auto const header = nlohmann::json::parse(decoded[0], nullptr); - ASSERT_FALSE(header.is_null()) << "header=" << decoded[0]; - auto const payload = nlohmann::json::parse(decoded[1], nullptr); - ASSERT_FALSE(payload.is_null()) << "payload=" << decoded[1]; - - auto const expected_header = nlohmann::json{ - {"alg", "RS256"}, {"typ", "JWT"}, {"kid", info->private_key_id}}; - - auto const iat = - std::chrono::duration_cast(now.time_since_epoch()); - auto const exp = iat + std::chrono::hours(1); - auto const expected_payload = nlohmann::json{ - {"iss", info->client_email}, - {"sub", info->client_email}, - {"iat", iat.count()}, - {"exp", exp.count()}, - {"scope", "https://www.googleapis.com/auth/cloud-platform"}, - }; - - ASSERT_EQ(expected_header, header) << "header=" << header; - ASSERT_EQ(expected_payload, payload) << "payload=" << payload; - - auto signature = - SignUsingSha256(components[0] + '.' + components[1], info->private_key); - ASSERT_STATUS_OK(signature); - EXPECT_THAT(*signature, - ElementsAreArray(decoded[2].begin(), decoded[2].end())); -} - -TEST_F(ServiceAccountCredentialsTest, MakeSelfSignedJWTWithScopes) { - auto info = ParseServiceAccountCredentials(MakeTestContents(), "test"); - ASSERT_STATUS_OK(info); - info->scopes = std::set{"test-only-s1", "test-only-s2"}; - - auto const now = std::chrono::system_clock::now(); - auto actual = MakeSelfSignedJWT(*info, now); - ASSERT_STATUS_OK(actual); - - std::vector components = absl::StrSplit(*actual, '.'); - std::vector decoded(components.size()); - std::transform(components.begin(), components.end(), decoded.begin(), - [](std::string const& e) { - auto v = UrlsafeBase64Decode(e).value(); - return std::string{v.begin(), v.end()}; - }); - ASSERT_THAT(3, decoded.size()); - auto const header = nlohmann::json::parse(decoded[0], nullptr); - ASSERT_FALSE(header.is_null()) << "header=" << decoded[0]; - auto const payload = nlohmann::json::parse(decoded[1], nullptr); - ASSERT_FALSE(payload.is_null()) << "payload=" << decoded[1]; - - auto const expected_header = nlohmann::json{ - {"alg", "RS256"}, {"typ", "JWT"}, {"kid", info->private_key_id}}; - - auto const iat = - std::chrono::duration_cast(now.time_since_epoch()); - auto const exp = iat + std::chrono::hours(1); - auto const expected_payload = nlohmann::json{ - {"iss", info->client_email}, - {"sub", info->client_email}, - {"iat", iat.count()}, - {"exp", exp.count()}, - {"scope", "test-only-s1 test-only-s2"}, - }; - - ASSERT_EQ(expected_header, header) << "header=" << header; - ASSERT_EQ(expected_payload, payload) << "payload=" << payload; - - auto signature = - SignUsingSha256(components[0] + '.' + components[1], info->private_key); - ASSERT_STATUS_OK(signature); - EXPECT_THAT(*signature, - ElementsAreArray(decoded[2].begin(), decoded[2].end())); -} - -TEST_F(ServiceAccountCredentialsTest, UseOauth) { - std::string filename = CreateRandomFileName() + ".p12"; - WriteBase64AsBinary(filename, kP12KeyFileContents); - - auto p12_info = ParseServiceAccountP12File(filename); - EXPECT_EQ(0, std::remove(filename.c_str())); - - auto json_info_without_scopes = - ParseServiceAccountCredentials(MakeTestContents(), "test"); - ASSERT_STATUS_OK(json_info_without_scopes); - ASSERT_FALSE(json_info_without_scopes->scopes.has_value()); - auto json_info_with_scopes = *json_info_without_scopes; - json_info_with_scopes.scopes = - std::set{{GoogleOAuthScopeCloudPlatform()}}; - - struct TestCase { - std::string name; - ServiceAccountCredentialsInfo info; - absl::optional environment; - bool expected; - }; - - std::vector cases = { - {"JSON/with-scopes/no-env", json_info_with_scopes, absl::nullopt, true}, - {"JSON/with-scopes/env", json_info_with_scopes, "1", true}, - {"JSON/no-scopes/no-env", *json_info_without_scopes, absl::nullopt, - false}, - {"JSON/no-scopes/env", *json_info_without_scopes, "1", true}, - }; - if (p12_info) { - // Some environments do not support PKCS$12, we need to test the other - // cases. - cases.push_back({"P12/no-env", *p12_info, absl::nullopt, true}); - cases.push_back({"P12/env", *p12_info, "1", true}); - } - - for (auto const& test : cases) { - SCOPED_TRACE("Testing for " + test.name); - ScopedEnvironment env( - "GOOGLE_CLOUD_CPP_EXPERIMENTAL_DISABLE_SELF_SIGNED_JWT", - test.environment); - EXPECT_EQ(test.expected, ServiceAccountUseOAuth(test.info)); - } -} - -TEST_F(ServiceAccountCredentialsTest, CachingWithSelfSignedJwt) { - auto clear = ScopedEnvironment( - "GOOGLE_CLOUD_CPP_EXPERIMENTAL_DISABLE_SELF_SIGNED_JWT", absl::nullopt); - auto info = ParseServiceAccountCredentials(MakeTestContents(), "test"); - ASSERT_STATUS_OK(info); - - ServiceAccountCredentials<> tested(*info); - auto tp = std::chrono::system_clock::now(); - auto initial = ServiceAccountCredentialsTester::Header(tested, tp); - ASSERT_STATUS_OK(initial); - - auto cached = ServiceAccountCredentialsTester::Header( - tested, tp + std::chrono::seconds(30)); - EXPECT_THAT(cached, IsOkAndHolds(*initial)); - - cached = ServiceAccountCredentialsTester::Header( - tested, tp + std::chrono::seconds(300)); - EXPECT_THAT(cached, IsOkAndHolds(*initial)); - - auto uncached = ServiceAccountCredentialsTester::Header( - tested, tp + std::chrono::hours(2)); - ASSERT_STATUS_OK(uncached); - EXPECT_NE(*initial, *uncached); -} - -} // namespace -} // namespace oauth2 -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage -} // namespace cloud -} // namespace google 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 08af74427b10b..82590845179ea 100644 --- a/google/cloud/storage/object_metadata.cc +++ b/google/cloud/storage/object_metadata.cc @@ -15,8 +15,8 @@ #include "google/cloud/storage/object_metadata.h" #include "google/cloud/storage/internal/metadata_parser.h" #include "google/cloud/storage/internal/object_acl_requests.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/format_time_point.h" +#include "absl/strings/str_join.h" #include #include #include @@ -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/options.h b/google/cloud/storage/options.h index 4a5204e58dfb1..f64f5d1f28e51 100644 --- a/google/cloud/storage/options.h +++ b/google/cloud/storage/options.h @@ -16,7 +16,6 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OPTIONS_H #include "google/cloud/storage/idempotency_policy.h" -#include "google/cloud/storage/oauth2/credentials.h" #include "google/cloud/storage/retry_policy.h" #include "google/cloud/storage/version.h" #include "google/cloud/backoff_policy.h" @@ -89,18 +88,6 @@ struct IamEndpointOption { using Type = std::string; }; -/** - * Configure oauth2::Credentials for the GCS client library. - * - * @ingroup storage-options - * - * @deprecated prefer using `google::cloud::UnifiedCredentialsOption` and the - * unified credentials documented in @ref guac - */ -struct Oauth2CredentialsOption { - using Type = std::shared_ptr; -}; - /** * Set the Google Cloud Platform project id. * @@ -332,9 +319,8 @@ struct IdempotencyPolicyOption { /// The complete list of options accepted by `storage::Client`. using ClientOptionList = ::google::cloud::OptionList< - RestEndpointOption, IamEndpointOption, Oauth2CredentialsOption, - ProjectIdOption, ProjectIdOption, ConnectionPoolSizeOption, - DownloadBufferSizeOption, UploadBufferSizeOption, + RestEndpointOption, IamEndpointOption, ProjectIdOption, ProjectIdOption, + ConnectionPoolSizeOption, DownloadBufferSizeOption, UploadBufferSizeOption, EnableCurlSslLockingOption, EnableCurlSigpipeHandlerOption, MaximumCurlSocketRecvSizeOption, MaximumCurlSocketSendSizeOption, TransferStallTimeoutOption, RetryPolicyOption, BackoffPolicyOption, diff --git a/google/cloud/storage/parallel_uploads_test.cc b/google/cloud/storage/parallel_uploads_test.cc index 5542b31641a57..68a0f40f27834 100644 --- a/google/cloud/storage/parallel_uploads_test.cc +++ b/google/cloud/storage/parallel_uploads_test.cc @@ -14,7 +14,6 @@ #include "google/cloud/storage/internal/bucket_metadata_parser.h" #include "google/cloud/storage/internal/object_metadata_parser.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/parallel_upload.h" #include "google/cloud/storage/retry_policy.h" #include "google/cloud/storage/testing/canonical_errors.h" diff --git a/google/cloud/storage/policy_document.cc b/google/cloud/storage/policy_document.cc index cbab4dff96367..26ea2f7ab5642 100644 --- a/google/cloud/storage/policy_document.cc +++ b/google/cloud/storage/policy_document.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "google/cloud/storage/policy_document.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/format_time_point.h" +#include "absl/strings/str_join.h" #include #include #include diff --git a/google/cloud/storage/quickstart/.bazelrc b/google/cloud/storage/quickstart/.bazelrc index f8f4bb3e07a87..1ccef142904e8 100644 --- a/google/cloud/storage/quickstart/.bazelrc +++ b/google/cloud/storage/quickstart/.bazelrc @@ -15,19 +15,12 @@ # 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 +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 - -#Our quickstarts do not yet support bzlmod -build --noenable_bzlmod 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/BUILD.bazel b/google/cloud/storage/quickstart/BUILD.bazel index 8d7ef136e9d0f..d7b53ab25f46a 100644 --- a/google/cloud/storage/quickstart/BUILD.bazel +++ b/google/cloud/storage/quickstart/BUILD.bazel @@ -32,8 +32,7 @@ cc_binary( "quickstart_grpc.cc", ], deps = [ - # TODO(#13857) - remove backwards compatibility shims - "@google_cloud_cpp//:experimental-storage_grpc", + "@google_cloud_cpp//:storage_grpc", ], ) @@ -43,7 +42,6 @@ cc_binary( "quickstart_async.cc", ], deps = [ - # TODO(#13857) - remove backwards compatibility shims - "@google_cloud_cpp//:experimental-storage_grpc", + "@google_cloud_cpp//:storage_grpc", ], ) diff --git a/google/cloud/storage/quickstart/CMakeLists.txt b/google/cloud/storage/quickstart/CMakeLists.txt index 5ec92439433b6..9eaac7221d702 100644 --- a/google/cloud/storage/quickstart/CMakeLists.txt +++ b/google/cloud/storage/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # A minimal CMakeList.txt showing how to use the Google Cloud Storage C++ client # library in CMake-based projects. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-storage-quickstart CXX) find_package(google_cloud_cpp_storage REQUIRED) @@ -38,9 +38,7 @@ if (NOT google_cloud_cpp_storage_grpc_FOUND) endif () add_executable(quickstart_grpc EXCLUDE_FROM_ALL quickstart_grpc.cc) -target_link_libraries(quickstart_grpc - google-cloud-cpp::experimental-storage_grpc) +target_link_libraries(quickstart_grpc google-cloud-cpp::storage_grpc) add_executable(quickstart_async EXCLUDE_FROM_ALL quickstart_async.cc) -target_link_libraries(quickstart_async - google-cloud-cpp::experimental-storage_grpc) +target_link_libraries(quickstart_async google-cloud-cpp::storage_grpc) diff --git a/google/cloud/storage/quickstart/MODULE.bazel b/google/cloud/storage/quickstart/MODULE.bazel new file mode 100644 index 0000000000000..e47bfb6fa8af0 --- /dev/null +++ b/google/cloud/storage/quickstart/MODULE.bazel @@ -0,0 +1,20 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +module( + name = "quickstart", + version = "0.0.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 696698fa03d07..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 = "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/storage/quickstart/bazel/BUILD.bazel b/google/cloud/storage/quickstart/bazel/BUILD.bazel new file mode 100644 index 0000000000000..9d3c52804de76 --- /dev/null +++ b/google/cloud/storage/quickstart/bazel/BUILD.bazel @@ -0,0 +1,17 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 v2 + +package(default_visibility = ["//:__subpackages__"]) diff --git a/google/cloud/storage/quickstart/bazel/remove_upb_c_rules.patch b/google/cloud/storage/quickstart/bazel/remove_upb_c_rules.patch new file mode 100644 index 0000000000000..43b077224c29d --- /dev/null +++ b/google/cloud/storage/quickstart/bazel/remove_upb_c_rules.patch @@ -0,0 +1,124 @@ +diff --git google/api/expr/v1alpha1/BUILD.bazel google/api/expr/v1alpha1/BUILD.bazel +index 9bed46809..197e5249c 100644 +--- google/api/expr/v1alpha1/BUILD.bazel ++++ google/api/expr/v1alpha1/BUILD.bazel +@@ -233,32 +233,32 @@ cc_proto_library( + ############################################################################## + # upb + ############################################################################## +-load( +- "@com_google_googleapis_imports//:imports.bzl", +- "upb_c_proto_library", +-) +- +-upb_c_proto_library( +- name = "checked_upb_proto", +- deps = [":checked_proto"], +-) +- +-upb_c_proto_library( +- name = "eval_upb_proto", +- deps = [":eval_proto"], +-) +- +-upb_c_proto_library( +- name = "explain_upb_proto", +- deps = [":explain_proto"], +-) +- +-upb_c_proto_library( +- name = "syntax_upb_proto", +- deps = [":syntax_proto"], +-) +- +-upb_c_proto_library( +- name = "value_upb_proto", +- deps = [":value_proto"], +-) ++#load( ++ #"@com_google_googleapis_imports//:imports.bzl", ++ #"upb_c_proto_library", ++#) ++# ++#upb_c_proto_library( ++ #name = "checked_upb_proto", ++ #deps = [":checked_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "eval_upb_proto", ++ #deps = [":eval_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "explain_upb_proto", ++ #deps = [":explain_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "syntax_upb_proto", ++ #deps = [":syntax_proto"], ++#) ++# ++#upb_c_proto_library( ++ #name = "value_upb_proto", ++ #deps = [":value_proto"], ++#) +diff --git google/rpc/BUILD.bazel google/rpc/BUILD.bazel +index 31fd6457d..c38f00c46 100644 +--- google/rpc/BUILD.bazel ++++ google/rpc/BUILD.bazel +@@ -11,7 +11,7 @@ load( + "php_proto_library", + "py_gapic_assembly_pkg", + "py_proto_library", +- "upb_c_proto_library", ++ #"upb_c_proto_library", + ) + load("@rules_proto//proto:defs.bzl", "proto_library") + +@@ -104,15 +104,15 @@ cc_proto_library( + deps = [":status_proto"], + ) + +-upb_c_proto_library( +- name = "code_upb_proto", +- deps = [":code_proto"], +-) ++#upb_c_proto_library( ++ #name = "code_upb_proto", ++ #deps = [":code_proto"], ++#) + +-upb_c_proto_library( +- name = "status_upb_proto", +- deps = [":status_proto"], +-) ++#upb_c_proto_library( ++ #name = "status_upb_proto", ++ #deps = [":status_proto"], ++#) + + py_proto_library( + name = "code_py_proto", +diff --git repository_rules.bzl repository_rules.bzl +index 2f87ad682..2ab3bd054 100644 +--- repository_rules.bzl ++++ repository_rules.bzl +@@ -224,11 +224,11 @@ def switched_rules_by_language( + # + # upb + # +- rules["upb_c_proto_library"] = _switch( +- upb, +- "@com_google_protobuf//bazel:upb_c_proto_library.bzl", +- "upb_c_proto_library", +- ) ++ #rules["upb_c_proto_library"] = _switch( ++ # upb, ++ # "@com_google_protobuf//bazel:upb_c_proto_library.bzl", ++ # "upb_c_proto_library", ++ #) + + # + # PHP diff --git a/google/cloud/storage/storage_client_unit_tests.bzl b/google/cloud/storage/storage_client_unit_tests.bzl index b1a8a1bdb56e3..54c1c64a555b6 100644 --- a/google/cloud/storage/storage_client_unit_tests.bzl +++ b/google/cloud/storage/storage_client_unit_tests.bzl @@ -31,7 +31,6 @@ storage_client_unit_tests = [ "client_object_acl_test.cc", "client_object_copy_test.cc", "client_object_test.cc", - "client_options_test.cc", "client_service_account_test.cc", "client_sign_policy_document_test.cc", "client_sign_url_test.cc", @@ -42,9 +41,6 @@ storage_client_unit_tests = [ "hashing_options_test.cc", "hmac_key_metadata_test.cc", "idempotency_policy_test.cc", - "internal/access_control_common_parser_test.cc", - "internal/access_control_common_test.cc", - "internal/access_token_credentials_test.cc", "internal/base64_test.cc", "internal/bucket_acl_requests_test.cc", "internal/bucket_requests_test.cc", @@ -71,7 +67,6 @@ storage_client_unit_tests = [ "internal/hash_values_test.cc", "internal/hmac_key_requests_test.cc", "internal/http_response_test.cc", - "internal/impersonate_service_account_credentials_test.cc", "internal/logging_stub_test.cc", "internal/make_jwt_assertion_test.cc", "internal/md5hash_test.cc", @@ -95,7 +90,6 @@ storage_client_unit_tests = [ "internal/tracing_connection_test.cc", "internal/tracing_object_read_source_test.cc", "internal/tuple_filter_test.cc", - "internal/unified_rest_credentials_test.cc", "lifecycle_rule_test.cc", "list_buckets_extended_reader_test.cc", "list_buckets_reader_test.cc", @@ -103,12 +97,6 @@ storage_client_unit_tests = [ "list_objects_and_prefixes_reader_test.cc", "list_objects_reader_test.cc", "notification_metadata_test.cc", - "oauth2/anonymous_credentials_test.cc", - "oauth2/authorized_user_credentials_test.cc", - "oauth2/compute_engine_credentials_test.cc", - "oauth2/google_application_default_credentials_file_test.cc", - "oauth2/google_credentials_test.cc", - "oauth2/service_account_credentials_test.cc", "object_access_control_test.cc", "object_metadata_test.cc", "object_retention_test.cc", diff --git a/google/cloud/storage/testing/client_unit_test.cc b/google/cloud/storage/testing/client_unit_test.cc index 66a2cb45f389a..b7c828a523d22 100644 --- a/google/cloud/storage/testing/client_unit_test.cc +++ b/google/cloud/storage/testing/client_unit_test.cc @@ -21,13 +21,9 @@ namespace storage { namespace testing { using ::testing::Return; -using ::testing::ReturnRef; ClientUnitTest::ClientUnitTest() - : mock_(std::make_shared()), - client_options_(ClientOptions(oauth2::CreateAnonymousCredentials())) { - EXPECT_CALL(*mock_, client_options()) - .WillRepeatedly(ReturnRef(client_options_)); + : mock_(std::make_shared()) { EXPECT_CALL(*mock_, options) .WillRepeatedly(Return(storage::internal::DefaultOptionsWithCredentials( Options{} diff --git a/google/cloud/storage/testing/client_unit_test.h b/google/cloud/storage/testing/client_unit_test.h index 5cb34074af098..17734caf5b2e1 100644 --- a/google/cloud/storage/testing/client_unit_test.h +++ b/google/cloud/storage/testing/client_unit_test.h @@ -34,7 +34,6 @@ class ClientUnitTest : public ::testing::Test { google::cloud::storage::Client ClientForMock(); std::shared_ptr mock_; - ClientOptions client_options_; }; } // namespace testing diff --git a/google/cloud/storage/testing/mock_client.h b/google/cloud/storage/testing/mock_client.h index 0c4161f9d3343..1faa1d99b4f27 100644 --- a/google/cloud/storage/testing/mock_client.h +++ b/google/cloud/storage/testing/mock_client.h @@ -31,11 +31,7 @@ namespace testing { class MockClient : public google::cloud::storage::internal::StorageConnection { public: - MockClient() - : client_options_( - google::cloud::storage::oauth2::CreateAnonymousCredentials()) { - EXPECT_CALL(*this, client_options()) - .WillRepeatedly(::testing::ReturnRef(client_options_)); + MockClient() { EXPECT_CALL(*this, options) .WillRepeatedly( ::testing::Return(storage::internal::DefaultOptionsWithCredentials( @@ -43,7 +39,6 @@ class MockClient : public google::cloud::storage::internal::StorageConnection { MakeInsecureCredentials())))); } - MOCK_METHOD(ClientOptions const&, client_options, (), (const, override)); MOCK_METHOD(Options, options, (), (const, override)); MOCK_METHOD(StatusOr, ListBuckets, (internal::ListBucketsRequest const&), (override)); @@ -181,15 +176,9 @@ class MockClient : public google::cloud::storage::internal::StorageConnection { (internal::GetNotificationRequest const&), (override)); MOCK_METHOD(StatusOr, DeleteNotification, (internal::DeleteNotificationRequest const&), (override)); - MOCK_METHOD( - StatusOr, AuthorizationHeader, - (std::shared_ptr const&)); MOCK_METHOD(std::vector, InspectStackStructure, (), (const, override)); - - private: - ClientOptions client_options_; }; class MockObjectReadSource : public internal::ObjectReadSource { diff --git a/google/cloud/storage/testing/mock_storage_stub.h b/google/cloud/storage/testing/mock_storage_stub.h index af6208a703080..d5cff4ad6695c 100644 --- a/google/cloud/storage/testing/mock_storage_stub.h +++ b/google/cloud/storage/testing/mock_storage_stub.h @@ -21,6 +21,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storage { @@ -257,4 +260,6 @@ using MockAsyncBidiWriteObjectStream = } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_TESTING_MOCK_STORAGE_STUB_H 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/BUILD.bazel b/google/cloud/storage/tests/BUILD.bazel index 177246db5be7a..675cdb0664eb7 100644 --- a/google/cloud/storage/tests/BUILD.bazel +++ b/google/cloud/storage/tests/BUILD.bazel @@ -48,10 +48,9 @@ VARIATIONS = { "//google/cloud/storage:storage_client_testing", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "//protos:system_includes", "//protos/google/cloud/storage/tests:storage_conformance_tests_cc_proto", - "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest_main", + "@abseil-cpp//absl/strings", + "@googletest//:gtest_main", ], ) for test in storage_client_integration_tests for v_label, v_env in VARIATIONS.items()] @@ -76,9 +75,8 @@ VARIATIONS = { "//google/cloud/storage:storage_client_testing", "//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "//protos:system_includes", "//protos/google/cloud/storage/tests:storage_conformance_tests_cc_proto", - "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest_main", + "@abseil-cpp//absl/strings", + "@googletest//:gtest_main", ], ) for test in ["universe_domain_integration_test.cc"]] diff --git a/google/cloud/storage/tests/create_client_integration_test.cc b/google/cloud/storage/tests/create_client_integration_test.cc index 1af30e631c788..6d385b36ea6b3 100644 --- a/google/cloud/storage/tests/create_client_integration_test.cc +++ b/google/cloud/storage/tests/create_client_integration_test.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/storage/client.h" -#include "google/cloud/storage/internal/unified_rest_credentials.h" #include "google/cloud/storage/testing/storage_integration_test.h" #include "google/cloud/storage/testing/temp_file.h" #include "google/cloud/credentials.h" @@ -66,37 +65,26 @@ class CreateClientIntegrationTest #include "google/cloud/internal/disable_deprecation_warnings.inc" TEST_F(CreateClientIntegrationTest, DefaultWorks) { - auto client = Client::CreateDefaultClient(); - ASSERT_THAT(client, IsOk()); + auto client = Client(Options{}); ASSERT_NO_FATAL_FAILURE( - UseClient(*client, bucket_name(), MakeRandomObjectName(), LoremIpsum())); + UseClient(client, bucket_name(), MakeRandomObjectName(), LoremIpsum())); } TEST_F(CreateClientIntegrationTest, SettingPolicies) { - auto credentials = oauth2::CreateAnonymousCredentials(); - if (!UsingEmulator()) { - auto c = oauth2::GoogleDefaultCredentials(); - ASSERT_THAT(c, IsOk()); - credentials = *std::move(c); - } - auto client = - Client(ClientOptions(std::move(credentials)), - LimitedErrorCountRetryPolicy(/*maximum_failures=*/5), - ExponentialBackoffPolicy(/*initial_delay=*/std::chrono::seconds(1), - /*maximum_delay=*/std::chrono::minutes(5), - /*scaling=*/1.5)); + auto client = Client( + Options{} + .set( + LimitedErrorCountRetryPolicy(/*maximum_failures=*/5).clone()) + .set( + ExponentialBackoffPolicy( + /*initial_delay=*/std::chrono::seconds(1), + /*maximum_delay=*/std::chrono::minutes(5), + /*scaling=*/1.5) + .clone())); ASSERT_NO_FATAL_FAILURE( UseClient(client, bucket_name(), MakeRandomObjectName(), LoremIpsum())); } -/// @test Verify the backwards compatibility `v1` namespace still exists. -TEST_F(CreateClientIntegrationTest, BackwardsCompatibility) { - auto client = ::google::cloud::storage::v1::Client::CreateDefaultClient(); - ASSERT_THAT(client, IsOk()); - ASSERT_NO_FATAL_FAILURE( - UseClient(*client, bucket_name(), MakeRandomObjectName(), LoremIpsum())); -} - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage diff --git a/google/cloud/storage/tests/key_file_integration_test.cc b/google/cloud/storage/tests/key_file_integration_test.cc index fe7f8ee98f0b8..b74eb23baaafd 100644 --- a/google/cloud/storage/tests/key_file_integration_test.cc +++ b/google/cloud/storage/tests/key_file_integration_test.cc @@ -70,12 +70,9 @@ class KeyFileIntegrationTest TEST_P(KeyFileIntegrationTest, ObjectWriteSignAndReadDefaultAccount) { if (UsingGrpc()) GTEST_SKIP(); - auto credentials = - oauth2::CreateServiceAccountCredentialsFromFilePath(key_filename_); - ASSERT_STATUS_OK(credentials); - + auto credentials = MakeServiceAccountCredentialsFromFile(key_filename_); auto client = MakeIntegrationTestClient( - Options{}.set(*credentials)); + Options{}.set(credentials)); auto object_name = MakeRandomObjectName(); std::string expected = LoremIpsum(); @@ -98,12 +95,9 @@ TEST_P(KeyFileIntegrationTest, ObjectWriteSignAndReadDefaultAccount) { TEST_P(KeyFileIntegrationTest, ObjectWriteSignAndReadExplicitAccount) { if (UsingGrpc()) GTEST_SKIP(); - auto credentials = - oauth2::CreateServiceAccountCredentialsFromFilePath(key_filename_); - ASSERT_STATUS_OK(credentials); - + auto credentials = MakeServiceAccountCredentialsFromFile(key_filename_); auto client = MakeIntegrationTestClient( - Options{}.set(*credentials)); + Options{}.set(credentials)); auto object_name = MakeRandomObjectName(); std::string expected = LoremIpsum(); 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/object_media_integration_test.cc b/google/cloud/storage/tests/object_media_integration_test.cc index 604bffe1364d6..5250461ee1d24 100644 --- a/google/cloud/storage/tests/object_media_integration_test.cc +++ b/google/cloud/storage/tests/object_media_integration_test.cc @@ -515,9 +515,6 @@ TEST_F(ObjectMediaIntegrationTest, ConnectionFailureUploadFile) { TEST_F(ObjectMediaIntegrationTest, StreamingReadTimeout) { // The emulator does not support this type of fault injection for gRPC. if (!UsingEmulator() || UsingGrpc()) GTEST_SKIP(); - auto options = ClientOptions::CreateDefaultClientOptions(); - ASSERT_STATUS_OK(options); - auto client = MakeIntegrationTestClient( Options{} .set(std::chrono::seconds(3)) 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 5959030c32f29..13ffc19d34626 100644 --- a/google/cloud/storage/tests/service_account_credentials_integration_test.cc +++ b/google/cloud/storage/tests/service_account_credentials_integration_test.cc @@ -12,17 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "google/cloud/storage/oauth2/google_credentials.h" #include "google/cloud/storage/testing/retry_http_request.h" #include "google/cloud/storage/testing/storage_integration_test.h" #include "google/cloud/internal/getenv.h" +#include "google/cloud/internal/oauth2_service_account_credentials.h" #include "google/cloud/internal/rest_request.h" +#include "google/cloud/internal/unified_rest_credentials.h" #include "google/cloud/testing_util/status_matchers.h" #include "absl/strings/str_split.h" #include #include #include -#include #include #include @@ -43,20 +43,21 @@ TEST_F(ServiceAccountCredentialsTest, UserInfoOAuth2) { "GOOGLE_CLOUD_CPP_STORAGE_TEST_KEY_FILE_JSON"); if (UsingEmulator() || !filename) GTEST_SKIP(); - auto credentials = oauth2::CreateServiceAccountCredentialsFromFilePath( - *filename, /*scopes=*/ - std::set({"https://www.googleapis.com/auth/userinfo.email", - "https://www.googleapis.com/auth/cloud-platform"}), - /*subject=*/absl::nullopt); - ASSERT_STATUS_OK(credentials); + auto options = Options{} + .set({}) + .set(std::vector( + {"https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/cloud-platform"})); + + auto credentials = MakeServiceAccountCredentialsFromFile(*filename, options); + auto sa_creds = rest_internal::MapCredentials(*credentials); auto constexpr kUrl = "https://www.googleapis.com/userinfo/v2/me"; - auto factory = [c = *credentials]() { - auto authorization = c->AuthorizationHeader(); + auto factory = [c = sa_creds]() { + auto authorization = c->GetToken(std::chrono::system_clock::now()); if (!authorization) return rest_internal::RestRequest(); - std::pair p = - absl::StrSplit(*authorization, absl::MaxSplits(": ", 1)); - return rest_internal::RestRequest().AddHeader(std::move(p)); + return rest_internal::RestRequest().AddHeader(rest_internal::HttpHeader( + "Authorization", "Bearer " + authorization->token)); }; auto response = RetryHttpGet(kUrl, factory); diff --git a/google/cloud/storage/tests/signed_url_conformance_test.cc b/google/cloud/storage/tests/signed_url_conformance_test.cc index 7f14085984059..002d0ccaecaf8 100644 --- a/google/cloud/storage/tests/signed_url_conformance_test.cc +++ b/google/cloud/storage/tests/signed_url_conformance_test.cc @@ -21,10 +21,11 @@ #include "google/cloud/internal/format_time_point.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/time_utils.h" +#include "google/cloud/internal/unified_rest_credentials.h" #include "google/cloud/terminate_handler.h" #include "google/cloud/testing_util/scoped_environment.h" #include "google/cloud/testing_util/status_matchers.h" -#include +#include "protos/google/cloud/storage/tests/conformance_tests.pb.h" #include #include #include @@ -87,13 +88,16 @@ class V4PostPolicyConformanceTest : public V4SignedUrlConformanceTest {}; TEST_P(V4SignedUrlConformanceTest, V4SignJson) { testing_util::ScopedEnvironment endpoint("CLOUD_STORAGE_EMULATOR_ENDPOINT", absl::nullopt); - auto creds = oauth2::CreateServiceAccountCredentialsFromJsonFilePath( - service_account_key_filename_); - ASSERT_STATUS_OK(creds); + testing_util::ScopedEnvironment preserve_creds( + "GOOGLE_CLOUD_CPP_STORAGE_TESTING_PRESERVE_CREDENTIALS", "yes"); + auto credentials = + MakeServiceAccountCredentialsFromFile(service_account_key_filename_); + auto sa_creds = rest_internal::MapCredentials(*credentials); + std::string account_email = sa_creds->AccountEmail(); + + auto client = MakeIntegrationTestClient( + Options{}.set(credentials)); - std::string account_email = (*creds)->AccountEmail(); - auto client = - MakeIntegrationTestClient(Options{}.set(*creds)); std::string actual_canonical_request; std::string actual_string_to_sign; @@ -191,13 +195,15 @@ INSTANTIATE_TEST_SUITE_P( TEST_P(V4PostPolicyConformanceTest, V4PostPolicy) { testing_util::ScopedEnvironment endpoint("CLOUD_STORAGE_EMULATOR_ENDPOINT", absl::nullopt); - auto creds = oauth2::CreateServiceAccountCredentialsFromJsonFilePath( - service_account_key_filename_); - ASSERT_STATUS_OK(creds); - - std::string account_email = (*creds)->AccountEmail(); - auto client = - MakeIntegrationTestClient(Options{}.set(*creds)); + testing_util::ScopedEnvironment preserve_creds( + "GOOGLE_CLOUD_CPP_STORAGE_TESTING_PRESERVE_CREDENTIALS", "yes"); + auto credentials = + MakeServiceAccountCredentialsFromFile(service_account_key_filename_); + auto sa_creds = rest_internal::MapCredentials(*credentials); + std::string account_email = sa_creds->AccountEmail(); + + auto client = MakeIntegrationTestClient( + Options{}.set(credentials)); auto const& test_params = (*post_policy_tests)[GetParam()]; auto const& input = test_params.policyinput(); diff --git a/google/cloud/storage/tests/storage_include_test.cc b/google/cloud/storage/tests/storage_include_test.cc index 5f0c341e37b12..abc4b3d15f478 100644 --- a/google/cloud/storage/tests/storage_include_test.cc +++ b/google/cloud/storage/tests/storage_include_test.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/storage/client.h" -#include "google/cloud/storage/oauth2/google_credentials.h" #include int main() { diff --git a/google/cloud/storage/tests/unified_credentials_integration_test.cc b/google/cloud/storage/tests/unified_credentials_integration_test.cc index 68e6edf086954..2d5407f17f567 100644 --- a/google/cloud/storage/tests/unified_credentials_integration_test.cc +++ b/google/cloud/storage/tests/unified_credentials_integration_test.cc @@ -13,13 +13,15 @@ // limitations under the License. #include "google/cloud/storage/client.h" -#include "google/cloud/storage/internal/unified_rest_credentials.h" #include "google/cloud/storage/testing/storage_integration_test.h" #include "google/cloud/storage/testing/temp_file.h" #include "google/cloud/credentials.h" #include "google/cloud/internal/getenv.h" +#include "google/cloud/internal/oauth2_google_credentials.h" +#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 @@ -42,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 @@ -87,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: @@ -371,15 +377,21 @@ TEST_F(UnifiedCredentialsIntegrationTest, AccessToken) { // application one would fetch access tokens from something more interesting, // like the IAM credentials service. This is just a reasonably easy way to get // a working access token for the test. - auto default_credentials = oauth2::GoogleDefaultCredentials(); - ASSERT_THAT(default_credentials, IsOk()); + auto default_credentials = + rest_internal::MapCredentials((*MakeGoogleDefaultCredentials())); auto expiration = std::chrono::system_clock::now() + std::chrono::hours(1); - auto header = default_credentials.value()->AuthorizationHeader(); - 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))); @@ -396,15 +408,21 @@ TEST_F(UnifiedCredentialsIntegrationTest, AccessTokenCustomTrustStore) { // application one would fetch access tokens from something more interesting, // like the IAM credentials service. This is just a reasonably easy way to get // a working access token for the test. - auto default_credentials = oauth2::GoogleDefaultCredentials(); - ASSERT_THAT(default_credentials, IsOk()); + auto default_credentials = + rest_internal::MapCredentials((*MakeGoogleDefaultCredentials())); auto expiration = std::chrono::system_clock::now() + std::chrono::hours(1); - auto header = default_credentials.value()->AuthorizationHeader(); - 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); @@ -424,15 +442,21 @@ TEST_F(UnifiedCredentialsIntegrationTest, AccessTokenEmptyTrustStore) { // application one would fetch access tokens from something more interesting, // like the IAM credentials service. This is just a reasonably easy way to get // a working access token for the test. - auto default_credentials = oauth2::GoogleDefaultCredentials(); - ASSERT_THAT(default_credentials, IsOk()); + auto default_credentials = + rest_internal::MapCredentials((*MakeGoogleDefaultCredentials())); auto expiration = std::chrono::system_clock::now() + std::chrono::hours(1); - auto header = default_credentials.value()->AuthorizationHeader(); - 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/storage/version.h b/google/cloud/storage/version.h index 82862d2c6168f..ffce8b3ea2462 100644 --- a/google/cloud/storage/version.h +++ b/google/cloud/storage/version.h @@ -84,8 +84,6 @@ std::string version_string(); std::string x_goog_api_client(); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -// TODO(#7463) - remove backwards compatibility namespaces -namespace v1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace storage } // namespace cloud } // namespace google diff --git a/google/cloud/storagebatchoperations/BUILD.bazel b/google/cloud/storagebatchoperations/BUILD.bazel index f05f2910d2c2c..a26e644ab257f 100644 --- a/google/cloud/storagebatchoperations/BUILD.bazel +++ b/google/cloud/storagebatchoperations/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/storagebatchoperations/v1:storagebatchoperations_cc_grpc", + "@googleapis//google/cloud/storagebatchoperations/v1:storagebatchoperations_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/storagebatchoperations/quickstart/CMakeLists.txt b/google/cloud/storagebatchoperations/quickstart/CMakeLists.txt index f9f3df4f47990..0b897b94620ca 100644 --- a/google/cloud/storagebatchoperations/quickstart/CMakeLists.txt +++ b/google/cloud/storagebatchoperations/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Storage Batch Operations API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-storagebatchoperations-quickstart CXX) find_package(google_cloud_cpp_storagebatchoperations REQUIRED) diff --git a/google/cloud/storagebatchoperations/quickstart/WORKSPACE.bazel b/google/cloud/storagebatchoperations/quickstart/WORKSPACE.bazel index 397b577f49dee..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 = "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/storagebatchoperations/v1/internal/storage_batch_operations_auth_decorator.cc b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_auth_decorator.cc index df5fb995355da..301dfb834ec78 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_auth_decorator.cc +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/storagebatchoperations/v1/storage_batch_operations.proto #include "google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_auth_decorator.h" -#include +#include "google/cloud/storagebatchoperations/v1/storage_batch_operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagebatchoperations_v1_internal { @@ -98,6 +101,27 @@ StorageBatchOperationsAuth::CancelJob( return child_->CancelJob(context, options, request); } +StatusOr< + google::cloud::storagebatchoperations::v1::ListBucketOperationsResponse> +StorageBatchOperationsAuth::ListBucketOperations( + grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListBucketOperations(context, options, request); +} + +StatusOr +StorageBatchOperationsAuth::GetBucketOperation( + grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1::GetBucketOperationRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetBucketOperation(context, options, request); +} + StatusOr StorageBatchOperationsAuth::ListLocations( grpc::ClientContext& context, Options const& options, @@ -190,3 +214,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagebatchoperations_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_auth_decorator.h b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_auth_decorator.h index 17eb28183145e..af54603c7f8ad 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_auth_decorator.h +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 storagebatchoperations_v1_internal { @@ -71,6 +74,17 @@ class StorageBatchOperationsAuth : public StorageBatchOperationsStub { google::cloud::storagebatchoperations::v1::CancelJobRequest const& request) override; + StatusOr< + google::cloud::storagebatchoperations::v1::ListBucketOperationsResponse> + ListBucketOperations(grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest const& request) override; + + StatusOr + GetBucketOperation(grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const& request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -117,4 +131,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEBATCHOPERATIONS_V1_INTERNAL_STORAGE_BATCH_OPERATIONS_AUTH_DECORATOR_H diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_connection_impl.cc b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_connection_impl.cc index 1e2eaf058b2fb..d11594f76a270 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_connection_impl.cc +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_connection_impl.cc @@ -250,6 +250,60 @@ StorageBatchOperationsConnectionImpl::CancelJob( *current, request, __func__); } +StreamRange +StorageBatchOperationsConnectionImpl::ListBucketOperations( + google::cloud::storagebatchoperations::v1::ListBucketOperationsRequest + request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListBucketOperations(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< + storagebatchoperations_v1::StorageBatchOperationsRetryPolicy>( + retry_policy(*current)), + backoff = std::shared_ptr(backoff_policy(*current))]( + Options const& options, google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest const& request) { + return stub->ListBucketOperations(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::storagebatchoperations::v1::ListBucketOperationsResponse + r) { + std::vector + result(r.bucket_operations().size()); + auto& messages = *r.mutable_bucket_operations(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +StorageBatchOperationsConnectionImpl::GetBucketOperation( + google::cloud::storagebatchoperations::v1::GetBucketOperationRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetBucketOperation(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const& request) { + return stub_->GetBucketOperation(context, options, request); + }, + *current, request, __func__); +} + StreamRange StorageBatchOperationsConnectionImpl::ListLocations( google::cloud::location::ListLocationsRequest request) { diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_connection_impl.h b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_connection_impl.h index e29375c992691..9243ae067c26b 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_connection_impl.h +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -82,6 +82,15 @@ class StorageBatchOperationsConnectionImpl CancelJob(google::cloud::storagebatchoperations::v1::CancelJobRequest const& request) override; + StreamRange + ListBucketOperations( + google::cloud::storagebatchoperations::v1::ListBucketOperationsRequest + request) override; + + StatusOr + GetBucketOperation(google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const& request) override; + StreamRange ListLocations( google::cloud::location::ListLocationsRequest request) override; diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_logging_decorator.cc b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_logging_decorator.cc index 82c46b1a5b246..07fa196e8d195 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_logging_decorator.cc +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/storagebatchoperations/v1/storage_batch_operations.proto #include "google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_logging_decorator.h" +#include "google/cloud/storagebatchoperations/v1/storage_batch_operations.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagebatchoperations_v1_internal { @@ -120,6 +123,35 @@ StorageBatchOperationsLogging::CancelJob( context, options, request, __func__, tracing_options_); } +StatusOr< + google::cloud::storagebatchoperations::v1::ListBucketOperationsResponse> +StorageBatchOperationsLogging::ListBucketOperations( + grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest const& request) { + return child_->ListBucketOperations(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +StorageBatchOperationsLogging::GetBucketOperation( + grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1::GetBucketOperationRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const& request) { + return child_->GetBucketOperation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr StorageBatchOperationsLogging::ListLocations( grpc::ClientContext& context, Options const& options, @@ -229,3 +261,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagebatchoperations_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_logging_decorator.h b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_logging_decorator.h index b91f4cbe7f599..38a290f42915f 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_logging_decorator.h +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 storagebatchoperations_v1_internal { @@ -71,6 +74,17 @@ class StorageBatchOperationsLogging : public StorageBatchOperationsStub { google::cloud::storagebatchoperations::v1::CancelJobRequest const& request) override; + StatusOr< + google::cloud::storagebatchoperations::v1::ListBucketOperationsResponse> + ListBucketOperations(grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest const& request) override; + + StatusOr + GetBucketOperation(grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const& request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -117,4 +131,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEBATCHOPERATIONS_V1_INTERNAL_STORAGE_BATCH_OPERATIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_metadata_decorator.cc b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_metadata_decorator.cc index 8d91b559ab837..48278c1118698 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_metadata_decorator.cc +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/storagebatchoperations/v1/storage_batch_operations.proto #include "google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_metadata_decorator.h" +#include "google/cloud/storagebatchoperations/v1/storage_batch_operations.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 storagebatchoperations_v1_internal { @@ -104,6 +108,27 @@ StorageBatchOperationsMetadata::CancelJob( return child_->CancelJob(context, options, request); } +StatusOr< + google::cloud::storagebatchoperations::v1::ListBucketOperationsResponse> +StorageBatchOperationsMetadata::ListBucketOperations( + grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListBucketOperations(context, options, request); +} + +StatusOr +StorageBatchOperationsMetadata::GetBucketOperation( + grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1::GetBucketOperationRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetBucketOperation(context, options, request); +} + StatusOr StorageBatchOperationsMetadata::ListLocations( grpc::ClientContext& context, Options const& options, @@ -196,3 +221,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagebatchoperations_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_metadata_decorator.h b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_metadata_decorator.h index 3eff602c4a1cc..27ef56dfa621d 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_metadata_decorator.h +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 storagebatchoperations_v1_internal { @@ -72,6 +75,17 @@ class StorageBatchOperationsMetadata : public StorageBatchOperationsStub { google::cloud::storagebatchoperations::v1::CancelJobRequest const& request) override; + StatusOr< + google::cloud::storagebatchoperations::v1::ListBucketOperationsResponse> + ListBucketOperations(grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest const& request) override; + + StatusOr + GetBucketOperation(grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const& request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -123,4 +137,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEBATCHOPERATIONS_V1_INTERNAL_STORAGE_BATCH_OPERATIONS_METADATA_DECORATOR_H diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_option_defaults.cc b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_option_defaults.cc index da23207ba3bf9..0f8e0fab09ef6 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_option_defaults.cc +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_option_defaults.cc @@ -44,7 +44,7 @@ Options StorageBatchOperationsDefaultOptions(Options options) { options.set< storagebatchoperations_v1::StorageBatchOperationsRetryPolicyOption>( storagebatchoperations_v1::StorageBatchOperationsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagebatchoperations_v1_internal { @@ -113,6 +116,34 @@ DefaultStorageBatchOperationsStub::CancelJob( return response; } +StatusOr< + google::cloud::storagebatchoperations::v1::ListBucketOperationsResponse> +DefaultStorageBatchOperationsStub::ListBucketOperations( + grpc::ClientContext& context, Options const&, + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest const& request) { + google::cloud::storagebatchoperations::v1::ListBucketOperationsResponse + response; + auto status = grpc_stub_->ListBucketOperations(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultStorageBatchOperationsStub::GetBucketOperation( + grpc::ClientContext& context, Options const&, + google::cloud::storagebatchoperations::v1::GetBucketOperationRequest const& + request) { + google::cloud::storagebatchoperations::v1::BucketOperation response; + auto status = grpc_stub_->GetBucketOperation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultStorageBatchOperationsStub::ListLocations( grpc::ClientContext& context, Options const&, @@ -226,3 +257,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagebatchoperations_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub.h b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub.h index 8ff52e50d0fc8..3870cfa511841 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub.h +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEBATCHOPERATIONS_V1_INTERNAL_STORAGE_BATCH_OPERATIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEBATCHOPERATIONS_V1_INTERNAL_STORAGE_BATCH_OPERATIONS_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/storagebatchoperations/v1/storage_batch_operations.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagebatchoperations_v1_internal { @@ -71,6 +74,17 @@ class StorageBatchOperationsStub { google::cloud::storagebatchoperations::v1::CancelJobRequest const& request) = 0; + virtual StatusOr< + google::cloud::storagebatchoperations::v1::ListBucketOperationsResponse> + ListBucketOperations(grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest const& request) = 0; + + virtual StatusOr + GetBucketOperation(grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const& request) = 0; + virtual StatusOr ListLocations( grpc::ClientContext& context, Options const& options, @@ -155,6 +169,17 @@ class DefaultStorageBatchOperationsStub : public StorageBatchOperationsStub { google::cloud::storagebatchoperations::v1::CancelJobRequest const& request) override; + StatusOr< + google::cloud::storagebatchoperations::v1::ListBucketOperationsResponse> + ListBucketOperations(grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest const& request) override; + + StatusOr + GetBucketOperation(grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const& request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -206,4 +231,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEBATCHOPERATIONS_V1_INTERNAL_STORAGE_BATCH_OPERATIONS_STUB_H diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub_factory.cc b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub_factory.cc index f1d2c22489e82..649c1c5b8cca2 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub_factory.cc +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/storagebatchoperations/v1/storage_batch_operations.proto #include "google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_auth_decorator.h" #include "google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_logging_decorator.h" #include "google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_metadata_decorator.h" #include "google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub.h" #include "google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_stub.h" +#include "google/cloud/storagebatchoperations/v1/storage_batch_operations.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagebatchoperations_v1_internal { @@ -76,3 +79,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagebatchoperations_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub_factory.h b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub_factory.h index fd93de9b13d0f..b0562900a948f 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub_factory.h +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagebatchoperations_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEBATCHOPERATIONS_V1_INTERNAL_STORAGE_BATCH_OPERATIONS_STUB_FACTORY_H diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_connection.cc b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_connection.cc index ed4ce4f9fa179..41b3dbe42bb9a 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_connection.cc +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace storagebatchoperations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - StorageBatchOperationsTracingConnection:: StorageBatchOperationsTracingConnection( std::shared_ptr< @@ -106,6 +104,31 @@ StorageBatchOperationsTracingConnection::CancelJob( return internal::EndSpan(*span, child_->CancelJob(request)); } +StreamRange +StorageBatchOperationsTracingConnection::ListBucketOperations( + google::cloud::storagebatchoperations::v1::ListBucketOperationsRequest + request) { + auto span = internal::MakeSpan( + "storagebatchoperations_v1::StorageBatchOperationsConnection::" + "ListBucketOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListBucketOperations(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::storagebatchoperations::v1::BucketOperation>( + std::move(span), std::move(sr)); +} + +StatusOr +StorageBatchOperationsTracingConnection::GetBucketOperation( + google::cloud::storagebatchoperations::v1::GetBucketOperationRequest const& + request) { + auto span = internal::MakeSpan( + "storagebatchoperations_v1::StorageBatchOperationsConnection::" + "GetBucketOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetBucketOperation(request)); +} + StreamRange StorageBatchOperationsTracingConnection::ListLocations( google::cloud::location::ListLocationsRequest request) { @@ -168,18 +191,14 @@ Status StorageBatchOperationsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeStorageBatchOperationsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_connection.h b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_connection.h index cdf667b1f1a27..360fc1a343255 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_connection.h +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace storagebatchoperations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class StorageBatchOperationsTracingConnection : public storagebatchoperations_v1::StorageBatchOperationsConnection { public: @@ -70,6 +68,15 @@ class StorageBatchOperationsTracingConnection CancelJob(google::cloud::storagebatchoperations::v1::CancelJobRequest const& request) override; + StreamRange + ListBucketOperations( + google::cloud::storagebatchoperations::v1::ListBucketOperationsRequest + request) override; + + StatusOr + GetBucketOperation(google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const& request) override; + StreamRange ListLocations( google::cloud::location::ListLocationsRequest request) override; @@ -93,8 +100,6 @@ class StorageBatchOperationsTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_stub.cc b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_stub.cc index d2ddee9545e92..bc15c09571c57 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_stub.cc +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagebatchoperations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - StorageBatchOperationsTracingStub::StorageBatchOperationsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -115,6 +116,35 @@ StorageBatchOperationsTracingStub::CancelJob( child_->CancelJob(context, options, request)); } +StatusOr< + google::cloud::storagebatchoperations::v1::ListBucketOperationsResponse> +StorageBatchOperationsTracingStub::ListBucketOperations( + grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.storagebatchoperations.v1.StorageBatchOperations", + "ListBucketOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListBucketOperations(context, options, request)); +} + +StatusOr +StorageBatchOperationsTracingStub::GetBucketOperation( + grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1::GetBucketOperationRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.storagebatchoperations.v1.StorageBatchOperations", + "GetBucketOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->GetBucketOperation(context, options, request)); +} + StatusOr StorageBatchOperationsTracingStub::ListLocations( grpc::ClientContext& context, Options const& options, @@ -219,19 +249,15 @@ future StorageBatchOperationsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeStorageBatchOperationsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagebatchoperations_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_stub.h b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_stub.h index 583693a77258c..0cf98ab42f8b2 100644 --- a/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_stub.h +++ b/google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagebatchoperations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class StorageBatchOperationsTracingStub : public StorageBatchOperationsStub { public: ~StorageBatchOperationsTracingStub() override = default; @@ -71,6 +72,17 @@ class StorageBatchOperationsTracingStub : public StorageBatchOperationsStub { google::cloud::storagebatchoperations::v1::CancelJobRequest const& request) override; + StatusOr< + google::cloud::storagebatchoperations::v1::ListBucketOperationsResponse> + ListBucketOperations(grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest const& request) override; + + StatusOr + GetBucketOperation(grpc::ClientContext& context, Options const& options, + google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const& request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -113,8 +125,6 @@ class StorageBatchOperationsTracingStub : public StorageBatchOperationsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -130,4 +140,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEBATCHOPERATIONS_V1_INTERNAL_STORAGE_BATCH_OPERATIONS_TRACING_STUB_H diff --git a/google/cloud/storagebatchoperations/v1/mocks/mock_storage_batch_operations_connection.h b/google/cloud/storagebatchoperations/v1/mocks/mock_storage_batch_operations_connection.h index 0ec869b86c2ce..5e1a56f780ca8 100644 --- a/google/cloud/storagebatchoperations/v1/mocks/mock_storage_batch_operations_connection.h +++ b/google/cloud/storagebatchoperations/v1/mocks/mock_storage_batch_operations_connection.h @@ -111,6 +111,20 @@ class MockStorageBatchOperationsConnection request), (override)); + MOCK_METHOD( + (StreamRange), + ListBucketOperations, + (google::cloud::storagebatchoperations::v1::ListBucketOperationsRequest + request), + (override)); + + MOCK_METHOD( + StatusOr, + GetBucketOperation, + (google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const& request), + (override)); + MOCK_METHOD((StreamRange), ListLocations, (google::cloud::location::ListLocationsRequest request), (override)); diff --git a/google/cloud/storagebatchoperations/v1/storage_batch_operations_client.cc b/google/cloud/storagebatchoperations/v1/storage_batch_operations_client.cc index 8b20f50beec23..954c011e6b0b9 100644 --- a/google/cloud/storagebatchoperations/v1/storage_batch_operations_client.cc +++ b/google/cloud/storagebatchoperations/v1/storage_batch_operations_client.cc @@ -146,6 +146,43 @@ StorageBatchOperationsClient::CancelJob( return connection_->CancelJob(request); } +StreamRange +StorageBatchOperationsClient::ListBucketOperations(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::storagebatchoperations::v1::ListBucketOperationsRequest + request; + request.set_parent(parent); + return connection_->ListBucketOperations(request); +} + +StreamRange +StorageBatchOperationsClient::ListBucketOperations( + google::cloud::storagebatchoperations::v1::ListBucketOperationsRequest + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListBucketOperations(std::move(request)); +} + +StatusOr +StorageBatchOperationsClient::GetBucketOperation(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::storagebatchoperations::v1::GetBucketOperationRequest request; + request.set_name(name); + return connection_->GetBucketOperation(request); +} + +StatusOr +StorageBatchOperationsClient::GetBucketOperation( + google::cloud::storagebatchoperations::v1::GetBucketOperationRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetBucketOperation(request); +} + StreamRange StorageBatchOperationsClient::ListLocations( google::cloud::location::ListLocationsRequest request, Options opts) { diff --git a/google/cloud/storagebatchoperations/v1/storage_batch_operations_client.h b/google/cloud/storagebatchoperations/v1/storage_batch_operations_client.h index 26483cea07ba4..f27d60e9d8734 100644 --- a/google/cloud/storagebatchoperations/v1/storage_batch_operations_client.h +++ b/google/cloud/storagebatchoperations/v1/storage_batch_operations_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -122,7 +122,7 @@ class StorageBatchOperationsClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.storagebatchoperations.v1.Job]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto#L37} - /// [google.cloud.storagebatchoperations.v1.ListJobsRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L94} + /// [google.cloud.storagebatchoperations.v1.ListJobsRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L111} /// // clang-format on StreamRange ListJobs( @@ -161,7 +161,7 @@ class StorageBatchOperationsClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.storagebatchoperations.v1.Job]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto#L37} - /// [google.cloud.storagebatchoperations.v1.ListJobsRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L94} + /// [google.cloud.storagebatchoperations.v1.ListJobsRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L111} /// // clang-format on StreamRange ListJobs( @@ -187,7 +187,7 @@ class StorageBatchOperationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.storagebatchoperations.v1.GetJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L129} + /// [google.cloud.storagebatchoperations.v1.GetJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L146} /// [google.cloud.storagebatchoperations.v1.Job]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto#L37} /// // clang-format on @@ -217,7 +217,7 @@ class StorageBatchOperationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.storagebatchoperations.v1.GetJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L129} + /// [google.cloud.storagebatchoperations.v1.GetJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L146} /// [google.cloud.storagebatchoperations.v1.Job]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto#L37} /// // clang-format on @@ -255,7 +255,7 @@ class StorageBatchOperationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.storagebatchoperations.v1.CreateJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L141} + /// [google.cloud.storagebatchoperations.v1.CreateJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L158} /// [google.cloud.storagebatchoperations.v1.Job]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto#L37} /// // clang-format on @@ -310,7 +310,7 @@ class StorageBatchOperationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.storagebatchoperations.v1.CreateJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L141} + /// [google.cloud.storagebatchoperations.v1.CreateJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L158} /// [google.cloud.storagebatchoperations.v1.Job]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto#L37} /// // clang-format on @@ -365,7 +365,7 @@ class StorageBatchOperationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.storagebatchoperations.v1.DeleteJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L193} + /// [google.cloud.storagebatchoperations.v1.DeleteJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L210} /// // clang-format on Status DeleteJob(std::string const& name, Options opts = {}); @@ -391,7 +391,7 @@ class StorageBatchOperationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.storagebatchoperations.v1.DeleteJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L193} + /// [google.cloud.storagebatchoperations.v1.DeleteJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L210} /// // clang-format on Status DeleteJob( @@ -418,8 +418,8 @@ class StorageBatchOperationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.storagebatchoperations.v1.CancelJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L171} - /// [google.cloud.storagebatchoperations.v1.CancelJobResponse]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L215} + /// [google.cloud.storagebatchoperations.v1.CancelJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L188} + /// [google.cloud.storagebatchoperations.v1.CancelJobResponse]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L238} /// // clang-format on StatusOr @@ -448,8 +448,8 @@ class StorageBatchOperationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.storagebatchoperations.v1.CancelJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L171} - /// [google.cloud.storagebatchoperations.v1.CancelJobResponse]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L215} + /// [google.cloud.storagebatchoperations.v1.CancelJobRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L188} + /// [google.cloud.storagebatchoperations.v1.CancelJobResponse]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L238} /// // clang-format on StatusOr @@ -457,6 +457,141 @@ class StorageBatchOperationsClient { request, Options opts = {}); + // clang-format off + /// + /// Lists BucketOperations in a given project and job. + /// + /// @param parent Required. Format: projects/{project_id}/locations/global/jobs/{job_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.storagebatchoperations.v1.BucketOperation], 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.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 + StreamRange + ListBucketOperations(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists BucketOperations in a given project and job. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.storagebatchoperations.v1.ListBucketOperationsRequest]. + /// Proto messages are converted to C++ 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.storagebatchoperations.v1.BucketOperation], 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.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 + StreamRange + ListBucketOperations( + google::cloud::storagebatchoperations::v1::ListBucketOperationsRequest + request, + Options opts = {}); + + // clang-format off + /// + /// Gets a BucketOperation. + /// + /// @param name Required. `name` of the bucket operation to retrieve. + /// Format: + /// projects/{project_id}/locations/global/jobs/{job_id}/bucketOperations/{bucket_operation_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.storagebatchoperations.v1.BucketOperation]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`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#L139} + /// [google.cloud.storagebatchoperations.v1.GetBucketOperationRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L276} + /// + // clang-format on + StatusOr + GetBucketOperation(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a BucketOperation. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.storagebatchoperations.v1.GetBucketOperationRequest]. + /// Proto messages are converted to 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.storagebatchoperations.v1.BucketOperation]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`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#L139} + /// [google.cloud.storagebatchoperations.v1.GetBucketOperationRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L276} + /// + // clang-format on + StatusOr + GetBucketOperation(google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const& request, + Options opts = {}); + // clang-format off /// /// Lists information about the supported locations for this service. @@ -747,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 = {}); @@ -786,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/storagebatchoperations/v1/storage_batch_operations_connection.cc b/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection.cc index ecd981dd675bf..725b3162c7928 100644 --- a/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection.cc +++ b/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection.cc @@ -87,6 +87,21 @@ StorageBatchOperationsConnection::CancelJob( return Status(StatusCode::kUnimplemented, "not implemented"); } +StreamRange +StorageBatchOperationsConnection::ListBucketOperations( + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange>(); +} + +StatusOr +StorageBatchOperationsConnection::GetBucketOperation( + google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + StreamRange StorageBatchOperationsConnection::ListLocations( google::cloud::location:: diff --git a/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection.h b/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection.h index d77bbd7c9db39..094751a4cdd33 100644 --- a/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection.h +++ b/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEBATCHOPERATIONS_V1_STORAGE_BATCH_OPERATIONS_CONNECTION_H #include "google/cloud/storagebatchoperations/v1/internal/storage_batch_operations_retry_traits.h" +#include "google/cloud/storagebatchoperations/v1/storage_batch_operations.pb.h" #include "google/cloud/storagebatchoperations/v1/storage_batch_operations_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -219,6 +219,16 @@ class StorageBatchOperationsConnection { CancelJob(google::cloud::storagebatchoperations::v1::CancelJobRequest const& request); + virtual StreamRange< + google::cloud::storagebatchoperations::v1::BucketOperation> + ListBucketOperations( + google::cloud::storagebatchoperations::v1::ListBucketOperationsRequest + request); + + virtual StatusOr + GetBucketOperation(google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const& request); + virtual StreamRange ListLocations( google::cloud::location::ListLocationsRequest request); diff --git a/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection_idempotency_policy.cc b/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection_idempotency_policy.cc index fbed272b6e739..04738c5ef61d1 100644 --- a/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection_idempotency_policy.cc +++ b/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection_idempotency_policy.cc @@ -60,6 +60,20 @@ Idempotency StorageBatchOperationsConnectionIdempotencyPolicy::CancelJob( return Idempotency::kNonIdempotent; } +Idempotency +StorageBatchOperationsConnectionIdempotencyPolicy::ListBucketOperations( + google::cloud::storagebatchoperations::v1:: + ListBucketOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency +StorageBatchOperationsConnectionIdempotencyPolicy::GetBucketOperation( + google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const&) { + return Idempotency::kIdempotent; +} + Idempotency StorageBatchOperationsConnectionIdempotencyPolicy::ListLocations( google::cloud::location::ListLocationsRequest) { // NOLINT return Idempotency::kIdempotent; diff --git a/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection_idempotency_policy.h b/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection_idempotency_policy.h index 94841473fe811..9a7b891c53655 100644 --- a/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection_idempotency_policy.h +++ b/google/cloud/storagebatchoperations/v1/storage_batch_operations_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEBATCHOPERATIONS_V1_STORAGE_BATCH_OPERATIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEBATCHOPERATIONS_V1_STORAGE_BATCH_OPERATIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/storagebatchoperations/v1/storage_batch_operations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -57,6 +57,14 @@ class StorageBatchOperationsConnectionIdempotencyPolicy { google::cloud::storagebatchoperations::v1::CancelJobRequest const& request); + virtual google::cloud::Idempotency ListBucketOperations( + google::cloud::storagebatchoperations::v1::ListBucketOperationsRequest + request); + + virtual google::cloud::Idempotency GetBucketOperation( + google::cloud::storagebatchoperations::v1:: + GetBucketOperationRequest const& request); + virtual google::cloud::Idempotency ListLocations( google::cloud::location::ListLocationsRequest request); diff --git a/google/cloud/storagecontrol/BUILD.bazel b/google/cloud/storagecontrol/BUILD.bazel index 473c01a78fab9..826731d87d018 100644 --- a/google/cloud/storagecontrol/BUILD.bazel +++ b/google/cloud/storagecontrol/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v2/"] googleapis_deps = [ - "@com_google_googleapis//google/storage/control/v2:control_cc_grpc", + "@googleapis//google/storage/control/v2:control_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/storagecontrol/quickstart/.bazelrc b/google/cloud/storagecontrol/quickstart/.bazelrc index 15d5c055db074..343e7f623d628 100644 --- a/google/cloud/storagecontrol/quickstart/.bazelrc +++ b/google/cloud/storagecontrol/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/storagecontrol/quickstart/CMakeLists.txt index 0f7beaf7b1e77..f8e1c29b8b56c 100644 --- a/google/cloud/storagecontrol/quickstart/CMakeLists.txt +++ b/google/cloud/storagecontrol/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Storage API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-storagecontrol-quickstart CXX) find_package(google_cloud_cpp_storagecontrol REQUIRED) diff --git a/google/cloud/storagecontrol/quickstart/WORKSPACE.bazel b/google/cloud/storagecontrol/quickstart/WORKSPACE.bazel index 0dff6fa12101f..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 = "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/storagecontrol/v2/internal/storage_control_auth_decorator.cc b/google/cloud/storagecontrol/v2/internal/storage_control_auth_decorator.cc index e573a58905b17..f0277c9895fa7 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_auth_decorator.cc +++ b/google/cloud/storagecontrol/v2/internal/storage_control_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/storage/control/v2/storage_control.proto #include "google/cloud/storagecontrol/v2/internal/storage_control_auth_decorator.h" -#include +#include "google/storage/control/v2/storage_control.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagecontrol_v2_internal { @@ -92,6 +95,35 @@ StatusOr StorageControlAuth::RenameFolder( return child_->RenameFolder(context, options, request); } +future> +StorageControlAuth::AsyncDeleteFolderRecursive( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::storage::control::v2::DeleteFolderRecursiveRequest 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->AsyncDeleteFolderRecursive(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +StorageControlAuth::DeleteFolderRecursive( + grpc::ClientContext& context, Options options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteFolderRecursive(context, options, request); +} + StatusOr StorageControlAuth::GetStorageLayout( grpc::ClientContext& context, Options const& options, @@ -365,3 +397,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagecontrol_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_auth_decorator.h b/google/cloud/storagecontrol/v2/internal/storage_control_auth_decorator.h index 662ab207b57ac..0c56ad0535567 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_auth_decorator.h +++ b/google/cloud/storagecontrol/v2/internal/storage_control_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/storagecontrol/v2/internal/storage_control_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 storagecontrol_v2_internal { @@ -68,6 +71,18 @@ class StorageControlAuth : public StorageControlStub { google::storage::control::v2::RenameFolderRequest const& request) override; + future> AsyncDeleteFolderRecursive( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) + override; + + StatusOr DeleteFolderRecursive( + grpc::ClientContext& context, Options options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) + override; + StatusOr GetStorageLayout( grpc::ClientContext& context, Options const& options, google::storage::control::v2::GetStorageLayoutRequest const& request) @@ -214,4 +229,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGECONTROL_V2_INTERNAL_STORAGE_CONTROL_AUTH_DECORATOR_H diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_connection_impl.cc b/google/cloud/storagecontrol/v2/internal/storage_control_connection_impl.cc index 7bf8bd07765cf..16addd3612ce6 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_connection_impl.cc +++ b/google/cloud/storagecontrol/v2/internal/storage_control_connection_impl.cc @@ -247,6 +247,103 @@ StorageControlConnectionImpl::RenameFolder( polling_policy(*current), __func__); } +future> +StorageControlConnectionImpl::DeleteFolderRecursive( + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + if (request_copy.request_id().empty()) { + request_copy.set_request_id(invocation_id_generator_->MakeInvocationId()); + } + auto const idempotent = + idempotency_policy(*current)->DeleteFolderRecursive(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::storage::control::v2::DeleteFolderRecursiveMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& + request) { + return stub->AsyncDeleteFolderRecursive(cq, 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::storage::control::v2::DeleteFolderRecursiveMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StorageControlConnectionImpl::DeleteFolderRecursive( + NoAwaitTag, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteFolderRecursive(request), + [this](grpc::ClientContext& context, Options const& options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& + request) { + return stub_->DeleteFolderRecursive(context, options, request); + }, + *current, request, __func__); +} + +future> +StorageControlConnectionImpl::DeleteFolderRecursive( + 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 DeleteFolderRecursive", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::storage::control::v2::DeleteFolderRecursiveMetadata>( + 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::storage::control::v2::DeleteFolderRecursiveMetadata>, + polling_policy(*current), __func__); +} + StatusOr StorageControlConnectionImpl::GetStorageLayout( google::storage::control::v2::GetStorageLayoutRequest const& request) { diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_connection_impl.h b/google/cloud/storagecontrol/v2/internal/storage_control_connection_impl.h index 0bbf88e1762df..bf5f405ba843d 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_connection_impl.h +++ b/google/cloud/storagecontrol/v2/internal/storage_control_connection_impl.h @@ -33,7 +33,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -78,6 +78,20 @@ class StorageControlConnectionImpl future> RenameFolder( google::longrunning::Operation const& operation) override; + future> + DeleteFolderRecursive( + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) + override; + + StatusOr DeleteFolderRecursive( + NoAwaitTag, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) + override; + + future> + DeleteFolderRecursive( + google::longrunning::Operation const& operation) override; + StatusOr GetStorageLayout( google::storage::control::v2::GetStorageLayoutRequest const& request) override; diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_logging_decorator.cc b/google/cloud/storagecontrol/v2/internal/storage_control_logging_decorator.cc index 964f753fe8741..b7d9291ee0945 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_logging_decorator.cc +++ b/google/cloud/storagecontrol/v2/internal/storage_control_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/storagecontrol/v2/internal/storage_control_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/storage/control/v2/storage_control.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagecontrol_v2_internal { @@ -110,6 +113,38 @@ StatusOr StorageControlLogging::RenameFolder( context, options, request, __func__, tracing_options_); } +future> +StorageControlLogging::AsyncDeleteFolderRecursive( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& + request) { + return child_->AsyncDeleteFolderRecursive(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +StorageControlLogging::DeleteFolderRecursive( + grpc::ClientContext& context, Options options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& + request) { + return child_->DeleteFolderRecursive(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr StorageControlLogging::GetStorageLayout( grpc::ClientContext& context, Options const& options, @@ -464,3 +499,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagecontrol_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_logging_decorator.h b/google/cloud/storagecontrol/v2/internal/storage_control_logging_decorator.h index d29b1f0df8425..be3156c7266b8 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_logging_decorator.h +++ b/google/cloud/storagecontrol/v2/internal/storage_control_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/storagecontrol/v2/internal/storage_control_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 storagecontrol_v2_internal { @@ -68,6 +71,18 @@ class StorageControlLogging : public StorageControlStub { google::storage::control::v2::RenameFolderRequest const& request) override; + future> AsyncDeleteFolderRecursive( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) + override; + + StatusOr DeleteFolderRecursive( + grpc::ClientContext& context, Options options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) + override; + StatusOr GetStorageLayout( grpc::ClientContext& context, Options const& options, google::storage::control::v2::GetStorageLayoutRequest const& request) @@ -214,4 +229,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGECONTROL_V2_INTERNAL_STORAGE_CONTROL_LOGGING_DECORATOR_H diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_metadata_decorator.cc b/google/cloud/storagecontrol/v2/internal/storage_control_metadata_decorator.cc index 0d0824faf241a..7ce8243522121 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_metadata_decorator.cc +++ b/google/cloud/storagecontrol/v2/internal/storage_control_metadata_decorator.cc @@ -18,18 +18,21 @@ #include "google/cloud/storagecontrol/v2/internal/storage_control_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/routing_matcher.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/storage/control/v2/storage_control.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagecontrol_v2_internal { @@ -199,6 +202,67 @@ StatusOr StorageControlMetadata::RenameFolder( return child_->RenameFolder(context, options, request); } +future> +StorageControlMetadata::AsyncDeleteFolderRecursive( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) { + std::vector params; + params.reserve(1); + + static auto* bucket_matcher = [] { + return new google::cloud::internal::RoutingMatcher< + google::storage::control::v2::DeleteFolderRecursiveRequest>{ + "bucket=", + { + {[](google::storage::control::v2:: + DeleteFolderRecursiveRequest const& request) + -> std::string const& { return request.name(); }, + std::regex{"(projects/[^/]+/buckets/[^/]+)/.*", + std::regex::optimize}}, + }}; + }(); + bucket_matcher->AppendParam(request, params); + + if (params.empty()) { + SetMetadata(*context, *options); + } else { + SetMetadata(*context, *options, absl::StrJoin(params, "&")); + } + return child_->AsyncDeleteFolderRecursive(cq, std::move(context), + std::move(options), request); +} + +StatusOr +StorageControlMetadata::DeleteFolderRecursive( + grpc::ClientContext& context, Options options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) { + std::vector params; + params.reserve(1); + + static auto* bucket_matcher = [] { + return new google::cloud::internal::RoutingMatcher< + google::storage::control::v2::DeleteFolderRecursiveRequest>{ + "bucket=", + { + {[](google::storage::control::v2:: + DeleteFolderRecursiveRequest const& request) + -> std::string const& { return request.name(); }, + std::regex{"(projects/[^/]+/buckets/[^/]+)/.*", + std::regex::optimize}}, + }}; + }(); + bucket_matcher->AppendParam(request, params); + + if (params.empty()) { + SetMetadata(context, options); + } else { + SetMetadata(context, options, absl::StrJoin(params, "&")); + } + return child_->DeleteFolderRecursive(context, options, request); +} + StatusOr StorageControlMetadata::GetStorageLayout( grpc::ClientContext& context, Options const& options, @@ -762,3 +826,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagecontrol_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_metadata_decorator.h b/google/cloud/storagecontrol/v2/internal/storage_control_metadata_decorator.h index b3d927f886f4a..1c9391afbc22d 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_metadata_decorator.h +++ b/google/cloud/storagecontrol/v2/internal/storage_control_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/storagecontrol/v2/internal/storage_control_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 storagecontrol_v2_internal { @@ -68,6 +71,18 @@ class StorageControlMetadata : public StorageControlStub { google::storage::control::v2::RenameFolderRequest const& request) override; + future> AsyncDeleteFolderRecursive( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) + override; + + StatusOr DeleteFolderRecursive( + grpc::ClientContext& context, Options options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) + override; + StatusOr GetStorageLayout( grpc::ClientContext& context, Options const& options, google::storage::control::v2::GetStorageLayoutRequest const& request) @@ -219,4 +234,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGECONTROL_V2_INTERNAL_STORAGE_CONTROL_METADATA_DECORATOR_H diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_option_defaults.cc b/google/cloud/storagecontrol/v2/internal/storage_control_option_defaults.cc index 48d2a337d28df..de843d95df00d 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_option_defaults.cc +++ b/google/cloud/storagecontrol/v2/internal/storage_control_option_defaults.cc @@ -41,7 +41,7 @@ Options StorageControlDefaultOptions(Options options) { if (!options.has()) { options.set( storagecontrol_v2::StorageControlLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_stub.cc b/google/cloud/storagecontrol/v2/internal/storage_control_stub.cc index b789db663948c..d1ffe32466af2 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_stub.cc +++ b/google/cloud/storagecontrol/v2/internal/storage_control_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/storagecontrol/v2/internal/storage_control_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/storage/control/v2/storage_control.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagecontrol_v2_internal { @@ -108,6 +111,37 @@ DefaultStorageControlStub::RenameFolder( return response; } +future> +DefaultStorageControlStub::AsyncDeleteFolderRecursive( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::storage::control::v2::DeleteFolderRecursiveRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::storage::control::v2::DeleteFolderRecursiveRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteFolderRecursive(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultStorageControlStub::DeleteFolderRecursive( + grpc::ClientContext& context, Options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteFolderRecursive(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultStorageControlStub::GetStorageLayout( grpc::ClientContext& context, Options const&, @@ -450,3 +484,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagecontrol_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_stub.h b/google/cloud/storagecontrol/v2/internal/storage_control_stub.h index b1e58a8d61101..9458db772884a 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_stub.h +++ b/google/cloud/storagecontrol/v2/internal/storage_control_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/storage/control/v2/storage_control.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagecontrol_v2_internal { @@ -65,6 +68,19 @@ class StorageControlStub { grpc::ClientContext& context, Options options, google::storage::control::v2::RenameFolderRequest const& request) = 0; + virtual future> + AsyncDeleteFolderRecursive( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& + request) = 0; + + virtual StatusOr DeleteFolderRecursive( + grpc::ClientContext& context, Options options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& + request) = 0; + virtual StatusOr GetStorageLayout( grpc::ClientContext& context, Options const& options, @@ -249,6 +265,18 @@ class DefaultStorageControlStub : public StorageControlStub { google::storage::control::v2::RenameFolderRequest const& request) override; + future> AsyncDeleteFolderRecursive( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) + override; + + StatusOr DeleteFolderRecursive( + grpc::ClientContext& context, Options options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) + override; + StatusOr GetStorageLayout( grpc::ClientContext& context, Options const& options, google::storage::control::v2::GetStorageLayoutRequest const& request) @@ -397,4 +425,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGECONTROL_V2_INTERNAL_STORAGE_CONTROL_STUB_H diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_stub_factory.cc b/google/cloud/storagecontrol/v2/internal/storage_control_stub_factory.cc index f9810544ecd3b..495bcfc58233a 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_stub_factory.cc +++ b/google/cloud/storagecontrol/v2/internal/storage_control_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/storage/control/v2/storage_control.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagecontrol_v2_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagecontrol_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_stub_factory.h b/google/cloud/storagecontrol/v2/internal/storage_control_stub_factory.h index 6fc150400ea7b..f720c342a4523 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_stub_factory.h +++ b/google/cloud/storagecontrol/v2/internal/storage_control_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagecontrol_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGECONTROL_V2_INTERNAL_STORAGE_CONTROL_STUB_FACTORY_H diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_tracing_connection.cc b/google/cloud/storagecontrol/v2/internal/storage_control_tracing_connection.cc index 95f48a9550c31..03f6ea086a14c 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_tracing_connection.cc +++ b/google/cloud/storagecontrol/v2/internal/storage_control_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace storagecontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - StorageControlTracingConnection::StorageControlTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -98,6 +96,37 @@ StorageControlTracingConnection::RenameFolder( return internal::EndSpan(std::move(span), child_->RenameFolder(operation)); } +future> +StorageControlTracingConnection::DeleteFolderRecursive( + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) { + auto span = internal::MakeSpan( + "storagecontrol_v2::StorageControlConnection::DeleteFolderRecursive"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteFolderRecursive(request)); +} + +StatusOr +StorageControlTracingConnection::DeleteFolderRecursive( + NoAwaitTag, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) { + auto span = internal::MakeSpan( + "storagecontrol_v2::StorageControlConnection::DeleteFolderRecursive"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->DeleteFolderRecursive(NoAwaitTag{}, request)); +} + +future> +StorageControlTracingConnection::DeleteFolderRecursive( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "storagecontrol_v2::StorageControlConnection::DeleteFolderRecursive"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteFolderRecursive(operation)); +} + StatusOr StorageControlTracingConnection::GetStorageLayout( google::storage::control::v2::GetStorageLayoutRequest const& request) { @@ -351,16 +380,12 @@ StorageControlTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeStorageControlTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_tracing_connection.h b/google/cloud/storagecontrol/v2/internal/storage_control_tracing_connection.h index 7d4b28dad8296..36e7c3f625cdc 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_tracing_connection.h +++ b/google/cloud/storagecontrol/v2/internal/storage_control_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace storagecontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class StorageControlTracingConnection : public storagecontrol_v2::StorageControlConnection { public: @@ -65,6 +63,20 @@ class StorageControlTracingConnection future> RenameFolder( google::longrunning::Operation const& operation) override; + future> + DeleteFolderRecursive( + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) + override; + + StatusOr DeleteFolderRecursive( + NoAwaitTag, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) + override; + + future> + DeleteFolderRecursive( + google::longrunning::Operation const& operation) override; + StatusOr GetStorageLayout( google::storage::control::v2::GetStorageLayoutRequest const& request) override; @@ -172,8 +184,6 @@ class StorageControlTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_tracing_stub.cc b/google/cloud/storagecontrol/v2/internal/storage_control_tracing_stub.cc index e093f09c70db2..4d46036c31974 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_tracing_stub.cc +++ b/google/cloud/storagecontrol/v2/internal/storage_control_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagecontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - StorageControlTracingStub::StorageControlTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -110,6 +111,35 @@ StorageControlTracingStub::RenameFolder( child_->RenameFolder(context, options, request)); } +future> +StorageControlTracingStub::AsyncDeleteFolderRecursive( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) { + auto span = internal::MakeSpanGrpc("google.storage.control.v2.StorageControl", + "DeleteFolderRecursive"); + span->SetAttribute("gl-cpp.request_id", request.request_id()); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteFolderRecursive(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +StorageControlTracingStub::DeleteFolderRecursive( + grpc::ClientContext& context, Options options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) { + auto span = internal::MakeSpanGrpc("google.storage.control.v2.StorageControl", + "DeleteFolderRecursive"); + span->SetAttribute("gl-cpp.request_id", request.request_id()); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteFolderRecursive(context, options, request)); +} + StatusOr StorageControlTracingStub::GetStorageLayout( grpc::ClientContext& context, Options const& options, @@ -443,18 +473,14 @@ future StorageControlTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeStorageControlTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagecontrol_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagecontrol/v2/internal/storage_control_tracing_stub.h b/google/cloud/storagecontrol/v2/internal/storage_control_tracing_stub.h index 1dcdb7d9ccbfe..02e47db8df023 100644 --- a/google/cloud/storagecontrol/v2/internal/storage_control_tracing_stub.h +++ b/google/cloud/storagecontrol/v2/internal/storage_control_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagecontrol_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class StorageControlTracingStub : public StorageControlStub { public: ~StorageControlTracingStub() override = default; @@ -67,6 +68,18 @@ class StorageControlTracingStub : public StorageControlStub { google::storage::control::v2::RenameFolderRequest const& request) override; + future> AsyncDeleteFolderRecursive( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) + override; + + StatusOr DeleteFolderRecursive( + grpc::ClientContext& context, Options options, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) + override; + StatusOr GetStorageLayout( grpc::ClientContext& context, Options const& options, google::storage::control::v2::GetStorageLayoutRequest const& request) @@ -209,8 +222,6 @@ class StorageControlTracingStub : public StorageControlStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -225,4 +236,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGECONTROL_V2_INTERNAL_STORAGE_CONTROL_TRACING_STUB_H diff --git a/google/cloud/storagecontrol/v2/mocks/mock_storage_control_connection.h b/google/cloud/storagecontrol/v2/mocks/mock_storage_control_connection.h index e86012381c3cb..552120e23a969 100644 --- a/google/cloud/storagecontrol/v2/mocks/mock_storage_control_connection.h +++ b/google/cloud/storagecontrol/v2/mocks/mock_storage_control_connection.h @@ -103,6 +103,47 @@ class MockStorageControlConnection RenameFolder, (google::longrunning::Operation const& operation), (override)); + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteFolderRecursive(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteFolderRecursive, + (google::storage::control::v2::DeleteFolderRecursiveRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteFolderRecursive(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteFolderRecursive, + (NoAwaitTag, + google::storage::control::v2::DeleteFolderRecursiveRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteFolderRecursive(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteFolderRecursive, + (google::longrunning::Operation const& operation), (override)); + MOCK_METHOD( StatusOr, GetStorageLayout, (google::storage::control::v2::GetStorageLayoutRequest const& request), 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 e8ca0dabca6af..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 @@ -15,7 +15,7 @@ #include "google/cloud/storagecontrol/v2/storage_control_client.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/testing_util/example_driver.h" -#include +#include "google/storage/control/v2/storage_control.pb.h" #include #include #include @@ -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/storagecontrol/v2/samples/storage_control_folder_samples.cc b/google/cloud/storagecontrol/v2/samples/storage_control_folder_samples.cc index 12bedbae3d64d..43e8050f65f4c 100644 --- a/google/cloud/storagecontrol/v2/samples/storage_control_folder_samples.cc +++ b/google/cloud/storagecontrol/v2/samples/storage_control_folder_samples.cc @@ -16,7 +16,7 @@ #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/time_utils.h" #include "google/cloud/testing_util/example_driver.h" -#include +#include "google/storage/control/v2/storage_control.pb.h" #include #include #include diff --git a/google/cloud/storagecontrol/v2/samples/storage_control_managed_folder_samples.cc b/google/cloud/storagecontrol/v2/samples/storage_control_managed_folder_samples.cc index bbc9a80c2d3b9..ae3a33b808a12 100644 --- a/google/cloud/storagecontrol/v2/samples/storage_control_managed_folder_samples.cc +++ b/google/cloud/storagecontrol/v2/samples/storage_control_managed_folder_samples.cc @@ -16,7 +16,7 @@ #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/time_utils.h" #include "google/cloud/testing_util/example_driver.h" -#include +#include "google/storage/control/v2/storage_control.pb.h" #include #include #include diff --git a/google/cloud/storagecontrol/v2/storage_control_client.cc b/google/cloud/storagecontrol/v2/storage_control_client.cc index 86bb25fcade5d..8538107537624 100644 --- a/google/cloud/storagecontrol/v2/storage_control_client.cc +++ b/google/cloud/storagecontrol/v2/storage_control_client.cc @@ -144,6 +144,48 @@ StorageControlClient::RenameFolder( return connection_->RenameFolder(operation); } +future> +StorageControlClient::DeleteFolderRecursive(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::storage::control::v2::DeleteFolderRecursiveRequest request; + request.set_name(name); + return connection_->DeleteFolderRecursive(request); +} + +StatusOr +StorageControlClient::DeleteFolderRecursive(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::storage::control::v2::DeleteFolderRecursiveRequest request; + request.set_name(name); + return connection_->DeleteFolderRecursive(NoAwaitTag{}, request); +} + +future> +StorageControlClient::DeleteFolderRecursive( + google::storage::control::v2::DeleteFolderRecursiveRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteFolderRecursive(request); +} + +StatusOr +StorageControlClient::DeleteFolderRecursive( + NoAwaitTag, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteFolderRecursive(NoAwaitTag{}, request); +} + +future> +StorageControlClient::DeleteFolderRecursive( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteFolderRecursive(operation); +} + StatusOr StorageControlClient::GetStorageLayout(std::string const& name, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); diff --git a/google/cloud/storagecontrol/v2/storage_control_client.h b/google/cloud/storagecontrol/v2/storage_control_client.h index b0077caac9c01..879d1dc31e267 100644 --- a/google/cloud/storagecontrol/v2/storage_control_client.h +++ b/google/cloud/storagecontrol/v2/storage_control_client.h @@ -28,7 +28,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -118,8 +118,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.CreateFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L439} - /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L378} + /// [google.storage.control.v2.CreateFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L456} + /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L395} /// // clang-format on StatusOr CreateFolder( @@ -151,8 +151,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.CreateFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L439} - /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L378} + /// [google.storage.control.v2.CreateFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L456} + /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L395} /// // clang-format on StatusOr CreateFolder( @@ -177,7 +177,7 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.DeleteFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L476} + /// [google.storage.control.v2.DeleteFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L493} /// // clang-format on Status DeleteFolder(std::string const& name, Options opts = {}); @@ -204,7 +204,7 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.DeleteFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L476} + /// [google.storage.control.v2.DeleteFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L493} /// // clang-format on Status DeleteFolder( @@ -231,8 +231,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L378} - /// [google.storage.control.v2.GetFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L413} + /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L395} + /// [google.storage.control.v2.GetFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L430} /// // clang-format on StatusOr GetFolder( @@ -262,8 +262,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L378} - /// [google.storage.control.v2.GetFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L413} + /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L395} + /// [google.storage.control.v2.GetFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L430} /// // clang-format on StatusOr GetFolder( @@ -299,8 +299,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L378} - /// [google.storage.control.v2.ListFoldersRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L502} + /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L395} + /// [google.storage.control.v2.ListFoldersRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L519} /// // clang-format on StreamRange ListFolders( @@ -339,8 +339,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L378} - /// [google.storage.control.v2.ListFoldersRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L502} + /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L395} + /// [google.storage.control.v2.ListFoldersRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L519} /// // clang-format on StreamRange ListFolders( @@ -377,8 +377,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L378} - /// [google.storage.control.v2.RenameFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L561} + /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L395} + /// [google.storage.control.v2.RenameFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L578} /// // clang-format on future> RenameFolder( @@ -433,8 +433,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L378} - /// [google.storage.control.v2.RenameFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L561} + /// [google.storage.control.v2.Folder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L395} + /// [google.storage.control.v2.RenameFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L578} /// // clang-format on future> RenameFolder( @@ -469,6 +469,124 @@ class StorageControlClient { future> RenameFolder( google::longrunning::Operation const& operation, Options opts = {}); + // clang-format off + /// + /// Deletes a folder recursively. This operation is only applicable to a + /// hierarchical namespace enabled bucket. + /// + /// @param name Required. Name of the folder being deleted, however all of its contents + /// will be deleted too. Format: + /// `projects/{project}/buckets/{bucket}/folders/{folder}` + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.storage.control.v2.DeleteFolderRecursiveMetadata] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.storage.control.v2.DeleteFolderRecursiveMetadata]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L676} + /// [google.storage.control.v2.DeleteFolderRecursiveRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L607} + /// + // clang-format on + future> + DeleteFolderRecursive(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteFolderRecursive + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteFolderRecursive( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a folder recursively. This operation is only applicable to a + /// hierarchical namespace enabled bucket. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.storage.control.v2.DeleteFolderRecursiveRequest]. + /// Proto messages are converted to C++ 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.storage.control.v2.DeleteFolderRecursiveMetadata] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.storage.control.v2.DeleteFolderRecursiveMetadata]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L676} + /// [google.storage.control.v2.DeleteFolderRecursiveRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L607} + /// + // clang-format on + future> + DeleteFolderRecursive( + google::storage::control::v2::DeleteFolderRecursiveRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteFolderRecursive + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteFolderRecursive( + NoAwaitTag, + google::storage::control::v2::DeleteFolderRecursiveRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteFolderRecursive + /// + /// 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> + DeleteFolderRecursive(google::longrunning::Operation const& operation, + Options opts = {}); + // clang-format off /// /// Returns the storage layout configuration for a given bucket. @@ -488,8 +606,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.GetStorageLayoutRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L675} - /// [google.storage.control.v2.StorageLayout]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L630} + /// [google.storage.control.v2.GetStorageLayoutRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L730} + /// [google.storage.control.v2.StorageLayout]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L685} /// // clang-format on StatusOr GetStorageLayout( @@ -518,8 +636,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.GetStorageLayoutRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L675} - /// [google.storage.control.v2.StorageLayout]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L630} + /// [google.storage.control.v2.GetStorageLayoutRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L730} + /// [google.storage.control.v2.StorageLayout]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L685} /// // clang-format on StatusOr GetStorageLayout( @@ -550,8 +668,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.CreateManagedFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L754} - /// [google.storage.control.v2.ManagedFolder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L698} + /// [google.storage.control.v2.CreateManagedFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L809} + /// [google.storage.control.v2.ManagedFolder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L753} /// // clang-format on StatusOr CreateManagedFolder( @@ -582,8 +700,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.CreateManagedFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L754} - /// [google.storage.control.v2.ManagedFolder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L698} + /// [google.storage.control.v2.CreateManagedFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L809} + /// [google.storage.control.v2.ManagedFolder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L753} /// // clang-format on StatusOr CreateManagedFolder( @@ -608,7 +726,7 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.DeleteManagedFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L782} + /// [google.storage.control.v2.DeleteManagedFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L837} /// // clang-format on Status DeleteManagedFolder(std::string const& name, Options opts = {}); @@ -634,7 +752,7 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.DeleteManagedFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L782} + /// [google.storage.control.v2.DeleteManagedFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L837} /// // clang-format on Status DeleteManagedFolder( @@ -661,8 +779,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.GetManagedFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L726} - /// [google.storage.control.v2.ManagedFolder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L698} + /// [google.storage.control.v2.GetManagedFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L781} + /// [google.storage.control.v2.ManagedFolder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L753} /// // clang-format on StatusOr GetManagedFolder( @@ -691,8 +809,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.GetManagedFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L726} - /// [google.storage.control.v2.ManagedFolder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L698} + /// [google.storage.control.v2.GetManagedFolderRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L781} + /// [google.storage.control.v2.ManagedFolder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L753} /// // clang-format on StatusOr GetManagedFolder( @@ -726,8 +844,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.ListManagedFoldersRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L816} - /// [google.storage.control.v2.ManagedFolder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L698} + /// [google.storage.control.v2.ListManagedFoldersRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L871} + /// [google.storage.control.v2.ManagedFolder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L753} /// // clang-format on StreamRange ListManagedFolders( @@ -765,8 +883,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.ListManagedFoldersRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L816} - /// [google.storage.control.v2.ManagedFolder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L698} + /// [google.storage.control.v2.ListManagedFoldersRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L871} + /// [google.storage.control.v2.ManagedFolder]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L753} /// // clang-format on StreamRange ListManagedFolders( @@ -803,8 +921,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L904} - /// [google.storage.control.v2.CreateAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L952} + /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L959} + /// [google.storage.control.v2.CreateAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1007} /// // clang-format on future> @@ -859,8 +977,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L904} - /// [google.storage.control.v2.CreateAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L952} + /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L959} + /// [google.storage.control.v2.CreateAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1007} /// // clang-format on future> @@ -932,8 +1050,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L904} - /// [google.storage.control.v2.UpdateAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L978} + /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L959} + /// [google.storage.control.v2.UpdateAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1033} /// // clang-format on future> @@ -988,8 +1106,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L904} - /// [google.storage.control.v2.UpdateAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L978} + /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L959} + /// [google.storage.control.v2.UpdateAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1033} /// // clang-format on future> @@ -1048,8 +1166,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L904} - /// [google.storage.control.v2.DisableAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1004} + /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L959} + /// [google.storage.control.v2.DisableAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1059} /// // clang-format on StatusOr DisableAnywhereCache( @@ -1081,8 +1199,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L904} - /// [google.storage.control.v2.DisableAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1004} + /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L959} + /// [google.storage.control.v2.DisableAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1059} /// // clang-format on StatusOr DisableAnywhereCache( @@ -1108,8 +1226,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L904} - /// [google.storage.control.v2.PauseAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1024} + /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L959} + /// [google.storage.control.v2.PauseAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1079} /// // clang-format on StatusOr PauseAnywhereCache( @@ -1138,8 +1256,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L904} - /// [google.storage.control.v2.PauseAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1024} + /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L959} + /// [google.storage.control.v2.PauseAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1079} /// // clang-format on StatusOr PauseAnywhereCache( @@ -1165,8 +1283,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L904} - /// [google.storage.control.v2.ResumeAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1044} + /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L959} + /// [google.storage.control.v2.ResumeAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1099} /// // clang-format on StatusOr ResumeAnywhereCache( @@ -1195,8 +1313,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L904} - /// [google.storage.control.v2.ResumeAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1044} + /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L959} + /// [google.storage.control.v2.ResumeAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1099} /// // clang-format on StatusOr ResumeAnywhereCache( @@ -1222,8 +1340,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L904} - /// [google.storage.control.v2.GetAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1064} + /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L959} + /// [google.storage.control.v2.GetAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1119} /// // clang-format on StatusOr GetAnywhereCache( @@ -1252,8 +1370,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L904} - /// [google.storage.control.v2.GetAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1064} + /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L959} + /// [google.storage.control.v2.GetAnywhereCacheRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1119} /// // clang-format on StatusOr GetAnywhereCache( @@ -1287,8 +1405,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L904} - /// [google.storage.control.v2.ListAnywhereCachesRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1083} + /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L959} + /// [google.storage.control.v2.ListAnywhereCachesRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1138} /// // clang-format on StreamRange ListAnywhereCaches( @@ -1326,8 +1444,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L904} - /// [google.storage.control.v2.ListAnywhereCachesRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1083} + /// [google.storage.control.v2.AnywhereCache]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L959} + /// [google.storage.control.v2.ListAnywhereCachesRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1138} /// // clang-format on StreamRange ListAnywhereCaches( @@ -1355,8 +1473,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.GetProjectIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1398} - /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1120} + /// [google.storage.control.v2.GetProjectIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1453} + /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1175} /// // clang-format on StatusOr @@ -1385,8 +1503,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.GetProjectIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1398} - /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1120} + /// [google.storage.control.v2.GetProjectIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1453} + /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1175} /// // clang-format on StatusOr @@ -1416,8 +1534,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1120} - /// [google.storage.control.v2.UpdateProjectIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1329} + /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1175} + /// [google.storage.control.v2.UpdateProjectIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1384} /// // clang-format on StatusOr @@ -1449,8 +1567,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1120} - /// [google.storage.control.v2.UpdateProjectIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1329} + /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1175} + /// [google.storage.control.v2.UpdateProjectIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1384} /// // clang-format on StatusOr @@ -1480,8 +1598,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.GetFolderIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1377} - /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1120} + /// [google.storage.control.v2.GetFolderIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1432} + /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1175} /// // clang-format on StatusOr @@ -1510,8 +1628,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.GetFolderIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1377} - /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1120} + /// [google.storage.control.v2.GetFolderIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1432} + /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1175} /// // clang-format on StatusOr @@ -1541,8 +1659,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1120} - /// [google.storage.control.v2.UpdateFolderIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1302} + /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1175} + /// [google.storage.control.v2.UpdateFolderIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1357} /// // clang-format on StatusOr @@ -1574,8 +1692,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1120} - /// [google.storage.control.v2.UpdateFolderIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1302} + /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1175} + /// [google.storage.control.v2.UpdateFolderIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1357} /// // clang-format on StatusOr @@ -1605,8 +1723,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.GetOrganizationIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1356} - /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1120} + /// [google.storage.control.v2.GetOrganizationIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1411} + /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1175} /// // clang-format on StatusOr @@ -1635,8 +1753,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.GetOrganizationIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1356} - /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1120} + /// [google.storage.control.v2.GetOrganizationIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1411} + /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1175} /// // clang-format on StatusOr @@ -1666,8 +1784,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1120} - /// [google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1275} + /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1175} + /// [google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1330} /// // clang-format on StatusOr @@ -1699,8 +1817,8 @@ class StorageControlClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1120} - /// [google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1275} + /// [google.storage.control.v2.IntelligenceConfig]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1175} + /// [google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest]: @googleapis_reference_link{google/storage/control/v2/storage_control.proto#L1330} /// // clang-format on StatusOr diff --git a/google/cloud/storagecontrol/v2/storage_control_connection.cc b/google/cloud/storagecontrol/v2/storage_control_connection.cc index a5ddf8832c6b2..023237bf711f3 100644 --- a/google/cloud/storagecontrol/v2/storage_control_connection.cc +++ b/google/cloud/storagecontrol/v2/storage_control_connection.cc @@ -84,6 +84,30 @@ StorageControlConnection::RenameFolder(google::longrunning::Operation const&) { Status(StatusCode::kUnimplemented, "not implemented")); } +future> +StorageControlConnection::DeleteFolderRecursive( + google::storage::control::v2::DeleteFolderRecursiveRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +StorageControlConnection::DeleteFolderRecursive( + NoAwaitTag, + google::storage::control::v2::DeleteFolderRecursiveRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StorageControlConnection::DeleteFolderRecursive( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + StatusOr StorageControlConnection::GetStorageLayout( google::storage::control::v2::GetStorageLayoutRequest const&) { diff --git a/google/cloud/storagecontrol/v2/storage_control_connection.h b/google/cloud/storagecontrol/v2/storage_control_connection.h index 1c15f550a459a..efe8a4adae450 100644 --- a/google/cloud/storagecontrol/v2/storage_control_connection.h +++ b/google/cloud/storagecontrol/v2/storage_control_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/storage/control/v2/storage_control.pb.h" #include namespace google { @@ -216,6 +216,21 @@ class StorageControlConnection { virtual future> RenameFolder( google::longrunning::Operation const& operation); + virtual future< + StatusOr> + DeleteFolderRecursive( + google::storage::control::v2::DeleteFolderRecursiveRequest const& + request); + + virtual StatusOr DeleteFolderRecursive( + NoAwaitTag, + google::storage::control::v2::DeleteFolderRecursiveRequest const& + request); + + virtual future< + StatusOr> + DeleteFolderRecursive(google::longrunning::Operation const& operation); + virtual StatusOr GetStorageLayout( google::storage::control::v2::GetStorageLayoutRequest const& request); diff --git a/google/cloud/storagecontrol/v2/storage_control_connection_idempotency_policy.cc b/google/cloud/storagecontrol/v2/storage_control_connection_idempotency_policy.cc index f3cd22dcc02a8..6f5941f9ede4f 100644 --- a/google/cloud/storagecontrol/v2/storage_control_connection_idempotency_policy.cc +++ b/google/cloud/storagecontrol/v2/storage_control_connection_idempotency_policy.cc @@ -63,6 +63,12 @@ Idempotency StorageControlConnectionIdempotencyPolicy::RenameFolder( return Idempotency::kNonIdempotent; } +Idempotency StorageControlConnectionIdempotencyPolicy::DeleteFolderRecursive( + google::storage::control::v2::DeleteFolderRecursiveRequest const& request) { + if (!request.request_id().empty()) return Idempotency::kIdempotent; + return Idempotency::kNonIdempotent; +} + Idempotency StorageControlConnectionIdempotencyPolicy::GetStorageLayout( google::storage::control::v2::GetStorageLayoutRequest const& request) { if (!request.request_id().empty()) return Idempotency::kIdempotent; diff --git a/google/cloud/storagecontrol/v2/storage_control_connection_idempotency_policy.h b/google/cloud/storagecontrol/v2/storage_control_connection_idempotency_policy.h index 0db0358f25d5a..9f2280555c0e4 100644 --- a/google/cloud/storagecontrol/v2/storage_control_connection_idempotency_policy.h +++ b/google/cloud/storagecontrol/v2/storage_control_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/storage/control/v2/storage_control.grpc.pb.h" #include namespace google { @@ -52,6 +52,10 @@ class StorageControlConnectionIdempotencyPolicy { virtual google::cloud::Idempotency RenameFolder( google::storage::control::v2::RenameFolderRequest const& request); + virtual google::cloud::Idempotency DeleteFolderRecursive( + google::storage::control::v2::DeleteFolderRecursiveRequest const& + request); + virtual google::cloud::Idempotency GetStorageLayout( google::storage::control::v2::GetStorageLayoutRequest const& request); diff --git a/google/cloud/storageinsights/BUILD.bazel b/google/cloud/storageinsights/BUILD.bazel index eef854b92b79e..82cb84f3d7753 100644 --- a/google/cloud/storageinsights/BUILD.bazel +++ b/google/cloud/storageinsights/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/storageinsights/v1:storageinsights_cc_grpc", + "@googleapis//google/cloud/storageinsights/v1:storageinsights_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/storageinsights/quickstart/.bazelrc b/google/cloud/storageinsights/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/storageinsights/quickstart/.bazelrc +++ b/google/cloud/storageinsights/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/storageinsights/quickstart/CMakeLists.txt index 668558114fa9c..c3b1ff61380bd 100644 --- a/google/cloud/storageinsights/quickstart/CMakeLists.txt +++ b/google/cloud/storageinsights/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Storage Insights API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-storageinsights-quickstart CXX) find_package(google_cloud_cpp_storageinsights REQUIRED) diff --git a/google/cloud/storageinsights/quickstart/WORKSPACE.bazel b/google/cloud/storageinsights/quickstart/WORKSPACE.bazel index c741515f640e2..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 = "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/storageinsights/v1/internal/storage_insights_auth_decorator.cc b/google/cloud/storageinsights/v1/internal/storage_insights_auth_decorator.cc index a3f9254900594..3916520f0cd27 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_auth_decorator.cc +++ b/google/cloud/storageinsights/v1/internal/storage_insights_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/storageinsights/v1/storageinsights.proto #include "google/cloud/storageinsights/v1/internal/storage_insights_auth_decorator.h" -#include +#include "google/cloud/storageinsights/v1/storageinsights.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storageinsights_v1_internal { @@ -357,3 +360,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storageinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_auth_decorator.h b/google/cloud/storageinsights/v1/internal/storage_insights_auth_decorator.h index c464091c9705f..726cd5f55cd60 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_auth_decorator.h +++ b/google/cloud/storageinsights/v1/internal/storage_insights_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/storageinsights/v1/internal/storage_insights_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 storageinsights_v1_internal { @@ -193,4 +196,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEINSIGHTS_V1_INTERNAL_STORAGE_INSIGHTS_AUTH_DECORATOR_H diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_connection_impl.h b/google/cloud/storageinsights/v1/internal/storage_insights_connection_impl.h index 278dd32ab1078..0a17475b9c82a 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_connection_impl.h +++ b/google/cloud/storageinsights/v1/internal/storage_insights_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_logging_decorator.cc b/google/cloud/storageinsights/v1/internal/storage_insights_logging_decorator.cc index 002e71d0d495c..f016e9676e1d1 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_logging_decorator.cc +++ b/google/cloud/storageinsights/v1/internal/storage_insights_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/storageinsights/v1/storageinsights.proto #include "google/cloud/storageinsights/v1/internal/storage_insights_logging_decorator.h" +#include "google/cloud/storageinsights/v1/storageinsights.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storageinsights_v1_internal { @@ -439,3 +442,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storageinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_logging_decorator.h b/google/cloud/storageinsights/v1/internal/storage_insights_logging_decorator.h index dad507f7bf240..8bbeb6ce746eb 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_logging_decorator.h +++ b/google/cloud/storageinsights/v1/internal/storage_insights_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/storageinsights/v1/internal/storage_insights_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 storageinsights_v1_internal { @@ -193,4 +196,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEINSIGHTS_V1_INTERNAL_STORAGE_INSIGHTS_LOGGING_DECORATOR_H diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_metadata_decorator.cc b/google/cloud/storageinsights/v1/internal/storage_insights_metadata_decorator.cc index da97c85ee551e..f5bd43da9f141 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_metadata_decorator.cc +++ b/google/cloud/storageinsights/v1/internal/storage_insights_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/storageinsights/v1/storageinsights.proto #include "google/cloud/storageinsights/v1/internal/storage_insights_metadata_decorator.h" +#include "google/cloud/storageinsights/v1/storageinsights.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 storageinsights_v1_internal { @@ -337,3 +341,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storageinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_metadata_decorator.h b/google/cloud/storageinsights/v1/internal/storage_insights_metadata_decorator.h index b8c76ee37b707..68533b33c7141 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_metadata_decorator.h +++ b/google/cloud/storageinsights/v1/internal/storage_insights_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/storageinsights/v1/internal/storage_insights_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 storageinsights_v1_internal { @@ -199,4 +202,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEINSIGHTS_V1_INTERNAL_STORAGE_INSIGHTS_METADATA_DECORATOR_H diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_option_defaults.cc b/google/cloud/storageinsights/v1/internal/storage_insights_option_defaults.cc index 71b216ca66943..1f5f4cb8c2357 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_option_defaults.cc +++ b/google/cloud/storageinsights/v1/internal/storage_insights_option_defaults.cc @@ -42,7 +42,7 @@ Options StorageInsightsDefaultOptions(Options options) { if (!options.has()) { options.set( storageinsights_v1::StorageInsightsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_stub.cc b/google/cloud/storageinsights/v1/internal/storage_insights_stub.cc index 564791c3f98fd..8b79c8795516f 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_stub.cc +++ b/google/cloud/storageinsights/v1/internal/storage_insights_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/storageinsights/v1/storageinsights.proto #include "google/cloud/storageinsights/v1/internal/storage_insights_stub.h" +#include "google/cloud/storageinsights/v1/storageinsights.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storageinsights_v1_internal { @@ -422,3 +425,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storageinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_stub.h b/google/cloud/storageinsights/v1/internal/storage_insights_stub.h index 7f293f2ba6674..2ad6239b3db66 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_stub.h +++ b/google/cloud/storageinsights/v1/internal/storage_insights_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEINSIGHTS_V1_INTERNAL_STORAGE_INSIGHTS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEINSIGHTS_V1_INTERNAL_STORAGE_INSIGHTS_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/storageinsights/v1/storageinsights.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storageinsights_v1_internal { @@ -369,4 +372,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEINSIGHTS_V1_INTERNAL_STORAGE_INSIGHTS_STUB_H diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_stub_factory.cc b/google/cloud/storageinsights/v1/internal/storage_insights_stub_factory.cc index 5b81f003e9711..f62175fe92ff4 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_stub_factory.cc +++ b/google/cloud/storageinsights/v1/internal/storage_insights_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/storageinsights/v1/storageinsights.proto #include "google/cloud/storageinsights/v1/internal/storage_insights_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/storageinsights/v1/internal/storage_insights_auth_decorator.h" #include "google/cloud/storageinsights/v1/internal/storage_insights_logging_decorator.h" #include "google/cloud/storageinsights/v1/internal/storage_insights_metadata_decorator.h" #include "google/cloud/storageinsights/v1/internal/storage_insights_stub.h" #include "google/cloud/storageinsights/v1/internal/storage_insights_tracing_stub.h" +#include "google/cloud/storageinsights/v1/storageinsights.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storageinsights_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storageinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_stub_factory.h b/google/cloud/storageinsights/v1/internal/storage_insights_stub_factory.h index 62bcbaa84814d..781f6ea530120 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_stub_factory.h +++ b/google/cloud/storageinsights/v1/internal/storage_insights_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storageinsights_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEINSIGHTS_V1_INTERNAL_STORAGE_INSIGHTS_STUB_FACTORY_H diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_tracing_connection.cc b/google/cloud/storageinsights/v1/internal/storage_insights_tracing_connection.cc index 1b87e43c05c7c..5d5a6b4240d63 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_tracing_connection.cc +++ b/google/cloud/storageinsights/v1/internal/storage_insights_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace storageinsights_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - StorageInsightsTracingConnection::StorageInsightsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -337,16 +335,12 @@ Status StorageInsightsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeStorageInsightsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_tracing_connection.h b/google/cloud/storageinsights/v1/internal/storage_insights_tracing_connection.h index 2261babdcd84b..2df1f5409e5e7 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_tracing_connection.h +++ b/google/cloud/storageinsights/v1/internal/storage_insights_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace storageinsights_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class StorageInsightsTracingConnection : public storageinsights_v1::StorageInsightsConnection { public: @@ -162,8 +160,6 @@ class StorageInsightsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_tracing_stub.cc b/google/cloud/storageinsights/v1/internal/storage_insights_tracing_stub.cc index 7a635c1d500fe..5851f32beb7a7 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_tracing_stub.cc +++ b/google/cloud/storageinsights/v1/internal/storage_insights_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storageinsights_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - StorageInsightsTracingStub::StorageInsightsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -383,18 +384,14 @@ future StorageInsightsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeStorageInsightsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storageinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storageinsights/v1/internal/storage_insights_tracing_stub.h b/google/cloud/storageinsights/v1/internal/storage_insights_tracing_stub.h index 067cfdef2bfa0..8fd110ff1888b 100644 --- a/google/cloud/storageinsights/v1/internal/storage_insights_tracing_stub.h +++ b/google/cloud/storageinsights/v1/internal/storage_insights_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storageinsights_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class StorageInsightsTracingStub : public StorageInsightsStub { public: ~StorageInsightsTracingStub() override = default; @@ -189,8 +190,6 @@ class StorageInsightsTracingStub : public StorageInsightsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -205,4 +204,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEINSIGHTS_V1_INTERNAL_STORAGE_INSIGHTS_TRACING_STUB_H diff --git a/google/cloud/storageinsights/v1/storage_insights_client.h b/google/cloud/storageinsights/v1/storage_insights_client.h index 63b8b2c4cd67d..c7ac98f5c75e8 100644 --- a/google/cloud/storageinsights/v1/storage_insights_client.h +++ b/google/cloud/storageinsights/v1/storage_insights_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/storageinsights/v1/storage_insights_connection.h b/google/cloud/storageinsights/v1/storage_insights_connection.h index 4d8359507e362..acdaed0c5d193 100644 --- a/google/cloud/storageinsights/v1/storage_insights_connection.h +++ b/google/cloud/storageinsights/v1/storage_insights_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/storageinsights/v1/internal/storage_insights_retry_traits.h" #include "google/cloud/storageinsights/v1/storage_insights_connection_idempotency_policy.h" +#include "google/cloud/storageinsights/v1/storageinsights.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/storageinsights/v1/storage_insights_connection_idempotency_policy.h b/google/cloud/storageinsights/v1/storage_insights_connection_idempotency_policy.h index b5f810cb8045a..c504ce1d2791d 100644 --- a/google/cloud/storageinsights/v1/storage_insights_connection_idempotency_policy.h +++ b/google/cloud/storageinsights/v1/storage_insights_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEINSIGHTS_V1_STORAGE_INSIGHTS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGEINSIGHTS_V1_STORAGE_INSIGHTS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/storageinsights/v1/storageinsights.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/storagetransfer/BUILD.bazel b/google/cloud/storagetransfer/BUILD.bazel index 3fdcf167e0153..1dfe331c452b2 100644 --- a/google/cloud/storagetransfer/BUILD.bazel +++ b/google/cloud/storagetransfer/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/storagetransfer/v1:storagetransfer_cc_grpc", + "@googleapis//google/storagetransfer/v1:storagetransfer_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/storagetransfer/CMakeLists.txt b/google/cloud/storagetransfer/CMakeLists.txt index 79b1ad38d6038..713edb09a209c 100644 --- a/google/cloud/storagetransfer/CMakeLists.txt +++ b/google/cloud/storagetransfer/CMakeLists.txt @@ -27,7 +27,7 @@ endif () include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(storagetransfer "Storage Transfer API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(storagetransfer_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/storagetransfer/mocks/mock_storage_transfer_connection.h b/google/cloud/storagetransfer/mocks/mock_storage_transfer_connection.h deleted file mode 100644 index c66f70ecca6f8..0000000000000 --- a/google/cloud/storagetransfer/mocks/mock_storage_transfer_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/storagetransfer/v1/transfer.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_MOCKS_MOCK_STORAGE_TRANSFER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_MOCKS_MOCK_STORAGE_TRANSFER_CONNECTION_H - -#include "google/cloud/storagetransfer/storage_transfer_connection.h" -#include "google/cloud/storagetransfer/v1/mocks/mock_storage_transfer_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in storagetransfer_v1_mocks instead of the aliases -/// defined in this namespace. -namespace storagetransfer_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// storagetransfer_v1_mocks::MockStorageTransferServiceConnection directly. -using ::google::cloud::storagetransfer_v1_mocks:: - MockStorageTransferServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storagetransfer_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_MOCKS_MOCK_STORAGE_TRANSFER_CONNECTION_H diff --git a/google/cloud/storagetransfer/quickstart/.bazelrc b/google/cloud/storagetransfer/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/storagetransfer/quickstart/.bazelrc +++ b/google/cloud/storagetransfer/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/storagetransfer/quickstart/CMakeLists.txt index 680fb0ee7ff00..09fce9fb82085 100644 --- a/google/cloud/storagetransfer/quickstart/CMakeLists.txt +++ b/google/cloud/storagetransfer/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Storage Transfer API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-storagetransfer-quickstart CXX) find_package(google_cloud_cpp_storagetransfer REQUIRED) diff --git a/google/cloud/storagetransfer/quickstart/WORKSPACE.bazel b/google/cloud/storagetransfer/quickstart/WORKSPACE.bazel index b490017b06828..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 = "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/storagetransfer/storage_transfer_client.h b/google/cloud/storagetransfer/storage_transfer_client.h deleted file mode 100644 index 5c18782710b6c..0000000000000 --- a/google/cloud/storagetransfer/storage_transfer_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/storagetransfer/v1/transfer.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_STORAGE_TRANSFER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_STORAGE_TRANSFER_CLIENT_H - -#include "google/cloud/storagetransfer/storage_transfer_connection.h" -#include "google/cloud/storagetransfer/v1/storage_transfer_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in storagetransfer_v1 instead of the aliases defined in -/// this namespace. -namespace storagetransfer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use storagetransfer_v1::StorageTransferServiceClient directly. -using ::google::cloud::storagetransfer_v1::StorageTransferServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storagetransfer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_STORAGE_TRANSFER_CLIENT_H diff --git a/google/cloud/storagetransfer/storage_transfer_connection.h b/google/cloud/storagetransfer/storage_transfer_connection.h deleted file mode 100644 index 689c7b2d3a887..0000000000000 --- a/google/cloud/storagetransfer/storage_transfer_connection.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/storagetransfer/v1/transfer.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_STORAGE_TRANSFER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_STORAGE_TRANSFER_CONNECTION_H - -#include "google/cloud/storagetransfer/storage_transfer_connection_idempotency_policy.h" -#include "google/cloud/storagetransfer/v1/storage_transfer_connection.h" - -namespace google { -namespace cloud { -namespace storagetransfer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use storagetransfer_v1::MakeStorageTransferServiceConnection -/// directly. -using ::google::cloud::storagetransfer_v1::MakeStorageTransferServiceConnection; - -/// @deprecated Use storagetransfer_v1::StorageTransferServiceConnection -/// directly. -using ::google::cloud::storagetransfer_v1::StorageTransferServiceConnection; - -/// @deprecated Use -/// storagetransfer_v1::StorageTransferServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::storagetransfer_v1:: - StorageTransferServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// storagetransfer_v1::StorageTransferServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::storagetransfer_v1:: - StorageTransferServiceLimitedTimeRetryPolicy; - -/// @deprecated Use storagetransfer_v1::StorageTransferServiceRetryPolicy -/// directly. -using ::google::cloud::storagetransfer_v1::StorageTransferServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storagetransfer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_STORAGE_TRANSFER_CONNECTION_H diff --git a/google/cloud/storagetransfer/storage_transfer_connection_idempotency_policy.h b/google/cloud/storagetransfer/storage_transfer_connection_idempotency_policy.h deleted file mode 100644 index 1186f9731902c..0000000000000 --- a/google/cloud/storagetransfer/storage_transfer_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/storagetransfer/v1/transfer.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_STORAGE_TRANSFER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_STORAGE_TRANSFER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/storagetransfer/v1/storage_transfer_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace storagetransfer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// storagetransfer_v1::MakeDefaultStorageTransferServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::storagetransfer_v1:: - MakeDefaultStorageTransferServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// storagetransfer_v1::StorageTransferServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::storagetransfer_v1:: - StorageTransferServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storagetransfer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_STORAGE_TRANSFER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/storagetransfer/storage_transfer_options.h b/google/cloud/storagetransfer/storage_transfer_options.h deleted file mode 100644 index d2f51361bbf9c..0000000000000 --- a/google/cloud/storagetransfer/storage_transfer_options.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/storagetransfer/v1/transfer.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_STORAGE_TRANSFER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_STORAGE_TRANSFER_OPTIONS_H - -#include "google/cloud/storagetransfer/storage_transfer_connection.h" -#include "google/cloud/storagetransfer/storage_transfer_connection_idempotency_policy.h" -#include "google/cloud/storagetransfer/v1/storage_transfer_options.h" - -namespace google { -namespace cloud { -namespace storagetransfer { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// storagetransfer_v1::StorageTransferServicePollingPolicyOption directly. -using ::google::cloud::storagetransfer_v1:: - StorageTransferServicePollingPolicyOption; - -/// @deprecated Use -/// storagetransfer_v1::StorageTransferServiceBackoffPolicyOption directly. -using ::google::cloud::storagetransfer_v1:: - StorageTransferServiceBackoffPolicyOption; - -/// @deprecated Use -/// storagetransfer_v1::StorageTransferServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::storagetransfer_v1:: - StorageTransferServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use storagetransfer_v1::StorageTransferServicePolicyOptionList -/// directly. -using ::google::cloud::storagetransfer_v1:: - StorageTransferServicePolicyOptionList; - -/// @deprecated Use storagetransfer_v1::StorageTransferServiceRetryPolicyOption -/// directly. -using ::google::cloud::storagetransfer_v1:: - StorageTransferServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storagetransfer -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_STORAGE_TRANSFER_OPTIONS_H diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_auth_decorator.cc b/google/cloud/storagetransfer/v1/internal/storage_transfer_auth_decorator.cc index d597f1587909f..b1a5b6c4b02cd 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_auth_decorator.cc +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/storagetransfer/v1/transfer.proto #include "google/cloud/storagetransfer/v1/internal/storage_transfer_auth_decorator.h" -#include +#include "google/storagetransfer/v1/transfer.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagetransfer_v1_internal { @@ -241,3 +244,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagetransfer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_auth_decorator.h b/google/cloud/storagetransfer/v1/internal/storage_transfer_auth_decorator.h index d6535c655ac91..7500c1dad56a4 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_auth_decorator.h +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/storagetransfer/v1/internal/storage_transfer_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 storagetransfer_v1_internal { @@ -150,4 +153,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_V1_INTERNAL_STORAGE_TRANSFER_AUTH_DECORATOR_H diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_connection_impl.h b/google/cloud/storagetransfer/v1/internal/storage_transfer_connection_impl.h index 914c3f3771f09..f052b8b13ccc6 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_connection_impl.h +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_logging_decorator.cc b/google/cloud/storagetransfer/v1/internal/storage_transfer_logging_decorator.cc index 99e198e759bcc..db43de1e88ceb 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_logging_decorator.cc +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/storagetransfer/v1/internal/storage_transfer_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/storagetransfer/v1/transfer.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagetransfer_v1_internal { @@ -307,3 +310,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagetransfer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_logging_decorator.h b/google/cloud/storagetransfer/v1/internal/storage_transfer_logging_decorator.h index 1b4621d32c0c2..626127f3ccd4b 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_logging_decorator.h +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/storagetransfer/v1/internal/storage_transfer_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 storagetransfer_v1_internal { @@ -150,4 +153,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_V1_INTERNAL_STORAGE_TRANSFER_LOGGING_DECORATOR_H diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_metadata_decorator.cc b/google/cloud/storagetransfer/v1/internal/storage_transfer_metadata_decorator.cc index be30ce8d9c5f9..2955528540c53 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_metadata_decorator.cc +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/storagetransfer/v1/internal/storage_transfer_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/storagetransfer/v1/transfer.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagetransfer_v1_internal { @@ -253,3 +257,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagetransfer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_metadata_decorator.h b/google/cloud/storagetransfer/v1/internal/storage_transfer_metadata_decorator.h index ba81033ee6565..1eb95f58c1a2c 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_metadata_decorator.h +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/storagetransfer/v1/internal/storage_transfer_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 storagetransfer_v1_internal { @@ -156,4 +159,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_V1_INTERNAL_STORAGE_TRANSFER_METADATA_DECORATOR_H diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_option_defaults.cc b/google/cloud/storagetransfer/v1/internal/storage_transfer_option_defaults.cc index 9af6735f07413..a8f0dd188b31f 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_option_defaults.cc +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_option_defaults.cc @@ -43,7 +43,7 @@ Options StorageTransferServiceDefaultOptions(Options options) { storagetransfer_v1::StorageTransferServiceRetryPolicyOption>()) { options.set( storagetransfer_v1::StorageTransferServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_stub.cc b/google/cloud/storagetransfer/v1/internal/storage_transfer_stub.cc index 3b6d2bef540ce..188e38c1f18bf 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_stub.cc +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_stub.cc @@ -19,11 +19,14 @@ #include "google/cloud/storagetransfer/v1/internal/storage_transfer_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/storagetransfer/v1/transfer.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagetransfer_v1_internal { @@ -296,3 +299,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagetransfer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_stub.h b/google/cloud/storagetransfer/v1/internal/storage_transfer_stub.h index f7a283590b6af..3ae7220b01e15 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_stub.h +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_stub.h @@ -24,11 +24,14 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/storagetransfer/v1/transfer.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagetransfer_v1_internal { @@ -256,4 +259,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_V1_INTERNAL_STORAGE_TRANSFER_STUB_H diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_stub_factory.cc b/google/cloud/storagetransfer/v1/internal/storage_transfer_stub_factory.cc index 020c9993b656c..3d83fda13e25e 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_stub_factory.cc +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_stub_factory.cc @@ -28,11 +28,14 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/storagetransfer/v1/transfer.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagetransfer_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagetransfer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_stub_factory.h b/google/cloud/storagetransfer/v1/internal/storage_transfer_stub_factory.h index 1808e6e832103..dedaba012cde0 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_stub_factory.h +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagetransfer_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_V1_INTERNAL_STORAGE_TRANSFER_STUB_FACTORY_H diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_connection.cc b/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_connection.cc index c8ce2fb649203..841c021f005e6 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_connection.cc +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace storagetransfer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - StorageTransferServiceTracingConnection:: StorageTransferServiceTracingConnection( std::shared_ptr @@ -217,18 +215,14 @@ Status StorageTransferServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeStorageTransferServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_connection.h b/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_connection.h index 068ec7892dcf3..5db8d91dda768 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_connection.h +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace storagetransfer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class StorageTransferServiceTracingConnection : public storagetransfer_v1::StorageTransferServiceConnection { public: @@ -116,8 +114,6 @@ class StorageTransferServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_stub.cc b/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_stub.cc index 7b9b79cda40eb..df5d126ededbc 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_stub.cc +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagetransfer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - StorageTransferServiceTracingStub::StorageTransferServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -282,19 +283,15 @@ future StorageTransferServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeStorageTransferServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storagetransfer_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_stub.h b/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_stub.h index e46afb82b3bde..51907a441db8c 100644 --- a/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_stub.h +++ b/google/cloud/storagetransfer/v1/internal/storage_transfer_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace storagetransfer_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class StorageTransferServiceTracingStub : public StorageTransferServiceStub { public: ~StorageTransferServiceTracingStub() override = default; @@ -146,8 +147,6 @@ class StorageTransferServiceTracingStub : public StorageTransferServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -163,4 +162,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGETRANSFER_V1_INTERNAL_STORAGE_TRANSFER_TRACING_STUB_H diff --git a/google/cloud/storagetransfer/v1/storage_transfer_client.h b/google/cloud/storagetransfer/v1/storage_transfer_client.h index a257d9cd2131d..aae79dd731add 100644 --- a/google/cloud/storagetransfer/v1/storage_transfer_client.h +++ b/google/cloud/storagetransfer/v1/storage_transfer_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -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/storagetransfer/v1/storage_transfer_connection.h b/google/cloud/storagetransfer/v1/storage_transfer_connection.h index a4fdbef45873b..92b125959eb82 100644 --- a/google/cloud/storagetransfer/v1/storage_transfer_connection.h +++ b/google/cloud/storagetransfer/v1/storage_transfer_connection.h @@ -30,8 +30,8 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/storagetransfer/v1/transfer.pb.h" #include namespace google { diff --git a/google/cloud/storagetransfer/v1/storage_transfer_connection_idempotency_policy.h b/google/cloud/storagetransfer/v1/storage_transfer_connection_idempotency_policy.h index 82ae504adfb24..8f9ee0fd3e0ad 100644 --- a/google/cloud/storagetransfer/v1/storage_transfer_connection_idempotency_policy.h +++ b/google/cloud/storagetransfer/v1/storage_transfer_connection_idempotency_policy.h @@ -21,8 +21,8 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" +#include "google/storagetransfer/v1/transfer.grpc.pb.h" #include namespace google { diff --git a/google/cloud/stream_range_test.cc b/google/cloud/stream_range_test.cc index 885688127a18c..bced62056bc11 100644 --- a/google/cloud/stream_range_test.cc +++ b/google/cloud/stream_range_test.cc @@ -273,8 +273,6 @@ TEST(StreamRange, ReaderDestructorOptionsSpan) { // happen with `CurrentOptions()` matching those at `StreamRange` ctor time. } -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - using ::google::cloud::testing_util::IsActive; class FakeReader { @@ -318,8 +316,6 @@ TEST(StreamRange, CallSpanActiveThroughout) { // the active span matching that at `StreamRange` ctor time. } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud diff --git a/google/cloud/support/BUILD.bazel b/google/cloud/support/BUILD.bazel index a6eadc8d21f07..7d9ea7e37fde7 100644 --- a/google/cloud/support/BUILD.bazel +++ b/google/cloud/support/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v2/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/support/v2:support_cc_grpc", + "@googleapis//google/cloud/support/v2:support_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/support/quickstart/.bazelrc b/google/cloud/support/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/support/quickstart/.bazelrc +++ b/google/cloud/support/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/support/quickstart/CMakeLists.txt index 9057fc7ca898d..1a63c684b1c49 100644 --- a/google/cloud/support/quickstart/CMakeLists.txt +++ b/google/cloud/support/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Google Cloud Support API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-support-quickstart CXX) find_package(google_cloud_cpp_support REQUIRED) diff --git a/google/cloud/support/quickstart/WORKSPACE.bazel b/google/cloud/support/quickstart/WORKSPACE.bazel index 0472ac8c4046b..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 = "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/support/v2/case_attachment_connection.h b/google/cloud/support/v2/case_attachment_connection.h index cbb912a173e51..eaac02afff88c 100644 --- a/google/cloud/support/v2/case_attachment_connection.h +++ b/google/cloud/support/v2/case_attachment_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_CASE_ATTACHMENT_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_CASE_ATTACHMENT_CONNECTION_H +#include "google/cloud/support/v2/attachment_service.pb.h" #include "google/cloud/support/v2/case_attachment_connection_idempotency_policy.h" #include "google/cloud/support/v2/internal/case_attachment_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/support/v2/case_attachment_connection_idempotency_policy.h b/google/cloud/support/v2/case_attachment_connection_idempotency_policy.h index 6c40b027ab08d..0309d9c1264ee 100644 --- a/google/cloud/support/v2/case_attachment_connection_idempotency_policy.h +++ b/google/cloud/support/v2/case_attachment_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_CASE_ATTACHMENT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_CASE_ATTACHMENT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/support/v2/attachment_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/support/v2/case_connection.h b/google/cloud/support/v2/case_connection.h index d3f8a93246066..8e2530c72bbbf 100644 --- a/google/cloud/support/v2/case_connection.h +++ b/google/cloud/support/v2/case_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_CASE_CONNECTION_H #include "google/cloud/support/v2/case_connection_idempotency_policy.h" +#include "google/cloud/support/v2/case_service.pb.h" #include "google/cloud/support/v2/internal/case_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/support/v2/case_connection_idempotency_policy.h b/google/cloud/support/v2/case_connection_idempotency_policy.h index 09b2d72707695..6b92765e2ed51 100644 --- a/google/cloud/support/v2/case_connection_idempotency_policy.h +++ b/google/cloud/support/v2/case_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_CASE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_CASE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/support/v2/case_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/support/v2/comment_connection.h b/google/cloud/support/v2/comment_connection.h index 05673b43ea1aa..48baea34fa581 100644 --- a/google/cloud/support/v2/comment_connection.h +++ b/google/cloud/support/v2/comment_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_COMMENT_CONNECTION_H #include "google/cloud/support/v2/comment_connection_idempotency_policy.h" +#include "google/cloud/support/v2/comment_service.pb.h" #include "google/cloud/support/v2/internal/comment_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/support/v2/comment_connection_idempotency_policy.h b/google/cloud/support/v2/comment_connection_idempotency_policy.h index 45ded57020ca4..c0f89cd65255d 100644 --- a/google/cloud/support/v2/comment_connection_idempotency_policy.h +++ b/google/cloud/support/v2/comment_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_COMMENT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_COMMENT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/support/v2/comment_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/support/v2/internal/case_attachment_auth_decorator.cc b/google/cloud/support/v2/internal/case_attachment_auth_decorator.cc index 2a5e94ef97ec4..de7660f25e8be 100644 --- a/google/cloud/support/v2/internal/case_attachment_auth_decorator.cc +++ b/google/cloud/support/v2/internal/case_attachment_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/support/v2/attachment_service.proto #include "google/cloud/support/v2/internal/case_attachment_auth_decorator.h" -#include +#include "google/cloud/support/v2/attachment_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -44,3 +47,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/case_attachment_auth_decorator.h b/google/cloud/support/v2/internal/case_attachment_auth_decorator.h index e8b1a49914018..b847b481716fc 100644 --- a/google/cloud/support/v2/internal/case_attachment_auth_decorator.h +++ b/google/cloud/support/v2/internal/case_attachment_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -53,4 +56,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_ATTACHMENT_AUTH_DECORATOR_H diff --git a/google/cloud/support/v2/internal/case_attachment_logging_decorator.cc b/google/cloud/support/v2/internal/case_attachment_logging_decorator.cc index 91c0e4e4fae7c..745a16e826abe 100644 --- a/google/cloud/support/v2/internal/case_attachment_logging_decorator.cc +++ b/google/cloud/support/v2/internal/case_attachment_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/support/v2/attachment_service.proto #include "google/cloud/support/v2/internal/case_attachment_logging_decorator.h" +#include "google/cloud/support/v2/attachment_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -52,3 +55,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/case_attachment_logging_decorator.h b/google/cloud/support/v2/internal/case_attachment_logging_decorator.h index 2d12b1528ecc9..742d87730f5c3 100644 --- a/google/cloud/support/v2/internal/case_attachment_logging_decorator.h +++ b/google/cloud/support/v2/internal/case_attachment_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -53,4 +56,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_ATTACHMENT_LOGGING_DECORATOR_H diff --git a/google/cloud/support/v2/internal/case_attachment_metadata_decorator.cc b/google/cloud/support/v2/internal/case_attachment_metadata_decorator.cc index c280791deef12..e6d97338e4524 100644 --- a/google/cloud/support/v2/internal/case_attachment_metadata_decorator.cc +++ b/google/cloud/support/v2/internal/case_attachment_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/support/v2/attachment_service.proto #include "google/cloud/support/v2/internal/case_attachment_metadata_decorator.h" +#include "google/cloud/support/v2/attachment_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 support_v2_internal { @@ -70,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/case_attachment_metadata_decorator.h b/google/cloud/support/v2/internal/case_attachment_metadata_decorator.h index 493a912ff9097..a910d79668993 100644 --- a/google/cloud/support/v2/internal/case_attachment_metadata_decorator.h +++ b/google/cloud/support/v2/internal/case_attachment_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -59,4 +62,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_ATTACHMENT_METADATA_DECORATOR_H diff --git a/google/cloud/support/v2/internal/case_attachment_option_defaults.cc b/google/cloud/support/v2/internal/case_attachment_option_defaults.cc index 9e1e7e67b62f5..4bf11313f5231 100644 --- a/google/cloud/support/v2/internal/case_attachment_option_defaults.cc +++ b/google/cloud/support/v2/internal/case_attachment_option_defaults.cc @@ -42,7 +42,7 @@ Options CaseAttachmentServiceDefaultOptions(Options options) { if (!options.has()) { options.set( support_v2::CaseAttachmentServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/support/v2/internal/case_attachment_stub.cc b/google/cloud/support/v2/internal/case_attachment_stub.cc index a8403b967ebdd..04bfccc74b487 100644 --- a/google/cloud/support/v2/internal/case_attachment_stub.cc +++ b/google/cloud/support/v2/internal/case_attachment_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/support/v2/attachment_service.proto #include "google/cloud/support/v2/internal/case_attachment_stub.h" +#include "google/cloud/support/v2/attachment_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -46,3 +49,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/case_attachment_stub.h b/google/cloud/support/v2/internal/case_attachment_stub.h index e29d42baf1e84..86d4fc689ad6b 100644 --- a/google/cloud/support/v2/internal/case_attachment_stub.h +++ b/google/cloud/support/v2/internal/case_attachment_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_ATTACHMENT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_ATTACHMENT_STUB_H +#include "google/cloud/support/v2/attachment_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -65,4 +68,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_ATTACHMENT_STUB_H diff --git a/google/cloud/support/v2/internal/case_attachment_stub_factory.cc b/google/cloud/support/v2/internal/case_attachment_stub_factory.cc index f0a2d54f27fd4..854f327d69433 100644 --- a/google/cloud/support/v2/internal/case_attachment_stub_factory.cc +++ b/google/cloud/support/v2/internal/case_attachment_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/support/v2/attachment_service.proto #include "google/cloud/support/v2/internal/case_attachment_stub_factory.h" +#include "google/cloud/support/v2/attachment_service.grpc.pb.h" #include "google/cloud/support/v2/internal/case_attachment_auth_decorator.h" #include "google/cloud/support/v2/internal/case_attachment_logging_decorator.h" #include "google/cloud/support/v2/internal/case_attachment_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/case_attachment_stub_factory.h b/google/cloud/support/v2/internal/case_attachment_stub_factory.h index bff249e0dfd7c..25f67506662a0 100644 --- a/google/cloud/support/v2/internal/case_attachment_stub_factory.h +++ b/google/cloud/support/v2/internal/case_attachment_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_ATTACHMENT_STUB_FACTORY_H diff --git a/google/cloud/support/v2/internal/case_attachment_tracing_connection.cc b/google/cloud/support/v2/internal/case_attachment_tracing_connection.cc index c8daa9be34cd4..a26373915f20e 100644 --- a/google/cloud/support/v2/internal/case_attachment_tracing_connection.cc +++ b/google/cloud/support/v2/internal/case_attachment_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace support_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CaseAttachmentServiceTracingConnection::CaseAttachmentServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -44,17 +42,13 @@ CaseAttachmentServiceTracingConnection::ListAttachments( google::cloud::support::v2::Attachment>(std::move(span), std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCaseAttachmentServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/support/v2/internal/case_attachment_tracing_connection.h b/google/cloud/support/v2/internal/case_attachment_tracing_connection.h index ec5c5389a770d..ac4a31b526106 100644 --- a/google/cloud/support/v2/internal/case_attachment_tracing_connection.h +++ b/google/cloud/support/v2/internal/case_attachment_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace support_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CaseAttachmentServiceTracingConnection : public support_v2::CaseAttachmentServiceConnection { public: @@ -47,8 +45,6 @@ class CaseAttachmentServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/support/v2/internal/case_attachment_tracing_stub.cc b/google/cloud/support/v2/internal/case_attachment_tracing_stub.cc index a5786c601f26f..9923e69c17f3b 100644 --- a/google/cloud/support/v2/internal/case_attachment_tracing_stub.cc +++ b/google/cloud/support/v2/internal/case_attachment_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CaseAttachmentServiceTracingStub::CaseAttachmentServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -44,18 +45,14 @@ CaseAttachmentServiceTracingStub::ListAttachments( child_->ListAttachments(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCaseAttachmentServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/case_attachment_tracing_stub.h b/google/cloud/support/v2/internal/case_attachment_tracing_stub.h index 086799d21108d..3822fcd220425 100644 --- a/google/cloud/support/v2/internal/case_attachment_tracing_stub.h +++ b/google/cloud/support/v2/internal/case_attachment_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CaseAttachmentServiceTracingStub : public CaseAttachmentServiceStub { public: ~CaseAttachmentServiceTracingStub() override = default; @@ -50,8 +51,6 @@ class CaseAttachmentServiceTracingStub : public CaseAttachmentServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -66,4 +65,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_ATTACHMENT_TRACING_STUB_H diff --git a/google/cloud/support/v2/internal/case_auth_decorator.cc b/google/cloud/support/v2/internal/case_auth_decorator.cc index dfb54754f52d2..fc6af861e96a4 100644 --- a/google/cloud/support/v2/internal/case_auth_decorator.cc +++ b/google/cloud/support/v2/internal/case_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/support/v2/case_service.proto #include "google/cloud/support/v2/internal/case_auth_decorator.h" -#include +#include "google/cloud/support/v2/case_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -103,3 +106,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/case_auth_decorator.h b/google/cloud/support/v2/internal/case_auth_decorator.h index c863aedc027ca..ab29a07526f43 100644 --- a/google/cloud/support/v2/internal/case_auth_decorator.h +++ b/google/cloud/support/v2/internal/case_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -82,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_AUTH_DECORATOR_H diff --git a/google/cloud/support/v2/internal/case_logging_decorator.cc b/google/cloud/support/v2/internal/case_logging_decorator.cc index a051362d61428..e055d615c45a5 100644 --- a/google/cloud/support/v2/internal/case_logging_decorator.cc +++ b/google/cloud/support/v2/internal/case_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/support/v2/case_service.proto #include "google/cloud/support/v2/internal/case_logging_decorator.h" +#include "google/cloud/support/v2/case_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -132,3 +135,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/case_logging_decorator.h b/google/cloud/support/v2/internal/case_logging_decorator.h index 2686659bb1a1f..70a1cbd31cf6d 100644 --- a/google/cloud/support/v2/internal/case_logging_decorator.h +++ b/google/cloud/support/v2/internal/case_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -82,4 +85,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_LOGGING_DECORATOR_H diff --git a/google/cloud/support/v2/internal/case_metadata_decorator.cc b/google/cloud/support/v2/internal/case_metadata_decorator.cc index a268251575c02..9d7b0a5a2ce3a 100644 --- a/google/cloud/support/v2/internal/case_metadata_decorator.cc +++ b/google/cloud/support/v2/internal/case_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/support/v2/case_service.proto #include "google/cloud/support/v2/internal/case_metadata_decorator.h" +#include "google/cloud/support/v2/case_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 support_v2_internal { @@ -129,3 +133,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/case_metadata_decorator.h b/google/cloud/support/v2/internal/case_metadata_decorator.h index b8477373a4292..08ba6117143d3 100644 --- a/google/cloud/support/v2/internal/case_metadata_decorator.h +++ b/google/cloud/support/v2/internal/case_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -87,4 +90,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_METADATA_DECORATOR_H diff --git a/google/cloud/support/v2/internal/case_option_defaults.cc b/google/cloud/support/v2/internal/case_option_defaults.cc index 8149fb4c2b468..1d1091c84d96f 100644 --- a/google/cloud/support/v2/internal/case_option_defaults.cc +++ b/google/cloud/support/v2/internal/case_option_defaults.cc @@ -40,7 +40,7 @@ Options CaseServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - support_v2::CaseServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + support_v2::CaseServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/support/v2/internal/case_stub.cc b/google/cloud/support/v2/internal/case_stub.cc index e7745b6c8d65b..2b8b878522404 100644 --- a/google/cloud/support/v2/internal/case_stub.cc +++ b/google/cloud/support/v2/internal/case_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/support/v2/case_service.proto #include "google/cloud/support/v2/internal/case_stub.h" +#include "google/cloud/support/v2/case_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -127,3 +130,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/case_stub.h b/google/cloud/support/v2/internal/case_stub.h index 06e234e7c3acf..100959b0a0ce2 100644 --- a/google/cloud/support/v2/internal/case_stub.h +++ b/google/cloud/support/v2/internal/case_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_STUB_H +#include "google/cloud/support/v2/case_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -122,4 +125,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_STUB_H diff --git a/google/cloud/support/v2/internal/case_stub_factory.cc b/google/cloud/support/v2/internal/case_stub_factory.cc index e76395456dab8..7295d8d473456 100644 --- a/google/cloud/support/v2/internal/case_stub_factory.cc +++ b/google/cloud/support/v2/internal/case_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/support/v2/case_service.proto #include "google/cloud/support/v2/internal/case_stub_factory.h" +#include "google/cloud/support/v2/case_service.grpc.pb.h" #include "google/cloud/support/v2/internal/case_auth_decorator.h" #include "google/cloud/support/v2/internal/case_logging_decorator.h" #include "google/cloud/support/v2/internal/case_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/case_stub_factory.h b/google/cloud/support/v2/internal/case_stub_factory.h index d92807974684c..4809348a604ff 100644 --- a/google/cloud/support/v2/internal/case_stub_factory.h +++ b/google/cloud/support/v2/internal/case_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_STUB_FACTORY_H diff --git a/google/cloud/support/v2/internal/case_tracing_connection.cc b/google/cloud/support/v2/internal/case_tracing_connection.cc index 3ed90fe3b1948..f0b12682c5834 100644 --- a/google/cloud/support/v2/internal/case_tracing_connection.cc +++ b/google/cloud/support/v2/internal/case_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace support_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CaseServiceTracingConnection::CaseServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -111,16 +109,12 @@ CaseServiceTracingConnection::SearchCaseClassifications( std::move(sr)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCaseServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/support/v2/internal/case_tracing_connection.h b/google/cloud/support/v2/internal/case_tracing_connection.h index c641c5376a092..37f7056bfee2e 100644 --- a/google/cloud/support/v2/internal/case_tracing_connection.h +++ b/google/cloud/support/v2/internal/case_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace support_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CaseServiceTracingConnection : public support_v2::CaseServiceConnection { public: ~CaseServiceTracingConnection() override = default; @@ -69,8 +67,6 @@ class CaseServiceTracingConnection : public support_v2::CaseServiceConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/support/v2/internal/case_tracing_stub.cc b/google/cloud/support/v2/internal/case_tracing_stub.cc index 5663cc757eeea..2bdada7eb3a64 100644 --- a/google/cloud/support/v2/internal/case_tracing_stub.cc +++ b/google/cloud/support/v2/internal/case_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CaseServiceTracingStub::CaseServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -125,18 +126,14 @@ CaseServiceTracingStub::SearchCaseClassifications( child_->SearchCaseClassifications(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCaseServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/case_tracing_stub.h b/google/cloud/support/v2/internal/case_tracing_stub.h index 53099ff0c259b..eb0f3a1266ebb 100644 --- a/google/cloud/support/v2/internal/case_tracing_stub.h +++ b/google/cloud/support/v2/internal/case_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CaseServiceTracingStub : public CaseServiceStub { public: ~CaseServiceTracingStub() override = default; @@ -78,8 +79,6 @@ class CaseServiceTracingStub : public CaseServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -94,4 +93,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_CASE_TRACING_STUB_H diff --git a/google/cloud/support/v2/internal/comment_auth_decorator.cc b/google/cloud/support/v2/internal/comment_auth_decorator.cc index 8ae5509ec8cb2..fbbd5c5bb9fd4 100644 --- a/google/cloud/support/v2/internal/comment_auth_decorator.cc +++ b/google/cloud/support/v2/internal/comment_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/support/v2/comment_service.proto #include "google/cloud/support/v2/internal/comment_auth_decorator.h" -#include +#include "google/cloud/support/v2/comment_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -52,3 +55,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/comment_auth_decorator.h b/google/cloud/support/v2/internal/comment_auth_decorator.h index 0b3a098bd6872..1d3df0977f5b5 100644 --- a/google/cloud/support/v2/internal/comment_auth_decorator.h +++ b/google/cloud/support/v2/internal/comment_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -56,4 +59,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_COMMENT_AUTH_DECORATOR_H diff --git a/google/cloud/support/v2/internal/comment_logging_decorator.cc b/google/cloud/support/v2/internal/comment_logging_decorator.cc index 57b7ac066ba6e..8332f0e07c32d 100644 --- a/google/cloud/support/v2/internal/comment_logging_decorator.cc +++ b/google/cloud/support/v2/internal/comment_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/support/v2/comment_service.proto #include "google/cloud/support/v2/internal/comment_logging_decorator.h" +#include "google/cloud/support/v2/comment_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -63,3 +66,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/comment_logging_decorator.h b/google/cloud/support/v2/internal/comment_logging_decorator.h index e065123b084a1..64f583a169822 100644 --- a/google/cloud/support/v2/internal/comment_logging_decorator.h +++ b/google/cloud/support/v2/internal/comment_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -56,4 +59,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_COMMENT_LOGGING_DECORATOR_H diff --git a/google/cloud/support/v2/internal/comment_metadata_decorator.cc b/google/cloud/support/v2/internal/comment_metadata_decorator.cc index 9cee31eb86362..8bbdf7875a161 100644 --- a/google/cloud/support/v2/internal/comment_metadata_decorator.cc +++ b/google/cloud/support/v2/internal/comment_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/support/v2/comment_service.proto #include "google/cloud/support/v2/internal/comment_metadata_decorator.h" +#include "google/cloud/support/v2/comment_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 support_v2_internal { @@ -79,3 +83,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/comment_metadata_decorator.h b/google/cloud/support/v2/internal/comment_metadata_decorator.h index 185ca3b6dcca6..b5fa7871ecbfc 100644 --- a/google/cloud/support/v2/internal/comment_metadata_decorator.h +++ b/google/cloud/support/v2/internal/comment_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -61,4 +64,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_COMMENT_METADATA_DECORATOR_H diff --git a/google/cloud/support/v2/internal/comment_option_defaults.cc b/google/cloud/support/v2/internal/comment_option_defaults.cc index 6b32ff216a876..a730c71e7a654 100644 --- a/google/cloud/support/v2/internal/comment_option_defaults.cc +++ b/google/cloud/support/v2/internal/comment_option_defaults.cc @@ -42,7 +42,7 @@ Options CommentServiceDefaultOptions(Options options) { if (!options.has()) { options.set( support_v2::CommentServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/support/v2/internal/comment_stub.cc b/google/cloud/support/v2/internal/comment_stub.cc index c77ef6c4b7a14..f2ce34d6c77b9 100644 --- a/google/cloud/support/v2/internal/comment_stub.cc +++ b/google/cloud/support/v2/internal/comment_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/support/v2/comment_service.proto #include "google/cloud/support/v2/internal/comment_stub.h" +#include "google/cloud/support/v2/comment_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -58,3 +61,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/comment_stub.h b/google/cloud/support/v2/internal/comment_stub.h index 74944963c8c20..c951ab8334670 100644 --- a/google/cloud/support/v2/internal/comment_stub.h +++ b/google/cloud/support/v2/internal/comment_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_COMMENT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_COMMENT_STUB_H +#include "google/cloud/support/v2/comment_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -70,4 +73,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_COMMENT_STUB_H diff --git a/google/cloud/support/v2/internal/comment_stub_factory.cc b/google/cloud/support/v2/internal/comment_stub_factory.cc index 75e3245d8e938..25b216a0f5bbc 100644 --- a/google/cloud/support/v2/internal/comment_stub_factory.cc +++ b/google/cloud/support/v2/internal/comment_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/support/v2/comment_service.proto #include "google/cloud/support/v2/internal/comment_stub_factory.h" +#include "google/cloud/support/v2/comment_service.grpc.pb.h" #include "google/cloud/support/v2/internal/comment_auth_decorator.h" #include "google/cloud/support/v2/internal/comment_logging_decorator.h" #include "google/cloud/support/v2/internal/comment_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/comment_stub_factory.h b/google/cloud/support/v2/internal/comment_stub_factory.h index d299a8eb9e90b..7a48de24232d8 100644 --- a/google/cloud/support/v2/internal/comment_stub_factory.h +++ b/google/cloud/support/v2/internal/comment_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_COMMENT_STUB_FACTORY_H diff --git a/google/cloud/support/v2/internal/comment_tracing_connection.cc b/google/cloud/support/v2/internal/comment_tracing_connection.cc index 4c84fc8734fae..573b55c56fe4e 100644 --- a/google/cloud/support/v2/internal/comment_tracing_connection.cc +++ b/google/cloud/support/v2/internal/comment_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace support_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CommentServiceTracingConnection::CommentServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -53,16 +51,12 @@ CommentServiceTracingConnection::CreateComment( return internal::EndSpan(*span, child_->CreateComment(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCommentServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/support/v2/internal/comment_tracing_connection.h b/google/cloud/support/v2/internal/comment_tracing_connection.h index ad13c56aee711..90ac323493bc6 100644 --- a/google/cloud/support/v2/internal/comment_tracing_connection.h +++ b/google/cloud/support/v2/internal/comment_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace support_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CommentServiceTracingConnection : public support_v2::CommentServiceConnection { public: @@ -50,8 +48,6 @@ class CommentServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/support/v2/internal/comment_tracing_stub.cc b/google/cloud/support/v2/internal/comment_tracing_stub.cc index 21200130f5bf9..d48b8da12ff70 100644 --- a/google/cloud/support/v2/internal/comment_tracing_stub.cc +++ b/google/cloud/support/v2/internal/comment_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CommentServiceTracingStub::CommentServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -56,18 +57,14 @@ CommentServiceTracingStub::CreateComment( child_->CreateComment(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCommentServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace support_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/support/v2/internal/comment_tracing_stub.h b/google/cloud/support/v2/internal/comment_tracing_stub.h index 7aa0806799502..48dcab8a44db9 100644 --- a/google/cloud/support/v2/internal/comment_tracing_stub.h +++ b/google/cloud/support/v2/internal/comment_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace support_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CommentServiceTracingStub : public CommentServiceStub { public: ~CommentServiceTracingStub() override = default; @@ -52,8 +53,6 @@ class CommentServiceTracingStub : public CommentServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -68,4 +67,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SUPPORT_V2_INTERNAL_COMMENT_TRACING_STUB_H diff --git a/google/cloud/talent/BUILD.bazel b/google/cloud/talent/BUILD.bazel index 926814bd78583..a0db9a6177e7f 100644 --- a/google/cloud/talent/BUILD.bazel +++ b/google/cloud/talent/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v4/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/talent/v4:talent_cc_grpc", + "@googleapis//google/cloud/talent/v4:talent_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/talent/CMakeLists.txt b/google/cloud/talent/CMakeLists.txt index 5fb5275296a46..a00059d0de5d7 100644 --- a/google/cloud/talent/CMakeLists.txt +++ b/google/cloud/talent/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(talent "Cloud Talent Solution API" - SERVICE_DIRS "__EMPTY__" "v4/") + SERVICE_DIRS "v4/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(talent_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/talent/company_client.h b/google/cloud/talent/company_client.h deleted file mode 100644 index 47e6193bb2bcd..0000000000000 --- a/google/cloud/talent/company_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/company_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPANY_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPANY_CLIENT_H - -#include "google/cloud/talent/company_connection.h" -#include "google/cloud/talent/v4/company_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in talent_v4 instead of the aliases defined in -/// this namespace. -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::CompanyServiceClient directly. -using ::google::cloud::talent_v4::CompanyServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPANY_CLIENT_H diff --git a/google/cloud/talent/company_connection.h b/google/cloud/talent/company_connection.h deleted file mode 100644 index 016f566677330..0000000000000 --- a/google/cloud/talent/company_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/company_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPANY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPANY_CONNECTION_H - -#include "google/cloud/talent/company_connection_idempotency_policy.h" -#include "google/cloud/talent/v4/company_connection.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::MakeCompanyServiceConnection directly. -using ::google::cloud::talent_v4::MakeCompanyServiceConnection; - -/// @deprecated Use talent_v4::CompanyServiceConnection directly. -using ::google::cloud::talent_v4::CompanyServiceConnection; - -/// @deprecated Use talent_v4::CompanyServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::talent_v4::CompanyServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use talent_v4::CompanyServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::talent_v4::CompanyServiceLimitedTimeRetryPolicy; - -/// @deprecated Use talent_v4::CompanyServiceRetryPolicy directly. -using ::google::cloud::talent_v4::CompanyServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPANY_CONNECTION_H diff --git a/google/cloud/talent/company_connection_idempotency_policy.h b/google/cloud/talent/company_connection_idempotency_policy.h deleted file mode 100644 index 25daf925d6465..0000000000000 --- a/google/cloud/talent/company_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/company_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPANY_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPANY_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/talent/v4/company_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// talent_v4::MakeDefaultCompanyServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::talent_v4:: - MakeDefaultCompanyServiceConnectionIdempotencyPolicy; - -/// @deprecated Use talent_v4::CompanyServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::talent_v4::CompanyServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPANY_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/talent/company_options.h b/google/cloud/talent/company_options.h deleted file mode 100644 index a815083579757..0000000000000 --- a/google/cloud/talent/company_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/company_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPANY_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPANY_OPTIONS_H - -#include "google/cloud/talent/company_connection.h" -#include "google/cloud/talent/company_connection_idempotency_policy.h" -#include "google/cloud/talent/v4/company_options.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::CompanyServiceBackoffPolicyOption directly. -using ::google::cloud::talent_v4::CompanyServiceBackoffPolicyOption; - -/// @deprecated Use talent_v4::CompanyServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::talent_v4:: - CompanyServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use talent_v4::CompanyServicePolicyOptionList directly. -using ::google::cloud::talent_v4::CompanyServicePolicyOptionList; - -/// @deprecated Use talent_v4::CompanyServiceRetryPolicyOption directly. -using ::google::cloud::talent_v4::CompanyServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPANY_OPTIONS_H diff --git a/google/cloud/talent/completion_client.h b/google/cloud/talent/completion_client.h deleted file mode 100644 index 1b26ca817af09..0000000000000 --- a/google/cloud/talent/completion_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/completion_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPLETION_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPLETION_CLIENT_H - -#include "google/cloud/talent/completion_connection.h" -#include "google/cloud/talent/v4/completion_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in talent_v4 instead of the aliases defined in -/// this namespace. -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::CompletionClient directly. -using ::google::cloud::talent_v4::CompletionClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPLETION_CLIENT_H diff --git a/google/cloud/talent/completion_connection.h b/google/cloud/talent/completion_connection.h deleted file mode 100644 index 4dc55c0501ab8..0000000000000 --- a/google/cloud/talent/completion_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/completion_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPLETION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPLETION_CONNECTION_H - -#include "google/cloud/talent/completion_connection_idempotency_policy.h" -#include "google/cloud/talent/v4/completion_connection.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::MakeCompletionConnection directly. -using ::google::cloud::talent_v4::MakeCompletionConnection; - -/// @deprecated Use talent_v4::CompletionConnection directly. -using ::google::cloud::talent_v4::CompletionConnection; - -/// @deprecated Use talent_v4::CompletionLimitedErrorCountRetryPolicy directly. -using ::google::cloud::talent_v4::CompletionLimitedErrorCountRetryPolicy; - -/// @deprecated Use talent_v4::CompletionLimitedTimeRetryPolicy directly. -using ::google::cloud::talent_v4::CompletionLimitedTimeRetryPolicy; - -/// @deprecated Use talent_v4::CompletionRetryPolicy directly. -using ::google::cloud::talent_v4::CompletionRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPLETION_CONNECTION_H diff --git a/google/cloud/talent/completion_connection_idempotency_policy.h b/google/cloud/talent/completion_connection_idempotency_policy.h deleted file mode 100644 index 1a0957cbdb53c..0000000000000 --- a/google/cloud/talent/completion_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/completion_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPLETION_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPLETION_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/talent/v4/completion_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::MakeDefaultCompletionConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::talent_v4:: - MakeDefaultCompletionConnectionIdempotencyPolicy; - -/// @deprecated Use talent_v4::CompletionConnectionIdempotencyPolicy directly. -using ::google::cloud::talent_v4::CompletionConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPLETION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/talent/completion_options.h b/google/cloud/talent/completion_options.h deleted file mode 100644 index c2f54162cc38b..0000000000000 --- a/google/cloud/talent/completion_options.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/completion_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPLETION_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPLETION_OPTIONS_H - -#include "google/cloud/talent/completion_connection.h" -#include "google/cloud/talent/completion_connection_idempotency_policy.h" -#include "google/cloud/talent/v4/completion_options.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::CompletionBackoffPolicyOption directly. -using ::google::cloud::talent_v4::CompletionBackoffPolicyOption; - -/// @deprecated Use talent_v4::CompletionConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::talent_v4::CompletionConnectionIdempotencyPolicyOption; - -/// @deprecated Use talent_v4::CompletionPolicyOptionList directly. -using ::google::cloud::talent_v4::CompletionPolicyOptionList; - -/// @deprecated Use talent_v4::CompletionRetryPolicyOption directly. -using ::google::cloud::talent_v4::CompletionRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_COMPLETION_OPTIONS_H diff --git a/google/cloud/talent/event_client.h b/google/cloud/talent/event_client.h deleted file mode 100644 index 5967011f513bf..0000000000000 --- a/google/cloud/talent/event_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/event_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_EVENT_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_EVENT_CLIENT_H - -#include "google/cloud/talent/event_connection.h" -#include "google/cloud/talent/v4/event_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in talent_v4 instead of the aliases defined in -/// this namespace. -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::EventServiceClient directly. -using ::google::cloud::talent_v4::EventServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_EVENT_CLIENT_H diff --git a/google/cloud/talent/event_connection.h b/google/cloud/talent/event_connection.h deleted file mode 100644 index 0d9b8958276b8..0000000000000 --- a/google/cloud/talent/event_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/event_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_EVENT_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_EVENT_CONNECTION_H - -#include "google/cloud/talent/event_connection_idempotency_policy.h" -#include "google/cloud/talent/v4/event_connection.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::MakeEventServiceConnection directly. -using ::google::cloud::talent_v4::MakeEventServiceConnection; - -/// @deprecated Use talent_v4::EventServiceConnection directly. -using ::google::cloud::talent_v4::EventServiceConnection; - -/// @deprecated Use talent_v4::EventServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::talent_v4::EventServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use talent_v4::EventServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::talent_v4::EventServiceLimitedTimeRetryPolicy; - -/// @deprecated Use talent_v4::EventServiceRetryPolicy directly. -using ::google::cloud::talent_v4::EventServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_EVENT_CONNECTION_H diff --git a/google/cloud/talent/event_connection_idempotency_policy.h b/google/cloud/talent/event_connection_idempotency_policy.h deleted file mode 100644 index f7cd0030453a3..0000000000000 --- a/google/cloud/talent/event_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/event_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_EVENT_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_EVENT_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/talent/v4/event_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// talent_v4::MakeDefaultEventServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::talent_v4:: - MakeDefaultEventServiceConnectionIdempotencyPolicy; - -/// @deprecated Use talent_v4::EventServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::talent_v4::EventServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_EVENT_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/talent/event_options.h b/google/cloud/talent/event_options.h deleted file mode 100644 index 59c465f6e5e1f..0000000000000 --- a/google/cloud/talent/event_options.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/event_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_EVENT_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_EVENT_OPTIONS_H - -#include "google/cloud/talent/event_connection.h" -#include "google/cloud/talent/event_connection_idempotency_policy.h" -#include "google/cloud/talent/v4/event_options.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::EventServiceBackoffPolicyOption directly. -using ::google::cloud::talent_v4::EventServiceBackoffPolicyOption; - -/// @deprecated Use talent_v4::EventServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::talent_v4::EventServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use talent_v4::EventServicePolicyOptionList directly. -using ::google::cloud::talent_v4::EventServicePolicyOptionList; - -/// @deprecated Use talent_v4::EventServiceRetryPolicyOption directly. -using ::google::cloud::talent_v4::EventServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_EVENT_OPTIONS_H diff --git a/google/cloud/talent/job_client.h b/google/cloud/talent/job_client.h deleted file mode 100644 index 5fe7e3bcb3b4b..0000000000000 --- a/google/cloud/talent/job_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/job_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_JOB_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_JOB_CLIENT_H - -#include "google/cloud/talent/job_connection.h" -#include "google/cloud/talent/v4/job_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in talent_v4 instead of the aliases defined in -/// this namespace. -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::JobServiceClient directly. -using ::google::cloud::talent_v4::JobServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_JOB_CLIENT_H diff --git a/google/cloud/talent/job_connection.h b/google/cloud/talent/job_connection.h deleted file mode 100644 index 2adf8e45b8346..0000000000000 --- a/google/cloud/talent/job_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/job_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_JOB_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_JOB_CONNECTION_H - -#include "google/cloud/talent/job_connection_idempotency_policy.h" -#include "google/cloud/talent/v4/job_connection.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::MakeJobServiceConnection directly. -using ::google::cloud::talent_v4::MakeJobServiceConnection; - -/// @deprecated Use talent_v4::JobServiceConnection directly. -using ::google::cloud::talent_v4::JobServiceConnection; - -/// @deprecated Use talent_v4::JobServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::talent_v4::JobServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use talent_v4::JobServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::talent_v4::JobServiceLimitedTimeRetryPolicy; - -/// @deprecated Use talent_v4::JobServiceRetryPolicy directly. -using ::google::cloud::talent_v4::JobServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_JOB_CONNECTION_H diff --git a/google/cloud/talent/job_connection_idempotency_policy.h b/google/cloud/talent/job_connection_idempotency_policy.h deleted file mode 100644 index a25f4138df361..0000000000000 --- a/google/cloud/talent/job_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/job_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_JOB_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_JOB_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/talent/v4/job_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::MakeDefaultJobServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::talent_v4:: - MakeDefaultJobServiceConnectionIdempotencyPolicy; - -/// @deprecated Use talent_v4::JobServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::talent_v4::JobServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_JOB_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/talent/job_options.h b/google/cloud/talent/job_options.h deleted file mode 100644 index 1dcd0b3f4c381..0000000000000 --- a/google/cloud/talent/job_options.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/job_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_JOB_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_JOB_OPTIONS_H - -#include "google/cloud/talent/job_connection.h" -#include "google/cloud/talent/job_connection_idempotency_policy.h" -#include "google/cloud/talent/v4/job_options.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::JobServicePollingPolicyOption directly. -using ::google::cloud::talent_v4::JobServicePollingPolicyOption; - -/// @deprecated Use talent_v4::JobServiceBackoffPolicyOption directly. -using ::google::cloud::talent_v4::JobServiceBackoffPolicyOption; - -/// @deprecated Use talent_v4::JobServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::talent_v4::JobServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use talent_v4::JobServicePolicyOptionList directly. -using ::google::cloud::talent_v4::JobServicePolicyOptionList; - -/// @deprecated Use talent_v4::JobServiceRetryPolicyOption directly. -using ::google::cloud::talent_v4::JobServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_JOB_OPTIONS_H diff --git a/google/cloud/talent/mocks/mock_company_connection.h b/google/cloud/talent/mocks/mock_company_connection.h deleted file mode 100644 index e7e9c4f31f442..0000000000000 --- a/google/cloud/talent/mocks/mock_company_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/company_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_COMPANY_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_COMPANY_CONNECTION_H - -#include "google/cloud/talent/company_connection.h" -#include "google/cloud/talent/v4/mocks/mock_company_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in talent_v4_mocks instead of the aliases -/// defined in this namespace. -namespace talent_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4_mocks::MockCompanyServiceConnection directly. -using ::google::cloud::talent_v4_mocks::MockCompanyServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_COMPANY_CONNECTION_H diff --git a/google/cloud/talent/mocks/mock_completion_connection.h b/google/cloud/talent/mocks/mock_completion_connection.h deleted file mode 100644 index c59f8b782cf54..0000000000000 --- a/google/cloud/talent/mocks/mock_completion_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/completion_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_COMPLETION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_COMPLETION_CONNECTION_H - -#include "google/cloud/talent/completion_connection.h" -#include "google/cloud/talent/v4/mocks/mock_completion_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in talent_v4_mocks instead of the aliases -/// defined in this namespace. -namespace talent_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4_mocks::MockCompletionConnection directly. -using ::google::cloud::talent_v4_mocks::MockCompletionConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_COMPLETION_CONNECTION_H diff --git a/google/cloud/talent/mocks/mock_event_connection.h b/google/cloud/talent/mocks/mock_event_connection.h deleted file mode 100644 index f0a8402145936..0000000000000 --- a/google/cloud/talent/mocks/mock_event_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/event_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_EVENT_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_EVENT_CONNECTION_H - -#include "google/cloud/talent/event_connection.h" -#include "google/cloud/talent/v4/mocks/mock_event_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in talent_v4_mocks instead of the aliases -/// defined in this namespace. -namespace talent_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4_mocks::MockEventServiceConnection directly. -using ::google::cloud::talent_v4_mocks::MockEventServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_EVENT_CONNECTION_H diff --git a/google/cloud/talent/mocks/mock_job_connection.h b/google/cloud/talent/mocks/mock_job_connection.h deleted file mode 100644 index 59d973836ab17..0000000000000 --- a/google/cloud/talent/mocks/mock_job_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/job_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_JOB_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_JOB_CONNECTION_H - -#include "google/cloud/talent/job_connection.h" -#include "google/cloud/talent/v4/mocks/mock_job_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in talent_v4_mocks instead of the aliases -/// defined in this namespace. -namespace talent_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4_mocks::MockJobServiceConnection directly. -using ::google::cloud::talent_v4_mocks::MockJobServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_JOB_CONNECTION_H diff --git a/google/cloud/talent/mocks/mock_tenant_connection.h b/google/cloud/talent/mocks/mock_tenant_connection.h deleted file mode 100644 index 494bbaa99174d..0000000000000 --- a/google/cloud/talent/mocks/mock_tenant_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/tenant_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_TENANT_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_TENANT_CONNECTION_H - -#include "google/cloud/talent/tenant_connection.h" -#include "google/cloud/talent/v4/mocks/mock_tenant_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in talent_v4_mocks instead of the aliases -/// defined in this namespace. -namespace talent_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4_mocks::MockTenantServiceConnection directly. -using ::google::cloud::talent_v4_mocks::MockTenantServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_MOCKS_MOCK_TENANT_CONNECTION_H diff --git a/google/cloud/talent/quickstart/.bazelrc b/google/cloud/talent/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/talent/quickstart/.bazelrc +++ b/google/cloud/talent/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/talent/quickstart/CMakeLists.txt index d26ed5c6b247c..d476189daaad2 100644 --- a/google/cloud/talent/quickstart/CMakeLists.txt +++ b/google/cloud/talent/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Talent Solution API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-talent-quickstart CXX) find_package(google_cloud_cpp_talent REQUIRED) diff --git a/google/cloud/talent/quickstart/WORKSPACE.bazel b/google/cloud/talent/quickstart/WORKSPACE.bazel index d7dd52f4b4a0c..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 = "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/talent/tenant_client.h b/google/cloud/talent/tenant_client.h deleted file mode 100644 index 45855c5033fb4..0000000000000 --- a/google/cloud/talent/tenant_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/tenant_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_TENANT_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_TENANT_CLIENT_H - -#include "google/cloud/talent/tenant_connection.h" -#include "google/cloud/talent/v4/tenant_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in talent_v4 instead of the aliases defined in -/// this namespace. -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::TenantServiceClient directly. -using ::google::cloud::talent_v4::TenantServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_TENANT_CLIENT_H diff --git a/google/cloud/talent/tenant_connection.h b/google/cloud/talent/tenant_connection.h deleted file mode 100644 index 0b4114a588f58..0000000000000 --- a/google/cloud/talent/tenant_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/tenant_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_TENANT_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_TENANT_CONNECTION_H - -#include "google/cloud/talent/tenant_connection_idempotency_policy.h" -#include "google/cloud/talent/v4/tenant_connection.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::MakeTenantServiceConnection directly. -using ::google::cloud::talent_v4::MakeTenantServiceConnection; - -/// @deprecated Use talent_v4::TenantServiceConnection directly. -using ::google::cloud::talent_v4::TenantServiceConnection; - -/// @deprecated Use talent_v4::TenantServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::talent_v4::TenantServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use talent_v4::TenantServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::talent_v4::TenantServiceLimitedTimeRetryPolicy; - -/// @deprecated Use talent_v4::TenantServiceRetryPolicy directly. -using ::google::cloud::talent_v4::TenantServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_TENANT_CONNECTION_H diff --git a/google/cloud/talent/tenant_connection_idempotency_policy.h b/google/cloud/talent/tenant_connection_idempotency_policy.h deleted file mode 100644 index aa756c1177aa0..0000000000000 --- a/google/cloud/talent/tenant_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/tenant_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_TENANT_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_TENANT_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/talent/v4/tenant_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// talent_v4::MakeDefaultTenantServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::talent_v4:: - MakeDefaultTenantServiceConnectionIdempotencyPolicy; - -/// @deprecated Use talent_v4::TenantServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::talent_v4::TenantServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_TENANT_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/talent/tenant_options.h b/google/cloud/talent/tenant_options.h deleted file mode 100644 index 1bc3638f25cff..0000000000000 --- a/google/cloud/talent/tenant_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/talent/v4/tenant_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_TENANT_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_TENANT_OPTIONS_H - -#include "google/cloud/talent/tenant_connection.h" -#include "google/cloud/talent/tenant_connection_idempotency_policy.h" -#include "google/cloud/talent/v4/tenant_options.h" - -namespace google { -namespace cloud { -namespace talent { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use talent_v4::TenantServiceBackoffPolicyOption directly. -using ::google::cloud::talent_v4::TenantServiceBackoffPolicyOption; - -/// @deprecated Use talent_v4::TenantServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::talent_v4:: - TenantServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use talent_v4::TenantServicePolicyOptionList directly. -using ::google::cloud::talent_v4::TenantServicePolicyOptionList; - -/// @deprecated Use talent_v4::TenantServiceRetryPolicyOption directly. -using ::google::cloud::talent_v4::TenantServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace talent -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_TENANT_OPTIONS_H diff --git a/google/cloud/talent/v4/company_connection.h b/google/cloud/talent/v4/company_connection.h index 326e5a5b31bba..dcdd5f9637d6e 100644 --- a/google/cloud/talent/v4/company_connection.h +++ b/google/cloud/talent/v4/company_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_COMPANY_CONNECTION_H #include "google/cloud/talent/v4/company_connection_idempotency_policy.h" +#include "google/cloud/talent/v4/company_service.pb.h" #include "google/cloud/talent/v4/internal/company_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/talent/v4/company_connection_idempotency_policy.h b/google/cloud/talent/v4/company_connection_idempotency_policy.h index 3217d473b0618..3aea3bf5532dc 100644 --- a/google/cloud/talent/v4/company_connection_idempotency_policy.h +++ b/google/cloud/talent/v4/company_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_COMPANY_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_COMPANY_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/talent/v4/company_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/talent/v4/completion_connection.h b/google/cloud/talent/v4/completion_connection.h index 0bf758dbf936d..a3ed7eee34890 100644 --- a/google/cloud/talent/v4/completion_connection.h +++ b/google/cloud/talent/v4/completion_connection.h @@ -20,13 +20,13 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_COMPLETION_CONNECTION_H #include "google/cloud/talent/v4/completion_connection_idempotency_policy.h" +#include "google/cloud/talent/v4/completion_service.pb.h" #include "google/cloud/talent/v4/internal/completion_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/version.h" -#include #include namespace google { diff --git a/google/cloud/talent/v4/completion_connection_idempotency_policy.h b/google/cloud/talent/v4/completion_connection_idempotency_policy.h index e5b5e9ffe0054..fcd45741957e2 100644 --- a/google/cloud/talent/v4/completion_connection_idempotency_policy.h +++ b/google/cloud/talent/v4/completion_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_COMPLETION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_COMPLETION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/talent/v4/completion_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/talent/v4/event_connection.h b/google/cloud/talent/v4/event_connection.h index 934da4f37ca64..5ef06242f6fe0 100644 --- a/google/cloud/talent/v4/event_connection.h +++ b/google/cloud/talent/v4/event_connection.h @@ -20,13 +20,13 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_EVENT_CONNECTION_H #include "google/cloud/talent/v4/event_connection_idempotency_policy.h" +#include "google/cloud/talent/v4/event_service.pb.h" #include "google/cloud/talent/v4/internal/event_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/version.h" -#include #include namespace google { diff --git a/google/cloud/talent/v4/event_connection_idempotency_policy.h b/google/cloud/talent/v4/event_connection_idempotency_policy.h index 72e1210d03591..dd33fc78967a9 100644 --- a/google/cloud/talent/v4/event_connection_idempotency_policy.h +++ b/google/cloud/talent/v4/event_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_EVENT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_EVENT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/talent/v4/event_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/talent/v4/internal/company_auth_decorator.cc b/google/cloud/talent/v4/internal/company_auth_decorator.cc index d69fb0b517c63..060a1595e730a 100644 --- a/google/cloud/talent/v4/internal/company_auth_decorator.cc +++ b/google/cloud/talent/v4/internal/company_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/talent/v4/company_service.proto #include "google/cloud/talent/v4/internal/company_auth_decorator.h" -#include +#include "google/cloud/talent/v4/company_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -84,3 +87,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/company_auth_decorator.h b/google/cloud/talent/v4/internal/company_auth_decorator.h index 891093c788a02..bf47753961958 100644 --- a/google/cloud/talent/v4/internal/company_auth_decorator.h +++ b/google/cloud/talent/v4/internal/company_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -72,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPANY_AUTH_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/company_logging_decorator.cc b/google/cloud/talent/v4/internal/company_logging_decorator.cc index ad8e0c83a1854..6dac36fa203af 100644 --- a/google/cloud/talent/v4/internal/company_logging_decorator.cc +++ b/google/cloud/talent/v4/internal/company_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/talent/v4/company_service.proto #include "google/cloud/talent/v4/internal/company_logging_decorator.h" +#include "google/cloud/talent/v4/company_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -108,3 +111,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/company_logging_decorator.h b/google/cloud/talent/v4/internal/company_logging_decorator.h index 469c6e537e4db..2ce20a0889524 100644 --- a/google/cloud/talent/v4/internal/company_logging_decorator.h +++ b/google/cloud/talent/v4/internal/company_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -72,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPANY_LOGGING_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/company_metadata_decorator.cc b/google/cloud/talent/v4/internal/company_metadata_decorator.cc index 16e73d3e9e241..2ced833fce5d4 100644 --- a/google/cloud/talent/v4/internal/company_metadata_decorator.cc +++ b/google/cloud/talent/v4/internal/company_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/talent/v4/company_service.proto #include "google/cloud/talent/v4/internal/company_metadata_decorator.h" +#include "google/cloud/talent/v4/company_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 talent_v4_internal { @@ -113,3 +117,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/company_metadata_decorator.h b/google/cloud/talent/v4/internal/company_metadata_decorator.h index 64f9fd32eefb5..fc6f457e66a49 100644 --- a/google/cloud/talent/v4/internal/company_metadata_decorator.h +++ b/google/cloud/talent/v4/internal/company_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -77,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPANY_METADATA_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/company_option_defaults.cc b/google/cloud/talent/v4/internal/company_option_defaults.cc index c4be6d2d44ea1..6d06ebb5781b4 100644 --- a/google/cloud/talent/v4/internal/company_option_defaults.cc +++ b/google/cloud/talent/v4/internal/company_option_defaults.cc @@ -41,7 +41,7 @@ Options CompanyServiceDefaultOptions(Options options) { if (!options.has()) { options.set( talent_v4::CompanyServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/talent/v4/internal/company_stub.cc b/google/cloud/talent/v4/internal/company_stub.cc index 6554d558b48ea..7382d9ff790d9 100644 --- a/google/cloud/talent/v4/internal/company_stub.cc +++ b/google/cloud/talent/v4/internal/company_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/talent/v4/company_service.proto #include "google/cloud/talent/v4/internal/company_stub.h" +#include "google/cloud/talent/v4/company_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -105,3 +108,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/company_stub.h b/google/cloud/talent/v4/internal/company_stub.h index 4b8f909978a87..abb5cac66fa45 100644 --- a/google/cloud/talent/v4/internal/company_stub.h +++ b/google/cloud/talent/v4/internal/company_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPANY_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPANY_STUB_H +#include "google/cloud/talent/v4/company_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -108,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPANY_STUB_H diff --git a/google/cloud/talent/v4/internal/company_stub_factory.cc b/google/cloud/talent/v4/internal/company_stub_factory.cc index e68f2c8d0d6dd..c69ff3106fcd5 100644 --- a/google/cloud/talent/v4/internal/company_stub_factory.cc +++ b/google/cloud/talent/v4/internal/company_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/talent/v4/company_service.proto #include "google/cloud/talent/v4/internal/company_stub_factory.h" +#include "google/cloud/talent/v4/company_service.grpc.pb.h" #include "google/cloud/talent/v4/internal/company_auth_decorator.h" #include "google/cloud/talent/v4/internal/company_logging_decorator.h" #include "google/cloud/talent/v4/internal/company_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/company_stub_factory.h b/google/cloud/talent/v4/internal/company_stub_factory.h index 4fb682b06d682..15da7b9bf61ec 100644 --- a/google/cloud/talent/v4/internal/company_stub_factory.h +++ b/google/cloud/talent/v4/internal/company_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPANY_STUB_FACTORY_H diff --git a/google/cloud/talent/v4/internal/company_tracing_connection.cc b/google/cloud/talent/v4/internal/company_tracing_connection.cc index 7e1906e83ec85..75a5ce7cb5510 100644 --- a/google/cloud/talent/v4/internal/company_tracing_connection.cc +++ b/google/cloud/talent/v4/internal/company_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CompanyServiceTracingConnection::CompanyServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -88,16 +86,12 @@ CompanyServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCompanyServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/talent/v4/internal/company_tracing_connection.h b/google/cloud/talent/v4/internal/company_tracing_connection.h index 63f3776f02ae3..de6c1f39a8aac 100644 --- a/google/cloud/talent/v4/internal/company_tracing_connection.h +++ b/google/cloud/talent/v4/internal/company_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CompanyServiceTracingConnection : public talent_v4::CompanyServiceConnection { public: @@ -62,8 +60,6 @@ class CompanyServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/talent/v4/internal/company_tracing_stub.cc b/google/cloud/talent/v4/internal/company_tracing_stub.cc index c45671a015d1f..5f23f96488a05 100644 --- a/google/cloud/talent/v4/internal/company_tracing_stub.cc +++ b/google/cloud/talent/v4/internal/company_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CompanyServiceTracingStub::CompanyServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -103,18 +104,14 @@ CompanyServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCompanyServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/company_tracing_stub.h b/google/cloud/talent/v4/internal/company_tracing_stub.h index 4c272fcea5e7e..b2ffc758ce61e 100644 --- a/google/cloud/talent/v4/internal/company_tracing_stub.h +++ b/google/cloud/talent/v4/internal/company_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CompanyServiceTracingStub : public CompanyServiceStub { public: ~CompanyServiceTracingStub() override = default; @@ -68,8 +69,6 @@ class CompanyServiceTracingStub : public CompanyServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -84,4 +83,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPANY_TRACING_STUB_H diff --git a/google/cloud/talent/v4/internal/completion_auth_decorator.cc b/google/cloud/talent/v4/internal/completion_auth_decorator.cc index b53ab9651272a..fd9d37e15dc5d 100644 --- a/google/cloud/talent/v4/internal/completion_auth_decorator.cc +++ b/google/cloud/talent/v4/internal/completion_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/talent/v4/completion_service.proto #include "google/cloud/talent/v4/internal/completion_auth_decorator.h" -#include +#include "google/cloud/talent/v4/completion_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -52,3 +55,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/completion_auth_decorator.h b/google/cloud/talent/v4/internal/completion_auth_decorator.h index 49c4042e20737..1ab17667c2769 100644 --- a/google/cloud/talent/v4/internal/completion_auth_decorator.h +++ b/google/cloud/talent/v4/internal/completion_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -56,4 +59,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPLETION_AUTH_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/completion_logging_decorator.cc b/google/cloud/talent/v4/internal/completion_logging_decorator.cc index f9ea46b49d42c..1f0e30311df30 100644 --- a/google/cloud/talent/v4/internal/completion_logging_decorator.cc +++ b/google/cloud/talent/v4/internal/completion_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/talent/v4/completion_service.proto #include "google/cloud/talent/v4/internal/completion_logging_decorator.h" +#include "google/cloud/talent/v4/completion_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -62,3 +65,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/completion_logging_decorator.h b/google/cloud/talent/v4/internal/completion_logging_decorator.h index b08957903e1d0..fe6e060aca58b 100644 --- a/google/cloud/talent/v4/internal/completion_logging_decorator.h +++ b/google/cloud/talent/v4/internal/completion_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -56,4 +59,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPLETION_LOGGING_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/completion_metadata_decorator.cc b/google/cloud/talent/v4/internal/completion_metadata_decorator.cc index 901b314f30d73..c73b8b705d039 100644 --- a/google/cloud/talent/v4/internal/completion_metadata_decorator.cc +++ b/google/cloud/talent/v4/internal/completion_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/talent/v4/completion_service.proto #include "google/cloud/talent/v4/internal/completion_metadata_decorator.h" +#include "google/cloud/talent/v4/completion_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 talent_v4_internal { @@ -78,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/completion_metadata_decorator.h b/google/cloud/talent/v4/internal/completion_metadata_decorator.h index 8cdf183cde244..99ff4ca695342 100644 --- a/google/cloud/talent/v4/internal/completion_metadata_decorator.h +++ b/google/cloud/talent/v4/internal/completion_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -61,4 +64,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPLETION_METADATA_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/completion_option_defaults.cc b/google/cloud/talent/v4/internal/completion_option_defaults.cc index 678b8c1871344..b9b2703347581 100644 --- a/google/cloud/talent/v4/internal/completion_option_defaults.cc +++ b/google/cloud/talent/v4/internal/completion_option_defaults.cc @@ -40,7 +40,7 @@ Options CompletionDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - talent_v4::CompletionLimitedTimeRetryPolicy(std::chrono::minutes(30)) + talent_v4::CompletionLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/talent/v4/internal/completion_stub.cc b/google/cloud/talent/v4/internal/completion_stub.cc index c065b83bec82a..07aac6e290a3e 100644 --- a/google/cloud/talent/v4/internal/completion_stub.cc +++ b/google/cloud/talent/v4/internal/completion_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/talent/v4/completion_service.proto #include "google/cloud/talent/v4/internal/completion_stub.h" +#include "google/cloud/talent/v4/completion_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -57,3 +60,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/completion_stub.h b/google/cloud/talent/v4/internal/completion_stub.h index 518fecf31f2c0..b3fd853b871b5 100644 --- a/google/cloud/talent/v4/internal/completion_stub.h +++ b/google/cloud/talent/v4/internal/completion_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPLETION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPLETION_STUB_H +#include "google/cloud/talent/v4/completion_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -76,4 +79,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPLETION_STUB_H diff --git a/google/cloud/talent/v4/internal/completion_stub_factory.cc b/google/cloud/talent/v4/internal/completion_stub_factory.cc index 828dce1b79fc3..cf11f96d3d7de 100644 --- a/google/cloud/talent/v4/internal/completion_stub_factory.cc +++ b/google/cloud/talent/v4/internal/completion_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/talent/v4/completion_service.proto #include "google/cloud/talent/v4/internal/completion_stub_factory.h" +#include "google/cloud/talent/v4/completion_service.grpc.pb.h" #include "google/cloud/talent/v4/internal/completion_auth_decorator.h" #include "google/cloud/talent/v4/internal/completion_logging_decorator.h" #include "google/cloud/talent/v4/internal/completion_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/completion_stub_factory.h b/google/cloud/talent/v4/internal/completion_stub_factory.h index 1668fc62d4c39..51b8f30210e5a 100644 --- a/google/cloud/talent/v4/internal/completion_stub_factory.h +++ b/google/cloud/talent/v4/internal/completion_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPLETION_STUB_FACTORY_H diff --git a/google/cloud/talent/v4/internal/completion_tracing_connection.cc b/google/cloud/talent/v4/internal/completion_tracing_connection.cc index 851a30e6d18fa..9718f8bcaee73 100644 --- a/google/cloud/talent/v4/internal/completion_tracing_connection.cc +++ b/google/cloud/talent/v4/internal/completion_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CompletionTracingConnection::CompletionTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -50,16 +48,12 @@ CompletionTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCompletionTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/talent/v4/internal/completion_tracing_connection.h b/google/cloud/talent/v4/internal/completion_tracing_connection.h index 9aeca23c96644..c46d2c1632a39 100644 --- a/google/cloud/talent/v4/internal/completion_tracing_connection.h +++ b/google/cloud/talent/v4/internal/completion_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CompletionTracingConnection : public talent_v4::CompletionConnection { public: ~CompletionTracingConnection() override = default; @@ -49,8 +47,6 @@ class CompletionTracingConnection : public talent_v4::CompletionConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/talent/v4/internal/completion_tracing_stub.cc b/google/cloud/talent/v4/internal/completion_tracing_stub.cc index c642881a0e2d2..9cd3eeba67cf3 100644 --- a/google/cloud/talent/v4/internal/completion_tracing_stub.cc +++ b/google/cloud/talent/v4/internal/completion_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CompletionTracingStub::CompletionTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -55,18 +56,14 @@ StatusOr CompletionTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCompletionTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/completion_tracing_stub.h b/google/cloud/talent/v4/internal/completion_tracing_stub.h index 04d87fde0f925..da1a15c83727d 100644 --- a/google/cloud/talent/v4/internal/completion_tracing_stub.h +++ b/google/cloud/talent/v4/internal/completion_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CompletionTracingStub : public CompletionStub { public: ~CompletionTracingStub() override = default; @@ -52,8 +53,6 @@ class CompletionTracingStub : public CompletionStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -68,4 +67,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_COMPLETION_TRACING_STUB_H diff --git a/google/cloud/talent/v4/internal/event_auth_decorator.cc b/google/cloud/talent/v4/internal/event_auth_decorator.cc index 43c16287f515f..053c9566a8c67 100644 --- a/google/cloud/talent/v4/internal/event_auth_decorator.cc +++ b/google/cloud/talent/v4/internal/event_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/talent/v4/event_service.proto #include "google/cloud/talent/v4/internal/event_auth_decorator.h" -#include +#include "google/cloud/talent/v4/event_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -52,3 +55,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/event_auth_decorator.h b/google/cloud/talent/v4/internal/event_auth_decorator.h index 122b63876d37c..04dfa7e1df627 100644 --- a/google/cloud/talent/v4/internal/event_auth_decorator.h +++ b/google/cloud/talent/v4/internal/event_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -57,4 +60,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_EVENT_AUTH_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/event_logging_decorator.cc b/google/cloud/talent/v4/internal/event_logging_decorator.cc index e0b06943bd7bb..0597dfe5eeeb7 100644 --- a/google/cloud/talent/v4/internal/event_logging_decorator.cc +++ b/google/cloud/talent/v4/internal/event_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/talent/v4/event_service.proto #include "google/cloud/talent/v4/internal/event_logging_decorator.h" +#include "google/cloud/talent/v4/event_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -63,3 +66,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/event_logging_decorator.h b/google/cloud/talent/v4/internal/event_logging_decorator.h index a5bf635de0233..129c66d97ce0a 100644 --- a/google/cloud/talent/v4/internal/event_logging_decorator.h +++ b/google/cloud/talent/v4/internal/event_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -57,4 +60,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_EVENT_LOGGING_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/event_metadata_decorator.cc b/google/cloud/talent/v4/internal/event_metadata_decorator.cc index 9aad598193003..a05e6b54191f7 100644 --- a/google/cloud/talent/v4/internal/event_metadata_decorator.cc +++ b/google/cloud/talent/v4/internal/event_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/talent/v4/event_service.proto #include "google/cloud/talent/v4/internal/event_metadata_decorator.h" +#include "google/cloud/talent/v4/event_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 talent_v4_internal { @@ -78,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/event_metadata_decorator.h b/google/cloud/talent/v4/internal/event_metadata_decorator.h index 254f89c38446a..2ce1af04f309a 100644 --- a/google/cloud/talent/v4/internal/event_metadata_decorator.h +++ b/google/cloud/talent/v4/internal/event_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -62,4 +65,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_EVENT_METADATA_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/event_option_defaults.cc b/google/cloud/talent/v4/internal/event_option_defaults.cc index ba05a5c255689..b32dec1f721e9 100644 --- a/google/cloud/talent/v4/internal/event_option_defaults.cc +++ b/google/cloud/talent/v4/internal/event_option_defaults.cc @@ -40,7 +40,7 @@ Options EventServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - talent_v4::EventServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + talent_v4::EventServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/talent/v4/internal/event_stub.cc b/google/cloud/talent/v4/internal/event_stub.cc index 43954946e5ecc..2d1b24a299b55 100644 --- a/google/cloud/talent/v4/internal/event_stub.cc +++ b/google/cloud/talent/v4/internal/event_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/talent/v4/event_service.proto #include "google/cloud/talent/v4/internal/event_stub.h" +#include "google/cloud/talent/v4/event_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -57,3 +60,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/event_stub.h b/google/cloud/talent/v4/internal/event_stub.h index 7ca65480661f9..1deae862cd870 100644 --- a/google/cloud/talent/v4/internal/event_stub.h +++ b/google/cloud/talent/v4/internal/event_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_EVENT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_EVENT_STUB_H +#include "google/cloud/talent/v4/event_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -76,4 +79,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_EVENT_STUB_H diff --git a/google/cloud/talent/v4/internal/event_stub_factory.cc b/google/cloud/talent/v4/internal/event_stub_factory.cc index a20eeedb68e17..b7baf573601ad 100644 --- a/google/cloud/talent/v4/internal/event_stub_factory.cc +++ b/google/cloud/talent/v4/internal/event_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/talent/v4/event_service.proto #include "google/cloud/talent/v4/internal/event_stub_factory.h" +#include "google/cloud/talent/v4/event_service.grpc.pb.h" #include "google/cloud/talent/v4/internal/event_auth_decorator.h" #include "google/cloud/talent/v4/internal/event_logging_decorator.h" #include "google/cloud/talent/v4/internal/event_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/event_stub_factory.h b/google/cloud/talent/v4/internal/event_stub_factory.h index 82ea81220ae00..013df4a0783da 100644 --- a/google/cloud/talent/v4/internal/event_stub_factory.h +++ b/google/cloud/talent/v4/internal/event_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_EVENT_STUB_FACTORY_H diff --git a/google/cloud/talent/v4/internal/event_tracing_connection.cc b/google/cloud/talent/v4/internal/event_tracing_connection.cc index 864acea8d2c4c..3e8cae600e80d 100644 --- a/google/cloud/talent/v4/internal/event_tracing_connection.cc +++ b/google/cloud/talent/v4/internal/event_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EventServiceTracingConnection::EventServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -50,16 +48,12 @@ EventServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEventServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/talent/v4/internal/event_tracing_connection.h b/google/cloud/talent/v4/internal/event_tracing_connection.h index 2f3f420b83c0c..17a20fea81fc9 100644 --- a/google/cloud/talent/v4/internal/event_tracing_connection.h +++ b/google/cloud/talent/v4/internal/event_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EventServiceTracingConnection : public talent_v4::EventServiceConnection { public: ~EventServiceTracingConnection() override = default; @@ -50,8 +48,6 @@ class EventServiceTracingConnection : public talent_v4::EventServiceConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/talent/v4/internal/event_tracing_stub.cc b/google/cloud/talent/v4/internal/event_tracing_stub.cc index 6a15ffdb2b88f..bcd7e4b67b119 100644 --- a/google/cloud/talent/v4/internal/event_tracing_stub.cc +++ b/google/cloud/talent/v4/internal/event_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - EventServiceTracingStub::EventServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -55,18 +56,14 @@ StatusOr EventServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeEventServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/event_tracing_stub.h b/google/cloud/talent/v4/internal/event_tracing_stub.h index 5acbdf9c69bb5..47659d25cf05d 100644 --- a/google/cloud/talent/v4/internal/event_tracing_stub.h +++ b/google/cloud/talent/v4/internal/event_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class EventServiceTracingStub : public EventServiceStub { public: ~EventServiceTracingStub() override = default; @@ -53,8 +54,6 @@ class EventServiceTracingStub : public EventServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -69,4 +68,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_EVENT_TRACING_STUB_H diff --git a/google/cloud/talent/v4/internal/job_auth_decorator.cc b/google/cloud/talent/v4/internal/job_auth_decorator.cc index fc45e1a6cebb3..77ae3138741cf 100644 --- a/google/cloud/talent/v4/internal/job_auth_decorator.cc +++ b/google/cloud/talent/v4/internal/job_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/talent/v4/job_service.proto #include "google/cloud/talent/v4/internal/job_auth_decorator.h" -#include +#include "google/cloud/talent/v4/job_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -221,3 +224,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/job_auth_decorator.h b/google/cloud/talent/v4/internal/job_auth_decorator.h index e8286beaea661..6f14cdac878de 100644 --- a/google/cloud/talent/v4/internal/job_auth_decorator.h +++ b/google/cloud/talent/v4/internal/job_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/talent/v4/internal/job_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 talent_v4_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_JOB_AUTH_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/job_connection_impl.h b/google/cloud/talent/v4/internal/job_connection_impl.h index 55de5cf56ee85..ead1f4cb82fe8 100644 --- a/google/cloud/talent/v4/internal/job_connection_impl.h +++ b/google/cloud/talent/v4/internal/job_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/talent/v4/internal/job_logging_decorator.cc b/google/cloud/talent/v4/internal/job_logging_decorator.cc index 8e2579ac8f998..d33f8604cf7d5 100644 --- a/google/cloud/talent/v4/internal/job_logging_decorator.cc +++ b/google/cloud/talent/v4/internal/job_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/talent/v4/job_service.proto #include "google/cloud/talent/v4/internal/job_logging_decorator.h" +#include "google/cloud/talent/v4/job_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -252,3 +255,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/job_logging_decorator.h b/google/cloud/talent/v4/internal/job_logging_decorator.h index 0094ef4c5f488..fe01e16b7b3c0 100644 --- a/google/cloud/talent/v4/internal/job_logging_decorator.h +++ b/google/cloud/talent/v4/internal/job_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/talent/v4/internal/job_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 talent_v4_internal { @@ -129,4 +132,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_JOB_LOGGING_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/job_metadata_decorator.cc b/google/cloud/talent/v4/internal/job_metadata_decorator.cc index 54f9f5a2a8a63..7f4fc1ad081f8 100644 --- a/google/cloud/talent/v4/internal/job_metadata_decorator.cc +++ b/google/cloud/talent/v4/internal/job_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/talent/v4/job_service.proto #include "google/cloud/talent/v4/internal/job_metadata_decorator.h" +#include "google/cloud/talent/v4/job_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 talent_v4_internal { @@ -212,3 +216,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/job_metadata_decorator.h b/google/cloud/talent/v4/internal/job_metadata_decorator.h index 2e39a03d6a0bb..3de54d55f7a06 100644 --- a/google/cloud/talent/v4/internal/job_metadata_decorator.h +++ b/google/cloud/talent/v4/internal/job_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/talent/v4/internal/job_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 talent_v4_internal { @@ -134,4 +137,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_JOB_METADATA_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/job_option_defaults.cc b/google/cloud/talent/v4/internal/job_option_defaults.cc index a2ed58fd6d6bc..99b33269f7118 100644 --- a/google/cloud/talent/v4/internal/job_option_defaults.cc +++ b/google/cloud/talent/v4/internal/job_option_defaults.cc @@ -40,7 +40,7 @@ Options JobServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - talent_v4::JobServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + talent_v4::JobServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/talent/v4/internal/job_stub.cc b/google/cloud/talent/v4/internal/job_stub.cc index db2a59614d6d6..0b0da63f6b8d6 100644 --- a/google/cloud/talent/v4/internal/job_stub.cc +++ b/google/cloud/talent/v4/internal/job_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/talent/v4/job_service.proto #include "google/cloud/talent/v4/internal/job_stub.h" +#include "google/cloud/talent/v4/job_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -252,3 +255,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/job_stub.h b/google/cloud/talent/v4/internal/job_stub.h index 9dec0dcff0010..87796a270e42d 100644 --- a/google/cloud/talent/v4/internal/job_stub.h +++ b/google/cloud/talent/v4/internal/job_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_JOB_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_JOB_STUB_H +#include "google/cloud/talent/v4/job_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -216,4 +219,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_JOB_STUB_H diff --git a/google/cloud/talent/v4/internal/job_stub_factory.cc b/google/cloud/talent/v4/internal/job_stub_factory.cc index 63820f2e284a9..45eb61d4ca127 100644 --- a/google/cloud/talent/v4/internal/job_stub_factory.cc +++ b/google/cloud/talent/v4/internal/job_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/talent/v4/internal/job_metadata_decorator.h" #include "google/cloud/talent/v4/internal/job_stub.h" #include "google/cloud/talent/v4/internal/job_tracing_stub.h" +#include "google/cloud/talent/v4/job_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/job_stub_factory.h b/google/cloud/talent/v4/internal/job_stub_factory.h index 3ef59b5917a2e..33065f55fc5cc 100644 --- a/google/cloud/talent/v4/internal/job_stub_factory.h +++ b/google/cloud/talent/v4/internal/job_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_JOB_STUB_FACTORY_H diff --git a/google/cloud/talent/v4/internal/job_tracing_connection.cc b/google/cloud/talent/v4/internal/job_tracing_connection.cc index aa68e00edf4eb..6125ca1d9b851 100644 --- a/google/cloud/talent/v4/internal/job_tracing_connection.cc +++ b/google/cloud/talent/v4/internal/job_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - JobServiceTracingConnection::JobServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -184,16 +182,12 @@ JobServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeJobServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/talent/v4/internal/job_tracing_connection.h b/google/cloud/talent/v4/internal/job_tracing_connection.h index 520394d0137a1..f348ef5c58e91 100644 --- a/google/cloud/talent/v4/internal/job_tracing_connection.h +++ b/google/cloud/talent/v4/internal/job_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class JobServiceTracingConnection : public talent_v4::JobServiceConnection { public: ~JobServiceTracingConnection() override = default; @@ -103,8 +101,6 @@ class JobServiceTracingConnection : public talent_v4::JobServiceConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/talent/v4/internal/job_tracing_stub.cc b/google/cloud/talent/v4/internal/job_tracing_stub.cc index c9d5cef94253d..e42908a4c95fa 100644 --- a/google/cloud/talent/v4/internal/job_tracing_stub.cc +++ b/google/cloud/talent/v4/internal/job_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - JobServiceTracingStub::JobServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -229,18 +230,14 @@ future JobServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeJobServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/job_tracing_stub.h b/google/cloud/talent/v4/internal/job_tracing_stub.h index b98605f59fcfc..dc6ca9a01faad 100644 --- a/google/cloud/talent/v4/internal/job_tracing_stub.h +++ b/google/cloud/talent/v4/internal/job_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class JobServiceTracingStub : public JobServiceStub { public: ~JobServiceTracingStub() override = default; @@ -124,8 +125,6 @@ class JobServiceTracingStub : public JobServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -140,4 +139,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_JOB_TRACING_STUB_H diff --git a/google/cloud/talent/v4/internal/tenant_auth_decorator.cc b/google/cloud/talent/v4/internal/tenant_auth_decorator.cc index f7e85a83ff224..3549a6a219b5c 100644 --- a/google/cloud/talent/v4/internal/tenant_auth_decorator.cc +++ b/google/cloud/talent/v4/internal/tenant_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/talent/v4/tenant_service.proto #include "google/cloud/talent/v4/internal/tenant_auth_decorator.h" -#include +#include "google/cloud/talent/v4/tenant_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -84,3 +87,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/tenant_auth_decorator.h b/google/cloud/talent/v4/internal/tenant_auth_decorator.h index 401e9ba828117..2050866074efa 100644 --- a/google/cloud/talent/v4/internal/tenant_auth_decorator.h +++ b/google/cloud/talent/v4/internal/tenant_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -72,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_TENANT_AUTH_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/tenant_logging_decorator.cc b/google/cloud/talent/v4/internal/tenant_logging_decorator.cc index 7113836e2836e..192771ccffca4 100644 --- a/google/cloud/talent/v4/internal/tenant_logging_decorator.cc +++ b/google/cloud/talent/v4/internal/tenant_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/talent/v4/tenant_service.proto #include "google/cloud/talent/v4/internal/tenant_logging_decorator.h" +#include "google/cloud/talent/v4/tenant_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -106,3 +109,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/tenant_logging_decorator.h b/google/cloud/talent/v4/internal/tenant_logging_decorator.h index 93256403110e3..ffcf5b5b18fe5 100644 --- a/google/cloud/talent/v4/internal/tenant_logging_decorator.h +++ b/google/cloud/talent/v4/internal/tenant_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -72,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_TENANT_LOGGING_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/tenant_metadata_decorator.cc b/google/cloud/talent/v4/internal/tenant_metadata_decorator.cc index 04337cc4922d0..c4ace33f43861 100644 --- a/google/cloud/talent/v4/internal/tenant_metadata_decorator.cc +++ b/google/cloud/talent/v4/internal/tenant_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/talent/v4/tenant_service.proto #include "google/cloud/talent/v4/internal/tenant_metadata_decorator.h" +#include "google/cloud/talent/v4/tenant_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 talent_v4_internal { @@ -111,3 +115,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/tenant_metadata_decorator.h b/google/cloud/talent/v4/internal/tenant_metadata_decorator.h index 179f040b87f87..593be426a29fa 100644 --- a/google/cloud/talent/v4/internal/tenant_metadata_decorator.h +++ b/google/cloud/talent/v4/internal/tenant_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -77,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_TENANT_METADATA_DECORATOR_H diff --git a/google/cloud/talent/v4/internal/tenant_option_defaults.cc b/google/cloud/talent/v4/internal/tenant_option_defaults.cc index 05f854920a66b..e4cb516fbf091 100644 --- a/google/cloud/talent/v4/internal/tenant_option_defaults.cc +++ b/google/cloud/talent/v4/internal/tenant_option_defaults.cc @@ -40,7 +40,7 @@ Options TenantServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - talent_v4::TenantServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + talent_v4::TenantServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/talent/v4/internal/tenant_stub.cc b/google/cloud/talent/v4/internal/tenant_stub.cc index bb392ddeaee15..f07fe0b360ad0 100644 --- a/google/cloud/talent/v4/internal/tenant_stub.cc +++ b/google/cloud/talent/v4/internal/tenant_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/talent/v4/tenant_service.proto #include "google/cloud/talent/v4/internal/tenant_stub.h" +#include "google/cloud/talent/v4/tenant_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -103,3 +106,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/tenant_stub.h b/google/cloud/talent/v4/internal/tenant_stub.h index 90c187f796217..971d6905f9aee 100644 --- a/google/cloud/talent/v4/internal/tenant_stub.h +++ b/google/cloud/talent/v4/internal/tenant_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_TENANT_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_TENANT_STUB_H +#include "google/cloud/talent/v4/tenant_service.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -107,4 +110,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_TENANT_STUB_H diff --git a/google/cloud/talent/v4/internal/tenant_stub_factory.cc b/google/cloud/talent/v4/internal/tenant_stub_factory.cc index 94edb8bcb0ebf..bae9a3608beaa 100644 --- a/google/cloud/talent/v4/internal/tenant_stub_factory.cc +++ b/google/cloud/talent/v4/internal/tenant_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/talent/v4/internal/tenant_metadata_decorator.h" #include "google/cloud/talent/v4/internal/tenant_stub.h" #include "google/cloud/talent/v4/internal/tenant_tracing_stub.h" +#include "google/cloud/talent/v4/tenant_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/tenant_stub_factory.h b/google/cloud/talent/v4/internal/tenant_stub_factory.h index c2ef80ba492f6..6d63923a6ba9e 100644 --- a/google/cloud/talent/v4/internal/tenant_stub_factory.h +++ b/google/cloud/talent/v4/internal/tenant_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_TENANT_STUB_FACTORY_H diff --git a/google/cloud/talent/v4/internal/tenant_tracing_connection.cc b/google/cloud/talent/v4/internal/tenant_tracing_connection.cc index de0a53aa88e86..cb775e29aa5c1 100644 --- a/google/cloud/talent/v4/internal/tenant_tracing_connection.cc +++ b/google/cloud/talent/v4/internal/tenant_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TenantServiceTracingConnection::TenantServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -88,16 +86,12 @@ TenantServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTenantServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/talent/v4/internal/tenant_tracing_connection.h b/google/cloud/talent/v4/internal/tenant_tracing_connection.h index 4000309233b53..933dc3b122529 100644 --- a/google/cloud/talent/v4/internal/tenant_tracing_connection.h +++ b/google/cloud/talent/v4/internal/tenant_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TenantServiceTracingConnection : public talent_v4::TenantServiceConnection { public: @@ -62,8 +60,6 @@ class TenantServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/talent/v4/internal/tenant_tracing_stub.cc b/google/cloud/talent/v4/internal/tenant_tracing_stub.cc index 45c91e61c5536..6c4b14cde3a14 100644 --- a/google/cloud/talent/v4/internal/tenant_tracing_stub.cc +++ b/google/cloud/talent/v4/internal/tenant_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TenantServiceTracingStub::TenantServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -101,18 +102,14 @@ StatusOr TenantServiceTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTenantServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace talent_v4_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/talent/v4/internal/tenant_tracing_stub.h b/google/cloud/talent/v4/internal/tenant_tracing_stub.h index a70d4cc8f36f1..c04abbc1a9796 100644 --- a/google/cloud/talent/v4/internal/tenant_tracing_stub.h +++ b/google/cloud/talent/v4/internal/tenant_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace talent_v4_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TenantServiceTracingStub : public TenantServiceStub { public: ~TenantServiceTracingStub() override = default; @@ -68,8 +69,6 @@ class TenantServiceTracingStub : public TenantServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -84,4 +83,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_INTERNAL_TENANT_TRACING_STUB_H diff --git a/google/cloud/talent/v4/job_client.h b/google/cloud/talent/v4/job_client.h index 7c1e051fed6f7..a7ec48dd23521 100644 --- a/google/cloud/talent/v4/job_client.h +++ b/google/cloud/talent/v4/job_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/talent/v4/job_connection.h b/google/cloud/talent/v4/job_connection.h index 54ad54d7c1bec..f15daa4ac9175 100644 --- a/google/cloud/talent/v4/job_connection.h +++ b/google/cloud/talent/v4/job_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/talent/v4/internal/job_retry_traits.h" #include "google/cloud/talent/v4/job_connection_idempotency_policy.h" +#include "google/cloud/talent/v4/job_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/talent/v4/job_connection_idempotency_policy.h b/google/cloud/talent/v4/job_connection_idempotency_policy.h index 2498f8ee006f8..c928a31637707 100644 --- a/google/cloud/talent/v4/job_connection_idempotency_policy.h +++ b/google/cloud/talent/v4/job_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_JOB_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_JOB_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/talent/v4/job_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/talent/v4/tenant_connection.h b/google/cloud/talent/v4/tenant_connection.h index 2c9a01c787db5..a6f2e4ba51eda 100644 --- a/google/cloud/talent/v4/tenant_connection.h +++ b/google/cloud/talent/v4/tenant_connection.h @@ -21,13 +21,13 @@ #include "google/cloud/talent/v4/internal/tenant_retry_traits.h" #include "google/cloud/talent/v4/tenant_connection_idempotency_policy.h" +#include "google/cloud/talent/v4/tenant_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 #include namespace google { diff --git a/google/cloud/talent/v4/tenant_connection_idempotency_policy.h b/google/cloud/talent/v4/tenant_connection_idempotency_policy.h index 2b319ab3c0a2e..66784a7dc0222 100644 --- a/google/cloud/talent/v4/tenant_connection_idempotency_policy.h +++ b/google/cloud/talent/v4/tenant_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_TENANT_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TALENT_V4_TENANT_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/talent/v4/tenant_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/tasks/BUILD.bazel b/google/cloud/tasks/BUILD.bazel index 2d17e94b56491..8b524d5564914 100644 --- a/google/cloud/tasks/BUILD.bazel +++ b/google/cloud/tasks/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/tasks/v2:tasks_cc_grpc", + "@googleapis//google/cloud/tasks/v2:tasks_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/tasks/CMakeLists.txt b/google/cloud/tasks/CMakeLists.txt index 7e49f40b647ea..9f98e60accea6 100644 --- a/google/cloud/tasks/CMakeLists.txt +++ b/google/cloud/tasks/CMakeLists.txt @@ -16,8 +16,7 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library(tasks "Cloud Tasks API" - SERVICE_DIRS "__EMPTY__" "v2/") +google_cloud_cpp_add_gapic_library(tasks "Cloud Tasks API" SERVICE_DIRS "v2/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(tasks_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/tasks/cloud_tasks_client.h b/google/cloud/tasks/cloud_tasks_client.h deleted file mode 100644 index 5b310a62fb0da..0000000000000 --- a/google/cloud/tasks/cloud_tasks_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/tasks/v2/cloudtasks.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_CLOUD_TASKS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_CLOUD_TASKS_CLIENT_H - -#include "google/cloud/tasks/cloud_tasks_connection.h" -#include "google/cloud/tasks/v2/cloud_tasks_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in tasks_v2 instead of the aliases defined in -/// this namespace. -namespace tasks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use tasks_v2::CloudTasksClient directly. -using ::google::cloud::tasks_v2::CloudTasksClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace tasks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_CLOUD_TASKS_CLIENT_H diff --git a/google/cloud/tasks/cloud_tasks_connection.h b/google/cloud/tasks/cloud_tasks_connection.h deleted file mode 100644 index 90e05ec75e158..0000000000000 --- a/google/cloud/tasks/cloud_tasks_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/tasks/v2/cloudtasks.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_CLOUD_TASKS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_CLOUD_TASKS_CONNECTION_H - -#include "google/cloud/tasks/cloud_tasks_connection_idempotency_policy.h" -#include "google/cloud/tasks/v2/cloud_tasks_connection.h" - -namespace google { -namespace cloud { -namespace tasks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use tasks_v2::MakeCloudTasksConnection directly. -using ::google::cloud::tasks_v2::MakeCloudTasksConnection; - -/// @deprecated Use tasks_v2::CloudTasksConnection directly. -using ::google::cloud::tasks_v2::CloudTasksConnection; - -/// @deprecated Use tasks_v2::CloudTasksLimitedErrorCountRetryPolicy directly. -using ::google::cloud::tasks_v2::CloudTasksLimitedErrorCountRetryPolicy; - -/// @deprecated Use tasks_v2::CloudTasksLimitedTimeRetryPolicy directly. -using ::google::cloud::tasks_v2::CloudTasksLimitedTimeRetryPolicy; - -/// @deprecated Use tasks_v2::CloudTasksRetryPolicy directly. -using ::google::cloud::tasks_v2::CloudTasksRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace tasks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_CLOUD_TASKS_CONNECTION_H diff --git a/google/cloud/tasks/cloud_tasks_connection_idempotency_policy.h b/google/cloud/tasks/cloud_tasks_connection_idempotency_policy.h deleted file mode 100644 index 87799940d1c42..0000000000000 --- a/google/cloud/tasks/cloud_tasks_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/tasks/v2/cloudtasks.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_CLOUD_TASKS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_CLOUD_TASKS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/tasks/v2/cloud_tasks_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace tasks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use tasks_v2::MakeDefaultCloudTasksConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::tasks_v2:: - MakeDefaultCloudTasksConnectionIdempotencyPolicy; - -/// @deprecated Use tasks_v2::CloudTasksConnectionIdempotencyPolicy directly. -using ::google::cloud::tasks_v2::CloudTasksConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace tasks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_CLOUD_TASKS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/tasks/cloud_tasks_options.h b/google/cloud/tasks/cloud_tasks_options.h deleted file mode 100644 index 6632e2d6b3ecf..0000000000000 --- a/google/cloud/tasks/cloud_tasks_options.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/tasks/v2/cloudtasks.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_CLOUD_TASKS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_CLOUD_TASKS_OPTIONS_H - -#include "google/cloud/tasks/cloud_tasks_connection.h" -#include "google/cloud/tasks/cloud_tasks_connection_idempotency_policy.h" -#include "google/cloud/tasks/v2/cloud_tasks_options.h" - -namespace google { -namespace cloud { -namespace tasks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use tasks_v2::CloudTasksBackoffPolicyOption directly. -using ::google::cloud::tasks_v2::CloudTasksBackoffPolicyOption; - -/// @deprecated Use tasks_v2::CloudTasksConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::tasks_v2::CloudTasksConnectionIdempotencyPolicyOption; - -/// @deprecated Use tasks_v2::CloudTasksPolicyOptionList directly. -using ::google::cloud::tasks_v2::CloudTasksPolicyOptionList; - -/// @deprecated Use tasks_v2::CloudTasksRetryPolicyOption directly. -using ::google::cloud::tasks_v2::CloudTasksRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace tasks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_CLOUD_TASKS_OPTIONS_H diff --git a/google/cloud/tasks/mocks/mock_cloud_tasks_connection.h b/google/cloud/tasks/mocks/mock_cloud_tasks_connection.h deleted file mode 100644 index d93c33b7b2733..0000000000000 --- a/google/cloud/tasks/mocks/mock_cloud_tasks_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/tasks/v2/cloudtasks.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_MOCKS_MOCK_CLOUD_TASKS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_MOCKS_MOCK_CLOUD_TASKS_CONNECTION_H - -#include "google/cloud/tasks/cloud_tasks_connection.h" -#include "google/cloud/tasks/v2/mocks/mock_cloud_tasks_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in tasks_v2_mocks instead of the aliases -/// defined in this namespace. -namespace tasks_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use tasks_v2_mocks::MockCloudTasksConnection directly. -using ::google::cloud::tasks_v2_mocks::MockCloudTasksConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace tasks_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_MOCKS_MOCK_CLOUD_TASKS_CONNECTION_H diff --git a/google/cloud/tasks/quickstart/.bazelrc b/google/cloud/tasks/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/tasks/quickstart/.bazelrc +++ b/google/cloud/tasks/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/tasks/quickstart/CMakeLists.txt index 7449f23e6889e..4ea48a47580b2 100644 --- a/google/cloud/tasks/quickstart/CMakeLists.txt +++ b/google/cloud/tasks/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Tasks API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-tasks-quickstart CXX) find_package(google_cloud_cpp_tasks REQUIRED) diff --git a/google/cloud/tasks/quickstart/WORKSPACE.bazel b/google/cloud/tasks/quickstart/WORKSPACE.bazel index b12fd8b4bc946..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 = "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/tasks/v2/cloud_tasks_connection.h b/google/cloud/tasks/v2/cloud_tasks_connection.h index 60b797d977751..ccc2ad9ebf11d 100644 --- a/google/cloud/tasks/v2/cloud_tasks_connection.h +++ b/google/cloud/tasks/v2/cloud_tasks_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_V2_CLOUD_TASKS_CONNECTION_H #include "google/cloud/tasks/v2/cloud_tasks_connection_idempotency_policy.h" +#include "google/cloud/tasks/v2/cloudtasks.pb.h" #include "google/cloud/tasks/v2/internal/cloud_tasks_retry_traits.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/tasks/v2/cloud_tasks_connection_idempotency_policy.h b/google/cloud/tasks/v2/cloud_tasks_connection_idempotency_policy.h index 4ce4d88c19b6a..80b498c80c75b 100644 --- a/google/cloud/tasks/v2/cloud_tasks_connection_idempotency_policy.h +++ b/google/cloud/tasks/v2/cloud_tasks_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_V2_CLOUD_TASKS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_V2_CLOUD_TASKS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/tasks/v2/cloudtasks.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include #include namespace google { diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_auth_decorator.cc b/google/cloud/tasks/v2/internal/cloud_tasks_auth_decorator.cc index 77f731171dd11..2454f3a95655d 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_auth_decorator.cc +++ b/google/cloud/tasks/v2/internal/cloud_tasks_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/tasks/v2/cloudtasks.proto #include "google/cloud/tasks/v2/internal/cloud_tasks_auth_decorator.h" -#include +#include "google/cloud/tasks/v2/cloudtasks.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tasks_v2_internal { @@ -182,3 +185,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tasks_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_auth_decorator.h b/google/cloud/tasks/v2/internal/cloud_tasks_auth_decorator.h index 017294421db79..f8b8b26f9d97c 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_auth_decorator.h +++ b/google/cloud/tasks/v2/internal/cloud_tasks_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tasks_v2_internal { @@ -120,4 +123,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_V2_INTERNAL_CLOUD_TASKS_AUTH_DECORATOR_H diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_logging_decorator.cc b/google/cloud/tasks/v2/internal/cloud_tasks_logging_decorator.cc index a55ee017dc797..f7789b3b21967 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_logging_decorator.cc +++ b/google/cloud/tasks/v2/internal/cloud_tasks_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/tasks/v2/cloudtasks.proto #include "google/cloud/tasks/v2/internal/cloud_tasks_logging_decorator.h" +#include "google/cloud/tasks/v2/cloudtasks.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tasks_v2_internal { @@ -241,3 +244,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tasks_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_logging_decorator.h b/google/cloud/tasks/v2/internal/cloud_tasks_logging_decorator.h index 788e19752d643..a674d45152fc5 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_logging_decorator.h +++ b/google/cloud/tasks/v2/internal/cloud_tasks_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tasks_v2_internal { @@ -120,4 +123,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_V2_INTERNAL_CLOUD_TASKS_LOGGING_DECORATOR_H diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_metadata_decorator.cc b/google/cloud/tasks/v2/internal/cloud_tasks_metadata_decorator.cc index 1a3cfdd3397cd..4d8ab7e5a8a40 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_metadata_decorator.cc +++ b/google/cloud/tasks/v2/internal/cloud_tasks_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/tasks/v2/cloudtasks.proto #include "google/cloud/tasks/v2/internal/cloud_tasks_metadata_decorator.h" +#include "google/cloud/tasks/v2/cloudtasks.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 tasks_v2_internal { @@ -213,3 +217,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tasks_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_metadata_decorator.h b/google/cloud/tasks/v2/internal/cloud_tasks_metadata_decorator.h index 626a35bdeec57..f36779911c60d 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_metadata_decorator.h +++ b/google/cloud/tasks/v2/internal/cloud_tasks_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tasks_v2_internal { @@ -125,4 +128,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_V2_INTERNAL_CLOUD_TASKS_METADATA_DECORATOR_H diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_option_defaults.cc b/google/cloud/tasks/v2/internal/cloud_tasks_option_defaults.cc index 58573f51fb7eb..588e31d09a430 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_option_defaults.cc +++ b/google/cloud/tasks/v2/internal/cloud_tasks_option_defaults.cc @@ -40,7 +40,7 @@ Options CloudTasksDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - tasks_v2::CloudTasksLimitedTimeRetryPolicy(std::chrono::minutes(30)) + tasks_v2::CloudTasksLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_stub.cc b/google/cloud/tasks/v2/internal/cloud_tasks_stub.cc index c7a73208b91c4..bf375bd55f212 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_stub.cc +++ b/google/cloud/tasks/v2/internal/cloud_tasks_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/tasks/v2/cloudtasks.proto #include "google/cloud/tasks/v2/internal/cloud_tasks_stub.h" +#include "google/cloud/tasks/v2/cloudtasks.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tasks_v2_internal { @@ -236,3 +239,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tasks_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_stub.h b/google/cloud/tasks/v2/internal/cloud_tasks_stub.h index d7e1e127ad115..a26bff9a31832 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_stub.h +++ b/google/cloud/tasks/v2/internal/cloud_tasks_stub.h @@ -19,14 +19,17 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_V2_INTERNAL_CLOUD_TASKS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_V2_INTERNAL_CLOUD_TASKS_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/tasks/v2/cloudtasks.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tasks_v2_internal { @@ -205,4 +208,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_V2_INTERNAL_CLOUD_TASKS_STUB_H diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_stub_factory.cc b/google/cloud/tasks/v2/internal/cloud_tasks_stub_factory.cc index dbbd6afdf312a..e5611ec90466c 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_stub_factory.cc +++ b/google/cloud/tasks/v2/internal/cloud_tasks_stub_factory.cc @@ -17,6 +17,8 @@ // source: google/cloud/tasks/v2/cloudtasks.proto #include "google/cloud/tasks/v2/internal/cloud_tasks_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/tasks/v2/cloudtasks.grpc.pb.h" #include "google/cloud/tasks/v2/internal/cloud_tasks_auth_decorator.h" #include "google/cloud/tasks/v2/internal/cloud_tasks_logging_decorator.h" #include "google/cloud/tasks/v2/internal/cloud_tasks_metadata_decorator.h" @@ -28,11 +30,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tasks_v2_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tasks_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_stub_factory.h b/google/cloud/tasks/v2/internal/cloud_tasks_stub_factory.h index 81b405d1d66d6..c0ae439409c63 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_stub_factory.h +++ b/google/cloud/tasks/v2/internal/cloud_tasks_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tasks_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_V2_INTERNAL_CLOUD_TASKS_STUB_FACTORY_H diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_tracing_connection.cc b/google/cloud/tasks/v2/internal/cloud_tasks_tracing_connection.cc index b6883c748253e..579d01272fe95 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_tracing_connection.cc +++ b/google/cloud/tasks/v2/internal/cloud_tasks_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace tasks_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudTasksTracingConnection::CloudTasksTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -180,15 +178,11 @@ CloudTasksTracingConnection::GetLocation( return internal::EndSpan(*span, child_->GetLocation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudTasksTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_tracing_connection.h b/google/cloud/tasks/v2/internal/cloud_tasks_tracing_connection.h index 2fa5dd5501dee..a15e9424d61ba 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_tracing_connection.h +++ b/google/cloud/tasks/v2/internal/cloud_tasks_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace tasks_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudTasksTracingConnection : public tasks_v2::CloudTasksConnection { public: ~CloudTasksTracingConnection() override = default; @@ -97,8 +95,6 @@ class CloudTasksTracingConnection : public tasks_v2::CloudTasksConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_tracing_stub.cc b/google/cloud/tasks/v2/internal/cloud_tasks_tracing_stub.cc index 89dd0cab8d078..f7dc9b087f2db 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_tracing_stub.cc +++ b/google/cloud/tasks/v2/internal/cloud_tasks_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tasks_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - CloudTasksTracingStub::CloudTasksTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -234,18 +235,14 @@ StatusOr CloudTasksTracingStub::GetLocation( child_->GetLocation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeCloudTasksTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tasks_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tasks/v2/internal/cloud_tasks_tracing_stub.h b/google/cloud/tasks/v2/internal/cloud_tasks_tracing_stub.h index a66d4c13de48a..97d9885a5e865 100644 --- a/google/cloud/tasks/v2/internal/cloud_tasks_tracing_stub.h +++ b/google/cloud/tasks/v2/internal/cloud_tasks_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tasks_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class CloudTasksTracingStub : public CloudTasksStub { public: ~CloudTasksTracingStub() override = default; @@ -116,8 +117,6 @@ class CloudTasksTracingStub : public CloudTasksStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -132,4 +131,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TASKS_V2_INTERNAL_CLOUD_TASKS_TRACING_STUB_H diff --git a/google/cloud/telcoautomation/BUILD.bazel b/google/cloud/telcoautomation/BUILD.bazel index 4cdc3d8937fb6..bf9d33b2305f1 100644 --- a/google/cloud/telcoautomation/BUILD.bazel +++ b/google/cloud/telcoautomation/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/telcoautomation/v1:telcoautomation_cc_grpc", + "@googleapis//google/cloud/telcoautomation/v1:telcoautomation_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/telcoautomation/quickstart/.bazelrc b/google/cloud/telcoautomation/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/telcoautomation/quickstart/.bazelrc +++ b/google/cloud/telcoautomation/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/telcoautomation/quickstart/CMakeLists.txt index 9b5e8f711b9a4..abbfbc549d9eb 100644 --- a/google/cloud/telcoautomation/quickstart/CMakeLists.txt +++ b/google/cloud/telcoautomation/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Telco Automation API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-telcoautomation-quickstart CXX) find_package(google_cloud_cpp_telcoautomation REQUIRED) diff --git a/google/cloud/telcoautomation/quickstart/WORKSPACE.bazel b/google/cloud/telcoautomation/quickstart/WORKSPACE.bazel index 2be1ea268f7eb..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 = "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/telcoautomation/v1/internal/telco_automation_auth_decorator.cc b/google/cloud/telcoautomation/v1/internal/telco_automation_auth_decorator.cc index bd1e54a18243d..cdae585011640 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_auth_decorator.cc +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/telcoautomation/v1/telcoautomation.proto #include "google/cloud/telcoautomation/v1/internal/telco_automation_auth_decorator.h" -#include +#include "google/cloud/telcoautomation/v1/telcoautomation.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace telcoautomation_v1_internal { @@ -546,3 +549,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace telcoautomation_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_auth_decorator.h b/google/cloud/telcoautomation/v1/internal/telco_automation_auth_decorator.h index 460628f125fb3..618b19551a22b 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_auth_decorator.h +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/telcoautomation/v1/internal/telco_automation_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 telcoautomation_v1_internal { @@ -314,4 +317,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TELCOAUTOMATION_V1_INTERNAL_TELCO_AUTOMATION_AUTH_DECORATOR_H diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_connection_impl.h b/google/cloud/telcoautomation/v1/internal/telco_automation_connection_impl.h index aa1d2809d2774..8f83c7bff1391 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_connection_impl.h +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_logging_decorator.cc b/google/cloud/telcoautomation/v1/internal/telco_automation_logging_decorator.cc index d1cbf6290a4ea..f22e1f062f620 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_logging_decorator.cc +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/telcoautomation/v1/telcoautomation.proto #include "google/cloud/telcoautomation/v1/internal/telco_automation_logging_decorator.h" +#include "google/cloud/telcoautomation/v1/telcoautomation.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace telcoautomation_v1_internal { @@ -710,3 +713,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace telcoautomation_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_logging_decorator.h b/google/cloud/telcoautomation/v1/internal/telco_automation_logging_decorator.h index 0892b0f4adb30..5bed8a96871eb 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_logging_decorator.h +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/telcoautomation/v1/internal/telco_automation_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 telcoautomation_v1_internal { @@ -314,4 +317,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TELCOAUTOMATION_V1_INTERNAL_TELCO_AUTOMATION_LOGGING_DECORATOR_H diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_metadata_decorator.cc b/google/cloud/telcoautomation/v1/internal/telco_automation_metadata_decorator.cc index 353454701f5f8..5d832cb3664de 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_metadata_decorator.cc +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/telcoautomation/v1/telcoautomation.proto #include "google/cloud/telcoautomation/v1/internal/telco_automation_metadata_decorator.h" +#include "google/cloud/telcoautomation/v1/telcoautomation.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 telcoautomation_v1_internal { @@ -532,3 +536,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace telcoautomation_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_metadata_decorator.h b/google/cloud/telcoautomation/v1/internal/telco_automation_metadata_decorator.h index f7bd774a06192..cb9aac026a8e3 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_metadata_decorator.h +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/telcoautomation/v1/internal/telco_automation_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 telcoautomation_v1_internal { @@ -320,4 +323,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TELCOAUTOMATION_V1_INTERNAL_TELCO_AUTOMATION_METADATA_DECORATOR_H diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_option_defaults.cc b/google/cloud/telcoautomation/v1/internal/telco_automation_option_defaults.cc index a50d6cd9f0be7..cdfb9a2050ed9 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_option_defaults.cc +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_option_defaults.cc @@ -42,7 +42,7 @@ Options TelcoAutomationDefaultOptions(Options options) { if (!options.has()) { options.set( telcoautomation_v1::TelcoAutomationLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_stub.cc b/google/cloud/telcoautomation/v1/internal/telco_automation_stub.cc index 82497e9d4c9a9..1d7573a0f437e 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_stub.cc +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/telcoautomation/v1/telcoautomation.proto #include "google/cloud/telcoautomation/v1/internal/telco_automation_stub.h" +#include "google/cloud/telcoautomation/v1/telcoautomation.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace telcoautomation_v1_internal { @@ -693,3 +696,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace telcoautomation_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_stub.h b/google/cloud/telcoautomation/v1/internal/telco_automation_stub.h index 6c64e010d42e4..2b06119149bfb 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_stub.h +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TELCOAUTOMATION_V1_INTERNAL_TELCO_AUTOMATION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TELCOAUTOMATION_V1_INTERNAL_TELCO_AUTOMATION_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/telcoautomation/v1/telcoautomation.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace telcoautomation_v1_internal { @@ -616,4 +619,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TELCOAUTOMATION_V1_INTERNAL_TELCO_AUTOMATION_STUB_H diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_stub_factory.cc b/google/cloud/telcoautomation/v1/internal/telco_automation_stub_factory.cc index 4a4d3f044b29a..4408db23af279 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_stub_factory.cc +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/telcoautomation/v1/telcoautomation.proto #include "google/cloud/telcoautomation/v1/internal/telco_automation_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/telcoautomation/v1/internal/telco_automation_auth_decorator.h" #include "google/cloud/telcoautomation/v1/internal/telco_automation_logging_decorator.h" #include "google/cloud/telcoautomation/v1/internal/telco_automation_metadata_decorator.h" #include "google/cloud/telcoautomation/v1/internal/telco_automation_stub.h" #include "google/cloud/telcoautomation/v1/internal/telco_automation_tracing_stub.h" +#include "google/cloud/telcoautomation/v1/telcoautomation.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace telcoautomation_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace telcoautomation_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_stub_factory.h b/google/cloud/telcoautomation/v1/internal/telco_automation_stub_factory.h index 21319bbdfff1c..8e3e7e117fff6 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_stub_factory.h +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace telcoautomation_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TELCOAUTOMATION_V1_INTERNAL_TELCO_AUTOMATION_STUB_FACTORY_H diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_connection.cc b/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_connection.cc index e24692f02b9c7..7bcde18a0528e 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_connection.cc +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace telcoautomation_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TelcoAutomationTracingConnection::TelcoAutomationTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -557,16 +555,12 @@ Status TelcoAutomationTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTelcoAutomationTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_connection.h b/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_connection.h index 21247b09f36bc..f854a89f21abb 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_connection.h +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace telcoautomation_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TelcoAutomationTracingConnection : public telcoautomation_v1::TelcoAutomationConnection { public: @@ -256,8 +254,6 @@ class TelcoAutomationTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_stub.cc b/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_stub.cc index dc70da756a8d2..4bdccd6f113e2 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_stub.cc +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace telcoautomation_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TelcoAutomationTracingStub::TelcoAutomationTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -675,18 +676,14 @@ future TelcoAutomationTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTelcoAutomationTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace telcoautomation_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_stub.h b/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_stub.h index 3c61f49821850..61d63dea273e2 100644 --- a/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_stub.h +++ b/google/cloud/telcoautomation/v1/internal/telco_automation_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace telcoautomation_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TelcoAutomationTracingStub : public TelcoAutomationStub { public: ~TelcoAutomationTracingStub() override = default; @@ -310,8 +311,6 @@ class TelcoAutomationTracingStub : public TelcoAutomationStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -326,4 +325,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TELCOAUTOMATION_V1_INTERNAL_TELCO_AUTOMATION_TRACING_STUB_H diff --git a/google/cloud/telcoautomation/v1/telco_automation_client.h b/google/cloud/telcoautomation/v1/telco_automation_client.h index 89558d25a5931..dc6f073631a3b 100644 --- a/google/cloud/telcoautomation/v1/telco_automation_client.h +++ b/google/cloud/telcoautomation/v1/telco_automation_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/telcoautomation/v1/telco_automation_connection.h b/google/cloud/telcoautomation/v1/telco_automation_connection.h index 5760f41a94e74..ba4b84d74e49a 100644 --- a/google/cloud/telcoautomation/v1/telco_automation_connection.h +++ b/google/cloud/telcoautomation/v1/telco_automation_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/telcoautomation/v1/internal/telco_automation_retry_traits.h" #include "google/cloud/telcoautomation/v1/telco_automation_connection_idempotency_policy.h" +#include "google/cloud/telcoautomation/v1/telcoautomation.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/telcoautomation/v1/telco_automation_connection_idempotency_policy.h b/google/cloud/telcoautomation/v1/telco_automation_connection_idempotency_policy.h index 712c176f3915d..05c0d7f629d93 100644 --- a/google/cloud/telcoautomation/v1/telco_automation_connection_idempotency_policy.h +++ b/google/cloud/telcoautomation/v1/telco_automation_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TELCOAUTOMATION_V1_TELCO_AUTOMATION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TELCOAUTOMATION_V1_TELCO_AUTOMATION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/telcoautomation/v1/telcoautomation.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/testing_util/BUILD.bazel b/google/cloud/testing_util/BUILD.bazel index 5178fec5676e4..2deae82a3675b 100644 --- a/google/cloud/testing_util/BUILD.bazel +++ b/google/cloud/testing_util/BUILD.bazel @@ -41,27 +41,22 @@ cc_library( }), deps = [ "//:common", - "@com_google_absl//absl/debugging:failure_signal_handler", - "@com_google_absl//absl/debugging:symbolize", - "@com_google_googletest//:gtest_main", - ] + select({ - "//google/cloud:enable_opentelemetry": [ - "@io_opentelemetry_cpp//exporters/memory:in_memory_span_exporter", - "@io_opentelemetry_cpp//sdk/src/trace", - ], - "//conditions:default": [], - }), + "@abseil-cpp//absl/debugging:failure_signal_handler", + "@abseil-cpp//absl/debugging:symbolize", + "@googletest//:gtest_main", + "@opentelemetry-cpp//exporters/memory:in_memory_span_exporter", + "@opentelemetry-cpp//sdk/src/trace", + ], ) cc_library( name = "google_cloud_cpp_testing", testonly = True, - deprecation = """ - This target is deprecated and will be removed on or after 2023-04-01. More - info: https://github.com/googleapis/google-cloud-cpp/issues/3701 - """, tags = ["manual"], - visibility = ["//visibility:public"], + visibility = [ + ":__subpackages__", + "//:__pkg__", + ], deps = [":google_cloud_cpp_testing_private"], ) @@ -71,7 +66,7 @@ cc_library( deps = [ ":google_cloud_cpp_testing", "//:common", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) for test in google_cloud_cpp_testing_unit_tests] @@ -83,11 +78,11 @@ cc_library( deps = [ "//:common", "//:grpc_utils", - "@com_github_grpc_grpc//:grpc++", - "@com_google_googleapis//:googleapis_system_includes", - "@com_google_googleapis//google/api:annotations_cc_proto", - "@com_google_googleapis//google/api:routing_cc_proto", - "@com_google_googletest//:gtest_main", + "@grpc//:grpc++", + # "@googleapis//:googleapis_system_includes", + "@googleapis//google/api:annotations_cc_proto", + "@googleapis//google/api:routing_cc_proto", + "@googletest//:gtest_main", "@com_google_protobuf//:protobuf", ], ) @@ -95,12 +90,11 @@ cc_library( cc_library( name = "google_cloud_cpp_testing_grpc", testonly = True, - deprecation = """ - This target is deprecated and will be removed on or after 2023-04-01. More - info: https://github.com/googleapis/google-cloud-cpp/issues/3701 - """, tags = ["manual"], - visibility = ["//visibility:public"], + visibility = [ + ":__subpackages__", + "//:__pkg__", + ], deps = [":google_cloud_cpp_testing_grpc_private"], ) @@ -110,8 +104,8 @@ cc_library( deps = [ ":google_cloud_cpp_testing_grpc", "//:common", - "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@googletest//:gtest_main", ], ) for test in google_cloud_cpp_testing_grpc_unit_tests] @@ -122,18 +116,17 @@ cc_library( hdrs = google_cloud_cpp_testing_rest_hdrs, deps = [ "//google/cloud:google_cloud_cpp_rest_internal", - "@com_google_googletest//:gtest_main", + "@googletest//:gtest_main", ], ) cc_library( name = "google_cloud_cpp_testing_rest", testonly = True, - deprecation = """ - This target is deprecated and will be removed on or after 2023-04-01. More - info: https://github.com/googleapis/google-cloud-cpp/issues/3701 - """, tags = ["manual"], - visibility = ["//visibility:public"], + visibility = [ + ":__subpackages__", + "//:__pkg__", + ], deps = [":google_cloud_cpp_testing_rest_private"], ) diff --git a/google/cloud/testing_util/CMakeLists.txt b/google/cloud/testing_util/CMakeLists.txt index 79f02b6249e55..8028f70d70284 100644 --- a/google/cloud/testing_util/CMakeLists.txt +++ b/google/cloud/testing_util/CMakeLists.txt @@ -57,14 +57,10 @@ add_library( timer.h) target_link_libraries( google_cloud_cpp_testing - PUBLIC absl::symbolize absl::failure_signal_handler - google-cloud-cpp::common GTest::gmock) -if (opentelemetry-cpp_FOUND) - target_link_libraries( - google_cloud_cpp_testing - PRIVATE opentelemetry-cpp::in_memory_span_exporter - opentelemetry-cpp::trace) -endif () + PUBLIC absl::symbolize absl::failure_signal_handler google-cloud-cpp::common + GTest::gmock + PRIVATE opentelemetry-cpp::in_memory_span_exporter opentelemetry-cpp::trace) + google_cloud_cpp_add_common_options(google_cloud_cpp_testing) include(CheckCXXSymbolExists) 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/testing_util/credentials.h b/google/cloud/testing_util/credentials.h index 593d568d9fde5..1aca048ccb02f 100644 --- a/google/cloud/testing_util/credentials.h +++ b/google/cloud/testing_util/credentials.h @@ -53,7 +53,11 @@ struct TestCredentialsVisitor : public internal::CredentialsVisitor { } void visit(internal::ServiceAccountConfig const& cfg) override { name = "ServiceAccountConfig"; - json_object = cfg.json_object(); + if (cfg.json_object()) { + json_object = *cfg.json_object(); + } else { + json_object = "cfg.file_path testing not implemented"; + } } void visit(internal::ExternalAccountConfig const& cfg) override { name = "ExternalAccountConfig"; diff --git a/google/cloud/testing_util/is_proto_equal_test.cc b/google/cloud/testing_util/is_proto_equal_test.cc index b13524b65589b..05f78ad4f9f2a 100644 --- a/google/cloud/testing_util/is_proto_equal_test.cc +++ b/google/cloud/testing_util/is_proto_equal_test.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "google/cloud/testing_util/is_proto_equal.h" -#include +#include "google/protobuf/wrappers.pb.h" #include namespace google { diff --git a/google/cloud/testing_util/opentelemetry_matchers.cc b/google/cloud/testing_util/opentelemetry_matchers.cc index 86bcdaa2afa82..175e8b1a11b54 100644 --- a/google/cloud/testing_util/opentelemetry_matchers.cc +++ b/google/cloud/testing_util/opentelemetry_matchers.cc @@ -12,17 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/testing_util/opentelemetry_matchers.h" -#include "google/cloud/internal/absl_str_join_quiet.h" #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/internal/opentelemetry_context.h" #include "google/cloud/opentelemetry_options.h" +#include "absl/strings/str_join.h" #include #include #include #include #include +#include namespace { @@ -38,7 +38,6 @@ void AttributeFormatter( *out += "bool:"; *out += v ? "true" : "false"; } - void operator()(double v) const { *out += "double:" + std::to_string(v); } void operator()(std::int32_t v) const { *out += "std::int32_t:" + std::to_string(v); } @@ -48,9 +47,7 @@ void AttributeFormatter( void operator()(std::int64_t v) const { *out += "std::int64_t:" + std::to_string(v); } - void operator()(std::uint64_t v) const { - *out += "std::uint64_t:" + std::to_string(v); - } + void operator()(double v) const { *out += "double:" + std::to_string(v); } void operator()(std::string const& v) const { *out += "std::string:" + v; } void operator()(std::vector const& v) const { auto format = [](std::string* out, bool b) { @@ -58,16 +55,6 @@ void AttributeFormatter( }; *out += "std::vector:[" + absl::StrJoin(v, ", ", format) + "]"; } - void operator()(std::vector const& v) const { - *out += "std::vector:[" + absl::StrJoin(v, ", ") + "]"; - } - void operator()(std::vector const& v) const { - *out += "std::vector:[" + absl::StrJoin(v, ", ") + "]"; - } - void operator()(std::vector const& v) const { - *out += "std::vector:[" + absl::StrJoin(v, ", ") + "]"; - ; - } void operator()(std::vector const& v) const { *out += "std::vector:[" + absl::StrJoin(v, ", ") + "]"; } @@ -77,11 +64,23 @@ void AttributeFormatter( void operator()(std::vector const& v) const { *out += "std::vector:[" + absl::StrJoin(v, ", ") + "]"; } + void operator()(std::vector const& v) const { + *out += "std::vector:[" + absl::StrJoin(v, ", ") + "]"; + } + void operator()(std::vector const& v) const { + *out += "std::vector:[" + absl::StrJoin(v, ", ") + "]"; + } + void operator()(std::uint64_t v) const { + *out += "std::uint64_t:" + std::to_string(v); + } void operator()(std::vector const& v) const { *out += "std::vector:[" + absl::StrJoin(v, ", ") + "]"; } + void operator()(std::vector const& v) const { + *out += "std::vector:[" + absl::StrJoin(v, ", ") + "]"; + } }; - absl::visit(Visitor{out}, kv.second); + std::visit(Visitor{out}, kv.second); } } // namespace @@ -223,4 +222,3 @@ Options DisableTracing(Options options) { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY diff --git a/google/cloud/testing_util/opentelemetry_matchers.h b/google/cloud/testing_util/opentelemetry_matchers.h index 95fe7aeba92b3..885eb5fdcafa7 100644 --- a/google/cloud/testing_util/opentelemetry_matchers.h +++ b/google/cloud/testing_util/opentelemetry_matchers.h @@ -15,7 +15,6 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TESTING_UTIL_OPENTELEMETRY_MATCHERS_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TESTING_UTIL_OPENTELEMETRY_MATCHERS_H -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #include "google/cloud/future.h" #include "google/cloud/internal/opentelemetry_context.h" #include "google/cloud/options.h" @@ -403,6 +402,5 @@ class PromiseWithOTelContext { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TESTING_UTIL_OPENTELEMETRY_MATCHERS_H diff --git a/google/cloud/testing_util/validate_metadata.cc b/google/cloud/testing_util/validate_metadata.cc index 2744da532f331..229089b752535 100644 --- a/google/cloud/testing_util/validate_metadata.cc +++ b/google/cloud/testing_util/validate_metadata.cc @@ -13,15 +13,15 @@ // limitations under the License. #include "google/cloud/testing_util/validate_metadata.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/absl_str_replace_quiet.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/log.h" #include "google/cloud/status_or.h" #include "absl/meta/type_traits.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_replace.h" #include "absl/strings/str_split.h" -#include -#include +#include "google/api/annotations.pb.h" +#include "google/api/routing.pb.h" #include #include #include diff --git a/google/cloud/texttospeech/BUILD.bazel b/google/cloud/texttospeech/BUILD.bazel index 912007a22e151..6454144ad675a 100644 --- a/google/cloud/texttospeech/BUILD.bazel +++ b/google/cloud/texttospeech/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/texttospeech/v1:texttospeech_cc_grpc", + "@googleapis//google/cloud/texttospeech/v1:texttospeech_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/texttospeech/CMakeLists.txt b/google/cloud/texttospeech/CMakeLists.txt index 080dcedb32e4d..5535b0583c3d6 100644 --- a/google/cloud/texttospeech/CMakeLists.txt +++ b/google/cloud/texttospeech/CMakeLists.txt @@ -18,7 +18,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( texttospeech "Cloud Text-to-Speech API" - SERVICE_DIRS "__EMPTY__" "v1/" + SERVICE_DIRS "v1/" BACKWARDS_COMPAT_PROTO_TARGETS "cloud_texttospeech_protos") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) diff --git a/google/cloud/texttospeech/mocks/mock_text_to_speech_connection.h b/google/cloud/texttospeech/mocks/mock_text_to_speech_connection.h deleted file mode 100644 index 394b1166049ff..0000000000000 --- a/google/cloud/texttospeech/mocks/mock_text_to_speech_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/texttospeech/v1/cloud_tts.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_MOCKS_MOCK_TEXT_TO_SPEECH_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_MOCKS_MOCK_TEXT_TO_SPEECH_CONNECTION_H - -#include "google/cloud/texttospeech/text_to_speech_connection.h" -#include "google/cloud/texttospeech/v1/mocks/mock_text_to_speech_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in texttospeech_v1_mocks instead of the aliases -/// defined in this namespace. -namespace texttospeech_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use texttospeech_v1_mocks::MockTextToSpeechConnection directly. -using ::google::cloud::texttospeech_v1_mocks::MockTextToSpeechConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace texttospeech_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_MOCKS_MOCK_TEXT_TO_SPEECH_CONNECTION_H diff --git a/google/cloud/texttospeech/quickstart/.bazelrc b/google/cloud/texttospeech/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/texttospeech/quickstart/.bazelrc +++ b/google/cloud/texttospeech/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/texttospeech/quickstart/CMakeLists.txt index 9ad5abd9c5bce..fac3d39b81942 100644 --- a/google/cloud/texttospeech/quickstart/CMakeLists.txt +++ b/google/cloud/texttospeech/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Text-to-Speech API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-texttospeech-quickstart CXX) find_package(google_cloud_cpp_texttospeech REQUIRED) diff --git a/google/cloud/texttospeech/quickstart/WORKSPACE.bazel b/google/cloud/texttospeech/quickstart/WORKSPACE.bazel index f998118e30789..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 = "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/texttospeech/text_to_speech_client.h b/google/cloud/texttospeech/text_to_speech_client.h deleted file mode 100644 index c05b03d8a3b6c..0000000000000 --- a/google/cloud/texttospeech/text_to_speech_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/texttospeech/v1/cloud_tts.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_TEXT_TO_SPEECH_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_TEXT_TO_SPEECH_CLIENT_H - -#include "google/cloud/texttospeech/text_to_speech_connection.h" -#include "google/cloud/texttospeech/v1/text_to_speech_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in texttospeech_v1 instead of the aliases defined in -/// this namespace. -namespace texttospeech { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use texttospeech_v1::TextToSpeechClient directly. -using ::google::cloud::texttospeech_v1::TextToSpeechClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace texttospeech -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_TEXT_TO_SPEECH_CLIENT_H diff --git a/google/cloud/texttospeech/text_to_speech_connection.h b/google/cloud/texttospeech/text_to_speech_connection.h deleted file mode 100644 index f05a635007bc9..0000000000000 --- a/google/cloud/texttospeech/text_to_speech_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/texttospeech/v1/cloud_tts.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_TEXT_TO_SPEECH_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_TEXT_TO_SPEECH_CONNECTION_H - -#include "google/cloud/texttospeech/text_to_speech_connection_idempotency_policy.h" -#include "google/cloud/texttospeech/v1/text_to_speech_connection.h" - -namespace google { -namespace cloud { -namespace texttospeech { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use texttospeech_v1::MakeTextToSpeechConnection directly. -using ::google::cloud::texttospeech_v1::MakeTextToSpeechConnection; - -/// @deprecated Use texttospeech_v1::TextToSpeechConnection directly. -using ::google::cloud::texttospeech_v1::TextToSpeechConnection; - -/// @deprecated Use texttospeech_v1::TextToSpeechLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::texttospeech_v1:: - TextToSpeechLimitedErrorCountRetryPolicy; - -/// @deprecated Use texttospeech_v1::TextToSpeechLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::texttospeech_v1::TextToSpeechLimitedTimeRetryPolicy; - -/// @deprecated Use texttospeech_v1::TextToSpeechRetryPolicy directly. -using ::google::cloud::texttospeech_v1::TextToSpeechRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace texttospeech -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_TEXT_TO_SPEECH_CONNECTION_H diff --git a/google/cloud/texttospeech/text_to_speech_connection_idempotency_policy.h b/google/cloud/texttospeech/text_to_speech_connection_idempotency_policy.h deleted file mode 100644 index 84263e946f763..0000000000000 --- a/google/cloud/texttospeech/text_to_speech_connection_idempotency_policy.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/texttospeech/v1/cloud_tts.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_TEXT_TO_SPEECH_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_TEXT_TO_SPEECH_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/texttospeech/v1/text_to_speech_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace texttospeech { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// texttospeech_v1::MakeDefaultTextToSpeechConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::texttospeech_v1:: - MakeDefaultTextToSpeechConnectionIdempotencyPolicy; - -/// @deprecated Use texttospeech_v1::TextToSpeechConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::texttospeech_v1::TextToSpeechConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace texttospeech -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_TEXT_TO_SPEECH_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/texttospeech/text_to_speech_options.h b/google/cloud/texttospeech/text_to_speech_options.h deleted file mode 100644 index 64753be7e04db..0000000000000 --- a/google/cloud/texttospeech/text_to_speech_options.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/texttospeech/v1/cloud_tts.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_TEXT_TO_SPEECH_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_TEXT_TO_SPEECH_OPTIONS_H - -#include "google/cloud/texttospeech/text_to_speech_connection.h" -#include "google/cloud/texttospeech/text_to_speech_connection_idempotency_policy.h" -#include "google/cloud/texttospeech/v1/text_to_speech_options.h" - -namespace google { -namespace cloud { -namespace texttospeech { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use texttospeech_v1::TextToSpeechBackoffPolicyOption directly. -using ::google::cloud::texttospeech_v1::TextToSpeechBackoffPolicyOption; - -/// @deprecated Use -/// texttospeech_v1::TextToSpeechConnectionIdempotencyPolicyOption directly. -using ::google::cloud::texttospeech_v1:: - TextToSpeechConnectionIdempotencyPolicyOption; - -/// @deprecated Use texttospeech_v1::TextToSpeechPolicyOptionList directly. -using ::google::cloud::texttospeech_v1::TextToSpeechPolicyOptionList; - -/// @deprecated Use texttospeech_v1::TextToSpeechRetryPolicyOption directly. -using ::google::cloud::texttospeech_v1::TextToSpeechRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace texttospeech -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_TEXT_TO_SPEECH_OPTIONS_H diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_auth_decorator.cc b/google/cloud/texttospeech/v1/internal/text_to_speech_auth_decorator.cc index c2b88730af878..7be6d2e622279 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_auth_decorator.cc +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_auth_decorator.cc @@ -17,11 +17,14 @@ // source: google/cloud/texttospeech/v1/cloud_tts.proto #include "google/cloud/texttospeech/v1/internal/text_to_speech_auth_decorator.h" +#include "google/cloud/texttospeech/v1/cloud_tts.grpc.pb.h" #include "google/cloud/internal/async_read_write_stream_auth.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace texttospeech_v1_internal { @@ -90,3 +93,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace texttospeech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_auth_decorator.h b/google/cloud/texttospeech/v1/internal/text_to_speech_auth_decorator.h index 4c6923c587ba6..7ab1dacee8347 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_auth_decorator.h +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace texttospeech_v1_internal { @@ -75,4 +78,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_V1_INTERNAL_TEXT_TO_SPEECH_AUTH_DECORATOR_H diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_logging_decorator.cc b/google/cloud/texttospeech/v1/internal/text_to_speech_logging_decorator.cc index 589b6f78db9c5..2f87b44a411c0 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_logging_decorator.cc +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_logging_decorator.cc @@ -17,15 +17,18 @@ // source: google/cloud/texttospeech/v1/cloud_tts.proto #include "google/cloud/texttospeech/v1/internal/text_to_speech_logging_decorator.h" +#include "google/cloud/texttospeech/v1/cloud_tts.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace texttospeech_v1_internal { @@ -114,3 +117,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace texttospeech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_logging_decorator.h b/google/cloud/texttospeech/v1/internal/text_to_speech_logging_decorator.h index 88c8d7960540d..93d44b62f36bf 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_logging_decorator.h +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace texttospeech_v1_internal { @@ -76,4 +79,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_V1_INTERNAL_TEXT_TO_SPEECH_LOGGING_DECORATOR_H diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_metadata_decorator.cc b/google/cloud/texttospeech/v1/internal/text_to_speech_metadata_decorator.cc index 6207b7735cd2b..fe5c66af7117f 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_metadata_decorator.cc +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/texttospeech/v1/cloud_tts.proto #include "google/cloud/texttospeech/v1/internal/text_to_speech_metadata_decorator.h" +#include "google/cloud/texttospeech/v1/cloud_tts.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 texttospeech_v1_internal { @@ -106,3 +110,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace texttospeech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_metadata_decorator.h b/google/cloud/texttospeech/v1/internal/text_to_speech_metadata_decorator.h index 383518e041099..242d531bb96ef 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_metadata_decorator.h +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace texttospeech_v1_internal { @@ -80,4 +83,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_V1_INTERNAL_TEXT_TO_SPEECH_METADATA_DECORATOR_H diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_option_defaults.cc b/google/cloud/texttospeech/v1/internal/text_to_speech_option_defaults.cc index d94afbfea8236..13408f2d12a49 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_option_defaults.cc +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_option_defaults.cc @@ -42,7 +42,7 @@ Options TextToSpeechDefaultOptions(Options options) { if (!options.has()) { options.set( texttospeech_v1::TextToSpeechLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_stub.cc b/google/cloud/texttospeech/v1/internal/text_to_speech_stub.cc index 3cb7412ef4be2..676fdcd1d9660 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_stub.cc +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/texttospeech/v1/cloud_tts.proto #include "google/cloud/texttospeech/v1/internal/text_to_speech_stub.h" +#include "google/cloud/texttospeech/v1/cloud_tts.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 #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace texttospeech_v1_internal { @@ -98,3 +101,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace texttospeech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_stub.h b/google/cloud/texttospeech/v1/internal/text_to_speech_stub.h index d18599cfc12a9..bc66d83d3555d 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_stub.h +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_V1_INTERNAL_TEXT_TO_SPEECH_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_V1_INTERNAL_TEXT_TO_SPEECH_STUB_H +#include "google/cloud/texttospeech/v1/cloud_tts.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace texttospeech_v1_internal { @@ -116,4 +119,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_V1_INTERNAL_TEXT_TO_SPEECH_STUB_H diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_stub_factory.cc b/google/cloud/texttospeech/v1/internal/text_to_speech_stub_factory.cc index 3317a73025a3f..d121f448792dc 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_stub_factory.cc +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/texttospeech/v1/cloud_tts.proto #include "google/cloud/texttospeech/v1/internal/text_to_speech_stub_factory.h" +#include "google/cloud/texttospeech/v1/cloud_tts.grpc.pb.h" #include "google/cloud/texttospeech/v1/internal/text_to_speech_auth_decorator.h" #include "google/cloud/texttospeech/v1/internal/text_to_speech_logging_decorator.h" #include "google/cloud/texttospeech/v1/internal/text_to_speech_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace texttospeech_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace texttospeech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_stub_factory.h b/google/cloud/texttospeech/v1/internal/text_to_speech_stub_factory.h index ee730e65bf883..60387d74473f6 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_stub_factory.h +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace texttospeech_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_V1_INTERNAL_TEXT_TO_SPEECH_STUB_FACTORY_H diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_connection.cc b/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_connection.cc index a56f96b2c7a09..f3a6db8f32503 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_connection.cc +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace texttospeech_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TextToSpeechTracingConnection::TextToSpeechTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -78,16 +76,12 @@ TextToSpeechTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTextToSpeechTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_connection.h b/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_connection.h index 4ce81470d193d..14faf220546ad 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_connection.h +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace texttospeech_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TextToSpeechTracingConnection : public texttospeech_v1::TextToSpeechConnection { public: @@ -64,8 +62,6 @@ class TextToSpeechTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_stub.cc b/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_stub.cc index 7eb555f5f322f..9b711cac57af6 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_stub.cc +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_stub.cc @@ -22,13 +22,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace texttospeech_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TextToSpeechTracingStub::TextToSpeechTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -98,18 +99,14 @@ StatusOr TextToSpeechTracingStub::GetOperation( child_->GetOperation(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTextToSpeechTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace texttospeech_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_stub.h b/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_stub.h index 9990f8fd8e390..76ba7f6d2cf94 100644 --- a/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_stub.h +++ b/google/cloud/texttospeech/v1/internal/text_to_speech_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace texttospeech_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TextToSpeechTracingStub : public TextToSpeechStub { public: ~TextToSpeechTracingStub() override = default; @@ -71,8 +72,6 @@ class TextToSpeechTracingStub : public TextToSpeechStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -87,4 +86,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_V1_INTERNAL_TEXT_TO_SPEECH_TRACING_STUB_H 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/texttospeech/v1/text_to_speech_connection.h b/google/cloud/texttospeech/v1/text_to_speech_connection.h index f99e459840639..a6f5e14218de8 100644 --- a/google/cloud/texttospeech/v1/text_to_speech_connection.h +++ b/google/cloud/texttospeech/v1/text_to_speech_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_V1_TEXT_TO_SPEECH_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_V1_TEXT_TO_SPEECH_CONNECTION_H +#include "google/cloud/texttospeech/v1/cloud_tts.pb.h" #include "google/cloud/texttospeech/v1/internal/text_to_speech_retry_traits.h" #include "google/cloud/texttospeech/v1/text_to_speech_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -28,7 +29,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/texttospeech/v1/text_to_speech_connection_idempotency_policy.h b/google/cloud/texttospeech/v1/text_to_speech_connection_idempotency_policy.h index f644468547c1d..415882d4d0968 100644 --- a/google/cloud/texttospeech/v1/text_to_speech_connection_idempotency_policy.h +++ b/google/cloud/texttospeech/v1/text_to_speech_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_V1_TEXT_TO_SPEECH_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TEXTTOSPEECH_V1_TEXT_TO_SPEECH_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/texttospeech/v1/cloud_tts.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/timeseriesinsights/BUILD.bazel b/google/cloud/timeseriesinsights/BUILD.bazel index dc294a941059d..bc0dfb0561e09 100644 --- a/google/cloud/timeseriesinsights/BUILD.bazel +++ b/google/cloud/timeseriesinsights/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/timeseriesinsights/v1:timeseriesinsights_cc_grpc", + "@googleapis//google/cloud/timeseriesinsights/v1:timeseriesinsights_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/timeseriesinsights/quickstart/.bazelrc b/google/cloud/timeseriesinsights/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/timeseriesinsights/quickstart/.bazelrc +++ b/google/cloud/timeseriesinsights/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/timeseriesinsights/quickstart/CMakeLists.txt index 7479a66b9305b..4a60c6fdd0bce 100644 --- a/google/cloud/timeseriesinsights/quickstart/CMakeLists.txt +++ b/google/cloud/timeseriesinsights/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Timeseries Insights API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-timeseriesinsights-quickstart CXX) find_package(google_cloud_cpp_timeseriesinsights REQUIRED) diff --git a/google/cloud/timeseriesinsights/quickstart/WORKSPACE.bazel b/google/cloud/timeseriesinsights/quickstart/WORKSPACE.bazel index e3337d711afac..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 = "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/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.cc index ff70ac4de70be..f6f4ad3a12d9d 100644 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.cc +++ b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto #include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.h" -#include +#include "google/cloud/timeseriesinsights/v1/timeseries_insights.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace timeseriesinsights_v1_internal { @@ -101,3 +104,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace timeseriesinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.h index c848e3d606a28..64e44ef207560 100644 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.h +++ b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace timeseriesinsights_v1_internal { @@ -85,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_AUTH_DECORATOR_H diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.cc index d87ea7a2b7fed..7b4030a474ec6 100644 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.cc +++ b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto #include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.h" +#include "google/cloud/timeseriesinsights/v1/timeseries_insights.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace timeseriesinsights_v1_internal { @@ -133,3 +136,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace timeseriesinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.h index 496b39d656940..33a660a08ee28 100644 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.h +++ b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace timeseriesinsights_v1_internal { @@ -85,4 +88,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_LOGGING_DECORATOR_H diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.cc index dbd6e867da7d1..d9d6f1ae6b974 100644 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.cc +++ b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto #include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.h" +#include "google/cloud/timeseriesinsights/v1/timeseries_insights.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 timeseriesinsights_v1_internal { @@ -127,3 +131,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace timeseriesinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.h index d445bcda73d7b..60bff78ea7d99 100644 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.h +++ b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace timeseriesinsights_v1_internal { @@ -91,4 +94,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_METADATA_DECORATOR_H diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.cc index c090d9764c0ad..40a9dfbfe6428 100644 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.cc +++ b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.cc @@ -46,7 +46,7 @@ Options TimeseriesInsightsControllerDefaultOptions(Options options) { timeseriesinsights_v1::TimeseriesInsightsControllerRetryPolicyOption>( timeseriesinsights_v1:: TimeseriesInsightsControllerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace timeseriesinsights_v1_internal { @@ -121,3 +124,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace timeseriesinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h index 888df3a1ee540..2d9b1afd28bf6 100644 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h +++ b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_STUB_H +#include "google/cloud/timeseriesinsights/v1/timeseries_insights.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace timeseriesinsights_v1_internal { @@ -130,4 +133,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_STUB_H diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.cc index 2305b3e61e340..6851acefec779 100644 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.cc +++ b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.h" #include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h" #include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.h" +#include "google/cloud/timeseriesinsights/v1/timeseries_insights.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace timeseriesinsights_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace timeseriesinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.h index 502858b0d904a..3613c6496dd00 100644 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.h +++ b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace timeseriesinsights_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_STUB_FACTORY_H diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.cc index e873f7d0b5d38..4b7471916883e 100644 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.cc +++ b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace timeseriesinsights_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TimeseriesInsightsControllerTracingConnection:: TimeseriesInsightsControllerTracingConnection( std::shared_ptr< @@ -112,19 +110,15 @@ TimeseriesInsightsControllerTracingConnection::EvaluateTimeseries( return internal::EndSpan(*span, child_->EvaluateTimeseries(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTimeseriesInsightsControllerTracingConnection( std::shared_ptr< timeseriesinsights_v1::TimeseriesInsightsControllerConnection> conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.h index f0637f15e1967..0d767760e3c42 100644 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.h +++ b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace timeseriesinsights_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TimeseriesInsightsControllerTracingConnection : public timeseriesinsights_v1::TimeseriesInsightsControllerConnection { public: @@ -76,8 +74,6 @@ class TimeseriesInsightsControllerTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.cc index c610487c4cfdd..4785e182c5b73 100644 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.cc +++ b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace timeseriesinsights_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TimeseriesInsightsControllerTracingStub:: TimeseriesInsightsControllerTracingStub( std::shared_ptr child) @@ -127,20 +128,16 @@ TimeseriesInsightsControllerTracingStub::EvaluateTimeseries( context, *span, child_->EvaluateTimeseries(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTimeseriesInsightsControllerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared( std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace timeseriesinsights_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.h index e2fb882ed1e8d..1f78c42f5edb5 100644 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.h +++ b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace timeseriesinsights_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TimeseriesInsightsControllerTracingStub : public TimeseriesInsightsControllerStub { public: @@ -82,8 +83,6 @@ class TimeseriesInsightsControllerTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -99,4 +98,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_TRACING_STUB_H diff --git a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h b/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h index 69fd5b335f1b0..2db73e03c4c6a 100644 --- a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h +++ b/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_H #include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_retry_traits.h" +#include "google/cloud/timeseriesinsights/v1/timeseries_insights.pb.h" #include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.h b/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.h index 7ae9671c09848..72dff89bd7666 100644 --- a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.h +++ b/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/timeseriesinsights/v1/timeseries_insights.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/tpu/BUILD.bazel b/google/cloud/tpu/BUILD.bazel index 2c84443519e07..b50bd2439cc46 100644 --- a/google/cloud/tpu/BUILD.bazel +++ b/google/cloud/tpu/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/tpu/v1:tpu_cc_grpc", - "@com_google_googleapis//google/cloud/tpu/v2:tpu_cc_grpc", + "@googleapis//google/cloud/tpu/v1:tpu_cc_grpc", + "@googleapis//google/cloud/tpu/v2:tpu_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/tpu/CMakeLists.txt b/google/cloud/tpu/CMakeLists.txt index 38fde08179d22..1df1bad6d6ef5 100644 --- a/google/cloud/tpu/CMakeLists.txt +++ b/google/cloud/tpu/CMakeLists.txt @@ -16,8 +16,7 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library(tpu "Cloud TPU API" SERVICE_DIRS "__EMPTY__" - "v1/" "v2/") +google_cloud_cpp_add_gapic_library(tpu "Cloud TPU API" SERVICE_DIRS "v1/" "v2/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(tpu_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/tpu/mocks/mock_tpu_connection.h b/google/cloud/tpu/mocks/mock_tpu_connection.h deleted file mode 100644 index 8409ecff3c730..0000000000000 --- a/google/cloud/tpu/mocks/mock_tpu_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/tpu/v1/cloud_tpu.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_MOCKS_MOCK_TPU_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_MOCKS_MOCK_TPU_CONNECTION_H - -#include "google/cloud/tpu/tpu_connection.h" -#include "google/cloud/tpu/v1/mocks/mock_tpu_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in tpu_v1_mocks instead of the aliases -/// defined in this namespace. -namespace tpu_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use tpu_v1_mocks::MockTpuConnection directly. -using ::google::cloud::tpu_v1_mocks::MockTpuConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace tpu_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_MOCKS_MOCK_TPU_CONNECTION_H diff --git a/google/cloud/tpu/quickstart/.bazelrc b/google/cloud/tpu/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/tpu/quickstart/.bazelrc +++ b/google/cloud/tpu/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/tpu/quickstart/CMakeLists.txt index b69308ca9f259..0234ec0214f2f 100644 --- a/google/cloud/tpu/quickstart/CMakeLists.txt +++ b/google/cloud/tpu/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud TPU API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-tpu-quickstart CXX) find_package(google_cloud_cpp_tpu REQUIRED) diff --git a/google/cloud/tpu/quickstart/WORKSPACE.bazel b/google/cloud/tpu/quickstart/WORKSPACE.bazel index 5259e8bf22e4b..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 = "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/tpu/tpu_client.h b/google/cloud/tpu/tpu_client.h deleted file mode 100644 index a222c4a6c950e..0000000000000 --- a/google/cloud/tpu/tpu_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/tpu/v1/cloud_tpu.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_TPU_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_TPU_CLIENT_H - -#include "google/cloud/tpu/tpu_connection.h" -#include "google/cloud/tpu/v1/tpu_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in tpu_v1 instead of the aliases defined in -/// this namespace. -namespace tpu { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use tpu_v1::TpuClient directly. -using ::google::cloud::tpu_v1::TpuClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace tpu -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_TPU_CLIENT_H diff --git a/google/cloud/tpu/tpu_connection.h b/google/cloud/tpu/tpu_connection.h deleted file mode 100644 index 120cd44a2f55e..0000000000000 --- a/google/cloud/tpu/tpu_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/tpu/v1/cloud_tpu.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_TPU_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_TPU_CONNECTION_H - -#include "google/cloud/tpu/tpu_connection_idempotency_policy.h" -#include "google/cloud/tpu/v1/tpu_connection.h" - -namespace google { -namespace cloud { -namespace tpu { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use tpu_v1::MakeTpuConnection directly. -using ::google::cloud::tpu_v1::MakeTpuConnection; - -/// @deprecated Use tpu_v1::TpuConnection directly. -using ::google::cloud::tpu_v1::TpuConnection; - -/// @deprecated Use tpu_v1::TpuLimitedErrorCountRetryPolicy directly. -using ::google::cloud::tpu_v1::TpuLimitedErrorCountRetryPolicy; - -/// @deprecated Use tpu_v1::TpuLimitedTimeRetryPolicy directly. -using ::google::cloud::tpu_v1::TpuLimitedTimeRetryPolicy; - -/// @deprecated Use tpu_v1::TpuRetryPolicy directly. -using ::google::cloud::tpu_v1::TpuRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace tpu -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_TPU_CONNECTION_H diff --git a/google/cloud/tpu/tpu_connection_idempotency_policy.h b/google/cloud/tpu/tpu_connection_idempotency_policy.h deleted file mode 100644 index 9b65c54d63a01..0000000000000 --- a/google/cloud/tpu/tpu_connection_idempotency_policy.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/tpu/v1/cloud_tpu.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_TPU_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_TPU_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/tpu/v1/tpu_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace tpu { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use tpu_v1::MakeDefaultTpuConnectionIdempotencyPolicy directly. -using ::google::cloud::tpu_v1::MakeDefaultTpuConnectionIdempotencyPolicy; - -/// @deprecated Use tpu_v1::TpuConnectionIdempotencyPolicy directly. -using ::google::cloud::tpu_v1::TpuConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace tpu -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_TPU_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/tpu/tpu_options.h b/google/cloud/tpu/tpu_options.h deleted file mode 100644 index 3f25bc93de56d..0000000000000 --- a/google/cloud/tpu/tpu_options.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/tpu/v1/cloud_tpu.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_TPU_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_TPU_OPTIONS_H - -#include "google/cloud/tpu/tpu_connection.h" -#include "google/cloud/tpu/tpu_connection_idempotency_policy.h" -#include "google/cloud/tpu/v1/tpu_options.h" - -namespace google { -namespace cloud { -namespace tpu { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use tpu_v1::TpuPollingPolicyOption directly. -using ::google::cloud::tpu_v1::TpuPollingPolicyOption; - -/// @deprecated Use tpu_v1::TpuBackoffPolicyOption directly. -using ::google::cloud::tpu_v1::TpuBackoffPolicyOption; - -/// @deprecated Use tpu_v1::TpuConnectionIdempotencyPolicyOption directly. -using ::google::cloud::tpu_v1::TpuConnectionIdempotencyPolicyOption; - -/// @deprecated Use tpu_v1::TpuPolicyOptionList directly. -using ::google::cloud::tpu_v1::TpuPolicyOptionList; - -/// @deprecated Use tpu_v1::TpuRetryPolicyOption directly. -using ::google::cloud::tpu_v1::TpuRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace tpu -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_TPU_OPTIONS_H diff --git a/google/cloud/tpu/v1/internal/tpu_auth_decorator.cc b/google/cloud/tpu/v1/internal/tpu_auth_decorator.cc index 050a10b55c232..e256d385679b3 100644 --- a/google/cloud/tpu/v1/internal/tpu_auth_decorator.cc +++ b/google/cloud/tpu/v1/internal/tpu_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/tpu/v1/cloud_tpu.proto #include "google/cloud/tpu/v1/internal/tpu_auth_decorator.h" -#include +#include "google/cloud/tpu/v1/cloud_tpu.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v1_internal { @@ -304,3 +307,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tpu_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tpu/v1/internal/tpu_auth_decorator.h b/google/cloud/tpu/v1/internal/tpu_auth_decorator.h index 0ea687762ea28..c9835650aded2 100644 --- a/google/cloud/tpu/v1/internal/tpu_auth_decorator.h +++ b/google/cloud/tpu/v1/internal/tpu_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/tpu/v1/internal/tpu_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 tpu_v1_internal { @@ -165,4 +168,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V1_INTERNAL_TPU_AUTH_DECORATOR_H diff --git a/google/cloud/tpu/v1/internal/tpu_connection_impl.h b/google/cloud/tpu/v1/internal/tpu_connection_impl.h index 55e228bdbf300..5da01cfedda88 100644 --- a/google/cloud/tpu/v1/internal/tpu_connection_impl.h +++ b/google/cloud/tpu/v1/internal/tpu_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/tpu/v1/internal/tpu_logging_decorator.cc b/google/cloud/tpu/v1/internal/tpu_logging_decorator.cc index aa0db4525fec9..b54737de8d991 100644 --- a/google/cloud/tpu/v1/internal/tpu_logging_decorator.cc +++ b/google/cloud/tpu/v1/internal/tpu_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/tpu/v1/cloud_tpu.proto #include "google/cloud/tpu/v1/internal/tpu_logging_decorator.h" +#include "google/cloud/tpu/v1/cloud_tpu.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v1_internal { @@ -354,3 +357,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tpu_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tpu/v1/internal/tpu_logging_decorator.h b/google/cloud/tpu/v1/internal/tpu_logging_decorator.h index 63423196a070f..3242463cf7767 100644 --- a/google/cloud/tpu/v1/internal/tpu_logging_decorator.h +++ b/google/cloud/tpu/v1/internal/tpu_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/tpu/v1/internal/tpu_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 tpu_v1_internal { @@ -164,4 +167,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V1_INTERNAL_TPU_LOGGING_DECORATOR_H diff --git a/google/cloud/tpu/v1/internal/tpu_metadata_decorator.cc b/google/cloud/tpu/v1/internal/tpu_metadata_decorator.cc index 766b049e865ae..5f28c1f2a3168 100644 --- a/google/cloud/tpu/v1/internal/tpu_metadata_decorator.cc +++ b/google/cloud/tpu/v1/internal/tpu_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/tpu/v1/cloud_tpu.proto #include "google/cloud/tpu/v1/internal/tpu_metadata_decorator.h" +#include "google/cloud/tpu/v1/cloud_tpu.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 tpu_v1_internal { @@ -279,3 +283,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tpu_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tpu/v1/internal/tpu_metadata_decorator.h b/google/cloud/tpu/v1/internal/tpu_metadata_decorator.h index d965b3af2d954..be057f8200674 100644 --- a/google/cloud/tpu/v1/internal/tpu_metadata_decorator.h +++ b/google/cloud/tpu/v1/internal/tpu_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/tpu/v1/internal/tpu_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 tpu_v1_internal { @@ -170,4 +173,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V1_INTERNAL_TPU_METADATA_DECORATOR_H diff --git a/google/cloud/tpu/v1/internal/tpu_option_defaults.cc b/google/cloud/tpu/v1/internal/tpu_option_defaults.cc index f8b005b69db33..944c1b3a474ec 100644 --- a/google/cloud/tpu/v1/internal/tpu_option_defaults.cc +++ b/google/cloud/tpu/v1/internal/tpu_option_defaults.cc @@ -40,7 +40,7 @@ Options TpuDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - tpu_v1::TpuLimitedTimeRetryPolicy(std::chrono::minutes(30)).clone()); + tpu_v1::TpuLimitedTimeRetryPolicy(std::chrono::minutes(10)).clone()); } if (!options.has()) { options.set( diff --git a/google/cloud/tpu/v1/internal/tpu_stub.cc b/google/cloud/tpu/v1/internal/tpu_stub.cc index cb240fab5a686..ade9c96dc446e 100644 --- a/google/cloud/tpu/v1/internal/tpu_stub.cc +++ b/google/cloud/tpu/v1/internal/tpu_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/tpu/v1/cloud_tpu.proto #include "google/cloud/tpu/v1/internal/tpu_stub.h" +#include "google/cloud/tpu/v1/cloud_tpu.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v1_internal { @@ -351,3 +354,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tpu_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tpu/v1/internal/tpu_stub.h b/google/cloud/tpu/v1/internal/tpu_stub.h index 82d3fd23bc2dc..273d0360bb360 100644 --- a/google/cloud/tpu/v1/internal/tpu_stub.h +++ b/google/cloud/tpu/v1/internal/tpu_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V1_INTERNAL_TPU_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V1_INTERNAL_TPU_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/tpu/v1/cloud_tpu.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v1_internal { @@ -295,4 +298,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V1_INTERNAL_TPU_STUB_H diff --git a/google/cloud/tpu/v1/internal/tpu_stub_factory.cc b/google/cloud/tpu/v1/internal/tpu_stub_factory.cc index e4138c3cf40bc..bc1f2be64c051 100644 --- a/google/cloud/tpu/v1/internal/tpu_stub_factory.cc +++ b/google/cloud/tpu/v1/internal/tpu_stub_factory.cc @@ -17,6 +17,8 @@ // source: google/cloud/tpu/v1/cloud_tpu.proto #include "google/cloud/tpu/v1/internal/tpu_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/tpu/v1/cloud_tpu.grpc.pb.h" #include "google/cloud/tpu/v1/internal/tpu_auth_decorator.h" #include "google/cloud/tpu/v1/internal/tpu_logging_decorator.h" #include "google/cloud/tpu/v1/internal/tpu_metadata_decorator.h" @@ -28,12 +30,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tpu_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tpu/v1/internal/tpu_stub_factory.h b/google/cloud/tpu/v1/internal/tpu_stub_factory.h index 93ca8392499d6..a4b53a5484b35 100644 --- a/google/cloud/tpu/v1/internal/tpu_stub_factory.h +++ b/google/cloud/tpu/v1/internal/tpu_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V1_INTERNAL_TPU_STUB_FACTORY_H diff --git a/google/cloud/tpu/v1/internal/tpu_tracing_connection.cc b/google/cloud/tpu/v1/internal/tpu_tracing_connection.cc index 2f1e3b7018090..f2863b16557fc 100644 --- a/google/cloud/tpu/v1/internal/tpu_tracing_connection.cc +++ b/google/cloud/tpu/v1/internal/tpu_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace tpu_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TpuTracingConnection::TpuTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -242,15 +240,11 @@ Status TpuTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTpuTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/tpu/v1/internal/tpu_tracing_connection.h b/google/cloud/tpu/v1/internal/tpu_tracing_connection.h index 050f0e07af44a..e0a1c94eae4b2 100644 --- a/google/cloud/tpu/v1/internal/tpu_tracing_connection.h +++ b/google/cloud/tpu/v1/internal/tpu_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace tpu_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TpuTracingConnection : public tpu_v1::TpuConnection { public: ~TpuTracingConnection() override = default; @@ -130,8 +128,6 @@ class TpuTracingConnection : public tpu_v1::TpuConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/tpu/v1/internal/tpu_tracing_stub.cc b/google/cloud/tpu/v1/internal/tpu_tracing_stub.cc index 87ee004d132b9..ac998df202dee 100644 --- a/google/cloud/tpu/v1/internal/tpu_tracing_stub.cc +++ b/google/cloud/tpu/v1/internal/tpu_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TpuTracingStub::TpuTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -307,17 +308,13 @@ future TpuTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTpuTracingStub(std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tpu_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tpu/v1/internal/tpu_tracing_stub.h b/google/cloud/tpu/v1/internal/tpu_tracing_stub.h index a5d4978e1ccd2..39bd781841c5c 100644 --- a/google/cloud/tpu/v1/internal/tpu_tracing_stub.h +++ b/google/cloud/tpu/v1/internal/tpu_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TpuTracingStub : public TpuStub { public: ~TpuTracingStub() override = default; @@ -160,8 +161,6 @@ class TpuTracingStub : public TpuStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -175,4 +174,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V1_INTERNAL_TPU_TRACING_STUB_H diff --git a/google/cloud/tpu/v1/tpu_client.h b/google/cloud/tpu/v1/tpu_client.h index 9a762e7be5dc5..09c88a79e2b0b 100644 --- a/google/cloud/tpu/v1/tpu_client.h +++ b/google/cloud/tpu/v1/tpu_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/v1/tpu_connection.h b/google/cloud/tpu/v1/tpu_connection.h index d5ba39ae90bf1..384a9b19bbf19 100644 --- a/google/cloud/tpu/v1/tpu_connection.h +++ b/google/cloud/tpu/v1/tpu_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V1_TPU_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V1_TPU_CONNECTION_H +#include "google/cloud/tpu/v1/cloud_tpu.pb.h" #include "google/cloud/tpu/v1/internal/tpu_retry_traits.h" #include "google/cloud/tpu/v1/tpu_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/tpu/v1/tpu_connection_idempotency_policy.h b/google/cloud/tpu/v1/tpu_connection_idempotency_policy.h index ca1c169c0c5f3..d006294357bf7 100644 --- a/google/cloud/tpu/v1/tpu_connection_idempotency_policy.h +++ b/google/cloud/tpu/v1/tpu_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V1_TPU_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V1_TPU_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/tpu/v1/cloud_tpu.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/tpu/v2/internal/tpu_auth_decorator.cc b/google/cloud/tpu/v2/internal/tpu_auth_decorator.cc index 39acfc56e44e9..ddb11cc175d48 100644 --- a/google/cloud/tpu/v2/internal/tpu_auth_decorator.cc +++ b/google/cloud/tpu/v2/internal/tpu_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/tpu/v2/cloud_tpu.proto #include "google/cloud/tpu/v2/internal/tpu_auth_decorator.h" -#include +#include "google/cloud/tpu/v2/cloud_tpu.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v2_internal { @@ -422,3 +425,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tpu_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tpu/v2/internal/tpu_auth_decorator.h b/google/cloud/tpu/v2/internal/tpu_auth_decorator.h index c98b7250bf07c..bfce9550a653a 100644 --- a/google/cloud/tpu/v2/internal/tpu_auth_decorator.h +++ b/google/cloud/tpu/v2/internal/tpu_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/tpu/v2/internal/tpu_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 tpu_v2_internal { @@ -219,4 +222,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V2_INTERNAL_TPU_AUTH_DECORATOR_H diff --git a/google/cloud/tpu/v2/internal/tpu_connection_impl.h b/google/cloud/tpu/v2/internal/tpu_connection_impl.h index 38868d09191d1..a149b84677f94 100644 --- a/google/cloud/tpu/v2/internal/tpu_connection_impl.h +++ b/google/cloud/tpu/v2/internal/tpu_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/tpu/v2/internal/tpu_logging_decorator.cc b/google/cloud/tpu/v2/internal/tpu_logging_decorator.cc index dc58b27d62eb0..e7660cdfe2f8c 100644 --- a/google/cloud/tpu/v2/internal/tpu_logging_decorator.cc +++ b/google/cloud/tpu/v2/internal/tpu_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/tpu/v2/cloud_tpu.proto #include "google/cloud/tpu/v2/internal/tpu_logging_decorator.h" +#include "google/cloud/tpu/v2/cloud_tpu.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v2_internal { @@ -494,3 +497,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tpu_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tpu/v2/internal/tpu_logging_decorator.h b/google/cloud/tpu/v2/internal/tpu_logging_decorator.h index d27bfedf51d4c..4a6dfc28bba36 100644 --- a/google/cloud/tpu/v2/internal/tpu_logging_decorator.h +++ b/google/cloud/tpu/v2/internal/tpu_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/tpu/v2/internal/tpu_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 tpu_v2_internal { @@ -218,4 +221,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V2_INTERNAL_TPU_LOGGING_DECORATOR_H diff --git a/google/cloud/tpu/v2/internal/tpu_metadata_decorator.cc b/google/cloud/tpu/v2/internal/tpu_metadata_decorator.cc index 40b3482954298..1b868e61bda42 100644 --- a/google/cloud/tpu/v2/internal/tpu_metadata_decorator.cc +++ b/google/cloud/tpu/v2/internal/tpu_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/tpu/v2/cloud_tpu.proto #include "google/cloud/tpu/v2/internal/tpu_metadata_decorator.h" +#include "google/cloud/tpu/v2/cloud_tpu.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 tpu_v2_internal { @@ -375,3 +379,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tpu_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tpu/v2/internal/tpu_metadata_decorator.h b/google/cloud/tpu/v2/internal/tpu_metadata_decorator.h index 39daaac944955..16bd5a2d0c9c4 100644 --- a/google/cloud/tpu/v2/internal/tpu_metadata_decorator.h +++ b/google/cloud/tpu/v2/internal/tpu_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/tpu/v2/internal/tpu_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 tpu_v2_internal { @@ -224,4 +227,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V2_INTERNAL_TPU_METADATA_DECORATOR_H diff --git a/google/cloud/tpu/v2/internal/tpu_option_defaults.cc b/google/cloud/tpu/v2/internal/tpu_option_defaults.cc index e6f43024e1f8b..f6d5e92027f72 100644 --- a/google/cloud/tpu/v2/internal/tpu_option_defaults.cc +++ b/google/cloud/tpu/v2/internal/tpu_option_defaults.cc @@ -40,7 +40,7 @@ Options TpuDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - tpu_v2::TpuLimitedTimeRetryPolicy(std::chrono::minutes(30)).clone()); + tpu_v2::TpuLimitedTimeRetryPolicy(std::chrono::minutes(10)).clone()); } if (!options.has()) { options.set( diff --git a/google/cloud/tpu/v2/internal/tpu_stub.cc b/google/cloud/tpu/v2/internal/tpu_stub.cc index 2e996ca628fbb..091258e6d1b1b 100644 --- a/google/cloud/tpu/v2/internal/tpu_stub.cc +++ b/google/cloud/tpu/v2/internal/tpu_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/tpu/v2/cloud_tpu.proto #include "google/cloud/tpu/v2/internal/tpu_stub.h" +#include "google/cloud/tpu/v2/cloud_tpu.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v2_internal { @@ -486,3 +489,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tpu_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tpu/v2/internal/tpu_stub.h b/google/cloud/tpu/v2/internal/tpu_stub.h index 945714b91138b..7e56c17ae0eb8 100644 --- a/google/cloud/tpu/v2/internal/tpu_stub.h +++ b/google/cloud/tpu/v2/internal/tpu_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V2_INTERNAL_TPU_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V2_INTERNAL_TPU_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/tpu/v2/cloud_tpu.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v2_internal { @@ -401,4 +404,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V2_INTERNAL_TPU_STUB_H diff --git a/google/cloud/tpu/v2/internal/tpu_stub_factory.cc b/google/cloud/tpu/v2/internal/tpu_stub_factory.cc index aab369ea8f042..218e8c77a9ddc 100644 --- a/google/cloud/tpu/v2/internal/tpu_stub_factory.cc +++ b/google/cloud/tpu/v2/internal/tpu_stub_factory.cc @@ -17,6 +17,8 @@ // source: google/cloud/tpu/v2/cloud_tpu.proto #include "google/cloud/tpu/v2/internal/tpu_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/tpu/v2/cloud_tpu.grpc.pb.h" #include "google/cloud/tpu/v2/internal/tpu_auth_decorator.h" #include "google/cloud/tpu/v2/internal/tpu_logging_decorator.h" #include "google/cloud/tpu/v2/internal/tpu_metadata_decorator.h" @@ -28,12 +30,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v2_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tpu_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tpu/v2/internal/tpu_stub_factory.h b/google/cloud/tpu/v2/internal/tpu_stub_factory.h index 0fe95c6be4dca..d289ca188b474 100644 --- a/google/cloud/tpu/v2/internal/tpu_stub_factory.h +++ b/google/cloud/tpu/v2/internal/tpu_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V2_INTERNAL_TPU_STUB_FACTORY_H diff --git a/google/cloud/tpu/v2/internal/tpu_tracing_connection.cc b/google/cloud/tpu/v2/internal/tpu_tracing_connection.cc index d7e6d573600a7..73a89d19e7ad9 100644 --- a/google/cloud/tpu/v2/internal/tpu_tracing_connection.cc +++ b/google/cloud/tpu/v2/internal/tpu_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace tpu_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TpuTracingConnection::TpuTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -359,15 +357,11 @@ Status TpuTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTpuTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/tpu/v2/internal/tpu_tracing_connection.h b/google/cloud/tpu/v2/internal/tpu_tracing_connection.h index 9fa4799a8d2d4..7cf41ebe8ac09 100644 --- a/google/cloud/tpu/v2/internal/tpu_tracing_connection.h +++ b/google/cloud/tpu/v2/internal/tpu_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace tpu_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TpuTracingConnection : public tpu_v2::TpuConnection { public: ~TpuTracingConnection() override = default; @@ -182,8 +180,6 @@ class TpuTracingConnection : public tpu_v2::TpuConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/tpu/v2/internal/tpu_tracing_stub.cc b/google/cloud/tpu/v2/internal/tpu_tracing_stub.cc index 591cd56baee98..87a59b09ead27 100644 --- a/google/cloud/tpu/v2/internal/tpu_tracing_stub.cc +++ b/google/cloud/tpu/v2/internal/tpu_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TpuTracingStub::TpuTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -433,17 +434,13 @@ future TpuTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTpuTracingStub(std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace tpu_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/tpu/v2/internal/tpu_tracing_stub.h b/google/cloud/tpu/v2/internal/tpu_tracing_stub.h index 5cb73f9e6d0c3..6fdbb83ab17cb 100644 --- a/google/cloud/tpu/v2/internal/tpu_tracing_stub.h +++ b/google/cloud/tpu/v2/internal/tpu_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace tpu_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TpuTracingStub : public TpuStub { public: ~TpuTracingStub() override = default; @@ -214,8 +215,6 @@ class TpuTracingStub : public TpuStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -229,4 +228,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V2_INTERNAL_TPU_TRACING_STUB_H diff --git a/google/cloud/tpu/v2/tpu_client.h b/google/cloud/tpu/v2/tpu_client.h index b58d40e75e301..9ecc91ffd24c8 100644 --- a/google/cloud/tpu/v2/tpu_client.h +++ b/google/cloud/tpu/v2/tpu_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/tpu/v2/tpu_connection.h b/google/cloud/tpu/v2/tpu_connection.h index 0ff19e205da23..53b799b554ae4 100644 --- a/google/cloud/tpu/v2/tpu_connection.h +++ b/google/cloud/tpu/v2/tpu_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V2_TPU_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V2_TPU_CONNECTION_H +#include "google/cloud/tpu/v2/cloud_tpu.pb.h" #include "google/cloud/tpu/v2/internal/tpu_retry_traits.h" #include "google/cloud/tpu/v2/tpu_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/tpu/v2/tpu_connection_idempotency_policy.h b/google/cloud/tpu/v2/tpu_connection_idempotency_policy.h index 1db7778fb6374..5c5fb739af1c3 100644 --- a/google/cloud/tpu/v2/tpu_connection_idempotency_policy.h +++ b/google/cloud/tpu/v2/tpu_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V2_TPU_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TPU_V2_TPU_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/tpu/v2/cloud_tpu.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/trace/BUILD.bazel b/google/cloud/trace/BUILD.bazel index 71c11f17a601e..f387f9b8a6418 100644 --- a/google/cloud/trace/BUILD.bazel +++ b/google/cloud/trace/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", "v2/", ] googleapis_deps = [ - "@com_google_googleapis//google/devtools/cloudtrace/v1:cloudtrace_cc_grpc", - "@com_google_googleapis//google/devtools/cloudtrace/v2:cloudtrace_cc_grpc", + "@googleapis//google/devtools/cloudtrace/v1:cloudtrace_cc_grpc", + "@googleapis//google/devtools/cloudtrace/v2:cloudtrace_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/trace/CMakeLists.txt b/google/cloud/trace/CMakeLists.txt index a3af837c0c8e2..91294152c4f4d 100644 --- a/google/cloud/trace/CMakeLists.txt +++ b/google/cloud/trace/CMakeLists.txt @@ -18,7 +18,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( trace "Cloud Trace API" - SERVICE_DIRS "__EMPTY__" "v1/" "v2/" + SERVICE_DIRS "v1/" "v2/" BACKWARDS_COMPAT_PROTO_TARGETS "devtools_cloudtrace_v2_trace_protos" "devtools_cloudtrace_v2_tracing_protos") diff --git a/google/cloud/trace/mocks/mock_trace_connection.h b/google/cloud/trace/mocks/mock_trace_connection.h deleted file mode 100644 index 576ca31de3c6b..0000000000000 --- a/google/cloud/trace/mocks/mock_trace_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudtrace/v2/tracing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_MOCKS_MOCK_TRACE_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_MOCKS_MOCK_TRACE_CONNECTION_H - -#include "google/cloud/trace/trace_connection.h" -#include "google/cloud/trace/v2/mocks/mock_trace_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in trace_v2_mocks instead of the aliases -/// defined in this namespace. -namespace trace_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use trace_v2_mocks::MockTraceServiceConnection directly. -using ::google::cloud::trace_v2_mocks::MockTraceServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace trace_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_MOCKS_MOCK_TRACE_CONNECTION_H diff --git a/google/cloud/trace/quickstart/.bazelrc b/google/cloud/trace/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/trace/quickstart/.bazelrc +++ b/google/cloud/trace/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/trace/quickstart/CMakeLists.txt index 4f9d338aa09d8..74001c0668741 100644 --- a/google/cloud/trace/quickstart/CMakeLists.txt +++ b/google/cloud/trace/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Trace API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-trace-quickstart CXX) find_package(google_cloud_cpp_trace REQUIRED) diff --git a/google/cloud/trace/quickstart/WORKSPACE.bazel b/google/cloud/trace/quickstart/WORKSPACE.bazel index 3035cdd0377c7..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 = "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/trace/trace_client.h b/google/cloud/trace/trace_client.h deleted file mode 100644 index af171379db9ba..0000000000000 --- a/google/cloud/trace/trace_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudtrace/v2/tracing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_TRACE_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_TRACE_CLIENT_H - -#include "google/cloud/trace/trace_connection.h" -#include "google/cloud/trace/v2/trace_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in trace_v2 instead of the aliases defined in -/// this namespace. -namespace trace { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use trace_v2::TraceServiceClient directly. -using ::google::cloud::trace_v2::TraceServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace trace -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_TRACE_CLIENT_H diff --git a/google/cloud/trace/trace_connection.h b/google/cloud/trace/trace_connection.h deleted file mode 100644 index 2e35663928263..0000000000000 --- a/google/cloud/trace/trace_connection.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudtrace/v2/tracing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_TRACE_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_TRACE_CONNECTION_H - -#include "google/cloud/trace/trace_connection_idempotency_policy.h" -#include "google/cloud/trace/v2/trace_connection.h" - -namespace google { -namespace cloud { -namespace trace { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use trace_v2::MakeTraceServiceConnection directly. -using ::google::cloud::trace_v2::MakeTraceServiceConnection; - -/// @deprecated Use trace_v2::TraceServiceConnection directly. -using ::google::cloud::trace_v2::TraceServiceConnection; - -/// @deprecated Use trace_v2::TraceServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::trace_v2::TraceServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use trace_v2::TraceServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::trace_v2::TraceServiceLimitedTimeRetryPolicy; - -/// @deprecated Use trace_v2::TraceServiceRetryPolicy directly. -using ::google::cloud::trace_v2::TraceServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace trace -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_TRACE_CONNECTION_H diff --git a/google/cloud/trace/trace_connection_idempotency_policy.h b/google/cloud/trace/trace_connection_idempotency_policy.h deleted file mode 100644 index 657ec8b7c6fe7..0000000000000 --- a/google/cloud/trace/trace_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudtrace/v2/tracing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_TRACE_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_TRACE_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/trace/v2/trace_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace trace { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use trace_v2::MakeDefaultTraceServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::trace_v2:: - MakeDefaultTraceServiceConnectionIdempotencyPolicy; - -/// @deprecated Use trace_v2::TraceServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::trace_v2::TraceServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace trace -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_TRACE_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/trace/trace_options.h b/google/cloud/trace/trace_options.h deleted file mode 100644 index b37c628b8ef50..0000000000000 --- a/google/cloud/trace/trace_options.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/devtools/cloudtrace/v2/tracing.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_TRACE_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_TRACE_OPTIONS_H - -#include "google/cloud/trace/trace_connection.h" -#include "google/cloud/trace/trace_connection_idempotency_policy.h" -#include "google/cloud/trace/v2/trace_options.h" - -namespace google { -namespace cloud { -namespace trace { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use trace_v2::TraceServiceBackoffPolicyOption directly. -using ::google::cloud::trace_v2::TraceServiceBackoffPolicyOption; - -/// @deprecated Use trace_v2::TraceServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::trace_v2::TraceServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use trace_v2::TraceServicePolicyOptionList directly. -using ::google::cloud::trace_v2::TraceServicePolicyOptionList; - -/// @deprecated Use trace_v2::TraceServiceRetryPolicyOption directly. -using ::google::cloud::trace_v2::TraceServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace trace -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_TRACE_OPTIONS_H diff --git a/google/cloud/trace/v1/internal/trace_auth_decorator.cc b/google/cloud/trace/v1/internal/trace_auth_decorator.cc index c0b2ad7aad41e..461ea20fe0a48 100644 --- a/google/cloud/trace/v1/internal/trace_auth_decorator.cc +++ b/google/cloud/trace/v1/internal/trace_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/devtools/cloudtrace/v1/trace.proto #include "google/cloud/trace/v1/internal/trace_auth_decorator.h" -#include +#include "google/devtools/cloudtrace/v1/trace.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v1_internal { @@ -60,3 +63,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace trace_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/trace/v1/internal/trace_auth_decorator.h b/google/cloud/trace/v1/internal/trace_auth_decorator.h index 8b8faa9fbb402..0e0d369864264 100644 --- a/google/cloud/trace/v1/internal/trace_auth_decorator.h +++ b/google/cloud/trace/v1/internal/trace_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v1_internal { @@ -62,4 +65,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_V1_INTERNAL_TRACE_AUTH_DECORATOR_H diff --git a/google/cloud/trace/v1/internal/trace_logging_decorator.cc b/google/cloud/trace/v1/internal/trace_logging_decorator.cc index 52ff1821f2e63..79b5d16c5836c 100644 --- a/google/cloud/trace/v1/internal/trace_logging_decorator.cc +++ b/google/cloud/trace/v1/internal/trace_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/trace/v1/internal/trace_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/devtools/cloudtrace/v1/trace.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace trace_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/trace/v1/internal/trace_logging_decorator.h b/google/cloud/trace/v1/internal/trace_logging_decorator.h index a4fc4aca7a86e..cafbecd177fe9 100644 --- a/google/cloud/trace/v1/internal/trace_logging_decorator.h +++ b/google/cloud/trace/v1/internal/trace_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v1_internal { @@ -62,4 +65,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_V1_INTERNAL_TRACE_LOGGING_DECORATOR_H diff --git a/google/cloud/trace/v1/internal/trace_metadata_decorator.cc b/google/cloud/trace/v1/internal/trace_metadata_decorator.cc index d56f80292115a..2194fff5123f7 100644 --- a/google/cloud/trace/v1/internal/trace_metadata_decorator.cc +++ b/google/cloud/trace/v1/internal/trace_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/trace/v1/internal/trace_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/devtools/cloudtrace/v1/trace.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v1_internal { @@ -91,3 +95,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace trace_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/trace/v1/internal/trace_metadata_decorator.h b/google/cloud/trace/v1/internal/trace_metadata_decorator.h index 09522ce44b5a4..70fc781b2662d 100644 --- a/google/cloud/trace/v1/internal/trace_metadata_decorator.h +++ b/google/cloud/trace/v1/internal/trace_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v1_internal { @@ -67,4 +70,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_V1_INTERNAL_TRACE_METADATA_DECORATOR_H diff --git a/google/cloud/trace/v1/internal/trace_option_defaults.cc b/google/cloud/trace/v1/internal/trace_option_defaults.cc index 9020f0cd96fbd..0ff913ff77074 100644 --- a/google/cloud/trace/v1/internal/trace_option_defaults.cc +++ b/google/cloud/trace/v1/internal/trace_option_defaults.cc @@ -40,7 +40,7 @@ Options TraceServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - trace_v1::TraceServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + trace_v1::TraceServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/trace/v1/internal/trace_stub.cc b/google/cloud/trace/v1/internal/trace_stub.cc index 34815d6559c79..31ded81cf1370 100644 --- a/google/cloud/trace/v1/internal/trace_stub.cc +++ b/google/cloud/trace/v1/internal/trace_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/trace/v1/internal/trace_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/devtools/cloudtrace/v1/trace.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v1_internal { @@ -69,3 +72,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace trace_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/trace/v1/internal/trace_stub.h b/google/cloud/trace/v1/internal/trace_stub.h index 085ba3aea7c46..5ff3802615623 100644 --- a/google/cloud/trace/v1/internal/trace_stub.h +++ b/google/cloud/trace/v1/internal/trace_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/devtools/cloudtrace/v1/trace.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v1_internal { @@ -81,4 +84,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_V1_INTERNAL_TRACE_STUB_H diff --git a/google/cloud/trace/v1/internal/trace_stub_factory.cc b/google/cloud/trace/v1/internal/trace_stub_factory.cc index 3b088e79e93e9..a692c74c9e09a 100644 --- a/google/cloud/trace/v1/internal/trace_stub_factory.cc +++ b/google/cloud/trace/v1/internal/trace_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/devtools/cloudtrace/v1/trace.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace trace_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/trace/v1/internal/trace_stub_factory.h b/google/cloud/trace/v1/internal/trace_stub_factory.h index 67beab7dbfe08..ee555653be5c2 100644 --- a/google/cloud/trace/v1/internal/trace_stub_factory.h +++ b/google/cloud/trace/v1/internal/trace_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_V1_INTERNAL_TRACE_STUB_FACTORY_H diff --git a/google/cloud/trace/v1/internal/trace_tracing_connection.cc b/google/cloud/trace/v1/internal/trace_tracing_connection.cc index 59edf46864267..64d74f703dd89 100644 --- a/google/cloud/trace/v1/internal/trace_tracing_connection.cc +++ b/google/cloud/trace/v1/internal/trace_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace trace_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TraceServiceTracingConnection::TraceServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -60,16 +58,12 @@ Status TraceServiceTracingConnection::PatchTraces( return internal::EndSpan(*span, child_->PatchTraces(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTraceServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/trace/v1/internal/trace_tracing_connection.h b/google/cloud/trace/v1/internal/trace_tracing_connection.h index f479484bc1b46..c969efb07e7a7 100644 --- a/google/cloud/trace/v1/internal/trace_tracing_connection.h +++ b/google/cloud/trace/v1/internal/trace_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace trace_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TraceServiceTracingConnection : public trace_v1::TraceServiceConnection { public: ~TraceServiceTracingConnection() override = default; @@ -53,8 +51,6 @@ class TraceServiceTracingConnection : public trace_v1::TraceServiceConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/trace/v1/internal/trace_tracing_stub.cc b/google/cloud/trace/v1/internal/trace_tracing_stub.cc index 3272c510c8436..3439dd77b3cc3 100644 --- a/google/cloud/trace/v1/internal/trace_tracing_stub.cc +++ b/google/cloud/trace/v1/internal/trace_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TraceServiceTracingStub::TraceServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -67,18 +68,14 @@ Status TraceServiceTracingStub::PatchTraces( child_->PatchTraces(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTraceServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace trace_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/trace/v1/internal/trace_tracing_stub.h b/google/cloud/trace/v1/internal/trace_tracing_stub.h index 34bb2f65bad4b..c834d3af1fc3d 100644 --- a/google/cloud/trace/v1/internal/trace_tracing_stub.h +++ b/google/cloud/trace/v1/internal/trace_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TraceServiceTracingStub : public TraceServiceStub { public: ~TraceServiceTracingStub() override = default; @@ -58,8 +59,6 @@ class TraceServiceTracingStub : public TraceServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -74,4 +73,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_V1_INTERNAL_TRACE_TRACING_STUB_H diff --git a/google/cloud/trace/v1/trace_connection.h b/google/cloud/trace/v1/trace_connection.h index e46e6f34a9f06..babf575740f9e 100644 --- a/google/cloud/trace/v1/trace_connection.h +++ b/google/cloud/trace/v1/trace_connection.h @@ -27,7 +27,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/devtools/cloudtrace/v1/trace.pb.h" #include namespace google { diff --git a/google/cloud/trace/v1/trace_connection_idempotency_policy.h b/google/cloud/trace/v1/trace_connection_idempotency_policy.h index 0a66ada7a1108..e356d6475057b 100644 --- a/google/cloud/trace/v1/trace_connection_idempotency_policy.h +++ b/google/cloud/trace/v1/trace_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/devtools/cloudtrace/v1/trace.grpc.pb.h" #include namespace google { diff --git a/google/cloud/trace/v2/internal/trace_auth_decorator.cc b/google/cloud/trace/v2/internal/trace_auth_decorator.cc index 1b7a104f984b7..abe7daef3659f 100644 --- a/google/cloud/trace/v2/internal/trace_auth_decorator.cc +++ b/google/cloud/trace/v2/internal/trace_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/devtools/cloudtrace/v2/tracing.proto #include "google/cloud/trace/v2/internal/trace_auth_decorator.h" -#include +#include "google/devtools/cloudtrace/v2/tracing.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v2_internal { @@ -51,3 +54,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace trace_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/trace/v2/internal/trace_auth_decorator.h b/google/cloud/trace/v2/internal/trace_auth_decorator.h index 9091b468ea5bf..0c848285a758c 100644 --- a/google/cloud/trace/v2/internal/trace_auth_decorator.h +++ b/google/cloud/trace/v2/internal/trace_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v2_internal { @@ -57,4 +60,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_V2_INTERNAL_TRACE_AUTH_DECORATOR_H diff --git a/google/cloud/trace/v2/internal/trace_logging_decorator.cc b/google/cloud/trace/v2/internal/trace_logging_decorator.cc index 68566bea1fa6a..abad971c9041b 100644 --- a/google/cloud/trace/v2/internal/trace_logging_decorator.cc +++ b/google/cloud/trace/v2/internal/trace_logging_decorator.cc @@ -19,12 +19,15 @@ #include "google/cloud/trace/v2/internal/trace_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include +#include "google/devtools/cloudtrace/v2/tracing.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v2_internal { @@ -63,3 +66,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace trace_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/trace/v2/internal/trace_logging_decorator.h b/google/cloud/trace/v2/internal/trace_logging_decorator.h index a2d1e6a93fca5..87d720f14bd3e 100644 --- a/google/cloud/trace/v2/internal/trace_logging_decorator.h +++ b/google/cloud/trace/v2/internal/trace_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v2_internal { @@ -57,4 +60,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_V2_INTERNAL_TRACE_LOGGING_DECORATOR_H diff --git a/google/cloud/trace/v2/internal/trace_metadata_decorator.cc b/google/cloud/trace/v2/internal/trace_metadata_decorator.cc index 76102c0ab2a16..c9179a9a34369 100644 --- a/google/cloud/trace/v2/internal/trace_metadata_decorator.cc +++ b/google/cloud/trace/v2/internal/trace_metadata_decorator.cc @@ -18,16 +18,20 @@ #include "google/cloud/trace/v2/internal/trace_metadata_decorator.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "google/devtools/cloudtrace/v2/tracing.grpc.pb.h" #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v2_internal { @@ -78,3 +82,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace trace_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/trace/v2/internal/trace_metadata_decorator.h b/google/cloud/trace/v2/internal/trace_metadata_decorator.h index a9b74a18376da..02c460a101b1e 100644 --- a/google/cloud/trace/v2/internal/trace_metadata_decorator.h +++ b/google/cloud/trace/v2/internal/trace_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v2_internal { @@ -62,4 +65,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_V2_INTERNAL_TRACE_METADATA_DECORATOR_H diff --git a/google/cloud/trace/v2/internal/trace_option_defaults.cc b/google/cloud/trace/v2/internal/trace_option_defaults.cc index 71c7bca653806..3eb84cd038e09 100644 --- a/google/cloud/trace/v2/internal/trace_option_defaults.cc +++ b/google/cloud/trace/v2/internal/trace_option_defaults.cc @@ -41,7 +41,7 @@ Options TraceServiceDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - trace_v2::TraceServiceLimitedTimeRetryPolicy(std::chrono::minutes(30)) + trace_v2::TraceServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/trace/v2/internal/trace_stub.cc b/google/cloud/trace/v2/internal/trace_stub.cc index 250abbf296bfe..f5fbf506ce8c2 100644 --- a/google/cloud/trace/v2/internal/trace_stub.cc +++ b/google/cloud/trace/v2/internal/trace_stub.cc @@ -19,10 +19,13 @@ #include "google/cloud/trace/v2/internal/trace_stub.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include +#include "google/devtools/cloudtrace/v2/tracing.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v2_internal { @@ -57,3 +60,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace trace_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/trace/v2/internal/trace_stub.h b/google/cloud/trace/v2/internal/trace_stub.h index fb8a91bd8f261..e4ea6709a9ecc 100644 --- a/google/cloud/trace/v2/internal/trace_stub.h +++ b/google/cloud/trace/v2/internal/trace_stub.h @@ -22,10 +22,13 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/devtools/cloudtrace/v2/tracing.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v2_internal { @@ -72,4 +75,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_V2_INTERNAL_TRACE_STUB_H diff --git a/google/cloud/trace/v2/internal/trace_stub_factory.cc b/google/cloud/trace/v2/internal/trace_stub_factory.cc index 08d2af62e6166..299c0b37ffe13 100644 --- a/google/cloud/trace/v2/internal/trace_stub_factory.cc +++ b/google/cloud/trace/v2/internal/trace_stub_factory.cc @@ -28,10 +28,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include +#include "google/devtools/cloudtrace/v2/tracing.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v2_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace trace_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/trace/v2/internal/trace_stub_factory.h b/google/cloud/trace/v2/internal/trace_stub_factory.h index ac62c08cbecfa..b3b68e32c89c9 100644 --- a/google/cloud/trace/v2/internal/trace_stub_factory.h +++ b/google/cloud/trace/v2/internal/trace_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v2_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_V2_INTERNAL_TRACE_STUB_FACTORY_H diff --git a/google/cloud/trace/v2/internal/trace_tracing_connection.cc b/google/cloud/trace/v2/internal/trace_tracing_connection.cc index 2a2dc9a4d7534..78caf5c32e7f2 100644 --- a/google/cloud/trace/v2/internal/trace_tracing_connection.cc +++ b/google/cloud/trace/v2/internal/trace_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace trace_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TraceServiceTracingConnection::TraceServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -49,16 +47,12 @@ TraceServiceTracingConnection::CreateSpan( return internal::EndSpan(*span, child_->CreateSpan(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTraceServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/trace/v2/internal/trace_tracing_connection.h b/google/cloud/trace/v2/internal/trace_tracing_connection.h index 4fd336fd36ec2..994aeec34f253 100644 --- a/google/cloud/trace/v2/internal/trace_tracing_connection.h +++ b/google/cloud/trace/v2/internal/trace_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace trace_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TraceServiceTracingConnection : public trace_v2::TraceServiceConnection { public: ~TraceServiceTracingConnection() override = default; @@ -50,8 +48,6 @@ class TraceServiceTracingConnection : public trace_v2::TraceServiceConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/trace/v2/internal/trace_tracing_stub.cc b/google/cloud/trace/v2/internal/trace_tracing_stub.cc index 78a3e41f3ac8b..0b24ff4ee2a6f 100644 --- a/google/cloud/trace/v2/internal/trace_tracing_stub.cc +++ b/google/cloud/trace/v2/internal/trace_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TraceServiceTracingStub::TraceServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -55,18 +56,14 @@ TraceServiceTracingStub::CreateSpan( child_->CreateSpan(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTraceServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace trace_v2_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/trace/v2/internal/trace_tracing_stub.h b/google/cloud/trace/v2/internal/trace_tracing_stub.h index 1313e93d6aaa7..e222e3cbf9a70 100644 --- a/google/cloud/trace/v2/internal/trace_tracing_stub.h +++ b/google/cloud/trace/v2/internal/trace_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace trace_v2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TraceServiceTracingStub : public TraceServiceStub { public: ~TraceServiceTracingStub() override = default; @@ -53,8 +54,6 @@ class TraceServiceTracingStub : public TraceServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -69,4 +68,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRACE_V2_INTERNAL_TRACE_TRACING_STUB_H diff --git a/google/cloud/trace/v2/trace_connection.h b/google/cloud/trace/v2/trace_connection.h index cdf9dbad28684..db91d718417a3 100644 --- a/google/cloud/trace/v2/trace_connection.h +++ b/google/cloud/trace/v2/trace_connection.h @@ -26,7 +26,7 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/devtools/cloudtrace/v2/tracing.pb.h" #include namespace google { diff --git a/google/cloud/trace/v2/trace_connection_idempotency_policy.h b/google/cloud/trace/v2/trace_connection_idempotency_policy.h index e48cbb1f7498b..2fb81f611cf57 100644 --- a/google/cloud/trace/v2/trace_connection_idempotency_policy.h +++ b/google/cloud/trace/v2/trace_connection_idempotency_policy.h @@ -21,7 +21,7 @@ #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include +#include "google/devtools/cloudtrace/v2/tracing.grpc.pb.h" #include namespace google { diff --git a/google/cloud/translate/BUILD.bazel b/google/cloud/translate/BUILD.bazel index 26658ea670c41..5724a52753401 100644 --- a/google/cloud/translate/BUILD.bazel +++ b/google/cloud/translate/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v3/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/translate/v3:translation_cc_grpc", + "@googleapis//google/cloud/translate/v3:translation_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/translate/CMakeLists.txt b/google/cloud/translate/CMakeLists.txt index 1c85c4b71aad6..794e4452062b2 100644 --- a/google/cloud/translate/CMakeLists.txt +++ b/google/cloud/translate/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(translate "Cloud Translation API" - SERVICE_DIRS "__EMPTY__" "v3/") + SERVICE_DIRS "v3/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(translate_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/translate/mocks/mock_translation_connection.h b/google/cloud/translate/mocks/mock_translation_connection.h deleted file mode 100644 index df8a8775fb284..0000000000000 --- a/google/cloud/translate/mocks/mock_translation_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/translate/v3/translation_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_MOCKS_MOCK_TRANSLATION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_MOCKS_MOCK_TRANSLATION_CONNECTION_H - -#include "google/cloud/translate/translation_connection.h" -#include "google/cloud/translate/v3/mocks/mock_translation_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in translate_v3_mocks instead of the aliases -/// defined in this namespace. -namespace translate_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use translate_v3_mocks::MockTranslationServiceConnection -/// directly. -using ::google::cloud::translate_v3_mocks::MockTranslationServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace translate_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_MOCKS_MOCK_TRANSLATION_CONNECTION_H diff --git a/google/cloud/translate/quickstart/.bazelrc b/google/cloud/translate/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/translate/quickstart/.bazelrc +++ b/google/cloud/translate/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/translate/quickstart/CMakeLists.txt index 027265b01e344..75bdd8ed7dd8a 100644 --- a/google/cloud/translate/quickstart/CMakeLists.txt +++ b/google/cloud/translate/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Translation API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-translate-quickstart CXX) find_package(google_cloud_cpp_translate REQUIRED) diff --git a/google/cloud/translate/quickstart/WORKSPACE.bazel b/google/cloud/translate/quickstart/WORKSPACE.bazel index 5bdd1e4fe51d6..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 = "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/translate/translation_client.h b/google/cloud/translate/translation_client.h deleted file mode 100644 index d130c5ee2e641..0000000000000 --- a/google/cloud/translate/translation_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/translate/v3/translation_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_TRANSLATION_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_TRANSLATION_CLIENT_H - -#include "google/cloud/translate/translation_connection.h" -#include "google/cloud/translate/v3/translation_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in translate_v3 instead of the aliases defined in -/// this namespace. -namespace translate { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use translate_v3::TranslationServiceClient directly. -using ::google::cloud::translate_v3::TranslationServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace translate -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_TRANSLATION_CLIENT_H diff --git a/google/cloud/translate/translation_connection.h b/google/cloud/translate/translation_connection.h deleted file mode 100644 index 0558e1e4dd7b5..0000000000000 --- a/google/cloud/translate/translation_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/translate/v3/translation_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_TRANSLATION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_TRANSLATION_CONNECTION_H - -#include "google/cloud/translate/translation_connection_idempotency_policy.h" -#include "google/cloud/translate/v3/translation_connection.h" - -namespace google { -namespace cloud { -namespace translate { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use translate_v3::MakeTranslationServiceConnection directly. -using ::google::cloud::translate_v3::MakeTranslationServiceConnection; - -/// @deprecated Use translate_v3::TranslationServiceConnection directly. -using ::google::cloud::translate_v3::TranslationServiceConnection; - -/// @deprecated Use translate_v3::TranslationServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::translate_v3:: - TranslationServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use translate_v3::TranslationServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::translate_v3::TranslationServiceLimitedTimeRetryPolicy; - -/// @deprecated Use translate_v3::TranslationServiceRetryPolicy directly. -using ::google::cloud::translate_v3::TranslationServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace translate -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_TRANSLATION_CONNECTION_H diff --git a/google/cloud/translate/translation_connection_idempotency_policy.h b/google/cloud/translate/translation_connection_idempotency_policy.h deleted file mode 100644 index 442252b2e6af6..0000000000000 --- a/google/cloud/translate/translation_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/translate/v3/translation_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_TRANSLATION_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_TRANSLATION_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/translate/v3/translation_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace translate { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// translate_v3::MakeDefaultTranslationServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::translate_v3:: - MakeDefaultTranslationServiceConnectionIdempotencyPolicy; - -/// @deprecated Use translate_v3::TranslationServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::translate_v3:: - TranslationServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace translate -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_TRANSLATION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/translate/translation_options.h b/google/cloud/translate/translation_options.h deleted file mode 100644 index 35051f89a85b9..0000000000000 --- a/google/cloud/translate/translation_options.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/translate/v3/translation_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_TRANSLATION_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_TRANSLATION_OPTIONS_H - -#include "google/cloud/translate/translation_connection.h" -#include "google/cloud/translate/translation_connection_idempotency_policy.h" -#include "google/cloud/translate/v3/translation_options.h" - -namespace google { -namespace cloud { -namespace translate { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use translate_v3::TranslationServicePollingPolicyOption -/// directly. -using ::google::cloud::translate_v3::TranslationServicePollingPolicyOption; - -/// @deprecated Use translate_v3::TranslationServiceBackoffPolicyOption -/// directly. -using ::google::cloud::translate_v3::TranslationServiceBackoffPolicyOption; - -/// @deprecated Use -/// translate_v3::TranslationServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::translate_v3:: - TranslationServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use translate_v3::TranslationServicePolicyOptionList directly. -using ::google::cloud::translate_v3::TranslationServicePolicyOptionList; - -/// @deprecated Use translate_v3::TranslationServiceRetryPolicyOption directly. -using ::google::cloud::translate_v3::TranslationServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace translate -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_TRANSLATION_OPTIONS_H diff --git a/google/cloud/translate/v3/internal/translation_auth_decorator.cc b/google/cloud/translate/v3/internal/translation_auth_decorator.cc index df2ac7447f32e..6fbc6a15cb9d5 100644 --- a/google/cloud/translate/v3/internal/translation_auth_decorator.cc +++ b/google/cloud/translate/v3/internal/translation_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/translate/v3/translation_service.proto #include "google/cloud/translate/v3/internal/translation_auth_decorator.h" -#include +#include "google/cloud/translate/v3/translation_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace translate_v3_internal { @@ -689,3 +692,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace translate_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/translate/v3/internal/translation_auth_decorator.h b/google/cloud/translate/v3/internal/translation_auth_decorator.h index 9504511aa2aab..162a32190981d 100644 --- a/google/cloud/translate/v3/internal/translation_auth_decorator.h +++ b/google/cloud/translate/v3/internal/translation_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/translate/v3/internal/translation_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 translate_v3_internal { @@ -365,4 +368,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_V3_INTERNAL_TRANSLATION_AUTH_DECORATOR_H diff --git a/google/cloud/translate/v3/internal/translation_connection_impl.h b/google/cloud/translate/v3/internal/translation_connection_impl.h index b359ee0d56d5d..7c175d7926c67 100644 --- a/google/cloud/translate/v3/internal/translation_connection_impl.h +++ b/google/cloud/translate/v3/internal/translation_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/translate/v3/internal/translation_logging_decorator.cc b/google/cloud/translate/v3/internal/translation_logging_decorator.cc index 06145cc6a7394..eff0fffb72adf 100644 --- a/google/cloud/translate/v3/internal/translation_logging_decorator.cc +++ b/google/cloud/translate/v3/internal/translation_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/translate/v3/translation_service.proto #include "google/cloud/translate/v3/internal/translation_logging_decorator.h" +#include "google/cloud/translate/v3/translation_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace translate_v3_internal { @@ -861,3 +864,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace translate_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/translate/v3/internal/translation_logging_decorator.h b/google/cloud/translate/v3/internal/translation_logging_decorator.h index af943aea25d7d..933890a4470c3 100644 --- a/google/cloud/translate/v3/internal/translation_logging_decorator.h +++ b/google/cloud/translate/v3/internal/translation_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/translate/v3/internal/translation_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 translate_v3_internal { @@ -365,4 +368,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_V3_INTERNAL_TRANSLATION_LOGGING_DECORATOR_H diff --git a/google/cloud/translate/v3/internal/translation_metadata_decorator.cc b/google/cloud/translate/v3/internal/translation_metadata_decorator.cc index 6c63c29b22e32..b35562d3fbadf 100644 --- a/google/cloud/translate/v3/internal/translation_metadata_decorator.cc +++ b/google/cloud/translate/v3/internal/translation_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/translate/v3/translation_service.proto #include "google/cloud/translate/v3/internal/translation_metadata_decorator.h" +#include "google/cloud/translate/v3/translation_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 translate_v3_internal { @@ -627,3 +631,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace translate_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/translate/v3/internal/translation_metadata_decorator.h b/google/cloud/translate/v3/internal/translation_metadata_decorator.h index bb6765e84e444..07c35fca396be 100644 --- a/google/cloud/translate/v3/internal/translation_metadata_decorator.h +++ b/google/cloud/translate/v3/internal/translation_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/translate/v3/internal/translation_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 translate_v3_internal { @@ -371,4 +374,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_V3_INTERNAL_TRANSLATION_METADATA_DECORATOR_H diff --git a/google/cloud/translate/v3/internal/translation_option_defaults.cc b/google/cloud/translate/v3/internal/translation_option_defaults.cc index 0e1e4d2120325..860317ca13c34 100644 --- a/google/cloud/translate/v3/internal/translation_option_defaults.cc +++ b/google/cloud/translate/v3/internal/translation_option_defaults.cc @@ -42,7 +42,7 @@ Options TranslationServiceDefaultOptions(Options options) { if (!options.has()) { options.set( translate_v3::TranslationServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/translate/v3/internal/translation_stub.cc b/google/cloud/translate/v3/internal/translation_stub.cc index aed06074902e4..51178be403408 100644 --- a/google/cloud/translate/v3/internal/translation_stub.cc +++ b/google/cloud/translate/v3/internal/translation_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/translate/v3/translation_service.proto #include "google/cloud/translate/v3/internal/translation_stub.h" +#include "google/cloud/translate/v3/translation_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace translate_v3_internal { @@ -830,3 +833,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace translate_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/translate/v3/internal/translation_stub.h b/google/cloud/translate/v3/internal/translation_stub.h index 31c1f3307eeb1..c8d2f445c6186 100644 --- a/google/cloud/translate/v3/internal/translation_stub.h +++ b/google/cloud/translate/v3/internal/translation_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_V3_INTERNAL_TRANSLATION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_V3_INTERNAL_TRANSLATION_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/translate/v3/translation_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace translate_v3_internal { @@ -690,4 +693,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_V3_INTERNAL_TRANSLATION_STUB_H diff --git a/google/cloud/translate/v3/internal/translation_stub_factory.cc b/google/cloud/translate/v3/internal/translation_stub_factory.cc index a714758e81371..91e0bd5c06da3 100644 --- a/google/cloud/translate/v3/internal/translation_stub_factory.cc +++ b/google/cloud/translate/v3/internal/translation_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/translate/v3/translation_service.proto #include "google/cloud/translate/v3/internal/translation_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/translate/v3/internal/translation_auth_decorator.h" #include "google/cloud/translate/v3/internal/translation_logging_decorator.h" #include "google/cloud/translate/v3/internal/translation_metadata_decorator.h" #include "google/cloud/translate/v3/internal/translation_stub.h" #include "google/cloud/translate/v3/internal/translation_tracing_stub.h" +#include "google/cloud/translate/v3/translation_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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace translate_v3_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace translate_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/translate/v3/internal/translation_stub_factory.h b/google/cloud/translate/v3/internal/translation_stub_factory.h index 02c1b0b44276c..1ff6c85d98dd8 100644 --- a/google/cloud/translate/v3/internal/translation_stub_factory.h +++ b/google/cloud/translate/v3/internal/translation_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace translate_v3_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_V3_INTERNAL_TRANSLATION_STUB_FACTORY_H diff --git a/google/cloud/translate/v3/internal/translation_tracing_connection.cc b/google/cloud/translate/v3/internal/translation_tracing_connection.cc index 60b2bc026667c..c6406c2d12f86 100644 --- a/google/cloud/translate/v3/internal/translation_tracing_connection.cc +++ b/google/cloud/translate/v3/internal/translation_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace translate_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TranslationServiceTracingConnection::TranslationServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -683,17 +681,13 @@ TranslationServiceTracingConnection::WaitOperation( return internal::EndSpan(*span, child_->WaitOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTranslationServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/translate/v3/internal/translation_tracing_connection.h b/google/cloud/translate/v3/internal/translation_tracing_connection.h index dd0d1fff38fa0..45a656593961e 100644 --- a/google/cloud/translate/v3/internal/translation_tracing_connection.h +++ b/google/cloud/translate/v3/internal/translation_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace translate_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TranslationServiceTracingConnection : public translate_v3::TranslationServiceConnection { public: @@ -313,8 +311,6 @@ class TranslationServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/translate/v3/internal/translation_tracing_stub.cc b/google/cloud/translate/v3/internal/translation_tracing_stub.cc index 15a512b2d569d..b3a3c9ac07e93 100644 --- a/google/cloud/translate/v3/internal/translation_tracing_stub.cc +++ b/google/cloud/translate/v3/internal/translation_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace translate_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TranslationServiceTracingStub::TranslationServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -776,18 +777,14 @@ future TranslationServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTranslationServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace translate_v3_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/translate/v3/internal/translation_tracing_stub.h b/google/cloud/translate/v3/internal/translation_tracing_stub.h index 0d42aa22cb63e..66308e2f677b5 100644 --- a/google/cloud/translate/v3/internal/translation_tracing_stub.h +++ b/google/cloud/translate/v3/internal/translation_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace translate_v3_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TranslationServiceTracingStub : public TranslationServiceStub { public: ~TranslationServiceTracingStub() override = default; @@ -361,8 +362,6 @@ class TranslationServiceTracingStub : public TranslationServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -377,4 +376,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_V3_INTERNAL_TRANSLATION_TRACING_STUB_H diff --git a/google/cloud/translate/v3/translation_client.h b/google/cloud/translate/v3/translation_client.h index 4749c8726b551..cb2afc0c57afa 100644 --- a/google/cloud/translate/v3/translation_client.h +++ b/google/cloud/translate/v3/translation_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/translate/v3/translation_connection.h b/google/cloud/translate/v3/translation_connection.h index c5f5552c29c61..b6bc8efa3ddfb 100644 --- a/google/cloud/translate/v3/translation_connection.h +++ b/google/cloud/translate/v3/translation_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/translate/v3/internal/translation_retry_traits.h" #include "google/cloud/translate/v3/translation_connection_idempotency_policy.h" +#include "google/cloud/translate/v3/translation_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/translate/v3/translation_connection_idempotency_policy.h b/google/cloud/translate/v3/translation_connection_idempotency_policy.h index 0b0c3d499fe1d..6d534dfb12915 100644 --- a/google/cloud/translate/v3/translation_connection_idempotency_policy.h +++ b/google/cloud/translate/v3/translation_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_V3_TRANSLATION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TRANSLATE_V3_TRANSLATION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/translate/v3/translation_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/universe_domain/demo/CMakeLists.txt b/google/cloud/universe_domain/demo/CMakeLists.txt index 06b8058d4291c..099913bd08e1e 100644 --- a/google/cloud/universe_domain/demo/CMakeLists.txt +++ b/google/cloud/universe_domain/demo/CMakeLists.txt @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations under # the License. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-universe-domain-demo CXX) find_package(google_cloud_cpp_bigquery REQUIRED) diff --git a/google/cloud/universe_domain/demo/WORKSPACE.bazel b/google/cloud/universe_domain/demo/WORKSPACE.bazel index 47fce2629da2f..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 = "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/universe_domain/integration_tests/BUILD.bazel b/google/cloud/universe_domain/integration_tests/BUILD.bazel index d566417998d08..91466c1b3169a 100644 --- a/google/cloud/universe_domain/integration_tests/BUILD.bazel +++ b/google/cloud/universe_domain/integration_tests/BUILD.bazel @@ -30,8 +30,8 @@ cc_test( "//:common", "//:universe_domain", "//google/cloud/testing_util:google_cloud_cpp_testing_private", - "@com_google_googletest//:gtest_main", "@google_cloud_cpp//:compute", "@google_cloud_cpp//:kms", + "@googletest//:gtest_main", ], ) 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/version.h b/google/cloud/version.h index 223e4ecb212e9..b440893708fce 100644 --- a/google/cloud/version.h +++ b/google/cloud/version.h @@ -107,9 +107,6 @@ int constexpr version() { std::string version_string(); GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -// TODO(#7463) - remove backwards compatibility namespaces -namespace v1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) -namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls) } // namespace cloud } // namespace google diff --git a/google/cloud/video/BUILD.bazel b/google/cloud/video/BUILD.bazel index 0645dff9ae20b..410a732725fc2 100644 --- a/google/cloud/video/BUILD.bazel +++ b/google/cloud/video/BUILD.bazel @@ -19,16 +19,15 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "livestream/v1/", "stitcher/v1/", "transcoder/v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/video/livestream/v1:livestream_cc_grpc", - "@com_google_googleapis//google/cloud/video/stitcher/v1:stitcher_cc_grpc", - "@com_google_googleapis//google/cloud/video/transcoder/v1:transcoder_cc_grpc", + "@googleapis//google/cloud/video/livestream/v1:livestream_cc_grpc", + "@googleapis//google/cloud/video/stitcher/v1:stitcher_cc_grpc", + "@googleapis//google/cloud/video/transcoder/v1:transcoder_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/video/CMakeLists.txt b/google/cloud/video/CMakeLists.txt index 133bebb28ce9e..3ee56bdf414b1 100644 --- a/google/cloud/video/CMakeLists.txt +++ b/google/cloud/video/CMakeLists.txt @@ -18,7 +18,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( video "A C++ Client Library for several Video Services" - SERVICE_DIRS "__EMPTY__" "livestream/v1/" "stitcher/v1/" "transcoder/v1/") + SERVICE_DIRS "livestream/v1/" "stitcher/v1/" "transcoder/v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(video_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/video/livestream/v1/internal/livestream_auth_decorator.cc b/google/cloud/video/livestream/v1/internal/livestream_auth_decorator.cc index 99b31020a71ac..8928f750b69e5 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_auth_decorator.cc +++ b/google/cloud/video/livestream/v1/internal/livestream_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/video/livestream/v1/service.proto #include "google/cloud/video/livestream/v1/internal/livestream_auth_decorator.h" -#include +#include "google/cloud/video/livestream/v1/service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_livestream_v1_internal { @@ -784,3 +787,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_livestream_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/livestream/v1/internal/livestream_auth_decorator.h b/google/cloud/video/livestream/v1/internal/livestream_auth_decorator.h index 31c73b783ffc1..b6b931b353165 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_auth_decorator.h +++ b/google/cloud/video/livestream/v1/internal/livestream_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/video/livestream/v1/internal/livestream_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 video_livestream_v1_internal { @@ -382,4 +385,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_V1_INTERNAL_LIVESTREAM_AUTH_DECORATOR_H diff --git a/google/cloud/video/livestream/v1/internal/livestream_connection_impl.h b/google/cloud/video/livestream/v1/internal/livestream_connection_impl.h index 219b038ce8499..2feafc3bb1d35 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_connection_impl.h +++ b/google/cloud/video/livestream/v1/internal/livestream_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/video/livestream/v1/internal/livestream_logging_decorator.cc b/google/cloud/video/livestream/v1/internal/livestream_logging_decorator.cc index c75665e1c2ac6..85d5af1d29dd9 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_logging_decorator.cc +++ b/google/cloud/video/livestream/v1/internal/livestream_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/video/livestream/v1/service.proto #include "google/cloud/video/livestream/v1/internal/livestream_logging_decorator.h" +#include "google/cloud/video/livestream/v1/service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_livestream_v1_internal { @@ -937,3 +940,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_livestream_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/livestream/v1/internal/livestream_logging_decorator.h b/google/cloud/video/livestream/v1/internal/livestream_logging_decorator.h index 3513c6ce0901d..ab226a4b3990c 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_logging_decorator.h +++ b/google/cloud/video/livestream/v1/internal/livestream_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/video/livestream/v1/internal/livestream_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 video_livestream_v1_internal { @@ -382,4 +385,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_V1_INTERNAL_LIVESTREAM_LOGGING_DECORATOR_H diff --git a/google/cloud/video/livestream/v1/internal/livestream_metadata_decorator.cc b/google/cloud/video/livestream/v1/internal/livestream_metadata_decorator.cc index ee103d3434eeb..35589e3e69491 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_metadata_decorator.cc +++ b/google/cloud/video/livestream/v1/internal/livestream_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/video/livestream/v1/service.proto #include "google/cloud/video/livestream/v1/internal/livestream_metadata_decorator.h" +#include "google/cloud/video/livestream/v1/service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 video_livestream_v1_internal { @@ -667,3 +671,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_livestream_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/livestream/v1/internal/livestream_metadata_decorator.h b/google/cloud/video/livestream/v1/internal/livestream_metadata_decorator.h index 5368cc30590b3..9a06b10a11dd4 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_metadata_decorator.h +++ b/google/cloud/video/livestream/v1/internal/livestream_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/video/livestream/v1/internal/livestream_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 video_livestream_v1_internal { @@ -388,4 +391,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_V1_INTERNAL_LIVESTREAM_METADATA_DECORATOR_H diff --git a/google/cloud/video/livestream/v1/internal/livestream_option_defaults.cc b/google/cloud/video/livestream/v1/internal/livestream_option_defaults.cc index 1a3e0b2bd90d9..94b5c822dd112 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_option_defaults.cc +++ b/google/cloud/video/livestream/v1/internal/livestream_option_defaults.cc @@ -42,7 +42,7 @@ Options LivestreamServiceDefaultOptions(Options options) { if (!options.has()) { options.set( video_livestream_v1::LivestreamServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/video/livestream/v1/internal/livestream_stub.cc b/google/cloud/video/livestream/v1/internal/livestream_stub.cc index cd4636a760dda..027d6b9cfaf7d 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_stub.cc +++ b/google/cloud/video/livestream/v1/internal/livestream_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/video/livestream/v1/service.proto #include "google/cloud/video/livestream/v1/internal/livestream_stub.h" +#include "google/cloud/video/livestream/v1/service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_livestream_v1_internal { @@ -909,3 +912,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_livestream_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/livestream/v1/internal/livestream_stub.h b/google/cloud/video/livestream/v1/internal/livestream_stub.h index 3de9dddf1ba30..9cf24ec6eb3cb 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_stub.h +++ b/google/cloud/video/livestream/v1/internal/livestream_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_V1_INTERNAL_LIVESTREAM_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_V1_INTERNAL_LIVESTREAM_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/video/livestream/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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_livestream_v1_internal { @@ -738,4 +741,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_V1_INTERNAL_LIVESTREAM_STUB_H diff --git a/google/cloud/video/livestream/v1/internal/livestream_stub_factory.cc b/google/cloud/video/livestream/v1/internal/livestream_stub_factory.cc index d26b5c68daf9d..dc81b404b15d9 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_stub_factory.cc +++ b/google/cloud/video/livestream/v1/internal/livestream_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/video/livestream/v1/service.proto #include "google/cloud/video/livestream/v1/internal/livestream_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/video/livestream/v1/internal/livestream_auth_decorator.h" #include "google/cloud/video/livestream/v1/internal/livestream_logging_decorator.h" #include "google/cloud/video/livestream/v1/internal/livestream_metadata_decorator.h" #include "google/cloud/video/livestream/v1/internal/livestream_stub.h" #include "google/cloud/video/livestream/v1/internal/livestream_tracing_stub.h" +#include "google/cloud/video/livestream/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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_livestream_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_livestream_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/livestream/v1/internal/livestream_stub_factory.h b/google/cloud/video/livestream/v1/internal/livestream_stub_factory.h index 845a3af2fa150..96ac060016987 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_stub_factory.h +++ b/google/cloud/video/livestream/v1/internal/livestream_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_livestream_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_V1_INTERNAL_LIVESTREAM_STUB_FACTORY_H diff --git a/google/cloud/video/livestream/v1/internal/livestream_tracing_connection.cc b/google/cloud/video/livestream/v1/internal/livestream_tracing_connection.cc index dd220ca4e5464..27297cf88a5f5 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_tracing_connection.cc +++ b/google/cloud/video/livestream/v1/internal/livestream_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace video_livestream_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LivestreamServiceTracingConnection::LivestreamServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -774,17 +772,13 @@ Status LivestreamServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLivestreamServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/video/livestream/v1/internal/livestream_tracing_connection.h b/google/cloud/video/livestream/v1/internal/livestream_tracing_connection.h index 93cb208ecbe05..850315a6dc2dd 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_tracing_connection.h +++ b/google/cloud/video/livestream/v1/internal/livestream_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace video_livestream_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LivestreamServiceTracingConnection : public video_livestream_v1::LivestreamServiceConnection { public: @@ -352,8 +350,6 @@ class LivestreamServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/video/livestream/v1/internal/livestream_tracing_stub.cc b/google/cloud/video/livestream/v1/internal/livestream_tracing_stub.cc index f793776ad0bc7..0344a2378ec43 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_tracing_stub.cc +++ b/google/cloud/video/livestream/v1/internal/livestream_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_livestream_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - LivestreamServiceTracingStub::LivestreamServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -807,18 +808,14 @@ future LivestreamServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeLivestreamServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_livestream_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/livestream/v1/internal/livestream_tracing_stub.h b/google/cloud/video/livestream/v1/internal/livestream_tracing_stub.h index 5d039688baefe..00d8f412895d9 100644 --- a/google/cloud/video/livestream/v1/internal/livestream_tracing_stub.h +++ b/google/cloud/video/livestream/v1/internal/livestream_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_livestream_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class LivestreamServiceTracingStub : public LivestreamServiceStub { public: ~LivestreamServiceTracingStub() override = default; @@ -378,8 +379,6 @@ class LivestreamServiceTracingStub : public LivestreamServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -394,4 +393,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_V1_INTERNAL_LIVESTREAM_TRACING_STUB_H diff --git a/google/cloud/video/livestream/v1/livestream_client.h b/google/cloud/video/livestream/v1/livestream_client.h index ecd259feade87..e2babb07923e8 100644 --- a/google/cloud/video/livestream/v1/livestream_client.h +++ b/google/cloud/video/livestream/v1/livestream_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/livestream/v1/livestream_connection.h b/google/cloud/video/livestream/v1/livestream_connection.h index a683cc15903ff..8bd63ac7c412f 100644 --- a/google/cloud/video/livestream/v1/livestream_connection.h +++ b/google/cloud/video/livestream/v1/livestream_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/video/livestream/v1/internal/livestream_retry_traits.h" #include "google/cloud/video/livestream/v1/livestream_connection_idempotency_policy.h" +#include "google/cloud/video/livestream/v1/service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/video/livestream/v1/livestream_connection_idempotency_policy.h b/google/cloud/video/livestream/v1/livestream_connection_idempotency_policy.h index ffb13a32e5ddb..f4518c052d3ff 100644 --- a/google/cloud/video/livestream/v1/livestream_connection_idempotency_policy.h +++ b/google/cloud/video/livestream/v1/livestream_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_V1_LIVESTREAM_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_V1_LIVESTREAM_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/video/livestream/v1/service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/video/livestream_client.h b/google/cloud/video/livestream_client.h deleted file mode 100644 index b14706665cf6d..0000000000000 --- a/google/cloud/video/livestream_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/livestream/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_CLIENT_H - -#include "google/cloud/video/livestream/v1/livestream_client.h" -#include "google/cloud/video/livestream_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in video_livestream_v1 instead of the aliases defined in -/// this namespace. -namespace video { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use video_livestream_v1::LivestreamServiceClient directly. -using ::google::cloud::video_livestream_v1::LivestreamServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_CLIENT_H diff --git a/google/cloud/video/livestream_connection.h b/google/cloud/video/livestream_connection.h deleted file mode 100644 index e83060959d68b..0000000000000 --- a/google/cloud/video/livestream_connection.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/livestream/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_CONNECTION_H - -#include "google/cloud/video/livestream/v1/livestream_connection.h" -#include "google/cloud/video/livestream_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace video { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use video_livestream_v1::MakeLivestreamServiceConnection -/// directly. -using ::google::cloud::video_livestream_v1::MakeLivestreamServiceConnection; - -/// @deprecated Use video_livestream_v1::LivestreamServiceConnection directly. -using ::google::cloud::video_livestream_v1::LivestreamServiceConnection; - -/// @deprecated Use -/// video_livestream_v1::LivestreamServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::video_livestream_v1:: - LivestreamServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use video_livestream_v1::LivestreamServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::video_livestream_v1:: - LivestreamServiceLimitedTimeRetryPolicy; - -/// @deprecated Use video_livestream_v1::LivestreamServiceRetryPolicy directly. -using ::google::cloud::video_livestream_v1::LivestreamServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_CONNECTION_H diff --git a/google/cloud/video/livestream_connection_idempotency_policy.h b/google/cloud/video/livestream_connection_idempotency_policy.h deleted file mode 100644 index beb1880a11dfd..0000000000000 --- a/google/cloud/video/livestream_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/livestream/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/video/livestream/v1/livestream_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace video { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// video_livestream_v1::MakeDefaultLivestreamServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::video_livestream_v1:: - MakeDefaultLivestreamServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// video_livestream_v1::LivestreamServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::video_livestream_v1:: - LivestreamServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/video/livestream_options.h b/google/cloud/video/livestream_options.h deleted file mode 100644 index 4c4d8577e9236..0000000000000 --- a/google/cloud/video/livestream_options.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/livestream/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_OPTIONS_H - -#include "google/cloud/video/livestream/v1/livestream_options.h" -#include "google/cloud/video/livestream_connection.h" -#include "google/cloud/video/livestream_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace video { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use video_livestream_v1::LivestreamServicePollingPolicyOption -/// directly. -using ::google::cloud::video_livestream_v1:: - LivestreamServicePollingPolicyOption; - -/// @deprecated Use video_livestream_v1::LivestreamServiceBackoffPolicyOption -/// directly. -using ::google::cloud::video_livestream_v1:: - LivestreamServiceBackoffPolicyOption; - -/// @deprecated Use -/// video_livestream_v1::LivestreamServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::video_livestream_v1:: - LivestreamServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use video_livestream_v1::LivestreamServicePolicyOptionList -/// directly. -using ::google::cloud::video_livestream_v1::LivestreamServicePolicyOptionList; - -/// @deprecated Use video_livestream_v1::LivestreamServiceRetryPolicyOption -/// directly. -using ::google::cloud::video_livestream_v1::LivestreamServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_LIVESTREAM_OPTIONS_H diff --git a/google/cloud/video/mocks/mock_livestream_connection.h b/google/cloud/video/mocks/mock_livestream_connection.h deleted file mode 100644 index cb1936dadbae3..0000000000000 --- a/google/cloud/video/mocks/mock_livestream_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/livestream/v1/service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_MOCKS_MOCK_LIVESTREAM_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_MOCKS_MOCK_LIVESTREAM_CONNECTION_H - -#include "google/cloud/video/livestream/v1/mocks/mock_livestream_connection.h" -#include "google/cloud/video/livestream_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in video_livestream_v1_mocks instead of the aliases -/// defined in this namespace. -namespace video_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use video_livestream_v1_mocks::MockLivestreamServiceConnection -/// directly. -using ::google::cloud::video_livestream_v1_mocks:: - MockLivestreamServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_MOCKS_MOCK_LIVESTREAM_CONNECTION_H diff --git a/google/cloud/video/mocks/mock_transcoder_connection.h b/google/cloud/video/mocks/mock_transcoder_connection.h deleted file mode 100644 index 89ef017dc4dc3..0000000000000 --- a/google/cloud/video/mocks/mock_transcoder_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/transcoder/v1/services.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_MOCKS_MOCK_TRANSCODER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_MOCKS_MOCK_TRANSCODER_CONNECTION_H - -#include "google/cloud/video/transcoder/v1/mocks/mock_transcoder_connection.h" -#include "google/cloud/video/transcoder_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in video_transcoder_v1_mocks instead of the aliases -/// defined in this namespace. -namespace video_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use video_transcoder_v1_mocks::MockTranscoderServiceConnection -/// directly. -using ::google::cloud::video_transcoder_v1_mocks:: - MockTranscoderServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_MOCKS_MOCK_TRANSCODER_CONNECTION_H diff --git a/google/cloud/video/mocks/mock_video_stitcher_connection.h b/google/cloud/video/mocks/mock_video_stitcher_connection.h deleted file mode 100644 index 2cff109b83ab4..0000000000000 --- a/google/cloud/video/mocks/mock_video_stitcher_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/stitcher/v1/video_stitcher_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_MOCKS_MOCK_VIDEO_STITCHER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_MOCKS_MOCK_VIDEO_STITCHER_CONNECTION_H - -#include "google/cloud/video/stitcher/v1/mocks/mock_video_stitcher_connection.h" -#include "google/cloud/video/video_stitcher_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in video_stitcher_v1_mocks instead of the aliases -/// defined in this namespace. -namespace video_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use video_stitcher_v1_mocks::MockVideoStitcherServiceConnection -/// directly. -using ::google::cloud::video_stitcher_v1_mocks:: - MockVideoStitcherServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_MOCKS_MOCK_VIDEO_STITCHER_CONNECTION_H diff --git a/google/cloud/video/quickstart/.bazelrc b/google/cloud/video/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/video/quickstart/.bazelrc +++ b/google/cloud/video/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/video/quickstart/CMakeLists.txt index 0d73957973a6e..6fcf838ea1c12 100644 --- a/google/cloud/video/quickstart/CMakeLists.txt +++ b/google/cloud/video/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the video services C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-video-quickstart CXX) find_package(google_cloud_cpp_video REQUIRED) diff --git a/google/cloud/video/quickstart/WORKSPACE.bazel b/google/cloud/video/quickstart/WORKSPACE.bazel index 4d6f724ce6484..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 = "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/video/stitcher/v1/internal/video_stitcher_auth_decorator.cc b/google/cloud/video/stitcher/v1/internal/video_stitcher_auth_decorator.cc index 5cc315f8e23f6..c9d117ff61ca5 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_auth_decorator.cc +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/video/stitcher/v1/video_stitcher_service.proto #include "google/cloud/video/stitcher/v1/internal/video_stitcher_auth_decorator.h" -#include +#include "google/cloud/video/stitcher/v1/video_stitcher_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_stitcher_v1_internal { @@ -622,3 +625,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_stitcher_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_auth_decorator.h b/google/cloud/video/stitcher/v1/internal/video_stitcher_auth_decorator.h index 563f464d358a2..39831f3537762 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_auth_decorator.h +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/video/stitcher/v1/internal/video_stitcher_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 video_stitcher_v1_internal { @@ -319,4 +322,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_STITCHER_V1_INTERNAL_VIDEO_STITCHER_AUTH_DECORATOR_H diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_connection_impl.h b/google/cloud/video/stitcher/v1/internal/video_stitcher_connection_impl.h index 3523612f19fe4..b472b8fbd174f 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_connection_impl.h +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_logging_decorator.cc b/google/cloud/video/stitcher/v1/internal/video_stitcher_logging_decorator.cc index 11f059eee2f68..3b64e6cd4bb0d 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_logging_decorator.cc +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/video/stitcher/v1/video_stitcher_service.proto #include "google/cloud/video/stitcher/v1/internal/video_stitcher_logging_decorator.h" +#include "google/cloud/video/stitcher/v1/video_stitcher_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_stitcher_v1_internal { @@ -757,3 +760,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_stitcher_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_logging_decorator.h b/google/cloud/video/stitcher/v1/internal/video_stitcher_logging_decorator.h index c632efaaca40d..eaa97d5d35498 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_logging_decorator.h +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/video/stitcher/v1/internal/video_stitcher_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 video_stitcher_v1_internal { @@ -319,4 +322,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_STITCHER_V1_INTERNAL_VIDEO_STITCHER_LOGGING_DECORATOR_H diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_metadata_decorator.cc b/google/cloud/video/stitcher/v1/internal/video_stitcher_metadata_decorator.cc index 37a7ef5e45bc4..d9f75cf51dcf6 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_metadata_decorator.cc +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/video/stitcher/v1/video_stitcher_service.proto #include "google/cloud/video/stitcher/v1/internal/video_stitcher_metadata_decorator.h" +#include "google/cloud/video/stitcher/v1/video_stitcher_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 video_stitcher_v1_internal { @@ -554,3 +558,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_stitcher_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_metadata_decorator.h b/google/cloud/video/stitcher/v1/internal/video_stitcher_metadata_decorator.h index 80834c1bc2074..9290f7b9ab3b8 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_metadata_decorator.h +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/video/stitcher/v1/internal/video_stitcher_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 video_stitcher_v1_internal { @@ -325,4 +328,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_STITCHER_V1_INTERNAL_VIDEO_STITCHER_METADATA_DECORATOR_H diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_option_defaults.cc b/google/cloud/video/stitcher/v1/internal/video_stitcher_option_defaults.cc index 23137f9678138..67d47d09d5adc 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_option_defaults.cc +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_option_defaults.cc @@ -43,7 +43,7 @@ Options VideoStitcherServiceDefaultOptions(Options options) { .has()) { options.set( video_stitcher_v1::VideoStitcherServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_stub.cc b/google/cloud/video/stitcher/v1/internal/video_stitcher_stub.cc index ff6895c41746d..881f8e4273a30 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_stub.cc +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/video/stitcher/v1/video_stitcher_service.proto #include "google/cloud/video/stitcher/v1/internal/video_stitcher_stub.h" +#include "google/cloud/video/stitcher/v1/video_stitcher_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_stitcher_v1_internal { @@ -722,3 +725,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_stitcher_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_stub.h b/google/cloud/video/stitcher/v1/internal/video_stitcher_stub.h index a51a4f06b96d8..c1210febda842 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_stub.h +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_STITCHER_V1_INTERNAL_VIDEO_STITCHER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_STITCHER_V1_INTERNAL_VIDEO_STITCHER_STUB_H +#include "google/cloud/video/stitcher/v1/video_stitcher_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_stitcher_v1_internal { @@ -610,4 +613,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_STITCHER_V1_INTERNAL_VIDEO_STITCHER_STUB_H diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_stub_factory.cc b/google/cloud/video/stitcher/v1/internal/video_stitcher_stub_factory.cc index f465cb88f44ba..cb674ef266a5f 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_stub_factory.cc +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/video/stitcher/v1/internal/video_stitcher_metadata_decorator.h" #include "google/cloud/video/stitcher/v1/internal/video_stitcher_stub.h" #include "google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_stub.h" +#include "google/cloud/video/stitcher/v1/video_stitcher_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_stitcher_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_stitcher_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_stub_factory.h b/google/cloud/video/stitcher/v1/internal/video_stitcher_stub_factory.h index ee57f7f720962..527fa513bb4eb 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_stub_factory.h +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_stitcher_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_STITCHER_V1_INTERNAL_VIDEO_STITCHER_STUB_FACTORY_H diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_connection.cc b/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_connection.cc index 1a75d9648dd1d..8673801e2456a 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_connection.cc +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace video_stitcher_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VideoStitcherServiceTracingConnection::VideoStitcherServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -610,17 +608,13 @@ Status VideoStitcherServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVideoStitcherServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_connection.h b/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_connection.h index b6bafe487ed7d..c248ae784c991 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_connection.h +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace video_stitcher_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VideoStitcherServiceTracingConnection : public video_stitcher_v1::VideoStitcherServiceConnection { public: @@ -282,8 +280,6 @@ class VideoStitcherServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_stub.cc b/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_stub.cc index e11682c414695..62995631801f5 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_stub.cc +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_stitcher_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VideoStitcherServiceTracingStub::VideoStitcherServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -668,18 +669,14 @@ future VideoStitcherServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVideoStitcherServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_stitcher_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_stub.h b/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_stub.h index 72173df39ce7c..802e331ac6111 100644 --- a/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_stub.h +++ b/google/cloud/video/stitcher/v1/internal/video_stitcher_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_stitcher_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VideoStitcherServiceTracingStub : public VideoStitcherServiceStub { public: ~VideoStitcherServiceTracingStub() override = default; @@ -315,8 +316,6 @@ class VideoStitcherServiceTracingStub : public VideoStitcherServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -331,4 +330,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_STITCHER_V1_INTERNAL_VIDEO_STITCHER_TRACING_STUB_H diff --git a/google/cloud/video/stitcher/v1/video_stitcher_client.h b/google/cloud/video/stitcher/v1/video_stitcher_client.h index 9ad7b1c43e54c..865e480c35051 100644 --- a/google/cloud/video/stitcher/v1/video_stitcher_client.h +++ b/google/cloud/video/stitcher/v1/video_stitcher_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/video/stitcher/v1/video_stitcher_connection.h b/google/cloud/video/stitcher/v1/video_stitcher_connection.h index def48d7fce5f9..946a3d9b7ce7b 100644 --- a/google/cloud/video/stitcher/v1/video_stitcher_connection.h +++ b/google/cloud/video/stitcher/v1/video_stitcher_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/video/stitcher/v1/internal/video_stitcher_retry_traits.h" #include "google/cloud/video/stitcher/v1/video_stitcher_connection_idempotency_policy.h" +#include "google/cloud/video/stitcher/v1/video_stitcher_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/video/stitcher/v1/video_stitcher_connection_idempotency_policy.h b/google/cloud/video/stitcher/v1/video_stitcher_connection_idempotency_policy.h index 65211da76256a..2f2342f9e98ed 100644 --- a/google/cloud/video/stitcher/v1/video_stitcher_connection_idempotency_policy.h +++ b/google/cloud/video/stitcher/v1/video_stitcher_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_STITCHER_V1_VIDEO_STITCHER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_STITCHER_V1_VIDEO_STITCHER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/video/stitcher/v1/video_stitcher_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_auth_decorator.cc b/google/cloud/video/transcoder/v1/internal/transcoder_auth_decorator.cc index bf6646a11f16d..97e023ca3eb66 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_auth_decorator.cc +++ b/google/cloud/video/transcoder/v1/internal/transcoder_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/video/transcoder/v1/services.proto #include "google/cloud/video/transcoder/v1/internal/transcoder_auth_decorator.h" -#include +#include "google/cloud/video/transcoder/v1/services.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_transcoder_v1_internal { @@ -109,3 +112,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_transcoder_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_auth_decorator.h b/google/cloud/video/transcoder/v1/internal/transcoder_auth_decorator.h index fab56d5de46c9..7b93c29d52ccd 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_auth_decorator.h +++ b/google/cloud/video/transcoder/v1/internal/transcoder_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_transcoder_v1_internal { @@ -88,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_V1_INTERNAL_TRANSCODER_AUTH_DECORATOR_H diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_logging_decorator.cc b/google/cloud/video/transcoder/v1/internal/transcoder_logging_decorator.cc index dc35330916f64..e46ab40e395d3 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_logging_decorator.cc +++ b/google/cloud/video/transcoder/v1/internal/transcoder_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/video/transcoder/v1/services.proto #include "google/cloud/video/transcoder/v1/internal/transcoder_logging_decorator.h" +#include "google/cloud/video/transcoder/v1/services.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_transcoder_v1_internal { @@ -148,3 +151,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_transcoder_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_logging_decorator.h b/google/cloud/video/transcoder/v1/internal/transcoder_logging_decorator.h index 76f1646de6576..d079faaa71a4a 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_logging_decorator.h +++ b/google/cloud/video/transcoder/v1/internal/transcoder_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_transcoder_v1_internal { @@ -88,4 +91,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_V1_INTERNAL_TRANSCODER_LOGGING_DECORATOR_H diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_metadata_decorator.cc b/google/cloud/video/transcoder/v1/internal/transcoder_metadata_decorator.cc index b8f417b7c23fb..2d0eb913d8393 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_metadata_decorator.cc +++ b/google/cloud/video/transcoder/v1/internal/transcoder_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/video/transcoder/v1/services.proto #include "google/cloud/video/transcoder/v1/internal/transcoder_metadata_decorator.h" +#include "google/cloud/video/transcoder/v1/services.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 video_transcoder_v1_internal { @@ -135,3 +139,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_transcoder_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_metadata_decorator.h b/google/cloud/video/transcoder/v1/internal/transcoder_metadata_decorator.h index 966772e222e41..556a8c4416af9 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_metadata_decorator.h +++ b/google/cloud/video/transcoder/v1/internal/transcoder_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_transcoder_v1_internal { @@ -94,4 +97,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_V1_INTERNAL_TRANSCODER_METADATA_DECORATOR_H diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_option_defaults.cc b/google/cloud/video/transcoder/v1/internal/transcoder_option_defaults.cc index afbc76b80fff6..d243d3a064f0d 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_option_defaults.cc +++ b/google/cloud/video/transcoder/v1/internal/transcoder_option_defaults.cc @@ -42,7 +42,7 @@ Options TranscoderServiceDefaultOptions(Options options) { if (!options.has()) { options.set( video_transcoder_v1::TranscoderServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_stub.cc b/google/cloud/video/transcoder/v1/internal/transcoder_stub.cc index e2358f9d0d25f..553085f1e6f91 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_stub.cc +++ b/google/cloud/video/transcoder/v1/internal/transcoder_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/video/transcoder/v1/services.proto #include "google/cloud/video/transcoder/v1/internal/transcoder_stub.h" +#include "google/cloud/video/transcoder/v1/services.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_transcoder_v1_internal { @@ -132,3 +135,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_transcoder_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_stub.h b/google/cloud/video/transcoder/v1/internal/transcoder_stub.h index a98fc22290da1..c14ce5d15f103 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_stub.h +++ b/google/cloud/video/transcoder/v1/internal/transcoder_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_V1_INTERNAL_TRANSCODER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_V1_INTERNAL_TRANSCODER_STUB_H +#include "google/cloud/video/transcoder/v1/services.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_transcoder_v1_internal { @@ -138,4 +141,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_V1_INTERNAL_TRANSCODER_STUB_H diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_stub_factory.cc b/google/cloud/video/transcoder/v1/internal/transcoder_stub_factory.cc index 419f4e1c2e967..d50c078914819 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_stub_factory.cc +++ b/google/cloud/video/transcoder/v1/internal/transcoder_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/video/transcoder/v1/internal/transcoder_metadata_decorator.h" #include "google/cloud/video/transcoder/v1/internal/transcoder_stub.h" #include "google/cloud/video/transcoder/v1/internal/transcoder_tracing_stub.h" +#include "google/cloud/video/transcoder/v1/services.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_transcoder_v1_internal { @@ -70,3 +73,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_transcoder_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_stub_factory.h b/google/cloud/video/transcoder/v1/internal/transcoder_stub_factory.h index 35b5c2c47e8c7..1d9eeca784644 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_stub_factory.h +++ b/google/cloud/video/transcoder/v1/internal/transcoder_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_transcoder_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_V1_INTERNAL_TRANSCODER_STUB_FACTORY_H diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_tracing_connection.cc b/google/cloud/video/transcoder/v1/internal/transcoder_tracing_connection.cc index 7a6a467f0dcd3..7bf10a3d50718 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_tracing_connection.cc +++ b/google/cloud/video/transcoder/v1/internal/transcoder_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace video_transcoder_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TranscoderServiceTracingConnection::TranscoderServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -112,17 +110,13 @@ Status TranscoderServiceTracingConnection::DeleteJobTemplate( return internal::EndSpan(*span, child_->DeleteJobTemplate(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTranscoderServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_tracing_connection.h b/google/cloud/video/transcoder/v1/internal/transcoder_tracing_connection.h index f8b8dcf80591d..51cd6a30f27c9 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_tracing_connection.h +++ b/google/cloud/video/transcoder/v1/internal/transcoder_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace video_transcoder_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TranscoderServiceTracingConnection : public video_transcoder_v1::TranscoderServiceConnection { public: @@ -74,8 +72,6 @@ class TranscoderServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_tracing_stub.cc b/google/cloud/video/transcoder/v1/internal/transcoder_tracing_stub.cc index 645ebcc29d2d6..e8f27c16912e3 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_tracing_stub.cc +++ b/google/cloud/video/transcoder/v1/internal/transcoder_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_transcoder_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - TranscoderServiceTracingStub::TranscoderServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -132,18 +133,14 @@ Status TranscoderServiceTracingStub::DeleteJobTemplate( context, *span, child_->DeleteJobTemplate(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeTranscoderServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace video_transcoder_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/video/transcoder/v1/internal/transcoder_tracing_stub.h b/google/cloud/video/transcoder/v1/internal/transcoder_tracing_stub.h index ac475ea2c60ff..f7d5bcbe48e89 100644 --- a/google/cloud/video/transcoder/v1/internal/transcoder_tracing_stub.h +++ b/google/cloud/video/transcoder/v1/internal/transcoder_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace video_transcoder_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class TranscoderServiceTracingStub : public TranscoderServiceStub { public: ~TranscoderServiceTracingStub() override = default; @@ -85,8 +86,6 @@ class TranscoderServiceTracingStub : public TranscoderServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -101,4 +100,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_V1_INTERNAL_TRANSCODER_TRACING_STUB_H diff --git a/google/cloud/video/transcoder/v1/transcoder_connection.h b/google/cloud/video/transcoder/v1/transcoder_connection.h index ba26962f261d0..c059eebaea2d5 100644 --- a/google/cloud/video/transcoder/v1/transcoder_connection.h +++ b/google/cloud/video/transcoder/v1/transcoder_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_V1_TRANSCODER_CONNECTION_H #include "google/cloud/video/transcoder/v1/internal/transcoder_retry_traits.h" +#include "google/cloud/video/transcoder/v1/services.pb.h" #include "google/cloud/video/transcoder/v1/transcoder_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/video/transcoder/v1/transcoder_connection_idempotency_policy.h b/google/cloud/video/transcoder/v1/transcoder_connection_idempotency_policy.h index c5bfcacf14e75..8d888abe32ff5 100644 --- a/google/cloud/video/transcoder/v1/transcoder_connection_idempotency_policy.h +++ b/google/cloud/video/transcoder/v1/transcoder_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_V1_TRANSCODER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_V1_TRANSCODER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/video/transcoder/v1/services.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/video/transcoder_client.h b/google/cloud/video/transcoder_client.h deleted file mode 100644 index bc92b7666ad53..0000000000000 --- a/google/cloud/video/transcoder_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/transcoder/v1/services.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_CLIENT_H - -#include "google/cloud/video/transcoder/v1/transcoder_client.h" -#include "google/cloud/video/transcoder_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in video_transcoder_v1 instead of the aliases defined in -/// this namespace. -namespace video { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use video_transcoder_v1::TranscoderServiceClient directly. -using ::google::cloud::video_transcoder_v1::TranscoderServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_CLIENT_H diff --git a/google/cloud/video/transcoder_connection.h b/google/cloud/video/transcoder_connection.h deleted file mode 100644 index 5cbe3ff2dff96..0000000000000 --- a/google/cloud/video/transcoder_connection.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/transcoder/v1/services.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_CONNECTION_H - -#include "google/cloud/video/transcoder/v1/transcoder_connection.h" -#include "google/cloud/video/transcoder_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace video { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use video_transcoder_v1::MakeTranscoderServiceConnection -/// directly. -using ::google::cloud::video_transcoder_v1::MakeTranscoderServiceConnection; - -/// @deprecated Use video_transcoder_v1::TranscoderServiceConnection directly. -using ::google::cloud::video_transcoder_v1::TranscoderServiceConnection; - -/// @deprecated Use -/// video_transcoder_v1::TranscoderServiceLimitedErrorCountRetryPolicy directly. -using ::google::cloud::video_transcoder_v1:: - TranscoderServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use video_transcoder_v1::TranscoderServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::video_transcoder_v1:: - TranscoderServiceLimitedTimeRetryPolicy; - -/// @deprecated Use video_transcoder_v1::TranscoderServiceRetryPolicy directly. -using ::google::cloud::video_transcoder_v1::TranscoderServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_CONNECTION_H diff --git a/google/cloud/video/transcoder_connection_idempotency_policy.h b/google/cloud/video/transcoder_connection_idempotency_policy.h deleted file mode 100644 index 3a2f147d15a22..0000000000000 --- a/google/cloud/video/transcoder_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/transcoder/v1/services.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/video/transcoder/v1/transcoder_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace video { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// video_transcoder_v1::MakeDefaultTranscoderServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::video_transcoder_v1:: - MakeDefaultTranscoderServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// video_transcoder_v1::TranscoderServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::video_transcoder_v1:: - TranscoderServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/video/transcoder_options.h b/google/cloud/video/transcoder_options.h deleted file mode 100644 index a23161a033a0d..0000000000000 --- a/google/cloud/video/transcoder_options.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/transcoder/v1/services.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_OPTIONS_H - -#include "google/cloud/video/transcoder/v1/transcoder_options.h" -#include "google/cloud/video/transcoder_connection.h" -#include "google/cloud/video/transcoder_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace video { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use video_transcoder_v1::TranscoderServiceBackoffPolicyOption -/// directly. -using ::google::cloud::video_transcoder_v1:: - TranscoderServiceBackoffPolicyOption; - -/// @deprecated Use -/// video_transcoder_v1::TranscoderServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::video_transcoder_v1:: - TranscoderServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use video_transcoder_v1::TranscoderServicePolicyOptionList -/// directly. -using ::google::cloud::video_transcoder_v1::TranscoderServicePolicyOptionList; - -/// @deprecated Use video_transcoder_v1::TranscoderServiceRetryPolicyOption -/// directly. -using ::google::cloud::video_transcoder_v1::TranscoderServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_TRANSCODER_OPTIONS_H diff --git a/google/cloud/video/video_stitcher_client.h b/google/cloud/video/video_stitcher_client.h deleted file mode 100644 index 116e866ec9cfe..0000000000000 --- a/google/cloud/video/video_stitcher_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/stitcher/v1/video_stitcher_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_VIDEO_STITCHER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_VIDEO_STITCHER_CLIENT_H - -#include "google/cloud/video/stitcher/v1/video_stitcher_client.h" -#include "google/cloud/video/video_stitcher_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in video_stitcher_v1 instead of the aliases defined in -/// this namespace. -namespace video { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use video_stitcher_v1::VideoStitcherServiceClient directly. -using ::google::cloud::video_stitcher_v1::VideoStitcherServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_VIDEO_STITCHER_CLIENT_H diff --git a/google/cloud/video/video_stitcher_connection.h b/google/cloud/video/video_stitcher_connection.h deleted file mode 100644 index d6f5869731038..0000000000000 --- a/google/cloud/video/video_stitcher_connection.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/stitcher/v1/video_stitcher_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_VIDEO_STITCHER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_VIDEO_STITCHER_CONNECTION_H - -#include "google/cloud/video/stitcher/v1/video_stitcher_connection.h" -#include "google/cloud/video/video_stitcher_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace video { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use video_stitcher_v1::MakeVideoStitcherServiceConnection -/// directly. -using ::google::cloud::video_stitcher_v1::MakeVideoStitcherServiceConnection; - -/// @deprecated Use video_stitcher_v1::VideoStitcherServiceConnection directly. -using ::google::cloud::video_stitcher_v1::VideoStitcherServiceConnection; - -/// @deprecated Use -/// video_stitcher_v1::VideoStitcherServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::video_stitcher_v1:: - VideoStitcherServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// video_stitcher_v1::VideoStitcherServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::video_stitcher_v1:: - VideoStitcherServiceLimitedTimeRetryPolicy; - -/// @deprecated Use video_stitcher_v1::VideoStitcherServiceRetryPolicy directly. -using ::google::cloud::video_stitcher_v1::VideoStitcherServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_VIDEO_STITCHER_CONNECTION_H diff --git a/google/cloud/video/video_stitcher_connection_idempotency_policy.h b/google/cloud/video/video_stitcher_connection_idempotency_policy.h deleted file mode 100644 index 03f79a180c4c1..0000000000000 --- a/google/cloud/video/video_stitcher_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/stitcher/v1/video_stitcher_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_VIDEO_STITCHER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_VIDEO_STITCHER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/video/stitcher/v1/video_stitcher_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace video { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// video_stitcher_v1::MakeDefaultVideoStitcherServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::video_stitcher_v1:: - MakeDefaultVideoStitcherServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// video_stitcher_v1::VideoStitcherServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::video_stitcher_v1:: - VideoStitcherServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_VIDEO_STITCHER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/video/video_stitcher_options.h b/google/cloud/video/video_stitcher_options.h deleted file mode 100644 index d8c185ce006e4..0000000000000 --- a/google/cloud/video/video_stitcher_options.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/video/stitcher/v1/video_stitcher_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_VIDEO_STITCHER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_VIDEO_STITCHER_OPTIONS_H - -#include "google/cloud/video/stitcher/v1/video_stitcher_options.h" -#include "google/cloud/video/video_stitcher_connection.h" -#include "google/cloud/video/video_stitcher_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace video { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use video_stitcher_v1::VideoStitcherServicePollingPolicyOption -/// directly. -using ::google::cloud::video_stitcher_v1:: - VideoStitcherServicePollingPolicyOption; - -/// @deprecated Use video_stitcher_v1::VideoStitcherServiceBackoffPolicyOption -/// directly. -using ::google::cloud::video_stitcher_v1:: - VideoStitcherServiceBackoffPolicyOption; - -/// @deprecated Use -/// video_stitcher_v1::VideoStitcherServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::video_stitcher_v1:: - VideoStitcherServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use video_stitcher_v1::VideoStitcherServicePolicyOptionList -/// directly. -using ::google::cloud::video_stitcher_v1::VideoStitcherServicePolicyOptionList; - -/// @deprecated Use video_stitcher_v1::VideoStitcherServiceRetryPolicyOption -/// directly. -using ::google::cloud::video_stitcher_v1::VideoStitcherServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace video -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEO_VIDEO_STITCHER_OPTIONS_H diff --git a/google/cloud/videointelligence/BUILD.bazel b/google/cloud/videointelligence/BUILD.bazel index 9bb8d201de31e..4d2ea13e9fc55 100644 --- a/google/cloud/videointelligence/BUILD.bazel +++ b/google/cloud/videointelligence/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/videointelligence/v1:videointelligence_cc_grpc", + "@googleapis//google/cloud/videointelligence/v1:videointelligence_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/videointelligence/CMakeLists.txt b/google/cloud/videointelligence/CMakeLists.txt index 1091b26fa5939..d901774374835 100644 --- a/google/cloud/videointelligence/CMakeLists.txt +++ b/google/cloud/videointelligence/CMakeLists.txt @@ -17,8 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library( - videointelligence "Cloud Video Intelligence API" SERVICE_DIRS "__EMPTY__" - "v1/") + videointelligence "Cloud Video Intelligence API" SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(videointelligence_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/videointelligence/mocks/mock_video_intelligence_connection.h b/google/cloud/videointelligence/mocks/mock_video_intelligence_connection.h deleted file mode 100644 index fc79bbb2e43f9..0000000000000 --- a/google/cloud/videointelligence/mocks/mock_video_intelligence_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/videointelligence/v1/video_intelligence.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_MOCKS_MOCK_VIDEO_INTELLIGENCE_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_MOCKS_MOCK_VIDEO_INTELLIGENCE_CONNECTION_H - -#include "google/cloud/videointelligence/v1/mocks/mock_video_intelligence_connection.h" -#include "google/cloud/videointelligence/video_intelligence_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in videointelligence_v1_mocks instead of the aliases -/// defined in this namespace. -namespace videointelligence_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// videointelligence_v1_mocks::MockVideoIntelligenceServiceConnection directly. -using ::google::cloud::videointelligence_v1_mocks:: - MockVideoIntelligenceServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace videointelligence_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_MOCKS_MOCK_VIDEO_INTELLIGENCE_CONNECTION_H diff --git a/google/cloud/videointelligence/quickstart/.bazelrc b/google/cloud/videointelligence/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/videointelligence/quickstart/.bazelrc +++ b/google/cloud/videointelligence/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/videointelligence/quickstart/CMakeLists.txt index 82a83db6e1221..ce3a133671b63 100644 --- a/google/cloud/videointelligence/quickstart/CMakeLists.txt +++ b/google/cloud/videointelligence/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Video Intelligence API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-videointelligence-quickstart CXX) find_package(google_cloud_cpp_videointelligence REQUIRED) diff --git a/google/cloud/videointelligence/quickstart/WORKSPACE.bazel b/google/cloud/videointelligence/quickstart/WORKSPACE.bazel index 31aaa59b92a7c..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 = "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/videointelligence/v1/internal/video_intelligence_auth_decorator.cc b/google/cloud/videointelligence/v1/internal/video_intelligence_auth_decorator.cc index a9c74676ecc98..1a60ec25b1255 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_auth_decorator.cc +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/videointelligence/v1/video_intelligence.proto #include "google/cloud/videointelligence/v1/internal/video_intelligence_auth_decorator.h" -#include +#include "google/cloud/videointelligence/v1/video_intelligence.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace videointelligence_v1_internal { @@ -100,3 +103,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace videointelligence_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/videointelligence/v1/internal/video_intelligence_auth_decorator.h b/google/cloud/videointelligence/v1/internal/video_intelligence_auth_decorator.h index 883050768733c..3a0a2f67dc352 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_auth_decorator.h +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/videointelligence/v1/internal/video_intelligence_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 videointelligence_v1_internal { @@ -73,4 +76,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_V1_INTERNAL_VIDEO_INTELLIGENCE_AUTH_DECORATOR_H diff --git a/google/cloud/videointelligence/v1/internal/video_intelligence_connection_impl.h b/google/cloud/videointelligence/v1/internal/video_intelligence_connection_impl.h index 5f14e13459663..ad42f7b778d06 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_connection_impl.h +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_connection_impl.h @@ -31,7 +31,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/videointelligence/v1/internal/video_intelligence_logging_decorator.cc b/google/cloud/videointelligence/v1/internal/video_intelligence_logging_decorator.cc index 733a631dde268..a845ae9bcb1f4 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_logging_decorator.cc +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/videointelligence/v1/video_intelligence.proto #include "google/cloud/videointelligence/v1/internal/video_intelligence_logging_decorator.h" +#include "google/cloud/videointelligence/v1/video_intelligence.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace videointelligence_v1_internal { @@ -106,3 +109,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace videointelligence_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/videointelligence/v1/internal/video_intelligence_logging_decorator.h b/google/cloud/videointelligence/v1/internal/video_intelligence_logging_decorator.h index 2283912e9888b..e4a342413ccc2 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_logging_decorator.h +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/videointelligence/v1/internal/video_intelligence_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 videointelligence_v1_internal { @@ -73,4 +76,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_V1_INTERNAL_VIDEO_INTELLIGENCE_LOGGING_DECORATOR_H diff --git a/google/cloud/videointelligence/v1/internal/video_intelligence_metadata_decorator.cc b/google/cloud/videointelligence/v1/internal/video_intelligence_metadata_decorator.cc index f8cef953e940e..78bb748da30df 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_metadata_decorator.cc +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/videointelligence/v1/video_intelligence.proto #include "google/cloud/videointelligence/v1/internal/video_intelligence_metadata_decorator.h" +#include "google/cloud/videointelligence/v1/video_intelligence.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 videointelligence_v1_internal { @@ -103,3 +107,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace videointelligence_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/videointelligence/v1/internal/video_intelligence_metadata_decorator.h b/google/cloud/videointelligence/v1/internal/video_intelligence_metadata_decorator.h index f809250c095ee..52d14d21464d9 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_metadata_decorator.h +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/videointelligence/v1/internal/video_intelligence_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 videointelligence_v1_internal { @@ -79,4 +82,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_V1_INTERNAL_VIDEO_INTELLIGENCE_METADATA_DECORATOR_H diff --git a/google/cloud/videointelligence/v1/internal/video_intelligence_option_defaults.cc b/google/cloud/videointelligence/v1/internal/video_intelligence_option_defaults.cc index 54b4db02886af..51ebd120f48bf 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_option_defaults.cc +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_option_defaults.cc @@ -45,7 +45,7 @@ Options VideoIntelligenceServiceDefaultOptions(Options options) { options.set< videointelligence_v1::VideoIntelligenceServiceRetryPolicyOption>( videointelligence_v1::VideoIntelligenceServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace videointelligence_v1_internal { @@ -105,3 +108,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace videointelligence_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/videointelligence/v1/internal/video_intelligence_stub.h b/google/cloud/videointelligence/v1/internal/video_intelligence_stub.h index 06ba3bd07bae1..5d3ba4c49168f 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_stub.h +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_V1_INTERNAL_VIDEO_INTELLIGENCE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_V1_INTERNAL_VIDEO_INTELLIGENCE_STUB_H +#include "google/cloud/videointelligence/v1/video_intelligence.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace videointelligence_v1_internal { @@ -112,4 +115,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_V1_INTERNAL_VIDEO_INTELLIGENCE_STUB_H diff --git a/google/cloud/videointelligence/v1/internal/video_intelligence_stub_factory.cc b/google/cloud/videointelligence/v1/internal/video_intelligence_stub_factory.cc index 3e6e76b339ce5..182dbd23b4c29 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_stub_factory.cc +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/videointelligence/v1/internal/video_intelligence_metadata_decorator.h" #include "google/cloud/videointelligence/v1/internal/video_intelligence_stub.h" #include "google/cloud/videointelligence/v1/internal/video_intelligence_tracing_stub.h" +#include "google/cloud/videointelligence/v1/video_intelligence.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace videointelligence_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace videointelligence_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/videointelligence/v1/internal/video_intelligence_stub_factory.h b/google/cloud/videointelligence/v1/internal/video_intelligence_stub_factory.h index 0cf714027edf6..4e19c54ef57e5 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_stub_factory.h +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace videointelligence_v1_internal { @@ -40,4 +43,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_V1_INTERNAL_VIDEO_INTELLIGENCE_STUB_FACTORY_H diff --git a/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_connection.cc b/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_connection.cc index cba4c192b43cb..aa0fe0a9aef0c 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_connection.cc +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace videointelligence_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VideoIntelligenceServiceTracingConnection:: VideoIntelligenceServiceTracingConnection( std::shared_ptr< @@ -66,18 +64,14 @@ VideoIntelligenceServiceTracingConnection::AnnotateVideo( return internal::EndSpan(std::move(span), child_->AnnotateVideo(operation)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVideoIntelligenceServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared( std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_connection.h b/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_connection.h index a92ac5a2d9c5b..190c52c189d2c 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_connection.h +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace videointelligence_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VideoIntelligenceServiceTracingConnection : public videointelligence_v1::VideoIntelligenceServiceConnection { public: @@ -59,8 +57,6 @@ class VideoIntelligenceServiceTracingConnection child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_stub.cc b/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_stub.cc index fc3414910785e..23ec6fc4ba8f5 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_stub.cc +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace videointelligence_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VideoIntelligenceServiceTracingStub::VideoIntelligenceServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -88,19 +89,15 @@ future VideoIntelligenceServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVideoIntelligenceServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace videointelligence_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_stub.h b/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_stub.h index 267255854bf01..db4b2fc714691 100644 --- a/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_stub.h +++ b/google/cloud/videointelligence/v1/internal/video_intelligence_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace videointelligence_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VideoIntelligenceServiceTracingStub : public VideoIntelligenceServiceStub { public: @@ -70,8 +71,6 @@ class VideoIntelligenceServiceTracingStub propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -87,4 +86,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_V1_INTERNAL_VIDEO_INTELLIGENCE_TRACING_STUB_H diff --git a/google/cloud/videointelligence/v1/video_intelligence_client.h b/google/cloud/videointelligence/v1/video_intelligence_client.h index 6bef98cbf7120..f299e55ba7e4f 100644 --- a/google/cloud/videointelligence/v1/video_intelligence_client.h +++ b/google/cloud/videointelligence/v1/video_intelligence_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/videointelligence/v1/video_intelligence_connection.h b/google/cloud/videointelligence/v1/video_intelligence_connection.h index 792e3dec94a51..fd087e791b1e3 100644 --- a/google/cloud/videointelligence/v1/video_intelligence_connection.h +++ b/google/cloud/videointelligence/v1/video_intelligence_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_V1_VIDEO_INTELLIGENCE_CONNECTION_H #include "google/cloud/videointelligence/v1/internal/video_intelligence_retry_traits.h" +#include "google/cloud/videointelligence/v1/video_intelligence.pb.h" #include "google/cloud/videointelligence/v1/video_intelligence_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -29,8 +30,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/videointelligence/v1/video_intelligence_connection_idempotency_policy.h b/google/cloud/videointelligence/v1/video_intelligence_connection_idempotency_policy.h index e3ae79f75c687..2f0fadb12f2b8 100644 --- a/google/cloud/videointelligence/v1/video_intelligence_connection_idempotency_policy.h +++ b/google/cloud/videointelligence/v1/video_intelligence_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_V1_VIDEO_INTELLIGENCE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_V1_VIDEO_INTELLIGENCE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/videointelligence/v1/video_intelligence.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/videointelligence/video_intelligence_client.h b/google/cloud/videointelligence/video_intelligence_client.h deleted file mode 100644 index 0b0415239afb1..0000000000000 --- a/google/cloud/videointelligence/video_intelligence_client.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/videointelligence/v1/video_intelligence.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_VIDEO_INTELLIGENCE_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_VIDEO_INTELLIGENCE_CLIENT_H - -#include "google/cloud/videointelligence/v1/video_intelligence_client.h" -#include "google/cloud/videointelligence/video_intelligence_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in videointelligence_v1 instead of the aliases defined in -/// this namespace. -namespace videointelligence { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use videointelligence_v1::VideoIntelligenceServiceClient -/// directly. -using ::google::cloud::videointelligence_v1::VideoIntelligenceServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace videointelligence -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_VIDEO_INTELLIGENCE_CLIENT_H diff --git a/google/cloud/videointelligence/video_intelligence_connection.h b/google/cloud/videointelligence/video_intelligence_connection.h deleted file mode 100644 index 5e99873838daf..0000000000000 --- a/google/cloud/videointelligence/video_intelligence_connection.h +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/videointelligence/v1/video_intelligence.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_VIDEO_INTELLIGENCE_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_VIDEO_INTELLIGENCE_CONNECTION_H - -#include "google/cloud/videointelligence/v1/video_intelligence_connection.h" -#include "google/cloud/videointelligence/video_intelligence_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace videointelligence { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use videointelligence_v1::MakeVideoIntelligenceServiceConnection -/// directly. -using ::google::cloud::videointelligence_v1:: - MakeVideoIntelligenceServiceConnection; - -/// @deprecated Use videointelligence_v1::VideoIntelligenceServiceConnection -/// directly. -using ::google::cloud::videointelligence_v1::VideoIntelligenceServiceConnection; - -/// @deprecated Use -/// videointelligence_v1::VideoIntelligenceServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::videointelligence_v1:: - VideoIntelligenceServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// videointelligence_v1::VideoIntelligenceServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::videointelligence_v1:: - VideoIntelligenceServiceLimitedTimeRetryPolicy; - -/// @deprecated Use videointelligence_v1::VideoIntelligenceServiceRetryPolicy -/// directly. -using ::google::cloud::videointelligence_v1:: - VideoIntelligenceServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace videointelligence -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_VIDEO_INTELLIGENCE_CONNECTION_H diff --git a/google/cloud/videointelligence/video_intelligence_connection_idempotency_policy.h b/google/cloud/videointelligence/video_intelligence_connection_idempotency_policy.h deleted file mode 100644 index 509e6085d0edd..0000000000000 --- a/google/cloud/videointelligence/video_intelligence_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/videointelligence/v1/video_intelligence.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_VIDEO_INTELLIGENCE_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_VIDEO_INTELLIGENCE_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/videointelligence/v1/video_intelligence_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace videointelligence { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// videointelligence_v1::MakeDefaultVideoIntelligenceServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::videointelligence_v1:: - MakeDefaultVideoIntelligenceServiceConnectionIdempotencyPolicy; - -/// @deprecated Use -/// videointelligence_v1::VideoIntelligenceServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::videointelligence_v1:: - VideoIntelligenceServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace videointelligence -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_VIDEO_INTELLIGENCE_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/videointelligence/video_intelligence_options.h b/google/cloud/videointelligence/video_intelligence_options.h deleted file mode 100644 index cb6d266b6656a..0000000000000 --- a/google/cloud/videointelligence/video_intelligence_options.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/videointelligence/v1/video_intelligence.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_VIDEO_INTELLIGENCE_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_VIDEO_INTELLIGENCE_OPTIONS_H - -#include "google/cloud/videointelligence/v1/video_intelligence_options.h" -#include "google/cloud/videointelligence/video_intelligence_connection.h" -#include "google/cloud/videointelligence/video_intelligence_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace videointelligence { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// videointelligence_v1::VideoIntelligenceServicePollingPolicyOption directly. -using ::google::cloud::videointelligence_v1:: - VideoIntelligenceServicePollingPolicyOption; - -/// @deprecated Use -/// videointelligence_v1::VideoIntelligenceServiceBackoffPolicyOption directly. -using ::google::cloud::videointelligence_v1:: - VideoIntelligenceServiceBackoffPolicyOption; - -/// @deprecated Use -/// videointelligence_v1::VideoIntelligenceServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::videointelligence_v1:: - VideoIntelligenceServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use -/// videointelligence_v1::VideoIntelligenceServicePolicyOptionList directly. -using ::google::cloud::videointelligence_v1:: - VideoIntelligenceServicePolicyOptionList; - -/// @deprecated Use -/// videointelligence_v1::VideoIntelligenceServiceRetryPolicyOption directly. -using ::google::cloud::videointelligence_v1:: - VideoIntelligenceServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace videointelligence -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VIDEOINTELLIGENCE_VIDEO_INTELLIGENCE_OPTIONS_H diff --git a/google/cloud/vision/BUILD.bazel b/google/cloud/vision/BUILD.bazel index fcd3c20a2f22d..ffd4215983416 100644 --- a/google/cloud/vision/BUILD.bazel +++ b/google/cloud/vision/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/vision/v1:vision_cc_grpc", + "@googleapis//google/cloud/vision/v1:vision_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/vision/CMakeLists.txt b/google/cloud/vision/CMakeLists.txt index a12765b63e933..6358d65d43a68 100644 --- a/google/cloud/vision/CMakeLists.txt +++ b/google/cloud/vision/CMakeLists.txt @@ -16,8 +16,7 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library(vision "Cloud Vision API" - SERVICE_DIRS "__EMPTY__" "v1/") +google_cloud_cpp_add_gapic_library(vision "Cloud Vision API" SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(vision_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/vision/image_annotator_client.h b/google/cloud/vision/image_annotator_client.h deleted file mode 100644 index f4bb8f0f64ed8..0000000000000 --- a/google/cloud/vision/image_annotator_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vision/v1/image_annotator.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_IMAGE_ANNOTATOR_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_IMAGE_ANNOTATOR_CLIENT_H - -#include "google/cloud/vision/image_annotator_connection.h" -#include "google/cloud/vision/v1/image_annotator_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in vision_v1 instead of the aliases defined in -/// this namespace. -namespace vision { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vision_v1::ImageAnnotatorClient directly. -using ::google::cloud::vision_v1::ImageAnnotatorClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vision -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_IMAGE_ANNOTATOR_CLIENT_H diff --git a/google/cloud/vision/image_annotator_connection.h b/google/cloud/vision/image_annotator_connection.h deleted file mode 100644 index 431146d49a096..0000000000000 --- a/google/cloud/vision/image_annotator_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vision/v1/image_annotator.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_IMAGE_ANNOTATOR_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_IMAGE_ANNOTATOR_CONNECTION_H - -#include "google/cloud/vision/image_annotator_connection_idempotency_policy.h" -#include "google/cloud/vision/v1/image_annotator_connection.h" - -namespace google { -namespace cloud { -namespace vision { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vision_v1::MakeImageAnnotatorConnection directly. -using ::google::cloud::vision_v1::MakeImageAnnotatorConnection; - -/// @deprecated Use vision_v1::ImageAnnotatorConnection directly. -using ::google::cloud::vision_v1::ImageAnnotatorConnection; - -/// @deprecated Use vision_v1::ImageAnnotatorLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::vision_v1::ImageAnnotatorLimitedErrorCountRetryPolicy; - -/// @deprecated Use vision_v1::ImageAnnotatorLimitedTimeRetryPolicy directly. -using ::google::cloud::vision_v1::ImageAnnotatorLimitedTimeRetryPolicy; - -/// @deprecated Use vision_v1::ImageAnnotatorRetryPolicy directly. -using ::google::cloud::vision_v1::ImageAnnotatorRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vision -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_IMAGE_ANNOTATOR_CONNECTION_H diff --git a/google/cloud/vision/image_annotator_connection_idempotency_policy.h b/google/cloud/vision/image_annotator_connection_idempotency_policy.h deleted file mode 100644 index 5c34cdbc50da5..0000000000000 --- a/google/cloud/vision/image_annotator_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vision/v1/image_annotator.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_IMAGE_ANNOTATOR_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_IMAGE_ANNOTATOR_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/vision/v1/image_annotator_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace vision { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// vision_v1::MakeDefaultImageAnnotatorConnectionIdempotencyPolicy directly. -using ::google::cloud::vision_v1:: - MakeDefaultImageAnnotatorConnectionIdempotencyPolicy; - -/// @deprecated Use vision_v1::ImageAnnotatorConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::vision_v1::ImageAnnotatorConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vision -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_IMAGE_ANNOTATOR_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/vision/image_annotator_options.h b/google/cloud/vision/image_annotator_options.h deleted file mode 100644 index 48dffc0294b59..0000000000000 --- a/google/cloud/vision/image_annotator_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vision/v1/image_annotator.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_IMAGE_ANNOTATOR_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_IMAGE_ANNOTATOR_OPTIONS_H - -#include "google/cloud/vision/image_annotator_connection.h" -#include "google/cloud/vision/image_annotator_connection_idempotency_policy.h" -#include "google/cloud/vision/v1/image_annotator_options.h" - -namespace google { -namespace cloud { -namespace vision { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vision_v1::ImageAnnotatorPollingPolicyOption directly. -using ::google::cloud::vision_v1::ImageAnnotatorPollingPolicyOption; - -/// @deprecated Use vision_v1::ImageAnnotatorBackoffPolicyOption directly. -using ::google::cloud::vision_v1::ImageAnnotatorBackoffPolicyOption; - -/// @deprecated Use vision_v1::ImageAnnotatorConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::vision_v1:: - ImageAnnotatorConnectionIdempotencyPolicyOption; - -/// @deprecated Use vision_v1::ImageAnnotatorPolicyOptionList directly. -using ::google::cloud::vision_v1::ImageAnnotatorPolicyOptionList; - -/// @deprecated Use vision_v1::ImageAnnotatorRetryPolicyOption directly. -using ::google::cloud::vision_v1::ImageAnnotatorRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vision -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_IMAGE_ANNOTATOR_OPTIONS_H diff --git a/google/cloud/vision/mocks/mock_image_annotator_connection.h b/google/cloud/vision/mocks/mock_image_annotator_connection.h deleted file mode 100644 index af746fab270a2..0000000000000 --- a/google/cloud/vision/mocks/mock_image_annotator_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vision/v1/image_annotator.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_MOCKS_MOCK_IMAGE_ANNOTATOR_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_MOCKS_MOCK_IMAGE_ANNOTATOR_CONNECTION_H - -#include "google/cloud/vision/image_annotator_connection.h" -#include "google/cloud/vision/v1/mocks/mock_image_annotator_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in vision_v1_mocks instead of the aliases -/// defined in this namespace. -namespace vision_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vision_v1_mocks::MockImageAnnotatorConnection directly. -using ::google::cloud::vision_v1_mocks::MockImageAnnotatorConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vision_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_MOCKS_MOCK_IMAGE_ANNOTATOR_CONNECTION_H diff --git a/google/cloud/vision/mocks/mock_product_search_connection.h b/google/cloud/vision/mocks/mock_product_search_connection.h deleted file mode 100644 index ed203a62156f0..0000000000000 --- a/google/cloud/vision/mocks/mock_product_search_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vision/v1/product_search_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_MOCKS_MOCK_PRODUCT_SEARCH_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_MOCKS_MOCK_PRODUCT_SEARCH_CONNECTION_H - -#include "google/cloud/vision/product_search_connection.h" -#include "google/cloud/vision/v1/mocks/mock_product_search_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in vision_v1_mocks instead of the aliases -/// defined in this namespace. -namespace vision_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vision_v1_mocks::MockProductSearchConnection directly. -using ::google::cloud::vision_v1_mocks::MockProductSearchConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vision_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_MOCKS_MOCK_PRODUCT_SEARCH_CONNECTION_H diff --git a/google/cloud/vision/product_search_client.h b/google/cloud/vision/product_search_client.h deleted file mode 100644 index baa463ca621f7..0000000000000 --- a/google/cloud/vision/product_search_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vision/v1/product_search_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_PRODUCT_SEARCH_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_PRODUCT_SEARCH_CLIENT_H - -#include "google/cloud/vision/product_search_connection.h" -#include "google/cloud/vision/v1/product_search_client.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in vision_v1 instead of the aliases defined in -/// this namespace. -namespace vision { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vision_v1::ProductSearchClient directly. -using ::google::cloud::vision_v1::ProductSearchClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vision -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_PRODUCT_SEARCH_CLIENT_H diff --git a/google/cloud/vision/product_search_connection.h b/google/cloud/vision/product_search_connection.h deleted file mode 100644 index eb4368d25c71d..0000000000000 --- a/google/cloud/vision/product_search_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vision/v1/product_search_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_PRODUCT_SEARCH_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_PRODUCT_SEARCH_CONNECTION_H - -#include "google/cloud/vision/product_search_connection_idempotency_policy.h" -#include "google/cloud/vision/v1/product_search_connection.h" - -namespace google { -namespace cloud { -namespace vision { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vision_v1::MakeProductSearchConnection directly. -using ::google::cloud::vision_v1::MakeProductSearchConnection; - -/// @deprecated Use vision_v1::ProductSearchConnection directly. -using ::google::cloud::vision_v1::ProductSearchConnection; - -/// @deprecated Use vision_v1::ProductSearchLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::vision_v1::ProductSearchLimitedErrorCountRetryPolicy; - -/// @deprecated Use vision_v1::ProductSearchLimitedTimeRetryPolicy directly. -using ::google::cloud::vision_v1::ProductSearchLimitedTimeRetryPolicy; - -/// @deprecated Use vision_v1::ProductSearchRetryPolicy directly. -using ::google::cloud::vision_v1::ProductSearchRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vision -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_PRODUCT_SEARCH_CONNECTION_H diff --git a/google/cloud/vision/product_search_connection_idempotency_policy.h b/google/cloud/vision/product_search_connection_idempotency_policy.h deleted file mode 100644 index 03407539fac98..0000000000000 --- a/google/cloud/vision/product_search_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vision/v1/product_search_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_PRODUCT_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_PRODUCT_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/vision/v1/product_search_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace vision { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// vision_v1::MakeDefaultProductSearchConnectionIdempotencyPolicy directly. -using ::google::cloud::vision_v1:: - MakeDefaultProductSearchConnectionIdempotencyPolicy; - -/// @deprecated Use vision_v1::ProductSearchConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::vision_v1::ProductSearchConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vision -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_PRODUCT_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/vision/product_search_options.h b/google/cloud/vision/product_search_options.h deleted file mode 100644 index b1554eff263c7..0000000000000 --- a/google/cloud/vision/product_search_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vision/v1/product_search_service.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_PRODUCT_SEARCH_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_PRODUCT_SEARCH_OPTIONS_H - -#include "google/cloud/vision/product_search_connection.h" -#include "google/cloud/vision/product_search_connection_idempotency_policy.h" -#include "google/cloud/vision/v1/product_search_options.h" - -namespace google { -namespace cloud { -namespace vision { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vision_v1::ProductSearchPollingPolicyOption directly. -using ::google::cloud::vision_v1::ProductSearchPollingPolicyOption; - -/// @deprecated Use vision_v1::ProductSearchBackoffPolicyOption directly. -using ::google::cloud::vision_v1::ProductSearchBackoffPolicyOption; - -/// @deprecated Use vision_v1::ProductSearchConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::vision_v1:: - ProductSearchConnectionIdempotencyPolicyOption; - -/// @deprecated Use vision_v1::ProductSearchPolicyOptionList directly. -using ::google::cloud::vision_v1::ProductSearchPolicyOptionList; - -/// @deprecated Use vision_v1::ProductSearchRetryPolicyOption directly. -using ::google::cloud::vision_v1::ProductSearchRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vision -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_PRODUCT_SEARCH_OPTIONS_H diff --git a/google/cloud/vision/quickstart/.bazelrc b/google/cloud/vision/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/vision/quickstart/.bazelrc +++ b/google/cloud/vision/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/vision/quickstart/CMakeLists.txt index 0bb3adde04082..e547a8cc6e7ed 100644 --- a/google/cloud/vision/quickstart/CMakeLists.txt +++ b/google/cloud/vision/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Vision API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-vision-quickstart CXX) find_package(google_cloud_cpp_vision REQUIRED) diff --git a/google/cloud/vision/quickstart/WORKSPACE.bazel b/google/cloud/vision/quickstart/WORKSPACE.bazel index 4a90437c3ee75..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 = "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/vision/v1/image_annotator_client.h b/google/cloud/vision/v1/image_annotator_client.h index be7279ae998b9..71dc19ada0f05 100644 --- a/google/cloud/vision/v1/image_annotator_client.h +++ b/google/cloud/vision/v1/image_annotator_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/vision/v1/image_annotator_connection.h b/google/cloud/vision/v1/image_annotator_connection.h index f0609a64ae56e..5cddd72a13844 100644 --- a/google/cloud/vision/v1/image_annotator_connection.h +++ b/google/cloud/vision/v1/image_annotator_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_IMAGE_ANNOTATOR_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_IMAGE_ANNOTATOR_CONNECTION_H +#include "google/cloud/vision/v1/image_annotator.pb.h" #include "google/cloud/vision/v1/image_annotator_connection_idempotency_policy.h" #include "google/cloud/vision/v1/internal/image_annotator_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -29,8 +30,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/vision/v1/image_annotator_connection_idempotency_policy.h b/google/cloud/vision/v1/image_annotator_connection_idempotency_policy.h index 2b7be1118f605..659d9f0fb0fd1 100644 --- a/google/cloud/vision/v1/image_annotator_connection_idempotency_policy.h +++ b/google/cloud/vision/v1/image_annotator_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_IMAGE_ANNOTATOR_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_IMAGE_ANNOTATOR_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/vision/v1/image_annotator.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/vision/v1/internal/image_annotator_auth_decorator.cc b/google/cloud/vision/v1/internal/image_annotator_auth_decorator.cc index 8ed299230a91f..ca003f42cc5c5 100644 --- a/google/cloud/vision/v1/internal/image_annotator_auth_decorator.cc +++ b/google/cloud/vision/v1/internal/image_annotator_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/vision/v1/image_annotator.proto #include "google/cloud/vision/v1/internal/image_annotator_auth_decorator.h" -#include +#include "google/cloud/vision/v1/image_annotator.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { @@ -155,3 +158,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vision_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vision/v1/internal/image_annotator_auth_decorator.h b/google/cloud/vision/v1/internal/image_annotator_auth_decorator.h index 3f62ed6da4643..dc955393edc88 100644 --- a/google/cloud/vision/v1/internal/image_annotator_auth_decorator.h +++ b/google/cloud/vision/v1/internal/image_annotator_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vision/v1/internal/image_annotator_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 vision_v1_internal { @@ -101,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_IMAGE_ANNOTATOR_AUTH_DECORATOR_H diff --git a/google/cloud/vision/v1/internal/image_annotator_connection_impl.h b/google/cloud/vision/v1/internal/image_annotator_connection_impl.h index be26c56021a96..e6a940d5c86e5 100644 --- a/google/cloud/vision/v1/internal/image_annotator_connection_impl.h +++ b/google/cloud/vision/v1/internal/image_annotator_connection_impl.h @@ -31,7 +31,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/vision/v1/internal/image_annotator_logging_decorator.cc b/google/cloud/vision/v1/internal/image_annotator_logging_decorator.cc index b3ae2a4f84ff2..c2ef5657e1661 100644 --- a/google/cloud/vision/v1/internal/image_annotator_logging_decorator.cc +++ b/google/cloud/vision/v1/internal/image_annotator_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/vision/v1/image_annotator.proto #include "google/cloud/vision/v1/internal/image_annotator_logging_decorator.h" +#include "google/cloud/vision/v1/image_annotator.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { @@ -175,3 +178,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vision_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vision/v1/internal/image_annotator_logging_decorator.h b/google/cloud/vision/v1/internal/image_annotator_logging_decorator.h index aaea856d8ed7c..b35bdb0e90a1b 100644 --- a/google/cloud/vision/v1/internal/image_annotator_logging_decorator.h +++ b/google/cloud/vision/v1/internal/image_annotator_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vision/v1/internal/image_annotator_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 vision_v1_internal { @@ -101,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_IMAGE_ANNOTATOR_LOGGING_DECORATOR_H diff --git a/google/cloud/vision/v1/internal/image_annotator_metadata_decorator.cc b/google/cloud/vision/v1/internal/image_annotator_metadata_decorator.cc index 6bab26c074210..4aec5085f3477 100644 --- a/google/cloud/vision/v1/internal/image_annotator_metadata_decorator.cc +++ b/google/cloud/vision/v1/internal/image_annotator_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/vision/v1/image_annotator.proto #include "google/cloud/vision/v1/internal/image_annotator_metadata_decorator.h" +#include "google/cloud/vision/v1/image_annotator.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 vision_v1_internal { @@ -146,3 +150,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vision_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vision/v1/internal/image_annotator_metadata_decorator.h b/google/cloud/vision/v1/internal/image_annotator_metadata_decorator.h index ede69394b2e08..64bb057e93dc7 100644 --- a/google/cloud/vision/v1/internal/image_annotator_metadata_decorator.h +++ b/google/cloud/vision/v1/internal/image_annotator_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vision/v1/internal/image_annotator_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 vision_v1_internal { @@ -106,4 +109,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_IMAGE_ANNOTATOR_METADATA_DECORATOR_H diff --git a/google/cloud/vision/v1/internal/image_annotator_option_defaults.cc b/google/cloud/vision/v1/internal/image_annotator_option_defaults.cc index 2eb55937a3114..d1e4f83e8cc1d 100644 --- a/google/cloud/vision/v1/internal/image_annotator_option_defaults.cc +++ b/google/cloud/vision/v1/internal/image_annotator_option_defaults.cc @@ -41,7 +41,7 @@ Options ImageAnnotatorDefaultOptions(Options options) { if (!options.has()) { options.set( vision_v1::ImageAnnotatorLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/vision/v1/internal/image_annotator_stub.cc b/google/cloud/vision/v1/internal/image_annotator_stub.cc index f4525e14b5789..4b1b458d0106c 100644 --- a/google/cloud/vision/v1/internal/image_annotator_stub.cc +++ b/google/cloud/vision/v1/internal/image_annotator_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/vision/v1/image_annotator.proto #include "google/cloud/vision/v1/internal/image_annotator_stub.h" +#include "google/cloud/vision/v1/image_annotator.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { @@ -174,3 +177,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vision_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vision/v1/internal/image_annotator_stub.h b/google/cloud/vision/v1/internal/image_annotator_stub.h index 17660ea21af4f..1c30f26be974d 100644 --- a/google/cloud/vision/v1/internal/image_annotator_stub.h +++ b/google/cloud/vision/v1/internal/image_annotator_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_IMAGE_ANNOTATOR_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_IMAGE_ANNOTATOR_STUB_H +#include "google/cloud/vision/v1/image_annotator.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { @@ -165,4 +168,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_IMAGE_ANNOTATOR_STUB_H diff --git a/google/cloud/vision/v1/internal/image_annotator_stub_factory.cc b/google/cloud/vision/v1/internal/image_annotator_stub_factory.cc index eb09e92277032..d5449633ccd4d 100644 --- a/google/cloud/vision/v1/internal/image_annotator_stub_factory.cc +++ b/google/cloud/vision/v1/internal/image_annotator_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/vision/v1/image_annotator.proto #include "google/cloud/vision/v1/internal/image_annotator_stub_factory.h" +#include "google/cloud/vision/v1/image_annotator.grpc.pb.h" #include "google/cloud/vision/v1/internal/image_annotator_auth_decorator.h" #include "google/cloud/vision/v1/internal/image_annotator_logging_decorator.h" #include "google/cloud/vision/v1/internal/image_annotator_metadata_decorator.h" @@ -28,11 +29,13 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vision_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vision/v1/internal/image_annotator_stub_factory.h b/google/cloud/vision/v1/internal/image_annotator_stub_factory.h index ee267fe5c3cb7..2bf42a406fed6 100644 --- a/google/cloud/vision/v1/internal/image_annotator_stub_factory.h +++ b/google/cloud/vision/v1/internal/image_annotator_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_IMAGE_ANNOTATOR_STUB_FACTORY_H diff --git a/google/cloud/vision/v1/internal/image_annotator_tracing_connection.cc b/google/cloud/vision/v1/internal/image_annotator_tracing_connection.cc index d3f9a586c1eed..cdff7f11eb2d1 100644 --- a/google/cloud/vision/v1/internal/image_annotator_tracing_connection.cc +++ b/google/cloud/vision/v1/internal/image_annotator_tracing_connection.cc @@ -26,8 +26,6 @@ namespace cloud { namespace vision_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ImageAnnotatorTracingConnection::ImageAnnotatorTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -121,16 +119,12 @@ ImageAnnotatorTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeImageAnnotatorTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/vision/v1/internal/image_annotator_tracing_connection.h b/google/cloud/vision/v1/internal/image_annotator_tracing_connection.h index f6909c98911e7..ad23b784bd53e 100644 --- a/google/cloud/vision/v1/internal/image_annotator_tracing_connection.h +++ b/google/cloud/vision/v1/internal/image_annotator_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace vision_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ImageAnnotatorTracingConnection : public vision_v1::ImageAnnotatorConnection { public: @@ -84,8 +82,6 @@ class ImageAnnotatorTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/vision/v1/internal/image_annotator_tracing_stub.cc b/google/cloud/vision/v1/internal/image_annotator_tracing_stub.cc index cefdb9eff1555..19bc446abeb81 100644 --- a/google/cloud/vision/v1/internal/image_annotator_tracing_stub.cc +++ b/google/cloud/vision/v1/internal/image_annotator_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ImageAnnotatorTracingStub::ImageAnnotatorTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -152,18 +153,14 @@ future ImageAnnotatorTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeImageAnnotatorTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vision_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vision/v1/internal/image_annotator_tracing_stub.h b/google/cloud/vision/v1/internal/image_annotator_tracing_stub.h index f3d469ae3b9aa..a9cfb7cdd9b35 100644 --- a/google/cloud/vision/v1/internal/image_annotator_tracing_stub.h +++ b/google/cloud/vision/v1/internal/image_annotator_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ImageAnnotatorTracingStub : public ImageAnnotatorStub { public: ~ImageAnnotatorTracingStub() override = default; @@ -96,8 +97,6 @@ class ImageAnnotatorTracingStub : public ImageAnnotatorStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -112,4 +111,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_IMAGE_ANNOTATOR_TRACING_STUB_H diff --git a/google/cloud/vision/v1/internal/product_search_auth_decorator.cc b/google/cloud/vision/v1/internal/product_search_auth_decorator.cc index f791395f3068d..9d2d4ec7cd472 100644 --- a/google/cloud/vision/v1/internal/product_search_auth_decorator.cc +++ b/google/cloud/vision/v1/internal/product_search_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/vision/v1/product_search_service.proto #include "google/cloud/vision/v1/internal/product_search_auth_decorator.h" -#include +#include "google/cloud/vision/v1/product_search_service.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { @@ -281,3 +284,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vision_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vision/v1/internal/product_search_auth_decorator.h b/google/cloud/vision/v1/internal/product_search_auth_decorator.h index f6d889454d4bd..2b0017af5299d 100644 --- a/google/cloud/vision/v1/internal/product_search_auth_decorator.h +++ b/google/cloud/vision/v1/internal/product_search_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vision/v1/internal/product_search_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 vision_v1_internal { @@ -168,4 +171,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_PRODUCT_SEARCH_AUTH_DECORATOR_H diff --git a/google/cloud/vision/v1/internal/product_search_connection_impl.h b/google/cloud/vision/v1/internal/product_search_connection_impl.h index d524a138d580f..42e3d79ab2598 100644 --- a/google/cloud/vision/v1/internal/product_search_connection_impl.h +++ b/google/cloud/vision/v1/internal/product_search_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/vision/v1/internal/product_search_logging_decorator.cc b/google/cloud/vision/v1/internal/product_search_logging_decorator.cc index 538196e0d2dd6..814ba43031767 100644 --- a/google/cloud/vision/v1/internal/product_search_logging_decorator.cc +++ b/google/cloud/vision/v1/internal/product_search_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/vision/v1/product_search_service.proto #include "google/cloud/vision/v1/internal/product_search_logging_decorator.h" +#include "google/cloud/vision/v1/product_search_service.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { @@ -356,3 +359,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vision_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vision/v1/internal/product_search_logging_decorator.h b/google/cloud/vision/v1/internal/product_search_logging_decorator.h index 0769e972b87f2..4e2d3a83ab5fd 100644 --- a/google/cloud/vision/v1/internal/product_search_logging_decorator.h +++ b/google/cloud/vision/v1/internal/product_search_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vision/v1/internal/product_search_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 vision_v1_internal { @@ -168,4 +171,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_PRODUCT_SEARCH_LOGGING_DECORATOR_H diff --git a/google/cloud/vision/v1/internal/product_search_metadata_decorator.cc b/google/cloud/vision/v1/internal/product_search_metadata_decorator.cc index 49775ca14c4c7..bb4e288d0987c 100644 --- a/google/cloud/vision/v1/internal/product_search_metadata_decorator.cc +++ b/google/cloud/vision/v1/internal/product_search_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/vision/v1/product_search_service.proto #include "google/cloud/vision/v1/internal/product_search_metadata_decorator.h" +#include "google/cloud/vision/v1/product_search_service.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 vision_v1_internal { @@ -283,3 +287,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vision_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vision/v1/internal/product_search_metadata_decorator.h b/google/cloud/vision/v1/internal/product_search_metadata_decorator.h index 3ec33019079d5..8368d444470e0 100644 --- a/google/cloud/vision/v1/internal/product_search_metadata_decorator.h +++ b/google/cloud/vision/v1/internal/product_search_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vision/v1/internal/product_search_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 vision_v1_internal { @@ -173,4 +176,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_PRODUCT_SEARCH_METADATA_DECORATOR_H diff --git a/google/cloud/vision/v1/internal/product_search_option_defaults.cc b/google/cloud/vision/v1/internal/product_search_option_defaults.cc index 36a21ee94e123..98daf7e0e936f 100644 --- a/google/cloud/vision/v1/internal/product_search_option_defaults.cc +++ b/google/cloud/vision/v1/internal/product_search_option_defaults.cc @@ -40,7 +40,7 @@ Options ProductSearchDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - vision_v1::ProductSearchLimitedTimeRetryPolicy(std::chrono::minutes(30)) + vision_v1::ProductSearchLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/vision/v1/internal/product_search_stub.cc b/google/cloud/vision/v1/internal/product_search_stub.cc index f316ab7c9bcac..3a90b3d205e06 100644 --- a/google/cloud/vision/v1/internal/product_search_stub.cc +++ b/google/cloud/vision/v1/internal/product_search_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/vision/v1/product_search_service.proto #include "google/cloud/vision/v1/internal/product_search_stub.h" +#include "google/cloud/vision/v1/product_search_service.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { @@ -348,3 +351,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vision_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vision/v1/internal/product_search_stub.h b/google/cloud/vision/v1/internal/product_search_stub.h index 9c8ca490ef6bf..59b35311acbff 100644 --- a/google/cloud/vision/v1/internal/product_search_stub.h +++ b/google/cloud/vision/v1/internal/product_search_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_PRODUCT_SEARCH_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_PRODUCT_SEARCH_STUB_H +#include "google/cloud/vision/v1/product_search_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { @@ -295,4 +298,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_PRODUCT_SEARCH_STUB_H diff --git a/google/cloud/vision/v1/internal/product_search_stub_factory.cc b/google/cloud/vision/v1/internal/product_search_stub_factory.cc index 6694d6918548f..d96b1001d5631 100644 --- a/google/cloud/vision/v1/internal/product_search_stub_factory.cc +++ b/google/cloud/vision/v1/internal/product_search_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/vision/v1/internal/product_search_metadata_decorator.h" #include "google/cloud/vision/v1/internal/product_search_stub.h" #include "google/cloud/vision/v1/internal/product_search_tracing_stub.h" +#include "google/cloud/vision/v1/product_search_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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vision_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vision/v1/internal/product_search_stub_factory.h b/google/cloud/vision/v1/internal/product_search_stub_factory.h index 7e55d423f6ae5..79d29b4878c76 100644 --- a/google/cloud/vision/v1/internal/product_search_stub_factory.h +++ b/google/cloud/vision/v1/internal/product_search_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_PRODUCT_SEARCH_STUB_FACTORY_H diff --git a/google/cloud/vision/v1/internal/product_search_tracing_connection.cc b/google/cloud/vision/v1/internal/product_search_tracing_connection.cc index cc9bc0c7bf52f..a6aa6117847fa 100644 --- a/google/cloud/vision/v1/internal/product_search_tracing_connection.cc +++ b/google/cloud/vision/v1/internal/product_search_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace vision_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ProductSearchTracingConnection::ProductSearchTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -258,16 +256,12 @@ ProductSearchTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeProductSearchTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/vision/v1/internal/product_search_tracing_connection.h b/google/cloud/vision/v1/internal/product_search_tracing_connection.h index 4e085a40c25f2..1903a85c9214c 100644 --- a/google/cloud/vision/v1/internal/product_search_tracing_connection.h +++ b/google/cloud/vision/v1/internal/product_search_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace vision_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ProductSearchTracingConnection : public vision_v1::ProductSearchConnection { public: @@ -130,8 +128,6 @@ class ProductSearchTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/vision/v1/internal/product_search_tracing_stub.cc b/google/cloud/vision/v1/internal/product_search_tracing_stub.cc index 13de798f13617..324c418dc975a 100644 --- a/google/cloud/vision/v1/internal/product_search_tracing_stub.cc +++ b/google/cloud/vision/v1/internal/product_search_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ProductSearchTracingStub::ProductSearchTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -327,18 +328,14 @@ future ProductSearchTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeProductSearchTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vision_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vision/v1/internal/product_search_tracing_stub.h b/google/cloud/vision/v1/internal/product_search_tracing_stub.h index eb17784b4cecd..4e32eccd364dd 100644 --- a/google/cloud/vision/v1/internal/product_search_tracing_stub.h +++ b/google/cloud/vision/v1/internal/product_search_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vision_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ProductSearchTracingStub : public ProductSearchStub { public: ~ProductSearchTracingStub() override = default; @@ -163,8 +164,6 @@ class ProductSearchTracingStub : public ProductSearchStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -179,4 +178,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_INTERNAL_PRODUCT_SEARCH_TRACING_STUB_H diff --git a/google/cloud/vision/v1/product_search_client.h b/google/cloud/vision/v1/product_search_client.h index f77cfe1e14c42..cecefd20ef321 100644 --- a/google/cloud/vision/v1/product_search_client.h +++ b/google/cloud/vision/v1/product_search_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/vision/v1/product_search_connection.h b/google/cloud/vision/v1/product_search_connection.h index 5560cfd38983a..74d0a98975ada 100644 --- a/google/cloud/vision/v1/product_search_connection.h +++ b/google/cloud/vision/v1/product_search_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/vision/v1/internal/product_search_retry_traits.h" #include "google/cloud/vision/v1/product_search_connection_idempotency_policy.h" +#include "google/cloud/vision/v1/product_search_service.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/vision/v1/product_search_connection_idempotency_policy.h b/google/cloud/vision/v1/product_search_connection_idempotency_policy.h index 332faacd18c66..ec8919300a0cc 100644 --- a/google/cloud/vision/v1/product_search_connection_idempotency_policy.h +++ b/google/cloud/vision/v1/product_search_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_PRODUCT_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISION_V1_PRODUCT_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/vision/v1/product_search_service.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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/BUILD.bazel b/google/cloud/vmmigration/BUILD.bazel index 1ab07a796fff6..826ebd0e26375 100644 --- a/google/cloud/vmmigration/BUILD.bazel +++ b/google/cloud/vmmigration/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/vmmigration/v1:vmmigration_cc_grpc", + "@googleapis//google/cloud/vmmigration/v1:vmmigration_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/vmmigration/CMakeLists.txt b/google/cloud/vmmigration/CMakeLists.txt index 25580e32d6f59..cbdaf43a66527 100644 --- a/google/cloud/vmmigration/CMakeLists.txt +++ b/google/cloud/vmmigration/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(vmmigration "VM Migration API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(vmmigration_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/vmmigration/mocks/mock_vm_migration_connection.h b/google/cloud/vmmigration/mocks/mock_vm_migration_connection.h deleted file mode 100644 index d71987c34d2ff..0000000000000 --- a/google/cloud/vmmigration/mocks/mock_vm_migration_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vmmigration/v1/vmmigration.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_MOCKS_MOCK_VM_MIGRATION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_MOCKS_MOCK_VM_MIGRATION_CONNECTION_H - -#include "google/cloud/vmmigration/v1/mocks/mock_vm_migration_connection.h" -#include "google/cloud/vmmigration/vm_migration_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in vmmigration_v1_mocks instead of the aliases -/// defined in this namespace. -namespace vmmigration_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vmmigration_v1_mocks::MockVmMigrationConnection directly. -using ::google::cloud::vmmigration_v1_mocks::MockVmMigrationConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vmmigration_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_MOCKS_MOCK_VM_MIGRATION_CONNECTION_H diff --git a/google/cloud/vmmigration/quickstart/.bazelrc b/google/cloud/vmmigration/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/vmmigration/quickstart/.bazelrc +++ b/google/cloud/vmmigration/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/vmmigration/quickstart/CMakeLists.txt index b07cc74e1f3fc..6fec4a868285a 100644 --- a/google/cloud/vmmigration/quickstart/CMakeLists.txt +++ b/google/cloud/vmmigration/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the VM Migration API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-vmmigration-quickstart CXX) find_package(google_cloud_cpp_vmmigration REQUIRED) diff --git a/google/cloud/vmmigration/quickstart/WORKSPACE.bazel b/google/cloud/vmmigration/quickstart/WORKSPACE.bazel index c1e748ba6d3a7..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 = "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/vmmigration/v1/internal/vm_migration_auth_decorator.cc b/google/cloud/vmmigration/v1/internal/vm_migration_auth_decorator.cc index 4ac661e114f13..2282cff388fc0 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_auth_decorator.cc +++ b/google/cloud/vmmigration/v1/internal/vm_migration_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/vmmigration/v1/vmmigration.proto #include "google/cloud/vmmigration/v1/internal/vm_migration_auth_decorator.h" -#include +#include "google/cloud/vmmigration/v1/vmmigration.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vmmigration_v1_internal { @@ -1395,3 +1398,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vmmigration_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_auth_decorator.h b/google/cloud/vmmigration/v1/internal/vm_migration_auth_decorator.h index b3eec715d8141..a4bf5b94677c1 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_auth_decorator.h +++ b/google/cloud/vmmigration/v1/internal/vm_migration_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vmmigration/v1/internal/vm_migration_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 vmmigration_v1_internal { @@ -660,4 +663,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_V1_INTERNAL_VM_MIGRATION_AUTH_DECORATOR_H diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_connection_impl.h b/google/cloud/vmmigration/v1/internal/vm_migration_connection_impl.h index 14b1484eefc82..fd1ff0736187e 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_connection_impl.h +++ b/google/cloud/vmmigration/v1/internal/vm_migration_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_logging_decorator.cc b/google/cloud/vmmigration/v1/internal/vm_migration_logging_decorator.cc index d7e52f8858bd1..a3e5bebe7e68b 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_logging_decorator.cc +++ b/google/cloud/vmmigration/v1/internal/vm_migration_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/vmmigration/v1/vmmigration.proto #include "google/cloud/vmmigration/v1/internal/vm_migration_logging_decorator.h" +#include "google/cloud/vmmigration/v1/vmmigration.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vmmigration_v1_internal { @@ -1647,3 +1650,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vmmigration_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_logging_decorator.h b/google/cloud/vmmigration/v1/internal/vm_migration_logging_decorator.h index 0b6925251b926..064d26a7b07ea 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_logging_decorator.h +++ b/google/cloud/vmmigration/v1/internal/vm_migration_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vmmigration/v1/internal/vm_migration_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 vmmigration_v1_internal { @@ -660,4 +663,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_V1_INTERNAL_VM_MIGRATION_LOGGING_DECORATOR_H diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_metadata_decorator.cc b/google/cloud/vmmigration/v1/internal/vm_migration_metadata_decorator.cc index 929672335e4e5..3779632b28a07 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_metadata_decorator.cc +++ b/google/cloud/vmmigration/v1/internal/vm_migration_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/vmmigration/v1/vmmigration.proto #include "google/cloud/vmmigration/v1/internal/vm_migration_metadata_decorator.h" +#include "google/cloud/vmmigration/v1/vmmigration.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 vmmigration_v1_internal { @@ -1155,3 +1159,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vmmigration_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_metadata_decorator.h b/google/cloud/vmmigration/v1/internal/vm_migration_metadata_decorator.h index 0665707bf79f3..ab2132a51747f 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_metadata_decorator.h +++ b/google/cloud/vmmigration/v1/internal/vm_migration_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vmmigration/v1/internal/vm_migration_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 vmmigration_v1_internal { @@ -665,4 +668,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_V1_INTERNAL_VM_MIGRATION_METADATA_DECORATOR_H diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_option_defaults.cc b/google/cloud/vmmigration/v1/internal/vm_migration_option_defaults.cc index d3917c7568d46..79ddc920db09f 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_option_defaults.cc +++ b/google/cloud/vmmigration/v1/internal/vm_migration_option_defaults.cc @@ -41,7 +41,7 @@ Options VmMigrationDefaultOptions(Options options) { if (!options.has()) { options.set( vmmigration_v1::VmMigrationLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_stub.cc b/google/cloud/vmmigration/v1/internal/vm_migration_stub.cc index ce4e3dcded3fe..84b13b5e1d5dc 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_stub.cc +++ b/google/cloud/vmmigration/v1/internal/vm_migration_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/vmmigration/v1/vmmigration.proto #include "google/cloud/vmmigration/v1/internal/vm_migration_stub.h" +#include "google/cloud/vmmigration/v1/vmmigration.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vmmigration_v1_internal { @@ -1598,3 +1601,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vmmigration_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_stub.h b/google/cloud/vmmigration/v1/internal/vm_migration_stub.h index b0604125d58cc..16550f69f11e5 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_stub.h +++ b/google/cloud/vmmigration/v1/internal/vm_migration_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_V1_INTERNAL_VM_MIGRATION_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_V1_INTERNAL_VM_MIGRATION_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vmmigration/v1/vmmigration.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vmmigration_v1_internal { @@ -1296,4 +1299,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_V1_INTERNAL_VM_MIGRATION_STUB_H diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_stub_factory.cc b/google/cloud/vmmigration/v1/internal/vm_migration_stub_factory.cc index 3e11e0d9eb3fc..c3127c2a4ea13 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_stub_factory.cc +++ b/google/cloud/vmmigration/v1/internal/vm_migration_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/vmmigration/v1/vmmigration.proto #include "google/cloud/vmmigration/v1/internal/vm_migration_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/vmmigration/v1/internal/vm_migration_auth_decorator.h" #include "google/cloud/vmmigration/v1/internal/vm_migration_logging_decorator.h" #include "google/cloud/vmmigration/v1/internal/vm_migration_metadata_decorator.h" #include "google/cloud/vmmigration/v1/internal/vm_migration_stub.h" #include "google/cloud/vmmigration/v1/internal/vm_migration_tracing_stub.h" +#include "google/cloud/vmmigration/v1/vmmigration.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vmmigration_v1_internal { @@ -74,3 +77,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vmmigration_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_stub_factory.h b/google/cloud/vmmigration/v1/internal/vm_migration_stub_factory.h index 785cf52cb523b..4db7ad7251c85 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_stub_factory.h +++ b/google/cloud/vmmigration/v1/internal/vm_migration_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vmmigration_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_V1_INTERNAL_VM_MIGRATION_STUB_FACTORY_H diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_tracing_connection.cc b/google/cloud/vmmigration/v1/internal/vm_migration_tracing_connection.cc index 976a40b058070..170738e80de9d 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_tracing_connection.cc +++ b/google/cloud/vmmigration/v1/internal/vm_migration_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace vmmigration_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VmMigrationTracingConnection::VmMigrationTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -1457,16 +1455,12 @@ Status VmMigrationTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVmMigrationTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_tracing_connection.h b/google/cloud/vmmigration/v1/internal/vm_migration_tracing_connection.h index e9d76afbc1398..e5bfe71df16b6 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_tracing_connection.h +++ b/google/cloud/vmmigration/v1/internal/vm_migration_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace vmmigration_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VmMigrationTracingConnection : public vmmigration_v1::VmMigrationConnection { public: @@ -634,8 +632,6 @@ class VmMigrationTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_tracing_stub.cc b/google/cloud/vmmigration/v1/internal/vm_migration_tracing_stub.cc index 188f23c766bf8..47bc5adf06dc5 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_tracing_stub.cc +++ b/google/cloud/vmmigration/v1/internal/vm_migration_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vmmigration_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VmMigrationTracingStub::VmMigrationTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -1434,18 +1435,14 @@ future VmMigrationTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVmMigrationTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vmmigration_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vmmigration/v1/internal/vm_migration_tracing_stub.h b/google/cloud/vmmigration/v1/internal/vm_migration_tracing_stub.h index 6245c5d7e0d51..9469a18394230 100644 --- a/google/cloud/vmmigration/v1/internal/vm_migration_tracing_stub.h +++ b/google/cloud/vmmigration/v1/internal/vm_migration_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vmmigration_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VmMigrationTracingStub : public VmMigrationStub { public: ~VmMigrationTracingStub() override = default; @@ -655,8 +656,6 @@ class VmMigrationTracingStub : public VmMigrationStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -671,4 +670,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_V1_INTERNAL_VM_MIGRATION_TRACING_STUB_H diff --git a/google/cloud/vmmigration/v1/vm_migration_client.h b/google/cloud/vmmigration/v1/vm_migration_client.h index 6de755e2e32a8..74c6ba9551c5b 100644 --- a/google/cloud/vmmigration/v1/vm_migration_client.h +++ b/google/cloud/vmmigration/v1/vm_migration_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/vmmigration/v1/vm_migration_connection.h b/google/cloud/vmmigration/v1/vm_migration_connection.h index 833b1b78c296c..bdc7f4360ac55 100644 --- a/google/cloud/vmmigration/v1/vm_migration_connection.h +++ b/google/cloud/vmmigration/v1/vm_migration_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/vmmigration/v1/internal/vm_migration_retry_traits.h" #include "google/cloud/vmmigration/v1/vm_migration_connection_idempotency_policy.h" +#include "google/cloud/vmmigration/v1/vmmigration.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/vmmigration/v1/vm_migration_connection_idempotency_policy.h b/google/cloud/vmmigration/v1/vm_migration_connection_idempotency_policy.h index 96731d249b257..55c032a1eb807 100644 --- a/google/cloud/vmmigration/v1/vm_migration_connection_idempotency_policy.h +++ b/google/cloud/vmmigration/v1/vm_migration_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_V1_VM_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_V1_VM_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vmmigration/v1/vmmigration.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/vmmigration/vm_migration_client.h b/google/cloud/vmmigration/vm_migration_client.h deleted file mode 100644 index 169558228c250..0000000000000 --- a/google/cloud/vmmigration/vm_migration_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vmmigration/v1/vmmigration.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_VM_MIGRATION_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_VM_MIGRATION_CLIENT_H - -#include "google/cloud/vmmigration/v1/vm_migration_client.h" -#include "google/cloud/vmmigration/vm_migration_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in vmmigration_v1 instead of the aliases defined in -/// this namespace. -namespace vmmigration { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vmmigration_v1::VmMigrationClient directly. -using ::google::cloud::vmmigration_v1::VmMigrationClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vmmigration -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_VM_MIGRATION_CLIENT_H diff --git a/google/cloud/vmmigration/vm_migration_connection.h b/google/cloud/vmmigration/vm_migration_connection.h deleted file mode 100644 index 17cbe7173345b..0000000000000 --- a/google/cloud/vmmigration/vm_migration_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vmmigration/v1/vmmigration.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_VM_MIGRATION_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_VM_MIGRATION_CONNECTION_H - -#include "google/cloud/vmmigration/v1/vm_migration_connection.h" -#include "google/cloud/vmmigration/vm_migration_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace vmmigration { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vmmigration_v1::MakeVmMigrationConnection directly. -using ::google::cloud::vmmigration_v1::MakeVmMigrationConnection; - -/// @deprecated Use vmmigration_v1::VmMigrationConnection directly. -using ::google::cloud::vmmigration_v1::VmMigrationConnection; - -/// @deprecated Use vmmigration_v1::VmMigrationLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::vmmigration_v1::VmMigrationLimitedErrorCountRetryPolicy; - -/// @deprecated Use vmmigration_v1::VmMigrationLimitedTimeRetryPolicy directly. -using ::google::cloud::vmmigration_v1::VmMigrationLimitedTimeRetryPolicy; - -/// @deprecated Use vmmigration_v1::VmMigrationRetryPolicy directly. -using ::google::cloud::vmmigration_v1::VmMigrationRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vmmigration -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_VM_MIGRATION_CONNECTION_H diff --git a/google/cloud/vmmigration/vm_migration_connection_idempotency_policy.h b/google/cloud/vmmigration/vm_migration_connection_idempotency_policy.h deleted file mode 100644 index 9cc1abda08f67..0000000000000 --- a/google/cloud/vmmigration/vm_migration_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vmmigration/v1/vmmigration.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_VM_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_VM_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/vmmigration/v1/vm_migration_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace vmmigration { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// vmmigration_v1::MakeDefaultVmMigrationConnectionIdempotencyPolicy directly. -using ::google::cloud::vmmigration_v1:: - MakeDefaultVmMigrationConnectionIdempotencyPolicy; - -/// @deprecated Use vmmigration_v1::VmMigrationConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::vmmigration_v1::VmMigrationConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vmmigration -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_VM_MIGRATION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/vmmigration/vm_migration_options.h b/google/cloud/vmmigration/vm_migration_options.h deleted file mode 100644 index 4e8682d508a61..0000000000000 --- a/google/cloud/vmmigration/vm_migration_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vmmigration/v1/vmmigration.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_VM_MIGRATION_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_VM_MIGRATION_OPTIONS_H - -#include "google/cloud/vmmigration/v1/vm_migration_options.h" -#include "google/cloud/vmmigration/vm_migration_connection.h" -#include "google/cloud/vmmigration/vm_migration_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace vmmigration { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vmmigration_v1::VmMigrationPollingPolicyOption directly. -using ::google::cloud::vmmigration_v1::VmMigrationPollingPolicyOption; - -/// @deprecated Use vmmigration_v1::VmMigrationBackoffPolicyOption directly. -using ::google::cloud::vmmigration_v1::VmMigrationBackoffPolicyOption; - -/// @deprecated Use vmmigration_v1::VmMigrationConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::vmmigration_v1:: - VmMigrationConnectionIdempotencyPolicyOption; - -/// @deprecated Use vmmigration_v1::VmMigrationPolicyOptionList directly. -using ::google::cloud::vmmigration_v1::VmMigrationPolicyOptionList; - -/// @deprecated Use vmmigration_v1::VmMigrationRetryPolicyOption directly. -using ::google::cloud::vmmigration_v1::VmMigrationRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vmmigration -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMMIGRATION_VM_MIGRATION_OPTIONS_H diff --git a/google/cloud/vmwareengine/BUILD.bazel b/google/cloud/vmwareengine/BUILD.bazel index afeffa991623b..c04055c1a23f4 100644 --- a/google/cloud/vmwareengine/BUILD.bazel +++ b/google/cloud/vmwareengine/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/vmwareengine/v1:vmwareengine_cc_grpc", + "@googleapis//google/cloud/vmwareengine/v1:vmwareengine_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/vmwareengine/quickstart/.bazelrc b/google/cloud/vmwareengine/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/vmwareengine/quickstart/.bazelrc +++ b/google/cloud/vmwareengine/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/vmwareengine/quickstart/CMakeLists.txt index 480344dc2b588..61e7ea230222c 100644 --- a/google/cloud/vmwareengine/quickstart/CMakeLists.txt +++ b/google/cloud/vmwareengine/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the VMware Engine API C++ client library from a # larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-vmwareengine-quickstart CXX) find_package(google_cloud_cpp_vmwareengine REQUIRED) diff --git a/google/cloud/vmwareengine/quickstart/WORKSPACE.bazel b/google/cloud/vmwareengine/quickstart/WORKSPACE.bazel index a78df5a3f38a1..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 = "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/vmwareengine/v1/internal/vmware_engine_auth_decorator.cc b/google/cloud/vmwareengine/v1/internal/vmware_engine_auth_decorator.cc index b4bf3f5e4f434..5ebec3de2cc4d 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_auth_decorator.cc +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/vmwareengine/v1/vmwareengine.proto #include "google/cloud/vmwareengine/v1/internal/vmware_engine_auth_decorator.h" -#include +#include "google/cloud/vmwareengine/v1/vmwareengine.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vmwareengine_v1_internal { @@ -1645,3 +1648,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vmwareengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_auth_decorator.h b/google/cloud/vmwareengine/v1/internal/vmware_engine_auth_decorator.h index a24eeed8567ca..8b400ab20b565 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_auth_decorator.h +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vmwareengine/v1/internal/vmware_engine_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 vmwareengine_v1_internal { @@ -767,4 +770,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMWAREENGINE_V1_INTERNAL_VMWARE_ENGINE_AUTH_DECORATOR_H diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_connection_impl.h b/google/cloud/vmwareengine/v1/internal/vmware_engine_connection_impl.h index e9ac82bb16df4..39b54e8c60b66 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_connection_impl.h +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_logging_decorator.cc b/google/cloud/vmwareengine/v1/internal/vmware_engine_logging_decorator.cc index aca7cfcb95fde..a2fe7cd977d4c 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_logging_decorator.cc +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/vmwareengine/v1/vmwareengine.proto #include "google/cloud/vmwareengine/v1/internal/vmware_engine_logging_decorator.h" +#include "google/cloud/vmwareengine/v1/vmwareengine.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vmwareengine_v1_internal { @@ -1976,3 +1979,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vmwareengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_logging_decorator.h b/google/cloud/vmwareengine/v1/internal/vmware_engine_logging_decorator.h index bdf169955bcd3..97fc79f14a97a 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_logging_decorator.h +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vmwareengine/v1/internal/vmware_engine_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 vmwareengine_v1_internal { @@ -767,4 +770,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMWAREENGINE_V1_INTERNAL_VMWARE_ENGINE_LOGGING_DECORATOR_H diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_metadata_decorator.cc b/google/cloud/vmwareengine/v1/internal/vmware_engine_metadata_decorator.cc index 4ab5aabe0576b..4db40a20958ef 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_metadata_decorator.cc +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/vmwareengine/v1/vmwareengine.proto #include "google/cloud/vmwareengine/v1/internal/vmware_engine_metadata_decorator.h" +#include "google/cloud/vmwareengine/v1/vmwareengine.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 vmwareengine_v1_internal { @@ -1417,3 +1421,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vmwareengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_metadata_decorator.h b/google/cloud/vmwareengine/v1/internal/vmware_engine_metadata_decorator.h index 0b37015f6ac95..abe328d05b682 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_metadata_decorator.h +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vmwareengine/v1/internal/vmware_engine_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 vmwareengine_v1_internal { @@ -772,4 +775,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMWAREENGINE_V1_INTERNAL_VMWARE_ENGINE_METADATA_DECORATOR_H diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_option_defaults.cc b/google/cloud/vmwareengine/v1/internal/vmware_engine_option_defaults.cc index db16f3b6d186c..4e59b95229a74 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_option_defaults.cc +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_option_defaults.cc @@ -42,7 +42,7 @@ Options VmwareEngineDefaultOptions(Options options) { if (!options.has()) { options.set( vmwareengine_v1::VmwareEngineLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_stub.cc b/google/cloud/vmwareengine/v1/internal/vmware_engine_stub.cc index 136a97b13a8c4..52e65ccff1f9c 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_stub.cc +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/vmwareengine/v1/vmwareengine.proto #include "google/cloud/vmwareengine/v1/internal/vmware_engine_stub.h" +#include "google/cloud/vmwareengine/v1/vmwareengine.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vmwareengine_v1_internal { @@ -1918,3 +1921,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vmwareengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_stub.h b/google/cloud/vmwareengine/v1/internal/vmware_engine_stub.h index a801623cc8905..b6339be36c837 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_stub.h +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_stub.h @@ -19,18 +19,21 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMWAREENGINE_V1_INTERNAL_VMWARE_ENGINE_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMWAREENGINE_V1_INTERNAL_VMWARE_ENGINE_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vmwareengine/v1/vmwareengine.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 -#include -#include -#include +#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 vmwareengine_v1_internal { @@ -1540,4 +1543,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMWAREENGINE_V1_INTERNAL_VMWARE_ENGINE_STUB_H diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_stub_factory.cc b/google/cloud/vmwareengine/v1/internal/vmware_engine_stub_factory.cc index 9637bff0e0ad1..e21c2648922ec 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_stub_factory.cc +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_stub_factory.cc @@ -17,24 +17,27 @@ // source: google/cloud/vmwareengine/v1/vmwareengine.proto #include "google/cloud/vmwareengine/v1/internal/vmware_engine_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/vmwareengine/v1/internal/vmware_engine_auth_decorator.h" #include "google/cloud/vmwareengine/v1/internal/vmware_engine_logging_decorator.h" #include "google/cloud/vmwareengine/v1/internal/vmware_engine_metadata_decorator.h" #include "google/cloud/vmwareengine/v1/internal/vmware_engine_stub.h" #include "google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_stub.h" +#include "google/cloud/vmwareengine/v1/vmwareengine.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 -#include -#include -#include +#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 vmwareengine_v1_internal { @@ -77,3 +80,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vmwareengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_stub_factory.h b/google/cloud/vmwareengine/v1/internal/vmware_engine_stub_factory.h index 74c6a67270f6e..f0099f5fd9ac1 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_stub_factory.h +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vmwareengine_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMWAREENGINE_V1_INTERNAL_VMWARE_ENGINE_STUB_FACTORY_H diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_connection.cc b/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_connection.cc index be0860616dbcb..f9e6fa602d493 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_connection.cc +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace vmwareengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VmwareEngineTracingConnection::VmwareEngineTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -1750,16 +1748,12 @@ Status VmwareEngineTracingConnection::DeleteOperation( return internal::EndSpan(*span, child_->DeleteOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVmwareEngineTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_connection.h b/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_connection.h index c46ca23a1a96e..0a3256348e7be 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_connection.h +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace vmwareengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VmwareEngineTracingConnection : public vmwareengine_v1::VmwareEngineConnection { public: @@ -746,8 +744,6 @@ class VmwareEngineTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_stub.cc b/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_stub.cc index f767e2079290e..b0c05165ece66 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_stub.cc +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vmwareengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VmwareEngineTracingStub::VmwareEngineTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -1738,18 +1739,14 @@ future VmwareEngineTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVmwareEngineTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vmwareengine_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_stub.h b/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_stub.h index f6c3474e30e73..0512abe5c3651 100644 --- a/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_stub.h +++ b/google/cloud/vmwareengine/v1/internal/vmware_engine_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vmwareengine_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VmwareEngineTracingStub : public VmwareEngineStub { public: ~VmwareEngineTracingStub() override = default; @@ -762,8 +763,6 @@ class VmwareEngineTracingStub : public VmwareEngineStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -778,4 +777,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMWAREENGINE_V1_INTERNAL_VMWARE_ENGINE_TRACING_STUB_H diff --git a/google/cloud/vmwareengine/v1/vmware_engine_client.h b/google/cloud/vmwareengine/v1/vmware_engine_client.h index a5259be6ba63e..c5273d7c77b46 100644 --- a/google/cloud/vmwareengine/v1/vmware_engine_client.h +++ b/google/cloud/vmwareengine/v1/vmware_engine_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/vmwareengine/v1/vmware_engine_connection.h b/google/cloud/vmwareengine/v1/vmware_engine_connection.h index e17a41d5faf18..119a2fdbb7101 100644 --- a/google/cloud/vmwareengine/v1/vmware_engine_connection.h +++ b/google/cloud/vmwareengine/v1/vmware_engine_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/vmwareengine/v1/internal/vmware_engine_retry_traits.h" #include "google/cloud/vmwareengine/v1/vmware_engine_connection_idempotency_policy.h" +#include "google/cloud/vmwareengine/v1/vmwareengine.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/vmwareengine/v1/vmware_engine_connection_idempotency_policy.h b/google/cloud/vmwareengine/v1/vmware_engine_connection_idempotency_policy.h index e213aeceab6f2..58186f6ff4da7 100644 --- a/google/cloud/vmwareengine/v1/vmware_engine_connection_idempotency_policy.h +++ b/google/cloud/vmwareengine/v1/vmware_engine_connection_idempotency_policy.h @@ -19,12 +19,12 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMWAREENGINE_V1_VMWARE_ENGINE_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VMWAREENGINE_V1_VMWARE_ENGINE_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vmwareengine/v1/vmwareengine.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/vpcaccess/BUILD.bazel b/google/cloud/vpcaccess/BUILD.bazel index 9cd861c7e9d8e..bac4db252fb71 100644 --- a/google/cloud/vpcaccess/BUILD.bazel +++ b/google/cloud/vpcaccess/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/vpcaccess/v1:vpcaccess_cc_grpc", + "@googleapis//google/cloud/vpcaccess/v1:vpcaccess_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/vpcaccess/CMakeLists.txt b/google/cloud/vpcaccess/CMakeLists.txt index af6b2c3febfb1..6b8bd903dcf34 100644 --- a/google/cloud/vpcaccess/CMakeLists.txt +++ b/google/cloud/vpcaccess/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(vpcaccess "Serverless VPC Access API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(vpcaccess_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/vpcaccess/mocks/mock_vpc_access_connection.h b/google/cloud/vpcaccess/mocks/mock_vpc_access_connection.h deleted file mode 100644 index 102de2a938155..0000000000000 --- a/google/cloud/vpcaccess/mocks/mock_vpc_access_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vpcaccess/v1/vpc_access.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_MOCKS_MOCK_VPC_ACCESS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_MOCKS_MOCK_VPC_ACCESS_CONNECTION_H - -#include "google/cloud/vpcaccess/v1/mocks/mock_vpc_access_connection.h" -#include "google/cloud/vpcaccess/vpc_access_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in vpcaccess_v1_mocks instead of the aliases -/// defined in this namespace. -namespace vpcaccess_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vpcaccess_v1_mocks::MockVpcAccessServiceConnection directly. -using ::google::cloud::vpcaccess_v1_mocks::MockVpcAccessServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vpcaccess_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_MOCKS_MOCK_VPC_ACCESS_CONNECTION_H diff --git a/google/cloud/vpcaccess/quickstart/.bazelrc b/google/cloud/vpcaccess/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/vpcaccess/quickstart/.bazelrc +++ b/google/cloud/vpcaccess/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/vpcaccess/quickstart/CMakeLists.txt index 7882e7fe9ab0a..6cce885f86538 100644 --- a/google/cloud/vpcaccess/quickstart/CMakeLists.txt +++ b/google/cloud/vpcaccess/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Serverless VPC Access API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-vpcaccess-quickstart CXX) find_package(google_cloud_cpp_vpcaccess REQUIRED) diff --git a/google/cloud/vpcaccess/quickstart/WORKSPACE.bazel b/google/cloud/vpcaccess/quickstart/WORKSPACE.bazel index daada20f3882b..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 = "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/vpcaccess/v1/internal/vpc_access_auth_decorator.cc b/google/cloud/vpcaccess/v1/internal/vpc_access_auth_decorator.cc index 878ec816ef207..e77ea552b9d7a 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_auth_decorator.cc +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/vpcaccess/v1/vpc_access.proto #include "google/cloud/vpcaccess/v1/internal/vpc_access_auth_decorator.h" -#include +#include "google/cloud/vpcaccess/v1/vpc_access.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vpcaccess_v1_internal { @@ -171,3 +174,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vpcaccess_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_auth_decorator.h b/google/cloud/vpcaccess/v1/internal/vpc_access_auth_decorator.h index 0b5d993bf960f..5448a7dfc2096 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_auth_decorator.h +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vpcaccess/v1/internal/vpc_access_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 vpcaccess_v1_internal { @@ -107,4 +110,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_V1_INTERNAL_VPC_ACCESS_AUTH_DECORATOR_H diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_connection_impl.h b/google/cloud/vpcaccess/v1/internal/vpc_access_connection_impl.h index 7e109814590b2..f62944dbfaa4a 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_connection_impl.h +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_logging_decorator.cc b/google/cloud/vpcaccess/v1/internal/vpc_access_logging_decorator.cc index 29ff75e9351ff..d5a2b58c5ba3b 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_logging_decorator.cc +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/vpcaccess/v1/vpc_access.proto #include "google/cloud/vpcaccess/v1/internal/vpc_access_logging_decorator.h" +#include "google/cloud/vpcaccess/v1/vpc_access.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vpcaccess_v1_internal { @@ -198,3 +201,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vpcaccess_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_logging_decorator.h b/google/cloud/vpcaccess/v1/internal/vpc_access_logging_decorator.h index a1d083eac1cb7..a9eea068cb06f 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_logging_decorator.h +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vpcaccess/v1/internal/vpc_access_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 vpcaccess_v1_internal { @@ -107,4 +110,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_V1_INTERNAL_VPC_ACCESS_LOGGING_DECORATOR_H diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_metadata_decorator.cc b/google/cloud/vpcaccess/v1/internal/vpc_access_metadata_decorator.cc index 624e7468b77e7..2b2eb77fa854a 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_metadata_decorator.cc +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/vpcaccess/v1/vpc_access.proto #include "google/cloud/vpcaccess/v1/internal/vpc_access_metadata_decorator.h" +#include "google/cloud/vpcaccess/v1/vpc_access.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 vpcaccess_v1_internal { @@ -170,3 +174,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vpcaccess_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_metadata_decorator.h b/google/cloud/vpcaccess/v1/internal/vpc_access_metadata_decorator.h index 5366cff472cfc..cc90597902e76 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_metadata_decorator.h +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/vpcaccess/v1/internal/vpc_access_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 vpcaccess_v1_internal { @@ -113,4 +116,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_V1_INTERNAL_VPC_ACCESS_METADATA_DECORATOR_H diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_option_defaults.cc b/google/cloud/vpcaccess/v1/internal/vpc_access_option_defaults.cc index 2883cc39eb511..e4c8a55fc451d 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_option_defaults.cc +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_option_defaults.cc @@ -42,7 +42,7 @@ Options VpcAccessServiceDefaultOptions(Options options) { if (!options.has()) { options.set( vpcaccess_v1::VpcAccessServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_stub.cc b/google/cloud/vpcaccess/v1/internal/vpc_access_stub.cc index 9e4b31f91edbc..a31cc8ce5ddb3 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_stub.cc +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/vpcaccess/v1/vpc_access.proto #include "google/cloud/vpcaccess/v1/internal/vpc_access_stub.h" +#include "google/cloud/vpcaccess/v1/vpc_access.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vpcaccess_v1_internal { @@ -196,3 +199,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vpcaccess_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_stub.h b/google/cloud/vpcaccess/v1/internal/vpc_access_stub.h index fde54cbd23b14..fea3f7d033c02 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_stub.h +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_V1_INTERNAL_VPC_ACCESS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_V1_INTERNAL_VPC_ACCESS_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vpcaccess/v1/vpc_access.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vpcaccess_v1_internal { @@ -180,4 +183,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_V1_INTERNAL_VPC_ACCESS_STUB_H diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_stub_factory.cc b/google/cloud/vpcaccess/v1/internal/vpc_access_stub_factory.cc index 0e960ed240076..272d5d3bcaaaa 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_stub_factory.cc +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/vpcaccess/v1/vpc_access.proto #include "google/cloud/vpcaccess/v1/internal/vpc_access_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/vpcaccess/v1/internal/vpc_access_auth_decorator.h" #include "google/cloud/vpcaccess/v1/internal/vpc_access_logging_decorator.h" #include "google/cloud/vpcaccess/v1/internal/vpc_access_metadata_decorator.h" #include "google/cloud/vpcaccess/v1/internal/vpc_access_stub.h" #include "google/cloud/vpcaccess/v1/internal/vpc_access_tracing_stub.h" +#include "google/cloud/vpcaccess/v1/vpc_access.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vpcaccess_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vpcaccess_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_stub_factory.h b/google/cloud/vpcaccess/v1/internal/vpc_access_stub_factory.h index 9ff825c6eb785..d1a04cbbf0c2f 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_stub_factory.h +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vpcaccess_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_V1_INTERNAL_VPC_ACCESS_STUB_FACTORY_H diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_connection.cc b/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_connection.cc index 356e2bd0d7fa7..e79979a7da7d9 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_connection.cc +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace vpcaccess_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VpcAccessServiceTracingConnection::VpcAccessServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -142,16 +140,12 @@ VpcAccessServiceTracingConnection::GetOperation( return internal::EndSpan(*span, child_->GetOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVpcAccessServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_connection.h b/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_connection.h index 26252d14071df..45d8b68439877 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_connection.h +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace vpcaccess_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VpcAccessServiceTracingConnection : public vpcaccess_v1::VpcAccessServiceConnection { public: @@ -84,8 +82,6 @@ class VpcAccessServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_stub.cc b/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_stub.cc index cc8fffc1da06a..ba446a477b44e 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_stub.cc +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vpcaccess_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - VpcAccessServiceTracingStub::VpcAccessServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -174,18 +175,14 @@ future VpcAccessServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeVpcAccessServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace vpcaccess_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_stub.h b/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_stub.h index 55d2e07d1aa01..253a557e96b13 100644 --- a/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_stub.h +++ b/google/cloud/vpcaccess/v1/internal/vpc_access_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace vpcaccess_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class VpcAccessServiceTracingStub : public VpcAccessServiceStub { public: ~VpcAccessServiceTracingStub() override = default; @@ -103,8 +104,6 @@ class VpcAccessServiceTracingStub : public VpcAccessServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -119,4 +118,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_V1_INTERNAL_VPC_ACCESS_TRACING_STUB_H diff --git a/google/cloud/vpcaccess/v1/vpc_access_client.h b/google/cloud/vpcaccess/v1/vpc_access_client.h index 57a9e89442281..b4ddfa6d67e18 100644 --- a/google/cloud/vpcaccess/v1/vpc_access_client.h +++ b/google/cloud/vpcaccess/v1/vpc_access_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include diff --git a/google/cloud/vpcaccess/v1/vpc_access_connection.h b/google/cloud/vpcaccess/v1/vpc_access_connection.h index 712c44eb09054..28f0019d475d4 100644 --- a/google/cloud/vpcaccess/v1/vpc_access_connection.h +++ b/google/cloud/vpcaccess/v1/vpc_access_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_V1_VPC_ACCESS_CONNECTION_H #include "google/cloud/vpcaccess/v1/internal/vpc_access_retry_traits.h" +#include "google/cloud/vpcaccess/v1/vpc_access.pb.h" #include "google/cloud/vpcaccess/v1/vpc_access_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/vpcaccess/v1/vpc_access_connection_idempotency_policy.h b/google/cloud/vpcaccess/v1/vpc_access_connection_idempotency_policy.h index ea579985b8d5a..8c2685cd48c8d 100644 --- a/google/cloud/vpcaccess/v1/vpc_access_connection_idempotency_policy.h +++ b/google/cloud/vpcaccess/v1/vpc_access_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_V1_VPC_ACCESS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_V1_VPC_ACCESS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vpcaccess/v1/vpc_access.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/vpcaccess/vpc_access_client.h b/google/cloud/vpcaccess/vpc_access_client.h deleted file mode 100644 index 5b38a9f5e67f6..0000000000000 --- a/google/cloud/vpcaccess/vpc_access_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vpcaccess/v1/vpc_access.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_VPC_ACCESS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_VPC_ACCESS_CLIENT_H - -#include "google/cloud/vpcaccess/v1/vpc_access_client.h" -#include "google/cloud/vpcaccess/vpc_access_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in vpcaccess_v1 instead of the aliases defined in -/// this namespace. -namespace vpcaccess { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vpcaccess_v1::VpcAccessServiceClient directly. -using ::google::cloud::vpcaccess_v1::VpcAccessServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vpcaccess -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_VPC_ACCESS_CLIENT_H diff --git a/google/cloud/vpcaccess/vpc_access_connection.h b/google/cloud/vpcaccess/vpc_access_connection.h deleted file mode 100644 index 24a61273068ea..0000000000000 --- a/google/cloud/vpcaccess/vpc_access_connection.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vpcaccess/v1/vpc_access.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_VPC_ACCESS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_VPC_ACCESS_CONNECTION_H - -#include "google/cloud/vpcaccess/v1/vpc_access_connection.h" -#include "google/cloud/vpcaccess/vpc_access_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace vpcaccess { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vpcaccess_v1::MakeVpcAccessServiceConnection directly. -using ::google::cloud::vpcaccess_v1::MakeVpcAccessServiceConnection; - -/// @deprecated Use vpcaccess_v1::VpcAccessServiceConnection directly. -using ::google::cloud::vpcaccess_v1::VpcAccessServiceConnection; - -/// @deprecated Use vpcaccess_v1::VpcAccessServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::vpcaccess_v1:: - VpcAccessServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use vpcaccess_v1::VpcAccessServiceLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::vpcaccess_v1::VpcAccessServiceLimitedTimeRetryPolicy; - -/// @deprecated Use vpcaccess_v1::VpcAccessServiceRetryPolicy directly. -using ::google::cloud::vpcaccess_v1::VpcAccessServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vpcaccess -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_VPC_ACCESS_CONNECTION_H diff --git a/google/cloud/vpcaccess/vpc_access_connection_idempotency_policy.h b/google/cloud/vpcaccess/vpc_access_connection_idempotency_policy.h deleted file mode 100644 index b54d42c9e60df..0000000000000 --- a/google/cloud/vpcaccess/vpc_access_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vpcaccess/v1/vpc_access.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_VPC_ACCESS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_VPC_ACCESS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/vpcaccess/v1/vpc_access_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace vpcaccess { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// vpcaccess_v1::MakeDefaultVpcAccessServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::vpcaccess_v1:: - MakeDefaultVpcAccessServiceConnectionIdempotencyPolicy; - -/// @deprecated Use vpcaccess_v1::VpcAccessServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::vpcaccess_v1:: - VpcAccessServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vpcaccess -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_VPC_ACCESS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/vpcaccess/vpc_access_options.h b/google/cloud/vpcaccess/vpc_access_options.h deleted file mode 100644 index 41a692c5fe56b..0000000000000 --- a/google/cloud/vpcaccess/vpc_access_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/vpcaccess/v1/vpc_access.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_VPC_ACCESS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_VPC_ACCESS_OPTIONS_H - -#include "google/cloud/vpcaccess/v1/vpc_access_options.h" -#include "google/cloud/vpcaccess/vpc_access_connection.h" -#include "google/cloud/vpcaccess/vpc_access_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace vpcaccess { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use vpcaccess_v1::VpcAccessServicePollingPolicyOption directly. -using ::google::cloud::vpcaccess_v1::VpcAccessServicePollingPolicyOption; - -/// @deprecated Use vpcaccess_v1::VpcAccessServiceBackoffPolicyOption directly. -using ::google::cloud::vpcaccess_v1::VpcAccessServiceBackoffPolicyOption; - -/// @deprecated Use -/// vpcaccess_v1::VpcAccessServiceConnectionIdempotencyPolicyOption directly. -using ::google::cloud::vpcaccess_v1:: - VpcAccessServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use vpcaccess_v1::VpcAccessServicePolicyOptionList directly. -using ::google::cloud::vpcaccess_v1::VpcAccessServicePolicyOptionList; - -/// @deprecated Use vpcaccess_v1::VpcAccessServiceRetryPolicyOption directly. -using ::google::cloud::vpcaccess_v1::VpcAccessServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace vpcaccess -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VPCACCESS_VPC_ACCESS_OPTIONS_H diff --git a/google/cloud/webrisk/BUILD.bazel b/google/cloud/webrisk/BUILD.bazel index 282bf5a26d552..9a0b29a58ef65 100644 --- a/google/cloud/webrisk/BUILD.bazel +++ b/google/cloud/webrisk/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/webrisk/v1:webrisk_cc_grpc", + "@googleapis//google/cloud/webrisk/v1:webrisk_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/webrisk/CMakeLists.txt b/google/cloud/webrisk/CMakeLists.txt index a5b3a7c457940..d55b6cd19d2a1 100644 --- a/google/cloud/webrisk/CMakeLists.txt +++ b/google/cloud/webrisk/CMakeLists.txt @@ -28,8 +28,7 @@ endif () include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library(webrisk "Web Risk API" - SERVICE_DIRS "__EMPTY__" "v1/") +google_cloud_cpp_add_gapic_library(webrisk "Web Risk API" SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(webrisk_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/webrisk/mocks/mock_web_risk_connection.h b/google/cloud/webrisk/mocks/mock_web_risk_connection.h deleted file mode 100644 index d7e8f1d072537..0000000000000 --- a/google/cloud/webrisk/mocks/mock_web_risk_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/webrisk/v1/webrisk.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_MOCKS_MOCK_WEB_RISK_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_MOCKS_MOCK_WEB_RISK_CONNECTION_H - -#include "google/cloud/webrisk/v1/mocks/mock_web_risk_connection.h" -#include "google/cloud/webrisk/web_risk_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in webrisk_v1_mocks instead of the aliases -/// defined in this namespace. -namespace webrisk_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use webrisk_v1_mocks::MockWebRiskServiceConnection directly. -using ::google::cloud::webrisk_v1_mocks::MockWebRiskServiceConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace webrisk_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_MOCKS_MOCK_WEB_RISK_CONNECTION_H diff --git a/google/cloud/webrisk/quickstart/.bazelrc b/google/cloud/webrisk/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/webrisk/quickstart/.bazelrc +++ b/google/cloud/webrisk/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/webrisk/quickstart/CMakeLists.txt index feeceb9f43484..865f9b95a550b 100644 --- a/google/cloud/webrisk/quickstart/CMakeLists.txt +++ b/google/cloud/webrisk/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Web Risk API C++ client library from a larger # CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-webrisk-quickstart CXX) find_package(google_cloud_cpp_webrisk REQUIRED) diff --git a/google/cloud/webrisk/quickstart/WORKSPACE.bazel b/google/cloud/webrisk/quickstart/WORKSPACE.bazel index 73261ffb1c1e5..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 = "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/webrisk/v1/internal/web_risk_auth_decorator.cc b/google/cloud/webrisk/v1/internal/web_risk_auth_decorator.cc index eeb716159222c..fc19b16eb4aaf 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_auth_decorator.cc +++ b/google/cloud/webrisk/v1/internal/web_risk_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/webrisk/v1/webrisk.proto #include "google/cloud/webrisk/v1/internal/web_risk_auth_decorator.h" -#include +#include "google/cloud/webrisk/v1/webrisk.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace webrisk_v1_internal { @@ -168,3 +171,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace webrisk_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/webrisk/v1/internal/web_risk_auth_decorator.h b/google/cloud/webrisk/v1/internal/web_risk_auth_decorator.h index ab80057426186..94c4dde1693c6 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_auth_decorator.h +++ b/google/cloud/webrisk/v1/internal/web_risk_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/webrisk/v1/internal/web_risk_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 webrisk_v1_internal { @@ -106,4 +109,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_V1_INTERNAL_WEB_RISK_AUTH_DECORATOR_H diff --git a/google/cloud/webrisk/v1/internal/web_risk_connection_impl.h b/google/cloud/webrisk/v1/internal/web_risk_connection_impl.h index 3c74b3104d50e..7307e2d17d2d4 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_connection_impl.h +++ b/google/cloud/webrisk/v1/internal/web_risk_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/webrisk/v1/internal/web_risk_logging_decorator.cc b/google/cloud/webrisk/v1/internal/web_risk_logging_decorator.cc index 5c1696053de22..90a7eea6051b1 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_logging_decorator.cc +++ b/google/cloud/webrisk/v1/internal/web_risk_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/webrisk/v1/webrisk.proto #include "google/cloud/webrisk/v1/internal/web_risk_logging_decorator.h" +#include "google/cloud/webrisk/v1/webrisk.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace webrisk_v1_internal { @@ -198,3 +201,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace webrisk_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/webrisk/v1/internal/web_risk_logging_decorator.h b/google/cloud/webrisk/v1/internal/web_risk_logging_decorator.h index 44c11d4d79f1f..8bbc4defb6fbb 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_logging_decorator.h +++ b/google/cloud/webrisk/v1/internal/web_risk_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/webrisk/v1/internal/web_risk_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 webrisk_v1_internal { @@ -106,4 +109,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_V1_INTERNAL_WEB_RISK_LOGGING_DECORATOR_H diff --git a/google/cloud/webrisk/v1/internal/web_risk_metadata_decorator.cc b/google/cloud/webrisk/v1/internal/web_risk_metadata_decorator.cc index ccb2bb0076888..2498e7452a1cd 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_metadata_decorator.cc +++ b/google/cloud/webrisk/v1/internal/web_risk_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/webrisk/v1/webrisk.proto #include "google/cloud/webrisk/v1/internal/web_risk_metadata_decorator.h" +#include "google/cloud/webrisk/v1/webrisk.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 webrisk_v1_internal { @@ -170,3 +174,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace webrisk_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/webrisk/v1/internal/web_risk_metadata_decorator.h b/google/cloud/webrisk/v1/internal/web_risk_metadata_decorator.h index b30df10fe4740..4378be2c2ac02 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_metadata_decorator.h +++ b/google/cloud/webrisk/v1/internal/web_risk_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/webrisk/v1/internal/web_risk_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 webrisk_v1_internal { @@ -111,4 +114,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_V1_INTERNAL_WEB_RISK_METADATA_DECORATOR_H diff --git a/google/cloud/webrisk/v1/internal/web_risk_option_defaults.cc b/google/cloud/webrisk/v1/internal/web_risk_option_defaults.cc index d7e3bb4abf274..50ed16d6d2237 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_option_defaults.cc +++ b/google/cloud/webrisk/v1/internal/web_risk_option_defaults.cc @@ -41,7 +41,7 @@ Options WebRiskServiceDefaultOptions(Options options) { if (!options.has()) { options.set( webrisk_v1::WebRiskServiceLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/webrisk/v1/internal/web_risk_stub.cc b/google/cloud/webrisk/v1/internal/web_risk_stub.cc index 42fb29e7e62da..ac6208f27f59b 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_stub.cc +++ b/google/cloud/webrisk/v1/internal/web_risk_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/webrisk/v1/webrisk.proto #include "google/cloud/webrisk/v1/internal/web_risk_stub.h" +#include "google/cloud/webrisk/v1/webrisk.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace webrisk_v1_internal { @@ -197,3 +200,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace webrisk_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/webrisk/v1/internal/web_risk_stub.h b/google/cloud/webrisk/v1/internal/web_risk_stub.h index 85719feb2d220..4facb42cd557f 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_stub.h +++ b/google/cloud/webrisk/v1/internal/web_risk_stub.h @@ -19,16 +19,19 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_V1_INTERNAL_WEB_RISK_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_V1_INTERNAL_WEB_RISK_STUB_H +#include "google/cloud/webrisk/v1/webrisk.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace webrisk_v1_internal { @@ -175,4 +178,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_V1_INTERNAL_WEB_RISK_STUB_H diff --git a/google/cloud/webrisk/v1/internal/web_risk_stub_factory.cc b/google/cloud/webrisk/v1/internal/web_risk_stub_factory.cc index 4bfcc94696a70..58c678ca87f35 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_stub_factory.cc +++ b/google/cloud/webrisk/v1/internal/web_risk_stub_factory.cc @@ -22,17 +22,20 @@ #include "google/cloud/webrisk/v1/internal/web_risk_metadata_decorator.h" #include "google/cloud/webrisk/v1/internal/web_risk_stub.h" #include "google/cloud/webrisk/v1/internal/web_risk_tracing_stub.h" +#include "google/cloud/webrisk/v1/webrisk.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 -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace webrisk_v1_internal { @@ -72,3 +75,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace webrisk_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/webrisk/v1/internal/web_risk_stub_factory.h b/google/cloud/webrisk/v1/internal/web_risk_stub_factory.h index 528d150ed11dd..4f6b2334fb438 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_stub_factory.h +++ b/google/cloud/webrisk/v1/internal/web_risk_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace webrisk_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_V1_INTERNAL_WEB_RISK_STUB_FACTORY_H diff --git a/google/cloud/webrisk/v1/internal/web_risk_tracing_connection.cc b/google/cloud/webrisk/v1/internal/web_risk_tracing_connection.cc index f2ad07212958c..c49bd84040fba 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_tracing_connection.cc +++ b/google/cloud/webrisk/v1/internal/web_risk_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace webrisk_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - WebRiskServiceTracingConnection::WebRiskServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -132,16 +130,12 @@ Status WebRiskServiceTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeWebRiskServiceTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/webrisk/v1/internal/web_risk_tracing_connection.h b/google/cloud/webrisk/v1/internal/web_risk_tracing_connection.h index 301a747f933ce..b3863818639bc 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_tracing_connection.h +++ b/google/cloud/webrisk/v1/internal/web_risk_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace webrisk_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class WebRiskServiceTracingConnection : public webrisk_v1::WebRiskServiceConnection { public: @@ -81,8 +79,6 @@ class WebRiskServiceTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/webrisk/v1/internal/web_risk_tracing_stub.cc b/google/cloud/webrisk/v1/internal/web_risk_tracing_stub.cc index d42d4be687407..ff3d1647ece10 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_tracing_stub.cc +++ b/google/cloud/webrisk/v1/internal/web_risk_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace webrisk_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - WebRiskServiceTracingStub::WebRiskServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -179,18 +180,14 @@ future WebRiskServiceTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeWebRiskServiceTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace webrisk_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/webrisk/v1/internal/web_risk_tracing_stub.h b/google/cloud/webrisk/v1/internal/web_risk_tracing_stub.h index 8b127a6d10738..aad3d185f5977 100644 --- a/google/cloud/webrisk/v1/internal/web_risk_tracing_stub.h +++ b/google/cloud/webrisk/v1/internal/web_risk_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace webrisk_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class WebRiskServiceTracingStub : public WebRiskServiceStub { public: ~WebRiskServiceTracingStub() override = default; @@ -101,8 +102,6 @@ class WebRiskServiceTracingStub : public WebRiskServiceStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -117,4 +116,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_V1_INTERNAL_WEB_RISK_TRACING_STUB_H diff --git a/google/cloud/webrisk/v1/web_risk_client.h b/google/cloud/webrisk/v1/web_risk_client.h index 1787ec92c0d41..61f6874b269ed 100644 --- a/google/cloud/webrisk/v1/web_risk_client.h +++ b/google/cloud/webrisk/v1/web_risk_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -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/webrisk/v1/web_risk_connection.h b/google/cloud/webrisk/v1/web_risk_connection.h index 9ae99d9803249..b02c17a97e6a9 100644 --- a/google/cloud/webrisk/v1/web_risk_connection.h +++ b/google/cloud/webrisk/v1/web_risk_connection.h @@ -21,6 +21,7 @@ #include "google/cloud/webrisk/v1/internal/web_risk_retry_traits.h" #include "google/cloud/webrisk/v1/web_risk_connection_idempotency_policy.h" +#include "google/cloud/webrisk/v1/webrisk.pb.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/webrisk/v1/web_risk_connection_idempotency_policy.h b/google/cloud/webrisk/v1/web_risk_connection_idempotency_policy.h index b203b4cb5ee50..ffbdeec0a4622 100644 --- a/google/cloud/webrisk/v1/web_risk_connection_idempotency_policy.h +++ b/google/cloud/webrisk/v1/web_risk_connection_idempotency_policy.h @@ -19,10 +19,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_V1_WEB_RISK_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_V1_WEB_RISK_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/webrisk/v1/webrisk.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/webrisk/web_risk_client.h b/google/cloud/webrisk/web_risk_client.h deleted file mode 100644 index 93834d5a4f726..0000000000000 --- a/google/cloud/webrisk/web_risk_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/webrisk/v1/webrisk.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_WEB_RISK_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_WEB_RISK_CLIENT_H - -#include "google/cloud/webrisk/v1/web_risk_client.h" -#include "google/cloud/webrisk/web_risk_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in webrisk_v1 instead of the aliases defined in -/// this namespace. -namespace webrisk { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use webrisk_v1::WebRiskServiceClient directly. -using ::google::cloud::webrisk_v1::WebRiskServiceClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace webrisk -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_WEB_RISK_CLIENT_H diff --git a/google/cloud/webrisk/web_risk_connection.h b/google/cloud/webrisk/web_risk_connection.h deleted file mode 100644 index e7fa8f8096ba3..0000000000000 --- a/google/cloud/webrisk/web_risk_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/webrisk/v1/webrisk.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_WEB_RISK_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_WEB_RISK_CONNECTION_H - -#include "google/cloud/webrisk/v1/web_risk_connection.h" -#include "google/cloud/webrisk/web_risk_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace webrisk { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use webrisk_v1::MakeWebRiskServiceConnection directly. -using ::google::cloud::webrisk_v1::MakeWebRiskServiceConnection; - -/// @deprecated Use webrisk_v1::WebRiskServiceConnection directly. -using ::google::cloud::webrisk_v1::WebRiskServiceConnection; - -/// @deprecated Use webrisk_v1::WebRiskServiceLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::webrisk_v1::WebRiskServiceLimitedErrorCountRetryPolicy; - -/// @deprecated Use webrisk_v1::WebRiskServiceLimitedTimeRetryPolicy directly. -using ::google::cloud::webrisk_v1::WebRiskServiceLimitedTimeRetryPolicy; - -/// @deprecated Use webrisk_v1::WebRiskServiceRetryPolicy directly. -using ::google::cloud::webrisk_v1::WebRiskServiceRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace webrisk -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_WEB_RISK_CONNECTION_H diff --git a/google/cloud/webrisk/web_risk_connection_idempotency_policy.h b/google/cloud/webrisk/web_risk_connection_idempotency_policy.h deleted file mode 100644 index 8332ce46ffb93..0000000000000 --- a/google/cloud/webrisk/web_risk_connection_idempotency_policy.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/webrisk/v1/webrisk.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_WEB_RISK_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_WEB_RISK_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/webrisk/v1/web_risk_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace webrisk { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// webrisk_v1::MakeDefaultWebRiskServiceConnectionIdempotencyPolicy directly. -using ::google::cloud::webrisk_v1:: - MakeDefaultWebRiskServiceConnectionIdempotencyPolicy; - -/// @deprecated Use webrisk_v1::WebRiskServiceConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::webrisk_v1::WebRiskServiceConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace webrisk -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_WEB_RISK_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/webrisk/web_risk_options.h b/google/cloud/webrisk/web_risk_options.h deleted file mode 100644 index 0fb940e89b5d1..0000000000000 --- a/google/cloud/webrisk/web_risk_options.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/webrisk/v1/webrisk.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_WEB_RISK_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_WEB_RISK_OPTIONS_H - -#include "google/cloud/webrisk/v1/web_risk_options.h" -#include "google/cloud/webrisk/web_risk_connection.h" -#include "google/cloud/webrisk/web_risk_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace webrisk { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use webrisk_v1::WebRiskServicePollingPolicyOption directly. -using ::google::cloud::webrisk_v1::WebRiskServicePollingPolicyOption; - -/// @deprecated Use webrisk_v1::WebRiskServiceBackoffPolicyOption directly. -using ::google::cloud::webrisk_v1::WebRiskServiceBackoffPolicyOption; - -/// @deprecated Use webrisk_v1::WebRiskServiceConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::webrisk_v1:: - WebRiskServiceConnectionIdempotencyPolicyOption; - -/// @deprecated Use webrisk_v1::WebRiskServicePolicyOptionList directly. -using ::google::cloud::webrisk_v1::WebRiskServicePolicyOptionList; - -/// @deprecated Use webrisk_v1::WebRiskServiceRetryPolicyOption directly. -using ::google::cloud::webrisk_v1::WebRiskServiceRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace webrisk -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBRISK_WEB_RISK_OPTIONS_H diff --git a/google/cloud/websecurityscanner/BUILD.bazel b/google/cloud/websecurityscanner/BUILD.bazel index c71b33972c793..aca53be177c96 100644 --- a/google/cloud/websecurityscanner/BUILD.bazel +++ b/google/cloud/websecurityscanner/BUILD.bazel @@ -19,12 +19,11 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/websecurityscanner/v1:websecurityscanner_cc_grpc", + "@googleapis//google/cloud/websecurityscanner/v1:websecurityscanner_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/websecurityscanner/CMakeLists.txt b/google/cloud/websecurityscanner/CMakeLists.txt index 2fa4745affc52..d77d7360215e5 100644 --- a/google/cloud/websecurityscanner/CMakeLists.txt +++ b/google/cloud/websecurityscanner/CMakeLists.txt @@ -17,7 +17,7 @@ include(GoogleCloudCppLibrary) google_cloud_cpp_add_gapic_library(websecurityscanner "Web Security Scanner API" - SERVICE_DIRS "__EMPTY__" "v1/") + SERVICE_DIRS "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(websecurityscanner_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/websecurityscanner/mocks/mock_web_security_scanner_connection.h b/google/cloud/websecurityscanner/mocks/mock_web_security_scanner_connection.h deleted file mode 100644 index b57aa12ee8bf5..0000000000000 --- a/google/cloud/websecurityscanner/mocks/mock_web_security_scanner_connection.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_MOCKS_MOCK_WEB_SECURITY_SCANNER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_MOCKS_MOCK_WEB_SECURITY_SCANNER_CONNECTION_H - -#include "google/cloud/websecurityscanner/v1/mocks/mock_web_security_scanner_connection.h" -#include "google/cloud/websecurityscanner/web_security_scanner_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in websecurityscanner_v1_mocks instead of the aliases -/// defined in this namespace. -namespace websecurityscanner_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// websecurityscanner_v1_mocks::MockWebSecurityScannerConnection directly. -using ::google::cloud::websecurityscanner_v1_mocks:: - MockWebSecurityScannerConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace websecurityscanner_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_MOCKS_MOCK_WEB_SECURITY_SCANNER_CONNECTION_H diff --git a/google/cloud/websecurityscanner/quickstart/.bazelrc b/google/cloud/websecurityscanner/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/websecurityscanner/quickstart/.bazelrc +++ b/google/cloud/websecurityscanner/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/websecurityscanner/quickstart/CMakeLists.txt index fb17c660f52fb..5b4b20a74797e 100644 --- a/google/cloud/websecurityscanner/quickstart/CMakeLists.txt +++ b/google/cloud/websecurityscanner/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Web Security Scanner API C++ client library # from a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-websecurityscanner-quickstart CXX) find_package(google_cloud_cpp_websecurityscanner REQUIRED) diff --git a/google/cloud/websecurityscanner/quickstart/WORKSPACE.bazel b/google/cloud/websecurityscanner/quickstart/WORKSPACE.bazel index 8c8e589c244cd..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 = "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/websecurityscanner/v1/internal/web_security_scanner_auth_decorator.cc b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_auth_decorator.cc index 36056c3d7c73b..306ac84845866 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_auth_decorator.cc +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/websecurityscanner/v1/web_security_scanner.proto #include "google/cloud/websecurityscanner/v1/internal/web_security_scanner_auth_decorator.h" -#include +#include "google/cloud/websecurityscanner/v1/web_security_scanner.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace websecurityscanner_v1_internal { @@ -158,3 +161,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace websecurityscanner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_auth_decorator.h b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_auth_decorator.h index 16ecae26433d8..f7ba6b8bb8f74 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_auth_decorator.h +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace websecurityscanner_v1_internal { @@ -116,4 +119,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_V1_INTERNAL_WEB_SECURITY_SCANNER_AUTH_DECORATOR_H diff --git a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_logging_decorator.cc b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_logging_decorator.cc index 904fc52f0940d..daa545b75e62b 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_logging_decorator.cc +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/websecurityscanner/v1/web_security_scanner.proto #include "google/cloud/websecurityscanner/v1/internal/web_security_scanner_logging_decorator.h" +#include "google/cloud/websecurityscanner/v1/web_security_scanner.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace websecurityscanner_v1_internal { @@ -219,3 +222,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace websecurityscanner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_logging_decorator.h b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_logging_decorator.h index eb9af7a0cdc2c..845963e3b5e54 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_logging_decorator.h +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace websecurityscanner_v1_internal { @@ -116,4 +119,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_V1_INTERNAL_WEB_SECURITY_SCANNER_LOGGING_DECORATOR_H diff --git a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_metadata_decorator.cc b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_metadata_decorator.cc index 0d6cdca147499..8e0ca9becb9aa 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_metadata_decorator.cc +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/websecurityscanner/v1/web_security_scanner.proto #include "google/cloud/websecurityscanner/v1/internal/web_security_scanner_metadata_decorator.h" +#include "google/cloud/websecurityscanner/v1/web_security_scanner.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 websecurityscanner_v1_internal { @@ -185,3 +189,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace websecurityscanner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_metadata_decorator.h b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_metadata_decorator.h index 48d69c838a22c..2415d173b379d 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_metadata_decorator.h +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace websecurityscanner_v1_internal { @@ -122,4 +125,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_V1_INTERNAL_WEB_SECURITY_SCANNER_METADATA_DECORATOR_H diff --git a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_option_defaults.cc b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_option_defaults.cc index fa89caa8a88d6..6f9246b5d6f90 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_option_defaults.cc +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_option_defaults.cc @@ -43,7 +43,7 @@ Options WebSecurityScannerDefaultOptions(Options options) { .has()) { options.set( websecurityscanner_v1::WebSecurityScannerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has< diff --git a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub.cc b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub.cc index ef1dfffa2eddd..c684e5fbff1ae 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub.cc +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/websecurityscanner/v1/web_security_scanner.proto #include "google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub.h" +#include "google/cloud/websecurityscanner/v1/web_security_scanner.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace websecurityscanner_v1_internal { @@ -196,3 +199,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace websecurityscanner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub.h b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub.h index 427c0c7bd7563..a9b35a28fab7d 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub.h +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_V1_INTERNAL_WEB_SECURITY_SCANNER_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_V1_INTERNAL_WEB_SECURITY_SCANNER_STUB_H +#include "google/cloud/websecurityscanner/v1/web_security_scanner.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace websecurityscanner_v1_internal { @@ -197,4 +200,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_V1_INTERNAL_WEB_SECURITY_SCANNER_STUB_H diff --git a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub_factory.cc b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub_factory.cc index 7d0775ff04f1b..eaf58c663b9f3 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub_factory.cc +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub_factory.cc @@ -22,16 +22,19 @@ #include "google/cloud/websecurityscanner/v1/internal/web_security_scanner_metadata_decorator.h" #include "google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub.h" #include "google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_stub.h" +#include "google/cloud/websecurityscanner/v1/web_security_scanner.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 #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace websecurityscanner_v1_internal { @@ -71,3 +74,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace websecurityscanner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub_factory.h b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub_factory.h index 5412ed707422f..fd1f93b53b096 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub_factory.h +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace websecurityscanner_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_V1_INTERNAL_WEB_SECURITY_SCANNER_STUB_FACTORY_H diff --git a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_connection.cc b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_connection.cc index f6082eb475ecf..0585bf550ec49 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_connection.cc +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace websecurityscanner_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - WebSecurityScannerTracingConnection::WebSecurityScannerTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -167,17 +165,13 @@ WebSecurityScannerTracingConnection::ListFindingTypeStats( return internal::EndSpan(*span, child_->ListFindingTypeStats(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeWebSecurityScannerTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_connection.h b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_connection.h index f830a2e6f5f7b..a82070b20c67a 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_connection.h +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace websecurityscanner_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class WebSecurityScannerTracingConnection : public websecurityscanner_v1::WebSecurityScannerConnection { public: @@ -98,8 +96,6 @@ class WebSecurityScannerTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_stub.cc b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_stub.cc index 7b44eac2aabc2..2a8d7c8991312 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_stub.cc +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace websecurityscanner_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - WebSecurityScannerTracingStub::WebSecurityScannerTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -200,18 +201,14 @@ WebSecurityScannerTracingStub::ListFindingTypeStats( context, *span, child_->ListFindingTypeStats(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeWebSecurityScannerTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace websecurityscanner_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_stub.h b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_stub.h index 56535b7ebd94d..2c48f10395735 100644 --- a/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_stub.h +++ b/google/cloud/websecurityscanner/v1/internal/web_security_scanner_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace websecurityscanner_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class WebSecurityScannerTracingStub : public WebSecurityScannerStub { public: ~WebSecurityScannerTracingStub() override = default; @@ -113,8 +114,6 @@ class WebSecurityScannerTracingStub : public WebSecurityScannerStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -129,4 +128,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_V1_INTERNAL_WEB_SECURITY_SCANNER_TRACING_STUB_H diff --git a/google/cloud/websecurityscanner/v1/web_security_scanner_connection.h b/google/cloud/websecurityscanner/v1/web_security_scanner_connection.h index 0dbd6ae93ae6e..a5f260cba938d 100644 --- a/google/cloud/websecurityscanner/v1/web_security_scanner_connection.h +++ b/google/cloud/websecurityscanner/v1/web_security_scanner_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_V1_WEB_SECURITY_SCANNER_CONNECTION_H #include "google/cloud/websecurityscanner/v1/internal/web_security_scanner_retry_traits.h" +#include "google/cloud/websecurityscanner/v1/web_security_scanner.pb.h" #include "google/cloud/websecurityscanner/v1/web_security_scanner_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/internal/retry_policy_impl.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/websecurityscanner/v1/web_security_scanner_connection_idempotency_policy.h b/google/cloud/websecurityscanner/v1/web_security_scanner_connection_idempotency_policy.h index 97f1630b5e93f..660a9e029b203 100644 --- a/google/cloud/websecurityscanner/v1/web_security_scanner_connection_idempotency_policy.h +++ b/google/cloud/websecurityscanner/v1/web_security_scanner_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_V1_WEB_SECURITY_SCANNER_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_V1_WEB_SECURITY_SCANNER_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/websecurityscanner/v1/web_security_scanner.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/websecurityscanner/web_security_scanner_client.h b/google/cloud/websecurityscanner/web_security_scanner_client.h deleted file mode 100644 index 0dd470dbec498..0000000000000 --- a/google/cloud/websecurityscanner/web_security_scanner_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_WEB_SECURITY_SCANNER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_WEB_SECURITY_SCANNER_CLIENT_H - -#include "google/cloud/websecurityscanner/v1/web_security_scanner_client.h" -#include "google/cloud/websecurityscanner/web_security_scanner_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in websecurityscanner_v1 instead of the aliases defined in -/// this namespace. -namespace websecurityscanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use websecurityscanner_v1::WebSecurityScannerClient directly. -using ::google::cloud::websecurityscanner_v1::WebSecurityScannerClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace websecurityscanner -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_WEB_SECURITY_SCANNER_CLIENT_H diff --git a/google/cloud/websecurityscanner/web_security_scanner_connection.h b/google/cloud/websecurityscanner/web_security_scanner_connection.h deleted file mode 100644 index 3a8185922028f..0000000000000 --- a/google/cloud/websecurityscanner/web_security_scanner_connection.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_WEB_SECURITY_SCANNER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_WEB_SECURITY_SCANNER_CONNECTION_H - -#include "google/cloud/websecurityscanner/v1/web_security_scanner_connection.h" -#include "google/cloud/websecurityscanner/web_security_scanner_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace websecurityscanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use websecurityscanner_v1::MakeWebSecurityScannerConnection -/// directly. -using ::google::cloud::websecurityscanner_v1::MakeWebSecurityScannerConnection; - -/// @deprecated Use websecurityscanner_v1::WebSecurityScannerConnection -/// directly. -using ::google::cloud::websecurityscanner_v1::WebSecurityScannerConnection; - -/// @deprecated Use -/// websecurityscanner_v1::WebSecurityScannerLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::websecurityscanner_v1:: - WebSecurityScannerLimitedErrorCountRetryPolicy; - -/// @deprecated Use -/// websecurityscanner_v1::WebSecurityScannerLimitedTimeRetryPolicy directly. -using ::google::cloud::websecurityscanner_v1:: - WebSecurityScannerLimitedTimeRetryPolicy; - -/// @deprecated Use websecurityscanner_v1::WebSecurityScannerRetryPolicy -/// directly. -using ::google::cloud::websecurityscanner_v1::WebSecurityScannerRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace websecurityscanner -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_WEB_SECURITY_SCANNER_CONNECTION_H diff --git a/google/cloud/websecurityscanner/web_security_scanner_connection_idempotency_policy.h b/google/cloud/websecurityscanner/web_security_scanner_connection_idempotency_policy.h deleted file mode 100644 index af60871e040cf..0000000000000 --- a/google/cloud/websecurityscanner/web_security_scanner_connection_idempotency_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_WEB_SECURITY_SCANNER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_WEB_SECURITY_SCANNER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/websecurityscanner/v1/web_security_scanner_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace websecurityscanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// websecurityscanner_v1::MakeDefaultWebSecurityScannerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::websecurityscanner_v1:: - MakeDefaultWebSecurityScannerConnectionIdempotencyPolicy; - -/// @deprecated Use -/// websecurityscanner_v1::WebSecurityScannerConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::websecurityscanner_v1:: - WebSecurityScannerConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace websecurityscanner -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_WEB_SECURITY_SCANNER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/websecurityscanner/web_security_scanner_options.h b/google/cloud/websecurityscanner/web_security_scanner_options.h deleted file mode 100644 index 85aba80e7885e..0000000000000 --- a/google/cloud/websecurityscanner/web_security_scanner_options.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_WEB_SECURITY_SCANNER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_WEB_SECURITY_SCANNER_OPTIONS_H - -#include "google/cloud/websecurityscanner/v1/web_security_scanner_options.h" -#include "google/cloud/websecurityscanner/web_security_scanner_connection.h" -#include "google/cloud/websecurityscanner/web_security_scanner_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace websecurityscanner { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use websecurityscanner_v1::WebSecurityScannerBackoffPolicyOption -/// directly. -using ::google::cloud::websecurityscanner_v1:: - WebSecurityScannerBackoffPolicyOption; - -/// @deprecated Use -/// websecurityscanner_v1::WebSecurityScannerConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::websecurityscanner_v1:: - WebSecurityScannerConnectionIdempotencyPolicyOption; - -/// @deprecated Use websecurityscanner_v1::WebSecurityScannerPolicyOptionList -/// directly. -using ::google::cloud::websecurityscanner_v1:: - WebSecurityScannerPolicyOptionList; - -/// @deprecated Use websecurityscanner_v1::WebSecurityScannerRetryPolicyOption -/// directly. -using ::google::cloud::websecurityscanner_v1:: - WebSecurityScannerRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace websecurityscanner -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WEBSECURITYSCANNER_WEB_SECURITY_SCANNER_OPTIONS_H diff --git a/google/cloud/workflows/BUILD.bazel b/google/cloud/workflows/BUILD.bazel index 86dd942860f47..3ef8d4c01f5a9 100644 --- a/google/cloud/workflows/BUILD.bazel +++ b/google/cloud/workflows/BUILD.bazel @@ -19,14 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ - "", "executions/v1/", "v1/", ] googleapis_deps = [ - "@com_google_googleapis//google/cloud/workflows/executions/v1:executions_cc_grpc", - "@com_google_googleapis//google/cloud/workflows/v1:workflows_cc_grpc", + "@googleapis//google/cloud/workflows/executions/v1:executions_cc_grpc", + "@googleapis//google/cloud/workflows/v1:workflows_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/workflows/CMakeLists.txt b/google/cloud/workflows/CMakeLists.txt index 8aa37f4c1c9bb..4bd6a8242ea03 100644 --- a/google/cloud/workflows/CMakeLists.txt +++ b/google/cloud/workflows/CMakeLists.txt @@ -16,9 +16,8 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library( - workflows "Workflow Executions API" SERVICE_DIRS "__EMPTY__" - "executions/v1/" "v1/") +google_cloud_cpp_add_gapic_library(workflows "Workflow Executions API" + SERVICE_DIRS "executions/v1/" "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(workflows_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/workflows/executions/v1/executions_connection.h b/google/cloud/workflows/executions/v1/executions_connection.h index 634a37b6d14a8..50e78b1c2678e 100644 --- a/google/cloud/workflows/executions/v1/executions_connection.h +++ b/google/cloud/workflows/executions/v1/executions_connection.h @@ -19,6 +19,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_V1_EXECUTIONS_CONNECTION_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_V1_EXECUTIONS_CONNECTION_H +#include "google/cloud/workflows/executions/v1/executions.pb.h" #include "google/cloud/workflows/executions/v1/executions_connection_idempotency_policy.h" #include "google/cloud/workflows/executions/v1/internal/executions_retry_traits.h" #include "google/cloud/backoff_policy.h" @@ -27,7 +28,6 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/workflows/executions/v1/executions_connection_idempotency_policy.h b/google/cloud/workflows/executions/v1/executions_connection_idempotency_policy.h index f7f186bd91a3e..43c76edc46a0a 100644 --- a/google/cloud/workflows/executions/v1/executions_connection_idempotency_policy.h +++ b/google/cloud/workflows/executions/v1/executions_connection_idempotency_policy.h @@ -19,9 +19,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_V1_EXECUTIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_V1_EXECUTIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/workflows/executions/v1/executions.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include #include namespace google { diff --git a/google/cloud/workflows/executions/v1/internal/executions_auth_decorator.cc b/google/cloud/workflows/executions/v1/internal/executions_auth_decorator.cc index 6c181364cf4ed..b2876a58ca255 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_auth_decorator.cc +++ b/google/cloud/workflows/executions/v1/internal/executions_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/workflows/executions/v1/executions.proto #include "google/cloud/workflows/executions/v1/internal/executions_auth_decorator.h" -#include +#include "google/cloud/workflows/executions/v1/executions.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_executions_v1_internal { @@ -75,3 +78,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workflows_executions_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workflows/executions/v1/internal/executions_auth_decorator.h b/google/cloud/workflows/executions/v1/internal/executions_auth_decorator.h index 50f784b3c5b96..b1a6d55fc8975 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_auth_decorator.h +++ b/google/cloud/workflows/executions/v1/internal/executions_auth_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_executions_v1_internal { @@ -69,4 +72,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_V1_INTERNAL_EXECUTIONS_AUTH_DECORATOR_H diff --git a/google/cloud/workflows/executions/v1/internal/executions_logging_decorator.cc b/google/cloud/workflows/executions/v1/internal/executions_logging_decorator.cc index e4a031d4e58f2..4e5d79df986a7 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_logging_decorator.cc +++ b/google/cloud/workflows/executions/v1/internal/executions_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/workflows/executions/v1/executions.proto #include "google/cloud/workflows/executions/v1/internal/executions_logging_decorator.h" +#include "google/cloud/workflows/executions/v1/executions.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_executions_v1_internal { @@ -97,3 +100,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workflows_executions_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workflows/executions/v1/internal/executions_logging_decorator.h b/google/cloud/workflows/executions/v1/internal/executions_logging_decorator.h index f0944af790d1a..4e8404ed4f13c 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_logging_decorator.h +++ b/google/cloud/workflows/executions/v1/internal/executions_logging_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_executions_v1_internal { @@ -69,4 +72,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_V1_INTERNAL_EXECUTIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/workflows/executions/v1/internal/executions_metadata_decorator.cc b/google/cloud/workflows/executions/v1/internal/executions_metadata_decorator.cc index 1cef5fb085891..4e9bb408e298f 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_metadata_decorator.cc +++ b/google/cloud/workflows/executions/v1/internal/executions_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/workflows/executions/v1/executions.proto #include "google/cloud/workflows/executions/v1/internal/executions_metadata_decorator.h" +#include "google/cloud/workflows/executions/v1/executions.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 workflows_executions_v1_internal { @@ -101,3 +105,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workflows_executions_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workflows/executions/v1/internal/executions_metadata_decorator.h b/google/cloud/workflows/executions/v1/internal/executions_metadata_decorator.h index 609a0929a5895..f650a692f6119 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_metadata_decorator.h +++ b/google/cloud/workflows/executions/v1/internal/executions_metadata_decorator.h @@ -26,6 +26,9 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_executions_v1_internal { @@ -74,4 +77,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_V1_INTERNAL_EXECUTIONS_METADATA_DECORATOR_H diff --git a/google/cloud/workflows/executions/v1/internal/executions_option_defaults.cc b/google/cloud/workflows/executions/v1/internal/executions_option_defaults.cc index 7e02b8bf55e84..56213adabd452 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_option_defaults.cc +++ b/google/cloud/workflows/executions/v1/internal/executions_option_defaults.cc @@ -42,7 +42,7 @@ Options ExecutionsDefaultOptions(Options options) { if (!options.has()) { options.set( workflows_executions_v1::ExecutionsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/workflows/executions/v1/internal/executions_stub.cc b/google/cloud/workflows/executions/v1/internal/executions_stub.cc index 791abcbf9150f..0a28938e7f627 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_stub.cc +++ b/google/cloud/workflows/executions/v1/internal/executions_stub.cc @@ -17,12 +17,15 @@ // source: google/cloud/workflows/executions/v1/executions.proto #include "google/cloud/workflows/executions/v1/internal/executions_stub.h" +#include "google/cloud/workflows/executions/v1/executions.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_executions_v1_internal { @@ -86,3 +89,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workflows_executions_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workflows/executions/v1/internal/executions_stub.h b/google/cloud/workflows/executions/v1/internal/executions_stub.h index 7db183607a67a..41d115c8c1476 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_stub.h +++ b/google/cloud/workflows/executions/v1/internal/executions_stub.h @@ -19,13 +19,16 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_V1_INTERNAL_EXECUTIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_V1_INTERNAL_EXECUTIONS_STUB_H +#include "google/cloud/workflows/executions/v1/executions.grpc.pb.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_executions_v1_internal { @@ -101,4 +104,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_V1_INTERNAL_EXECUTIONS_STUB_H diff --git a/google/cloud/workflows/executions/v1/internal/executions_stub_factory.cc b/google/cloud/workflows/executions/v1/internal/executions_stub_factory.cc index 23fc0052b9b75..95c4217c362b7 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_stub_factory.cc +++ b/google/cloud/workflows/executions/v1/internal/executions_stub_factory.cc @@ -17,6 +17,7 @@ // source: google/cloud/workflows/executions/v1/executions.proto #include "google/cloud/workflows/executions/v1/internal/executions_stub_factory.h" +#include "google/cloud/workflows/executions/v1/executions.grpc.pb.h" #include "google/cloud/workflows/executions/v1/internal/executions_auth_decorator.h" #include "google/cloud/workflows/executions/v1/internal/executions_logging_decorator.h" #include "google/cloud/workflows/executions/v1/internal/executions_metadata_decorator.h" @@ -28,10 +29,12 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_executions_v1_internal { @@ -68,3 +71,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workflows_executions_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workflows/executions/v1/internal/executions_stub_factory.h b/google/cloud/workflows/executions/v1/internal/executions_stub_factory.h index 33a0d3ad07a20..b08469c1d73b1 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_stub_factory.h +++ b/google/cloud/workflows/executions/v1/internal/executions_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_executions_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_V1_INTERNAL_EXECUTIONS_STUB_FACTORY_H diff --git a/google/cloud/workflows/executions/v1/internal/executions_tracing_connection.cc b/google/cloud/workflows/executions/v1/internal/executions_tracing_connection.cc index cb4d2d10d4ded..bb2353e448c32 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_tracing_connection.cc +++ b/google/cloud/workflows/executions/v1/internal/executions_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace workflows_executions_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ExecutionsTracingConnection::ExecutionsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -75,16 +73,12 @@ ExecutionsTracingConnection::CancelExecution( return internal::EndSpan(*span, child_->CancelExecution(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeExecutionsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/workflows/executions/v1/internal/executions_tracing_connection.h b/google/cloud/workflows/executions/v1/internal/executions_tracing_connection.h index a83504308034c..7b737eeb7d874 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_tracing_connection.h +++ b/google/cloud/workflows/executions/v1/internal/executions_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace workflows_executions_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ExecutionsTracingConnection : public workflows_executions_v1::ExecutionsConnection { public: @@ -60,8 +58,6 @@ class ExecutionsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/workflows/executions/v1/internal/executions_tracing_stub.cc b/google/cloud/workflows/executions/v1/internal/executions_tracing_stub.cc index 93a22cff3b7b3..64c76cf47ace4 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_tracing_stub.cc +++ b/google/cloud/workflows/executions/v1/internal/executions_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_executions_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - ExecutionsTracingStub::ExecutionsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -84,18 +85,14 @@ ExecutionsTracingStub::CancelExecution( child_->CancelExecution(context, options, request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeExecutionsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workflows_executions_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workflows/executions/v1/internal/executions_tracing_stub.h b/google/cloud/workflows/executions/v1/internal/executions_tracing_stub.h index da82747917da8..e9316c390086d 100644 --- a/google/cloud/workflows/executions/v1/internal/executions_tracing_stub.h +++ b/google/cloud/workflows/executions/v1/internal/executions_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_executions_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class ExecutionsTracingStub : public ExecutionsStub { public: ~ExecutionsTracingStub() override = default; @@ -65,8 +66,6 @@ class ExecutionsTracingStub : public ExecutionsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -81,4 +80,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_V1_INTERNAL_EXECUTIONS_TRACING_STUB_H diff --git a/google/cloud/workflows/executions_client.h b/google/cloud/workflows/executions_client.h deleted file mode 100644 index bcb44336918a7..0000000000000 --- a/google/cloud/workflows/executions_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/workflows/executions/v1/executions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_CLIENT_H - -#include "google/cloud/workflows/executions/v1/executions_client.h" -#include "google/cloud/workflows/executions_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in workflows_executions_v1 instead of the aliases defined -/// in this namespace. -namespace workflows { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use workflows_executions_v1::ExecutionsClient directly. -using ::google::cloud::workflows_executions_v1::ExecutionsClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace workflows -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_CLIENT_H diff --git a/google/cloud/workflows/executions_connection.h b/google/cloud/workflows/executions_connection.h deleted file mode 100644 index af08d6515e0a2..0000000000000 --- a/google/cloud/workflows/executions_connection.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/workflows/executions/v1/executions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_CONNECTION_H - -#include "google/cloud/workflows/executions/v1/executions_connection.h" -#include "google/cloud/workflows/executions_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace workflows { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use workflows_executions_v1::MakeExecutionsConnection directly. -using ::google::cloud::workflows_executions_v1::MakeExecutionsConnection; - -/// @deprecated Use workflows_executions_v1::ExecutionsConnection directly. -using ::google::cloud::workflows_executions_v1::ExecutionsConnection; - -/// @deprecated Use -/// workflows_executions_v1::ExecutionsLimitedErrorCountRetryPolicy directly. -using ::google::cloud::workflows_executions_v1:: - ExecutionsLimitedErrorCountRetryPolicy; - -/// @deprecated Use workflows_executions_v1::ExecutionsLimitedTimeRetryPolicy -/// directly. -using ::google::cloud::workflows_executions_v1:: - ExecutionsLimitedTimeRetryPolicy; - -/// @deprecated Use workflows_executions_v1::ExecutionsRetryPolicy directly. -using ::google::cloud::workflows_executions_v1::ExecutionsRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace workflows -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_CONNECTION_H diff --git a/google/cloud/workflows/executions_connection_idempotency_policy.h b/google/cloud/workflows/executions_connection_idempotency_policy.h deleted file mode 100644 index 038aa751c8e29..0000000000000 --- a/google/cloud/workflows/executions_connection_idempotency_policy.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/workflows/executions/v1/executions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/workflows/executions/v1/executions_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace workflows { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// workflows_executions_v1::MakeDefaultExecutionsConnectionIdempotencyPolicy -/// directly. -using ::google::cloud::workflows_executions_v1:: - MakeDefaultExecutionsConnectionIdempotencyPolicy; - -/// @deprecated Use -/// workflows_executions_v1::ExecutionsConnectionIdempotencyPolicy directly. -using ::google::cloud::workflows_executions_v1:: - ExecutionsConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace workflows -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/workflows/executions_options.h b/google/cloud/workflows/executions_options.h deleted file mode 100644 index e49ebff4ded05..0000000000000 --- a/google/cloud/workflows/executions_options.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/workflows/executions/v1/executions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_OPTIONS_H - -#include "google/cloud/workflows/executions/v1/executions_options.h" -#include "google/cloud/workflows/executions_connection.h" -#include "google/cloud/workflows/executions_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace workflows { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use workflows_executions_v1::ExecutionsBackoffPolicyOption -/// directly. -using ::google::cloud::workflows_executions_v1::ExecutionsBackoffPolicyOption; - -/// @deprecated Use -/// workflows_executions_v1::ExecutionsConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::workflows_executions_v1:: - ExecutionsConnectionIdempotencyPolicyOption; - -/// @deprecated Use workflows_executions_v1::ExecutionsPolicyOptionList -/// directly. -using ::google::cloud::workflows_executions_v1::ExecutionsPolicyOptionList; - -/// @deprecated Use workflows_executions_v1::ExecutionsRetryPolicyOption -/// directly. -using ::google::cloud::workflows_executions_v1::ExecutionsRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace workflows -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_EXECUTIONS_OPTIONS_H diff --git a/google/cloud/workflows/mocks/mock_executions_connection.h b/google/cloud/workflows/mocks/mock_executions_connection.h deleted file mode 100644 index b8f701a60acf8..0000000000000 --- a/google/cloud/workflows/mocks/mock_executions_connection.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/workflows/executions/v1/executions.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_MOCKS_MOCK_EXECUTIONS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_MOCKS_MOCK_EXECUTIONS_CONNECTION_H - -#include "google/cloud/workflows/executions/v1/mocks/mock_executions_connection.h" -#include "google/cloud/workflows/executions_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in workflows_executions_v1_mocks instead of the aliases -/// defined in this namespace. -namespace workflows_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use workflows_executions_v1_mocks::MockExecutionsConnection -/// directly. -using ::google::cloud::workflows_executions_v1_mocks::MockExecutionsConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace workflows_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_MOCKS_MOCK_EXECUTIONS_CONNECTION_H diff --git a/google/cloud/workflows/mocks/mock_workflows_connection.h b/google/cloud/workflows/mocks/mock_workflows_connection.h deleted file mode 100644 index d6a24aeed5642..0000000000000 --- a/google/cloud/workflows/mocks/mock_workflows_connection.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/workflows/v1/workflows.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_MOCKS_MOCK_WORKFLOWS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_MOCKS_MOCK_WORKFLOWS_CONNECTION_H - -#include "google/cloud/workflows/v1/mocks/mock_workflows_connection.h" -#include "google/cloud/workflows/workflows_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in workflows_v1_mocks instead of the aliases -/// defined in this namespace. -namespace workflows_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use workflows_v1_mocks::MockWorkflowsConnection directly. -using ::google::cloud::workflows_v1_mocks::MockWorkflowsConnection; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace workflows_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_MOCKS_MOCK_WORKFLOWS_CONNECTION_H diff --git a/google/cloud/workflows/quickstart/.bazelrc b/google/cloud/workflows/quickstart/.bazelrc index f8f4bb3e07a87..a0cd2dae58f1b 100644 --- a/google/cloud/workflows/quickstart/.bazelrc +++ b/google/cloud/workflows/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/workflows/quickstart/CMakeLists.txt index ca93a80d3eed1..3fa5b2a9efd1f 100644 --- a/google/cloud/workflows/quickstart/CMakeLists.txt +++ b/google/cloud/workflows/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Workflow Executions API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-workflows-quickstart CXX) find_package(google_cloud_cpp_workflows REQUIRED) diff --git a/google/cloud/workflows/quickstart/WORKSPACE.bazel b/google/cloud/workflows/quickstart/WORKSPACE.bazel index 72ce4a126e001..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 = "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/workflows/v1/internal/workflows_auth_decorator.cc b/google/cloud/workflows/v1/internal/workflows_auth_decorator.cc index 72f872b1989b7..26ecc7946991a 100644 --- a/google/cloud/workflows/v1/internal/workflows_auth_decorator.cc +++ b/google/cloud/workflows/v1/internal/workflows_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/workflows/v1/workflows.proto #include "google/cloud/workflows/v1/internal/workflows_auth_decorator.h" -#include +#include "google/cloud/workflows/v1/workflows.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_v1_internal { @@ -223,3 +226,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workflows_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workflows/v1/internal/workflows_auth_decorator.h b/google/cloud/workflows/v1/internal/workflows_auth_decorator.h index 43146227c08bc..5bfd53d24b84a 100644 --- a/google/cloud/workflows/v1/internal/workflows_auth_decorator.h +++ b/google/cloud/workflows/v1/internal/workflows_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/workflows/v1/internal/workflows_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 workflows_v1_internal { @@ -132,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_V1_INTERNAL_WORKFLOWS_AUTH_DECORATOR_H diff --git a/google/cloud/workflows/v1/internal/workflows_connection_impl.h b/google/cloud/workflows/v1/internal/workflows_connection_impl.h index a60b4d6815dfb..3cb2ab9922531 100644 --- a/google/cloud/workflows/v1/internal/workflows_connection_impl.h +++ b/google/cloud/workflows/v1/internal/workflows_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/workflows/v1/internal/workflows_logging_decorator.cc b/google/cloud/workflows/v1/internal/workflows_logging_decorator.cc index 1af33fa54b11d..149068705c6f0 100644 --- a/google/cloud/workflows/v1/internal/workflows_logging_decorator.cc +++ b/google/cloud/workflows/v1/internal/workflows_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/workflows/v1/workflows.proto #include "google/cloud/workflows/v1/internal/workflows_logging_decorator.h" +#include "google/cloud/workflows/v1/workflows.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_v1_internal { @@ -261,3 +264,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workflows_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workflows/v1/internal/workflows_logging_decorator.h b/google/cloud/workflows/v1/internal/workflows_logging_decorator.h index 04ddf2deb502d..1b0c701ff3765 100644 --- a/google/cloud/workflows/v1/internal/workflows_logging_decorator.h +++ b/google/cloud/workflows/v1/internal/workflows_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/workflows/v1/internal/workflows_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 workflows_v1_internal { @@ -132,4 +135,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_V1_INTERNAL_WORKFLOWS_LOGGING_DECORATOR_H diff --git a/google/cloud/workflows/v1/internal/workflows_metadata_decorator.cc b/google/cloud/workflows/v1/internal/workflows_metadata_decorator.cc index da9e975dac1e8..1cc4d5fcc0c51 100644 --- a/google/cloud/workflows/v1/internal/workflows_metadata_decorator.cc +++ b/google/cloud/workflows/v1/internal/workflows_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/workflows/v1/workflows.proto #include "google/cloud/workflows/v1/internal/workflows_metadata_decorator.h" +#include "google/cloud/workflows/v1/workflows.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 workflows_v1_internal { @@ -214,3 +218,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workflows_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workflows/v1/internal/workflows_metadata_decorator.h b/google/cloud/workflows/v1/internal/workflows_metadata_decorator.h index 77f22bd16eef8..7be99e1e810e9 100644 --- a/google/cloud/workflows/v1/internal/workflows_metadata_decorator.h +++ b/google/cloud/workflows/v1/internal/workflows_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/workflows/v1/internal/workflows_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 workflows_v1_internal { @@ -137,4 +140,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_V1_INTERNAL_WORKFLOWS_METADATA_DECORATOR_H diff --git a/google/cloud/workflows/v1/internal/workflows_option_defaults.cc b/google/cloud/workflows/v1/internal/workflows_option_defaults.cc index c13280189a676..771c28d15f78a 100644 --- a/google/cloud/workflows/v1/internal/workflows_option_defaults.cc +++ b/google/cloud/workflows/v1/internal/workflows_option_defaults.cc @@ -40,7 +40,7 @@ Options WorkflowsDefaultOptions(Options options) { options = internal::PopulateGrpcOptions(std::move(options)); if (!options.has()) { options.set( - workflows_v1::WorkflowsLimitedTimeRetryPolicy(std::chrono::minutes(30)) + workflows_v1::WorkflowsLimitedTimeRetryPolicy(std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/workflows/v1/internal/workflows_stub.cc b/google/cloud/workflows/v1/internal/workflows_stub.cc index 92188010f5d63..daf0e48f086d1 100644 --- a/google/cloud/workflows/v1/internal/workflows_stub.cc +++ b/google/cloud/workflows/v1/internal/workflows_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/workflows/v1/workflows.proto #include "google/cloud/workflows/v1/internal/workflows_stub.h" +#include "google/cloud/workflows/v1/workflows.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_v1_internal { @@ -254,3 +257,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workflows_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workflows/v1/internal/workflows_stub.h b/google/cloud/workflows/v1/internal/workflows_stub.h index 5b52ec5d3cd3d..17e6362bbaa55 100644 --- a/google/cloud/workflows/v1/internal/workflows_stub.h +++ b/google/cloud/workflows/v1/internal/workflows_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_V1_INTERNAL_WORKFLOWS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_V1_INTERNAL_WORKFLOWS_STUB_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/workflows/v1/workflows.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_v1_internal { @@ -228,4 +231,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_V1_INTERNAL_WORKFLOWS_STUB_H diff --git a/google/cloud/workflows/v1/internal/workflows_stub_factory.cc b/google/cloud/workflows/v1/internal/workflows_stub_factory.cc index 18bc1b778b7ed..16d104c7f0c2d 100644 --- a/google/cloud/workflows/v1/internal/workflows_stub_factory.cc +++ b/google/cloud/workflows/v1/internal/workflows_stub_factory.cc @@ -17,23 +17,26 @@ // source: google/cloud/workflows/v1/workflows.proto #include "google/cloud/workflows/v1/internal/workflows_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/workflows/v1/internal/workflows_auth_decorator.h" #include "google/cloud/workflows/v1/internal/workflows_logging_decorator.h" #include "google/cloud/workflows/v1/internal/workflows_metadata_decorator.h" #include "google/cloud/workflows/v1/internal/workflows_stub.h" #include "google/cloud/workflows/v1/internal/workflows_tracing_stub.h" +#include "google/cloud/workflows/v1/workflows.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 -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workflows_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workflows/v1/internal/workflows_stub_factory.h b/google/cloud/workflows/v1/internal/workflows_stub_factory.h index 15ca8c3024348..7a477819acda2 100644 --- a/google/cloud/workflows/v1/internal/workflows_stub_factory.h +++ b/google/cloud/workflows/v1/internal/workflows_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_V1_INTERNAL_WORKFLOWS_STUB_FACTORY_H diff --git a/google/cloud/workflows/v1/internal/workflows_tracing_connection.cc b/google/cloud/workflows/v1/internal/workflows_tracing_connection.cc index 5b3d87458df14..28b733f151710 100644 --- a/google/cloud/workflows/v1/internal/workflows_tracing_connection.cc +++ b/google/cloud/workflows/v1/internal/workflows_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace workflows_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - WorkflowsTracingConnection::WorkflowsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -199,16 +197,12 @@ Status WorkflowsTracingConnection::DeleteOperation( return internal::EndSpan(*span, child_->DeleteOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeWorkflowsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/workflows/v1/internal/workflows_tracing_connection.h b/google/cloud/workflows/v1/internal/workflows_tracing_connection.h index 325b589c97c15..e356559273eb1 100644 --- a/google/cloud/workflows/v1/internal/workflows_tracing_connection.h +++ b/google/cloud/workflows/v1/internal/workflows_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace workflows_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class WorkflowsTracingConnection : public workflows_v1::WorkflowsConnection { public: ~WorkflowsTracingConnection() override = default; @@ -104,8 +102,6 @@ class WorkflowsTracingConnection : public workflows_v1::WorkflowsConnection { std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/workflows/v1/internal/workflows_tracing_stub.cc b/google/cloud/workflows/v1/internal/workflows_tracing_stub.cc index 0965f99fa0dd1..6da8035ccdb88 100644 --- a/google/cloud/workflows/v1/internal/workflows_tracing_stub.cc +++ b/google/cloud/workflows/v1/internal/workflows_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - WorkflowsTracingStub::WorkflowsTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -230,18 +231,14 @@ future WorkflowsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeWorkflowsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workflows_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workflows/v1/internal/workflows_tracing_stub.h b/google/cloud/workflows/v1/internal/workflows_tracing_stub.h index 33fd816da5fd1..2d3a0b8cfd1a8 100644 --- a/google/cloud/workflows/v1/internal/workflows_tracing_stub.h +++ b/google/cloud/workflows/v1/internal/workflows_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workflows_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class WorkflowsTracingStub : public WorkflowsStub { public: ~WorkflowsTracingStub() override = default; @@ -127,8 +128,6 @@ class WorkflowsTracingStub : public WorkflowsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -143,4 +142,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_V1_INTERNAL_WORKFLOWS_TRACING_STUB_H diff --git a/google/cloud/workflows/v1/workflows_client.h b/google/cloud/workflows/v1/workflows_client.h index af9b14ba62349..b618bf3e932f9 100644 --- a/google/cloud/workflows/v1/workflows_client.h +++ b/google/cloud/workflows/v1/workflows_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include diff --git a/google/cloud/workflows/v1/workflows_connection.h b/google/cloud/workflows/v1/workflows_connection.h index 5744a4a0a78b9..5bef570d7dd96 100644 --- a/google/cloud/workflows/v1/workflows_connection.h +++ b/google/cloud/workflows/v1/workflows_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_V1_WORKFLOWS_CONNECTION_H #include "google/cloud/workflows/v1/internal/workflows_retry_traits.h" +#include "google/cloud/workflows/v1/workflows.pb.h" #include "google/cloud/workflows/v1/workflows_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/workflows/v1/workflows_connection_idempotency_policy.h b/google/cloud/workflows/v1/workflows_connection_idempotency_policy.h index e9fe229c99f3d..0d1500688a6d5 100644 --- a/google/cloud/workflows/v1/workflows_connection_idempotency_policy.h +++ b/google/cloud/workflows/v1/workflows_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_V1_WORKFLOWS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_V1_WORKFLOWS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/workflows/v1/workflows.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/workflows/workflows_client.h b/google/cloud/workflows/workflows_client.h deleted file mode 100644 index 0abe1d7d1900c..0000000000000 --- a/google/cloud/workflows/workflows_client.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/workflows/v1/workflows.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_WORKFLOWS_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_WORKFLOWS_CLIENT_H - -#include "google/cloud/workflows/v1/workflows_client.h" -#include "google/cloud/workflows/workflows_connection.h" - -namespace google { -namespace cloud { -/// @deprecated This namespace exists for backwards compatibility. Use the -/// types defined in workflows_v1 instead of the aliases defined in -/// this namespace. -namespace workflows { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use workflows_v1::WorkflowsClient directly. -using ::google::cloud::workflows_v1::WorkflowsClient; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace workflows -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_WORKFLOWS_CLIENT_H diff --git a/google/cloud/workflows/workflows_connection.h b/google/cloud/workflows/workflows_connection.h deleted file mode 100644 index a546d50c070fd..0000000000000 --- a/google/cloud/workflows/workflows_connection.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/workflows/v1/workflows.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_WORKFLOWS_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_WORKFLOWS_CONNECTION_H - -#include "google/cloud/workflows/v1/workflows_connection.h" -#include "google/cloud/workflows/workflows_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace workflows { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use workflows_v1::MakeWorkflowsConnection directly. -using ::google::cloud::workflows_v1::MakeWorkflowsConnection; - -/// @deprecated Use workflows_v1::WorkflowsConnection directly. -using ::google::cloud::workflows_v1::WorkflowsConnection; - -/// @deprecated Use workflows_v1::WorkflowsLimitedErrorCountRetryPolicy -/// directly. -using ::google::cloud::workflows_v1::WorkflowsLimitedErrorCountRetryPolicy; - -/// @deprecated Use workflows_v1::WorkflowsLimitedTimeRetryPolicy directly. -using ::google::cloud::workflows_v1::WorkflowsLimitedTimeRetryPolicy; - -/// @deprecated Use workflows_v1::WorkflowsRetryPolicy directly. -using ::google::cloud::workflows_v1::WorkflowsRetryPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace workflows -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_WORKFLOWS_CONNECTION_H diff --git a/google/cloud/workflows/workflows_connection_idempotency_policy.h b/google/cloud/workflows/workflows_connection_idempotency_policy.h deleted file mode 100644 index f6ad276822c14..0000000000000 --- a/google/cloud/workflows/workflows_connection_idempotency_policy.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/workflows/v1/workflows.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_WORKFLOWS_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_WORKFLOWS_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/workflows/v1/workflows_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace workflows { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use -/// workflows_v1::MakeDefaultWorkflowsConnectionIdempotencyPolicy directly. -using ::google::cloud::workflows_v1:: - MakeDefaultWorkflowsConnectionIdempotencyPolicy; - -/// @deprecated Use workflows_v1::WorkflowsConnectionIdempotencyPolicy directly. -using ::google::cloud::workflows_v1::WorkflowsConnectionIdempotencyPolicy; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace workflows -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_WORKFLOWS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/workflows/workflows_options.h b/google/cloud/workflows/workflows_options.h deleted file mode 100644 index 3e5267b502b97..0000000000000 --- a/google/cloud/workflows/workflows_options.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/workflows/v1/workflows.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_WORKFLOWS_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_WORKFLOWS_OPTIONS_H - -#include "google/cloud/workflows/v1/workflows_options.h" -#include "google/cloud/workflows/workflows_connection.h" -#include "google/cloud/workflows/workflows_connection_idempotency_policy.h" - -namespace google { -namespace cloud { -namespace workflows { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// @deprecated Use workflows_v1::WorkflowsPollingPolicyOption directly. -using ::google::cloud::workflows_v1::WorkflowsPollingPolicyOption; - -/// @deprecated Use workflows_v1::WorkflowsBackoffPolicyOption directly. -using ::google::cloud::workflows_v1::WorkflowsBackoffPolicyOption; - -/// @deprecated Use workflows_v1::WorkflowsConnectionIdempotencyPolicyOption -/// directly. -using ::google::cloud::workflows_v1::WorkflowsConnectionIdempotencyPolicyOption; - -/// @deprecated Use workflows_v1::WorkflowsPolicyOptionList directly. -using ::google::cloud::workflows_v1::WorkflowsPolicyOptionList; - -/// @deprecated Use workflows_v1::WorkflowsRetryPolicyOption directly. -using ::google::cloud::workflows_v1::WorkflowsRetryPolicyOption; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace workflows -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKFLOWS_WORKFLOWS_OPTIONS_H 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/BUILD.bazel b/google/cloud/workstations/BUILD.bazel index 92812cdbf3b8d..b7b5a95430f3f 100644 --- a/google/cloud/workstations/BUILD.bazel +++ b/google/cloud/workstations/BUILD.bazel @@ -21,7 +21,7 @@ licenses(["notice"]) # Apache 2.0 service_dirs = ["v1/"] googleapis_deps = [ - "@com_google_googleapis//google/cloud/workstations/v1:workstations_cc_grpc", + "@googleapis//google/cloud/workstations/v1:workstations_cc_grpc", ] cc_gapic_library( diff --git a/google/cloud/workstations/quickstart/.bazelrc b/google/cloud/workstations/quickstart/.bazelrc index 6777c6b4c95de..ec27511a60add 100644 --- a/google/cloud/workstations/quickstart/.bazelrc +++ b/google/cloud/workstations/quickstart/.bazelrc @@ -15,14 +15,14 @@ # 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 + + +build:linux --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 + + +build:linux --host_cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 # 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 @@ -31,3 +31,4 @@ build --experimental_convenience_symlinks=ignore #Our quickstarts do not yet support bzlmod build --noenable_bzlmod +build --enable_workspace 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/CMakeLists.txt b/google/cloud/workstations/quickstart/CMakeLists.txt index ae56dad9a5c2b..bd41cd34ee7c8 100644 --- a/google/cloud/workstations/quickstart/CMakeLists.txt +++ b/google/cloud/workstations/quickstart/CMakeLists.txt @@ -15,7 +15,7 @@ # This file shows how to use the Cloud Workstations API C++ client library from # a larger CMake project. -cmake_minimum_required(VERSION 3.10...3.24) +cmake_minimum_required(VERSION 3.22...3.31) project(google-cloud-cpp-workstations-quickstart CXX) find_package(google_cloud_cpp_workstations REQUIRED) diff --git a/google/cloud/workstations/quickstart/WORKSPACE.bazel b/google/cloud/workstations/quickstart/WORKSPACE.bazel index dcd523b25db20..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 = "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/workstations/v1/internal/workstations_auth_decorator.cc b/google/cloud/workstations/v1/internal/workstations_auth_decorator.cc index 130ae233577a1..0a034a57781bc 100644 --- a/google/cloud/workstations/v1/internal/workstations_auth_decorator.cc +++ b/google/cloud/workstations/v1/internal/workstations_auth_decorator.cc @@ -17,10 +17,13 @@ // source: google/cloud/workstations/v1/workstations.proto #include "google/cloud/workstations/v1/internal/workstations_auth_decorator.h" -#include +#include "google/cloud/workstations/v1/workstations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workstations_v1_internal { @@ -543,3 +546,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workstations_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workstations/v1/internal/workstations_auth_decorator.h b/google/cloud/workstations/v1/internal/workstations_auth_decorator.h index d9775402cd1a5..e31deb49ba67e 100644 --- a/google/cloud/workstations/v1/internal/workstations_auth_decorator.h +++ b/google/cloud/workstations/v1/internal/workstations_auth_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/workstations/v1/internal/workstations_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" -#include +#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 workstations_v1_internal { @@ -278,4 +281,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKSTATIONS_V1_INTERNAL_WORKSTATIONS_AUTH_DECORATOR_H diff --git a/google/cloud/workstations/v1/internal/workstations_connection_impl.h b/google/cloud/workstations/v1/internal/workstations_connection_impl.h index bcab4455fb5bc..a0eac1286aa15 100644 --- a/google/cloud/workstations/v1/internal/workstations_connection_impl.h +++ b/google/cloud/workstations/v1/internal/workstations_connection_impl.h @@ -32,7 +32,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/workstations/v1/internal/workstations_logging_decorator.cc b/google/cloud/workstations/v1/internal/workstations_logging_decorator.cc index fe7fa3303ee87..70eb8672f5f22 100644 --- a/google/cloud/workstations/v1/internal/workstations_logging_decorator.cc +++ b/google/cloud/workstations/v1/internal/workstations_logging_decorator.cc @@ -17,14 +17,17 @@ // source: google/cloud/workstations/v1/workstations.proto #include "google/cloud/workstations/v1/internal/workstations_logging_decorator.h" +#include "google/cloud/workstations/v1/workstations.grpc.pb.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" -#include #include #include #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workstations_v1_internal { @@ -646,3 +649,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workstations_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workstations/v1/internal/workstations_logging_decorator.h b/google/cloud/workstations/v1/internal/workstations_logging_decorator.h index d601d33c4d93a..809c7a46e6382 100644 --- a/google/cloud/workstations/v1/internal/workstations_logging_decorator.h +++ b/google/cloud/workstations/v1/internal/workstations_logging_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/workstations/v1/internal/workstations_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" -#include +#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 workstations_v1_internal { @@ -278,4 +281,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKSTATIONS_V1_INTERNAL_WORKSTATIONS_LOGGING_DECORATOR_H diff --git a/google/cloud/workstations/v1/internal/workstations_metadata_decorator.cc b/google/cloud/workstations/v1/internal/workstations_metadata_decorator.cc index 577cc13353044..81215faff5045 100644 --- a/google/cloud/workstations/v1/internal/workstations_metadata_decorator.cc +++ b/google/cloud/workstations/v1/internal/workstations_metadata_decorator.cc @@ -17,17 +17,21 @@ // source: google/cloud/workstations/v1/workstations.proto #include "google/cloud/workstations/v1/internal/workstations_metadata_decorator.h" +#include "google/cloud/workstations/v1/workstations.grpc.pb.h" #include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/url_encode.h" #include "google/cloud/status_or.h" -#include +#include "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 workstations_v1_internal { @@ -485,3 +489,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workstations_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workstations/v1/internal/workstations_metadata_decorator.h b/google/cloud/workstations/v1/internal/workstations_metadata_decorator.h index 0bec415e3e417..fe15e41e7bcf8 100644 --- a/google/cloud/workstations/v1/internal/workstations_metadata_decorator.h +++ b/google/cloud/workstations/v1/internal/workstations_metadata_decorator.h @@ -22,11 +22,14 @@ #include "google/cloud/workstations/v1/internal/workstations_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" -#include +#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 workstations_v1_internal { @@ -283,4 +286,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKSTATIONS_V1_INTERNAL_WORKSTATIONS_METADATA_DECORATOR_H diff --git a/google/cloud/workstations/v1/internal/workstations_option_defaults.cc b/google/cloud/workstations/v1/internal/workstations_option_defaults.cc index 9ef4fe79cffcc..b0a75dc5ff948 100644 --- a/google/cloud/workstations/v1/internal/workstations_option_defaults.cc +++ b/google/cloud/workstations/v1/internal/workstations_option_defaults.cc @@ -41,7 +41,7 @@ Options WorkstationsDefaultOptions(Options options) { if (!options.has()) { options.set( workstations_v1::WorkstationsLimitedTimeRetryPolicy( - std::chrono::minutes(30)) + std::chrono::minutes(10)) .clone()); } if (!options.has()) { diff --git a/google/cloud/workstations/v1/internal/workstations_stub.cc b/google/cloud/workstations/v1/internal/workstations_stub.cc index c99b1da839ea1..32dcbb7f866bf 100644 --- a/google/cloud/workstations/v1/internal/workstations_stub.cc +++ b/google/cloud/workstations/v1/internal/workstations_stub.cc @@ -17,13 +17,16 @@ // source: google/cloud/workstations/v1/workstations.proto #include "google/cloud/workstations/v1/internal/workstations_stub.h" +#include "google/cloud/workstations/v1/workstations.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workstations_v1_internal { @@ -636,3 +639,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workstations_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workstations/v1/internal/workstations_stub.h b/google/cloud/workstations/v1/internal/workstations_stub.h index eb598f16277f0..93c35ed6b9afa 100644 --- a/google/cloud/workstations/v1/internal/workstations_stub.h +++ b/google/cloud/workstations/v1/internal/workstations_stub.h @@ -19,17 +19,20 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKSTATIONS_V1_INTERNAL_WORKSTATIONS_STUB_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKSTATIONS_V1_INTERNAL_WORKSTATIONS_STUB_H +#include "google/cloud/workstations/v1/workstations.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 -#include -#include +#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 workstations_v1_internal { @@ -535,4 +538,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKSTATIONS_V1_INTERNAL_WORKSTATIONS_STUB_H diff --git a/google/cloud/workstations/v1/internal/workstations_stub_factory.cc b/google/cloud/workstations/v1/internal/workstations_stub_factory.cc index f0ef4131e6dbe..8d2181bede69d 100644 --- a/google/cloud/workstations/v1/internal/workstations_stub_factory.cc +++ b/google/cloud/workstations/v1/internal/workstations_stub_factory.cc @@ -22,18 +22,21 @@ #include "google/cloud/workstations/v1/internal/workstations_metadata_decorator.h" #include "google/cloud/workstations/v1/internal/workstations_stub.h" #include "google/cloud/workstations/v1/internal/workstations_tracing_stub.h" +#include "google/cloud/workstations/v1/workstations.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 -#include -#include +#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 workstations_v1_internal { @@ -73,3 +76,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workstations_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workstations/v1/internal/workstations_stub_factory.h b/google/cloud/workstations/v1/internal/workstations_stub_factory.h index 04d4952070a6c..691b83e20a3c3 100644 --- a/google/cloud/workstations/v1/internal/workstations_stub_factory.h +++ b/google/cloud/workstations/v1/internal/workstations_stub_factory.h @@ -25,6 +25,9 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workstations_v1_internal { @@ -39,4 +42,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKSTATIONS_V1_INTERNAL_WORKSTATIONS_STUB_FACTORY_H diff --git a/google/cloud/workstations/v1/internal/workstations_tracing_connection.cc b/google/cloud/workstations/v1/internal/workstations_tracing_connection.cc index 57189684bc4c2..110a501e40933 100644 --- a/google/cloud/workstations/v1/internal/workstations_tracing_connection.cc +++ b/google/cloud/workstations/v1/internal/workstations_tracing_connection.cc @@ -27,8 +27,6 @@ namespace cloud { namespace workstations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - WorkstationsTracingConnection::WorkstationsTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} @@ -541,16 +539,12 @@ Status WorkstationsTracingConnection::CancelOperation( return internal::EndSpan(*span, child_->CancelOperation(request)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeWorkstationsTracingConnection( std::shared_ptr conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY if (internal::TracingEnabled(conn->options())) { conn = std::make_shared(std::move(conn)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return conn; } diff --git a/google/cloud/workstations/v1/internal/workstations_tracing_connection.h b/google/cloud/workstations/v1/internal/workstations_tracing_connection.h index d66c537e5bc53..ad8b4a6be96af 100644 --- a/google/cloud/workstations/v1/internal/workstations_tracing_connection.h +++ b/google/cloud/workstations/v1/internal/workstations_tracing_connection.h @@ -28,8 +28,6 @@ namespace cloud { namespace workstations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class WorkstationsTracingConnection : public workstations_v1::WorkstationsConnection { public: @@ -256,8 +254,6 @@ class WorkstationsTracingConnection std::shared_ptr child_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Conditionally applies the tracing decorator to the given connection. * diff --git a/google/cloud/workstations/v1/internal/workstations_tracing_stub.cc b/google/cloud/workstations/v1/internal/workstations_tracing_stub.cc index 9af897260429a..226ff2d337481 100644 --- a/google/cloud/workstations/v1/internal/workstations_tracing_stub.cc +++ b/google/cloud/workstations/v1/internal/workstations_tracing_stub.cc @@ -21,13 +21,14 @@ #include #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workstations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - WorkstationsTracingStub::WorkstationsTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} @@ -574,18 +575,14 @@ future WorkstationsTracingStub::AsyncCancelOperation( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - std::shared_ptr MakeWorkstationsTracingStub( std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY return std::make_shared(std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace workstations_v1_internal } // namespace cloud } // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workstations/v1/internal/workstations_tracing_stub.h b/google/cloud/workstations/v1/internal/workstations_tracing_stub.h index 40a27f78db463..400e1f2adbe94 100644 --- a/google/cloud/workstations/v1/internal/workstations_tracing_stub.h +++ b/google/cloud/workstations/v1/internal/workstations_tracing_stub.h @@ -25,13 +25,14 @@ #include "google/cloud/version.h" #include +// Must be included last. +#include "google/cloud/ports_def.inc" + namespace google { namespace cloud { namespace workstations_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - class WorkstationsTracingStub : public WorkstationsStub { public: ~WorkstationsTracingStub() override = default; @@ -273,8 +274,6 @@ class WorkstationsTracingStub : public WorkstationsStub { propagator_; }; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - /** * Applies the tracing decorator to the given stub. * @@ -289,4 +288,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace cloud } // namespace google +#include "google/cloud/ports_undef.inc" + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKSTATIONS_V1_INTERNAL_WORKSTATIONS_TRACING_STUB_H diff --git a/google/cloud/workstations/v1/workstations_client.h b/google/cloud/workstations/v1/workstations_client.h index fd61e4adcf87d..5f63a6c9c9502 100644 --- a/google/cloud/workstations/v1/workstations_client.h +++ b/google/cloud/workstations/v1/workstations_client.h @@ -26,7 +26,7 @@ #include "google/cloud/polling_policy.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -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/google/cloud/workstations/v1/workstations_connection.h b/google/cloud/workstations/v1/workstations_connection.h index 13bee4cc6a66d..02cc1d3532a38 100644 --- a/google/cloud/workstations/v1/workstations_connection.h +++ b/google/cloud/workstations/v1/workstations_connection.h @@ -20,6 +20,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKSTATIONS_V1_WORKSTATIONS_CONNECTION_H #include "google/cloud/workstations/v1/internal/workstations_retry_traits.h" +#include "google/cloud/workstations/v1/workstations.pb.h" #include "google/cloud/workstations/v1/workstations_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/future.h" @@ -30,8 +31,7 @@ #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" -#include -#include +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { diff --git a/google/cloud/workstations/v1/workstations_connection_idempotency_policy.h b/google/cloud/workstations/v1/workstations_connection_idempotency_policy.h index 53effe4e3ee9b..0dcb30455e146 100644 --- a/google/cloud/workstations/v1/workstations_connection_idempotency_policy.h +++ b/google/cloud/workstations/v1/workstations_connection_idempotency_policy.h @@ -19,11 +19,11 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKSTATIONS_V1_WORKSTATIONS_CONNECTION_IDEMPOTENCY_POLICY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKSTATIONS_V1_WORKSTATIONS_CONNECTION_IDEMPOTENCY_POLICY_H +#include "google/cloud/workstations/v1/workstations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include -#include -#include +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { 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", ] diff --git a/protos/BUILD.bazel b/protos/BUILD.bazel index a63e71f57ffd6..63e2ffb14e350 100644 --- a/protos/BUILD.bazel +++ b/protos/BUILD.bazel @@ -16,13 +16,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 -cc_library( - name = "system_includes", - includes = ["."], - visibility = [ - "//google/cloud/bigtable/test_proxy:__pkg__", - "//google/cloud/compute:__pkg__", - "//google/cloud/spanner:__subpackages__", - "//google/cloud/storage/tests:__pkg__", - ], -) +#cc_library( +# name = "system_includes", +# includes = ["."], +# visibility = [ +# "//google/cloud/bigtable/test_proxy:__pkg__", +# "//google/cloud/compute:__pkg__", +# "//google/cloud/spanner:__subpackages__", +# "//google/cloud/storage/tests:__pkg__", +# ], +#) diff --git a/protos/google/cloud/bigtable/test_proxy/BUILD.bazel b/protos/google/cloud/bigtable/test_proxy/BUILD.bazel index 4982da5c8a0ad..a046c420483cb 100644 --- a/protos/google/cloud/bigtable/test_proxy/BUILD.bazel +++ b/protos/google/cloud/bigtable/test_proxy/BUILD.bazel @@ -12,12 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -load( - "@com_google_googleapis_imports//:imports.bzl", - "cc_grpc_library", - "cc_proto_library", -) -load("@rules_proto//proto:defs.bzl", "proto_library") +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") package(default_visibility = ["//visibility:private"]) @@ -29,11 +26,11 @@ proto_library( name = "test_proxy_proto", srcs = ["test_proxy.proto"], deps = [ - "@com_google_googleapis//google/api:client_proto", - "@com_google_googleapis//google/bigtable/v2:bigtable_proto", - "@com_google_googleapis//google/rpc:status_proto", "@com_google_protobuf//:descriptor_proto", "@com_google_protobuf//:duration_proto", + "@googleapis//google/api:client_proto", + "@googleapis//google/bigtable/v2:bigtable_proto", + "@googleapis//google/rpc:status_proto", ], ) diff --git a/protos/google/cloud/compute/BUILD.bazel b/protos/google/cloud/compute/BUILD.bazel index 1cc9073df5b2c..04e17e09fb1eb 100644 --- a/protos/google/cloud/compute/BUILD.bazel +++ b/protos/google/cloud/compute/BUILD.bazel @@ -12,11 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -load( - "@com_google_googleapis_imports//:imports.bzl", - "cc_proto_library", -) -load("@rules_proto//proto:defs.bzl", "proto_library") +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") load("//google/cloud/compute:service_dirs.bzl", "operation_service_dirs", "service_dirs") package(default_visibility = ["//visibility:private"]) @@ -46,15 +43,15 @@ proto_library( "//google/cloud/compute:__pkg__", ], deps = [ - "@com_google_googleapis//google/api:annotations_proto", - "@com_google_googleapis//google/api:client_proto", - "@com_google_googleapis//google/api:field_behavior_proto", - "@com_google_googleapis//google/api:http_proto", - "@com_google_googleapis//google/api:resource_proto", - "@com_google_googleapis//google/api:routing_proto", - "@com_google_googleapis//google/cloud:extended_operations_proto", "@com_google_protobuf//:any_proto", "@com_google_protobuf//:empty_proto", + "@googleapis//google/api:annotations_proto", + "@googleapis//google/api:client_proto", + "@googleapis//google/api:field_behavior_proto", + "@googleapis//google/api:http_proto", + "@googleapis//google/api:resource_proto", + "@googleapis//google/api:routing_proto", + "@googleapis//google/cloud:extended_operations_proto", ], ) diff --git a/protos/google/cloud/spanner/testing/BUILD.bazel b/protos/google/cloud/spanner/testing/BUILD.bazel index 59fd7848c02f9..fe4766481f59f 100644 --- a/protos/google/cloud/spanner/testing/BUILD.bazel +++ b/protos/google/cloud/spanner/testing/BUILD.bazel @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") + package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 diff --git a/protos/google/cloud/storage/tests/BUILD.bazel b/protos/google/cloud/storage/tests/BUILD.bazel index f3f70add7cbf2..4bb25803c5928 100644 --- a/protos/google/cloud/storage/tests/BUILD.bazel +++ b/protos/google/cloud/storage/tests/BUILD.bazel @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") + package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 diff --git a/vcpkg.json b/vcpkg.json index 9580c28496fcc..3cd53f101d516 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -6,7 +6,6 @@ "supports": "!uwp", "dependencies": [ "abseil", - "crc32c", { "name": "curl", "features": [ @@ -32,10 +31,7 @@ "nlohmann-json", "benchmark", "gtest", - { - "$description": "Only used for the opentelemetry feature.", - "name": "opentelemetry-cpp" - }, + "opentelemetry-cpp", { "$description": "Only used for the docfx feature.", "name": "pugixml"